/* SLATE_APP_V2 (2026-10-04): one shell + one type system for every Slate page.
   Loaded last; uses the theme variables from style.css so dark mode follows. */

/* ── topbar: identical on dashboard, notebook, settings, guide ── */
.topbar, header.topbar {
  height: 60px !important; padding: 0 clamp(16px, 2.4vw, 32px) !important; gap: 28px !important;
  display: flex !important; align-items: center !important;
  background: var(--paper, #FAFAF7) !important; backdrop-filter: none !important;
  border-bottom: 1px solid var(--line, #E5E3DC) !important;
  position: sticky !important; top: 0 !important; z-index: 30 !important;
}
.topbar .topbar-brand, .topbar .brand { display: flex !important; align-items: center !important; gap: 9px !important; text-decoration: none !important; color: var(--ink) !important; }
.topbar .brand-logo { height: 22px !important; }
.topbar .brand-text { display: flex !important; align-items: baseline !important; gap: 8px !important; }
.topbar .brand-name { font-family: var(--serif, 'Fraunces', Georgia, serif) !important; font-size: 20px !important; font-weight: 500 !important; letter-spacing: -.015em !important; }
.topbar .brand-by {
  font-family: var(--sans, 'Inter Tight', sans-serif) !important; font-size: 13px !important;
  letter-spacing: 0 !important; text-transform: none !important; color: var(--mid) !important; font-weight: 400 !important;
}
.topbar-nav { gap: 2px !important; }
.topbar .topbar-nav { display: flex; align-items: center; flex: 1; }
.topbar .brand-dot { color: var(--accent, #B55A30); }
@media (max-width: 780px) { .topbar .topbar-nav { display: none; } }
.topbar-link {
  font-family: var(--sans, 'Inter Tight', sans-serif) !important;
  font-size: 14.5px !important; font-weight: 450 !important; color: var(--muted, #5A5753) !important;
  padding: 7px 12px !important; border-radius: 8px !important; text-decoration: none !important;
}
.topbar-link:hover { color: var(--ink) !important; background: var(--paper-2) !important; }
.topbar-link.active { color: var(--ink) !important; background: var(--paper-3) !important; font-weight: 500 !important; }
.topbar-right { gap: 6px !important; }
.topbar-icon-btn { width: 34px !important; height: 34px !important; border: 0 !important; border-radius: 8px !important; }
.topbar-icon-btn:hover { background: var(--paper-2) !important; color: var(--ink) !important; }
.topbar-chat-link {
  margin-left: 8px; font-size: 14px !important; font-weight: 500 !important; color: var(--ink) !important;
  padding: 7px 14px !important; border: 1px solid var(--line-2, #D6D3CA) !important; border-radius: 999px !important; text-decoration: none !important;
}
.topbar-chat-link:hover { border-color: var(--ink) !important; }
.topbar-menu-btn { border: 0 !important; }

/* ── one label style everywhere: sentence case, sans, muted. No tracked caps, no mono. ── */
.usage-label, .suggestion-label, .panel-badge, .field-label, .section-optional, .run-label,
.section-eyebrow, .library-collection-filter-label, .library-card-status, .library-card-kind,
.eyebrow, .dropzone-meta, .source-card-type, .toc-label, .bib-heading, .disclosure-heading,
.artifacts-label, .status-pill, .sources-label, .card-title, .tier-badge, .topic-hint,
.crumb-back, .crumb-sep, .crumb-current, .hero-eyebrow, .toc-num, .method-num, .section-num,
.source-card-meta, .lm-n, .lm-count, .run-preview dt, .output-meta dt, #view-output dt, #view-research dt {
  text-transform: none !important; letter-spacing: 0 !important;
  font-family: var(--sans, 'Inter Tight', sans-serif) !important; font-variant-numeric: tabular-nums;
}
.usage-label, .suggestion-label, .field-label, .section-optional, .run-label, .section-eyebrow,
.library-collection-filter-label, .eyebrow, .dropzone-meta, .toc-label, .bib-heading,
.disclosure-heading, .artifacts-label, .sources-label, .card-title, .hero-eyebrow,
#view-research dt, #view-output dt {
  font-size: 13px !important; font-weight: 500 !important; color: var(--mid) !important;
}
.section-eyebrow, .eyebrow, .hero-eyebrow { color: var(--accent) !important; font-size: 14px !important; }
.crumb-back, .crumb-current { font-size: 14px !important; color: var(--muted) !important; font-weight: 450 !important; }
.crumb-current { color: var(--ink) !important; }
.crumb-sep { color: var(--line-2) !important; }

/* pills: chips get an 8px corner like every other control */
.suggestion-chip, .collection-pill, .filter-chip { border-radius: 8px !important; }
.suggestion-chip { font-size: 13.5px !important; }

/* ── home ── */
#view-home .home-title { font-weight: 300 !important; letter-spacing: -.025em !important; }
#view-home .panel-method { display: none !important; }
#view-home .home-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
.panel { border-radius: 12px !important; }
.panel-head h3 { font-family: var(--serif) !important; font-weight: 400 !important; font-size: 19px !important; }
.panel-link { font-size: 13.5px !important; color: var(--muted) !important; }
.panel-link:hover { color: var(--ink) !important; }
.home-bib-link b { font-weight: 500 !important; border-bottom: 1px solid currentColor; }

/* ── buttons: ink primary, quiet secondary, one radius ── */
.btn-primary, .btn-go, #begin-btn, .begin-btn {
  border-radius: 999px !important; font-weight: 500 !important; letter-spacing: 0 !important;
}
.btn-secondary.btn-sm { border-radius: 8px !important; font-size: 13.5px !important; font-weight: 450 !important; letter-spacing: 0 !important; }

/* ── report ── */
.output-header { background: var(--paper) !important; border-bottom: 1px solid var(--line) !important; }
.output-header-actions { gap: 6px !important; align-items: center !important; flex-wrap: nowrap !important; }
.sv2-export { position: relative; }
.sv2-export > .sv2-export-btn::after { content: ""; display: inline-block; width: 6px; height: 6px; margin-left: 8px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: translateY(-2px) rotate(45deg); }
.sv2-export-menu {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 40; min-width: 230px;
  display: none; flex-direction: column; padding: 6px;
  background: var(--card, #fff); border: 1px solid var(--line); border-radius: 12px;
  box-shadow: 0 18px 44px -14px rgba(26,26,26,.28);
}
.sv2-export.open .sv2-export-menu { display: flex; }
.sv2-export-menu button {
  all: unset; box-sizing: border-box; cursor: pointer; display: flex; justify-content: space-between; gap: 16px;
  padding: 9px 12px; border-radius: 8px; font: 450 14px/1.3 var(--sans, 'Inter Tight', sans-serif); color: var(--ink);
}
.sv2-export-menu button:hover, .sv2-export-menu button:focus-visible { background: var(--paper-2); }
.sv2-export-menu button small { color: var(--mid); font-size: 12.5px; }
.sv2-export-menu .sv2-sep { height: 1px; background: var(--line); margin: 5px 4px; }

.source-card { border-radius: 10px !important; }
.source-card-type { font-size: 12.5px !important; font-weight: 500 !important; color: var(--mid) !important; }
.source-card[data-type="law"] .source-card-type .sv2-type { display: none; }
.source-card-title a { font-family: var(--sans) !important; font-size: 14px !important; line-height: 1.4 !important; color: var(--ink) !important; font-weight: 500 !important; }
.source-card-meta { font-size: 12.5px !important; color: var(--mid) !important; }
.toc-list li { font-size: 13.5px !important; }

/* ── settings ── */
#depthQuota > div { border-radius: 10px !important; border-color: var(--line) !important; box-shadow: none !important; background: var(--paper-2) !important; }
.tier-badge { border-radius: 6px !important; font-size: 12px !important; }

/* ── notebook headings (were SUMBER / CHAT / NOTES in caps) ── */
.nb-sources-head h2, .nb-chat-head h2, .nb-notes-head h2, .nb-eyebrow, .nb-map-source-head {
  text-transform: none !important; letter-spacing: 0 !important; font-family: var(--sans) !important;
  font-size: 14px !important; font-weight: 600 !important; color: var(--ink) !important;
}

@media (max-width: 780px) {
  .topbar-chat-link { display: none !important; }
  #view-home .home-grid { grid-template-columns: 1fr !important; }
  .output-header-actions { flex-wrap: wrap !important; }
}

/* ── second pass: unclassed labels, quota tiles, guide contents ── */
.composer-top span, .composer-top kbd, .pill .sub {
  text-transform: none !important; letter-spacing: 0 !important; font-family: var(--sans, 'Inter Tight', sans-serif) !important;
}
.composer-top { font-size: 13px !important; color: var(--mid) !important; }
.composer-top span:first-child { font-weight: 500; color: var(--muted); }
.pill .sub { font-size: 12px !important; opacity: .7; margin-left: 6px; }
.topbar-icon-btn, .topbar-icon-btn svg { color: var(--muted, #5A5753) !important; stroke: currentColor; }

#depthQuota > div { background: var(--paper-2, #F3F1EB) !important; border-color: var(--line, #E5E3DC) !important; }
#depthQuota > div > div:first-child { text-transform: none !important; letter-spacing: 0 !important; font-size: 13px !important; font-weight: 500; }
#depthQuota > div > div:nth-child(2) { color: var(--ink, #1A1A1A) !important; }

.toc-title { text-transform: none !important; letter-spacing: 0 !important; font-family: var(--sans, 'Inter Tight', sans-serif) !important; font-size: 13px !important; font-weight: 500 !important; color: var(--mid) !important; }
.toc a::before { content: none !important; }

/* literature matrix is a report action, not an export format */
#lit-matrix-btn { white-space: nowrap; }

/* ═════ SLATE_APP_V3 (2026-10-04): sidebar shell, Home composer, report as a sheet ═════ */
@media (min-width: 1024px) {
  body.sv3 { padding-left: 256px; --topbar-h: 0px; }
  body.sv3 header.topbar {
    position: fixed !important; left: 0; top: 0; bottom: 0; width: 256px; height: 100vh !important;
    flex-direction: column !important; align-items: stretch !important; justify-content: flex-start !important;
    padding: 16px 12px 14px !important; gap: 0 !important;
    background: var(--paper-2) !important; border-bottom: 0 !important; border-right: 1px solid var(--line) !important;
    overflow-y: auto;
  }
  body.sv3 .topbar .topbar-brand, body.sv3 .topbar .brand { padding: 4px 8px 18px; }
  body.sv3 .topbar .brand-by { display: none !important; }
  body.sv3 .topbar-menu-btn { display: none !important; }
  body.sv3 .topbar-nav, body.sv3 .topbar .topbar-nav {
    display: flex !important; flex-direction: column !important; align-items: stretch !important; flex: 0 0 auto !important; gap: 1px !important;
  }
  body.sv3 .topbar-link {
    display: flex !important; align-items: center !important; gap: 11px !important; height: 36px !important;
    padding: 0 10px !important; font-size: 14.5px !important; text-align: left; width: 100%;
  }
  body.sv3 .topbar-link svg.sv3-ic { width: 17px; height: 17px; flex-shrink: 0; stroke: currentColor; fill: none; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; opacity: .8; }
  body.sv3 .topbar-link.active { background: var(--card, #fff) !important; box-shadow: 0 0 0 1px var(--line); }
  body.sv3 .topbar-link.sv3-new {
    order: -1; justify-content: center !important; height: 40px !important; margin: 0 4px 14px; width: auto;
    border-radius: 999px !important; background: var(--ink) !important; color: var(--paper) !important; font-weight: 500 !important; box-shadow: none !important;
  }
  body.sv3 .topbar-link.sv3-new svg.sv3-ic { display: none; }
  body.sv3 .topbar-link.sv3-new:hover { background: #000 !important; }
  body.dark.sv3 .topbar-link.sv3-new:hover { background: #fff !important; }
  .sv3-recent { margin-top: 22px; display: flex; flex-direction: column; min-height: 0; }
  .sv3-recent h4 { padding: 0 10px 6px; font: 500 13px/1.3 var(--sans, 'Inter Tight', sans-serif); color: var(--mid); }
  .sv3-recent button {
    all: unset; box-sizing: border-box; cursor: pointer; display: block; padding: 7px 10px; border-radius: 8px;
    font: 400 14px/1.35 var(--sans, 'Inter Tight', sans-serif); color: var(--muted); white-space: nowrap; overflow: hidden;
    -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 26px), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - 26px), transparent);
  }
  .sv3-recent button:hover { background: var(--paper-3); color: var(--ink); }
  .sv3-recent button.on { background: var(--card, #fff); color: var(--ink); font-weight: 500; box-shadow: 0 0 0 1px var(--line); }
  body.sv3 .topbar-right {
    margin-top: auto !important; padding-top: 12px; border-top: 1px solid var(--line);
    display: flex !important; flex-direction: row !important; flex-wrap: wrap; align-items: center !important; gap: 4px !important;
  }
  body.sv3 .topbar-chat-link { margin: 6px 0 0 !important; width: 100%; text-align: center; }
}

/* Home: one large composer sheet */
#view-home .home-title { font-size: clamp(38px, 4.2vw, 56px) !important; }
#view-home .composer {
  border-radius: 16px !important; border: 1px solid var(--line) !important; background: var(--card, #fff) !important;
  box-shadow: 0 1px 0 rgba(0,0,0,.02), 0 26px 50px -36px rgba(38,45,54,.4) !important; padding: 0 !important; overflow: visible;
}
#view-home .composer-top { display: none !important; }
#view-home .composer-input {
  font-family: var(--serif, 'Fraunces', Georgia, serif) !important; font-weight: 300 !important; font-size: 22px !important;
  padding: 24px 24px 18px !important; border: 0 !important; background: transparent !important;
}
#view-home .composer-input::placeholder { font-style: italic; }
#view-home .composer-bottom { padding: 12px 16px 16px 20px !important; border-top: 0 !important; gap: 10px !important; }
#view-home .pills-sm { background: var(--paper-2) !important; border-radius: 10px !important; padding: 3px !important; gap: 0 !important; border: 0 !important; }
#view-home .pills-sm .pill { border: 0 !important; border-radius: 8px !important; background: transparent !important; color: var(--muted) !important; height: 32px; font-size: 13.5px !important; }
#view-home .pills-sm .pill.active { background: var(--card, #fff) !important; color: var(--ink) !important; font-weight: 500 !important; box-shadow: 0 1px 2px rgba(0,0,0,.08) !important; }
#view-home .advanced-toggle { height: 38px; padding: 0 12px !important; border: 1px solid var(--line) !important; border-radius: 10px !important; font-size: 13.5px !important; }
#home-start { height: 40px !important; padding: 0 20px !important; border-radius: 999px !important; background: var(--ink) !important; color: var(--paper) !important; border: 0 !important; }
#home-start:disabled { opacity: .35 !important; }
#view-home .home-grid .panel { border: 0 !important; background: transparent !important; padding: 0 !important; box-shadow: none !important; }
#view-home .home-grid .panel-head { border-bottom: 1px solid var(--line); padding-bottom: 10px !important; margin-bottom: 4px; }
#view-home .home-grid .panel-head h3 { font-size: 22px !important; }

/* Report: toolbar pills, article as a sheet, quieter sources column */
#view-output .output-header .btn-secondary.btn-sm,
#view-output .output-header .sv2-export-btn,
#view-output .output-header #lit-matrix-btn { height: 36px !important; padding: 0 14px !important; border-radius: 999px !important; border: 1px solid var(--line-2) !important; background: transparent !important; font-weight: 500 !important; }
#view-output .output-header .btn-secondary.btn-sm.sv2-export-btn { background: var(--ink) !important; color: var(--paper) !important; border-color: var(--ink) !important; }
#view-output .mode-toggle { background: var(--paper-2) !important; border-radius: 10px !important; padding: 3px !important; border: 0 !important; }
#view-output .mode-btn { border-radius: 8px !important; border: 0 !important; }
#view-output .mode-btn.active { background: var(--card, #fff) !important; color: var(--ink) !important; box-shadow: 0 1px 2px rgba(0,0,0,.08) !important; }
#view-output .collection-assign-select { height: 36px; border-radius: 10px !important; border: 1px solid var(--line) !important; background: transparent !important; }
@media (min-width: 900px) {
  #view-output .output-wrap {
    background: var(--card, #fff); border: 1px solid var(--line); border-radius: 8px;
    padding: clamp(36px, 4vw, 56px) clamp(28px, 4vw, 60px) clamp(40px, 4vw, 60px) !important;
    margin-top: 28px !important; margin-bottom: 48px !important;
    box-shadow: 0 30px 50px -40px rgba(38,45,54,.35);
  }
  #view-output .output-toc { background: transparent !important; border-right: 0 !important; }
  #view-output .output-sources { background: transparent !important; border-left: 1px solid var(--line) !important; }
}
#view-output #out-topic { font-weight: 300 !important; letter-spacing: -.02em !important; }
#view-output .toc-list li { border-radius: 0 !important; background: transparent !important; border-left: 1px solid var(--line); padding-left: 12px !important; }
#view-output .toc-list li.active, #view-output .toc-list li.on { border-left: 2px solid var(--ink) !important; color: var(--ink) !important; font-weight: 500; }
#view-output .source-card { border: 0 !important; border-bottom: 1px solid var(--line) !important; border-radius: 0 !important; background: transparent !important; padding: 12px 2px !important; box-shadow: none !important; }
#view-output .source-card:hover { background: var(--paper-2) !important; }
#view-output .sources-list { gap: 0 !important; }

/* SLATE_APP_V3 notebook: same sidebar; the chat card gets back the 60px the old topbar used */
@media (min-width: 1024px) {
  body.sv3-nb .nb-chat-card { height: calc(100vh - 150px) !important; }
  body.sv3-nb .topbar-right .nb-lang-btn, body.sv3-nb .topbar-right .nb-theme-btn { width: 34px; height: 34px; }
}
@media (min-width: 1024px) {
  body.sv3 .topbar-right { width: 100% !important; justify-content: flex-start !important; margin-left: 0 !important; }
}

/* SLATE_SIDEBAR_COLLAPSE_V1: icon rail when collapsed; reports collapse it automatically */
.sv3-toggle { display: none; }
@media (min-width: 1024px) {
  body.sv3 header.topbar { transition: width .2s ease; }
  body.sv3 { transition: padding-left .2s ease; }
  .sv3-toggle {
    display: inline-flex; position: absolute; top: 18px; right: 12px; width: 30px; height: 30px; border-radius: 8px;
    align-items: center; justify-content: center; color: var(--mid); background: transparent; border: 0; cursor: pointer;
  }
  .sv3-toggle:hover { background: var(--paper-3); color: var(--ink); }
  .sv3-toggle svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
  body.sv3 header.topbar { position: fixed; }
  .sv3-plus { display: none; }

  body.sv3.sv3-mini { padding-left: 64px; }
  body.sv3.sv3-mini header.topbar { width: 64px !important; padding: 14px 10px 12px !important; align-items: center !important; }
  body.sv3.sv3-mini .topbar .topbar-brand, body.sv3.sv3-mini .topbar .brand { padding: 4px 0 0 !important; justify-content: center; }
  body.sv3.sv3-mini .topbar .brand-text { display: none !important; }
  body.sv3.sv3-mini .sv3-toggle { position: static; margin: 10px 0 12px; }
  body.sv3.sv3-mini .topbar-nav { width: 44px; align-items: center !important; }
  body.sv3.sv3-mini .topbar-link { width: 44px !important; height: 40px !important; padding: 0 !important; justify-content: center !important; font-size: 0 !important; gap: 0 !important; }
  body.sv3.sv3-mini .topbar-link svg.sv3-ic { width: 19px; height: 19px; }
  body.sv3.sv3-mini .topbar-link.sv3-new { width: 40px !important; height: 40px !important; margin: 0 0 12px !important; border-radius: 50% !important; }
  body.sv3.sv3-mini .topbar-link.sv3-new .sv3-plus { display: block; width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; }
  body.sv3.sv3-mini .sv3-recent, body.sv3.sv3-mini .topbar-chat-link { display: none !important; }
  body.sv3.sv3-mini .topbar-right { flex-direction: column !important; width: 44px !important; padding-top: 10px; }
}

/* SLATE_DELETE_UI_V1 + NOTEBOOK_DELETE_V1 (preview-gated in JS) */
.library-card-delete.sv3-del { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; padding: 0; border-radius: 8px; color: var(--mid, #8a8478); }
.library-card-delete.sv3-del svg, .sv3-del-report svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.library-card-delete.sv3-del:hover, .library-card-delete.sv3-del:focus-visible { color: #b0392b; background: rgba(176, 57, 43, .08); }
#view-output .output-header .btn-secondary.btn-sm.sv3-del-report { display: inline-flex; align-items: center; justify-content: center; width: 36px; min-width: 36px; flex: 0 0 36px; padding: 0 !important; color: var(--mid, #8a8478); }
#view-output .output-header .btn-secondary.btn-sm.sv3-del-report:hover { color: #b0392b !important; border-color: rgba(176, 57, 43, .45) !important; }
#view-output .output-header .sv3-del-report[hidden] { display: none; }
.nb-delete-btn { color: #b0392b; }
.nb-delete-btn:hover { border-color: rgba(176, 57, 43, .5); background: rgba(176, 57, 43, .06); }
.nb-notebook-item:has(.nb-notebook-del) { grid-template-columns: 1fr auto auto; }
.nb-notebook-del { grid-column: 3; padding: 0 10px; }
.nb-notebook-del:hover { color: #b0392b !important; background: rgba(176, 57, 43, .08) !important; }
.nb-delete-btn[hidden] { display: none; }
/* SLATE_RECENT_MOBILE_HIDE_V1: Recent list is a sidebar-only element */
@media (max-width: 1023.98px) { .sv3-recent { display: none !important; } }
/* SLATE_EXPORT_MENU_FIX_V1: menu items were inheriting the toolbar pill rule (border, 36px, radius 999) */
#view-output .output-header .sv2-export-menu .btn-secondary.btn-sm {
  height: auto !important; min-height: 0 !important; padding: 9px 12px !important; border: 0 !important; border-radius: 8px !important;
  background: transparent !important; color: var(--ink) !important; font-weight: 450 !important; align-items: center; width: 100%;
}
#view-output .output-header .sv2-export-menu .btn-secondary.btn-sm:hover,
#view-output .output-header .sv2-export-menu .btn-secondary.btn-sm:focus-visible { background: var(--paper-2) !important; }

/* SLATE_SIDEBAR_UNIFY_V1 */
/* guide.html has its own palette names: give it the Slate tokens the shell uses */
body.sv3-guide { --paper: #FAFAF7; --paper-2: #F4F2EC; --paper-3: #EDEAE2; --card: #fff; --muted: #5A5753; --line-2: #D6D3CA; --sans: 'Inter Tight', 'Inter', system-ui, sans-serif; --serif: 'Fraunces', Georgia, serif; }
body.sv3-guide.dark { --paper: #141311; --paper-2: #1C1B18; --paper-3: #26241F; --card: #1C1B18; --muted: #B4B1A9; --line-2: #3B3933; }
body.sv3-guide header.topbar { background: var(--paper); }
/* account icon duplicates Settings; one footer set everywhere */
.topbar-right #account-btn { display: none !important; }
.topbar-icon-btn.sv3-lang, .topbar-icon-btn#nb-lang-btn { font: 600 12px/1 var(--sans, 'Inter Tight', sans-serif) !important; letter-spacing: .02em; color: var(--muted) !important; background: transparent; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.topbar-icon-btn.sv3-theme { background: transparent; color: var(--muted); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
@media (min-width: 1024px) {
  body.sv3 .topbar .topbar-brand { display: flex !important; align-items: center !important; height: 44px !important; min-height: 44px !important; padding: 0 8px !important; margin: 0 0 14px !important; box-sizing: border-box; background: none; border: 0; }
  body.sv3 .topbar .topbar-brand .brand-text { display: flex; align-items: center; }
}
/* phone menu on pages that don't load style.css (settings, guide) */
.topbar-menu-btn.sv3-menu { display: none; background: transparent; border: 0; width: 38px; height: 38px; align-items: center; justify-content: center; color: var(--ink); cursor: pointer; border-radius: 8px; }
@media (max-width: 780px) {
  header.topbar { position: relative; }
  .topbar-menu-btn.sv3-menu { display: inline-flex; }
  .topbar .topbar-nav.mobile-open {
    display: flex !important; position: absolute; top: 100%; left: 0; right: 0; flex-direction: column; gap: 2px; padding: 8px;
    background: var(--paper, #FAFAF7); border-bottom: 1px solid var(--line); box-shadow: 0 12px 24px rgba(0,0,0,.06); z-index: 30;
  }
  .topbar .topbar-nav.mobile-open .topbar-link { width: 100%; text-align: left; padding: 12px 14px !important; display: flex; align-items: center; gap: 10px; }
  .topbar .topbar-nav.mobile-open .topbar-link svg.sv3-ic { width: 17px; height: 17px; stroke: currentColor; fill: none; stroke-width: 1.5; }
  .topbar .topbar-nav .topbar-link.sv3-new { background: var(--ink) !important; color: var(--paper, #FAFAF7) !important; justify-content: center; border-radius: 999px !important; margin-bottom: 6px; }
  .topbar .topbar-nav .topbar-link.sv3-new svg.sv3-ic { display: none; }
  /* Library cards: long titles wrapped instead of widening the page */
  .library-card, .library-card-main, .library-card-topic { min-width: 0; max-width: 100%; }
  .library-card-topic { white-space: normal !important; overflow-wrap: anywhere; }
}
/* notebook header on phones: actions go to their own row so the title is readable */
@media (max-width: 560px) {
  body.sv3-nb .nb-workspace-head { flex-wrap: wrap; }
  body.sv3-nb .nb-title-group { flex: 1 1 100%; min-width: 0; }
  body.sv3-nb .nb-title-picker h1 { max-width: calc(100vw - 70px) !important; }
  body.sv3-nb .nb-workspace-actions { flex: 1 1 100%; }
  body.sv3-nb .nb-workspace-actions #nb-new-btn { margin-left: auto; }
}
/* collapse plus icon exists in the DOM at every width; only the mini rail shows it */
.topbar-link .sv3-plus { display: none; width: 18px; height: 18px; }
@media (min-width: 1024px) { body.sv3.sv3-mini .topbar-link.sv3-new .sv3-plus { display: block; } }

/* SLATE_REPORT_MOBILE_FIT_V1: long multi-source citation chips wrap; wide tables scroll inside the sheet */
#report .cite-badge { white-space: normal !important; max-width: 100%; overflow-wrap: anywhere; box-sizing: border-box; }
#report table.md-table, #report table { display: block; max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
@media (max-width: 780px) { #report table.md-table th, #report table.md-table td { min-width: 120px; } }

/* SLATE_CC_MARGIN_NOTES_V1: Cek Sumber notes in the report sheet's right margin (cite-check.js) */
@media (min-width: 1280px) { #view-output .output-grid:not(.mode-focus) { grid-template-columns: 210px minmax(0, 1fr) 300px; } }
body.cc-margin-on #view-output .output-wrap { position: relative; max-width: min(100% - 24px, 1010px) !important; padding-right: 268px !important; }
.cc-margin { position: absolute; top: 0; right: 28px; width: 212px; bottom: 0; pointer-events: none; }
.cc-mnote {
  position: absolute; left: 0; right: 0; pointer-events: auto; display: flex; flex-direction: column; gap: 2px; text-align: left;
  background: none; border: 0; border-left: 2px solid var(--line); padding: 1px 0 3px 10px; margin: 0; cursor: pointer;
  font: 400 12px/1.4 var(--sans, 'Inter Tight', sans-serif); color: var(--mid); transition: border-color .15s, color .15s;
}
.cc-mnote:hover, .cc-mnote:focus-visible { color: var(--ink); border-left-color: var(--ink); outline: none; }
.cc-mnote-head { display: flex; align-items: center; gap: 6px; font-weight: 600; color: var(--ink-2, var(--ink)); }
.cc-mnote-head .cc-dot { margin: 0; }
.cc-mnote-more { font-weight: 500; color: var(--mid); }
.cc-mnote-src { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cc-mnote-q { font-family: var(--serif, Georgia, serif); font-style: italic; font-size: 12.5px; line-height: 1.45; color: var(--ink-2, var(--ink)); display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.cc-mnote-partial { border-left-color: #C08A3E; }
.cc-mnote-contradicted { border-left-color: #B14C5C; }
.cc-mnote-not_found, .cc-mnote-unverifiable { border-left-color: var(--line-2, #D6D3CA); }
.cc-mnote-compact .cc-mnote-head { font-weight: 500; }
#report .cite-badge.cc-hover { outline: 2px solid var(--accent, #B55A30); outline-offset: 1px; }
@media print { .cc-margin { display: none; } body.cc-margin-on #view-output .output-wrap { padding-right: 0 !important; } }

/* SLATE_SMALL_FIXES_V1 */
/* notebook theme button: same icon + visible on phones like every page */
.topbar-icon-btn#nb-theme-btn { display: inline-flex !important; align-items: center; justify-content: center; color: var(--muted) !important; }
/* phone menu: identical item height on every page */
@media (max-width: 780px) {
  .topbar .topbar-nav.mobile-open .topbar-link { height: 44px !important; padding: 0 14px !important; font-size: 14.5px !important; line-height: 1 !important; display: flex !important; align-items: center !important; box-sizing: border-box; }
}
/* Library: the sidebar already has "Riset baru"; the header copy duplicated it on desktop */
@media (min-width: 1024px) { body.sv3 #view-library .library-head > .btn-primary[data-go="research"] { display: none !important; } }

/* SLATE_DARK_CANVAS_V1 (2026-10-07): style.css paints html with var(--paper), but the dark
   tokens live on body.dark, so the html canvas stayed light (#FAFAF7) and showed as a white band
   below body's 100% box when content overflowed / on overscroll. Paint the canvas dark too. */
html:has(> body.dark) { background: #141311; color-scheme: dark; }  /* SLATE_DARK_SCROLLBARS_V1: native scrollbars/controls follow dark */

/* SLATE_RUNLOG_GRID_V1 (2026-10-07): run-log rows were flex+wrap with the label at flex:1 and
   word-break:break-word, so the "52 sources" count squeezed the label to one broken syllable per
   line ("Memba / ca"). Grid: dot | status | label, count on its own line under the label. */
.runlog .progress-line { display: grid; grid-template-columns: 6px auto minmax(0, 1fr); column-gap: 8px; align-items: start; }
.runlog .progress-line .label { word-break: normal; overflow-wrap: break-word; min-width: 0; }
.runlog .progress-line .progress-count { grid-column: 3; font-size: 11px; color: var(--mid); }

/* SLATE_OUTPUT_FIT_V1 (2026-10-07): .output-grid was calc(100vh - 60px) but the output header is
   65px in the sidebar shell, so the page itself scrolled 5px (an extra page scrollbar next to the
   two pane scrollbars). Size the grid as the remainder of a 100vh flex column instead. */
@media (min-width: 1024px) {
  body.sv3 #view-output:not(.hidden) { display: flex; flex-direction: column; height: 100vh; }
  body.sv3 #view-output .output-grid { flex: 1 1 auto; height: auto; min-height: 0; }
}
#report hr { border: 0; border-top: 1px solid var(--line); margin: 28px 0; }

/* SLATE_FOOTER_ICONS_V1 (2026-10-07): settings/guide don't load style.css, so the footer Guide link
   (an <a>, display:block) sat its icon top-left and the theme button had no sun/moon swap rules. */
header.topbar a.topbar-icon-btn { display: inline-flex; align-items: center; justify-content: center; }
.topbar-icon-btn .icon-sun { display: none; }
body.dark .topbar-icon-btn .icon-sun { display: block; }
body.dark .topbar-icon-btn .icon-moon { display: none; }
/* SLATE_DARK_CONTRAST_V1: dark placeholders were --line-2 (#3B3933 on #1C1B18, ~1.6:1, unreadable);
   the active Library kind filter lost its ink background to body.dark .library-kind-btn */
body.dark input::placeholder, body.dark textarea::placeholder { color: var(--mid) !important; }
body.dark .library-kind-btn.active { background: var(--ink); color: var(--paper); border-color: var(--ink); }
/* SLATE_GUIDE_DOUBLE_RULE_V1: hero border-bottom + 56px + .toc border-top drew two rules around an empty band */
body.sv3-guide .hero { border-bottom: 0; margin-bottom: 0; padding-bottom: 40px; }

/* SLATE_NOTEBOOK_ACCENT_V1 (2026-10-07): notebook had its own blue accent (#2C4A6F / #AFC9EA in dark);
   use the Slate accent like every other page, and the primary button style (ink) for Tambah */
body, body.dark { --nb-blue: var(--accent); }
.nb-url-row button { background: var(--ink) !important; color: var(--paper) !important; }
/* SLATE_LIBRARY_NB_LABEL_V1: notebook rows said "Notebook" twice (kind badge + status) */
.library-card-status.status-notebook { display: none; }
/* SLATE_BIBCHECK_BACK_ALIGN_V1: back link sat in a 960px row over the 880px bibcheck column */
#view-bibcheck .compat-nav { max-width: 880px; }
/* SLATE_NOTEBOOK_ACCENT_V1 (cont.): blue hardcoded outside --nb-blue in notebook-v3.css line 378 */
body .nb-source-scope, body.dark .nb-source-scope { background: var(--paper-3); color: var(--muted); }
body .nb-source-refs, body.dark .nb-source-refs, .nb-info-stat { color: var(--accent); }
.nb-source-scope button, .nb-notes button, .nb-note-actions button, .nb-collab-form button, .nb-public-row button { border-color: var(--line-2); }
.nb-role-pill, .nb-metric, .nb-data-table th { background: var(--paper-3); }
.nb-flashcard { border-color: var(--line-2); background: var(--card); }

/* SLATE_REPORT_PANELS_V1: disclosures above the article, capped on small screens. */
.report-panel-controls { display: none; }
@media (max-width: 1160px) {
  #view-output .report-panel-controls {
    display: flex; flex-wrap: wrap; gap: 8px;
    padding: 12px 22px; border-bottom: 1px solid var(--line);
    background: var(--paper);
  }
  #view-output .report-panel-controls [hidden],
  #view-output .report-panel-toc { display: none !important; }
  #view-output .output-grid[data-report-panel="sources"] .output-sources {
    display: block !important; grid-column: 1 / -1; grid-row: 1;
    position: static; height: auto; max-height: min(55vh, 480px);
    overflow-y: auto; min-width: 0; border-bottom: 1px solid var(--line);
  }
  #view-output .output-grid[data-report-panel="sources"] .output-toc,
  #view-output .output-grid[data-report-panel="sources"] .output-scroll { grid-row: 2; }
}
@media (max-width: 780px) {
  #view-output .report-panel-controls .report-panel-toc { display: inline-flex !important; }
  #view-output .output-grid[data-report-panel="toc"] .output-toc {
    display: block !important; grid-column: 1; grid-row: 1;
    position: static; height: auto; max-height: min(55vh, 480px);
    overflow-y: auto; min-width: 0; border-bottom: 1px solid var(--line) !important;
  }
  #view-output .output-grid[data-report-panel="toc"] .output-scroll { grid-row: 2; }
  #view-output .output-grid[data-report-panel="sources"] .output-toc { display: none; }
}
