:root {
  --forest: #12352f;
  --forest-deep: #0a211d;
  --forest-700: #1b463d;
  --forest-050: #eef2ef;
  --ivory: #f6f1e6;
  --ivory-light: #fffdf8;
  --purple: #7C3AED;
  --purple-deep: #5B21B6;
  --purple-light: #A78BFA;
  --purple-line: #C4B5FD;
  --paper: #f8f7f5;
  --paper-raised: #fbfaf7;
  --white: #ffffff;
  --ink: #20312d;
  --ink-soft: #3c4a45;
  --muted: #63716c;
  --line: #ded9cd;
  --line-strong: #c8c1b2;
  --danger: #8a3324;
  --danger-deep: #6f281c;
  --danger-line: #b4573f;
  --danger-bg: #fbf1ee;
  --success-bg: #eaf1ec;
  --warning: #8b4b22;
  --shadow: 0 20px 60px rgba(10, 33, 29, 0.12);
  --shadow-card: 0 1px 2px rgba(16, 32, 28, 0.04), 0 8px 24px rgba(16, 32, 28, 0.05);
  --s1: 4px;
  --s2: 8px;
  --s3: 12px;
  --s4: 16px;
  --s5: 20px;
  --s6: 24px;
  --s7: 32px;
  --s8: 40px;
  --s9: 56px;
  --r-xs: 2px;
  --r-sm: 4px;
  --r-md: 6px;
  --r-lg: 10px;
  --focus: rgba(122, 95, 38, 0.38);
}

* { box-sizing: border-box; }

html {
  min-height: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 85% 10%, rgba(183, 149, 85, 0.13), transparent 28rem),
    var(--ivory);
  font-family: "Noto Serif TC", "PingFang TC", "Microsoft JhengHei", serif;
  line-height: 1.7;
  max-width: 100%;
  overflow-x: hidden;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  content: "";
  pointer-events: none;
  opacity: 0.22;
  background-image: linear-gradient(90deg, transparent 49.8%, rgba(18, 53, 47, 0.09) 50%, transparent 50.2%);
  background-size: 84px 84px;
}

a { color: inherit; }

.site-header,
.staff-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(1120px, calc(100% - 40px));
  margin: 0 auto;
  padding: 28px 0;
}

.brand {
  display: inline-flex;
  flex-shrink: 0;
  white-space: nowrap;
  gap: 12px;
  align-items: center;
  color: var(--forest);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 38px;
  height: 38px;
  border: 1px solid var(--purple);
  border-radius: 50%;
  place-items: center;
  color: var(--purple);
  font-size: 0.9rem;
}

.hero {
  width: min(820px, calc(100% - 40px));
  margin: clamp(48px, 10vh, 120px) auto 80px;
  text-align: center;
}

.eyebrow {
  margin: 0 0 18px;
  color: var(--purple);
  font-family: Georgia, serif;
  font-size: 0.72rem;
  letter-spacing: 0.28em;
}

h1,
h2,
p { margin-top: 0; }

.hero h1 {
  margin-bottom: 24px;
  color: var(--forest);
  font-size: clamp(2.3rem, 7vw, 5.2rem);
  font-weight: 500;
  letter-spacing: 0.08em;
  line-height: 1.18;
  text-wrap: balance;
}

.lead {
  max-width: 640px;
  margin: 0 auto 40px;
  color: var(--muted);
  font-size: clamp(1rem, 2.2vw, 1.18rem);
}

.status-panel {
  display: flex;
  gap: 18px;
  align-items: flex-start;
  max-width: 650px;
  margin: 0 auto;
  padding: 24px 26px;
  border: 1px solid rgba(183, 149, 85, 0.42);
  background: rgba(255, 253, 248, 0.78);
  box-shadow: var(--shadow);
  text-align: left;
}

.status-panel strong {
  color: var(--forest);
  font-size: 1.08rem;
  letter-spacing: 0.06em;
}

.status-panel p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 0.93rem;
}

.status-dot {
  width: 9px;
  height: 9px;
  margin-top: 9px;
  border-radius: 50%;
  background: var(--purple);
  box-shadow: 0 0 0 6px rgba(183, 149, 85, 0.14);
  flex: 0 0 auto;
}

footer {
  padding: 30px 20px;
  color: #56645f;
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-align: center;
}

/* ------------------------------------------------------------------ */
/*  Staff workspace — compact, classical, restrained (DEC-021)         */
/*  Based on the verified visual prototype at                            */
/*  /tmp/baoduoduo-worktrees/staff-workspace-prototype-20261009-023204  */
/*  (commit 47ef531). Class names match the production templates so      */
/*  the stylesheet drops in without template-side changes.               */
/* ------------------------------------------------------------------ */

.staff-page,
.login-page {
  background: #F5F0E6;
}

/* Compact sticky header — 60px on phone and desktop (DEC-021). */
.staff-header {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s4);
  width: 100%;
  min-height: 60px;
  margin: 0;
  padding: var(--s2) var(--s4);
  background: var(--forest-deep);
  border-bottom: 1px solid rgba(216, 194, 141, 0.28);
}

.brand-light { color: #f3efe4; }
.staff-header .brand { color: #f3efe4; font-size: 0.95rem; letter-spacing: 0.12em; }
.staff-header .brand-mark {
  width: 32px;
  height: 32px;
  border: 1px solid var(--purple-light);
  color: var(--purple-light);
  font-size: 0.82rem;
}

.staff-header-actions {
  display: inline-flex;
  align-items: center;
  gap: var(--s3);
  flex-wrap: wrap;
  justify-content: flex-end;
  min-width: 0;
}
.staff-header-title {
  color: var(--purple-light);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  white-space: nowrap;
}
/* The logout form sits inside the header so the legacy ``.logout-form``
   rule would otherwise add an extra gap above it. */
.staff-header .logout-form { margin: 0; }
.logout-action {
  min-height: 40px;
  padding: 8px 14px;
  color: #fbf7ec;
  border: 1px solid rgba(216, 194, 141, 0.65);
  border-radius: var(--r-sm);
  background: rgba(216, 194, 141, 0.08);
  font: inherit;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  cursor: pointer;
}
.logout-action:hover,
.logout-action:focus-visible {
  color: var(--forest-deep);
  background: var(--purple-light);
  border-color: var(--purple-light);
  outline: none;
}

.staff-main {
  width: min(1040px, calc(100% - 32px));
  margin: 0 auto;
  padding: var(--s6) 0 var(--s9);
}

.staff-intro { max-width: 620px; }
.staff-intro .eyebrow {
  margin-bottom: var(--s3);
  font-size: 0.68rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
}
.staff-intro h1 {
  margin-bottom: var(--s2);
  color: var(--forest);
  font-size: clamp(1.5rem, 3.2vw, 2rem);
  font-weight: 500;
  letter-spacing: 0.02em;
  line-height: 1.28;
}
.staff-intro > p:last-child,
.staff-intro .login-line { color: var(--muted); font-size: 0.9rem; margin: 0; }

/* Home-page security notice and feature grid — untouched, kept for
   the public homepage. The portal does not use these classes. */
.security-notice {
  display: flex;
  gap: 18px;
  align-items: flex-start;
  margin: 38px 0;
  padding: 22px;
  border-left: 4px solid var(--warning);
  background: #fff5ec;
}

.notice-icon {
  display: grid;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  color: white;
  background: var(--warning);
  font-family: sans-serif;
  font-weight: 700;
  place-items: center;
  flex: 0 0 auto;
}

.security-notice h2 {
  margin-bottom: 4px;
  color: #6f3918;
  font-size: 1rem;
}

.security-notice p {
  margin-bottom: 0;
  color: #765642;
  font-size: 0.92rem;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
}

.feature-card {
  position: relative;
  min-height: 260px;
  padding: 32px;
  overflow: hidden;
  border: 1px solid #ded7c8;
  background: var(--ivory-light);
  box-shadow: 0 12px 32px rgba(18, 53, 47, 0.08);
}

.card-number {
  display: block;
  margin-bottom: 35px;
  color: var(--purple);
  font-family: Georgia, serif;
  font-size: 0.76rem;
  letter-spacing: 0.18em;
}

.feature-card h2 {
  margin-bottom: 10px;
  color: var(--forest);
  font-size: 1.45rem;
  font-weight: 500;
}

.feature-card p {
  margin-bottom: 30px;
  color: var(--muted);
  font-size: 0.94rem;
}

.coming-soon {
  display: inline-block;
  padding: 6px 11px;
  border-radius: 999px;
  color: #52645e;
  background: #edf0eb;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
}

.staff-footer {
  color: #a9b5b0;
  background: var(--forest-deep);
  font-size: 0.76rem;
  letter-spacing: 0.12em;
  text-align: center;
  padding: var(--s6) var(--s4);
}

/* Authentication and shared form layout */
.login-page {
  display: flex;
  min-height: 100vh;
  flex-direction: column;
}
.login-page .site-header { flex: 0 0 auto; }
.login-main {
  display: grid;
  width: min(100%, 520px);
  margin: auto;
  padding: 36px 20px 72px;
  place-items: center;
}
.login-card {
  width: 100%;
  padding: clamp(28px, 6vw, 46px);
  border: 1px solid rgba(118, 92, 36, 0.28);
  border-radius: 22px;
  background: rgba(255, 253, 248, 0.96);
  box-shadow: var(--shadow);
}
.login-card h1 {
  margin-bottom: 12px;
  color: var(--forest);
  font-size: clamp(1.75rem, 7vw, 2.65rem);
  font-weight: 600;
  line-height: 1.25;
  overflow-wrap: anywhere;
}
.login-lead {
  margin-bottom: 28px;
  color: var(--muted);
  font-size: 0.98rem;
}
.login-form,
.admin-form { display: grid; gap: 18px; }
.field {
  display: grid;
  gap: 7px;
  min-width: 0;
  color: var(--forest-deep);
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.03em;
}
.field input,
.field select,
.field textarea,
.inline-form input {
  width: 100%;
  min-width: 0;
  min-height: 48px;
  padding: 11px 13px;
  border: 1px solid #b8b1a4;
  border-radius: 10px;
  color: var(--ink);
  background: #fff;
  font: inherit;
  font-weight: 400;
  letter-spacing: normal;
}
.field input:focus,
.field select:focus,
.field textarea:focus,
.inline-form input:focus {
  border-color: var(--purple);
  outline: 3px solid rgba(118, 92, 36, 0.16);
}
.primary-action,
.secondary-action {
  min-height: 46px;
  padding: 11px 18px;
  border: 1px solid var(--forest);
  border-radius: 10px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
.secondary-action.compact { min-height: 30px; padding: 4px 10px; font-size: 0.78rem; border-radius: var(--r-xs); }
.primary-action { color: #fff; background: var(--forest); }
.primary-action:hover,
.primary-action:focus-visible { background: var(--forest-deep); }
.secondary-action { color: var(--forest); background: transparent; }
.secondary-action.danger { color: #842f23; border-color: #a33a2b; }
.secondary-action.danger:hover { background: #fff0ed; }
.secondary-action.danger.compact { color: #842f23; border-color: #a33a2b; }
.login-error {
  padding: 12px 14px;
  border-left: 4px solid #a33a2b;
  border-radius: 6px;
  color: #74281e;
  background: #fff0ed;
}
.admin-section {
  margin-top: 38px;
  padding: 28px;
  border: 1px solid #ded7c8;
  border-radius: 16px;
  background: #fff;
}
.inline-form { display: inline-grid; gap: 8px; margin: 4px; }
.users-table { width: 100%; border-collapse: collapse; }
.users-table th,
.users-table td {
  padding: 12px 10px;
  border-bottom: 1px solid #e7e0d4;
  text-align: left;
  vertical-align: top;
}
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.danger { color: #842f23; border-color: #a33a2b; }

/* ------------------------------------------------------------------ */
/*  Staff workspace cards (DEC-021): restrained paper surface.         */
/* ------------------------------------------------------------------ */
.workspace-card {
  min-width: 0;
  max-width: 100%;
  margin-top: var(--s5);
  padding: clamp(18px, 3vw, 28px);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--white);
  box-shadow: var(--shadow-card);
}
.section-heading {
  display: flex;
  gap: var(--s4);
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: var(--s5);
}
.section-heading h2 { margin: 0; color: var(--forest); font-size: clamp(1.15rem, 2.4vw, 1.45rem); font-weight: 500; }
.section-heading .eyebrow { margin-bottom: var(--s1); }

/* Squared, quiet status pill — never a rounded "pill-everything"
   decoration (DEC-021, prototype §4.8). */
.status-pill {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border: 1px solid transparent;
  border-radius: var(--r-xs);
  color: var(--forest);
  background: var(--forest-050);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.status-pill.muted { color: var(--muted); background: #f0ede6; }
.status-pill.success { color: var(--forest); background: var(--success-bg); border-color: rgba(18, 53, 47, 0.2); }
.status-pill.failed { color: var(--danger); background: var(--danger-bg); border-color: rgba(138, 51, 36, 0.2); }

.analyze-form { display: grid; gap: 8px; margin-top: 14px; }
.analyze-form .primary-action { justify-self: start; }
.analyze-form .form-note { margin: 0; }
.failed-note { color: #762d1d; }
.request-form-placeholder { display: grid; gap: 12px; padding: 12px 4px; }
.manual-confirm-form .form-note { margin: 0; }
button[type="submit"][disabled] { opacity: 0.7; cursor: progress; }

/* Upload dropzone — kept for the upload tab. The dashed border is the
   upload zone semantics, not an action panel decoration (DEC-021). */
.upload-form { display: grid; min-width: 0; max-width: 100%; grid-template-columns: 1fr auto; gap: 14px; align-items: end; }
.upload-drop {
  display: grid;
  min-width: 0;
  max-width: 100%;
  gap: 8px;
  padding: var(--s5);
  border: 1px dashed var(--line-strong);
  border-radius: var(--r-sm);
  color: var(--forest);
  background: var(--paper-raised);
  font-weight: 600;
}
.upload-drop input {
  display: block;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
  font: inherit;
  font-weight: 400;
}
.form-note { margin: 14px 0 0; color: var(--muted); font-size: 0.85rem; }

/* Draft layout (STEP 2: screenshot left + confirm form right). */
.draft-layout { display: grid; grid-template-columns: minmax(220px, 0.7fr) minmax(0, 1.3fr); gap: var(--s6); align-items: start; }
.screenshot-panel {
  padding: var(--s3);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--paper-raised);
}
.screenshot-panel img { display: block; width: 100%; max-height: 680px; object-fit: contain; border-radius: var(--r-xs); background: var(--white); }
.screenshot-panel p { margin: 9px 2px 0; color: var(--muted); font-size: .78rem; overflow-wrap: anywhere; }

/* Screenshot gallery for multi-image upload (up to 5 images) */
.screenshot-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: var(--s3);
  margin-bottom: var(--s3);
}
.screenshot-thumb {
  display: flex;
  flex-direction: column;
  margin: 0;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--white);
  overflow: hidden;
  min-width: 0;
}
.screenshot-preview-link {
  display: block;
  text-decoration: none;
  color: inherit;
  border-radius: var(--r-sm) var(--r-sm) 0 0;
  overflow: hidden;
  min-width: 0;
}
.screenshot-preview-link:hover,
.screenshot-preview-link:focus-visible {
  outline: 2px solid var(--purple);
  outline-offset: -2px;
}
.screenshot-preview-link img {
  display: block;
  display: block;
  width: 100%;
  max-width: 100%;
  height: 180px;
  max-height: 180px;
  margin: 0 auto;
  object-fit: contain;
  background: var(--ivory);
}
.screenshot-thumb figcaption {
  padding: var(--s2);
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.3;
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 650px) {
  .screenshot-gallery {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--s2);
  }
  .screenshot-preview-link img {
    height: 160px;
    max-height: 160px;
  }
}
@media (max-width: 420px) {
  .screenshot-gallery {
    grid-template-columns: minmax(0, 1fr);
  }
  .screenshot-preview-link img {
    height: 180px;
    max-height: 180px;
  }
}

.raw-ai-result { margin-top: 12px; }
.raw-ai-result summary { cursor: pointer; color: var(--muted); font-size: .78rem; }
.raw-ai-result pre { margin: 8px 0 0; padding: 10px; border-radius: 9px; background: #fffdf8; font-size: .72rem; line-height: 1.5; max-height: 260px; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; }

/* Cancel-draft form (DEC-012) — unchanged: it really deletes the
   uploaded file, so the soft-confirm checkbox stays. */
.cancel-draft-form { display: grid; gap: 10px; margin-top: 16px; padding-top: 14px; border-top: 1px dashed #b8b1a4; }
.cancel-draft-form h3 { margin: 0; color: var(--forest); font-size: .95rem; }
.cancel-draft-form .secondary-action { justify-self: start; }
.cancel-draft-form .form-note { margin-top: 0; }
.discard-check { display: flex; gap: 8px; align-items: flex-start; color: var(--forest-deep); font-size: .78rem; font-weight: 600; }
.discard-check input { flex: 0 0 auto; width: 16px; height: 16px; min-height: 0; margin-top: 1px; }
.request-form { display: grid; gap: 20px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.field.full { grid-column: 1 / -1; }
.field textarea { resize: vertical; }
.search-form { display: grid; grid-template-columns: 1fr auto; gap: 8px; margin-bottom: var(--s5); }

/* ------------------------------------------------------------------ */
/*  Request list — card (DEC-022)                                      */
/*  Compact, classical, restrained: summary clamped to three lines,    */
/*  metadata on one inline `上傳人 · 時間 · 狀態` line, no orphan        */
/*  whitespace, no inline completion checkbox, no rounded-everything.  */
/* ------------------------------------------------------------------ */
.request-list { display: grid; gap: var(--s3); }

.request-row {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(180px, 220px);
  gap: var(--s4);
  align-items: start;
  padding: var(--s3) var(--s4);
  border: 1px solid var(--line);
  border-left: 3px solid var(--forest);
  border-radius: var(--r-md);
  background: var(--white);
}
.request-row.cancelled {
  border-left-color: var(--line-strong);
  background: var(--paper-raised);
}
.request-row.completed {
  border-left-color: var(--forest-700);
  background: #f4f8f4;
}

.request-row-main { min-width: 0; display: grid; gap: var(--s2); }
.request-head {
  display: flex;
  align-items: baseline;
  gap: var(--s3);
  flex-wrap: wrap;
}
.request-row h3,
.request-row .request-customer {
  margin: 0;
  color: var(--forest);
  font-size: 1rem;
  font-weight: 500;
  line-height: 1.3;
  letter-spacing: 0.01em;
}
.request-row p { margin: 0; color: var(--ink-soft); }
.request-id {
  color: var(--purple);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  white-space: nowrap;
}

/* Pending-row sequence number (Facebook review queue): a quiet 1-based
   counter at the left of every pending row, next to the job id, so the
   operator can say "第 3 項" out loud without reading the whole id. */
.request-seq {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 22px;
  padding: 0 6px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-xs);
  color: var(--forest);
  background: var(--paper-raised);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

/* Summary block: clamped to 3 visual lines; the toggle button only
   appears when JS detects the text overflows. */
.request-summary-block { display: grid; gap: 4px; }
.request-summary {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.9rem;
  line-height: 1.55;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  overflow: hidden;
  text-overflow: ellipsis;
  word-break: break-word;
}
.request-summary[data-summary-clamped="false"] {
  display: block;
  -webkit-line-clamp: unset;
  line-clamp: unset;
  overflow: visible;
}
.summary-toggle {
  justify-self: start;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 26px;
  padding: 2px 8px;
  border: 0;
  border-radius: var(--r-xs);
  color: var(--purple-deep);
  background: transparent;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
}
.summary-toggle[hidden] {
  display: none;
}
.summary-toggle::after {
  content: "▾";
  display: inline-block;
  font-size: 0.7rem;
  transition: transform 120ms ease;
}
.summary-toggle[aria-expanded="true"]::after {
  transform: rotate(180deg);
}
.summary-toggle:hover,
.summary-toggle:focus-visible {
  background: rgba(122, 95, 38, 0.1);
  outline: 2px solid var(--purple);
  outline-offset: 2px;
}

/* Compact screenshot button (DEC-022): the only screenshot affordance
   inside an active row, kept as a single secondary button. */
.screenshot-button {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 30px;
  padding: 3px 10px;
  border: 1px solid var(--purple-line);
  border-radius: var(--r-sm);
  color: var(--forest);
  background: transparent;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  text-decoration: none;
}
.screenshot-button::before {
  content: "▣";
  display: inline-block;
  font-size: 0.78rem;
  color: var(--purple);
}
.screenshot-button:hover,
.screenshot-button:focus-visible {
  background: rgba(122, 95, 38, 0.1);
  outline: none;
}

/* Meta directly follows the request body inside the same card column
   flow (DEC-022): single inline line `上傳人 · 時間 · 狀態`. */
.request-row-aside {
  display: flex;
  flex-direction: column;
  gap: var(--s3);
  min-width: 0;
}
.request-meta-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s2);
  margin: 0;
  padding-top: var(--s3);
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.4;
}
.request-meta-line .meta-piece { display: inline-flex; align-items: baseline; gap: 4px; min-width: 0; }
.request-meta-line .meta-label {
  color: var(--muted);
  font-size: 0.74rem;
  letter-spacing: 0.04em;
}
.request-meta-line .meta-piece strong {
  color: var(--ink-soft);
  font-weight: 600;
}
.request-meta-line .meta-sep {
  color: var(--line-strong);
  font-weight: 700;
  user-select: none;
}

/* Compact button row — never a giant dashed panel (DEC-022 §4.7). */
.request-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s2);
  border-top: 1px solid var(--line);
  padding-top: var(--s3);
}
.facebook-pending-row {
  min-height: 104px;
}
.facebook-pending-row .request-row-aside {
  justify-content: space-between;
}
.facebook-job-select {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
}
.facebook-job-select input {
  width: 16px;
  height: 16px;
  accent-color: var(--forest);
}
.facebook-job-preview {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 52px;
  overflow: hidden;
}
.facebook-job-preview a,
.facebook-job-preview-empty {
  display: inline-flex;
  width: 50px;
  height: 50px;
  flex: 0 0 50px;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--r-xs);
  background: var(--paper-raised);
}
.facebook-job-preview img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.facebook-job-preview-empty {
  color: var(--muted);
  font-size: 0.8rem;
}
.facebook-bulk-delete-form {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--s3);
  margin: 0 0 var(--s3);
  padding: var(--s3);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--paper-raised);
}
.facebook-bulk-delete-form .form-note { margin: 0; }
.complete-form { display: inline-flex; }
.complete-form .secondary-action,
.cancel-form .danger-outline,
.restore-form .restore-action {
  min-height: 36px;
  padding: 6px 12px;
  font-size: 0.82rem;
}
.cancel-form { display: inline-flex; }
.cancel-info {
  display: inline-grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  color: var(--muted);
  background: var(--white);
  font: inherit;
  font-size: 0.74rem;
  font-weight: 700;
  cursor: pointer;
}
.cancel-info:hover,
.cancel-info:focus-visible,
.cancel-info[data-open="1"] {
  color: var(--forest);
  border-color: var(--purple-line);
  background: rgba(122, 95, 38, 0.1);
  outline: none;
}
/* Native HTML tooltip via ``title`` attribute is the no-JS fallback;
   JS upgrades to a small popover attached below the button. */
.cancel-info + .cancel-tooltip {
  display: none;
}
.cancel-info[data-open="1"] + .cancel-tooltip {
  display: block;
  position: absolute;
  z-index: 50;
  max-width: 260px;
  padding: 8px 10px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-sm);
  background: var(--paper-raised);
  color: var(--ink-soft);
  font-size: 0.78rem;
  line-height: 1.45;
  box-shadow: var(--shadow-card);
}
.cancelled-note,
.completed-note { margin: var(--s2) 0 0; font-size: 0.78rem; color: var(--muted); }
.completed-note { color: var(--forest-700); }

/* ------------------------------------------------------------------ */
/*  Confirm-complete dialog (DEC-022). Modal opened when the employee  */
/*  clicks `標記完成`. Reuses the same backdrop/close styling as the   */
/*  existing image preview dialog so the two modals feel consistent.  */
/* ------------------------------------------------------------------ */
.confirm-dialog-backdrop {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(10, 33, 29, 0.72);
  z-index: 1100;
  overscroll-behavior: contain;
}
.confirm-dialog-backdrop[hidden] { display: none; }
.confirm-dialog {
  position: relative;
  display: grid;
  gap: var(--s3);
  width: min(100%, 420px);
  padding: 22px 22px 18px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--white);
  box-shadow: var(--shadow);
}
.confirm-dialog h2 {
  margin: 0;
  color: var(--forest);
  font-size: 1.05rem;
  font-weight: 500;
  letter-spacing: 0.01em;
}
.confirm-dialog p { margin: 0; color: var(--ink-soft); font-size: 0.92rem; line-height: 1.55; }
.confirm-dialog .confirm-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s2);
  justify-content: flex-end;
  margin-top: var(--s2);
}
.confirm-dialog .confirm-actions .secondary-action,
.confirm-dialog .confirm-actions .primary-action {
  min-height: 40px;
  padding: 8px 14px;
  font-size: 0.84rem;
}
@media (max-width: 650px) {
  .confirm-dialog { padding: 18px 16px; }
  .confirm-dialog .confirm-actions .secondary-action,
  .confirm-dialog .confirm-actions .primary-action { flex: 1 1 auto; }
}
@media (prefers-reduced-motion: reduce) {
  .summary-toggle::after { transition: none; }
}

.empty-state {
  padding: var(--s8) var(--s5);
  border: 1px dashed var(--line-strong);
  border-radius: var(--r-md);
  text-align: center;
  color: var(--muted);
}
.empty-state strong { display: block; color: var(--ink); font-size: 1rem; }
.empty-state p { margin: var(--s2) 0 0; font-size: 0.86rem; }

@media (max-width: 650px) {
  .site-header,
  .staff-header { width: 100%; padding: 18px 16px; }
  .brand { font-size: 0.9rem; letter-spacing: 0.08em; }
  .staff-badge { font-size: 0.65rem; }
  .hero { margin-top: 58px; }
  .hero h1 { letter-spacing: 0.04em; }
  .status-panel { padding: 20px; }
  .staff-main { padding-top: var(--s6); padding-bottom: var(--s8); }
  .feature-grid { grid-template-columns: 1fr; }
  .feature-card { min-height: 230px; padding: 26px; }
  .login-page .site-header { padding: 22px 20px 4px; }
  .login-main { margin: 0 auto; padding: 28px 16px 54px; }
  .login-card { padding: 26px 20px; border-radius: 16px; }
  .login-card .eyebrow { margin-bottom: 12px; }
  .login-card h1 { font-size: clamp(1.65rem, 9vw, 2.2rem); }
  .users-table,
  .users-table tbody,
  .users-table tr,
  .users-table td {
    display: block;
    width: 100%;
    min-width: 0;
  }
  .users-table thead { display: none; }
  .users-table tr {
    margin-top: 14px;
    padding: 14px 16px;
    border: 1px solid #ded7c8;
    border-radius: 12px;
    background: #fffdf8;
  }
  .users-table td {
    display: grid;
    grid-template-columns: 88px minmax(0, 1fr);
    gap: 10px;
    padding: 7px 0;
    border: 0;
    overflow-wrap: anywhere;
  }
  .users-table td::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: .82rem;
    font-weight: 700;
  }
  .users-table .actions-cell { display: block; padding-top: 12px; }
  .users-table .actions-cell::before { display: block; margin-bottom: 8px; }
  .users-table .inline-form { display: grid; width: 100%; margin: 8px 0 0; }
  .users-table .inline-form input,
  .users-table .inline-form button { width: 100%; }
  .admin-section { padding: 20px 16px; overflow: hidden; }
  .workspace-card { padding: 20px 16px; border-radius: var(--r-sm); }
  .section-heading { align-items: flex-start; flex-wrap: wrap; }
  .search-form,
  .upload-form,
  .draft-layout,
  .form-grid { grid-template-columns: 1fr; }
  .upload-form .primary-action { width: 100%; }
  .screenshot-panel { position: static; }
  .field.full { grid-column: auto; }
  .request-row { grid-template-columns: 1fr; gap: var(--s3); }
  .request-meta-line { border-top: 0; padding-top: 0; }
  .request-actions { width: 100%; }
}

/* ------------------------------------------------------------------ */
/*  Request list — view tabs (DEC-021 §4.4)                             */
/*  Squared, compact, never wrap into a lone row.                       */
/* ------------------------------------------------------------------ */
.view-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s2);
  margin-bottom: var(--s4);
}
.view-tab {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 6px 14px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-sm);
  color: var(--ink);
  background: var(--white);
  font: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
}
.view-tab:hover,
.view-tab:focus-visible { background: rgba(122, 95, 38, 0.08); outline: none; }
.view-tab.active { color: #fbf7ec; background: var(--forest); border-color: var(--forest); }

/* ------------------------------------------------------------------ */
/*  Request list — view original screenshot (private endpoint, DEC-017)*/
/* ------------------------------------------------------------------ */
.request-attachments {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s2);
  margin: var(--s3) 0 0;
}
.view-original {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 6px 12px;
  border: 1px solid var(--purple-line);
  border-radius: var(--r-sm);
  color: var(--forest);
  background: transparent;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: none;
}
.view-original:hover,
.view-original:focus-visible { background: rgba(122, 95, 38, 0.1); outline: none; }

/* ------------------------------------------------------------------ */
/*  Portal tabs (DEC-018 / DEC-021 §4.3): one quiet segmented frame.   */
/* ------------------------------------------------------------------ */
.portal-tabs {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  margin: var(--s5) 0 0;
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-md);
  background: var(--paper-raised);
  overflow: hidden;
  position: sticky;
  top: 60px;
  z-index: 20;
}
.portal-tab {
  display: inline-flex;
  flex: 1 1 auto;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 10px 18px;
  border: 0;
  border-right: 1px solid var(--line);
  border-radius: 0;
  color: var(--ink);
  background: transparent;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 120ms ease;
}
.portal-tab:last-child { border-right: 0; }
.portal-tab:hover,
.portal-tab:focus-visible { background: rgba(122, 95, 38, 0.08); outline: none; }
.portal-tab.active {
  color: #fbf7ec;
  background: var(--forest);
}
.portal-tab[hidden] { display: none; }

.portal-panel {
  display: block;
  margin-top: var(--s5);
}

@media (max-width: 650px) {
  .staff-header { min-height: 60px; padding: var(--s2) 16px; }
  .staff-header-actions { gap: var(--s2); }
  .staff-header-title {
    font-size: 0.68rem;
    letter-spacing: 0.08em;
  }
  .logout-action { min-height: 36px; padding: 6px 12px; font-size: 0.74rem; }
  .portal-tabs {
    margin-top: var(--s4);
    border-radius: var(--r-sm);
  }
  .portal-tab {
    min-height: 44px;
    padding: 10px 14px;
    font-size: 0.85rem;
  }
}

/* AI analyse countdown / progress (DEC-020) */
.analyze-progress {
  margin: 8px 0 0;
  color: var(--forest);
  font-size: 0.85rem;
  font-weight: 600;
  min-height: 1.4rem;
}
.analyze-form.is-progress .primary-action {
  opacity: 0.85;
  cursor: progress;
}
.analyze-form.is-progress {
  border-left: 3px solid var(--forest);
  padding-left: 10px;
}
.analyze-form.is-success {
  border-left: 3px solid var(--forest-700, var(--forest));
  padding-left: 10px;
}
.analyze-form.is-failed {
  border-left: 3px solid #a33a2b;
  padding-left: 10px;
}
.analyze-form.is-overtime {
  border-left: 3px solid var(--warning);
  padding-left: 10px;
}
.analyze-form button[type="submit"][disabled] {
  background: var(--forest-deep, var(--forest));
  color: #fff;
}

/* Same-page accessible image preview (DEC-020) */
.image-preview-backdrop {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(10, 33, 29, 0.72);
  z-index: 1000;
  overscroll-behavior: contain;
}
.image-preview-backdrop[hidden] {
  display: none;
}
.image-preview-dialog {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: min(96vw, 1200px);
  max-height: min(96vh, 1200px);
  padding: 8px;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 24px 80px rgba(10, 33, 29, 0.32);
  overflow: auto;
}
.image-preview-dialog img {
  display: block;
  max-width: 100%;
  max-height: 80vh;
  height: auto;
  border-radius: 8px;
  object-fit: contain;
}
.image-preview-caption {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.82rem;
  text-align: center;
}
.image-preview-close {
  position: sticky;
  top: 8px;
  align-self: flex-end;
  order: -1;
  z-index: 2;
  width: 48px;
  height: 48px;
  min-width: 48px;
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 1px solid var(--purple);
  border-radius: 999px;
  font: inherit;
  font-size: 1.6rem;
  font-weight: 700;
  line-height: 1;
  color: var(--forest);
  background: rgba(255, 255, 255, 0.92);
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(10, 33, 29, 0.18);
}
.image-preview-close:hover,
.image-preview-close:focus-visible {
  background: var(--white);
  outline: 2px solid var(--purple);
  outline-offset: 2px;
}
@media (max-width: 650px) {
  .image-preview-dialog {
    padding: 8px;
    max-height: 95vh;
  }
  .image-preview-dialog img {
    max-height: 70vh;
  }
}

/* ------------------------------------------------------------------ */
/* Compact help info buttons (DEC-020)                                 */
/* Long explanations sit behind an accessible info button; critical    */
/* errors and statuses remain visible without clicking.                */
/* ------------------------------------------------------------------ */
.help-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  padding: 4px 10px;
  border: 1px solid var(--purple);
  border-radius: 999px;
  background: transparent;
  color: var(--forest);
  font: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  cursor: pointer;
}
.help-button::before {
  content: "?";
  display: inline-grid;
  width: 18px;
  height: 18px;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: var(--purple);
  font-size: 0.72rem;
  font-weight: 700;
}
.help-button:hover,
.help-button:focus-visible {
  background: rgba(118, 92, 36, 0.1);
  outline: 2px solid var(--purple);
  outline-offset: 2px;
}
.help-button[aria-expanded="true"] {
  background: rgba(118, 92, 36, 0.18);
}
.help-panel {
  margin: 8px 0 0;
  padding: 12px 14px;
  border-left: 3px solid var(--purple);
  background: rgba(246, 241, 230, 0.6);
  color: var(--ink-soft, var(--muted));
  font-size: 0.85rem;
}
.help-panel[hidden] {
  display: none;
}
.help-panel p,
.help-panel ul {
  margin: 0 0 6px;
}
.help-panel ul {
  padding-left: 18px;
}
.help-panel p:last-child,
.help-panel ul:last-child {
  margin-bottom: 0;
}

/* ------------------------------------------------------------------ */
/* Compact AI workflow: status colour, manual path, mobile fixes      */
/* (DEC-020)                                                           */
/* ------------------------------------------------------------------ */
.workspace-card[data-analysis-state="analyzed"] {
  border-left: 3px solid var(--forest-700, var(--forest));
}
.workspace-card[data-analysis-state="failed"] {
  border-left: 3px solid #a33a2b;
}
.workspace-card[data-analysis-state="not_analyzed"] {
  border-left: 3px solid var(--purple);
}
.workspace-card[data-analysis-state="analyzing"] {
  border-left: 3px solid var(--warning);
}
.analyse-success {
  color: var(--forest);
  font-weight: 600;
}
.analyse-failed {
  color: #762d1d;
  font-weight: 600;
}
.failed-note {
  color: #762d1d;
}

/* Manual create request (no screenshot) — distinct from the upload flow */
.manual-create-card {
  margin-top: 18px;
}
.manual-create-card .eyebrow {
  margin-bottom: 6px;
}
.manual-create-form .form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.manual-create-form .field.full {
  grid-column: 1 / -1;
}
.manual-create-form .form-note {
  margin-top: 12px;
}

/* ------------------------------------------------------------------ */
/* Button system — primary / secondary / danger-outline / restore      */
/* (DEC-021 §4.7). All buttons share the same restrained square style. */
/* ------------------------------------------------------------------ */
.primary-action,
.secondary-action,
.danger-outline,
.restore-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s2);
  min-height: 44px;
  padding: 10px 18px;
  border: 1px solid var(--forest);
  border-radius: var(--r-sm);
  font: inherit;
  font-size: 0.88rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  cursor: pointer;
  text-decoration: none;
}
.primary-action { color: #fbf7ec; background: var(--forest); }
.primary-action:hover,
.primary-action:focus-visible { background: var(--forest-deep); }

.secondary-action { color: var(--forest); background: var(--white); border-color: var(--line-strong); }
.secondary-action:hover,
.secondary-action:focus-visible {
  background: rgba(122, 95, 38, 0.08);
  border-color: var(--purple-line);
}

.danger-outline { color: var(--danger); background: var(--white); border-color: var(--danger-line); }
.danger-outline:hover,
.danger-outline:focus-visible { color: var(--danger-deep); background: var(--danger-bg); }

.restore-action { color: var(--purple-deep); background: var(--white); border-color: var(--purple-line); }
.restore-action:hover,
.restore-action:focus-visible { background: rgba(122, 95, 38, 0.1); }

/* Glyph repair marker (DEC-021 §5) — used on the prototype to flag
   normalised characters such as 圈口 47–50. Production renders the
   normalised string; the marker is for review tooling only. */
.glyph-fixed {
  text-decoration: underline dotted var(--purple);
  text-underline-offset: 3px;
}

/* Mobile screenshot layout (DEC-020) */
@media (max-width: 650px) {
  .draft-layout {
    grid-template-columns: 1fr;
    gap: 18px;
  }
  .screenshot-panel {
    position: static;
    padding: 10px;
    max-width: 100%;
  }
  .screenshot-panel img {
    max-height: 360px;
    width: 100%;
  }
  .workspace-card[data-analysis-state] {
    border-left-width: 2px;
    padding-left: 14px;
  }
  .view-original {
    width: 100%;
    justify-content: center;
  }
  .request-attachments {
    flex-direction: column;
    align-items: stretch;
  }
  .analyze-form.is-progress,
  .analyze-form.is-success,
  .analyze-form.is-failed,
  .analyze-form.is-overtime {
    padding-left: 6px;
  }
}
@media (max-width: 420px) {
  .screenshot-panel img {
    max-height: 240px;
  }
  .image-preview-dialog img {
    max-height: 60vh;
  }
  .manual-create-form .form-grid {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; scroll-behavior: auto !important; }
}
/* ------------------------------------------------------------------ */
/*  Public storefront + admin inventory editor (DEC-022)                */
/*  Visual direction: restrained classical / artistic gallery.          */
/*  - quiet square borders; modest 2–6 px radius only;                 */
/*  - off-white paper + ink + restrained gold accent;                  */
/*  - high-density grid that does not feel crowded;                    */
/*  - no glow / no glassmorphism / no oversized pill rounding.         */
/* ------------------------------------------------------------------ */

.mounting-page{max-width:1120px;margin:0 auto;padding:0 20px 64px;color:#19332e}
.mounting-header{width:min(1120px,calc(100% - 40px));margin:0 auto;padding:28px 0;display:flex;align-items:center;justify-content:space-between;gap:20px;font-family:ui-sans-serif,system-ui,-apple-system,"Noto Sans TC","Microsoft JhengHei",sans-serif;line-height:normal}
.mounting-brand{display:inline-flex;flex-shrink:0;white-space:nowrap;align-items:center;color:#123f3a;font-size:1rem;font-weight:700;letter-spacing:.13em;text-decoration:none}
.mounting-back-link{color:#1f6d61;text-decoration:none;font-size:14px}
.mounting-back-link:hover{color:#ae7a2c}
.mounting-main{padding-top:clamp(42px,8vw,92px)}
.mounting-hero{padding:0 0 22px;border-bottom:1px solid #d8dfd7;margin-bottom:24px}
.mounting-hero h1{font-family:"Noto Serif TC",serif;font-size:clamp(28px,5vw,42px);margin:6px 0 10px}
.mounting-hero p{line-height:1.8;color:#53645f;max-width:720px;margin:0}
.mounting-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,300px),1fr));gap:18px}
.mounting-card{background:#fff;border:1px solid #dfe5df;border-radius:10px;overflow:hidden;box-shadow:0 5px 18px #173a3010}
.mounting-gallery{display:grid;grid-template-columns:repeat(auto-fit,minmax(130px,1fr));gap:2px;background:#edf0ea}
.mounting-gallery img{display:block;width:100%;height:230px;object-fit:cover}
.mounting-copy{padding:18px 20px 22px}
.mounting-copy h2{font-size:21px;margin:0 0 8px}
.mounting-summary{color:#9b7436;font-weight:600;margin:0 0 12px}
.mounting-description{white-space:pre-line;line-height:1.85;color:#4a5b56;margin:0}
.mounting-empty{padding:40px 20px;text-align:center;color:#66756f;background:#f5f6f2;border-radius:8px}
.mounting-back{display:inline-block;margin-top:24px;color:#345c50;text-decoration:none;border-bottom:1px solid currentColor;padding-bottom:3px}
@media(max-width:780px){.mounting-header{width:min(calc(100% - 32px),620px);padding:18px 0}}
@media(max-width:600px){.mounting-header{width:min(calc(100% - 32px),620px);padding:18px 0}.mounting-brand{font-size:14px}.mounting-back-link{font-size:13px}.mounting-page{padding:0 14px 44px}.mounting-main{padding-top:50px}.mounting-gallery img{height:190px}.mounting-copy{padding:15px}}

.mounting-hero-tools{display:flex;align-items:flex-end;justify-content:space-between;gap:16px}
.mounting-hero-tools .eyebrow{margin-bottom:0}
.mounting-card .product-card-body{min-height:132px}
.mounting-card-hint{margin:12px 0 0;color:var(--purple);font-size:.8rem;letter-spacing:.06em}
@media(max-width:650px){.mounting-hero-tools{align-items:flex-start;flex-direction:column;gap:10px}.mounting-hero-tools .display-mode-toggle{margin-left:0}.mounting-card .product-card-body{min-height:0}}

.storefront-page {
  background: #F5F0E6;
  font-family: "KKK Noto Sans TC", "PingFang TC", "Microsoft JhengHei", sans-serif;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(1120px, calc(100% - 40px));
  margin: 0 auto;
  padding: 14px 0 10px;
}

.site-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}
.site-nav {
  display: flex;
  justify-content: flex-end;
  margin-left: auto;
}
.site-header-home .site-nav {
  width: 100%;
  justify-content: space-between;
  margin-left: 0;
}

.site-nav a {
  color: var(--ink-soft);
  font-size: 0.88rem;
  letter-spacing: 0.14em;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  padding-bottom: 2px;
}
.home-nav-links {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 18px;
  margin-left: auto;
}
.home-nav-links a { white-space: nowrap; }
.nav-contact {
  color: var(--forest) !important;
  font-size: 0.8rem !important;
  letter-spacing: 0.12em !important;
}
.nav-whatsapp { color: #176b4d !important; }
.nav-news { color: #8a6a20 !important; }
.nav-mounting { color: #72506f !important; }
.nav-rate { color: #526b63 !important; }
@media (max-width: 650px) {
  .home-nav-links { gap: 9px; }
  .home-nav-links a { font-size: 0.68rem !important; letter-spacing: 0.04em !important; }
}
.home-nav-toggle { display: none; }
@media (max-width: 767px) {
  .site-header-home .site-nav { position: relative; flex-wrap: wrap; gap: 10px; }
  .site-header-home .brand { min-width: 0; }
  .home-nav-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 36px;
    margin-left: auto;
    padding: 0;
    color: var(--forest);
    background: transparent;
    border: 1px solid rgba(10, 42, 32, 0.28);
    border-radius: 6px;
    font-size: 1.25rem;
    line-height: 1;
    cursor: pointer;
  }
  .home-nav-toggle:focus-visible { outline: 2px solid var(--purple); outline-offset: 3px; }
  .site-header-home .home-nav-links {
    flex-basis: 100%;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0;
    width: 100%;
    margin: 0;
    padding-top: 8px;
    border-top: 1px solid rgba(10, 42, 32, 0.16);
  }
  .site-header-home .home-nav-links a {
    display: block;
    width: auto;
    padding: 10px 4px;
    text-align: right;
    font-size: 0.82rem !important;
    letter-spacing: 0.08em !important;
  }
  .site-header-home .site-nav[data-mobile-nav-ready="true"] .home-nav-links[hidden] { display: none; }
}
.site-nav[data-mobile-nav-ready="true"] .home-nav-links[hidden] { display: flex; }
.site-nav[data-mobile-nav-ready="true"] .home-nav-toggle { display: none; }
@media (max-width: 767px) {
  .site-nav[data-mobile-nav-ready="true"] .home-nav-links[hidden] { display: none; }
  .site-nav[data-mobile-nav-ready="true"] .home-nav-toggle { display: inline-flex; }
}
.site-nav a:hover { border-bottom-color: var(--purple); color: var(--forest); }

.hero {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 42vh;
  margin: 0 auto 54px;
  padding: 72px 20px;
  overflow: hidden;
  color: var(--paper);
  text-align: center;
  background:
    linear-gradient(180deg, rgba(10, 42, 32, 0.32), rgba(10, 42, 32, 0.78)),
    url("/site/bg01.jpg") center / cover no-repeat;
}
.hero::after {
  position: absolute;
  inset: 0;
  content: "";
  pointer-events: none;
  border-bottom: 1px solid rgba(167, 135, 255, 0.45);
}
.hero > * {
  position: relative;
  z-index: 1;
}
.hero .eyebrow {
  margin-bottom: 14px;
  color: var(--purple-light);
  font-family: Georgia, "Times New Roman", serif;
  font-style: italic;
  letter-spacing: 0.42em;
}
.hero h1 {
  margin: 0 0 16px;
  color: var(--paper);
  font-family: "Noto Serif TC", "Songti TC", serif;
  font-size: clamp(2.8rem, 10vw, 5.4rem);
  font-weight: 500;
  letter-spacing: 0.16em;
  line-height: 1.08;
  text-shadow: 0 4px 24px rgba(0, 0, 0, 0.38);
}
.hero .lead {
  max-width: 560px;
  margin: 0;
  color: rgba(250, 247, 240, 0.86);
  font-size: clamp(0.9rem, 2.1vw, 1.05rem);
  font-weight: 300;
  letter-spacing: 0.08em;
}

.storefront-section {
  width: min(1120px, calc(100% - 40px));
  margin: 0 auto 80px;
  padding: 28px 0 0;
  border-top: 1px solid var(--line);
}
.storefront-section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: nowrap;
  margin-bottom: 22px;
}
.storefront-section-title {
  display: flex;
  align-items: baseline;
  gap: 18px;
  min-width: 0;
}
.storefront-section-head .eyebrow {
  margin: 0 0 4px;
  font-size: 0.68rem;
  letter-spacing: 0.24em;
}
.storefront-section-head h2 {
  margin: 0;
  color: var(--forest);
  font-size: clamp(1.4rem, 2.6vw, 1.9rem);
  font-weight: 500;
  letter-spacing: 0.05em;
}
.storefront-section-count {
  margin: 0 0 0 auto;
  color: var(--muted);
  font-size: 0.82rem;
  letter-spacing: 0.16em;
}

.storefront-section-empty {
  display: flex;
  align-items: flex-start;
  gap: 18px;
  padding: 22px 24px;
  border: 1px solid rgba(183, 149, 85, 0.4);
  background: rgba(255, 253, 248, 0.78);
  color: var(--ink-soft);
  font-size: 0.95rem;
  border-radius: var(--r-sm);
}
.storefront-section-empty .status-dot {
  width: 9px; height: 9px;
  margin-top: 9px;
  border-radius: 50%;
  background: var(--purple);
  box-shadow: 0 0 0 6px rgba(183, 149, 85, 0.14);
  flex: 0 0 auto;
}
.storefront-section-empty strong { color: var(--forest); display: block; letter-spacing: 0.06em; }
.storefront-section-empty p { margin: 4px 0 0; color: var(--muted); font-size: 0.92rem; }

.product-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 18px;
}

.product-card {
  background: var(--paper-raised);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  transition: border-color 120ms ease, transform 120ms ease;
}
.product-card:hover {
  border-color: var(--purple-line);
  transform: translateY(-1px);
}
.product-card-link {
  display: block;
  color: inherit;
  text-decoration: none;
  padding: 0;
}
.product-card-image {
  position: relative;
  aspect-ratio: 4 / 3;
  background: var(--ivory);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-top-left-radius: var(--r-sm);
  border-top-right-radius: var(--r-sm);
}
.product-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.product-card-image-empty {
  color: var(--muted);
  font-size: 0.92rem;
  letter-spacing: 0.08em;
  text-align: center;
  padding: 0 18px;
  background:
    repeating-linear-gradient(135deg, rgba(18, 53, 47, 0.03) 0 6px, transparent 6px 14px),
    var(--ivory);
}
.product-card-image-empty span { display: block; max-width: 90%; margin: 0 auto; }
.product-card-body { padding: 14px 16px 18px; }
.product-card-category {
  margin: 0 0 6px;
  color: var(--purple);
  font-family: Georgia, serif;
  font-size: 0.7rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
}
.product-card-name {
  margin: 0 0 6px;
  color: var(--forest);
  font-size: 1.02rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  line-height: 1.35;
}
.product-card-summary {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.product-card-views, .storefront-detail-views { color: #7c756d; font-size: 0.78rem; margin: 6px 0 0; letter-spacing: .02em; }
.product-card-price {
  margin: 0;
  color: var(--ink);
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.03em;
}

/* ----- Display-mode toggle + compact grid (DEC-023) ----- */

.display-mode-toggle {
  display: inline-flex;
  align-items: stretch;
  margin: 0 0 0 auto;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--paper-raised);
  overflow: hidden;
  flex: 0 0 auto;
}

.display-mode-toggle__button {
  appearance: none;
  -webkit-appearance: none;
  font: inherit;
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  color: var(--ink-soft);
  background: transparent;
  border: 0;
  border-radius: 0;
  padding: 8px 14px;
  cursor: pointer;
  transition: background-color 120ms ease, color 120ms ease;
}
.display-mode-toggle__button + .display-mode-toggle__button {
  border-left: 1px solid var(--line);
}
.display-mode-toggle__button:hover,
.display-mode-toggle__button:focus-visible {
  color: var(--forest);
  background: var(--ivory);
}
.display-mode-toggle__button:focus-visible {
  outline: 2px solid var(--purple);
  outline-offset: -2px;
}
.display-mode-toggle__button[aria-pressed="true"] {
  color: var(--paper);
  background: var(--forest);
}

.product-grid[data-display-mode="compact"] {
  /* Exactly two columns of square thumbnails; mobile keeps two rows so
     thumbs stay legible without forcing a wider viewport. */
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.product-grid[data-display-mode="compact"] .product-card {
  border-radius: var(--r-xs, 2px);
}
.product-grid[data-display-mode="compact"] .product-card-image {
  aspect-ratio: 1 / 1;
  border-bottom: 0;
  border-top-left-radius: var(--r-xs, 2px);
  border-top-right-radius: var(--r-xs, 2px);
}
.product-grid[data-display-mode="compact"] .product-card-body {
  /* DEC-023: image-only mode hides category / name / price text per the
     public toggle; the underlying <a> still carries the accessible name
     so screen-reader and keyboard users keep the product title. */
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.product-grid[data-display-mode="compact"] .product-card-link {
  position: relative;
  display: block;
}

@media (max-width: 650px) {
  .storefront-section-head {
    align-items: flex-end;
    gap: 8px;
  }
  .storefront-section-title {
    display: block;
    flex: 1 1 auto;
    min-width: 0;
  }
  .storefront-section-title .eyebrow {
    margin-bottom: 4px;
  }
  .display-mode-toggle {
    margin-left: 0;
    flex: 0 0 auto;
  }
  .display-mode-toggle__button {
    padding: 7px 7px;
    font-size: 0.7rem;
    letter-spacing: 0.03em;
  }
  .product-grid[data-display-mode="compact"] {
    gap: 10px;
  }
}

.storefront-page-swipe-viewport {
  position: relative;
  overflow: hidden;
  background: var(--ivory);
}
.storefront-page-swipe-panel {
  position: relative;
  width: 100%;
  overflow: hidden;
  contain: paint;
  backface-visibility: hidden;
  will-change: transform;
}
.storefront-page-swipe-panel-current {
  position: relative;
  z-index: 2;
  will-change: auto;
}
.storefront-page-swipe-panel-neighbour {
  position: absolute;
  z-index: 1;
  top: 0;
  left: 0;
  min-height: 100%;
  background: var(--ivory);
}
@media (max-width: 760px) {
  .storefront-page-swipe-viewport { touch-action: pan-y; }
  .storefront-page-swipe-panel-neighbour .storefront-detail{ margin-bottom: 0; }
}
.storefront-mobile-contact-bar { display: none; }

.storefront-detail {
  width: min(1120px, calc(100% - 40px));
  margin: 0 auto 80px;
  padding: 14px 0 0;
}
.storefront-detail .eyebrow {
  margin: 0 0 6px;
  color: var(--muted);
  letter-spacing: 0.18em;
  font-size: 0.78rem;
}
.storefront-detail .eyebrow a { color: inherit; text-decoration: none; border-bottom: 1px solid var(--line); padding-bottom: 1px; }
.storefront-detail-title {
  margin: 0 0 6px;
  color: var(--forest);
  font-size: clamp(1.8rem, 3.6vw, 2.6rem);
  font-weight: 500;
  letter-spacing: 0.06em;
  line-height: 1.2;
}
.storefront-detail-code { margin: 0 0 12px; color: var(--muted); font-size: 0.85rem; letter-spacing: 0.14em; }
.storefront-detail-summary { margin: 0 0 28px; color: var(--ink-soft); font-size: 1.05rem; line-height: 1.7; max-width: 720px; }

.storefront-detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: 36px;
  align-items: start;
}
@media (max-width: 760px) {
  .storefront-detail-layout { grid-template-columns: 1fr; }
}
.storefront-detail-figure { margin: 0; width: 100%; min-width: 0; max-width: 100%; overflow: hidden; }
.storefront-detail-gallery-mobile {
  list-style: none;
  display: none;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  margin: 0;
  padding: 0;
  overflow: hidden;
}
.storefront-detail-gallery-mobile > li {
  list-style: none;
  display: block;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
}
.storefront-detail-gallery-mobile > li::marker { content: ""; }
.storefront-detail-gallery-mobile img {
  display: block;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  height: auto;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--ivory);
}
.storefront-detail-gallery-desktop {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  grid-template-areas: "thumbs main";
  gap: 12px;
  align-items: start;
}
.storefront-detail-gallery-desktop .storefront-detail-main-image { grid-area: main; }
.storefront-detail-gallery-desktop .storefront-detail-thumbnails { grid-area: thumbs; }
.storefront-detail-main-image {
  position: relative;
  min-width: 0;
  height: min(66vh, 620px);
  background: var(--ivory);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  overflow: hidden;
  cursor: crosshair;
  outline: none;
}
.storefront-detail-main-image:focus-visible {
  outline: 2px solid var(--forest);
  outline-offset: 3px;
}
.storefront-detail-main-image > img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.storefront-detail-zoom-hint {
  position: absolute;
  right: 10px;
  bottom: 10px;
  padding: 5px 8px;
  color: var(--paper);
  background: rgba(18, 53, 47, 0.78);
  font-size: 0.7rem;
  letter-spacing: 0.05em;
  pointer-events: none;
}
.storefront-detail-thumbnails {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 0 0 64px;
  width: 64px;
  max-height: none;
  overflow-y: visible;
}
.storefront-detail-thumbnail {
  appearance: none;
  padding: 0;
  flex: 0 0 64px;
  width: 64px;
  height: 64px;
  border: 1px solid var(--line);
  border-radius: var(--r-xs, 2px);
  background: var(--paper-raised);
  cursor: pointer;
  overflow: hidden;
}
.storefront-detail-thumbnail img { display: block; width: 64px; height: 64px; object-fit: cover; }
.storefront-detail-thumbnail:hover,
.storefront-detail-thumbnail:focus-visible,
.storefront-detail-thumbnail.is-active { border-color: var(--purple); }
.storefront-detail-thumbnail:focus-visible { outline: 2px solid var(--forest); outline-offset: 2px; }
.storefront-detail-zoom-popup {
  position: fixed;
  --popup-width: 520px;
  --popup-height: 520px;
  left: calc(var(--popup-left, -9999) * 1px);
  top: calc(var(--popup-top, -9999) * 1px);
  width: min(var(--popup-width), 38vw, calc(100vw - 24px));
  max-width: calc(100vw - 24px);
  aspect-ratio: 1 / 1;
  height: auto;
  min-height: 0;
  background: var(--ivory);
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  background-repeat: no-repeat;
  background-size: 300% auto;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  z-index: 200;
}
.storefront-detail-zoom-popup.is-visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}
.storefront-detail-zoom-popup-hint { display: none; }
@media (max-width: 760px) {
  .storefront-detail-figure,
  .storefront-detail-gallery-mobile,
  .storefront-detail-gallery-mobile > li,
  .storefront-detail-gallery-mobile img {
    width: calc(100vw - 32px) !important;
    max-width: calc(100vw - 32px) !important;
    min-width: 0 !important;
    box-sizing: border-box;
  }
  .storefront-detail-gallery-mobile { display: block; }
  .storefront-detail-gallery-desktop { display: none; }
  .storefront-detail-main-image { height: auto; aspect-ratio: auto; cursor: default; }
  .storefront-detail-main-image > img { height: auto; max-height: none; object-fit: contain; }
  .storefront-detail-zoom-hint { display: none; }
  .storefront-detail-zoom-popup { display: none; }
  .storefront-detail-thumbnails { display: none; }
}
.storefront-detail-no-image {
  aspect-ratio: 4 / 3;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  background:
    repeating-linear-gradient(135deg, rgba(18, 53, 47, 0.03) 0 6px, transparent 6px 14px),
    var(--ivory);
  color: var(--muted);
  font-size: 1rem;
  letter-spacing: 0.08em;
  text-align: center;
  border-radius: var(--r-sm);
  padding: 24px;
}
.storefront-detail-source {
  margin-top: 10px;
  color: var(--muted);
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  word-break: break-all;
}
.storefront-detail-source a { color: var(--forest-deep); text-decoration: underline; text-decoration-color: var(--purple-line); }

.storefront-detail-meta { padding-top: 4px; }
.storefront-detail-meta-head {
  display: grid;
  grid-template-rows: 2.1rem 1.8rem auto;
  align-items: start;
  margin-bottom: 24px;
}
.storefront-detail-price-slot,
.storefront-detail-category-slot {
  min-height: 0;
}
.storefront-detail-price {
  margin: 0;
  color: var(--forest);
  font-size: 1.4rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  line-height: 1.5;
}
.storefront-detail-price-empty,
.storefront-detail-category-empty {
  visibility: hidden;
}
.storefront-detail-category {
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.5;
}
.storefront-detail-contact-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 4px;
}
.storefront-detail-messenger,
.storefront-detail-whatsapp {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  min-height: 44px;
  margin-top: 4px;
  padding: 9px 18px;
  border: 1px solid #1877f2;
  border-radius: 999px;
  background: #1877f2;
  color: #fff;
  font-size: 0.92rem;
  letter-spacing: 0.04em;
  text-decoration: none;
  transition: background-color 120ms ease, border-color 120ms ease, transform 120ms ease;
}
.storefront-detail-whatsapp {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  min-height: 44px;
  padding: 9px 18px;
  border: 1px solid #128c7e;
  border-radius: 999px;
  background: #128c7e;
  color: #fff;
  font-size: 0.92rem;
  letter-spacing: 0.04em;
  text-decoration: none;
  transition: background-color 120ms ease, border-color 120ms ease, transform 120ms ease;
}
.storefront-detail-whatsapp:hover,
.storefront-detail-whatsapp:focus-visible {
  border-color: #075e54;
  background: #075e54;
  color: #fff;
  transform: translateY(-1px);
}
.storefront-detail-messenger:hover,
.storefront-detail-messenger:focus-visible,
.storefront-detail-whatsapp:focus-visible {
  border-color: #0f5fc4;
  background: #0f5fc4;
  color: #fff;
  transform: translateY(-1px);
}
.storefront-detail-messenger:focus-visible {
  outline: 2px solid var(--forest);
  outline-offset: 3px;
}
.storefront-detail-recommender {
  margin: 0 0 8px;
  color: var(--purple);
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.05em;
}
.storefront-detail-description { margin-bottom: 20px; }
.storefront-detail-spec {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0;
  margin: 0 0 24px;
  padding: 0;
  border-top: 1px solid var(--line);
}
.storefront-detail-spec > div {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 12px 14px 12px 0;
  border-bottom: 1px solid var(--line);
}
.storefront-detail-spec dt { color: var(--muted); font-size: 0.74rem; letter-spacing: 0.18em; text-transform: uppercase; }
.storefront-detail-spec dd { margin: 0; color: var(--ink); font-size: 0.98rem; }
.storefront-detail-recommender {
  margin: 0 0 8px;
  color: var(--purple);
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.05em;
}
.storefront-detail-description { margin-bottom: 20px; }
.storefront-detail-description h2 { margin: 0 0 10px; color: var(--forest); font-size: 1.08rem; font-weight: 600; letter-spacing: 0.06em; }
.storefront-detail-description p { margin: 0 0 12px; color: var(--ink-soft); line-height: 1.75; white-space: pre-line; }
.storefront-detail-note { color: var(--muted); font-size: 0.86rem; line-height: 1.6; border-left: 2px solid var(--purple-line); padding: 4px 0 4px 12px; }

/* ----- Storefront detail prev/next nav (DEC-024) -----
   The wrapper carries no-JS anchor links plus the data hooks the
   portal.js touch + keyboard layer reads.  Two links sit on a row,
   aligned to the edges, so the visitor always knows the swipe
   direction without an explicit affordance.  When only one neighbour
   exists (first / last product) the remaining anchor keeps the
   correct side via margin-left: auto. */
.storefront-detail-nav {
  width: min(1120px, calc(100% - 40px));
  margin: 0 auto;
  padding: 4px 0 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 0;
}
.storefront-detail-nav:empty { display: none; }
.storefront-detail-nav-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--paper);
  color: var(--forest);
  font-size: 0.92rem;
  letter-spacing: 0.04em;
  text-decoration: none;
  min-height: 44px;
  min-width: 44px;
  transition: background-color 120ms ease, border-color 120ms ease, color 120ms ease;
}
.storefront-detail-nav-link:hover,
.storefront-detail-nav-link:focus-visible {
  border-color: var(--forest);
  color: var(--forest-deep);
  background: var(--paper-raised);
}
.storefront-detail-nav-link:focus-visible {
  outline: 2px solid var(--forest);
  outline-offset: 2px;
}
.storefront-detail-nav-link-next { margin-left: auto; }
@media (max-width: 480px) {
  .storefront-detail-nav {
    padding: 4px 0 0;
    gap: 6px;
  }
  .storefront-detail-nav-link {
    font-size: 0.86rem;
    padding: 5px 8px;
    min-height: 32px;
  }
}

.storefront-empty {
  width: min(720px, calc(100% - 40px));
  margin: clamp(60px, 12vh, 120px) auto 80px;
  text-align: center;
}
.storefront-empty h1 { color: var(--forest); font-weight: 500; letter-spacing: 0.06em; margin: 0 0 16px; }
.storefront-empty .lead { margin: 0 auto 28px; max-width: 540px; }

/* ----- Approved storefront responsive polish ----- */
@media (max-width: 650px) {
  .storefront-page .site-header { padding: 12px 16px 8px; }
  .storefront-page .hero { margin: 18px auto 26px; }
  .storefront-page .hero h1 { margin-bottom: 10px; font-size: clamp(1.8rem, 9vw, 2.5rem); letter-spacing: 0.03em; }
  .storefront-page .hero .lead { font-size: 0.92rem; line-height: 1.55; }
  .storefront-page .storefront-section { width: calc(100% - 32px); margin-bottom: 48px; padding-top: 18px; }
  .storefront-page .storefront-section-head { margin-bottom: 14px; gap: 8px 12px; }
  .storefront-page .storefront-section-head h2 { font-size: 1.35rem; }
  .storefront-page .product-card-body { padding: 11px 12px 14px; }
  .storefront-detail-nav { width: calc(100% - 32px); padding-top: 8px; }
  .storefront-detail { width: calc(100% - 32px); margin-bottom: 48px; padding-top: 14px; }
  .storefront-detail .eyebrow { margin-bottom: 8px; }
  .storefront-detail-title { font-size: clamp(1.55rem, 8vw, 2.1rem); }
  .storefront-detail-code { margin-bottom: 10px; }
  .storefront-detail-layout { gap: 20px; }
  .storefront-detail { padding-bottom: 92px; }
  .storefront-detail-contact-actions { display: none; }
  .storefront-product-page .storefront-footer {
    padding-bottom: calc(98px + env(safe-area-inset-bottom));
  }
  .storefront-mobile-contact-bar {
    position: fixed;
    left: 16px;
    right: 16px;
    bottom: max(12px, env(safe-area-inset-bottom));
    z-index: 100;
    display: flex;
    gap: 10px;
    width: auto;
    padding: 0;
    box-shadow: 0 8px 24px rgba(18, 53, 47, 0.22);
  }
  .storefront-mobile-contact-bar > a {
    flex: 1 1 0;
    min-width: 0;
    margin-top: 0;
    padding-right: 8px;
    padding-left: 8px;
  }
}


.inventory-page-picker { display: flex; align-items: center; gap: 0.45rem; margin-left: auto; font-size: 0.82rem; color: var(--muted); }
.inventory-page-picker select { min-width: 6.5rem; padding: 0.35rem 0.5rem; border: 1px solid var(--line); border-radius: 0.45rem; background: var(--surface); color: var(--ink); }
.inventory-row[hidden] { display: none; }
.inventory-load-sentinel { min-height: 2rem; }

.inventory-status-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  width: min(1120px, calc(100% - 40px));
  margin: 0 auto 18px;
}
.inventory-status-tab {
  display: inline-block;
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--paper-raised);
  color: var(--ink-soft);
  font-size: 0.86rem;
  letter-spacing: 0.08em;
  text-decoration: none;
}
.inventory-status-tab:hover { border-color: var(--purple-line); color: var(--forest); }
.inventory-status-tab.active {
  background: var(--forest);
  border-color: var(--forest);
  color: var(--ivory-light);
}

.inventory-form .inventory-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px 18px;
}
.inventory-form .inventory-grid-wide { grid-column: 1 / -1; }
.inventory-form .field > span { font-size: 0.82rem; }
.inventory-form input[type="text"],
.inventory-form input[type="url"],
.inventory-form input[type="number"],
.inventory-form select,
.inventory-form textarea {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: var(--r-xs);
  background: var(--paper-raised);
  color: var(--ink);
  font: inherit;
  font-size: 0.92rem;
}
.inventory-form textarea { resize: vertical; min-height: 60px; }
.inventory-image-preview {
  display: block;
  max-width: 260px;
  max-height: 200px;
  margin-top: 10px;
  border-radius: var(--r-xs);
  border: 1px solid var(--line);
  object-fit: contain;
}
.inventory-price-block {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
}
.inventory-image-preview-list {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
  gap: 8px;
  width: min(100%, 360px);
  margin: 10px 0 0;
  padding: 0;
}
.inventory-image-preview-list li {
  width: 100%;
  aspect-ratio: 1;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--r-xs);
  background: var(--paper);
}
.inventory-image-preview-list img {
  display: block;
  width: 100%;
  height: 100%;
  max-width: 100%;
  object-fit: cover;
}
.inventory-form input:focus,
.inventory-form select:focus,
.inventory-form textarea:focus {
  outline: 2px solid var(--focus);
  outline-offset: 1px;
  border-color: var(--purple);
}
.inventory-form-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 18px;
}
@media (max-width: 760px) {
  .inventory-form .inventory-grid { grid-template-columns: 1fr; }
  .inventory-form .inventory-create-minimal { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .inventory-form .inventory-create-minimal .inventory-grid-wide { grid-column: 1 / -1; }
  .inventory-form .inventory-create-minimal input,
  .inventory-form .inventory-create-minimal select { min-width: 0; }
  .inventory-price-block { grid-template-columns: 1fr; }
}

.inventory-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}
@media (min-width: 650px) {
  .inventory-list {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  }
}
.inventory-row {
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--paper-raised);
  padding: 12px;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.inventory-row-head {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1 1 auto;
  min-height: 0;
}
.inventory-row-thumbnail {
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--r-xs);
  background: var(--ivory);
  flex-shrink: 0;
}
.inventory-row-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.inventory-row-thumbnail-empty {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  background:
    repeating-linear-gradient(135deg, rgba(18, 53, 47, 0.03) 0 6px, transparent 6px 14px),
    var(--ivory);
}
.inventory-row-name { margin: 0; color: var(--forest); font-weight: 600; letter-spacing: 0.03em; font-size: 0.95rem; line-height: 1.3; }
.inventory-row-meta { margin: 0; color: var(--muted); font-size: 0.76rem; display: flex; flex-wrap: wrap; gap: 4px 10px; line-height: 1.4; }
.inventory-row-meta .status-pill { margin-right: 2px; }
.inventory-row-edit { margin-top: auto; }
.inventory-row-edit > summary {
  list-style: none;
  cursor: pointer;
  user-select: none;
  display: inline-block;
  padding: 5px 12px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  color: var(--ink-soft);
  font-size: 0.8rem;
  letter-spacing: 0.06em;
}
.inventory-row-edit > summary::-webkit-details-marker { display: none; }
.inventory-row-edit[open] > summary { background: var(--forest); color: var(--ivory-light); border-color: var(--forest); }
.inventory-row-edit > form { margin-top: 12px; border-top: 1px solid var(--line); padding-top: 12px; }
.inventory-archive-form { margin-top: 10px; }
.inventory-archive-form .form-note { margin: 5px 0 0; }
@media (max-width: 650px) {
  .inventory-row { padding: 14px 16px; }
  .inventory-row-head { gap: 10px; }
  .inventory-row-thumbnail { aspect-ratio: 4 / 3; }
  .inventory-row-name { font-size: 1rem; }
  .inventory-row-meta { font-size: 0.82rem; }
}

.status-pill.status-draft { background: rgba(99, 113, 108, 0.16); color: var(--ink-soft); }
.status-pill.status-active { background: rgba(18, 53, 47, 0.92); color: var(--ivory-light); }
.status-pill.status-archived { background: rgba(138, 51, 36, 0.16); color: var(--danger-deep); }

/* ----- Hero override on storefront (smaller than homepage hero) ----- */
.storefront-page .hero { margin-bottom: 54px; }
.storefront-page .hero h1 { font-size: clamp(1.9rem, 4.6vw, 3rem); }

/* ------------------------------------------------------------------ */
/*  API Key Management UX (DEC-024 Stage 2 UX improvements)           */
/* ------------------------------------------------------------------ */

.api-key-intro {
  margin-bottom: var(--s6);
  padding: var(--s5);
  border: 1px solid var(--purple-line);
  border-radius: var(--r-md);
  background: rgba(246, 241, 230, 0.6);
}
.api-key-intro .eyebrow { margin-bottom: var(--s3); color: var(--purple); }
.intro-content p { margin: 0 0 var(--s3); line-height: 1.7; }
.intro-content p:last-child { margin-bottom: 0; }
.intro-content code { background: var(--paper); padding: 2px 6px; border-radius: var(--r-xs); font-size: 0.9em; }
.intro-content .warning { color: var(--danger-deep); background: var(--danger-bg); padding: var(--s3); border-radius: var(--r-sm); border-left: 3px solid var(--danger-line); }

.api-key-user-block { margin-top: var(--s4); }
.api-key-user-block h3 { margin: 0 0 var(--s3); color: var(--forest); font-size: 1.1rem; }

.api-key-user-details { border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--white); }
.api-key-user-summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--s3) var(--s4);
  cursor: pointer;
  user-select: none;
  list-style: none;
  gap: var(--s3);
}
.api-key-user-summary::-webkit-details-marker { display: none; }
.api-key-user-summary::before {
  content: "▾";
  display: inline-block;
  font-size: 0.6rem;
  color: var(--purple);
  transition: transform 150ms ease;
  flex-shrink: 0;
}
.api-key-user-details[open] > .api-key-user-summary::before { transform: rotate(180deg); }
.api-key-user-summary:hover,
.api-key-user-summary:focus-visible { background: var(--paper-raised); outline: 2px solid var(--purple); outline-offset: -2px; }
.api-key-user-name { font-weight: 600; color: var(--forest); font-size: 0.95rem; }
.api-key-user-meta { color: var(--muted); font-size: 0.82rem; white-space: nowrap; }
.api-key-user-body { padding: var(--s3) var(--s4); border-top: 1px solid var(--line); }
.staff-user-list { display: flex; flex-direction: column; gap: var(--s2); }
.staff-user-details { margin-top: 0; }
.staff-user-meta-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s2) var(--s4); color: var(--muted); font-size: 0.84rem; }
.staff-user-meta-grid strong { color: var(--forest); }
.staff-user-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2); margin-top: var(--s3); }
.staff-user-actions .inline-form { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2); }
@media (max-width: 600px) {
  .staff-user-meta-grid { grid-template-columns: 1fr; }
  .staff-user-actions, .staff-user-actions .inline-form { width: 100%; }
  .staff-user-actions .inline-form input[type="password"], .staff-user-actions .inline-form button { width: 100%; }
}

.api-keys-list { display: flex; flex-direction: column; gap: var(--s2); }
.api-key-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--s3);
  padding: var(--s2) var(--s3);
  border: 1px solid var(--line);
  border-radius: var(--r-xs);
  background: var(--paper-raised);
}
.api-key-row-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.api-key-row-primary { display: flex; align-items: center; gap: var(--s2); flex-wrap: wrap; }
.api-key-label { font-weight: 600; color: var(--forest); font-size: 0.88rem; }
.api-key-hash { font-family: monospace; font-size: 0.8rem; color: var(--ink-soft); background: var(--paper); padding: 1px 4px; border-radius: var(--r-xs); }
.api-key-status { flex-shrink: 0; }
.api-key-row-secondary { display: flex; align-items: center; gap: var(--s3); flex-wrap: wrap; font-size: 0.78rem; color: var(--muted); }
.api-key-scopes { display: flex; gap: 4px; flex-wrap: wrap; }
.api-key-dates { white-space: nowrap; }
.api-key-row-actions { display: flex; gap: var(--s2); flex-shrink: 0; align-items: center; }
.api-keys-empty { color: var(--muted); font-size: 0.85rem; margin: var(--s2) 0; }

.api-key-create-details { margin-top: var(--s3); border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--white); }
.api-key-create-summary {
  padding: var(--s2) var(--s3);
  cursor: pointer;
  list-style: none;
  font-size: 0.85rem;
  color: var(--forest);
  font-weight: 600;
}
.api-key-create-summary::-webkit-details-marker { display: none; }
.api-key-create-summary::before { content: "+ "; font-weight: 400; color: var(--purple); }
.api-key-create-summary:hover,
.api-key-create-summary:focus-visible { background: var(--paper-raised); }
.api-key-create-details[open] > .api-key-create-summary::before { content: "− "; }
.api-key-create-body { padding: var(--s3); border-top: 1px solid var(--line); }

.api-key-form-grid { display: grid; gap: var(--s3); grid-template-columns: 1fr; }
.api-key-form-row { display: grid; gap: var(--s3); grid-template-columns: 1fr; }
@media (min-width: 600px) {
  .api-key-form-row { grid-template-columns: 2fr 1fr; }
}
.api-key-expiry-field { }
.api-key-form-grid .scope-fieldset { grid-column: 1 / -1; }

@media (max-width: 600px) {
  .api-key-form-row { grid-template-columns: 1fr; }
}

.scope-badge {
  display: inline-block;
  padding: 2px 8px;
  margin: 2px 4px 2px 0;
  border: 1px solid var(--purple-line);
  border-radius: var(--r-xs);
  background: var(--paper-raised);
  color: var(--forest);
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.api-key-create-card { margin-top: var(--s5); }
.create-key-intro {
  margin: 0 0 var(--s5);
  padding: var(--s4);
  border: 1px solid var(--danger-line);
  border-radius: var(--r-sm);
  background: var(--danger-bg);
  color: var(--danger-deep);
  font-size: 0.9rem;
  line-height: 1.6;
}
.create-key-intro strong { color: var(--danger); }

.scope-fieldset { border: 0; padding: 0; margin: 0; }
.scope-fieldset legend { margin-bottom: var(--s2); color: var(--forest-deep); font-size: 0.85rem; font-weight: 700; }
.scope-fieldset .required-marker { color: var(--danger); }
.scope-help { margin: 0 0 var(--s2); color: var(--muted); font-size: 0.78rem; line-height: 1.4; }
.scope-help code { background: var(--paper); padding: 1px 4px; border-radius: var(--r-xs); font-size: 0.9em; }
.scope-checkboxes { display: flex; flex-wrap: wrap; gap: var(--s1); }
.scope-checkbox {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: var(--r-xs);
  background: var(--white);
  cursor: pointer;
  transition: border-color 120ms ease, background 120ms ease;
  white-space: nowrap;
}
.scope-checkbox:hover,
.scope-checkbox:focus-within { border-color: var(--purple-line); background: rgba(246, 241, 230, 0.5); }
.scope-checkbox input { flex: 0 0 auto; width: 15px; height: 15px; margin: 0; accent-color: var(--purple); }
.scope-label { line-height: 1.3; color: var(--ink); font-size: 0.8rem; }
.scope-label strong { color: var(--forest); font-family: monospace; font-size: 0.78rem; }
.scope-checkbox.compact { padding: 4px 8px; }
.scope-checkbox.compact input { width: 14px; height: 14px; }
.scope-checkbox.compact .scope-label { font-size: 0.78rem; }

.agent-guide-panel { border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--white); overflow: hidden; margin-top: var(--s3); }
.agent-guide-summary {
  display: flex;
  align-items: center;
  gap: var(--s2);
  padding: var(--s2) var(--s3);
  cursor: pointer;
  list-style: none;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--forest);
  background: var(--paper-raised);
  border-bottom: 1px solid var(--line);
}
.agent-guide-summary::-webkit-details-marker { display: none; }
.agent-guide-summary::before { content: "▾"; display: inline-block; font-size: 0.6rem; color: var(--purple); transition: transform 150ms ease; }
.agent-guide-panel[open] > .agent-guide-summary::before { transform: rotate(180deg); }
.agent-guide-summary:hover,
.agent-guide-summary:focus-visible { background: rgba(122, 95, 38, 0.1); outline: 2px solid var(--purple); outline-offset: -2px; }
.agent-guide-content { padding: var(--s3); display: grid; gap: var(--s3); }
.agent-guide-content .form-note { margin: 0; }
.agent-config-textarea { width: 100%; min-height: 200px; padding: var(--s3); border: 1px solid var(--line); border-radius: var(--r-xs); background: var(--paper-raised); font-family: monospace; font-size: 0.78rem; line-height: 1.5; color: var(--forest-deep); resize: vertical; }
@media (max-width: 600px) {
  .agent-config-textarea { font-size: 0.72rem; min-height: 160px; }
}

.api-key-result-panel { margin-top: var(--s5); }
.api-key-result-panel .warning { background: var(--warning); color: var(--ivory-light); }
.raw-key-content { margin-top: var(--s4); }
.raw-key-warning { margin: 0 0 var(--s4); padding: var(--s3); border: 1px solid var(--danger-line); border-radius: var(--r-sm); background: var(--danger-bg); color: var(--danger-deep); font-size: 0.9rem; line-height: 1.6; }
.raw-key-display {
  display: flex;
  gap: var(--s3);
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: var(--s4);
  padding: var(--s4);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-sm);
  background: var(--paper-raised);
}
.raw-key-display code {
  flex: 1 1 auto;
  min-width: 0;
  word-break: break-all;
  font-size: 0.85rem;
  line-height: 1.5;
  color: var(--forest-deep);
  background: var(--white);
  padding: var(--s3);
  border: 1px solid var(--line);
  border-radius: var(--r-xs);
}
.copy-button { flex: 0 0 auto; white-space: nowrap; }

@media (max-width: 650px) {
  .api-key-user-summary { padding: var(--s2) var(--s3); }
  .api-key-user-body { padding: var(--s2) var(--s3); }
  .api-key-row { flex-direction: column; gap: var(--s2); }
  .api-key-row-actions { width: 100%; justify-content: flex-end; }
  .api-key-row-actions form { flex: 1; }
  .api-key-row-actions .inline-form { width: 100%; margin: 0; }
  .api-key-row-actions .secondary-action.compact { width: 100%; }
  .scope-badge { font-size: 0.7rem; padding: 1px 6px; }
  .raw-key-display { flex-direction: column; align-items: stretch; }
  .raw-key-display code { font-size: 0.8rem; }
  .copy-button { width: 100%; }
}

/* ------------------------------------------------------------------ */
/*  API Connection Guide (admin-only, in API key section)             */
/* ------------------------------------------------------------------ */

.api-connection-guide {
  margin-top: var(--s6);
  padding: var(--s5);
  border: 1px solid var(--purple-line);
  border-radius: var(--r-md);
  background: rgba(246, 241, 230, 0.4);
}

.api-connection-guide .section-heading {
  margin-bottom: var(--s4);
}

.api-guide-details {
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--white);
  overflow: hidden;
}

.api-guide-details summary {
  padding: var(--s3) var(--s4);
  cursor: pointer;
  color: var(--forest);
  font-weight: 600;
  font-size: 0.95rem;
  background: var(--paper-raised);
  border-bottom: 1px solid var(--line);
  list-style: none;
}
.api-guide-details summary::-webkit-details-marker { display: none; }
.api-guide-details summary::before {
  content: "▾";
  display: inline-block;
  margin-right: var(--s2);
  font-size: 0.7rem;
  transition: transform 120ms ease;
  color: var(--purple);
}
.api-guide-details[open] summary::before {
  transform: rotate(180deg);
}
.api-guide-details summary:hover,
.api-guide-details summary:focus-visible {
  background: rgba(122, 95, 38, 0.1);
  outline: 2px solid var(--purple);
  outline-offset: -2px;
}

.api-guide-content {
  padding: var(--s5);
  display: grid;
  gap: var(--s5);
}

.guide-section h4 {
  margin: 0 0 var(--s3);
  color: var(--forest);
  font-size: 1rem;
  font-weight: 500;
  padding-bottom: var(--s2);
  border-bottom: 1px solid var(--line);
}

.guide-row {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: var(--s4);
  align-items: start;
  margin-bottom: var(--s3);
}

.guide-label {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  white-space: nowrap;
  padding-top: 2px;
}

.guide-value {
  display: grid;
  gap: var(--s2);
}

.code-block {
  position: relative;
  display: flex;
  align-items: center;
  gap: var(--s3);
  padding: var(--s3);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--paper-raised);
  overflow-x: auto;
}
.code-block code {
  flex: 1 1 auto;
  min-width: 0;
  word-break: break-all;
  font-size: 0.82rem;
  line-height: 1.5;
  color: var(--forest-deep);
  background: var(--white);
  padding: var(--s2) var(--s3);
  border: 1px solid var(--line);
  border-radius: var(--r-xs);
}
.code-block .copy-button {
  flex: 0 0 auto;
  white-space: nowrap;
  min-height: 36px;
  padding: 6px 12px;
  font-size: 0.78rem;
}

.curl-example {
  white-space: pre-wrap;
  word-break: break-word;
}
.curl-example code {
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 0.78rem;
  line-height: 1.6;
}

.guide-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}
.guide-table th,
.guide-table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}
.guide-table th {
  color: var(--muted);
  font-weight: 700;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: var(--paper-raised);
}
.guide-table td {
  color: var(--ink-soft);
}
.guide-table code {
  background: var(--paper);
  padding: 1px 4px;
  border-radius: var(--r-xs);
  font-size: 0.85em;
}

@media (max-width: 650px) {
  .guide-row {
    grid-template-columns: 1fr;
    gap: var(--s1);
  }
  .guide-label {
    padding-top: 0;
  }
  .code-block {
    flex-direction: column;
    align-items: stretch;
    gap: var(--s2);
  }
  .code-block .copy-button {
    width: 100%;
  }
  .curl-example code {
    font-size: 0.74rem;
  }
  .guide-table th,
  .guide-table td {
    padding: 6px 8px;
    font-size: 0.78rem;
  }
}

/* ------------------------------------------------------------------ */
/*  Drafts tab — 草稿箱 (DEC-024 follow-on)                              */
/*  Compact responsive cards for AI drafts, import drafts, and         */
/*  product drafts. Reuses existing colour tokens and spacing.         */
/* ------------------------------------------------------------------ */

.draft-cards {
  display: grid;
  gap: var(--s3);
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

@media (max-width: 820px) {
  .draft-cards {
    grid-template-columns: 1fr;
  }
}

.draft-card {
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  gap: var(--s2);
  padding: var(--s3);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--white);
  box-shadow: var(--shadow-card);
}

.draft-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s2);
  flex-wrap: wrap;
}

.draft-id {
  color: var(--purple);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.draft-card-thumb {
  aspect-ratio: 4 / 3;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--ivory);
  overflow: hidden;
}

.draft-card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.draft-card-thumb a {
  display: block;
  width: 100%;
  height: 100%;
}

.draft-card-thumb a:hover img,
.draft-card-thumb a:focus-visible img {
  transform: scale(1.02);
}

.draft-card-thumb-empty {
  color: var(--muted);
  font-size: 0.82rem;
  letter-spacing: 0.06em;
  text-align: center;
  padding: var(--s3);
}

.draft-card-body {
  display: grid;
  gap: var(--s1);
  min-width: 0;
}

.draft-product-name {
  margin: 0;
  color: var(--forest);
  font-size: 1rem;
  font-weight: 500;
  line-height: 1.3;
  word-break: break-word;
}

.draft-customer {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.82rem;
  line-height: 1.4;
}

.draft-summary {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.86rem;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  overflow: hidden;
  text-overflow: ellipsis;
  word-break: break-word;
}

.draft-summary[data-summary-clamped="false"] {
  display: block;
  -webkit-line-clamp: unset;
  line-clamp: unset;
  overflow: visible;
}

.draft-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s1);
  margin: 0;
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.4;
}

.draft-meta .meta-piece {
  display: inline-flex;
  align-items: baseline;
  gap: 2px;
  min-width: 0;
}

.draft-meta .meta-sep {
  color: var(--line-strong);
  font-weight: 700;
  user-select: none;
}

.draft-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s2);
  padding-top: var(--s2);
  border-top: 1px solid var(--line);
}

.draft-card-actions .primary-action,
.draft-card-actions .secondary-action {
  min-height: 38px;
  padding: 7px 14px;
  font-size: 0.82rem;
}

.confirm-draft-form .form-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.confirm-draft-form .primary-action {
  width: 100%;
}

/* Final shared hero sizing: storefront and legacy contact page */
.storefront-page .hero,
.legacy-storefront-hero {
  min-height: 0 !important;
  height: auto !important;
  max-height: none !important;
  padding: 56px 20px !important;
  margin-bottom: 40px;
}
.legacy-storefront-hero h1 {
  font-size: clamp(1.9rem, 4.6vw, 3rem) !important;
}
@media (max-width: 768px) {
  .storefront-page .hero,
  .legacy-storefront-hero {
    min-height: 0 !important;
    height: auto !important;
    max-height: none !important;
    padding: 44px 20px !important;
    margin-bottom: 28px;
  }
  .legacy-storefront-hero h1 {
    font-size: clamp(1.9rem, 4.6vw, 3rem) !important;
  }
}

.storefront-footer-joke {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.5;
  letter-spacing: 0.02em;
}

@media (max-width: 650px) {
  .mounting-hero-tools .display-mode-toggle {
    align-self: flex-end;
  }
}


/* Facebook importer: show the next action without making admins decode statuses. */
.facebook-import-steps {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  list-style: none;
  margin: 18px 0 0;
  padding: 0;
}
.facebook-import-steps li {
  display: grid;
  gap: 6px;
  color: var(--ink-soft);
  font-size: .85rem;
}
.facebook-import-steps strong {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: var(--surface-muted);
  color: var(--ink);
}
@media (max-width: 640px) {
  .facebook-import-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}


.facebook-control-grid {
  display: grid;
  grid-template-columns: minmax(0, 4fr) minmax(180px, 1fr);
  gap: var(--s4);
  align-items: start;
}
.facebook-control-grid > .workspace-card { min-width: 0; }
.facebook-history { margin-top: var(--s4); padding-top: var(--s3); border-top: 1px solid var(--line); }
.facebook-history > summary { cursor: pointer; font-weight: 700; color: var(--ink-soft); }
@media (max-width: 760px) {
  .facebook-control-grid { grid-template-columns: 1fr; }
}

.facebook-login-status {
  max-width: 340px;
  margin-top: var(--s4);
}

.inventory-create-collapsible > summary { cursor: pointer; list-style: none; }
.inventory-create-collapsible > summary::-webkit-details-marker { display: none; }
.inventory-create-collapsible > summary::after { content: '+'; font-size: 1.25rem; color: var(--accent); margin-left: auto; }
.inventory-create-collapsible[open] > summary::after { content: '−'; }


/* Facebook review: compact square thumbnails; click opens the full image. */
.facebook-inline-review .screenshot-gallery {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: var(--s2);
  width: 100%;
  min-width: 0;
  overflow: visible;
  padding-bottom: 2px;
}
.facebook-inline-review .screenshot-thumb {
  min-width: 0;
  width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
}
.facebook-inline-review .screenshot-preview-link {
  display: block;
  width: 100%;
  height: 100%;
  overflow: hidden;
}
.facebook-inline-review .facebook-review-thumb-img {
  display: block !important;
  width: 100% !important;
  height: 100% !important;
  max-width: 100% !important;
  max-height: 100% !important;
  object-fit: contain !important;
  object-position: center !important;
}
.facebook-inline-review .screenshot-thumb figcaption {
  display: none;
}
@media (max-width: 760px) {
  .facebook-inline-review .screenshot-gallery {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    overflow: visible;
  }
}


.facebook-import-actions {
  display: flex;
  align-items: end;
  gap: var(--s2);
}
.facebook-import-actions button {
  white-space: nowrap;
}
@media (max-width: 520px) {
  .facebook-import-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
}

/* ------------------------------------------------------------------ */
/* Facebook review dialog. The pending-job list opens the review card  */
/* in place (app/static/portal.js) instead of reloading the page, so   */
/* the operator keeps their place in the queue. The dialog reuses the  */
/* backdrop / close-button language of the image preview dialog.       */
/* ------------------------------------------------------------------ */
.facebook-review-modal-backdrop {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(10, 33, 29, 0.72);
  z-index: 1100;
  overscroll-behavior: contain;
}
.facebook-review-modal-backdrop[hidden] { display: none; }
.facebook-review-modal {
  position: relative;
  display: grid;
  gap: var(--s3);
  width: min(100%, 780px);
  max-height: min(92vh, 940px);
  overflow: auto;
  padding: 18px 20px 20px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--white);
  box-shadow: var(--shadow);
}
.facebook-review-modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--s3);
}
.facebook-review-modal-title {
  margin: 0;
  color: var(--forest);
  font-size: 1.05rem;
  font-weight: 500;
  letter-spacing: 0.01em;
}
.facebook-review-modal-desc {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.88rem;
  line-height: 1.55;
}
.facebook-review-modal-close {
  flex: 0 0 auto;
  width: 48px;
  height: 48px;
  min-width: 48px;
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 1px solid var(--purple);
  border-radius: 999px;
  font: inherit;
  font-size: 1.6rem;
  font-weight: 700;
  line-height: 1;
  color: var(--forest);
  background: var(--white);
  cursor: pointer;
}
.facebook-review-modal-close:hover,
.facebook-review-modal-close:focus-visible {
  background: var(--paper-raised);
  outline: 2px solid var(--purple);
  outline-offset: 2px;
}
.facebook-review-modal-body { min-width: 0; }
/* The review card is a workspace card on the page; inside the dialog it
   must not draw a second frame around the dialog frame. */
.facebook-review-modal-body .workspace-card {
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
.facebook-review-modal-body .workspace-card .section-heading {
  margin-bottom: var(--s3);
}
@media (max-width: 650px) {
  .facebook-review-modal {
    padding: 14px 14px 16px;
    max-height: 94vh;
  }
}

/* Identity line of the inline review card: the pending-row sequence
   number plus the 8-character job id. */
.facebook-review-identity {
  display: flex;
  align-items: center;
  gap: var(--s2);
  margin: var(--s2) 0 0;
}
.facebook-review-heading-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: var(--s2);
}
.facebook-review-heading-actions .inline-form { margin: 0; }

