:root {
  color-scheme: light;
  --ink: #132b3d;
  --ink-soft: #365267;
  --muted: #7b8e98;
  --line: #dfe9e7;
  --line-strong: #c9dbd7;
  --canvas: #f7faf9;
  --panel: #ffffff;
  --panel-soft: #f2f7f5;
  --green-deep: #073d32;
  --green: #087b5b;
  --green-bright: #16a577;
  --mint: #e6f4ef;
  --mint-strong: #d5eee6;
  --blue: #3298d8;
  --amber: #eca04c;
  --red: #f06669;
  --shadow: 0 8px 22px rgba(20, 61, 53, .05);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
body { margin: 0; background: var(--canvas); color: var(--ink); }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .48; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, p { margin: 0; }
.app-shell { min-height: 100vh; }

.topbar { height: 64px; display: flex; align-items: center; gap: 38px; padding: 0 24px; background: var(--green-deep); color: #f5fbf8; }
.brand { display: flex; align-items: center; gap: 11px; min-width: 164px; font-size: 17px; font-weight: 820; letter-spacing: .015em; }
.brand-mark { width: 32px; height: 32px; display: grid; place-items: center; border: 1px solid #96bbb0; color: #fff; font-size: 15px; font-weight: 700; }
.brand-accent { color: #99cfc0; }
.topbar-context { flex: 1; color: #c5d9d3; font-size: 12px; }
.topbar-actions { display: flex; align-items: center; gap: 15px; font-size: 11px; }
.connection-state { display: inline-flex; align-items: center; gap: 7px; color: #bdd4cc; white-space: nowrap; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: #db9d4f; box-shadow: 0 0 0 4px rgba(219,157,79,.14); }
.status-dot.ready { background: #65d29b; box-shadow: 0 0 0 4px rgba(101,210,155,.14); }
.status-dot.error { background: #f08383; box-shadow: 0 0 0 4px rgba(240,131,131,.14); }
.top-icon-button, .profile-button { border: 0; background: transparent; color: #c5d9d3; }
.top-icon-button { font-size: 20px; line-height: 1; }
.profile-button { display: flex; align-items: center; gap: 8px; }
.profile-avatar { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; background: #e9f2f0; color: var(--green-deep); font-size: 10px; font-weight: 800; }
.model-picker { position: relative; }
.model-picker-toggle { display: inline-flex; align-items: center; gap: 6px; border: 1px solid rgba(215,239,232,.23); padding: 7px 9px; background: rgba(255,255,255,.06); color: #e6f4ef; font-size: 11px; }
.model-picker-toggle:hover { background: rgba(255,255,255,.12); }
.model-picker-label { color: #a9c7bd; }
.model-picker-toggle strong { max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chevron { color: #9fc7ba; }
.model-picker-menu { position: absolute; z-index: 40; top: calc(100% + 10px); right: 0; width: 330px; padding: 15px; border: 1px solid var(--line-strong); background: #fff; color: var(--ink); box-shadow: 0 18px 42px rgba(7,61,50,.18); }
.picker-heading, .picker-footer { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.picker-heading strong { display: block; margin-top: 4px; font-size: 14px; }
.close-picker { border: 0; background: transparent; color: var(--muted); font-size: 20px; line-height: 1; }
.picker-copy { margin-top: 12px; color: var(--muted); font-size: 11px; line-height: 1.45; }
#model-select { width: 100%; margin-top: 12px; padding: 9px 10px; border: 1px solid var(--line-strong); background: #fff; color: var(--ink); font-size: 12px; }
.model-profile-list { display: grid; gap: 5px; margin-top: 9px; }
.model-profile-item { display: grid; grid-template-columns: 8px 1fr auto; align-items: center; gap: 8px; padding: 8px; border: 1px solid var(--line); background: #fbfdfc; }
.model-profile-item.is-active { border-color: #a9d4c6; background: var(--mint); }
.model-profile-item strong { display: block; font-size: 11px; }
.model-profile-item span { display: block; margin-top: 2px; color: var(--muted); font-size: 10px; }
.profile-state-dot { width: 7px; height: 7px; border-radius: 50%; background: #c3d0cd; }
.profile-state-dot.ready { background: var(--green-bright); }
.profile-state-dot.error { background: var(--red); }
.profile-state-label { color: var(--muted); font-size: 9px; white-space: nowrap; }
.picker-footer { align-items: center; margin-top: 11px; padding-top: 10px; border-top: 1px solid var(--line); color: var(--muted); font-size: 10px; }

.workspace-grid { min-height: calc(100vh - 64px); display: grid; grid-template-columns: 205px minmax(700px, 1fr); }
.sidebar { min-height: calc(100vh - 64px); display: flex; flex-direction: column; padding: 21px 10px 15px; background: var(--green-deep); color: #d4e5df; }
.primary-nav { display: grid; gap: 4px; }
.nav-item { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 13px; border: 0; background: transparent; color: #c5d9d3; font-size: 12px; text-align: left; }
.nav-item:hover, .nav-item.active { background: #12634f; color: #fff; }
.nav-item.active { box-shadow: inset 3px 0 0 #55c39a; }
.nav-icon { width: 18px; color: #d1e6de; font-size: 18px; text-align: center; }
.nav-button { font-size: 12px; }
.sidebar-projects { margin-top: 33px; }
.sidebar-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; padding: 0 5px; }
.sidebar h1 { margin-top: 6px; color: #fff; font-size: 17px; letter-spacing: -.02em; }
.eyebrow { color: var(--muted); font-size: 9px; font-weight: 800; letter-spacing: .11em; text-transform: uppercase; }
.sidebar .eyebrow { color: #a7c7bc; }
.icon-button { width: 30px; height: 30px; border: 1px solid #a8c8bd; background: var(--mint); color: var(--green); font-size: 20px; line-height: 1; }
.case-list { display: grid; gap: 5px; margin-top: 18px; }
.case-item { width: 100%; padding: 11px 9px; border: 1px solid transparent; background: transparent; color: #dbeae5; text-align: left; }
.case-item:hover { background: rgba(255,255,255,.06); }
.case-item.active { border-color: #75b69d; background: rgba(177,224,207,.18); }
.case-item strong { display: block; overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.case-item span { display: block; margin-top: 5px; color: #93b7ab; font-size: 9px; }
.assistant-card { margin: auto 5px 15px; padding: 13px 12px 12px; border: 1px solid #4a927b; background: rgba(12,104,80,.45); }
.assistant-orb { width: 30px; height: 30px; display: grid; place-items: center; margin-bottom: 10px; border-radius: 50%; background: #d6f1e5; color: var(--green); font-size: 17px; }
.assistant-card strong { color: #fff; font-size: 12px; }
.assistant-card p { margin-top: 7px; color: #acd0c2; font-size: 10px; line-height: 1.4; }
.assistant-question { width: 100%; display: flex; justify-content: space-between; align-items: center; margin-top: 11px; padding: 8px 9px; border: 1px solid #87bdaa; background: transparent; color: #fff; font-size: 10px; }
.assistant-question:hover { background: rgba(255,255,255,.08); }
.sidebar-foot { padding: 11px 7px 0; border-top: 1px solid rgba(188,223,211,.16); color: #8eb3a7; font-size: 9px; line-height: 1.4; }
.privacy-lock { margin-right: 5px; color: #63ca9d; }

.main-column { min-width: 0; min-height: calc(100vh - 64px); background: #fff; overflow: auto; }
.case-header { padding: 20px 24px 12px; border-bottom: 1px solid var(--line); }
.back-link { border: 0; background: transparent; color: var(--green); font-size: 11px; font-weight: 700; }
.case-header-row { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-top: 21px; }
.case-heading { display: flex; align-items: center; gap: 14px; min-width: 0; }
.case-heading h2 { overflow: hidden; color: var(--ink); font-size: 22px; letter-spacing: -.035em; text-overflow: ellipsis; white-space: nowrap; }
.case-status-chip, .case-type-chip { display: inline-flex; align-items: center; border: 1px solid #cae7dc; border-radius: 18px; background: var(--mint); color: var(--green); font-size: 10px; font-weight: 800; white-space: nowrap; }
.case-status-chip { padding: 6px 11px; }
.case-actions { display: flex; align-items: center; gap: 8px; }
.outline-button { min-height: 33px; padding: 0 12px; border: 1px solid var(--line); background: #fff; color: var(--ink-soft); font-size: 10px; }
.outline-button:hover { border-color: #9ecbbc; color: var(--green); }
.ghost-button { border-color: var(--line); background: #fff; color: var(--muted); font-size: 12px; }
.case-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 13px; margin-top: 12px; color: var(--muted); font-size: 10px; }
.meta-divider { width: 1px; height: 13px; background: var(--line); }
.case-type-chip { padding: 6px 12px; border-color: var(--line); background: #fff; color: var(--ink-soft); font-weight: 500; }
.date-control { display: inline-flex; align-items: center; gap: 7px; margin-left: auto; white-space: nowrap; }
input, textarea, select { outline: none; }
input, textarea { border: 1px solid var(--line-strong); background: #fff; color: var(--ink); }
input:focus, textarea:focus, select:focus { border-color: #68ae94; box-shadow: 0 0 0 3px rgba(22,165,119,.10); }
input[type="date"] { padding: 7px 8px; font-size: 11px; }
.case-tabs { display: flex; gap: 25px; min-height: 47px; padding: 0 24px; border-bottom: 1px solid var(--line); overflow-x: auto; }
.case-tab { position: relative; padding: 0 0 2px; border: 0; background: transparent; color: var(--ink-soft); font-size: 11px; white-space: nowrap; }
.case-tab:hover, .case-tab.active { color: var(--green); }
.case-tab.active { font-weight: 800; }
.case-tab.active::after { position: absolute; right: 0; bottom: -1px; left: 0; height: 2px; background: var(--green-bright); content: ''; }
.dashboard-grid { display: grid; grid-template-columns: minmax(210px, 284px) minmax(380px, 1fr) minmax(250px, 332px); gap: 14px; padding: 14px 15px 24px; background: #fbfdfc; }
.left-column, .center-column, .right-column { min-width: 0; display: grid; align-content: start; gap: 13px; }
.dashboard-card { border: 1px solid var(--line); background: #fff; box-shadow: var(--shadow); }
.dashboard-card.case-briefing { overflow: hidden; }
.case-briefing:not([open]) { max-height: 162px; }
.case-briefing[open] { max-height: 480px; overflow-y: auto; }
.briefing-summary { display: block; padding: 15px 14px; cursor: pointer; list-style: none; }
.briefing-summary::-webkit-details-marker { display: none; }
.briefing-summary-main { display: block; }
.briefing-summary-main strong { display: block; margin-top: 6px; color: var(--green); font-size: 14px; line-height: 1.25; }
.briefing-summary-main > span:last-child { display: block; display: -webkit-box; margin-top: 7px; overflow: hidden; color: var(--ink-soft); font-size: 10px; line-height: 1.45; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.briefing-summary-side { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 11px; }
.briefing-stage { color: var(--green); font-size: 10px; font-weight: 800; }
.briefing-chevron { color: var(--green); font-size: 16px; font-weight: 800; }
.case-briefing[open] .briefing-chevron { transform: rotate(45deg); }
.briefing-body { padding: 0 14px 14px; }
.briefing-top { padding-top: 10px; border-top: 1px solid var(--line); }
.briefing-top h3 { margin-top: 5px; font-size: 13px; }
.briefing-top p, .briefing-detail-copy { margin-top: 6px; color: var(--muted); font-size: 10px; line-height: 1.45; }
.briefing-grid { display: grid; gap: 10px; margin-top: 13px; }
.briefing-label { display: block; color: var(--muted); font-size: 8px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.briefing-grid ul, .briefing-details ul { margin: 4px 0 0; padding-left: 14px; font-size: 10px; line-height: 1.4; }
.briefing-grid li + li, .briefing-details li + li { margin-top: 3px; }
.briefing-row { display: grid; gap: 10px; margin-top: 13px; }
.briefing-dates, .violation-list { display: grid; gap: 5px; margin-top: 5px; }
.briefing-date { display: grid; grid-template-columns: 67px 1fr; gap: 5px; padding: 5px 6px; border: 1px solid var(--line); font-size: 9px; }
.briefing-date strong { color: var(--green); }
.briefing-date span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.briefing-date em, .violation-item em { grid-column: 2; color: var(--amber); font-size: 8px; font-style: normal; }
.violation-item { display: grid; gap: 3px; padding: 6px; border-left: 2px solid var(--amber); background: #fffaf3; font-size: 9px; line-height: 1.35; }
.violation-item span { color: var(--muted); }
.briefing-details { margin-top: 12px; padding-top: 9px; border-top: 1px solid var(--line); }
.compact-disclosure > summary { cursor: pointer; color: var(--green); font-size: 10px; font-weight: 800; }
.card-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 13px 14px 10px; }
.card-heading > div { display: flex; align-items: center; gap: 8px; }
.card-heading strong { color: var(--ink); font-size: 12px; }
.card-icon { color: var(--green); font-size: 18px; }
.card-menu, .inline-link { border: 0; background: transparent; color: var(--green); font-size: 9px; }
.card-menu { color: var(--muted); font-size: 12px; }
.party-list { padding: 0 14px 13px; }
.party-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); }
.party-avatar { width: 31px; height: 31px; display: grid; place-items: center; border-radius: 50%; background: var(--mint); color: var(--green); font-size: 18px; }
.party-row small, .party-row strong { display: block; }
.party-row small { color: var(--muted); font-size: 9px; }
.party-row strong { margin-top: 3px; color: var(--ink-soft); font-size: 10px; font-weight: 600; }
.documents-card .document-list { max-height: 300px; overflow-y: auto; padding: 0 14px 11px; }
.document-count-summary { display: none; }
.document-details { display: block; }
.document-details > summary { display: none; }
.document-item { padding: 9px 0; border-top: 1px solid var(--line); }
.document-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 6px; }
.document-heading strong { min-width: 0; overflow: hidden; color: var(--ink-soft); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.document-status { flex: 0 0 auto; color: var(--muted); font-size: 8px; }
.status-text_extracted, .status-ocr_extracted { color: var(--green); }
.status-ocr_pending, .status-converter_pending, .status-extraction_failed { color: var(--amber); }
.document-meta { margin-top: 4px; color: var(--muted); font-size: 9px; }
.document-progress { height: 3px; margin-top: 6px; background: #edf4f1; }
.document-progress span { display: block; height: 100%; background: var(--green-bright); }
.document-error { margin-top: 4px; color: var(--red); font-size: 9px; }
.warning-summary, .document-ok { margin: 0 0 8px; padding: 7px; background: #fff7e8; color: var(--amber); font-size: 9px; }
.warning-summary span { display: block; margin-top: 3px; overflow: hidden; color: var(--muted); text-overflow: ellipsis; white-space: nowrap; }
.analysis-intro { display: flex; align-items: center; gap: 11px; min-height: 66px; padding: 13px 15px; border: 1px solid var(--line); background: #fff; }
.analysis-badge { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 50%; background: var(--green-deep); color: #c7f2df; font-size: 18px; }
.analysis-intro h3 { margin-top: 3px; font-size: 14px; }
.analysis-intro p { margin-top: 4px; color: var(--muted); font-size: 10px; }
.analysis-date { margin-left: auto; color: var(--muted); font-size: 9px; white-space: nowrap; }
.analysis-date strong { color: var(--green); }
.chat-drawer-toggle { display: flex; align-items: center; justify-content: space-between; padding: 9px 12px; border: 1px solid var(--line-strong); background: var(--mint); color: var(--green); font-size: 11px; font-weight: 800; text-align: left; }
.chat-drawer-toggle span:last-child { color: var(--muted); font-size: 9px; font-weight: 700; }
.chat-panel.chat-drawer { display: flex; flex-direction: column; min-height: 760px; height: clamp(760px, calc(100vh - 160px), 1040px); max-height: none; border: 1px solid var(--line); background: #fff; box-shadow: var(--shadow); }
.chat-drawer.chat-closed { min-height: 45px; height: 45px; }
.chat-drawer.chat-closed .chat-log, .chat-drawer.chat-closed .composer-wrap { display: none; }
.chat-log { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 15px 18px; }
.empty-chat { max-width: 360px; margin: 20% auto 0; text-align: center; color: var(--muted); }
.empty-chat-icon { width: 42px; height: 42px; display: grid; place-items: center; margin: 0 auto 13px; border-radius: 50%; background: var(--green-deep); color: #c7f2df; font-size: 22px; }
.empty-chat h3 { color: var(--ink); font-size: 14px; }
.empty-chat p { margin-top: 7px; font-size: 11px; line-height: 1.5; }
.message { max-width: 720px; margin: 0 auto 16px; }
.message-meta { display: flex; align-items: center; gap: 8px; margin-bottom: 5px; color: var(--muted); font-size: 9px; }
.message-role { color: var(--ink); font-weight: 800; }
.message-bubble { padding: 12px 14px; border: 1px solid var(--line); background: #fff; color: var(--ink-soft); font-size: 12px; font-weight: 500; line-height: 1.55; white-space: pre-wrap; }
.message.user .message-bubble { border-color: #c9e5da; background: var(--mint); color: var(--ink); font-weight: 600; }
.message.assistant .message-bubble { box-shadow: 0 5px 16px rgba(20,61,53,.04); }
.message-collapsed { max-height: 175px; overflow: hidden; }
.message-full { margin-top: 5px; }
.message-full summary { padding: 4px 0; cursor: pointer; color: var(--green); font-size: 9px; font-weight: 800; }
.message-full-content { max-height: 260px; overflow-y: auto; }
.composer-wrap { flex: 0 0 auto; max-height: none; overflow: hidden; padding: 9px 14px 12px; border-top: 1px solid var(--line); background: #fbfdfc; }
.composer-tools { display: flex; align-items: center; gap: 10px; min-height: 25px; }
.file-button { color: var(--green); font-size: 10px; font-weight: 800; cursor: pointer; }
.file-button input { display: none; }
.upload-hint, .role-link { color: var(--muted); font-size: 9px; }
.role-link { margin-left: auto; }
.text-button { border: 0; background: transparent; color: var(--green); font-size: 10px; font-weight: 800; }
.composer { display: flex; gap: 8px; align-items: stretch; margin-top: 7px; }
.composer textarea { min-height: 58px; flex: 1; padding: 11px; resize: vertical; font-size: 11px; }
.send-button, .primary-button { border: 1px solid var(--green); background: var(--green); color: #fff; padding: 0 16px; font-size: 11px; font-weight: 800; }
.send-button { min-width: 92px; }
.send-button:hover, .primary-button:hover { background: #066b4e; }
.send-button span { margin-left: 4px; font-size: 15px; }
.secondary-button { border: 1px solid var(--line-strong); background: #fff; color: var(--green); padding: 9px 13px; font-weight: 700; }
.compact-button { padding: 6px 9px; font-size: 9px; }

.processing-panel, .goal-panel { overflow-y: auto; overscroll-behavior: contain; }
.processing-panel { max-height: 150px; margin-bottom: 8px; padding: 10px; border: 1px solid #cde1d9; background: #f4faf7; }
.processing-heading, .goal-heading, .draft-title { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.processing-heading h3, .goal-panel h3 { margin-top: 4px; font-size: 12px; }
.processing-percent, .goal-state { color: var(--green); font-size: 10px; font-weight: 800; }
.processing-message, .goal-copy { margin-top: 6px; color: var(--muted); font-size: 9px; line-height: 1.4; }
.processing-progress { height: 5px; margin-top: 8px; background: #dcece6; }
.processing-progress span { display: block; height: 100%; background: var(--green-bright); transition: width .25s ease; }
.processing-stats { display: flex; flex-wrap: wrap; gap: 8px 13px; margin-top: 6px; color: var(--muted); font-size: 9px; }
.processing-stats strong { color: var(--ink); }
.processing-current-file { max-width: 46%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.processing-phase { margin-top: 6px; color: var(--green); font-size: 9px; font-weight: 700; }
.review-summary { max-height: none; overflow: visible; margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--line); }
.review-title { display: flex; justify-content: space-between; gap: 8px; color: var(--green); font-size: 9px; font-weight: 800; }
.review-role { color: var(--muted); font-weight: 600; }
.review-glance { display: grid; grid-template-columns: repeat(2, 1fr); gap: 5px; margin-top: 6px; }
.review-glance div { display: grid; gap: 2px; padding: 6px; border: 1px solid var(--line); background: #fff; }
.review-glance strong { color: var(--muted); font-size: 8px; text-transform: uppercase; }
.review-glance span { overflow: hidden; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.review-details { margin-top: 6px; }
.review-section { margin-top: 8px; }
.review-section strong { font-size: 9px; }
.review-section ul { margin: 4px 0 0; padding-left: 14px; color: var(--muted); font-size: 9px; line-height: 1.35; }
.goal-panel { max-height: 210px; margin-bottom: 8px; padding: 10px; border: 1px solid #c4dfd4; background: #eef8f4; }
.goal-options { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px; }
.goal-option { padding: 6px 7px; border: 1px solid #aad3c3; background: #fff; color: var(--green); font-size: 9px; font-weight: 800; }
.goal-option.selected, .goal-option:hover { background: var(--green); color: #fff; }
.goal-panel textarea { width: 100%; min-height: 35px; margin-top: 7px; padding: 7px; resize: vertical; font-size: 10px; }
.goal-actions { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.goal-actions .primary-button { padding: 7px 9px; font-size: 9px; }
.goal-hint { color: var(--muted); font-size: 9px; }
.goal-draft { max-height: none; overflow: visible; margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--line); }
.draft-title strong { font-size: 10px; }
.draft-title span { color: var(--muted); font-size: 9px; }
.draft-warning { margin-top: 5px; color: var(--amber); font-size: 9px; }
.draft-section { margin-top: 7px; }
.draft-section strong { font-size: 9px; }
.draft-section ul { margin: 3px 0 0; padding-left: 14px; color: var(--muted); font-size: 9px; line-height: 1.35; }
body:not(.goal-gate) .goal-panel { max-height: 64px; overflow: hidden; padding: 8px 10px; }
body:not(.goal-gate) .goal-panel .goal-copy,
body:not(.goal-gate) .goal-panel .goal-options,
body:not(.goal-gate) .goal-panel textarea,
body:not(.goal-gate) .goal-panel .goal-actions,
body:not(.goal-gate) .goal-panel .goal-draft { display: none; }

.right-column { gap: 13px; }
.deadlines-card .deadline-list { padding: 0 14px 12px; }
.event-item { position: relative; display: grid; grid-template-columns: 10px 1fr auto; gap: 8px; padding: 9px 0 9px 7px; border-top: 1px solid var(--line); }
.event-item::before { position: absolute; top: 14px; left: 0; width: 6px; height: 6px; border-radius: 50%; background: #99aab0; content: ''; }
.event-item:first-child::before { background: var(--red); }
.event-item strong { grid-column: 2; color: var(--ink-soft); font-size: 10px; font-weight: 700; }
.event-item p { grid-column: 2; margin-top: -4px; color: var(--ink); font-size: 10px; line-height: 1.35; }
.event-item span { grid-column: 2; color: var(--muted); font-size: 8px; }
.event-item .list-limit-note { grid-column: 2 / -1; }
.probability-body { display: flex; align-items: center; gap: 12px; padding: 0 14px 12px; }
.probability-ring { width: 74px; height: 74px; display: grid; place-content: center; flex: 0 0 auto; border: 8px solid #dceee8; border-top-color: var(--green); border-right-color: var(--green); border-radius: 50%; text-align: center; transform: rotate(22deg); }
.probability-ring strong, .probability-ring span { display: block; transform: rotate(-22deg); }
.probability-ring strong { font-size: 16px; }
.probability-ring span { margin-top: 1px; color: var(--muted); font-size: 7px; }
.probability-body > div:last-child { min-width: 0; }
.probability-body > div:last-child strong { font-size: 10px; }
.probability-body p { margin-top: 5px; color: var(--muted); font-size: 9px; line-height: 1.4; }
.probability-bar { display: flex; gap: 3px; padding: 0 14px; }
.probability-bar span { height: 6px; flex: 1; border-radius: 5px; background: var(--green-bright); }
.probability-bar span:nth-child(2) { background: var(--blue); }
.probability-bar span:nth-child(3) { background: #96c7d5; }
.probability-bar span:nth-child(4) { background: var(--amber); }
.probability-legend { display: grid; grid-template-columns: repeat(2, 1fr); gap: 7px; padding: 10px 14px 14px; color: var(--muted); font-size: 8px; }
.probability-legend i { display: inline-block; width: 7px; height: 7px; margin-right: 4px; border-radius: 50%; }
.dot-green { background: var(--green-bright); }.dot-blue { background: var(--blue); }.dot-amber { background: var(--amber); }
.tasks-card .task-list { padding: 0 14px 12px; }
.task-item { display: flex; gap: 8px; padding: 9px 0; border-top: 1px solid var(--line); color: var(--ink-soft); font-size: 10px; line-height: 1.35; }
.task-box { width: 13px; height: 13px; flex: 0 0 auto; border: 1px solid #9fbab0; border-radius: 50%; }
.compact-memory { overflow: hidden; }
.compact-memory summary { display: flex; align-items: center; justify-content: space-between; padding: 13px 14px; cursor: pointer; list-style: none; }
.compact-memory summary::-webkit-details-marker { display: none; }
.compact-memory summary > span:first-child { display: flex; align-items: center; gap: 8px; }
.compact-memory summary strong { font-size: 11px; }
.memory-note { padding: 0 14px 13px; color: var(--muted); font-size: 10px; line-height: 1.4; }
.memory-note p + p { margin-top: 9px; }
.memory-note strong { color: var(--ink); }
.hidden-data { display: none; }

.dialog { width: min(520px, calc(100vw - 30px)); padding: 0; border: 1px solid var(--line); color: var(--ink); box-shadow: 0 20px 55px rgba(7,61,50,.2); }
.dialog::backdrop { background: rgba(4,37,31,.48); }
.dialog form { display: grid; gap: 14px; padding: 22px; }
.dialog-heading { display: flex; align-items: flex-start; justify-content: space-between; }
.dialog h2 { margin-top: 5px; font-size: 19px; }
.dialog label { display: grid; gap: 6px; font-size: 11px; font-weight: 800; }
.dialog input, .dialog textarea { width: 100%; padding: 10px; }
.dialog-copy { color: var(--muted); font-size: 11px; line-height: 1.5; }
.close-button { border: 0; background: transparent; color: var(--muted); font-size: 23px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; }
.redaction-result { padding: 11px; border: 1px solid #ead5a7; background: #fff9eb; color: var(--ink-soft); font-size: 11px; line-height: 1.5; white-space: pre-wrap; }
.role-list { margin: 0; padding-left: 18px; color: var(--ink-soft); font-size: 11px; line-height: 1.6; }
.hidden { display: none !important; }
.goal-gate .composer-tools, .goal-gate .composer { display: none; }
.muted { color: var(--muted); font-size: 10px; line-height: 1.45; }
.empty-state { color: var(--muted); font-size: 11px; line-height: 1.5; }
.empty-state.compact { padding: 10px 5px; }
.list-limit-note { padding: 5px 0; }

@media (max-width: 1260px) {
  .workspace-grid { grid-template-columns: 190px minmax(650px, 1fr); }
  .dashboard-grid { grid-template-columns: 240px minmax(350px, 1fr) 270px; }
  .sidebar { padding-left: 8px; padding-right: 8px; }
  .topbar { gap: 18px; }
  .topbar-context { display: none; }
}
@media (max-width: 980px) {
  .workspace-grid { display: block; }
  .sidebar { min-height: auto; display: block; padding: 10px 14px; }
  .primary-nav { display: flex; gap: 3px; overflow-x: auto; }
  .nav-item { width: auto; flex: 0 0 auto; padding: 8px 10px; }
  .sidebar-projects { margin-top: 12px; }
  .case-list { display: flex; overflow-x: auto; }
  .case-item { min-width: 190px; }
  .assistant-card, .sidebar-foot { display: none; }
  .dashboard-grid { grid-template-columns: minmax(220px, 280px) minmax(380px, 1fr); }
  .right-column { grid-column: 1 / -1; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .compact-memory { grid-column: 1 / -1; }
}
@media (max-width: 720px) {
  .topbar { height: 58px; padding: 0 12px; }
  .brand { min-width: auto; font-size: 15px; }
  .connection-state, .profile-button span:not(.profile-avatar), .top-icon-button { display: none; }
  .model-picker-toggle { padding: 6px; }
  .model-picker-label { display: none; }
  .model-picker-menu { position: fixed; top: 60px; right: 10px; left: 10px; width: auto; }
  .case-header { padding: 15px 14px 11px; }
  .case-header-row { display: block; margin-top: 15px; }
  .case-heading h2 { font-size: 19px; }
  .case-actions { margin-top: 12px; }
  .case-actions .outline-button { flex: 1; padding: 0 6px; font-size: 9px; }
  .case-meta { gap: 8px; }
  .date-control { width: 100%; margin-left: 0; }
  .case-tabs { gap: 18px; padding: 0 14px; }
  .dashboard-grid { display: block; padding: 10px; }
  .left-column, .center-column, .right-column { display: grid; margin-bottom: 10px; }
  .analysis-intro { align-items: flex-start; }
  .analysis-date { display: none; }
  .chat-panel.chat-drawer { min-height: 500px; height: min(620px, 74vh); }
  .right-column { display: grid; grid-template-columns: 1fr; }
  .composer { display: block; }
  .send-button { width: 100%; min-height: 42px; margin-top: 7px; }
  .model-picker-menu { max-height: calc(100vh - 78px); overflow-y: auto; }
}
