/* ShelfSorted admin — modern SaaS style, same type and colors as the public site. No JavaScript. */
@font-face { font-family: "Jakarta"; src: url("/fonts/jakarta.woff2") format("woff2"); font-weight: 200 800; font-display: swap; }
@font-face { font-family: "Inter"; src: url("/fonts/inter.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }

:root {
  --bg: #f6f7f9; --surface: #fff; --ink: #0b1220; --text: #334155; --muted: #64748b; --faint: #94a3b8;
  --line: #e5e9f0; --line-soft: #f0f2f6;
  --brand: #0d7a63; --brand-dark: #0a5c4b; --brand-tint: #e7f6f1;
  --amber: #b45309; --amber-tint: #fff4dc; --red: #dc2626; --red-tint: #fdecec; --blue: #2563eb; --blue-tint: #e8f0fe;
  --violet: #7c3aed; --violet-tint: #f1eafe;
  --r-sm: 9px; --r: 14px; --r-lg: 18px;
  --sh-1: 0 1px 2px rgba(15, 23, 42, 0.05);
  --sh-2: 0 1px 2px rgba(15, 23, 42, 0.04), 0 10px 28px -10px rgba(15, 23, 42, 0.12);
  --head: "Jakarta", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --body: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 400 14.5px/1.55 var(--body); -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4 { font-family: var(--head); color: var(--ink); margin: 0; line-height: 1.2; letter-spacing: -0.02em; }
h1 { font-size: 1.75rem; font-weight: 800; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
h2 { font-size: 1rem; font-weight: 750; display: flex; align-items: center; gap: 9px; }
h2 .ic { width: 18px; height: 18px; color: var(--muted); }
p { margin: 0; }
code, .mono { font-family: var(--mono); font-size: 0.84em; }
code { background: #f1f5f9; border: 1px solid var(--line-soft); border-radius: 6px; padding: 1px 6px; }
.muted { color: var(--muted); }
.small { font-size: 0.82rem; }
.strong { font-weight: 650; color: var(--ink); }
.right { text-align: right; }
.num { font-variant-numeric: tabular-nums; }
.green { color: #15803d; } .red { color: var(--red); }
.link { color: var(--brand); font-weight: 600; font-size: 0.86rem; }
.link:hover { text-decoration: underline; }
.inline { display: inline; margin: 0; }
.ic { width: 18px; height: 18px; flex: none; }
.ic-sm { width: 14px; height: 14px; }

/* ---------- shell ---------- */
.shell { display: grid; grid-template-columns: 264px minmax(0, 1fr); min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 22px; padding: 20px 14px 16px; background: var(--surface); border-right: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 11px; padding: 4px 8px; }
.brand-mark { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; flex: none; background: linear-gradient(135deg, #10a37f, var(--brand-dark)); box-shadow: 0 6px 14px -6px rgba(13,122,99,.7); }
.brand-mark svg { width: 21px; height: 21px; fill: #fff; }
.brand-mark-lg { width: 48px; height: 48px; border-radius: 14px; }
.brand-mark-lg svg { width: 27px; height: 27px; }
.brand-text { font: 800 1.08rem/1.15 var(--head); color: var(--ink); letter-spacing: -0.02em; }
.brand-text small { display: block; font: 500 0.75rem/1.3 var(--body); color: var(--muted); letter-spacing: 0; }
.menu { display: flex; flex-direction: column; gap: 2px; }
.menu-head { font: 700 0.68rem/1 var(--body); letter-spacing: 0.1em; text-transform: uppercase; color: var(--faint); padding: 14px 12px 8px; }
.menu a { position: relative; display: flex; align-items: center; gap: 11px; padding: 9px 12px; border-radius: 10px; color: var(--text); font-weight: 550; }
.menu a .ic { color: var(--faint); }
.menu a:hover { background: #f4f6f8; color: var(--ink); }
.menu a.active { background: var(--brand-tint); color: var(--brand-dark); }
.menu a.active .ic { color: var(--brand); }
.menu a.active::before { content: ""; position: absolute; left: -14px; top: 9px; bottom: 9px; width: 3px; border-radius: 0 3px 3px 0; background: var(--brand); }
.count { margin-left: auto; font: 700 0.7rem/1 var(--body); font-style: normal; background: var(--amber-tint); color: var(--amber); padding: 4px 7px; border-radius: 999px; }
.sidebar-foot { margin-top: auto; display: flex; flex-direction: column; gap: 10px; }
.site-card { display: flex; align-items: center; gap: 10px; padding: 11px 12px; border: 1px solid var(--line); border-radius: 12px; background: linear-gradient(180deg, #fbfcfd, #f6f8fa); }
.site-card:hover { border-color: #cfd8e3; }
.site-card .ic { color: var(--brand); }
.site-card span { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.site-card strong { font-size: 0.84rem; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.site-card small { color: var(--muted); font-size: 0.74rem; }
.user-row { display: flex; align-items: center; gap: 10px; padding: 8px 6px 2px; border-top: 1px solid var(--line-soft); }
.avatar { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--ink); color: #fff; font: 700 0.85rem/1 var(--head); flex: none; }
.user-name { flex: 1; font-weight: 650; color: var(--ink); font-size: 0.88rem; line-height: 1.2; }
.user-name small { display: block; color: var(--muted); font-weight: 500; font-size: 0.74rem; }

.main { padding: 30px 40px 64px; max-width: 1360px; width: 100%; }

/* ---------- page header ---------- */
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; flex-wrap: wrap; margin-bottom: 24px; }
.page-head p.muted { margin-top: 8px; max-width: 72ch; }
.eyebrow { font: 700 0.72rem/1 var(--body); letter-spacing: 0.1em; text-transform: uppercase; color: var(--brand); margin-bottom: 10px !important; }
.head-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.crumbs { display: flex; gap: 8px; align-items: center; color: var(--faint); font-size: 0.84rem; margin-bottom: 12px; }
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--ink); }
.sticky-head { position: sticky; top: 0; z-index: 5; background: rgba(246, 247, 249, 0.92); backdrop-filter: blur(10px); padding: 14px 0; margin-top: -14px; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 38px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font: 600 0.86rem/1 var(--body); cursor: pointer; white-space: nowrap; box-shadow: var(--sh-1); transition: background .15s, border-color .15s, transform .15s; }
.btn .ic { width: 16px; height: 16px; }
.btn:hover { border-color: #cbd5e1; background: #fbfcfd; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; box-shadow: 0 6px 14px -6px rgba(13,122,99,.6); }
.btn-primary:hover { background: var(--brand-dark); border-color: var(--brand-dark); }
.btn-danger { color: var(--red); }
.btn-danger:hover { background: var(--red-tint); border-color: #f5c2c2; }
.btn-ghost { background: transparent; box-shadow: none; border-color: transparent; color: var(--muted); }
.btn-ghost:hover { background: #eef1f5; color: var(--ink); }
.btn-sm { height: 32px; padding: 0 11px; font-size: 0.8rem; border-radius: 9px; }
.btn-block { width: 100%; height: 44px; }
.icon-btn { width: 34px; height: 34px; display: inline-grid; place-items: center; border-radius: 9px; border: 1px solid transparent; background: transparent; color: var(--muted); cursor: pointer; }
.icon-btn:hover { background: #eef1f5; color: var(--ink); }
.icon-btn-sm { width: 26px; height: 26px; border-radius: 7px; }
.icon-btn-sm .ic { width: 14px; height: 14px; }
.icon-btn.ghost { visibility: hidden; }
:focus-visible { outline: 3px solid #93c5fd; outline-offset: 2px; }

/* ---------- flash ---------- */
.flash { display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px; border-radius: 12px; margin-bottom: 16px; background: var(--brand-tint); color: #0a5c4b; border: 1px solid #c6e8dc; font-weight: 500; }
.flash .ic { margin-top: 1px; }
.flash-error { background: var(--red-tint); color: #b91c1c; border-color: #f7caca; }
.flash-warn { background: var(--amber-tint); color: #92400e; border-color: #f6dc9f; }

/* ---------- stats ---------- */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 20px; }
.stat { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 14px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 18px 20px; box-shadow: var(--sh-1); transition: box-shadow .15s, transform .15s; }
a.stat:hover { box-shadow: var(--sh-2); transform: translateY(-1px); }
.stat-ic { grid-row: span 2; width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; }
.stat-ic .ic { width: 21px; height: 21px; }
.ic-green { background: var(--brand-tint); color: var(--brand); }
.ic-amber { background: var(--amber-tint); color: var(--amber); }
.ic-blue { background: var(--blue-tint); color: var(--blue); }
.ic-violet { background: var(--violet-tint); color: var(--violet); }
.stat-num { font: 800 1.65rem/1.1 var(--head); color: var(--ink); letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.stat-num-sm { font-size: 1rem; }
.stat-label { color: var(--muted); font-size: 0.82rem; }
.stat-attn { border-color: #f3d58a; background: linear-gradient(180deg, #fffdf6, #fff); }

/* ---------- panels ---------- */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 20px 22px; margin-bottom: 20px; box-shadow: var(--sh-1); }
.panel.flush { padding: 0; overflow: hidden; }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.panel-head.pad { padding: 18px 22px 0; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.grid-wide { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); align-items: start; }
.empty { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; color: var(--muted); padding: 28px 16px; background: repeating-linear-gradient(45deg, #fafbfc, #fafbfc 8px, #f6f7f9 8px, #f6f7f9 16px); border: 1px dashed var(--line); border-radius: 14px; }
.empty .ic { width: 26px; height: 26px; color: var(--faint); }
.empty h1 { font-size: 1.3rem; }
.hint { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 0.82rem; margin: -8px 0 18px; }
.hint .ic { width: 15px; height: 15px; color: var(--amber); }

/* rows */
.rows { list-style: none; margin: 0; padding: 0; }
.rows li { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-top: 1px solid var(--line-soft); }
.rows li:first-child { border-top: 0; padding-top: 4px; }
.row-ic { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: #f3f5f8; color: var(--muted); flex: none; }
.row-ic .ic { width: 17px; height: 17px; }
.row-main { flex: 1; min-width: 0; display: flex; flex-direction: column; font-weight: 600; color: var(--ink); }
.row-main a:hover { color: var(--brand-dark); }
.row-main small { color: var(--muted); font-weight: 400; font-size: 0.8rem; }

.checks { list-style: none; margin: 0; padding: 0; }
.checks li { display: flex; align-items: center; gap: 12px; padding: 9px 0; border-top: 1px solid var(--line-soft); }
.checks li:first-child { border-top: 0; padding-top: 2px; }
.check-ic { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; flex: none; }
.check-ic .ic { width: 15px; height: 15px; stroke-width: 2.4; }
.checks .ok .check-ic { background: var(--brand-tint); color: var(--brand); }
.checks .bad .check-ic { background: var(--amber-tint); color: var(--amber); }
.checks .row-main small { font-family: var(--mono); font-size: 0.74rem; }

/* pills */
.pill { display: inline-flex; align-items: center; gap: 6px; font: 650 0.72rem/1 var(--body); padding: 5px 9px; border-radius: 999px; background: #f1f4f7; color: var(--muted); vertical-align: middle; white-space: nowrap; letter-spacing: 0; }
.pill i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: 0.8; }
.pill-ok { background: var(--brand-tint); color: var(--brand-dark); }
.pill-warn { background: var(--amber-tint); color: var(--amber); }
.pill-err { background: var(--red-tint); color: var(--red); }
.pill-run { background: var(--blue-tint); color: var(--blue); }
h1 .pill { font-size: 0.78rem; padding: 6px 11px; }

/* tables */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font: 650 0.72rem/1 var(--body); letter-spacing: 0.06em; text-transform: uppercase; color: var(--faint); padding: 12px 16px; background: #fafbfc; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 13px 16px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: #fafbfc; }
.table td .small { display: block; margin-top: 2px; }
.table td .pill { margin-top: 4px; }
.panel:not(.flush) .table th:first-child, .panel:not(.flush) .table td:first-child { padding-left: 0; }
.panel:not(.flush) .table th { background: transparent; }
.empty-cell { text-align: center; color: var(--muted); padding: 28px !important; }
.job-name { font-weight: 650; color: var(--ink); display: inline-flex; gap: 8px; align-items: baseline; }
.job-id { color: var(--faint); font: 600 0.78rem var(--mono); }
.kv td { padding-top: 10px; padding-bottom: 10px; }

/* tabs */
.tabs { display: inline-flex; gap: 4px; background: #eceff3; padding: 4px; border-radius: 12px; margin-bottom: 16px; }
.tabs a { padding: 7px 13px; border-radius: 9px; font-weight: 600; font-size: 0.84rem; color: var(--muted); }
.tabs a:hover { color: var(--ink); }
.tabs a.active { background: #fff; color: var(--ink); box-shadow: var(--sh-1); }

/* forms */
.field { display: flex; flex-direction: column; gap: 6px; font-weight: 600; font-size: 0.82rem; color: var(--ink); margin-bottom: 14px; }
.field small { color: var(--faint); font-weight: 500; }
input, select, textarea { font: 400 0.92rem/1.45 var(--body); color: var(--ink); background: #fff; border: 1px solid #d9dfe7; border-radius: 10px; padding: 9px 12px; width: 100%; transition: border-color .15s, box-shadow .15s; }
textarea { resize: vertical; min-height: 64px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px rgba(13, 122, 99, 0.12); }
.form-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0 14px; }
.span-2 { grid-column: span 2; } .span-4 { grid-column: span 4; }
.form-grid.pair { padding: 12px 0 0; border-top: 1px solid var(--line-soft); }
.form-grid.pair:first-of-type { border-top: 0; padding-top: 0; }
.form-grid.pair .field { margin-bottom: 8px; }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; padding-top: 6px; }
.form-foot { display: flex; justify-content: flex-end; gap: 10px; margin-top: 4px; }
.add-panel summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 10px; font: 700 0.95rem var(--head); color: var(--ink); }
.add-panel summary::-webkit-details-marker { display: none; }
.add-panel summary .ic { width: 20px; height: 20px; padding: 3px; border-radius: 7px; background: var(--brand); color: #fff; }
.add-panel summary .muted { font-family: var(--body); font-weight: 400; margin-left: auto; }
.add-panel[open] summary { margin-bottom: 18px; }

/* switch (pure CSS) */
.switch { position: relative; width: 42px; height: 24px; flex: none; border-radius: 999px; background: #d5dbe3; border: 0; padding: 0; cursor: pointer; transition: background .15s; display: inline-block; }
.switch span { position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.2); transition: transform .15s; }
.switch.on, .switch-input:checked + .switch { background: var(--brand); }
.switch.on span, .switch-input:checked + .switch span { transform: translateX(18px); }
.switch-input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch-input:focus-visible + .switch { outline: 3px solid #93c5fd; outline-offset: 2px; }
.toggle-row { display: flex; align-items: center; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--line-soft); cursor: pointer; margin-bottom: 14px; }
.toggle-row + .toggle-row { margin-top: -14px; }

/* stepper */
.stepper { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--sh-1); margin-bottom: 20px; overflow: hidden; }
.step { display: flex; align-items: center; gap: 12px; padding: 16px 18px; border-right: 1px solid var(--line-soft); flex-wrap: wrap; }
.step:last-child { border-right: 0; }
.step-dot { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; flex: none; background: #f1f4f7; color: var(--muted); font: 800 0.85rem/1 var(--head); border: 1px solid var(--line); }
.step-dot .ic { width: 16px; height: 16px; stroke-width: 2.4; }
.step.done .step-dot { background: var(--brand); border-color: var(--brand); color: #fff; }
.step-dot-muted { background: var(--amber-tint); color: var(--amber); border-color: transparent; }
.step-body { flex: 1; min-width: 110px; display: flex; flex-direction: column; line-height: 1.3; }
.step-body strong { color: var(--ink); font-size: 0.9rem; }
.step-body small { color: var(--muted); font-size: 0.78rem; }

/* products */
.products { list-style: none; margin: 0; padding: 0; }
.product { display: grid; grid-template-columns: auto 60px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 12px 0; border-top: 1px solid var(--line-soft); scroll-margin-top: 20px; }
.product:first-child { border-top: 0; padding-top: 2px; }
.order { display: flex; flex-direction: column; align-items: center; gap: 1px; }
.pos { display: inline-grid; place-items: center; min-width: 24px; height: 24px; padding: 0 6px; border-radius: 7px; background: #f1f4f7; color: var(--ink); font: 800 0.76rem/1 var(--head); }
.thumb { width: 60px; height: 60px; border-radius: 12px; border: 1px solid var(--line); background: #fff; display: grid; place-items: center; padding: 5px; }
.thumb img { max-width: 100%; max-height: 100%; object-fit: contain; }
.product-info a { color: var(--ink); font-weight: 600; font-size: 0.88rem; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.product-info a:hover { color: var(--brand-dark); }
.meta { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 4px; color: var(--muted); font-size: 0.78rem; font-variant-numeric: tabular-nums; }
.earn { color: var(--violet); font-weight: 650; }
.product.is-rejected { opacity: 0.45; }
.product.is-rejected .product-info a { text-decoration: line-through; }

/* preview */
.preview h3 { font-size: 1.25rem; font-weight: 800; margin-bottom: 10px; }
.preview h4 { font-family: var(--head); margin: 22px 0 8px; font-size: 0.95rem; }
.preview p { margin: 0 0 10px; }
.seo { background: #f8fafc; border: 1px solid var(--line-soft); border-radius: 10px; padding: 9px 12px; font-size: 0.84rem; color: var(--muted); }
.seo span { display: block; font: 700 0.66rem/1.4 var(--body); text-transform: uppercase; letter-spacing: 0.08em; color: var(--faint); }
.preview-item { border-top: 1px solid var(--line-soft); padding-top: 14px; margin-top: 14px; }
.preview-title { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; color: var(--ink); }
.mini-ticks { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.mini-ticks li { display: flex; gap: 7px; align-items: flex-start; font-size: 0.84rem; color: var(--muted); }
.mini-ticks .ic { width: 15px; height: 15px; color: var(--brand); stroke-width: 2.4; margin-top: 2px; }

/* edit */
.edit-product { border-top: 1px solid var(--line-soft); padding-top: 16px; margin-top: 4px; }
.edit-product:first-of-type { border-top: 0; padding-top: 0; }
.edit-product-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }

/* earnings upload */
.upload { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.upload-ic { width: 46px; height: 46px; border-radius: 13px; display: grid; place-items: center; background: var(--violet-tint); color: var(--violet); flex: none; }
.upload-text { flex: 1; min-width: 220px; display: flex; flex-direction: column; color: var(--ink); }
.upload-text small { color: var(--muted); }
.file-input { width: auto; max-width: 300px; padding: 7px; font-size: 0.82rem; border-style: dashed; }

/* job log */
.live { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; font-size: 0.84rem; color: var(--blue); background: var(--blue-tint); padding: 8px 12px; border-radius: 999px; }
.live .ic { width: 15px; height: 15px; }
.terminal { border-radius: var(--r-lg); overflow: hidden; border: 1px solid #1e293b; box-shadow: var(--sh-2); }
.terminal-bar { display: flex; align-items: center; gap: 7px; padding: 11px 14px; background: #111827; color: #94a3b8; font: 500 0.78rem var(--mono); }
.terminal-bar i { width: 11px; height: 11px; border-radius: 50%; background: #374151; }
.terminal-bar i:nth-child(1) { background: #f87171; } .terminal-bar i:nth-child(2) { background: #fbbf24; } .terminal-bar i:nth-child(3) { background: #34d399; }
.terminal-bar span { margin-left: 8px; }
.log { margin: 0; background: #0b1220; color: #e2e8f0; padding: 18px 20px; font: 0.82rem/1.7 var(--mono); white-space: pre-wrap; word-break: break-word; max-height: 72vh; overflow: auto; }
.code { background: #0b1220; color: #e2e8f0; border-radius: 12px; padding: 13px 15px; font: 0.82rem/1.55 var(--mono); white-space: pre-wrap; word-break: break-all; margin: 0 0 10px; }

/* login */
.login-page { min-height: 100vh; display: grid; place-items: center; padding: 24px; background:
  radial-gradient(600px 400px at 85% 0%, rgba(255, 196, 61, 0.16), transparent 70%),
  radial-gradient(700px 480px at 0% 100%, rgba(16, 163, 127, 0.14), transparent 70%), var(--bg); }
.login-wrap { width: 100%; max-width: 400px; }
.login-card { display: flex; flex-direction: column; gap: 4px; background: var(--surface); border: 1px solid var(--line); border-radius: 22px; padding: 32px 30px; box-shadow: 0 24px 60px -20px rgba(15, 23, 42, 0.25); }
.login-card h1 { font-size: 1.45rem; margin-top: 16px; }
.login-card > .muted { margin-bottom: 18px; }
.login-card .flash { margin-bottom: 10px; }
.login-foot { text-align: center; color: var(--faint); font-size: 0.78rem; margin-top: 16px; }

/* ---------- responsive ---------- */
@media (max-width: 1200px) {
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stepper { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .step:nth-child(2) { border-right: 0; }
  .step:nth-child(-n+2) { border-bottom: 1px solid var(--line-soft); }
  .grid-wide { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: sticky; top: 0; z-index: 10; height: auto; flex-direction: row; align-items: center; gap: 8px; padding: 10px 14px; border-right: 0; border-bottom: 1px solid var(--line); overflow-x: auto; }
  .brand-text small, .menu-head, .site-card, .user-name { display: none; }
  .brand { padding: 0; }
  .menu { flex-direction: row; gap: 2px; }
  .menu a { padding: 8px 10px; white-space: nowrap; }
  .menu a span { display: none; }
  .menu a.active::before { display: none; }
  .sidebar-foot { margin: 0 0 0 auto; flex-direction: row; }
  .user-row { border: 0; padding: 0; }
  .main { padding: 22px 16px 48px; }
  .grid-2 { grid-template-columns: 1fr; }
  h1 { font-size: 1.45rem; }
}
@media (max-width: 620px) {
  .stats { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat { padding: 14px; column-gap: 10px; }
  .stat-ic { width: 36px; height: 36px; }
  .stat-num { font-size: 1.3rem; }
  .stepper { grid-template-columns: 1fr; }
  .step { border-right: 0 !important; border-bottom: 1px solid var(--line-soft); }
  .form-grid { grid-template-columns: 1fr; }
  .span-2, .span-4 { grid-column: auto; }
  .hide-sm { display: none; }
  .product { grid-template-columns: auto 48px minmax(0, 1fr) auto; gap: 10px; }
  .thumb { width: 48px; height: 48px; }
  .head-actions { width: 100%; }
  .head-actions .btn, .head-actions form, .head-actions form .btn { flex: 1; width: 100%; }
}

/* pinterest */
.pin-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 16px; }
.pin-grid-sm { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
.pin-card { margin: 0; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: #fff; display: flex; flex-direction: column; }
.pin-img { display: block; aspect-ratio: 2 / 3; background: #f1f4f7; }
.pin-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pin-card figcaption { display: flex; flex-direction: column; gap: 4px; padding: 10px 12px 12px; }
.pin-meta { display: flex; justify-content: space-between; align-items: center; gap: 6px; }
.pin-title { color: var(--ink); font-size: 0.84rem; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pin-actions { display: flex; justify-content: space-between; align-items: center; margin-top: 6px; }
.board-form { display: flex; gap: 8px; align-items: center; }
.board-form select { max-width: 320px; }
.pad-x { padding: 0 22px; margin: 8px 0; }
.checks.plain .row-main small { font-family: var(--body); font-size: 0.8rem; }
.factcheck { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 0.84rem; margin-top: 8px !important; }
.factcheck .ic { width: 16px; height: 16px; }
.factcheck.ok { color: var(--brand-dark); }
.factcheck.bad { color: var(--amber); }
.todo { border-color: #f6dc9f; background: linear-gradient(180deg, #fffbf0, #fff); }
.calm { display: flex; align-items: center; gap: 12px; border-color: #c6e8dc; background: linear-gradient(180deg, #f3fbf7, #fff); }
.calm > .ic { width: 22px; height: 22px; color: var(--brand); flex: none; }
.calm strong { color: var(--ink); margin-right: 6px; }

/* API keys form */
.key-row { align-items: center; }
.key-row .field { margin-bottom: 8px; }
.key-row .field small { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.clear-key { display: inline-flex; align-items: center; gap: 6px; font-weight: 500; color: var(--muted); font-size: 0.78rem; }
.clear-key input { width: auto; margin: 0; }
.key-actions { justify-content: flex-end; align-self: end; flex-direction: row; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
@media (max-width: 760px) { .key-row .field.span-2, .form-grid .field.span-2 { grid-column: span 4; } }
