/* POD Hub admin — hand-written port of the FrontendWP Admin look (cloaked tokens:
   themes/cloaked/tokens.json, components/admin/*). No build step. */

:root {
  --cream: #FBF8EE;
  --sand: #F3EEE2;
  --hairline: #E7E0CE;
  --ink: #130F02;
  --stone: #6B6456;
  --ember: #FF550C;
  --ember-hover: #E84A05;
  --ember-text: #C2410C;
  --ember-soft: rgba(255, 85, 12, 0.15);
  --white: #FFFFFF;
  --green-700: #15803D;
  --green-soft: rgba(21, 128, 61, 0.10);
  --red-700: #B91C1C;
  --red-soft: rgba(185, 28, 28, 0.09);
  --radius-card: 1.75rem;
  --radius-tile: 1rem;
  --radius-pill: 9999px;
  --font: "Be Vietnam Pro", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--cream); color: var(--ink);
  font-family: var(--font); font-size: 15px; line-height: 1.55;
  overflow-x: hidden;
}
body.no-scroll { overflow: hidden; }
[hidden] { display: none !important; }
h1, h2, h3, h4 { font-weight: 600; line-height: 1.25; margin: 0 0 .5rem; letter-spacing: 0; }
h1 { font-size: 1.625rem; }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.0625rem; }
h4 { font-size: .9375rem; }
p { margin: .5rem 0; }
a { color: var(--ember-text); text-underline-offset: 2px; }
a:hover { text-decoration: underline; }
code, .mono { font-family: var(--mono); font-size: .85em; }
code { background: var(--sand); border-radius: 6px; padding: .1em .35em; overflow-wrap: anywhere; }
.muted { color: var(--stone); }
.small { font-size: .8125rem; }
.icon { width: 1.25rem; height: 1.25rem; flex: none; }
:focus-visible { outline: 2px solid var(--ember); outline-offset: 2px; }

/* ── shell ─────────────────────────────────────────────────────────────── */
.shell { min-height: 100vh; }
@media (min-width: 1024px) { .shell { display: flex; } }
.sidebar {
  display: none; position: sticky; top: 0; height: 100vh; width: 16rem; flex: none;
  border-right: 1px solid var(--hairline);
}
@media (min-width: 1024px) { .sidebar { display: block; } }
.sidebar-inner { display: flex; flex-direction: column; height: 100%; background: var(--white); }
.sidebar-brand {
  display: flex; align-items: center; gap: .5rem; height: 4rem; flex: none;
  padding: 0 4rem 0 1.25rem; border-bottom: 1px solid var(--hairline);
  color: var(--ink); text-decoration: none; font-weight: 600; font-size: 1rem;
}
@media (min-width: 1024px) { .sidebar-brand { padding-right: 1.25rem; } }
.sidebar-brand:hover { text-decoration: none; }
.brand-mark { width: .75rem; height: .75rem; background: var(--ember); border-radius: 2px; transform: rotate(45deg); flex: none; }
.brand-sub { font-weight: 400; font-size: .875rem; color: var(--stone); }
.sidebar-nav { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 0 .75rem 1.5rem; }
.sidebar-nav ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .125rem; }
.nav-group {
  margin: 0; padding: 1.25rem .75rem .375rem; font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .06em; color: var(--stone);
}
.nav-link {
  display: flex; align-items: center; gap: .75rem; min-height: 2.5rem; padding: 0 .75rem;
  border-radius: var(--radius-pill); font-size: .875rem; color: var(--stone); text-decoration: none;
  transition: background-color .15s, color .15s;
}
.nav-link:hover { background: var(--sand); color: var(--ink); text-decoration: none; }
.nav-link.is-active { background: var(--ember-soft); color: var(--ink); font-weight: 500; }
.nav-link.is-active .icon { color: var(--ember-text); }
.nav-link.is-disabled { cursor: not-allowed; opacity: .6; }
.nav-link.is-disabled:hover { background: transparent; color: var(--stone); }
.nav-text { min-width: 0; line-height: 1.25; padding: .375rem 0; }
.nav-hint { display: block; font-size: 11px; }
.sidebar-user {
  display: flex; align-items: center; gap: .75rem; flex: none;
  padding: 1rem 1.25rem; border-top: 1px solid var(--hairline); font-size: .875rem;
}
.avatar {
  display: inline-flex; align-items: center; justify-content: center; width: 2.25rem; height: 2.25rem;
  border-radius: 50%; background: var(--sand); font-weight: 600; text-transform: uppercase; flex: none;
}

.shell-main { min-width: 0; flex: 1; }
.topbar {
  position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: .75rem;
  height: 4rem; padding: 0 1rem; background: var(--white); border-bottom: 1px solid var(--hairline);
}
@media (min-width: 640px) { .topbar { padding: 0 1.5rem; } }
.menu-btn { flex: none; }
@media (min-width: 1024px) { .icon-btn.menu-btn { display: none; } }
.breadcrumb { min-width: 0; flex: 1; }
.breadcrumb ol { display: flex; align-items: center; gap: .375rem; list-style: none; margin: 0; padding: 0; font-size: .875rem; min-width: 0; }
.crumb { display: none; color: var(--stone); flex: none; }
.crumb span { margin-left: .375rem; }
@media (min-width: 640px) { .crumb { display: block; } }
.crumb-current { font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar-right { display: flex; align-items: center; gap: .75rem; flex: none; font-size: .875rem; }
.topbar-right form { margin: 0; }
.topbar-user { display: none; color: var(--stone); }
@media (min-width: 768px) { .topbar-user { display: inline; } }
@media (max-width: 479px) { .topbar-right .btn span { display: none; } .topbar-right .btn { padding: 0 .75rem; } }

.content { width: 100%; max-width: 75rem; margin: 0 auto; padding: 1.5rem 1rem 3rem; }
@media (min-width: 640px) { .content { padding: 2rem 1.5rem 3rem; } }
@media (min-width: 1024px) { .content { padding: 2rem 2rem 3rem; } }

.drawer { position: fixed; inset: 0; z-index: 50; }
.drawer-backdrop { position: absolute; inset: 0; background: rgba(19, 15, 2, .6); }
.drawer-panel {
  position: absolute; top: 0; bottom: 0; left: 0; width: 18rem; max-width: 85vw;
  background: var(--white); border-right: 1px solid var(--hairline); box-shadow: 0 20px 40px rgba(19, 15, 2, .25);
}
.drawer-close { position: absolute; right: .75rem; top: .75rem; z-index: 2; background: var(--white); }

/* bare layout (login) */
.bare { display: flex; min-height: 100vh; align-items: center; justify-content: center; padding: 2.5rem 1rem; }
.bare-card { width: 100%; max-width: 26rem; }

/* ── building blocks ───────────────────────────────────────────────────── */
.page-header { margin-bottom: 1.5rem; }
.page-header .muted { margin: .25rem 0 0; }
.back-link { display: inline-flex; align-items: center; min-height: 2.5rem; font-size: .875rem; font-weight: 500; }

.card {
  background: var(--white); border: 1px solid var(--hairline); border-radius: var(--radius-card);
  padding: 1.25rem; margin: 0 0 1.5rem; min-width: 0;
}
@media (min-width: 640px) { .card { padding: 1.5rem 2rem; } }
.card > :first-child { margin-top: 0; }
.card > :last-child { margin-bottom: 0; }
.card-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem 1rem; margin-bottom: .75rem; }
.card-head h2, .card-head h3 { margin: 0; }
.tile { background: var(--sand); border-radius: var(--radius-tile); padding: 1rem 1.25rem; margin: .75rem 0; min-width: 0; }
.tile > :first-child { margin-top: 0; }
.tile > :last-child { margin-bottom: 0; }
.grid-2 { display: grid; gap: 0; }
@media (min-width: 900px) { .grid-2 { grid-template-columns: 1fr 1fr; gap: 1.5rem; margin-bottom: 1.5rem; } .grid-2 > .card { margin: 0; } }
.stats { display: flex; flex-wrap: wrap; gap: .5rem; margin: .5rem 0 1rem; padding: 0; list-style: none; }
.stats li { background: var(--sand); border-radius: var(--radius-pill); padding: .25rem .75rem; font-size: .8125rem; }
.stats strong { font-weight: 600; }
hr.rule { border: 0; border-top: 1px solid var(--hairline); margin: 1.5rem 0; }

/* buttons — pills, ≥ 40px tall */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  min-height: 2.75rem; padding: .375rem 1.25rem; border-radius: var(--radius-pill);
  border: 1px solid transparent; font: inherit; font-size: .9375rem; font-weight: 500; line-height: 1.2;
  cursor: pointer; text-decoration: none; text-align: center; transition: background-color .15s, border-color .15s, color .15s;
}
.btn:hover { text-decoration: none; }
.btn .icon { width: 1.125rem; height: 1.125rem; }
/* Owner request 2026-10-01: white text on ember buttons; redesigned — deeper ember gradient, soft shadow, one line. */
.btn-primary {
  background: linear-gradient(180deg, #FF6A2B 0%, var(--ember) 55%, var(--ember-hover) 100%);
  color: #fff; font-weight: 600; white-space: nowrap; border-color: rgba(194, 65, 12, .35);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .25) inset, 0 2px 6px rgba(194, 65, 12, .28);
}
.btn-primary:hover { background: linear-gradient(180deg, var(--ember) 0%, var(--ember-hover) 100%); box-shadow: 0 1px 0 rgba(255, 255, 255, .2) inset, 0 3px 10px rgba(194, 65, 12, .35); }
.btn-primary:active { background: var(--ember-text); box-shadow: none; }
.btn-primary:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.btn-outline { background: transparent; color: var(--ink); border-color: rgba(19, 15, 2, .8); }
.btn-outline:hover { background: var(--ink); color: var(--cream); }
.btn-outline:hover .tag-paid { background: var(--ember); color: var(--ink); }
.btn-dark { background: var(--ink); color: var(--cream); }
.btn-dark:hover { background: #2E281B; }
.btn-danger { background: var(--red-700); color: var(--white); }
.btn-danger:hover { background: #991B1B; }
.btn-lg { min-height: 2.75rem; padding: .5rem 1.5rem; font-size: .9375rem; }
.btn[disabled], .btn.htmx-request { opacity: .55; cursor: progress; }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center; width: 2.5rem; height: 2.5rem;
  border-radius: 50%; border: 1px solid var(--hairline); background: var(--white); color: var(--ink); cursor: pointer;
}
.icon-btn:hover { border-color: var(--stone); }
/* Paid API: same meaning as the old red .ai buttons — clicking spends API budget. */
.tag-paid {
  display: inline-flex; align-items: center; padding: .125rem .5rem; border-radius: var(--radius-pill);
  background: var(--ink); color: var(--cream); font-size: 11px; font-weight: 600; white-space: nowrap;
}
.btn-dark .tag-paid { background: var(--ember); color: var(--ink); }
.ran { font-size: 11px; font-weight: 600; color: var(--green-700); white-space: nowrap; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin: .75rem 0; }
.actions form { margin: 0; display: inline-flex; }
.legend { display: flex; flex-wrap: wrap; gap: .5rem 1.25rem; font-size: .8125rem; color: var(--stone); margin: 0 0 1.25rem; }
.legend > span { display: inline-flex; align-items: center; gap: .375rem; }

/* badges — icon + text, never color only */
.badge {
  display: inline-flex; align-items: center; gap: .3rem; min-height: 1.5rem; padding: .0625rem .625rem;
  border-radius: var(--radius-pill); font-size: .75rem; font-weight: 500; white-space: nowrap; text-decoration: none;
}
.badge-done { background: var(--green-soft); color: var(--green-700); }
.badge-wip { background: var(--ember-soft); color: var(--ember-text); }
.badge-pending { background: var(--sand); color: var(--stone); }
.badge-failed { background: var(--red-soft); color: var(--red-700); }
.badge-info { background: var(--sand); color: var(--ink); }
a.badge-link { display: inline-flex; align-items: center; min-height: 2.5rem; text-decoration: none; }
a.badge-link:hover .badge { box-shadow: inset 0 0 0 1px currentColor; }

/* forms — pill controls */
.field { margin: 0 0 1rem; min-width: 0; }
.field > label, .label { display: block; font-size: .875rem; font-weight: 500; margin-bottom: .375rem; }
.hint { font-size: .8125rem; color: var(--stone); margin: .375rem 0 0; }
.form-grid { display: grid; gap: 0 1.25rem; }
@media (min-width: 768px) { .form-grid { grid-template-columns: 1fr 1fr; } }
.input, .select, input[type=text], input[type=password], input[type=email], input[type=url], select {
  width: 100%; min-height: 2.75rem; padding: 0 1.25rem; border: 1px solid var(--hairline); border-radius: var(--radius-pill);
  background: var(--white); color: var(--ink); font: inherit; font-size: .9375rem;
}
select, select.select { padding-right: 2.5rem; appearance: none; -webkit-appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--stone) 50%), linear-gradient(135deg, var(--stone) 50%, transparent 50%);
  background-position: calc(100% - 1.25rem) 50%, calc(100% - .95rem) 50%; background-size: .35rem .35rem; background-repeat: no-repeat; }
.input:focus, input:focus, select:focus, textarea:focus { border-color: var(--stone); outline: 2px solid var(--ember); outline-offset: 1px; }
textarea {
  width: 100%; min-height: 12rem; padding: .75rem 1rem; border: 1px solid var(--hairline); border-radius: var(--radius-tile);
  background: var(--white); color: var(--ink); font-family: var(--mono); font-size: .8125rem; line-height: 1.5;
}
textarea.plain { font-family: var(--font); font-size: .9375rem; min-height: 5rem; }
.inline-form { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin: .5rem 0; }
.inline-form .input, .inline-form input[type=text] { flex: 1 1 14rem; width: auto; }
.check { display: inline-flex; align-items: center; gap: .5rem; min-height: 2.5rem; font-size: .875rem; cursor: pointer; }
.check input { width: 1.125rem; height: 1.125rem; accent-color: var(--ember); }
.error-text { color: var(--red-700); font-size: .875rem; }
.warn-text { color: #7C2D12; font-size: .875rem; overflow-wrap: anywhere; }

/* alerts */
.alert { border-radius: var(--radius-tile); padding: .875rem 1.125rem; margin: 0 0 1.25rem; border: 1px solid; font-size: .9375rem; }
.alert > :first-child { margin-top: 0; }
.alert > :last-child { margin-bottom: 0; }
.alert-ok { background: var(--green-soft); border-color: rgba(21, 128, 61, .3); color: #14532D; }
.alert-error { background: var(--red-soft); border-color: rgba(185, 28, 28, .3); color: #7F1D1D; }
.alert-warn { background: #FFF4EC; border-color: rgba(194, 65, 12, .35); color: #7C2D12; }
.alert-info { background: var(--sand); border-color: var(--hairline); }

/* tables — scroll inside their card on small screens */
.table-wrap { position: relative; overflow-x: auto; -webkit-overflow-scrolling: touch; margin: .75rem 0; border: 1px solid var(--hairline); border-radius: var(--radius-tile); }
.table-wrap:first-child { margin-top: 0; }
table { border-collapse: collapse; width: 100%; font-size: .875rem; }
th, td { padding: .625rem .875rem; text-align: left; vertical-align: middle; border-bottom: 1px solid var(--hairline); }
tr:last-child > td { border-bottom: 0; }
th { background: #FDFBF5; color: var(--stone); font-weight: 600; font-size: .75rem; white-space: nowrap; }
td.nowrap, th.nowrap { white-space: nowrap; }
tr.row-disabled td { color: var(--stone); }
td.num { font-variant-numeric: tabular-nums; }
.table-min { min-width: 44rem; }

/* store picker */
/* Store-scoped phase page: "back to the phase table" + store switcher on one row (wraps on phones). */
.store-bar { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem 1rem; margin: 0 0 1.25rem; }
.store-back { flex: none; }
.store-picker { display: flex; align-items: center; gap: .75rem; flex: 1 1 16rem; max-width: 26rem; }
.store-picker label { display: inline-flex; align-items: center; gap: .375rem; font-size: .875rem; font-weight: 500; color: var(--stone); white-space: nowrap; }
.store-picker .select { flex: 1; }

/* jobs / logs */
.job { border: 1px solid var(--hairline); border-radius: var(--radius-tile); padding: .75rem 1rem; margin: .75rem 0; background: var(--white); }
.job-head { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; font-size: .875rem; }
pre.log {
  background: var(--sand); border-radius: .75rem; padding: .75rem 1rem; margin: .625rem 0 0;
  max-height: 22rem; overflow: auto; font-family: var(--mono); font-size: .75rem; line-height: 1.5;
  white-space: pre-wrap; overflow-wrap: anywhere;
}
.log-line-E { color: var(--red-700); font-weight: 600; }
.log-line-W { color: var(--ember-text); }
.log-line-P { color: var(--green-700); }

/* thumbnails + lightbox */
.thumb-sm {
  width: 64px; height: 64px; object-fit: cover; border-radius: .75rem; border: 1px solid var(--hairline);
  cursor: zoom-in; display: block; margin-bottom: .375rem; background: var(--sand);
}
.lightbox-overlay {
  position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center;
  background: rgba(19, 15, 2, .85); cursor: zoom-out; padding: 1rem;
}
.lightbox-overlay img { max-width: 92vw; max-height: 90vh; border-radius: var(--radius-tile); background: var(--white); }

/* toasts */
#toast-container {
  position: fixed; top: 1rem; left: 50%; transform: translateX(-50%); z-index: 1100;
  display: flex; flex-direction: column; gap: .625rem; align-items: center; width: max-content; max-width: calc(100vw - 2rem);
  pointer-events: none;
}
.toast {
  display: flex; align-items: center; gap: .625rem; padding: .875rem 1.5rem; border-radius: var(--radius-tile);
  background: var(--green-700); color: var(--white); font-size: .9375rem; font-weight: 600; max-width: 32rem;
  box-shadow: 0 16px 40px rgba(19, 15, 2, .25);
  opacity: 0; transform: translateY(-.75rem); transition: opacity .25s ease, transform .25s ease;
}
.toast-error { background: var(--red-700); }
.toast-show { opacity: 1; transform: none; }

/* dashboard */
.store-cell { display: flex; flex-direction: column; align-items: flex-start; gap: .25rem; min-width: 8rem; }
.store-cell .badge { white-space: normal; border-radius: .75rem; }
.table-status th, .table-status td { padding: .5rem .5rem; }
.table-status th:first-child, .table-status td:first-child { padding-left: .875rem; }
.store-cell strong { font-weight: 600; }
.store-cell code { overflow-wrap: anywhere; }
.website-cell { min-width: 6rem; max-width: 12rem; overflow-wrap: anywhere; }
.row-actions { display: flex; gap: .25rem; white-space: nowrap; }
.row-actions a { display: inline-flex; align-items: center; min-height: 2.5rem; padding: 0 .5rem; font-weight: 500; }
.row-actions a.danger { color: var(--red-700); }
.pick-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; }
@media (min-width: 640px) { .pick-list { grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr)); } }
.pick-list a {
  display: flex; align-items: center; gap: .5rem; min-height: 3rem; padding: 0 1.25rem;
  border: 1px solid var(--hairline); border-radius: var(--radius-pill); background: var(--white); color: var(--ink); font-weight: 500;
}
.pick-list a:hover { border-color: var(--stone); text-decoration: none; }

/* phase "pick a store" table */
.filter-chips { display: flex; flex-wrap: wrap; gap: .5rem; margin: 0 0 1rem; }
.chip { display: inline-flex; align-items: center; min-height: 2.5rem; padding: 0 1rem; border: 1px solid var(--hairline); border-radius: var(--radius-pill); background: var(--white); color: var(--ink); font-weight: 500; font-size: .875rem; }
.chip:hover { border-color: var(--stone); text-decoration: none; }
.chip.is-active { background: var(--ink); border-color: var(--ink); color: var(--white); }
.figures { list-style: none; margin: 0; padding: 0; display: grid; gap: .125rem; font-size: .8125rem; color: var(--stone); white-space: nowrap; }
.row-actions .btn { padding: 0 1rem; color: #fff; }

/* phase 3 / 4 read-only pages */
.stat-row { display: flex; flex-wrap: wrap; gap: 1rem 2rem; margin: 0 0 .75rem; }
.stat-row dt { font-size: .8125rem; color: var(--stone); }
.stat-row dd { margin: 0; font-size: 1.5rem; font-weight: 600; }
.tree, .tree ul { list-style: none; margin: 0; padding-left: 1.25rem; border-left: 1px solid var(--hairline); }
.tree { padding-left: 0; border-left: 0; display: grid; gap: .75rem; }
.tree li > div, .tree li > ul > li { display: flex; flex-wrap: wrap; align-items: center; gap: .25rem .75rem; padding: .25rem 0; }
.tree-kw { font-weight: 500; overflow-wrap: anywhere; }
.plan-raw { max-height: 28rem; overflow: auto; background: var(--sand); border-radius: .75rem; padding: .75rem 1rem; font-size: .75rem; white-space: pre-wrap; overflow-wrap: anywhere; }
details > summary { cursor: pointer; min-height: 2.5rem; display: flex; align-items: center; font-weight: 500; }

/* security */
.secret-box { font-family: var(--mono); font-size: 1rem; letter-spacing: .08em; background: var(--sand); border-radius: .75rem; padding: .75rem 1rem; overflow-wrap: anywhere; }

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

/* login */
.login-brand { display: flex; align-items: center; gap: .5rem; justify-content: center; margin: 0 0 1rem; font-size: 1.0625rem; }
.login-submit { width: 100%; margin-top: .5rem; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

tr.job-row > td { padding: 0 .875rem; border-bottom: 0; }
tr.job-row > td:empty, tr.job-row > td > div:empty { padding: 0; }

/* sites / publish */
.wrap-anywhere { overflow-wrap: anywhere; }
a.cell-link { display: inline-flex; align-items: center; min-height: 2.5rem; }
.copy-row { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin: .5rem 0 1rem; }
.copy-row .secret-input { flex: 1 1 16rem; width: auto; min-width: 0; font-family: var(--mono); font-size: .8125rem; }
ol.steps { margin: .5rem 0 1rem; padding-left: 1.25rem; }
ol.steps li { margin: .375rem 0; }
.fieldset { border: 0; margin: 0 0 1rem; padding: 0; min-width: 0; }
.fieldset legend { padding: 0; }
.fieldset .check { margin-right: 1.25rem; }
.niche-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; }
.niche-item { border: 1px solid var(--hairline); border-radius: var(--radius-tile); padding: .25rem 1rem; min-width: 0; }
.niche-item.is-blocked { background: var(--sand); }
.niche-item .check { align-items: flex-start; padding: .5rem 0; }
.niche-item .check span { overflow-wrap: anywhere; }
.niche-item p { margin: 0 0 .5rem; }
.result-cell { min-width: 14rem; }
.badge.badge-wrap { white-space: normal; border-radius: .75rem; min-width: 0; }

/* lightbox close button */
.lightbox-close { position: absolute; top: 1rem; right: 1rem; width: 2.75rem; height: 2.75rem; }

/* full run: start form, run page (spec 2026-10-01-auto-pipeline-run-design.md §3) */
.choice-grid { display: grid; gap: .5rem; margin-bottom: .5rem; }
@media (min-width: 768px) { .choice-grid { grid-template-columns: 1fr 1fr; } }
.choice {
  display: flex; align-items: flex-start; gap: .625rem; min-height: 2.75rem; padding: .75rem 1rem; cursor: pointer;
  border: 1px solid var(--hairline); border-radius: var(--radius-tile); background: var(--white); min-width: 0;
}
.choice input { width: 1.125rem; height: 1.125rem; margin-top: .2rem; flex: none; accent-color: var(--ember); }
.choice:has(input:checked) { border-color: var(--ember); box-shadow: inset 0 0 0 1px var(--ember); }
.details > summary { cursor: pointer; min-height: 2.75rem; display: flex; align-items: center; font-weight: 500; }
.details > summary::marker { color: var(--stone); }
details.card > summary { list-style: none; }
details.card > summary::-webkit-details-marker { display: none; }
details.card > summary::before { content: "▸"; margin-right: .5rem; color: var(--stone); }
details.card[open] > summary::before { content: "▾"; }
.summary-title { display: inline; margin: 0; font-size: 1.25rem; }
.cost { margin: .75rem 0 1rem; }
.cost-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .25rem 1rem; font-size: .875rem; margin-bottom: .375rem; }
progress.cost-bar {
  display: block; width: 100%; height: .75rem; border: 0; border-radius: var(--radius-pill); overflow: hidden;
  background: var(--sand); color: var(--ember); appearance: none; -webkit-appearance: none;
}
progress.cost-bar::-webkit-progress-bar { background: var(--sand); border-radius: var(--radius-pill); }
progress.cost-bar::-webkit-progress-value { background: var(--ember); border-radius: var(--radius-pill); }
progress.cost-bar::-moz-progress-bar { background: var(--ember); border-radius: var(--radius-pill); }
progress.cost-bar.is-over::-webkit-progress-value { background: var(--red-700); }
progress.cost-bar.is-over::-moz-progress-bar { background: var(--red-700); }
.timeline { list-style: none; margin: .75rem 0; padding: 0; display: grid; gap: .375rem; }
.timeline-item {
  display: flex; flex-wrap: wrap; align-items: center; gap: .25rem .75rem; padding: .5rem .875rem; min-width: 0;
  border: 1px solid var(--hairline); border-radius: var(--radius-tile); background: var(--white);
}
.timeline-item.is-running, .timeline-item.is-review { border-color: var(--ember); }
.timeline-item.is-failed, .timeline-item.is-budget { border-color: rgba(185, 28, 28, .45); }
.timeline-name { font-weight: 500; flex: 1 1 12rem; min-width: 0; }
.compare-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .75rem; }
.compare-row { border: 1px solid var(--hairline); border-radius: var(--radius-tile); padding: .75rem 1rem; background: var(--white); min-width: 0; }
.compare-id { margin: 0 0 .5rem; overflow-wrap: anywhere; }
.compare-pair { display: grid; gap: .75rem; }
@media (min-width: 640px) { .compare-pair { grid-template-columns: 1fr 1fr; } }
.compare-cell { margin: 0; min-width: 0; overflow-wrap: anywhere; font-size: .875rem; }
.compare-cell figcaption { margin-top: .5rem; }
button.zoom { display: block; width: 100%; padding: 0; border: 0; background: none; cursor: zoom-in; border-radius: .75rem; }
.compare-img, .compare-empty {
  display: block; width: 100%; aspect-ratio: 1 / 1; max-height: 20rem; object-fit: contain; border-radius: .75rem;
  border: 1px solid var(--hairline); background: var(--sand);
}
.compare-empty { display: flex; align-items: center; justify-content: center; color: var(--stone); font-size: .875rem; padding: 1rem; text-align: center; }

/* ── language switch (VI | EN) ─────────────────────────────────────────── */
.lang-switch { display: inline-flex; flex: none; margin: 0; padding: 2px; border: 1px solid var(--hairline); border-radius: var(--radius-pill); background: var(--white); }
.lang-btn {
  min-width: 2.5rem; height: 2.5rem; padding: 0 .625rem; border: 0; border-radius: var(--radius-pill); background: transparent;
  color: var(--ink); font: inherit; font-size: .8125rem; font-weight: 600; cursor: pointer;
}
.lang-btn:hover { background: var(--sand); }
.lang-btn.is-active { background: var(--ink); color: var(--cream); }
.login-lang { display: flex; justify-content: center; margin: 0 0 1rem; }

/* ── help button + side panel ──────────────────────────────────────────── */
.help-btn { padding: 0 1rem; }
@media (max-width: 479px) {
  .topbar { gap: .5rem; padding: 0 .75rem; }
  .topbar-right { gap: .375rem; }
  .topbar-right .help-btn span { display: none; }
  .topbar-right .help-btn { padding: 0; width: 2.75rem; }
  .topbar-right .lang-btn { padding: 0 .375rem; }
}
.help-drawer { position: fixed; inset: 0; z-index: 60; }
.help-backdrop { position: absolute; inset: 0; background: rgba(19, 15, 2, .6); }
.help-panel {
  position: absolute; inset: 0; display: flex; flex-direction: column; background: var(--cream);
}
@media (min-width: 768px) {
  .help-panel { left: auto; width: 100%; max-width: 32rem; border-left: 1px solid var(--hairline); box-shadow: -20px 0 40px rgba(19, 15, 2, .2); }
}
.help-head {
  display: flex; align-items: center; gap: .75rem; flex: none; padding: .75rem 1rem .75rem 1.25rem;
  border-bottom: 1px solid var(--hairline); background: var(--white);
}
.help-title { flex: 1; min-width: 0; margin: 0; font-size: 1.125rem; overflow-wrap: anywhere; }
.help-close { flex: none; width: 2.75rem; height: 2.75rem; }
.help-body { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 1.25rem 1.25rem 2.5rem; overflow-wrap: anywhere; }
.help-body:focus { outline: none; }
.help-body:focus-visible { box-shadow: inset 0 0 0 2px var(--ember); }
.help-summary { color: var(--stone); margin-top: 0; }
.help-section { margin-top: 1.5rem; }
.help-section h3 { font-size: 1rem; margin-bottom: .375rem; }
.help-section p, .help-section li, .help-fields dd { font-size: .9rem; }
.help-steps { padding-left: 1.25rem; margin: .5rem 0; }
.help-steps li { margin: .3rem 0; }
.help-fields { margin: .5rem 0; display: grid; gap: .5rem; }
.help-fields > div { background: var(--white); border: 1px solid var(--hairline); border-radius: .75rem; padding: .5rem .75rem; }
.help-fields dt { font-weight: 600; font-size: .875rem; }
.help-fields dd { margin: .125rem 0 0; color: var(--stone); }
.help-note { border-radius: .75rem; padding: .625rem .875rem; margin: .625rem 0; }
.help-note ul { margin: .25rem 0 0; padding-left: 1.125rem; }
.help-note li { margin: .2rem 0; }
.help-note-title { margin: 0; font-weight: 600; font-size: .8125rem; }
.help-tips { background: var(--sand); }
.help-warnings { background: #FFF4EC; border: 1px solid rgba(194, 65, 12, .35); color: #7C2D12; }

/* ── "?" popover next to a title ───────────────────────────────────────── */
.title-row { position: relative; display: flex; align-items: center; flex-wrap: wrap; gap: .5rem; min-width: 0; }
.title-row > h1, .title-row > h2, .title-row > h3 { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.page-header .title-row + .muted, .page-header .title-row + p { margin-top: .375rem; }
.card > .title-row, .tile > .title-row { margin-bottom: .5rem; }
.pop { display: inline-flex; }
.pop-btn {
  display: inline-flex; align-items: center; justify-content: center; width: 2.5rem; height: 2.5rem; flex: none;
  border: 1px solid var(--hairline); border-radius: 50%; background: var(--white); color: var(--stone);
  font: inherit; font-size: .9375rem; font-weight: 600; cursor: pointer;
}
.pop-btn:hover, .pop-btn[aria-expanded="true"] { border-color: var(--stone); color: var(--ink); }
.pop-card {
  position: absolute; left: 0; top: 100%; z-index: 20; display: block; width: min(30rem, calc(100vw - 2rem)); margin-top: .5rem;
  padding: .875rem 1rem; border: 1px solid var(--hairline); border-radius: var(--radius-tile); background: var(--white);
  color: var(--stone); font-size: .875rem; font-weight: 400; line-height: 1.55; box-shadow: 0 12px 32px rgba(19, 15, 2, .15);
  overflow-wrap: anywhere;
}
.card-head .title-row { flex: 1 1 auto; }

/* Sortable table headers (static/admin.js): the header text becomes a button; the arrow shows the order. */
.th-sort { all: unset; cursor: pointer; display: inline-flex; align-items: center; gap: .25rem; min-height: 2.5rem; font: inherit; color: inherit; }
.th-sort:focus-visible { outline: 2px solid var(--ember); outline-offset: 2px; border-radius: 4px; }
.th-sort::after { content: "↕"; font-size: .75em; opacity: .45; }
th[aria-sort="ascending"] .th-sort::after { content: "▲"; opacity: .9; }
th[aria-sort="descending"] .th-sort::after { content: "▼"; opacity: .9; }
