:root {
  color-scheme: light;
  --page: #f6f5f0;
  --surface: #ffffff;
  --surface-soft: #fafbf8;
  --surface-green: #edf5ee;
  --text: #202a24;
  --muted: #5e6a61;
  --line: #dce3d9;
  --line-strong: #bbc9bb;
  --green: #256445;
  --green-dark: #174d32;
  --green-soft: #dcecdf;
  --focus: #126f8d;
  --warning-text: #785115;
  --warning-bg: #fff8e9;
  --warning-line: #e6d19b;
  --error-text: #963c31;
  --error-bg: #fff2ed;
  --error-line: #e7c2b6;
  --radius: 18px;
  --radius-small: 10px;
  --shadow: 0 4px 20px rgb(32 42 36 / 3%);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  background: var(--page);
  scroll-padding-top: 24px;
}

body {
  margin: 0;
  color: var(--text);
  background: var(--page);
  font-size: 14px;
  line-height: 1.5;
}

button,
input,
select {
  font: inherit;
}

button,
select,
summary {
  cursor: pointer;
}

button,
input,
select,
a,
summary {
  -webkit-tap-highlight-color: transparent;
}

a {
  color: var(--green);
  text-underline-offset: 3px;
}

a:hover {
  color: var(--green-dark);
}

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

button:disabled,
input:disabled,
select:disabled {
  cursor: not-allowed;
  color: #79837b;
  opacity: 0.65;
}

input:disabled,
select:disabled {
  background-color: #eef1eb;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1,
h2,
h3 {
  line-height: 1.25;
  font-weight: 650;
}

h1 {
  font-size: clamp(26px, 2.65vw, 38px);
  letter-spacing: -0.035em;
}

h2 {
  font-size: 20px;
  letter-spacing: -0.02em;
}

h3 {
  font-size: 17px;
}

.muted {
  color: var(--muted);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  z-index: 100;
  top: 12px;
  left: 16px;
  padding: 12px 18px;
  border-radius: var(--radius-small);
  background: var(--green-dark);
  color: #fff;
  font-weight: 600;
  transform: translateY(-170%);
}

.skip-link:focus {
  transform: translateY(0);
  color: #fff;
}

.app-shell {
  width: min(100% - 64px, 1440px);
  margin: 0 auto;
  padding: 40px 0 28px;
}

.topbar,
.topbar-actions,
.account-heading,
.account-identity,
.panel-header,
.section-heading,
.export-controls,
.export-actions,
.dialog-header {
  display: flex;
  align-items: center;
}

.topbar {
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 30px;
}

.eyebrow {
  color: var(--green);
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 0.16em;
}

.brand .eyebrow {
  margin-bottom: 9px;
}

.brand > .muted {
  margin-top: 8px;
  font-size: 15px;
}

.topbar-actions,
.export-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.button {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 10px 16px;
  border: 1px solid transparent;
  border-radius: var(--radius-small);
  font-weight: 600;
  font-size: 13px;
  line-height: 1.4;
  text-align: center;
  text-decoration: none;
  transition: background-color 120ms ease, border-color 120ms ease;
}

.button-primary {
  border-color: var(--green);
  background: var(--green);
  color: #fff;
}

.button-primary:hover:not(:disabled) {
  border-color: var(--green-dark);
  background: var(--green-dark);
  color: #fff;
}

.button-secondary {
  border-color: var(--line-strong);
  background: var(--surface);
  color: var(--text);
}

.button-secondary:hover:not(:disabled) {
  border-color: var(--green);
  background: var(--surface-green);
  color: var(--green-dark);
}

.button-quiet {
  background: transparent;
  color: var(--green);
}

.button-quiet:hover:not(:disabled) {
  background: var(--green-soft);
}

.control-panel,
.panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.control-panel {
  padding: 22px 24px 0;
  margin-bottom: 28px;
}

.filters-top {
  display: flex;
  align-items: end;
  flex-wrap: wrap;
  gap: 20px;
}

.field {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 7px;
}

.field > span {
  font-size: 12px;
  font-weight: 600;
}

.field > span .muted {
  margin-left: 4px;
  font-weight: 400;
}

.field-wide {
  flex: 1 1 250px;
}

input,
select {
  min-width: 0;
  min-height: 42px;
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-small);
  background-color: var(--surface);
  color: var(--text);
  line-height: 1.4;
}

select {
  padding-right: 30px;
}

input::placeholder {
  color: #7b857d;
  opacity: 1;
}

input:hover:not(:disabled),
select:hover:not(:disabled) {
  border-color: #869d88;
}

input:focus,
select:focus {
  border-color: var(--green);
}

input[type="date"] {
  min-width: 145px;
  font-variant-numeric: tabular-nums;
}

input[type="search"]::-webkit-search-cancel-button {
  cursor: pointer;
}

.date-range {
  display: flex;
  flex: 1 1 385px;
  align-items: end;
  justify-content: flex-end;
  gap: 10px;
}

.date-range .field {
  flex: 1 1 145px;
}

.date-range .button {
  flex-shrink: 0;
}

.segmented {
  display: flex;
  min-height: 42px;
  gap: 3px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: var(--radius-small);
  background: var(--surface-soft);
}

.segmented button {
  min-height: 34px;
  padding: 6px 11px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.segmented button:hover:not(:disabled) {
  background: var(--green-soft);
  color: var(--green-dark);
}

.segmented button[aria-pressed="true"] {
  border-color: var(--green);
  background: var(--green);
  color: #fff;
}

.advanced-filters {
  margin-top: 20px;
  border-top: 1px solid var(--line);
}

.advanced-filters summary {
  width: fit-content;
  padding: 15px 0;
  color: var(--green);
  font-size: 12px;
  font-weight: 600;
}

.advanced-filters summary::marker {
  font-size: 10px;
}

.advanced-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
  padding: 3px 0 18px;
}

.filters-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
  font-size: 12px;
}

.filter-summary {
  color: var(--muted);
}

.form-error {
  color: var(--error-text);
  font-weight: 600;
}

.workspace {
  display: grid;
  gap: 26px;
}

.account-heading {
  justify-content: space-between;
  gap: 24px;
  padding: 2px 2px 0;
}

.account-identity {
  min-width: 0;
  gap: 14px;
}

.account-identity > div:last-child {
  min-width: 0;
}

.account-identity h2 {
  overflow-wrap: anywhere;
  font-size: 23px;
}

.account-avatar {
  display: grid;
  width: 54px;
  height: 54px;
  flex: 0 0 54px;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: var(--green-soft);
  color: var(--green-dark);
  font-size: 21px;
  font-weight: 650;
}

.account-avatar img {
  z-index: 1;
  display: block;
  width: 100%;
  height: 100%;
  background: var(--green-soft);
  object-fit: cover;
}

.account-avatar > * {
  grid-area: 1 / 1;
}

.account-avatar-fallback {
  align-self: center;
  justify-self: center;
}

.account-subtitle {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
  overflow-wrap: anywhere;
}

.coverage {
  flex: 0 1 380px;
  font-size: 12px;
  text-align: right;
}

.coverage > p + p {
  margin-top: 3px;
}

.coverage > p:first-child {
  font-weight: 600;
}

.notice-stack {
  display: grid;
  gap: 10px;
}

.notice-stack:empty {
  display: none;
}

.notice {
  padding: 13px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-small);
  background: var(--surface-soft);
  font-size: 13px;
  overflow-wrap: anywhere;
}

.notice-warning {
  border-color: var(--warning-line);
  background: var(--warning-bg);
  color: var(--warning-text);
}

.state {
  padding: 24px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-small);
  background: var(--surface-soft);
  color: var(--muted);
  text-align: center;
  overflow-wrap: anywhere;
}

.state:empty {
  display: none;
}

.state-text {
  display: inline;
}

.state.is-loading {
  border-style: solid;
  background: var(--surface-green);
  color: var(--green-dark);
}

.state.is-loading::before {
  display: inline-block;
  width: 12px;
  height: 12px;
  margin-right: 10px;
  border: 2px solid #a9c8ae;
  border-top-color: var(--green);
  border-radius: 50%;
  content: "";
  vertical-align: -1px;
  animation: state-spin 850ms linear infinite;
}

.state.is-error {
  border-style: solid;
  border-color: var(--error-line);
  background: var(--error-bg);
  color: var(--error-text);
}

.state.is-empty {
  padding-top: 32px;
  padding-bottom: 32px;
}

.state button {
  display: table;
  margin: 12px 6px 0;
  margin-right: auto;
  margin-left: auto;
}

.section-heading {
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  margin-bottom: 14px;
}

.section-title {
  font-size: 17px;
}

.section-heading > .muted {
  font-size: 12px;
  text-align: right;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.metric-group {
  margin-bottom: 9px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 500;
  line-height: 1.4;
}

.metric-card {
  min-width: 0;
  padding: 21px 22px 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.metric-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.metric-value {
  margin-top: 9px;
  color: var(--text);
  font-size: clamp(28px, 2.6vw, 38px);
  font-weight: 650;
  letter-spacing: -0.04em;
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

.metric-note {
  margin-top: 8px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
}

.metric-unavailable {
  background: var(--surface-soft);
  box-shadow: none;
}

.metric-unavailable .metric-value,
.empty-dash {
  color: #8a958c;
}

.metric-unavailable .metric-value {
  font-size: 22px;
  line-height: 1.35;
  letter-spacing: -0.02em;
}

.summary-section > .state {
  margin-bottom: 14px;
}

.panel {
  min-width: 0;
  overflow: hidden;
}

.panel-header {
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
  padding: 24px 26px 18px;
}

.panel-header .muted {
  margin-top: 5px;
  font-size: 12px;
}

.chart-metric-field {
  width: min(240px, 100%);
}

.chart-body {
  padding: 0 22px 20px;
}

.chart-state {
  min-height: 180px;
  align-content: center;
}

.chart-wrap {
  min-width: 0;
  width: 100%;
}

.chart-svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
  font: 11px -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
}

.chart-gridline {
  stroke: #e2e8df;
  stroke-width: 1;
  stroke-dasharray: 3 4;
  vector-effect: non-scaling-stroke;
}

.chart-axis {
  fill: var(--muted);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.chart-line {
  fill: none;
  stroke: var(--green);
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}

.chart-point {
  fill: var(--green);
  stroke: var(--surface);
  stroke-width: 1.5;
  vector-effect: non-scaling-stroke;
}

.chart-point:focus-visible {
  stroke: var(--focus);
  stroke-width: 3;
}

.chart-note {
  margin: 10px 4px 0;
  font-size: 11px;
}

.chart-note:empty {
  display: none;
}

.panel-tabs {
  display: flex;
  gap: 24px;
  padding: 0 26px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-soft);
}

.panel-tab {
  position: relative;
  min-height: 58px;
  padding: 18px 1px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}

.panel-tab:hover {
  color: var(--green);
}

.panel-tab[aria-selected="true"] {
  color: var(--green-dark);
}

.panel-tab[aria-selected="true"]::after {
  position: absolute;
  right: 0;
  bottom: -1px;
  left: 0;
  height: 3px;
  border-radius: 3px 3px 0 0;
  background: var(--green);
  content: "";
}

.panel-tab:focus-visible {
  z-index: 1;
  outline-offset: -5px;
  border-radius: 8px;
}

.tab-count,
.pill,
.cache-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-green);
  color: var(--green-dark);
  font-size: 10px;
  font-weight: 600;
  line-height: 1.5;
  vertical-align: middle;
}

.tab-count {
  margin-left: 5px;
}

.tab-count:empty {
  display: none;
}

.cache-pill {
  background: var(--surface);
  color: var(--muted);
}

.tab-panel {
  padding: 24px 26px;
}

.data-panel-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.data-panel-toolbar > .field {
  flex: 0 1 240px;
}

.data-panel-toolbar .search-field {
  flex: 1 1 280px;
  max-width: 430px;
}

.data-meta {
  margin-bottom: 16px;
  font-size: 12px;
}

.data-meta:empty {
  display: none;
}

.table-wrap {
  max-width: 100%;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-small);
  overscroll-behavior-x: contain;
  scrollbar-color: #bccbbd var(--surface-soft);
  scrollbar-width: thin;
}

.data-table {
  width: 100%;
  border-spacing: 0;
  border-collapse: separate;
  color: var(--text);
  font-size: 12px;
}

.data-table th,
.data-table td {
  padding: 13px 16px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}

.data-table th {
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
  white-space: nowrap;
}

.data-table th.sort-active {
  background: var(--surface-green);
  color: var(--green-dark);
}

.data-table tbody tr:last-child td {
  border-bottom: 0;
}

.data-table tbody tr:hover {
  background: #f7faf5;
}

.data-table th:first-child,
.data-table td:first-child {
  width: 38%;
  min-width: 265px;
}

.data-table .number-cell {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.pin-cell {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 12px;
}

.pin-image,
.pin-image-placeholder {
  width: 42px;
  height: 56px;
  flex: 0 0 42px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-green);
  object-fit: cover;
}

.pin-image-placeholder {
  display: grid;
  place-items: center;
  color: #708a75;
  font-size: 11px;
  font-weight: 600;
}

.pin-text {
  min-width: 0;
  max-width: 360px;
}

.pin-title {
  display: block;
  max-width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--green-dark);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.5;
  text-align: left;
  text-decoration: none;
  overflow-wrap: anywhere;
}

.pin-title:hover {
  color: var(--green);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.pin-id {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

.panel-bottom {
  display: flex;
  justify-content: center;
  margin-top: 20px;
}

.panel-bottom:has(> [hidden]) {
  display: none;
}

.board-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.board-grid:empty {
  display: none;
}

.board-card {
  display: flex;
  min-width: 0;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-soft);
  overflow-wrap: anywhere;
}

.board-heading {
  width: 100%;
  color: var(--text);
  font-size: 15px;
  font-weight: 650;
  line-height: 1.4;
}

.board-heading a {
  color: inherit;
  text-decoration: none;
}

.board-heading a:hover {
  color: var(--green);
  text-decoration: underline;
}

.board-card > p {
  color: var(--muted);
  font-size: 12px;
}

.board-meta {
  display: flex;
  width: 100%;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  margin-top: auto;
  color: var(--muted);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.breakdown-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px 28px;
}

.breakdown-list:empty {
  display: none;
}

.breakdown-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 9px 14px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-soft);
}

.breakdown-row {
  display: flex;
  min-width: 0;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
}

.breakdown-label,
.breakdown-item .label {
  min-width: 0;
  font-size: 12px;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.breakdown-value,
.breakdown-item .value {
  flex-shrink: 0;
  color: var(--green-dark);
  font-size: 13px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}

.breakdown-track,
.breakdown-item .track {
  grid-column: 1 / -1;
  height: 6px;
  overflow: hidden;
  border-radius: 99px;
  background: #e1e9de;
}

.breakdown-bar,
.breakdown-item .bar {
  display: block;
  height: 100%;
  max-width: 100%;
  border-radius: inherit;
  background: var(--green);
}

.export-controls {
  justify-content: space-between;
  gap: 24px;
  padding: 4px 2px;
}

.export-controls .muted {
  max-width: 610px;
  margin-top: 6px;
  font-size: 12px;
}

.export-actions {
  flex: 0 0 auto;
}

.export-actions select {
  width: 210px;
}

.page-footer {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 20px;
  padding: 20px 2px 0;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 11px;
}

.page-footer p {
  max-width: 780px;
}

.page-footer a {
  flex-shrink: 0;
}

.pin-dialog {
  width: min(100% - 48px, 1080px);
  max-height: min(90vh, 960px);
  max-height: min(90dvh, 960px);
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 22px;
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 24px 100px rgb(20 38 24 / 24%);
}

.pin-dialog::backdrop {
  background: rgb(24 36 28 / 48%);
  backdrop-filter: blur(3px);
}

.dialog-shell {
  display: flex;
  max-height: inherit;
  flex-direction: column;
}

.dialog-header {
  flex: 0 0 auto;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 24px 28px 20px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-soft);
}

.dialog-header > div {
  min-width: 0;
}

.dialog-header h2 {
  margin-top: 7px;
  font-size: 23px;
  overflow-wrap: anywhere;
}

.dialog-meta {
  margin-top: 8px;
  font-size: 11px;
  overflow-wrap: anywhere;
}

.dialog-close {
  flex: 0 0 auto;
  margin: -4px -8px 0 0;
}

.dialog-close span {
  font-size: 23px;
  font-weight: 400;
  line-height: 1;
}

.dialog-body {
  min-height: 0;
  padding: 24px 28px 28px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.dialog-body > .text-link {
  display: inline-block;
  margin-bottom: 20px;
  font-size: 12px;
  font-weight: 600;
}

.dialog-body > .state,
.dialog-body > .notice-stack:not(:empty) {
  margin-bottom: 18px;
}

.dialog-metrics {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.dialog-metrics .metric-card {
  padding: 16px 18px;
  box-shadow: none;
}

.dialog-metrics .metric-value {
  font-size: 28px;
}

.dialog-body > .panel-header {
  align-items: center;
  padding: 28px 0 18px;
}

.dialog-body > .panel-header .field {
  max-width: 240px;
}

@keyframes state-spin {
  to { transform: rotate(360deg); }
}

@media (min-width: 1600px) {
  .app-shell {
    padding-top: 48px;
  }
}

@media (max-width: 1180px) {
  .app-shell {
    width: calc(100% - 48px);
    padding-top: 30px;
  }

  .filters-top {
    gap: 18px;
  }

  .field-wide {
    flex-basis: 48%;
  }

  .date-range {
    justify-content: flex-start;
  }

  .advanced-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .export-controls {
    align-items: flex-start;
  }

  .export-actions {
    flex: 0 1 350px;
  }

  .export-actions .field {
    flex: 1 1 180px;
  }

  .export-actions select {
    width: 100%;
  }
}

@media (max-width: 900px) {
  .topbar {
    align-items: flex-start;
  }

  .topbar-actions {
    max-width: 250px;
    gap: 6px;
  }

  .control-panel {
    padding-right: 20px;
    padding-left: 20px;
  }

  .metric-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .metric-card {
    padding: 18px;
  }

  .board-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .account-heading {
    align-items: flex-start;
  }

  .coverage {
    max-width: 290px;
  }

  .export-controls {
    flex-direction: column;
    gap: 16px;
  }

  .export-actions {
    flex: 0 1 auto;
    justify-content: flex-start;
  }

  .page-footer {
    flex-direction: column;
    gap: 9px;
  }

  .pin-dialog {
    width: calc(100% - 40px);
  }
}

@media (max-width: 640px) {
  .app-shell {
    width: calc(100% - 28px);
    padding-top: 24px;
    padding-bottom: 20px;
  }

  .topbar {
    flex-direction: column;
    gap: 18px;
    margin-bottom: 20px;
  }

  .brand > .muted {
    font-size: 13px;
  }

  .topbar-actions {
    max-width: none;
    width: 100%;
    justify-content: flex-start;
    gap: 8px;
  }

  .topbar-actions .button-secondary {
    flex: 1 1 auto;
  }

  .button {
    min-height: 44px;
  }

  .control-panel {
    padding: 17px 16px 0;
    margin-bottom: 24px;
    border-radius: 14px;
  }

  .filters-top {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
  }

  .segmented button {
    flex: 1;
    min-height: 36px;
  }

  .date-range {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
  }

  .date-range input {
    min-width: 0;
    padding-right: 7px;
    padding-left: 7px;
    font-size: 12px;
  }

  .date-range .button {
    grid-column: 1 / -1;
  }

  .advanced-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px 10px;
  }

  .advanced-grid .field:last-child {
    grid-column: 1 / -1;
  }

  .advanced-grid select {
    font-size: 12px;
  }

  .workspace {
    gap: 22px;
  }

  .account-heading {
    flex-direction: column;
    gap: 14px;
  }

  .account-identity {
    gap: 12px;
  }

  .account-identity h2 {
    font-size: 20px;
  }

  .account-avatar {
    width: 48px;
    height: 48px;
    flex-basis: 48px;
  }

  .coverage {
    max-width: none;
    flex-basis: auto;
    text-align: left;
  }

  .section-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 5px;
    margin-bottom: 12px;
  }

  .section-heading > .muted {
    font-size: 11px;
    text-align: left;
  }

  .metric-grid,
  .dialog-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .metric-card,
  .dialog-metrics .metric-card {
    padding: 16px 14px;
    border-radius: 12px;
  }

  .metric-value,
  .dialog-metrics .metric-value {
    margin-top: 8px;
    font-size: 28px;
  }

  .metric-label {
    font-size: 11px;
  }

  .metric-note {
    font-size: 10px;
  }

  .metric-unavailable .metric-value,
  .dialog-metrics .metric-unavailable .metric-value {
    font-size: 20px;
  }

  .panel {
    border-radius: 14px;
  }

  .panel-header {
    flex-wrap: wrap;
    gap: 14px;
    padding: 20px 16px 14px;
  }

  .panel-header h2 {
    font-size: 18px;
  }

  .chart-metric-field {
    width: 100%;
  }

  .chart-body {
    padding: 0 12px 16px;
  }

  .chart-svg {
    min-height: 155px;
  }

  .chart-axis {
    font-size: 13px;
  }

  .chart-note {
    margin-left: 4px;
    margin-right: 4px;
  }

  .panel-tabs {
    gap: 20px;
    padding: 0 16px;
    overflow-x: auto;
    scrollbar-width: thin;
  }

  .panel-tab {
    min-height: 54px;
    padding-top: 16px;
    padding-bottom: 16px;
    font-size: 12px;
  }

  .tab-panel {
    padding: 18px 16px;
  }

  .data-panel-toolbar {
    gap: 12px;
  }

  .data-panel-toolbar > .field,
  .data-panel-toolbar .search-field {
    max-width: none;
    flex-basis: 100%;
  }

  .data-table th,
  .data-table td {
    padding: 12px;
  }

  .data-table th:first-child,
  .data-table td:first-child {
    min-width: 235px;
  }

  .pin-text {
    max-width: 235px;
  }

  .board-grid,
  .breakdown-list {
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
  }

  .board-card {
    padding: 18px;
  }

  .export-controls {
    padding: 0 2px;
  }

  .export-actions {
    width: 100%;
    flex-wrap: nowrap;
    gap: 8px;
  }

  .export-actions .field {
    flex-basis: 0;
  }

  .export-actions .button {
    flex-shrink: 0;
    padding-right: 12px;
    padding-left: 12px;
  }

  .export-actions select {
    font-size: 12px;
  }

  .state {
    padding: 21px 16px;
    font-size: 13px;
  }

  .pin-dialog {
    width: calc(100% - 20px);
    max-height: calc(100vh - 28px);
    max-height: calc(100dvh - 28px);
    border-radius: 16px;
  }

  .dialog-header {
    gap: 10px;
    padding: 20px 16px 16px;
  }

  .dialog-header h2 {
    font-size: 19px;
  }

  .dialog-close {
    min-height: 40px;
    padding: 8px;
    margin: -6px -8px 0 0;
    font-size: 11px;
  }

  .dialog-close span {
    font-size: 21px;
  }

  .dialog-body {
    padding: 20px 16px 22px;
  }

  .dialog-body > .panel-header {
    gap: 12px;
    padding-top: 24px;
  }

  .dialog-body > .panel-header .field {
    max-width: none;
    width: 100%;
  }
}

@media (max-width: 360px) {
  .app-shell {
    width: calc(100% - 20px);
  }

  .topbar-actions {
    gap: 4px;
  }

  .topbar-actions .button {
    font-size: 11px;
    padding-right: 10px;
    padding-left: 10px;
  }

  .segmented button {
    padding-right: 7px;
    padding-left: 7px;
    font-size: 11px;
  }

  .metric-value,
  .dialog-metrics .metric-value {
    font-size: 25px;
  }

  .export-actions {
    flex-wrap: wrap;
  }

  .export-actions .field,
  .export-actions .button {
    flex-basis: 100%;
  }
}

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

@media (forced-colors: active) {
  .button,
  .segmented button[aria-pressed="true"],
  .metric-card,
  .board-card,
  .panel,
  .control-panel,
  .state,
  .notice {
    border-color: CanvasText;
  }

  .chart-line,
  .chart-point {
    stroke: LinkText;
  }

  .chart-point,
  .breakdown-bar,
  .breakdown-item .bar,
  .panel-tab[aria-selected="true"]::after {
    fill: LinkText;
    background: LinkText;
    forced-color-adjust: none;
  }
}
