:root {
  color-scheme: dark;
  --bg: #0d0b10;
  --panel: #17131d;
  --panel-2: #201927;
  --panel-3: #2a2132;
  --text: #f8f5fb;
  --muted: #b8afc2;
  --faint: #7f7589;
  --line: #3b3045;
  --line-soft: #2b2333;
  --amber: #f5a524;
  --amber-strong: #ffbb45;
  --amber-soft: rgba(245, 165, 36, .14);
  --green: #8be28b;
  --green-soft: rgba(139, 226, 139, .12);
  --purple: #b88cff;
  --purple-soft: rgba(184, 140, 255, .12);
  --danger: #ff7c7c;
  --danger-soft: rgba(255, 124, 124, .12);
  --shadow: 0 18px 60px rgba(0, 0, 0, .34);
  --radius: 18px;
  --radius-sm: 12px;
  --sidebar: 268px;
  --header: 72px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--bg); }
body { margin: 0; min-height: 100vh; background:
  radial-gradient(circle at 20% -10%, rgba(184, 140, 255, .10), transparent 28rem),
  radial-gradient(circle at 90% 10%, rgba(245, 165, 36, .08), transparent 24rem),
  var(--bg); color: var(--text); }
button, input, textarea, select { font: inherit; }
button { color: inherit; }
a { color: inherit; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: var(--sidebar) minmax(0, 1fr); }
.sidebar { position: fixed; inset: 0 auto 0 0; width: var(--sidebar); padding: 22px 18px; border-right: 1px solid var(--line-soft); background: rgba(16, 13, 20, .94); backdrop-filter: blur(18px); display: flex; flex-direction: column; z-index: 30; }
.brand { display: flex; gap: 13px; align-items: center; padding: 5px 7px 22px; }
.brand img { width: 46px; height: 46px; border-radius: 13px; box-shadow: 0 10px 30px rgba(245, 165, 36, .16); }
.brand strong { display: block; font-size: 15px; letter-spacing: .08em; }
.brand span { display: block; color: var(--muted); font-size: 12px; margin-top: 3px; }

.nav { display: grid; gap: 7px; }
.nav-button { width: 100%; border: 1px solid transparent; background: transparent; border-radius: 13px; padding: 13px 14px; display: grid; grid-template-columns: 25px 1fr auto; align-items: center; text-align: left; cursor: pointer; color: var(--muted); transition: .16s ease; }
.nav-button:hover { background: var(--panel); color: var(--text); }
.nav-button.active { background: var(--amber-soft); border-color: rgba(245,165,36,.24); color: var(--text); }
.nav-icon { font-size: 18px; }
.nav-label { font-weight: 750; font-size: 14px; }
.nav-badge { min-width: 23px; height: 23px; display: inline-grid; place-items: center; padding: 0 6px; border-radius: 999px; background: var(--panel-3); color: var(--muted); font-size: 11px; font-weight: 800; }
.nav-button.active .nav-badge { background: var(--amber); color: #211400; }

.sidebar-bottom { margin-top: auto; display: grid; gap: 10px; }
.boundary-card { border: 1px solid rgba(139,226,139,.22); background: var(--green-soft); border-radius: 14px; padding: 13px; }
.boundary-card strong { display: block; font-size: 12px; color: var(--green); letter-spacing: .06em; }
.boundary-card p { margin: 6px 0 0; color: var(--muted); font-size: 12px; line-height: 1.45; }
.authority { color: var(--faint); font-size: 11px; line-height: 1.5; padding: 0 4px; }

.main-column { grid-column: 2; min-width: 0; }
.topbar { min-height: var(--header); position: sticky; top: 0; z-index: 20; border-bottom: 1px solid var(--line-soft); background: rgba(13,11,16,.88); backdrop-filter: blur(18px); display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 13px clamp(18px, 3vw, 44px); }
.topbar-title { min-width: 0; }
.topbar-title strong { display: block; font-size: 15px; }
.topbar-title span { display: block; margin-top: 3px; color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-actions { display: flex; gap: 9px; align-items: center; }
.status-pill { border: 1px solid var(--line); background: var(--panel); border-radius: 999px; padding: 8px 11px; font-size: 11px; font-weight: 850; letter-spacing: .04em; color: var(--muted); white-space: nowrap; }
.status-pill.safe { color: var(--green); border-color: rgba(139,226,139,.25); background: var(--green-soft); }
.status-pill.warn { color: var(--amber); border-color: rgba(245,165,36,.25); background: var(--amber-soft); }
.status-pill.danger { color: var(--danger); border-color: rgba(255,124,124,.3); background: var(--danger-soft); }

.safety-strip { margin: 18px clamp(18px, 3vw, 44px) 0; padding: 12px 15px; border: 1px solid rgba(245,165,36,.22); background: var(--amber-soft); border-radius: 14px; display: flex; gap: 10px; align-items: flex-start; color: #f7dca7; font-size: 12px; line-height: 1.5; }
.safety-strip strong { color: var(--amber-strong); }

.content { width: min(1500px, 100%); margin: 0 auto; padding: 28px clamp(18px, 3vw, 44px) 112px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; margin-bottom: 24px; }
.eyebrow { color: var(--amber); font-size: 12px; font-weight: 900; letter-spacing: .14em; text-transform: uppercase; }
h1 { font-size: clamp(29px, 4vw, 46px); line-height: 1.06; margin: 8px 0 10px; letter-spacing: -.045em; }
h2 { font-size: clamp(21px, 2.5vw, 30px); margin: 0; letter-spacing: -.025em; }
h3 { font-size: 17px; margin: 0; }
p { color: var(--muted); }
.page-intro { max-width: 720px; margin: 0; line-height: 1.65; }

.grid { display: grid; gap: 16px; }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.card { border: 1px solid var(--line-soft); background: linear-gradient(160deg, rgba(32,25,39,.93), rgba(22,18,27,.96)); border-radius: var(--radius); padding: 20px; box-shadow: 0 1px 0 rgba(255,255,255,.02) inset; }
.card.soft { background: rgba(24,19,30,.72); }
.card.amber { border-color: rgba(245,165,36,.28); background: linear-gradient(160deg, rgba(245,165,36,.13), rgba(23,18,27,.96)); }
.card.green { border-color: rgba(139,226,139,.24); background: linear-gradient(160deg, rgba(139,226,139,.10), rgba(23,18,27,.96)); }
.card.danger { border-color: rgba(255,124,124,.25); background: linear-gradient(160deg, rgba(255,124,124,.10), rgba(23,18,27,.96)); }
.card-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 16px; }
.card-header p { margin: 5px 0 0; font-size: 13px; line-height: 1.5; }
.card-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line-soft); }

.hero-action { display: grid; grid-template-columns: 1.3fr .7fr; gap: 18px; align-items: stretch; margin-bottom: 18px; }
.next-card { min-height: 270px; display: flex; flex-direction: column; justify-content: space-between; padding: clamp(24px, 4vw, 42px); border-color: rgba(245,165,36,.36); background:
  radial-gradient(circle at 90% 10%, rgba(245,165,36,.22), transparent 19rem),
  linear-gradient(150deg, #2a1f21, #19141f 62%); }
.next-card h2 { font-size: clamp(28px, 4vw, 48px); max-width: 760px; line-height: 1.05; }
.next-card p { max-width: 670px; line-height: 1.65; }
.next-number { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; background: var(--amber); color: #251600; font-size: 22px; font-weight: 950; margin-bottom: 22px; }

.metric { min-height: 125px; }
.metric-label { color: var(--muted); font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; }
.metric-value { margin-top: 10px; font-size: 34px; font-weight: 950; letter-spacing: -.04em; }
.metric-note { color: var(--faint); font-size: 12px; margin-top: 6px; }

.btn { min-height: 44px; border: 1px solid var(--line); border-radius: 12px; padding: 10px 15px; background: var(--panel-2); color: var(--text); font-weight: 850; font-size: 13px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px; transition: .16s ease; text-decoration: none; }
.btn:hover:not(:disabled) { transform: translateY(-1px); border-color: #5b4a68; background: var(--panel-3); }
.btn:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible { outline: 3px solid rgba(245,165,36,.28); outline-offset: 2px; }
.btn:disabled { opacity: .42; cursor: not-allowed; }
.btn.primary { background: var(--amber); border-color: var(--amber); color: #251600; box-shadow: 0 8px 30px rgba(245,165,36,.17); }
.btn.primary:hover:not(:disabled) { background: var(--amber-strong); border-color: var(--amber-strong); }
.btn.success { background: var(--green); border-color: var(--green); color: #10210f; }
.btn.danger { border-color: rgba(255,124,124,.35); background: var(--danger-soft); color: #ffc3c3; }
.btn.ghost { background: transparent; }
.btn.large { min-height: 56px; padding: 14px 21px; border-radius: 15px; font-size: 15px; }
.btn.small { min-height: 36px; padding: 7px 10px; font-size: 12px; border-radius: 10px; }
.button-row { display: flex; gap: 9px; flex-wrap: wrap; align-items: center; }

.tag { display: inline-flex; align-items: center; gap: 6px; min-height: 27px; border: 1px solid var(--line); background: rgba(255,255,255,.025); border-radius: 999px; padding: 5px 9px; color: var(--muted); font-size: 11px; font-weight: 800; }
.tag.amber { color: var(--amber); border-color: rgba(245,165,36,.25); background: var(--amber-soft); }
.tag.green { color: var(--green); border-color: rgba(139,226,139,.25); background: var(--green-soft); }
.tag.purple { color: var(--purple); border-color: rgba(184,140,255,.25); background: var(--purple-soft); }
.tag.danger { color: var(--danger); border-color: rgba(255,124,124,.25); background: var(--danger-soft); }
.tags { display: flex; gap: 7px; flex-wrap: wrap; }

.product-card { padding: 0; overflow: hidden; }
.product-image { aspect-ratio: 16 / 10; background:
  linear-gradient(135deg, rgba(245,165,36,.12), rgba(184,140,255,.08)),
  repeating-linear-gradient(45deg, transparent, transparent 10px, rgba(255,255,255,.012) 10px, rgba(255,255,255,.012) 20px); display: grid; place-items: center; overflow: hidden; }
.product-image img { width: 100%; height: 100%; object-fit: cover; }
.product-image-placeholder { color: var(--faint); font-weight: 900; letter-spacing: .08em; text-align: center; padding: 20px; }
.product-body { padding: 20px; }
.product-description { min-height: 48px; font-size: 13px; line-height: 1.55; }
.product-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 16px; }
.product-stat { border: 1px solid var(--line-soft); background: rgba(0,0,0,.12); border-radius: 11px; padding: 10px; }
.product-stat span { display: block; color: var(--faint); font-size: 10px; font-weight: 850; text-transform: uppercase; }
.product-stat strong { display: block; margin-top: 5px; font-size: 13px; }

.empty { border: 1px dashed #4d4057; border-radius: var(--radius); padding: 42px 24px; text-align: center; background: rgba(255,255,255,.015); }
.empty-icon { font-size: 38px; }
.empty h3 { margin-top: 13px; }
.empty p { max-width: 520px; margin: 9px auto 20px; line-height: 1.6; }

.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px; }
.field { display: grid; gap: 7px; }
.field.full { grid-column: 1 / -1; }
label { color: #e7dfed; font-size: 12px; font-weight: 850; }
.help { color: var(--faint); font-size: 11px; line-height: 1.45; }
.input, input, textarea, select { width: 100%; color: var(--text); background: #120f17; border: 1px solid var(--line); border-radius: 11px; min-height: 45px; padding: 11px 12px; }
textarea { min-height: 112px; resize: vertical; line-height: 1.55; }
select { cursor: pointer; }
.check-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.check-tile { position: relative; }
.check-tile input { position: absolute; opacity: 0; pointer-events: none; }
.check-tile label { min-height: 52px; border: 1px solid var(--line); background: #120f17; border-radius: 12px; padding: 13px; display: flex; align-items: center; gap: 10px; cursor: pointer; }
.check-tile input:checked + label { border-color: rgba(245,165,36,.55); background: var(--amber-soft); color: var(--amber-strong); }
.upload-box { border: 1px dashed #5b4a68; border-radius: 13px; padding: 18px; background: rgba(255,255,255,.018); }
.upload-box input { background: transparent; padding: 8px; }

.review-layout { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 18px; align-items: start; }
.review-list { display: grid; gap: 13px; }
.post-card { border: 1px solid var(--line-soft); background: rgba(27,22,33,.92); border-radius: 16px; padding: 17px; }
.post-card.rejected { opacity: .68; border-color: rgba(255,124,124,.24); }
.post-card.frozen { border-color: rgba(139,226,139,.24); }
.post-top { display: flex; justify-content: space-between; gap: 13px; align-items: flex-start; }
.post-caption { margin: 14px 0; color: #e8e2ec; font-size: 13px; line-height: 1.65; white-space: pre-wrap; }
.post-media { width: 100%; max-height: 260px; object-fit: cover; border-radius: 12px; border: 1px solid var(--line-soft); margin: 8px 0 13px; }
.warning-list { margin: 12px 0 0; padding: 0; list-style: none; display: grid; gap: 7px; }
.warning-list li { border: 1px solid rgba(255,124,124,.2); background: var(--danger-soft); color: #ffb7b7; border-radius: 10px; padding: 9px 10px; font-size: 11px; line-height: 1.45; }
.approval-panel { position: sticky; top: calc(var(--header) + 18px); }
.approval-count { font-size: 42px; font-weight: 950; letter-spacing: -.05em; }

.queue-item { display: grid; grid-template-columns: 1fr auto; gap: 14px; align-items: center; border: 1px solid var(--line-soft); border-radius: 14px; padding: 15px; background: rgba(255,255,255,.018); }
.queue-item + .queue-item { margin-top: 10px; }
.queue-title { font-weight: 850; }
.queue-meta { color: var(--muted); font-size: 12px; margin-top: 5px; }
.queue-error { color: var(--danger); font-size: 11px; margin-top: 6px; }
.safety-control { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.switch { position: relative; width: 54px; height: 30px; flex: 0 0 auto; }
.switch input { position: absolute; opacity: 0; }
.switch span { position: absolute; inset: 0; border-radius: 999px; background: #45394f; border: 1px solid #5a4a66; cursor: pointer; transition: .18s; }
.switch span::after { content: ''; position: absolute; width: 22px; height: 22px; top: 3px; left: 4px; background: #c9bfce; border-radius: 50%; transition: .18s; }
.switch input:checked + span { background: rgba(245,165,36,.34); border-color: var(--amber); }
.switch input:checked + span::after { transform: translateX(23px); background: var(--amber); }
.switch.danger input:checked + span { background: rgba(255,124,124,.28); border-color: var(--danger); }
.switch.danger input:checked + span::after { background: var(--danger); }

.audit-list { display: grid; gap: 8px; max-height: 520px; overflow: auto; padding-right: 5px; }
.audit-row { border-left: 3px solid var(--line); padding: 9px 10px; background: rgba(255,255,255,.018); border-radius: 0 10px 10px 0; }
.audit-row strong { display: block; font-size: 12px; }
.audit-row p { margin: 4px 0 0; font-size: 11px; line-height: 1.45; }
.audit-row time { color: var(--faint); font-size: 10px; }

.modal-backdrop { position: fixed; inset: 0; z-index: 100; background: rgba(0,0,0,.74); backdrop-filter: blur(8px); display: grid; place-items: center; padding: 20px; }
.modal { width: min(760px, 100%); max-height: min(900px, calc(100vh - 40px)); overflow: auto; border: 1px solid #4b3c57; background: #17131d; border-radius: 20px; box-shadow: var(--shadow); }
.modal.wide { width: min(960px, 100%); }
.modal-head { position: sticky; top: 0; z-index: 2; display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; padding: 20px; border-bottom: 1px solid var(--line-soft); background: rgba(23,19,29,.96); backdrop-filter: blur(12px); }
.modal-head p { margin: 5px 0 0; font-size: 12px; }
.modal-body { padding: 20px; }
.modal-foot { position: sticky; bottom: 0; padding: 15px 20px; border-top: 1px solid var(--line-soft); background: rgba(23,19,29,.96); display: flex; justify-content: flex-end; gap: 9px; }
.icon-button { width: 40px; height: 40px; border-radius: 11px; border: 1px solid var(--line); background: var(--panel-2); cursor: pointer; }

.toast { position: fixed; right: 22px; bottom: 22px; z-index: 200; width: min(380px, calc(100vw - 44px)); border: 1px solid var(--line); background: #211a28; border-radius: 14px; padding: 14px 16px; box-shadow: var(--shadow); animation: toast-in .22s ease; }
.toast.success { border-color: rgba(139,226,139,.32); }
.toast.error { border-color: rgba(255,124,124,.36); }
.toast strong { display: block; font-size: 13px; }
.toast span { display: block; color: var(--muted); font-size: 12px; line-height: 1.45; margin-top: 4px; }
@keyframes toast-in { from { transform: translateY(10px); opacity: 0; } }

.mobile-nav { display: none; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.text-green { color: var(--green); }
.text-amber { color: var(--amber); }
.text-danger { color: var(--danger); }
.spacer { height: 4px; }
.divider { height: 1px; background: var(--line-soft); margin: 18px 0; }
.inline-note { border-left: 3px solid var(--amber); padding: 9px 12px; color: var(--muted); background: var(--amber-soft); border-radius: 0 10px 10px 0; font-size: 12px; line-height: 1.55; }

@media (max-width: 1120px) {
  .grid.four { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero-action { grid-template-columns: 1fr; }
  .review-layout { grid-template-columns: 1fr; }
  .approval-panel { position: static; }
}

@media (max-width: 820px) {
  :root { --header: 64px; }
  .app-shell { display: block; }
  .sidebar { display: none; }
  .main-column { grid-column: 1; }
  .topbar { padding: 10px 16px; }
  .topbar-actions .status-pill:first-child { display: none; }
  .safety-strip { margin: 12px 14px 0; }
  .content { padding: 22px 14px 104px; }
  .page-head { align-items: flex-start; flex-direction: column; }
  .grid.two, .grid.three, .grid.four { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .field.full { grid-column: auto; }
  .product-stats { grid-template-columns: repeat(3, 1fr); }
  .queue-item { grid-template-columns: 1fr; }
  .mobile-nav { position: fixed; display: grid; grid-template-columns: repeat(4, 1fr); left: 10px; right: 10px; bottom: max(10px, env(safe-area-inset-bottom)); z-index: 40; border: 1px solid var(--line); background: rgba(23,19,29,.94); backdrop-filter: blur(20px); border-radius: 17px; padding: 7px; box-shadow: var(--shadow); }
  .mobile-nav button { border: 0; background: transparent; color: var(--muted); border-radius: 11px; padding: 8px 4px; font-size: 10px; font-weight: 800; display: grid; gap: 3px; place-items: center; cursor: pointer; }
  .mobile-nav button span { font-size: 18px; }
  .mobile-nav button.active { color: var(--amber); background: var(--amber-soft); }
  .modal-backdrop { padding: 0; align-items: end; }
  .modal, .modal.wide { width: 100%; max-height: 94vh; border-radius: 22px 22px 0 0; }
  .toast { left: 14px; right: 14px; bottom: 92px; width: auto; }
}

@media (max-width: 480px) {
  .status-pill { padding: 7px 9px; }
  .topbar-title span { max-width: 190px; }
  .product-stats { grid-template-columns: 1fr; }
  .check-grid { grid-template-columns: 1fr; }
  .button-row .btn { flex: 1 1 auto; }
  .next-card { min-height: 310px; }
}

/* Website product autopilot */
.website-panel { border-color: rgba(139,226,139,.24); background: linear-gradient(150deg, rgba(139,226,139,.08), rgba(23,18,27,.96) 56%); }
.website-panel .card-header { align-items: center; }
.source-grid { margin-top: 8px; }
.source-tile { min-width: 0; border: 1px solid var(--line-soft); background: rgba(0,0,0,.16); border-radius: 14px; padding: 15px; }
.source-top { display: flex; justify-content: space-between; gap: 10px; align-items: center; }
.source-top strong { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.source-tile > a { display: block; color: var(--amber); font-size: 12px; margin-top: 10px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.source-meta { display: flex; justify-content: space-between; gap: 10px; margin-top: 12px; color: var(--faint); font-size: 10px; }
.source-error { margin-top: 10px; border: 1px solid rgba(255,124,124,.2); background: var(--danger-soft); color: #ffb7b7; border-radius: 9px; padding: 8px; font-size: 10px; line-height: 1.4; }

@media (max-width: 900px) {
  .website-panel .card-header { align-items: flex-start; }
  .source-grid { grid-template-columns: 1fr !important; }
}

/* v1.3 full-catalogue lock and official account connections */
.catalogue-lock { display:flex; align-items:center; justify-content:space-between; gap:20px; padding:20px; border:1px solid rgba(101,214,139,.28); background:linear-gradient(135deg, rgba(101,214,139,.12), rgba(245,165,36,.08)); border-radius:18px; }
.catalogue-lock h2 { margin:6px 0 6px; }
.catalogue-lock p { margin:0; color:var(--muted); }
.connection-summary { display:flex; justify-content:space-between; align-items:center; gap:24px; }
.connection-summary h2 { margin:6px 0; }
.connection-summary p { margin:0; color:var(--muted); max-width:760px; }
.account-card { min-height:265px; display:flex; flex-direction:column; }
.account-card.connected { border-color:rgba(101,214,139,.32); box-shadow:0 0 0 1px rgba(101,214,139,.08), var(--shadow); }
.account-card > p { color:var(--muted); line-height:1.55; }
.account-card .card-footer { margin-top:auto; }
.account-dot { width:12px; height:12px; border-radius:999px; background:var(--panel-3); box-shadow:0 0 0 5px rgba(255,255,255,.03); }
.account-dot.online { background:var(--green); box-shadow:0 0 0 5px rgba(101,214,139,.12); }
.account-meta { display:grid; gap:7px; margin:14px 0; padding:12px 0; border-top:1px solid var(--line); border-bottom:1px solid var(--line); color:var(--muted); font-size:12px; }
.account-meta span:first-child { color:var(--text); font-weight:800; }
.setup-steps { margin:18px 0; padding-left:22px; display:grid; gap:11px; color:var(--muted); line-height:1.5; }
.setup-steps code, .inline-note code { user-select:all; overflow-wrap:anywhere; }

@media (max-width: 760px) {
  .catalogue-lock, .connection-summary { align-items:flex-start; flex-direction:column; }
  .mobile-nav { grid-template-columns:repeat(5, 1fr); }
}
