  :root {
    --bg: #F5F5F7;
    --surface: #FFFFFF;
    --surface2: #EFEFF2;
    --border: rgba(0,0,0,0.08);
    --border2: rgba(0,0,0,0.12);
    --text: #1D1D1F;
    --muted: #6E6E73;
    --accent: #0071E3;
    --accent2: #0077ED;
    --accent-hover: #0077ED;
    --accent-soft: rgba(0,113,227,0.08);
    --green: #34C759;
    --amber: #FF9F0A;
    --red: #FF3B30;
    --blue: #0071E3;
    --shadow: 0 1px 2px rgba(0,0,0,0.04), 0 8px 24px rgba(0,0,0,0.06);
    --ease: cubic-bezier(0.22, 1, 0.36, 1);
    --font: 'Switzer', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --mono: 'IBM Plex Mono', ui-monospace, monospace;
    --fs-xs: 13px;
    --fs-sm: 14px;
    --fs-base: 16px;
    --fs-btn: 15px;
    --fs-md: 15px;
    --fs-lg: 18px;
    --fs-title: 32px;
    --fs-stat: 32px;
    --r-sm: 8px;
    --r-md: 10px;
    --r-lg: 14px;
    --r-xl: 18px;
    --sp-1: 4px;
    --sp-2: 8px;
    --sp-3: 12px;
    --sp-4: 16px;
    --sp-5: 20px;
    --sp-6: 24px;
    --sp-7: 32px;
    --sp-8: 40px;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow-md: 0 1px 2px rgba(0,0,0,0.04), 0 6px 18px rgba(0,0,0,0.06);
    --shadow-lg: 0 4px 12px rgba(0,0,0,0.06), 0 24px 48px rgba(0,0,0,0.12);
    --tone-planned-bg: rgba(0,0,0,0.05);
    --tone-planned-fg: #48484C;
    --tone-writing-bg: var(--accent-soft);
    --tone-writing-fg: var(--accent);
    --tone-ready-bg: rgba(255,159,10,0.14);
    --tone-ready-fg: #B56F00;
    --tone-draft-bg: rgba(0,113,227,0.10);
    --tone-draft-fg: #0060C2;
    --tone-live-bg: rgba(52,199,89,0.14);
    --tone-live-fg: #1F7A35;
    --tone-failed-bg: rgba(255,59,48,0.10);
    --tone-failed-fg: #D70015;
  }
  *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
  body {
    background: var(--bg); color: var(--text); font-family: var(--font);
    min-height: 100vh; font-size: var(--fs-base); line-height: 1.5; -webkit-font-smoothing: antialiased;
  }

  /* Layout */
  .shell { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }

  /* Sidebar */
  .sidebar {
    background: var(--surface);
    border-right: 1px solid var(--border);
    display: flex; flex-direction: column;
    padding: 26px 0;
    position: sticky; top: 0; height: 100vh;
  }
  .logo {
    padding: 0 22px 28px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 20px;
  }
  .logo-mark { font-size: var(--fs-md); font-weight: 600; letter-spacing: -0.02em; color: var(--text); }
  .logo-sub { font-size: var(--fs-xs); color: var(--muted); margin-top: 2px; font-family: var(--mono); }
  .nav-item {
    display: flex; align-items: center; gap: 11px;
    padding: 11px 16px; margin: 0 10px; font-size: var(--fs-sm); font-weight: 500;
    color: var(--muted); cursor: pointer; border-radius: 10px;
    transition: background 0.2s var(--ease), color 0.2s var(--ease);
  }
  .nav-item:hover { color: var(--text); background: rgba(0,0,0,0.04); }
  .nav-item.active { color: var(--accent); background: var(--accent-soft); }
  .nav-icon { font-size: 18px; width: 20px; text-align: center; }

  /* Main */
  .main { padding: 36px 40px; overflow-y: auto; }
  .page { display: none; }
  .page.active { display: block; animation: enter 0.4s var(--ease) both; }

  /* Header */
  .page-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 30px; }
  .page-title { font-size: var(--fs-title); font-weight: 700; letter-spacing: -0.025em; }
  .page-subtitle { font-size: var(--fs-sm); color: var(--muted); margin-top: 6px; }

  /* Buttons */
  .btn {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 11px 20px; border-radius: 980px; font-size: var(--fs-btn); font-weight: 500;
    font-family: var(--font); cursor: pointer;
    transition: transform 0.2s var(--ease), background 0.2s var(--ease), border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
    border: none;
  }
  .btn:active { transform: scale(0.98); }
  .btn-primary { background: var(--accent); color: #fff; box-shadow: none; }
  .btn-primary:hover { background: var(--accent-hover); }
  .btn-ghost { background: transparent; color: var(--muted); border: 1px solid var(--border2); border-radius: 12px; }
  .btn-ghost:hover { color: var(--text); border-color: rgba(0,0,0,0.22); background: rgba(0,0,0,0.02); }
  .btn-sm { padding: 7px 12px; font-size: var(--fs-sm); }
  .btn-danger { background: rgba(255,59,48,0.1); color: var(--red); border: 1px solid rgba(255,59,48,0.2); border-radius: 12px; }
  .btn-danger:hover { background: rgba(255,59,48,0.16); }
  .btn-success { background: rgba(52,199,89,0.12); color: #248A3D; border: 1px solid rgba(52,199,89,0.25); border-radius: 12px; }
  .btn-success:hover { background: rgba(52,199,89,0.2); }
  .btn:disabled { opacity: 0.55; cursor: not-allowed; pointer-events: none; }
  .page-header-actions { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }

  /* Stats */
  .stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 28px; }
  .stat-card { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 20px 22px; box-shadow: var(--shadow); }
  .stat-label { font-size: var(--fs-xs); font-weight: 500; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; }
  .stat-value { font-size: var(--fs-stat); font-weight: 500; font-family: var(--mono); letter-spacing: -0.02em; }
  .stat-accent { color: var(--accent); }
  .stat-green { color: var(--green); }
  .stat-amber { color: var(--amber); }
  .stat-blue { color: var(--blue); }

  /* Calendar */
  .calendar-nav { display: flex; align-items: center; gap: 16px; margin-bottom: 20px; }
  .cal-month { font-size: var(--fs-lg); font-weight: 600; min-width: 170px; }
  .calendar-grid { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; overflow: hidden; box-shadow: var(--shadow); }
  .cal-header { display: grid; grid-template-columns: repeat(7, 1fr); background: var(--surface2); }
  .cal-header-cell { padding: 14px 0; text-align: center; font-size: var(--fs-xs); font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
  .cal-body { display: grid; grid-template-columns: repeat(7, 1fr); }
  .cal-cell {
    min-height: 148px; padding: 12px; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border);
    vertical-align: top; transition: background 0.1s;
  }
  .cal-cell.empty-day { cursor: pointer; }
  .cal-cell.empty-day:hover { background: rgba(0,0,0,0.02); }
  .cal-cell:nth-child(7n) { border-right: none; }
  .cal-cell.other-month .cal-day { color: var(--muted); opacity: 0.4; }
  .cal-cell.today { background: var(--accent-soft); }
  .cal-cell.today .cal-day { background: var(--accent); color: #fff; border-radius: 50%; width: 26px; height: 26px; display: flex; align-items: center; justify-content: center; }
  .cal-day { font-size: var(--fs-sm); font-weight: 500; color: var(--muted); margin-bottom: 8px; }
  .cal-events { display: flex; flex-direction: column; gap: 6px; }
  .cal-event {
    font-size: var(--fs-sm); padding: 8px 9px; border-radius: 8px; font-weight: 500;
    line-height: 1.4; max-width: 100%; cursor: pointer;
    display: flex; align-items: flex-start; gap: 6px;
    word-break: break-word;
  }
  .cal-event-icon { width: 14px; height: 14px; flex-shrink: 0; margin-top: 2px; }
  .cal-event-text {
    flex: 1; min-width: 0;
    display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 4;
    overflow: hidden;
  }
  .cal-event.scheduled { background: var(--accent-soft); color: var(--accent); }
  .cal-event.generated { background: rgba(255,159,10,0.15); color: #C77C00; }
  .cal-event.published { background: rgba(52,199,89,0.15); color: #248A3D; }
  .cal-event.draft { background: rgba(0,113,227,0.12); color: var(--accent); }
  .cal-event.processing {
    background: rgba(0,113,227,0.08); color: var(--accent);
    flex-direction: column; gap: 7px; cursor: default; pointer-events: none;
  }
  .cal-event.error { background: rgba(255,59,48,0.12); color: var(--red); }
  .cal-event-gen-head {
    display: flex; align-items: center; gap: 7px; width: 100%;
    font-size: var(--fs-xs); font-weight: 600; letter-spacing: 0.02em;
  }
  .cal-event-gen-pct {
    margin-left: auto; font-family: var(--mono); font-weight: 600; font-size: 11px;
  }
  .cal-event-gen-label {
    font-size: 10px; font-weight: 500; color: var(--muted); line-height: 1.3;
    width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  }
  .cal-event-spinner { width: 12px; height: 12px; flex-shrink: 0; border-width: 1.5px; }
  .gen-progress-track {
    width: 100%; height: 4px; border-radius: 999px; background: rgba(0,113,227,0.12); overflow: hidden;
  }
  .gen-progress-fill {
    height: 100%; border-radius: 999px; background: var(--accent);
    transition: width 0.45s var(--ease);
  }
  .cal-skel { display: flex; flex-direction: column; gap: 5px; width: 100%; }
  .cal-skel-line {
    display: block; height: 8px; border-radius: 4px; width: 100%;
    background: linear-gradient(90deg, rgba(0,113,227,0.12) 0%, rgba(0,113,227,0.22) 45%, rgba(0,113,227,0.12) 100%);
    background-size: 200% 100%;
    animation: calSkel 1.2s ease-in-out infinite;
  }
  .cal-skel-line.short { width: 62%; }
  .cal-skel-line.mid { width: 84%; }
  @keyframes calSkel {
    0% { background-position: 100% 0; }
    100% { background-position: -100% 0; }
  }

  /* Page / dashboard loading skeletons */
  .skel {
    display: inline-block; border-radius: 8px; vertical-align: middle;
    background: linear-gradient(90deg, rgba(0,0,0,0.06) 0%, rgba(0,0,0,0.11) 45%, rgba(0,0,0,0.06) 100%);
    background-size: 200% 100%;
    animation: calSkel 1.15s ease-in-out infinite;
  }
  .skel-bar { height: 1em; min-width: 2.5em; }
  .skel-stat { height: 1.35em; width: 2.4em; border-radius: 10px; }
  .skel-month { height: 1.15em; width: 9.5em; border-radius: 8px; }
  .skel-block { display: block; width: 100%; }
  .cal-cell.skel-cell { pointer-events: none; }
  .cal-cell.skel-cell .cal-day {
    width: 22px; height: 14px; border-radius: 6px; margin-bottom: 10px;
    background: linear-gradient(90deg, rgba(0,0,0,0.05) 0%, rgba(0,0,0,0.09) 45%, rgba(0,0,0,0.05) 100%);
    background-size: 200% 100%; animation: calSkel 1.15s ease-in-out infinite;
  }
  .cal-cell.skel-cell .skel-event {
    height: 28px; border-radius: 8px; margin-top: 4px;
    background: linear-gradient(90deg, rgba(0,0,0,0.05) 0%, rgba(0,0,0,0.1) 45%, rgba(0,0,0,0.05) 100%);
    background-size: 200% 100%; animation: calSkel 1.15s ease-in-out infinite;
  }
  .cal-cell.skel-cell .skel-event.short { width: 72%; height: 22px; }
  tr.skel-row td { padding: 14px 12px; vertical-align: middle; }
  .skel-td { height: 14px; border-radius: 6px; max-width: 100%; }
  .kw-skel-row {
    display: grid; grid-template-columns: 2fr 2fr 1fr; gap: 16px;
    padding: 16px 12px; border-bottom: 1px solid var(--border); align-items: center;
  }
  .kw-skel-row .skel { height: 12px; border-radius: 6px; width: 100%; }
  .kw-skel-row .skel.w60 { width: 60%; }
  .kw-skel-row .skel.w80 { width: 80%; }
  .billing-skel-grid .skel-stat { width: 4.5em; height: 1.35em; }
  .admin-skel {
    display: flex; flex-direction: column; gap: 10px; padding: 8px 0;
  }
  .admin-skel .skel { height: 12px; border-radius: 6px; }
  .settings-skel { display: none; }
  #page-settings.is-loading .settings-skel { display: block; }
  #page-settings.is-loading .settings-layout,
  #page-settings.is-loading .settings-save-bar { display: none !important; }
  .settings-skel-card { pointer-events: none; }
  .settings-skel-grid {
    display: grid; grid-template-columns: 1fr 1fr; gap: 14px 16px;
  }
  .settings-skel-grid .skel-input {
    height: 42px; border-radius: 12px;
  }
  .settings-skel-grid .skel-input.full { grid-column: 1 / -1; }
  .settings-skel-grid .skel-input.tall { height: 88px; }
  .article-gen-cell { display: flex; flex-direction: column; gap: 8px; min-width: 160px; max-width: 240px; }
  .article-gen-meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
  .article-gen-pct { font-family: var(--mono); font-size: 12px; font-weight: 600; color: var(--accent); }
  .article-gen-label { font-size: 11px; color: var(--muted); line-height: 1.3; }
  .badge-processing .badge-pct { font-family: var(--mono); font-weight: 600; }

  /* Articles table */
  .table-wrap { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; overflow: hidden; box-shadow: var(--shadow); }
  table { width: 100%; border-collapse: collapse; }
  th { padding: 14px 18px; text-align: left; font-size: var(--fs-xs); font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); background: var(--surface2); border-bottom: 1px solid var(--border); }
  td { padding: 15px 18px; font-size: var(--fs-sm); border-bottom: 1px solid var(--border); vertical-align: middle; }
  tr:last-child td { border-bottom: none; }
  tr:hover td { background: rgba(0,0,0,0.02); }
  .badge {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 4px 10px; border-radius: 20px; font-size: var(--fs-xs); font-weight: 500; font-family: var(--mono);
  }
  .badge-scheduled { background: var(--accent-soft); color: var(--accent); }
  .badge-generated { background: rgba(255,159,10,0.15); color: #C77C00; }
  .badge-published { background: rgba(52,199,89,0.15); color: #248A3D; }
  .badge-draft { background: rgba(0,113,227,0.12); color: var(--accent); }
  .badge-processing { background: rgba(255,159,10,0.15); color: #C77C00; }
  .badge-error { background: rgba(255,59,48,0.12); color: var(--red); }
  .badge-processing .badge-dot { animation: pulse 1.2s ease-in-out infinite; }
  .badge-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

  /* Keywords */
  .kw-grid { display: flex; flex-direction: column; gap: 0; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; overflow: hidden; box-shadow: var(--shadow); }
  .kw-row { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) 140px; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--border); gap: 16px; transition: background 0.1s; }
  .kw-angle { font-size: var(--fs-sm); color: var(--muted); line-height: 1.4; }
  .kw-row:last-child { border-bottom: none; }
  .kw-row:hover { background: rgba(0,0,0,0.02); }
  .kw-row-clickable { cursor: pointer; }
  .kw-row-clickable:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
  .kw-header { background: var(--surface2); font-size: var(--fs-xs); font-weight: 600; text-transform: uppercase; letter-spacing: 0.07em; color: var(--muted); }
  .kw-name { font-size: var(--fs-sm); font-weight: 500; }
  .kw-num { font-size: var(--fs-sm); font-family: var(--mono); color: var(--muted); text-align: right; }
  .score-bar { height: 4px; background: var(--border); border-radius: 2px; overflow: hidden; }
  .score-fill { height: 100%; background: var(--accent); border-radius: 2px; }

  /* Settings */
  .settings-section { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 24px; margin-bottom: 20px; box-shadow: var(--shadow); }
  .settings-title {
    display: flex; align-items: center; gap: 8px;
    font-size: var(--fs-md); font-weight: 600; margin-bottom: 18px; color: var(--text);
  }
  .settings-title svg, .settings-title i svg { color: var(--accent); width: 18px; height: 18px; }
  .form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
  .form-group { display: flex; flex-direction: column; gap: 6px; }
  .form-group.full { grid-column: 1 / -1; }
  label { font-size: var(--fs-sm); font-weight: 500; color: var(--muted); }
  input:not([type="color"]):not([type="checkbox"]):not([type="radio"]), textarea, select {
    background: var(--surface); border: 1px solid var(--border2); color: var(--text);
    border-radius: 12px; padding: 11px 14px; font-size: var(--fs-md); font-family: var(--font);
    transition: border 0.2s var(--ease), box-shadow 0.2s var(--ease); outline: none; width: 100%;
  }
  input:not([type="color"]):not([type="checkbox"]):not([type="radio"]):focus, textarea:focus, select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
  }
  input[type="checkbox"], input[type="radio"] {
    width: auto; max-width: none; padding: 0; margin: 0;
    border: none; border-radius: 0; background: transparent; box-shadow: none;
    accent-color: var(--accent); flex-shrink: 0;
  }
  textarea { resize: vertical; min-height: 80px; }

  /* Color pickers — visible swatch + hex (funnel / default) */
  .color-fields {
    display: grid; grid-template-columns: 1fr 1fr; gap: 16px;
    grid-column: 1 / -1;
  }
  .color-field {
    display: flex; align-items: center; gap: 12px;
    background: var(--surface2); border: 1px solid var(--border2);
    border-radius: 14px; padding: 10px 12px 10px 10px;
    height: 100%;
  }
  input[type="color"].color-swatch {
    -webkit-appearance: none; appearance: none;
    width: 52px; height: 52px; min-width: 52px; max-width: 52px;
    padding: 0; margin: 0; border: 2px solid rgba(0,0,0,0.12);
    border-radius: 12px; cursor: pointer; flex-shrink: 0;
    background: transparent; box-shadow: inset 0 0 0 1px rgba(255,255,255,0.35);
    overflow: hidden;
  }
  input[type="color"].color-swatch::-webkit-color-swatch-wrapper { padding: 0; border: none; }
  input[type="color"].color-swatch::-webkit-color-swatch {
    border: none; border-radius: 10px; width: 100%; height: 100%;
  }
  input[type="color"].color-swatch::-moz-color-swatch {
    border: none; border-radius: 10px;
  }
  input[type="color"].color-swatch:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
    outline: none;
  }
  .color-field-meta { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
  .color-field-meta label { margin: 0; }
  .color-hex {
    font-family: var(--mono); font-size: 14px; font-weight: 500;
    padding: 8px 10px; border-radius: 8px; width: 100%;
    text-transform: uppercase; letter-spacing: 0.04em;
  }
  .color-preview-bar {
    grid-column: 1 / -1; height: 10px; border-radius: 999px;
    background: linear-gradient(90deg, var(--color-primary, #111), var(--color-accent, #555));
    box-shadow: inset 0 0 0 1px rgba(0,0,0,0.06);
  }
  /* Settings: mid-size brand colors (between tiny and funnel defaults) */
  #page-settings .color-fields { gap: 14px; }
  #page-settings .color-field {
    gap: 10px; border-radius: 12px; padding: 10px 12px 10px 10px;
  }
  #page-settings input[type="color"].color-swatch {
    width: 36px; height: 36px; min-width: 36px; max-width: 36px;
    border-width: 1px; border-radius: 8px; box-shadow: none;
  }
  #page-settings input[type="color"].color-swatch::-webkit-color-swatch { border-radius: 7px; }
  #page-settings input[type="color"].color-swatch::-moz-color-swatch { border-radius: 7px; }
  #page-settings input[type="color"].color-swatch:focus {
    box-shadow: 0 0 0 3px var(--accent-soft);
  }
  #page-settings .color-field-meta { gap: 6px; }
  #page-settings .color-field-meta label {
    font-size: var(--fs-sm); font-weight: 500; color: var(--muted);
  }
  #page-settings .color-hex {
    font-size: var(--fs-md); padding: 8px 12px; border-radius: 10px;
  }
  #page-settings .color-preview-bar {
    height: 6px; opacity: 0.8; box-shadow: none;
  }
  .file-picker {
    display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  }
  .file-picker-btn {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 10px 14px; font-size: var(--fs-sm); font-weight: 550;
  }
  .file-picker-btn .btn-icon,
  .file-picker-btn svg { width: 16px; height: 16px; flex-shrink: 0; }
  .file-picker-name {
    font-size: var(--fs-sm); color: var(--muted); min-width: 0;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    max-width: min(280px, 100%);
  }
  .file-picker-name.has-file { color: var(--text); font-weight: 500; }
  @media (max-width: 720px) {
    .color-fields { grid-template-columns: 1fr; }
  }

  /* Modal */
  .modal-overlay {
    position: fixed; inset: 0; background: rgba(0,0,0,0.32); z-index: 100;
    display: none; align-items: center; justify-content: center;
    backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  }
  .modal-overlay.open {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 16px;
    animation: fadeIn 0.3s var(--ease) both;
  }
  .modal {
    background: var(--surface); border: 1px solid var(--border); border-radius: 18px;
    width: 520px; max-width: calc(100vw - 32px);
    max-height: calc(100vh - 48px);
    display: flex; flex-direction: column; overflow: hidden;
    padding: 0; box-shadow: var(--shadow);
    animation: modalIn 0.4s var(--ease) both;
  }
  .modal-title { font-size: 24px; font-weight: 700; margin-bottom: 0; flex-shrink: 0; letter-spacing: -0.025em; }
  .modal-header {
    padding: 24px 28px 0; flex-shrink: 0;
    display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
  }
  .modal-header .modal-title { flex: 1; min-width: 0; padding-right: 4px; }
  .modal-close-x {
    flex-shrink: 0; width: 36px; height: 36px; margin: -6px -8px 0 0;
    border: none; border-radius: 50%; background: transparent; color: var(--muted);
    font-size: 26px; line-height: 1; cursor: pointer; font-family: var(--font);
    display: inline-flex; align-items: center; justify-content: center;
    transition: background 0.15s var(--ease), color 0.15s var(--ease);
  }
  .modal-close-x:hover { background: rgba(0,0,0,0.06); color: var(--text); }
  .modal.modal-cover-choice {
    width: 480px; padding: 28px 28px 24px;
  }
  .modal-cover-choice .modal-title { margin-bottom: 8px; }
  .modal-cover-choice .cover-choice-lead {
    font-size: 15px; color: var(--muted); line-height: 1.5; margin: 0 0 24px;
  }
  .cover-choice-list { display: flex; flex-direction: column; gap: 10px; }
  .cover-choice-option {
    display: flex; align-items: flex-start; gap: 14px; width: 100%; text-align: left;
    padding: 16px 18px; border-radius: 14px; border: 1px solid var(--border);
    background: var(--surface); cursor: pointer; font-family: var(--font);
    transition: border-color 0.2s var(--ease), background 0.2s var(--ease), box-shadow 0.2s var(--ease), transform 0.2s var(--ease);
  }
  .cover-choice-option:hover {
    border-color: rgba(0,113,227,0.35); background: var(--accent-soft); box-shadow: var(--shadow);
  }
  .cover-choice-option:active { transform: scale(0.99); }
  .cover-choice-option.primary {
    border-color: transparent; background: var(--accent); color: #fff;
  }
  .cover-choice-option.primary:hover {
    background: var(--accent-hover); border-color: transparent; box-shadow: var(--shadow);
  }
  .cover-choice-option.primary .cover-choice-desc { color: rgba(255,255,255,0.78); }
  .cover-choice-icon {
    width: 40px; height: 40px; border-radius: 10px; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    background: rgba(0,0,0,0.05); color: var(--accent);
  }
  .cover-choice-option.primary .cover-choice-icon {
    background: rgba(255,255,255,0.18); color: #fff;
  }
  .cover-choice-icon svg { width: 20px; height: 20px; }
  .cover-choice-copy { flex: 1; min-width: 0; padding-top: 2px; }
  .cover-choice-label { display: block; font-size: var(--fs-md); font-weight: 600; letter-spacing: -0.01em; margin-bottom: 3px; }
  .cover-choice-desc { display: block; font-size: var(--fs-sm); color: var(--muted); line-height: 1.4; }
  .cover-choice-footer { margin-top: 18px; display: flex; justify-content: flex-end; }
  .modal-body {
    overflow-y: auto;
    padding: 20px 28px;
    flex: 1;
    min-height: 0;
  }
  .modal-actions {
    display: flex; gap: 10px; justify-content: flex-end;
    padding: 16px 28px 24px;
    border-top: 1px solid var(--border);
    flex-shrink: 0;
    margin-top: 0;
    background: var(--surface);
  }
  .kw-suggest-loading { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: var(--fs-sm); padding: 10px 0; }
  .kw-picker { display: flex; flex-direction: column; gap: 12px; }
  .kw-picker > label { margin-bottom: 0; }
  .kw-picker--planned { gap: 10px; }
  .kw-picker--planned > label {
    font-size: 13px; font-weight: 600; letter-spacing: 0.01em; color: var(--text);
  }
  .kw-topic-input {
    font-size: 16px !important; font-weight: 600; line-height: 1.35;
    padding: 14px 16px !important; border-radius: 12px !important;
    border-color: var(--border2) !important;
    background: var(--surface) !important;
    box-shadow: 0 1px 2px rgba(0,0,0,0.04);
  }
  .kw-topic-input:focus {
    border-color: var(--accent) !important;
    box-shadow: 0 0 0 3px var(--accent-soft);
  }
  .kw-topic-hint {
    margin: -4px 0 0;
    font-size: 12px;
    line-height: 1.4;
    color: var(--muted);
  }
  .kw-swap {
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface2);
    overflow: hidden;
  }
  .kw-swap-summary {
    list-style: none; cursor: pointer; user-select: none;
    display: flex; align-items: center; justify-content: space-between; gap: 8px;
    padding: 10px 14px;
    font-size: 13px; font-weight: 500; color: var(--muted);
    transition: color 0.15s, background 0.15s;
  }
  .kw-swap-summary::-webkit-details-marker { display: none; }
  .kw-swap-summary::after {
    content: ''; width: 7px; height: 7px; flex-shrink: 0;
    border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor;
    transform: rotate(45deg); margin-top: -3px;
    transition: transform 0.15s var(--ease);
  }
  .kw-swap[open] > .kw-swap-summary {
    color: var(--text); border-bottom: 1px solid var(--border);
    background: rgba(0,0,0,0.015);
  }
  .kw-swap[open] > .kw-swap-summary::after {
    transform: rotate(-135deg); margin-top: 2px;
  }
  .kw-swap-summary:hover { color: var(--text); }
  .kw-swap-body {
    display: flex; flex-direction: column; gap: 10px;
    padding: 12px 14px 14px;
  }
  .kw-best-btn {
    display: flex; align-items: flex-start; gap: 12px; width: 100%;
    padding: 14px 16px; border-radius: 12px; text-align: left;
    background: var(--accent-soft); border: 1px solid rgba(0,113,227,0.28);
    color: var(--text); cursor: pointer; font-family: var(--font);
    transition: background 0.15s var(--ease), border-color 0.15s var(--ease), transform 0.15s var(--ease), box-shadow 0.15s var(--ease);
  }
  .kw-best-btn--quiet {
    padding: 11px 12px; gap: 10px; border-radius: 10px;
    background: var(--surface); border-color: var(--border2);
  }
  .kw-best-btn--quiet:hover:not(:disabled) {
    background: var(--surface); border-color: var(--accent);
  }
  .kw-best-btn--quiet > svg,
  .kw-best-btn--quiet > i svg { width: 16px; height: 16px; color: var(--muted); }
  .kw-best-btn--quiet .kw-best-title {
    font-size: 11px; font-weight: 600; letter-spacing: 0.04em;
    text-transform: uppercase; color: var(--muted);
  }
  .kw-best-btn--quiet .kw-best-keyword {
    font-size: 13px; font-weight: 550;
  }
  .kw-best-btn--quiet .kw-best-meta {
    font-size: 11px; color: var(--muted); background: var(--surface2);
  }
  .kw-best-btn--quiet.selected {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px var(--accent-soft);
  }
  .kw-best-btn:hover:not(:disabled) {
    background: rgba(0,113,227,0.14); border-color: var(--accent);
  }
  .kw-best-btn.selected {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
  }
  .kw-best-btn:disabled { opacity: 0.55; cursor: not-allowed; }
  .kw-best-btn:active:not(:disabled) { transform: scale(0.99); }
  .kw-best-btn > svg, .kw-best-btn > i svg { width: 22px; height: 22px; color: var(--accent); flex-shrink: 0; margin-top: 2px; }
  .kw-best-copy { display: flex; flex-direction: column; gap: 6px; min-width: 0; flex: 1; }
  .kw-best-title { font-size: var(--fs-sm); font-weight: 600; color: var(--accent); }
  .kw-best-keyword {
    font-size: 15px; font-weight: 600; color: var(--text); line-height: 1.35;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  }
  .kw-best-meta {
    display: inline-flex; align-items: center; gap: 6px; align-self: flex-start;
    font-size: 12px; font-weight: 500; font-family: var(--mono); color: var(--accent);
    background: rgba(0,113,227,0.1); border-radius: 999px; padding: 3px 9px;
  }
  .kw-picker-row {
    display: flex; align-items: center; justify-content: space-between; gap: 8px;
  }
  .kw-picker-label { font-size: var(--fs-sm); font-weight: 500; color: var(--muted); }
  .kw-pills-shell { position: relative; }
  .kw-pills-wrap {
    position: relative;
    max-height: 72px;
    overflow: hidden;
    transition: max-height 0.25s var(--ease);
  }
  .kw-pills-wrap.expanded {
    max-height: 280px; overflow-y: auto;
    padding-bottom: 40px; /* room for Show less outside the scroll */
  }
  .kw-pills-shell.has-more:not(.expanded)::after {
    content: '';
    position: absolute; left: 0; right: 0; bottom: 0; height: 44px;
    background: linear-gradient(180deg, rgba(255,255,255,0), var(--surface) 72%);
    pointer-events: none;
    z-index: 1;
    border-radius: 0 0 8px 8px;
  }
  .kw-swap .kw-pills-shell.has-more:not(.expanded)::after {
    background: linear-gradient(180deg, rgba(239,239,242,0), var(--surface2) 72%);
  }
  .kw-swap .kw-show-all {
    background: var(--surface2);
    box-shadow: none;
  }
  .kw-pills { display: flex; flex-wrap: wrap; gap: 8px; }
  .kw-pill {
    display: inline-flex; align-items: center; gap: 7px;
    max-width: 100%; padding: 8px 12px; border-radius: 999px;
    font-size: 13px; font-weight: 500; font-family: var(--font); line-height: 1.25;
    background: var(--surface2); border: 1px solid var(--border2); color: var(--text);
    cursor: pointer; transition: border-color 0.15s, background 0.15s, color 0.15s;
  }
  .kw-pill:hover { border-color: var(--accent); color: var(--accent); }
  .kw-pill.selected {
    border-color: var(--accent); background: var(--accent-soft); color: var(--accent);
  }
  .kw-pill-text {
    min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 280px;
  }
  .kw-pill-score {
    flex-shrink: 0; font-family: var(--mono); font-size: 11px; color: var(--muted);
  }
  .kw-pill.selected .kw-pill-score { color: var(--accent); }
  /* Toggle sits outside the scroll area, centered over the peek/fade */
  .kw-show-all {
    display: none;
    position: absolute; left: 50%; bottom: 8px; transform: translateX(-50%);
    z-index: 2;
    padding: 5px 12px; border: 1px solid rgba(0,113,227,0.25);
    border-radius: 999px; background: rgba(255,255,255,0.96);
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    font-family: var(--font); font-size: 12px; font-weight: 600; color: var(--accent);
    cursor: pointer; white-space: nowrap;
  }
  .kw-show-all.visible { display: inline-flex; align-items: center; gap: 4px; }
  .kw-pills-shell.expanded .kw-show-all {
    bottom: 10px;
  }
  .kw-selected-banner {
    display: none; align-items: center; gap: 10px;
    padding: 10px 12px; border-radius: 10px;
    background: var(--accent-soft); border: 1px solid rgba(0,113,227,0.22);
  }
  .kw-selected-banner.visible { display: flex; }
  .kw-selected-banner-label {
    font-size: 11px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase;
    color: var(--accent); flex-shrink: 0;
  }
  .kw-selected-banner-text {
    flex: 1; min-width: 0; font-size: 14px; font-weight: 550; color: var(--text);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  }
  .kw-selected-banner-clear {
    border: none; background: transparent; color: var(--muted); cursor: pointer;
    font-size: 18px; line-height: 1; padding: 0 4px;
  }
  .kw-selected-banner-clear:hover { color: var(--text); }
  .kw-picker-or {
    font-size: 11px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase;
    color: var(--muted); margin: 2px 0 0;
  }
  .kw-suggest-empty { font-size: var(--fs-sm); color: var(--muted); padding: 4px 0 0; }
  .mode-toggle { display: flex; gap: 8px; flex-wrap: wrap; }
  #s-cover-style-toggle .mode-option { flex: 1 1 0; min-width: 0; }
  .mode-option {
    flex: 1; padding: 12px 14px; border-radius: 8px; font-size: var(--fs-sm); font-weight: 500;
    background: var(--surface2); border: 1px solid var(--border2); color: var(--muted);
    cursor: pointer; transition: all 0.15s; font-family: var(--font); text-align: left;
  }
  .mode-option:hover { border-color: var(--accent); color: var(--text); }
  .mode-option.active {
    border-color: var(--accent);
    background: var(--accent-soft);
    color: var(--accent);
  }
  .mode-option strong { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-weight: 650; color: inherit; }
  .length-rec {
    font-size: 10px; font-weight: 650; letter-spacing: 0.04em; text-transform: uppercase;
    padding: 2px 7px; border-radius: 999px; background: var(--accent); color: #fff; line-height: 1.4;
  }
  .mode-option small { display: block; margin-top: 4px; font-weight: 400; color: var(--muted); font-size: var(--fs-xs); line-height: 1.35; }
  .mode-option.active small { color: var(--muted); }

  /* CMS picker — WordPress first, with brand marks */
  .cms-picker {
    display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px;
  }
  @media (max-width: 560px) {
    .cms-picker { grid-template-columns: 1fr; }
  }
  .cms-pick {
    position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 10px;
    padding: 14px 14px 12px; border-radius: 14px; text-align: left;
    background: var(--surface); border: 1.5px solid var(--border2); color: var(--text);
    cursor: pointer; font-family: var(--font);
    transition: border-color 0.15s var(--ease), background 0.15s var(--ease), box-shadow 0.15s var(--ease), transform 0.15s var(--ease);
  }
  .cms-pick:hover { border-color: rgba(0,113,227,0.35); background: var(--surface2); }
  .cms-pick.active {
    border-color: var(--accent); background: var(--accent-soft);
    box-shadow: 0 0 0 3px var(--accent-soft);
  }
  .cms-pick.recommended.active { box-shadow: 0 0 0 3px rgba(0,113,227,0.18); }
  .cms-pick-logo {
    width: 36px; height: 36px; border-radius: 10px; display: flex; align-items: center; justify-content: center;
    background: #fff; border: 1px solid var(--border); flex-shrink: 0;
  }
  .cms-pick-logo svg { width: 22px; height: 22px; display: block; }
  .cms-pick-logo img { width: 32px; height: 32px; display: block; object-fit: contain; }
  .cms-pick-copy { min-width: 0; width: 100%; }
  .cms-pick-name { display: block; font-size: 14px; font-weight: 650; letter-spacing: -0.01em; }
  .cms-pick-meta { display: block; margin-top: 2px; font-size: 12px; color: var(--muted); line-height: 1.35; }
  .cms-pick-badge {
    position: absolute; top: 10px; right: 10px;
    font-size: 10px; font-weight: 650; letter-spacing: 0.04em; text-transform: uppercase;
    padding: 3px 7px; border-radius: 999px; background: var(--accent); color: #fff;
  }
  .cms-pick:not(.recommended) .cms-pick-badge { display: none; }
  .field-locked {
    background: var(--surface2) !important; color: var(--muted) !important; cursor: not-allowed;
  }
  .dest-lock-hint { font-size: 12px; color: var(--muted); margin: 6px 0 0; line-height: 1.45; }
  .publisher-badge-row {
    display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
    padding: 0 0 14px;
  }
  .publisher-badge-row .cms-pick-logo { width: 28px; height: 28px; border-radius: 8px; }
  .publisher-badge-row .cms-pick-logo svg { width: 16px; height: 16px; }
  .publisher-badge-row .cms-pick-logo img { width: 24px; height: 24px; }
  .publisher-badge-label { font-weight: 600; color: var(--text); font-size: 14px; }

  /* Featured image */
  .featured-cell { display: flex; align-items: center; gap: 8px; }
  .featured-thumb {
    width: 44px; height: 44px; object-fit: cover; border-radius: 8px;
    border: 1px solid var(--border2); flex-shrink: 0;
  }
  .featured-thumb-clickable {
    cursor: zoom-in;
    transition: border-color 0.15s, box-shadow 0.15s;
  }
  .featured-thumb-clickable:hover {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px var(--accent-soft);
  }
  /* Calendar article modal — wide reading + side controls, single scroll */
  #cal-article-modal .modal.modal-cal-article {
    width: min(560px, calc(100vw - 32px));
  }
  #cal-article-modal .modal.modal-cal-article.has-preview {
    width: min(1080px, calc(100vw - 32px));
  }
  #cal-article-modal .modal-body {
    overscroll-behavior: contain;
  }
  .cal-art-layout {
    display: flex; flex-direction: column; gap: 8px;
  }
  #cal-art-modal-panel.has-preview .cal-art-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(220px, 260px);
    gap: 20px 24px;
    align-items: start;
  }
  .cal-art-reading { display: none; min-width: 0; }
  #cal-art-modal-panel.has-preview .cal-art-reading { display: flex; flex-direction: column; gap: 14px; }
  .cal-art-side {
    min-width: 0;
    display: flex; flex-direction: column; gap: 12px;
  }
  .cal-art-side #cal-art-intro { margin: 0; }
  .cal-art-cover {
    display: none; margin: 0; border-radius: 12px; overflow: hidden;
    border: 1px solid var(--border2); background: var(--surface2);
  }
  .cal-art-cover.visible { display: block; }
  .cal-art-cover img {
    display: block; width: 100%; max-height: 200px; aspect-ratio: 860 / 680;
    object-fit: cover; cursor: zoom-in;
  }
  .cal-art-cover.has-actions:not(.has-image) img { display: none; }
  .cal-art-cover-empty {
    display: flex; align-items: center; justify-content: center;
    aspect-ratio: 860 / 680; max-height: 140px; padding: 16px;
    font-size: 12px; color: var(--muted); background: var(--surface2);
  }
  .cal-art-cover-meta {
    padding: 7px 10px; font-size: 11px; color: var(--muted); line-height: 1.35;
    border-top: 1px solid var(--border);
  }
  .cal-art-cover-actions {
    display: flex; flex-wrap: wrap; gap: 6px;
    padding: 8px 10px 10px; border-top: 1px solid var(--border);
    background: var(--surface);
  }
  .cal-art-cover-actions .btn {
    flex: 1 1 auto; justify-content: center; gap: 6px; min-width: 0;
  }
  .cal-art-cover-actions .btn i svg { width: 13px; height: 13px; }
  .cal-art-cover-actions .btn:disabled { opacity: 0.55; cursor: not-allowed; }
  .btn-danger-ghost { color: var(--danger, #b42318); }
  .btn-danger-ghost:hover:not(:disabled) {
    background: rgba(180, 35, 24, 0.08); color: var(--danger, #b42318);
  }
  .cal-art-preview {
    display: none; margin: 0; border-radius: 14px; overflow: hidden;
    border: 1px solid var(--border2); background: var(--surface);
  }
  .cal-art-preview.visible { display: block; }
  .cal-art-preview-head {
    padding: 16px 18px 14px; border-bottom: 1px solid var(--border);
    background: var(--surface2);
  }
  .cal-art-preview-title {
    font-size: 18px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.3;
    color: var(--text); margin: 0 0 6px;
  }
  .cal-art-preview-meta {
    font-size: 13px; color: var(--muted); line-height: 1.45; margin: 0;
  }
  .cal-art-preview.collapsed .cal-art-preview-meta {
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  }
  /* Article is primary content — start open; collapse still peeks enough to read */
  .cal-art-preview-body {
    position: relative; max-height: 280px; overflow: hidden;
    padding: 16px 18px; background: var(--surface);
  }
  .cal-art-preview.expanded .cal-art-preview-body {
    max-height: none; overflow: visible;
  }
  .cal-art-preview-fade {
    position: absolute; left: 0; right: 0; bottom: 0; height: 64px;
    background: linear-gradient(to bottom, rgba(255,255,255,0), var(--surface) 88%);
    pointer-events: none;
  }
  .cal-art-preview.expanded .cal-art-preview-fade { display: none; }
  .cal-art-preview-content {
    font-size: 14px; line-height: 1.65; color: var(--text);
    max-width: 62ch;
  }
  .cal-art-preview-content :is(h1, h2, h3, h4):not(.seo-brand-cta *, .seo-end-banner *, [class*="seo-callout"] *) {
    font-size: 15px; font-weight: 650; margin: 1.15em 0 0.45em; line-height: 1.35;
    letter-spacing: -0.015em; color: var(--text) !important;
  }
  .cal-art-preview-content p:not(.seo-brand-cta *, .seo-end-banner *, [class*="seo-callout"] *, details *, summary *) {
    margin: 0 0 0.8em; color: var(--text) !important;
  }
  .cal-art-preview-content ul,
  .cal-art-preview-content ol {
    margin: 0 0 0.9em; padding-left: 1.35em; line-height: 1.55;
  }
  .cal-art-preview-content li:not(.seo-brand-cta *, .seo-end-banner *, [class*="seo-callout"] *, nav *, .rank-math-toc *) {
    margin: 0 0 0.4em; color: var(--text) !important;
  }
  .cal-art-preview-content a:not(.seo-brand-cta *, .seo-end-banner *, [class*="seo-callout"] *, nav *, .rank-math-toc *) {
    color: var(--accent) !important; text-decoration: none; font-weight: 500;
  }
  .cal-art-preview-content a:not(.seo-brand-cta *, .seo-end-banner *, [class*="seo-callout"] *, nav *, .rank-math-toc *):hover { text-decoration: underline; }
  .cal-art-preview-content :is(strong, b):not(.seo-brand-cta *, .seo-end-banner *, [class*="seo-callout"] *) {
    color: var(--text) !important; font-weight: 650;
  }
  .cal-art-preview-content img {
    max-width: 100%; height: auto; border-radius: 10px; margin: 0.85em 0;
  }
  /* Keep WP-like chrome for CTA / callouts / TOC / FAQ — only soft-normalize plain tables */
  .cal-art-preview-content table,
  .cal-art-preview-content th,
  .cal-art-preview-content td {
    background: var(--surface2) !important;
    background-image: none !important;
    border-color: var(--border) !important;
    color: var(--text) !important;
    box-shadow: none !important;
  }
  .cal-art-preview-content .seo-brand-cta,
  .cal-art-preview-content .seo-end-banner,
  .cal-art-preview-content [class*="seo-callout"] {
    max-width: none;
    width: 100%;
  }
  .cal-art-preview-content nav ul,
  .cal-art-preview-content .rank-math-toc ul {
    margin: 0; padding-left: 1.2em;
  }
  /* TOC: theme-adaptive tint (matches WP light/dark via currentColor) */
  .cal-art-preview-content .rank-math-toc {
    background: color-mix(in srgb, currentColor 8%, transparent) !important;
    border: 1px solid color-mix(in srgb, currentColor 18%, transparent) !important;
    color: inherit !important;
  }
  .cal-art-preview-content .rank-math-toc li {
    color: inherit !important;
  }
  .cal-art-preview-content .rank-math-toc a {
    color: inherit !important;
    text-decoration: underline;
    text-underline-offset: 2px;
    font-weight: 500;
  }
  .cal-art-preview-content .rank-math-toc a:hover {
    opacity: 0.8;
  }
  .cal-art-preview-content table {
    width: 100%; border-collapse: collapse; font-size: 13px;
  }
  .cal-art-preview-content th,
  .cal-art-preview-content td {
    border: 1px solid var(--border) !important;
    padding: 8px 10px !important;
  }
  .cal-art-preview-content th { font-weight: 600; background: rgba(0,0,0,0.03) !important; }
  .cal-art-preview-actions {
    display: flex; gap: 8px; justify-content: flex-start; flex-wrap: wrap;
    padding: 10px 14px; border-top: 1px solid var(--border); background: var(--surface2);
  }
  @media (max-width: 860px) {
    #cal-art-modal-panel.has-preview .cal-art-layout {
      grid-template-columns: 1fr;
      gap: 18px;
    }
  }
  .featured-placeholder {
    width: 44px; height: 44px; border-radius: 8px; border: 1px dashed var(--border2);
    display: flex; align-items: center; justify-content: center; color: var(--muted);
    font-size: var(--fs-xs); flex-shrink: 0;
  }

  /* Featured cover full-size preview */
  .modal.modal-featured-full {
    width: auto; max-width: calc(100vw - 32px); padding: 0;
  }
  .featured-full-header {
    padding: 16px 20px; border-bottom: 1px solid var(--border);
    display: flex; justify-content: space-between; align-items: center; gap: 16px;
    flex-shrink: 0;
  }
  .featured-full-meta { font-size: var(--fs-sm); color: var(--muted); margin-top: 4px; }
  .featured-full-body {
    padding: 0; background: var(--surface2); overflow: hidden;
    display: flex; justify-content: center; align-items: center;
  }
  .featured-full-img {
    display: block; max-width: 100%; width: auto; height: auto;
    object-fit: contain; image-rendering: auto;
  }

  /* Article preview modal */
  .modal.modal-preview {
    width: 700px; padding: 0; display: flex; flex-direction: column;
    max-height: 90vh; max-width: calc(100vw - 32px);
  }
  .preview-header {
    padding: 24px 28px 16px; border-bottom: 1px solid var(--border);
    position: relative; flex-shrink: 0;
  }
  .preview-header-badge { position: absolute; top: 24px; right: 28px; }
  .preview-title {
    font-size: 24px; font-weight: 700; line-height: 1.35;
    padding-right: 130px; color: var(--text);
  }
  .preview-meta { font-size: var(--fs-sm); color: var(--muted); margin-top: 10px; line-height: 1.5; }
  .preview-body {
    padding: 24px 28px; overflow-y: auto; max-height: 70vh; flex: 1;
    background: var(--surface);
  }
  .preview-content { color: var(--text); font-size: var(--fs-md); }
  .preview-content :is(h1, h2, h3, h4):not(.seo-brand-cta *, .seo-end-banner *, [class*="seo-callout"] *) {
    color: var(--text) !important; margin: 1.4em 0 0.6em; line-height: 1.3; letter-spacing: -0.02em;
  }
  .preview-content h2:not(.seo-brand-cta *, .seo-end-banner *, [class*="seo-callout"] *) { font-size: 1.35em; }
  .preview-content h3:not(.seo-brand-cta *, .seo-end-banner *, [class*="seo-callout"] *) { font-size: 1.15em; }
  .preview-content p:not(.seo-brand-cta *, .seo-end-banner *, [class*="seo-callout"] *, details *, summary *) {
    margin-bottom: 1em; line-height: 1.7; color: var(--text) !important;
  }
  .preview-content ul, .preview-content ol { margin: 0 0 1em 1.25em; padding-left: 0.25em; line-height: 1.7; }
  .preview-content li:not(.seo-brand-cta *, .seo-end-banner *, [class*="seo-callout"] *, nav *, .rank-math-toc *) {
    margin-bottom: 0.35em; color: var(--text) !important;
  }
  .preview-content a:not(.seo-brand-cta *, .seo-end-banner *, [class*="seo-callout"] *, nav *, .rank-math-toc *) {
    color: var(--accent) !important; text-decoration: none; font-weight: 500;
  }
  .preview-content a:not(.seo-brand-cta *, .seo-end-banner *, [class*="seo-callout"] *, nav *, .rank-math-toc *):hover { text-decoration: underline; }
  .preview-content strong:not(.seo-brand-cta *, .seo-end-banner *, [class*="seo-callout"] *) { color: var(--text) !important; }
  .preview-content blockquote {
    border-left: 3px solid var(--accent); padding-left: 14px; margin: 1em 0;
    color: var(--muted);
  }
  /* Keep WP-like chrome for CTA / callouts / TOC / FAQ — only soft-normalize plain tables */
  .preview-content table,
  .preview-content th,
  .preview-content td {
    background: var(--surface2) !important;
    background-image: none !important;
    border-color: var(--border) !important;
    color: var(--text) !important;
    box-shadow: none !important;
  }
  .preview-content .seo-brand-cta,
  .preview-content .seo-end-banner,
  .preview-content [class*="seo-callout"] {
    max-width: none;
  }
  /* TOC: theme-adaptive tint (matches WP light/dark via currentColor) */
  .preview-content .rank-math-toc {
    background: color-mix(in srgb, currentColor 8%, transparent) !important;
    border: 1px solid color-mix(in srgb, currentColor 18%, transparent) !important;
    color: inherit !important;
  }
  .preview-content .rank-math-toc li {
    color: inherit !important;
  }
  .preview-content .rank-math-toc a {
    color: inherit !important;
    text-decoration: underline;
    text-underline-offset: 2px;
    font-weight: 500;
  }
  .preview-content .rank-math-toc a:hover {
    opacity: 0.8;
  }
  .preview-content .seo-pexels-figure,
  .cal-art-preview-content .seo-pexels-figure {
    margin: 1.1em 0;
    max-width: 480px;
  }
  .preview-content .seo-pexels-credit,
  .preview-content .seo-pexels-attribution,
  .cal-art-preview-content .seo-pexels-credit,
  .cal-art-preview-content .seo-pexels-attribution {
    font-size: 12px !important;
    color: var(--muted) !important;
    line-height: 1.4;
  }
  .preview-content .seo-pexels-credit a,
  .preview-content .seo-pexels-attribution a,
  .cal-art-preview-content .seo-pexels-credit a,
  .cal-art-preview-content .seo-pexels-attribution a {
    color: var(--accent) !important;
    font-weight: 500;
  }
  .preview-content table { width: 100%; border-collapse: collapse; }
  .preview-content th,
  .preview-content td {
    border: 1px solid var(--border) !important;
    padding: 10px 12px !important;
  }
  .preview-content th { font-weight: 600; background: rgba(0,0,0,0.03) !important; }
  .preview-footer {
    padding: 16px 28px 24px; border-top: 1px solid var(--border);
    display: flex; gap: 10px; justify-content: flex-end; flex-shrink: 0;
  }
  .article-title-link {
    background: none; border: none; padding: 0; font-size: var(--fs-sm); color: var(--accent);
    cursor: pointer; text-align: left; max-width: 220px; overflow: hidden;
    text-overflow: ellipsis; white-space: nowrap; display: block; font-family: var(--font);
  }
  .article-title-link:hover { color: var(--accent); text-decoration: underline; }

  /* Toast — high-visibility status banner (base; polished below) */
  .toast {
    position: fixed; z-index: 500;
    display: none; align-items: center;
    pointer-events: none; opacity: 0;
  }
  .toast.show { display: flex; opacity: 1; pointer-events: auto; }

  .empty-state { text-align: center; padding: 60px 20px; color: var(--muted); }
  .empty-icon { font-size: 40px; margin-bottom: 12px; }
  .empty-text { font-size: var(--fs-md); }
  .spinner { width: 18px; height: 18px; border: 2px solid var(--border2); border-top-color: var(--accent); border-radius: 50%; animation: spin 0.7s linear infinite; display: inline-block; }
  @keyframes spin { to { transform: rotate(360deg); } }
  
  .nav-icon, .btn-icon, .empty-icon svg { width: 18px; height: 18px; flex-shrink: 0; stroke: currentColor; }
  .sidebar-brand { padding: 0 22px 16px; }
  .brand-name { font-size: 1.05rem; font-weight: 700; color: var(--text); letter-spacing: -0.03em; }
  .brand-name span { color: var(--accent); }
  .logo-tag { font-size: var(--fs-xs); color: var(--muted); font-weight: 500; margin-top: 2px; }
  .site-switcher { position: relative; margin: 0 10px 14px; }
  .site-switcher-btn {
    width: 100%; display: flex; align-items: center; gap: 10px; text-align: left;
    padding: 10px 12px; border-radius: 12px; border: 1px solid var(--border);
    background: var(--bg); color: var(--text); cursor: pointer; font: inherit;
    transition: border-color 0.15s var(--ease), background 0.15s var(--ease);
  }
  .site-switcher-btn:hover { border-color: var(--border2); background: var(--surface2); }
  .site-switcher-btn .site-switcher-meta { flex: 1; min-width: 0; }
  .site-switcher-label {
    font-size: var(--fs-sm); font-weight: 600; letter-spacing: -0.01em;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  .site-switcher-host {
    font-size: 11px; color: var(--muted); margin-top: 2px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  .site-switcher-chevron { flex-shrink: 0; opacity: 0.55; }
  .site-switcher-menu {
    display: none; position: absolute; left: 0; right: 0; top: calc(100% + 6px);
    z-index: 40; background: var(--surface); border: 1px solid var(--border);
    border-radius: 12px; box-shadow: var(--shadow); padding: 6px; max-height: 280px; overflow: auto;
  }
  .site-switcher.open .site-switcher-menu { display: block; }
  .site-menu-item {
    display: flex; align-items: center; gap: 8px; width: 100%; text-align: left;
    padding: 9px 10px; border: none; border-radius: 8px; background: transparent;
    color: var(--text); font: inherit; font-size: var(--fs-sm); cursor: pointer;
  }
  .site-menu-item:hover { background: rgba(0,0,0,0.04); }
  .site-menu-item.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
  .site-menu-item .site-menu-host { display: block; font-size: 11px; color: var(--muted); font-weight: 400; margin-top: 1px; }
  .site-menu-add {
    display: flex; align-items: center; gap: 8px; width: 100%; text-align: left;
    padding: 9px 10px; margin-top: 4px; border: none; border-top: 1px solid var(--border);
    border-radius: 0 0 8px 8px; background: transparent; color: var(--accent);
    font: inherit; font-size: var(--fs-sm); font-weight: 600; cursor: pointer;
  }
  .site-menu-add:hover { background: var(--accent-soft); }
  .sidebar-footer { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--border); }
  .sidebar nav { flex: 1; min-height: 0; }
  @keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }
  @keyframes enter {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
  }
  @keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
  }
  @keyframes modalIn {
    from { opacity: 0; transform: scale(0.97); }
    to { opacity: 1; transform: scale(1); }
  }
  @media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
      animation-duration: 0.01ms !important;
      animation-iteration-count: 1 !important;
      transition-duration: 0.01ms !important;
    }
  }
  #app-shell, #admin-shell { display: none; }
  #app-shell.visible, #admin-shell.visible { display: grid; animation: enter 0.45s var(--ease) both; }
  #gate, #wizard { display: none; min-height: 100vh; }
  #gate.visible, #wizard.visible { display: block; animation: enter 0.45s var(--ease) both; }
  .funnel { max-width: 720px; margin: 0 auto; padding: 64px 20px 72px; }
  .funnel-wide { max-width: 880px; }
  .funnel .logo-mark {
    margin-bottom: 36px; font-size: clamp(28px, 5vw, 40px); font-weight: 700;
    letter-spacing: -0.035em; color: var(--text);
  }
  .funnel h1 { font-size: clamp(28px, 4.5vw, 40px); letter-spacing: -0.03em; line-height: 1.12; margin: 0 0 14px; font-weight: 700; }
  .funnel .lead { color: var(--muted); font-size: 17px; line-height: 1.55; max-width: 520px; margin: 0 0 28px; }
  .url-row { display: flex; gap: 10px; flex-wrap: wrap; }
  .url-row input {
    flex: 1; min-width: 220px; padding: 16px 18px; border-radius: 14px;
    border: 1px solid var(--border2); background: var(--surface); color: var(--text);
    font: inherit; font-size: 16px; box-shadow: var(--shadow);
  }
  .url-row input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
  .url-row .btn { padding: 16px 26px; font-size: 15px; }
  .micro { font-size: 13px; color: var(--muted); margin-top: 14px; }
  .trust-row { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 36px; font-size: 12px; color: var(--muted); }
  .trust-row span { display: inline-flex; align-items: center; gap: 6px; }
  .auth-card {
    background: var(--surface); border: 1px solid var(--border); border-radius: 18px;
    padding: 28px; max-width: 400px; box-shadow: var(--shadow);
  }
  .auth-card h2 { margin-bottom: 16px; font-size: 20px; letter-spacing: -0.02em; }
  .auth-card .auth-terms {
    display: flex; align-items: flex-start; gap: 10px;
    margin: 0 0 16px; font-size: 13px; color: var(--muted); line-height: 1.45;
    width: 100%; max-width: 100%;
  }
  .auth-card .auth-terms[hidden] { display: none !important; }
  .auth-card .auth-terms input { margin-top: 3px; }
  .auth-card .auth-terms span { flex: 1; min-width: 0; }
  .auth-card .auth-terms a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
  .auth-toggle { font-size: 13px; color: var(--muted); margin-top: 14px; }
  .auth-toggle button { background: none; border: none; color: var(--accent); cursor: pointer; font: inherit; font-weight: 500; }
  .wizard-wrap { max-width: 640px; margin: 48px auto; padding: 0 20px; }
  .wiz-sheet-top {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    margin: 0 0 8px;
  }
  .wiz-sheet-top .logo-mark { margin: 0; }
  .wiz-sheet-top .logo-mark a { display: inline-flex; align-items: center; gap: 8px; }
  .wiz-sheet-top .logo-mark img { height: 36px; width: auto; display: block; }
  .wiz-sheet-top .btn-sm { flex-shrink: 0; }

  /* /connect — real #app-shell behind, reconnect sheet on top */
  body.route-connect #app-shell.visible.connect-backdrop {
    display: grid;
    position: fixed; inset: 0; z-index: 0;
    filter: blur(6.5px);
    transform: scale(1.01);
    pointer-events: none;
    user-select: none;
    animation: none;
  }
  body.route-connect #wizard.visible {
    display: flex; align-items: center; justify-content: center;
    position: fixed; inset: 0; z-index: 40;
    padding: 24px 16px; box-sizing: border-box;
    overflow: auto;
    background: rgba(20, 20, 24, 0.38);
    animation: none;
  }
  body.route-connect .wizard-wrap {
    position: relative; z-index: 1;
    width: 100%; max-width: 720px;
    margin: auto;
    padding: 28px 32px 32px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-xl, 18px);
    box-shadow: var(--shadow-lg);
    max-height: calc(100vh - 48px);
    overflow: auto;
  }
  body.route-connect .wizard-wrap .funnel-progress { margin-bottom: 28px; }
  @media (max-width: 720px) {
    body.route-connect .wizard-wrap { padding: 22px 18px 26px; margin: 12px auto; }
  }

  /* /onboarding uses the same shell as /login */
  body.route-connect #wiz-auth-top,
  body.route-connect #wiz-auth-foot,
  body.route-connect #wiz-proof,
  body.route-connect #wiz-back { display: none !important; }
  body.route-connect #wiz-auth-main,
  body.route-connect #wiz-stage { display: contents; }
  body.route-connect .wiz-onb-card {
    max-width: none; width: auto; margin: 0; padding: 0;
    background: transparent; border: none; border-radius: 0; box-shadow: none;
  }
  body.route-connect .wiz-onb-card .auth-card-icon { display: none; }
  body.route-connect .wiz-onb-card .auth-card-head { text-align: left; margin-bottom: 8px; }
  body.route-connect .wiz-onb-card .auth-card-head p { margin: 8px 0 14px; font-size: 14px; color: var(--accent); font-weight: 500; }

  body.route-onboarding #wizard.visible {
    display: flex; flex-direction: column;
    min-height: 100vh; padding: 0;
    background: #f8f9ff; color: #0b1c30;
    font-family: "Plus Jakarta Sans", var(--font);
    animation: enter 0.45s var(--ease) both;
  }
  body.route-onboarding #wiz-auth-main { flex: 1; }
  body.route-onboarding #wiz-stage { max-width: 440px; }
  body.route-onboarding #wizard:has(#wiz-cms:not([hidden])) #wiz-stage,
  body.route-onboarding #wizard:has(#wiz-brand:not([hidden])) #wiz-stage { max-width: 680px; }
  body.route-onboarding .wizard-wrap {
    max-width: none; margin: 0; padding: 0; background: transparent;
  }
  body.route-onboarding .wiz-sheet-top { display: none; }
  body.route-onboarding .wizard-wrap .funnel-progress { margin: 0 0 22px; }
  body.route-onboarding .wiz-onb-card {
    max-width: none; width: 100%; margin: 0;
    background: #fff;
    border: 1px solid rgba(195, 198, 215, 0.45);
    border-radius: 12px;
    padding: 28px 28px 22px;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04), 0 1px 2px rgba(15, 23, 42, 0.04);
    text-align: left;
  }
  body.route-onboarding .wiz-onb-card h1 {
    font-size: 22px; line-height: 28px; letter-spacing: -0.02em;
    font-weight: 700; margin: 0; color: #0b1c30;
  }
  body.route-onboarding .wiz-onb-card .auth-card-head p {
    margin: 6px 0 0; font-size: 13px; line-height: 1.45; color: #434655; font-weight: 400;
  }
  body.route-onboarding .wiz-onb-card .form-group { margin-bottom: 14px; }
  body.route-onboarding .wiz-onb-card label {
    font-size: 12px; font-weight: 600; color: #0b1c30;
  }
  body.route-onboarding .funnel-progress .fp-dot { border-color: #f8f9ff; }
  body.route-onboarding .wiz-onb-card input:not([type="color"]):not([type="checkbox"]):not([type="radio"]),
  body.route-onboarding .wiz-onb-card select,
  body.route-onboarding .wiz-onb-card textarea {
    width: 100%; border-radius: 8px;
    border: 1px solid rgba(195, 198, 215, 0.85);
    font-size: 14px; font-family: inherit; color: #0b1c30; background: #fff;
  }
  body.route-onboarding .wiz-onb-card input:not([type="color"]):not([type="checkbox"]):not([type="radio"]) {
    height: 38px; padding: 0 12px;
  }
  body.route-onboarding .wiz-onb-card textarea { height: auto; padding: 10px 12px; }
  body.route-onboarding .wiz-onb-card .auth-field input { height: 38px; padding: 0 40px 0 12px; }
  body.route-onboarding .cms-pick {
    border-radius: 12px;
    border: 1px solid rgba(195, 198, 215, 0.7);
    background: #fff;
    box-shadow: none;
  }
  body.route-onboarding .cms-pick.active {
    border-color: #2563eb;
    background: #eff4ff;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
  }
  body.route-onboarding .help-guide-link {
    border-radius: 8px;
    border-color: rgba(195, 198, 215, 0.7);
    background: #fff;
    color: #004ac6;
    font-size: 13px;
    font-weight: 600;
  }
  body.route-onboarding .brand-edit {
    background: #f8f9ff;
    border: 1px solid rgba(195, 198, 215, 0.45);
    border-radius: 12px;
    box-shadow: none;
  }
  body.route-onboarding .wiz-onb-card input:focus:not([type="radio"]):not([type="checkbox"]),
  body.route-onboarding .wiz-onb-card select:focus,
  body.route-onboarding .wiz-onb-card textarea:focus {
    outline: none; border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.16);
  }
  body.route-onboarding .wiz-onb-card .auth-submit {
    width: 100%; height: 40px; margin-top: 6px;
    border-radius: 8px; padding: 0 16px;
    background: #2563eb; font-size: 14px; font-weight: 600;
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    box-shadow: 0 1px 2px rgba(37, 99, 235, 0.25);
  }
  body.route-onboarding .wiz-onb-card .auth-submit:hover { background: #004ac6; }
  body.route-onboarding .wiz-onb-card .auth-submit .material-symbols-outlined { font-size: 18px; }
  body.route-onboarding .wiz-onb-card .micro { color: #434655; }
  @media (max-width: 640px) {
    body.route-onboarding .wiz-onb-card { padding: 22px 18px 18px; }
  }

  /* Choose + loading use the same shell as the scan step */
  #gate:has(#gate-results.active),
  #gate:has(#gate-loading.active) { background: #f8f9ff; }
  .reg-step {
    min-height: 100vh;
    background: #f8f9ff;
    color: #0b1c30;
    font-family: "Plus Jakarta Sans", var(--font);
  }
  #gate-loading.reg-step.active,
  #gate-results.reg-step.active {
    display: flex;
    flex-direction: column;
  }
  .reg-step .auth-main { flex: 1; }
  .reg-step .reg-stage-wide { max-width: 680px; }
  .reg-step .funnel-progress { margin: 0 0 22px; }
  .reg-step .funnel-progress .fp-dot { border-color: #f8f9ff; }
  .reg-step .wiz-onb-card {
    max-width: none; width: 100%; margin: 0;
    background: #fff;
    border: 1px solid rgba(195, 198, 215, 0.45);
    border-radius: 12px;
    padding: 28px 28px 22px;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04), 0 1px 2px rgba(15, 23, 42, 0.04);
    text-align: left;
  }
  .reg-step .wiz-onb-card h1 {
    font-size: 22px; line-height: 28px; letter-spacing: -0.02em;
    font-weight: 700; margin: 0; color: #0b1c30;
  }
  .reg-step .wiz-onb-card .auth-card-head p,
  .reg-step .reg-hook,
  .reg-step .fomo-urgency {
    margin: 6px 0 0; font-size: 13px; line-height: 1.45; color: #434655; font-weight: 400;
  }
  .reg-step .reg-hook { margin: 0 0 16px; }
  .reg-step .reg-section-label {
    margin: 18px 0 4px; font-size: 14px; font-weight: 700; color: #0b1c30; letter-spacing: -0.02em;
  }
  .reg-step .wiz-onb-card .form-group { margin-bottom: 14px; }
  .reg-step .wiz-onb-card label { font-size: 12px; font-weight: 600; color: #0b1c30; }
  .reg-step .wiz-onb-card input:not([type="color"]):not([type="checkbox"]):not([type="radio"]),
  .reg-step .wiz-onb-card select,
  .reg-step .wiz-onb-card textarea {
    width: 100%; border-radius: 8px;
    border: 1px solid rgba(195, 198, 215, 0.85);
    font-size: 14px; font-family: inherit; color: #0b1c30; background: #fff;
  }
  .reg-step .wiz-onb-card input:not([type="color"]):not([type="checkbox"]):not([type="radio"]),
  .reg-step .wiz-onb-card select { height: 38px; padding: 0 12px; }
  .reg-step .wiz-onb-card textarea { height: auto; padding: 10px 12px; }
  .reg-step .wiz-onb-card input:focus:not([type="radio"]):not([type="checkbox"]),
  .reg-step .wiz-onb-card select:focus,
  .reg-step .wiz-onb-card textarea:focus {
    outline: none; border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.16);
  }
  .fomo-card input[type="radio"] {
    width: 16px; height: 16px; min-width: 16px; max-width: 16px;
    margin: 3px 0 0; padding: 0;
    border: none; border-radius: 50%;
    outline: none; box-shadow: none;
    justify-self: start; align-self: start;
    accent-color: var(--accent);
  }
  .fomo-card input[type="radio"]:focus,
  .fomo-card input[type="radio"]:focus-visible {
    outline: none; box-shadow: none; border: none;
  }
  .reg-step .brand-edit {
    background: #f8f9ff;
    border: 1px solid rgba(195, 198, 215, 0.45);
    border-radius: 12px;
    box-shadow: none;
  }
  .reg-step .fomo-card {
    background: #fff;
    border: 1px solid rgba(195, 198, 215, 0.7);
    border-radius: 12px;
    box-shadow: none;
  }
  .reg-step .fomo-card:hover,
  .reg-step .fomo-card.selected {
    border-color: #2563eb;
    background: #eff4ff;
    box-shadow: none;
  }
  .reg-step .auth-submit {
    width: 100%; height: 40px; margin-top: 6px;
    border-radius: 8px; padding: 0 16px;
    background: #2563eb; font-size: 14px; font-weight: 600;
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    box-shadow: 0 1px 2px rgba(37, 99, 235, 0.25);
  }
  .reg-step .auth-submit:hover { background: #004ac6; }
  .reg-step .auth-submit .material-symbols-outlined { font-size: 18px; }
  .reg-step .auth-toggle { text-align: center; }
  .reg-step .claim-existing-note { max-width: none; }
  .reg-step .claim-existing-note a { color: #004ac6; font-weight: 600; }
  @media (max-width: 640px) {
    .reg-step .wiz-onb-card { padding: 22px 18px 18px; }
    .reg-step .form-grid,
    .reg-step .color-fields { grid-template-columns: 1fr; }
  }
  .steps { display: flex; gap: 8px; margin-bottom: 24px; }
  .step { flex: 1; height: 4px; background: var(--surface2); border-radius: 4px; }
  .step.on { background: var(--accent); }
  .help-steps { font-size: 13px; color: var(--muted); line-height: 1.6; margin: 0 0 16px; padding-left: 18px; }
  .help-guide-link {
    display: inline-flex; align-items: center; gap: 8px;
    margin: 0 0 16px; padding: 10px 14px;
    border: 1px solid var(--border2); border-radius: 12px;
    background: var(--surface); color: var(--accent);
    font: inherit; font-size: 14px; font-weight: 500; cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease;
  }
  .help-guide-link:hover { background: var(--accent-soft); border-color: var(--accent); }
  .help-guide-link svg, .help-guide-link i { width: 18px; height: 18px; flex-shrink: 0; }
  .label-with-help {
    display: inline-flex; align-items: center; gap: 4px;
  }
  .indexnow-key-row {
    display: flex; gap: 8px; align-items: stretch;
  }
  .indexnow-key-row input { flex: 1; min-width: 0; }
  .indexnow-key-row .btn { flex-shrink: 0; white-space: nowrap; }
  .help-icon-btn {
    width: 28px; height: 28px; padding: 0; border: none; border-radius: 999px;
    background: transparent; color: var(--accent); cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
  }
  .help-icon-btn:hover { background: var(--accent-soft); }
  .help-icon-btn svg, .help-icon-btn i { width: 18px; height: 18px; }
  .help-page-toolbar { margin: 0 0 18px; max-width: 920px; }
  .help-search-wrap {
    display: flex; align-items: center; gap: 10px;
    max-width: 420px; padding: 0 12px;
    border: 1px solid var(--border2); border-radius: 12px; background: var(--surface);
  }
  .help-search-wrap:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
  .help-search-wrap svg { width: 16px; height: 16px; color: var(--muted); flex-shrink: 0; }
  .help-search-wrap input {
    border: none !important; box-shadow: none !important; background: transparent !important;
    padding: 11px 0 !important; margin: 0; width: 100%;
  }
  .help-page-hint { margin: 10px 0 0; font-size: 13px; color: var(--muted); line-height: 1.45; }
  .help-guide-list {
    display: grid; gap: 14px; max-width: 920px;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  }
  .help-guide-card {
    display: flex; flex-direction: column; align-items: flex-start; gap: 8px;
    width: 100%; text-align: left; cursor: pointer; font: inherit;
    padding: 18px 18px 14px; border-radius: 16px; min-height: 100%;
    border: 1px solid var(--border2); background: var(--surface); color: var(--text);
    transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
  }
  .help-guide-card:hover {
    border-color: rgba(0,113,227,0.35); box-shadow: var(--shadow);
    transform: translateY(-1px);
  }
  .help-guide-card[hidden] { display: none; }
  .help-guide-card-top {
    display: flex; align-items: center; justify-content: space-between;
    width: 100%; gap: 10px;
  }
  .help-guide-card-logo {
    width: 40px; height: 40px; border-radius: 10px;
    background: var(--surface2); display: inline-flex; align-items: center; justify-content: center;
  }
  .help-guide-card-logo svg { width: 24px; height: 24px; }
  .help-guide-card-logo img { width: 34px; height: 34px; object-fit: contain; display: block; }
  .help-badge {
    font-size: 11px; font-weight: 650; letter-spacing: 0.02em;
    padding: 3px 8px; border-radius: 999px;
    background: rgba(0,0,0,0.06); color: var(--muted);
  }
  .help-badge.recommended { background: var(--accent-soft); color: var(--accent); }
  .help-guide-card-title { font-weight: 700; font-size: 16px; letter-spacing: -0.02em; }
  .help-guide-card-summary { font-size: 13px; color: var(--muted); line-height: 1.5; flex: 1; }
  .help-guide-card-foot {
    display: flex; align-items: center; justify-content: space-between;
    width: 100%; gap: 10px; margin-top: 4px; padding-top: 10px;
    border-top: 1px solid var(--border);
  }
  .help-guide-card-time {
    display: inline-flex; align-items: center; gap: 5px;
    font-size: 12px; color: var(--muted);
  }
  .help-guide-card-time svg { width: 13px; height: 13px; }
  .help-guide-card-cta {
    display: inline-flex; align-items: center; gap: 4px;
    font-size: 13px; font-weight: 600; color: var(--accent);
  }
  .help-guide-card-cta svg { width: 14px; height: 14px; }
  .help-drawer[hidden] { display: none; }
  .help-drawer { position: fixed; inset: 0; z-index: 400; }
  .help-drawer-backdrop {
    position: absolute; inset: 0; border: none; padding: 0;
    background: rgba(0,0,0,0.32); cursor: pointer;
  }
  .help-drawer-panel {
    position: absolute; top: 0; right: 0; bottom: 0;
    width: min(480px, 100vw); background: var(--surface);
    border-left: 1px solid var(--border); box-shadow: var(--shadow);
    display: flex; flex-direction: column;
    animation: enter 0.28s var(--ease) both;
  }
  .help-drawer-head {
    display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
    padding: 18px 18px 14px; border-bottom: 1px solid var(--border);
  }
  .help-drawer-brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
  .help-drawer-logo {
    width: 42px; height: 42px; border-radius: 12px; flex-shrink: 0;
    background: var(--surface2); display: inline-flex; align-items: center; justify-content: center;
  }
  .help-drawer-logo svg { width: 24px; height: 24px; }
  .help-drawer-logo img { width: 36px; height: 36px; object-fit: contain; display: block; }
  .help-drawer-title { margin: 0; font-size: 18px; letter-spacing: -0.02em; }
  .help-drawer-meta { margin: 3px 0 0; font-size: 12px; color: var(--muted); }
  .help-drawer-body { padding: 16px 20px 32px; overflow: auto; }
  .help-drawer-goal {
    margin: 0 0 18px; font-size: 14px; line-height: 1.55; color: var(--text);
    padding: 12px 14px; border-radius: 12px; background: var(--surface2);
  }
  .help-drawer-sub {
    margin: 4px 0 10px; font-size: 12px; font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted);
  }
  .help-drawer-steps {
    list-style: none; margin: 0 0 20px; padding: 0;
  }
  .help-drawer-steps li {
    display: flex; gap: 12px; align-items: flex-start;
    margin: 0 0 12px; font-size: 14px; line-height: 1.5;
  }
  .help-step-num {
    flex-shrink: 0; width: 24px; height: 24px; border-radius: 999px;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 12px; font-weight: 700; background: var(--accent-soft); color: var(--accent);
  }
  .help-step-text { padding-top: 2px; }
  .help-drawer-paste {
    margin: 0 0 20px; padding: 14px; border-radius: 14px;
    border: 1px solid var(--border2); background: var(--surface2);
  }
  .help-drawer-paste .help-drawer-sub { margin-top: 0; }
  .help-paste-list { margin: 0; }
  .help-paste-row {
    display: grid; gap: 2px; padding: 10px 0;
    border-top: 1px solid var(--border);
  }
  .help-paste-row:first-child { border-top: none; padding-top: 0; }
  .help-paste-row dt { font-size: 13px; font-weight: 650; }
  .help-paste-row dd { margin: 0; font-size: 13px; color: var(--muted); line-height: 1.45; }
  .help-drawer-trouble { display: grid; gap: 8px; margin: 0 0 8px; }
  .help-trouble-card {
    padding: 12px 14px; border-radius: 12px;
    border: 1px solid var(--border2); background: var(--surface);
  }
  .help-trouble-card strong {
    display: block; font-size: 13px; margin-bottom: 4px;
  }
  .help-trouble-card p {
    margin: 0; font-size: 13px; line-height: 1.5; color: var(--muted);
  }
  .help-drawer-steps code, .help-drawer-goal code,
  .help-paste-row code, .help-trouble-card code {
    font-family: var(--mono); font-size: 12px;
    background: var(--surface2); padding: 1px 5px; border-radius: 4px;
  }
  .add-site-modal .modal {
    width: 680px;
    max-width: calc(100vw - 32px);
  }
  .add-site-steps { display: none; }
  .add-site-steps.active { display: block; }
  .add-site-scan-skel {
    display: grid; grid-template-columns: 1fr 1fr; gap: 16px;
    pointer-events: none; user-select: none;
  }
  .add-site-scan-skel .skel-field { display: flex; flex-direction: column; gap: 8px; }
  .add-site-scan-skel .skel-field.full { grid-column: 1 / -1; }
  .add-site-scan-skel .skel-label {
    height: 11px; width: 38%; border-radius: 6px;
  }
  .add-site-scan-skel .skel-input {
    height: 42px; width: 100%; border-radius: 10px;
  }
  .add-site-scan-skel .skel-input.tall { height: 88px; }
  .add-site-scan-skel .skel-label.w28 { width: 28%; }
  .add-site-scan-skel .skel-label.w52 { width: 52%; }
  .add-site-scan-status {
    display: flex; align-items: center; gap: 10px;
    margin: 0 0 16px; font-size: 13px; color: var(--muted); line-height: 1.45;
  }
  .add-site-scan-status .skel {
    width: 14px; height: 14px; border-radius: 50%; flex-shrink: 0;
  }
  .legal-links { margin-top: 28px; font-size: 12px; color: var(--muted); }
  .legal-links a { color: var(--muted); }
  .analyze-box { text-align: center; padding: 48px 16px; }
  .analyze-box .spinner { width: 28px; height: 28px; margin: 0 auto 18px; }
  .analyze-status { color: var(--muted); font-size: 14px; min-height: 1.4em; }
  .analyze-status.scan-status-in { animation: scanStatus .4s var(--ease); }
  .scan-journey { margin-top: 8px; position: relative; }
  .scan-step:not(:last-child)::after {
    content: ''; position: absolute; left: 13px; top: 37px; bottom: -8px; width: 2px;
    background: #e4e7f0; z-index: 0;
  }
  .scan-step.done:not(:last-child)::after { background: #2563eb; }
  .scan-steps { list-style: none; margin: 18px 0 0; padding: 0; display: grid; }
  .scan-step {
    display: grid; grid-template-columns: 28px 1fr; gap: 12px; align-items: flex-start;
    min-height: 44px; position: relative; padding: 8px 0;
  }
  .scan-step-mark { margin-top: 1px; }
  .scan-step-copy span {
    display: none; margin-top: 2px; font-size: 12px; line-height: 1.4; color: #434655; font-weight: 500;
  }
  .scan-step.active .scan-step-copy span { display: block; animation: scanStatus .4s var(--ease); }
  .scan-live {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
  }
  .scan-step-mark {
    width: 28px; height: 28px; border-radius: 50%;
    border: 2px solid #d5d9e6; background: #fff; position: relative; z-index: 1;
  }
  .scan-step.done .scan-step-mark { border-color: #2563eb; background: #2563eb; }
  .scan-step.done .scan-step-mark::before {
    content: ''; position: absolute; left: 8px; top: 4px; width: 6px; height: 11px;
    border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg);
    animation: scanCheck .28s var(--ease);
  }
  .scan-step.active .scan-step-mark {
    border-color: #2563eb;
    box-shadow: 0 0 0 5px rgba(37, 99, 235, 0.14);
  }
  .scan-step.active .scan-step-mark::before {
    content: ''; position: absolute; inset: 6px; border-radius: 50%; background: #2563eb;
    animation: scanPulse 1.15s ease-in-out infinite;
  }
  .scan-step.wait { opacity: .42; }
  .scan-step-copy strong { display: block; font-size: 14px; font-weight: 650; color: #0b1c30; letter-spacing: -0.01em; }
  .scan-progress {
    margin-top: 16px; height: 4px; border-radius: 99px; background: #e8ebf4; overflow: hidden;
  }
  .scan-progress span {
    display: block; height: 100%; width: 12%; border-radius: inherit;
    background: #2563eb; transition: width .55s cubic-bezier(.2,.8,.2,1);
  }
  .scan-journey.is-holding .scan-progress span {
    background: linear-gradient(90deg, #1d4ed8 0%, #60a5fa 45%, #1d4ed8 100%);
    background-size: 200% 100%;
    animation: scanBar 1.3s linear infinite;
  }
  .scan-journey.is-done .scan-progress span { width: 100%; animation: none; background: #2563eb; }
  @keyframes scanPulse { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(.72); opacity: .55; } }
  @keyframes scanCheck { from { transform: rotate(45deg) scale(.6); } to { transform: rotate(45deg) scale(1); } }
  @keyframes scanStatus { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
  @keyframes scanBar { from { background-position: 100% 0; } to { background-position: -100% 0; } }
  @media (prefers-reduced-motion: reduce) {
    .scan-step.active .scan-step-mark::before,
    .scan-step.done .scan-step-mark::before,
    .scan-journey.is-holding .scan-progress span,
    .analyze-status.scan-status-in { animation: none; }
  }
  .hook-banner {
    background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
    padding: 18px 20px; margin-bottom: 22px; box-shadow: var(--shadow);
  }
  .hook-banner strong { display: block; font-size: 16px; margin-bottom: 4px; letter-spacing: -0.01em; }
  .hook-banner span { font-size: 13px; color: var(--muted); }
  .fomo-grid { display: grid; gap: 12px; margin: 18px 0 24px; }
  .fomo-card {
    display: grid; grid-template-columns: 28px 1fr; gap: 12px; align-items: start;
    background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
    padding: 16px 18px; cursor: pointer;
    transition: border-color 0.2s var(--ease), background 0.2s var(--ease), box-shadow 0.2s var(--ease);
  }
  .fomo-card:hover, .fomo-card.selected {
    border-color: rgba(0,113,227,0.45); background: var(--accent-soft); box-shadow: var(--shadow);
  }
  .fomo-card input { margin-top: 3px; accent-color: var(--accent); }
  .fomo-card h3 { font-size: 15px; font-weight: 600; margin: 0 0 4px; line-height: 1.35; letter-spacing: -0.01em; }
  .fomo-card p { font-size: 13px; color: var(--muted); margin: 0; line-height: 1.45; }
  .fomo-badge { font-size: 12px; color: var(--accent); white-space: nowrap; font-weight: 600; text-align: right; line-height: 1.3; max-width: 88px; }
  .fomo-badge small { display: block; color: var(--muted); font-weight: 500; font-size: 10px; margin-top: 2px; }
  .funnel-progress { display: flex; align-items: flex-start; gap: 0; margin: 0 0 40px; }
  .funnel-progress .fp-step {
    flex: 1; position: relative;
    display: flex; flex-direction: column; align-items: center; gap: 12px;
    color: var(--muted); transition: color 0.3s var(--ease);
  }
  .funnel-progress .fp-step::before {
    content: ''; position: absolute; top: 17px; left: 0; right: 0; height: 4px;
    background: var(--surface2); z-index: 0; transition: background 0.35s var(--ease);
  }
  .funnel-progress .fp-step:first-child::before { left: 50%; }
  .funnel-progress .fp-step:last-child::before { right: 50%; }
  .funnel-progress .fp-dot {
    position: relative; z-index: 1; box-sizing: border-box;
    width: 36px; height: 36px; border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--surface2); color: var(--muted);
    border: 3px solid var(--bg);
    font-size: 15px; font-weight: 700; line-height: 1; letter-spacing: 0;
    font-variant-numeric: tabular-nums;
    /* Digits sit high in the em-box; nudge for true visual center */
    padding-top: 1px;
    transition: background 0.35s var(--ease), color 0.35s var(--ease), box-shadow 0.35s var(--ease);
  }
  .funnel-progress .fp-label {
    font-size: 14px; font-weight: 550; letter-spacing: -0.01em; line-height: 1.2;
  }
  .funnel-progress .fp-step.done { color: var(--accent); }
  .funnel-progress .fp-step.done::before { background: var(--accent); }
  .funnel-progress .fp-step.done .fp-dot {
    background: var(--accent); color: #fff; font-size: 16px; padding-top: 0;
  }
  .funnel-progress .fp-step.active { color: var(--text); }
  .funnel-progress .fp-step.active .fp-label { font-weight: 650; }
  .funnel-progress .fp-step.active::before { background: linear-gradient(90deg, var(--accent), var(--surface2)); }
  .funnel-progress .fp-step.active .fp-dot {
    background: var(--accent); color: #fff;
    box-shadow: 0 0 0 6px var(--accent-soft);
  }
  .funnel-progress .fp-step.active ~ .fp-step::before { background: var(--surface2); }
  .fomo-urgency { font-size: 14px; color: var(--accent); margin: 0 0 14px; font-weight: 500; }
  .brand-edit { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 18px; margin-bottom: 8px; box-shadow: var(--shadow); }
  .brand-edit summary { cursor: pointer; font-size: 13px; color: var(--muted); list-style: none; }
  .brand-edit summary::-webkit-details-marker { display: none; }
  .brand-edit[open] summary { margin-bottom: 14px; color: var(--text); }
  .funnel-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 8px; }
  .claim-existing-note { margin-top: 14px; max-width: 520px; }
  .claim-existing-note a { color: var(--accent); text-decoration: none; font-weight: 500; }
  .claim-existing-note a:hover { text-decoration: underline; }
  .sign-in-link { margin-left: auto; font-size: 13px; color: var(--muted); }
  .sign-in-link button,
  .sign-in-link a {
    background: none; border: none; color: var(--accent); cursor: pointer;
    font: inherit; font-weight: 500; text-decoration: none;
  }
  .lp-footer a { color: var(--muted); text-decoration: none; }
  .lp-footer a:hover { color: var(--accent); text-decoration: underline; }
  .lp-nav-signin {
    background: none; border: none; color: var(--text); cursor: pointer;
    font: inherit; font-size: 14px; font-weight: 500; text-decoration: none;
    padding: 8px 4px;
  }
  .lp-nav-signin:hover { color: var(--accent); }
  body.route-auth #gate-url,
  body.route-auth #gate-loading,
  body.route-auth #gate-results { display: none !important; }
  body.route-landing #gate-auth { display: none !important; }
  body.route-landing #gate-auth.active { display: none !important; }
  /* Standalone /login */
  body.route-auth:not(.route-auth-claim) #auth-funnel-progress { display: none !important; }
  body.route-auth.route-auth-claim #auth-funnel-progress { display: flex !important; }

  body.route-auth #gate.visible {
    display: block;
    min-height: 100vh;
    padding: 0;
    background: #f8f9ff;
  }
  body.route-auth #gate-auth.funnel {
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    text-align: initial;
    background: #f8f9ff;
    color: #0b1c30;
    font-family: "Plus Jakarta Sans", var(--font);
  }
  body.route-auth #gate-auth.funnel h1 {
    font-size: 22px;
    line-height: 28px;
    letter-spacing: -0.02em;
    font-weight: 700;
    margin: 0;
    color: #0b1c30;
  }
  .auth-sr {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
  }
  .auth-top {
    position: sticky; top: 0; z-index: 20;
    display: flex; align-items: center; justify-content: space-between; gap: 16px;
    padding: 10px 24px;
    background: #fff;
    border-bottom: 1px solid rgba(195, 198, 215, 0.45);
  }
  .auth-brand {
    display: inline-flex; align-items: center; gap: 8px;
    color: inherit; text-decoration: none;
  }
  .auth-brand-mark { display: block; height: 38px; }
  .auth-brand-mark img { height: 38px; width: auto; display: block; }
  .auth-brand-name { font-size: 18px; font-weight: 600; letter-spacing: -0.02em; }
  .auth-brand-name strong { font-weight: 800; color: #2563eb; }
  .auth-top-switch { display: flex; align-items: center; gap: 12px; }
  .auth-top-switch[hidden] { display: none !important; }
  #auth-top-hint { font-size: 13px; color: #434655; }
  #auth-top-cta {
    display: inline-flex; align-items: center;
    height: 34px; padding: 0 12px;
    border-radius: 8px; border: 1px solid rgba(195, 198, 215, 0.7);
    background: #fff; color: #0b1c30;
    font: inherit; font-size: 12px; font-weight: 600;
    cursor: pointer;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  }
  #auth-top-cta:hover { background: #eff4ff; border-color: rgba(37, 99, 235, 0.4); }
  .auth-top-btn {
    display: inline-flex; align-items: center;
    height: 34px; padding: 0 12px;
    border-radius: 8px; border: 1px solid rgba(195, 198, 215, 0.7);
    background: #fff; color: #0b1c30;
    font: inherit; font-size: 12px; font-weight: 600;
    cursor: pointer; text-decoration: none;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  }
  .auth-top-btn:hover { background: #eff4ff; border-color: rgba(37, 99, 235, 0.4); color: #0b1c30; }
  .auth-main {
    flex: 1;
    display: flex; align-items: center; justify-content: center;
    padding: 32px 16px 40px;
    position: relative;
  }
  .auth-main::before {
    content: "";
    position: absolute; inset: 0;
    background: radial-gradient(700px 420px at 50% 42%, rgba(220, 233, 255, 0.9), transparent 70%);
    pointer-events: none;
  }
  .auth-stage { position: relative; z-index: 1; width: 100%; max-width: 440px; }
  body.route-auth.route-auth-claim .auth-stage { max-width: 520px; }
  body.route-auth.route-auth-claim #auth-funnel-progress { margin: 0 0 22px; }
  body.route-auth #gate-auth .auth-card {
    max-width: none; width: 100%; margin: 0;
    background: #fff;
    border: 1px solid rgba(195, 198, 215, 0.45);
    border-radius: 12px;
    padding: 28px 28px 22px;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04), 0 1px 2px rgba(15, 23, 42, 0.04);
    text-align: left;
  }
  .auth-card-head { text-align: center; margin-bottom: 22px; }
  .auth-card-icon {
    width: 48px; height: 48px; margin: 0 auto 12px;
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    background: #eff4ff; color: #2563eb;
    border: 1px solid rgba(195, 198, 215, 0.35);
  }
  .auth-card-icon .material-symbols-outlined { font-size: 26px; }
  .auth-card-head p {
    margin: 6px 0 0; font-size: 13px; line-height: 1.45; color: #434655;
  }
  body.route-auth #gate-auth .auth-card .form-group { margin-bottom: 14px; }
  body.route-auth #gate-auth .auth-card label {
    font-size: 12px; font-weight: 600; color: #0b1c30;
  }
  .auth-label-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
  #auth-forgot-link {
    background: none; border: none; padding: 0;
    color: #004ac6; font: inherit; font-size: 11px; font-weight: 600;
    cursor: pointer;
  }
  #auth-forgot-link:hover { text-decoration: underline; }
  #auth-forgot-link[hidden] { display: none !important; }
  .auth-field { position: relative; }
  body.route-auth #gate-auth .auth-field input {
    height: 38px; padding: 0 40px 0 12px;
    border-radius: 8px;
    border: 1px solid rgba(195, 198, 215, 0.85);
    font-size: 14px; font-family: inherit;
  }
  body.route-auth #gate-auth .auth-field input:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.16);
  }
  body.route-auth #gate-auth .auth-field.is-invalid input {
    border-color: var(--tone-failed-fg);
    background: var(--tone-failed-bg);
  }
  body.route-auth #gate-auth .auth-field.is-invalid input:focus {
    border-color: var(--tone-failed-fg);
    box-shadow: 0 0 0 3px rgba(215, 0, 21, 0.16);
  }
  .auth-field-hint {
    margin: 6px 0 0;
    font-size: 12px;
    line-height: 1.4;
    color: #434655;
  }
  .auth-field-hint[hidden] { display: none !important; }
  .auth-field-hint.is-invalid { color: var(--tone-failed-fg); }
  .auth-card .auth-terms.is-invalid input[type="checkbox"] {
    outline: 2px solid var(--tone-failed-fg);
    outline-offset: 2px;
    accent-color: var(--tone-failed-fg);
  }
  .auth-field-icon, .auth-eye {
    position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
    color: #737686;
  }
  .auth-field-icon { font-size: 18px; pointer-events: none; right: 10px; }
  .auth-eye {
    background: none; border: none; padding: 2px; cursor: pointer;
    display: inline-flex; color: #737686;
  }
  .auth-eye:hover { color: #0b1c30; }
  .auth-eye .material-symbols-outlined { font-size: 20px; }
  body.route-auth #gate-auth .auth-submit {
    width: 100%; height: 40px; margin-top: 6px;
    border-radius: 8px; padding: 0 16px;
    background: #2563eb; font-size: 14px; font-weight: 600;
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    box-shadow: 0 1px 2px rgba(37, 99, 235, 0.25);
  }
  body.route-auth #gate-auth .auth-submit:hover { background: #004ac6; }
  body.route-auth #gate-auth .auth-submit .material-symbols-outlined { font-size: 18px; }
  .auth-trust {
    display: flex; align-items: center; justify-content: center; gap: 6px;
    margin: 16px 0 0; padding-top: 14px;
    border-top: 1px solid rgba(195, 198, 215, 0.35);
    font-size: 11px; font-weight: 600; color: #434655;
  }
  .auth-trust .material-symbols-outlined {
    font-size: 16px; color: #006e2d;
    font-variation-settings: "FILL" 1;
  }
  .auth-switch { margin-top: 16px; text-align: center; }
  .auth-switch[hidden] { display: none !important; }
  body.route-auth #gate-auth .auth-toggle { margin-top: 12px; text-align: center; font-size: 13px; }
  body.route-auth #gate-auth .auth-toggle button { font-weight: 600; }
  .auth-proof {
    margin-top: 28px; padding: 14px 16px 12px;
    background: rgba(255, 255, 255, 0.82);
    border: 1px solid rgba(195, 198, 215, 0.45);
    border-radius: 12px;
  }
  .auth-proof[hidden] { display: none !important; }
  .auth-proof-label {
    display: flex; align-items: center; gap: 8px;
    font-size: 11px; font-weight: 700; letter-spacing: 0.06em;
    text-transform: uppercase; color: #434655; margin-bottom: 10px;
  }
  .auth-proof-label i {
    width: 8px; height: 8px; border-radius: 50%; background: #7cf994; display: block;
  }
  .auth-proof-grid {
    display: grid; grid-template-columns: repeat(3, 1fr);
    border-top: 1px solid rgba(195, 198, 215, 0.35); padding-top: 10px;
  }
  .auth-proof-grid div { text-align: center; padding: 0 6px; }
  .auth-proof-grid div + div { border-left: 1px solid rgba(195, 198, 215, 0.35); }
  .auth-proof-grid strong { display: block; font-size: 12px; font-weight: 600; color: #0b1c30; }
  .auth-proof-grid span { display: block; margin-top: 2px; font-size: 10px; color: #434655; }
  .auth-back { text-align: center; margin: 16px 0 0; }
  .auth-back a { color: #434655; font-size: 12px; text-decoration: none; }
  .auth-back a:hover { color: #004ac6; }
  .auth-foot {
    display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 20px;
    padding: 20px 24px;
    background: #fff;
    border-top: 1px solid rgba(195, 198, 215, 0.35);
  }
  .auth-foot-brand { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px 14px; }
  .auth-foot-brand strong { font-size: 14px; letter-spacing: -0.02em; }
  .auth-foot-brand span, .auth-foot-nav a { font-size: 13px; color: #434655; text-decoration: none; }
  .auth-foot-nav { display: flex; gap: 18px; }
  .auth-foot-nav a:hover { color: #004ac6; }
  @media (max-width: 640px) {
    #auth-top-hint { display: none; }
    .auth-top { padding: 10px 14px; }
    body.route-auth #gate-auth .auth-card { padding: 22px 18px 18px; }
    .auth-foot { justify-content: center; text-align: center; }
    .auth-foot-brand { justify-content: center; }
  }
  .gate-panel { display: none; }
  .gate-panel.active { display: block; animation: enter 0.4s var(--ease) both; }

  /* Landing */
  html { scroll-behavior: smooth; }
  .lp { background:
    radial-gradient(900px 420px at 80% -10%, rgba(0,113,227,0.10), transparent 60%),
    radial-gradient(700px 380px at 0% 20%, rgba(0,113,227,0.06), transparent 55%),
    var(--bg);
  }
  .lp-nav {
    position: sticky; top: 0; z-index: 30;
    display: flex; align-items: center; justify-content: space-between; gap: 16px;
    padding: 14px 28px;
    background: rgba(245,245,247,0.78);
    backdrop-filter: saturate(1.4) blur(16px);
    border-bottom: 1px solid transparent;
    transition: border-color 0.3s var(--ease), background 0.3s var(--ease);
  }
  .lp-nav.is-stuck { border-bottom-color: var(--border); background: rgba(245,245,247,0.92); }
  .lp-brand { font-weight: 700; letter-spacing: -0.03em; font-size: 17px; color: var(--text); }
  .lp-brand span { color: var(--accent); }
  .lp-nav-links { display: flex; align-items: center; gap: 22px; }
  .lp-nav-links a {
    color: var(--muted); text-decoration: none; font-size: 14px; font-weight: 500;
    transition: color 0.2s var(--ease);
  }
  .lp-nav-links a:hover { color: var(--text); }
  .lp-nav-signin {
    background: none; border: none; color: var(--text); cursor: pointer;
    font: inherit; font-size: 14px; font-weight: 500; text-decoration: none;
  }
  a.btn { text-decoration: none; }
  .lp-wrap { max-width: 1120px; margin: 0 auto; padding: 0 28px; }
  .lp-hero {
    display: grid; grid-template-columns: 1.05fr 0.95fr; gap: 48px; align-items: center;
    padding: 36px 0 28px;
  }
  .lp-kicker {
    display: inline-flex; align-items: center; gap: 8px;
    font-family: var(--mono); font-size: 12px; letter-spacing: 0.01em;
    color: var(--accent); margin-bottom: 16px; line-height: 1.45; max-width: 520px;
  }
  .lp-kicker i { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); display: inline-block; flex-shrink: 0; animation: pulse 2.4s var(--ease) infinite; }
  .lp h1 {
    font-size: clamp(40px, 5.2vw, 64px); line-height: 1.02; letter-spacing: -0.04em;
    font-weight: 700; margin: 0 0 16px;
  }
  .lp .lead { font-size: 18px; line-height: 1.55; color: var(--muted); max-width: 520px; margin: 0 0 26px; }
  .lp .url-row { max-width: 560px; }
  .lp-hero-actions {
    display: flex; flex-wrap: wrap; gap: 10px; align-items: center;
    margin: 12px 0 0; max-width: 560px;
  }
  .lp-hero-actions[hidden] { display: none !important; }
  .lp-nav-signin[role="button"],
  #lp-footer-auth[role="button"] { cursor: pointer; }
  .lp .trust-row { margin-top: 22px; }
  .lp-cost { margin: 14px 0 0; max-width: 520px; font-size: 13px; line-height: 1.5; color: var(--muted); }
  .lp-hero-copy > * { animation: enter 0.7s var(--ease) both; }
  .lp-hero-copy > *:nth-child(2) { animation-delay: 0.05s; }
  .lp-hero-copy > *:nth-child(3) { animation-delay: 0.1s; }
  .lp-hero-copy > *:nth-child(4) { animation-delay: 0.15s; }
  .lp-hero-copy > *:nth-child(5) { animation-delay: 0.2s; }
  .lp-hero-copy > *:nth-child(6) { animation-delay: 0.25s; }
  .lp-hero-copy > *:nth-child(7) { animation-delay: 0.3s; }
  .lp-hero-copy > *:nth-child(8) { animation-delay: 0.35s; }
  .lp-stage {
    animation: enter 0.9s var(--ease) 0.12s both;
  }
  .lp-stage-card {
    background: var(--surface); border: 1px solid var(--border); border-radius: 18px;
    box-shadow: var(--shadow); padding: 18px 18px 14px; overflow: hidden;
  }
  .lp-stage-top {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 14px; font-size: 13px; font-weight: 600; letter-spacing: -0.01em;
  }
  .lp-pill {
    font-family: var(--mono); font-size: 11px; font-weight: 500; color: var(--muted);
    background: var(--surface2); border-radius: 999px; padding: 4px 8px;
    max-width: 58%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  }
  .lp-cal { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .lp-day {
    background: var(--bg); border-radius: 12px; padding: 10px; min-height: 118px;
  }
  .lp-day > span {
    display: block; font-size: 11px; font-weight: 600; letter-spacing: 0.06em;
    text-transform: uppercase; color: var(--muted); margin-bottom: 8px;
  }
  .lp-chip {
    font-size: 12px; font-weight: 500; line-height: 1.35; border-radius: 8px; padding: 8px;
    animation: enter 0.6s var(--ease) both;
  }
  .lp-chip.queued { background: var(--accent-soft); color: var(--accent); animation-delay: 0.35s; }
  .lp-chip.writing { background: rgba(255,159,10,0.15); color: #C77C00; animation-delay: 0.48s; }
  .lp-chip.live { background: rgba(52,199,89,0.15); color: #248A3D; animation-delay: 0.6s; }
  .lp-stage-note { margin-top: 12px; font-size: 12px; color: var(--muted); line-height: 1.45; }
  .lp-section { padding: 72px 0; scroll-margin-top: 72px; }
  .lp-section h2 {
    font-size: clamp(28px, 3.4vw, 40px); letter-spacing: -0.035em; line-height: 1.1;
    margin: 0 0 12px; font-weight: 700;
  }
  .lp-section .lp-sub { color: var(--muted); font-size: 16px; line-height: 1.55; max-width: 560px; margin: 0 0 28px; }
  .lp-steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
  .lp-step {
    background: var(--surface); border: 1px solid var(--border); border-radius: 16px;
    padding: 22px 20px 20px; box-shadow: var(--shadow);
    transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease);
  }
  .lp-step:hover { transform: translateY(-3px); box-shadow: 0 10px 28px rgba(0,0,0,0.07); }
  .lp-step-n {
    font-family: var(--mono); font-size: 12px; color: var(--accent); font-weight: 500; margin-bottom: 12px;
  }
  .lp-step h3 { font-size: 17px; letter-spacing: -0.02em; margin: 0 0 8px; }
  .lp-step p { font-size: 14px; color: var(--muted); line-height: 1.5; margin: 0; }
  .lp-step-proof { margin-top: 10px; font-family: var(--mono); font-size: 12px; color: var(--text); letter-spacing: -0.01em; }
  .lp-band {
    background: var(--surface); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border);
  }
  .lp-split { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: center; }
  .lp-quote {
    font-size: clamp(22px, 2.6vw, 30px); letter-spacing: -0.03em; line-height: 1.25;
    font-weight: 600; margin: 0 0 16px;
  }
  .lp-note { font-size: 15px; color: var(--muted); line-height: 1.6; margin: 0 0 12px; }
  .lp-admit {
    font-size: 14px; line-height: 1.55; color: var(--text);
    background: var(--accent-soft); border-radius: 14px; padding: 14px 16px; margin-top: 18px;
  }
  .lp-controls { display: grid; gap: 12px; }
  .lp-control {
    display: grid; grid-template-columns: 36px 1fr; gap: 12px; align-items: start;
    background: var(--bg); border-radius: 14px; padding: 14px 14px;
  }
  .lp-control svg { width: 18px; height: 18px; color: var(--accent); margin-top: 2px; }
  .lp-control strong { display: block; font-size: 14px; margin-bottom: 3px; }
  .lp-control span { font-size: 13px; color: var(--muted); line-height: 1.45; }
  .lp-faq { display: grid; gap: 8px; max-width: 760px; }
  .lp-faq details {
    background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
    padding: 0 18px; box-shadow: var(--shadow);
  }
  .lp-faq summary {
    cursor: pointer; list-style: none; font-weight: 600; font-size: 15px;
    letter-spacing: -0.01em; padding: 16px 0;
  }
  .lp-faq summary::-webkit-details-marker { display: none; }
  .lp-faq details p { font-size: 14px; color: var(--muted); line-height: 1.55; margin: 0; padding-bottom: 16px; }
  .lp-final {
    text-align: center; padding: 28px 0 88px;
  }
  .lp-final h2 { margin-left: auto; margin-right: auto; }
  .lp-final .lp-sub { margin-left: auto; margin-right: auto; }
  .lp-final .url-row { max-width: 640px; margin: 0 auto; justify-content: center; }
  .lp-footer {
    display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap;
    padding: 22px 0 32px; border-top: 1px solid var(--border);
    font-size: 12px; color: var(--muted);
  }
  .lp-footer a, .lp-footer button {
    color: var(--muted); background: none; border: none; cursor: pointer; font: inherit; font-size: 12px;
  }
  .lp-reveal { opacity: 0; transform: translateY(16px); transition: opacity 0.7s var(--ease), transform 0.7s var(--ease); }
  .lp-reveal.in { opacity: 1; transform: none; }
  .lp-reveal.d1 { transition-delay: 0.08s; }
  .lp-reveal.d2 { transition-delay: 0.16s; }
  .lp-reveal.d3 { transition-delay: 0.24s; }
  @media (max-width: 860px) {
    .lp-nav { padding: 12px 16px; }
    .lp-nav-links a { display: none; }
    .lp-wrap { padding: 0 16px; }
    .lp-hero, .lp-steps, .lp-split { grid-template-columns: 1fr; gap: 22px; }
    .lp-hero { padding-top: 18px; }
    .lp h1 { font-size: 38px; }
    .lp .url-row { flex-direction: column; }
    .lp .url-row .btn { width: 100%; justify-content: center; }
    .lp-section { padding: 48px 0; }
    .lp-cal { grid-template-columns: 1fr; }
    .lp-day { min-height: 0; }
  }

/* =====================================================================
   Dashboard design system (app shell + modals)
   ===================================================================== */

[hidden] { display: none !important; }

/* Shell */
#app-shell, #admin-shell { grid-template-columns: 248px minmax(0, 1fr); }
#admin-shell .sidebar { padding: 18px 0 14px; overflow-y: auto; }
#admin-shell .sidebar-brand { padding: 0 20px 16px; }
#admin-shell .nav-item {
  position: relative; width: calc(100% - 24px); margin: 1px 12px; padding: 8px 12px; gap: 10px;
  border: 0; background: transparent; font: inherit; font-size: 14px; text-align: left;
  border-radius: var(--r-md); color: #48484C; cursor: pointer;
}
#admin-shell .nav-item.active { color: var(--accent); background: var(--accent-soft); font-weight: 600; }
#admin-shell .main { padding: 28px 40px 64px; min-width: 0; }
#admin-shell .page.active { max-width: 1240px; margin: 0 auto; }
a.nav-item { text-decoration: none; }
#app-shell .main { padding: 28px 40px 64px; min-width: 0; overflow: visible; overflow-x: clip; }
#app-shell .page.active { max-width: 1280px; margin: 0 auto; }

/* Sidebar */
#app-shell .sidebar { padding: 18px 0 14px; overflow-y: auto; }
#app-shell .sidebar-brand { padding: 0 20px 16px; }
.brand-link { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); }
.brand-mark {
  width: 28px; height: 28px; border-radius: var(--r-sm); flex-shrink: 0;
  background: var(--accent); color: #fff;
  display: flex; align-items: center; justify-content: center;
}
.brand-mark svg { width: 16px; height: 16px; }
#app-shell .brand-mark { width: auto; height: 40px; border-radius: 0; background: none; }
#app-shell .brand-mark img { height: 40px; width: auto; display: block; }
#app-shell .site-switcher { margin: 0 12px 12px; }
#app-shell .site-switcher-btn {
  background: var(--surface); border-color: var(--border2); box-shadow: var(--shadow-sm);
  padding: 8px 10px; border-radius: var(--r-md);
}
#app-shell .site-switcher-btn:hover { background: var(--surface2); }
.site-avatar {
  width: 30px; height: 30px; border-radius: var(--r-sm); flex-shrink: 0;
  background: var(--accent-soft); color: var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; text-transform: uppercase;
  overflow: hidden;
}
.site-avatar.has-favicon { background: var(--surface2); padding: 0; }
.site-avatar img {
  width: 100%; height: 100%; object-fit: contain; display: block;
}
.site-avatar-sm { width: 24px; height: 24px; font-size: 11px; border-radius: 6px; }
.nav-label {
  padding: 14px 24px 6px; font-size: 11px; font-weight: 600;
  letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted);
}
#app-shell .nav-item {
  position: relative; margin: 1px 12px; padding: 8px 12px; gap: 10px;
  font-size: 14px; border-radius: var(--r-md); color: #48484C;
}
#app-shell .nav-item .nav-icon { width: 18px; height: 18px; }
#app-shell .nav-item.active { color: var(--accent); background: var(--accent-soft); font-weight: 600; }
#app-shell .nav-item.active::before {
  content: ''; position: absolute; left: -12px; top: 8px; bottom: 8px; width: 3px;
  border-radius: 0 3px 3px 0; background: var(--accent);
}
.nav-count {
  margin-left: auto; min-width: 22px; text-align: center;
  font-size: 11px; font-family: var(--mono); font-weight: 600;
  padding: 1px 7px; border-radius: 999px; background: var(--surface2); color: var(--muted);
}
.nav-count:empty { display: none; }
.nav-count.attention { background: var(--tone-ready-bg); color: var(--tone-ready-fg); }
#app-shell .nav-item.active .nav-count { background: rgba(0,113,227,0.14); color: var(--accent); }
#app-shell .sidebar-footer { padding-top: 12px; }
.quota-card {
  position: relative; overflow: hidden;
  margin: 0 12px 8px; padding: 12px;
  border-radius: var(--r-lg);
  border: 1px solid rgba(0, 113, 227, 0.14);
  display: flex; align-items: center; gap: 10px; min-width: 0; width: calc(100% - 24px);
  isolation: isolate;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.7);
  background: transparent; color: inherit; font: inherit; text-align: left; cursor: pointer;
  transition: border-color 0.15s var(--ease), box-shadow 0.15s var(--ease), transform 0.15s var(--ease);
}
.quota-card:hover {
  border-color: rgba(0, 113, 227, 0.28);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.8), 0 4px 14px rgba(0,113,227,0.1);
}
.quota-card:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.quota-card::before {
  content: ''; position: absolute; inset: 0; z-index: -1;
  background:
    radial-gradient(120% 140% at 0% 0%, rgba(255,255,255,0.65), transparent 55%),
    radial-gradient(90% 120% at 100% 110%, rgba(0,113,227,0.16), transparent 58%),
    linear-gradient(145deg, #EAF3FF 0%, #D6E8FF 48%, #E8F1FF 100%);
}
.quota-card-badge {
  flex: none; width: 32px; height: 32px; border-radius: 10px;
  display: grid; place-items: center;
  background: rgba(255,255,255,0.78);
  border: 1px solid rgba(0, 113, 227, 0.14);
  box-shadow: 0 1px 2px rgba(0,0,0,0.04);
  color: var(--accent);
}
.quota-card.is-premium .quota-card-badge {
  background: linear-gradient(160deg, #FFFFFF, #D6E8FF);
  border-color: rgba(0, 113, 227, 0.2);
}
.quota-card-badge svg { width: 15px; height: 15px; }
.quota-card-meta { min-width: 0; flex: 1; display: grid; gap: 1px; }
.quota-card-email {
  display: block;
  font-size: 12px; font-weight: 600; color: var(--text); line-height: 1.35;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.quota-card-plan {
  font-size: 11px; font-weight: 650; letter-spacing: 0.02em;
  color: var(--accent); text-transform: uppercase;
}
.quota-bar { height: 6px; border-radius: 999px; background: var(--surface2); overflow: hidden; }
.quota-bar > span { display: block; height: 100%; width: 0; border-radius: 999px; background: var(--accent); transition: width 0.45s var(--ease); }
.quota-bar.warn > span { background: var(--amber); }
.quota-bar.full > span { background: var(--red); }
.link-btn {
  background: none; border: none; padding: 0; cursor: pointer;
  font: inherit; font-weight: 600; color: var(--accent);
}
.link-btn:hover { text-decoration: underline; }
.sidebar-legal { padding: 4px 24px 8px; font-size: 11px; color: var(--muted); }
.sidebar-legal a { color: inherit; text-decoration: none; }
.sidebar-legal a:hover { color: var(--text); text-decoration: underline; }

/* Page header */
#app-shell .page-header { margin-bottom: 22px; gap: 16px; align-items: flex-end; flex-wrap: wrap; }
#app-shell .page-title { font-size: 26px; font-weight: 700; letter-spacing: -0.022em; line-height: 1.2; }
#app-shell .page-subtitle { font-size: 14px; margin-top: 4px; line-height: 1.45; max-width: 60ch; }

/* Buttons */
.shell .btn, .modal-overlay .btn, .toast .btn {
  justify-content: center; gap: 7px; padding: 9px 16px; line-height: 1.2;
  font-size: 14px; font-weight: 550; border-radius: var(--r-md); white-space: nowrap;
}
.shell .btn-sm, .modal-overlay .btn-sm { padding: 6px 11px; font-size: 13px; border-radius: var(--r-sm); }
.shell .btn .btn-icon, .modal-overlay .btn .btn-icon { width: 16px; height: 16px; }
.shell .btn-primary, .modal-overlay .btn-primary { box-shadow: 0 1px 2px rgba(0,113,227,0.25); }
.shell .btn-ghost, .modal-overlay .btn-ghost {
  color: var(--text); background: var(--surface); border-radius: var(--r-md); box-shadow: var(--shadow-sm);
}
.shell .btn-sm.btn-ghost, .modal-overlay .btn-sm.btn-ghost { border-radius: var(--r-sm); }
.shell .btn-ghost:hover, .modal-overlay .btn-ghost:hover { background: var(--surface2); }
.shell .btn-danger, .modal-overlay .btn-danger { border-radius: var(--r-md); }
#confirm-modal .btn-danger { background: var(--red); color: #fff; border-color: var(--red); }
#confirm-modal .btn-danger:hover { background: var(--red); filter: brightness(0.92); }
.shell .btn-success, .modal-overlay .btn-success {
  background: var(--green); color: #fff; border: none; border-radius: var(--r-md);
  box-shadow: 0 1px 2px rgba(52,199,89,0.3);
}
.shell .btn-success:hover, .modal-overlay .btn-success:hover { background: #2DB84F; }
.btn-quiet { background: transparent; color: var(--muted); border: none; }
.btn-quiet:hover { background: rgba(0,0,0,0.05); color: var(--text); }
.btn-danger-quiet { background: transparent; color: var(--red); border: none; }
.btn-danger-quiet:hover { background: var(--tone-failed-bg); }
.icon-btn {
  width: 32px; height: 32px; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: var(--r-sm); border: 1px solid transparent; background: transparent;
  color: var(--muted); cursor: pointer; font-family: var(--font);
  transition: background 0.15s var(--ease), color 0.15s var(--ease), border-color 0.15s var(--ease);
}
.icon-btn:hover { background: rgba(0,0,0,0.05); color: var(--text); }
.icon-btn.bordered { border-color: var(--border2); background: var(--surface); }
.icon-btn.danger:hover { background: var(--tone-failed-bg); color: var(--red); }
.icon-btn svg { width: 16px; height: 16px; }
.icon-btn:disabled { opacity: 0.4; cursor: not-allowed; pointer-events: none; }

/* Cards, sections, hints */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow-sm); }
.card-pad { padding: var(--sp-5) var(--sp-6); }
.section-title { font-size: 16px; font-weight: 650; letter-spacing: -0.01em; color: var(--text); }
.section-sub { font-size: 13px; color: var(--muted); line-height: 1.5; margin-top: 2px; }
.field-hint { font-size: 12px; color: var(--muted); line-height: 1.5; margin: 6px 0 0; }
.check-row { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; color: var(--text) !important; font-size: 14px !important; }
.check-row input { width: auto !important; margin-top: 3px; accent-color: var(--accent); }
.check-row small { display: block; font-size: 12px; color: var(--muted); font-weight: 400; margin-top: 3px; line-height: 1.45; }

/* Form controls (dashboard + modals) */
.shell input:not([type="color"]):not([type="checkbox"]):not([type="radio"]),
.shell textarea, .shell select,
.modal-overlay input:not([type="color"]):not([type="checkbox"]):not([type="radio"]),
.modal-overlay textarea, .modal-overlay select {
  border-radius: var(--r-md); padding: 9px 12px; font-size: 14px;
}
.shell label, .modal-overlay label { font-size: 13px; font-weight: 550; color: var(--text); }
.shell .form-grid, .modal-overlay .form-grid { gap: 16px 18px; }
.shell .mode-option, .modal-overlay .mode-option {
  border-radius: var(--r-md); padding: 11px 13px; background: var(--surface);
  display: flex; flex-direction: column; justify-content: flex-start; align-items: flex-start; text-align: left;
}
.shell .mode-option.active, .modal-overlay .mode-option.active { background: var(--accent-soft); }

/* Empty state */
.shell .empty-state, .modal-overlay .empty-state {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 56px 24px; text-align: center; color: var(--muted);
}
.shell .empty-icon, .modal-overlay .empty-icon {
  width: 48px; height: 48px; border-radius: var(--r-lg); margin-bottom: 10px;
  display: flex; align-items: center; justify-content: center;
  background: var(--accent-soft); color: var(--accent);
}
.shell .empty-icon svg, .modal-overlay .empty-icon svg { width: 22px; height: 22px; }
.empty-title { font-size: 16px; font-weight: 650; color: var(--text); letter-spacing: -0.01em; }
.shell .empty-text { font-size: 14px; line-height: 1.5; max-width: 44ch; }
.empty-actions { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; justify-content: center; }

/* Status pill (single source: STATUS_META in app.js) */
.status-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 10px 3px 8px; border-radius: 999px;
  font-size: 12px; font-weight: 600; line-height: 1.5; white-space: nowrap;
}
.status-pill .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex-shrink: 0; }
.status-pill .status-lock { width: 11px; height: 11px; flex-shrink: 0; }
.status-pill .pct { font-family: var(--mono); font-weight: 600; }
.tone-planned { background: var(--tone-planned-bg); color: var(--tone-planned-fg); }
.tone-writing { background: var(--tone-writing-bg); color: var(--tone-writing-fg); }
.tone-writing .dot { animation: pulse 1.2s ease-in-out infinite; }
.tone-ready { background: var(--tone-ready-bg); color: var(--tone-ready-fg); }
.tone-draft { background: var(--tone-draft-bg); color: var(--tone-draft-fg); }
.tone-live { background: var(--tone-live-bg); color: var(--tone-live-fg); }
.tone-failed { background: var(--tone-failed-bg); color: var(--tone-failed-fg); }

/* Stats */
#app-shell .stats-grid { gap: 12px; margin-bottom: 20px; }
#app-shell .stat-card {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px; border-radius: var(--r-lg); box-shadow: var(--shadow-sm);
}
#app-shell .stat-card.clickable { cursor: pointer; transition: border-color 0.15s var(--ease), box-shadow 0.15s var(--ease); }
#app-shell .stat-card.clickable:hover { border-color: var(--border2); box-shadow: var(--shadow-md); }
.stat-icon {
  width: 36px; height: 36px; border-radius: var(--r-md); flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
.stat-icon svg { width: 18px; height: 18px; }
#app-shell .stat-label { font-size: 12px; font-weight: 500; text-transform: none; letter-spacing: 0; margin-bottom: 1px; }
#app-shell .stat-value {
  font-size: 22px; font-weight: 650; font-family: var(--font);
  letter-spacing: -0.02em; line-height: 1.2; color: var(--text);
}

/* Calendar */
.cal-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.cal-toolbar-left { display: flex; align-items: center; gap: 10px; }
.seg {
  display: inline-flex; overflow: hidden; border-radius: var(--r-md);
  border: 1px solid var(--border2); background: var(--surface); box-shadow: var(--shadow-sm);
}
.seg button {
  display: inline-flex; align-items: center; justify-content: center; gap: 4px;
  padding: 6px 10px; border: none; background: transparent; cursor: pointer;
  font: inherit; font-size: 13px; font-weight: 550; color: var(--text);
}
.seg button + button { border-left: 1px solid var(--border); }
.seg button:hover { background: var(--surface2); }
.seg svg { width: 16px; height: 16px; }
:is(#app-shell, .cal-demo) .cal-month { font-size: 18px; font-weight: 650; letter-spacing: -0.015em; min-width: 0; }
.cal-legend { display: flex; flex-wrap: wrap; gap: 6px; }
.cal-legend .status-pill { font-weight: 550; font-size: 11.5px; padding: 2px 9px 2px 7px; }
:is(#app-shell, .cal-demo) .calendar-grid { border-radius: var(--r-lg); box-shadow: var(--shadow-sm); }
:is(#app-shell, .cal-demo) .cal-header { background: var(--surface); border-bottom: 1px solid var(--border); }
:is(#app-shell, .cal-demo) .cal-header-cell { padding: 10px 12px; text-align: left; font-size: 11px; letter-spacing: 0.06em; }
:is(#app-shell, .cal-demo) .cal-cell { min-height: 128px; padding: 8px; display: flex; flex-direction: column; position: relative; }
:is(#app-shell, .cal-demo) .cal-cell.other-month { background: #FAFAFB; }
:is(#app-shell, .cal-demo) .cal-cell.other-month .cal-day { opacity: 0.55; }
:is(#app-shell, .cal-demo) .cal-cell.today { background: rgba(0,113,227,0.03); }
.cal-cell-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
:is(#app-shell, .cal-demo) .cal-day {
  width: 24px; height: 24px; margin: 0; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 550; color: var(--text);
}
:is(#app-shell, .cal-demo) .cal-cell.past .cal-day { color: var(--muted); }
:is(#app-shell, .cal-demo) .cal-cell.today .cal-day { background: var(--accent); color: #fff; width: 24px; height: 24px; }
.cal-add {
  width: 24px; height: 24px; border-radius: 6px; border: none; padding: 0;
  display: flex; align-items: center; justify-content: center; cursor: pointer;
  background: var(--accent-soft); color: var(--accent);
  opacity: 0; transition: opacity 0.15s var(--ease), background 0.15s var(--ease);
}
.cal-add svg { width: 14px; height: 14px; }
.cal-add:hover { background: rgba(0,113,227,0.16); }
.cal-cell:hover .cal-add, .cal-add:focus-visible { opacity: 1; }
:is(#app-shell, .cal-demo) .cal-cell.empty-day { cursor: default; }
:is(#app-shell, .cal-demo) .cal-cell.empty-day:hover { background: transparent; }
:is(#app-shell, .cal-demo) .cal-cell.empty-day.today:hover { background: rgba(0,113,227,0.03); }
.cal-empty-cta {
  flex: 1; min-height: 56px; border-radius: var(--r-sm); border: 1px dashed transparent;
  display: flex; align-items: center; justify-content: center; gap: 6px;
  font-size: 12px; font-weight: 550; color: var(--accent); background: none; cursor: pointer;
  opacity: 0; transition: opacity 0.15s var(--ease), border-color 0.15s var(--ease);
  font-family: var(--font);
}
.cal-empty-cta svg { width: 14px; height: 14px; }
.cal-cell:hover .cal-empty-cta, .cal-empty-cta:focus-visible { opacity: 1; border-color: rgba(0,113,227,0.35); }
.cal-empty-cta.cal-empty-lock {
  opacity: 0.9; color: var(--accent);
  border-color: rgba(0,113,227,0.28); background: rgba(0,113,227,0.06);
}
.cal-empty-cta.cal-empty-lock svg { width: 18px; height: 18px; }
.cal-cell:hover .cal-empty-cta.cal-empty-lock { opacity: 1; border-color: rgba(0,113,227,0.55); background: rgba(0,113,227,0.12); }
.tone-locked { background: rgba(0,113,227,0.12); color: #0A4A8A; }
:is(#app-shell, .cal-demo) .cal-event.tone-locked {
  background: rgba(0,113,227,0.12); color: #0A4A8A; border-left-color: var(--accent);
}
:is(#app-shell, .cal-demo) .cal-events { gap: 4px; }
:is(#app-shell, .cal-demo) .cal-event {
  font-size: 12.5px; padding: 6px 8px 6px 8px; border-radius: 7px; line-height: 1.35;
  border-left: 3px solid currentColor; gap: 6px; font-weight: 550;
  transition: box-shadow 0.15s var(--ease), filter 0.15s var(--ease);
}
:is(#app-shell, .cal-demo) .cal-event:hover { box-shadow: var(--shadow-sm); filter: brightness(0.97); }
:is(#app-shell, .cal-demo) .cal-event:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
:is(#app-shell, .cal-demo) .cal-event .cal-event-text { -webkit-line-clamp: 3; }
:is(#app-shell, .cal-demo) .cal-event.tone-planned { background: var(--tone-planned-bg); color: var(--tone-planned-fg); border-left-color: rgba(0,0,0,0.22); }
:is(#app-shell, .cal-demo) .cal-event.tone-writing { background: var(--tone-writing-bg); color: var(--tone-writing-fg); pointer-events: auto; cursor: pointer; }
:is(#app-shell, .cal-demo) .cal-event.tone-ready { background: var(--tone-ready-bg); color: var(--tone-ready-fg); }
:is(#app-shell, .cal-demo) .cal-event.tone-draft { background: var(--tone-draft-bg); color: var(--tone-draft-fg); }
:is(#app-shell, .cal-demo) .cal-event.tone-live { background: var(--tone-live-bg); color: var(--tone-live-fg); }
:is(#app-shell, .cal-demo) .cal-event.tone-failed { background: var(--tone-failed-bg); color: var(--tone-failed-fg); }
:is(#app-shell, .cal-demo) .cal-event .cal-event-icon { width: 13px; height: 13px; margin-top: 2px; opacity: 0.85; }

/* Tabs + toolbar */
.list-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.tabs { display: flex; gap: 2px; padding: 3px; border-radius: var(--r-md); background: var(--surface2); overflow-x: auto; }
.tab {
  display: inline-flex; align-items: center; gap: 7px; white-space: nowrap;
  padding: 6px 12px; border: none; border-radius: var(--r-sm); background: transparent;
  font: inherit; font-size: 13px; font-weight: 550; color: var(--muted); cursor: pointer;
  transition: background 0.15s var(--ease), color 0.15s var(--ease), box-shadow 0.15s var(--ease);
}
.tab:hover { color: var(--text); }
.tab.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }
.tab-count { font-size: 11px; font-family: var(--mono); font-weight: 600; color: var(--muted); }
.tab.active .tab-count { color: var(--accent); }
.search-field { position: relative; }
.search-field svg { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); width: 15px; height: 15px; color: var(--muted); pointer-events: none; }
.shell .search-field input { padding-left: 33px !important; width: 260px; background: var(--surface); }

/* Articles table */
#app-shell .table-wrap { border-radius: var(--r-lg); box-shadow: var(--shadow-sm); overflow-x: auto; }
#app-shell th { padding: 10px 16px; font-size: 11px; letter-spacing: 0.06em; background: #FAFAFB; }
#app-shell td { padding: 12px 16px; font-size: 14px; }
#app-shell tr:hover td { background: #FAFAFB; }
#app-shell th.col-actions, #app-shell td.col-actions { text-align: right; }
.art-cell { display: flex; align-items: center; gap: 12px; min-width: 0; }
.art-cell-copy { min-width: 0; flex: 1; }
.art-title {
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  background: none; border: none; padding: 0; text-align: left; cursor: pointer;
  font-family: var(--font); font-size: 14px; font-weight: 600; line-height: 1.35; color: var(--text);
}
.art-title:hover { color: var(--accent); }
.art-kw {
  margin-top: 2px; font-size: 12px; color: var(--muted);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 52ch;
}
.art-error { margin-top: 4px; font-size: 12px; color: var(--tone-failed-fg); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 52ch; }
.art-date { font-size: 13px; white-space: nowrap; }
.art-date small { display: block; font-size: 12px; color: var(--muted); }
.row-actions { display: flex; gap: 6px; align-items: center; justify-content: flex-end; }
#app-shell .featured-thumb, #app-shell .featured-placeholder { width: 44px; height: 44px; border-radius: var(--r-sm); }
.cover-slot { position: relative; flex-shrink: 0; }
.art-progress { display: flex; flex-direction: column; gap: 6px; min-width: 140px; max-width: 220px; }
.art-progress-label { font-size: 12px; color: var(--muted); line-height: 1.3; }

/* Popover menu */
.pop-menu {
  position: fixed; z-index: 350; min-width: 210px; padding: 6px; display: none;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md);
  box-shadow: var(--shadow-lg);
}
.pop-menu.open { display: block; animation: fadeIn 0.12s var(--ease) both; }
.pop-item {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px;
  border: none; border-radius: 6px; background: none; cursor: pointer; text-align: left;
  font: inherit; font-size: 14px; color: var(--text);
}
.pop-item:hover { background: var(--surface2); }
.pop-item svg { width: 16px; height: 16px; color: var(--muted); }
.pop-item.danger, .pop-item.danger svg { color: var(--red); }
.pop-item.danger:hover { background: var(--tone-failed-bg); }
.pop-sep { height: 1px; margin: 4px 2px; background: var(--border); }

/* Ideas */
#app-shell .kw-grid { border-radius: var(--r-lg); box-shadow: var(--shadow-sm); }
#page-keywords .kw-row { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1.3fr) 110px 216px; padding: 12px 16px; }
#page-keywords .kw-header { padding: 10px 16px; font-size: 11px; letter-spacing: 0.06em; background: #FAFAFB; }
#page-keywords .kw-name { font-weight: 600; display: inline-flex; flex-wrap: wrap; align-items: center; gap: 8px; }
#page-keywords .kw-source-badge {
  display: inline-flex; align-items: center; font-size: 10px; font-weight: 700; letter-spacing: 0.04em;
  padding: 2px 6px; border-radius: 999px; background: rgba(0,113,227,0.12); color: var(--accent);
}
#page-keywords .kw-skel-row { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1.3fr) 110px 216px; }
.kw-actions { display: flex; gap: 6px; justify-content: flex-end; }
.kw-score { display: flex; flex-direction: column; gap: 4px; }
.kw-score span { font-size: 11px; font-family: var(--mono); color: var(--muted); }
.demo-note {
  display: flex; align-items: center; gap: 10px; margin-bottom: 14px; padding: 10px 14px;
  border-radius: var(--r-md); background: var(--tone-ready-bg); color: var(--tone-ready-fg); font-size: 13px;
}
.demo-note svg { width: 16px; height: 16px; flex-shrink: 0; }

/* Next-step banner (calendar / articles) */
.next-banner {
  display: flex; align-items: center; gap: 14px; margin-bottom: 18px; padding: 14px 16px;
  border-radius: var(--r-lg); border: 1px solid var(--border); background: var(--surface); box-shadow: var(--shadow-sm);
}
.next-banner-icon {
  width: 36px; height: 36px; border-radius: var(--r-md); flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
.next-banner-icon svg { width: 18px; height: 18px; }
.next-banner-copy { flex: 1; min-width: 0; }
.next-banner-copy strong { display: block; font-size: 14px; font-weight: 650; color: var(--text); }
.next-banner-copy span { display: block; font-size: 13px; color: var(--muted); margin-top: 1px; }

/* Settings */
.settings-layout { display: grid; grid-template-columns: 196px minmax(0, 1fr); gap: 32px; align-items: start; }
.settings-nav { position: sticky; top: 24px; display: flex; flex-direction: column; gap: 2px; }
.settings-nav a {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--r-sm);
  font-size: 14px; font-weight: 500; color: var(--muted); text-decoration: none;
  transition: background 0.15s var(--ease), color 0.15s var(--ease);
}
.settings-nav a:hover { color: var(--text); background: rgba(0,0,0,0.04); }
.settings-nav a.active { color: var(--accent); background: var(--accent-soft); font-weight: 600; }
.settings-nav svg { width: 16px; height: 16px; }
.settings-main { min-width: 0; }
#app-shell .settings-section { border-radius: var(--r-lg); box-shadow: var(--shadow-sm); padding: 24px; margin-bottom: 16px; scroll-margin-top: 24px; }
#app-shell .settings-title { font-size: 16px; margin-bottom: 4px; letter-spacing: -0.01em; }
#app-shell .settings-title svg { width: 17px; height: 17px; }
.settings-desc { font-size: 13px; color: var(--muted); line-height: 1.55; margin: 0 0 18px; max-width: 68ch; }
.settings-danger { border-color: rgba(255,59,48,0.22) !important; }
.settings-danger-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.save-bar {
  position: sticky; bottom: 16px; z-index: 20; margin-top: 8px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 12px 10px 18px; border-radius: var(--r-lg);
  background: rgba(29,29,31,0.94); color: #fff; box-shadow: var(--shadow-lg);
  font-size: 14px; font-weight: 500;
  opacity: 0; transform: translateY(14px); pointer-events: none;
  transition: opacity 0.25s var(--ease), transform 0.25s var(--ease);
}
.save-bar.visible { opacity: 1; transform: none; pointer-events: auto; }
.save-bar-actions { display: flex; gap: 8px; }
.save-bar .btn-quiet { color: rgba(255,255,255,0.75); }
.save-bar .btn-quiet:hover { color: #fff; background: rgba(255,255,255,0.1); }

/* Billing */
.usage-card { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 20px; align-items: center; padding: 20px 24px; margin-bottom: 20px; }
.usage-kicker { font-size: 12px; font-weight: 500; color: var(--muted); }
.usage-big { font-size: 28px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.2; margin-top: 2px; }
.usage-big small { font-size: 14px; font-weight: 500; color: var(--muted); letter-spacing: 0; }
.usage-card .quota-bar { height: 8px; margin-top: 12px; max-width: 520px; }
.usage-meta { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 10px; font-size: 13px; color: var(--muted); }
.plan-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; max-width: 820px; }
.plan-card { position: relative; display: flex; flex-direction: column; gap: 14px; padding: 22px; }
.plan-card.current { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.plan-tag {
  position: absolute; top: 18px; right: 18px; padding: 3px 9px; border-radius: 999px;
  font-size: 11px; font-weight: 650; background: var(--accent-soft); color: var(--accent);
}
.plan-name { font-size: 15px; font-weight: 650; }
.plan-amount { font-size: 30px; font-weight: 700; letter-spacing: -0.025em; line-height: 1.1; }
.plan-amount small { font-size: 14px; font-weight: 500; color: var(--muted); letter-spacing: 0; }
.plan-feats { list-style: none; display: flex; flex-direction: column; gap: 8px; font-size: 14px; color: var(--text); }
.plan-feats li { display: flex; align-items: flex-start; gap: 8px; }
.plan-feats svg { width: 16px; height: 16px; color: var(--green); flex-shrink: 0; margin-top: 2px; }
.plan-card .btn { margin-top: auto; }
.billing-notice {
  display: flex; align-items: flex-start; gap: 10px; margin-bottom: 18px; padding: 12px 14px;
  border-radius: var(--r-md); font-size: 14px; line-height: 1.5;
  background: var(--accent-soft); color: var(--text); border: 1px solid rgba(0,113,227,0.2);
}
.billing-notice.warn { background: var(--tone-failed-bg); border-color: rgba(255,59,48,0.22); }
.billing-notice svg { width: 18px; height: 18px; color: var(--accent); flex-shrink: 0; margin-top: 1px; }
.billing-notice.warn svg { color: var(--red); }

/* Admin */
.adm-bar { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  position: sticky; top: 0; z-index: 20; background: var(--bg); padding: 6px 0 16px; margin-bottom: 4px; }
.adm-title { font-size: 28px; font-weight: 700; letter-spacing: -0.025em; line-height: 1.15; }
.adm-sub { font-size: 14px; color: var(--muted); margin-top: 4px; }
.adm-tools { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.adm-updated { font-size: 12px; color: var(--muted); }
.adm-seg { display: inline-flex; background: var(--surface2); border-radius: 999px; padding: 3px; }
.adm-seg button { border: 0; background: transparent; padding: 6px 14px; border-radius: 999px; font: inherit; font-size: 13px;
  font-weight: 550; color: var(--muted); cursor: pointer; transition: background .15s, color .15s; }
.adm-seg button:hover { color: var(--text); }
.adm-seg button.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }
.adm-side-foot { margin-top: auto; padding: 12px 0 0; border-top: 1px solid var(--border); }
#admin-shell .sidebar { display: flex; flex-direction: column; }
.adm-hint { font-size: 12px; color: var(--muted); padding: 10px 20px 0; }
.adm-hint kbd, .adm-kbd { font-family: var(--mono); font-size: 11px; background: var(--surface2); border: 1px solid var(--border2);
  border-radius: 5px; padding: 1px 6px; }

.adm-stack { display: grid; gap: 16px; }
.adm-two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
.adm-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow-sm); min-width: 0; }
.adm-card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 14px 18px; border-bottom: 1px solid var(--border); }
.adm-card-head h3 { font-size: 14px; font-weight: 650; margin: 0; }
.adm-card-head p { font-size: 12px; color: var(--muted); margin: 2px 0 0; }
.adm-card-body { padding: 16px 18px; }
.adm-note { font-size: 13px; color: var(--muted); line-height: 1.5; margin: 0; }
.adm-banner { display: flex; gap: 10px; align-items: flex-start; padding: 12px 16px; border-radius: var(--r-md);
  background: var(--accent-soft); color: var(--text); font-size: 13px; line-height: 1.5; }
.adm-banner.warn { background: var(--tone-ready-bg); }
.adm-banner.bad { background: var(--tone-failed-bg); }

/* KPI cards */
.adm-kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; }
.adm-kpi { position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm); padding: 16px 16px 14px; min-width: 0; }
.adm-kpi-label { font-size: 12px; font-weight: 600; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.adm-kpi-value { font-size: 28px; font-weight: 700; letter-spacing: -0.03em; margin-top: 6px; font-variant-numeric: tabular-nums; line-height: 1.1; }
.adm-kpi-foot { font-size: 12px; color: var(--muted); margin-top: 8px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; line-height: 1.4; }
.adm-kpi .adm-spark { position: absolute; right: 14px; top: 16px; width: 64px; height: 26px; }
.adm-kpi.is-good .adm-kpi-value { color: var(--tone-live-fg); }
.adm-kpi.is-bad .adm-kpi-value { color: var(--tone-failed-fg); }
.adm-delta { font-weight: 650; font-size: 11px; padding: 2px 7px; border-radius: 999px; font-variant-numeric: tabular-nums; }
.adm-delta.up { background: var(--tone-live-bg); color: var(--tone-live-fg); }
.adm-delta.down { background: var(--tone-failed-bg); color: var(--tone-failed-fg); }
.adm-delta.flat { background: var(--surface2); color: var(--muted); }
.adm-strip { display: flex; flex-wrap: wrap; gap: 6px 22px; font-size: 13px; color: var(--muted); padding: 2px 4px; }
.adm-strip b { color: var(--text); font-weight: 650; font-variant-numeric: tabular-nums; }

/* Pills and chips */
.adm-pill { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 650; padding: 2px 9px; border-radius: 999px;
  background: var(--surface2); color: var(--muted); white-space: nowrap; }
.adm-pill.ok { background: var(--tone-live-bg); color: var(--tone-live-fg); }
.adm-pill.warn { background: var(--tone-ready-bg); color: var(--tone-ready-fg); }
.adm-pill.bad { background: var(--tone-failed-bg); color: var(--tone-failed-fg); }
.adm-pill.info { background: var(--tone-draft-bg); color: var(--tone-draft-fg); }
.adm-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.adm-chip { border: 1px solid var(--border2); background: var(--surface); color: var(--text); font: inherit; font-size: 13px; font-weight: 550;
  padding: 6px 12px; border-radius: 999px; cursor: pointer; display: inline-flex; align-items: center; gap: 7px; transition: all .15s; }
.adm-chip:hover { border-color: var(--accent); }
.adm-chip.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.adm-chip em { font-style: normal; font-size: 11px; opacity: .7; font-variant-numeric: tabular-nums; }

/* Charts */
.adm-chart { position: relative; width: 100%; min-height: 200px; }
.adm-chart svg { display: block; width: 100%; overflow: visible; }
.adm-chart text { font-family: var(--font); font-size: 11px; fill: var(--muted); }
.adm-tip { position: absolute; pointer-events: none; background: #1D1D1F; color: #fff; border-radius: 9px; padding: 7px 10px;
  font-size: 12px; line-height: 1.4; white-space: nowrap; transform: translate(-50%, calc(-100% - 12px)); opacity: 0; transition: opacity .1s; z-index: 5;
  box-shadow: 0 6px 18px rgba(0,0,0,.2); }
.adm-tip.show { opacity: 1; }
.adm-tip b { font-weight: 700; font-size: 13px; display: block; }
.adm-tip span { opacity: .7; }
.adm-empty { padding: 28px 16px; text-align: center; color: var(--muted); font-size: 13px; line-height: 1.5; }
.adm-empty strong { display: block; color: var(--text); font-size: 14px; margin-bottom: 4px; }

/* Funnel */
.adm-funnel-row { display: grid; grid-template-columns: minmax(120px, 190px) 1fr 52px 56px; gap: 12px; align-items: center; padding: 6px 0; font-size: 13px; }
.adm-funnel-track { height: 22px; background: var(--surface2); border-radius: 7px; overflow: hidden; }
.adm-funnel-track i { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), #4DA3FF); border-radius: 7px; min-width: 3px; }
.adm-funnel-row b { text-align: right; font-variant-numeric: tabular-nums; }
.adm-funnel-row span.pct { text-align: right; color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }

/* Donut */
.adm-donut { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }
.adm-donut svg { width: 132px; height: 132px; flex: none; }
.adm-donut .seg { cursor: pointer; transition: opacity .15s; }
.adm-donut:hover .seg { opacity: .55; }
.adm-donut .seg:hover { opacity: 1; }
.adm-donut-center { font-family: var(--font); fill: var(--text); font-weight: 700; font-size: 22px; }
.adm-donut-sub { font-family: var(--font); fill: var(--muted); font-size: 10px; }
.adm-legend { display: grid; gap: 6px; font-size: 13px; flex: 1; min-width: 150px; }
.adm-legend div { display: flex; align-items: center; gap: 8px; }
.adm-legend i { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.adm-legend b { margin-left: auto; font-variant-numeric: tabular-nums; }
.adm-legend small { color: var(--muted); font-size: 12px; min-width: 38px; text-align: right; }

/* Segments (who to talk to) */
.adm-seg-list { display: grid; gap: 2px; margin-top: 12px; }
.adm-user-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; text-align: left;
  border: 0; background: transparent; font: inherit; font-size: 13px; padding: 9px 10px; border-radius: var(--r-md); cursor: pointer; }
.adm-user-row:hover { background: var(--accent-soft); }
.adm-user-row .id { font-family: var(--mono); font-size: 11px; color: var(--muted); margin-right: 8px; }
.adm-user-row .note { color: var(--muted); font-size: 12px; white-space: nowrap; }
.adm-user-row .mail { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }

/* Tables */
.adm-table-wrap { overflow-x: auto; }
.adm-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.adm-table th { text-align: left; font-size: 11px; font-weight: 650; text-transform: uppercase; letter-spacing: .04em; color: var(--muted);
  padding: 10px 14px; border-bottom: 1px solid var(--border); white-space: nowrap; background: var(--surface); position: sticky; top: 0; }
.adm-table th.sort { cursor: pointer; user-select: none; }
.adm-table th.sort:hover { color: var(--text); }
.adm-table th.sorted { color: var(--accent); }
.adm-table td { padding: 11px 14px; border-bottom: 1px solid var(--border); white-space: nowrap; vertical-align: middle; }
.adm-table tr:last-child td { border-bottom: 0; }
.adm-table tr.click { cursor: pointer; }
.adm-table tr.click:hover td { background: var(--accent-soft); }
.adm-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.adm-table .mono { font-family: var(--mono); font-size: 12px; color: var(--muted); }
.adm-table .wrap { white-space: normal; max-width: 340px; }
.adm-link { border: 0; background: none; padding: 0; font: inherit; color: var(--accent); cursor: pointer; text-align: left; }
.adm-link:hover { text-decoration: underline; }
.adm-bar2 { width: 90px; height: 8px; border-radius: 99px; background: var(--surface2); overflow: hidden; display: inline-block; vertical-align: middle; }
.adm-bar2 i { display: block; height: 100%; background: var(--green); border-radius: 99px; }
.adm-bar2.watch i { background: var(--amber); }
.adm-bar2.costly i { background: var(--red); }
.adm-toolbar { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.adm-search { position: relative; flex: 1 1 240px; min-width: 200px; max-width: 360px; }
.adm-search input, .adm-search input[type="search"] { width: 100%; padding: 9px 12px 9px 36px !important; border: 1px solid var(--border2); border-radius: var(--r-md); font: inherit; font-size: 14px; background: var(--surface); color: var(--text); }
.adm-search input:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: transparent; }
.adm-search svg, .adm-search i { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); width: 15px; height: 15px; color: var(--muted); pointer-events: none; }
.adm-pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 18px; border-top: 1px solid var(--border); font-size: 13px; color: var(--muted); }
.adm-pager div { display: flex; gap: 8px; }

/* Forms */
.adm-form { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.adm-form .full { grid-column: 1 / -1; }
.adm-field label { display: block; font-size: 12px; font-weight: 600; color: var(--muted); margin-bottom: 5px; }
.adm-input, .adm-field input, .adm-field select, .adm-field textarea { width: 100%; padding: 9px 12px; border: 1px solid var(--border2); border-radius: var(--r-md);
  font: inherit; font-size: 14px; background: var(--surface); color: var(--text); }
.adm-field textarea { min-height: 220px; resize: vertical; line-height: 1.55; }
.adm-field input:focus, .adm-field select:focus, .adm-field textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: transparent; }
.adm-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.adm-sm { padding: 6px 12px !important; font-size: 13px !important; }
details.adm-details > summary { cursor: pointer; font-size: 14px; font-weight: 650; padding: 14px 18px; list-style: none; display: flex; justify-content: space-between; align-items: center; }
details.adm-details > summary::-webkit-details-marker { display: none; }
details.adm-details[open] > summary { border-bottom: 1px solid var(--border); }

/* Drawer */
.adm-scrim { position: fixed; inset: 0; background: rgba(0,0,0,.28); opacity: 0; pointer-events: none; transition: opacity .2s; z-index: 55; }
.adm-scrim.open { opacity: 1; pointer-events: auto; }
.adm-drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(580px, 100vw); background: var(--surface); z-index: 60;
  transform: translateX(104%); transition: transform .28s var(--ease); display: flex; flex-direction: column; box-shadow: var(--shadow-lg); }
.adm-drawer.open { transform: none; }
.adm-drawer-head { padding: 20px 22px 0; border-bottom: 1px solid var(--border); }
.adm-drawer-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.adm-drawer-mail { font-size: 18px; font-weight: 700; letter-spacing: -0.015em; word-break: break-all; }
.adm-idchip { display: inline-flex; align-items: center; gap: 8px; margin-top: 8px; font-family: var(--mono); font-size: 13px; font-weight: 650;
  background: var(--accent-soft); color: var(--accent); padding: 4px 6px 4px 10px; border-radius: 999px; }
.adm-idchip button { border: 0; background: var(--surface); color: var(--accent); border-radius: 99px; width: 22px; height: 22px; cursor: pointer; display: grid; place-items: center; }
.adm-idchip button i, .adm-idchip button svg { width: 12px; height: 12px; }
.adm-tabs { display: flex; gap: 4px; margin-top: 16px; }
.adm-tabs button { border: 0; background: none; font: inherit; font-size: 14px; font-weight: 600; color: var(--muted); padding: 10px 12px; cursor: pointer;
  border-bottom: 2px solid transparent; margin-bottom: -1px; }
.adm-tabs button:hover { color: var(--text); }
.adm-tabs button.active { color: var(--accent); border-bottom-color: var(--accent); }
.adm-drawer-body { padding: 20px 22px 40px; overflow-y: auto; flex: 1; display: grid; gap: 18px; align-content: start; }
.adm-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.adm-fact { background: var(--bg); border-radius: var(--r-md); padding: 11px 13px; min-width: 0; }
.adm-fact > span { display: block; font-size: 11px; font-weight: 600; color: var(--muted); }
.adm-fact strong { display: block; font-size: 14px; font-weight: 650; margin-top: 3px; overflow-wrap: anywhere; }
.adm-section-title { font-size: 12px; font-weight: 650; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; margin: 0 0 10px; }
.adm-site { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--r-md); }
.adm-site a { color: var(--accent); text-decoration: none; font-size: 13px; word-break: break-all; }
.adm-site small { color: var(--muted); display: block; font-size: 12px; margin-top: 2px; }
.adm-timeline { display: grid; gap: 0; }
.adm-tl { display: grid; grid-template-columns: 14px 1fr auto; gap: 12px; padding: 10px 0; font-size: 13px; position: relative; }
.adm-tl::before { content: ''; position: absolute; left: 6px; top: 24px; bottom: -10px; width: 2px; background: var(--border); }
.adm-tl:last-child::before { display: none; }
.adm-tl i { width: 14px; height: 14px; border-radius: 50%; background: var(--green); margin-top: 3px; border: 3px solid var(--surface); box-shadow: 0 0 0 1px var(--border2); }
.adm-tl.bad i { background: var(--red); }
.adm-tl.warn i { background: var(--amber); }
.adm-tl.info i { background: var(--accent); }
.adm-tl small { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; overflow-wrap: anywhere; }
.adm-tl time { font-size: 12px; color: var(--muted); white-space: nowrap; }

/* Article reader */
.adm-modal-wrap { position: fixed; inset: 0; z-index: 70; display: none; align-items: center; justify-content: center; padding: 20px; }
.adm-modal-wrap.open { display: flex; }
.adm-modal-back { position: absolute; inset: 0; background: rgba(0,0,0,.4); backdrop-filter: blur(4px); }
.adm-modal { position: relative; background: var(--surface); border-radius: var(--r-xl); box-shadow: var(--shadow-lg); width: min(860px, 100%); max-height: 90vh; display: flex; flex-direction: column; overflow: hidden; }
.adm-modal-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 20px 24px 14px; border-bottom: 1px solid var(--border); }
.adm-modal-head h3 { margin: 0; font-size: 18px; font-weight: 700; letter-spacing: -0.015em; }
.adm-modal-head p { margin: 4px 0 0; font-size: 12px; color: var(--muted); }
.adm-modal iframe { border: 0; width: 100%; flex: 1; min-height: 60vh; background: #fff; }

/* Email */
.adm-email { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 16px; align-items: start; }
.adm-conds { display: grid; gap: 8px; }
.adm-cond { display: grid; grid-template-columns: 1.4fr 1fr 1fr auto; gap: 8px; align-items: center; }
.adm-cond select, .adm-cond input { width: 100%; padding: 8px 10px; border: 1px solid var(--border2); border-radius: var(--r-md); font: inherit; font-size: 13px; background: var(--surface); }
.adm-mail-body.is-html { white-space: normal; }
.adm-mail-body.is-html img { max-width: 100%; height: auto; }
.tox-tinymce { border-radius: var(--r-md) !important; border-color: var(--border2) !important; }
@media (max-width: 800px) {
  .adm-cond { grid-template-columns: 1fr; }
}
.adm-tpl-list { display: grid; gap: 6px; padding: 10px; }
.adm-tpl { text-align: left; border: 1px solid transparent; background: transparent; font: inherit; padding: 11px 12px; border-radius: var(--r-md); cursor: pointer; }
.adm-tpl:hover { background: var(--bg); }
.adm-tpl.active { background: var(--accent-soft); border-color: rgba(0,113,227,.25); }
.adm-tpl strong { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 14px; }
.adm-tpl small { display: block; color: var(--muted); font-size: 12px; margin-top: 3px; line-height: 1.4; }
.adm-tpl-sep { height: 1px; background: var(--border); margin: 4px 6px; }
.adm-ph { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin: 8px 0 0; font-size: 12px; color: var(--muted); }
.adm-ph button { font-family: var(--mono); font-size: 12px; border: 1px dashed var(--border2); background: var(--surface); border-radius: 7px; padding: 3px 8px; cursor: pointer; color: var(--accent); }
.adm-ph button:hover { background: var(--accent-soft); }
.adm-mail { border: 1px solid var(--border); border-radius: var(--r-lg); background: #fff; overflow: hidden; }
.adm-mail-head { padding: 14px 18px; background: var(--bg); border-bottom: 1px solid var(--border); font-size: 13px; }
.adm-mail-head div { color: var(--muted); font-size: 12px; }
.adm-mail-head strong { font-size: 15px; display: block; margin-top: 3px; }
.adm-mail-body { padding: 18px; white-space: pre-wrap; font-size: 14px; line-height: 1.65; }
.adm-suggest { position: relative; }
.adm-suggest-list { position: absolute; left: 0; right: 0; top: calc(100% + 4px); background: var(--surface); border: 1px solid var(--border2); border-radius: var(--r-md);
  box-shadow: var(--shadow-lg); z-index: 10; overflow: hidden; }
.adm-suggest-list:empty { display: none; }

/* Skeleton */
.adm-skel { display: grid; gap: 16px; }
.adm-skel .row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.adm-skel .box { height: 104px; border-radius: var(--r-lg); background: linear-gradient(90deg, var(--surface2) 25%, #F6F6F8 50%, var(--surface2) 75%); background-size: 200% 100%; animation: adm-shine 1.2s linear infinite; }
.adm-skel .box.tall { height: 260px; }
@keyframes adm-shine { to { background-position: -200% 0; } }

@media (max-width: 1000px) {
  .adm-two, .adm-email { grid-template-columns: 1fr; }
  .adm-skel .row { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 700px) {
  .adm-form, .adm-facts { grid-template-columns: 1fr; }
  .adm-funnel-row { grid-template-columns: 110px 1fr 44px 48px; gap: 8px; }
  .adm-bar { position: static; }
}

/* Modals */
.modal-overlay { background: rgba(0,0,0,0.28); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.modal-overlay .modal { border: none; border-radius: var(--r-xl); box-shadow: var(--shadow-lg); }
.modal-overlay .modal-header { padding: 20px 24px 0; }
.modal-overlay .modal-title { font-size: 20px; letter-spacing: -0.02em; line-height: 1.3; }
.modal-subtitle { font-size: 13px; color: var(--muted); margin-top: 4px; line-height: 1.45; }
.modal-overlay .modal-body { padding: 18px 24px 20px; }
.modal-overlay .modal-actions { padding: 14px 24px; background: #FAFAFB; gap: 8px; align-items: center; }
.modal-actions .spacer { flex: 1; }
.modal-overlay .modal-close-x { width: 32px; height: 32px; margin: -4px -6px 0 0; font-size: 22px; }
.modal-steps { display: flex; align-items: center; gap: 8px; margin-top: 12px; font-size: 12px; color: var(--muted); }
.modal-step { display: inline-flex; align-items: center; gap: 6px; font-weight: 550; }
.modal-step b {
  width: 20px; height: 20px; border-radius: 50%; font-size: 11px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--surface2); color: var(--muted);
}
.modal-step.active { color: var(--text); }
.modal-step.active b { background: var(--accent); color: #fff; }
.modal-step.done b { background: var(--accent-soft); color: var(--accent); }
.modal-step-sep { width: 24px; height: 1px; background: var(--border2); }
.step-panel { display: none; }
.step-panel.active { display: block; animation: enter 0.25s var(--ease) both; }
.form-stack { display: flex; flex-direction: column; gap: 18px; }
.topic-summary {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: var(--r-md);
  background: var(--surface2); font-size: 14px; font-weight: 550;
}
.topic-summary svg { width: 16px; height: 16px; color: var(--accent); flex-shrink: 0; }
.topic-summary span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.modal.modal-confirm { width: 440px; }
.modal.modal-correction { width: min(560px, calc(100vw - 32px)); }
#correction-topic-pane[hidden],
#correction-facts-pane[hidden] { display: none !important; }
.correction-choices { display: flex; flex-direction: column; gap: 8px; margin: 14px 0 4px; }
.correction-choice {
  text-align: left; padding: 12px 14px; border-radius: 12px;
  border: 1px solid var(--border); background: var(--surface2); color: var(--text);
  cursor: pointer;
}
.correction-choice strong { display: block; font-size: 14px; }
.correction-choice small { display: block; margin-top: 2px; color: var(--muted); font-size: 13px; line-height: 1.4; }
.correction-choice.is-on { border-color: var(--accent); background: rgba(0, 113, 227, 0.08); }
#correction-topic-pane, #correction-facts-pane { margin-top: 14px; }
.fact-list { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.fact-row {
  display: flex; gap: 12px; align-items: flex-start; justify-content: space-between;
  padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px;
}
.fact-row span { font-size: 14px; line-height: 1.45; }
/* Reconnect sheet form tweaks */
body.route-connect .wizard-wrap .url-row { margin-top: 4px; }
body.route-connect .wizard-wrap .url-row input { flex: 1; min-width: 140px; }
body.route-connect #wiz-reconnect-actions { justify-content: flex-end; }
body.route-connect #wiz-reconnect-actions .btn-primary { margin-left: auto; }
body.route-connect .wizard-wrap .btn,
body.route-connect .wizard-wrap .btn-sm {
  /* match shell button polish inside the sheet */
  border-radius: var(--r-md);
}
@media (max-width: 560px) {
  body.route-connect .wizard-wrap .url-row { flex-direction: column; }
  body.route-connect .wizard-wrap .url-row .btn { width: 100%; justify-content: center; }
  body.route-connect #wiz-reconnect-actions { flex-direction: column-reverse; align-items: stretch; }
  body.route-connect #wiz-reconnect-actions .btn-primary { margin-left: 0; }
}
.cms-tip-bubble {
  position: fixed; z-index: 360; width: min(280px, calc(100vw - 16px));
  padding: 12px 14px; display: none;
  background: var(--surface); color: var(--text);
  border: 1px solid var(--border); border-radius: 12px;
  box-shadow: var(--shadow-lg);
  font-size: 13px; line-height: 1.45;
}
.cms-tip-bubble.open { display: block; animation: fadeIn 0.12s var(--ease) both; }
.cms-tip-bubble[hidden] { display: none !important; }
.cms-tip-bubble::before {
  content: ''; position: absolute; left: var(--cms-tip-arrow-x, 50%);
  width: 10px; height: 10px; background: var(--surface);
  border-left: 1px solid var(--border); border-top: 1px solid var(--border);
  transform: translateX(-50%) rotate(45deg);
}
.cms-tip-bubble[data-place="below"]::before { top: -6px; }
.cms-tip-bubble[data-place="above"]::before {
  bottom: -6px; top: auto;
  border: none; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border);
}
.cms-tip-bubble-title {
  font-size: 13px; font-weight: 650; letter-spacing: -0.01em; margin: 0 0 8px;
}
.cms-tip-steps {
  margin: 0; padding-left: 16px; color: var(--muted);
}
.cms-tip-steps li + li { margin-top: 4px; }
.cms-tip-steps strong { color: var(--text); font-weight: 600; }
.confirm-icon {
  width: 40px; height: 40px; border-radius: var(--r-md); margin-bottom: 14px;
  display: flex; align-items: center; justify-content: center;
  background: var(--accent-soft); color: var(--accent);
}
.confirm-icon.danger { background: var(--tone-failed-bg); color: var(--red); }
.confirm-icon svg { width: 20px; height: 20px; }
.confirm-title { font-size: 18px; font-weight: 700; letter-spacing: -0.02em; margin-bottom: 6px; }
.confirm-body { font-size: 14px; color: var(--muted); line-height: 1.55; }
.detail-status { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 8px; }
.detail-status-meta { font-size: 13px; color: var(--muted); }
.next-step {
  display: flex; gap: 10px; margin: 0 0 16px; padding: 12px 14px; border-radius: var(--r-md);
  background: var(--bg); border: 1px solid var(--border); font-size: 13px; line-height: 1.5; color: var(--text);
}
.next-step svg { width: 16px; height: 16px; color: var(--accent); flex-shrink: 0; margin-top: 2px; }
.next-step.failed { background: var(--tone-failed-bg); border-color: rgba(255,59,48,0.2); color: var(--tone-failed-fg); }
.next-step.failed svg { color: var(--red); }
.progress-panel {
  display: flex; flex-direction: column; gap: 10px; margin-bottom: 16px; padding: 16px;
  border-radius: var(--r-lg); background: var(--accent-soft);
}
.progress-panel-head { display: flex; align-items: center; gap: 10px; font-size: 14px; font-weight: 600; color: var(--accent); }
.progress-panel-head .pct { margin-left: auto; font-family: var(--mono); }
.progress-panel .gen-progress-track { height: 6px; }
.progress-panel-note { font-size: 12px; color: var(--muted); line-height: 1.45; }
#cal-article-modal .modal-actions .btn-danger-quiet { margin-right: auto; }
.modal-overlay .preview-header { padding: 20px 24px 16px; }
.modal-overlay .preview-title { font-size: 21px; padding-right: 40px; letter-spacing: -0.02em; }
.preview-head-row { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.modal-overlay .preview-header .modal-close-x { position: absolute; top: 16px; right: 18px; margin: 0; }
.modal-overlay .preview-footer { padding: 14px 24px; background: #FAFAFB; gap: 8px; }

/* Toast — top-center, strong color, hard to miss */
.toast {
  top: 22px; bottom: auto; left: 50%; right: auto;
  width: min(540px, calc(100vw - 28px));
  padding: 16px 18px; gap: 14px;
  border: 2px solid var(--border2); border-radius: 16px;
  background: var(--surface); color: var(--text);
  font-size: 16px; font-weight: 600; letter-spacing: -0.015em;
  box-shadow: 0 12px 40px rgba(0,0,0,0.18), 0 4px 12px rgba(0,0,0,0.08);
  transform: translateX(-50%) translateY(-14px) scale(0.98);
  transition: transform 0.3s var(--ease), opacity 0.3s var(--ease);
}
.toast.show {
  transform: translateX(-50%) translateY(0) scale(1);
  animation: toastIn 0.35s var(--ease) both;
}
@keyframes toastIn {
  from { opacity: 0; transform: translateX(-50%) translateY(-20px) scale(0.96); }
  to { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); }
}
.toast-success {
  background: #ECFDF3; color: #166534;
  border-color: rgba(34, 197, 94, 0.55);
}
.toast-info {
  background: #EFF6FF; color: #1D4ED8;
  border-color: rgba(0, 113, 227, 0.45);
}
.toast-error {
  background: #FEF2F2; color: #B91C1C;
  border-color: rgba(239, 68, 68, 0.55);
}
.toast-icon {
  width: 36px; height: 36px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
.toast-success .toast-icon { background: rgba(34, 197, 94, 0.22); color: #15803D; }
.toast-info .toast-icon { background: rgba(0, 113, 227, 0.16); color: var(--accent); }
.toast-error .toast-icon { background: rgba(239, 68, 68, 0.18); color: #DC2626; }
.toast-icon svg { width: 20px; height: 20px; }
.toast-msg { flex: 1; line-height: 1.4; min-width: 0; }
.toast-action { flex-shrink: 0; }
.toast .toast-close {
  width: 32px; height: 32px; font-size: 20px; border-radius: 50%;
  background: rgba(0,0,0,0.06); border: none; color: inherit; cursor: pointer;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
  opacity: 0.8;
}
.toast .toast-close:hover { opacity: 1; background: rgba(0,0,0,0.1); }
@media (max-width: 560px) {
  .toast { top: 12px; width: calc(100vw - 20px); font-size: 15px; padding: 14px 14px; }
}

/* Responsive */
@media (max-width: 1180px) {
  #app-shell .stats-grid { grid-template-columns: repeat(2, 1fr); }
  #page-keywords .kw-row, #page-keywords .kw-skel-row { grid-template-columns: minmax(0, 1fr) 100px 200px; }
  #page-keywords .kw-angle, #page-keywords .kw-header span:nth-child(2) { display: none; }
}
@media (max-width: 960px) {
  #app-shell, #admin-shell { grid-template-columns: 1fr; }
  #admin-shell .sidebar { position: relative; height: auto; border-right: none; border-bottom: 1px solid var(--border); }
  #admin-shell .sidebar nav { display: flex; flex-wrap: wrap; gap: 2px; padding: 0 8px; }
  #admin-shell .main { padding: 20px 16px 48px; }
  #app-shell .sidebar { position: relative; height: auto; border-right: none; border-bottom: 1px solid var(--border); }
  #app-shell .sidebar nav { display: flex; flex-wrap: wrap; gap: 2px; padding: 0 8px; }
  #app-shell .nav-label { display: none; }
  #app-shell .nav-item.active::before { display: none; }
  #app-shell .sidebar-footer { position: absolute; top: 12px; right: 12px; padding: 0; border: none; margin: 0; }
  #app-shell .sidebar-footer .quota-card,
  #app-shell .sidebar-footer .sidebar-legal { display: none; }
  #app-shell .sidebar-brand { padding-right: 120px; }
  #app-shell .main { padding: 20px 16px 48px; }
  .settings-layout { grid-template-columns: 1fr; }
  .settings-nav { display: none; }
  .settings-skel-grid { grid-template-columns: 1fr; }
  .plan-grid { grid-template-columns: 1fr; max-width: none; }
  :is(#app-shell, .cal-demo) .cal-cell { min-height: 96px; padding: 6px; }
  .cal-legend { display: none; }
  .shell .search-field input { width: 100%; }
  .usage-card { grid-template-columns: 1fr; }
}

/* Stitch landing — scoped so app chrome keeps Switzer / existing controls */
#gate-url {
  font-family: "Plus Jakarta Sans", system-ui, sans-serif;
  background: #f8fafc;
  color: #1e293b;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
#gate-url.gate-panel.active { animation: fadeIn 0.35s ease both; }
#gate-url :is(button, input, a, h1, h2, h3, p, span) { font-family: inherit; }
:where(#gate-url) .material-symbols-outlined { font-size: 20px; }
#gate-url .material-symbols-outlined {
  font-family: "Material Symbols Outlined";
  font-weight: normal;
  font-style: normal;
  line-height: 1;
  letter-spacing: normal;
  text-transform: none;
  display: inline-block;
  white-space: nowrap;
  word-wrap: normal;
  direction: ltr;
  font-variation-settings: "FILL" 0, "wght" 400, "GRAD" 0, "opsz" 24;
  -webkit-font-smoothing: antialiased;
}
#gate-url [hidden] { display: none !important; }


/* Account (inside Settings) */
.acct-rows { display: grid; }
.acct-row { padding: 14px 0; border-top: 1px solid var(--border); }
.acct-row:first-child { border-top: 0; padding-top: 4px; }
.acct-row-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.acct-row-main { min-width: 0; }
.acct-label { font-size: 12px; font-weight: 600; color: var(--muted); margin-bottom: 2px; }
.acct-value { font-size: 14px; font-weight: 550; overflow-wrap: anywhere; }
.acct-value.acct-muted { font-weight: 400; color: var(--muted); font-size: 13px; line-height: 1.5; max-width: 54ch; }
.acct-dots { letter-spacing: 2px; color: var(--muted); }
.acct-form { display: grid; gap: 12px; max-width: 360px; margin-top: 14px; padding: 16px; background: var(--bg); border-radius: var(--r-md); }
.acct-form[hidden] { display: none; }
.acct-form .form-group { margin: 0; }
.acct-form-actions { display: flex; gap: 8px; align-items: center; }
.acct-show { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); cursor: pointer; }
.acct-pending { display: flex; align-items: center; gap: 12px; margin-top: 12px; padding: 10px 12px; border-radius: var(--r-md);
  background: var(--tone-ready-bg); color: var(--text); font-size: 13px; }
.acct-pending[hidden] { display: none; }
.acct-pending svg { width: 18px; height: 18px; color: var(--tone-ready-fg); flex: none; }
.acct-pending-text { display: grid; gap: 1px; min-width: 0; flex: 1; }
.acct-pending-text span { color: var(--muted); font-size: 12px; }
.acct-pending-actions { display: flex; gap: 12px; flex: none; }
.acct-ok { color: var(--tone-live-fg) !important; }
.acct-bad { color: var(--tone-failed-fg) !important; }
@media (max-width: 600px) {
  .acct-row-head { align-items: flex-start; }
  .acct-pending { flex-wrap: wrap; }
}


/* Billing page */
.bill-hero {
  position: relative; overflow: hidden; margin-bottom: 28px; padding: 24px 26px;
  display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px 40px; align-items: start;
  background:
    radial-gradient(90% 140% at 100% 0%, rgba(0,113,227,0.14), transparent 60%),
    linear-gradient(145deg, #F4F8FF 0%, #E6F0FF 100%);
  border-color: rgba(0,113,227,0.16);
}
.bill-hero.has-plan { grid-template-columns: minmax(0, 1.1fr) minmax(240px, 0.9fr); align-items: center; }
.bill-hero-kicker { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 600; color: var(--muted); }
.bill-hero-kicker svg { width: 14px; height: 14px; color: var(--accent); }
.bill-hero-title { font-size: 28px; font-weight: 700; letter-spacing: -0.025em; line-height: 1.15; margin-top: 4px; }
.bill-hero-lead { margin-top: 6px; font-size: 14px; color: var(--muted); max-width: 52ch; line-height: 1.5; }
.bill-hero-perks { gap: 8px; font-size: 13.5px; }
.bill-hero-actions { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; margin-top: 16px; }
.bill-interval { display: inline-flex; padding: 3px; border-radius: 999px; background: rgba(0,113,227,0.10); border: 1px solid rgba(0,113,227,0.28); }
.bill-interval button {
  border: 0; background: transparent; font: inherit; font-size: 13px; font-weight: 650;
  padding: 6px 14px; border-radius: 999px; cursor: pointer; color: #4A5D73;
}
.bill-interval button.is-on { background: var(--accent); color: #fff; box-shadow: 0 1px 2px rgba(0,71,150,0.35); }
.bill-interval-note { margin: 0; font-size: 13px; color: var(--muted); }
.bill-honest { margin: 0; font-size: 13px; line-height: 1.5; color: var(--muted); max-width: 42ch; }
.bill-honest strong { display: block; color: var(--text); font-weight: 650; }
.bill-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px 24px; margin-top: 18px; max-width: 640px; }
.bill-fact dt { font-size: 11px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); }
.bill-fact dd { margin: 2px 0 0; font-size: 14px; font-weight: 600; color: var(--text); display: flex; align-items: center; gap: 6px; }
.bill-fact dd small { font-weight: 450; color: var(--muted); font-size: 12px; }
.bill-card-brand {
  display: inline-grid; place-items: center; min-width: 34px; height: 22px; padding: 0 6px; border-radius: 5px;
  font-size: 10px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase;
  background: #fff; border: 1px solid var(--border2); color: var(--text);
}
.bill-manage { padding: 4px 0; }
.bill-manage-row {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 14px 20px; border-top: 1px solid var(--border);
}
.bill-manage-row:first-child { border-top: 0; }
.bill-manage-main { min-width: 0; }
.bill-manage-label { font-size: 14px; font-weight: 600; }
.bill-manage-hint { font-size: 13px; color: var(--muted); margin-top: 2px; line-height: 1.45; }
.bill-manage-actions { display: flex; flex-wrap: wrap; gap: 8px; flex: none; }
.bill-manage-empty { padding: 18px 20px; font-size: 13px; color: var(--muted); line-height: 1.5; }
@media (max-width: 640px) {
  .bill-manage-row { flex-direction: column; align-items: stretch; }
  .bill-manage-actions .btn { width: 100%; justify-content: center; }
}
.bill-section { margin-bottom: 28px; }
.bill-section[hidden] { display: none; }
.bill-section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 12px; }
.bill-section-title { font-size: 16px; font-weight: 650; letter-spacing: -0.01em; }
.bill-section-sub { font-size: 13px; color: var(--muted); margin-top: 2px; line-height: 1.45; }
.bill-sites { padding: 4px 0; }
.bill-site { display: flex; align-items: center; gap: 12px; padding: 12px 20px; border-top: 1px solid var(--border); }
.bill-site:first-child { border-top: 0; }
.bill-site-main { min-width: 0; flex: 1; }
.bill-site-name { font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bill-site-host { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bill-site-state { flex: none; text-align: right; font-size: 13px; color: var(--muted); display: grid; gap: 2px; justify-items: end; }
.bill-sites-foot { padding: 12px 20px; border-top: 1px solid var(--border); font-size: 13px; color: var(--muted); background: var(--bg); border-radius: 0 0 var(--r-lg) var(--r-lg); }
.bill-plan-note { margin-top: 8px; font-size: 13px; color: var(--muted); line-height: 1.5; max-width: 38ch; }
.bill-invoices { padding: 0; overflow: hidden; }
.bill-inv-row { display: grid; grid-template-columns: 110px minmax(0, 1fr) 90px 90px auto; gap: 12px; align-items: center; padding: 12px 20px; border-top: 1px solid var(--border); font-size: 13px; }
.bill-inv-row:first-child { border-top: 0; }
.bill-inv-row.head { background: var(--surface2); font-size: 11px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); padding-top: 10px; padding-bottom: 10px; }
.bill-inv-num { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bill-inv-amt { font-weight: 600; font-variant-numeric: tabular-nums; }
.bill-inv-links { display: flex; gap: 12px; justify-content: flex-end; }
.bill-inv-links a { color: var(--accent); font-weight: 600; text-decoration: none; }
.bill-inv-links a:hover { text-decoration: underline; }
.bill-empty { padding: 22px 20px; font-size: 13px; color: var(--muted); text-align: center; }
.bill-foot { margin: -8px 0 8px; font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.bill-foot[hidden] { display: none; }
@media (max-width: 760px) {
  .bill-hero,
  .bill-hero.has-plan { grid-template-columns: 1fr; padding: 20px; }
  .bill-hero-actions { align-items: stretch; }
  .bill-hero-actions .btn { width: 100%; }
  .bill-section-head { flex-wrap: wrap; align-items: flex-start; }
  .bill-site { padding: 12px 16px; }
  .bill-inv-row { grid-template-columns: 1fr auto; row-gap: 4px; }
  .bill-inv-row.head { display: none; }
  .bill-inv-num { display: none; }
  .bill-inv-links { grid-column: 1 / -1; justify-content: flex-start; }
}

/* Billing FAQ */
.bill-faq { margin-top: 8px; }
.bill-faq-list { padding: 6px; overflow: hidden; }
.bill-faq-item { border-radius: var(--r-md); transition: background 0.25s var(--ease); }
.bill-faq-item + .bill-faq-item { margin-top: 2px; }
.bill-faq-item:hover { background: rgba(0,0,0,0.02); }
.bill-faq-item.open { background: var(--accent-soft); }
.bill-faq-h { margin: 0; font-size: inherit; font-weight: inherit; }
.bill-faq-q {
  width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 14px 16px; background: none; border: 0; cursor: pointer; text-align: left;
  font: inherit; font-size: 14px; font-weight: 600; line-height: 1.4; color: var(--text);
  border-radius: var(--r-md); transition: color 0.2s var(--ease);
}
.bill-faq-q:hover { color: var(--accent); }
.bill-faq-q:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.bill-faq-item.open .bill-faq-q { color: var(--accent); }
.bill-faq-icon {
  position: relative; flex: none; width: 22px; height: 22px; border-radius: 50%;
  background: var(--surface2); transition: background 0.25s var(--ease), transform 0.35s var(--ease);
}
.bill-faq-icon::before, .bill-faq-icon::after {
  content: ''; position: absolute; left: 50%; top: 50%; width: 10px; height: 2px; border-radius: 1px;
  background: currentColor; transform: translate(-50%, -50%);
  transition: transform 0.35s var(--ease), opacity 0.25s var(--ease);
}
.bill-faq-icon::after { transform: translate(-50%, -50%) rotate(90deg); }
.bill-faq-item.open .bill-faq-icon { background: var(--accent); color: #fff; transform: rotate(180deg); }
.bill-faq-item.open .bill-faq-icon::after { transform: translate(-50%, -50%) rotate(0deg); opacity: 0; }
.bill-faq-a { display: grid; grid-template-rows: 0fr; transition: grid-template-rows 0.38s var(--ease); }
.bill-faq-item.open .bill-faq-a { grid-template-rows: 1fr; }
.bill-faq-a-inner { overflow: hidden; min-height: 0; }
.bill-faq-a-body {
  padding: 0 16px 16px; max-width: 68ch; font-size: 14px; line-height: 1.6; color: var(--muted);
  opacity: 0; transform: translateY(-6px);
  transition: opacity 0.3s var(--ease), transform 0.38s var(--ease);
}
.bill-faq-item.open .bill-faq-a-body { opacity: 1; transform: none; transition-delay: 0.06s; }
.bill-faq-a-body p { margin: 0; }
.bill-faq-a-body p + p { margin-top: 8px; }
.bill-faq-a-body strong { color: var(--text); font-weight: 600; }
@media (prefers-reduced-motion: reduce) {
  .bill-faq-a, .bill-faq-a-body, .bill-faq-icon, .bill-faq-icon::before, .bill-faq-icon::after,
  .bill-faq-item, .bill-faq-q { transition: none; }
}

.free-paywall {
  position: relative; overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 0.85fr);
  gap: 28px;
  align-items: center;
  margin: 0 0 22px;
  padding: 28px 32px;
  border: 0; border-radius: 26px; color: #fff;
  background: linear-gradient(135deg, #0a5fd0 0%, #0071e3 48%, #4aa3ff 100%);
  box-shadow: 0 20px 44px rgba(0,113,227,0.24);
}
.free-paywall::before, .free-paywall::after { content: ""; position: absolute; border-radius: 50%; pointer-events: none; }
.free-paywall::before { width: 340px; height: 340px; right: -110px; top: -170px; background: rgba(255,255,255,0.12); }
.free-paywall::after { width: 210px; height: 210px; left: 38%; bottom: -150px; background: rgba(255,255,255,0.08); }
.free-paywall > * { position: relative; z-index: 1; }
.free-paywall[hidden] { display: none !important; }
.free-paywall-kicker {
  display: inline-flex; align-items: center; gap: 6px;
  width: fit-content;
  padding: 5px 12px; border-radius: 999px;
  font-size: 12px; font-weight: 700; letter-spacing: 0.08em;
  text-transform: uppercase; color: #fff; background: rgba(255,255,255,0.2);
}
.free-paywall-kicker svg { width: 14px; height: 14px; }
.free-paywall-title {
  margin: 14px 0 0; max-width: 26ch; font-size: 32px; font-weight: 750; letter-spacing: -0.03em; line-height: 1.12; color: #fff;
}
.free-paywall-lead { margin: 12px 0 0; color: rgba(255,255,255,0.88); font-size: 16px; line-height: 1.5; max-width: 46ch; }
.free-paywall-offer {
  display: grid; justify-items: start; gap: 10px; padding: 20px 22px; border-radius: 20px;
  background: rgba(255,255,255,0.16); border: 1px solid rgba(255,255,255,0.28);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
.free-paywall .bill-interval, .free-paywall-dialog .bill-interval { background: rgba(255,255,255,0.18); border-color: rgba(255,255,255,0.3); }
.free-paywall .bill-interval button, .free-paywall-dialog .bill-interval button { color: rgba(255,255,255,0.85); white-space: nowrap; padding: 6px 12px; }
.free-paywall .bill-interval button.is-on, .free-paywall-dialog .bill-interval button.is-on { background: #fff; color: #0a5fd0; box-shadow: 0 1px 3px rgba(0,40,100,0.25); }
.free-paywall .plan-amount, .free-paywall-dialog .plan-amount { margin: 4px 0 0; color: #fff; }
.free-paywall .plan-amount small, .free-paywall-dialog .plan-amount small { color: rgba(255,255,255,0.8); }
.free-paywall .micro, .free-paywall-dialog .micro { margin: 0; color: rgba(255,255,255,0.8); }
.free-paywall .btn-primary, .free-paywall-dialog .btn-primary { margin-top: 4px; background: #fff; color: #0a5fd0; font-weight: 700; box-shadow: 0 6px 16px rgba(0,40,100,0.22); }
.free-paywall .btn-primary:hover, .free-paywall-dialog .btn-primary:hover { background: #f0f6ff; }
.free-paywall-dialog {
  position: relative; overflow: hidden; color: #fff;
  width: min(480px, calc(100vw - 32px));
  border: 0; border-radius: 26px;
  background: linear-gradient(135deg, #0a5fd0 0%, #0071e3 55%, #4aa3ff 100%);
  box-shadow: 0 24px 60px rgba(0,60,140,0.35);
}
.free-paywall-dialog .modal-title { font-size: 26px; letter-spacing: -0.03em; line-height: 1.15; color: #fff; }
.free-paywall-dialog .free-paywall-kicker { margin-bottom: 12px; }
.free-paywall-dialog .free-paywall-lead { color: rgba(255,255,255,0.88); }
.free-paywall-dialog .plan-amount { margin: 14px 0 4px; }
.free-paywall-dialog .modal-close-x { color: rgba(255,255,255,0.85); }
.modal-overlay .free-paywall-dialog .modal-header, .modal-overlay .free-paywall-dialog .modal-body, .modal-overlay .free-paywall-dialog .modal-actions { background: transparent; border-color: transparent; }
.free-paywall-dialog .btn-ghost { background: transparent; color: #fff; border-color: rgba(255,255,255,0.45); }
.free-paywall-dialog .btn-ghost:hover { background: rgba(255,255,255,0.14); }
@media (max-width: 800px) {
  .free-paywall { grid-template-columns: 1fr; padding: 24px 22px; gap: 20px; border-radius: 22px; }
  .free-paywall-title { font-size: 26px; }
  .free-paywall-offer { justify-items: stretch; }
  .free-paywall-offer .btn { width: 100%; justify-content: center; }
}

.strategy-summary, .plan-goal {
  display: grid; gap: 4px; margin: 4px 0 16px; padding: 14px 16px;
  border: 1px solid var(--accent); border-radius: 14px; background: var(--accent-soft);
}
.plan-weeks { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 10px; }
.plan-week .strategy-topic-title, .plan-week .plan-week-focus { overflow-wrap: anywhere; }
.plan-week .strategy-topic-meta { flex-wrap: wrap; }
.plan-week {
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 12px;
  display: grid; gap: 8px; align-content: start;
}
.plan-week-num { margin: 0; color: var(--accent); font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.plan-week-focus { margin: 0; font-weight: 650; }
.plan-week-topics { display: grid; gap: 8px; }
.plan-modal { width: min(640px, calc(100vw - 32px)); }

/* Plan story: goal, four-week track, one week at a time */
#plan-story { margin: 4px 0 22px; }
.plan-story { display: grid; gap: 18px; text-align: left; }
.ps-goal {
  display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px;
  border-radius: 14px; background: var(--accent-soft);
  animation: psRise .5s var(--ease) both;
}
.ps-goal-icon {
  flex: none; width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center;
  background: var(--accent); color: #fff; font-size: 19px;
}
.ps-goal-kicker, .ps-kicker {
  margin: 0 0 2px; color: var(--accent); font-size: 11px; font-weight: 700;
  letter-spacing: .06em; text-transform: uppercase;
}
.ps-goal-text { margin: 0; font-size: 15px; font-weight: 650; line-height: 1.35; color: var(--text); }
.ps-goal-more { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.ps-goal-more span {
  font-size: 12px; line-height: 1.3; color: var(--muted); padding: 4px 9px;
  background: var(--surface); border-radius: 999px;
}

.ps-track {
  position: relative; display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px;
  --ps-progress: 0%;
}
.ps-line {
  position: absolute; left: 12.5%; right: 12.5%; top: 17px; height: 3px;
  border-radius: 3px; background: var(--border); overflow: hidden;
}
.ps-line i {
  display: block; height: 100%; width: var(--ps-progress); background: var(--accent);
  border-radius: inherit; transition: width .6s var(--ease);
}
.ps-node {
  position: relative; z-index: 1; display: grid; justify-items: center; gap: 3px;
  padding: 0 2px 4px; background: none; border: 0; cursor: pointer; color: var(--muted);
  font: inherit; text-align: center;
  animation: psRise .45s var(--ease) both; animation-delay: calc(var(--i) * 70ms + 80ms);
}
.ps-dot {
  width: 37px; height: 37px; border-radius: 50%; display: grid; place-items: center;
  background: var(--surface); border: 2px solid var(--border); color: var(--muted);
  font-size: 14px; font-weight: 700;
  transition: transform .3s var(--ease), background .3s var(--ease), border-color .3s var(--ease), color .3s var(--ease), box-shadow .3s var(--ease);
}
.ps-dot .material-symbols-outlined { font-size: 19px; }
.ps-node:hover .ps-dot { border-color: var(--accent); color: var(--accent); }
.ps-node.done .ps-dot { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.ps-node.active .ps-dot {
  background: var(--accent); border-color: var(--accent); color: #fff;
  transform: scale(1.08); box-shadow: 0 0 0 6px var(--accent-soft);
}
.ps-node-week { font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; margin-top: 4px; }
.ps-node-label {
  font-size: 12.5px; font-weight: 550; line-height: 1.25; color: var(--text); opacity: .7;
  overflow-wrap: anywhere; transition: opacity .3s var(--ease);
}
.ps-node.active .ps-node-week { color: var(--accent); }
.ps-node.active .ps-node-label { opacity: 1; font-weight: 650; }
.ps-node:focus-visible { outline: none; }
.ps-node:focus-visible .ps-dot { box-shadow: 0 0 0 4px var(--accent-soft), 0 0 0 6px var(--accent); }

.ps-panels { position: relative; }
.ps-panel {
  padding: 18px; border: 1px solid var(--border); border-radius: 16px; background: var(--surface);
  display: grid; gap: 10px;
}
.ps-panel.active { animation: psPanel .45s var(--ease) both; }
.ps-focus { margin: 0; font-size: 19px; font-weight: 700; line-height: 1.3; letter-spacing: -0.015em; color: var(--text); }
.ps-why {
  margin: 0; display: flex; gap: 8px; align-items: flex-start;
  font-size: 14px; line-height: 1.45; color: var(--muted);
}
.ps-why .material-symbols-outlined { font-size: 18px; color: #E0A100; margin-top: 1px; }
.ps-toggle {
  justify-self: start; display: inline-flex; align-items: center; gap: 4px; margin-top: 2px;
  padding: 6px 10px 6px 12px; border-radius: 999px; border: 1px solid var(--border);
  background: var(--surface2); color: var(--text); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer;
  transition: background .2s var(--ease), border-color .2s var(--ease);
}
.ps-toggle:hover { border-color: var(--accent); }
.ps-toggle .material-symbols-outlined { font-size: 18px; transition: transform .3s var(--ease); }
.ps-toggle[aria-expanded="true"] .material-symbols-outlined { transform: rotate(180deg); }
.ps-articles { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.ps-articles li { animation: psRise .35s var(--ease) both; animation-delay: calc(var(--j) * 50ms); }
.ps-article {
  width: 100%; display: flex; align-items: center; gap: 8px; padding: 9px 12px;
  border-radius: 10px; background: var(--surface2); border: 1px solid transparent;
  font: inherit; text-align: left; color: var(--text);
}
.ps-article.is-link { cursor: pointer; transition: border-color .2s var(--ease), transform .2s var(--ease); }
.ps-article.is-link:hover { border-color: var(--accent); transform: translateX(2px); }
.ps-article-title { flex: 1; min-width: 0; font-size: 14px; font-weight: 550; line-height: 1.35; overflow-wrap: anywhere; }
.ps-edited { flex: none; font-size: 11px; color: var(--muted); font-style: italic; }
.ps-pill {
  flex: none; display: inline-flex; align-items: center; gap: 3px; white-space: nowrap;
  font-size: 11.5px; font-weight: 600; padding: 3px 8px; border-radius: 999px;
  background: var(--surface); color: var(--muted);
}
.ps-pill .material-symbols-outlined { font-size: 13px; }
.ps-pill-done { background: rgba(52,199,89,.14); color: #1E8E3E; }
.ps-pill-planned, .ps-pill-live { background: var(--accent-soft); color: var(--accent); }
.ps-pill-error { background: rgba(255,59,48,.12); color: #C9302C; }
.ps-pill-locked { background: var(--surface); color: var(--muted); }
.ps-nav { display: flex; justify-content: flex-end; gap: 6px; }
.ps-nav-btn {
  width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center;
  border: 1px solid var(--border); background: var(--surface); color: var(--text); cursor: pointer;
  transition: border-color .2s var(--ease), color .2s var(--ease);
}
.ps-nav-btn .material-symbols-outlined { font-size: 18px; }
.ps-nav-btn:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.ps-nav-btn:disabled { opacity: .35; cursor: default; }
.ps-summary { margin: 0; font-size: 13px; color: var(--muted); }
.ps-themes { display: grid; gap: 6px; }
.ps-themes-label {
  margin: 0; font-size: 11px; font-weight: 700; letter-spacing: .06em;
  text-transform: uppercase; color: var(--muted);
}
.ps-theme-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.ps-theme-chips span {
  font-size: 12.5px; font-weight: 550; line-height: 1.3; padding: 5px 10px; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent);
  animation: psRise .35s var(--ease) both; animation-delay: calc(var(--k) * 45ms + 120ms);
}
.ps-article-pending {
  background: transparent; border: 1px dashed var(--border2, var(--border)); color: var(--muted);
}
.ps-article-pending > .material-symbols-outlined { flex: none; font-size: 18px; }
.ps-article-pending .ps-article-title { font-weight: 600; color: var(--muted); }
.ps-pending-note { flex: none; font-size: 11.5px; color: var(--muted); }
.ps-pill-unlock { background: var(--accent); color: #fff; }
.ps-article-pending.is-link:hover { border-style: solid; }
.ps-count-note {
  margin: 0; display: flex; align-items: center; gap: 8px; padding: 10px 12px;
  border-radius: 10px; border: 1px dashed var(--border); font-size: 13px; color: var(--muted);
}
.ps-count-note .material-symbols-outlined { font-size: 18px; }
.ps-start { animation: psRise .5s var(--ease) both; animation-delay: .35s; }
.ps-start .fomo-card p {
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}

@keyframes psRise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes psPanel { from { opacity: 0; transform: translateY(6px) scale(.99); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  .ps-goal, .ps-node, .ps-panel.active, .ps-articles li, .ps-start, .ps-theme-chips span { animation: none; }
  .ps-line i, .ps-dot { transition: none; }
}
@media (max-width: 640px) {
  .ps-node-label { display: none; }
  .ps-panel { padding: 14px; }
  .ps-focus { font-size: 17px; }
  .ps-article { flex-wrap: wrap; }
  .ps-pending-note { flex-basis: 100%; }
}
@media (max-width: 640px) {
  .plan-weeks { grid-template-columns: 1fr; }
  .funnel-progress .fp-label { font-size: 11px; text-align: center; }
  .funnel-progress .fp-dot { width: 28px; height: 28px; font-size: 13px; }
  .funnel-progress .fp-step::before { top: 13px; }
}
.strategy-summary-kicker { margin: 8px 0 0; font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.strategy-summary-goal, #strategy-focus { margin: 0; font-weight: 650; }
.strategy-counts { margin: 8px 0 0; color: var(--muted); font-size: 13px; }
.strategy-gap { margin: 8px 0 0; font-size: 13px; color: var(--muted); }
.strategy-panel { display: grid; gap: 18px; margin: 8px 0 8px; }
.strategy-block { display: grid; gap: 8px; }
.strategy-goals { margin: 0; padding-left: 18px; display: grid; gap: 6px; color: var(--text); }
.strategy-goals li { line-height: 1.45; }
.strategy-weeks { display: grid; gap: 8px; }
.strategy-week, .strategy-topic, .plan-queue {
  text-align: left; border: 1px solid var(--border); border-radius: 12px;
  background: var(--surface); padding: 10px 12px;
}
.strategy-week strong { display: block; font-size: 12px; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.strategy-week span, .strategy-topic-title { font-weight: 650; }
.strategy-week p, .strategy-topic p { margin: 4px 0 0; color: var(--muted); font-size: 13px; line-height: 1.45; }
.strategy-topics, .strategy-week-topics { display: grid; gap: 8px; }
.strategy-week-label { margin: 8px 0 0; font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.strategy-topic-meta { display: flex; gap: 8px; align-items: center; margin-top: 6px; font-size: 12px; color: var(--muted); }
.intent-chip {
  display: inline-flex; align-items: center; border-radius: 999px;
  padding: 2px 8px; background: rgba(0,0,0,0.06); color: #48484C; font-weight: 650;
}
.strategy-knowledge { display: grid; gap: 8px; margin: 16px 0; }
.strategy-knowledge textarea { width: 100%; }
.strategy-knowledge-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.onb-step-nav { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 18px; }
.onb-step-nav .btn { display: inline-flex; align-items: center; gap: 6px; height: 42px; padding: 0 16px; border-radius: 10px; font-weight: 600; }
.onb-step-nav .btn-primary { background: var(--accent); color: #fff; }
.onb-step-nav .btn-primary:hover { background: var(--accent-hover); }
.onb-step-nav .material-symbols-outlined { font-size: 18px; }
.onb-step-nav .btn:disabled { opacity: .6; cursor: default; }
.strategy-source-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.strategy-source-list li, .add-site-week { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; }
.plan-card { margin: 0 0 16px; padding: 16px 18px; display: grid; gap: 12px; }
.plan-card h2 { margin: 0; font-size: 20px; }
.plan-card-head p { margin: 4px 0 0; color: var(--muted); }
.plan-queue { width: 100%; cursor: pointer; font: inherit; color: inherit; }
.plan-queue:hover { border-color: rgba(0,0,0,0.2); }
.add-site-plan { margin: 0 0 14px; display: grid; gap: 6px; }
.add-site-week { display: block; margin: 0; color: var(--muted); line-height: 1.45; }

.cs { display: grid; gap: 22px; max-width: 1080px; }
.cs-note {
  display: flex; align-items: center; gap: 12px; padding: 14px 18px;
  border-radius: 16px; background: var(--surface); border: 1px solid var(--border); line-height: 1.45;
  animation: psRise .45s var(--ease) both;
}
.cs-note p { margin: 0; flex: 1; min-width: 0; font-size: 15px; }
.cs-note .material-symbols-outlined { flex: none; font-size: 22px; color: var(--accent); }
.cs-note .btn { flex: none; }

.cs-hero {
  position: relative; overflow: hidden; padding: 34px 38px 32px; border-radius: 26px; color: #fff;
  background: linear-gradient(135deg, #0a5fd0 0%, #0071e3 48%, #4aa3ff 100%);
  box-shadow: 0 20px 44px rgba(0,113,227,0.24);
  animation: psRise .5s var(--ease) both;
}
.cs-hero::before, .cs-hero::after { content: ""; position: absolute; border-radius: 50%; pointer-events: none; }
.cs-hero::before { width: 360px; height: 360px; right: -110px; top: -170px; background: rgba(255,255,255,0.12); }
.cs-hero::after { width: 220px; height: 220px; right: 120px; bottom: -140px; background: rgba(255,255,255,0.08); }
.cs-hero > * { position: relative; z-index: 1; }
.cs-hero-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.cs-hero-kicker { margin: 0; font-size: 13px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; opacity: .85; }
.cs-hero-range {
  display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border-radius: 999px;
  background: rgba(255,255,255,0.2); font-size: 14px; font-weight: 650;
}
.cs-hero-range .material-symbols-outlined { font-size: 18px; }
.cs-hero-goal { margin: 0; max-width: 24ch; font-size: 36px; line-height: 1.12; font-weight: 750; letter-spacing: -0.03em; }
.cs-progress { margin-top: 28px; max-width: 460px; }
.cs-bar { height: 9px; border-radius: 999px; background: rgba(255,255,255,0.26); overflow: hidden; }
.cs-bar i { display: block; height: 100%; min-width: 9px; border-radius: 999px; background: #fff; transition: width .6s var(--ease); }
.cs-progress p { margin: 10px 0 0; font-size: 14.5px; font-weight: 600; opacity: .95; }

.cs-weeks { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.cs-wk {
  display: grid; gap: 10px; align-content: start; padding: 18px 20px; border-radius: 20px; text-align: left;
  border: 1.5px solid var(--border); background: var(--surface); color: var(--text); font: inherit; cursor: pointer;
  animation: psRise .45s var(--ease) both; animation-delay: calc(var(--i) * 60ms);
  transition: border-color .25s var(--ease), box-shadow .25s var(--ease), transform .25s var(--ease);
}
.cs-wk:hover { transform: translateY(-2px); box-shadow: 0 10px 26px rgba(0,0,0,0.07); }
.cs-wk.is-active { border-color: var(--accent); box-shadow: 0 10px 28px rgba(0,113,227,0.16), 0 0 0 4px var(--accent-soft); }
.cs-wk-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 22px; }
.cs-wk-n { font-size: 12px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.cs-wk.is-active .cs-wk-n { color: var(--accent); }
.cs-wk-now { padding: 2px 9px; border-radius: 999px; background: var(--accent); color: #fff; font-size: 11px; font-weight: 700; }
.cs-wk-label { font-size: 21px; line-height: 1.15; letter-spacing: -0.02em; font-weight: 700; }
.cs-wk-dots { display: flex; gap: 5px; }
.cs-wk-dots i { width: 100%; max-width: 18px; height: 6px; border-radius: 999px; background: var(--surface2); }
.cs-wk-dots i.is-done { background: var(--accent); }
.cs-wk-dots i.is-live { background: var(--accent); opacity: .45; animation: csPulse 1.4s ease-in-out infinite; }
.cs-wk-count { font-size: 13.5px; color: var(--muted); }
@keyframes csPulse { 50% { opacity: 1; } }

.cs-detail {
  padding: 30px 34px 26px; border-radius: 24px; background: var(--surface);
  border: 1px solid var(--border); box-shadow: var(--shadow);
  animation: psRise .4s var(--ease) both;
}
.cs-detail[hidden] { display: none; }
.cs-detail-kicker { margin: 0 0 8px; font-size: 13px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--accent); }
.cs-detail h3 { margin: 0; font-size: 26px; line-height: 1.2; letter-spacing: -0.025em; font-weight: 700; }
.cs-detail-why { margin: 10px 0 0; max-width: 68ch; font-size: 16px; line-height: 1.55; color: var(--muted); }
.cs-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.cs-chips span { padding: 6px 14px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-size: 14px; font-weight: 600; }
.cs-list { list-style: none; margin: 24px 0 0; padding: 0; display: grid; gap: 8px; }
.cs-list li { animation: psRise .4s var(--ease) both; animation-delay: calc(var(--j) * 40ms); }
.cs-row {
  display: grid; grid-template-columns: 112px 1fr auto; align-items: center; gap: 16px; width: 100%;
  padding: 15px 18px; border-radius: 16px; border: 1.5px solid transparent; background: var(--bg);
  color: var(--text); font: inherit; text-align: left;
  transition: border-color .25s var(--ease), background .25s var(--ease), box-shadow .25s var(--ease), transform .25s var(--ease);
}
button.cs-row { cursor: pointer; }
.cs-row:hover, .cs-row.is-link:hover {
  background: #fff; border-color: var(--accent);
  box-shadow: 0 10px 24px rgba(0,113,227,0.12), 0 0 0 4px var(--accent-soft); transform: translateY(-1px);
}
.cs-row-date { font-size: 14px; font-weight: 600; color: var(--muted); white-space: nowrap; }
.cs-row-date .material-symbols-outlined { font-size: 20px; vertical-align: middle; }
.cs-row-title { font-size: 16px; font-weight: 650; line-height: 1.35; letter-spacing: -0.01em; min-width: 0; }
.cs-row-more .cs-row-title { color: var(--muted); font-weight: 600; }
.cs-row-note { font-size: 13.5px; color: var(--muted); text-align: right; }
.cs-pill {
  display: inline-flex; align-items: center; gap: 4px; padding: 5px 12px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--border2); color: var(--muted);
  font-size: 13px; font-weight: 650; white-space: nowrap;
}
.cs-pill .material-symbols-outlined { font-size: 14px; }
.cs-pill-done { background: #e6f6ec; border-color: transparent; color: #1b7a3a; }
.cs-pill-live { background: var(--accent-soft); border-color: transparent; color: var(--accent); }
.cs-pill-error { background: #fff3e0; border-color: transparent; color: #b25e00; }
.cs-pill-unlock { background: var(--accent); border-color: transparent; color: #fff; }

.cs-next {
  display: flex; align-items: center; gap: 16px; padding: 20px 24px; border-radius: 22px;
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow);
  animation: psRise .5s var(--ease) both;
}
.cs-next > .material-symbols-outlined {
  flex: none; width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent); font-size: 24px;
}
.cs-next-copy { flex: 1; min-width: 0; }
.cs-next-copy p { margin: 0; font-size: 15px; line-height: 1.5; color: var(--muted); }
.cs-next-copy .cs-next-title { font-size: 17px; font-weight: 700; color: var(--text); letter-spacing: -0.01em; }
.cs-next .btn { flex: none; }

.cs-earlier { display: grid; gap: 12px; }
.cs-section-label { margin: 0; font-size: 13px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.cs-months { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.cs-month {
  display: flex; align-items: center; gap: 10px; padding: 16px 18px; border-radius: 16px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  font: inherit; font-size: 15px; font-weight: 650; text-align: left; cursor: pointer;
  animation: psRise .4s var(--ease) both; animation-delay: calc(var(--i) * 50ms);
  transition: border-color .25s var(--ease), box-shadow .25s var(--ease), transform .25s var(--ease);
}
.cs-month .material-symbols-outlined { font-size: 20px; color: var(--muted); }
.cs-month:hover { border-color: var(--accent); box-shadow: 0 10px 24px rgba(0,113,227,0.12), 0 0 0 4px var(--accent-soft); transform: translateY(-2px); }

@media (prefers-reduced-motion: reduce) {
  .cs-note, .cs-hero, .cs-wk, .cs-detail, .cs-list li, .cs-next, .cs-month, .cs-wk-dots i.is-live { animation: none; }
  .cs-wk, .cs-row, .cs-month, .cs-bar i { transition: none; }
}
@media (max-width: 860px) {
  .cs-weeks { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .cs { gap: 16px; }
  .cs-note, .cs-next { flex-wrap: wrap; }
  .cs-hero { padding: 26px 22px 24px; border-radius: 22px; }
  .cs-hero-goal { font-size: 27px; }
  .cs-detail { padding: 22px 18px 18px; border-radius: 20px; }
  .cs-detail h3 { font-size: 22px; }
  .cs-row { grid-template-columns: 1fr auto; gap: 4px 12px; padding: 14px 16px; }
  .cs-row-date { grid-column: 1 / -1; font-size: 13px; }
  .cs-row-note { grid-column: 1 / -1; text-align: left; }
}

/* Autopublish switch (calendar) */
.autopub {
  display: flex; align-items: center; gap: 16px; margin-bottom: 18px; padding: 16px 20px;
  border-radius: 20px; border: 1px solid var(--border); background: var(--surface); box-shadow: var(--shadow-sm);
  transition: border-color .3s var(--ease), background .3s var(--ease);
}
.autopub[hidden] { display: none; }
.autopub.is-on { border-color: rgba(0,113,227,0.35); background: linear-gradient(135deg, rgba(0,113,227,0.07), rgba(74,163,255,0.04)); }
.autopub-icon {
  width: 42px; height: 42px; border-radius: 13px; flex: none; display: grid; place-items: center;
  background: var(--surface2); color: var(--muted); transition: background .3s var(--ease), color .3s var(--ease);
}
.autopub.is-on .autopub-icon { background: var(--accent); color: #fff; }
.autopub-icon svg { width: 20px; height: 20px; }
.autopub-copy { flex: 1; min-width: 0; }
.autopub-copy strong { display: block; font-size: 15.5px; font-weight: 700; letter-spacing: -0.01em; color: var(--text); }
.autopub-copy span { display: block; margin-top: 2px; font-size: 14px; line-height: 1.45; color: var(--muted); }
.switch {
  position: relative; flex: none; width: 52px; height: 30px; padding: 0; border: 0; border-radius: 999px; cursor: pointer;
  background: #c9c9ce; transition: background .25s var(--ease);
}
.switch i {
  position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff;
  box-shadow: 0 2px 5px rgba(0,0,0,0.25); transition: transform .25s var(--ease);
}
.switch.is-on { background: var(--accent); }
.switch.is-on i { transform: translateX(22px); }
.switch i { display: grid; place-items: center; }
.switch i .material-symbols-outlined { font-size: 14px; color: #8e8e93; }
.switch.is-locked { opacity: .85; }
.autopub.is-locked .autopub-icon { background: var(--surface2); color: var(--muted); }
.switch:focus-visible { outline: 3px solid var(--accent-soft); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { .autopub, .autopub-icon, .switch, .switch i { transition: none; } }
@media (max-width: 640px) { .autopub { padding: 14px 16px; gap: 12px; } }
