/*
 * jikij.com v2 — dark-first, mobile-first, zero dependencies (no CDN, no
 * framework): system stack for body text, one self-hosted display face
 * (Bricolage Grotesque, OFL — assets/fonts/) for the brand and headings.
 * Custom properties, one grid.
 *
 * THEME MECHANICS (do not break — ThemeTokensTest enforces this):
 * dark tokens live on :root and ship color-scheme:dark; the LIGHT palette
 * appears in exactly two blocks that must stay token-for-token identical:
 *   1. @media (prefers-color-scheme: light) { :root:not([data-theme="dark"]) }
 *      → auto mode, system prefers light and the visitor hasn't forced dark;
 *   2. :root[data-theme="light"] → manual light.
 * To change a light value, edit BOTH blocks; if they drift the test fails.
 * assets/js/app.js (toggle) and app/Views/layout.php (pre-paint script,
 * theme-color metas) complete the tri-state auto/light/dark cycle.
 */

/* Display face for brand + headings only — body text stays on the system
   stack (perf, familiarity). Subset latin, one weight (800), 21 KB, self-
   hosted per the no-CDN house rule; license alongside in assets/fonts/. */
@font-face {
  font-family: "Bricolage Grotesque";
  src: url("../fonts/bricolage-grotesque-latin-800.woff2") format("woff2");
  font-weight: 800;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #141118;
  --surface: #1c1725;
  --surface-2: #251e31;
  --ink: #f1edf6;
  --ink-soft: #b3aac2;
  --line: #38304a;
  --accent: #ffb454;
  --accent-ink: #221603;
  --ok: #3ecf8e;
  --danger: #ff7a7a;
  --radius: 14px;
  --radius-small: 9px;
  --shadow: 0 8px 28px rgba(0, 0, 0, .45);
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --display: "Bricolage Grotesque", var(--sans);
  color-scheme: dark;
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #f7f3ee;
    --surface: #ffffff;
    --surface-2: #f1eae0;
    --ink: #262031;
    --ink-soft: #6f6581;
    --line: #e3dbcf;
    --accent: #9e5a00;
    --accent-ink: #ffffff;
    --ok: #14825a;
    --danger: #c22f2f;
    --shadow: 0 8px 28px rgba(60, 40, 10, .12);
    color-scheme: light;
  }
}

:root[data-theme="light"] {
  --bg: #f7f3ee;
  --surface: #ffffff;
  --surface-2: #f1eae0;
  --ink: #262031;
  --ink-soft: #6f6581;
  --line: #e3dbcf;
  --accent: #9e5a00;
  --accent-ink: #ffffff;
  --ok: #14825a;
  --danger: #c22f2f;
  --shadow: 0 8px 28px rgba(60, 40, 10, .12);
  color-scheme: light;
}

/* ------------------------------------------------------------------ base */

* { box-sizing: border-box; }

/* The hidden attribute must always win, even over class display rules
   (the delivery pitch is hidden="" until app.js reveals it after 15 s). */
[hidden] { display: none !important; }

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

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

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

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip {
  position: absolute;
  left: 8px; top: -48px;
  z-index: 100;
  padding: 8px 14px;
  background: var(--accent);
  color: var(--accent-ink);
  border-radius: var(--radius-small);
  transition: top .15s ease;
}
.skip:focus { top: 8px; text-decoration: none; }

/* ---------------------------------------------------------------- header */

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  max-width: 1080px;
  margin: 0 auto;
  padding: 12px 16px;
}

.brand {
  font-family: var(--display);
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: .06em;
  color: var(--ink);
}
.brand:hover { text-decoration: none; color: var(--accent); }

.site-nav { display: flex; align-items: center; gap: 14px; }
.site-nav a { color: var(--ink-soft); font-weight: 600; }
.site-nav a:hover { color: var(--ink); }

/* Tri-state toggle: auto (default) / light / dark, cycled by app.js.
   Exactly one icon shows per state. */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px; height: 36px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface);
  color: var(--ink-soft);
  cursor: pointer;
}
.theme-toggle:hover { color: var(--ink); border-color: var(--accent); }
.theme-toggle .ti-light, .theme-toggle .ti-dark { display: none; }
.theme-toggle[data-theme-state="light"] .ti-light { display: block; }
.theme-toggle[data-theme-state="light"] .ti-auto { display: none; }
.theme-toggle[data-theme-state="dark"] .ti-dark { display: block; }
.theme-toggle[data-theme-state="dark"] .ti-auto { display: none; }

/* ----------------------------------------------------------------- layout */

main { max-width: 1080px; margin: 0 auto; padding: 8px 16px 96px; }

.site-footer {
  max-width: 1080px;
  margin: 0 auto;
  padding: 24px 16px 40px;
  color: var(--ink-soft);
  font-size: .88rem;
  border-top: 1px solid var(--line);
}
.site-footer .fine { opacity: .75; margin-bottom: 0; }

/* ------------------------------------------------------------------ hero */

.hero { margin: 18px 0 20px; }
.hero h1 {
  font-family: var(--display);
  font-weight: 800;
  margin: 0 0 6px;
  font-size: clamp(1.55rem, 5vw, 2.3rem);
  line-height: 1.2;
}
.hero .tagline { margin: 0; color: var(--ink-soft); font-size: 1.02rem; }

/* The "take everything" banner (/tout and the delivery cross-sell). */
.buyall {
  display: block;
  margin: 18px 0;
  padding: 16px 18px;
  background: var(--surface);
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  color: var(--ink);
  box-shadow: var(--shadow);
}
.buyall:hover { text-decoration: none; border-color: var(--accent); transform: translateY(-1px); }
.buyall .ba-title { font-size: 1.12rem; font-weight: 800; color: var(--accent); }
.buyall .ba-price { font-size: 1.4rem; font-weight: 800; }
.buyall s { color: var(--ink-soft); font-weight: 600; }
.buyall .ba-sub { color: var(--ink-soft); font-size: .9rem; }

/* --------------------------------------------------------------- toolbar */

.toolbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
  margin-bottom: 16px;
}

.searchbox { position: relative; flex: 1 1 220px; max-width: 340px; }
.searchbox input {
  width: 100%;
  padding: 9px 40px 9px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  /* 16px, not .95rem: iOS Safari force-zooms the viewport on focus when an
     input's font is under 16px — the #1 mobile papercut. Same for every
     other form control below. */
  font-size: 16px;
}
.searchbox input::placeholder { color: var(--ink-soft); }
/* The native WebKit clear button would draw a second cross next to ours. */
.searchbox input[type="search"]::-webkit-search-cancel-button,
.searchbox input[type="search"]::-webkit-search-decoration {
  -webkit-appearance: none;
  appearance: none;
}
.searchbox .search-clear {
  position: absolute;
  right: 6px; top: 50%;
  transform: translateY(-50%);
  border: 0;
  background: var(--surface-2);
  color: var(--ink-soft);
  width: 26px; height: 26px;
  border-radius: 50%;
  cursor: pointer;
  display: none;
}
.searchbox.has-value .search-clear { display: block; }

.chip-row { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  padding: 6px 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  font-size: .86rem;
  font-weight: 600;
  cursor: pointer;
}
.chip:hover { border-color: var(--accent); }
.chip[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }

.result-count { color: var(--ink-soft); font-size: .86rem; margin-left: auto; }

.no-result {
  padding: 32px 16px;
  text-align: center;
  color: var(--ink-soft);
  display: none;
}
.no-result.visible { display: block; }

/* ------------------------------------------------------------------ wall */

.wall {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(146px, 1fr));
  gap: 14px;
}

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  transition: border-color .12s ease, transform .12s ease;
}
.card:hover { border-color: var(--accent); transform: translateY(-2px); }

.card img {
  display: block;
  width: 100%;
  /* Covers arrive in every ratio imaginable; cropping onto one 3/4 box
     keeps the mosaic rows tidy whatever the source art looks like. */
  aspect-ratio: 3 / 4;
  object-fit: cover;
  background: var(--surface-2);
}

.card .card-body { padding: 10px 12px 12px; }
.card .card-title {
  margin: 0 0 4px;
  font-size: .93rem;
  font-weight: 700;
  line-height: 1.3;
}
/* The title is a link to /livre/{slug} — it must read as the card text,
   not as an accent-colored button (app.js keeps the click from toggling). */
.card .card-title a {
  color: inherit;
  text-decoration: none;
}
.card .card-title a:hover { text-decoration: underline; }
.card .card-text {
  margin: 0;
  color: var(--ink-soft);
  font-size: .8rem;
  line-height: 1.4;
  /* Three lines max: the grid keeps its rhythm when one description runs
     longer than the others (the full text lives on /livre/{slug}). */
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* selection state */
.card .card-check {
  position: absolute;
  top: 8px; right: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px; height: 26px;
  background: var(--ok);
  color: #fff;
  border-radius: 50%;
  font-weight: 800;
  font-size: .9rem;
  /* Always rendered, scaled to nothing when unselected: a display swap
     can't transition, a transform can — the check pops in with a little
     overshoot instead of teleporting. */
  transform: scale(0);
  transition: transform .18s cubic-bezier(.34, 1.56, .64, 1);
  pointer-events: none;
}
.card.selected { border-color: var(--ok); box-shadow: 0 0 0 2px var(--ok); }
.card.selected .card-check { transform: scale(1); }

/* cap reached: unselected cards lock (app.js toggles data-at-cap on .wall) */
.wall[data-at-cap="1"] .card:not(.selected) { opacity: .45; cursor: not-allowed; }
.wall[data-at-cap="1"] .card:not(.selected):hover { border-color: var(--line); transform: none; }

/* highlight pulse when arriving from /livre/{slug}#… */
@keyframes card-pulse {
  0%, 100% { box-shadow: 0 0 0 2px var(--accent); }
  50% { box-shadow: 0 0 0 8px var(--accent); }
}
.card.pulse { animation: card-pulse 1s ease 2; border-color: var(--accent); }

/* -------------------------------------------------------------- cart bar */

.cartbar {
  position: fixed;
  left: 12px; right: 12px; bottom: 12px;
  z-index: 50;
  max-width: 640px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 10px 10px 16px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 999px;
  box-shadow: var(--shadow);
  /* Slides up from below the fold instead of popping (display swaps can't
     transition); visibility keeps it out of the a11y tree and untappable
     while hidden. */
  transform: translateY(calc(100% + 24px));
  opacity: 0;
  visibility: hidden;
  transition: transform .22s ease, opacity .22s ease, visibility 0s linear .22s;
}
.cartbar.visible {
  transform: none;
  opacity: 1;
  visibility: visible;
  transition-delay: 0s;
}

/* Ladder progress: how far to the next price rung (app.js sets the width).
   On narrow screens it is the only nudge left — the upsell text hides. */
.cart-progress {
  flex: 1 1 56px;
  max-width: 88px;
  height: 6px;
  border-radius: 999px;
  background: var(--line);
  overflow: hidden;
}
.cart-progress-fill {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: var(--accent);
  transition: width .25s ease;
}

.cartbar .cart-count { font-weight: 800; white-space: nowrap; }
.cartbar .cart-price { font-weight: 800; color: var(--accent); white-space: nowrap; }
.cartbar .cart-price s { color: var(--ink-soft); font-weight: 600; margin-right: 6px; }
.cartbar .cart-upsell { color: var(--ink-soft); font-size: .84rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Narrow screens: the bar carries count + price + checkout only; the upsell
   lives in the drawer and any tap on the bar (not the button) opens it. */
@media (max-width: 560px) {
  .cartbar .cart-upsell, .cartbar #cart-open { display: none; }
  .cartbar .cart-price s { display: none; }
}

.btn {
  display: inline-block;
  padding: 10px 18px;
  border: 0;
  border-radius: 12px;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: .95rem;
  font-weight: 800;
  cursor: pointer;
  text-align: center;
}
.btn:hover { text-decoration: none; filter: brightness(1.06); }
.btn.small { padding: 8px 14px; border-radius: 10px; }
.btn.ghost { background: var(--surface); color: var(--ink); border: 1px solid var(--line); }
.btn.block { display: block; width: 100%; }

/* Cart drawer modal: dimmed backdrop under the bottom sheet (z 55 < 60),
   click-outside closes it, and the page behind stops scrolling while the
   drawer is open (body.drawer-open, toggled by app.js). */
.cart-backdrop {
  position: fixed;
  inset: 0;
  z-index: 55;
  background: rgba(10, 8, 14, .6);
  opacity: 0;
  visibility: hidden;
  transition: opacity .2s ease, visibility 0s linear .2s;
}
.cart-backdrop.visible {
  opacity: 1;
  visibility: visible;
  transition-delay: 0s;
}
body.drawer-open { overflow: hidden; }

/* Cart drawer: bottom sheet on every screen — a phone thumb-zone pattern
   that still reads well on desktop (centered, max-width). */
.cart-drawer {
  position: fixed;
  left: 12px; right: 12px; bottom: 0;
  z-index: 60;
  max-width: 640px;
  margin: 0 auto;
  padding: 18px 18px 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-bottom: 0;
  border-radius: var(--radius) var(--radius) 0 0;
  box-shadow: var(--shadow);
  transform: translateY(105%);
  transition: transform .2s ease;
  max-height: 76vh;
  overflow: auto;
}
.cart-drawer.open { transform: translateY(0); }
/* Programmatic focus target (tabindex="-1"): no focus ring on the sheet. */
.cart-drawer:focus { outline: none; }
.cart-drawer h2 { margin: 0 0 4px; font-size: 1.05rem; }
.cart-drawer .drawer-price { color: var(--accent); font-weight: 800; font-size: 1.15rem; }
.cart-drawer .drawer-price s { color: var(--ink-soft); font-weight: 600; margin-right: 8px; }
.cart-drawer ul { list-style: none; margin: 12px 0; padding: 0; }
.cart-drawer li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 0;
  border-bottom: 1px solid var(--line);
  font-size: .92rem;
}
.cart-drawer li .remove {
  border: 0;
  background: none;
  color: var(--danger);
  cursor: pointer;
  font-size: 1rem;
  padding: 2px 6px;
}
.cart-drawer .drawer-actions { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; }
.cart-drawer .drawer-upsell { color: var(--ink-soft); font-size: .86rem; text-align: center; }

/* ------------------------------------------------------------- book page */

/* Breadcrumb back to the wall — browser-back is not a navigation system. */
.crumb { margin: 0 0 14px; font-size: .9rem; }
.crumb a { color: var(--ink-soft); font-weight: 600; }
.crumb a:hover { color: var(--ink); }

.book { display: grid; gap: 22px; grid-template-columns: minmax(150px, 320px) 1fr; align-items: start; }
@media (max-width: 560px) { .book { grid-template-columns: 1fr; } }
.book .book-cover {
  border-radius: var(--radius);
  border: 1px solid var(--line);
  width: 100%;
  /* Same 3/4 box as the wall cards: one art rule everywhere (the crop is
     done by CSS; the source image is untouched). */
  aspect-ratio: 3 / 4;
  object-fit: cover;
}
.book h1 { font-family: var(--display); font-weight: 800; margin: 0 0 8px; font-size: clamp(1.3rem, 4.5vw, 1.9rem); line-height: 1.25; }
.book .book-meta { color: var(--ink-soft); font-size: .92rem; margin: 0 0 14px; }
.book .book-desc { margin: 0 0 18px; }
.book .book-content { margin: 0 0 18px; max-width: 62ch; }
.book .book-buy { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.book .hint { margin: 12px 0 0; color: var(--ink-soft); font-size: .88rem; }
.tag-line { display: flex; gap: 8px; flex-wrap: wrap; margin: 0 0 14px; }

/* --------------------------------------------------------- static pages */

.page-narrow { max-width: 720px; margin: 0 auto; }
.page-narrow h1 { font-family: var(--display); font-weight: 800; font-size: clamp(1.5rem, 5vw, 2.1rem); line-height: 1.2; }

/* Download button under a delivery card (same spacing on every card). */
.card-cta { margin: 10px 0 0; }

.prose { color: var(--ink); }
.prose h2 { margin: 26px 0 10px; font-size: 1.2rem; }
.prose .step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px; height: 26px;
  margin-right: 8px;
  background: var(--accent);
  color: var(--accent-ink);
  border-radius: 50%;
  font-weight: 800;
  font-size: .9rem;
}

.commission-table { width: 100%; border-collapse: collapse; margin: 10px 0 18px; font-size: .92rem; }
.commission-table th, .commission-table td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: left; }
.commission-table th { color: var(--ink-soft); font-weight: 600; }
.commission-table td.num, .commission-table th.num { text-align: right; font-variant-numeric: tabular-nums; }
.commission-table .commission-amount { color: var(--accent); font-weight: 700; }

.faq details { border: 1px solid var(--line); border-radius: var(--radius-small); padding: 12px 16px; margin: 10px 0; background: var(--surface); }
.faq summary { cursor: pointer; font-weight: 700; }
.faq details p { color: var(--ink-soft); margin: 10px 0 0; }

/* Link generator (affiliation page) */
.gen-box {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  margin: 14px 0;
}
.gen-box .field-row { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 10px; }
.gen-box input {
  flex: 1 1 200px;
  padding: 9px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-small);
  background: var(--surface-2);
  color: var(--ink);
  font-size: 16px; /* iOS zoom guard, see .searchbox input */
}
.gen-box .gen-result {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-top: 6px;
}
.gen-box .gen-link {
  flex: 1;
  padding: 9px 12px;
  background: var(--surface-2);
  border-radius: var(--radius-small);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: .84rem;
  overflow-wrap: anywhere;
  min-height: 38px;
}

.share-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.share-row a {
  padding: 7px 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink);
  font-size: .86rem;
  font-weight: 600;
}
.share-row a:hover { border-color: var(--accent); text-decoration: none; }

/* Banners gallery (affiliation) */
.banner-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.banner-item { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; }
.banner-item img { display: block; width: 100%; height: auto; border-radius: 6px; margin-bottom: 8px; background: var(--surface-2); }
.banner-item .snippet {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: .72rem;
  color: var(--ink-soft);
  background: var(--surface-2);
  border-radius: 6px;
  padding: 8px;
  /* pre-wrap, not pre: the embed code carries long banner URLs, and
     `pre` disables wrapping entirely (overflow-wrap alone is a no-op
     while white-space: pre holds) — the box would overflow its card. */
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  margin: 0 0 8px;
}

/* ------------------------------------------------------------- delivery */

.delivery-ok {
  background: var(--surface);
  border: 1px solid var(--ok);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin: 18px 0;
}
.delivery-ok h1 { margin: 0 0 10px; font-size: clamp(1.3rem, 4.5vw, 1.8rem); color: var(--ok); }
.delivery-ok h2 { font-size: 1.05rem; margin: 14px 0 0; color: var(--accent); }
.delivery-ok p { margin: 8px 0; }
.delivery-ok .warn { font-weight: 700; }

/* --------------------------------------------------------------- admin */

/* Back-office chrome shared by the three admin pages. */
.admin-narrow { max-width: 760px; }
.admin-wide { max-width: 960px; }
.admin-head { display: flex; gap: 14px; align-items: baseline; flex-wrap: wrap; }
.admin-head h1 { margin-right: auto; }
.tagline.small { font-size: .85rem; }
.admin-actions { margin-top: 18px; }
.admin-btn-row { display: flex; gap: 10px; }
.admin-check { display: flex; gap: 8px; align-items: center; margin-top: 20px; }
.nowrap { white-space: nowrap; }
.inline-form { display: inline; }
.btn-link { border: 0; background: none; color: var(--danger); cursor: pointer; }

/* Themed inputs outside .admin-form (settings tables, rate): the UA default
   would fight color-scheme on some browsers. 16px = iOS zoom guard. */
.admin-field {
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-small);
  background: var(--surface-2);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
}
.admin-num { width: 90px; }
.admin-ref { width: 110px; }

.login-box { max-width: 380px; padding: 40px 0; }
.login-box input:not([type="hidden"]) {
  width: 100%;
  margin-bottom: 10px;
  padding: 9px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-small);
  background: var(--surface-2);
  color: var(--ink);
  font-size: 16px; /* iOS zoom guard */
}

/* Centered utility page (404, /acces fallback). */
.page-centered { text-align: center; padding: 40px 0; }
.centered-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 22px; }

.admin-table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.admin-table th, .admin-table td { padding: 7px 9px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.admin-form { display: grid; gap: 10px; grid-template-columns: 1fr 1fr; margin: 14px 0; }
.admin-form label { display: block; font-size: .84rem; color: var(--ink-soft); margin-bottom: 3px; }
.admin-form input, .admin-form textarea, .admin-form select {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-small);
  background: var(--surface-2);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px; /* iOS zoom guard, see .searchbox input */
}
.admin-form .full { grid-column: 1 / -1; }
.notice { padding: 10px 14px; border-radius: var(--radius-small); margin: 10px 0; }
.notice.ok { background: rgba(62, 207, 142, .12); color: var(--ok); }
.notice.err { background: rgba(255, 122, 122, .1); color: var(--danger); }

/* Admin catalog: drag-and-drop ordering */
.admin-table tr[draggable="true"] .drag-handle { cursor: grab; user-select: none; color: var(--ink-soft); font-size: 1.05rem; padding: 0 4px; }
.admin-table tr.dragging { opacity: .45; background: var(--surface-2); }
.admin-table tr.drag-over { box-shadow: inset 0 2px 0 var(--accent); }
.drop-zone {
  border: 1px dashed var(--line);
  border-radius: var(--radius-small);
  padding: 12px;
  text-align: center;
  color: var(--ink-soft);
  font-size: .84rem;
  background: var(--surface-2);
}
.drop-zone.over { border-color: var(--accent); color: var(--accent); }
.admin-thumb { max-width: 64px; max-height: 84px; margin-top: 8px; border-radius: 6px; border: 1px solid var(--line); display: block; }

/* --------------------------------------------------------------- motion */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
