:root {
  --primary: #2457d6;
  --primary-dark: #173d9f;
  --primary-soft: #eef3ff;
  --ink: #172033;
  --muted: #667085;
  --line: #e4e8f0;
  --surface: #ffffff;
  --canvas: #f6f8fc;
  --success: #16835c;
  --success-soft: #eaf8f2;
  --warning: #a75f00;
  --warning-soft: #fff6e6;
  --danger: #b42318;
  --danger-soft: #fff0ef;
  --shadow: 0 10px 30px rgba(33, 55, 97, 0.08);
  --radius: 16px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--canvas);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
}
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }

.topbar {
  height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 0 28px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 30;
}
.brand { display: flex; align-items: center; gap: 12px; min-width: 210px; }
.brand-mark {
  width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center;
  color: #fff; background: var(--primary); font-weight: 800; letter-spacing: -1px;
}
.brand strong { display: block; font-size: 15px; }
.brand small { color: var(--muted); display: block; margin-top: 2px; }
.mode-switch { display: flex; padding: 4px; border-radius: 12px; background: var(--canvas); border: 1px solid var(--line); }
.mode-switch button { border: 0; background: transparent; color: var(--muted); padding: 8px 14px; border-radius: 9px; font-weight: 650; }
.mode-switch button.active { background: var(--primary); color: #fff; box-shadow: 0 4px 12px rgba(36,87,214,.25); }
.top-actions { display: flex; align-items: center; gap: 10px; min-width: 210px; justify-content: flex-end; }
.mvp-badge { color: var(--primary-dark); background: var(--primary-soft); padding: 7px 10px; border-radius: 999px; font-weight: 700; font-size: 12px; }
.avatar { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: #182238; color: white; font-weight: 700; }

.shell { display: grid; grid-template-columns: 224px 1fr; min-height: calc(100vh - 68px); }
.sidebar { background: white; border-right: 1px solid var(--line); padding: 22px 14px; position: sticky; top: 68px; height: calc(100vh - 68px); }
.nav-title { margin: 4px 10px 12px; color: #98a2b3; font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.nav-btn { width: 100%; display: flex; align-items: center; gap: 11px; padding: 11px 12px; margin: 3px 0; border: 0; border-radius: 10px; color: #49536a; background: transparent; text-align: left; font-weight: 600; }
.nav-btn:hover { background: #f7f9fd; }
.nav-btn.active { color: var(--primary); background: var(--primary-soft); }
.nav-icon { width: 22px; height: 22px; border-radius: 7px; background: currentColor; opacity: .12; position: relative; }
.nav-btn.active .nav-icon { opacity: .18; }
.sidebar-foot { position: absolute; bottom: 20px; left: 14px; right: 14px; padding: 12px; border-radius: 12px; background: var(--primary-soft); color: var(--primary-dark); font-size: 12px; line-height: 1.45; }

.main { padding: 30px; min-width: 0; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 24px; }
.page-head h1 { margin: 0; font-size: clamp(25px, 3vw, 34px); letter-spacing: -.035em; }
.page-head p { margin: 7px 0 0; color: var(--muted); font-size: 15px; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; }
.btn { border: 1px solid var(--line); background: white; color: var(--ink); padding: 10px 14px; border-radius: 10px; font-weight: 700; display: inline-flex; align-items: center; gap: 8px; justify-content: center; }
.btn:hover { border-color: #cbd4e4; background: #fafbfe; }
.btn.primary { background: var(--primary); border-color: var(--primary); color: white; }
.btn.primary:hover { background: var(--primary-dark); }
.btn.small { padding: 7px 10px; border-radius: 8px; font-size: 12px; }
.btn.danger { color: var(--danger); background: var(--danger-soft); border-color: #ffd3d0; }

.grid { display: grid; gap: 16px; }
.stats { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 20px; }
.card { background: white; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.stat { padding: 18px; }
.stat-label { color: var(--muted); font-weight: 600; }
.stat-row { display: flex; align-items: flex-end; justify-content: space-between; margin-top: 12px; }
.stat-value { font-size: 29px; line-height: 1; font-weight: 800; letter-spacing: -.04em; }
.stat-note { font-size: 12px; color: var(--success); background: var(--success-soft); border-radius: 999px; padding: 5px 7px; }
.two-col { grid-template-columns: minmax(0, 1.5fr) minmax(280px, .8fr); }
.section { padding: 20px; }
.section-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; gap: 12px; }
.section-head h2, .section-head h3 { margin: 0; font-size: 17px; }
.section-head span { color: var(--muted); font-size: 12px; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { padding: 11px 12px; text-align: left; color: var(--muted); font-size: 11px; letter-spacing: .05em; text-transform: uppercase; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 13px 12px; border-bottom: 1px solid #eef1f6; vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
.click-row { cursor: pointer; }
.click-row:hover td { background: #f9fbff; }
.person { display: flex; align-items: center; gap: 10px; }
.person-avatar { width: 34px; height: 34px; border-radius: 10px; background: var(--primary-soft); color: var(--primary); display: grid; place-items: center; font-weight: 800; }
.person strong { display: block; }
.person small { color: var(--muted); }
.pill { display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; padding: 6px 9px; font-size: 12px; font-weight: 700; background: #f1f3f7; color: #556070; white-space: nowrap; }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.blue { background: var(--primary-soft); color: var(--primary); }
.pill.green { background: var(--success-soft); color: var(--success); }
.pill.orange { background: var(--warning-soft); color: var(--warning); }
.pill.red { background: var(--danger-soft); color: var(--danger); }

.task-list, .timeline, .checklist { display: grid; gap: 10px; }
.task { display: flex; gap: 11px; align-items: flex-start; padding: 12px; border: 1px solid var(--line); border-radius: 11px; }
.task-check { flex: 0 0 auto; width: 19px; height: 19px; border: 1.5px solid #bdc6d6; border-radius: 6px; display: grid; place-items: center; color: white; }
.task.done .task-check { background: var(--success); border-color: var(--success); }
.task-content { flex: 1; min-width: 0; }
.task-content strong { display: block; font-size: 13px; }
.task-content small { display: block; color: var(--muted); margin-top: 4px; }
.task-time { color: #98a2b3; font-size: 11px; }

.filterbar { display: flex; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.field, .select { background: white; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; outline: none; color: var(--ink); }
.field:focus, .select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.search { min-width: 280px; flex: 1; }
.date-filter { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 12px; font-weight: 700; white-space: nowrap; }
.date-filter .field { width: 142px; }
.journal-filters .select { min-width: 190px; }
.journal-list { display: grid; gap: 10px; }
.journal-entry { display: grid; grid-template-columns: 38px minmax(0,1fr) auto; align-items: center; gap: 12px; padding: 13px; border: 1px solid var(--line); border-radius: 12px; background: white; }
.journal-entry-icon { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; color: var(--primary); background: var(--primary-soft); font-size: 16px; font-weight: 850; }
.journal-entry-main { min-width: 0; }
.journal-entry-main strong, .journal-entry-main small, .journal-entry-main span { display: block; }
.journal-entry-main small { color: #49536a; margin-top: 3px; }
.journal-entry-main span { color: var(--muted); margin-top: 4px; font-size: 11px; }
.journal-entry-meta { display: grid; justify-items: end; gap: 7px; }
.journal-entry-meta time { color: var(--muted); font-size: 11px; white-space: nowrap; }

.profile-head { padding: 22px; display: flex; align-items: center; gap: 16px; margin-bottom: 16px; }
.profile-avatar { width: 58px; height: 58px; border-radius: 17px; display: grid; place-items: center; color: white; background: var(--primary); font-size: 20px; font-weight: 800; }
.profile-info { flex: 1; }
.profile-info h2 { margin: 0; font-size: 21px; }
.profile-info p { color: var(--muted); margin: 5px 0 0; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); padding: 0 20px; background: white; border-radius: var(--radius) var(--radius) 0 0; }
.tab { border: 0; background: transparent; padding: 14px 12px 12px; color: var(--muted); font-weight: 700; border-bottom: 2px solid transparent; }
.tab.active { color: var(--primary); border-bottom-color: var(--primary); }
.detail-body { padding: 20px; border-radius: 0 0 var(--radius) var(--radius); }
.info-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.info-item { border: 1px solid var(--line); border-radius: 11px; padding: 13px; }
.info-item label { color: var(--muted); font-size: 12px; display: block; margin-bottom: 5px; }
.info-item strong { font-size: 14px; }
.info-item.story { grid-column: span 1; min-height: 132px; }
.info-item.story p { color: #49536a; line-height: 1.55; margin: 0 0 12px; }
.eyebrow-dark { color: var(--primary); font-size: 11px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; }
.mission-preview { margin-top: 18px; display: grid; grid-template-columns: minmax(220px,.7fr) minmax(420px,1.4fr) auto; align-items: center; gap: 20px; padding: 18px; border: 1px solid #d7e0f5; background: #f8faff; border-radius: 14px; cursor: pointer; }
.mission-preview:hover { border-color: var(--primary); }
.mission-preview h3 { margin: 5px 0 3px; }
.mission-preview p { margin: 0; color: var(--muted); }
.mission-preview .stepper { margin: 8px 0; }

.mission-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.mission-selector-admin { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 18px; padding: 15px 16px; border: 1px solid #d8e1f5; border-radius: 14px; background: #f8faff; }
.mission-selector-admin h3 { margin: 4px 0 0; }
.mission-selector-admin .select { min-width: 390px; font-weight: 750; border-color: #cbd8f3; }
.mission-head h2 { margin: 5px 0; font-size: 23px; }
.mission-head p { color: var(--muted); margin: 0; }
.mission-head-actions { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; justify-content: flex-end; }
.mission-layout { display: grid; grid-template-columns: minmax(0,1fr) 310px; gap: 18px; align-items: start; }
.mission-subtabs { display: flex; gap: 6px; padding: 6px; margin: 4px 0 18px; border-radius: 13px; background: #eef1f7; }
.mission-subtabs button { flex: 1; border: 0; background: transparent; color: var(--muted); padding: 11px 12px; border-radius: 9px; font-weight: 750; }
.mission-subtabs button.active { background: white; color: var(--primary); box-shadow: 0 3px 10px rgba(33,55,97,.11); }
.mission-subtabs button span { margin-left: 6px; padding: 3px 6px; background: var(--primary-soft); border-radius: 999px; font-size: 10px; }
.mission-main { display: grid; gap: 16px; }
.mission-side { min-width: 0; }
.subsection { border: 1px solid var(--line); border-radius: 14px; padding: 18px; background: white; }
.subsection h3 { margin: 0; }
.sticky-card { position: sticky; top: 92px; }
.offer-summary { display: grid; grid-template-columns: minmax(0,1fr) minmax(190px,.65fr) auto; align-items: center; gap: 14px; padding: 13px; border: 1px solid var(--line); border-radius: 11px; margin-top: 10px; }
.offer-summary strong, .offer-summary small { display: block; }
.offer-summary small { color: var(--muted); margin-top: 4px; }
.offer-state { display: grid; justify-items: start; gap: 5px; }
.offer-state > span:last-child { color: var(--muted); font-size: 11px; }
.legal-checks { display: grid; gap: 9px; }
.legal-check { display: flex; align-items: flex-start; gap: 11px; padding: 12px; border: 1px solid var(--line); border-radius: 11px; cursor: pointer; }
.legal-check.checked { background: var(--primary-soft); border-color: #cdd9f8; }
.legal-check input { accent-color: var(--primary); margin-top: 2px; }
.legal-check strong, .legal-check small { display: block; }
.legal-check small { color: var(--muted); margin-top: 3px; }
.legal-send { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.legal-send > span { color: var(--muted); font-size: 12px; font-weight: 700; }
.action-stack { display: grid; gap: 9px; margin-top: 14px; }
.human-action { display: grid; grid-template-columns: 20px 1fr; gap: 10px; align-items: start; padding: 11px; border: 1px solid #ffd8d2; background: #fff8f7; border-radius: 11px; }
.human-action.done { border-color: #ccebdd; background: var(--success-soft); }
.human-action .task-check { background: var(--warning); border-color: var(--warning); color: white; }
.human-action.done .task-check { background: var(--success); border-color: var(--success); }
.human-action strong, .human-action small { display: block; }
.human-action small { color: var(--muted); margin-top: 3px; line-height: 1.35; }
.human-action .btn { grid-column: 2; justify-self: start; }
.comments-section .section-head { align-items: flex-start; }
.comment-total { flex: 0 0 auto; color: var(--primary); background: var(--primary-soft); border-radius: 999px; padding: 6px 9px; font-size: 11px; font-weight: 800; }
.comment-composer { display: grid; gap: 9px; padding: 14px; margin-bottom: 16px; border: 1px solid #d8e1f5; border-radius: 12px; background: #f8faff; }
.comment-composer > label { color: var(--ink); font-size: 13px; font-weight: 800; }
.comment-composer textarea { width: 100%; resize: vertical; min-height: 82px; font: inherit; box-sizing: border-box; }
.comment-composer > div { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.comment-composer > div > span { color: var(--muted); font-size: 11px; }
.comment-list { display: grid; gap: 10px; }
.comment-card { display: grid; grid-template-columns: 36px minmax(0,1fr); gap: 11px; padding: 13px; border: 1px solid var(--line); border-radius: 12px; background: white; }
.comment-avatar { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; color: white; background: var(--primary); font-size: 11px; font-weight: 850; }
.comment-meta { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.comment-meta strong { font-size: 13px; }
.comment-meta time { color: var(--muted); font-size: 11px; white-space: nowrap; }
.comment-card p { margin: 6px 0 0; color: #49536a; font-size: 13px; line-height: 1.5; white-space: pre-wrap; }
.empty-comments { padding: 24px; display: grid; gap: 5px; text-align: center; color: var(--muted); border: 1px dashed var(--line); border-radius: 12px; }
.empty-comments strong { color: var(--ink); }
.modal-checklist { display: grid; gap: 8px; padding: 12px; border: 1px solid var(--line); border-radius: 11px; background: #fafbfe; }
.modal-checklist label { display: flex; gap: 9px; align-items: center; color: #3f4a5f; }
.modal-checklist input { accent-color: var(--primary); }

.stepper { display: grid; grid-template-columns: repeat(5, 1fr); margin: 22px 0; }
.step { position: relative; text-align: center; color: #98a2b3; font-size: 11px; font-weight: 700; }
.step::before { content: ""; display: block; width: 13px; height: 13px; border-radius: 50%; margin: 0 auto 8px; background: #dbe0e9; border: 3px solid white; box-shadow: 0 0 0 1px #dbe0e9; position: relative; z-index: 2; }
.step::after { content: ""; position: absolute; top: 7px; left: -50%; width: 100%; height: 2px; background: #dbe0e9; z-index: 1; }
.step:first-child::after { display: none; }
.step.complete, .step.active { color: var(--primary); }
.step.complete::before, .step.active::before { background: var(--primary); box-shadow: 0 0 0 1px var(--primary); }
.step.complete::after, .step.active::after { background: var(--primary); }

.doc-item { display: grid; grid-template-columns: 34px minmax(0,1fr) auto; align-items: center; gap: 11px; padding: 12px; border: 1px solid var(--line); border-radius: 11px; }
.doc-icon { width: 34px; height: 38px; border-radius: 8px; background: var(--primary-soft); color: var(--primary); display: grid; place-items: center; font-weight: 800; font-size: 10px; }
.doc-item strong { display: block; }
.doc-item small { color: var(--muted); display: block; margin-top: 3px; }
.doc-actions { display: flex; align-items: center; gap: 7px; }

.client-shell { max-width: 1120px; margin: 0 auto; padding: 30px 24px 56px; }
.scenario-bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 16px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 14px; background: white; }
.scenario-bar strong, .scenario-bar span { display: block; }
.scenario-bar span { color: var(--muted); font-size: 12px; margin-top: 3px; }
.scenario-switch { display: flex; gap: 4px; padding: 4px; background: var(--canvas); border-radius: 11px; }
.scenario-switch button { border: 0; background: transparent; color: var(--muted); padding: 8px 11px; border-radius: 8px; font-weight: 700; }
.scenario-switch button.active { background: white; color: var(--primary); box-shadow: 0 2px 8px rgba(33,55,97,.12); }
.client-hero { padding: 26px; background: linear-gradient(125deg, var(--primary), var(--primary-dark)); color: white; border-radius: 20px; margin-bottom: 20px; box-shadow: 0 15px 35px rgba(36,87,214,.2); }
.client-hero .eyebrow { opacity: .78; font-weight: 700; font-size: 12px; text-transform: uppercase; letter-spacing: .07em; }
.client-hero h1 { margin: 10px 0 6px; font-size: 28px; }
.client-hero p { margin: 0; opacity: .85; }
.progress-box { margin-top: 20px; padding-top: 16px; border-top: 1px solid rgba(255,255,255,.2); display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: center; }
.progress-box > div > strong { display: block; margin-bottom: 8px; }
.mission-selector { margin-top: 18px; display: flex; align-items: center; gap: 12px; width: min(520px,100%); }
.mission-selector label { font-size: 12px; font-weight: 700; opacity: .8; white-space: nowrap; }
.mission-selector select { flex: 1; border: 1px solid rgba(255,255,255,.35); background: white; color: var(--ink); border-radius: 10px; padding: 10px 12px; font-weight: 750; }
.progress { height: 8px; border-radius: 999px; background: rgba(255,255,255,.22); overflow: hidden; }
.progress > div { height: 100%; border-radius: inherit; background: white; transition: width .3s; }
.client-grid { grid-template-columns: minmax(0,1.3fr) minmax(280px,.7fr); }
.upload-zone { border: 1.5px dashed #cbd3df; border-radius: 10px; padding: 10px 12px; background: #fafbfe; color: var(--muted); }
.upload-zone.has-file { border-style: solid; border-color: #98dbc3; background: var(--success-soft); color: var(--success); }
.upload-zone button { padding: 0; background: none; border: 0; color: var(--primary); font-weight: 750; }
.client-offer { display: grid; grid-template-columns: 1fr auto auto; gap: 14px; align-items: center; padding: 15px; border: 1px solid #d6e0f7; border-radius: 13px; background: #f8faff; margin-bottom: 14px; }
.client-offer h3 { margin: 5px 0; }
.client-offer p { margin: 0; color: var(--muted); }
.client-legal { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); }
.client-legal .full { width: 100%; margin-top: 12px; }
.ai-client-grid { grid-template-columns: minmax(0,1.6fr) minmax(280px,.6fr); }
.ai-dropzone { min-height: 270px; display: grid; place-items: center; align-content: center; gap: 9px; text-align: center; padding: 30px; border: 2px dashed #9fb5e8; border-radius: 16px; background: linear-gradient(145deg,#f7faff,#eef3ff); cursor: pointer; transition: .2s; }
.ai-dropzone:hover { border-color: var(--primary); transform: translateY(-1px); }
.ai-dropzone.processed { border-style: solid; border-color: #80cdb0; background: linear-gradient(145deg,#f5fffb,#eaf8f2); }
.ai-drop-icon { width: 56px; height: 56px; display: grid; place-items: center; border-radius: 17px; background: var(--primary); color: white; font-size: 24px; font-weight: 850; box-shadow: 0 10px 24px rgba(36,87,214,.22); }
.ai-dropzone.processed .ai-drop-icon { background: var(--success); box-shadow: 0 10px 24px rgba(22,131,92,.18); }
.ai-dropzone h3 { margin: 5px 0 0; font-size: 20px; }
.ai-dropzone p { max-width: 570px; margin: 0 0 7px; color: var(--muted); line-height: 1.5; }
.ai-results, .ai-checklist { margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line); }
.ai-result-grid { display: grid; gap: 9px; }
.ai-result-grid > div { display: grid; grid-template-columns: minmax(0,1fr) minmax(150px,.5fr) auto; align-items: center; gap: 12px; padding: 11px 12px; border: 1px solid var(--line); border-radius: 10px; }
.ai-result-grid span:not(.pill) { color: var(--muted); font-size: 12px; }
.empty-card { text-align: center; padding: 30px; color: var(--muted); }
.big-icon { width: 48px; height: 48px; border-radius: 14px; background: var(--primary-soft); color: var(--primary); display: grid; place-items: center; margin: 0 auto 12px; font-size: 20px; }

.scope { margin-top: 18px; padding: 18px; border: 1px dashed #b9c6e7; border-radius: 14px; background: #f8faff; }
.scope h3 { margin: 0 0 10px; font-size: 14px; color: var(--primary-dark); }
.scope-list { display: flex; gap: 8px; flex-wrap: wrap; }
.scope-list span { padding: 6px 9px; border-radius: 8px; background: white; color: #49536a; border: 1px solid #dce4f5; font-size: 12px; font-weight: 650; }

.modal-backdrop { position: fixed; inset: 0; background: rgba(13,24,45,.48); display: grid; place-items: center; z-index: 80; padding: 20px; }
.modal { width: min(520px, 100%); background: white; border-radius: 18px; box-shadow: 0 26px 70px rgba(13,24,45,.25); overflow: hidden; }
.modal-head { padding: 20px 22px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; }
.modal-head h2 { margin: 0; font-size: 19px; }
.close { border: 0; background: #f2f4f7; width: 31px; height: 31px; border-radius: 9px; font-size: 18px; }
.modal-body { padding: 22px; display: grid; gap: 14px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-group label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 6px; font-weight: 700; }
.form-group input, .form-group select, .form-group textarea { width: 100%; }
.modal-foot { padding: 16px 22px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 10px; }
.toast { position: fixed; right: 24px; bottom: 24px; padding: 13px 16px; border-radius: 11px; background: #172033; color: white; font-weight: 650; box-shadow: 0 12px 30px rgba(0,0,0,.2); opacity: 0; transform: translateY(12px); pointer-events: none; transition: .25s; z-index: 100; }
.toast.show { opacity: 1; transform: translateY(0); }
.hidden { display: none !important; }

@media (max-width: 1020px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  .two-col, .client-grid { grid-template-columns: 1fr; }
  .mission-layout { grid-template-columns: 1fr; }
  .ai-client-grid { grid-template-columns: 1fr; }
  .sticky-card { position: static; }
  .mission-preview { grid-template-columns: 1fr; }
  .sidebar { width: 74px; }
  .shell { grid-template-columns: 74px 1fr; }
  .nav-btn { justify-content: center; }
  .nav-btn span:not(.nav-icon), .nav-title, .sidebar-foot { display: none; }
}
@media (max-width: 700px) {
  .topbar { padding: 0 14px; height: auto; min-height: 68px; flex-wrap: wrap; padding-top: 10px; padding-bottom: 10px; }
  .brand { min-width: 0; }
  .brand small, .top-actions .avatar { display: none; }
  .mode-switch { order: 3; width: 100%; }
  .mode-switch button { flex: 1; }
  .top-actions { min-width: 0; }
  .shell { display: block; }
  .sidebar { display: flex; overflow-x: auto; position: sticky; top: 118px; width: 100%; height: auto; padding: 8px; z-index: 20; }
  .nav-btn { width: auto; min-width: 44px; }
  .main, .client-shell { padding: 20px 14px 44px; }
  .page-head { flex-direction: column; }
  .stats { grid-template-columns: 1fr 1fr; }
  .stat-value { font-size: 24px; }
  .info-grid, .form-row { grid-template-columns: 1fr; }
  .info-item.story { grid-column: span 1; }
  .mission-head, .scenario-bar, .mission-selector-admin { flex-direction: column; align-items: stretch; }
  .mission-selector-admin .select { min-width: 0; width: 100%; }
  .mission-subtabs { flex-direction: column; }
  .mission-head-actions { justify-content: flex-start; }
  .comment-composer > div, .comment-meta { align-items: stretch; flex-direction: column; }
  .journal-entry { grid-template-columns: 38px minmax(0,1fr); }
  .journal-entry-meta { grid-column: 2; justify-items: start; }
  .scenario-switch { width: 100%; }
  .scenario-switch button { flex: 1; }
  .offer-summary, .client-offer { grid-template-columns: 1fr; }
  .ai-result-grid > div { grid-template-columns: 1fr; }
  .mission-selector { align-items: stretch; flex-direction: column; }
  .step { font-size: 0; }
  .doc-item { grid-template-columns: 34px 1fr; }
  .doc-actions { grid-column: 2; justify-content: flex-start; }
}
