/*
 * jshub.cc: AB-1 Tactile Bento Workbench & Keycap Identity.
 * Tokens and rules are documented in DESIGN.md. Change them there first.
 */

:root {
  /* surfaces */
  --paper: oklch(0.962 0.01 88);
  --card: oklch(0.992 0.004 88);
  --surface-dark: oklch(0.19 0.016 260);
  --surface-warm: oklch(0.978 0.014 88);
  --rule: oklch(0.86 0.012 88);

  /* accents & ink */
  --margin: oklch(0.55 0.20 34);
  --margin-red: oklch(0.55 0.20 34);
  --accent: oklch(0.55 0.20 34);
  --graphite: oklch(0.19 0.015 260);
  --muted: oklch(0.46 0.015 260);
  --ink: oklch(0.45 0.18 262);
  --ink-soft: oklch(0.45 0.18 262 / 0.10);
  --ink-dash: oklch(0.19 0.015 260 / 0.22);
  --hl: oklch(0.91 0.16 102);
  --hl-soft: oklch(0.91 0.16 102 / 0.18);

  /* status */
  --live: oklch(0.49 0.15 150);
  --beta: oklch(0.48 0.15 240);
  --dev: oklch(0.56 0.15 58);
  --idea: oklch(0.48 0.015 260);

  /* typography */
  --sans: "Bricolage Grotesque", "Anuphan", system-ui, sans-serif;
  --thai: "Anuphan", "Bricolage Grotesque", system-ui, sans-serif;
  --hand: "JetBrains Mono", ui-monospace, monospace;
  --mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;

  /* layout & motion */
  --line: 1.65rem;
  --gutter: 7rem;
  --section: 2.5rem;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

* {
  margin: 0;
  padding: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: var(--sans);
  font-size: 0.98rem;
  line-height: 1.6;
  color: var(--graphite);
  background-color: var(--paper);
  background-image: radial-gradient(oklch(0.19 0.015 260 / 0.10) 1px, transparent 1px);
  background-size: 18px 18px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  padding: 1.5rem 1.25rem 3.5rem;
}

:lang(th) {
  font-family: var(--thai);
}

a {
  color: var(--ink);
}

:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
  border-radius: 4px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 100;
  background: var(--graphite);
  color: var(--card);
  padding: 0.45rem 1rem;
  border-radius: 6px;
  font-family: var(--mono);
  font-size: 0.82rem;
  text-decoration: none;
}

.skip-link:focus {
  top: 1rem;
}

/* ==========================================================================
   AB-1 PUBLIC WORKBENCH SHELL (2-Pane: Left Sidebar + Right Bento Area)
   ========================================================================== */

.page {
  max-width: 1200px;
  margin: 0 auto;
}

.ab-shell {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  background: var(--paper);
  border: 1.5px solid var(--graphite);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 8px 0 oklch(0.19 0.015 260 / 0.08);
}

.ab-sidebar {
  background: var(--card);
  border-right: 1.5px solid var(--graphite);
  padding: 1.75rem 1.5rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 2rem;
}

.ab-sidebar-top {
  display: flex;
  flex-direction: column;
}

.ab-sidebar .top {
  display: block;
  height: auto;
  padding-bottom: 1.25rem;
  border-bottom: 1px dashed var(--rule);
}

.logo {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.3rem;
  color: inherit;
  text-decoration: none;
}

.logo img {
  display: block;
  width: auto;
  height: 2.75rem;
}

.logo span {
  font-family: var(--mono);
  font-size: 0.76rem;
  color: var(--muted);
  letter-spacing: 0.01em;
}

/* Sidebar Hero & Intro */
.ab-hero {
  margin-top: 1.5rem;
}

.ab-hero h1 {
  font-size: clamp(1.6rem, 2.4vw, 1.95rem);
  font-weight: 800;
  line-height: 1.06;
  letter-spacing: -0.035em;
  color: var(--graphite);
  margin-bottom: 0.65rem;
}

.ab-hero .lede {
  font-size: 0.88rem;
  line-height: 1.55;
  color: var(--muted);
  margin: 0;
}

.ab-hero .lede strong {
  color: var(--graphite);
  font-weight: 600;
}

.ab-hero .lede code {
  font-family: var(--mono);
  font-size: 0.82rem;
  color: var(--graphite);
}

/* Sidebar Filter Navigation & Tally */
.ab-filter-section {
  margin-top: 1.75rem;
}

.ab-filter-label {
  font-family: var(--mono);
  font-size: 0.74rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  margin-bottom: 0.5rem;
}

.filters,
.ab-subnav {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.filters[hidden] {
  display: none;
}

.ab-subnav {
  margin-top: 1.25rem;
}

.ab-nav-pill,
.filters button {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  padding: 0.45rem 0.75rem;
  border-radius: 7px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  font-family: var(--sans);
  font-size: 0.84rem;
  font-weight: 500;
  line-height: 1.3;
  cursor: pointer;
  text-align: left;
  text-decoration: none;
  transition: background-color 0.15s var(--ease-out), color 0.15s var(--ease-out);
}

.ab-nav-pill:hover,
.filters button:hover {
  color: var(--graphite);
  background: oklch(0.19 0.015 260 / 0.05);
}

.ab-nav-pill[aria-pressed="true"],
.filters button[aria-pressed="true"] {
  background: var(--graphite);
  color: var(--card);
  font-weight: 700;
}

.pill-count {
  font-family: var(--mono);
  font-size: 0.75rem;
  opacity: 0.85;
}

.tally {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  margin-top: 0.65rem;
  padding: 0.65rem 0.75rem;
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 8px;
}

.tally-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.82rem;
  color: var(--muted);
}

.tally-row b {
  font-family: var(--mono);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--graphite);
}

/* Sidebar Maker Dock */
.ab-maker {
  border-top: 1px dashed var(--rule);
  padding-top: 1.25rem;
}

.ab-maker-kicker {
  font-family: var(--mono);
  font-size: 0.74rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  margin-bottom: 0.25rem;
}

.ab-maker .sig {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--graphite);
  margin-bottom: 0.25rem;
}

.ab-maker .bio {
  font-size: 0.82rem;
  line-height: 1.5;
  color: var(--muted);
  margin-bottom: 0.85rem;
}

.ab-maker .bio em {
  font-style: normal;
  color: var(--graphite);
  font-weight: 600;
}

.ab-maker .links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 0.75rem;
  font-family: var(--mono);
  font-size: 0.75rem;
  font-weight: 700;
}

.ab-maker .links a {
  color: var(--ink);
  text-decoration: none;
}

.ab-maker .links a:hover {
  text-decoration: underline;
}

.ab-maker .foot-meta {
  margin-top: 0.85rem;
  font-family: var(--mono);
  font-size: 0.74rem;
  color: var(--muted);
}

.ab-maker .foot-meta a {
  color: var(--muted);
  text-decoration: none;
}

.ab-maker .foot-meta a:hover {
  color: var(--graphite);
  text-decoration: underline;
}

/* ==========================================================================
   RIGHT PANE: 12-COLUMN ASYMMETRIC BENTO GRID
   ========================================================================== */

.ab-main {
  min-width: 0;
}

.ab-bento {
  padding: 1.25rem;
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 1rem;
  align-content: start;
}

.ab-tile {
  background: var(--card);
  border: 1.5px solid var(--graphite);
  border-radius: 12px;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: transform 0.15s var(--ease-out), box-shadow 0.15s var(--ease-out);
}

.ab-tile-interactive:hover {
  transform: translateY(-2px);
  box-shadow: 4px 4px 0 var(--graphite);
}

.span-12 { grid-column: span 12; }
.span-8  { grid-column: span 8; }
.span-4  { grid-column: span 4; }

/* ---------- Status Indicator (Word + Shape + Color) ---------- */

.st {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--mono);
  font-size: 0.76rem;
  font-weight: 700;
  white-space: nowrap;
}

.st::before {
  content: "";
  width: 0.55rem;
  height: 0.55rem;
  flex: none;
  border: 2px solid currentColor;
  border-radius: 50%;
}

.st--live { color: var(--live); }
.st--live::before { background: currentColor; }
.st--beta { color: var(--beta); }
.st--beta::before { background: linear-gradient(90deg, currentColor 50%, transparent 50%); }
.st--in-development { color: var(--dev); }
.st--in-development::before { border-style: dashed; }
.st--concept { color: var(--idea); }
.st--concept::before { border-style: dotted; }

/* ---------- Pinned Flagship Pair (8 cols Dark + 4 cols Companion) ---------- */

.pinned {
  grid-column: span 8;
  background: var(--surface-dark);
  color: var(--card);
  border: 1.5px solid var(--graphite);
  border-radius: 12px;
  padding: 1.65rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 1.35rem;
  box-shadow: 4px 4px 0 var(--accent);
}

.pinned .st--live {
  color: oklch(0.78 0.16 150);
}

.pinned-top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.85rem;
}

.pin-badge {
  background: var(--accent);
  color: var(--card);
  font-family: var(--mono);
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 0.18rem 0.55rem;
  border-radius: 4px;
}

.p-name {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.4rem 0.75rem;
  margin-bottom: 0.35rem;
}

.p-name h2 {
  font-size: clamp(2.1rem, 3.8vw, 3rem);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.04em;
}

.p-name h2 a {
  color: inherit;
  text-decoration: none;
}

.p-name h2 a:hover {
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-underline-offset: 5px;
}

.native {
  font-family: var(--thai);
  font-weight: 600;
}

.p-name .native {
  font-size: 1.3rem;
  opacity: 0.78;
  line-height: 1.4;
}

.pinned .tagline {
  font-size: 1.08rem;
  font-weight: 600;
  line-height: 1.4;
  margin-bottom: 0.4rem;
}

.pinned .desc {
  font-size: 0.88rem;
  line-height: 1.55;
  opacity: 0.8;
  max-width: 58ch;
}

/* Command Box */
.cmd {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  min-height: 2.85rem;
  padding: 0.45rem 0.5rem 0.45rem 0.85rem;
  background: var(--paper);
  color: var(--graphite);
  border: 1.5px solid var(--graphite);
  border-radius: 7px;
  font-family: var(--mono);
  font-size: 0.8rem;
}

.pinned .cmd {
  background: oklch(0.13 0.015 260);
  color: var(--card);
  border-color: oklch(0.34 0.02 260);
}

.cmd code {
  min-width: 0;
  overflow-x: auto;
  white-space: nowrap;
  scrollbar-width: none;
}

.cmd code::before {
  content: "$ ";
  color: var(--accent);
  font-weight: 700;
  user-select: none;
}

.copy {
  flex: none;
  height: 2rem;
  padding: 0 0.75rem;
  border: 0;
  border-radius: 4px;
  background: var(--accent);
  color: var(--card);
  font: 700 0.75rem var(--mono);
  cursor: pointer;
  transition: transform 0.15s var(--ease-out), background-color 0.15s var(--ease-out);
}

.copy:hover {
  transform: translateY(-1px);
}

.copy.is-done {
  background: var(--live);
}

/* Pinned Companion Tile (4 cols) */
.pinned-companion {
  background: var(--surface-warm);
}

.companion-kicker {
  font-family: var(--mono);
  font-size: 0.74rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  margin-bottom: 0.75rem;
}

.route-box {
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: 6px;
  padding: 0.55rem 0.7rem;
  margin-bottom: 0.85rem;
  font-family: var(--mono);
}

.route-label {
  display: block;
  font-size: 0.7rem;
  color: var(--muted);
}

.route-val {
  display: block;
  font-size: 0.78rem;
  color: var(--graphite);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pinned-companion .tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.pinned-companion .tags span {
  background: var(--card);
  border: 1px solid var(--rule);
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  font-family: var(--mono);
  font-size: 0.74rem;
  color: var(--graphite);
}

.pinned-companion .go {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  margin-top: 1.25rem;
  font-family: var(--mono);
  font-size: 0.78rem;
  font-weight: 700;
}

.btn-bento-primary {
  display: block;
  background: var(--ink);
  color: var(--card);
  text-align: center;
  padding: 0.55rem 0.75rem;
  border-radius: 6px;
  text-decoration: none;
  transition: transform 0.15s var(--ease-out);
}

.btn-bento-primary:hover {
  transform: translateY(-1px);
}

.btn-bento-secondary {
  display: block;
  background: var(--card);
  color: var(--graphite);
  border: 1px solid var(--graphite);
  text-align: center;
  padding: 0.45rem 0.75rem;
  border-radius: 6px;
  text-decoration: none;
}

.btn-bento-secondary:hover {
  background: var(--ink-soft);
}

/* ---------- Projects Bento Directory (ol.toc) ---------- */

.bento-sec-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0.35rem 0.25rem 0.85rem;
}

.bento-sec-title-group {
  display: flex;
  align-items: baseline;
  gap: 0.55rem;
}

.sec-kicker {
  font-family: var(--mono);
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--accent);
}

.sec {
  display: inline-flex;
  align-items: baseline;
  gap: 0.6rem;
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.sec small {
  font-family: var(--mono);
  font-size: 0.76rem;
  font-weight: 500;
  color: var(--muted);
}

.bento-sec-label {
  font-family: var(--mono);
  font-size: 0.74rem;
  color: var(--muted);
}

.toc {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
}

.toc li[hidden] {
  display: none;
}

.tile-top-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.65rem;
  font-family: var(--mono);
  font-size: 0.75rem;
}

.toc .n {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--muted);
}

.toc .name {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin-bottom: 0.35rem;
  overflow-wrap: anywhere;
}

.toc .name a {
  color: var(--graphite);
  text-decoration: none;
}

.toc .name a:hover {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 4px;
}

.toc .name .native {
  margin-left: 0.35rem;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--muted);
}

.toc .what p {
  font-size: 0.88rem;
  line-height: 1.5;
  color: var(--muted);
}

.tile-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  margin-top: 1.25rem;
  padding-top: 0.75rem;
  border-top: 1px dashed var(--rule);
  font-family: var(--mono);
  font-size: 0.75rem;
}

.tile-foot .tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.74rem;
}

.toc .lnk {
  flex: none;
  font-family: var(--mono);
  font-size: 0.76rem;
}

.toc .lnk a {
  color: var(--ink);
  font-weight: 700;
  text-decoration: none;
}

.toc .lnk a:hover {
  text-decoration: underline;
}

.toc .lnk .none {
  color: var(--muted);
}

.empty {
  text-align: center;
  padding: 2.5rem 1.5rem;
  font-family: var(--mono);
  font-size: 0.85rem;
  color: var(--muted);
}

/* ==========================================================================
   PROJECT DETAIL & LEGAL BENTO PAGES
   ========================================================================== */

.detail-card,
.legal.prose {
  padding: 2rem 2.25rem;
}

.detail-top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  padding-bottom: 1rem;
  margin-bottom: 1.5rem;
  border-bottom: 1px dashed var(--rule);
}

.detail-order {
  font-family: var(--mono);
  font-size: 0.76rem;
  color: var(--muted);
}

.project-detail .crumbs {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--muted);
}

.project-detail .crumbs a {
  color: var(--muted);
  text-decoration: none;
}

.project-detail .crumbs a:hover {
  color: var(--ink);
  text-decoration: underline;
}

.project-detail .crumbs .sep {
  color: var(--ink-dash);
}

.project-detail .crumbs .current {
  color: var(--graphite);
  font-weight: 700;
}

.project-detail .category-chip {
  display: inline-block;
  font-family: var(--mono);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--accent);
  background: oklch(0.55 0.20 34 / 0.1);
  padding: 0.15rem 0.55rem;
  border-radius: 4px;
  margin-bottom: 0.65rem;
}

.project-detail .proj-title-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.65rem 1.15rem;
}

.project-detail .proj-title {
  font-size: clamp(2.2rem, 4.5vw, 3.25rem);
  line-height: 1.05;
  font-weight: 800;
  letter-spacing: -0.04em;
  color: var(--graphite);
}

.project-detail .proj-title-row .native {
  font-size: 1.5rem;
  color: var(--muted);
}

.project-detail .proj-tagline {
  font-size: 1.2rem;
  font-weight: 600;
  line-height: 1.45;
  color: var(--graphite);
  margin-top: 0.65rem;
  max-width: 58ch;
}

.project-detail .actions-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.project-detail .cmd-box {
  margin-top: 1.5rem;
  max-width: 58ch;
}

.project-detail .desc-block {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px dashed var(--rule);
  max-width: 62ch;
}

.project-detail .desc-block h2 {
  font-family: var(--mono);
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  margin-bottom: 0.6rem;
}

.project-detail .desc-block .desc-text {
  font-size: 0.98rem;
  line-height: 1.65;
  color: var(--graphite);
  white-space: pre-line;
}

.project-detail .tags-section {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 1.75rem;
}

.project-detail .tag-item {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--graphite);
  background: var(--paper);
  border: 1px solid var(--rule);
  padding: 0.2rem 0.55rem;
  border-radius: 4px;
}

.project-detail .tag-item::before {
  content: "#";
  color: var(--accent);
}

/* Legal Prose */
.prose h1 {
  font-size: clamp(2rem, 4vw, 2.75rem);
  line-height: 1.1;
  font-weight: 800;
  letter-spacing: -0.035em;
  margin-bottom: 0.5rem;
}

.prose .updated {
  font-family: var(--mono);
  font-size: 0.76rem;
  color: var(--muted);
}

.prose section {
  margin-top: 1.75rem;
  max-width: 66ch;
}

.prose h2 {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 0.4rem;
}

.prose p,
.prose ul {
  color: var(--graphite);
  font-size: 0.95rem;
  line-height: 1.65;
}

.prose ul {
  padding-left: 1.4rem;
  margin-top: 0.4rem;
}

.prose .back {
  margin-top: 2.25rem;
  padding-top: 1rem;
  border-top: 1px dashed var(--rule);
  font-family: var(--mono);
  font-size: 0.82rem;
  font-weight: 700;
}

/* ==========================================================================
   ADMIN LAYOUT, BUTTONS, FORMS & TABLES
   ========================================================================== */

.row {
  display: grid;
  grid-template-columns: var(--gutter) minmax(0, 1fr);
  background: var(--card);
  border: 1.5px solid var(--graphite);
  border-radius: 12px;
  padding: 1.75rem;
  margin-top: 1rem;
}

.gutter {
  font-family: var(--mono);
  color: var(--accent);
  padding-right: 1.5rem;
}

.gutter .num {
  display: block;
  font-size: 1.5rem;
  font-weight: 800;
}

.gutter .hand {
  display: block;
  font-size: 0.78rem;
  color: var(--muted);
  text-transform: uppercase;
}

.body {
  min-width: 0;
}

header.top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  padding: 1rem 1.5rem;
  background: var(--card);
  border: 1.5px solid var(--graphite);
  border-radius: 12px;
}

.ab-sidebar header.top {
  border: 0;
  border-bottom: 1px dashed var(--rule);
  border-radius: 0;
  padding: 0 0 1.25rem;
  background: transparent;
}

.admin-nav {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 1.25rem;
}

.admin-nav a {
  color: var(--graphite);
  font-family: var(--mono);
  font-size: 0.84rem;
  font-weight: 600;
  text-decoration: none;
}

.admin-nav a:hover {
  color: var(--ink);
  text-decoration: underline;
}

.breadcrumbs,
.admin-breadcrumbs {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--muted);
}

.breadcrumbs a,
.admin-breadcrumbs a {
  color: var(--muted);
  text-decoration: none;
}

.btn-signout {
  background: transparent;
  border: 1px solid var(--rule);
  border-radius: 5px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.78rem;
  padding: 0.3rem 0.65rem;
  cursor: pointer;
}

.btn-signout:hover {
  color: var(--accent);
  border-color: var(--accent);
}

.header-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.header-actions h1 {
  font-size: 1.85rem;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.btn-ink {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 2.4rem;
  padding: 0 1.15rem;
  border: 0;
  border-radius: 6px;
  background: var(--ink);
  color: var(--card);
  font-family: var(--mono);
  font-size: 0.82rem;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.15s var(--ease-out);
}

.btn-ink:hover {
  transform: translateY(-1px);
}

.btn-danger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 2.2rem;
  padding: 0 0.9rem;
  border: 0;
  border-radius: 6px;
  background: var(--accent);
  color: var(--card);
  font-family: var(--mono);
  font-size: 0.8rem;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}

.btn-subtle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 2.2rem;
  padding: 0 0.8rem;
  border: 1.5px solid var(--graphite);
  border-radius: 6px;
  background: var(--card);
  color: var(--graphite);
  font-family: var(--mono);
  font-size: 0.8rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}

.btn-subtle:hover {
  background: var(--ink-soft);
}

.btn-move {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.8rem;
  height: 1.6rem;
  border: 1px solid var(--rule);
  border-radius: 4px;
  background: var(--paper);
  color: var(--graphite);
  font-family: var(--mono);
  font-size: 0.82rem;
  cursor: pointer;
}

.move-controls {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

/* Forms */
.form-group {
  margin-bottom: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.form-group label {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--graphite);
}

.form-hint {
  font-size: 0.82rem;
  color: var(--muted);
}

.form-input,
.form-select,
.form-textarea {
  display: block;
  width: 100%;
  background-color: var(--paper);
  color: var(--graphite);
  border: 1.5px solid var(--graphite);
  border-radius: 6px;
  font-family: var(--sans);
  font-size: 0.92rem;
}

.form-input,
.form-select {
  height: 2.85rem;
  padding: 0 0.85rem;
}

.form-input[name="slug"],
.form-input[name="url"],
.form-input[name="source_url"],
.form-input[name="install_cmd"],
.form-input[name="tags"],
.form-input[name="sort_order"],
.form-input[type="number"],
.form-input.is-mono {
  font-family: var(--mono);
  font-size: 0.85rem;
}

.form-textarea {
  min-height: 6rem;
  padding: 0.7rem 0.85rem;
  resize: vertical;
}

.form-checkbox,
.form-group label:has(input[type="checkbox"]) {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-weight: 500;
  cursor: pointer;
}

.form-error {
  color: var(--accent);
  font-size: 0.84rem;
  font-weight: 600;
  margin-top: 0.25rem;
}

.callout-error,
.form-errors {
  padding: 0.85rem 1.1rem;
  border: 1.5px solid var(--accent);
  border-radius: 8px;
  background: oklch(0.55 0.20 34 / 0.08);
  color: var(--accent);
  font-size: 0.9rem;
  margin-bottom: 1.25rem;
}

.callout-notice,
.callout-success {
  padding: 0.85rem 1.1rem;
  border: 1.5px solid var(--live);
  border-radius: 8px;
  background: oklch(0.49 0.15 150 / 0.08);
  color: var(--live);
  font-size: 0.9rem;
  margin-bottom: 1.25rem;
}

.paper-card {
  max-width: 28rem;
  padding: 2rem;
  background: var(--card);
  border: 1.5px solid var(--graphite);
  border-radius: 12px;
  box-shadow: 4px 4px 0 var(--graphite);
}

.form-actions {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  margin-top: 1.5rem;
}

/* Admin Table */
.admin-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 0.75rem;
  font-size: 0.92rem;
}

.admin-table th {
  font-family: var(--mono);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  text-align: left;
  padding: 0.7rem 0.6rem;
  border-bottom: 1.5px solid var(--graphite);
}

.admin-table td {
  padding: 0.75rem 0.6rem;
  border-bottom: 1px dashed var(--rule);
  vertical-align: middle;
}

.admin-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.tag {
  display: inline-block;
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--muted);
  margin-right: 0.35rem;
}

.draft {
  font-family: var(--mono);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--accent);
}

details.inline-confirm {
  display: inline-block;
}

details.inline-confirm summary {
  display: inline-flex;
  align-items: center;
  font-family: var(--mono);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--accent);
  cursor: pointer;
  list-style: none;
  padding: 0.2rem 0.4rem;
}

details.inline-confirm summary::-webkit-details-marker {
  display: none;
}

details.inline-confirm form {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.3rem 0.55rem;
  background: var(--paper);
  border: 1.5px solid var(--accent);
  border-radius: 6px;
}

/* ==========================================================================
   RESPONSIVE BREAKPOINTS
   ========================================================================== */

@media (max-width: 960px) {
  .ab-shell {
    grid-template-columns: 1fr;
  }

  .ab-sidebar {
    border-right: 0;
    border-bottom: 1.5px solid var(--graphite);
  }

  .pinned,
  .span-8,
  .span-4 {
    grid-column: span 12;
  }

  .row {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
}

@media (max-width: 640px) {
  body {
    padding: 0.75rem 0.75rem 2.5rem;
  }

  .ab-bento {
    padding: 0.85rem;
  }

  .ab-tile,
  .pinned,
  .detail-card,
  .legal.prose {
    padding: 1.25rem;
  }

  .admin-table {
    display: block;
    overflow-x: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
  }
}
