/* Look ported from MRA feat/web-projects (src/web/static/app.css); layout per UX map v1.1. */
:root {
  --navy:#14365e; --navy-d:#0d2440; --blue:#1c4a7e; --blue-l:#4f9be0;
  --sky:#9bbfe0; --pale:#eef2f7; --amber:#b45309; --green:#15803d; --grey:#8a94a6;
  --red:#b91c1c; --ink:#1f2733; --line:#dde4ee; --field:#cdd6e4;
  --amber-soft:#fdf3e4; --green-soft:#e8f5ec; --blue-soft:#e7eff9; --red-soft:#fdecec;
  --mark:#ffe58a;
}
* { box-sizing:border-box; }
body { margin:0; font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,sans-serif;
       color:var(--ink); background:var(--pale); font-size:14px; line-height:1.5; }
a { color:var(--blue); }
.hidden { display:none !important; }
.muted { color:var(--grey); font-size:12px; }
.sr-only { position:absolute; width:1px; height:1px; overflow:hidden; clip:rect(0 0 0 0); white-space:nowrap; }
:focus-visible { outline:2px solid var(--blue-l); outline-offset:2px; }
svg.icon { width:16px; height:16px; flex:none; stroke:currentColor; fill:none; stroke-width:2;
           stroke-linecap:round; stroke-linejoin:round; vertical-align:-3px; }

/* Shell: narrow sidebar + slim search bar. Sign-in screens hide both. */
.shell { display:grid; grid-template-columns:216px minmax(0,1fr); min-height:100vh; }
/* The first column stays navy below a sticky sidebar, whatever the page height. */
.shell:not(.bare) { background:linear-gradient(90deg,var(--navy) 216px,transparent 216px); }
.shell.bare { display:block; }
.shell.bare .sidebar, .shell.bare .topbar { display:none; }
.sidebar { position:sticky; top:0; height:100vh; display:flex; flex-direction:column; gap:4px;
           background:linear-gradient(180deg,var(--navy-d),var(--navy)); color:#fff; padding:18px 12px; }
.brand { color:#fff; text-decoration:none; font-size:18px; font-weight:700; letter-spacing:.4px;
         padding:0 10px; }
.tagline { color:var(--sky); font-size:11.5px; padding:0 10px 14px; }
.nav a { display:flex; align-items:center; gap:10px; color:#dbe6f3; text-decoration:none;
         padding:8px 10px; border-radius:7px; font-weight:600; font-size:13.5px; }
.nav a:hover { background:rgba(255,255,255,.08); color:#fff; }
.nav a[aria-current="page"] { background:rgba(255,255,255,.14); color:#fff; }
.side-foot { margin-top:auto; border-top:1px solid rgba(255,255,255,.14); padding:12px 10px 0;
             font-size:12px; display:flex; flex-direction:column; gap:8px; }
.side-foot .email { overflow-wrap:anywhere; }
.side-foot .role { align-self:flex-start; background:rgba(255,255,255,.14); border-radius:12px;
                   padding:1px 9px; font-size:10.5px; font-weight:600; text-transform:uppercase; letter-spacing:.4px; }
button.ghost { background:transparent; border:1px solid rgba(255,255,255,.4); color:#fff;
               padding:5px 12px; font-size:12px; align-self:flex-start; }
button.ghost:hover { background:rgba(255,255,255,.12); border-color:#fff; }

.topbar { background:#fff; border-bottom:1px solid var(--line); padding:10px 28px; position:sticky;
          top:0; z-index:5; }
.search-form { display:flex; align-items:center; gap:8px; max-width:640px; border:1px solid var(--field);
               border-radius:8px; padding:0 10px; background:#fff; color:var(--grey); }
.search-form:focus-within { border-color:var(--blue-l); box-shadow:0 0 0 3px rgba(79,155,224,.18); }
.search-form input { flex:1; border:0; outline:0; font:inherit; padding:8px 0; color:var(--ink); min-width:0; }
.kbd { border:1px solid var(--line); border-radius:4px; padding:0 6px; font-size:11px; color:var(--grey); }

main { max-width:1180px; margin:22px auto 60px; padding:0 28px; }
.shell.bare main { max-width:none; }

/* Cards and buttons */
.card { background:#fff; border:1px solid var(--line); border-radius:10px; padding:20px;
        box-shadow:0 1px 3px rgba(13,36,64,.06); }
button, .btn { font:inherit; border-radius:7px; padding:7px 13px; font-size:13px; font-weight:600;
               cursor:pointer; border:1px solid var(--navy); background:var(--navy); color:#fff;
               text-decoration:none; display:inline-flex; align-items:center; gap:6px; line-height:1.4; }
button:hover, .btn:hover { background:var(--blue); border-color:var(--blue); }
button:disabled { opacity:.5; cursor:not-allowed; }
.btn.secondary, button.secondary { background:#fff; color:var(--navy); border-color:var(--field); }
.btn.secondary:hover, button.secondary:hover { background:var(--pale); border-color:var(--navy); }
button.link { background:none; border:0; padding:0; color:var(--blue); font-weight:600; }
button.link:hover { background:none; text-decoration:underline; }
button.icon-btn { background:#fff; color:var(--navy); border-color:var(--field); padding:6px 8px; }
button.icon-btn:hover { background:var(--pale); }
button.danger { background:var(--red); border-color:var(--red); }
button.danger:hover { background:#991b1b; border-color:#991b1b; }
.btn.big { font-size:15px; padding:12px 22px; }
.error { color:var(--red); font-size:12.5px; white-space:pre-wrap; margin-top:8px; }

/* Sign-in */
.signin { max-width:420px; margin:12vh auto 0; text-align:center; }
.signin .brand-big { color:var(--navy); font-size:22px; font-weight:700; margin-bottom:18px; }
.signin h1 { margin:0 0 8px; font-size:20px; color:var(--navy); }
.signin p { color:var(--grey); margin:0 0 20px; }
.signin .error { margin:0 0 16px; }

/* Page heads, breadcrumbs */
.crumbs { font-size:12.5px; color:var(--grey); margin-bottom:8px; display:flex; gap:6px; flex-wrap:wrap; }
.crumbs a { color:var(--grey); text-decoration:none; }
.crumbs a:hover { color:var(--blue); text-decoration:underline; }
.page-head { display:flex; align-items:center; gap:12px; margin-bottom:16px; flex-wrap:wrap; }
.page-head h1 { margin:0; font-size:22px; color:var(--navy); }
.page-head .spacer { flex:1; }
.empty { text-align:center; color:var(--grey); padding:44px 20px; }
.empty strong { display:block; color:var(--ink); font-size:15px; margin-bottom:6px; }
.empty .btn, .empty button { margin-top:14px; }

/* Clients list */
table.list { width:100%; border-collapse:collapse; background:#fff; border:1px solid var(--line);
             border-radius:10px; overflow:hidden; }
table.list th { text-align:left; font-size:11.5px; text-transform:uppercase; letter-spacing:.5px;
                color:var(--grey); background:#f7f9fc; padding:10px 14px; border-bottom:1px solid var(--line); }
table.list td { padding:11px 14px; border-bottom:1px solid var(--line); }
table.list tr:last-child td { border-bottom:none; }
table.list tbody tr { cursor:pointer; }
table.list tbody tr:hover { background:#f7f9fc; }
table.list td.name a { font-weight:600; color:var(--navy); text-decoration:none; }
table.list td.num { text-align:right; font-variant-numeric:tabular-nums; }
table.list th.num { text-align:right; }

/* Profile */
.facts { display:flex; flex-wrap:wrap; gap:10px 32px; margin:6px 0 4px; }
.fact .k { font-size:10.5px; text-transform:uppercase; letter-spacing:.6px; color:var(--grey); }
.fact .v { font-weight:600; }
.profile-notes { color:#46536a; margin:10px 0 0; white-space:pre-wrap; max-width:80ch; }
.profile-grid { display:grid; grid-template-columns:minmax(0,1fr) 290px; gap:20px; margin-top:22px;
                align-items:start; border-top:1px solid var(--line); padding-top:20px; }
.section-head { display:flex; align-items:center; gap:10px; margin:0 0 10px; }
.section-head h2 { margin:0; font-size:16px; color:var(--navy); }
.section-head .count { color:var(--grey); font-size:12.5px; }
.section-head .spacer { flex:1; }
.stack { display:flex; flex-direction:column; gap:12px; }
.general { margin-top:22px; }

.project { padding:0; overflow:hidden; scroll-margin-top:70px; }
.project-head { display:flex; align-items:center; gap:10px; padding:12px 14px 12px 8px; flex-wrap:wrap; }
.proj-toggle { flex:1; min-width:200px; display:flex; align-items:center; gap:8px; text-align:left;
               background:none; border:0; color:var(--ink); padding:4px 6px; font-weight:400; }
.proj-toggle:hover { background:var(--pale); }
.proj-toggle .chev { color:var(--grey); transition:transform .15s; }
.proj-toggle[aria-expanded="true"] .chev { transform:rotate(90deg); }
.proj-title { display:block; font-weight:700; font-size:14.5px; color:var(--navy); }
.proj-meta { display:block; font-size:12px; color:var(--grey); }
.project-actions { display:flex; gap:6px; align-items:center; }
.project-body { padding:0 18px 18px; border-top:1px solid var(--line); }
.brief { background:#f7f9fc; border-radius:8px; padding:10px 12px; margin:14px 0 4px; }
.brief .k { font-size:10.5px; text-transform:uppercase; letter-spacing:.6px; color:var(--grey); font-weight:700; }
.brief p { margin:2px 0 0; white-space:pre-wrap; }
.brief.clamped p { display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; }
.sub-head { font-size:10.5px; text-transform:uppercase; letter-spacing:.6px; color:var(--grey);
            font-weight:700; margin:16px 0 6px; }
.runs { list-style:none; margin:0; padding:0; }
.runs li { display:flex; flex-wrap:wrap; align-items:center; gap:6px 10px; padding:6px 0;
           border-bottom:1px dashed var(--line); font-size:13px; }
.runs li:last-child { border-bottom:0; }

.pill { display:inline-flex; align-items:center; gap:4px; border-radius:10px; padding:1px 8px;
        font-size:11px; font-weight:600; white-space:nowrap; background:var(--pale); color:#46536a; }
.pill.active { background:var(--green-soft); color:var(--green); }
.pill.tag { background:var(--blue-soft); color:var(--blue); }
.pill.warn { background:var(--amber-soft); color:var(--amber); }
.pill.bad { background:var(--red-soft); color:var(--red); }
button.pill { border:0; cursor:pointer; }
button.pill:hover { background:#d8e5f5; }

.files { width:100%; border-collapse:collapse; font-size:13px; }
.files td { padding:8px 6px; border-bottom:1px solid var(--line); vertical-align:middle; }
.files tr:last-child td { border-bottom:0; }
.files .ext { width:44px; }
.ext-badge { display:inline-block; min-width:36px; text-align:center; font-size:10px; font-weight:700;
             color:#46536a; background:var(--pale); border-radius:5px; padding:6px 4px; }
.files .fname button { font-weight:600; color:var(--navy); text-align:left; overflow-wrap:anywhere; }
.files .fmeta { display:block; color:var(--grey); font-size:11.5px; }
.files .fstatus { text-align:right; }
.files .fstatus .pill + .pill { margin-left:4px; }
.files .fdl { width:34px; text-align:right; }
.files .fdl a { color:var(--grey); display:inline-flex; padding:4px; border-radius:5px; }
.files .fdl a:hover { color:var(--navy); background:var(--pale); }
.files .fkebab { width:34px; text-align:right; }

/* Profile file groups: deliverables, chips, working files, Move to… menu */
.deliv-row { display:flex; flex-wrap:wrap; align-items:center; gap:8px 14px; padding:11px 0;
             border-bottom:1px solid var(--line); }
.deliverables > .deliv-row:last-child { border-bottom:0; }
.deliv-main { flex:1; min-width:150px; display:flex; flex-wrap:wrap; align-items:center; gap:4px 8px; }
.deliv-title { font-weight:700; font-size:14.5px; color:var(--navy); overflow-wrap:anywhere; }
.deliv-date { color:var(--grey); font-size:11.5px; }
.deliv-side { display:flex; align-items:center; gap:8px; margin-left:auto; }
.chips, .card-chips { display:flex; flex-wrap:wrap; gap:6px; }
.chip-group { display:inline-flex; align-items:center; border:1px solid var(--field); border-radius:14px;
              background:#fff; }
button.chip { background:var(--blue-soft); color:var(--blue); border:1px solid transparent; border-radius:14px;
              padding:2px 10px; font-size:11.5px; font-weight:700; white-space:nowrap; }
button.chip:hover { background:#d8e5f5; border-color:transparent; }
.chip-group button.chip { border-radius:13px 0 0 13px; }
.chip-dl a { color:var(--grey); display:inline-flex; padding:3px 7px 3px 5px; }
.chip-dl a:hover { color:var(--navy); }
.card-chips { flex:0 1 auto; }
details.earlier { flex-basis:100%; }
details.earlier summary { cursor:pointer; color:var(--blue); font-size:12px; font-weight:600; }
details.earlier .deliv-row { padding:6px 0 6px 14px; border-bottom:1px dashed var(--line); }
details.earlier .deliv-title { font-size:13px; }
details.working { margin-top:16px; }
details.working summary { cursor:pointer; font-size:10.5px; text-transform:uppercase; letter-spacing:.6px;
                          color:var(--grey); font-weight:700; }
.badge { display:inline-block; min-width:18px; margin-left:6px; padding:0 6px; border-radius:9px;
         background:var(--pale); color:#46536a; font-size:10.5px; text-align:center; letter-spacing:0; }
button.kebab { background:none; border:1px solid transparent; color:var(--grey); padding:1px 7px;
               font-size:16px; line-height:1.2; }
button.kebab:hover:not(:disabled) { background:var(--pale); color:var(--navy); border-color:var(--field); }
button.kebab:disabled { opacity:.35; }
.menu { position:fixed; z-index:20; min-width:176px; background:#fff; border:1px solid var(--line);
        border-radius:9px; padding:6px; box-shadow:0 10px 30px rgba(13,36,64,.18); }
.menu-head { font-size:10.5px; text-transform:uppercase; letter-spacing:.6px; color:var(--grey);
             font-weight:700; padding:3px 8px 5px; }
.menu [role=menuitemradio] { display:flex; width:100%; background:none; border:0; color:var(--ink);
                             font-weight:500; padding:6px 8px; border-radius:6px; }
.menu [role=menuitemradio]:hover, .menu [role=menuitemradio]:focus { background:var(--pale); }
.menu [role=menuitemradio]::before { content:""; width:14px; flex:none; color:var(--blue); }
.menu [role=menuitemradio][aria-checked="true"]::before { content:"✓"; }
.menu .error:empty { display:none; }

.dropzone { margin-top:12px; border:1.5px dashed var(--field); border-radius:9px; padding:14px;
            text-align:center; color:#46536a; font-size:13px; background:#fbfcfe; }
.dropzone.over { border-color:var(--blue-l); background:var(--blue-soft); }
.dropzone .dest { display:block; color:var(--grey); font-size:11.5px; margin-top:2px; }
.uploads { list-style:none; margin:8px 0 0; padding:0; font-size:12.5px; }
.uploads li { padding:5px 8px; border-radius:6px; margin-top:4px; background:var(--pale); }
.uploads li.ok { background:var(--green-soft); color:#14532d; }
.uploads li.warn { background:var(--amber-soft); color:#7c3d06; }
.uploads li.bad { background:var(--red-soft); color:#7f1d1d; }

.contacts .contact { display:flex; gap:10px; padding:10px 0; border-bottom:1px solid var(--line); }
.contacts .contact:last-of-type { border-bottom:0; }
.avatar { width:30px; height:30px; flex:none; border-radius:50%; background:var(--blue-soft);
          color:var(--blue); font-size:11px; font-weight:700; display:flex; align-items:center; justify-content:center; }
.contact .icon-btn { align-self:flex-start; }
.contact .who { flex:1; min-width:0; font-size:12.5px; }
.contact .who strong { display:block; font-size:13.5px; }
.contact .who a, .contact .who span { display:block; overflow-wrap:anywhere; color:#46536a; }
.contact .who a { color:var(--blue); }
.contacts h2 { margin:0 0 4px; font-size:15px; color:var(--navy); }
.contacts .add { width:100%; justify-content:center; margin-top:8px; }

/* Dialogs: modal forms and the file drawer */
dialog { border:0; padding:0; color:var(--ink); }
dialog::backdrop { background:rgba(13,36,64,.38); }
dialog.modal { width:min(560px,calc(100vw - 32px)); border-radius:12px; box-shadow:0 20px 50px rgba(13,36,64,.25); }
.modal form { padding:22px; display:flex; flex-direction:column; gap:12px; }
.modal h2 { margin:0; font-size:18px; color:var(--navy); }
.field { display:flex; flex-direction:column; gap:4px; font-size:12.5px; font-weight:600; color:#46536a; }
.field input, .field textarea, .field select { font:inherit; font-weight:400; color:var(--ink);
  border:1px solid var(--field); border-radius:7px; padding:8px 10px; background:#fff; }
.field textarea { min-height:78px; resize:vertical; }
.field-row { display:grid; grid-template-columns:1fr 1fr; gap:12px; }
fieldset.group { border:1px solid var(--line); border-radius:9px; padding:10px 12px 12px; margin:0;
                 display:flex; flex-direction:column; gap:10px; }
fieldset.group legend { font-size:12px; font-weight:700; color:var(--navy); padding:0 4px; }
.form-actions { display:flex; gap:8px; justify-content:flex-end; margin-top:4px; }
details.danger { border:1px solid #f3c4c4; border-radius:9px; padding:8px 12px; margin-top:6px; }
details.danger summary { cursor:pointer; color:var(--red); font-weight:700; font-size:12.5px; }
details.danger p { font-size:12.5px; margin:8px 0; }
details.danger .confirm-row { display:flex; gap:8px; }
details.danger .confirm-row input { flex:1; min-width:0; font:inherit; border:1px solid var(--field);
                                     border-radius:7px; padding:7px 10px; }

dialog.drawer { margin:0 0 0 auto; height:100vh; max-height:100vh; width:min(760px,100vw);
                flex-direction:column; box-shadow:-12px 0 40px rgba(13,36,64,.2); }
dialog.drawer[open] { display:flex; }
.drawer-head { padding:18px 22px 14px; border-bottom:1px solid var(--line); }
.drawer-crumb { font-size:10.5px; text-transform:uppercase; letter-spacing:.8px; color:var(--grey); font-weight:700; }
.drawer-title { display:flex; align-items:flex-start; gap:10px; margin:4px 0 2px; }
.drawer-title h2 { flex:1; margin:0; font-size:18px; color:var(--navy); overflow-wrap:anywhere; }
.drawer-tools { display:flex; flex-wrap:wrap; gap:8px; align-items:center; margin-top:10px; }
.drawer-tools .spacer { flex:1; }
.matchbar { display:flex; align-items:center; gap:8px; padding:8px 22px; background:#f7f9fc;
            border-bottom:1px solid var(--line); font-size:12.5px; }
.matchbar .q { flex:1; overflow-wrap:anywhere; }
.drawer-body { flex:1; overflow:auto; padding:18px 22px 30px; }
.doc-text { white-space:pre-wrap; overflow-wrap:anywhere; max-width:78ch; line-height:1.65; font-size:13.5px; }
.doc-note { margin-top:14px; }
[role=tablist] { display:inline-flex; border:1px solid var(--field); border-radius:8px; overflow:hidden; }
[role=tablist] [role=tab] { background:#fff; color:var(--navy); border:0; border-radius:0; padding:5px 12px; }
[role=tablist] [role=tab] + [role=tab] { border-left:1px solid var(--field); }
[role=tablist] [role=tab][aria-selected="true"] { background:var(--navy); color:#fff; }
.sheet-tabs { margin-bottom:10px; max-width:100%; overflow-x:auto; }
.sheet-tabs [role=tab] { flex:none; white-space:nowrap; }
/* A sheet with nothing in its read window stays listed, in a lighter tone. */
.sheet-tabs [role=tab].blank:not([aria-selected="true"]) { color:var(--grey); }
.download-card { background:#fff; border:1px solid var(--line); border-radius:10px; padding:18px 20px;
                 max-width:52ch; box-shadow:0 1px 3px rgba(13,36,64,.06); }
.download-card h3 { margin:0 0 4px; font-size:15px; color:var(--navy); }
.download-card p { margin:0 0 12px; color:#46536a; }
.doc-pages { display:flex; flex-direction:column; gap:16px; }
.doc-page { margin:0; }
/* A4 placeholder until the lazy image loads, so a jump to page N lands on it. */
.doc-page-img { display:block; width:100%; height:auto; aspect-ratio:auto 210 / 297; background:#fff;
                border:1px solid var(--line); box-shadow:0 1px 3px rgba(13,36,64,.08); scroll-margin-top:8px; }
.doc-page figcaption { text-align:center; margin-top:4px; }
.doc-image { display:block; max-width:100%; height:auto; border:1px solid var(--line); }
.doc-html { max-width:78ch; line-height:1.6; overflow-wrap:anywhere; }
.doc-html table { border-collapse:collapse; margin:10px 0; display:block; max-width:100%; overflow-x:auto; }
.doc-html th, .doc-html td { border:1px solid var(--line); padding:5px 9px; text-align:left; }
.doc-html img { max-width:100%; }
.sheet-wrap { max-width:100%; overflow:auto; border:1px solid var(--line); border-radius:6px; }
table.sheet { border-collapse:collapse; font-size:12.5px; }
table.sheet td { border:1px solid var(--line); padding:4px 8px; white-space:nowrap; }
.matchbar .page-link { font-size:12.5px; }
mark { background:var(--mark); color:inherit; border-radius:2px; padding:0 1px; }
mark.current { background:#f59e0b; color:#fff; outline:2px solid #b45309; }
.notice { background:var(--amber-soft); color:#7c3d06; border-radius:8px; padding:12px 14px; }

/* Search */
.search-groups { display:flex; flex-direction:column; gap:14px; }
.search-group h2 { margin:0 0 8px; font-size:15px; }
.search-group h2 a { color:var(--navy); text-decoration:none; }
.hit { display:flex; gap:10px; padding:9px 0; border-top:1px solid var(--line); }
.hit .kind { flex:none; width:64px; }
.hit .body { min-width:0; }
.hit .title { font-weight:600; }
.hit .hit-page { color:var(--grey); font-size:12px; margin-left:6px; white-space:nowrap; }
.hit .where { color:var(--grey); font-size:12px; }
.hit .snippet { color:#46536a; font-size:12.5px; margin-top:2px; overflow-wrap:anywhere; }

/* Brief page: chat on the left, the brief card with Inputs and Start run on the right */
.brief-page { display:grid; grid-template-columns:minmax(0,1fr) 380px; gap:20px; align-items:start; }
.brief-page > .card { min-width:0; }
.chatlog { display:flex; flex-direction:column; gap:10px; min-height:260px; max-height:62vh;
           overflow-y:auto; padding:2px 2px 12px; }
.msg { max-width:85%; padding:8px 12px; border-radius:10px; white-space:pre-wrap; overflow-wrap:anywhere;
       font-size:13.5px; }
.msg.user { align-self:flex-end; background:var(--navy); color:#fff; border-bottom-right-radius:3px; }
.msg.assistant { align-self:flex-start; background:var(--pale); border-bottom-left-radius:3px; }
.msg[aria-busy="true"] { color:var(--grey); font-style:italic; }
.chatlog + form { display:flex; gap:8px; align-items:flex-end; border-top:1px solid var(--line); padding-top:12px; }
.chatlog + form textarea { flex:1; min-width:0; font:inherit; color:var(--ink); border:1px solid var(--field);
                           border-radius:7px; padding:8px 10px; min-height:42px; resize:vertical; }
.brief-card h2 { margin:0 0 6px; font-size:16px; color:var(--navy); }
.brief-card form { display:flex; flex-direction:column; gap:12px; }
.brief-card fieldset.group { flex-direction:row; flex-wrap:wrap; gap:6px 16px; }
.brief-card fieldset.group label { display:inline-flex; align-items:center; gap:5px; font-size:13px; }
.brief-card .study-type { display:flex; flex-direction:column; gap:4px; }
.brief-card .study-type p { margin:0; }
.brief-card details summary { cursor:pointer; color:var(--blue); font-size:12.5px; font-weight:600; }
.brief-card details textarea { display:block; width:100%; margin-top:8px; min-height:180px; resize:vertical;
  border:1px solid var(--field); border-radius:7px; padding:8px 10px; color:var(--ink);
  font-family:ui-monospace,Consolas,monospace; font-size:12px; }
.brief-card ul { list-style:none; margin:0; padding:0; }
.brief-card li { display:flex; flex-wrap:wrap; align-items:center; gap:4px 10px; padding:6px 0;
                 border-bottom:1px dashed var(--line); font-size:13px; }
.brief-card li:last-child { border-bottom:0; }
.brief-card li > span { flex:1; min-width:0; font-weight:600; color:var(--navy); overflow-wrap:anywhere; }
.brief-card li label { display:inline-flex; align-items:center; gap:5px; color:#46536a; font-size:12.5px; }
.brief-card .form-actions { margin-top:14px; }

/* Runs: lines under a project header, the run drawer, citation chips, the cited page */
.run-lines { display:flex; flex-direction:column; gap:2px; padding:0 14px 10px 36px; margin-top:-4px; }
.run-line { display:flex; flex-wrap:wrap; align-items:center; gap:4px 10px; font-size:13px; }
button.run-open { background:none; border:1px solid transparent; color:var(--ink); padding:2px 6px; font-weight:600;
                  font-size:13px; display:inline-flex; flex-wrap:wrap; align-items:center; gap:4px; text-align:left; }
button.run-open:hover { background:var(--pale); border-color:transparent; }
.run-agent { color:var(--navy); }
.run-elapsed { color:var(--grey); font-weight:400; font-variant-numeric:tabular-nums; }
button.run-act { padding:2px 10px; font-size:12px; }
.run-line .error, .run-summary .error { margin:0; }
.run-line .error:empty, .run-summary .error:empty { display:none; }
.run-summary { display:flex; flex-wrap:wrap; align-items:center; gap:6px 10px; margin-top:6px; }
.run-facts { display:grid; grid-template-columns:max-content minmax(0,1fr); gap:4px 16px; margin:0 0 4px; font-size:13px; }
.run-facts:empty { display:none; }
.run-facts dt { color:var(--grey); font-weight:600; }
.run-facts dd { margin:0; overflow-wrap:anywhere; }
.run-study { margin:0 0 4px; font-size:13px; }
.run-body .sub-head:first-of-type { margin-top:6px; }
.run-progress { margin:0; padding-left:20px; font-size:13px; }
.run-progress li { padding:2px 0; }
.run-progress li:first-child { font-weight:600; color:var(--navy); }
.gates, .run-files { list-style:none; margin:0; padding:0; font-size:13px; }
.gate-row, .run-files li { padding:5px 0; border-bottom:1px dashed var(--line); overflow-wrap:anywhere; }
.gate-row:last-child, .run-files li:last-child { border-bottom:0; }
.gate-name { font-weight:600; }
.run-files a { display:inline-flex; align-items:center; gap:6px; font-weight:600; }
.doc-html a.cite { display:inline-block; background:var(--blue-soft); color:var(--blue); border-radius:12px;
                   padding:0 8px; font-size:12px; font-weight:600; text-decoration:none; line-height:1.7; }
.doc-html a.cite:hover { background:#d8e5f5; }
.doc-page.cited .doc-page-img { outline:3px solid var(--blue-l); outline-offset:2px; }
.drawer-tools .page-marker { font-size:12.5px; }
.modal label.check { display:flex; flex-wrap:wrap; align-items:center; gap:6px; font-size:12.5px; font-weight:600;
                     color:#46536a; }
.modal label.check .muted { font-weight:400; }

/* Client summary: meta line with the action at the right, bullets, a sources popover per bullet */
.summary { position:relative; margin-top:16px; padding:14px 18px; }
.summary:focus { outline:none; }
.sum-meta { display:flex; flex-wrap:wrap; align-items:baseline; gap:4px 12px; }
.sum-line { flex:1; min-width:0; color:var(--grey); font-size:12.5px; }
.sum-title { display:inline; margin:0; font-size:13px; color:var(--navy); }
.sum-files { display:inline-block; }
.sum-files summary { display:inline; cursor:pointer; color:var(--blue); font-weight:600; }
.sum-files ul { position:absolute; left:18px; right:18px; z-index:6; list-style:none; margin:6px 0 0; padding:8px 12px;
                background:#fff; border:1px solid var(--line); border-radius:9px; box-shadow:0 10px 30px rgba(13,36,64,.18); }
.sum-files li { padding:3px 0; overflow-wrap:anywhere; }
.sum-files a { font-weight:600; }
.sum-status { color:var(--grey); font-size:12.5px; font-style:italic; }
.sum-failed { color:var(--red); font-size:12.5px; }
.summary button.link { font-size:12.5px; }
.summary button.secondary.sum-act { padding:2px 10px; font-size:12px; }
.sum-new { margin:2px 0 0; }
.sum-empty { margin:6px 0 0; color:#46536a; font-size:13px; }
.sum-error:empty { display:none; }
.sum-bullets { margin:8px 0 0; padding-left:20px; }
.sum-bullets li { position:relative; padding:2px 0; overflow-wrap:anywhere; }
button.src-icon { background:none; border:0; color:var(--grey); padding:0 3px; vertical-align:baseline; }
button.src-icon:hover, button.src-icon[aria-expanded="true"] { background:none; color:var(--blue); }
.src-pop { position:absolute; left:0; right:0; top:100%; z-index:6; display:flex; flex-wrap:wrap; gap:6px;
           padding:8px 10px; background:#fff; border:1px solid var(--line); border-radius:9px;
           box-shadow:0 10px 30px rgba(13,36,64,.18); }
.src-pop[hidden] { display:none; }
a.src-chip { background:var(--blue-soft); color:var(--blue); border-radius:12px; padding:0 8px; font-size:12px;
             font-weight:600; text-decoration:none; line-height:1.7; max-width:100%; overflow-wrap:anywhere; }
a.src-chip:hover { background:#d8e5f5; }

@media (max-width:1000px) {
  .profile-grid { grid-template-columns:minmax(0,1fr); }
  .brief-page { grid-template-columns:minmax(0,1fr); }
}
@media (max-width:760px) {
  .shell, .shell:not(.bare) { grid-template-columns:minmax(0,1fr); background:none; }
  .section-head .muted { display:none; }
  .sidebar { position:static; height:auto; flex-direction:row; flex-wrap:wrap; align-items:center;
             padding:10px 16px; gap:4px 10px; }
  .tagline { display:none; }
  .brand { padding:0; margin-right:auto; }
  .nav { display:flex; gap:2px; }
  .nav a { padding:6px 8px; }
  .side-foot { margin:0; border:0; padding:0; flex-direction:row; align-items:center; width:100%; }
  .side-foot .email { flex:1; font-size:11.5px; }
  .topbar { padding:8px 16px; }
  main { padding:0 16px; margin-top:16px; }
  table.list th:nth-child(n+3), table.list td:nth-child(n+3) { display:none; }
  .field-row { grid-template-columns:1fr; }
  .files .fmeta-col { display:none; }
  .project-head { padding-right:10px; }
  .run-lines { padding-left:14px; }
  .drawer-head, .drawer-body { padding-left:16px; padding-right:16px; }
  .matchbar { padding:8px 16px; }
}
