:root {
  --page: #f1f3f2;
  --surface: #ffffff;
  --surface-2: #f7f8f7;
  --surface-3: #e9edeb;
  --text: #172023;
  --muted: #65706c;
  --line: #d5dbd8;
  --line-strong: #b4bdb9;
  --header: #202a2d;
  --header-2: #303c40;
  --red: #b23a3f;
  --red-soft: #f4e7e8;
  --teal: #1f746c;
  --teal-soft: #e3f0ed;
  --amber: #b07a22;
  --amber-soft: #f5eddf;
  --blue: #3f6597;
  --danger: #a72e33;
  --radius: 6px;
  --sidebar: 248px;
}

* { box-sizing: border-box; }
html, body { min-width: 320px; min-height: 100%; }
body { margin: 0; background: var(--page); color: var(--text); font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif; font-size:clamp(16px, 15px + .12vw, 18px); letter-spacing: 0; }
button, input, select { font: inherit; letter-spacing: 0; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, p { margin: 0; }
[hidden] { display: none !important; }
svg { width: 16px; height: 16px; stroke-width: 1.8; flex: 0 0 auto; }

.login-view { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: var(--header); }
.login-panel { width: min(390px, 100%); padding: 28px; background: var(--surface); border: 1px solid #414c50; border-radius: var(--radius); box-shadow: 0 18px 50px rgba(0, 0, 0, .24); }
.login-brand { display: flex; align-items: center; gap: 12px; padding-bottom: 22px; border-bottom: 1px solid var(--line); }
.login-brand > span, .app-brand > span { display: grid; place-items: center; color: #fff; background: var(--red); border-radius: 4px; font-weight: 700; }
.login-brand > span { width: 42px; height: 42px; }
.login-brand h1 { font-size:clamp(21px, 20px + .12vw, 23px); font-weight: 650; }
.login-brand p { margin-top: 3px; color: var(--muted); font-size:clamp(14px, 13px + .12vw, 16px); }
.login-form { display: grid; gap: 15px; margin-top: 22px; }
.login-form label, .form-stack label { display: grid; gap: 6px; color: #3d4845; font-size:clamp(14px, 13px + .12vw, 16px); font-weight: 600; }
input, select { width: 100%; min-height: 38px; padding: 0 10px; border: 1px solid var(--line); border-radius: 4px; outline: 0; background: var(--surface); color: var(--text); }
input:focus, select:focus { border-color: var(--teal); box-shadow: 0 0 0 2px rgba(31, 116, 108, .12); }
.form-error { min-height: 18px; color: var(--danger); font-size:clamp(14px, 13px + .12vw, 16px); }

.btn-primary, .btn-secondary, .btn-text, .icon-btn { border: 1px solid transparent; border-radius: 4px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; }
.btn-primary { min-height: 38px; padding: 0 15px; background: var(--red); color: #fff; font-weight: 650; }
.btn-primary:hover { background: #9d3035; }
.btn-primary:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary.block { width: 100%; }
.btn-secondary { min-height: 32px; padding: 0 12px; background: var(--surface-3); border-color: var(--line); color: var(--text); }
.btn-text { min-height: 30px; padding: 0 8px; background: transparent; color: var(--muted); }
.btn-text:hover { color: var(--text); background: var(--surface-3); }
.icon-btn { width: 34px; height: 34px; padding: 0; background: transparent; color: var(--muted); border-color: var(--line); }
.icon-btn:hover { color: var(--text); background: var(--surface-3); }
.icon-btn.small { width: 29px; height: 29px; }
.icon-btn.danger { color: var(--danger); }

.app-view { min-height: 100vh; }
.app-header { position: sticky; top: 0; z-index: 30; height: 62px; display: flex; align-items: center; gap: 14px; padding: 0 18px; background: var(--header); color: #f5f7f6; border-bottom: 1px solid #354246; }
.header-menu { display: none; color: #fff; border-color: #475559; }
.app-brand { display: flex; align-items: center; gap: 10px; min-width: 245px; }
.app-brand > span { width: 34px; height: 34px; font-size:clamp(14px, 13px + .12vw, 16px); }
.app-brand strong, .app-brand small { display: block; }
.app-brand strong { font-size:clamp(17px, 16px + .12vw, 19px); font-weight: 650; }
.app-brand small { margin-top: 2px; color: #b9c4c0; font-size:clamp(13px, 12px + .12vw, 15px); }
.species-switch { display: inline-flex; height: 34px; border: 1px solid #4a585c; border-radius: 4px; overflow: hidden; }
.species-switch button { min-width: 68px; border: 0; border-right: 1px solid #4a585c; background: transparent; color: #bdc7c3; }
.species-switch button:last-child { border-right: 0; }
.species-switch button.active { background: #f2f5f3; color: var(--header); font-weight: 650; }
.header-spacer { flex: 1; }
.account-button { min-width: 0; height: 38px; display: flex; align-items: center; gap: 8px; padding: 0 9px 0 5px; border: 0; border-radius: 4px; background: transparent; color: #f5f7f6; }
.account-button:hover { background: var(--header-2); }
.account-button > span:first-child { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; background: var(--amber); font-size:clamp(14px, 13px + .12vw, 16px); font-weight: 700; }
.account-menu { position: fixed; top: 54px; right: 16px; z-index: 45; width: 160px; padding: 5px; background: var(--surface); border: 1px solid var(--line); border-radius: 4px; box-shadow: 0 10px 28px rgba(20, 28, 30, .18); }
.account-menu button { width: 100%; min-height: 36px; display: flex; align-items: center; gap: 8px; border: 0; padding: 0 9px; background: transparent; color: var(--text); text-align: left; border-radius: 3px; }
.account-menu button:hover { background: var(--surface-3); }

.app-layout { display: grid; grid-template-columns: var(--sidebar) minmax(0, 1fr); min-height: calc(100vh - 62px); }
.sidebar { position: sticky; top: 62px; height: calc(100vh - 62px); overflow-y: auto; padding: 12px 9px 24px; background: #273236; color: #d8dfdc; border-right: 1px solid #354246; scrollbar-width: thin; }
.sidebar nav { display: grid; gap: 2px; }
.sidebar a, .sidebar summary { min-height: 36px; display: flex; align-items: center; gap: 9px; padding: 0 10px; border-radius: 4px; color: #c7d0cc; font-size:clamp(14px, 13px + .12vw, 16px); }
.sidebar a:hover, .sidebar summary:hover { background: #354246; color: #fff; }
.sidebar a.active { background: var(--red); color: #fff; }
.sidebar details > div { display: grid; gap: 2px; padding-left: 13px; }
.sidebar details details > div { padding-left: 10px; }
.sidebar summary { list-style: none; cursor: pointer; }
.sidebar summary::-webkit-details-marker { display: none; }
.sidebar summary span { min-width: 0; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar .nav-chevron { width: 13px; transition: transform .15s ease; }
.sidebar details[open] > summary .nav-chevron { transform: rotate(90deg); }
.sidebar .nav-label { margin: 17px 10px 6px; color: #84918c; font-size:clamp(12px, 11px + .12vw, 14px); font-weight: 700; text-transform: uppercase; }

.page-content { min-width: 0; padding: 18px; outline: none; }
.page-loading, .page-error { min-height: 280px; display: grid; place-items: center; color: var(--muted); }
.page-error { align-content: center; gap: 8px; }
.page-error svg { width: 26px; height: 26px; color: var(--danger); }
.page-heading { min-height: 48px; display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 14px; }
.page-heading h2 { margin-top: 3px; font-size:clamp(23px, 22px + .12vw, 25px); font-weight: 650; }
.eyebrow, .breadcrumb { color: var(--muted); font-size:clamp(12px, 11px + .12vw, 14px); font-weight: 700; }
.breadcrumb { text-transform: none; }
.page-meta { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.page-meta span { padding: 5px 8px; background: var(--surface-3); border: 1px solid var(--line); border-radius: 3px; color: var(--muted); font-size:clamp(13px, 12px + .12vw, 15px); }

.metric-summary-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.metric-summary { min-width: 0; padding: 14px 15px; border-right: 1px solid var(--line); }
.metric-summary:last-child { border-right: 0; }
.metric-summary-head, .metric-summary-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.metric-summary-head { color: var(--muted); font-size:clamp(14px, 13px + .12vw, 16px); }
.metric-summary-value { margin-top: 9px; font-size:clamp(27px, 26px + .12vw, 29px); font-weight: 680; white-space: nowrap; }
.metric-summary-value small { margin-left: 5px; color: var(--muted); font-size:clamp(13px, 12px + .12vw, 15px); font-weight: 400; }
.metric-summary-foot { margin-top: 5px; color: var(--muted); font-size:clamp(13px, 12px + .12vw, 15px); }
.freshness { font-size:clamp(12px, 11px + .12vw, 14px); }
.freshness.fresh { color: var(--teal); }
.freshness.stale { color: var(--amber); }
.delta.up { color: var(--red); }
.delta.down { color: var(--teal); }

.workband { margin-top: 13px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.two-column-band { display: grid; grid-template-columns: minmax(0, 1fr) 270px; }
.primary-visual { min-width: 0; }
.two-column-band .coverage-panel { border-left: 1px solid var(--line); }
.section-title { min-height: 49px; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 13px; border-bottom: 1px solid var(--line); }
.section-title h3 { font-size:clamp(16px, 15px + .12vw, 18px); font-weight: 650; }
.section-title span { display: block; margin-top: 2px; color: var(--muted); font-size:clamp(13px, 12px + .12vw, 15px); }
.chart-large { width: 100%; height: 410px; }
.chart-medium { width: 100%; height: 360px; }
.coverage-list { padding: 5px 13px 12px; }
.coverage-list > div { min-height: 37px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border-bottom: 1px solid #edf0ee; color: var(--muted); font-size:clamp(14px, 13px + .12vw, 16px); }
.coverage-list > div:last-child { border-bottom: 0; }
.coverage-list strong { color: var(--text); }

.table-scroll { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; }
.data-table th, .data-table td { padding: 10px 12px; border-bottom: 1px solid #e8ecea; text-align: right; white-space: nowrap; font-size:clamp(14px, 13px + .12vw, 16px); }
.data-table th { background: var(--surface-2); color: var(--muted); font-weight: 600; }
.data-table tr:last-child td { border-bottom: 0; }
.data-table th:first-child, .data-table td:first-child { text-align: left; }
.data-table td:nth-child(2) { max-width: 280px; overflow: hidden; text-overflow: ellipsis; }
.data-table.compact td { text-align: left; }
.table-subline { display: block; margin-top: 2px; color: var(--muted); font-weight: 400; }
.status-dot { width: 7px; height: 7px; display: inline-block; margin-right: 5px; border-radius: 50%; background: var(--line-strong); }
.status-dot.fresh { background: var(--teal); }
.status-dot.stale { background: var(--amber); }
.empty-state { padding: 28px 12px !important; color: var(--muted); text-align: center !important; }

.explorer-layout { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 12px; }
.series-panel, .chart-panel { min-width: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.series-panel-tools { height: 51px; display: flex; align-items: center; gap: 7px; padding: 8px; border-bottom: 1px solid var(--line); }
.search-control { min-width: 0; flex: 1; height: 34px; display: flex; align-items: center; gap: 7px; padding: 0 8px; border: 1px solid var(--line); border-radius: 4px; }
.search-control input { min-width: 0; min-height: 0; padding: 0; border: 0; box-shadow: none; background: transparent; }
.search-control svg { color: var(--muted); }
.series-list { height: 524px; overflow-y: auto; scrollbar-width: thin; }
.series-row { width: 100%; min-height: 55px; display: grid; grid-template-columns: 18px minmax(0, 1fr); gap: 8px; padding: 8px; border: 0; border-bottom: 1px solid #edf0ee; background: transparent; color: var(--text); text-align: left; }
.series-row:hover { background: var(--surface-2); }
.series-row.selected { background: var(--red-soft); }
.series-check { width: 16px; height: 16px; display: grid; place-items: center; margin-top: 2px; border: 1px solid var(--line-strong); border-radius: 3px; color: #fff; font-size:clamp(12px, 11px + .12vw, 14px); }
.series-row.selected .series-check { background: var(--red); border-color: var(--red); }
.series-row strong, .series-row small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.series-row strong { font-size:clamp(14px, 13px + .12vw, 16px); font-weight: 600; }
.series-row small { margin-top: 4px; color: var(--muted); font-size:clamp(12px, 11px + .12vw, 14px); }
.sample-warning { display: inline-block; margin-left: 6px; padding: 1px 4px; border-radius: 3px; background: var(--amber-soft); color: var(--amber); font-size:clamp(11px, 10px + .12vw, 13px); font-style: normal; font-weight: 500; vertical-align: 1px; }
.chart-toolbar { min-height: 55px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 12px; border-bottom: 1px solid var(--line); }
.chart-toolbar > div:first-child { min-width: 0; }
.chart-toolbar span, .chart-toolbar strong { display: block; }
.chart-toolbar span { color: var(--muted); font-size:clamp(13px, 12px + .12vw, 15px); }
.chart-toolbar strong { max-width: 420px; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size:clamp(14px, 13px + .12vw, 16px); }
.toolbar-group { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; justify-content: flex-end; }
.segmented-control { display: inline-flex; height: 32px; border: 1px solid var(--line); border-radius: 4px; overflow: hidden; }
.segmented-control button { min-width: 42px; padding: 0 8px; border: 0; border-right: 1px solid var(--line); background: var(--surface); color: var(--muted); font-size:clamp(13px, 12px + .12vw, 15px); }
.segmented-control button:last-child { border-right: 0; }
.segmented-control button.active { background: var(--header); color: #fff; }
.chart-main { width: 100%; height: 458px; }
.axis-bar { min-height: 48px; display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-top: 1px solid var(--line); }
.axis-bar label { display: flex; align-items: center; gap: 5px; color: var(--muted); font-size:clamp(13px, 12px + .12vw, 15px); }
.axis-bar input { width: 86px; min-height: 30px; }
.source-table { border-bottom: 1px solid var(--line); }
.source-table:last-child { border-bottom: 0; }
.source-table summary { padding: 11px 13px; cursor: pointer; font-weight: 600; font-size:clamp(14px, 13px + .12vw, 16px); }

.model-score-strip { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.model-score-strip article { min-width: 0; padding: 13px 15px; border-right: 1px solid var(--line); }
.model-score-strip article:last-child { border-right: 0; }
.model-score-strip span, .model-score-strip strong, .model-score-strip b { display: block; }
.model-score-strip span { color: var(--muted); font-size:clamp(13px, 12px + .12vw, 15px); }
.model-score-strip strong { margin-top: 6px; font-size:clamp(18px, 17px + .12vw, 20px); }
.model-score-strip b { margin-top: 5px; color: var(--muted); font-size:clamp(14px, 13px + .12vw, 16px); font-weight: 500; }
.bull { color: var(--red); }
.bear { color: var(--teal); }
.scenario-band { margin-top: 12px; min-height: 72px; display: grid; grid-template-columns: 220px minmax(260px, 1fr) minmax(260px, 1.1fr); gap: 14px; align-items: center; padding: 11px 13px; background: var(--header); color: #fff; border-radius: var(--radius); }
.scenario-band label { display: grid; gap: 5px; color: #bfc9c5; font-size:clamp(13px, 12px + .12vw, 15px); }
.scenario-band select { min-height: 34px; background: var(--header-2); border-color: #4e5c60; color: #fff; }
.scenario-slider span { display: flex; justify-content: space-between; }
.scenario-slider input { min-height: 20px; padding: 0; border: 0; box-shadow: none; accent-color: var(--red); }
.scenario-result span, .scenario-result strong { display: block; }
.scenario-result span { color: #bfc9c5; font-size:clamp(13px, 12px + .12vw, 15px); }
.scenario-result strong { margin-top: 5px; line-height: 1.45; font-size:clamp(14px, 13px + .12vw, 16px); }
.model-grid { display: grid; grid-template-columns: 1.2fr 1fr; }
.model-grid > div + div { border-left: 1px solid var(--line); }
.impact.positive { color: var(--red); }
.impact.negative { color: var(--teal); }
.model-disclaimer { margin-top: 10px; color: var(--muted); font-size:clamp(13px, 12px + .12vw, 15px); text-align: right; }

.admin-split { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 12px; }
.admin-split .workband { margin-top: 0; }
.create-account-panel { align-self: start; }
.form-stack { display: grid; gap: 13px; padding: 14px; }
.table-actions { display: flex; justify-content: flex-end; gap: 5px; }
.account-status { padding: 3px 6px; border-radius: 3px; font-size:clamp(12px, 11px + .12vw, 14px); }
.account-status.enabled { background: var(--teal-soft); color: var(--teal); }
.account-status.disabled { background: var(--red-soft); color: var(--danger); }
.audit-list { max-height: 360px; overflow-y: auto; }
.audit-list > div { min-height: 40px; display: grid; grid-template-columns: 140px 110px 140px minmax(0, 1fr); gap: 10px; align-items: center; padding: 7px 13px; border-bottom: 1px solid #e8ecea; font-size:clamp(13px, 12px + .12vw, 15px); }
.audit-list time, .audit-list small { color: var(--muted); }
.dataset-summary-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.dataset-summary-grid article { padding: 14px; border-right: 1px solid var(--line); }
.dataset-summary-grid article:last-child { border-right: 0; }
.dataset-summary-grid span, .dataset-summary-grid strong { display: block; }
.dataset-summary-grid span { color: var(--muted); font-size:clamp(13px, 12px + .12vw, 15px); }
.dataset-summary-grid strong { margin-top: 7px; font-size:clamp(25px, 24px + .12vw, 27px); }
.upload-zone { padding-bottom: 14px; }
.file-drop { min-height: 150px; margin: 14px; display: grid; place-items: center; align-content: center; gap: 7px; border: 1px dashed var(--line-strong); border-radius: 4px; background: var(--surface-2); color: var(--muted); cursor: pointer; }
.file-drop:hover { border-color: var(--teal); background: var(--teal-soft); }
.file-drop svg { width: 28px; height: 28px; color: var(--teal); }
.file-drop strong { color: var(--text); }
.file-drop span { font-size:clamp(13px, 12px + .12vw, 15px); }
.upload-actions { min-height: 38px; display: flex; align-items: center; gap: 12px; padding: 0 14px; }
.upload-actions span { color: var(--muted); font-size:clamp(14px, 13px + .12vw, 16px); }

.regional-kpi-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.regional-kpi { min-width: 0; padding: 12px 13px; border-right: 1px solid var(--line); }
.regional-kpi:last-child { border-right: 0; }
.regional-kpi span, .regional-kpi strong, .regional-kpi small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.regional-kpi span { color: var(--muted); font-size:clamp(12px, 11px + .12vw, 14px); }
.regional-kpi strong { margin-top: 5px; font-size:clamp(19px, 18px + .12vw, 21px); }
.regional-kpi small { margin-top: 3px; color: var(--muted); font-size:clamp(12px, 11px + .12vw, 14px); }
.regional-kpi.positive strong { color: var(--red); }
.regional-kpi.negative strong { color: var(--teal); }
.regional-map-band { display: grid; grid-template-columns: minmax(0, 1fr) 300px; }
.regional-map-main { min-width: 0; }
.regional-toolbar .segmented-control button { min-width: 62px; }
.regional-map { width: 100%; height: 560px; }
.regional-detail { min-width: 0; padding: 14px; border-left: 1px solid var(--line); background: var(--surface-2); }
.regional-detail-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.regional-detail-head span { color: var(--muted); font-size:clamp(12px, 11px + .12vw, 14px); }
.regional-detail-head h3 { margin-top: 3px; font-size:clamp(19px, 18px + .12vw, 21px); }
.regional-detail-price { display: flex; align-items: baseline; gap: 5px; margin-top: 22px; padding-bottom: 15px; border-bottom: 1px solid var(--line); }
.regional-detail-price strong { color: var(--red); font-size:clamp(36px, 35px + .12vw, 38px); line-height: 1; }
.regional-detail-price > span { color: var(--muted); font-size:clamp(13px, 12px + .12vw, 15px); }
.regional-detail-price small { margin-left: auto; color: var(--muted); font-size:clamp(12px, 11px + .12vw, 14px); }
.regional-detail-metrics { display: grid; gap: 0; margin: 10px 0 0; }
.regional-detail-metrics > div { min-height: 37px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid #e4e9e6; }
.regional-detail-metrics dt { color: var(--muted); font-size:clamp(13px, 12px + .12vw, 15px); }
.regional-detail-metrics dd { margin: 0; font-size:clamp(14px, 13px + .12vw, 16px); font-weight: 650; }
.regional-detail-metrics .up, .province-price .up { color: var(--red); }
.regional-detail-metrics .down, .province-price .down { color: var(--teal); }
.regional-detail-metrics .flat, .province-price .flat { color: var(--muted); }
.regional-trend { width: 100%; height: 220px; margin-top: 12px; }
.regional-source { color: var(--muted); font-size:clamp(12px, 11px + .12vw, 14px); line-height: 1.5; }
.regional-detail-empty { min-height: 440px; display: grid; place-items: center; align-content: center; gap: 8px; color: var(--muted); text-align: center; }
.regional-detail-empty svg { width: 26px; height: 26px; }
.regional-detail-empty strong { color: var(--text); }
.data-notice { min-height: 37px; display: flex; align-items: center; gap: 8px; padding: 7px 12px; border-bottom: 1px solid #ead9b9; background: var(--amber-soft); color: #72521d; font-size:clamp(13px, 12px + .12vw, 15px); }
.map-legend { min-height: 36px; display: flex; align-items: center; justify-content: center; gap: 18px; padding: 6px 12px; border-top: 1px solid var(--line); color: var(--muted); font-size:clamp(12px, 11px + .12vw, 14px); }
.map-legend span { display: inline-flex; align-items: center; gap: 5px; }
.map-legend i { width: 9px; height: 9px; border-radius: 2px; }
.map-legend .up { background: var(--red); }
.map-legend .down { background: var(--teal); }
.map-legend .flat { background: #a8b1ad; }
.map-legend .missing { background: #e3e7e5; border: 1px solid #cbd2cf; }
.stale-text { color: var(--amber) !important; }
.region-groups { padding: 4px 13px 14px; }
.region-group { display: grid; grid-template-columns: 76px minmax(0, 1fr); gap: 10px; padding: 10px 0; border-bottom: 1px solid #e7ebe9; }
.region-group:last-child { border-bottom: 0; }
.region-group h4 { margin: 8px 0 0; font-size:clamp(14px, 13px + .12vw, 16px); }
.region-group > div { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.province-price { min-width: 0; min-height: 78px; display: grid; align-content: center; gap: 3px; padding: 8px; border: 1px solid var(--line); border-radius: 4px; background: var(--surface); color: var(--text); text-align: center; }
.province-price:hover { border-color: var(--red); background: var(--red-soft); }
.province-price.selected { border-color: var(--header); box-shadow: inset 0 0 0 1px var(--header); }
.province-price span { font-size:clamp(13px, 12px + .12vw, 15px); font-weight: 650; }
.province-price strong { color: var(--red); font-size:clamp(18px, 17px + .12vw, 20px); }
.province-price strong small { margin-left: 2px; color: var(--muted); font-size:clamp(11px, 10px + .12vw, 13px); font-weight: 400; }
.province-price em { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size:clamp(11px, 10px + .12vw, 13px); font-style: normal; }

.manual-update-form { display: grid; grid-template-columns: 110px minmax(260px, 2fr) 150px 150px minmax(180px, 1fr) auto; gap: 10px; align-items: end; padding: 14px; }
.manual-update-form label { min-width: 0; display: grid; gap: 6px; color: #3d4845; font-size:clamp(13px, 12px + .12vw, 15px); font-weight: 600; }
.manual-update-form select { min-width: 0; }
.manual-series-field small { overflow: hidden; color: var(--muted); font-size:clamp(11px, 10px + .12vw, 13px); font-weight: 400; text-overflow: ellipsis; white-space: nowrap; }
.manual-submit { white-space: nowrap; }
.manual-update-table td:first-child { max-width: 340px; }
.manual-update-table td:last-child { width: 50px; }

/* 进口牛肉价格终端 */
.beef-price-heading { align-items: center; }
.beef-price-controls { min-height: 58px; display: flex; align-items: end; gap: 10px; margin-bottom: 12px; padding: 10px 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.beef-price-controls label { width: 210px; display: grid; gap: 4px; color: var(--muted); font-size:clamp(11px, 10px + .12vw, 13px); font-weight: 650; }
.beef-price-controls select { min-height: 32px; font-size:clamp(13px, 12px + .12vw, 15px); }
.beef-price-controls .segmented-control { margin-left: auto; }
.beef-price-controls .segmented-control + .segmented-control { margin-left: 0; }
.beef-price-kpis { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); margin-bottom: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.beef-price-kpis article { position: relative; min-width: 0; padding: 13px 15px; border-right: 1px solid var(--line); }
.beef-price-kpis article:last-child { border-right: 0; }
.beef-price-kpis span,.beef-price-kpis em,.beef-price-kpis b { display: block; }
.beef-price-kpis span { color: var(--muted); font-size:clamp(12px, 11px + .12vw, 14px); }
.beef-price-kpis strong { display: block; margin: 7px 0 4px; font-size:clamp(26px, 25px + .12vw, 28px); }
.beef-price-kpis strong small { margin-left: 4px; color: var(--muted); font-size:clamp(11px, 10px + .12vw, 13px); font-weight: 400; }
.beef-price-kpis em { color: var(--muted); font-size:clamp(11px, 10px + .12vw, 13px); font-style: normal; }
.beef-price-kpis b { position: absolute; right: 14px; bottom: 13px; font-size:clamp(11px, 10px + .12vw, 13px); font-weight: 600; }
.beef-price-main { display: grid; grid-template-columns: minmax(0,1fr) 260px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.price-chart-panel { min-width: 0; }
.beef-price-chart { width: 100%; height: 440px; }
.price-signal-panel { border-left: 1px solid var(--line); background: var(--surface-2); }
.price-signal { margin: 12px; padding: 13px; border-left: 3px solid var(--blue); background: var(--surface); }
.price-signal strong { font-size:clamp(16px, 15px + .12vw, 18px); }
.price-signal p { margin-top: 7px; color: var(--muted); font-size:clamp(12px, 11px + .12vw, 14px); line-height: 1.7; }
.price-signal-panel dl { margin: 0 12px; }
.price-signal-panel dl div { min-height: 40px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.price-signal-panel dt { color: var(--muted); font-size:clamp(12px, 11px + .12vw, 14px); }
.price-signal-panel dd { margin: 0; font-size:clamp(14px, 13px + .12vw, 16px); font-weight: 700; }
.beef-price-table td:first-child strong,.beef-price-table td:first-child small { display: block; }
.beef-price-table td:first-child small { margin-top: 3px; color: var(--muted); font-size:clamp(11px, 10px + .12vw, 13px); }
.quality-tag { display: inline-flex; padding: 3px 6px; border-radius: 3px; font-size:clamp(11px, 10px + .12vw, 13px); }
.quality-tag.ok { color: var(--teal); background: var(--teal-soft); }
.quality-tag.warn { color: var(--amber); background: var(--amber-soft); }

/* 研究报告 */
.report-workspace { height: calc(100vh - 142px); min-height: 650px; display: grid; grid-template-columns: 250px minmax(470px, 1fr) 310px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.report-index, .annotation-rail { min-width: 0; overflow: hidden; background: var(--surface-2); }
.report-index { border-right: 1px solid var(--line); }
.report-index-tools, .annotation-head { min-height: 58px; padding: 10px 12px; display: flex; align-items: center; justify-content: space-between; gap: 8px; border-bottom: 1px solid var(--line); }
.report-index-tools strong, .report-index-tools span, .annotation-head strong, .annotation-head span { display: block; }
.report-index-tools span, .annotation-head span { color: var(--muted); font-size:clamp(12px, 11px + .12vw, 14px); }
.report-list { height: calc(100% - 58px); overflow-y: auto; padding: 8px; }
.report-list section > time { display: block; padding: 8px 5px 5px; color: var(--muted); font-size:clamp(12px, 11px + .12vw, 14px); font-weight: 700; }
.report-row-wrap { position: relative; }
.report-row { width: 100%; min-height: 62px; display: block; padding: 9px 38px 9px 10px; border: 1px solid transparent; border-radius: 4px; background: transparent; color: var(--text); text-align: left; }
.report-row:hover { background: var(--surface); }
.report-row.active { border-color: #dbaeb0; background: var(--red-soft); }
.report-row strong, .report-row small { display: block; }
.report-row strong { font-size:clamp(14px, 13px + .12vw, 16px); line-height: 1.45; }
.report-row small { margin-top: 5px; color: var(--muted); font-size:clamp(12px, 11px + .12vw, 14px); }
.report-delete-button { position: absolute; top: 16px; right: 5px; z-index: 2; width: 30px; height: 30px; display: grid; place-items: center; border: 0; border-radius: 4px; background: transparent; color: var(--muted); cursor: pointer; }
.report-delete-button:hover { background: #fff; color: var(--danger); }
.report-delete-button:disabled { opacity: .45; cursor: wait; }
.report-delete-button svg { width: 15px; height: 15px; pointer-events: none; }
.report-reader { min-width: 0; min-height: 0; display: flex; flex-direction: column; overflow: hidden; background: #eef0ef; }
.reader-toolbar { min-height: 58px; padding: 8px 12px; display: flex; align-items: center; justify-content: space-between; gap: 10px; border-bottom: 1px solid var(--line); background: var(--surface); }
.reader-toolbar strong, .reader-toolbar small { display: block; }
.reader-toolbar strong { max-width: 520px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size:clamp(14px, 13px + .12vw, 16px); }
.reader-toolbar small { margin-top: 3px; color: var(--muted); font-size:clamp(12px, 11px + .12vw, 14px); }
.reader-actions { display: flex; align-items: center; gap: 8px; }
.reader-page-status { min-width: 128px; color: var(--muted); font-size:clamp(12px, 11px + .12vw, 14px); text-align: right; }
.pdf-zoom-controls { height: 30px; display: inline-grid; grid-template-columns: 28px 46px 28px; align-items: center; overflow: hidden; border: 1px solid var(--line); border-radius: 4px; background: var(--surface-2); }
.pdf-zoom-controls button { height: 100%; border: 0; background: transparent; color: var(--text); font-size:clamp(18px, 17px + .12vw, 20px); }
.pdf-zoom-controls button:hover { background: var(--surface); color: var(--red); }
.pdf-zoom-controls span { font-size:clamp(11px, 10px + .12vw, 13px); text-align: center; }
.reader-view-switch { height: 32px; display: inline-flex; overflow: hidden; border: 1px solid var(--line); border-radius: 4px; background: var(--surface-2); }
.reader-view-switch button { padding: 0 10px; border: 0; border-right: 1px solid var(--line); background: transparent; color: var(--muted); font-size:clamp(13px, 12px + .12vw, 15px); }
.reader-view-switch button:last-child { border-right: 0; }
.reader-view-switch button.active { background: var(--header); color: #fff; }
.report-original { min-height: 0; flex: 1 1 auto; padding: 12px; background: #dfe3e1; }
.report-original iframe { width: 100%; height: 100%; display: block; border: 1px solid #c8cfcb; background: #fff; }
.pdf-annotator { min-width: 0; min-height: 0; flex: 1 1 auto; overflow: auto; overscroll-behavior: contain; scrollbar-gutter: stable; background: #dfe3e1; }
.pdf-pages { min-width: max-content; min-height: 100%; display: flex; flex-direction: column; align-items: center; gap: 18px; padding: 18px 22px 40px; }
.pdf-page-shell { position: relative; width: min(920px, calc(100vw - 650px)); min-width: 360px; min-height: 520px; flex: none; overflow: hidden; background: #fff; border: 1px solid #c8cfcb; box-shadow: 0 3px 12px rgba(24,34,36,.12); transition: box-shadow .2s ease, border-color .2s ease; }
.pdf-page-shell.comment-target { border-color: var(--amber); box-shadow: 0 0 0 3px rgba(176,122,34,.22), 0 3px 12px rgba(24,34,36,.12); }
.pdf-page-shell canvas { position: absolute; inset: 0; display: block; background: #fff; }
.pdf-page-loading, .pdf-page-error, .pdf-loading { display: grid; place-items: center; align-content: center; gap: 8px; color: var(--muted); font-size:clamp(13px, 12px + .12vw, 15px); text-align: center; }
.pdf-page-loading, .pdf-page-error { position: absolute; inset: 0; }
.pdf-loading { min-height: 520px; padding: 28px; }
.pdf-loading svg { width: 30px; height: 30px; color: var(--red); }
.pdf-loading:not(.error) svg { animation: spin 1s linear infinite; }
.pdf-loading strong, .pdf-page-error strong { color: var(--text); font-size:clamp(15px, 14px + .12vw, 17px); }
.pdf-page-number { position: absolute; right: 9px; bottom: 7px; z-index: 3; padding: 3px 6px; border-radius: 3px; background: rgba(23,34,36,.72); color: #fff; font-size:clamp(11px, 10px + .12vw, 13px); pointer-events: none; }
.pdf-page-shell.image-only::after { content: "本页为扫描图像，暂无可选择文字"; position: absolute; left: 50%; bottom: 8px; z-index: 3; transform: translateX(-50%); padding: 4px 8px; border-radius: 3px; background: rgba(176,122,34,.86); color: #fff; font-size:clamp(11px, 10px + .12vw, 13px); pointer-events: none; }
.pdf-page-shell .textLayer { position: absolute; inset: 0; z-index: 2; overflow: clip; color-scheme: only light; color: transparent; line-height: 1; letter-spacing: normal; word-spacing: normal; text-align: initial; text-size-adjust: none; transform-origin: 0 0; user-select: text; }
.pdf-page-shell .textLayer :is(span, br) { position: absolute; color: transparent; white-space: pre; cursor: text; transform-origin: 0 0; user-select: text; }
.pdf-page-shell .textLayer { --min-font-size: 1; --text-scale-factor: calc(var(--total-scale-factor) * var(--min-font-size)); --min-font-size-inv: calc(1 / var(--min-font-size)); }
.pdf-page-shell .textLayer > :not(.markedContent), .pdf-page-shell .textLayer .markedContent span:not(.markedContent) { z-index: 1; --font-height: 0; --scale-x: 1; --rotate: 0deg; font-size: calc(var(--text-scale-factor) * var(--font-height)); transform: rotate(var(--rotate)) scaleX(var(--scale-x)) scale(var(--min-font-size-inv)); }
.pdf-page-shell .textLayer .markedContent { display: contents; }
.pdf-page-shell .textLayer ::selection { background: rgba(248,223,136,.82); color: transparent; }
.pdf-page-shell .textLayer .endOfContent { position: absolute; inset: 100% 0 0; display: block; z-index: 0; cursor: default; user-select: none; }
.document-paper { width: min(760px, calc(100% - 30px)); min-height: 0; flex: 1 1 auto; margin: 16px auto; padding: 54px 64px 80px; overflow-y: auto; overscroll-behavior: contain; scrollbar-gutter: stable; background: #fff; border: 1px solid #d9dddb; box-shadow: 0 2px 8px rgba(20,28,30,.05); user-select: text; }
.document-paper h1 { font-family: "Songti SC", SimSun, serif; font-size:clamp(26px, 25px + .12vw, 28px); text-align: center; line-height: 1.5; }
.document-meta { margin: 18px 0 30px !important; padding-bottom: 16px; border-bottom: 2px solid var(--red); color: var(--muted); font-size:clamp(13px, 12px + .12vw, 15px) !important; text-align: center; }
.document-paper p { margin: 0 0 17px; font-family: "Songti SC", SimSun, serif; font-size:clamp(17px, 16px + .12vw, 19px); line-height: 2; text-indent: 2em; }
.document-paper ::selection { background: #f8df88; color: #a72e33; }
.reader-empty, .pdf-notice { display: grid; place-items: center; align-content: center; gap: 8px; color: var(--muted); text-align: center; }
.reader-empty { min-height: 500px; }
.pdf-notice { min-height: 320px; padding: 30px; }
.reader-empty svg, .pdf-notice svg { width: 32px; height: 32px; color: var(--red); }
.reader-empty strong, .pdf-notice strong { color: var(--text); }
.pdf-notice span { max-width: 420px; line-height: 1.7; font-size:clamp(14px, 13px + .12vw, 16px); }
.annotation-rail { border-left: 1px solid var(--line); }
.selection-card { margin: 10px; padding: 11px; border: 1px solid var(--line); border-radius: 4px; background: var(--surface); }
.selection-card.ready { border-color: #dec67f; background: #fffdf4; }
.selection-card > span { color: var(--amber); font-size:clamp(12px, 11px + .12vw, 14px); font-weight: 700; }
.selection-card blockquote, .annotation-list blockquote { margin: 7px 0; padding: 8px 9px; border-left: 2px solid var(--amber); background: var(--amber-soft); color: #59461f; font-size:clamp(13px, 12px + .12vw, 15px); line-height: 1.55; }
.selection-card textarea { width: 100%; min-height: 68px; resize: vertical; padding: 8px; border: 1px solid var(--line); border-radius: 4px; outline: 0; font: inherit; font-size:clamp(13px, 12px + .12vw, 15px); }
.selection-card .btn-primary { width: 100%; min-height: 32px; margin-top: 7px; }
.annotation-list { height: calc(100% - 282px); overflow-y: auto; padding: 0 10px 12px; }
.annotation-list article { padding: 10px 0; border-bottom: 1px solid var(--line); }
.comment-thread-item.is-reply { margin-left: calc(var(--thread-depth) * 8px); padding-left: 8px; border-left: 2px solid #dce3e2; border-bottom-color: #e7eceb; }
.comment-thread-item.is-root + .comment-thread-item.is-root { margin-top: 5px; }
.comment-children { margin-top: 7px; }
.comment-reply-target { margin-bottom: 5px; color: var(--muted); font-size:clamp(12px, 11px + .12vw, 14px); }
.comment-reply-target strong { color: var(--text); }
.comment-meta { display: flex; justify-content: space-between; gap: 8px; font-size:clamp(12px, 11px + .12vw, 14px); }
.comment-meta time { color: var(--muted); }
.annotation-list article > p { margin-top: 8px; font-size:clamp(13px, 12px + .12vw, 15px); line-height: 1.6; }
.annotation-list article > p.deleted-comment { color: var(--muted); font-style: italic; }
.comment-actions { min-height: 26px; display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 7px; }
.comment-actions > span { display: inline-flex; align-items: center; gap: 8px; }
.comment-action-buttons .danger { color: var(--red); }
.comment-page-link { color: var(--blue); font-weight: 700; }
.reply-composer { margin-top: 7px; padding: 8px; border: 1px solid var(--line); border-radius: 4px; background: var(--surface); }
.reply-composer[hidden] { display: none; }
.reply-composer textarea { width: 100%; min-height: 58px; resize: vertical; padding: 7px; border: 1px solid var(--line); border-radius: 4px; outline: 0; font: inherit; font-size:clamp(13px, 12px + .12vw, 15px); }
.reply-composer textarea:focus { border-color: var(--amber); box-shadow: 0 0 0 2px rgba(176,122,34,.12); }
.reply-composer > div { display: flex; justify-content: flex-end; align-items: center; gap: 8px; margin-top: 6px; }
.reply-composer .btn-primary { min-height: 28px; padding: 0 10px; }
.reply-toggle { width: 100%; margin-top: 7px; padding: 6px 8px; border: 0; border-radius: 3px; background: #eef2f1; color: var(--blue); font-size:clamp(12px, 11px + .12vw, 14px); font-weight: 700; cursor: pointer; }
.reply-toggle:hover { background: #e3eae8; }
.legacy-comment { color: var(--muted); font-size:clamp(11px, 10px + .12vw, 13px); }

/* 产业日历：时间线是主视图 */
.calendar-subtitle { margin-top: 5px; color: var(--muted); font-size:clamp(13px, 12px + .12vw, 15px); }
.calendar-command { display: grid; grid-template-columns: minmax(580px, 1fr) 340px; gap: 12px; }
.timeline-panel, .countdown-panel { min-width: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.timeline-toolbar { min-height: 58px; padding: 10px 13px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--line); }
.event-filters { display: flex; gap: 4px; flex-wrap: wrap; }
.event-filters button { min-height: 28px; padding: 0 8px; border: 1px solid var(--line); border-radius: 3px; background: var(--surface); color: var(--muted); font-size:clamp(12px, 11px + .12vw, 14px); }
.event-filters button.active { border-color: var(--header); background: var(--header); color: #fff; }
.timeline-date { display: grid; grid-template-columns: 1fr auto 1fr; gap: 12px; align-items: center; padding: 14px 18px 5px; color: var(--muted); font-size:clamp(13px, 12px + .12vw, 15px); }
.timeline-date span { height: 1px; background: var(--line); }
.timeline-section { padding: 8px 18px 14px; }
.timeline-section > h3 { margin: 5px 0 6px 93px; color: var(--muted); font-size:clamp(12px, 11px + .12vw, 14px); }
.timeline-section.past { background: var(--surface-2); border-top: 1px solid var(--line); }
.timeline-event { position: relative; min-height: 112px; display: grid; grid-template-columns: 82px 14px minmax(0,1fr) 32px; gap: 10px; align-items: start; padding: 12px 0; }
.timeline-event:not(:last-child)::after { content: ""; position: absolute; left: 98px; top: 29px; bottom: -13px; width: 1px; background: var(--line); }
.timeline-event > time { text-align: right; }
.timeline-event > time b, .timeline-event > time span { display: block; }
.timeline-event > time b { color: var(--red); font-size:clamp(16px, 15px + .12vw, 18px); white-space: nowrap; }
.timeline-event > time span { margin-top: 4px; color: var(--muted); font-size:clamp(11px, 10px + .12vw, 13px); }
.timeline-marker { position: relative; z-index: 1; width: 11px; height: 11px; margin-top: 5px; border: 3px solid var(--surface); border-radius: 50%; box-shadow: 0 0 0 1px currentColor; background: currentColor; }
.timeline-content { padding: 0 12px 12px 0; border-bottom: 1px solid #e9edeb; }
.timeline-content > div { display: flex; align-items: center; gap: 7px; }
.timeline-content em { color: var(--muted); font-size:clamp(11px, 10px + .12vw, 13px); font-style: normal; }
.timeline-content h3 { margin-top: 6px; font-size:clamp(16px, 15px + .12vw, 18px); }
.timeline-content p { margin-top: 6px; color: #44504c; font-size:clamp(13px, 12px + .12vw, 15px); line-height: 1.55; }
.timeline-content small { display: block; margin-top: 7px; color: var(--muted); font-size:clamp(11px, 10px + .12vw, 13px); }
.event-type { display: inline-block; padding: 2px 5px; border-radius: 3px; font-size:clamp(11px, 10px + .12vw, 13px); font-weight: 700; }
.policy { color: var(--red); }.event-type.policy { background: var(--red-soft); }
.data { color: var(--blue); }.event-type.data { background: #e8eef6; }
.turn { color: var(--amber); }.event-type.turn { background: var(--amber-soft); }
.meeting { color: var(--teal); }.event-type.meeting { background: var(--teal-soft); }
.countdown-card { display: grid; grid-template-columns: 72px minmax(0,1fr); border-bottom: 1px solid var(--line); }
.countdown-card > b { display: grid; place-items: center; color: var(--red); border-right: 1px solid var(--line); font-size:clamp(21px, 20px + .12vw, 23px); white-space: nowrap; }
.countdown-card > div { min-width: 0; padding: 12px; }
.countdown-card strong, .countdown-card small { display: block; }
.countdown-card strong { margin: 6px 0; font-size:clamp(14px, 13px + .12vw, 16px); }
.countdown-card small { margin-top: 3px; color: var(--muted); font-size:clamp(11px, 10px + .12vw, 13px); }
.calendar-advice { margin: 12px; padding: 12px; border: 1px solid #e6d6b5; border-radius: 4px; background: var(--amber-soft); }
.calendar-advice strong { font-size:clamp(13px, 12px + .12vw, 15px); }
.calendar-advice p { margin-top: 6px; color: #665333; font-size:clamp(12px, 11px + .12vw, 14px); line-height: 1.65; }
.inline-modal { position: fixed; inset: 62px 0 0 var(--sidebar); z-index: 25; display: grid; place-items: center; padding: 20px; background: rgba(20,28,30,.45); }
.inline-modal form { width: min(520px, 100%); max-height: calc(100vh - 100px); overflow-y: auto; padding: 0 14px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 18px 45px rgba(0,0,0,.2); }
.inline-modal .modal-head { margin: 0 -14px 0; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* 月度情报盘 */
.calendar-heading { align-items: center; }
.calendar-controls { display: flex; align-items: center; justify-content: flex-end; gap: 7px; flex-wrap: wrap; }
.calendar-controls > strong { min-width: 94px; text-align: center; font-size:clamp(15px, 14px + .12vw, 17px); }
.calendar-controls select { width: 116px; min-height: 34px; font-size:clamp(13px, 12px + .12vw, 15px); }
.calendar-overview { min-height: 98px; display: grid; grid-template-columns: minmax(360px,1fr) repeat(3,150px); margin-bottom: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.risk-heat { min-width: 0; padding: 14px 16px; display: grid; grid-template-columns: 1fr auto; gap: 7px 12px; border-right: 1px solid var(--line); }
.risk-heat > div:first-child { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; }
.risk-heat strong { font-size:clamp(14px, 13px + .12vw, 16px); }.risk-heat span, .risk-heat small { color: var(--muted); font-size:clamp(11px, 10px + .12vw, 13px); }
.heat-strip { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(var(--days,31),1fr); gap: 2px; height: 9px; }
.heat-strip i { border-radius: 1px; background: var(--red); opacity: calc(.12 + var(--heat) * .88); }
.risk-heat > small:last-child { text-align: right; }
.calendar-overview article { display: grid; align-content: center; padding: 12px 16px; border-right: 1px solid var(--line); }
.calendar-overview article:last-child { border-right: 0; }
.calendar-overview article span, .calendar-overview article em { color: var(--muted); font-size:clamp(12px, 11px + .12vw, 14px); font-style: normal; }
.calendar-overview article strong { margin: 5px 0 3px; font-size:clamp(25px, 24px + .12vw, 27px); }.calendar-overview article strong small { margin-left: 3px; color: var(--muted); font-size:clamp(12px, 11px + .12vw, 14px); font-weight: 400; }
.month-layout { display: grid; grid-template-columns: minmax(620px,1fr) 300px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.month-calendar { min-width: 0; border-right: 1px solid var(--line); }
.weekday-row { height: 36px; display: grid; grid-template-columns: repeat(7,1fr); border-bottom: 1px solid var(--line); }
.weekday-row span { display: grid; place-items: center; color: #3e4945; font-size:clamp(13px, 12px + .12vw, 15px); font-weight: 650; }
.month-grid { display: grid; grid-template-columns: repeat(7,minmax(0,1fr)); grid-template-rows: repeat(6,112px); }
.month-day { min-width: 0; position: relative; display: block; padding: 8px; overflow: hidden; border: 0; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--surface); color: var(--text); text-align: left; }
.month-day:nth-child(7n) { border-right: 0; }.month-day:nth-last-child(-n+7) { border-bottom: 0; }
.month-day:hover { background: var(--surface-2); }.month-day.outside { background: #fafbfa; color: #9aa39f; }
.month-day.selected { z-index: 1; background: #fffafa; box-shadow: inset 0 0 0 1px var(--red); }
.day-number { display: inline-grid; place-items: center; width: 23px; height: 23px; font-size:clamp(13px, 12px + .12vw, 15px); font-weight: 650; }
.day-number.today { border-radius: 50%; background: var(--red); color: #fff; }.month-day > small { color: var(--red); font-size:clamp(10px, 9px + .12vw, 12px); }
.month-event { min-width: 0; display: grid; grid-template-columns: 5px auto 1fr; gap: 3px 4px; align-items: center; margin-top: 5px; color: var(--muted); font-size:clamp(10px, 9px + .12vw, 12px); line-height: 1.25; }
.month-event i { width: 5px; height: 5px; border-radius: 50%; background: currentColor; }.month-event b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: currentColor; font-weight: 650; }.month-event time { text-align: right; }
.month-event em { grid-column: 2 / -1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); font-style: normal; font-size:clamp(11px, 10px + .12vw, 13px); }
.more-events { display: block; margin: 5px 0 0 9px; color: var(--blue); font-size:clamp(11px, 10px + .12vw, 13px); }
.calendar-legend { min-height: 38px; display: flex; align-items: center; justify-content: center; gap: 24px; border-top: 1px solid var(--line); color: var(--muted); font-size:clamp(11px, 10px + .12vw, 13px); }
.calendar-legend span { display: flex; align-items: center; gap: 5px; }.calendar-legend i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.day-agenda { min-width: 0; background: var(--surface-2); }
.day-agenda-head { height: 56px; display: flex; align-items: center; justify-content: space-between; padding: 10px 13px; border-bottom: 1px solid var(--line); background: var(--surface); }
.day-agenda-head strong { font-size:clamp(18px, 17px + .12vw, 20px); }.day-agenda-head span { margin-left: 7px; color: var(--muted); font-size:clamp(12px, 11px + .12vw, 14px); }.day-agenda-head small { color: var(--muted); font-size:clamp(11px, 10px + .12vw, 13px); }
.day-event-list { height: 650px; overflow-y: auto; }
.day-event { padding: 13px; border-bottom: 1px solid var(--line); background: var(--surface); }
.day-event-title { display: grid; grid-template-columns: 39px 8px minmax(0,1fr); gap: 6px; align-items: start; margin-top: 10px; }
.day-event-title time { font-size:clamp(14px, 13px + .12vw, 16px); font-weight: 700; }.agenda-dot { width: 7px; height: 7px; margin-top: 4px; border-radius: 50%; background: currentColor; }
.day-event-title strong { font-size:clamp(13px, 12px + .12vw, 15px); line-height: 1.45; }.day-event-info { margin: 8px 0 0 53px; }
.day-event-info > p { margin-top: 7px; color: #4b5652; font-size:clamp(11px, 10px + .12vw, 13px); line-height: 1.6; }.day-event-info > p span { float: right; color: var(--teal); }
.day-event-info .repeat-note { display: flex; align-items: center; gap: 5px; color: var(--blue); }
.day-event-info .repeat-note svg { width: 12px; height: 12px; }
.related-reports { display: grid; gap: 6px; margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); }
.related-reports b { font-size:clamp(11px, 10px + .12vw, 13px); }.related-reports a { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--blue); font-size:clamp(11px, 10px + .12vw, 13px); }.related-reports span { color: var(--muted); font-size:clamp(11px, 10px + .12vw, 13px); }
.day-event-actions { display: flex; gap: 6px; margin-top: 10px; }.day-event:not(.expanded) .day-event-info > p:nth-child(n+2), .day-event:not(.expanded) .day-event-actions { display: none; }
.day-add-button { width: calc(100% - 24px); min-height: 36px; display: flex; align-items: center; justify-content: center; gap: 6px; margin: 12px; border: 1px solid var(--line); border-radius: 4px; background: var(--surface); color: var(--text); font-size:clamp(12px, 11px + .12vw, 14px); }
.day-add-button:hover { border-color: var(--red); color: var(--red); }

.modal-backdrop { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 20px; background: rgba(20, 28, 30, .52); }
.modal { width: min(420px, 100%); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 20px 55px rgba(0, 0, 0, .25); }
.modal-head { min-height: 50px; display: flex; align-items: center; justify-content: space-between; padding: 8px 10px 8px 14px; border-bottom: 1px solid var(--line); }
.modal-head h2 { font-size:clamp(17px, 16px + .12vw, 19px); }
.toast { position: fixed; left: 50%; bottom: 20px; z-index: 80; transform: translate(-50%, 18px); padding: 9px 14px; background: var(--header); color: #fff; border-radius: 4px; opacity: 0; pointer-events: none; transition: opacity .16s ease, transform .16s ease; box-shadow: 0 8px 24px rgba(0, 0, 0, .18); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.error { background: var(--danger); }
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 1180px) {
  :root { --sidebar: 220px; }
  .metric-summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .metric-summary:nth-child(2) { border-right: 0; }
  .metric-summary:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .two-column-band { grid-template-columns: minmax(0, 1fr) 235px; }
  .model-grid { grid-template-columns: 1fr; }
  .model-grid > div + div { border-left: 0; border-top: 1px solid var(--line); }
  .regional-kpi-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .regional-kpi { border-bottom: 1px solid var(--line); }
  .regional-kpi:nth-child(3n) { border-right: 0; }
  .regional-kpi:nth-child(n+4) { border-bottom: 0; }
  .region-group > div { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .manual-update-form { grid-template-columns: 110px minmax(260px, 1fr) 145px 145px; }
  .report-workspace { grid-template-columns: 220px minmax(430px, 1fr) 280px; }
  .document-paper { padding: 42px 44px 70px; }
  .calendar-command { grid-template-columns: minmax(500px, 1fr) 300px; }
  .calendar-overview { grid-template-columns: minmax(280px,1fr) repeat(3,120px); }
  .month-layout { grid-template-columns: minmax(560px,1fr) 280px; }
  .month-grid { grid-template-rows: repeat(6,104px); }
  .manual-note-field { grid-column: 1 / 4; }
}

@media (max-width: 900px) {
  .header-menu { display: inline-flex; }
  .app-brand { min-width: 0; }
  .app-brand small { display: none; }
  .app-layout { grid-template-columns: 1fr; }
  .sidebar { position: fixed; top: 62px; bottom: 0; left: 0; z-index: 35; width: min(300px, 86vw); height: auto; transform: translateX(-105%); transition: transform .18s ease; box-shadow: 10px 0 28px rgba(0, 0, 0, .2); }
  .sidebar.open { transform: translateX(0); }
  .page-content { padding: 13px; }
  .explorer-layout { grid-template-columns: 1fr; }
  .series-panel { order: 2; }
  .series-list { height: 330px; }
  .chart-panel { order: 1; }
  .admin-split { grid-template-columns: 1fr; }
  .scenario-band { grid-template-columns: 1fr 1fr; }
  .scenario-result { grid-column: 1 / -1; }
  .regional-map-band { grid-template-columns: 1fr; }
  .regional-detail { border-left: 0; border-top: 1px solid var(--line); }
  .regional-detail-empty { min-height: 220px; }
  .region-group > div { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .manual-update-form { grid-template-columns: 1fr 1fr; }
  .report-workspace { height: auto; grid-template-columns: 220px minmax(0,1fr); }
  .report-reader { overflow: visible; }
  .document-paper { min-height: 520px; flex: none; overflow: visible; }
  .report-original { height: 720px; flex: none; }
  .pdf-annotator { height: 720px; flex: none; }
  .annotation-rail { grid-column: 1 / -1; min-height: 420px; border-left: 0; border-top: 1px solid var(--line); }
  .annotation-list { height: 300px; }
  .calendar-command { grid-template-columns: 1fr; }
  .calendar-overview { grid-template-columns: 1fr 1fr 1fr; }.risk-heat { grid-column: 1 / -1; border-right: 0; border-bottom: 1px solid var(--line); }
  .month-layout { grid-template-columns: 1fr; }.month-calendar { border-right: 0; }.day-agenda { border-top: 1px solid var(--line); }.day-event-list { height: auto; max-height: 520px; }
  .inline-modal { inset: 62px 0 0; }
  .manual-series-field, .manual-note-field { grid-column: 1 / -1; }
  .beef-price-controls { flex-wrap: wrap; }
  .beef-price-controls label { width: calc(50% - 5px); }
  .beef-price-controls .segmented-control { margin-left: 0; }
  .beef-price-main { grid-template-columns: 1fr; }
  .price-signal-panel { border-left: 0; border-top: 1px solid var(--line); }
}

@media (max-width: 640px) {
  .app-header { gap: 8px; padding: 0 9px; }
  .app-brand strong { max-width: 125px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size:clamp(15px, 14px + .12vw, 17px); }
  .app-brand > span { display: none; }
  .species-switch button { min-width: 54px; }
  .account-button { padding-right: 4px; }
  #account-name, .account-button > svg { display: none; }
  .page-content { padding: 9px; }
  .page-heading { display: block; }
  .page-meta { margin-top: 8px; justify-content: flex-start; }
  .metric-summary-grid, .model-score-strip, .dataset-summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .metric-summary, .model-score-strip article, .dataset-summary-grid article { padding: 11px; }
  .metric-summary:nth-child(2n), .model-score-strip article:nth-child(2n), .dataset-summary-grid article:nth-child(2n) { border-right: 0; }
  .metric-summary:nth-child(-n+2), .dataset-summary-grid article:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .model-score-strip article:nth-child(2) { border-right: 0; }
  .model-score-strip article:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .model-score-strip article:last-child { grid-column: 1 / -1; }
  .metric-summary-value { font-size:clamp(23px, 22px + .12vw, 25px); }
  .two-column-band { grid-template-columns: 1fr; }
  .two-column-band .coverage-panel { border-left: 0; border-top: 1px solid var(--line); }
  .chart-large { height: 350px; }
  .chart-main { height: 400px; }
  .chart-toolbar { align-items: flex-start; flex-direction: column; }
  .chart-toolbar strong { max-width: 100%; white-space: normal; }
  .toolbar-group { justify-content: flex-start; }
  .axis-bar { flex-wrap: wrap; }
  .axis-bar label { width: calc(50% - 5px); display: grid; }
  .axis-bar input { width: 100%; }
  .scenario-band { grid-template-columns: 1fr; }
  .scenario-result { grid-column: auto; }
  .audit-list > div { grid-template-columns: 1fr 1fr; }
  .audit-list small { grid-column: 1 / -1; }
  .file-drop { margin: 10px; text-align: center; padding: 14px; }
  .regional-kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .regional-kpi:nth-child(3n) { border-right: 1px solid var(--line); }
  .regional-kpi:nth-child(2n) { border-right: 0; }
  .regional-kpi:nth-child(n+4) { border-bottom: 1px solid var(--line); }
  .regional-kpi:nth-child(n+5) { border-bottom: 0; }
  .regional-map { height: 420px; }
  .regional-toolbar .segmented-control { width: 100%; }
  .regional-toolbar .segmented-control button { min-width: 0; flex: 1; }
  .map-legend { gap: 9px; justify-content: space-between; }
  .region-group { grid-template-columns: 1fr; }
  .region-group h4 { margin-top: 0; }
  .region-group > div { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .manual-update-form { grid-template-columns: 1fr; }
  .manual-series-field, .manual-note-field { grid-column: auto; }
  .manual-submit { width: 100%; }
  .report-workspace { grid-template-columns: 1fr; }
  .report-index { max-height: 300px; border-right: 0; border-bottom: 1px solid var(--line); }
  .report-reader { min-height: 620px; }
  .reader-toolbar { align-items: flex-start; flex-direction: column; }
  .reader-actions { width: 100%; justify-content: space-between; }
  .reader-view-switch { flex: 1; }
  .reader-view-switch button { flex: 1; }
  .report-original { height: 70vh; min-height: 520px; padding: 6px; }
  .pdf-annotator { height: 70vh; min-height: 520px; }
  .pdf-pages { padding: 10px 12px 30px; }
  .document-paper { width: calc(100% - 16px); padding: 32px 20px 60px; }
  .timeline-event { grid-template-columns: 62px 14px minmax(0,1fr) 30px; }
  .timeline-event:not(:last-child)::after { left: 78px; }
  .timeline-section > h3 { margin-left: 73px; }
  .calendar-controls { margin-top: 10px; justify-content: flex-start; }.calendar-controls > strong { order: -1; width: 100%; text-align: left; }
  .calendar-overview { grid-template-columns: 1fr; }.calendar-overview article { border-right: 0; border-bottom: 1px solid var(--line); }.calendar-overview article:last-child { border-bottom: 0; }
  .month-calendar { overflow-x: auto; }.weekday-row, .month-grid, .calendar-legend { min-width: 720px; }
  .beef-price-controls label { width: 100%; }
  .beef-price-controls .segmented-control { width: 100%; }
  .beef-price-controls .segmented-control button { flex: 1; }
  .beef-price-kpis { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .beef-price-kpis article:nth-child(2n) { border-right: 0; }
  .beef-price-kpis article:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .beef-price-kpis strong { font-size:clamp(22px, 21px + .12vw, 24px); }
  .beef-price-chart { height: 380px; }
}
