@font-face {
  font-family: "DM Sans";
  font-weight: 400 800;
  font-display: swap;
  src: url("./assets/dm-sans-latin.woff2") format("woff2");
}

:root {
  color-scheme: dark;
  font-family: "DM Sans", sans-serif;
  color: #f5f3f8;
  background: #0d0c10;
  --unit: min(.052083333vw, .092592593dvh);
  --muted: #aaa7b5;
  --border: #302c38;
  --accent: #c0abff;
  --focus: #d3c1ff;
}

* { box-sizing: border-box; }
body { margin: 0; }

button, input { font: inherit; }
button {
  color: inherit;
  cursor: pointer;
}
button:focus-visible, input:focus-visible, a:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
}

.dashboard {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: calc(18 * var(--unit));
  width: 100%;
  height: 100dvh;
  padding: calc(30 * var(--unit)) calc(48 * var(--unit)) calc(18 * var(--unit));
  background:
    radial-gradient(ellipse at 90% 0%, #1c142b 0%, transparent 42%),
    #0d0c10;
}

.masthead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: calc(28 * var(--unit));
  padding-bottom: calc(18 * var(--unit));
  border-bottom: 1px solid var(--border);
}

.masthead-brand { min-width: 0; }
.wordmark {
  display: block;
  width: calc(129 * var(--unit));
  height: auto;
  margin-bottom: calc(13 * var(--unit));
}

h1, h2, h3, p { margin: 0; }
h1 {
  font-size: calc(43 * var(--unit));
  font-weight: 750;
  line-height: 1;
  letter-spacing: -.06em;
}

.screen-nav {
  display: flex;
  gap: calc(4 * var(--unit));
  padding: calc(4 * var(--unit));
  border: 1px solid #383043;
  border-radius: calc(12 * var(--unit));
  background: #15121b;
}
.screen-link {
  display: block;
  padding: calc(12 * var(--unit)) calc(20 * var(--unit));
  border-radius: calc(8 * var(--unit));
  color: #c3bbd0;
  font-size: calc(19 * var(--unit));
  font-weight: 650;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
}
.screen-link[aria-current="page"] {
  background: #35264c;
  color: #efe4ff;
}
.screen-link:hover { color: white; }

.toolbar {
  display: flex;
  align-items: stretch;
  gap: calc(12 * var(--unit));
  flex-shrink: 0;
}
.toolbar button {
  min-height: calc(56 * var(--unit));
  border: 1px solid #3b3449;
  border-radius: calc(12 * var(--unit));
  background: #1b1723;
  transition: background-color 150ms ease, border-color 150ms ease;
}
.toolbar button:hover {
  border-color: #69518f;
  background: #241c33;
}
.toolbar .mode-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: calc(10 * var(--unit));
  padding: 0 calc(17 * var(--unit));
  color: #d9c9fb;
  font-size: calc(18 * var(--unit));
  font-weight: 700;
  line-height: 1.1;
}
.toolbar .mode-button[data-mode="demo"] {
  background: #2a1c42;
  border-color: #584075;
  color: #ebdfff;
}

.status-dot {
  display: inline-block;
  width: .48em;
  height: .48em;
  flex: 0 0 .48em;
  border-radius: 50%;
  background: currentColor;
}

.chevron {
  display: inline-block;
  width: .4em;
  height: .4em;
  flex: 0 0 .4em;
  margin: -.18em .08em 0 .14em;
  border-bottom: 1px solid currentColor;
  border-right: 1px solid currentColor;
  transform: rotate(45deg);
}

.period-button {
  display: grid;
  grid-template-columns: 1fr auto;
  align-content: center;
  align-items: center;
  column-gap: calc(14 * var(--unit));
  text-align: left;
  padding: calc(7 * var(--unit)) calc(15 * var(--unit));
  font-size: calc(18 * var(--unit));
  line-height: 1.12;
}
.period-label {
  font-weight: 700;
  grid-column: 1;
}
.period-dates {
  grid-column: 1;
  margin-top: calc(4 * var(--unit));
  color: #c0b8cd;
  font-size: .83em;
  white-space: nowrap;
}
.period-button .chevron { grid-area: 1 / 2 / span 2 / 3; }

.icon-button {
  display: grid;
  place-items: center;
}
.fullscreen-button {
  width: calc(56 * var(--unit));
  padding: 0;
  color: #d9c9fb;
  font-size: calc(21 * var(--unit));
}
.fullscreen-icon {
  width: .9em;
  height: .9em;
  background:
    linear-gradient(currentColor, currentColor) left top / .3em 2px,
    linear-gradient(currentColor, currentColor) left top / 2px .3em,
    linear-gradient(currentColor, currentColor) right top / .3em 2px,
    linear-gradient(currentColor, currentColor) right top / 2px .3em,
    linear-gradient(currentColor, currentColor) left bottom / .3em 2px,
    linear-gradient(currentColor, currentColor) left bottom / 2px .3em,
    linear-gradient(currentColor, currentColor) right bottom / .3em 2px,
    linear-gradient(currentColor, currentColor) right bottom / 2px .3em;
  background-repeat: no-repeat;
}
.fullscreen-button[aria-pressed="true"] .fullscreen-icon { transform: scale(.74); }

.sections {
  min-height: 0;
}
.tv-screen {
  display: grid;
  height: 100%;
  min-height: 0;
}
.tv-screen[hidden] { display: none; }
.sales-screen {
  grid-template-rows: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.75fr);
  gap: calc(16 * var(--unit));
}
.operations-screen { align-items: center; }
.metric-section {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: calc(8 * var(--unit));
  min-width: 0;
}
.metric-section h2 {
  display: flex;
  align-items: center;
  gap: calc(12 * var(--unit));
  color: #d3c1fb;
  font-size: calc(17 * var(--unit));
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.metric-section h2::before {
  content: "";
  width: calc(5 * var(--unit));
  height: .83em;
  border-radius: 2px;
  background: #aa7cf9;
}
.metric-section h2::after {
  content: "";
  flex: 1;
  height: 1px;
  margin-left: calc(4 * var(--unit));
  background: #2b2436;
}

.metric-grid {
  display: grid;
  gap: calc(13 * var(--unit));
  grid-template-columns: repeat(var(--columns), minmax(0, 1fr));
}
.marketing {
  --columns: 4;
  --value-size: 56;
}
.commercial {
  --columns: 5;
  --value-size: 54;
}
.commercial .metric-value:has(.unit) { --value-size: 50; }
.revenue {
  --columns: 3;
  --value-size: 98;
  gap: calc(17 * var(--unit));
}
.operations-screen .metric-grid {
  height: min(58dvh, calc(610 * var(--unit)));
  gap: calc(22 * var(--unit));
}
.operations-screen h2 { font-size: calc(23 * var(--unit)); }

.metric-card {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto auto;
  align-items: start;
  min-width: 0;
  min-height: 0;
  padding: calc(13 * var(--unit)) calc(18 * var(--unit)) calc(11 * var(--unit));
  background: linear-gradient(125deg, #19171f, #15141a 74%);
  border: 1px solid var(--border);
  border-radius: calc(14 * var(--unit));
}
.operations-screen .metric-card {
  padding: calc(44 * var(--unit)) calc(36 * var(--unit)) calc(36 * var(--unit));
  border-radius: calc(20 * var(--unit));
  background: linear-gradient(143deg, #241b34, #18151f 55%, #15141a);
}
.metric-card.metric-priority {
  background:
    radial-gradient(ellipse at top right, #8e59dd51, transparent 68%),
    linear-gradient(115deg, #332044, #261b36 52%, #1a1623);
  border-color: #735298;
  box-shadow: inset calc(3 * var(--unit)) 0 #bb8cff, 0 0 calc(18 * var(--unit)) #9668e51c;
}
.metric-title {
  color: #ddd9e6;
  font-weight: 650;
  font-size: calc(20 * var(--unit));
  line-height: 1.1;
  letter-spacing: -.015em;
}
.metric-priority .metric-title {
  color: #f3e7ff;
  font-weight: 750;
}
.metric-priority[data-status="available"] .metric-value {
  color: #fff8ff;
  text-shadow: 0 0 calc(18 * var(--unit)) #ba82fa45;
}
.operations-screen .metric-title { font-size: calc(31 * var(--unit)); }
.metric-value {
  display: flex;
  flex-wrap: nowrap;
  align-self: center;
  align-items: baseline;
  gap: .08em;
  min-width: 0;
  font-size: calc(var(--value-size) * var(--unit));
  font-variant-numeric: tabular-nums;
  font-weight: 750;
  line-height: 1;
  letter-spacing: -.075em;
  white-space: nowrap;
}
.metric-value[data-compact="true"] { font-size: calc(var(--value-size) * .81 * var(--unit)); }
.metric-value[data-compact="wide"] { font-size: calc(var(--value-size) * .67 * var(--unit)); }
.metric-value[data-compact="very-wide"] { font-size: calc(var(--value-size) * .54 * var(--unit)); }
.metric-value .unit {
  color: #b5adc5;
  font-size: .43em;
  font-weight: 650;
  letter-spacing: -.045em;
}
.metric-value .decimals {
  color: #dad4e5;
  font-size: .56em;
  font-weight: 650;
  letter-spacing: -.04em;
  margin-left: -.15em;
}
.metric-caption {
  display: flex;
  align-items: baseline;
  gap: .5em;
  min-height: 1.2em;
  min-width: 0;
  color: #bcb5c9;
  font-size: calc(15 * var(--unit));
  line-height: 1.12;
}
.metric-caption:empty { display: none; }
.operations-screen .metric-caption { font-size: calc(22 * var(--unit)); }
.metric-caption strong {
  color: #dac6ff;
  font-weight: 750;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.metric-caption[data-status="pending"],
.metric-caption[data-status="unavailable"] {
  color: #b9adc9;
}
.metric-caption .secondary-unavailable {
  font-size: .84em;
  color: #b5adc5;
}
.metric-card[data-status="pending"] .metric-value,
.metric-card[data-status="unavailable"] .metric-value {
  color: #a492bc;
  font-weight: 450;
}

.metric-goal {
  display: grid;
  gap: calc(4 * var(--unit));
  min-width: 0;
  margin-top: calc(7 * var(--unit));
  color: #b9afc9;
  font-size: calc(14 * var(--unit));
  line-height: 1.12;
  font-variant-numeric: tabular-nums;
}
.metric-goal:empty { display: none; }
.goal-line {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: calc(6 * var(--unit));
  min-width: 0;
}
.goal-label { min-width: 0; }
.goal-percent {
  color: #dac8ff;
  font-weight: 750;
  white-space: nowrap;
}
.metric-goal[data-state="met"] .goal-percent,
.metric-goal[data-state="within"] .goal-percent { color: #aee2c2; }
.metric-goal[data-state="over"] .goal-percent { color: #f0c68c; }
.goal-delta { color: #b6a9c8; }
.metric-goal progress {
  display: block;
  appearance: none;
  width: 100%;
  height: calc(5 * var(--unit));
  border: 0;
  border-radius: 99px;
  overflow: hidden;
  background: #30263e;
  color: #b48bff;
}
.metric-goal progress::-webkit-progress-bar { background: #30263e; }
.metric-goal progress::-webkit-progress-value {
  border-radius: 99px;
  background: linear-gradient(90deg, #8652e0, #c09bff);
}
.metric-goal progress::-moz-progress-bar {
  border-radius: 99px;
  background: linear-gradient(90deg, #8652e0, #c09bff);
}
.operations-screen .metric-goal {
  margin-top: calc(24 * var(--unit));
  gap: calc(12 * var(--unit));
  font-size: calc(21 * var(--unit));
}
.operations-screen .metric-goal progress { height: calc(9 * var(--unit)); }

.insights-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: calc(13 * var(--unit));
  min-height: 0;
}
.insight-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: calc(13 * var(--unit));
  min-width: 0;
  padding: calc(17 * var(--unit)) calc(18 * var(--unit)) calc(15 * var(--unit));
  border: 1px solid var(--border);
  border-radius: calc(15 * var(--unit));
  background: linear-gradient(155deg, #21192c, #17151d 60%);
}
.panel-header h2 {
  color: #f0e9fb;
  font-size: calc(24 * var(--unit));
  font-weight: 750;
  line-height: 1.05;
  letter-spacing: -.026em;
}
.panel-header p {
  margin-top: calc(5 * var(--unit));
  color: #b8adca;
  font-size: calc(15 * var(--unit));
  line-height: 1.2;
}
.panel-empty {
  grid-column: 1 / -1;
  align-self: center;
  justify-self: center;
  color: #baafcb;
  font-size: calc(18 * var(--unit));
  text-align: center;
}
.funnel {
  display: grid;
  align-content: stretch;
  grid-auto-rows: minmax(0, 1fr);
  gap: calc(3 * var(--unit));
  min-height: 0;
}
.funnel-stage {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr) calc(72 * var(--unit));
  align-items: center;
  column-gap: calc(8 * var(--unit));
  min-width: 0;
  --funnel-top: 100%;
  --funnel-bottom: 89%;
  --funnel-light: #a77aff;
  --funnel-dark: #733ec2;
}
.funnel-stage:nth-child(2) { --funnel-top: 89%; --funnel-bottom: 76%; }
.funnel-stage:nth-child(3) { --funnel-top: 76%; --funnel-bottom: 63%; }
.funnel-stage:nth-child(4) { --funnel-top: 63%; --funnel-bottom: 50%; }
.funnel-stage:nth-child(5) { --funnel-top: 50%; --funnel-bottom: 37%; }
.funnel-stage:nth-child(6) { --funnel-top: 37%; --funnel-bottom: 25%; }
.funnel-stage:nth-child(7) { --funnel-top: 25%; --funnel-bottom: 16%; }
.funnel-stage:nth-child(2n) { --funnel-light: #bf9aff; --funnel-dark: #8b58e2; }
.funnel-stage[data-status="pending"],
.funnel-stage[data-status="loading"],
.funnel-stage[data-status="unavailable"] {
  --funnel-light: #514363;
  --funnel-dark: #423653;
}
.funnel-label {
  color: #d6cee3;
  font-size: calc(16 * var(--unit));
  font-weight: 650;
  line-height: 1.08;
}
.funnel-shape {
  align-self: stretch;
  background: linear-gradient(105deg, var(--funnel-dark), var(--funnel-light));
  clip-path: polygon(
    calc(50% - var(--funnel-top) / 2) 0,
    calc(50% + var(--funnel-top) / 2) 0,
    calc(50% + var(--funnel-bottom) / 2) 100%,
    calc(50% - var(--funnel-bottom) / 2) 100%
  );
}
.funnel-value {
  color: #f3eaff;
  font-size: calc(22 * var(--unit));
  font-variant-numeric: tabular-nums;
  font-weight: 750;
  line-height: 1;
  text-align: right;
  white-space: nowrap;
}
.podium {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: stretch;
  gap: calc(7 * var(--unit));
  min-height: 0;
}
.podium:has(> :only-child) { grid-template-columns: minmax(0, 1fr); }
.podium:has(> :nth-child(2):last-child) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.podium:has(> :nth-child(3)) > .podium-place[data-rank="1"] { order: 1; }
.podium:has(> :nth-child(3)) > .podium-place[data-rank="2"] { order: 0; }
.podium:has(> :nth-child(3)) > .podium-place[data-rank="3"] { order: 2; }
.podium-place {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  justify-items: center;
  gap: calc(5 * var(--unit));
  min-width: 0;
  min-height: 0;
  padding-top: calc(var(--podium-offset) * var(--unit));
  text-align: center;
}
.podium-place[data-rank="2"] {
  --podium-offset: 34;
  --podium-avatar-size: 78;
  --step-height: 59;
  --podium-light: #f3f7fb;
  --podium-edge: #aebdcb;
  --podium-fill: #656e7c;
  --podium-base: #292e3a;
}
.podium-place[data-rank="1"] {
  --podium-offset: 0;
  --podium-avatar-size: 92;
  --step-height: 84;
  --podium-light: #ffebaa;
  --podium-edge: #eebb57;
  --podium-fill: #986721;
  --podium-base: #402910;
}
.podium-place[data-rank="3"] {
  --podium-offset: 55;
  --podium-avatar-size: 70;
  --step-height: 49;
  --podium-light: #ffd0aa;
  --podium-edge: #dc9368;
  --podium-fill: #8d5137;
  --podium-base: #43271e;
}
.podium-avatar {
  position: relative;
  display: grid;
  place-items: center;
  width: calc(var(--podium-avatar-size) * var(--unit));
  height: calc(var(--podium-avatar-size) * var(--unit));
  overflow: hidden;
  border: 2px solid var(--podium-edge);
  border-radius: 50%;
  background: var(--podium-base);
  box-shadow: 0 0 0 calc(2 * var(--unit)) var(--podium-base);
  color: var(--podium-light);
  font-size: calc(21 * var(--unit));
  font-weight: 700;
}
.podium-avatar img {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.demo-portrait {
  position: absolute;
  inset: 0;
  background-image: url("./assets/demo-podium.jpg");
  background-size: 300% 200%;
  background-repeat: no-repeat;
}
.podium-avatar[data-demo-portrait="1"] .demo-portrait { background-position: 50% 0; }
.podium-avatar[data-demo-portrait="2"] .demo-portrait { background-position: 100% 0; }
.podium-avatar[data-demo-portrait="3"] .demo-portrait { background-position: 0 100%; }
.podium-avatar[data-demo-portrait="4"] .demo-portrait { background-position: 50% 100%; }
.podium-avatar[data-demo-portrait="5"] .demo-portrait { background-position: 100% 100%; }
.podium-name {
  display: -webkit-box;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  color: #f2eafa;
  font-size: calc(19 * var(--unit));
  font-weight: 750;
  line-height: 1.12;
  overflow-wrap: anywhere;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}
.podium-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: calc(3 * var(--unit));
  width: 100%;
  min-width: 0;
  min-height: calc(var(--step-height) * var(--unit));
  padding: calc(3 * var(--unit));
  border: 1px solid var(--podium-edge);
  border-radius: calc(9 * var(--unit));
  background:
    linear-gradient(141deg, #ffffff24, #ffffff08 29%, transparent 29.5%),
    linear-gradient(165deg, var(--podium-fill), var(--podium-base) 83%);
  box-shadow: inset 0 calc(2 * var(--unit)) 0 var(--podium-light), inset 0 calc(-4 * var(--unit)) #0003;
  font-variant-numeric: tabular-nums;
}
.podium-rank {
  padding: calc(1 * var(--unit)) calc(9 * var(--unit));
  border-radius: 99px;
  background: linear-gradient(145deg, var(--podium-light), var(--podium-edge));
  color: #221b17;
  font-size: calc(16 * var(--unit));
  font-weight: 800;
  line-height: 1;
}
.podium-score {
  color: #f8f1ff;
  font-size: calc(21 * var(--unit));
  font-weight: 750;
  line-height: 1.1;
  overflow-wrap: anywhere;
}
.podium-details {
  display: grid;
  gap: calc(2 * var(--unit));
  min-height: calc(30 * var(--unit));
  max-width: 100%;
  margin: 0;
  padding: 0;
  color: #c4b7d7;
  font-size: calc(14 * var(--unit));
  line-height: 1.16;
  list-style: none;
  overflow-wrap: anywhere;
}
.podium-detail-value {
  margin-inline-start: .35em;
  color: #f3e8ff;
  font-weight: 750;
  font-variant-numeric: tabular-nums;
}

.status-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: calc(10 * var(--unit));
  padding-top: calc(12 * var(--unit));
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: calc(15 * var(--unit));
  line-height: 1.2;
}
.status-group, .data-status {
  display: flex;
  align-items: center;
  min-width: 0;
}
.status-group { gap: calc(20 * var(--unit)); }
.status-actions {
  display: flex;
  align-items: center;
  gap: calc(18 * var(--unit));
}
.logout-button {
  padding: .25em 0;
  border: 0;
  background: transparent;
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: .2em;
}
.data-status {
  gap: .5em;
  font-weight: 650;
}
.data-status[data-status="demo"] { color: #d6c1ff; }
.data-status[data-status="live"] { color: #a2dfb8; }
.data-status[data-status="stale"], .data-status[data-status="offline"] { color: #e8c191; }
.update-time {
  border-left: 1px solid #3c3549;
  padding-left: calc(20 * var(--unit));
}
.update-time time {
  margin-left: .35em;
  font-weight: 650;
  color: #e0dbe7;
  white-space: nowrap;
}

.login-page {
  display: grid;
  min-height: 100dvh;
  padding: 24px;
  place-items: center;
  background: radial-gradient(ellipse at 75% 0%, #241934, transparent 55%), #0d0c10;
}
.login-panel {
  width: min(100%, 420px);
  padding: clamp(24px, 6vw, 36px);
  border: 1px solid var(--border);
  border-radius: 18px;
  background: #1a1721;
}
.login-logo {
  display: block;
  width: 110px;
  height: auto;
  margin-bottom: 16px;
}
.login-panel h1 { font-size: clamp(28px, 7vw, 36px); }
.login-form {
  display: grid;
  gap: 15px;
  margin-top: 28px;
}
.login-form label {
  display: grid;
  gap: 6px;
  color: #e0dbe7;
  font-size: 15px;
  font-weight: 650;
}
.login-form input {
  min-width: 0;
  padding: 11px 12px;
  border: 1px solid #524365;
  border-radius: 8px;
  background: #141019;
  color: #f5f3f8;
  font-size: 16px;
}
.login-form .primary-button { min-height: 44px; }

dialog {
  width: min(490px, calc(100vw - 28px));
  padding: 24px;
  color: inherit;
  background: #1a1721;
  border: 1px solid #524365;
  border-radius: 17px;
  box-shadow: 0 25px 90px #0009;
}
dialog::backdrop { background: #08060bc9; }
.dialog-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}
.dialog-heading h2 { font-size: 23px; }
.close-dialog {
  border: 0;
  background: transparent;
  width: 28px;
  height: 28px;
  font-size: 24px;
  line-height: 1;
}
.period-presets { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 22px; }
.preset-button {
  padding: 7px 11px;
  border: 1px solid #4e415d;
  border-radius: 8px;
  background: #241e2d;
  font-size: 14px;
}
.preset-button[aria-pressed="true"],
.preset-button:hover,
.mode-option[aria-pressed="true"],
.mode-option:hover {
  border-color: #a981f0;
  background: #302142;
}
.date-fields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(145px, 1fr));
  gap: 12px;
}
.date-fields label {
  display: grid;
  gap: 7px;
  font-size: 15px;
}
.date-fields input {
  width: 100%;
  padding: 9px 10px;
  color: inherit;
  background: #100d15;
  border: 1px solid #524365;
  border-radius: 8px;
}
.primary-button {
  width: 100%;
  margin-top: 20px;
  padding: 10px;
  color: #1a1029;
  font-weight: 750;
  background: #c0a3f5;
  border: 1px solid transparent;
  border-radius: 8px;
}
.primary-button:hover { background: #cfb8fa; }
.form-error {
  margin-top: 12px;
  color: #ffc0c5;
  font-size: 14px;
}
.mode-options { display: grid; gap: 10px; }
.mode-option {
  display: grid;
  gap: 3px;
  padding: 12px 14px;
  text-align: left;
  background: #211b2b;
  border: 1px solid #4e415d;
  border-radius: 8px;
}
.mode-option span { color: #c5bacf; font-size: 14px; }
.visually-hidden {
  position: absolute;
  inset-block-start: 0;
  inset-inline-start: 0;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

@media (max-aspect-ratio: 7/5) {
  :root { --unit: clamp(.68px, .1vw, 1px); }
  .dashboard {
    height: auto;
    min-height: 100dvh;
    gap: 24px;
    padding: 22px;
  }
  .masthead {
    align-items: flex-start;
    flex-direction: column;
    gap: 18px;
  }
  .toolbar { max-width: 100%; }
  .tv-screen { height: auto; }
  .sales-screen { grid-template-rows: auto; gap: 20px; }
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .metric-card { min-height: calc(170 * var(--unit)); }
  .metric-value { font-size: calc(var(--value-size) * .82 * var(--unit)); }
  .operations-screen .metric-grid { height: auto; }
  .operations-screen .metric-card { min-height: calc(290 * var(--unit)); }
  .insights-grid { grid-template-columns: 1fr; }
  .insight-panel { min-height: calc(320 * var(--unit)); }
  .status-bar, .status-group {
    align-items: flex-start;
    flex-wrap: wrap;
  }
}
@media (max-aspect-ratio: 7/5) and (max-width: 520px) {
  .dashboard { padding: 16px; }
  .toolbar { flex-wrap: wrap; gap: 6px; }
  .toolbar button { min-height: 44px; }
  .screen-link { padding: 12px; font-size: 14px; }
  .metric-card { padding-inline: 12px; }
  .metric-value { font-size: calc(var(--value-size) * .7 * var(--unit)); }
  .metric-value[data-compact="true"] { font-size: calc(var(--value-size) * .58 * var(--unit)); }
  .metric-value[data-compact="wide"] { font-size: calc(var(--value-size) * .49 * var(--unit)); }
  .metric-value[data-compact="very-wide"] { font-size: calc(var(--value-size) * .41 * var(--unit)); }
  .metric-caption { flex-wrap: wrap; row-gap: 0; }
  .goal-line { flex-wrap: wrap; }
  .operations-screen .metric-grid { grid-template-columns: minmax(0, 1fr); }
  .operations-screen .metric-card {
    min-height: 20rem;
    padding: 24px;
  }
  .status-group { gap: 5px 10px; }
  .update-time { border: 0; padding: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .toolbar button { transition: none; }
}
