/* Patent reply workspace — comparison theme */
:root {
  color-scheme: light;
  --canvas: #f2f5f9;
  --surface: #fff;
  --surface-2: #f7f9fc;
  --text: #172b45;
  --muted: #5d6e83;
  --line: #ccd6e3;
  --line-soft: #e4eaf2;
  --accent: #245bcc;
  --accent-soft: #ecf2ff;
  --ok: #187459;
  --ok-soft: #edf7f2;
  --warn: #8b570a;
  --warn-soft: #fff8e9;
  --danger: #b33838;
  --danger-soft: #fff1f0;
  --radius-s: 7px;
  --radius-m: 11px;
  --radius-l: 16px;
  --shadow-1: 0 2px 8px #22345105;
  --shadow-2: 0 14px 42px #1d36541c;
  --font: "Segoe UI", "Microsoft YaHei", "PingFang SC", sans-serif;
  --sidebar: #142a45;
  --sidebar-muted: #b8c7db;
}
body {font: 14px/1.65 var(--font); background: var(--canvas);}
button, select, input {min-height: 38px;}
button {font-weight: 500; transition: background 150ms, border-color 150ms;}
button:hover:not(:disabled) {background: var(--accent-soft);}
button.primary {background: var(--accent); border-color: var(--accent); box-shadow: 0 3px 8px #245bcc16;}
button.primary:hover:not(:disabled) {background: #194bb3;}
button.link {min-height: 32px;}
button:focus-visible, a:focus-visible, summary:focus-visible, .case-card:focus-visible {
  outline: 3px solid #5387e5; outline-offset: 3px;
}
input, textarea, select {padding: 9px 11px; background: #fff;}
textarea {line-height: 1.7;}
input[type=file] {padding: 10px; font-size: 13px; border: 1px dashed #b5c8e5; background: #f7faff; cursor: pointer;}
input[type=file]::file-selector-button {
  margin-right: 10px; border: 1px solid #c7d6ed; border-radius: 6px;
  padding: 7px 10px; background: #fff; color: #214f9e; font: inherit; cursor: pointer;
}
h1,h2,h3 {letter-spacing: -.02em;}
a {text-underline-offset: 4px;}
[hidden] {display: none !important;}
.skip-link {position: fixed; top: -60px; left: 16px; z-index: 100; padding: 9px 16px; background: white;}
.skip-link:focus {top: 8px;}
#work-view {height: 100dvh; display: grid; grid-template-columns: 248px minmax(0,1fr); grid-template-rows: 62px auto minmax(0,1fr);}
.workspace {display: contents;}
#topbar {grid-column: 2; grid-row: 1; padding: 0 28px; gap: 18px; background: #fff; backdrop-filter: none;}
.top-location {display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--muted);}
.top-location b {font-weight: 600; color: var(--text);}
.top-divider {color: #aab7c8;}
.top-link {font-size: 13px; text-decoration: none; white-space: nowrap;}
.compare-link {padding: 5px 11px; border: 1px solid var(--line); border-radius: 6px; color: var(--text);}
#who {max-width: 180px; overflow-wrap: anywhere;}
#banner {grid-column: 2; grid-row: 2; margin: 0; border-radius: 0;}
.sidebar {grid-column: 1; grid-row: 1 / -1; width: auto; flex-basis: auto; border: 0; background: var(--sidebar); color: #f6f8fc;}
.sidebar-brand {display: flex; gap: 12px; align-items: center; padding: 25px 22px 24px;}
.brand-mark {display: grid; place-items: center; width: 38px; height: 42px; color: #99bbff;}
.brand-mark svg {width: 34px; height: 36px;}
.sidebar-brand strong {display: block; font-size: 20px; font-weight: 650; letter-spacing: 1px;}
.sidebar-brand small {display: block; margin-top: 1px; font-size: 11px; letter-spacing: 2px; color: var(--sidebar-muted);}
.sidebar-head {padding: 0 16px 16px; border-color: #ffffff15; gap: 14px;}
.sidebar-head .row {gap: 7px;}
#btn-new {min-height: 42px; background: #3973df; border-color: #3973df;}
#btn-refresh {padding: 6px 10px; background: #ffffff08; color: #cbd8e9; border-color: #ffffff20;}
#case-search {background: #0d223b; border-color: #ffffff20; color: #fff; font-size: 13px;}
#case-search::placeholder {color: #a7b8d1;}
.sidebar-section {display: flex; justify-content: space-between; padding: 0 2px; color: var(--sidebar-muted); font-size: 12px;}
#case-filters {gap: 5px;}
#case-filters .chip {min-height: 30px; padding: 3px 9px; font-size: 12px; border-radius: 5px; color: #c5d2e5; background: transparent; border-color: transparent;}
#case-filters .chip.is-active {background: #ffffff18; color: white;}
#case-filters .chip:hover {background: #ffffff10;}
.case-list {padding: 12px 10px;}
.case-card {border-radius: 8px; padding: 13px 13px 14px; margin-bottom: 6px;}
.case-card:hover {background: #ffffff08;}
.case-card.is-selected {background: #243e61; border-color: #5a83c1; box-shadow: inset 3px 0 #83aaff;}
.case-id {font-size: 11px; color: #acc2e4; letter-spacing: .06em;}
.case-title {font-size: 13px; font-weight: 500; color: #f2f6ff; margin: 6px 0 10px; line-height: 1.7; -webkit-line-clamp: 3;}
.case-meta {font-size: 12px;}
.sidebar .case-meta {color: #c0cee0;}
.sidebar .tag {background: #ffffff08; color: #d8e4f4; border-color: #8fa7c155;}
.sidebar .tag.ok {color: #afe8d0; background: #20624b42; border-color: #4d9c7b55;}
.sidebar .tag.warn {color: #ffdb9a; background: #9a68272a; border-color: #b8935c66;}
.sidebar .tag.err {color: #ffc9c6; background: #922f3b33; border-color: #b8747a66;}
.sidebar .tag.info {color: #c6dcff; background: #3763a344;}
.sidebar .hint {padding: 12px; color: #b8c8dd; line-height: 1.8;}
.sidebar-footer {padding: 16px 22px; border-top: 1px solid #ffffff15; color: #b8c7db; font-size: 12px;}
.main {grid-column: 2; grid-row: 3; overflow: hidden;}
.info-bar {display: block; padding: 24px 28px 18px; background: transparent; border: 0;}
.case-heading {display: flex; align-items: flex-start; justify-content: space-between; gap: 16px;}
.case-kicker {display: block; color: var(--muted); font-size: 12px; margin-bottom: 6px;}
#design-title {font-size: clamp(20px,1.6vw,27px); font-weight: 650; line-height: 1.5; max-width: 1100px; overflow-wrap: anywhere;}
#goal-badge {background: #fff; border: 1px solid #cdd8eb; padding: 5px 10px; color: #345991; border-radius: 6px; font-size: 12px; flex: none; margin-top: 8px;}
#info-empty {padding: 8px 0 0; font-size: 13px; max-width: 850px;}
#info-fields {gap: 5px 22px !important; margin-top: 12px;}
.info-item {display: flex; flex-direction: row; gap: 6px; min-width: 0; max-width: none;}
.info-item:nth-child(1), .info-item:nth-child(2) {display: none;}
.info-label, .info-value {font-size: 12px; line-height: 1.6;}
.info-label {color: var(--muted);}
.info-value {max-width: 300px; font-weight: 500; white-space: normal; overflow-wrap: anywhere;}
.stage-rail {padding: 0 28px 18px; flex: none;}
.timeline {display: grid; grid-template-columns: repeat(6,minmax(0,1fr)); gap: 0; margin: 0; background: #fff; border: 1px solid var(--line-soft); border-radius: 10px; padding: 14px 8px; counter-reset: step; box-shadow: var(--shadow-1);}
.timeline li {counter-increment: step; position: relative; display: grid; grid-template-columns: 28px minmax(0,1fr); column-gap: 9px; row-gap: 0; padding: 0 13px; border-radius: 0; border-right: 1px solid var(--line-soft);}
.timeline li:last-child {border-right: 0;}
.timeline .tl-dot {display: grid; place-items: center; width: 28px; height: 28px; grid-row: 1 / 3; align-self: center; border: 1px solid #d1dae6; background: #f7f9fc; border-radius: 8px;}
.timeline .tl-dot:before {content: counter(step,decimal-leading-zero); color: #697d98; font: 12px/1 var(--mono);}
.timeline .tl-name {font-size: 12px; font-weight: 550; white-space: nowrap;}
.timeline .tl-state {font-size: 11px; margin: 0;}
.timeline li.tl-done .tl-dot {background: var(--ok-soft); border-color: #c6e3d8;}
.timeline li.tl-done .tl-dot:before {content: "✓"; color: var(--ok); font: 16px/1 var(--font);}
.timeline li.tl-running .tl-dot {background: var(--accent); border-color: var(--accent); box-shadow: 0 0 0 3px #245bcc12;}
.timeline li.tl-running .tl-dot:before {color: white;}
.timeline li.tl-waiting_human .tl-dot {background: var(--warn-soft); border-color: #d9b879;}
.timeline li.tl-waiting_human .tl-dot:before {content: "!"; color: var(--warn);}
.timeline li.tl-failed .tl-dot, .timeline li.tl-gate_failed .tl-dot {background: var(--danger-soft); border-color: #e4b0ac;}
.timeline li.tl-failed .tl-dot:before, .timeline li.tl-gate_failed .tl-dot:before {content: "!"; color: var(--danger);}
.work {gap: 20px; padding: 0 28px 24px;}
.review-col, .action-col {box-shadow: var(--shadow-1); border-radius: 10px;}
.review-col {flex: 1 1 auto;}
.action-col {width: 346px; flex: 0 0 346px;}
#review-tabs {padding: 0 18px; gap: 15px; min-height: 53px; align-items: stretch;}
.tab {font-size: 13px; padding: 13px 3px; min-height: 44px;}
.tab:hover:not(:disabled) {background: transparent;}
.tab-body {padding: 22px 24px; scrollbar-gutter: stable;}
.action-head {padding: 15px 18px; min-height: 54px; background: white;}
.action-title {font-size: 15px; font-weight: 650;}
.action-body {padding: 16px 18px; scrollbar-gutter: stable;}
.kv-grid {gap: 10px; grid-template-columns: repeat(auto-fit,minmax(160px,1fr));}
.kv {padding: 10px 12px; background: #fafbfd;}
.kv b {font-size: 12px; margin-bottom: 3px;}
.kv span {font-size: 13px; line-height: 1.7;}
.sec-title {font-size: 14px; margin: 22px 0 12px; padding-bottom: 9px; color: #27415e;}
.issue {margin-bottom: 14px; border-radius: 8px;}
.issue-head {padding: 12px 14px; background: #f7f9fc;}
.issue-no {border-radius: 5px; background: #e7eefb; color: #2857a6; font-size: 12px; padding: 2px 8px;}
.issue-body {padding: 16px; font-size: 14px; line-height: 1.9;}
.tag {padding: 2px 8px; font-size: 12px; border-radius: 5px; white-space: normal;}
.quote-block {padding: 10px 14px; margin: 12px 0; border-left: 3px solid #b0c3df; font-size: 13px; line-height: 1.85;}
.reason-list {font-size: 13px; line-height: 1.8;}
.issue-sub, .anchor-table, .map-table {font-size: 12px;}
.anchor-table td,.anchor-table th,.map-table td,.map-table th {padding: 9px 8px; overflow-wrap: anywhere;}
#pane-analysis, #pane-oa, #pane-amendment {overflow-wrap: anywhere;}
pre,pre.doc {font: 13px/1.9 var(--font); padding: 15px; max-height: 580px;}
.empty-state .big {display: none;}
.empty-state {min-height: 270px; text-align: left; align-items: flex-start; padding: 25px 16px;}
.empty-state > div:nth-child(2) {font-size: 18px; font-weight: 600; color: var(--text);}
.empty-state ol {font-size: 13px; line-height: 1.9;}
.design-metrics {display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); margin-bottom: 22px; gap: 12px;}
.design-metric {padding: 14px 15px; border: 1px solid var(--line-soft); border-radius: 8px; background: #fafcfe;}
.design-metric span {display: block; color: var(--muted); font-size: 12px;}
.design-metric strong {display: block; font-size: 28px; line-height: 1.5; font-variant-numeric: tabular-nums; font-weight: 600; margin-top: 4px;}
.design-metric small {font-size: 12px; margin-left: 5px; color: var(--muted); font-weight: 400;}
.design-notice {padding: 15px 17px; background: #fffaed; border: 1px solid #e9d5a7; border-radius: 8px; margin: 0 0 20px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px;}
.design-notice p {font-size: 13px; margin: 3px 0 0; color: #79541c;}
.design-notice strong {color: #745015; font-size: 14px;}
.design-notice button {background: white; border-color: #d5b875; color: #73501c;}
.design-intro {padding: 8px 4px 20px;}
.design-intro h2 {font-size: 25px; margin: 16px 0 10px; line-height: 1.5;}
.design-intro p {font-size: 14px; color: var(--muted); line-height: 1.85; max-width: 510px;}
.design-document-icon {width: 52px; height: 60px; color: #3b68af; margin-bottom: 18px;}
.design-checklist {display: grid; gap: 14px; margin-top: 30px;}
.design-checklist > div {display: flex; align-items: flex-start; gap: 13px; padding: 15px; border: 1px solid var(--line-soft); border-radius: 9px; background: #fafcff;}
.design-checklist svg {width: 23px; height: 23px; color: #6384b1; flex: none; margin-top: 2px;}
.design-checklist b {font-size: 14px; font-weight: 600;}
.design-checklist p {font-size: 13px; margin: 4px 0 0;}
.design-checklist small {display: block; margin-top: 3px; color: var(--muted);}
.is-new-case .action-col {width: 520px; flex-basis: 520px;}
.is-new-case .tab-body {padding: 28px;}
#form-panel label,#gate-panel label {font-size: 13px; margin-top: 12px;}
#form-panel label > span {margin-bottom: 7px;}
#form-panel input,#form-panel select {font-size: 13px;}
.fold {background: white; border-radius: 8px; padding: 12px; margin: 12px 0; border: 1px solid #dce5f1;}
.fold > summary {font-size: 13px; font-weight: 600; color: #2e4667; padding: 1px 0;}
.text-entry {margin-top: 9px;}
.text-entry > summary {font-size: 12px; color: var(--muted); font-weight: 400;}
.text-entry textarea {margin-top: 8px;}
.upload-filenames {font-size: 12px; color: var(--ok); margin: 7px 0 0; overflow-wrap: anywhere; line-height: 1.7;}
.upload-filenames:empty {display: none;}
#form-panel .actions {position: sticky; bottom: -16px; background: white; padding: 14px 0 16px; border-top: 1px solid var(--line-soft); margin: 16px 0 -8px; z-index: 2;}
#run-btn,#resume-btn {flex: 1; min-height: 44px; font-size: 14px;}
#settings-box {background: #f8fafc;}
.hint {font-size: 12px; line-height: 1.8;}
#gate-panel {padding: 15px; border-color: #dfbd7b; background: #fffdf7;}
#gate-panel h2 {font-size: 16px; line-height: 1.6;}
.gate-sec {font-size: 13px; line-height: 1.85;}
.adj-item {padding: 12px;}
.adj-opt {padding: 5px 0; font-size: 13px;}
#status-line {font-size: 15px; line-height: 1.65;}
#progress-note, #progress-elapsed {margin: 8px 0;}
#progress-elapsed {font-variant-numeric: tabular-nums;}
.progress-track {height: 6px; margin: 14px 0 10px;}
.c-job-brief:not([hidden]) {background: #f7f9fd; border: 1px solid #e0e8f3; border-left: 3px solid #547dc6; margin: 14px 0; padding: 13px; gap: 12px;}
.c-job-brief > div {grid-template-columns: 1fr; gap: 4px; font-size: 13px; line-height: 1.8;}
.c-job-brief b {color: #48648b; font-size: 12px;}
#result-brief {display: none !important;}
#result-panel h2 {font-size: 21px; margin-bottom: 14px;}
#downloads {margin: 0 0 22px; padding: 14px; background: #f0f5fd; border: 1px solid #d5e1f3; border-radius: 8px;}
#downloads a, #downloads button {font-size: 13px; padding: 9px 12px; background: white; border-radius: 6px; border: 1px solid #cbd9ee; text-decoration: none; display: inline-flex; align-items: center;}
#downloads a:hover, #downloads button:hover {background: #e6efff;}
.summary {margin-bottom: 20px;}
.summary div {padding: 12px; font-size: 13px; line-height: 1.8;}
.summary b {font-size: 12px; margin-bottom: 4px;}
.warn-item {padding: 15px; margin: 10px 0; font-size: 13px; line-height: 1.9; overflow-wrap: anywhere;}
.warn-item.warn {border: 1px solid #e8d2a7; background: #fffaf1;}
.warn-item.info {background: #f2f7fa; color: #38566b; border: 1px solid #d7e4eb;}
.warn-item textarea {display: block; width: 100%; min-height: 100px; margin: 12px 0; background: #fff;}
.warn-item details {margin: 10px 0 0; background: #ffffff88; border-radius: 5px; padding: 7px 10px;}
.warn-item details[open] {background: #fff; border: 1px solid var(--line-soft);}
.warn-item details > div {margin: 10px 0; padding-top: 10px; border-top: 1px solid var(--line-soft);}
details > summary {font-size: 13px; min-height: 25px; color: #3e5d85;}
.verified-section {margin-top: 20px; padding: 12px; border: 1px solid var(--line-soft); border-radius: 8px;}
.verified-section > summary {color: #406b5b; font-weight: 600;}
.design-result-task {padding: 14px; margin: 0 0 16px; border: 1px solid #e2ceaa; background: #fffbf3; border-radius: 8px;}
.design-result-task strong {display: block; font-size: 14px; color: #78501b;}
.design-result-task p {font-size: 13px; line-height: 1.8; color: #775b34;}
.design-result-task button {width: 100%; background: white;}
.info-details {margin: 4px 0 20px; border-bottom: 1px solid var(--line-soft); padding-bottom: 10px;}
#setup-view,#login-view {position: relative; width: min(440px,calc(100% - 40px)); max-width: 440px; margin: 10vh max(30px,calc((100vw - 1040px)/2)); padding: 34px; box-shadow: 0 15px 60px #1d365414; border: 1px solid var(--line-soft); border-radius: 14px; background: white;}
#setup-view h1,#login-view h1 {font-size: 22px; line-height: 1.5; margin-bottom: 25px;}
#setup-view label,#login-view label {font-size: 13px; margin-bottom: 6px; display: block;}
#setup-view input,#login-view input {width: 100%; min-height: 43px;}
#setup-view button,#login-view button {min-height: 44px; margin-top: 8px;}
.auth-visual {position: fixed; left: calc(50% + 20px); top: 17%; right: max(40px,calc((100vw - 1040px)/2)); padding: 30px; color: var(--text);}
.auth-visual .brand-mark {margin-bottom: 26px; color: #245bcc;}
.auth-visual h2 {font-size: 32px; line-height: 1.6; margin-bottom: 18px;}
.auth-visual p {font-size: 14px; color: var(--muted); line-height: 1.9; max-width: 330px;}
.auth-steps {display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 30px; max-width: 350px;}
.auth-steps span {font-size: 13px; padding: 12px; background: #ffffffa6; border: 1px solid var(--line-soft); border-radius: 8px;}
body:has(#work-view:not([hidden])) .auth-visual {display: none;}
#toast {top: 76px;}
@media(min-width:1800px) {
  .action-col {width: 400px; flex-basis: 400px;}
  .tab-body {padding: 26px 32px;}
  .work {gap: 24px;}
}
@media(max-width:1250px) {
  #work-view {grid-template-columns: 220px minmax(0,1fr);}
  .sidebar-brand {padding: 24px 18px;}
  .work {padding: 0 20px 20px; gap: 14px;}
  .stage-rail {padding: 0 20px 16px;}
  .info-bar {padding: 20px;}
  .action-col,.is-new-case .action-col {width: 320px; flex-basis: 320px;}
  .timeline li {grid-template-columns: 22px minmax(0,1fr); gap: 5px; padding: 0 7px;}
  .timeline .tl-dot {width: 22px; height: 24px;}
  .timeline .tl-name {font-size: 11px;}
  .tab-body {padding: 18px;}
  .top-location {display: none;}
  #topbar {padding: 0 20px; gap: 12px;}
}
@media(max-width:1030px) {
  #work-view {height: auto; min-height: 100dvh; grid-template-columns: 220px minmax(0,1fr);}
  .sidebar {height: 100dvh; position: sticky; top: 0; align-self: start; max-height: none;}
  .main {overflow: visible;}
  .work {flex-direction: column; overflow: visible;}
  .action-col,.is-new-case .action-col {width: 100%; flex: none; order: -1;}
  .action-body,.tab-body {overflow: visible;}
  .review-col {min-height: 300px; flex: none;}
  .is-new-case .action-col {order: 0;}
  .timeline {grid-template-columns: repeat(3,minmax(0,1fr)); gap: 15px 0; padding: 14px 4px;}
  .timeline li:nth-child(3) {border: 0;}
  .timeline .tl-name {font-size: 12px;}
  .auth-visual {display: none;}
  #setup-view,#login-view {margin: 8vh auto;}
}
@media(max-width:720px) {
  #work-view {display: flex; height: auto; overflow: visible;}
  #topbar {order: -2; min-height: 58px; position: static; flex-wrap: wrap; padding: 8px 16px; gap: 10px;}
  #who {display: none;}
  #banner {order: -1;}
  .sidebar {position: static; height: auto; max-height: 340px; width: 100%; flex: none;}
  .sidebar-brand {padding: 14px 18px;}
  .sidebar-brand small,.sidebar-footer,.sidebar-section {display: none;}
  .sidebar-brand strong {font-size: 18px;}
  .sidebar-head {gap: 9px; padding-bottom: 10px;}
  .case-list {max-height: 128px; padding: 5px 10px;}
  .case-card {padding: 9px 12px; margin-bottom: 4px;}
  .case-title {-webkit-line-clamp: 1; margin: 2px 0 5px;}
  .info-bar {padding: 20px 16px 16px;}
  #design-title {font-size: 20px;}
  .case-heading {display: block;}
  #goal-badge {display: inline-block; margin-top: 10px;}
  .work {padding: 0 12px 20px; gap: 16px;}
  .stage-rail {padding: 0 12px 16px;}
  .tab-body,.is-new-case .tab-body {padding: 18px 16px;}
  #review-tabs {padding: 0 15px; gap: 16px;}
  .info-value {max-width: 230px;}
  .design-metrics {gap: 7px;}
  .design-metric {padding: 10px;}
  .design-metric strong {font-size: 23px;}
  .design-intro h2 {font-size: 22px;}
  .design-checklist {margin-top: 20px;}
  .row2 {flex-wrap: wrap;}
  .row2 > label {min-width: 150px;}
  input,textarea,select {font-size: 16px !important;}
  button {min-height: 42px;}
  .chip {min-height: 34px !important;}
  .top-link {min-height: 36px; display: inline-flex; align-items: center;}
}
@media(prefers-reduced-motion:reduce) {
  *,*::before,*::after {animation: none !important; transition: none !important; scroll-behavior: auto !important;}
}

.review-section, .design-result-details {margin-top:16px; padding:12px; border:1px solid var(--line-soft); border-radius:8px;}
.review-section > summary {color:var(--warn); font-weight:600;}
.design-result-details > summary {font-weight:600;}
.design-result-details #audit-scope-box {margin-bottom:0;}
.design-result-details #audit-scope-box h3 {display:none;}

/* Visual reference: public CNIPA service portals. */
:root {
  --accent: #3664d1;
  --accent-soft: #eff3fc;
  --text: #25354c;
  --muted: #606e82;
  --line: #cbd5e3;
  --line-soft: #e1e7f0;
  --canvas: #f3f5f9;
  --radius-s: 4px;
  --radius-m: 6px;
  --shadow-1: none;
}
#work-view {grid-template-rows: 84px auto minmax(0,1fr);}
#topbar {grid-column: 1 / -1; background: #3664d1; color: white; padding: 0 25px; min-height: 84px; border: 0; gap: 25px;}
#topbar .sidebar-brand {padding: 0 30px 0 0; gap: 14px; border-right: 1px solid #ffffff30; flex: none;}
#topbar .sidebar-brand strong {font-size: 24px; font-weight: 600; letter-spacing: 2px; color: white;}
#topbar .sidebar-brand small {font-size: 11px; color: #e2eaff; letter-spacing: 2px;}
#topbar .brand-mark {color: #fff; width: 34px;}
.portal-nav {display: flex; gap: 12px; align-items: center; font-size: 15px;}
.portal-nav a {color: #f4f7ff; text-decoration: none; padding: 10px 14px;}
.portal-nav .current {color: white; background: #ffffff1c; border-bottom: 2px solid white; padding: 10px 14px;}
#topbar .top-link, #topbar #who, #topbar #logout-btn {color: #fff;}
#topbar .compare-link {border-color: #b8caf6; background: #ffffff08;}
#topbar #logout-btn:hover {background: #ffffff16;}
#topbar #who {font-size: 12px;}
#banner {grid-column: 1 / -1;}
.sidebar {grid-row: 3; background: #fff; color: var(--text); border-right: 1px solid var(--line-soft);}
.sidebar-head {padding: 22px 16px 17px; border-color: var(--line-soft);}
#btn-new {background: #3664d1; border-color: #3664d1; border-radius: 4px; box-shadow: none;}
#btn-refresh {color: #4c6082; background: #fff; border-color: #ccd7e7;}
#case-search {background: #f8fafd; border-color: #d6deea; color: var(--text);}
#case-search::placeholder {color: #65778e;}
.sidebar-section {color: #5c6e87;}
.sidebar-section span:first-child {color: #344b69; font-weight: 600;}
#case-filters .chip {color: #52647d; border-radius: 3px;}
#case-filters .chip.is-active {background: #eaf0fc; color: #2f5cbd;}
#case-filters .chip:hover {background: #f0f4fc;}
.case-card {border-radius: 5px; border: 1px solid #e4eaf2; margin-bottom: 10px;}
.case-card:hover {background: #f6f9fe; border-color: #b9ccec;}
.case-card.is-selected {background: #f0f5ff; border-color: #a9c0ee; box-shadow: inset 3px 0 #3664d1;}
.case-id {color: #526f99;}
.case-title {color: #263c5a; font-weight: 600;}
.sidebar .case-meta {color: #61738d;}
.sidebar .tag {color: #536781; background: #f5f7fa; border-color: #ccd7e4;}
.sidebar .tag.ok {color: #237153; background: #edf7f1; border-color: #c4decf;}
.sidebar .tag.warn {color: #8b5b10; background: #fff8e9; border-color: #e9d2a2;}
.sidebar .tag.err {color: #b13732; background: #fff2f1; border-color: #edc4c0;}
.sidebar .tag.info {color: #2e5dc2; background: #edf2ff; border-color: #c5d5f3;}
.sidebar .hint {color: #65768a;}
.sidebar-footer {color: #69798e; border-color: var(--line-soft); font-size: 11px; padding: 15px 18px;}
.info-bar {padding-top: 23px;}
#design-title {font-size: clamp(20px,1.55vw,25px); color: #243953;}
#goal-badge {background: #edf2fc; border-color: #d1def6; border-radius: 3px;}
.timeline, .review-col, .action-col {border-radius: 5px;}
.timeline .tl-dot {border-radius: 50%;}
.tab {border-radius: 0; font-size: 14px;}
#review-tabs {gap: 22px; background: #fbfcff;}
.action-head {background: #f7f9fd; border-bottom: 1px solid #dce4f1;}
.action-title {color: #2c4c7c;}
.sec-title {position: relative; padding-left: 10px; border-bottom-color: #e2e9f4;}
.sec-title:before {content:""; position:absolute; left:0; top:3px; height:15px; width:3px; background:#3664d1;}
.design-metric {border-radius:4px; background:#f7faff; border-color:#dbe5f5; padding:16px;}
.design-metric strong {color:#315da7;}
.design-metric span {color:#526b8e;}
.kv, .issue, .fold, .summary div, .warn-item {border-radius:4px;}
.design-result-task, .design-notice {border-radius:4px; box-shadow:none;}
#downloads {border-radius:4px; background:#f4f7fd;}
#downloads button {border-radius:4px;}
#result-panel h2 {font-size:20px; color:#273f60;}
#setup-view,#login-view {border-radius:6px; border-top:4px solid #3664d1;}
.auth-visual .brand-mark {color:#3664d1;}
.auth-visual h2 {color:#2a4776;}
@media(max-width:1250px) {
  #topbar {gap:14px; padding:0 20px;}
  #topbar .sidebar-brand {padding-right:18px;}
  #topbar .sidebar-brand strong {font-size:21px;}
  .portal-nav {font-size:13px; gap:3px;}
  .portal-nav a,.portal-nav .current {padding:10px;}
}
@media(max-width:1030px) {
  .sidebar {top:0;}
  #topbar #who {display:none;}
}
@media(max-width:720px) {
  #topbar {min-height:110px; gap:9px 14px; padding:12px 16px;}
  #topbar .sidebar-brand {border:0; width:100%; padding:0;}
  #topbar .sidebar-brand strong {font-size:21px;}
  #topbar .sidebar-brand small {display:block; font-size:10px;}
  #topbar .spacer {display:none;}
  .portal-nav {margin-right:auto;}
  .portal-nav a {padding:5px 8px 5px 0;}
  .portal-nav .current {padding:5px 8px;}
  #topbar .compare-link {padding:4px 8px; font-size:12px;}
  #topbar #logout-btn {font-size:12px;}
  .sidebar-head {padding:13px 16px 10px; gap:9px;}
  .sidebar-footer {display:none;}
  .sidebar {max-height:280px;}
  #design-title {font-size:20px;}
}

.skip-link:not(:focus) {clip-path:inset(50%);width:1px;height:1px;overflow:hidden;white-space:nowrap;}
.tab.is-active:hover:not(:disabled) {border-bottom-color:var(--accent);}
