:root {
  color-scheme: light;
  --red: #ca1724;
  --red-active: #ac252a;
  --ink: #171b24;
  --muted: #566071;
  --canvas: #d9dde3;
  --sidebar: #111318;
  --border: #dce0e5;
  --stripe: #f4f5f7;
  --rail: 232px;
  --soft-shadow: 0 2px 3px #19212e0f, 0 5px 12px #19212e0d;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font: 15px/1.45 "Segoe UI", Arial, sans-serif;
}
[hidden] { display: none !important; }
button, input, select { font: inherit; color: inherit; }
button, summary, label:has(input[type="checkbox"]) { cursor: pointer; }
button, a.link {
  min-height: 42px;
  padding: 8px 13px;
  background: linear-gradient(#fff, #f7f8fa);
  border: 1px solid #cbd1d8;
  border-radius: 8px;
  color: #343d49;
  font-size: 14px;
  font-weight: 600;
  box-shadow: 0 1px 2px #20293719;
}
button:disabled { opacity: .54; cursor: default; }
a { color: #93272b; font-weight: 600; text-underline-offset: 3px; }
:where(button, a, input, select, summary):focus-visible {
  outline: 3px solid #b02b34;
  outline-offset: 3px;
}
input[type="checkbox"] {
  width: 20px; height: 20px;
  margin: 0;
  flex: 0 0 auto;
  accent-color: var(--red-active);
  cursor: pointer;
}
aside {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 5;
  width: var(--rail);
  display: flex;
  flex-direction: column;
  padding: 14px 15px 18px;
  overflow-y: auto;
  color: #fff;
  background: var(--sidebar);
}
aside .brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 3px 4px 12px;
  border-bottom: 1px solid #30343c;
  text-align: center;
}
.brand .logo-box { position: relative; width: 90px; flex: none; mix-blend-mode: screen; }
.brand img { display: block; width: 100%; height: auto; object-fit: contain; }
.brand .logo-original { clip-path: inset(0 0 35% 0); }
.brand .logo-tagline {
  position: absolute; inset: 0;
  clip-path: inset(65% 0 0 0);
  filter: brightness(0) invert(1);
}
.brand span { color: #b9bdc5; font-size: 10px; line-height: 1.4; letter-spacing: 2.5px; }
aside nav {
  display: grid;
  align-content: start;
  gap: 5px;
  margin: 18px 0;
}
aside nav button {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 44px;
  padding: 10px 13px;
  border: 0;
  color: #d3d7df;
  background: transparent;
  box-shadow: none;
  font-weight: 500;
  text-align: left;
}
aside nav button[aria-pressed="true"] { color: white; background: var(--red); font-weight: 650; }
aside nav button svg { flex: 0 0 19px; width: 19px; height: 19px; }
aside nav button > * { pointer-events: none; }
aside .profile, aside footer {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  margin-top: auto;
  border-top: 1px solid #30343c;
  padding: 16px 8px 0;
  font-size: 13px;
}
aside .profile strong, aside .profile small, aside footer small { display: block; }
aside .profile small, aside footer small { color: #b6bbc5; }
main {
  margin-left: var(--rail);
  padding: clamp(20px, 2.7vw, 42px);
  max-width: 1750px;
}
.top, main > header, .boardhead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.top, main > header { margin-bottom: 18px; }
h1, h2 { margin: 0; line-height: 1.25; }
h1 { font-size: clamp(24px, 2.4vw, 32px); letter-spacing: -.03em; }
h2 { font-size: 18px; letter-spacing: -.02em; }
.top small, .meta, .hint, #count { color: var(--muted); }
.meta, #count { font-size: 13px; }
.demo { font-size: 13px; color: #5d6471; }
#stats {
  display: grid;
  grid-template-columns: repeat(3,minmax(0,1fr));
  gap: 14px;
  margin: 0 0 18px;
}
.metric {
  min-width: 0;
  padding: 17px 19px;
  background: linear-gradient(155deg, #fff 52%, #f5f6f8);
  border: 1px solid #d9dde3;
  border-radius: 12px;
  box-shadow: var(--soft-shadow);
}
.metric > span, .metric strong, .metric small { display: block; }
.metric > span { font-weight: 600; font-size: 14px; }
.metric strong { margin: 5px 0 1px; font-size: clamp(22px, 2.4vw, 29px); line-height: 1.2; letter-spacing: -.035em; }
.metric small { color: var(--muted); font-size: 13px; }
.board {
  min-width: 0;
  background: #fff;
  padding: clamp(16px, 2vw, 26px);
  border: 1px solid #e6e9ee;
  border-radius: 13px;
}
.boardhead { flex-wrap: wrap; }
#count { font-variant-numeric: tabular-nums; }
.filters {
  display: grid;
  grid-template-columns: minmax(160px, 1.6fr) repeat(2, minmax(130px, 1fr));
  align-items: end;
  gap: 12px;
  margin: 0 0 21px;
}
.filters label { display: block; min-width: 0; font-size: 13px; font-weight: 500; color: #545e6c; }
.filters input, .filters select {
  display: block;
  width: 100%; min-width: 0; min-height: 44px;
  margin-top: 5px;
  padding: 9px 11px;
  border: 1px solid #cfd4dc;
  border-radius: 7px;
  background: #fff;
  color: var(--ink);
  font-size: 15px;
}
#tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
#tabs:empty { display: none; }
#tabs button { background: white; border-color: var(--border); color: var(--ink); box-shadow: none; }
#tabs button[aria-pressed="true"] { color: white; background: var(--red-active); border-color: var(--red-active); }
#list { margin-top: 18px; }
details {
  overflow: clip;
  border: 1px solid #d9dde3;
  border-radius: 10px;
  background: white;
}
details + details { margin-top: 9px; }
details:nth-of-type(even) > summary { background: var(--stripe); }
summary {
  display: flex;
  align-items: center;
  padding: 13px 16px;
  gap: 13px;
  min-height: 58px;
  list-style: none;
}
summary::-webkit-details-marker { display: none; }
summary::before {
  content: "";
  width: 8px; height: 8px;
  flex: 0 0 8px;
  border-right: 2px solid #687385;
  border-bottom: 2px solid #687385;
  transform: rotate(-45deg);
}
details[open] > summary { background: #f4f5f7; box-shadow: inset 3px 0 var(--red-active); }
details[open] > summary::before { transform: rotate(45deg); }
summary:focus-visible { outline-offset: -3px; }
.summary, .line, .group-tools label, .volume-label {
  display: flex;
  align-items: center;
}
.summary { min-width: 0; flex: 1; justify-content: space-between; gap: 16px; }
.group-title { min-width: 0; }
.group-title strong, .grow strong { font-weight: 650; }
.group-title > :is(strong, .meta), .group-totals > *, .grow .meta { display: block; }
.group-id { font-variant-numeric: tabular-nums; }
.group-totals { text-align: right; flex: 0 0 auto; margin-left: auto; }
.meters { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.group-tools { border-top: 1px solid var(--border); padding: 0 16px; color: var(--muted); }
.group-tools label { width: fit-content; min-height: 44px; gap: 11px; font-size: 13px; font-weight: 600; }
.line { flex-wrap: wrap; gap: 10px; padding: 12px 16px; border-top: 1px solid var(--border); }
.line:nth-of-type(even) { background: #f7f8fa; }
.volume-label { flex: 1 1 280px; min-width: 0; gap: 11px; min-height: 42px; }
.grow { flex: 1; min-width: 0; }
.line:has(input:checked) { background: #fff3f3; }
.tag {
  display: inline-flex; align-items: center; gap: 6px;
  width: fit-content;
  border: 1px solid #19212e0d;
  border-radius: 40px;
  background: #edf1f6; color: #4d5c70;
  padding: 4px 9px;
  box-shadow: 0 2px 3px #19212e12,inset 0 1px 0 #ffffffb3;
  font-size: 12px; font-weight: 600; white-space: nowrap;
}
.tag::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.stage-0, .urgent { background: #fff7e7; color: #805610; }
.stage-1 { background: #eaf1fc; color: #3b5b88; }
.stage-2, .stage-3, .stage-4 { background: #eff8f2; color: #336f46; }
.line a, .line button.link { font-size: 13px; }
.line a.link { display: inline-flex; align-items: center; text-decoration: none; }
.empty { text-align: center; padding: 30px 10px; color: var(--muted); }
#bar:not(:empty) {
  position: sticky;
  z-index: 2; bottom: max(8px,env(safe-area-inset-bottom));
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  margin-top: 12px; padding: 12px 16px;
  border: 1px solid #cdd1d8; border-radius: 11px;
  background: white; box-shadow: 0 4px 15px #2029371c;
}
.selection-summary { font-weight: 600; }
#bar button:not(:disabled) { background: var(--red-active); border-color: var(--red-active); color: white; }
#bar button:disabled { opacity: 1; color: #626975; background: #eff0f3; border-color: #d9dce1; }
#message:empty { display: none; }
#message:not(:empty) {
  padding: 12px 16px;
  font-size: 14px; color: #374153; border: 1px solid #d3d9e3;
  background: #f8fafc; border-radius: 8px;
}
@media (hover:hover) {
  button:not(:disabled):hover { background: #eff1f4; }
  aside nav button:hover { color: white; background: #292d35; }
  aside nav button[aria-pressed="true"]:hover { background: #b21a27; }
  #tabs button:hover { background: #f9dede; border-color: #ce7376; color: #71191e; }
  #tabs button[aria-pressed="true"]:hover, #bar button:not(:disabled):hover { color: #fff; background: #b93b40; }
  #list summary:hover { background: #ebeff3; }
}
@media (max-width: 1100px) {
  :root { --rail: 198px; }
  main { padding: 22px 20px; }
  aside { padding-inline: 11px; }
  .metric { padding: 14px; }
}
@media (max-width: 840px) {
  aside { position: static; display: grid; grid-template-columns: 1fr auto; width: 100%; padding: 10px 16px; gap: 8px; }
  aside .brand { flex-direction: row; justify-content: flex-start; min-height: 36px; padding: 0; border: 0; }
  aside .brand .logo-box { width: 57px; }
  aside nav { grid-row: 2; grid-column: 1/-1; display: flex; flex-wrap: wrap; gap: 3px; margin: 0; }
  aside nav button { width: auto; flex: 0 1 auto; min-height: 42px; padding: 8px 12px; }
  aside .profile { grid-row: 1; grid-column: 2; align-self: center; align-items: flex-end; gap: 0; margin: 0; padding: 0; border: 0; }
  main { margin: 0; padding: 20px 16px 30px; }
}
@media (max-width: 590px) {
  main { padding: 16px 10px 25px; }
  aside { padding: 9px 10px; }
  aside nav { gap: 3px; }
  aside nav button { gap: 5px; padding: 9px; font-size: 13px; }
  .top, main > header { flex-wrap: wrap; }
  #stats { gap: 6px; }
  .metric { padding: 11px 9px; }
  .metric > span, .metric small { font-size: 12px; }
  .metric strong { font-size: 21px; }
  .board { padding: 13px 10px; }
  .filters { grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 7px; }
  .filters label:first-child { grid-column: 1/-1; }
  #tabs { gap: 5px; }
  #tabs button { font-size: 13px; padding: 7px 9px; }
  summary { padding: 10px; gap: 10px; }
  .summary { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 5px 8px; }
  .summary .group-title { grid-column: 1; grid-row: 1; }
  .summary .group-totals { grid-column: 2; grid-row: 1; }
  .summary .urgent { grid-column: 1/-1; grid-row: 2; }
  .group-tools, .line { padding-inline: 10px; }
  .volume-label { flex-wrap: wrap; }
  #bar:not(:empty) { padding: 9px 10px; flex-wrap: wrap; }
}
@media (pointer: coarse) {
  button, aside nav button, .group-tools label { min-height: 44px; }
  .filters input, .filters select { font-size: 16px; }
}
