:root {
  --ink: #13213b;
  --muted: #65728a;
  --border: #d8e0ea;
  --surface: #ffffff;
  --background: #f4f6f9;
  --red: #d43135;
  --red-soft: #fff6f6;
  --shadow: 0 10px 28px rgba(35, 48, 70, .06);
}

* { box-sizing: border-box; }

html { min-height: 100%; background: var(--background); }

body { margin: 0; min-width: 320px; color: var(--ink); background: var(--background); font-family: Arial, Helvetica, sans-serif; }

button, input, select { font: inherit; }
button { cursor: pointer; }

.dashboard-app { width: min(1540px, 100%); min-height: 100vh; margin: 0 auto; padding: 22px clamp(18px, 3vw, 48px) 18px; }

.dashboard-header { display: grid; grid-template-columns: minmax(0, 1fr) minmax(650px, 1.35fr); align-items: center; gap: 24px; padding-bottom: 10px; border-bottom: 1px solid var(--border); }
.dashboard-title { min-width: 0; }
.dashboard-title .eyebrow { margin-bottom: 5px; }
.dashboard-title .dashboard-header-actions { justify-content: flex-start; margin-top: 14px; }

.dashboard-header-right { display: grid; gap: 8px; min-width: 0; }
.dashboard-header-actions { display: flex; align-items: center; justify-content: flex-end; gap: 10px; }
.outline-button, .icon-button, .range-controls button { min-height: 44px; border: 1px solid var(--border); border-radius: 8px; color: var(--ink); background: var(--surface); font-weight: 700; }
.outline-button { display: inline-flex; align-items: center; gap: 10px; padding: 0 16px; }
.icon-button { display: grid; place-items: center; width: 44px; padding: 0; }
.outline-button:hover, .icon-button:hover, .range-controls button:hover { border-color: var(--red); color: var(--red); }
.icon-button.is-loading { border-color: #f1b8ba; color: var(--red); }
.icon-button.is-loading .icon-refresh { animation: dashboard-refresh-spin .8s linear infinite; }

.icon { display: inline-block; position: relative; width: 20px; height: 20px; flex: 0 0 auto; }
.icon-calendar:before { content: ""; position: absolute; inset: 4px 2px 2px; border: 2px solid currentColor; border-radius: 3px; }
.icon-calendar:after { content: ""; position: absolute; left: 5px; right: 5px; top: 1px; height: 6px; border-left: 2px solid currentColor; border-right: 2px solid currentColor; }
.icon-expand:before { content: "↗"; font-size: 24px; line-height: 20px; }
.icon-refresh:before { content: "↻"; font-size: 26px; line-height: 18px; }
.icon-logout:before { content: "⇥"; font-size: 27px; line-height: 18px; }
.icon-map:before { content: "⌖"; font-size: 27px; line-height: 18px; color: var(--red); }

.dashboard-information { display: grid; grid-template-columns: minmax(220px, .9fr) minmax(300px, 1fr); gap: 8px; min-width: 0; }
.dashboard-info-left, .dashboard-info-stack { display: grid; gap: 8px; min-width: 0; }
.dashboard-info-left { grid-template-rows: minmax(0, 1fr) minmax(0, 1fr); }
.dashboard-info-card { display: grid; align-items: center; min-width: 0; min-height: 44px; padding: 8px 12px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); box-shadow: var(--shadow); text-align: center; }
.dashboard-info-card > span { color: var(--muted); font-size: 12px; }
.dashboard-info-card > strong { min-width: 0; overflow: hidden; color: var(--ink); font-size: 16px; text-overflow: ellipsis; white-space: nowrap; }
.election-notice-card { position: relative; overflow: hidden; border-color: #f1b8ba; color: var(--ink); background: var(--red-soft); cursor: pointer; }
.election-notice-card:focus-visible { outline: 2px solid rgba(212, 49, 53, .42); outline-offset: 2px; }
.election-notice-card .ticker-track { position: absolute; inset: 0; display: block; animation: ticker-scroll-vertical 34s ease-in-out infinite; will-change: transform; }
.election-notice-card .ticker-track span { display: grid; grid-template-columns: auto minmax(0, auto) auto; place-content: center; align-items: center; gap: 8px; width: 100%; height: 100%; padding: 3px 12px; color: var(--ink); font-size: 14px; font-weight: 800; line-height: 1.25; text-align: center; }
.election-notice-card .ticker-track span b { color: var(--red); font-size: 17px; line-height: 1; }
.election-notice-card.is-paused .ticker-track { animation-play-state: paused; }
@keyframes ticker-scroll-vertical {
  0%, 12% { transform: translateY(0); }
  16%, 28% { transform: translateY(-100%); }
  32%, 44% { transform: translateY(-200%); }
  48%, 60% { transform: translateY(-300%); }
  64%, 76% { transform: translateY(-400%); }
  80%, 92% { transform: translateY(-500%); }
  100% { transform: translateY(-600%); }
}
@keyframes dashboard-refresh-spin { to { transform: rotate(360deg); } }
.party-card { grid-template-columns: minmax(0, 1fr) auto; gap: 2px 8px; }
.party-card > span:first-child { grid-column: 1 / -1; font-weight: 700; }
.party-card > strong { color: var(--red); }
.party-card .info-chevron { grid-column: 2; grid-row: 2; color: var(--red); font-size: 18px; }
.import-card { grid-template-columns: 1fr; gap: 2px; }
.import-card > strong { font-size: 17px; }
.dashboard-info-stack .phase-control { min-height: 44px; padding: 8px 12px; }
.dashboard-info-stack .phase-control select { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.countdown-card { border-color: #f1b8ba; background: var(--red-soft); }
.countdown-card > strong { color: var(--red); font-size: 20px; }

.eyebrow { margin: 0 0 6px; color: var(--muted); font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 3px; font-size: clamp(32px, 4vw, 54px); line-height: .98; }
.intro-copy { margin-bottom: 0; color: var(--muted); font-size: clamp(16px, 1.6vw, 22px); line-height: 1.1; }
.phase-control { display: grid; gap: 6px; min-width: 0; padding: 11px 14px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); box-shadow: var(--shadow); }
.phase-control label, .date-field span { color: var(--muted); font-size: 12px; font-weight: 800; }
.phase-control select { border: 0; outline: 0; color: var(--ink); background: transparent; font-weight: 700; }

.range-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 18px; padding: 14px 16px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); box-shadow: var(--shadow); }
.range-heading { display: flex; align-items: center; gap: 12px; min-width: 0; }
.range-heading > .icon { color: var(--red); }
.range-heading div { display: grid; gap: 4px; }
.range-heading small { color: var(--muted); font-size: 12px; }
.range-controls { display: flex; align-items: end; justify-content: end; flex-wrap: wrap; gap: 8px; }
.range-controls button { padding: 0 14px; white-space: nowrap; }
.range-controls button.is-selected { border-color: var(--red); color: #fff; background: var(--red); }
.date-field { display: grid; gap: 4px; min-width: 132px; }
.date-field input { min-height: 42px; padding: 0 9px; border: 1px solid var(--border); border-radius: 7px; color: var(--ink); background: #fff; }
.date-field input:focus { outline: 2px solid rgba(212, 49, 53, .2); border-color: var(--red); }

.dashboard-message { padding: 20px; border: 1px solid #f1b8ba; border-radius: 8px; color: #7c2225; background: var(--red-soft); text-align: center; font-weight: 700; }
.kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.kpi-card { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 14px; min-height: 136px; padding: 18px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); box-shadow: var(--shadow); text-align: center; }
.kpi-card-action { width: 100%; color: inherit; font: inherit; cursor: pointer; }
.kpi-card-action:hover { border-color: var(--red); box-shadow: 0 12px 30px rgba(212, 49, 53, .12); }
.kpi-card .kpi-icon { display: grid; place-items: center; width: 50px; height: 50px; border-radius: 50%; color: #fff; background: var(--red); font-size: 22px; font-weight: 900; }
.kpi-card > div { min-width: 0; text-align: center; }
.kpi-card span { display: block; color: var(--muted); font-size: 14px; font-weight: 700; }
.kpi-card strong { display: block; margin-top: 5px; font-size: clamp(30px, 3.2vw, 48px); line-height: 1; }
.kpi-card small { display: block; margin-top: 5px; color: var(--muted); font-size: 11px; }

.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.18fr) minmax(300px, .82fr) minmax(330px, .95fr); gap: 16px; }
.dashboard-panel { min-width: 0; padding: 20px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); box-shadow: var(--shadow); text-align: center; }
.panel-heading { display: flex; align-items: center; justify-content: center; gap: 12px; padding-bottom: 14px; border-bottom: 1px solid var(--border); text-align: center; }
.panel-heading h2 { margin-bottom: 0; font-size: clamp(19px, 2vw, 27px); }
.panel-period { color: var(--muted); font-size: 13px; white-space: nowrap; }
.mail-panel .panel-heading { justify-content: space-between; text-align: left; }
.mail-panel .panel-heading h2 { font-size: clamp(17px, 1.8vw, 24px); white-space: nowrap; }
.metric-strip { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; padding: 18px 0 12px; text-align: center; }
.metric { min-width: 0; padding: 0 12px; border-right: 1px solid var(--border); text-align: center; }
.metric:first-child { padding-left: 0; }
.metric:last-child { padding-right: 0; border-right: 0; }
.metric span { display: block; color: var(--muted); font-size: 13px; }
.metric strong { display: block; margin-top: 7px; color: var(--red); font-size: clamp(22px, 2.5vw, 34px); }
.trend-heading { display: flex; justify-content: center; gap: 12px; padding: 8px 0; color: var(--muted); font-size: 12px; font-weight: 700; text-align: center; }
.trend-key { display: flex; align-items: center; gap: 6px; }
.trend-key i { display: inline-block; width: 18px; height: 3px; margin-left: 8px; background: var(--red); }
.trend-key .key-today { opacity: .4; }
.mail-trend { display: grid; grid-template-columns: repeat(7, minmax(24px, 1fr)); align-items: end; gap: 8px; min-height: 154px; padding: 14px 5px 10px; border-top: 1px solid var(--border); }
.trend-day { display: grid; grid-template-rows: 1fr auto; gap: 8px; min-width: 0; height: 126px; }
.trend-bars { display: flex; align-items: end; justify-content: center; gap: 4px; min-height: 0; }
.trend-bars i { display: block; width: 10px; min-height: 3px; border-radius: 4px 4px 0 0; background: var(--red); }
.trend-bars i:last-child { opacity: .4; }
.trend-day small { overflow: hidden; color: var(--muted); font-size: 10px; text-align: center; text-overflow: ellipsis; white-space: nowrap; }
.field-metrics { display: grid; grid-template-columns: 1fr; gap: 0; margin-top: 12px; }
.field-panel .field-metrics { text-align: left; }
.field-metric { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 15px 0; border-bottom: 1px solid var(--border); text-align: left; }
.field-metric span { color: var(--muted); }
.field-metric strong { font-size: 24px; }
.coverage-line { display: grid; gap: 10px; margin-top: 18px; text-align: center; }
.coverage-line > div:first-child { display: flex; justify-content: center; gap: 12px; }
.coverage-line span { color: var(--muted); font-size: 13px; }
.progress-track { height: 12px; overflow: hidden; border-radius: 999px; background: #e7ebf0; }
.progress-track span { display: block; width: 0; height: 100%; border-radius: inherit; background: var(--red); transition: width .25s ease; }
.priority-header, .priority-row { display: grid; grid-template-columns: 30px 1fr 84px; align-items: center; gap: 10px; text-align: center; }
.priority-header { padding: 14px 0 8px; color: var(--muted); font-size: 12px; font-weight: 700; }
.priority-header span:last-child { text-align: center; }
.priority-row { padding: 11px 0; border-top: 1px solid var(--border); }
.priority-number { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; color: #fff; background: var(--red); font-size: 12px; font-weight: 800; }
.priority-name { min-width: 0; }
.priority-name strong { display: block; overflow: hidden; font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
.priority-name small { display: block; margin-top: 4px; color: var(--muted); font-size: 11px; }
.priority-value { text-align: center; font-size: 13px; font-weight: 700; }
.priority-progress { grid-column: 2 / -1; height: 7px; overflow: hidden; border-radius: 999px; background: #e7ebf0; }
.priority-progress span { display: block; height: 100%; border-radius: inherit; background: var(--red); }
.priority-rows { max-height: 360px; overflow-y: auto; padding-right: 5px; scrollbar-color: #aab4c2 transparent; scrollbar-width: thin; }
.empty-state { margin: 20px 0; color: var(--muted); font-size: 13px; text-align: center; }

.dashboard-footer { display: grid; justify-items: center; gap: 8px; padding: 12px 0 0; color: var(--muted); font-size: 12px; }
.dashboard-footer-links { display: flex; flex-wrap: nowrap; justify-content: center; gap: 10px; max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.dashboard-footer-links::-webkit-scrollbar { display: none; }
.dashboard-footer-links button { display: grid; place-items: center; flex: 0 0 48px; width: 48px; height: 48px; padding: 0; border: 1px solid var(--border); border-radius: 50%; color: var(--muted); background: var(--surface); box-shadow: 0 8px 18px rgba(20, 32, 48, .08); transition: background .16s ease, border-color .16s ease, color .16s ease, transform .16s ease; }
.dashboard-footer-links button:hover, .dashboard-footer-links button:focus-visible { border-color: rgba(212, 49, 53, .34); color: var(--red); background: var(--red-soft); transform: translateY(-1px); }
.dashboard-footer-links svg { width: 21px; height: 21px; fill: currentColor; }
.dashboard-footer-copy { display: grid; gap: 1px; text-align: center; }
.dashboard-footer-copy p { margin: 0; }
.dashboard-footer-copy a { color: inherit; font-weight: 800; text-decoration: none; }
.dashboard-footer-copy a:hover, .dashboard-footer-copy a:focus-visible { color: var(--red); text-decoration: underline; }
.dashboard-updated { display: none; }

.icon-close:before, .icon-close:after { content: ""; position: absolute; top: 9px; left: 3px; width: 16px; height: 2px; background: currentColor; }
.icon-close:before { transform: rotate(45deg); }
.icon-close:after { transform: rotate(-45deg); }

.dashboard-modal[hidden] { display: none; }
.dashboard-modal { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 20px; }
.dashboard-modal-backdrop { position: absolute; inset: 0; background: rgba(19, 33, 59, .42); backdrop-filter: blur(3px); }
.dashboard-modal-window { position: relative; width: min(880px, 100%); max-height: min(760px, calc(100vh - 40px)); overflow: hidden; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); box-shadow: 0 24px 70px rgba(19, 33, 59, .24); }
.dashboard-modal-header { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 26px 28px 18px; border-bottom: 1px solid var(--border); }
.dashboard-modal-header h2 { margin: 0; font-size: clamp(23px, 3vw, 30px); }
.dashboard-modal-actions { display: flex; align-items: center; gap: 8px; }
.modal-action-button { min-height: 44px; padding: 0 15px; border: 1px solid var(--border); border-radius: 8px; color: var(--ink); background: var(--surface); font-weight: 800; }
.modal-action-button:hover { border-color: var(--red); color: var(--red); }
.dashboard-modal-body { max-height: calc(min(760px, 100vh - 40px) - 111px); overflow-y: auto; padding: 8px 28px 24px; }
.resource-description { margin: 8px 0 12px; color: var(--muted); font-size: 14px; }
.resource-list { display: grid; gap: 10px; }
.resource-card { display: grid; gap: 4px; padding: 14px 16px; border: 1px solid var(--border); border-radius: 8px; color: var(--ink); background: #fbfcfe; text-decoration: none; }
.resource-card:hover, .resource-card:focus-visible { border-color: var(--red); background: var(--red-soft); }
.resource-card span { font-weight: 800; }
.resource-card strong { overflow: hidden; color: var(--muted); font-size: 12px; font-weight: 400; text-overflow: ellipsis; white-space: nowrap; }
.notice-tabs { display: grid; gap: 10px; }
.notice-tab-list { display: inline-flex; gap: 6px; width: fit-content; padding: 4px; border: 1px solid var(--border); border-radius: 8px; background: #f8fafc; }
.notice-tab-list button { min-height: 30px; padding: 0 12px; border: 0; border-radius: 7px; color: var(--muted); background: transparent; font-size: 12px; font-weight: 800; }
.notice-tab-list button.active { color: #fff; background: var(--red); }
.election-notice-detail { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.election-notice-detail section { padding: 14px; border: 1px solid var(--border); border-radius: 8px; background: #fbfcfe; }
.election-notice-detail section:first-child { grid-column: 1 / -1; }
.election-notice-detail h3 { margin: 0 0 10px; font-size: 14px; }
.election-notice-detail p { margin: 0; font-weight: 800; }
.notice-date-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.notice-date-grid div { padding: 10px; border: 1px solid var(--border); border-radius: 7px; background: #fff; text-align: center; }
.notice-date-grid span, .notice-date-grid small { display: block; color: var(--muted); font-size: 12px; font-weight: 800; }
.notice-date-grid strong { display: block; margin-top: 5px; font-size: 18px; }
.election-calendar { display: grid; gap: 7px; max-width: 100%; }
.calendar-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; background: #fbfcfe; }
.calendar-toolbar span, .calendar-weekdays span { display: block; color: var(--muted); font-size: 12px; font-weight: 800; }
.calendar-toolbar strong { display: block; margin-top: 1px; font-size: 18px; }
.calendar-nav { display: flex; align-items: center; justify-content: flex-end; gap: 4px; padding: 3px; border: 1px solid var(--border); border-radius: 8px; background: #fff; }
.calendar-nav button { min-height: 30px; padding: 0 8px; border: 0; border-radius: 6px; color: var(--ink); background: transparent; font-size: 12px; font-weight: 800; }
.calendar-icon-button { width: 32px; }
.calendar-today-button { min-width: 72px; }
.calendar-nav button:hover, .calendar-nav button:focus-visible { color: var(--red); background: #fff7f7; }
.calendar-weekdays, .calendar-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 5px; }
.calendar-weekdays span { text-align: center; }
.calendar-grid { grid-auto-rows: 58px; }
.calendar-day { height: 58px; overflow: hidden; padding: 5px; border: 1px solid var(--border); border-radius: 8px; background: #fff; }
.calendar-day.is-empty { background: #f8fafc; }
.calendar-day.is-today { border-color: rgba(212, 49, 53, .58); box-shadow: inset 0 0 0 2px rgba(212, 49, 53, .12); }
.calendar-day.has-event { background: #fffafa; }
.calendar-day strong { display: block; margin-bottom: 3px; font-size: 12px; }
.calendar-event { display: block; overflow: hidden; margin-top: 2px; padding: 2px 4px; border-radius: 6px; color: var(--red); background: rgba(212, 49, 53, .11); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.county-analysis-row { display: grid; grid-template-columns: minmax(190px, .7fr) minmax(200px, 1.4fr) 100px; align-items: center; gap: 18px; padding: 18px 0; border-bottom: 1px solid var(--border); }
.county-analysis-name { min-width: 0; text-align: left; }
.county-analysis-name strong { display: block; font-size: 21px; }
.county-analysis-name span { display: block; margin-top: 5px; color: var(--muted); font-size: 15px; }
.county-analysis-bar { height: 18px; overflow: hidden; border-radius: 999px; background: #e7ebf0; }
.county-analysis-bar span { display: block; height: 100%; border-radius: inherit; background: var(--red); }
.county-analysis-value { font-size: 22px; font-weight: 800; text-align: right; }
.county-analysis-total { display: flex; justify-content: space-between; gap: 20px; padding-top: 18px; color: var(--muted); font-weight: 700; }
.county-analysis-total strong { color: var(--ink); font-size: 18px; }

@media (max-width: 1120px) {
  .dashboard-header { grid-template-columns: 1fr; gap: 12px; }
  .dashboard-header-right { width: 100%; }
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dashboard-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mail-panel { grid-column: 1 / -1; }
}

@media (max-width: 760px) {
  .dashboard-app { padding: 12px 12px 16px; }
  .dashboard-header { grid-template-columns: minmax(0, 1fr) auto; align-items: start; gap: 10px; }
  .dashboard-title { grid-column: 1 / -1; }
  .dashboard-title h1 { font-size: 38px; }
  .dashboard-title .intro-copy { font-size: 16px; }
  .dashboard-information { grid-template-columns: 1fr; }
  .dashboard-info-left { grid-template-rows: auto auto; }
  .dashboard-info-stack { grid-template-columns: 1fr; }
  .phase-control { grid-column: auto; width: 100%; }
  .dashboard-header-actions { gap: 6px; }
  .outline-button { width: 44px; padding: 0; justify-content: center; }
  .outline-button span:last-child { display: none; }
  .range-toolbar { display: grid; align-items: stretch; }
  .range-controls { display: grid; grid-template-columns: repeat(4, 1fr); }
  .range-controls button { min-width: 0; padding: 0 5px; font-size: 12px; }
  .date-field { grid-column: span 2; }
  .kpi-grid, .dashboard-grid { grid-template-columns: 1fr; }
  .mail-panel { grid-column: auto; }
  .kpi-card { min-height: 112px; }
  .kpi-card strong { font-size: 34px; }
  .metric-strip { grid-template-columns: repeat(2, 1fr); row-gap: 15px; }
  .metric:nth-child(2) { border-right: 0; }
  .metric:nth-child(3), .metric:nth-child(4) { padding-top: 12px; border-top: 1px solid var(--border); }
  .metric:nth-child(3) { padding-left: 0; }
  .metric:nth-child(4) { padding-right: 0; }
  .panel-heading { align-items: start; }
  .mail-panel .panel-heading h2 { white-space: normal; }
  .panel-period { font-size: 11px; }
  .dashboard-footer-links { justify-content: flex-start; width: 100%; }
  .dashboard-modal { padding: 10px; }
  .dashboard-modal-header { align-items: start; padding: 20px 18px 14px; }
  .dashboard-modal-header h2 { font-size: 22px; }
  .dashboard-modal-body { padding: 4px 18px 18px; }
  .election-notice-detail, .notice-date-grid { grid-template-columns: 1fr; }
  .notice-tab-list { width: 100%; }
  .notice-tab-list button { flex: 1; }
  .calendar-toolbar { align-items: stretch; flex-direction: column; }
  .calendar-nav { justify-content: center; }
  .calendar-grid { min-width: 720px; }
  .election-calendar { overflow-x: auto; }
  .county-analysis-row { grid-template-columns: minmax(120px, .8fr) minmax(90px, 1fr) 78px; gap: 10px; padding: 14px 0; }
  .county-analysis-name strong { font-size: 17px; }
  .county-analysis-name span { font-size: 12px; }
  .county-analysis-value { font-size: 17px; }
}

@media (display-mode: fullscreen) {
  .dashboard-app { padding: 12px clamp(18px, 2.5vw, 40px) 10px; }
  .dashboard-header { padding-bottom: 8px; }
  .range-toolbar { margin-bottom: 12px; padding: 10px 14px; }
  .kpi-grid { gap: 10px; margin-bottom: 12px; }
  .kpi-card { min-height: 106px; padding: 14px; }
  .dashboard-panel { padding: 14px; }
  .panel-heading { padding-bottom: 9px; }
  .metric-strip { padding: 12px 0 8px; }
  .mail-trend { min-height: 120px; padding: 8px 5px 6px; }
  .trend-day { height: 104px; }
  .field-metric { padding: 10px 0; }
  .dashboard-footer { gap: 6px; padding-top: 8px; }
  .dashboard-footer-links { gap: 8px; }
  .dashboard-footer-links button { flex-basis: 42px; width: 42px; height: 42px; }
  .dashboard-footer-links svg { width: 18px; height: 18px; }
  .dashboard-footer-copy { font-size: 11px; }
}

:fullscreen { overflow: hidden; }
:fullscreen body { height: 100vh; overflow: hidden; }
:fullscreen .dashboard-app { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; height: 100vh; min-height: 0; padding-top: 12px; padding-bottom: 10px; overflow: hidden; }
:fullscreen .dashboard-header { padding-bottom: 8px; }
:fullscreen main { display: flex; min-height: 0; flex-direction: column; overflow: hidden; }
:fullscreen .range-toolbar { flex: 0 0 auto; }
:fullscreen #dashboardContent { display: flex; min-height: 0; flex: 1; flex-direction: column; overflow: hidden; }
:fullscreen .kpi-grid { flex: 0 0 auto; }
:fullscreen .dashboard-grid { min-height: 0; flex: 1; grid-template-rows: minmax(0, 1fr); }
:fullscreen .dashboard-panel { min-height: 0; overflow: hidden; }
:fullscreen .priority-panel { display: flex; flex-direction: column; }
:fullscreen .priority-rows { min-height: 0; max-height: none; flex: 1; overflow-y: auto; }

@media (min-width: 761px) {
  :fullscreen .dashboard-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  :fullscreen .mail-panel { grid-column: auto; }
}

/* Keep the candidate view compact at a glance while allowing it to reflow cleanly. */
html, body { overflow-x: hidden; }
.dashboard-app { width: min(1840px, 100%); overflow-x: clip; }
.kpi-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; }
.kpi-card { grid-template-columns: 1fr; gap: 8px; min-height: 118px; padding: 14px 12px; }
.kpi-card .kpi-icon { width: 40px; height: 40px; margin: 0 auto; font-size: 18px; }
.kpi-card strong { font-size: clamp(27px, 2.7vw, 42px); }
.dashboard-panel { padding: 16px; }
.panel-heading { padding-bottom: 10px; }
.mail-panel .panel-heading h2 { font-size: clamp(17px, 1.55vw, 22px); }
.field-metric { padding: 10px 0; }
.field-metric strong { font-size: 20px; }
.coverage-line { margin-top: 12px; }
.priority-rows { max-height: 294px; overflow-x: hidden; overflow-y: auto; padding-right: 5px; scrollbar-color: #aab4c2 transparent; scrollbar-width: thin; }
.priority-row { padding: 8px 0; }
.priority-name strong { font-size: 13px; }
.priority-name small { margin-top: 2px; }
.priority-progress { height: 6px; }
.priority-row.is-high-volume { border-left: 3px solid #d9981e; border-radius: 4px; background: #fffaf0; padding-left: 7px; }
.priority-row.is-high-volume .priority-number { background: #d9981e; }
.priority-row.is-high-volume .priority-progress span { background: #d9981e; }
.priority-value { display: grid; justify-items: center; gap: 3px; }
.priority-high-volume { padding: 2px 5px; border: 1px solid #e7c778; border-radius: 999px; color: #805b10; background: #fff1c9; font-size: 9px; font-weight: 800; line-height: 1; }
.dashboard-footer-links { flex-wrap: wrap; overflow: visible; }

@media (max-width: 1440px) and (min-width: 1121px) {
  .dashboard-header { grid-template-columns: minmax(320px, .8fr) minmax(0, 1.2fr); gap: 16px; }
  .kpi-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 1120px) and (min-width: 761px) {
  .dashboard-header { grid-template-columns: 1fr; gap: 12px; }
  .dashboard-header-right { width: 100%; }
  .kpi-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .dashboard-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mail-panel { grid-column: 1 / -1; }
}

@media (max-width: 760px) {
  .dashboard-app { width: 100%; padding: 12px 12px 16px; }
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .kpi-card { grid-template-columns: auto 1fr; min-height: 92px; padding: 12px 10px; text-align: left; }
  .kpi-card .kpi-icon { width: 34px; height: 34px; margin: 0; font-size: 16px; }
  .kpi-card > div { text-align: center; }
  .kpi-card span { font-size: 12px; }
  .kpi-card strong { font-size: clamp(24px, 8vw, 34px); }
  .kpi-card small { font-size: 10px; }
  .dashboard-footer-links { justify-content: center; width: 100%; }
  .dashboard-footer-links button { flex-basis: 42px; width: 42px; height: 42px; }
}

:fullscreen .priority-rows { max-height: none; overflow-x: hidden; overflow-y: auto; padding-right: 5px; }
