/* =====================================================================
   CorePrompt — Design System (production tokens)
   Plus Jakarta Sans for UI · JetBrains Mono for prompt syntax only
   ===================================================================== */
:root {
  --canvas: #F8FAFC; --surface: #FFFFFF; --surface-2: #F1F5F9; --surface-3: #E2E8F0;
  --ink: #0F172A; --ink-2: #1E293B; --muted: #64748B; --faint: #94A3B8; --line: #E2E8F0; --line-2: #EEF2F6;
  --primary: #6366F1; --primary-hover: #4F46E5; --primary-active: #4338CA; --primary-soft: #EEF2FF; --primary-ring: rgba(99, 102, 241, .18);
  --violet: #8B5CF6; --cyan: #06B6D4; --mint: #10B981; --amber: #F59E0B; --rose: #F43F5E;
  --pub-bg: #ECFDF5; --pub-fg: #065F46; --pub-bd: #A7F3D0;
  --mem-bg: #FFFBEB; --mem-fg: #92400E; --mem-bd: #FDE68A;
  --stf-bg: #FFF1F2; --stf-fg: #9F1239; --stf-bd: #FECDD3;
  --code-bg: #0F172A; --code-ink: #E2E8F0; --code-dim: #94A3B8;
  --shadow-1: 0 4px 20px -2px rgba(15, 23, 42, .05);
  --shadow-2: 0 12px 32px -4px rgba(99, 102, 241, .12);
  --shadow-3: 0 20px 40px -8px rgba(15, 23, 42, .16);
  --shadow-hero: 0 12px 28px -6px rgba(99, 102, 241, .40);
  --r-card: 12px; --r-ctl: 8px; --r-pill: 9999px;
  --font: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace;
  --nav-h: 64px; --content-w: 760px; --wrap: 1240px;
  color-scheme: light;
}
[data-theme="dark"] {
  --canvas: #0B1120; --surface: #111A2E; --surface-2: #17223A; --surface-3: #22304D;
  --ink: #E2E8F0; --ink-2: #CBD5E1; --muted: #94A3B8; --faint: #64748B; --line: #22304D; --line-2: #1B2741;
  --primary-soft: rgba(99, 102, 241, .16);
  --pub-bg: rgba(16, 185, 129, .14); --pub-fg: #6EE7B7; --pub-bd: rgba(16, 185, 129, .35);
  --mem-bg: rgba(245, 158, 11, .14); --mem-fg: #FCD34D; --mem-bd: rgba(245, 158, 11, .35);
  --stf-bg: rgba(244, 63, 94, .14); --stf-fg: #FDA4AF; --stf-bd: rgba(244, 63, 94, .35);
  --shadow-1: 0 4px 20px -2px rgba(0, 0, 0, .35);
  color-scheme: dark;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--nav-h) + 16px); }
body { margin: 0; font-family: var(--font); font-size: 15px; line-height: 1.6; color: var(--ink); background: var(--canvas); -webkit-font-smoothing: antialiased; }
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: 4px; }
::selection { background: var(--primary-ring); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; } }

/* ---------- type scale ---------- */
h1, h2, h3, h4 { margin: 0; line-height: 1.2; letter-spacing: -.02em; font-weight: 700; }
.t-display { font-size: clamp(34px, 5.2vw, 56px); line-height: 1.06; letter-spacing: -.035em; font-weight: 800; }
.t-h1 { font-size: clamp(26px, 3.2vw, 36px); letter-spacing: -.025em; }
.t-h2 { font-size: clamp(20px, 2.2vw, 24px); }
.t-h3 { font-size: 17px; letter-spacing: -.01em; }
.t-muted { color: var(--muted); }
.t-small { font-size: 13px; }
.t-xs { font-size: 12px; }
.t-label { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.mono { font-family: var(--mono); }
.clamp-1 { display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.clamp-3 { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

/* ---------- layout ---------- */
.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 16px; }
@media (min-width: 768px) { .wrap { padding: 0 24px; } }
@media (min-width: 1200px) { .wrap { padding: 0 32px; } }
.stack > * + * { margin-top: var(--gap, 16px); }
.row { display: flex; align-items: center; gap: var(--gap, 12px); }
.row.wrap-row { flex-wrap: wrap; }
.between { justify-content: space-between; }
.grow { flex: 1; min-width: 0; }
.section { padding: 40px 0; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.section-head p { margin: 4px 0 0; color: var(--muted); font-size: 14px; }
.grid { display: grid; gap: 20px; }
.cards { display: grid; gap: 20px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 420px) { .cards { gap: 12px; } }
@media (min-width: 900px) { .cards { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1200px) { .cards.c4 { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.hide-mobile { display: none !important; }
@media (min-width: 768px) { .hide-mobile { display: revert !important; } .only-mobile { display: none !important; } }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 16px; border-radius: var(--r-ctl); border: 1px solid transparent;
  font-size: 14px; font-weight: 600; white-space: nowrap; transition: background .15s, border-color .15s, color .15s, box-shadow .15s, transform .15s; user-select: none; }
.btn svg { flex: none; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--primary); color: #fff; box-shadow: 0 6px 16px -6px rgba(99, 102, 241, .6); }
.btn-primary:hover:not(:disabled) { background: var(--primary-hover); }
.btn-primary:active:not(:disabled) { background: var(--primary-active); }
.btn-secondary { background: var(--surface); border-color: var(--line); color: var(--ink-2); }
.btn-secondary:hover:not(:disabled) { background: var(--surface-2); border-color: var(--surface-3); }
.btn-ghost { background: transparent; color: var(--ink-2); }
.btn-ghost:hover:not(:disabled) { background: var(--surface-2); }
.btn-dark { background: #0F172A; color: #fff; }
.btn-dark:hover:not(:disabled) { background: #1E293B; }
.btn-danger { background: #E11D48; color: #fff; }
.btn-danger:hover:not(:disabled) { background: #BE123C; }
.btn-danger-ghost { background: transparent; color: #E11D48; border-color: var(--stf-bd); }
.btn-danger-ghost:hover { background: var(--stf-bg); }
.btn-sm { height: 32px; padding: 0 12px; font-size: 13px; border-radius: 7px; }
.btn-lg { height: 48px; padding: 0 22px; font-size: 15px; }
.btn-block { width: 100%; }
.btn-icon { width: 40px; padding: 0; }
.btn-icon.btn-sm { width: 32px; }
.btn-pill { border-radius: var(--r-pill); }
.btn .spin { width: 16px; height: 16px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.link { color: var(--primary); font-weight: 600; }
.link:hover { color: var(--primary-hover); text-decoration: underline; text-underline-offset: 3px; }

/* ---------- forms ---------- */
.field { display: grid; gap: 6px; }
.field > label, .field > .label { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.field .hint { font-size: 12px; color: var(--muted); }
.field .err { font-size: 12px; color: #E11D48; font-weight: 500; min-height: 0; }
.input, .select, .textarea { width: 100%; height: 42px; padding: 0 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-ctl); outline: none;
  font-size: 14px; transition: border-color .15s, box-shadow .15s; }
.textarea { height: auto; min-height: 96px; padding: 10px 12px; line-height: 1.55; resize: vertical; }
.select { appearance: none; padding-right: 34px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748B' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-ring); }
.input.invalid, .textarea.invalid { border-color: #F43F5E; box-shadow: 0 0 0 3px rgba(244, 63, 94, .12); }
.input-sm, .select.input-sm { height: 34px; font-size: 13px; }
.input-wrap { position: relative; }
.input-wrap > svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--faint); pointer-events: none; }
.input-wrap > .input { padding-left: 38px; }
.input-wrap > .trail { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); }
.check { display: inline-flex; align-items: center; gap: 10px; font-size: 14px; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--primary); }
.switch { position: relative; display: inline-flex; width: 38px; height: 22px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; background: var(--surface-3); border-radius: 99px; transition: background .2s; cursor: pointer; }
.switch span::after { content: ''; position: absolute; left: 3px; top: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.2); transition: transform .2s; }
.switch input:checked + span { background: var(--primary); }
.switch input:checked + span::after { transform: translateX(16px); }
.switch input:focus-visible + span { outline: 2px solid var(--primary); outline-offset: 2px; }
.radio-cards { display: grid; gap: 8px; }
.radio-card { display: flex; gap: 10px; align-items: flex-start; padding: 12px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; transition: border-color .15s, background .15s; }
.radio-card input { margin-top: 3px; accent-color: var(--primary); }
.radio-card:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); }
.radio-card strong { display: block; font-size: 14px; }
.radio-card small { color: var(--muted); font-size: 12px; }
.seg { display: inline-flex; padding: 3px; background: var(--surface-2); border-radius: 10px; gap: 2px; }
.seg button { border: 0; background: transparent; height: 30px; padding: 0 12px; border-radius: 8px; font-size: 13px; font-weight: 600; color: var(--muted); }
.seg button.on { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(15, 23, 42, .1); }

/* ---------- badges & chips ---------- */
.badge { display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 10px; border-radius: var(--r-pill); font-size: 11.5px; font-weight: 700; border: 1px solid transparent; white-space: nowrap; line-height: 1; }
.badge svg { width: 12px; height: 12px; }
.badge-public { background: var(--pub-bg); color: var(--pub-fg); border-color: var(--pub-bd); }
.badge-members { background: var(--mem-bg); color: var(--mem-fg); border-color: var(--mem-bd); }
.badge-staff { background: var(--stf-bg); color: var(--stf-fg); border-color: var(--stf-bd); }
.badge-neutral { background: var(--surface-2); color: var(--ink-2); border-color: var(--line); }
.badge-primary { background: var(--primary-soft); color: var(--primary-active); border-color: #C7D2FE; }
.badge-dark { background: #0F172A; color: #fff; }
.badge-glass { background: rgba(255, 255, 255, .88); color: #0F172A; backdrop-filter: blur(6px); border-color: rgba(255,255,255,.6); }
.status { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; border-radius: var(--r-pill); font-size: 12px; font-weight: 600; background: var(--surface-2); color: var(--ink-2); }
.status::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.st-published { background: var(--pub-bg); color: var(--pub-fg); }
.st-draft { background: var(--surface-2); color: var(--muted); }
.st-scheduled { background: var(--primary-soft); color: var(--primary-active); }
.st-archived { background: #F1F5F9; color: #475569; }
.st-private, .st-suspended, .st-rejected { background: var(--stf-bg); color: var(--stf-fg); }
.st-pending { background: var(--mem-bg); color: var(--mem-fg); }
.st-active, .st-approved { background: var(--pub-bg); color: var(--pub-fg); }
.delta { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 99px; font-size: 11.5px; font-weight: 700; }
.delta.up { background: #DCFCE7; color: #15803D; }
.delta.down { background: #FFE4E6; color: #BE123C; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 14px; border-radius: var(--r-pill); border: 1px solid var(--line); background: var(--surface); font-size: 13px; font-weight: 600; color: var(--ink-2); white-space: nowrap; transition: border-color .15s, background .15s, color .15s; }
.chip:hover { border-color: #C7D2FE; color: var(--primary-active); }
.chip.on { background: var(--primary); color: #fff; border-color: var(--primary); }
.chip .x { display: inline-flex; opacity: .7; }
.chip-sm { height: 28px; padding: 0 10px; font-size: 12px; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chips.scroll { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; -webkit-overflow-scrolling: touch; }
.chips.scroll::-webkit-scrollbar { display: none; }
.kbd { display: inline-flex; align-items: center; height: 22px; padding: 0 6px; border-radius: 6px; border: 1px solid var(--line); background: var(--surface-2); font-size: 11px; font-weight: 600; color: var(--muted); }

/* ---------- cards ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); box-shadow: var(--shadow-1); }
.card-pad { padding: 20px; }
@media (min-width: 768px) { .card-pad { padding: 24px; } }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.card-head h3 { font-size: 16px; }
.card-head p { margin: 2px 0 0; font-size: 12.5px; color: var(--muted); }
.divider { height: 1px; background: var(--line); margin: 16px 0; border: 0; }

/* ---------- public navbar ---------- */
.nav { position: sticky; top: 0; z-index: 40; height: var(--nav-h); background: color-mix(in srgb, var(--canvas) 82%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.nav .wrap { height: 100%; display: flex; align-items: center; gap: 16px; }
.brand { display: inline-flex; align-items: center; gap: 9px; font-weight: 800; font-size: 17px; letter-spacing: -.02em; }
.brand-mark { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; background: var(--primary); color: #fff; box-shadow: 0 6px 14px -6px rgba(99,102,241,.7); }
.brand-mark svg { width: 18px; height: 18px; }
.nav-search { position: relative; flex: 1; max-width: 460px; }
.nav-search .box { display: flex; align-items: center; height: 40px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; transition: border-color .15s, box-shadow .15s; }
.nav-search .box:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-ring); }
.nav-search .box > svg { margin-left: 12px; color: var(--faint); flex: none; }
.nav-search input { flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: transparent; padding: 0 10px; font-size: 14px; }
.nav-search select { height: 28px; border: 0; border-left: 1px solid var(--line); background: transparent; padding: 0 22px 0 10px; font-size: 12.5px; font-weight: 600; color: var(--muted); outline: 0; appearance: none; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748B' stroke-width='2.5'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 6px center; max-width: 130px; }
.nav-search .kbd { margin-right: 8px; }
.nav-links { display: flex; gap: 2px; }
.nav-links a { white-space: nowrap; height: 36px; display: inline-flex; align-items: center; padding: 0 12px; border-radius: 8px; font-size: 14px; font-weight: 600; color: var(--muted); }
.nav-links a:hover { color: var(--ink); background: var(--surface-2); }
.nav-links a.on { color: var(--primary-active); background: var(--primary-soft); }
.nav-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.icon-btn { position: relative; width: 40px; height: 40px; border-radius: 10px; display: inline-grid; place-items: center; border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); }
.icon-btn:hover { background: var(--surface-2); }
.icon-btn .dot { position: absolute; top: -4px; right: -4px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 99px; background: var(--rose); color: #fff; font-size: 10.5px; font-weight: 700; display: grid; place-items: center; border: 2px solid var(--canvas); }
.avatar { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; background: var(--primary-soft); color: var(--primary-active); display: inline-grid; place-items: center; font-weight: 700; font-size: 13px; flex: none; overflow: hidden; }
.avatar-lg { width: 96px; height: 96px; font-size: 30px; }
.avatar-sm { width: 28px; height: 28px; font-size: 11px; }
.menu-pop { position: absolute; right: 0; top: calc(100% + 8px); min-width: 240px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-3); padding: 6px; z-index: 60; animation: pop .14s ease-out; }
@keyframes pop { from { opacity: 0; transform: translateY(-4px) scale(.98); } }
.menu-pop a, .menu-pop button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border: 0; background: transparent; border-radius: 8px; font-size: 14px; font-weight: 500; text-align: left; color: var(--ink-2); }
.menu-pop a:hover, .menu-pop button:hover { background: var(--surface-2); }
.menu-pop .head { padding: 10px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.menu-pop .sep { height: 1px; background: var(--line); margin: 4px 0; }
@media (max-width: 1279px) { .nav-links { display: none; } }
@media (max-width: 767px) { .nav-search { display: none; } .nav .wrap { gap: 8px; } }

/* typeahead */
.typeahead { position: absolute; left: 0; right: 0; top: calc(100% + 8px); background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-3); padding: 6px; z-index: 70; }
.ta-item { display: flex; align-items: center; gap: 12px; padding: 8px; border-radius: 9px; cursor: pointer; }
.ta-item:hover, .ta-item.active { background: var(--surface-2); }
.ta-item img, .ta-item .ph { width: 40px; height: 50px; border-radius: 7px; object-fit: cover; background: var(--surface-2); flex: none; }
.ta-item .ph.locked { filter: blur(3px); }
.ta-item .t { font-size: 14px; font-weight: 600; }
.ta-foot { display: flex; align-items: center; justify-content: space-between; padding: 10px 8px 6px; border-top: 1px solid var(--line); margin-top: 4px; font-size: 13px; }

/* drawer + modal */
.overlay { position: fixed; inset: 0; z-index: 90; background: rgba(15, 23, 42, .45); backdrop-filter: blur(2px); animation: fade .18s ease-out; }
@keyframes fade { from { opacity: 0; } }
.drawer { position: fixed; z-index: 91; background: var(--surface); box-shadow: var(--shadow-3); display: flex; flex-direction: column; }
.drawer.right { top: 0; right: 0; bottom: 0; width: min(440px, 100vw); animation: slideL .22s ease-out; }
.drawer.left { top: 0; left: 0; bottom: 0; width: min(320px, 88vw); animation: slideR .22s ease-out; }
.drawer.bottom { left: 0; right: 0; bottom: 0; max-height: 86vh; border-radius: 18px 18px 0 0; animation: slideU .24s ease-out; }
@keyframes slideL { from { transform: translateX(100%); } } @keyframes slideR { from { transform: translateX(-100%); } } @keyframes slideU { from { transform: translateY(100%); } }
.drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.drawer-head h3 { font-size: 16px; }
.drawer-body { padding: 20px; overflow-y: auto; flex: 1; }
.drawer-foot { padding: 14px 20px; border-top: 1px solid var(--line); display: flex; gap: 8px; justify-content: flex-end; }
.modal { position: fixed; z-index: 91; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(560px, calc(100vw - 24px)); max-height: calc(100vh - 32px); background: var(--surface); border-radius: 16px; box-shadow: var(--shadow-3); display: flex; flex-direction: column; animation: pop .18s ease-out; }
.modal.lg { width: min(860px, calc(100vw - 24px)); }
.modal.xl { width: min(1100px, calc(100vw - 24px)); height: calc(100vh - 32px); }
.modal .drawer-body { overflow-y: auto; }
.mob-nav a { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 10px; font-weight: 600; }
.mob-nav a:hover, .mob-nav a.on { background: var(--surface-2); }

/* toasts */
#toasts { position: fixed; top: 16px; right: 16px; z-index: 120; display: grid; gap: 8px; width: min(380px, calc(100vw - 32px)); }
.toast { display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-3); font-size: 14px; font-weight: 500; animation: toastIn .22s ease-out; border-left: 4px solid var(--mint); }
.toast.warn { border-left-color: var(--amber); } .toast.error { border-left-color: var(--rose); }
.toast > svg { flex: none; margin-top: 2px; color: var(--mint); } .toast.warn > svg { color: var(--amber); } .toast.error > svg { color: var(--rose); }
.toast.out { animation: toastOut .2s ease-in forwards; }
@keyframes toastIn { from { opacity: 0; transform: translateX(20px); } } @keyframes toastOut { to { opacity: 0; transform: translateX(20px); } }

/* skeleton */
.sk { background: linear-gradient(90deg, var(--surface-2) 0%, var(--surface-3) 50%, var(--surface-2) 100%); background-size: 200% 100%; animation: shimmer 1.3s ease-in-out infinite; border-radius: 8px; }
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: -100% 0; } }
.sk-line { height: 12px; margin: 8px 0; } .sk-title { height: 22px; width: 60%; }

/* empty */
.empty { text-align: center; padding: 48px 20px; }
.empty .ill { width: 88px; height: 88px; margin: 0 auto 16px; border-radius: 24px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary); }
.empty h3 { font-size: 18px; margin-bottom: 6px; }
.empty p { color: var(--muted); margin: 0 auto 18px; max-width: 420px; font-size: 14px; }

/* ---------- prompt card ---------- */
.pcard { position: relative; display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); overflow: hidden; box-shadow: var(--shadow-1); transition: transform .2s ease, box-shadow .2s ease, border-color .2s; }
.pcard:hover { transform: translateY(-2px); box-shadow: var(--shadow-2); border-color: #C7D2FE; }
.pcard .cover { position: relative; aspect-ratio: 4 / 5; background: var(--surface-2); overflow: hidden; }
.pcard .cover img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.pcard:hover .cover img { transform: scale(1.03); }
.pcard .cover .img-fail { position: absolute; inset: 0; display: grid; place-items: center; color: var(--faint); background: linear-gradient(135deg, var(--surface-2), var(--primary-soft)); }
.pcard .tl { position: absolute; top: 10px; left: 10px; max-width: calc(100% - 110px); }
.pcard .tr { position: absolute; top: 10px; right: 10px; }
.pcard .tl .badge { max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.pcard .copy-cta { position: absolute; left: 10px; right: 10px; bottom: 10px; opacity: 0; transform: translateY(6px); transition: opacity .18s, transform .18s; }
.pcard:hover .copy-cta, .pcard:focus-within .copy-cta { opacity: 1; transform: none; }
@media (hover: none) { .pcard .copy-cta { opacity: 1; transform: none; } }
.pcard .body { padding: 14px 14px 12px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.pcard .title { font-size: 15px; font-weight: 700; line-height: 1.35; letter-spacing: -.01em; }
.pcard .title a::after { content: ''; position: absolute; inset: 0; z-index: 1; }
.pcard .copy-cta, .pcard .tl, .pcard .tr, .pcard .author { z-index: 2; }
.pcard .meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: auto; }
.pcard .author { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: var(--muted); min-width: 0; position: relative; }
.pcard .author img { width: 20px; height: 20px; border-radius: 50%; }
.pcard .counter { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 600; color: var(--muted); flex: none; }
.tool-badge { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 9px 0 4px; border-radius: 99px; background: var(--surface-2); font-size: 11.5px; font-weight: 700; color: var(--ink-2); max-width: 100%; }
.tool-badge .tb-ic { width: 16px; height: 16px; border-radius: 50%; background: var(--primary); color: #fff; display: grid; place-items: center; font-size: 9px; font-weight: 800; flex: none; }
.tool-badge span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pcard.gated .cover img { filter: blur(8px) saturate(.9); transform: scale(1.12); }
.pcard.gated .cover::after { content: ''; position: absolute; inset: 0; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); background: rgba(15, 23, 42, .12); }
.pcard.gated .lockmark { position: absolute; z-index: 2; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; background: rgba(255,255,255,.92); color: #92400E; box-shadow: 0 10px 24px -8px rgba(15,23,42,.35); }
.pcard.gated .teaser { font-size: 12.5px; color: var(--muted); filter: blur(3px); user-select: none; }
.pcard.sk-card .cover { animation: shimmer 1.3s infinite; background: linear-gradient(90deg, var(--surface-2), var(--surface-3), var(--surface-2)); background-size: 200% 100%; }

/* ---------- hero (home) ---------- */
.hero { position: relative; padding: 56px 0 32px; overflow: hidden; }
.hero::before { content: ''; position: absolute; inset: -40% -10% auto; height: 520px; background: radial-gradient(closest-side, rgba(99,102,241,.16), transparent 70%), radial-gradient(closest-side at 70% 40%, rgba(139,92,246,.12), transparent 70%); pointer-events: none; }
.hero .wrap { position: relative; }
.hero-grid { display: grid; gap: 32px; align-items: center; }
@media (min-width: 1000px) { .hero-grid { grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: 48px; } }
.hero-grid > * { min-width: 0; }
.hero h1 { max-width: 13ch; }
.hero .lede { font-size: 17px; color: var(--muted); max-width: 52ch; margin: 16px 0 24px; }
.hero-search { position: relative; max-width: 620px; }
.hero-search .box { display: flex; align-items: center; gap: 8px; height: 60px; padding: 6px 6px 6px 18px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-1); transition: border-color .15s, box-shadow .15s; }
.hero-search .box:focus-within { border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-ring); }
.hero-search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font-size: 16px; height: 100%; }
.hero-search .box > svg { color: var(--faint); flex: none; }
.hero-stats { display: flex; gap: 28px; margin-top: 24px; flex-wrap: wrap; }
.hero-stats b { display: block; font-size: 22px; letter-spacing: -.02em; }
.hero-stats span { font-size: 13px; color: var(--muted); }
.hero-demo { position: relative; }
.hero-demo .promptbox { box-shadow: 0 30px 60px -20px rgba(15, 23, 42, .45); }
.hero-demo .float-card { position: absolute; left: -28px; bottom: -34px; width: 190px; padding: 12px; border-radius: 14px; background: var(--primary); color: #fff; box-shadow: var(--shadow-hero); }
.hero-demo .float-card b { font-size: 24px; letter-spacing: -.02em; display: block; }
@media (max-width: 999px) { .hero-demo { display: none; } }

/* taxonomy tiles */
.tiles { display: grid; gap: 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 768px) { .tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1200px) { .tiles { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
.tile { display: flex; flex-direction: column; gap: 14px; padding: 16px; border-radius: var(--r-card); background: var(--surface); border: 1px solid var(--line); transition: border-color .15s, box-shadow .15s, transform .15s; }
.tile:hover { border-color: #C7D2FE; box-shadow: var(--shadow-2); transform: translateY(-2px); }
.tile .ic { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary); }
.tile .ic.tool { background: #0F172A; color: #fff; font-weight: 800; font-size: 15px; }
.tile strong { font-size: 14.5px; display: block; }
.tile small { color: var(--muted); font-size: 12.5px; font-weight: 600; }
@media (max-width: 767px) { .tiles.scroll-mobile { display: flex; overflow-x: auto; scrollbar-width: none; } .tiles.scroll-mobile .tile { flex: 0 0 150px; } }

/* collections */
.colls { display: grid; gap: 20px; }
@media (min-width: 900px) { .colls { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.coll { display: flex; flex-direction: column; border-radius: var(--r-card); overflow: hidden; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-1); transition: box-shadow .2s, transform .2s; }
.coll:hover { box-shadow: var(--shadow-2); transform: translateY(-2px); }
.coll .stackprev { position: relative; height: 180px; background: linear-gradient(135deg, var(--primary-soft), #F5F3FF); display: flex; align-items: flex-end; justify-content: center; padding-top: 18px; overflow: hidden; }
.coll .stackprev img { width: 34%; aspect-ratio: 4/5; object-fit: cover; border-radius: 10px; border: 3px solid #fff; box-shadow: 0 12px 24px -10px rgba(15,23,42,.45); margin: 0 -16px; transform-origin: bottom center; }
.coll .stackprev img:nth-child(1) { transform: rotate(-8deg) translateY(10px); } .coll .stackprev img:nth-child(2) { z-index: 1; transform: translateY(-4px); } .coll .stackprev img:nth-child(3) { transform: rotate(8deg) translateY(10px); }
.coll .body { padding: 16px 18px 18px; }
.coll h3 { font-size: 16px; margin-bottom: 4px; }

/* ---------- page headers / toolbar ---------- */
.page-head { padding: 32px 0 20px; }
.page-head p { margin: 8px 0 0; color: var(--muted); max-width: 64ch; }
.crumbs { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 13px; color: var(--muted); margin-bottom: 14px; }
.crumbs a:hover { color: var(--primary); }
.crumbs svg { width: 14px; height: 14px; color: var(--faint); }
.toolbar { position: sticky; top: var(--nav-h); z-index: 30; padding: 12px 0; background: color-mix(in srgb, var(--canvas) 90%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.toolbar .row { flex-wrap: wrap; }
.toolbar .select { width: auto; min-width: 140px; height: 38px; font-size: 13.5px; }
.active-filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 10px; }
.result-count { font-size: 14px; color: var(--muted); }
.result-count b { color: var(--ink); }
.pager { display: flex; justify-content: center; gap: 6px; margin: 32px 0 8px; }
.pager button { min-width: 38px; height: 38px; border-radius: 9px; border: 1px solid var(--line); background: var(--surface); font-weight: 600; font-size: 13.5px; }
.pager button.on { background: var(--primary); color: #fff; border-color: var(--primary); }
.pager button:disabled { opacity: .4; cursor: default; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.tabs button, .tabs a { position: relative; height: 42px; padding: 0 14px; border: 0; background: transparent; font-weight: 600; font-size: 14px; color: var(--muted); white-space: nowrap; display: inline-flex; align-items: center; gap: 8px; }
.tabs button.on, .tabs a.on { color: var(--primary-active); }
.tabs button.on::after, .tabs a.on::after { content: ''; position: absolute; left: 10px; right: 10px; bottom: -1px; height: 2px; border-radius: 2px; background: var(--primary); }
.tabs .count { height: 20px; min-width: 20px; padding: 0 6px; border-radius: 99px; background: var(--surface-2); font-size: 11px; display: inline-grid; place-items: center; color: var(--muted); }
.tabs .on .count { background: var(--primary-soft); color: var(--primary-active); }

/* search layout */
.split { display: grid; gap: 24px; }
@media (min-width: 1000px) { .split { grid-template-columns: 260px minmax(0, 1fr); } }
.facet h4 { font-size: 13px; font-weight: 700; margin: 0 0 10px; }
.facet + .facet { margin-top: 20px; padding-top: 20px; border-top: 1px solid var(--line); }
.facet label { display: flex; align-items: center; gap: 10px; padding: 5px 0; font-size: 14px; cursor: pointer; }
.facet label input { accent-color: var(--primary); width: 16px; height: 16px; }
.facet label .n { margin-left: auto; font-size: 11.5px; font-weight: 700; color: var(--muted); background: var(--surface-2); border-radius: 99px; padding: 1px 8px; }

/* ---------- prompt box (signature component) ---------- */
.promptbox { border-radius: 14px; overflow: hidden; background: var(--code-bg); color: var(--code-ink); border: 1px solid #1E293B; box-shadow: inset 0 1px 0 rgba(255,255,255,.06), 0 16px 32px -12px rgba(15, 23, 42, .35); margin: 24px 0; }
.pb-head { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-bottom: 1px solid rgba(148, 163, 184, .14); flex-wrap: wrap; }
.pb-head .pb-title { font-weight: 700; font-size: 14px; color: #F8FAFC; margin-right: auto; display: flex; align-items: center; gap: 8px; }
.pb-head .pb-title::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--violet); box-shadow: 0 0 0 3px rgba(139, 92, 246, .25); }
.pb-pill { height: 22px; padding: 0 9px; border-radius: 99px; font-size: 11px; font-weight: 700; display: inline-flex; align-items: center; background: rgba(148, 163, 184, .14); color: #CBD5E1; text-transform: capitalize; }
.pb-pill.v-main { background: rgba(99, 102, 241, .22); color: #C7D2FE; }
.pb-pill.v-negative { background: rgba(244, 63, 94, .18); color: #FDA4AF; }
.pb-pill.v-alternative { background: rgba(6, 182, 212, .18); color: #A5F3FC; }
.pb-pill.v-parameter { background: rgba(245, 158, 11, .18); color: #FDE68A; }
.pb-body { position: relative; }
.pb-body pre { margin: 0; padding: 18px 18px 20px; font-family: var(--mono); font-size: 13.5px; line-height: 1.75; white-space: pre-wrap; word-break: break-word; color: var(--code-ink); max-height: 360px; overflow: auto; }
.pb-body pre .pm { color: #C4B5FD; } .pb-body pre .pm b { color: #FDE68A; font-weight: 500; }
.pb-body pre .var { color: #A5B4FC; background: rgba(99, 102, 241, .22); border-radius: 5px; padding: 1px 4px; }
.pb-body pre .str { color: #86EFAC; }
.pb-body pre .w { color: #67E8F9; }
.pb-foot { display: flex; align-items: center; gap: 10px; padding: 10px 12px 12px 14px; background: rgba(15, 23, 42, .6); border-top: 1px solid rgba(148, 163, 184, .14); flex-wrap: wrap; }
.pb-foot .note { flex: 1; min-width: 180px; font-size: 12.5px; color: var(--code-dim); display: flex; gap: 6px; align-items: flex-start; }
.pb-foot .note svg { flex: none; margin-top: 2px; }
.pb-model { height: 28px; padding: 0 10px; border-radius: 8px; border: 1px solid rgba(148, 163, 184, .25); font-size: 12px; font-weight: 600; color: #E2E8F0; display: inline-flex; align-items: center; gap: 6px; }
.pb-copy { height: 36px; padding: 0 14px; border-radius: 9px; border: 0; background: #fff; color: #0F172A; font-weight: 700; font-size: 13px; display: inline-flex; align-items: center; gap: 8px; transition: background .15s, color .15s; }
.pb-copy:hover { background: #E0E7FF; }
.pb-copy.ok { background: var(--mint); color: #fff; }
.pb-copy.fail { background: #FFE4E6; color: #9F1239; }
.pb-count { font-size: 11.5px; color: var(--code-dim); font-weight: 600; }

/* ---------- article / detail ---------- */
.detail { display: grid; gap: 32px; padding-bottom: 48px; }
@media (min-width: 1100px) { .detail { grid-template-columns: minmax(0, 68fr) minmax(0, 32fr); gap: 40px; } }
.detail h1 { margin: 6px 0 12px; }
.detail .summary { font-size: 17px; color: var(--muted); margin: 0 0 16px; max-width: 64ch; }
.meta-pills { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.meta-pill { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; border-radius: 99px; background: var(--surface); border: 1px solid var(--line); font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.meta-pill img { width: 20px; height: 20px; border-radius: 50%; margin-left: -6px; }
.feature-img { position: relative; min-height: 120px; margin: 24px 0 16px; border-radius: 16px; overflow: hidden; background: var(--surface-2); cursor: zoom-in; }
.feature-img img { width: 100%; max-height: 640px; object-fit: cover; }
.feature-img .img-fail { position: absolute; inset: 0; display: grid; place-items: center; color: var(--faint); }
.feature-img .zoom { position: absolute; right: 12px; bottom: 12px; }
.share-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.article { font-size: 16px; line-height: 1.75; color: var(--ink-2); max-width: var(--content-w); }
.article > * + * { margin-top: 1em; }
.article h2 { font-size: 23px; margin-top: 1.8em; color: var(--ink); }
.article h3 { font-size: 18px; margin-top: 1.5em; color: var(--ink); }
.article h4 { font-size: 16px; margin-top: 1.3em; }
.article p { margin-bottom: 0; }
.article a { color: var(--primary); text-decoration: underline; text-underline-offset: 3px; }
.article ul, .article ol { padding-left: 1.3em; } .article li + li { margin-top: .35em; }
.article blockquote { margin: 1.4em 0; padding: 14px 18px; border-left: 3px solid var(--primary); background: var(--primary-soft); border-radius: 0 10px 10px 0; color: var(--ink); font-weight: 500; }
.article img { border-radius: 12px; }
.article figure { margin: 1.6em 0; } .article figure.align-center img { margin: 0 auto; } .article figure.align-left { max-width: 50%; float: left; margin-right: 1em; } .article figure.align-right { max-width: 50%; float: right; margin-left: 1em; }
.article figcaption { font-size: 13px; color: var(--muted); text-align: center; margin-top: 8px; }
.article hr { border: 0; height: 1px; background: var(--line); margin: 2em 0; }
.article pre.cp-code { background: var(--code-bg); color: var(--code-ink); padding: 16px; border-radius: 12px; overflow-x: auto; font-family: var(--mono); font-size: 13px; line-height: 1.65; }
.article code { font-family: var(--mono); font-size: .88em; background: var(--surface-2); padding: 2px 6px; border-radius: 5px; }
.article pre code { background: none; padding: 0; }
.article table { width: 100%; border-collapse: collapse; font-size: 14px; display: block; overflow-x: auto; }
.article th, .article td { border: 1px solid var(--line); padding: 8px 10px; text-align: left; }
.callout { display: flex; gap: 12px; padding: 14px 16px; border-radius: 12px; border: 1px solid; margin: 20px 0; font-size: 15px; }
.callout > svg { flex: none; margin-top: 3px; }
.callout.info { background: #EFF6FF; border-color: #BFDBFE; color: #1E3A8A; }
.callout.tip { background: var(--pub-bg); border-color: var(--pub-bd); color: var(--pub-fg); }
.callout.warning { background: var(--mem-bg); border-color: var(--mem-bd); color: var(--mem-fg); }
[data-theme="dark"] .callout.info { background: rgba(59,130,246,.12); border-color: rgba(59,130,246,.3); color: #BFDBFE; }
.compare { position: relative; border-radius: 14px; overflow: hidden; aspect-ratio: 3 / 2; background: var(--surface-2); user-select: none; margin: 20px 0; touch-action: pan-y; }
.compare img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.compare .before { clip-path: inset(0 calc(100% - var(--pos, 50%)) 0 0); }
.compare .handle { position: absolute; top: 0; bottom: 0; left: var(--pos, 50%); width: 3px; margin-left: -1.5px; background: #fff; box-shadow: 0 0 0 1px rgba(15,23,42,.2); pointer-events: none; }
.compare .handle::after { content: ''; position: absolute; top: 50%; left: 50%; width: 40px; height: 40px; margin: -20px 0 0 -20px; border-radius: 50%; background: #fff; box-shadow: 0 6px 16px rgba(15,23,42,.3);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='22' viewBox='0 0 24 24' fill='none' stroke='%236366F1' stroke-width='2.5' stroke-linecap='round'%3E%3Cpath d='m9 18-6-6 6-6M15 6l6 6-6 6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: center; }
.compare input[type=range] { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: ew-resize; margin: 0; }
.compare .lbl { position: absolute; top: 12px; z-index: 1; } .compare .lbl.l { left: 12px; } .compare .lbl.r { right: 12px; }
.video { position: relative; aspect-ratio: 16 / 9; border-radius: 14px; overflow: hidden; background: #000; margin: 20px 0; }
.video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.video .poster { position: absolute; inset: 0; display: grid; place-items: center; cursor: pointer; background: #0F172A center/cover no-repeat; border: 0; width: 100%; }
.video .poster span { width: 68px; height: 68px; border-radius: 50%; background: rgba(255,255,255,.95); display: grid; place-items: center; color: var(--primary); box-shadow: 0 10px 30px rgba(0,0,0,.4); }
.gallery { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); margin: 20px 0; }
.gallery img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 10px; cursor: zoom-in; }
.linkcard, .refcard, .toolcard, .dlcard { display: flex; gap: 14px; align-items: center; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); margin: 18px 0; text-decoration: none !important; color: var(--ink) !important; }
.linkcard:hover, .dlcard:hover { border-color: #C7D2FE; box-shadow: var(--shadow-2); }
.linkcard .ic, .dlcard .ic, .toolcard .ic { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary); flex: none; }
.linkcard small, .dlcard small { color: var(--muted); display: block; font-size: 12.5px; }
.btnlink { display: inline-flex !important; text-decoration: none !important; color: #fff !important; }
.embed { margin: 20px 0; } .embed iframe { width: 100%; min-height: 360px; border: 0; border-radius: 12px; }
.side { display: grid; gap: 16px; align-content: start; }
@media (min-width: 1100px) { .side { position: sticky; top: calc(var(--nav-h) + 20px); } }
.stat-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.stat-pair .s { padding: 14px; border-radius: 12px; background: var(--surface-2); }
.stat-pair .s.hl { background: var(--primary); color: #fff; box-shadow: var(--shadow-hero); }
.stat-pair b { display: block; font-size: 22px; letter-spacing: -.02em; }
.stat-pair span { font-size: 12px; opacity: .8; font-weight: 600; }
.kv { display: grid; gap: 10px; font-size: 14px; }
.kv div { display: flex; justify-content: space-between; gap: 12px; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; font-weight: 600; text-align: right; }
.toc a { display: block; padding: 6px 10px; border-left: 2px solid var(--line); font-size: 13.5px; color: var(--muted); }
.toc a.lvl3 { padding-left: 22px; font-size: 13px; }
.toc a.on { color: var(--primary-active); border-left-color: var(--primary); font-weight: 600; background: var(--primary-soft); border-radius: 0 6px 6px 0; }
.source-card { display: flex; gap: 12px; align-items: center; }
.source-card img { width: 56px; height: 56px; border-radius: 10px; object-fit: cover; flex: none; background: var(--surface-2); }
.lightbox { position: fixed; inset: 0; z-index: 130; background: rgba(2, 6, 23, .92); display: grid; place-items: center; padding: 24px; animation: fade .2s; cursor: zoom-out; }
.lightbox img { max-width: 100%; max-height: 100%; border-radius: 10px; }
.lightbox button { position: absolute; top: 16px; right: 16px; }

/* gate */
.gate-wrap { position: relative; }
.gate-teaser { position: relative; max-height: 220px; overflow: hidden; -webkit-mask-image: linear-gradient(#000 30%, transparent); mask-image: linear-gradient(#000 30%, transparent); }
.gate-frost { position: relative; border-radius: 16px; overflow: hidden; margin-top: -40px; padding: 32px 16px; background: repeating-linear-gradient(180deg, var(--surface-2) 0 14px, transparent 14px 28px); }
.gate-frost::before { content: ''; position: absolute; inset: 0; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); background: color-mix(in srgb, var(--canvas) 55%, transparent); }
.gate-card { position: relative; max-width: 520px; margin: 0 auto; text-align: center; padding: 32px 24px; }
.gate-card .lock { width: 64px; height: 64px; margin: 0 auto 18px; border-radius: 20px; display: grid; place-items: center; background: var(--mem-bg); border: 1px solid var(--mem-bd); color: #B45309; }
.gate-card h2 { font-size: 22px; margin-bottom: 14px; }
.gate-card ul { text-align: left; list-style: none; padding: 0; margin: 0 auto 22px; display: grid; gap: 10px; max-width: 360px; font-size: 14.5px; }
.gate-card li { display: flex; gap: 10px; align-items: flex-start; } .gate-card li svg { color: var(--mint); flex: none; margin-top: 3px; }
.gate-cover { position: relative; border-radius: 16px; overflow: hidden; aspect-ratio: 16/8; background: var(--surface-2); margin: 20px 0; }
.gate-cover img { width: 100%; height: 100%; object-fit: cover; filter: blur(14px) saturate(.9); transform: scale(1.15); }
.gate-cover .lockmark { position: absolute; inset: 0; display: grid; place-items: center; }
.gate-cover .lockmark span { display: inline-flex; align-items: center; gap: 8px; padding: 10px 16px; border-radius: 99px; background: rgba(255,255,255,.94); color: #92400E; font-weight: 700; font-size: 14px; box-shadow: var(--shadow-3); }

/* static pages & auth */
.reading { max-width: 760px; margin: 0 auto; }
.static-grid { display: grid; gap: 32px; }
@media (min-width: 1100px) { .static-grid { grid-template-columns: minmax(0, 760px) 220px; justify-content: center; } }
.team { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); margin-top: 24px; }
.auth-page { min-height: calc(100vh - var(--nav-h)); display: grid; place-items: center; padding: 40px 16px; background: radial-gradient(800px 400px at 50% -10%, rgba(99,102,241,.12), transparent 70%); }
.auth-card { width: 100%; max-width: 420px; padding: 32px 28px; }
.auth-card.w440 { max-width: 440px; }
.auth-card .brand { justify-content: center; width: 100%; margin-bottom: 20px; }
.auth-card h1 { font-size: 24px; text-align: center; }
.auth-card .sub { text-align: center; color: var(--muted); margin: 6px 0 22px; font-size: 14px; }
.or { display: flex; align-items: center; gap: 12px; color: var(--faint); font-size: 12px; margin: 18px 0; }
.or::before, .or::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.alert { display: flex; gap: 10px; padding: 12px 14px; border-radius: 10px; font-size: 13.5px; border: 1px solid; align-items: flex-start; }
.alert svg { flex: none; margin-top: 1px; }
.alert.info { background: var(--primary-soft); border-color: #C7D2FE; color: var(--primary-active); }
.alert.error { background: var(--stf-bg); border-color: var(--stf-bd); color: var(--stf-fg); }
.alert.warn { background: var(--mem-bg); border-color: var(--mem-bd); color: var(--mem-fg); }
.alert.ok { background: var(--pub-bg); border-color: var(--pub-bd); color: var(--pub-fg); }
.strength { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; }
.strength i { height: 4px; border-radius: 4px; background: var(--surface-3); transition: background .2s; }
.strength[data-s="1"] i:nth-child(-n+1) { background: var(--rose); } .strength[data-s="2"] i:nth-child(-n+2) { background: var(--amber); }
.strength[data-s="3"] i:nth-child(-n+3) { background: #84CC16; } .strength[data-s="4"] i { background: var(--mint); }
.criteria { display: grid; gap: 4px; font-size: 12.5px; color: var(--muted); list-style: none; padding: 0; margin: 4px 0 0; }
.criteria li { display: flex; gap: 6px; align-items: center; } .criteria li.ok { color: var(--pub-fg); }
.demo-accounts { display: grid; gap: 6px; margin-top: 16px; }
.demo-accounts button { display: flex; justify-content: space-between; align-items: center; padding: 8px 12px; border-radius: 9px; border: 1px dashed var(--line); background: var(--surface-2); font-size: 13px; }
.demo-accounts button:hover { border-color: var(--primary); }
.dropzone { border: 2px dashed var(--line); border-radius: 12px; padding: 22px; text-align: center; color: var(--muted); cursor: pointer; transition: border-color .15s, background .15s; background: var(--surface); }
.dropzone:hover, .dropzone.over { border-color: var(--primary); background: var(--primary-soft); color: var(--primary-active); }

/* 404 */
.nf { text-align: center; padding: 72px 16px 40px; }
.nf .num { font-size: clamp(88px, 16vw, 160px); font-weight: 800; letter-spacing: -.06em; line-height: 1; background: linear-gradient(135deg, var(--primary), var(--violet)); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* footer */
.footer { margin-top: 48px; border-top: 1px solid var(--line); background: var(--surface); }
.footer-grid { display: grid; gap: 32px; padding: 48px 0 32px; }
@media (min-width: 768px) { .footer-grid { grid-template-columns: 1.6fr 1fr 1fr 1fr; } }
.footer h4 { font-size: 13px; margin-bottom: 14px; color: var(--ink); }
.footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; font-size: 14px; color: var(--muted); }
.footer ul a:hover { color: var(--primary); }
.footer .mission { color: var(--muted); font-size: 14px; margin: 12px 0 16px; max-width: 40ch; }
.socials { display: flex; gap: 8px; flex-wrap: wrap; }
.footer-bottom { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 18px 0 28px; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); }
.demo-ribbon { background: #0F172A; color: #E2E8F0; font-size: 12.5px; padding: 8px 0; }
.demo-ribbon .wrap { display: flex; gap: 10px; align-items: center; justify-content: center; flex-wrap: wrap; text-align: center; }
.demo-ribbon b { color: #FDE68A; }

/* =====================================================================
   ADMIN WORKSPACE
   ===================================================================== */
.adm { min-height: 100vh; background: #F8FAFC; color: #0F172A; color-scheme: light;
  --canvas: #F8FAFC; --surface: #FFFFFF; --surface-2: #F1F5F9; --surface-3: #E2E8F0; --ink: #0F172A; --ink-2: #1E293B; --muted: #64748B; --faint: #94A3B8; --line: #E2E8F0;
  --primary-soft: #EEF2FF; --pub-bg: #ECFDF5; --pub-fg: #065F46; --pub-bd: #A7F3D0; --mem-bg: #FFFBEB; --mem-fg: #92400E; --mem-bd: #FDE68A; --stf-bg: #FFF1F2; --stf-fg: #9F1239; --stf-bd: #FECDD3;
  --shadow-1: 0 4px 20px -2px rgba(15, 23, 42, .05); }
.dock { position: fixed; left: 0; top: 0; bottom: 0; width: 72px; background: #0F172A; z-index: 50; display: flex; flex-direction: column; align-items: center; padding: 14px 0; gap: 4px; box-shadow: inset -1px 0 0 rgba(255,255,255,.06); }
.dock .brand-mark { margin-bottom: 14px; }
.dock nav { display: flex; flex-direction: column; gap: 2px; flex: 1; overflow-y: auto; overflow-x: visible; scrollbar-width: none; width: 100%; align-items: center; padding: 2px 0; }
.dock nav::-webkit-scrollbar { display: none; }
.dock a, .dock button.dk { position: relative; width: 44px; height: 40px; flex: none; border-radius: 11px; display: grid; place-items: center; color: #94A3B8; border: 0; background: transparent; transition: background .15s, color .15s; }
.dock a:hover, .dock button.dk:hover { background: rgba(148, 163, 184, .14); color: #F8FAFC; }
.dock a.on { background: var(--primary); color: #fff; box-shadow: 0 8px 18px -8px rgba(99,102,241,.9); }
.dock a.on::before { content: ''; position: absolute; left: -14px; top: 9px; bottom: 9px; width: 4px; border-radius: 0 4px 4px 0; background: #A5B4FC; }
.dock .cnt { position: absolute; top: 2px; right: 0; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 99px; background: var(--rose); color: #fff; font-size: 10px; font-weight: 700; display: grid; place-items: center; border: 2px solid #0F172A; }
.dock .sep { width: 28px; height: 1px; background: rgba(148,163,184,.2); margin: 6px 0; flex: none; }
.flyout { position: fixed; z-index: 200; background: #0F172A; color: #fff; padding: 6px 10px; border-radius: 8px; font-size: 12.5px; font-weight: 600; pointer-events: none; box-shadow: var(--shadow-3); white-space: nowrap; animation: fade .12s; }
.adm-main { margin-left: 72px; min-width: 0; }
.topbar { position: sticky; top: 0; z-index: 40; height: 68px; display: flex; align-items: center; gap: 16px; padding: 0 24px; background: rgba(248, 250, 252, .86); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom: 1px solid #E2E8F0; }
.topbar .greet h1 { font-size: 18px; letter-spacing: -.02em; }
.topbar .greet p { margin: 0; font-size: 12.5px; color: #64748B; }
.omni { position: relative; flex: 1; max-width: 420px; margin-left: auto; }
.sync { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: #64748B; white-space: nowrap; }
.sync i { width: 8px; height: 8px; border-radius: 50%; background: var(--mint); box-shadow: 0 0 0 3px rgba(16,185,129,.18); }
.sync.busy i { background: var(--amber); box-shadow: 0 0 0 3px rgba(245,158,11,.18); animation: pulse 1s infinite; }
@keyframes pulse { 50% { opacity: .4; } }
.role-badge { height: 24px; padding: 0 10px; border-radius: 99px; background: #0F172A; color: #fff; font-size: 11px; font-weight: 700; display: inline-flex; align-items: center; text-transform: capitalize; }
.canvas { padding: 24px; max-width: 1480px; }
.adm-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.adm-head h2 { font-size: 24px; letter-spacing: -.025em; }
.adm-head p { margin: 4px 0 0; color: #64748B; font-size: 14px; }
.adm .card { border-radius: 16px; }
@media (max-width: 899px) {
  .dock { transform: translateX(-100%); transition: transform .22s; width: 76px; }
  .dock.open { transform: none; }
  .adm-main { margin-left: 0; }
  .topbar { padding: 0 14px; gap: 10px; }
  .topbar .greet p, .sync span { display: none; }
  .canvas { padding: 16px; }
}
.kpis { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.kpi { padding: 20px; border-radius: 16px; background: #fff; border: 1px solid #E2E8F0; box-shadow: var(--shadow-1); display: flex; flex-direction: column; gap: 14px; min-height: 150px; }
.kpi .top { display: flex; justify-content: space-between; align-items: flex-start; }
.kpi .ic { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: #F1F5F9; color: #0F172A; }
.kpi .lbl { font-size: 13.5px; font-weight: 600; color: #475569; }
.kpi .val { font-size: 28px; font-weight: 800; letter-spacing: -.03em; line-height: 1; }
.kpi .val small { font-size: 12px; font-weight: 500; color: #64748B; letter-spacing: 0; margin-left: 6px; }
.kpi.hero { background: var(--primary); color: #fff; border-color: var(--primary); box-shadow: var(--shadow-hero); }
.kpi.hero .ic { background: #fff; color: var(--primary); } .kpi.hero .lbl, .kpi.hero .val small { color: rgba(255,255,255,.85); }
.kpi.dark { background: #0F172A; color: #fff; border-color: #0F172A; box-shadow: inset 0 1px 0 rgba(255,255,255,.08), 0 16px 32px -6px rgba(15,23,42,.22); }
.kpi.dark .ic { background: rgba(255,255,255,.1); color: #fff; } .kpi.dark .lbl, .kpi.dark .val small { color: #94A3B8; }
.subkpis { display: flex; gap: 10px; flex-wrap: wrap; margin: 16px 0 20px; }
.subkpi { display: inline-flex; align-items: center; gap: 10px; padding: 8px 14px 8px 8px; border-radius: 99px; background: #fff; border: 1px solid #E2E8F0; font-size: 13px; font-weight: 600; color: #475569; }
.subkpi .ic { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: #EEF2FF; color: var(--primary); }
.subkpi b { color: #0F172A; font-size: 15px; }
.dash-grid { display: grid; gap: 20px; }
@media (min-width: 1200px) { .dash-grid { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); } }
.qa { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.qa a { display: flex; align-items: center; gap: 10px; padding: 12px; border-radius: 12px; border: 1px dashed #CBD5E1; font-weight: 600; font-size: 13.5px; color: #1E293B; background: #fff; }
.qa a:hover { border-color: var(--primary); color: var(--primary-active); background: #EEF2FF; }
.feed { display: grid; gap: 2px; }
.feed .it { display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px solid #F1F5F9; font-size: 13.5px; }
.feed .it:last-child { border-bottom: 0; }
.feed .dotic { width: 30px; height: 30px; border-radius: 50%; background: #EEF2FF; color: var(--primary); display: grid; place-items: center; flex: none; }
.legend { display: grid; gap: 10px; }
.legend .li { display: flex; align-items: center; gap: 10px; font-size: 13.5px; }
.legend .sw { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.legend .li b { margin-left: auto; }
.chart-tip { position: fixed; z-index: 150; pointer-events: none; background: #0F172A; color: #fff; padding: 8px 12px; border-radius: 10px; font-size: 12.5px; box-shadow: var(--shadow-3); line-height: 1.6; }
.chart-tip i { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart .bar { transition: opacity .15s; cursor: pointer; } .chart .bar:hover { opacity: .8; }
.chart .ax { font-size: 11px; fill: #94A3B8; font-family: var(--font); }

/* data table */
.tbl-wrap { overflow-x: auto; }
.tbl { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13.5px; }
.tbl th { text-align: left; font-size: 12px; font-weight: 700; color: #64748B; padding: 10px 12px; border-bottom: 1px solid #E2E8F0; white-space: nowrap; background: #F8FAFC; }
.tbl th:first-child { border-top-left-radius: 10px; } .tbl th:last-child { border-top-right-radius: 10px; }
.tbl td { padding: 12px; border-bottom: 1px solid #F1F5F9; vertical-align: middle; }
.tbl tr:hover td { background: #FAFBFF; }
.tbl tr.sel td { background: #EEF2FF; }
.tbl .thumb { width: 44px; height: 54px; border-radius: 8px; object-fit: cover; background: #F1F5F9; display: block; }
.tbl .thumb.sq { height: 44px; }
.tbl .ttl { font-weight: 700; color: #0F172A; display: block; }
.tbl .slug { font-size: 12px; color: #64748B; }
.tbl .num { font-variant-numeric: tabular-nums; font-weight: 600; }
.tbl .acts { display: flex; gap: 4px; justify-content: flex-end; }
.tbl input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--primary); }
@media (max-width: 899px) {
  .tbl.stack thead { display: none; }
  .tbl.stack, .tbl.stack tbody, .tbl.stack tr, .tbl.stack td { display: block; width: 100%; }
  .tbl.stack tr { background: #fff; border: 1px solid #E2E8F0; border-radius: 14px; padding: 6px 4px; margin-bottom: 12px; box-shadow: var(--shadow-1); }
  .tbl.stack td { border: 0; padding: 7px 12px; display: flex; justify-content: space-between; align-items: center; gap: 12px; text-align: right; }
  .tbl.stack td::before { content: attr(data-label); font-size: 12px; font-weight: 600; color: #64748B; text-align: left; }
  .tbl.stack td.main { display: block; text-align: left; } .tbl.stack td.main::before { display: none; }
  .tbl.stack td.acts-cell { justify-content: flex-end; border-top: 1px solid #F1F5F9; margin-top: 4px; } .tbl.stack td.acts-cell::before { display: none; }
  .tbl.stack tr:hover td { background: transparent; }
}
.bulkbar { position: sticky; top: 76px; z-index: 30; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 10px 12px; border-radius: 14px; background: #0F172A; color: #fff; margin-bottom: 12px; box-shadow: var(--shadow-3); animation: pop .15s; }
.bulkbar .btn-secondary { background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.14); color: #fff; }
.bulkbar .btn-secondary:hover { background: rgba(255,255,255,.16); }
.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.filters .select, .filters .input { width: auto; height: 38px; font-size: 13.5px; }
.filters .input-wrap { flex: 1; min-width: 200px; }

/* editor */
.ed-top { position: sticky; top: 68px; z-index: 39; height: 64px; display: flex; align-items: center; gap: 12px; padding: 0 20px; background: #fff; border-bottom: 1px solid #E2E8F0; }
.ed-top .saved { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: #64748B; font-weight: 600; white-space: nowrap; }
.ed-top .saved.dirty { color: #B45309; } .ed-top .saved.err { color: #BE123C; }
.ed-layout { display: grid; gap: 20px; padding: 20px; max-width: 1480px; }
@media (min-width: 1200px) { .ed-layout { grid-template-columns: minmax(0, 1fr) 360px; } }
.ed-title { width: 100%; border: 0; outline: 0; background: transparent; font-size: clamp(24px, 3vw, 32px); font-weight: 800; letter-spacing: -.025em; padding: 4px 0; }
.ed-slug { display: flex; align-items: center; gap: 6px; font-size: 13px; color: #64748B; flex-wrap: wrap; }
.ed-slug input { border: 1px solid transparent; background: #F1F5F9; border-radius: 6px; padding: 3px 8px; font-size: 13px; font-weight: 600; color: #0F172A; min-width: 120px; outline: 0; }
.ed-slug input:focus { border-color: var(--primary); background: #fff; }
.rte { border: 1px solid #E2E8F0; border-radius: 14px; background: #fff; }
.rte-foot { border-radius: 0 0 14px 14px; }
.rte-html { border-radius: 0; }
.rte-sticky { position: sticky; top: 132px; z-index: 10; background: #F8FAFC; border-bottom: 1px solid #E2E8F0; border-radius: 14px 14px 0 0; }
.rte-bar { display: flex; flex-wrap: wrap; gap: 2px; padding: 8px; border-bottom: 1px solid #E2E8F0; background: #F8FAFC; align-items: center; }
.rte-bar button, .rte-bar select { height: 32px; min-width: 32px; padding: 0 8px; border: 0; background: transparent; border-radius: 7px; color: #334155; display: inline-grid; place-items: center; font-size: 13px; font-weight: 600; }
.rte-bar button:hover { background: #E2E8F0; } .rte-bar button.on { background: #E0E7FF; color: var(--primary-active); }
.rte-bar select { padding-right: 4px; outline: 0; cursor: pointer; display: inline-block; }
.rte-bar .sep { width: 1px; height: 20px; background: #E2E8F0; margin: 0 4px; }
.rte-bar .mode { margin-left: auto; }
.rte-bar input[type=color] { width: 28px; height: 28px; border: 0; padding: 0; background: transparent; cursor: pointer; }
.rte-insert { display: flex; gap: 8px; flex-wrap: wrap; padding: 10px; background: #fff; }
.rte-area { min-height: 480px; padding: 24px clamp(16px, 4vw, 40px); outline: 0; font-size: 16px; line-height: 1.75; color: #1E293B; }
.rte-area:empty::before { content: attr(data-placeholder); color: #94A3B8; }
.rte-html { width: 100%; min-height: 480px; border: 0; outline: 0; padding: 20px; font-family: var(--mono); font-size: 13px; line-height: 1.6; background: #0F172A; color: #E2E8F0; resize: vertical; }
.rte-foot { display: flex; justify-content: space-between; padding: 8px 14px; border-top: 1px solid #E2E8F0; font-size: 12px; color: #64748B; }
.rte-area .cp-block { position: relative; margin: 18px 0; border: 1px dashed #A5B4FC; border-radius: 12px; padding: 12px 14px; background: #F5F7FF; cursor: pointer; user-select: none; font-size: 14px; }
.rte-area .cp-block:hover { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-ring); }
.rte-area .cp-block.cp-promptbox { background: #0F172A; color: #E2E8F0; border-style: solid; border-color: #334155; }
.rte-area .cp-block.cp-promptbox pre { margin: 6px 0 0; font-family: var(--mono); font-size: 12.5px; white-space: pre-wrap; max-height: 160px; overflow: hidden; color: #CBD5E1; }
.rte-area .cp-block::before { content: attr(data-label); display: block; font-size: 11px; font-weight: 700; color: var(--primary); margin-bottom: 4px; }
.rte-area .cp-block.cp-promptbox::before { color: #A5B4FC; }
.rte-area figure { margin: 18px 0; } .rte-area figure img { border-radius: 10px; max-height: 420px; }
.rte-area figcaption { font-size: 13px; color: #64748B; text-align: center; }
.rte-area h2 { font-size: 23px; margin: 1.4em 0 .4em; } .rte-area h3 { font-size: 18px; margin: 1.2em 0 .3em; } .rte-area h4 { font-size: 16px; }
.rte-area blockquote { border-left: 3px solid var(--primary); margin: 1em 0; padding: 6px 14px; background: #EEF2FF; border-radius: 0 8px 8px 0; }
.rte-area pre.cp-code { background: #0F172A; color: #E2E8F0; padding: 12px; border-radius: 10px; font-family: var(--mono); font-size: 13px; }
.inspector { display: grid; gap: 14px; align-content: start; }
.panel { background: #fff; border: 1px solid #E2E8F0; border-radius: 14px; }
.panel > summary { list-style: none; display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; font-weight: 700; font-size: 14px; cursor: pointer; }
.panel > summary::-webkit-details-marker { display: none; }
.panel > summary svg { transition: transform .2s; color: #94A3B8; }
.panel[open] > summary svg { transform: rotate(180deg); }
.panel .pbody { padding: 0 16px 16px; display: grid; gap: 12px; }
.cover-prev { position: relative; border-radius: 10px; overflow: hidden; background: #F1F5F9; aspect-ratio: 4/3; display: grid; place-items: center; color: #94A3B8; }
.cover-prev img { width: 100%; height: 100%; object-fit: cover; }
.mini-card { display: flex; gap: 10px; align-items: center; padding: 8px; border: 1px solid #E2E8F0; border-radius: 10px; background: #fff; }
.mini-card img { width: 44px; height: 44px; border-radius: 8px; object-fit: cover; background: #F1F5F9; flex: none; }
.mini-card .grow small { display: block; color: #64748B; font-size: 12px; }
.tokens { display: flex; flex-wrap: wrap; gap: 6px; padding: 6px; border: 1px solid #E2E8F0; border-radius: 8px; min-height: 42px; align-items: center; background: #fff; }
.tokens:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-ring); }
.tokens .tk { display: inline-flex; align-items: center; gap: 4px; height: 26px; padding: 0 4px 0 10px; border-radius: 99px; background: #EFF6FF; border: 1px solid #DBEAFE; font-size: 12.5px; font-weight: 600; color: #1E40AF; }
.tokens .tk button { border: 0; background: transparent; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; color: inherit; }
.tokens input { flex: 1; min-width: 100px; border: 0; outline: 0; font-size: 13.5px; height: 28px; background: transparent; }
.checklist { max-height: 200px; overflow-y: auto; display: grid; gap: 2px; border: 1px solid #E2E8F0; border-radius: 8px; padding: 6px; }
.checklist label { display: flex; align-items: center; gap: 8px; padding: 5px 6px; border-radius: 6px; font-size: 13.5px; cursor: pointer; }
.checklist label:hover { background: #F8FAFC; }
.og-prev { border: 1px solid #E2E8F0; border-radius: 10px; overflow: hidden; font-size: 13px; }
.og-prev .im { aspect-ratio: 1.91/1; background: #F1F5F9 center/cover; }
.og-prev .tx { padding: 10px 12px; background: #F8FAFC; } .og-prev .tx small { color: #64748B; text-transform: lowercase; }
.media-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
.mcard { border: 1px solid #E2E8F0; border-radius: 12px; overflow: hidden; background: #fff; cursor: pointer; text-align: left; padding: 0; transition: box-shadow .15s, border-color .15s; }
.mcard:hover { border-color: #C7D2FE; box-shadow: var(--shadow-2); }
.mcard.on { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-ring); }
.mcard .im { aspect-ratio: 1; background: #F1F5F9; display: grid; place-items: center; color: #94A3B8; overflow: hidden; }
.mcard .im img { width: 100%; height: 100%; object-fit: cover; }
.mcard .tx { padding: 8px 10px; font-size: 12px; color: #64748B; } .mcard .tx b { display: block; color: #0F172A; font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.upq { display: grid; gap: 8px; margin-top: 12px; }
.upq .it { display: flex; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 10px; background: #fff; border: 1px solid #E2E8F0; font-size: 13px; }
.prog { height: 6px; border-radius: 6px; background: #E2E8F0; overflow: hidden; flex: 1; }
.prog i { display: block; height: 100%; background: var(--primary); border-radius: 6px; transition: width .3s; }
.tree { display: grid; gap: 6px; }
.tree .node { display: flex; align-items: center; gap: 10px; padding: 10px 12px; background: #fff; border: 1px solid #E2E8F0; border-radius: 12px; }
.tree .node.drag-over { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-ring); }
.tree .node.dragging { opacity: .4; }
.tree .grip { color: #94A3B8; cursor: grab; display: inline-flex; }
.tree .node .ic { width: 34px; height: 34px; border-radius: 10px; background: #EEF2FF; color: var(--primary); display: grid; place-items: center; flex: none; }
.split-35 { display: grid; gap: 20px; }
@media (min-width: 1100px) { .split-35 { grid-template-columns: 35fr 65fr; align-items: start; } .split-35 > :first-child { position: sticky; top: 88px; } }
.tagcloud { display: flex; flex-wrap: wrap; gap: 8px; align-items: baseline; }
.tagcloud a { padding: 4px 12px; border-radius: 99px; background: #EEF2FF; color: var(--primary-active); font-weight: 600; }
.diff { font-family: var(--mono); font-size: 12.5px; line-height: 1.6; border: 1px solid #E2E8F0; border-radius: 12px; overflow: auto; max-height: 70vh; background: #fff; }
.diff div { padding: 2px 12px; white-space: pre-wrap; word-break: break-word; border-left: 3px solid transparent; }
.diff .add { background: #ECFDF5; border-left-color: var(--mint); color: #065F46; }
.diff .del { background: #FFF1F2; border-left-color: var(--rose); color: #9F1239; text-decoration: line-through; text-decoration-color: rgba(159,18,57,.4); }
.diff .same { color: #64748B; }
.timeline { display: grid; gap: 4px; }
.timeline button { text-align: left; border: 1px solid transparent; background: transparent; border-radius: 12px; padding: 12px; display: grid; gap: 2px; position: relative; padding-left: 34px; }
.timeline button::before { content: ''; position: absolute; left: 14px; top: 18px; width: 9px; height: 9px; border-radius: 50%; background: #CBD5E1; box-shadow: 0 0 0 3px #fff; }
.timeline button::after { content: ''; position: absolute; left: 18px; top: 30px; bottom: -8px; width: 1px; background: #E2E8F0; }
.timeline button:last-child::after { display: none; }
.timeline button:hover { background: #F8FAFC; }
.timeline button.on { border-color: #C7D2FE; background: #EEF2FF; } .timeline button.on::before { background: var(--primary); }
.matrix { width: 100%; border-collapse: collapse; font-size: 13px; }
.matrix th, .matrix td { padding: 8px; border-bottom: 1px solid #F1F5F9; text-align: center; }
.matrix th:first-child, .matrix td:first-child { text-align: left; }
.matrix .y { color: var(--mint); } .matrix .n { color: #CBD5E1; } .matrix .p { font-size: 11px; font-weight: 700; color: #B45309; background: #FFFBEB; border-radius: 99px; padding: 2px 8px; }
.diag { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.diag .card { padding: 18px; }
.diag .n { font-size: 30px; font-weight: 800; letter-spacing: -.03em; }
.sortable-item { cursor: grab; }
.sortable-item.dragging { opacity: .4; }
.sortable-item.drag-over { box-shadow: 0 0 0 3px var(--primary-ring); border-color: var(--primary) !important; }
.preview-frame { background: var(--canvas); border-radius: 12px; overflow: auto; height: 100%; padding: 16px; }
.pulse-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--mint); display: inline-block; }
