:root {
  --dashboard-feature-ink: #211f16;
  --dashboard-feature-muted: #423324;
  --dashboard-feature-base: #e5ceb1;
  --dashboard-feature-gradient: linear-gradient(100deg, #f8e9d6eb 8%, #f3dfc8d4 40%, #dcba935c 72%, #ae8d6820);
  --dashboard-feature-mobile: linear-gradient(100deg, #f8e9d6ee 16%, #f3dfc8dc 54%, #dcba9385 100%);
  --dashboard-feature-rim: #fff9eda3;
  --dashboard-feature-mark: #fff4e4;
  --dashboard-feature-mark-ink: #254d39;
  --dashboard-status-base: #fff6e7;
  --dashboard-active: #3d7772;
  --dashboard-active-ink: #245950;
  --dashboard-attention: #ad7430;
  --dashboard-attention-ink: #744614;
  --dashboard-ready: #52834a;
  --dashboard-ready-ink: #365e30;
  --dashboard-interrupted: #ab5948;
  --dashboard-interrupted-ink: #863a2e;
}

:root[data-theme='dark'] {
  --dashboard-feature-ink: #fff4e8;
  --dashboard-feature-muted: #f2deca;
  --dashboard-feature-base: #3b2e27;
  --dashboard-feature-gradient: linear-gradient(100deg, #2b211ded 12%, #322620de 44%, #4331298f 75%, #38281f69);
  --dashboard-feature-mobile: linear-gradient(100deg, #2b211df0 10%, #322620e7 58%, #433129a3 100%);
  --dashboard-feature-rim: #8871648c;
  --dashboard-feature-mark: #e8dece;
  --dashboard-status-base: #3d3029;
  --dashboard-active: #7ac1b7;
  --dashboard-active-ink: #a5ded3;
  --dashboard-attention: #ecb16b;
  --dashboard-attention-ink: #f5ca92;
  --dashboard-ready: #a1c584;
  --dashboard-ready-ink: #bfe1a9;
  --dashboard-interrupted: #f3a591;
  --dashboard-interrupted-ink: #ffbbae;
}

.workspace-dashboard {
  display: grid;
  gap: clamp(12px, 2vw, 20px);
  min-width: 0;
}

.workspace-dashboard-hero {
  display: grid;
  align-content: end;
  justify-items: start;
  min-height: clamp(160px, 23vw, 244px);
  padding: clamp(22px, 4vw, 48px);
  border: 1px solid var(--glass-rim, var(--border));
  border-radius: calc(var(--radius) + 7px);
  color: var(--dashboard-feature-ink);
  background-color: var(--dashboard-feature-base);
  background-image: var(--dashboard-feature-gradient), var(--workspace-scene, none);
  background-size: cover;
  background-position: center, center 54%;
  box-shadow: inset 0 1px 0 var(--dashboard-feature-rim), var(--glass-shadow);
}

.workspace-dashboard-hero h1 {
  max-width: min(100%, 19ch);
  font-family: var(--serif, Georgia, serif);
  font-size: clamp(2.55rem, 6.4vw, 5.15rem);
  font-weight: 500;
  letter-spacing: -.048em;
  line-height: 1;
  overflow-wrap: anywhere;
}

.workspace-dashboard-hero p {
  max-width: 41ch;
  margin-top: .65rem;
  color: var(--dashboard-feature-muted);
  font-size: clamp(.82rem, 1.5vw, .99rem);
  font-weight: 650;
  line-height: 1.55;
}

.workspace-dashboard.is-company .workspace-dashboard-hero {
  align-content: center;
  min-height: clamp(145px, 21vw, 213px);
}

.workspace-dashboard-hero .workspace-dashboard-brand-mark {
  margin-bottom: 11px;
  color: var(--dashboard-feature-mark-ink);
  background: var(--dashboard-feature-mark);
}

.workspace-dashboard-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(8px, 1.8vw, 16px);
  margin: 0;
}

.workspace-dashboard .workspace-dashboard-metric {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-width: 0;
  min-height: 124px;
  padding: clamp(12px, 1.8vw, 21px);
}

.workspace-dashboard-metric dt {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 5px;
  min-width: 0;
  color: var(--muted);
  font-size: .77rem;
  font-weight: 750;
  line-height: 1.33;
  overflow-wrap: anywhere;
}

.workspace-dashboard-metric-icon,
.workspace-dashboard-brand-mark,
.workspace-dashboard-record-icon {
  display: grid;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  place-items: center;
  border-radius: 11px;
  color: var(--accent);
  background: var(--accent-muted);
}

.workspace-dashboard-metric dd { display: grid; gap: 4px; margin: 6px 0 0; }

.workspace-dashboard-metric strong {
  font-size: clamp(1.8rem, 4vw, 3rem);
  font-variant-numeric: tabular-nums;
  font-weight: 770;
  letter-spacing: -.07em;
  line-height: .98;
  overflow-wrap: anywhere;
}

.workspace-dashboard-metric small,
.workspace-dashboard-panel-head p,
.workspace-dashboard-company-name small,
.workspace-dashboard-record-name small {
  color: var(--muted);
  font-size: .73rem;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.workspace-dashboard .workspace-dashboard-metric.is-featured {
  color: #fff8e9;
  border-color: #426b59;
  background: radial-gradient(ellipse at 96% 0%, #51806b, transparent 68%), linear-gradient(135deg, #285240, #143a2c);
  box-shadow: inset 0 1px 0 #fbffef35, 0 8px 19px rgb(20 59 43 / 12%);
}

.workspace-dashboard-metric.is-featured :is(dt, small) { color: #f0eede; }
.workspace-dashboard-metric.is-featured .workspace-dashboard-metric-icon { color: #fcf5e3; background: #f8f7e329; }

.workspace-dashboard-columns {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(225px, 1fr);
  align-items: stretch;
  gap: clamp(10px, 1.8vw, 16px);
}

.workspace-dashboard-panel {
  min-width: 0;
  padding: clamp(14px, 2.2vw, 22px);
}

.workspace-dashboard-panel h2 { font-size: clamp(1.02rem, 1.85vw, 1.2rem); }
.workspace-dashboard-panel-head p { margin-top: 5px; }
.workspace-dashboard-panel ul { list-style: none; padding: 0; margin: 12px 0 0; }

.workspace-dashboard-company-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr));
  gap: 8px;
}

.workspace-dashboard-company {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 64px;
  height: 100%;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface-raised);
  text-decoration: none;
  transition: background .16s ease, border-color .16s ease;
}

.workspace-dashboard-company:hover {
  border-color: color-mix(in srgb, var(--accent), var(--border) 72%);
  background: var(--accent-muted);
}

.workspace-dashboard-brand-mark {
  width: 40px;
  height: 40px;
  flex-basis: 40px;
  overflow: hidden;
  font-size: .98rem;
  font-weight: 820;
}

.workspace-dashboard-brand-mark img { width: 100%; height: 100%; padding: 5px; object-fit: contain; }
.workspace-dashboard-company > svg { margin-left: auto; color: var(--accent); }
.workspace-dashboard-company-name,
.workspace-dashboard-record-name { display: grid; min-width: 0; gap: 3px; }

.workspace-dashboard-company-name strong,
.workspace-dashboard-record-name :is(a, strong) {
  font-size: .86rem;
  font-weight: 750;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.workspace-dashboard-distribution { display: grid; gap: 9px; }
.workspace-dashboard-distribution-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 10px;
  align-items: baseline;
  color: var(--muted);
  font-size: .75rem;
  font-weight: 680;
}

.workspace-dashboard-distribution-row strong { color: var(--ink); font-variant-numeric: tabular-nums; }
.workspace-dashboard-distribution-row meter {
  appearance: none;
  grid-column: 1 / -1;
  display: block;
  width: 100%;
  height: 6px;
  border: 0;
  border-radius: 99px;
  background: color-mix(in srgb, var(--accent), transparent 88%);
}

.workspace-dashboard-distribution-row meter::-webkit-meter-bar {
  border: 0;
  border-radius: 99px;
  background: transparent;
}

.workspace-dashboard-distribution-row meter::-webkit-meter-optimum-value { border-radius: 99px; background: var(--dashboard-status-fill); }
.workspace-dashboard-distribution-row meter::-moz-meter-bar { border-radius: 99px; background: var(--dashboard-status-fill); }

.workspace-dashboard [data-status] { --dashboard-status-fill: var(--muted); --dashboard-status-ink: var(--muted); }
.workspace-dashboard [data-status="active"] { --dashboard-status-fill: var(--dashboard-active); --dashboard-status-ink: var(--dashboard-active-ink); }
.workspace-dashboard [data-status="attention"] { --dashboard-status-fill: var(--dashboard-attention); --dashboard-status-ink: var(--dashboard-attention-ink); }
.workspace-dashboard [data-status="ready"] { --dashboard-status-fill: var(--dashboard-ready); --dashboard-status-ink: var(--dashboard-ready-ink); }
.workspace-dashboard [data-status="interrupted"] { --dashboard-status-fill: var(--dashboard-interrupted); --dashboard-status-ink: var(--dashboard-interrupted-ink); }

.workspace-dashboard-record {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto minmax(91px, max-content);
  align-items: center;
  gap: 8px clamp(7px, 1.4vw, 15px);
  min-height: 55px;
  padding: 9px 0;
  border-top: 1px solid var(--border);
}

.workspace-dashboard-record a { text-decoration-color: color-mix(in srgb, currentColor, transparent 70%); }
.workspace-dashboard-record a:hover { color: var(--accent); }
.workspace-dashboard-record time {
  color: var(--muted);
  font-size: .7rem;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.workspace-dashboard-status {
  display: inline-flex;
  align-items: center;
  justify-self: start;
  gap: 5px;
  padding: 4px 7px;
  border-radius: 99px;
  color: var(--dashboard-status-ink);
  background: color-mix(in srgb, var(--dashboard-status-fill), var(--dashboard-status-base) 88%);
  font-size: .68rem;
  font-weight: 750;
  line-height: 1.2;
  white-space: nowrap;
}

.workspace-dashboard-status::before {
  width: 5px;
  height: 5px;
  flex: 0 0 5px;
  border-radius: 50%;
  background: currentColor;
  content: '';
}

.workspace-dashboard-empty {
  margin-top: 12px;
  padding: 15px 11px;
  border: 1px dashed var(--border);
  border-radius: 13px;
  color: var(--muted);
  background: var(--surface-raised);
  font-size: .81rem;
}

@media (max-width: 1050px) {
  .workspace-dashboard.is-company .workspace-dashboard-columns {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 760px) {
  .workspace-dashboard-columns { grid-template-columns: minmax(0, 1fr); }
  .workspace-dashboard-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .workspace-dashboard-hero {
    background-image: var(--dashboard-feature-mobile), var(--workspace-scene, none);
  }
}

@media (max-width: 450px) {
  .workspace-dashboard-metric dt { align-items: flex-start; }
  .workspace-dashboard-metric-icon { width: 27px; height: 27px; flex-basis: 27px; border-radius: 8px; }
  .workspace-dashboard-metric-icon svg { width: 15px; height: 15px; }
  .workspace-dashboard-record { grid-template-columns: 34px minmax(0, 1fr) auto; }
  .workspace-dashboard-record time { grid-column: 2 / -1; text-align: left; }
}

@media (prefers-reduced-motion: reduce) {
  .workspace-dashboard-company { transition: none; }
}

@media (prefers-reduced-transparency: reduce), (prefers-contrast: more) {
  .workspace-dashboard-hero { background: var(--dashboard-feature-base); }
}

@media (forced-colors: active) {
  .workspace-dashboard-hero,
  .workspace-dashboard .workspace-dashboard-metric.is-featured,
  .workspace-dashboard-status { border: 1px solid CanvasText; color: CanvasText; background: Canvas; }
  .workspace-dashboard-status::before { background: CanvasText; }
}
