@font-face {
  font-family: 'Bebas Neue';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(/fonts/bebas-neue-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: 'Bebas Neue';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(/fonts/bebas-neue-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'Roboto';
  font-style: italic;
  font-weight: 400;
  font-stretch: 100%;
  font-display: swap;
  src: url(/fonts/roboto-italic-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: 'Roboto';
  font-style: italic;
  font-weight: 400;
  font-stretch: 100%;
  font-display: swap;
  src: url(/fonts/roboto-italic-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'Roboto';
  font-style: normal;
  font-weight: 300 900;
  font-stretch: 100%;
  font-display: swap;
  src: url(/fonts/roboto-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: 'Roboto';
  font-style: normal;
  font-weight: 300 900;
  font-stretch: 100%;
  font-display: swap;
  src: url(/fonts/roboto-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'Roboto Slab';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url(/fonts/roboto-slab-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: 'Roboto Slab';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url(/fonts/roboto-slab-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* Savana Signatures brand tokens. */
:root {
  color-scheme: light dark;
  --color-brand-50: light-dark(#eff7fe, #202f44);
  --color-brand-100: light-dark(#dbecfd, #253c57);
  --color-brand-200: #bfdffc;
  --color-brand-300: #93cbfa;
  --color-brand-400: #5badf7;
  --color-brand-500: #2c93f4;
  --color-brand-600: light-dark(#1574ce, #7ec1ff);
  --color-brand-700: light-dark(#0f5eae, #8dcaff);
  --color-brand-800: light-dark(#12508d, #a9d5ff);
  --color-brand-900: #273ca2;
  --color-brand-950: light-dark(#16214f, #e0eafa);

  --color-ink-900: light-dark(#23252b, #edf1f7);
  --color-ink-700: light-dark(#3f4147, #d3dce8);
  --color-ink-500: light-dark(#6b6f76, #a7b5c7);

  --font-sans: "Roboto", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-display: var(--font-sans);
  --font-hero: "Bebas Neue", "Oswald", Impact, "Arial Narrow", sans-serif;
  --font-serif: "Roboto Slab", ui-serif, Georgia, serif;

  --muted: var(--color-ink-500);
  --line: light-dark(#dce5f0, #303e51);
  --control-line: light-dark(#c5d5e8, #5c6e86);
  --accent: var(--color-brand-700);
  --page: light-dark(#fdfdfd, #111721);
  --surface: light-dark(#f7faff, #151e2c);
  --panel: light-dark(#fff, #1b2534);
  --shadow: light-dark(#16214f14, #0005);
  --scrim: light-dark(#16214f26, #0008);
  --dialog-scrim: light-dark(#16214f83, #000a);
  --danger: light-dark(#9b2626, #ffb4b4);
  --notice-background: light-dark(#16214f, #293d59);
  --on-accent: #16181d;
  --hero-background: #16214f;

  font-family: var(--font-sans);
  color: var(--color-ink-900);
  background: var(--page);
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
}

:root[data-theme="light"] { color-scheme: light; }
:root[data-theme="dark"] { color-scheme: dark; }

::selection { background: var(--color-brand-500); color: var(--on-accent); }

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; }
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .55; }
svg { width: 1.15em; height: 1.15em; flex: none; vertical-align: middle; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { font-family: var(--font-display); }
p { line-height: 1.55; }
h1 { font-size: clamp(2rem, 4vw, 3.7rem); font-weight: 700; line-height: 1.04; letter-spacing: -.015em; overflow-wrap: anywhere; }
h2 { font-size: 1.25rem; letter-spacing: -.025em; }
small { color: var(--muted); font-size: .875rem; }
:focus-visible { outline: 3px solid var(--color-brand-600); outline-offset: 3px; }
[hidden] { display: none !important; }

.shell { display: grid; grid-template-columns: 68px minmax(0, 1fr); min-height: 100vh; }
.shell:has(> .sidebar[data-expanded="true"]) { grid-template-columns: 218px minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; height: 100dvh; background: var(--surface); color: var(--color-brand-950); border-inline-end: 1px solid var(--line); display: flex; flex-direction: column; padding: 16px 10px; overflow-y: auto; }
.sidebar-scrim { display: none; }
.topbar-brand { display: inline-flex; align-items: center; gap: 8px; color: var(--color-brand-950); flex: none; font-size: 1.18rem; font-weight: 750; letter-spacing: -.015em; white-space: nowrap; }
.brand-accent { color: var(--color-brand-700); }
.brand-logo { display: block; flex: none; object-fit: contain; border-radius: 5px; background: light-dark(transparent, #dbe9fb); }
.sidebar nav { display: grid; gap: 4px; margin-top: 22px; }
.sidebar nav a { display: flex; gap: 9px; align-items: center; min-height: 42px; padding: 6px 10px; border-radius: 8px; font-weight: 600; font-size: .9rem; white-space: nowrap; }
.sidebar nav a:hover { background: var(--color-brand-50); }
.sidebar nav a[aria-current] { background: var(--color-brand-100); color: var(--color-brand-800); }
.sidebar .icon { display: inline-grid; place-items: center; color: var(--color-brand-800); }
.nav-short { display: none; }
.sidebar[data-expanded="false"] { padding-inline: 6px; }
.sidebar[data-expanded="false"] a:has(.nav-short) .nav-label { display: none; }
.sidebar[data-expanded="false"] nav a { flex-direction: column; justify-content: center; gap: 3px; padding: 5px 0; min-height: 52px; background: transparent; font-size: .7rem; }
.sidebar[data-expanded="false"] .nav-short { display: inline; }
.sidebar[data-expanded="false"] nav .icon { border-radius: 9px; width: 36px; height: 26px; font-size: 1.05rem; }
.sidebar[data-expanded="false"] nav a:hover .icon { background: var(--color-brand-50); }
.sidebar[data-expanded="false"] nav a[aria-current] .icon { background: var(--color-brand-100); }
.topbar { height: 69px; display: flex; align-items: center; justify-content: space-between; gap: 9px; padding: 0 clamp(20px, 4vw, 51px); background: var(--panel); border-bottom: 1px solid var(--line); font-weight: 650; }
.topbar-heading { display: flex; align-items: center; gap: 10px; min-width: 0; }
.topbar-heading #breadcrumb { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; border-inline-start: 1px solid var(--line); padding-inline-start: 10px; }
.topbar > .actions, .sidebar-toggle { flex-shrink: 0; }
.sidebar-toggle { display: grid; place-items: center; width: 36px; height: 36px; padding: 0; border: 0; border-radius: 9px; color: var(--on-accent); background: var(--color-brand-500); }
.sidebar-toggle svg { width: 19px; height: 19px; stroke-width: 2; }
.sidebar-toggle:hover, .sidebar-toggle[aria-expanded="true"] { background: var(--color-brand-400); }
.sidebar > .sidebar-toggle { margin-inline-start: 6px; }
.sidebar[data-expanded="false"] > .sidebar-toggle { margin-inline: auto; }
.ai-indicator { display: inline-flex; align-items: center; gap: 7px; font-size: .82rem; color: var(--color-ink-700); padding: 6px 10px; background: var(--color-brand-50); border: 1px solid var(--line); border-radius: 30px; }
.ai-indicator span { width: 7px; height: 7px; border-radius: 50%; background: #9a7540; }
.ai-indicator.enabled span { background: var(--color-brand-700); }
main { max-width: 1440px; padding: 34px clamp(20px, 4vw, 51px) 48px; margin: auto; }
.shell:has(> .sidebar[data-expanded="false"]) main:has(.proposal-studio) { max-width: none; }
.hero { position: relative; isolation: isolate; display: flex; align-items: center; min-height: 293px; border-radius: 18px; overflow: hidden; padding: 38px; background: linear-gradient(115deg, var(--hero-background) 30%, var(--color-brand-900) 95%); color: #fff; }
.hero-content { max-width: 570px; position: relative; z-index: 1; }
.hero h1 { font-family: var(--font-hero); font-size: clamp(2.8rem, 5vw, 4.25rem); font-weight: 400; text-transform: uppercase; letter-spacing: .03em; line-height: .95; }
.hero p { max-width: 450px; margin: 15px 0 24px; color: #dbecfd; }
.hero-art { position: absolute; right: 1%; top: 0; bottom: 0; width: 33%; pointer-events: none; }
.orb { position: absolute; width: 320px; height: 320px; border-radius: 50%; top: 50%; right: -20px; transform: translateY(-50%); border: 1px solid #93cbfa40; box-shadow: 0 0 0 25px #93cbfa13, inset 0 0 0 25px #93cbfa16, inset 0 0 0 48px #93cbfa10; }
.paper { position: absolute; display: block; width: 120px; height: 152px; border-radius: 13px; top: calc(50% - 76px); right: 24%; border: 1px solid var(--color-brand-300); }
.paper.back { background: var(--color-brand-400); transform: translate(-26px, 3px) rotate(-18deg); }
.paper.front { background: var(--color-brand-100); transform: rotate(12deg); box-shadow: 0 12px 30px #16214f40; padding: 22px 16px; }
.paper i { display: block; background: var(--color-brand-300); height: 5px; border-radius: 5px; margin-bottom: 11px; width: 100%; }
.paper i:first-child { width: 58%; background: var(--accent); }
.paper i:last-of-type { width: 72%; }
.paper b { position: absolute; right: -13px; bottom: -8px; width: 43px; height: 43px; border-radius: 50%; background: var(--color-brand-300); border: 3px solid var(--color-brand-100); color: var(--hero-background); display: grid; place-items: center; }
.actions { display: flex; align-items: center; flex-wrap: wrap; gap: 9px; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 9px 13px; border: 1px solid var(--control-line); border-radius: 8px; background: var(--panel); color: var(--color-brand-950); font-size: .9rem; font-weight: 700; min-height: 41px; }
.button:hover:not(:disabled) { background: var(--color-brand-50); }
.button.primary { background: var(--color-brand-500); border-color: var(--color-brand-500); color: var(--on-accent); }
.button.primary:hover:not(:disabled) { background: var(--color-brand-400); border-color: var(--color-brand-400); }
.hero .primary { background: var(--color-brand-300); border-color: var(--color-brand-300); color: var(--hero-background); }
.hero .primary:hover { background: var(--color-brand-200) !important; }
.button.hero-secondary { background: #ffffff12; border-color: #bfdffc71; color: #fff; }
.button.hero-secondary:hover { background: #ffffff28 !important; }
.button.danger { color: var(--danger); }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin: 20px 0 34px; }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; display: flex; align-items: center; gap: 13px; padding: 17px; }
.stat:hover, .proposal-row:hover { border-color: var(--color-brand-400); background: var(--surface); }
.doc-icon, .empty-icon { flex: none; display: grid; place-items: center; background: var(--color-brand-100); color: var(--accent); width: 43px; height: 43px; border-radius: 11px; }
.stat strong, .stat small, .row-name small { display: block; }
.stat strong { font-size: 1.45rem; line-height: 1.15; }
.stat small { margin-top: 3px; }
.section-head, .page-heading, .source-top, .editor-head, .editor-foot, .modal-head, .modal-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.section-head { margin-bottom: 13px; }
.section-head a, .back, .text-button { color: var(--accent); font-weight: 700; font-size: .9rem; }
.section-head a:hover, .back:hover, .text-button:hover { text-decoration: underline; }
.page-heading { margin-bottom: 26px; }
.page-heading h1 { font-size: clamp(1.85rem, 4vw, 2.85rem); }
.page-heading p { color: var(--muted); margin-top: 7px; }
.proposal-list, .source-grid { display: grid; gap: 10px; }
.proposal-row { display: grid; grid-template-columns: auto minmax(0,1fr) auto auto; align-items: center; gap: 14px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 13px; }
.row-name { overflow-wrap: anywhere; }
.row-name small { margin-top: 4px; }
.deadline { white-space: nowrap; color: var(--muted); font-size: .875rem; }
.tag { padding: 5px 9px; background: var(--color-brand-50); border-radius: 20px; color: var(--color-ink-700); font-size: .8rem; font-weight: 700; white-space: nowrap; }
.tag.ready { background: var(--color-brand-100); color: var(--color-brand-800); }
.empty { background: var(--panel); border: 1px solid var(--line); border-radius: 13px; display: grid; justify-items: center; text-align: center; gap: 10px; padding: 32px 17px; }
.empty p, .example p { color: var(--muted); }
.empty .button { margin-top: 5px; }
.example { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 18px 0; margin-top: 7px; }
.example p { font-size: .9rem; margin-top: 3px; }
.source-grid { grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr)); }
.card, .source-card { background: var(--panel); border: 1px solid var(--line); border-radius: 13px; }
.source-card { padding: 18px; min-width: 0; overflow-wrap: anywhere; }
.source-card h2 { margin: 12px 0 6px; }
.source-card p { color: var(--muted); font-size: .95rem; margin-bottom: 12px; }
.text-button { padding: 0; border: 0; background: transparent; }
.sample-label { color: var(--muted); font-size: .8rem; margin-left: 7px; }
.search { max-width: 380px; margin-bottom: 20px; }
.back { display: inline-block; margin-bottom: 14px; }
.editor-layout { display: grid; grid-template-columns: minmax(0, 1.9fr) minmax(255px, 1fr); gap: 16px; align-items: start; }
.editor { padding: 17px; min-width: 0; }
.editor-head { margin-bottom: 13px; }
.status-field { display: flex; align-items: center; gap: 8px; color: var(--muted); }
.editor textarea { line-height: 1.55; background: var(--surface); }
.editor-foot { margin-top: 12px; }
#word-count { font-size: .85rem; color: var(--muted); }
.review { display: grid; gap: 13px; min-width: 0; }
.review-card { padding: 16px; overflow-wrap: anywhere; }
.review-title { display: flex; align-items: center; gap: 7px; color: var(--accent); }
.review-card p { margin: 8px 0; font-size: .9rem; color: var(--muted); }
.checklist { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 9px; }
.checklist label { display: flex; align-items: start; gap: 8px; font-weight: 500; }
.checklist input { width: 16px; height: 16px; margin: 2px 0 0; accent-color: var(--accent); flex: none; }
.notes { border-top: 1px solid var(--line); padding-top: 12px; margin-top: 14px; }
.notes label, .source-detail { margin-top: 8px; }
summary { cursor: pointer; font-weight: 650; font-size: .92rem; }
pre { font: inherit; font-size: .9rem; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; color: var(--muted); max-height: 300px; overflow: auto; }
label { display: grid; gap: 5px; font-size: .9rem; font-weight: 650; }
label small { font-weight: 500; }
input:not([type="checkbox"]), select, textarea { width: 100%; min-width: 0; padding: 9px 10px; border-radius: 7px; border: 1px solid var(--control-line); background: var(--panel); color: var(--color-ink-900); font-size: 1rem; font-weight: 400; }
select { appearance: none; padding-right: 30px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='m1 1 5 5 5-5' fill='none' stroke='%23738096' stroke-width='1.6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 9px center; }
textarea { resize: vertical; display: block; }
dialog { width: min(620px, calc(100% - 26px)); max-height: calc(100% - 30px); border: 1px solid var(--line); border-radius: 15px; padding: 22px; background: var(--panel); color: inherit; box-shadow: 0 25px 75px var(--shadow); }
dialog::backdrop { background: var(--dialog-scrim); }
.modal-head { margin-bottom: 15px; }
.modal-head h2 { overflow-wrap: anywhere; }
.icon-button { display: grid; place-items: center; background: var(--color-brand-50); border: none; border-radius: 8px; width: 34px; height: 34px; color: inherit; flex: none; }
.modal-form { display: grid; gap: 13px; }
.call-url-row { display: flex; align-items: end; flex-wrap: wrap; gap: 9px; }
.call-url-row label { flex: 1 1 13rem; min-width: 0; }
#funding-import-status:empty { display: none; }
.form-row { display: grid; grid-template-columns: 1.4fr 1fr; gap: 12px; }
.modal-foot { justify-content: flex-end; }
.form-error { color: var(--danger); font-size: .9rem; }
.form-error:empty { display: none; }
.modal-meta { font-size: .9rem; color: var(--muted); }
.document-text { max-height: 55vh; }
#notice { position: fixed; z-index: 3; bottom: 16px; right: 17px; max-width: calc(100% - 34px); background: var(--notice-background); color: #fff; border-radius: 9px; padding: 12px 15px; opacity: 0; pointer-events: none; box-shadow: 0 5px 18px #16214f35; }
#notice.visible { opacity: 1; }
#notice.error { background: #8f2424; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

@media (max-width: 1060px) {
  .hero-art { opacity: .6; }
  .editor-layout { grid-template-columns: minmax(0, 1fr); }
  .review { grid-template-columns: repeat(auto-fit, minmax(min(230px, 100%), 1fr)); align-items: start; }
}
@media (max-width: 760px) {
  .shell { display: block; }
  .sidebar { position: fixed; z-index: 2; inset: 48px auto 0 0; width: min(230px, 85vw); height: auto; padding: 16px 13px; overflow-y: auto; box-shadow: 8px 0 24px #16214f33; }
  .sidebar[data-expanded="false"] { display: none; }
  .sidebar[data-expanded="true"] + .sidebar-scrim { display: block; position: fixed; z-index: 1; inset: 48px 0 0; background: var(--scrim); }
  .sidebar nav { margin: 16px 0 0; }
  .sidebar nav a { padding: 8px; gap: 6px; font-size: .85rem; }
  .topbar { position: sticky; z-index: 3; top: 0; height: 48px; }
  main { padding-top: 20px; }
  .hero { min-height: 240px; padding: 24px; }
  .hero-art { display: none; }
}
@media (max-width: 490px) {
  .topbar-brand { font-size: 1.02rem; }
  .topbar-heading #breadcrumb { display: none; }
  /* Only the status dot fits beside the name. Its text stays available to screen readers. */
  .ai-indicator { gap: 0; padding: 8px; font-size: 0; }
  .ai-indicator span { width: 9px; height: 9px; }
  .stats { gap: 6px; margin-bottom: 25px; }
  .stat { padding: 8px; align-items: start; flex-direction: column; gap: 6px; }
  .stat small { font-size: .78rem; }
  .stat .doc-icon { width: 31px; height: 31px; }
  .section-head, .page-heading, .example, .editor-foot { align-items: flex-start; flex-wrap: wrap; }
  .proposal-row { grid-template-columns: auto minmax(0,1fr) auto; gap: 9px; }
  .deadline { grid-column: 2; grid-row: 2; }
  .proposal-row .tag { grid-column: 3; grid-row: 1; }
  .form-row { grid-template-columns: 1fr; }
}

#auth-screen { min-height: 100dvh; display: grid; place-items: center; padding: clamp(16px, 4vw, 40px); background: radial-gradient(ellipse at top right, var(--color-brand-100), var(--surface) 55%); max-width: none; }
/* Always dark, whichever theme is active: the form sits on the brand gradient. */
.auth-layout { color-scheme: dark; position: relative; isolation: isolate; width: min(500px, 100%); overflow: hidden; background: linear-gradient(150deg, var(--hero-background) 25%, var(--color-brand-900)); color: #fff; border: 1px solid var(--line); border-radius: 22px; box-shadow: 0 24px 70px var(--shadow); }
.auth-brand { display: flex; align-items: center; gap: 11px; margin-bottom: 36px; font-size: 1.3rem; font-weight: 750; }
.auth-brand span { color: var(--color-brand-300); margin-inline-start: -5px; }
.auth-brand .brand-logo { background: #fff; padding: 4px; border-radius: 9px; }
.auth-rings { position: absolute; z-index: -1; width: 400px; height: 400px; top: -70px; right: -150px; opacity: .22; transform: rotate(-38deg); stroke: var(--color-brand-400); }
.auth-rings circle:nth-child(2) { stroke: var(--color-brand-200); opacity: .55; }
.login-card { display: flex; flex-direction: column; min-width: 0; padding: clamp(26px, 7vw, 48px); }
.login-card h1 { font-size: 2.1rem; margin: 0 0 8px; color: #fff; }
.auth-message { color: #dbecfd; margin-bottom: 24px; overflow-wrap: anywhere; }
.auth-message strong { color: #fff; }
.login-card form { gap: 17px; }
.login-card input { min-height: 48px; padding: 10px 14px; border-radius: 10px; background: #101a40; border-color: #7f95cf; color: #fff; }
.login-card input::placeholder { color: #a9b9e2; opacity: 1; }
.login-card :is(small, .reveal, .auth-resend) { color: #dbecfd; }
.login-card .text-button { color: var(--color-brand-300); }
.login-card input[readonly] { color: #c3d0ee; }
.login-card .form-error { font-weight: 600; }
.auth-icon { display: grid; place-items: center; width: 54px; height: 54px; margin-bottom: 20px; border-radius: 15px; background: rgb(255 255 255 / .12); color: var(--color-brand-300); font-size: 1.5rem; }
.button.wide { width: 100%; min-height: 49px; border-radius: 10px; font-size: 1rem; }
.secret-field { position: relative; display: block; }
.secret-field input { width: 100%; padding-inline-end: 50px; }
.reveal { position: absolute; inset: 4px 4px 4px auto; width: 42px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 8px; background: none; color: var(--muted); }
.reveal:hover, .reveal[aria-pressed="true"] { color: var(--color-brand-700); }
.auth-link { align-self: center; margin-top: 20px; }
.auth-back { display: inline-flex; align-items: center; gap: 6px; align-self: center; margin-top: 18px; }
.auth-resend { margin-top: 20px; text-align: center; color: var(--muted); font-size: .92rem; }
.auth-resend .text-button:disabled { color: inherit; opacity: 1; text-decoration: none; }
.code-field { position: relative; display: block; }
.login-card .code-field input { position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; opacity: 0; cursor: text; }
.code-cells { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: clamp(6px, 1.6vw, 11px); }
.code-cells i { display: grid; place-items: center; height: 62px; border: 1.5px solid #7f95cf; border-radius: 12px; background: #101a40; color: #fff; font-style: normal; font-size: 1.65rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.code-field input:focus + .code-cells .current { border-color: var(--color-brand-500); box-shadow: 0 0 0 4px color-mix(in srgb, var(--color-brand-500) 25%, transparent); }
.status-chip { display: inline-flex; align-items: center; gap: 7px; padding: 4px 10px; border-radius: 30px; background: var(--color-brand-50); color: var(--color-ink-700); font-size: .82rem; font-weight: 650; white-space: nowrap; }
.status-chip::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--muted); }
.status-chip.on::before { background: light-dark(#1b8a5a, #5fd3a0); }
.status-chip.wait::before { background: light-dark(#b7791f, #f0c060); }
.staff-actions { display: flex; flex-wrap: wrap; gap: 4px 14px; }
.text-button.danger { color: var(--danger); }
#account-link { width: 40px; min-height: 40px; padding: 0; border-radius: 50%; background: var(--color-brand-100); color: var(--color-brand-800); }
#account-link:hover { background: var(--color-brand-50); }
.filters { display: flex; flex-wrap: wrap; align-items: end; gap: 12px; padding: 14px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; margin-bottom: 18px; }
.proposal-file-nav { margin-bottom: 14px; }
.proposal-file-nav [aria-current="page"] { background: var(--color-brand-100); color: var(--accent); }
.draft-history-row { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; padding: 12px 15px; }
.draft-history-row + .draft-history-row { border-top: 1px solid var(--line); }
.filters label:first-child { flex: 1 1 220px; }
.paging { display: flex; align-items: center; justify-content: flex-end; gap: 10px; margin-top: 16px; font-size: .9rem; color: var(--muted); }
.search-status { color: var(--muted); font-size: .9rem; margin-bottom: 12px; }
.table-wrap { overflow: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; font-size: .9rem; }
th, td { padding: 12px; border-bottom: 1px solid var(--line); }
th { color: var(--muted); background: var(--surface); white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
.resource-id { display: block; font-family: monospace; font-size: .75rem; overflow-wrap: anywhere; }
.settings-card { margin-bottom: 15px; padding: clamp(14px, 3vw, 24px); }
.settings-card h2 { margin-bottom: 10px; }
.settings-card p, .related-proposal { margin: 8px 0; }
.settings-card .password-form { max-width: 490px; }
.theme-setting { max-width: 220px; }
.rate-grid, .usage-summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(150px, 100%), 1fr)); gap: 12px; }
.month-filter, #evaluation-capture-form { align-items: end; max-width: 100%; }
.month-filter label, #evaluation-capture-form label { flex: 1 1 10rem; min-width: 0; }
.month-filter :is(input, button), #evaluation-capture-form :is(input, button) { min-height: 41px; }
#evaluation-capture-form { width: fit-content; }
.usage-summary { margin: 10px 0 18px; }
.usage-summary div { padding: 12px; background: var(--color-brand-50); border-radius: 9px; }
.api-trace { border-top: 1px solid var(--line); padding: 10px 0; }
.api-trace summary { cursor: pointer; overflow-wrap: anywhere; }
.api-trace summary span { margin-inline-start: 5px; }
.api-trace pre { overflow: auto; background: var(--color-brand-50); padding: 12px; border-radius: 8px; }
.evaluation-row { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; padding: 7px 0; border-top: 1px solid var(--line); }
.evaluation-detail pre { max-height: 45dvh; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; }
.profile-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 13rem); gap: 12px; align-items: end; padding-block: 12px; border-top: 1px solid var(--line); }
.profile-row .check-label { min-height: 40px; }
.profile-inputs, .profile-actions { display: grid; gap: 8px; }
.profile-actions button { justify-self: start; }
@media (max-width: 350px) {
  .topbar-brand .brand-logo { display: none; }
}
@media (max-width: 600px) {
  .profile-row { grid-template-columns: 1fr; gap: 4px; }
}
.usage-summary strong { display: block; font-size: 1.3rem; padding-top: 3px; }
.check-label { display: flex; align-items: center; }
.check-label input { accent-color: var(--accent); }
.modal-actions { flex-wrap: wrap; }
.proposal-heading { margin-bottom: 16px; }
.proposal-heading .back { margin-bottom: 10px; }
.proposal-title-row, .studio-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.proposal-identity { min-width: 0; }
.proposal-identity h1 { max-width: 70ch; font-size: clamp(1.35rem, 2.1vw, 1.8rem); line-height: 1.25; letter-spacing: -.025em; }
.proposal-identity p { margin-top: 4px; color: var(--muted); font-size: .9rem; }
.proposal-actions, .draft-tools, .draft-label { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.proposal-actions { flex: none; }
#main:has(.proposal-studio) { container-type: inline-size; }
.proposal-studio { display: grid; grid-template-columns: minmax(0,1.55fr) minmax(320px,1fr); align-items: start; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; }
.studio-editor, .conversation { min-width: 0; padding: 16px 20px; }
.conversation { border-left: 1px solid var(--line); }
.studio-head { min-height: 38px; margin-bottom: 11px; flex-wrap: wrap; }
.studio-head h2 { font-size: 1rem; letter-spacing: -.015em; }
.provider-label { color: var(--muted); font-size: .85rem; }
.proposal-status { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: .8rem; }
.proposal-status span { white-space: nowrap; }
.studio-editor .draft-tools select, .composer select { padding-block: 6px; min-height: 34px; font-size: .875rem; }
.studio-editor textarea { line-height: 1.55; }
.draft-edit { display: grid; gap: 12px; }
.draft-edit-toolbar { display: flex; flex-wrap: wrap; align-items: end; gap: 8px; }
.draft-edit-toolbar label { flex: 1 1 180px; min-width: 0; }
.draft-edit textarea { min-height: 10rem; max-height: 62vh; overflow-y: scroll; scrollbar-gutter: stable; scrollbar-color: var(--muted) var(--surface); }
@supports selector(::-webkit-scrollbar) {
  .draft-edit textarea { scrollbar-color: auto; }
}
.draft-edit textarea::-webkit-scrollbar { width: 13px; }
.draft-edit textarea::-webkit-scrollbar-track { background: var(--surface); }
.draft-edit textarea::-webkit-scrollbar-thumb { background: var(--muted); border: 3px solid var(--surface); border-radius: 10px; }
.proposal-studio .button, .proposal-actions .button { min-height: 34px; padding: 6px 10px; }
.button.quiet { background: transparent; border-color: transparent; }
.draft-preview { max-height: 62vh; overflow: auto; border-block: 1px solid var(--line); padding: 14px 0 18px; overflow-wrap: anywhere; }
.draft-preview :is(h3, h4, h5, h6) { font-family: var(--font-serif); }
.draft-preview h3 { margin: 0 0 12px; font-size: 1.15rem; }
.draft-preview h4, .draft-preview h5, .draft-preview h6 { margin: 14px 0 4px; font-size: .98rem; }
.draft-preview > :first-child { margin-top: 0; }
.draft-preview p { margin: 0 0 8px; white-space: pre-wrap; line-height: 1.6; }
.draft-preview .outline-placeholder { color: var(--muted); }
.draft-label #section-count { color: var(--muted); font-size: .83rem; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; padding: 4px 6px; margin-inline: -6px; background: transparent; color: inherit; border: 0; border-radius: 5px; font-weight: inherit; text-align: left; }
.section-heading[aria-pressed="true"], .section-heading:hover:not(:disabled) { background: var(--color-brand-50); color: var(--accent); }
.section-heading small { color: var(--color-brand-700); font-family: var(--font-sans); font-size: .75rem; flex: none; }
.section-toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: 5px; margin-bottom: 12px; }
.section-toolbar label { min-width: 145px; flex: 1 1 155px; }
.section-toolbar select { min-height: 34px; padding-block: 5px; font-size: .875rem; }
.section-base { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 6px; color: var(--muted); font-size: .85rem; padding: 4px 6px; }
.version-list { margin-bottom: 12px; }
.saved-version { border-top: 1px solid var(--line); padding: 10px 0; }
.saved-version summary small { margin-inline-start: 6px; font-weight: 400; }
.saved-version .actions { margin-top: 8px; }
.proposal-reference { margin-top: 12px; }
.proposal-reference #progress { color: var(--muted); font-size: .82rem; font-weight: 400; margin-left: 6px; }
.reference-content { margin: 0 0 4px 14px; }
.reference-content .notes { border-top: 0; border-bottom: 1px solid var(--line); padding: 9px 0; margin: 0; }
.conversation-log { max-height: min(48vh, 480px); overflow: auto; }
.conversation-log:empty { display: none; }
.conversation-turn { display: grid; gap: 11px; margin-bottom: 16px; font-size: .92rem; }
.staff-message { justify-self: end; max-width: 90%; background: var(--color-brand-50); border-radius: 8px; padding: 8px 10px; }
.assistant-message > strong { display: block; margin-bottom: 4px; font-size: .78rem; color: var(--muted); }
.copy-response { width: 30px; height: 30px; background: transparent; color: var(--muted); }
.copy-response:hover { background: var(--color-brand-50); color: var(--accent); }
.staff-message p, .assistant-message p { white-space: pre-wrap; overflow-wrap: anywhere; }
.assistant-message { min-width: 0; }
.suggestion { padding: 6px 0 6px 10px; border-left: 2px solid var(--line); }
.formatted-draft { margin: 7px 0 10px; max-height: 23rem; overflow: auto; overflow-wrap: anywhere; }
.formatted-draft p { margin-bottom: 6px; }
.draft-bullet { display: flex; gap: .55em; }
.draft-bullet > :first-child { flex: none; }
.draft-bullet.depth-1 { padding-inline-start: 1em; }
.draft-bullet.depth-2 { padding-inline-start: 2em; }
.draft-bullet.depth-3 { padding-inline-start: 3em; }
.draft-bullet.depth-4 { padding-inline-start: 4em; }
.suggestion .actions { margin-top: 8px; }
.composer { padding: 8px; border: 1px solid var(--control-line); border-radius: 8px; background: var(--surface); }
.composer textarea { min-height: 65px; max-height: 270px; border: 0; background: transparent; padding: 8px 6px; }
.composer-controls { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; border-top: 1px solid var(--line); padding-top: 6px; }
.composer-controls select { padding-left: 7px; border-color: transparent; background-color: transparent; text-overflow: ellipsis; }
.type-select { flex: 1 1 112px; min-width: 0; }
.send-button { margin-left: auto; }
.attachment-list { display: flex; flex-wrap: wrap; gap: 5px; }
.attachment-list:not(:empty) { margin: 5px 0; }
.attachment { display: flex; gap: 5px; align-items: center; max-width: 100%; border: 1px solid var(--line); border-radius: 5px; background: var(--color-brand-50); padding: 4px 7px; color: var(--color-brand-950); font-size: .82rem; }
.attachment span { max-width: 19ch; white-space: nowrap; text-overflow: ellipsis; overflow: hidden; }
.composer-status { display: flex; align-items: center; gap: 8px; margin: 0 0 12px; color: var(--muted); font-size: .875rem; }
.rejected-response { margin-bottom: 12px; font-size: .875rem; }
.rejected-response summary { cursor: pointer; color: var(--accent); font-weight: 650; }
.rejected-response pre { margin: 6px 0; max-height: 18rem; }
.generation-spinner { width: 15px; height: 15px; flex: none; border: 2px solid var(--control-line); border-top-color: var(--accent); border-radius: 50%; animation: generation-spin .85s linear infinite; }
@keyframes generation-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .generation-spinner { animation: none; }
}
.action-menu { position: relative; }
.action-menu summary { display: inline-flex; list-style: none; }
.action-menu summary::-webkit-details-marker { display: none; }
.action-menu[open] summary { background: var(--color-brand-50); }
.action-menu-items { position: absolute; z-index: 1; display: grid; right: 0; top: calc(100% + 5px); min-width: 155px; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 8px 20px var(--shadow); padding: 4px; }
.attachment-menu .action-menu-items { left: 0; right: auto; top: auto; bottom: calc(100% + 5px); }
.action-menu-items button { border: 0; border-radius: 4px; background: transparent; color: inherit; padding: 8px; text-align: left; white-space: nowrap; font-size: .9rem; }
.action-menu-items button:hover { background: var(--color-brand-50); }
.attachment-matches { max-height: 320px; overflow: auto; }
.picker-option { display: flex; align-items: start; gap: 9px; padding: 9px 4px; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.picker-option span { display: grid; }
.picker-option input { accent-color: var(--accent); }
#attachment-search { margin-bottom: 12px; }
@container (max-width: 740px) {
  .proposal-studio { grid-template-columns: minmax(0,1fr); }
  .conversation { border-left: 0; border-top: 1px solid var(--line); }
  .draft-preview { max-height: 42vh; }
}
@container (max-width: 495px) {
  .proposal-title-row { align-items: flex-start; flex-direction: column; gap: 8px; }
  .studio-editor, .conversation { padding: 13px; }
}
@media (max-width: 490px) {
  .filters label { flex: 1 1 125px; }
}
