:root {
  --navy-950: #0d1b2e;
  --navy-900: #132640;
  --navy-800: #17345d;
  --blue-700: #1f56a6;
  --blue-600: #2563b9;
  --blue-100: #eaf1fb;
  --blue-50: #f3f7fc;
  --ink: #18212f;
  --text: #344054;
  --muted: #667085;
  --subtle: #98a2b3;
  --line: #dce2ea;
  --line-dark: #c8d0dc;
  --surface: #ffffff;
  --canvas: #f3f5f8;
  --soft: #f8fafc;
  --gold: #b4822c;
  --gold-soft: #f5ead3;
  --success: #27845a;
  --success-soft: #e9f6ef;
  --warning: #9a6515;
  --warning-soft: #fff4db;
  --danger: #b33b3b;
  --danger-soft: #fff0f0;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .06);
  --shadow-md: 0 12px 32px rgba(16, 24, 40, .09);
  --ease: cubic-bezier(.22, .8, .2, 1);
}

* { box-sizing: border-box; }
html { min-width: 320px; min-height: 100%; background: var(--canvas); }
body { min-width: 320px; min-height: 100vh; margin: 0; overflow-x: hidden; background: var(--canvas); color: var(--ink); font-family: Inter, "Segoe UI", "Microsoft YaHei", Arial, sans-serif; letter-spacing: 0; }
button, input, textarea, select { font: inherit; letter-spacing: 0; }
button { border: 0; cursor: pointer; }
button:focus { outline: none; }
button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible, a:focus-visible { outline: 2px solid rgba(37, 99, 185, .55); outline-offset: 2px; }
a { color: inherit; }
svg { width: 18px; height: 18px; stroke-width: 1.8; }
[hidden] { display: none !important; }
mark { color: inherit; }

.app-shell { display: grid; min-height: 100vh; grid-template-columns: 248px minmax(0, 1fr); }
.sidebar { position: fixed; z-index: 30; inset: 0 auto 0 0; display: flex; width: 248px; flex-direction: column; padding: 22px 16px 16px; background: var(--navy-950); color: #dce5f2; }
.brand { display: flex; align-items: center; gap: 11px; min-height: 52px; padding: 0 8px 20px; color: #fff; text-decoration: none; border-bottom: 1px solid rgba(255, 255, 255, .09); }
.brand-mark { display: grid; width: 34px; height: 34px; flex: 0 0 auto; place-items: center; background: #fff; color: var(--navy-900); font-family: Georgia, serif; font-size: 19px; font-weight: 900; }
.brand > span:last-child { min-width: 0; }
.brand strong, .brand small { display: block; }
.brand strong { font-size: 15px; }
.brand small { margin-top: 4px; overflow: hidden; color: #8190a5; font-size: 8px; text-overflow: ellipsis; white-space: nowrap; }

.primary-nav { display: grid; gap: 4px; margin-top: 22px; }
.primary-nav button { position: relative; display: flex; width: 100%; min-height: 43px; align-items: center; gap: 12px; padding: 0 12px; background: transparent; color: #9ba8ba; font-size: 13px; text-align: left; transition: background .18s, color .18s, transform .18s; }
.primary-nav button:hover { background: rgba(255, 255, 255, .055); color: #fff; }
.primary-nav button:active { transform: translateX(1px); }
.primary-nav button.active { background: #fff; color: var(--navy-900); font-weight: 800; box-shadow: 0 7px 20px rgba(0, 0, 0, .15); }
.primary-nav button.active::before { content: ""; position: absolute; top: 8px; bottom: 8px; left: 0; width: 3px; background: var(--blue-600); }
.primary-nav button b { margin-left: auto; padding: 2px 6px; background: rgba(255, 255, 255, .09); color: #afbdce; font-size: 10px; font-weight: 700; }
.primary-nav button.active b { background: var(--blue-100); color: var(--blue-700); }
.sidebar-label { margin: 25px 12px 0; color: #68778c; font-size: 9px; font-weight: 800; text-transform: uppercase; }
.secondary-nav { margin-top: 8px; }

.sidebar-capacity { margin-top: auto; padding: 15px 12px; background: rgba(255, 255, 255, .045); border: 1px solid rgba(255, 255, 255, .065); }
.sidebar-capacity > div { display: flex; justify-content: space-between; color: #bdc8d6; font-size: 10px; }
.sidebar-capacity > i { display: block; height: 3px; margin: 10px 0 8px; overflow: hidden; background: rgba(255, 255, 255, .12); }
.sidebar-capacity > i b { display: block; width: 68%; height: 100%; background: #6fa4ef; }
.sidebar-capacity p { margin: 0; color: #6f8095; font-size: 9px; }
.sidebar-footer { display: grid; gap: 9px; margin-top: 12px; padding: 12px 8px 0; border-top: 1px solid rgba(255, 255, 255, .08); }
.sidebar-footer button { display: flex; align-items: center; gap: 9px; padding: 0; background: transparent; color: #93a1b4; font-size: 10px; text-align: left; }
.sidebar-footer a { color: #6f8095; font-size: 9px; text-decoration: none; }
.sidebar-footer a:hover { color: #fff; }

.main-shell { min-width: 0; grid-column: 2; }
.topbar { position: sticky; z-index: 20; top: 0; display: flex; height: 66px; align-items: center; justify-content: space-between; padding: 0 30px; background: rgba(255, 255, 255, .96); border-bottom: 1px solid var(--line); backdrop-filter: blur(14px); }
.topbar-left, .topbar-actions, .breadcrumb, .search-button, .help-button, .account-button { display: flex; align-items: center; }
.breadcrumb { gap: 7px; color: var(--muted); font-size: 12px; }
.breadcrumb svg { width: 13px; height: 13px; }
.breadcrumb strong { color: var(--ink); }
.topbar-actions { gap: 8px; }
.search-button { min-width: 270px; height: 38px; gap: 9px; padding: 0 10px; background: var(--soft); border: 1px solid var(--line); color: var(--muted); font-size: 11px; text-align: left; }
.search-button span { flex: 1; }
.search-button kbd { padding: 3px 6px; background: #fff; border: 1px solid var(--line); color: var(--subtle); font-family: inherit; font-size: 9px; }
.icon-button { position: relative; display: inline-grid; width: 36px; height: 36px; place-items: center; padding: 0; background: transparent; color: var(--muted); }
.icon-button:hover { background: var(--blue-50); color: var(--blue-700); }
.notification-dot { position: absolute; top: 7px; right: 7px; width: 6px; height: 6px; background: var(--danger); border: 2px solid #fff; border-radius: 50%; }
.help-button { height: 36px; gap: 7px; padding: 0 10px; background: transparent; color: var(--muted); font-size: 11px; }
.account-button { height: 38px; gap: 6px; padding: 0 6px; background: transparent; color: var(--muted); }
.account-button > span { display: grid; width: 29px; height: 29px; place-items: center; background: var(--navy-800); color: #fff; font-size: 11px; font-weight: 900; }
.account-button svg { width: 13px; height: 13px; }
.mobile-menu { display: none; }

.content-area { min-width: 0; padding: 30px; }
.page { display: none; animation: pageEnter .36s var(--ease); }
.page.active { display: block; }
.page-heading, .workspace-head, .module-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 24px; }
.page-heading h1, .workspace-head h1, .module-heading h2 { margin: 5px 0 6px; color: var(--ink); font-size: 27px; line-height: 1.25; font-weight: 760; }
.page-heading p, .workspace-head p, .module-heading p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.6; }
.eyebrow, .panel-header > div > span, .tender-summary header span, .export-settings > header span, .export-checklist > header span, .rule-panel > header span { color: var(--blue-700); font-size: 9px; font-weight: 900; text-transform: uppercase; }
.primary-button, .secondary-button { display: inline-flex; min-height: 40px; align-items: center; justify-content: center; gap: 8px; padding: 0 15px; font-size: 12px; font-weight: 800; white-space: nowrap; transition: transform .18s, box-shadow .18s, background .18s; }
.primary-button { background: var(--navy-800); color: #fff; box-shadow: 0 5px 12px rgba(23, 52, 93, .16); }
.primary-button:hover { background: var(--blue-700); box-shadow: 0 8px 18px rgba(23, 52, 93, .23); }
.secondary-button { background: #fff; border: 1px solid var(--line-dark); color: var(--text); }
.secondary-button:hover { background: var(--blue-50); border-color: #adc1dd; color: var(--blue-700); }
.primary-button:active, .secondary-button:active { transform: translateY(1px); }

.metric-strip { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 18px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-sm); }
.metric-strip article { min-width: 0; padding: 19px 20px; }
.metric-strip article + article { border-left: 1px solid var(--line); }
.metric-strip span, .metric-strip strong, .metric-strip small { display: block; }
.metric-strip span { color: var(--muted); font-size: 10px; }
.metric-strip strong { margin: 8px 0 6px; color: var(--navy-900); font-family: "Segoe UI", Arial, sans-serif; font-size: 25px; line-height: 1; }
.metric-strip small { color: var(--subtle); font-size: 9px; }
.metric-strip small b { color: var(--success); }

.dashboard-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(260px, .76fr); gap: 18px; margin-bottom: 18px; }
.lower-grid { grid-template-columns: minmax(0, 1.2fr) minmax(330px, .8fr); }
.panel { min-width: 0; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-sm); }
.panel-header { display: flex; min-height: 66px; align-items: center; justify-content: space-between; gap: 16px; padding: 0 18px; border-bottom: 1px solid var(--line); }
.panel-header h2, .panel-header h3 { margin: 4px 0 0; font-size: 16px; }
.panel-header > button, .panel-header > div + button { display: inline-flex; align-items: center; gap: 6px; padding: 0; background: transparent; color: var(--blue-700); font-size: 10px; font-weight: 800; }
.panel-header button svg { width: 13px; height: 13px; }

.project-table { overflow-x: auto; }
.project-row { display: grid; width: 100%; min-width: 760px; grid-template-columns: minmax(260px, 1.7fr) 130px 120px 88px 26px; align-items: center; gap: 14px; padding: 14px 18px; background: #fff; border-bottom: 1px solid var(--line); color: var(--text); text-align: left; }
button.project-row { transition: background .18s; }
button.project-row:hover { background: var(--blue-50); }
.project-row:last-child { border-bottom: 0; }
.table-head { min-height: 36px; padding-block: 9px; background: var(--soft); color: var(--muted); font-size: 9px; font-weight: 800; }
.project-name { display: grid; min-width: 0; grid-template-columns: 34px minmax(0, 1fr); column-gap: 10px; }
.project-name > i { grid-row: 1 / 3; display: grid; width: 34px; height: 34px; place-items: center; background: var(--blue-100); color: var(--blue-700); font-size: 12px; font-style: normal; font-weight: 900; }
.project-row b, .project-row small { display: block; }
.project-row b { overflow: hidden; color: var(--ink); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.project-row small { margin-top: 4px; color: var(--subtle); font-size: 8px; }
.danger-text { color: var(--danger) !important; }
.coverage > b { font-size: 10px; }
.coverage > i, .card-progress > i { display: block; height: 3px; margin-top: 7px; overflow: hidden; background: #e9edf3; }
.coverage > i em, .card-progress > i em { display: block; height: 100%; background: var(--blue-600); }
.status { display: inline-flex; width: fit-content; align-items: center; padding: 5px 8px; border: 0; font-size: 9px; font-weight: 800; }
.status-writing { background: var(--blue-100); color: var(--blue-700); }
.status-review { background: var(--warning-soft); color: var(--warning); }
.status-parsing { background: #eef0f4; color: #556273; }
.status-done { background: var(--success-soft); color: var(--success); }

.deadline-panel { padding-bottom: 12px; }
.date-card { display: grid; grid-template-columns: 48px 1fr auto; align-items: center; gap: 11px; margin: 12px 14px 0; padding: 12px; background: var(--soft); border-left: 3px solid #a9b6c7; }
.date-card.urgent { background: var(--danger-soft); border-left-color: var(--danger); }
.date-card time { text-align: center; }
.date-card time b, .date-card time span, .date-card strong, .date-card p { display: block; }
.date-card time b { font-size: 19px; line-height: 1; }
.date-card time span { margin-top: 4px; color: var(--muted); font-size: 8px; }
.date-card strong { font-size: 10px; }
.date-card p { margin: 5px 0 0; color: var(--muted); font-size: 8px; }
.date-card mark { padding: 4px 6px; background: #fff; color: var(--danger); font-size: 8px; font-weight: 900; }
.calendar-link { display: flex; width: calc(100% - 28px); min-height: 36px; align-items: center; justify-content: center; gap: 7px; margin: 12px 14px 0; background: transparent; border: 1px solid var(--line); color: var(--blue-700); font-size: 9px; font-weight: 800; }

.live-indicator { display: flex; align-items: center; gap: 6px; color: var(--success); font-size: 9px; }
.live-indicator i, .autosave i, .export-status i { width: 6px; height: 6px; background: var(--success); border-radius: 50%; box-shadow: 0 0 0 4px rgba(39, 132, 90, .1); animation: pulse 2.2s ease-in-out infinite; }
.production-chart { display: flex; height: 158px; align-items: end; gap: 14px; padding: 22px 22px 17px; background-image: linear-gradient(to top, transparent 24%, #edf0f4 25%, transparent 26%, transparent 49%, #edf0f4 50%, transparent 51%, transparent 74%, #edf0f4 75%, transparent 76%); }
.production-chart > div { display: flex; height: 100%; flex: 1; flex-direction: column; justify-content: end; gap: 8px; }
.production-chart i { display: block; min-height: 8px; background: #b9c8dc; transition: height .5s var(--ease); }
.production-chart .current i { background: var(--blue-600); }
.production-chart span { color: var(--subtle); font-size: 8px; text-align: center; }
.ai-activity-panel footer { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--line); }
.ai-activity-panel footer span { padding: 12px 15px; color: var(--muted); font-size: 9px; }
.ai-activity-panel footer span + span { border-left: 1px solid var(--line); }
.ai-activity-panel footer b { margin-right: 4px; color: var(--ink); font-size: 13px; }

.task-panel > button { display: grid; width: 100%; grid-template-columns: 34px 1fr auto; align-items: center; gap: 11px; padding: 13px 16px; background: #fff; border-bottom: 1px solid var(--line); color: var(--text); text-align: left; }
.task-panel > button:last-child { border-bottom: 0; }
.task-panel > button:hover { background: var(--blue-50); }
.task-panel > button > svg { width: 31px; height: 31px; padding: 7px; background: var(--blue-100); color: var(--blue-700); }
.task-panel strong, .task-panel small { display: block; }
.task-panel strong { font-size: 10px; }
.task-panel small { margin-top: 4px; color: var(--subtle); font-size: 8px; }
.task-panel mark { padding: 4px 6px; background: var(--danger-soft); color: var(--danger); font-size: 8px; font-weight: 800; }

.prototype-banner { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 15px 18px; background: var(--navy-900); color: #fff; }
.prototype-banner > div { display: flex; align-items: center; gap: 12px; }
.prototype-banner > div > svg { color: #82b2f2; }
.prototype-banner strong, .prototype-banner small { display: block; }
.prototype-banner strong { font-size: 11px; }
.prototype-banner small { margin-top: 5px; color: #93a5bd; font-size: 9px; line-height: 1.5; }
.prototype-banner button { flex: 0 0 auto; padding: 0; background: transparent; color: #b9d4f8; font-size: 9px; text-decoration: underline; }

.toolbar, .matrix-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.segmented { display: inline-flex; padding: 3px; background: #e9edf3; }
.segmented button { min-height: 31px; padding: 0 12px; background: transparent; color: var(--muted); font-size: 9px; font-weight: 800; }
.segmented button.active { background: #fff; color: var(--navy-800); box-shadow: var(--shadow-sm); }
.toolbar > label, .matrix-toolbar label, .outline-search, .evidence-list-panel > header label { display: flex; min-width: 240px; height: 38px; align-items: center; gap: 8px; padding: 0 11px; background: #fff; border: 1px solid var(--line); color: var(--muted); }
.toolbar input, .matrix-toolbar input, .outline-search input, .evidence-list-panel input { width: 100%; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--ink); font-size: 10px; }
.project-card-grid { display: grid; grid-template-columns: repeat(3, minmax(270px, 1fr)); gap: 16px; }
.project-card-grid > article { display: flex; min-height: 280px; flex-direction: column; padding: 18px; background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow-sm); transition: transform .2s, box-shadow .2s, border-color .2s; }
.project-card-grid > article:hover { transform: translateY(-2px); border-color: #b6c8e0; box-shadow: var(--shadow-md); }
.project-card-grid article > header, .project-card-grid article > footer, .card-progress > span { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.project-sector { color: var(--blue-700); font-size: 9px; font-weight: 900; }
.project-card-grid h2 { margin: 20px 0 8px; font-size: 16px; line-height: 1.4; }
.project-card-grid > article > p { margin: 0; color: var(--muted); font-size: 9px; }
.project-card-grid dl { display: grid; grid-template-columns: repeat(3, 1fr); margin: 22px 0 18px; padding: 13px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.project-card-grid dl > div + div { padding-left: 12px; border-left: 1px solid var(--line); }
.project-card-grid dt { color: var(--subtle); font-size: 8px; }
.project-card-grid dd { margin: 5px 0 0; color: var(--text); font-size: 9px; font-weight: 800; }
.card-progress { margin-top: auto; }
.card-progress span b, .card-progress span strong { font-size: 9px; }
.card-progress span b { color: var(--muted); }
.card-progress span strong { color: var(--blue-700); }
.project-card-grid article > footer { margin-top: 18px; }
.avatar-stack { display: flex; align-items: center; }
.avatar-stack i, .avatar-stack b { display: grid; width: 26px; height: 26px; place-items: center; margin-right: -5px; background: #dfe8f5; border: 2px solid #fff; color: var(--navy-800); border-radius: 50%; font-size: 8px; font-style: normal; }
.avatar-stack b { background: #eef1f5; color: var(--muted); }
.project-card-grid footer button { display: inline-flex; align-items: center; gap: 6px; padding: 0; background: transparent; color: var(--blue-700); font-size: 9px; font-weight: 900; }
.project-card-grid footer button svg { width: 13px; height: 13px; }

.workspace-page { margin: -30px; }
.workspace-head { min-height: 118px; align-items: center; margin: 0; padding: 19px 28px; background: #fff; border-bottom: 1px solid var(--line); }
.workspace-head h1 { margin-block: 4px; font-size: 22px; }
.back-link { display: inline-flex; align-items: center; gap: 5px; margin-bottom: 9px; padding: 0; background: transparent; color: var(--muted); font-size: 9px; }
.back-link svg { width: 13px; height: 13px; }
.workspace-actions { display: flex; align-items: center; gap: 8px; }
.autosave, .export-status { display: inline-flex; align-items: center; gap: 7px; color: var(--muted); font-size: 9px; }
.workspace-tabs { position: sticky; z-index: 15; top: 66px; display: flex; min-height: 50px; align-items: stretch; gap: 4px; padding: 0 27px; overflow-x: auto; background: #fff; border-bottom: 1px solid var(--line); }
.workspace-tabs button { position: relative; display: inline-flex; min-width: max-content; align-items: center; gap: 7px; padding: 0 13px; background: transparent; color: var(--muted); font-size: 10px; font-weight: 800; }
.workspace-tabs button::after { content: ""; position: absolute; right: 13px; bottom: -1px; left: 13px; height: 2px; background: transparent; }
.workspace-tabs button.active { color: var(--blue-700); }
.workspace-tabs button.active::after { background: var(--blue-600); }
.workspace-tabs button b { padding: 2px 5px; background: #eef2f7; color: var(--muted); font-size: 8px; }
.workspace-tabs .warning-badge { background: var(--danger-soft); color: var(--danger); }
.workspace-view { display: none; padding: 24px 28px 34px; animation: pageEnter .32s var(--ease); }
.workspace-view.active { display: block; }
.overview-grid { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: 16px; margin-bottom: 16px; }
.second-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }

.readiness-panel .panel-header mark { padding: 5px 8px; background: var(--danger-soft); color: var(--danger); font-size: 8px; font-weight: 900; }
.readiness-content { display: grid; grid-template-columns: 155px 1fr; align-items: center; gap: 16px; padding: 24px; }
.score-ring { position: relative; display: grid; width: 126px; height: 126px; place-items: center; background: conic-gradient(var(--blue-600) 0 86%, #e9edf3 86% 100%); border-radius: 50%; }
.score-ring::after { content: ""; position: absolute; inset: 11px; background: #fff; border-radius: 50%; }
.score-ring span { position: relative; z-index: 1; color: var(--navy-900); font-size: 31px; font-weight: 800; }
.score-ring small { font-size: 13px; }
.readiness-content > div:last-child > strong { display: block; font-size: 15px; }
.readiness-content > div:last-child > p { margin: 7px 0 13px; color: var(--muted); font-size: 10px; line-height: 1.6; }
.readiness-content ul { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.readiness-content li { display: flex; align-items: center; gap: 8px; color: var(--text); font-size: 9px; }
.readiness-content li i { width: 7px; height: 7px; background: var(--success); border-radius: 50%; }
.readiness-content li.warn i { background: var(--warning); }

.tender-summary dl { display: grid; grid-template-columns: repeat(3, 1fr); margin: 0; }
.tender-summary dl > div { min-height: 78px; padding: 15px 17px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.tender-summary dl > div:nth-child(3n) { border-right: 0; }
.tender-summary dl > div:nth-last-child(-n+3) { border-bottom: 0; }
.tender-summary dt { color: var(--muted); font-size: 8px; }
.tender-summary dd { margin: 7px 0 0; color: var(--ink); font-size: 10px; font-weight: 800; line-height: 1.5; }

.score-composition { padding-bottom: 17px; }
.score-composition .panel-header strong { font-size: 10px; }
.score-bar { display: flex; height: 48px; margin: 22px 18px 14px; overflow: hidden; }
.score-bar i { display: flex; align-items: center; padding-left: 12px; color: #fff; font-size: 9px; font-style: normal; font-weight: 900; }
.score-bar .tech, .score-legend i.tech { background: var(--blue-600); }
.score-bar .business, .score-legend i.business { background: var(--navy-800); }
.score-bar .price, .score-legend i.price { background: var(--gold); }
.score-legend { display: flex; gap: 20px; padding: 0 18px; }
.score-legend span { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 8px; }
.score-legend i { width: 7px; height: 7px; }
.score-legend b { color: var(--ink); }
.score-composition > button { display: inline-flex; align-items: center; gap: 7px; margin: 17px 18px 0; padding: 0; background: transparent; color: var(--blue-700); font-size: 9px; font-weight: 900; }
.score-composition > button svg { width: 13px; height: 13px; }

.risk-summary > article { display: grid; grid-template-columns: 31px 1fr auto; align-items: start; gap: 10px; padding: 13px 16px; border-bottom: 1px solid var(--line); }
.risk-summary > article:last-child { border-bottom: 0; }
.risk-summary > article > svg { width: 29px; height: 29px; padding: 7px; background: var(--danger-soft); color: var(--danger); }
.risk-summary strong, .risk-summary p { display: block; }
.risk-summary strong { font-size: 10px; }
.risk-summary p { margin: 5px 0 0; color: var(--muted); font-size: 8px; line-height: 1.5; }
.risk-summary mark { padding: 4px 6px; background: var(--danger-soft); color: var(--danger); font-size: 8px; font-weight: 900; }
.risk-summary mark.medium { background: var(--warning-soft); color: var(--warning); }

.workflow-panel ol { display: grid; grid-template-columns: repeat(5, 1fr); margin: 0; padding: 22px 18px 24px; list-style: none; }
.workflow-panel li { position: relative; display: flex; min-width: 0; gap: 9px; }
.workflow-panel li::after { content: ""; position: absolute; top: 14px; right: 7px; left: 34px; height: 1px; background: var(--line-dark); }
.workflow-panel li:last-child::after { display: none; }
.workflow-panel li > i { position: relative; z-index: 1; display: grid; width: 28px; height: 28px; flex: 0 0 auto; place-items: center; background: #eef1f5; color: var(--muted); border-radius: 50%; font-size: 9px; font-style: normal; font-weight: 900; }
.workflow-panel li.done > i { background: var(--success); color: #fff; }
.workflow-panel li.active > i { background: var(--blue-600); color: #fff; box-shadow: 0 0 0 5px var(--blue-100); }
.workflow-panel li > span { position: relative; z-index: 1; min-width: 0; padding: 0 8px 0 0; background: #fff; }
.workflow-panel li strong, .workflow-panel li small { display: block; }
.workflow-panel li strong { font-size: 9px; }
.workflow-panel li small { margin-top: 5px; color: var(--subtle); font-size: 7px; line-height: 1.5; }

.matrix-toolbar { align-items: flex-end; }
.matrix-toolbar h2, .module-heading h2 { margin: 5px 0 5px; font-size: 21px; }
.matrix-toolbar p { margin: 0; color: var(--muted); font-size: 10px; }
.matrix-toolbar > div:last-child { display: flex; align-items: center; gap: 8px; }
.matrix-toolbar select, .evidence-list-panel select, .export-settings select, .export-settings input { height: 38px; padding: 0 11px; background: #fff; border: 1px solid var(--line); color: var(--text); font-size: 10px; outline: 0; }
.matrix-summary { display: flex; align-items: center; gap: 25px; margin-bottom: 12px; padding: 11px 15px; background: var(--navy-900); color: #c3cedd; }
.matrix-summary span { font-size: 9px; }
.matrix-summary b { margin-right: 5px; color: #fff; font-size: 13px; }
.matrix-summary .warning b { color: #ffd889; }
.response-matrix { overflow-x: auto; background: #fff; border: 1px solid var(--line); }
.matrix-row { display: grid; min-width: 1050px; grid-template-columns: minmax(190px, 1.2fr) minmax(220px, 1.35fr) minmax(175px, 1fr) 120px 100px 95px 34px; align-items: center; gap: 12px; min-height: 77px; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.matrix-row:last-child { border-bottom: 0; }
.matrix-row:not(.matrix-head):hover { background: var(--blue-50); }
.matrix-head { min-height: 38px; background: var(--soft); color: var(--muted); font-size: 8px; font-weight: 900; }
.matrix-row > span { min-width: 0; }
.matrix-row > span:first-child { position: relative; padding-left: 14px; }
.weight-bar { position: absolute; top: 2px; bottom: 2px; left: 0; width: 4px; overflow: hidden; background: #e4e8ef; }
.weight-bar b { position: absolute; right: 0; bottom: 0; left: 0; background: var(--blue-600); }
.matrix-row strong, .matrix-row small { display: block; }
.matrix-row strong { font-size: 10px; }
.matrix-row small { margin-top: 5px; color: var(--subtle); font-size: 8px; }
.matrix-row p { margin: 0; color: var(--text); font-size: 9px; line-height: 1.55; }
.matrix-row span > button:not(.icon-button) { padding: 0; background: transparent; color: var(--blue-700); font-size: 9px; font-weight: 800; text-align: left; }
.evidence-chip { display: inline-flex !important; width: fit-content; align-items: center; gap: 5px; padding: 5px 7px; background: var(--blue-100); color: var(--blue-700); font-size: 8px !important; }
.evidence-chip.warning { background: var(--warning-soft); color: var(--warning); }
.evidence-chip.danger { background: var(--danger-soft); color: var(--danger); }
.evidence-chip svg { width: 11px; height: 11px; }
.member-avatar { display: inline-grid; width: 24px; height: 24px; margin-right: 5px; place-items: center; background: #e8edf4; color: var(--navy-800); border-radius: 50%; font-size: 8px; font-style: normal; font-weight: 900; }
.matrix-status { display: inline-flex; width: fit-content; align-items: center; gap: 4px; padding: 5px 7px; font-size: 8px; font-weight: 900; }
.matrix-status svg { width: 11px; height: 11px; }
.matrix-status.complete { background: var(--success-soft); color: var(--success); }
.matrix-status.risk { background: var(--warning-soft); color: var(--warning); }
.matrix-status.missing { background: var(--danger-soft); color: var(--danger); }

.editor-view { height: calc(100vh - 234px); min-height: 620px; grid-template-columns: 245px minmax(500px, 1fr) 310px; padding: 0; overflow: hidden; background: #e9edf2; }
.editor-view.active { display: grid; }
.mobile-editor-tabs { display: none; }
.outline-panel, .ai-panel { min-width: 0; overflow: hidden; background: #fff; }
.outline-panel { display: flex; flex-direction: column; border-right: 1px solid var(--line); }
.outline-panel > header, .ai-panel > header { display: flex; min-height: 62px; align-items: center; justify-content: space-between; gap: 10px; padding: 0 14px; border-bottom: 1px solid var(--line); }
.outline-panel header span, .outline-panel header strong { display: block; }
.outline-panel header span { color: var(--blue-700); font-size: 8px; font-weight: 900; }
.outline-panel header strong { margin-top: 4px; font-size: 12px; }
.outline-search { min-width: 0; height: 35px; margin: 10px 12px; }
.outline-panel nav { flex: 1; overflow-y: auto; padding: 0 8px 15px; scrollbar-width: thin; }
.outline-panel nav > button { display: grid; width: 100%; min-height: 40px; grid-template-columns: 15px 1fr auto; align-items: center; gap: 5px; padding: 6px 8px; background: transparent; color: var(--text); text-align: left; }
.outline-panel nav > button:hover, .outline-panel nav > button.active { background: var(--blue-50); color: var(--blue-700); }
.outline-panel nav > button svg { width: 13px; height: 13px; }
.outline-panel nav > button span { display: flex; min-width: 0; align-items: center; gap: 7px; overflow: hidden; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.outline-panel nav > button span b { color: var(--subtle); font-size: 8px; }
.outline-panel nav > button mark { color: var(--success); font-size: 8px; font-weight: 900; }
.outline-panel nav > button mark.risk { color: var(--warning); }
.outline-children { display: grid; margin: 0 0 4px 29px; border-left: 1px solid var(--line); }
.outline-children button { min-height: 34px; padding: 5px 8px 5px 12px; overflow: hidden; background: transparent; color: var(--muted); font-size: 8px; text-align: left; text-overflow: ellipsis; white-space: nowrap; }
.outline-children button:hover, .outline-children button.active { color: var(--blue-700); font-weight: 800; }
.outline-panel > footer { display: flex; min-height: 42px; align-items: center; justify-content: space-between; padding: 0 13px; background: var(--soft); border-top: 1px solid var(--line); color: var(--muted); font-size: 8px; }

.document-editor { display: flex; min-width: 0; flex-direction: column; overflow: hidden; }
.editor-toolbar { display: flex; min-height: 48px; align-items: center; justify-content: space-between; gap: 12px; padding: 0 12px; background: #fff; border-bottom: 1px solid var(--line); }
.editor-history, .editor-format, .editor-meta { display: flex; align-items: center; gap: 4px; }
.editor-history { padding-right: 8px; border-right: 1px solid var(--line); }
.editor-format select { height: 30px; padding: 0 24px 0 8px; border: 1px solid var(--line); background: #fff; color: var(--text); font-size: 9px; }
.editor-format button { display: grid; width: 30px; height: 30px; place-items: center; background: transparent; color: var(--muted); }
.editor-format button:hover, .editor-format button.active { background: var(--blue-100); color: var(--blue-700); }
.editor-format button i { font-family: Georgia, serif; font-style: italic; }
.editor-meta { color: var(--muted); font-size: 8px; }
.tablet-ai-button { display: none; }
.editor-meta > span:first-child { padding-right: 8px; border-right: 1px solid var(--line); }
.document-canvas-wrap { flex: 1; overflow: auto; padding: 26px 32px 50px; scrollbar-width: thin; }
.document-page { position: relative; width: min(760px, 100%); min-height: 1040px; margin: 0 auto; padding: 66px 74px 76px; outline: 0; background: #fff; border: 1px solid #d9dee6; box-shadow: 0 10px 32px rgba(37, 49, 67, .1); color: #242b35; font-family: "Microsoft YaHei", Arial, sans-serif; }
.document-page:focus { border-color: #9eb8da; box-shadow: 0 10px 32px rgba(37, 49, 67, .12), 0 0 0 2px rgba(37, 99, 185, .1); }
.document-page > header, .document-page > footer { position: absolute; right: 45px; left: 45px; display: flex; justify-content: space-between; color: #8b94a1; font-size: 8px; }
.document-page > header { top: 26px; padding-bottom: 10px; border-bottom: 1px solid #dfe3e9; }
.document-page > footer { bottom: 27px; padding-top: 10px; border-top: 1px solid #dfe3e9; }
.document-page h1 { margin: 4px 0 25px; color: #172a46; font-size: 24px; line-height: 1.4; text-align: center; }
.document-page h2 { margin: 27px 0 12px; color: #1d3555; font-size: 16px; }
.document-page p, .document-page li { font-size: 13px; line-height: 2; text-align: justify; }
.document-page p { margin: 0 0 15px; }
.document-page ol { margin: 0 0 16px; padding-left: 21px; }
.document-callout { margin: 20px 0; padding: 13px 15px; background: #f2f6fb; border-left: 3px solid var(--blue-600); }
.document-callout strong { color: var(--blue-700); font-size: 11px; }
.document-callout p { margin: 5px 0 0; color: #53657c; font-size: 10px; line-height: 1.7; }
.document-page table { width: 100%; margin: 17px 0; border-collapse: collapse; font-size: 10px; }
.document-page th, .document-page td { padding: 10px; border: 1px solid #cfd6df; text-align: left; line-height: 1.55; }
.document-page th { background: #edf3fa; color: #203b62; }

.ai-panel { display: flex; flex-direction: column; border-left: 1px solid var(--line); }
.ai-panel > header > div { display: flex; min-width: 0; align-items: center; gap: 9px; }
.ai-mark { display: grid; width: 29px; height: 29px; flex: 0 0 auto; place-items: center; background: var(--navy-800); color: #fff; }
.ai-mark svg { width: 15px; height: 15px; }
.ai-panel header strong, .ai-panel header small { display: block; }
.ai-panel header strong { font-size: 11px; }
.ai-panel header small { margin-top: 3px; overflow: hidden; color: var(--muted); font-size: 7px; text-overflow: ellipsis; white-space: nowrap; }
.ai-context { margin: 13px; padding: 12px; background: var(--blue-50); border: 1px solid #dce7f4; }
.ai-context > span { display: flex; align-items: center; gap: 6px; color: var(--blue-700); font-size: 8px; font-weight: 900; }
.ai-context > span svg { width: 12px; height: 12px; }
.ai-context > strong { display: block; margin-top: 8px; font-size: 10px; }
.ai-context p { margin: 5px 0 0; color: var(--muted); font-size: 8px; line-height: 1.5; }
.ai-suggestions { display: grid; gap: 6px; padding: 0 13px; }
.ai-suggestions > span { margin-bottom: 2px; color: var(--muted); font-size: 8px; font-weight: 900; }
.ai-suggestions > button { display: grid; width: 100%; grid-template-columns: 28px 1fr; align-items: center; gap: 9px; padding: 9px 10px; background: #fff; border: 1px solid var(--line); color: var(--text); text-align: left; }
.ai-suggestions > button:hover { background: var(--blue-50); border-color: #b9cce4; }
.ai-suggestions > button > svg { color: var(--blue-700); }
.ai-suggestions strong, .ai-suggestions small { display: block; }
.ai-suggestions strong { font-size: 9px; }
.ai-suggestions small { margin-top: 4px; color: var(--subtle); font-size: 7px; }
.ai-response { margin: 12px 13px 0; padding: 12px; background: #f8fafc; border: 1px solid var(--line); border-top: 3px solid var(--blue-600); animation: pageEnter .25s ease; }
.ai-response > span { color: var(--blue-700); font-size: 8px; font-weight: 900; }
.ai-response p { margin: 8px 0 10px; color: var(--text); font-size: 9px; line-height: 1.7; }
.ai-response > div { display: flex; gap: 6px; }
.ai-response button { min-height: 29px; padding: 0 9px; background: var(--navy-800); color: #fff; font-size: 8px; font-weight: 800; }
.ai-response button + button { background: transparent; border: 1px solid var(--line-dark); color: var(--muted); }
.ai-composer { display: grid; grid-template-columns: 1fr 34px; align-items: end; gap: 7px; margin: auto 13px 11px; padding: 9px; background: #fff; border: 1px solid var(--line-dark); box-shadow: var(--shadow-sm); }
.ai-composer:focus-within { border-color: #91add2; }
.ai-composer textarea { width: 100%; max-height: 84px; resize: none; padding: 0; border: 0; outline: 0; color: var(--ink); font-size: 9px; line-height: 1.55; }
.ai-composer button { display: grid; width: 34px; height: 34px; place-items: center; background: var(--navy-800); color: #fff; }
.ai-panel > footer { display: flex; gap: 7px; padding: 10px 13px; background: var(--soft); border-top: 1px solid var(--line); color: var(--muted); font-size: 7px; line-height: 1.5; }
.ai-panel > footer svg { width: 13px; height: 13px; flex: 0 0 auto; color: var(--success); }

.module-heading { align-items: center; }
.evidence-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 15px; }
.evidence-stats article { display: flex; align-items: center; gap: 12px; padding: 15px; background: #fff; border: 1px solid var(--line); }
.evidence-stats article > svg { width: 34px; height: 34px; padding: 8px; background: var(--blue-100); color: var(--blue-700); }
.evidence-stats article.warn > svg { background: var(--danger-soft); color: var(--danger); }
.evidence-stats strong, .evidence-stats small { display: block; }
.evidence-stats strong { font-size: 19px; }
.evidence-stats small { margin-top: 3px; color: var(--muted); font-size: 8px; }
.evidence-layout { display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: 15px; }
.evidence-categories { display: grid; align-content: start; padding: 8px; background: #fff; border: 1px solid var(--line); }
.evidence-categories button { display: flex; min-height: 42px; align-items: center; gap: 9px; padding: 0 10px; background: transparent; color: var(--muted); font-size: 9px; text-align: left; }
.evidence-categories button b { margin-left: auto; }
.evidence-categories button.active { background: var(--blue-50); color: var(--blue-700); font-weight: 900; }
.evidence-list-panel > header { display: flex; min-height: 57px; align-items: center; justify-content: space-between; gap: 10px; padding: 0 13px; border-bottom: 1px solid var(--line); }
.evidence-list-panel > header select { height: 35px; }
.evidence-list article { display: grid; grid-template-columns: 39px minmax(0, 1fr) 80px 80px 36px; align-items: center; gap: 12px; min-height: 67px; padding: 10px 13px; border-bottom: 1px solid var(--line); }
.evidence-list article:last-child { border-bottom: 0; }
.evidence-list article:hover { background: var(--blue-50); }
.file-icon { display: grid; width: 37px; height: 41px; place-items: center; background: #e9eff7; color: var(--blue-700); font-size: 8px; font-style: normal; font-weight: 900; }
.file-icon.missing { background: var(--danger-soft); color: var(--danger); font-size: 16px; }
.evidence-list strong, .evidence-list small { display: block; }
.evidence-list strong { font-size: 10px; }
.evidence-list small { margin-top: 5px; color: var(--muted); font-size: 8px; }
.evidence-list article > b { color: var(--muted); font-size: 8px; font-weight: 600; }
.evidence-list mark { width: fit-content; padding: 5px 7px; font-size: 8px; font-weight: 900; }
.evidence-list mark.valid { background: var(--success-soft); color: var(--success); }
.evidence-list mark.expiring { background: var(--warning-soft); color: var(--warning); }
.evidence-list mark.missing { background: var(--danger-soft); color: var(--danger); }

.compliance-overview { display: grid; grid-template-columns: 260px 1fr; margin-bottom: 15px; background: #fff; border: 1px solid var(--line); }
.compliance-score { padding: 23px; background: var(--navy-900); color: #fff; }
.compliance-score span { display: block; color: #9bc3fa; font-size: 36px; font-weight: 800; }
.compliance-score small { font-size: 14px; }
.compliance-score strong { display: block; margin-top: 10px; font-size: 12px; }
.compliance-score p { margin: 6px 0 0; color: #97a8be; font-size: 9px; }
.compliance-bars { display: grid; grid-template-columns: 1fr 1fr; gap: 17px 24px; padding: 22px; }
.compliance-bars article span { display: flex; justify-content: space-between; margin-bottom: 8px; font-size: 9px; }
.compliance-bars article span b { color: var(--text); }
.compliance-bars article span strong { color: var(--blue-700); }
.compliance-bars article > i { display: block; height: 5px; overflow: hidden; background: #e9edf3; }
.compliance-bars article > i em { display: block; height: 100%; background: var(--blue-600); }
.compliance-layout { display: grid; grid-template-columns: minmax(0, 1fr) 285px; gap: 15px; }
.compliance-list > header { display: flex; min-height: 60px; align-items: center; justify-content: space-between; gap: 12px; padding: 0 15px; border-bottom: 1px solid var(--line); }
.compliance-list h3 { margin: 0; font-size: 14px; }
.compliance-list > article { display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; align-items: start; gap: 12px; padding: 15px; border-bottom: 1px solid var(--line); }
.compliance-list > article:last-child { border-bottom: 0; }
.compliance-list > article > mark { width: fit-content; padding: 5px 7px; background: var(--danger-soft); color: var(--danger); font-size: 8px; font-weight: 900; }
.compliance-list > article > mark.passed { background: var(--success-soft); color: var(--success); }
.compliance-list strong, .compliance-list p, .compliance-list small { display: block; }
.compliance-list strong { font-size: 10px; }
.compliance-list p { margin: 6px 0; color: var(--text); font-size: 9px; line-height: 1.55; }
.compliance-list small { color: var(--subtle); font-size: 8px; }
.compliance-list article > button { min-height: 30px; padding: 0 9px; background: transparent; border: 1px solid var(--line-dark); color: var(--blue-700); font-size: 8px; font-weight: 900; }
.rule-panel { padding-bottom: 13px; }
.rule-panel > header { padding: 17px; border-bottom: 1px solid var(--line); }
.rule-panel h3 { margin: 5px 0 0; font-size: 14px; }
.rule-panel ul { display: grid; gap: 2px; margin: 0; padding: 10px; list-style: none; }
.rule-panel li { display: flex; align-items: center; gap: 9px; padding: 9px; }
.rule-panel li > svg { width: 25px; height: 25px; padding: 6px; background: var(--success-soft); color: var(--success); }
.rule-panel li strong, .rule-panel li small { display: block; }
.rule-panel li strong { font-size: 9px; }
.rule-panel li small { margin-top: 3px; color: var(--subtle); font-size: 7px; }
.rule-panel > p { margin: 0 13px; padding: 11px; background: var(--warning-soft); color: #72501d; font-size: 8px; line-height: 1.65; }

.export-status { padding: 7px 10px; background: var(--success-soft); color: var(--success); }
.export-layout { display: grid; grid-template-columns: minmax(0, 1fr) 350px; gap: 15px; margin-bottom: 15px; }
.export-settings, .export-checklist { padding-bottom: 18px; }
.export-settings > header, .export-checklist > header { padding: 17px 18px; border-bottom: 1px solid var(--line); }
.export-settings h3, .export-checklist h3 { margin: 5px 0 0; font-size: 15px; }
.setting-group { display: grid; gap: 8px; padding: 15px 18px 0; }
.setting-group > label { color: var(--text); font-size: 9px; font-weight: 900; }
.format-options { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.format-options button { display: grid; grid-template-columns: 32px 1fr 16px; align-items: center; gap: 9px; min-height: 66px; padding: 10px; background: #fff; border: 1px solid var(--line); color: var(--text); text-align: left; }
.format-options button.active { background: var(--blue-50); border-color: var(--blue-600); }
.format-options button > svg:first-child { color: var(--blue-700); }
.format-options button > svg:last-child { display: none; width: 15px; height: 15px; color: var(--blue-700); }
.format-options button.active > svg:last-child { display: block; }
.format-options strong, .format-options small { display: block; }
.format-options strong { font-size: 10px; }
.format-options small { margin-top: 4px; color: var(--subtle); font-size: 8px; }
.export-settings select, .export-settings input { width: 100%; }
.setting-row { display: flex; min-height: 61px; align-items: center; justify-content: space-between; gap: 15px; margin: 0 18px; border-bottom: 1px solid var(--line); }
.setting-row strong, .setting-row small { display: block; }
.setting-row strong { font-size: 10px; }
.setting-row small { margin-top: 4px; color: var(--subtle); font-size: 8px; }
.switch { position: relative; display: block; width: 34px; height: 19px; }
.switch input { position: absolute; opacity: 0; }
.switch i { position: absolute; inset: 0; background: #cfd6df; border-radius: 20px; transition: background .18s; }
.switch i::after { content: ""; position: absolute; top: 3px; left: 3px; width: 13px; height: 13px; background: #fff; border-radius: 50%; box-shadow: 0 1px 3px rgba(0, 0, 0, .2); transition: transform .18s; }
.switch input:checked + i { background: var(--blue-600); }
.switch input:checked + i::after { transform: translateX(15px); }
.export-checklist ul { margin: 0; padding: 8px 14px; list-style: none; }
.export-checklist li { display: grid; grid-template-columns: 28px 1fr auto; align-items: center; gap: 9px; padding: 12px 4px; border-bottom: 1px solid var(--line); }
.export-checklist li > svg { width: 26px; height: 26px; padding: 5px; background: var(--success-soft); color: var(--success); }
.export-checklist li.warning > svg { background: var(--warning-soft); color: var(--warning); }
.export-checklist strong, .export-checklist small { display: block; }
.export-checklist strong { font-size: 9px; }
.export-checklist small { margin-top: 4px; color: var(--subtle); font-size: 8px; }
.export-checklist li button { padding: 0; background: transparent; color: var(--blue-700); font-size: 8px; font-weight: 900; }
.export-button { width: calc(100% - 28px); margin: 9px 14px 0; }
.export-checklist > p { margin: 10px 14px 0; color: var(--muted); font-size: 8px; line-height: 1.55; text-align: center; }
.version-panel .panel-header h3 { margin: 4px 0 0; }
.version-row { display: grid; grid-template-columns: 34px minmax(0, 1fr) 80px 55px 36px; align-items: center; gap: 11px; min-height: 63px; padding: 10px 15px; border-bottom: 1px solid var(--line); }
.version-row:last-child { border-bottom: 0; }
.version-row > svg { width: 31px; height: 31px; padding: 7px; background: var(--blue-100); color: var(--blue-700); }
.version-row strong, .version-row small { display: block; }
.version-row strong { font-size: 10px; }
.version-row small { margin-top: 4px; color: var(--subtle); font-size: 8px; }
.version-row > b { color: var(--muted); font-size: 8px; }
.version-row > mark { padding: 4px 6px; background: var(--blue-50); color: var(--blue-700); font-size: 8px; font-weight: 900; }

.placeholder-page { min-height: calc(100vh - 126px); place-content: center; justify-items: center; text-align: center; }
.placeholder-page.active { display: grid; }
.placeholder-page > svg { width: 54px; height: 54px; padding: 13px; background: var(--blue-100); color: var(--blue-700); }
.placeholder-page h1 { margin: 18px 0 7px; font-size: 24px; }
.placeholder-page p { max-width: 480px; margin: 0 0 20px; color: var(--muted); font-size: 11px; }

.modal-layer { position: fixed; z-index: 100; inset: 0; display: grid; place-items: center; padding: 22px; background: rgba(11, 24, 41, .58); backdrop-filter: blur(5px); }
.modal { width: min(620px, 100%); max-height: calc(100vh - 44px); overflow: hidden; background: #fff; box-shadow: 0 28px 80px rgba(10, 21, 36, .28); animation: modalEnter .28s var(--ease); }
.modal > header { display: flex; min-height: 74px; align-items: center; justify-content: space-between; gap: 15px; padding: 0 20px; background: var(--navy-900); color: #fff; }
.modal > header span { color: #8eb9f2; font-size: 8px; font-weight: 900; }
.modal > header h2 { margin: 5px 0 0; font-size: 18px; }
.modal > header .icon-button { color: #fff; }
.modal > header .icon-button:hover { background: rgba(255, 255, 255, .1); }
.modal-content { max-height: calc(100vh - 118px); overflow-y: auto; padding: 20px; scrollbar-width: thin; }
.modal-card { padding: 14px; background: var(--soft); border: 1px solid var(--line); }
.modal-card + .modal-card { margin-top: 10px; }
.modal-card strong { font-size: 11px; }
.modal-card p { margin: 7px 0 0; color: var(--text); font-size: 9px; line-height: 1.75; }
.modal-list { display: grid; gap: 8px; margin: 10px 0 0; padding: 0; list-style: none; }
.modal-list li { display: flex; gap: 8px; color: var(--text); font-size: 9px; line-height: 1.6; }
.modal-list li::before { content: ""; width: 5px; height: 5px; flex: 0 0 auto; margin-top: 5px; background: var(--blue-600); }
.contact-lines { margin-top: 12px; padding: 14px; background: var(--navy-900); color: #c2cddd; font-size: 9px; line-height: 1.8; }
.contact-lines a { color: #9fc5f7; font-weight: 900; }
.modal-form { display: grid; gap: 12px; }
.modal-form label { display: grid; gap: 6px; color: var(--text); font-size: 9px; font-weight: 800; }
.modal-form input, .modal-form textarea, .modal-form select { width: 100%; min-height: 40px; padding: 9px 11px; border: 1px solid var(--line-dark); outline: 0; background: #fff; color: var(--ink); font-size: 10px; font-weight: 400; }
.modal-form textarea { min-height: 86px; resize: vertical; }
.modal-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 15px; }
.upload-zone { display: grid; min-height: 150px; place-items: center; padding: 20px; background: var(--blue-50); border: 1px dashed #9eb7d8; text-align: center; }
.upload-zone svg { width: 36px; height: 36px; color: var(--blue-700); }
.upload-zone strong, .upload-zone small { display: block; }
.upload-zone strong { margin-top: 10px; font-size: 11px; }
.upload-zone small { margin-top: 6px; color: var(--muted); font-size: 8px; }
.upload-zone button { margin-top: 12px; min-height: 33px; padding: 0 11px; background: #fff; border: 1px solid var(--line-dark); color: var(--blue-700); font-size: 9px; font-weight: 900; }
.wizard-steps { display: flex; margin-bottom: 18px; }
.wizard-steps span { position: relative; display: flex; flex: 1; align-items: center; gap: 7px; color: var(--subtle); font-size: 8px; }
.wizard-steps span::after { content: ""; height: 1px; flex: 1; background: var(--line); }
.wizard-steps span:last-child::after { display: none; }
.wizard-steps i { display: grid; width: 23px; height: 23px; place-items: center; background: #eef1f5; color: var(--muted); border-radius: 50%; font-style: normal; font-weight: 900; }
.wizard-steps span.active { color: var(--blue-700); font-weight: 900; }
.wizard-steps span.active i, .wizard-steps span.done i { background: var(--blue-600); color: #fff; }
.analysis-loader { padding: 22px; text-align: center; }
.analysis-loader > i { position: relative; display: block; width: 58px; height: 58px; margin: 0 auto 14px; border: 3px solid #dbe5f2; border-top-color: var(--blue-600); border-radius: 50%; animation: spin .9s linear infinite; }
.analysis-loader strong { font-size: 12px; }
.analysis-loader p { margin: 7px 0 0; color: var(--muted); font-size: 9px; }
.analysis-progress { height: 4px; margin: 17px 0 8px; overflow: hidden; background: #e7ebf1; }
.analysis-progress b { display: block; width: 32%; height: 100%; background: var(--blue-600); animation: progressMove 1.2s ease-in-out infinite; }
.analysis-results { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; margin-top: 13px; }
.analysis-results article { padding: 13px; background: var(--soft); border: 1px solid var(--line); }
.analysis-results strong, .analysis-results small { display: block; }
.analysis-results strong { color: var(--blue-700); font-size: 18px; }
.analysis-results small { margin-top: 5px; color: var(--muted); font-size: 8px; }
.search-modal { position: relative; }
.search-modal input { width: 100%; height: 45px; padding: 0 13px 0 42px; border: 1px solid var(--line-dark); outline: 0; font-size: 11px; }
.search-modal > svg { position: absolute; top: 13px; left: 14px; color: var(--muted); }
.search-results { display: grid; gap: 7px; margin-top: 11px; }
.search-results button { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 47px; padding: 0 12px; background: var(--soft); border: 1px solid var(--line); color: var(--text); font-size: 9px; text-align: left; }
.search-results button span small { display: block; margin-top: 3px; color: var(--subtle); }

.toast { position: fixed; z-index: 120; right: 24px; bottom: 24px; display: flex; min-width: 280px; max-width: calc(100% - 32px); align-items: center; gap: 9px; padding: 13px 15px; background: var(--navy-900); color: #fff; box-shadow: var(--shadow-md); font-size: 10px; transform: translateY(130%); opacity: 0; transition: transform .3s var(--ease), opacity .3s; }
.toast.show { transform: translateY(0); opacity: 1; }
.toast svg { color: #8dd8b0; }

@keyframes pageEnter { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: none; } }
@keyframes modalEnter { from { opacity: 0; transform: translateY(12px) scale(.985); } to { opacity: 1; transform: none; } }
@keyframes pulse { 50% { opacity: .45; transform: scale(.82); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes progressMove { from { transform: translateX(-105%); } to { transform: translateX(315%); } }

@media (max-width: 1180px) {
  .app-shell { grid-template-columns: 218px minmax(0, 1fr); }
  .sidebar { width: 218px; }
  .search-button { min-width: 210px; }
  .project-card-grid { grid-template-columns: repeat(2, minmax(270px, 1fr)); }
  .editor-view { grid-template-columns: 220px minmax(440px, 1fr) 280px; }
  .document-page { padding-inline: 54px; }
}

@media (max-width: 960px) {
  .app-shell { display: block; }
  .sidebar { width: 248px; transform: translateX(-102%); transition: transform .3s var(--ease); }
  .sidebar.open { transform: translateX(0); box-shadow: 20px 0 60px rgba(0, 0, 0, .25); }
  .main-shell { min-width: 0; }
  .mobile-menu { display: inline-grid; }
  .topbar { padding-inline: 18px; }
  .search-button { min-width: 38px; width: 38px; justify-content: center; padding: 0; }
  .search-button span, .search-button kbd, .help-button span { display: none; }
  .content-area { padding: 22px 18px; }
  .workspace-page { margin: -22px -18px; }
  .dashboard-grid, .lower-grid, .overview-grid, .second-row, .export-layout, .compliance-layout { grid-template-columns: 1fr; }
  .editor-view { height: auto; min-height: 0; grid-template-columns: 220px minmax(480px, 1fr); overflow-x: auto; }
  .ai-panel { position: fixed; z-index: 60; top: 66px; right: 0; bottom: 0; width: 310px; box-shadow: -18px 0 50px rgba(16, 24, 40, .18); transform: translateX(105%); transition: transform .3s var(--ease); }
  .ai-panel.open { transform: translateX(0); }
  .tablet-ai-button { display: inline-grid; }
  .workspace-actions .autosave { display: none; }
  .evidence-layout { grid-template-columns: 185px minmax(520px, 1fr); overflow-x: auto; }
}

@media (max-width: 680px) {
  .topbar { height: 58px; padding-inline: 12px; }
  .breadcrumb span, .help-button { display: none; }
  .content-area { padding: 17px 12px 24px; }
  .page-heading, .workspace-head, .module-heading { align-items: flex-start; flex-direction: column; }
  .page-heading h1, .module-heading h2 { font-size: 22px; }
  .primary-button { width: 100%; }
  .metric-strip { grid-template-columns: 1fr 1fr; }
  .metric-strip article:nth-child(3) { border-left: 0; border-top: 1px solid var(--line); }
  .metric-strip article:nth-child(4) { border-top: 1px solid var(--line); }
  .dashboard-grid { gap: 12px; }
  .panel-header { padding-inline: 14px; }
  .project-card-grid { grid-template-columns: 1fr; }
  .toolbar, .matrix-toolbar, .matrix-toolbar > div:last-child { align-items: stretch; flex-direction: column; }
  .toolbar > label, .matrix-toolbar label { width: 100%; min-width: 0; }
  .segmented { width: 100%; overflow-x: auto; }
  .segmented button { flex: 1; white-space: nowrap; }
  .prototype-banner { align-items: flex-start; flex-direction: column; }
  .workspace-page { margin: -17px -12px -24px; }
  .workspace-head { padding: 16px; }
  .workspace-actions { width: 100%; }
  .workspace-actions .secondary-button { flex: 1; }
  .workspace-actions .primary-button { flex: 1.4; }
  .workspace-tabs { top: 58px; padding-inline: 9px; }
  .workspace-view { padding: 16px 12px 24px; }
  .readiness-content { grid-template-columns: 1fr; justify-items: center; text-align: center; }
  .readiness-content ul { text-align: left; }
  .tender-summary dl { grid-template-columns: 1fr 1fr; }
  .tender-summary dl > div:nth-child(3n) { border-right: 1px solid var(--line); }
  .tender-summary dl > div:nth-child(2n) { border-right: 0; }
  .tender-summary dl > div:nth-last-child(-n+3) { border-bottom: 1px solid var(--line); }
  .tender-summary dl > div:nth-last-child(-n+2) { border-bottom: 0; }
  .score-legend { flex-wrap: wrap; }
  .workflow-panel ol { min-width: 720px; }
  .workflow-panel { overflow-x: auto; }
  .matrix-summary { overflow-x: auto; }
  .matrix-summary span { min-width: max-content; }
  .editor-view, .editor-view.active { display: block; min-height: calc(100vh - 108px); overflow: visible; background: #e9edf2; }
  .mobile-editor-tabs { position: sticky; z-index: 19; top: 108px; display: grid; grid-template-columns: repeat(3, 1fr); min-height: 44px; background: #fff; border-bottom: 1px solid var(--line); }
  .mobile-editor-tabs button { position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 6px; background: transparent; color: var(--muted); font-size: 10px; font-weight: 800; }
  .mobile-editor-tabs button::after { content: ""; position: absolute; right: 22px; bottom: 0; left: 22px; height: 2px; background: transparent; }
  .mobile-editor-tabs button.active { color: var(--blue-700); }
  .mobile-editor-tabs button.active::after { background: var(--blue-600); }
  .mobile-editor-tabs svg { width: 15px; height: 15px; }
  .tablet-ai-button { display: none; }
  .editor-view .outline-panel, .editor-view .document-editor, .editor-view .ai-panel { display: none; }
  .editor-view.mobile-editor-outline .outline-panel { display: flex; min-height: calc(100vh - 152px); }
  .editor-view.mobile-editor-document .document-editor { display: flex; min-height: calc(100vh - 152px); }
  .editor-view.mobile-editor-ai .ai-panel { position: static; display: flex; width: 100%; min-height: calc(100vh - 152px); box-shadow: none; transform: none; }
  .editor-toolbar { position: sticky; z-index: 18; top: 152px; width: 100%; overflow-x: auto; }
  .editor-history, .editor-format, .editor-meta { flex: 0 0 auto; }
  .document-canvas-wrap { padding: 10px; }
  .document-page { width: 100%; min-height: 920px; padding: 62px 28px 76px; }
  .document-page > header, .document-page > footer { right: 28px; left: 28px; }
  .evidence-stats { grid-template-columns: 1fr 1fr; }
  .evidence-layout { grid-template-columns: minmax(720px, 1fr); }
  .evidence-categories { display: flex; overflow-x: auto; }
  .evidence-categories button { min-width: max-content; }
  .compliance-overview { grid-template-columns: 1fr; }
  .compliance-bars { grid-template-columns: 1fr; }
  .compliance-list > header { align-items: flex-start; flex-direction: column; padding-block: 12px; }
  .compliance-list > article { grid-template-columns: 58px 1fr; }
  .compliance-list article > button { grid-column: 2; width: fit-content; }
  .format-options { grid-template-columns: 1fr; }
  .modal-layer { padding: 0; align-items: end; }
  .modal { width: 100%; max-height: 91vh; }
  .modal-form-row, .analysis-results { grid-template-columns: 1fr; }
  .toast { right: 16px; bottom: 16px; left: 16px; min-width: 0; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
