/* Atelier work surfaces from Stitch 10Б, 21–22 and dark screen 30. */
html[data-workspace-theme] {
  --surface: #f9f9f8;
  --low: #f0f1f1;
  --line: #dfe2e3;
  --ink: #1a1c1c;
  --muted: #43474e;
  --secondary: #565c69;
  --primary: #003dbe;
  --accent: #2756df;
  --selected: #e9effd;
  --team-side: #f1f2f2;
  --team-hero: #202429;
  --team-hero-ink: #f9f9f8;
  --team-hero-muted: #d4deef;
}

html[data-workspace-theme="dark"] {
  color-scheme: dark;
  --surface: #17191e;
  --panel: #22252d;
  --low: #2c303a;
  --line: #414752;
  --ink: #e9ebf1;
  --muted: #c5cbd9;
  --secondary: #bbc5d7;
  --primary: #b0c5ff;
  --accent: #8caaff;
  --selected: #303f63;
  --team-side: #1e2128;
  --team-hero: #293447;
  --team-hero-ink: #f2f5ff;
  --team-hero-muted: #d4deef;
}

@media (prefers-color-scheme: dark) {
  html[data-workspace-theme="system"] {
    color-scheme: dark;
    --surface: #17191e;
    --panel: #22252d;
    --low: #2c303a;
    --line: #414752;
    --ink: #e9ebf1;
    --muted: #c5cbd9;
    --secondary: #bbc5d7;
    --primary: #b0c5ff;
    --accent: #8caaff;
    --selected: #303f63;
    --team-side: #1e2128;
    --team-hero: #293447;
    --team-hero-ink: #f2f5ff;
    --team-hero-muted: #d4deef;
  }
}

html[data-workspace-theme] .site-header { background: var(--surface); }
html[data-workspace-theme] .bar { max-width: none; padding-inline: clamp(12px, 2.5vw, 36px); }
html[data-workspace-theme] .button.primary { background: var(--primary); color: var(--panel); }
html[data-workspace-theme] .button.primary:hover { background: var(--accent); }
html[data-workspace-theme] :is(.sample, .team-empty) { color: var(--ink); }

.team-preferences { display: flex; align-items: center; gap: 7px 12px; flex-wrap: wrap; }
.team-preferences .field { display: flex; align-items: center; gap: 8px; }
.team-preferences .field label { color: var(--muted); font-size: .82rem; }
.team-preferences :is(select, .button) { min-height: 40px; }
.team-preferences select { padding: 4px 8px; }
.team-shell { min-height: calc(100vh - 120px); display: grid; grid-template-columns: 196px minmax(0, 1fr); }
.team-sidebar { min-width: 0; padding: 16px 10px; background: var(--team-side); border-inline-end: 1px solid var(--line); }
.team-sidebar nav { display: grid; gap: 4px; }
.team-brand { display: grid; gap: 3px; padding: 7px 10px 20px; }
.team-brand strong { font-size: .95rem; overflow-wrap: anywhere; }
.team-brand span { font-size: .78rem; }
.team-sidebar a { min-height: 40px; display: flex; align-items: center; gap: 9px; padding: 6px 10px; border-radius: 8px; text-decoration: none; color: var(--ink); font-size: .9rem; }
.team-sidebar a span { display: inline-grid; place-items: center; width: 18px; }
.team-sidebar a:is(:hover, [aria-current]) { background: var(--selected); color: var(--primary); }
.team-sidebar a[aria-current] { font-weight: 650; }
.team-sidebar .team-back { margin-block-start: 20px; color: var(--primary); border: 1px solid var(--line); }
.team-body { min-width: 0; width: min(100%, 1500px); margin-inline: auto; padding: clamp(16px, 3.4vw, 42px); display: grid; align-content: start; gap: 17px; }
.team-title { display: flex; align-items: flex-end; justify-content: space-between; gap: 10px 16px; flex-wrap: wrap; }
.team-title h1 { font-size: clamp(1.7rem, 3.1vw, 2.2rem); }
.team-title p { margin-block-start: .35rem; color: var(--muted); }
.team-hero { display: flex; justify-content: space-between; align-items: flex-end; flex-wrap: wrap; gap: 14px 24px; border-radius: 13px; background: var(--team-hero); color: var(--team-hero-ink); padding: clamp(18px, 3vw, 32px); }
.team-hero h2 { margin-block: 6px; font-size: clamp(1.35rem, 2.8vw, 1.95rem); line-height: 1.18; }
.team-hero p { color: var(--team-hero-muted); }
.team-hero .button.primary { background: #f4f7ff; color: #132751; border-color: transparent; }
.team-hero .button.primary:hover { background: #dce8ff; }
.team-columns, .team-metrics { display: grid; gap: 14px; align-items: start; }
.team-columns { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.team-metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.team-metric { display: flex; flex-direction: column; align-items: flex-start; gap: 5px; padding: 16px; height: 100%; }
.team-metric > span { color: var(--muted); font-size: .88rem; }
.team-metric > strong { display: block; font-size: 1.45rem; font-variant-numeric: tabular-nums; }
.team-metric .button { margin-block-start: 4px; }
.team-tabs { padding: 4px 0 8px; border-bottom: 1px solid var(--line); }
.team-tabs a { min-height: 40px; display: flex; align-items: center; }
.team-row { min-width: 0; display: flex; justify-content: space-between; align-items: start; gap: 9px 12px; flex-wrap: wrap; border-bottom: 1px solid var(--line); padding-block-end: .75rem; overflow-wrap: anywhere; }
.team-row:last-child { border: 0; padding: 0; }
.team-row p { color: var(--muted); white-space: pre-wrap; font-size: .9rem; }
.team-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.team-notice { white-space: pre-wrap; }
.team-empty { color: var(--muted); font-size: .9rem; }
.team-board { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 11px; align-items: stretch; }
.team-column { display: grid; align-content: start; gap: 9px; background: var(--low); border: 1px solid var(--line); padding: 10px; border-radius: 12px; min-width: 0; }
.column-title { display: flex; gap: 7px; align-items: center; justify-content: space-between; padding: 4px 3px; }
.column-title h2 { font-size: .99rem; }
.column-title span { color: var(--muted); font-size: .85rem; }
.team-task-card { display: grid; gap: 5px; overflow-wrap: anywhere; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 10px; }
.team-task-card p { font-size: .82rem; }
.team-task-card a { text-decoration-thickness: 1px; }
.team-table { width: 100%; text-align: start; border-collapse: collapse; }
.team-table :is(td, th) { padding: 8px; text-align: start; border-bottom: 1px solid var(--line); }
.team-table-wrap { overflow-x: auto; }
.team-onboard-steps { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; padding: 0; margin: 0; list-style: none; }
.team-onboard-steps li { color: var(--muted); border-top: 3px solid var(--line); padding-block-start: 6px; }
.team-onboard-steps li[aria-current] { color: var(--primary); border-color: var(--accent); font-weight: 650; }

@media (max-width: 1050px) {
  .team-board { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 850px) {
  .team-columns, .team-metrics { grid-template-columns: 1fr; }
}
@media (max-width: 680px) {
  .team-shell { grid-template-columns: minmax(0, 1fr); }
  .team-sidebar { padding: 10px 14px; border-inline-end: 0; border-bottom: 1px solid var(--line); }
  .team-sidebar nav { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .team-brand { padding: 0 0 7px; }
  .team-sidebar .team-back { margin-block-start: 6px; }
  .team-preferences .field { align-items: start; flex-direction: column; gap: 2px; }
  .team-onboard-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 390px) {
  .team-board { grid-template-columns: minmax(0, 1fr); }
}
