/* Studio board stylesheet (website target). Colors and fonts match the team deck.
   Light and dark follow the system setting. Works at 390 px, 768 px and desktop. */

:root {
  --bg: #F4F1EA;
  --bg2: #E8E3D7;
  --card: #FBFAF6;
  --border: #D9D3C4;
  --text: #444B5C;
  --heading: #141A2B;
  --muted: #6B7180;
  --accent: #A9521A;
  --accent-text: #FFFFFF;
  --blue: #2C64A6;
  --red: #B8402B;
  --yellow: #C99312;
  --green: #2F7D45;
  --font-head: "Space Grotesk", "Segoe UI", system-ui, sans-serif;
  --font-body: "IBM Plex Sans", "Segoe UI", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", Consolas, "Courier New", monospace;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(20, 26, 43, 0.06);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #141A2B;
    --bg2: #1C2338;
    --card: #1F2740;
    --border: #34405C;
    --text: #D6D9E2;
    --heading: #F4F1EA;
    --muted: #A2A9BA;
    --accent: #F2A65A;
    --accent-text: #141A2B;
    --blue: #7FAEE8;
    --red: #F08A75;
    --yellow: #E7BC4A;
    --green: #6FC587;
    --shadow: none;
  }
}

/* Inside Mr. Mak the tile is always dark. Mr. Mak's report.css sets its own --accent and --blue
   on body, so we re-declare our palette on body with higher specificity to stay one studio look. */
html[data-mak-report], html[data-mak-report] body, html[data-mak-report=document] body {
  --bg: #101115; --bg2: #18191f; --card: #1B1C24; --border: #2E3040; --text: #D3D0D9; --heading: #F5F1F6;
  --muted: #A29BAA; --accent: #F2A65A; --accent-text: #141A2B; --blue: #8FB4E6; --red: #F08A75;
  --yellow: #E7BC4A; --green: #6FC587; --shadow: none;
  font-family: var(--font-body);
}
html[data-mak-report] a { color: var(--blue); }
html[data-mak-report] .btn-primary { background: var(--accent); color: var(--accent-text); }
html[data-mak-report] .brand, html[data-mak-report] .topnav a { color: #F5F1F6; }
html[data-mak-report=document] main > section { background: transparent; border: 0; }

* { box-sizing: border-box; }
html { background: var(--bg); }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
}
h1, h2, h3, h4 { font-family: var(--font-head); color: var(--heading); line-height: 1.2; margin: 0 0 0.5em; }
h1 { font-size: clamp(1.7rem, 4vw, 2.4rem); letter-spacing: -0.02em; }
h2 { font-size: 1.3rem; }
h3 { font-size: 1.05rem; }
p { margin: 0 0 0.9em; }
a { color: var(--blue); text-underline-offset: 3px; }
a:focus-visible, button:focus-visible, select:focus-visible, [tabindex]:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}
code, .path { font-family: var(--font-mono); font-size: 0.85em; background: var(--bg2); padding: 1px 5px; border-radius: 4px; overflow-wrap: anywhere; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--card); padding: 8px 12px; border-radius: 6px; }
.skip:focus { left: 8px; z-index: 10; }

.wrap { max-width: 1180px; margin: 0 auto; padding: 0 16px; }

/* Top bar and navigation */
.topbar { background: var(--heading); color: #F4F1EA; }
html[data-mak-report] .topbar, html[data-mak-report] .footer { background: var(--bg2); }
@media (prefers-color-scheme: dark) { .topbar { background: var(--bg2); } }
.topbar-inner { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 56px; flex-wrap: wrap; padding-top: 8px; padding-bottom: 8px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: #F4F1EA; text-decoration: none; font-family: var(--font-head); font-weight: 700; }
.brand-mark { width: 14px; height: 14px; border-radius: 3px; background: var(--accent); display: inline-block; }
.topnav { display: flex; gap: 4px; flex-wrap: wrap; }
.topnav a { color: #F4F1EA; text-decoration: none; padding: 6px 10px; border-radius: 6px; font-size: 0.95rem; }
.topnav a[aria-current="page"] { background: rgba(255, 255, 255, 0.14); }
.topnav a:hover { background: rgba(255, 255, 255, 0.1); }

/* Banners */
.banner { padding: 10px 0; font-weight: 600; }
.banner .wrap { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.banner-demo { background: var(--yellow); color: #141A2B; }
.banner-paused { background: var(--red); color: #FFFFFF; }

/* Sections and cards */
main { padding: 20px 16px 40px; }
.section { margin: 0 0 28px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.section-head h2 { margin: 0; }
.section-head .tools { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); margin-bottom: 16px; }
.card > :last-child { margin-bottom: 0; }
.card-link { display: block; color: inherit; text-decoration: none; }
.card-link:hover { border-color: var(--accent); }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; margin-bottom: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; margin-bottom: 16px; }
.hero { padding: 24px 0 8px; }
.eyebrow { text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.8rem; color: var(--accent); font-weight: 700; margin-bottom: 4px; }
.lead { font-size: 1.1rem; max-width: 60ch; }
.cta { text-align: center; }
.muted { color: var(--muted); }
.small { font-size: 0.88rem; }
.note { color: var(--muted); font-size: 0.88rem; margin: 6px 0 0; }

/* Status light and header stats */
.statusbar { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.stat { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; }
.stat .label { font-size: 0.8rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }
.stat .value { font-family: var(--font-head); font-size: 1.15rem; color: var(--heading); font-weight: 600; overflow-wrap: anywhere; }
.light { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; }
.light::before { content: ""; width: 14px; height: 14px; border-radius: 50%; display: inline-block; border: 2px solid var(--heading); }
.light-red::before { background: var(--red); }
.light-yellow::before { background: var(--yellow); }
.light-green::before { background: var(--green); }
.light-blue::before { background: var(--blue); }

/* Badges */
.badge { display: inline-block; font-size: 0.75rem; font-weight: 600; padding: 2px 8px; border-radius: 999px; border: 1px solid var(--border); background: var(--bg2); color: var(--text); white-space: nowrap; }
.badge-demo { background: var(--yellow); color: #141A2B; border-color: transparent; }
.badge-status-open { background: var(--bg2); }
.badge-status-claimed, .badge-status-in-progress, .badge-status-preview { background: var(--blue); color: #fff; border-color: transparent; }
.badge-status-plan-submitted, .badge-status-in-test-train, .badge-status-ready-to-test { background: var(--yellow); color: #141A2B; border-color: transparent; }
.badge-status-plan-approved, .badge-status-merged, .badge-status-verified-in-playtest { background: var(--green); color: #fff; border-color: transparent; }
.badge-status-needs-changes, .badge-status-blocked { background: var(--red); color: #fff; border-color: transparent; }
.badge-status-needs-lead { background: var(--accent); color: var(--accent-text); border-color: transparent; }
.badge-risk-high { background: var(--red); color: #fff; border-color: transparent; }
.badge-risk-medium { background: var(--yellow); color: #141A2B; border-color: transparent; }
.badge-risk-low { background: var(--green); color: #fff; border-color: transparent; }
.badge-p0 { border-color: var(--red); color: var(--red); }
.badge-p1 { border-color: var(--accent); color: var(--accent); }
.badge-stale { border-color: var(--yellow); color: var(--yellow); }
@media (prefers-color-scheme: dark) {
  .badge-status-claimed, .badge-status-in-progress, .badge-status-preview, .badge-status-plan-approved,
  .badge-status-merged, .badge-status-verified-in-playtest, .badge-status-needs-changes, .badge-status-blocked,
  .badge-risk-high, .badge-risk-low { color: #141A2B; }
}
html[data-mak-report] .badge-status-claimed, html[data-mak-report] .badge-status-in-progress,
html[data-mak-report] .badge-status-plan-approved, html[data-mak-report] .badge-status-merged,
html[data-mak-report] .badge-status-needs-changes, html[data-mak-report] .badge-risk-high,
html[data-mak-report] .badge-risk-low { color: #141A2B; }

/* Buttons */
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border-radius: 8px; border: 1px solid var(--border); background: var(--card); color: var(--heading); font: 600 0.92rem var(--font-body); text-decoration: none; cursor: pointer; min-height: 36px; }
.btn:hover { border-color: var(--accent); }
.btn-primary { background: var(--accent); color: var(--accent-text); border-color: transparent; }
.btn-primary:hover { filter: brightness(1.08); }
.btn-danger { color: var(--red); }
.btn-sm { padding: 4px 10px; min-height: 30px; font-size: 0.85rem; }
.btn[aria-disabled="true"] { opacity: 0.55; pointer-events: none; }
select, input[type="search"] { font: inherit; padding: 6px 8px; border-radius: 6px; border: 1px solid var(--border); background: var(--card); color: var(--text); min-height: 36px; }

/* Task lists */
.task-list { list-style: none; margin: 0; padding: 0; }
.task { display: grid; grid-template-columns: 1fr auto; gap: 8px 16px; padding: 12px 0; border-top: 1px solid var(--border); align-items: start; }
.task:first-child { border-top: 0; }
.task .title { font-weight: 600; color: var(--heading); }
.task .title a { color: inherit; text-decoration: none; }
.task .title a:hover { text-decoration: underline; }
.task .meta { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-top: 4px; font-size: 0.85rem; color: var(--muted); }
.task .actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.task .files { margin-top: 6px; font-size: 0.82rem; }
.task .reason { margin-top: 6px; font-size: 0.9rem; }
.role-group { margin-bottom: 16px; }
.role-group h3 { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.role-group h3 .count { font-weight: 400; color: var(--muted); font-size: 0.9rem; }
.member-group { margin-bottom: 14px; }
.member-group h3 { margin-bottom: 2px; }
.empty { color: var(--muted); font-style: italic; }
[hidden] { display: none !important; }

/* Tabs: jump links without JavaScript; one section at a time with it */
.tabs { display: flex; gap: 4px; flex-wrap: wrap; border-bottom: 2px solid var(--border); margin: 0 0 20px; position: sticky; top: 0; background: var(--bg); z-index: 5; }
.tabs a { color: var(--text); text-decoration: none; padding: 10px 12px; border-bottom: 3px solid transparent; margin-bottom: -2px; font-weight: 600; font-size: 0.95rem; }
.tabs a:hover { color: var(--heading); }
.tabs a[aria-current="true"] { color: var(--accent); border-bottom-color: var(--accent); }
body.has-tabs .section[data-tab-hidden] { display: none; }

/* Collapsible groups */
details.role-group > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 8px; padding: 6px 0; }
details.role-group > summary::-webkit-details-marker { display: none; }
details.role-group > summary::before { content: ""; width: 8px; height: 8px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(-45deg); transition: transform 0.15s; margin-right: 4px; }
details.role-group[open] > summary::before { transform: rotate(45deg); }
details.role-group > summary h3 { margin: 0; }
details.role-group > summary:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

/* Tables */
table.plain { width: 100%; border-collapse: collapse; font-size: 0.93rem; }
table.plain th, table.plain td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--border); vertical-align: top; }
table.plain th { color: var(--heading); font-family: var(--font-head); font-weight: 600; }
.table-scroll { overflow-x: auto; }

/* Lists on public pages */
.checklist, .steps { padding-left: 1.3em; }
.checklist li, .steps li { margin-bottom: 8px; }

/* Loop diagram */
.loop { width: 100%; height: auto; margin: 10px 0 16px; }
.loop text { font-family: var(--font-body); font-size: 13px; fill: var(--heading); }
.loop .stage { fill: var(--card); stroke: var(--accent); stroke-width: 2; }
.loop .arrow { stroke: var(--muted); stroke-width: 2; fill: none; marker-end: url(#arrowhead); }
.loop .who { fill: var(--muted); font-size: 11px; }

/* Footer */
.footer { padding: 16px; color: var(--muted); font-size: 0.86rem; border-top: 1px solid var(--border); margin-top: 20px; }
.footer p { margin: 0 0 4px; }

@media (max-width: 600px) {
  .task { grid-template-columns: 1fr; }
  .task .actions { justify-content: flex-start; }
  .topnav a { padding: 6px 8px; font-size: 0.9rem; }
  h2 { font-size: 1.15rem; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
