@font-face{font-family:'Hind Siliguri';font-style:normal;font-display:swap;font-weight:400;src:url(fonts/hind-siliguri-bengali-400-normal.woff2) format('woff2');unicode-range:U+0951-0952,U+0964-0965,U+0980-09FE,U+1CD0,U+1CD2,U+1CD5-1CD6,U+1CD8,U+1CE1,U+1CEA,U+1CED,U+1CF2,U+1CF5-1CF7,U+200C-200D,U+20B9,U+25CC,U+A8F1}
@font-face{font-family:'Hind Siliguri';font-style:normal;font-display:swap;font-weight:400;src:url(fonts/hind-siliguri-latin-400-normal.woff2) format('woff2');unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}
@font-face{font-family:'Hind Siliguri';font-style:normal;font-display:swap;font-weight:500;src:url(fonts/hind-siliguri-bengali-500-normal.woff2) format('woff2');unicode-range:U+0951-0952,U+0964-0965,U+0980-09FE,U+1CD0,U+1CD2,U+1CD5-1CD6,U+1CD8,U+1CE1,U+1CEA,U+1CED,U+1CF2,U+1CF5-1CF7,U+200C-200D,U+20B9,U+25CC,U+A8F1}
@font-face{font-family:'Hind Siliguri';font-style:normal;font-display:swap;font-weight:500;src:url(fonts/hind-siliguri-latin-500-normal.woff2) format('woff2');unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}
@font-face{font-family:'Hind Siliguri';font-style:normal;font-display:swap;font-weight:600;src:url(fonts/hind-siliguri-bengali-600-normal.woff2) format('woff2');unicode-range:U+0951-0952,U+0964-0965,U+0980-09FE,U+1CD0,U+1CD2,U+1CD5-1CD6,U+1CD8,U+1CE1,U+1CEA,U+1CED,U+1CF2,U+1CF5-1CF7,U+200C-200D,U+20B9,U+25CC,U+A8F1}
@font-face{font-family:'Hind Siliguri';font-style:normal;font-display:swap;font-weight:600;src:url(fonts/hind-siliguri-latin-600-normal.woff2) format('woff2');unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}
@font-face{font-family:'Hind Siliguri';font-style:normal;font-display:swap;font-weight:700;src:url(fonts/hind-siliguri-bengali-700-normal.woff2) format('woff2');unicode-range:U+0951-0952,U+0964-0965,U+0980-09FE,U+1CD0,U+1CD2,U+1CD5-1CD6,U+1CD8,U+1CE1,U+1CEA,U+1CED,U+1CF2,U+1CF5-1CF7,U+200C-200D,U+20B9,U+25CC,U+A8F1}
@font-face{font-family:'Hind Siliguri';font-style:normal;font-display:swap;font-weight:700;src:url(fonts/hind-siliguri-latin-700-normal.woff2) format('woff2');unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}

/* Design tokens. The build reuses this file for the in-page overlay by replacing :root with :host. */
:root {
  --bg: #f5f5f2;
  --surface: #ffffff;
  --surface-2: #f0f0eb;
  --surface-3: #e8e8e1;
  --border: #e3e3dc;
  --border-strong: #cfcfc6;
  --text: #16171b;
  --text-2: #55575f;
  --text-3: #8a8c94;
  --accent: #4f46e5;
  --accent-hover: #4338ca;
  --accent-ink: #ffffff;
  --accent-soft: #eef0ff;
  --accent-text: #3730a3;
  --ink: #16171b;
  --ink-text: #ffffff;
  --ok: #047857;
  --ok-soft: #e3f6ee;
  --warn: #a15c07;
  --warn-soft: #fdf3dc;
  --danger: #c81e1e;
  --danger-soft: #fdecec;
  --hl-var: #e3e6ff;
  --hl-var-text: #3730a3;
  --hl-section: #fdefc8;
  --hl-section-text: #7a4a03;
  --hl-block: #d9f5e5;
  --hl-block-text: #05603a;
  --hl-builtin: #fbe3f1;
  --hl-builtin-text: #8a1c5c;
  --hl-comment-text: #8a8c94;
  --radius: 14px;
  --radius-sm: 9px;
  --radius-xs: 6px;
  --shadow-sm: 0 1px 2px rgba(16, 17, 20, 0.06);
  --shadow: 0 1px 2px rgba(16, 17, 20, 0.05), 0 10px 30px rgba(16, 17, 20, 0.08);
  --shadow-lg: 0 2px 6px rgba(16, 17, 20, 0.08), 0 24px 60px rgba(16, 17, 20, 0.18);
  --font: 'Hind Siliguri', 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, 'Noto Sans Bengali', 'Nirmala UI', 'Helvetica Neue', Arial, sans-serif;
  --mono: ui-monospace, 'SF Mono', 'Cascadia Code', Menlo, Consolas, 'Noto Sans Bengali', 'Nirmala UI', monospace;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --bg: #0d0e12;
    --surface: #15171c;
    --surface-2: #1b1e24;
    --surface-3: #23262e;
    --border: #282b33;
    --border-strong: #363a44;
    --text: #eceef2;
    --text-2: #a6a9b2;
    --text-3: #747883;
    --accent: #8b8ff9;
    --accent-hover: #a5a9ff;
    --accent-ink: #0d0e12;
    --accent-soft: #1f2146;
    --accent-text: #c9cbff;
    --ink: #eceef2;
    --ink-text: #0d0e12;
    --ok: #34d399;
    --ok-soft: #10291f;
    --warn: #fbbf24;
    --warn-soft: #2d230c;
    --danger: #f87171;
    --danger-soft: #2f1414;
    --hl-var: #262a5c;
    --hl-var-text: #c9cbff;
    --hl-section: #3a2d0c;
    --hl-section-text: #fcd57a;
    --hl-block: #0f3324;
    --hl-block-text: #7ee2b0;
    --hl-builtin: #3a1430;
    --hl-builtin-text: #f5a6d6;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 10px 30px rgba(0, 0, 0, 0.35);
    --shadow-lg: 0 2px 6px rgba(0, 0, 0, 0.5), 0 24px 60px rgba(0, 0, 0, 0.55);
    color-scheme: dark;
  }
}

:root[data-theme='dark'] {
  --bg: #0d0e12;
  --surface: #15171c;
  --surface-2: #1b1e24;
  --surface-3: #23262e;
  --border: #282b33;
  --border-strong: #363a44;
  --text: #eceef2;
  --text-2: #a6a9b2;
  --text-3: #747883;
  --accent: #8b8ff9;
  --accent-hover: #a5a9ff;
  --accent-ink: #0d0e12;
  --accent-soft: #1f2146;
  --accent-text: #c9cbff;
  --ink: #eceef2;
  --ink-text: #0d0e12;
  --ok: #34d399;
  --ok-soft: #10291f;
  --warn: #fbbf24;
  --warn-soft: #2d230c;
  --danger: #f87171;
  --danger-soft: #2f1414;
  --hl-var: #262a5c;
  --hl-var-text: #c9cbff;
  --hl-section: #3a2d0c;
  --hl-section-text: #fcd57a;
  --hl-block: #0f3324;
  --hl-block-text: #7ee2b0;
  --hl-builtin: #3a1430;
  --hl-builtin-text: #f5a6d6;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 10px 30px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 2px 6px rgba(0, 0, 0, 0.5), 0 24px 60px rgba(0, 0, 0, 0.55);
  color-scheme: dark;
}

/* Fill form, preview and shared controls — used by the dashboard, side panel and in-page overlay. */
.pf-form { display: flex; flex-direction: column; gap: 14px; }
.pf-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.pf-label { display: flex; align-items: baseline; gap: 6px; font-size: 13px; font-weight: 600; color: var(--text); line-height: 1.35; }
.pf-label .pf-req { color: var(--danger); font-weight: 700; }
.pf-label .pf-type { margin-left: auto; font-size: 11px; font-weight: 500; color: var(--text-3); }
.pf-help { font-size: 12px; color: var(--text-3); line-height: 1.45; }
.pf-err { font-size: 12px; color: var(--danger); font-weight: 500; }
.pf-input {
  width: 100%; box-sizing: border-box; font: inherit; font-size: 14px; color: var(--text);
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  padding: 9px 11px; outline: none; transition: border-color .15s, box-shadow .15s; line-height: 1.45;
}
.pf-input::placeholder { color: var(--text-3); }
.pf-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }
.pf-input.pf-invalid { border-color: var(--danger); }
textarea.pf-input { resize: vertical; min-height: 64px; max-height: 320px; }
select.pf-input { appearance: none; padding-right: 32px; 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='%238a8c94' stroke-width='2.5' 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 11px center; }
.pf-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.pf-chip {
  font: inherit; font-size: 13px; padding: 5px 11px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--text-2); line-height: 1.35;
}
.pf-chip:hover { border-color: var(--accent); color: var(--text); }
.pf-chip.on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-text); font-weight: 600; }
.pf-chip:focus-visible, .pf-switch:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.pf-toggle-row { display: flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; }
.pf-switch {
  position: relative; width: 38px; height: 22px; flex: none; border-radius: 999px; border: none; cursor: pointer; padding: 0;
  background: var(--surface-3); transition: background .15s;
}
.pf-switch::after { content: ''; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.25); transition: transform .15s; }
.pf-switch[aria-checked='true'] { background: var(--accent); }
.pf-switch[aria-checked='true']::after { transform: translateX(16px); }
.pf-toggle-text { font-size: 13px; color: var(--text-2); }
.pf-range { display: flex; align-items: center; gap: 12px; }
.pf-range input { flex: 1; accent-color: var(--accent); }
.pf-range output { min-width: 34px; text-align: right; font-weight: 600; font-size: 13px; color: var(--text); font-variant-numeric: tabular-nums; }

.pf-preview {
  white-space: pre-wrap; word-break: break-word; font-size: 13.5px; line-height: 1.6; color: var(--text);
  background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px 14px;
  max-height: 340px; overflow: auto;
}
.pf-seg { border-radius: 4px; padding: 0 2px; }
.pf-seg-value, .pf-seg-builtin { background: var(--hl-var); color: var(--hl-var-text); }
.pf-seg-fallback { background: var(--surface-3); color: var(--text-2); }
.pf-seg-empty { background: var(--warn-soft); color: var(--warn); font-style: italic; }
.pf-seg-missing { background: var(--danger-soft); color: var(--danger); }

.pf-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; font: inherit; font-size: 14px; font-weight: 600;
  padding: 9px 15px; border-radius: var(--radius-sm); border: 1px solid var(--border-strong); background: var(--surface); color: var(--text);
  cursor: pointer; line-height: 1.2; white-space: nowrap; transition: background .15s, border-color .15s, transform .05s; text-decoration: none;
}
.pf-btn:hover { background: var(--surface-2); }
.pf-btn:active { transform: translateY(1px); }
.pf-btn:disabled { opacity: .5; cursor: not-allowed; }
.pf-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.pf-btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.pf-btn.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.pf-btn.ink { background: var(--ink); border-color: var(--ink); color: var(--ink-text); }
.pf-btn.ink:hover { opacity: .9; }
.pf-btn.danger { color: var(--danger); }
.pf-btn.danger:hover { background: var(--danger-soft); border-color: var(--danger); }
.pf-btn.ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.pf-btn.ghost:hover { background: var(--surface-2); color: var(--text); }
.pf-btn.sm { font-size: 13px; padding: 6px 10px; }
.pf-btn.icon { padding: 7px; }
.pf-btn svg { width: 16px; height: 16px; flex: none; }
.pf-kbd { font-family: var(--mono); font-size: 11px; padding: 1px 5px; border-radius: 4px; border: 1px solid var(--border-strong); color: var(--text-3); background: var(--surface-2); }

/* Fill panel */
.fp { display: flex; flex-direction: column; min-height: 0; }
.fp-head { display: flex; align-items: center; gap: 10px; padding: 14px 16px 12px; border-bottom: 1px solid var(--border); }
.fp-logo { width: 24px; height: 24px; border-radius: 7px; flex: none; }
.fp-title { font-size: 15px; font-weight: 600; line-height: 1.3; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fp-sub { font-size: 12px; color: var(--text-3); }
.fp-badge { margin-left: auto; font-size: 11px; font-weight: 600; color: var(--accent-text); background: var(--accent-soft); padding: 3px 8px; border-radius: 999px; white-space: nowrap; }
.fp-body { padding: 16px; overflow: auto; display: flex; flex-direction: column; gap: 16px; min-height: 0; }
.fp-section-title { display: flex; align-items: center; gap: 8px; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); margin-bottom: 8px; cursor: pointer; user-select: none; background: none; border: 0; padding: 0; font-family: inherit; }
.fp-actions { display: flex; align-items: center; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--border); background: var(--surface); }
.fp-actions .grow { flex: 1; }
.fp-hint { font-size: 11px; color: var(--text-3); }
.fp-section-title.static { cursor: default; margin-bottom: 0; }
.att-list { display: flex; flex-direction: column; gap: 6px; }
.att-item { display: flex; align-items: center; gap: 10px; padding: 6px 10px 6px 8px; border: 1px solid var(--border); border-radius: 10px; cursor: pointer; background: var(--surface); }
.att-item.on { border-color: color-mix(in srgb, var(--accent) 55%, var(--border)); background: color-mix(in srgb, var(--accent-soft) 60%, var(--surface)); }
.att-item input { accent-color: var(--accent); width: 16px; height: 16px; flex: none; }
.att-item .thumb { display: inline-grid; place-items: center; flex: none; overflow: hidden; border-radius: 8px; background: var(--surface-2); color: var(--text-3); }
.att-item .thumb img, .att-item .thumb video { width: 100%; height: 100%; object-fit: cover; }
.att-meta { display: flex; flex-direction: column; min-width: 0; }
.att-meta .att-name { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.att-meta .att-size { font-size: 11.5px; color: var(--text-3); }

/* ---- brand / platform / product pickers in the fill panel */
.fp-brand { display: flex; flex-wrap: wrap; gap: 8px 12px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2); }
.fp-pick { display: flex; flex-direction: column; gap: 4px; min-width: 140px; flex: 1 1 140px; font-size: 12px; font-weight: 600; color: var(--text-2); }
.fp-pick select { width: 100%; }
.brand-missing { display: flex; gap: 6px; align-items: center; }

/* ===================================================================== base */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font); font-size: 14.5px; line-height: 1.5; color: var(--text); background: var(--bg);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
h1, h2, h3, h4 { margin: 0; line-height: 1.25; font-weight: 600; letter-spacing: -0.01em; }
h1 { font-size: 26px; }
h2 { font-size: 18px; }
h3 { font-size: 15.5px; }
h4 { font-size: 14px; }
p { margin: 0; }
a { color: var(--accent-text); text-decoration: none; }
a:hover { text-decoration: underline; }
a.pf-btn:hover { text-decoration: none; }
code, .mono { font-family: var(--mono); font-size: 0.92em; }
button { font-family: inherit; }
::selection { background: color-mix(in srgb, var(--accent) 28%, transparent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.muted { color: var(--text-2); }
.faint { color: var(--text-3); }
.small { font-size: 12.5px; }
.center { text-align: center; }
.pad { padding: 14px 0; }
.grow { flex: 1; }
.break { word-break: break-all; }
.eyebrow { display: inline-block; font-size: 11.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--accent-text); margin-bottom: 6px; }
.boot { display: grid; place-items: center; height: 100vh; animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .5; } }

.pf-btn.wide { width: 100%; }
.pf-btn.active { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-text); }
.pf-btn.danger-solid { background: var(--danger); border-color: var(--danger); color: #fff; }
.pf-btn.danger-solid:hover { opacity: .9; }
.pf-input.auto { width: auto; }
.pf-input.lg { font-size: 16px; padding: 10px 12px; font-weight: 500; }
.pf-input.sm { font-size: 13px; padding: 5px 8px; }
.pf-input.mono { font-family: var(--mono); font-size: 13px; }

.badge { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-text); white-space: nowrap; }
.badge.muted-badge { background: var(--surface-2); color: var(--text-3); }
.chip { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 500; padding: 2px 9px; border-radius: 999px; background: var(--surface-2); color: var(--text-2); border: 1px solid var(--border); white-space: nowrap; }
.chip.ok { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.chip.removable button { display: inline-flex; border: 0; background: none; padding: 0; color: var(--text-3); cursor: pointer; }
.chip.removable button:hover { color: var(--danger); }
.star { color: #f5a524; margin-right: 4px; vertical-align: -1px; }
.linkish { display: inline-flex; align-items: center; gap: 5px; background: none; border: 0; padding: 0; color: var(--accent-text); font: inherit; font-size: 13px; cursor: pointer; }
.linkish:hover { text-decoration: underline; }

/* ==================================================================== shell */
.shell { display: flex; min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; width: 264px; flex: none; display: flex; flex-direction: column; gap: 14px;
  padding: 18px 14px 14px; background: var(--surface); border-right: 1px solid var(--border); overflow-y: auto;
}
.sb-top { display: flex; align-items: center; justify-content: space-between; padding: 0 6px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-size: 18px; font-weight: 700; color: var(--text); letter-spacing: -0.02em; }
.brand:hover { text-decoration: none; }
.sb-close { display: none; }
.create-btn { padding: 11px 14px; font-size: 15px; justify-content: flex-start; border-radius: 12px; }
.sidebar .menu-wrap { display: block; }
.sb-nav { display: flex; flex-direction: column; gap: 18px; }
.sb-group { display: flex; flex-direction: column; gap: 2px; }
.sb-group-title { font-size: 11px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--text-3); padding: 0 10px 6px; }
.sb-link { display: flex; align-items: center; gap: 11px; padding: 9px 10px; border-radius: 10px; color: var(--text-2); font-weight: 500; font-size: 14.5px; }
.sb-link:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.sb-link.on { background: var(--ink); color: var(--ink-text); }
.sb-link.on svg { color: var(--ink-text); }
.sb-badge { margin-left: auto; font-size: 10px; font-weight: 700; padding: 2px 6px; border-radius: 6px; background: var(--ok-soft); color: var(--ok); letter-spacing: .04em; }
.sb-link.on .sb-badge { background: rgba(255, 255, 255, .16); color: inherit; }
.sb-count { margin-left: auto; font-size: 12px; color: var(--text-3); }
.sb-link.on .sb-count { color: inherit; opacity: .7; }
.sb-bottom { margin-top: auto; display: flex; flex-direction: column; gap: 10px; padding-top: 12px; border-top: 1px solid var(--border); }
.sb-account { display: flex; align-items: center; gap: 10px; padding: 0 4px; min-width: 0; }
.avatar { width: 30px; height: 30px; border-radius: 50%; flex: none; display: grid; place-items: center; font-weight: 700; font-size: 13px; background: var(--accent-soft); color: var(--accent-text); }
.sb-email { font-size: 13px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sb-controls { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.sb-switches { display: flex; gap: 4px; }
.mini-toggle { display: inline-grid; place-items: center; min-width: 32px; height: 28px; padding: 0 6px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); color: var(--text-2); font-size: 12px; font-weight: 600; cursor: pointer; }
.mini-toggle:hover { color: var(--text); border-color: var(--border-strong); }
.sb-scrim { display: none; }
.main { flex: 1; min-width: 0; }
.mobile-bar { display: none; }

.sync-badge { display: inline-flex; align-items: center; gap: 6px; font: inherit; font-size: 12px; font-weight: 500; padding: 4px 9px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--text-2); cursor: pointer; white-space: nowrap; }
.sync-badge:disabled { cursor: default; }
.sync-badge.ok svg { color: var(--ok); }
.sync-badge.error { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 40%, var(--border)); }
.sync-badge.signed_out { color: var(--warn); }
.sync-badge.syncing svg { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* menu */
.menu-wrap { position: relative; display: inline-block; }
.menu { position: absolute; top: calc(100% + 6px); z-index: 50; min-width: 220px; padding: 6px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-lg); animation: pop .12s ease-out; }
.menu.right { right: 0; }
.menu.left { left: 0; }
.sidebar .menu.left { right: 0; }
.menu-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border: 0; background: none; border-radius: 8px; color: var(--text); font: inherit; font-size: 14px; text-align: left; cursor: pointer; }
.menu-item:hover { background: var(--surface-2); }
.menu-item.danger { color: var(--danger); }
.menu-item.danger:hover { background: var(--danger-soft); }
.menu-item svg { width: 16px; height: 16px; color: var(--text-3); }
.menu-item.danger svg { color: inherit; }
.menu-hint { margin-left: auto; font-family: var(--mono); font-size: 11.5px; color: var(--text-3); }
.menu-sep { height: 1px; background: var(--border); margin: 5px 4px; }
@keyframes pop { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }

/* ===================================================================== page */
.page { max-width: 1180px; margin: 0 auto; padding: 32px 36px 64px; display: flex; flex-direction: column; gap: 20px; }
.page.narrow { max-width: 880px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.page-head h1 { margin-bottom: 4px; }
.head-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.crumb { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-2); margin-bottom: 8px; }
.unsaved { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--warn); margin-right: 4px; }
.unsaved .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--warn); }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow-sm); display: flex; flex-direction: column; gap: 14px; }
.card.flush { padding: 0; gap: 0; overflow: hidden; }
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.card-head p { margin-top: 4px; font-size: 13.5px; }
.card-actions { display: flex; gap: 6px; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }

.row { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.row.inline { flex-direction: row; align-items: center; gap: 10px; flex-wrap: wrap; }
.row-label { font-size: 13px; font-weight: 600; color: var(--text); }
.row-hint { font-size: 12.5px; color: var(--text-3); }
.input-group { display: flex; gap: 8px; align-items: center; }
.input-group .pf-input { flex: 1; }
.check { display: inline-flex; align-items: center; gap: 8px; font-size: 13.5px; cursor: pointer; }
.check input { accent-color: var(--accent); width: 16px; height: 16px; }
.btn-row { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.btn-row.left { justify-content: flex-start; }

.seg { display: inline-flex; padding: 3px; gap: 2px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--border); }
.seg button { font: inherit; font-size: 13px; font-weight: 500; padding: 6px 12px; border: 0; border-radius: 7px; background: none; color: var(--text-2); cursor: pointer; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.seg button:hover { color: var(--text); }
.seg button.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); font-weight: 600; }
.seg.mono button { font-family: var(--mono); min-width: 34px; justify-content: center; }
.seg.small button { padding: 5px 10px; }
.wide-seg { display: flex; width: 100%; }
.wide-seg button { flex: 1; justify-content: center; padding: 9px 12px; }

.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 8px 0; cursor: pointer; }
.switch-row.disabled { opacity: .5; }
.switch-text { display: flex; flex-direction: column; }
.switch-label { font-size: 14px; font-weight: 500; }
.switch-sub { font-size: 12.5px; color: var(--text-3); }

.alert { display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; border-radius: 10px; font-size: 13.5px; line-height: 1.45; }
.alert svg { flex: none; margin-top: 2px; width: 16px; height: 16px; }
.alert.error { background: var(--danger-soft); color: var(--danger); }
.alert.info { background: var(--accent-soft); color: var(--accent-text); }
.alert.warn { background: var(--warn-soft); color: var(--warn); }
.alert ul { margin: 4px 0 0; padding-left: 18px; }

.tabs { display: flex; gap: 4px; padding: 4px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; width: fit-content; max-width: 100%; overflow-x: auto; }
.tab { display: inline-flex; align-items: center; gap: 7px; font: inherit; font-size: 14px; font-weight: 500; padding: 8px 16px; border-radius: 9px; border: 0; background: none; color: var(--text-2); cursor: pointer; white-space: nowrap; }
.tab:hover { color: var(--text); background: var(--surface-2); }
.tab.on { background: var(--ink); color: var(--ink-text); }

.empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; padding: 48px 20px; border: 1px dashed var(--border-strong); border-radius: var(--radius); background: var(--surface); }
.empty-ic { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-text); margin-bottom: 6px; }
.empty p { color: var(--text-2); max-width: 440px; }
.empty-actions { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; justify-content: center; }

/* toasts & modal */
.toasts { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; z-index: 1000; align-items: center; pointer-events: none; }
.toast-item { display: flex; align-items: center; gap: 9px; padding: 10px 16px; border-radius: 999px; background: var(--ink); color: var(--ink-text); font-size: 13.5px; font-weight: 600; box-shadow: var(--shadow-lg); animation: pop .15s ease-out; max-width: min(560px, calc(100vw - 32px)); }
.toast-item svg { width: 16px; height: 16px; flex: none; }
.toast-item.ok svg { color: #34d399; }
.toast-item.error { background: var(--danger); color: #fff; }
.toast-item.info svg { color: #93c5fd; }
.modal-backdrop { position: fixed; inset: 0; z-index: 900; background: rgba(10, 10, 14, .38); display: grid; place-items: center; padding: 20px; animation: fade .12s ease-out; }
@keyframes fade { from { opacity: 0; } }
.modal { width: 100%; max-width: 480px; max-height: calc(100vh - 40px); display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow-lg); overflow: hidden; animation: pop .14s ease-out; }
.modal.wide { max-width: 720px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.modal-body { padding: 18px 20px; overflow-y: auto; display: flex; flex-direction: column; gap: 14px; }
.modal-foot { display: flex; gap: 8px; justify-content: flex-end; padding: 14px 20px; border-top: 1px solid var(--border); background: var(--surface); }
.modal.fill-modal .modal-body { padding: 0; gap: 0; }
.modal.fill-modal .fp { max-height: calc(100vh - 80px); }
.modal.fill-modal .fp-body { overflow-y: auto; }
.modal-extra { padding: 10px 16px; border-top: 1px solid var(--border); background: var(--surface-2); }

/* ================================================================ overview */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.stat { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 12px; align-items: center; padding: 16px 18px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); color: var(--text); box-shadow: var(--shadow-sm); transition: border-color .15s, transform .15s; }
.stat:hover { border-color: var(--accent); text-decoration: none; transform: translateY(-1px); }
.stat-ic { grid-row: span 2; width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-text); }
.stat-v { font-size: 24px; font-weight: 700; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat-k { font-size: 13px; color: var(--text-2); }
.onboarding { background: linear-gradient(135deg, var(--surface) 55%, var(--accent-soft)); }
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 8px 20px; }
.steps li { display: flex; align-items: center; gap: 10px; padding: 6px 0; }
.steps li.done .step-l { color: var(--text-3); text-decoration: line-through; }
.step-n { width: 26px; height: 26px; border-radius: 50%; flex: none; display: grid; place-items: center; font-size: 12.5px; font-weight: 700; background: var(--surface-2); color: var(--text-2); border: 1px solid var(--border); }
.steps li.done .step-n { background: var(--ok); color: #fff; border-color: var(--ok); }
.step-l { flex: 1; font-size: 14px; }
.steps.big { grid-template-columns: 1fr; width: 100%; text-align: left; }
.trigger-demo { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; color: var(--text-3); }
.trigger-demo.big { justify-content: center; margin: 4px 0 8px; }
.td-box { display: inline-flex; align-items: center; padding: 10px 14px; min-width: 150px; border-radius: 12px; background: #16181d; color: #e5e7eb; font-family: var(--mono); font-size: 15px; box-shadow: var(--shadow); }
.td-caret { color: #a5b4fc; font-weight: 700; }
.td-cursor { width: 2px; height: 18px; background: #a5b4fc; margin-left: 2px; animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.td-pal { display: flex; flex-direction: column; gap: 2px; padding: 6px; border-radius: 12px; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); min-width: 240px; }
.td-item { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 7px 10px; border-radius: 8px; font-size: 13px; color: var(--text); }
.td-item.on { background: var(--surface-2); }
.prow { display: flex; align-items: center; gap: 12px; padding: 10px 6px; border-bottom: 1px solid var(--border); color: var(--text); }
.prow:last-child { border-bottom: 0; }
.prow:hover { background: var(--surface-2); text-decoration: none; border-radius: 8px; }
.prow-main { flex: 1; min-width: 0; }
.prow-name { font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.prow-sub { color: var(--text-3); font-size: 12px; }
.connect-teaser { flex-direction: row; align-items: center; gap: 18px; background: linear-gradient(120deg, var(--surface), var(--accent-soft)); }
.ct-ic { width: 48px; height: 48px; border-radius: 14px; flex: none; display: grid; place-items: center; background: var(--accent); color: var(--accent-ink); }
.ct-text { flex: 1; }
.ct-text p { margin-top: 4px; font-size: 13.5px; }

/* ================================================================= library */
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.search { position: relative; flex: 1; min-width: 220px; display: flex; align-items: center; }
.search > svg { position: absolute; left: 12px; color: var(--text-3); pointer-events: none; }
.search .pf-input { padding-left: 38px; padding-right: 38px; }
.search .pf-btn { position: absolute; right: 4px; }
.cats { display: flex; gap: 6px; flex-wrap: wrap; }
.cat { font: inherit; font-size: 13px; font-weight: 500; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--text-2); cursor: pointer; display: inline-flex; gap: 6px; align-items: center; }
.cat span { font-size: 11.5px; color: var(--text-3); }
.cat:hover { border-color: var(--border-strong); color: var(--text); }
.cat.on { background: var(--ink); border-color: var(--ink); color: var(--ink-text); }
.cat.on span { color: inherit; opacity: .7; }
.pgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.pcard { display: flex; flex-direction: column; gap: 8px; padding: 16px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); cursor: pointer; transition: border-color .15s, box-shadow .15s, transform .15s; min-width: 0; }
.pcard:hover { border-color: var(--border-strong); box-shadow: var(--shadow); transform: translateY(-1px); }
.pcard-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.pcard-name { font-size: 15px; font-weight: 600; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.star-btn { flex: none; display: grid; place-items: center; width: 30px; height: 30px; margin: -5px -6px 0 0; border: 0; border-radius: 8px; background: none; color: var(--text-3); cursor: pointer; }
.star-btn:hover { background: var(--surface-2); color: #f5a524; }
.star-btn.on { color: #f5a524; }
.pcard-slug { font-size: 12px; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pcard-desc { font-size: 13.5px; color: var(--text-2); line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; flex: 1; }
.pcard-desc.faint { color: var(--text-3); }
.pcard-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pcard-actions { display: flex; align-items: center; gap: 6px; padding-top: 6px; border-top: 1px solid var(--border); margin-top: 2px; }
.pcard-actions .menu-wrap { margin-left: auto; }
.pcard.market .pcard-actions > :last-child { margin-left: auto; }
.lang-pill { font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 6px; background: var(--surface-2); color: var(--text-3); }
.code-chip { align-self: flex-start; display: inline-flex; align-items: center; gap: 6px; font-family: var(--mono); font-size: 12px; padding: 3px 9px; border-radius: 7px; border: 1px solid var(--border); background: var(--hl-block); color: var(--hl-block-text); cursor: copy; }

/* ================================================================== editor */
.ed-grid { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 20px; align-items: start; }
.ed-main { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.ed-side .sticky { position: sticky; top: 20px; }
.slug-input { display: flex; align-items: center; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--surface); overflow: hidden; transition: border-color .15s, box-shadow .15s; }
.slug-input:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }
.slug-input.bad { border-color: var(--warn); }
.slug-input span { padding: 0 4px 0 11px; color: var(--accent-text); font-family: var(--mono); font-weight: 700; }
.slug-input span:last-child { padding: 0 11px 0 4px; }
.slug-input input { flex: 1; min-width: 0; border: 0; outline: none; background: none; padding: 10px 11px 10px 0; color: var(--text); font-size: 14px; }
.ed-toolbar { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.syntax-help { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 18px; padding: 12px 14px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--border); }
.sh-row { display: flex; gap: 10px; align-items: baseline; font-size: 13px; }
.sh-row code { flex: none; color: var(--accent-text); }
.sh-row span { color: var(--text-2); }

.code { position: relative; border: 1px solid var(--border-strong); border-radius: 12px; background: var(--surface); transition: border-color .15s, box-shadow .15s; }
.code:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); }
.code-hl, .code-ta {
  margin: 0; padding: 14px 16px; font-family: var(--font); font-size: 15px; line-height: 1.7; letter-spacing: normal;
  white-space: pre-wrap; word-wrap: break-word; overflow-wrap: break-word; tab-size: 4; border: 0;
}
.code-hl { position: absolute; inset: 0; overflow: hidden; color: var(--text); pointer-events: none; }
.code-ta { position: relative; display: block; width: 100%; min-height: calc(var(--rows, 12) * 1.7em + 28px); resize: vertical; background: transparent; color: transparent; caret-color: var(--text); outline: none; overflow: auto; }
.code-ta::placeholder { color: var(--text-3); }
.code-ta::selection { color: transparent; background: color-mix(in srgb, var(--accent) 30%, transparent); }
.code mark { color: inherit; border-radius: 4px; }
.code mark.hl-var { background: var(--hl-var); color: var(--hl-var-text); }
.code mark.hl-section { background: var(--hl-section); color: var(--hl-section-text); }
.code mark.hl-block { background: var(--hl-block); color: var(--hl-block-text); }
.code mark.hl-builtin { background: var(--hl-builtin); color: var(--hl-builtin-text); }
.code mark.hl-comment { background: none; color: var(--hl-comment-text); font-style: italic; }
.ed-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.details-toggle { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; background: none; border: 0; padding: 0; color: var(--text); cursor: pointer; font: inherit; }
.details-toggle > div { flex: 1; }
.details-toggle p { font-size: 13.5px; margin-top: 3px; }
.details-body { display: flex; flex-direction: column; gap: 14px; align-items: flex-start; padding-top: 14px; border-top: 1px solid var(--border); }
.details-body .row { width: 100%; }
.mini-fields { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.mini-fields li { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 13px; padding: 6px 8px; border-radius: 8px; background: var(--surface-2); }
.mini-fields code { color: var(--hl-var-text); background: var(--hl-var); padding: 1px 6px; border-radius: 5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.preview-wrap { max-width: 760px; }
.preview-panel { border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }

.fields-editor { display: flex; flex-direction: column; gap: 10px; }
.fe-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 6px; }
.fe-head p { margin-top: 4px; font-size: 13.5px; }
.fe-empty { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 28px 12px; border: 1px dashed var(--border-strong); border-radius: 12px; text-align: center; }
.fcard { border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
.fcard.open { border-color: var(--border-strong); box-shadow: var(--shadow-sm); }
.fcard.unused { border-style: dashed; opacity: .85; }
.fcard-head { display: flex; align-items: center; gap: 10px; padding: 11px 14px; cursor: pointer; user-select: none; }
.fcard-ic { width: 28px; height: 28px; border-radius: 8px; flex: none; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-text); }
.fcard-name { font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fcard-key { font-size: 12px; color: var(--hl-var-text); background: var(--hl-var); padding: 1px 6px; border-radius: 5px; white-space: nowrap; max-width: 30%; overflow: hidden; text-overflow: ellipsis; }
.fcard-type { margin-left: auto; font-size: 12.5px; color: var(--text-3); white-space: nowrap; }
.tag-req { font-size: 11px; font-weight: 600; color: var(--danger); background: var(--danger-soft); padding: 1px 7px; border-radius: 999px; }
.tag-warn { font-size: 11px; font-weight: 600; color: var(--warn); background: var(--warn-soft); padding: 1px 7px; border-radius: 999px; white-space: nowrap; }
.fcard-body { display: flex; flex-direction: column; gap: 12px; padding: 4px 14px 14px; border-top: 1px solid var(--border); padding-top: 14px; }
.fcard-foot { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding-top: 4px; }
.rename { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.rename .pf-input { width: 180px; }

.versions { display: flex; flex-direction: column; gap: 8px; }
.versions > p { margin-bottom: 6px; }
.ver { border: 1px solid var(--border); border-radius: 10px; }
.ver.current { display: flex; align-items: center; gap: 10px; padding: 10px 12px; background: var(--surface-2); }
.ver-row { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 12px; background: none; border: 0; font: inherit; color: var(--text); cursor: pointer; text-align: left; }
.ver-n { font-family: var(--mono); font-size: 12px; font-weight: 700; color: var(--accent-text); background: var(--accent-soft); padding: 1px 7px; border-radius: 6px; }
.ver-name { flex: 1; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ver-body { padding: 0 12px 12px; display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.ver-content { margin: 0; width: 100%; max-height: 260px; overflow: auto; white-space: pre-wrap; font-family: var(--font); font-size: 13.5px; background: var(--surface-2); padding: 10px 12px; border-radius: 8px; }

/* ================================================================= history */
.hgroup { display: flex; flex-direction: column; gap: 8px; }
.hday { font-size: 13px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--text-3); }
.hrow { display: grid; grid-template-columns: 1fr auto; align-items: center; border-bottom: 1px solid var(--border); }
.hrow:last-child { border-bottom: 0; }
.hrow-main { display: flex; flex-direction: column; gap: 6px; padding: 12px 16px; background: none; border: 0; text-align: left; font: inherit; color: var(--text); cursor: pointer; min-width: 0; }
.hrow-main:hover { background: var(--surface-2); }
.hrow-title { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.hname { font-weight: 600; }
.site-pill { font-size: 11.5px; font-weight: 600; padding: 1px 8px; border-radius: 999px; background: var(--surface-2); color: var(--text-2); border: 1px solid var(--border); }
.site-pill.mcp { background: var(--accent-soft); color: var(--accent-text); border-color: transparent; }
.hvals { display: flex; gap: 6px; flex-wrap: wrap; }
.hval { font-size: 12.5px; color: var(--text-2); background: var(--surface-2); padding: 1px 8px; border-radius: 6px; max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hval b { font-weight: 600; color: var(--text); }
.hrow-actions { display: flex; gap: 4px; padding-right: 12px; }
.hout { grid-column: 1 / -1; margin: 0 16px 14px; padding: 12px 14px; white-space: pre-wrap; font-family: var(--font); font-size: 13.5px; background: var(--surface-2); border-radius: 10px; max-height: 320px; overflow: auto; }

/* =============================================================== generator */
.step-text { font-weight: 600; font-size: 14px; }
.req-box { margin: 0; padding: 14px 16px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); white-space: pre-wrap; font-family: var(--mono); font-size: 12.5px; max-height: 260px; overflow: auto; }
.gen-result { display: flex; flex-direction: column; gap: 12px; }

/* ================================================================= connect */
.create-link { display: flex; gap: 8px; }
.create-link .pf-input { max-width: 260px; }
.created { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; padding: 14px; border-radius: 12px; background: var(--ok-soft); }
.linkbox { display: flex; align-items: center; gap: 6px; width: 100%; padding: 6px 6px 6px 12px; border: 1px solid var(--border-strong); border-radius: 10px; background: var(--surface); }
.linkbox-url { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12.5px; color: var(--text); }
.howto-steps { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 8px; font-size: 14px; }
.howto-steps li::marker { color: var(--accent); font-weight: 700; }
.howto .pf-btn { align-self: flex-start; }
.examples { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.example { display: flex; gap: 8px; align-items: flex-start; padding: 10px 12px; border-radius: 10px; background: var(--surface-2); font-size: 13.5px; }
.example svg { flex: none; color: var(--accent-text); margin-top: 3px; }
.tool-list { display: flex; flex-wrap: wrap; gap: 6px; }
.tool-list code { font-size: 12px; padding: 2px 8px; border-radius: 6px; background: var(--surface-2); border: 1px solid var(--border); color: var(--text-2); }
.tokens { display: flex; flex-direction: column; gap: 10px; }
.token { display: flex; gap: 12px; align-items: flex-start; padding: 12px; border: 1px solid var(--border); border-radius: 12px; }
.token-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.token-name { display: flex; align-items: center; gap: 6px; font-weight: 600; }
.token-actions { display: flex; flex-direction: column; gap: 6px; }
.deploy-note summary { cursor: pointer; font-size: 13px; color: var(--text-2); }
.deploy-note p { margin-top: 6px; }

/* ================================================================ settings */
.site-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; }
.site-toggle { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border: 1px solid var(--border); border-radius: 10px; cursor: pointer; }
.site-dot { width: 10px; height: 10px; border-radius: 50%; flex: none; display: inline-block; }
.site-name { flex: 1; font-size: 14px; font-weight: 500; }
.subsection { display: flex; flex-direction: column; gap: 10px; padding-top: 14px; border-top: 1px solid var(--border); }
.chips-row { display: flex; gap: 6px; flex-wrap: wrap; }
.kbd-list { display: flex; flex-direction: column; gap: 8px; font-size: 14px; }
.kbd-list > div { display: flex; align-items: center; gap: 6px; }
.kbd-list > div > span:last-child { margin-left: 10px; color: var(--text-2); }

/* ==================================================================== auth */
.auth-screen { min-height: 100vh; display: grid; grid-template-columns: minmax(320px, 0.9fr) 1.1fr; }
.auth-side { padding: 56px 48px; background: linear-gradient(160deg, #1e1b4b, #312e81 55%, #4338ca); color: #eef0ff; display: flex; flex-direction: column; gap: 22px; justify-content: center; }
.auth-brand { display: flex; align-items: center; gap: 12px; font-size: 20px; font-weight: 700; }
.auth-side h2 { font-size: 30px; line-height: 1.25; font-weight: 700; max-width: 420px; }
.auth-points { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.auth-points li { display: flex; gap: 12px; align-items: flex-start; font-size: 15px; color: #d6d8ff; }
.auth-points svg { flex: none; margin-top: 3px; color: #a5b4fc; }
.auth-main { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; padding: 40px 20px; position: relative; }
.back-link { position: absolute; top: 24px; left: 24px; }
.auth-card { width: 100%; max-width: 400px; display: flex; flex-direction: column; gap: 14px; padding: 28px; background: var(--surface); border: 1px solid var(--border); border-radius: 18px; box-shadow: var(--shadow); }
.auth-card.compact { padding: 18px; border-radius: 14px; box-shadow: none; }
.auth-card h1 { font-size: 22px; }
.auth-logo { margin-bottom: 2px; }
.auth-card .seg { display: flex; }
.auth-card .seg button { flex: 1; justify-content: center; }
.code-input { font-family: var(--mono); font-size: 20px; letter-spacing: .3em; text-align: center; }
.or { display: flex; align-items: center; gap: 10px; color: var(--text-3); font-size: 12px; }
.or::before, .or::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.auth-links { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.help-box { padding: 10px 12px; border-radius: 10px; background: var(--surface-2); }
.auth-lang { display: flex; gap: 4px; }
.auth-lang button { font: inherit; font-size: 13px; border: 0; background: none; color: var(--text-3); padding: 4px 10px; border-radius: 8px; cursor: pointer; }
.auth-lang button.on { color: var(--text); background: var(--surface-2); font-weight: 600; }
.auth-lang.top { align-self: flex-end; }

.welcome { min-height: 100vh; display: grid; place-items: center; padding: 32px 16px; background: radial-gradient(1200px 500px at 50% -10%, var(--accent-soft), var(--bg)); }
.welcome-card { width: 100%; max-width: 560px; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 16px; padding: 32px; background: var(--surface); border: 1px solid var(--border); border-radius: 22px; box-shadow: var(--shadow); }
.welcome-card h1 { font-size: 28px; }

/* ============================================================== side panel */
.sidepanel-body { background: var(--bg); }
.sp { display: flex; flex-direction: column; height: 100vh; }
.sp-head { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--border); background: var(--surface); }
.sp-head b { font-size: 15px; }
.sp-gate { padding: 14px; overflow-y: auto; }
.sp-gate .auth-card { max-width: none; }
.sp-tabs { display: flex; gap: 4px; padding: 8px 12px 0; }
.sp-tabs button { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 6px; font: inherit; font-size: 13.5px; font-weight: 500; padding: 7px; border: 0; border-bottom: 2px solid transparent; background: none; color: var(--text-2); cursor: pointer; }
.sp-tabs button.on { color: var(--text); border-bottom-color: var(--accent); font-weight: 600; }
.sp-search { display: flex; gap: 6px; align-items: center; padding: 10px 12px; position: relative; }
.sp-search > svg { position: absolute; left: 24px; color: var(--text-3); }
.sp-search .pf-input { padding-left: 36px; }
.sp-list { flex: 1; overflow-y: auto; padding: 0 8px 12px; display: flex; flex-direction: column; gap: 2px; }
.sp-item { display: flex; align-items: center; gap: 8px; width: 100%; padding: 9px 10px; border: 0; border-radius: 10px; background: none; color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.sp-item:hover, .sp-item:focus-visible { background: var(--surface); box-shadow: var(--shadow-sm); }
.sp-item.static { cursor: default; }
.sp-item.static:hover { background: none; box-shadow: none; }
.sp-item-main { flex: 1; min-width: 0; }
.sp-item-name { font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sp-item-sub { font-size: 11.5px; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sp-empty { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 28px 12px; text-align: center; }
.sp-fill { flex: 1; display: flex; flex-direction: column; min-height: 0; background: var(--surface); }
.sp-fill .fp { flex: 1; min-height: 0; }
.sp-fill .fp-body { flex: 1; overflow-y: auto; }
.sp-fill .fp-actions { flex-wrap: wrap; }
.sp-back { display: inline-flex; align-items: center; gap: 6px; margin: 10px 12px 0; padding: 0; border: 0; background: none; color: var(--text-2); font: inherit; font-size: 13px; cursor: pointer; align-self: flex-start; }
.sp-foot { padding: 8px 14px; border-top: 1px solid var(--border); background: var(--surface); display: flex; align-items: center; gap: 6px; }
.sp-foot .site-dot { margin-right: 4px; }

/* ============================================================== responsive */
@media (max-width: 1100px) {
  .ed-grid { grid-template-columns: 1fr; }
  .ed-side { display: none; }
}
@media (max-width: 900px) {
  .sidebar { position: fixed; z-index: 800; left: 0; top: 0; transform: translateX(-100%); transition: transform .2s; box-shadow: var(--shadow-lg); }
  .sidebar.open { transform: none; }
  .sb-close { display: inline-flex; }
  .sb-scrim { display: block; position: fixed; inset: 0; z-index: 790; background: rgba(0, 0, 0, .3); }
  .mobile-bar { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--border); background: var(--surface); position: sticky; top: 0; z-index: 50; }
  .mobile-bar .brand { font-size: 16px; flex: 1; }
  .page { padding: 20px 16px 48px; }
  .stats { grid-template-columns: 1fr 1fr; }
  .two-col, .grid2, .grid3, .examples, .steps, .syntax-help { grid-template-columns: 1fr; }
  .auth-screen { grid-template-columns: 1fr; }
  .auth-side { display: none; }
  .connect-teaser { flex-direction: column; align-items: flex-start; }
  .hide-sm { display: none; }
}

/* ============================================================ files & media */
.thumb { position: relative; display: inline-grid; place-items: center; flex: none; overflow: hidden; border-radius: 10px; background: var(--surface-2); color: var(--text-3); border: 1px solid var(--border); }
.thumb img, .thumb video { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb-image { background: repeating-conic-gradient(var(--surface-2) 0 25%, var(--surface) 0 50%) 0 0 / 14px 14px; }
.thumb-image img { object-fit: contain; }
.thumb-video { background: #111; color: #ccc; }
.thumb-play { position: absolute; inset: auto 6px 6px auto; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: rgba(0, 0, 0, .55); color: #fff; }
.dropzone { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; width: 100%; padding: 26px 16px; border: 2px dashed var(--border-strong); border-radius: var(--radius); background: var(--surface); color: var(--text-2); font: inherit; cursor: pointer; transition: border-color .15s, background .15s; }
.dropzone:hover, .dropzone.over { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-text); }
.dropzone.compact { flex-direction: row; padding: 12px 14px; }
.dz-title { font-weight: 600; font-size: 14px; }
.dz-hint { font-size: 12.5px; color: var(--text-3); }
.drop-overlay { position: fixed; inset: 12px; z-index: 950; display: flex; align-items: center; justify-content: center; gap: 12px; border: 3px dashed var(--accent); border-radius: 20px; background: color-mix(in srgb, var(--accent-soft) 85%, transparent); color: var(--accent-text); font-size: 18px; font-weight: 600; pointer-events: none; }
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
.media-grid.small { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; }
.media-card { position: relative; display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-sm); text-align: left; font: inherit; color: var(--text); padding: 0; }
.media-card .media-thumb { width: 100% !important; height: auto !important; aspect-ratio: 4 / 3; border-radius: 0; border: 0; border-bottom: 1px solid var(--border); }
.media-card.pick { cursor: pointer; }
.media-card.pick.on { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent); }
.media-card.pick .media-name { padding: 8px 10px; font-size: 12.5px; }
.pick-check { position: absolute; top: 8px; right: 8px; display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); }
.media-info { padding: 10px 12px 4px; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.media-name { font-weight: 600; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.media-meta { display: flex; gap: 8px; flex-wrap: wrap; font-size: 12px; color: var(--text-3); }
.dotlabel::before { content: ''; display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 5px; background: var(--text-3); vertical-align: 1px; }
.dotlabel.ok::before { background: var(--ok); }
.dotlabel.wait::before { background: var(--warn); }
.media-actions { display: flex; gap: 6px; padding: 8px 12px 12px; align-items: center; }
.media-actions .menu-wrap { margin-left: auto; }
.card.drop-over { border-color: var(--accent); background: var(--accent-soft); }
.att-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; }
.att-tile { display: flex; align-items: center; gap: 10px; padding: 8px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); min-width: 0; }
.att-tile-meta { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.att-name { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.att-size { font-size: 11.5px; color: var(--text-3); }
.att-empty { padding: 14px; border: 1px dashed var(--border-strong); border-radius: 12px; text-align: center; }

/* ================================================================== wizard */
.auth-card.wizard { max-width: 640px; }
.wz-modes { display: flex; }
.wz-modes button { flex: 1; justify-content: center; }
.wz { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.wz-step { display: flex; gap: 12px; }
.wz-n { flex: none; display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--accent-soft); color: var(--accent-text); font-weight: 700; font-size: 13px; }
.wz-step.done .wz-n { background: var(--ok); color: #fff; }
.wz-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.wz-title { font-weight: 600; font-size: 14.5px; }
.wz-body .pf-btn { align-self: flex-start; }
.wz-body .btn-row .pf-btn { align-self: auto; }
.wz-paste { display: flex; flex-direction: column; gap: 10px; }
.cmd { margin: 0; padding: 10px 12px; border-radius: 10px; background: #16181d; color: #e5e7eb; font-family: var(--mono); font-size: 12.5px; white-space: pre-wrap; }

.desktop-card { border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); background: linear-gradient(135deg, var(--surface) 60%, var(--accent-soft)); }
.shortcut-demo { display: flex; flex-direction: column; gap: 6px; padding: 12px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); }
.sd-row { display: flex; gap: 12px; align-items: baseline; flex-wrap: wrap; font-size: 13.5px; }
.sd-row code { background: #16181d; color: #c7d2fe; padding: 2px 8px; border-radius: 6px; font-size: 12.5px; }
.sd-row span { color: var(--text-2); }

/* ================================================================ send sheet */
.send { display: flex; flex-direction: column; min-height: 0; max-height: calc(100vh - 80px); }
.send-body { padding: 14px 16px 18px; display: flex; flex-direction: column; gap: 12px; overflow-y: auto; }
.send-main { display: flex; align-items: center; gap: 12px; width: 100%; padding: 14px 16px; border: 0; border-radius: 14px; background: var(--accent); color: var(--accent-ink); font: inherit; text-align: left; cursor: pointer; box-shadow: var(--shadow-sm); transition: transform .1s, background .15s; }
.send-main:hover { background: var(--accent-hover); }
.send-main:active { transform: scale(.99); }
.send-main:disabled { opacity: .6; cursor: progress; }
.send-main.alt { background: var(--surface); color: var(--text); border: 1px solid var(--border); }
.send-main.alt:hover { border-color: var(--accent); background: var(--surface); }
.send-main-ic { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: rgba(255, 255, 255, .18); flex: none; }
.send-main.alt .send-main-ic { background: var(--accent-soft); color: var(--accent-text); }
.send-main-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.send-main-text b { font-size: 15.5px; }
.send-main-text small { font-size: 12.5px; opacity: .85; }
.send-label { font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--text-3); margin-top: 4px; }
.send-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.send-tile { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 6px 10px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); color: var(--text); font: inherit; cursor: pointer; transition: border-color .15s, transform .1s; }
.send-tile:hover { border-color: var(--accent); }
.send-tile:active { transform: scale(.97); }
.send-tile small { font-size: 11px; text-align: center; }
.send-dot { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 12px; color: #fff; font-weight: 700; font-size: 17px; }
.send-name { font-weight: 600; font-size: 13.5px; }
.send-files { display: flex; flex-direction: column; gap: 6px; padding: 10px 12px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); }
.send-files-list { display: flex; gap: 6px; flex-wrap: wrap; }
.send-files p { margin: 0; }
.send-extra { display: flex; gap: 8px; flex-wrap: wrap; }
.send-preview summary { cursor: pointer; font-size: 13px; color: var(--text-2); }
.send-preview pre { margin: 8px 0 0; padding: 10px 12px; max-height: 220px; overflow: auto; white-space: pre-wrap; word-break: break-word; background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; font-family: var(--font); font-size: 13px; }

/* ============================================================ phone link / QR */
.phone-link { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.qr { flex: none; border-radius: 12px; border: 1px solid var(--border); background: #fff; }
.phone-link-text { flex: 1; min-width: 220px; display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }

/* ============================================================ phone layout */
.bottom-nav { display: none; }
@media (max-width: 640px) {
  .page { padding: 16px 14px 96px; }
  .page-head { flex-direction: column; align-items: stretch; gap: 12px; }
  .page-head .head-actions { flex-wrap: wrap; }
  .page-head h1 { font-size: 22px; }
  .stats { gap: 10px; }
  .stat { padding: 12px 14px; }
  .send-grid { grid-template-columns: repeat(2, 1fr); }
  .modal-backdrop { padding: 0; place-items: end center; }
  .modal, .modal.wide { max-width: 100%; max-height: 94vh; border-radius: 18px 18px 0 0; border-bottom: 0; padding-bottom: env(safe-area-inset-bottom); }
  .modal.fill-modal .fp, .send { max-height: 94vh; }
  .toasts { bottom: calc(80px + env(safe-area-inset-bottom)); }
  .mobile-bar { padding-top: max(10px, env(safe-area-inset-top)); }
  .bottom-nav { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 60; justify-content: space-around; align-items: stretch; padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-top: 1px solid var(--border); }
  .bn-item { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 2px; border: 0; background: none; color: var(--text-3); font: inherit; font-size: 11px; font-weight: 600; text-decoration: none; border-radius: 12px; cursor: pointer; }
  .bn-item.on { color: var(--accent); }
  .bn-item:hover { text-decoration: none; }
  .bn-plus { display: grid; place-items: center; width: 44px; height: 44px; margin-top: -2px; border-radius: 14px; background: var(--accent); color: var(--accent-ink); box-shadow: var(--shadow); }
}
@media (pointer: coarse) {
  .fp-actions .fp-hint.grow { visibility: hidden; }
  .pf-input, select.pf-input, textarea.pf-input { font-size: 16px; }
  .pf-btn { min-height: 40px; }
  .pf-btn.sm { min-height: 36px; }
}

/* ---- brand profiles */
.brand-card { text-decoration: none; color: inherit; }
.brand-card .pcard-top { display: flex; gap: 12px; align-items: center; }
.brand-card .pcard-meta span { display: inline-flex; gap: 4px; align-items: center; }
.thumb-empty { display: inline-grid; place-items: center; border-radius: 10px; background: var(--surface-2); color: var(--text-3); border: 1px dashed var(--border); flex: none; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.brand-editor .card + .card, .brand-editor .seg + .card, .brand-editor .card + .seg { margin-top: 14px; }
.brand-top { display: flex; gap: 16px; align-items: flex-end; flex-wrap: wrap; }
.asset-pick { display: flex; gap: 12px; align-items: center; }
.asset-pick-actions { display: flex; flex-direction: column; gap: 6px; }
.asset-pick select { max-width: 180px; }
.brand-tabs { display: flex; flex-wrap: wrap; margin-top: 14px; width: 100%; }
.brand-tabs button { flex: 1 1 auto; justify-content: center; }
.row-wide { grid-column: 1 / -1; }
.brand-editor textarea.pf-input { min-height: 72px; resize: vertical; line-height: 1.5; }
.brand-images { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 6px; }
.brand-img { position: relative; }
.brand-img button { position: absolute; top: -8px; right: -8px; background: var(--surface); border: 1px solid var(--border); border-radius: 999px; }
.list-editor { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.le-item { border: 1px solid var(--border); border-radius: 10px; background: var(--surface); }
.le-item.open { border-color: var(--accent); }
.le-head { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 12px; border: 0; background: none; font: inherit; color: var(--text); cursor: pointer; text-align: left; min-height: 44px; }
.le-head .ellipsis { max-width: 40%; }
.le-body { padding: 4px 12px 12px; display: flex; flex-direction: column; gap: 12px; }
.brand-preview pre { white-space: pre-wrap; word-break: break-word; max-height: 360px; overflow: auto; background: var(--surface-2); padding: 12px; border-radius: 8px; margin: 10px 0 0; }
.save-bar { position: sticky; bottom: 12px; z-index: 5; display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 16px; padding: 10px 14px; border-radius: 12px; background: var(--surface); border: 1px solid var(--accent); box-shadow: var(--shadow-md, 0 6px 24px rgba(0,0,0,.12)); }
.google-btn { gap: 10px; font-weight: 600; }
.advanced-card { margin-top: 14px; }
.advanced-card summary { cursor: pointer; padding: 4px 0; }
.advanced-card[open] summary { margin-bottom: 10px; }
@media (max-width: 640px) {
  .brand-tabs { overflow-x: auto; flex-wrap: nowrap; }
  .brand-tabs button { flex: none; }
  .brand-editor .grid2 { grid-template-columns: 1fr; }
  .save-bar { bottom: 76px; }
}
.crumb { display: inline-flex; align-items: center; gap: 4px; margin-bottom: 6px; }
.server-notice { padding: 12px 24px 0; display: flex; flex-direction: column; gap: 8px; } @media (max-width: 640px) { .server-notice { padding: 10px 12px 0; } }
.plain-fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.plain-fieldset + .seg, .plain-fieldset > .card + .card { margin-top: 14px; }
.brand-editor > .plain-fieldset { margin-top: 14px; display: block; }
.shared-badge { background: var(--surface-2); color: var(--text-2); }
.share-form { display: flex; flex-direction: column; gap: 10px; }
.share-list { display: flex; flex-direction: column; gap: 8px; margin-top: 16px; }
.share-row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 10px; }
.share-who { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.share-row select { width: auto; }
.avatar-sm { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-text); font-weight: 700; font-size: 13px; flex: none; }
.card-inset { margin-top: 16px; padding: 14px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); display: flex; flex-direction: column; gap: 8px; }
.bf-found { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.bf-row { display: flex; gap: 10px; align-items: flex-start; padding: 8px 10px; border: 1px solid var(--border); border-radius: 10px; cursor: pointer; }
.bf-row input { margin-top: 4px; }
.pi-preview { max-height: 260px; overflow: auto; border: 1px solid var(--border); border-radius: 10px; }
.pi-preview table { width: 100%; border-collapse: collapse; font-size: 13px; }
.pi-preview th, .pi-preview td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--border); vertical-align: top; }
@media (max-width: 640px) { .hide-sm { display: none; } }
