:root {
  color-scheme: light;
  font: 14px/1.42 Rubik, system-ui, -apple-system, "Segoe UI", sans-serif;
  --canvas: #f4f6f9;
  --paper: #fff;
  --ink: #253047;
  --muted: #606d80;
  --line: #e0e8ef;
  --blue: #2a50ae;
  --blue-dark: #173d92;
  --blue-soft: #eaf0fc;
  --columns: 350px minmax(0, 1fr);
  --months: 3;
  color: var(--ink);
  background: var(--canvas);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
.app { max-width: 1650px; margin-inline: auto; padding: 18px clamp(14px, 2.2vw, 36px) 30px; }
h1, h2, p { margin: 0; }
h1 { font-size: 24px; font-weight: 500; line-height: 1.2; letter-spacing: -.02em; }
button { font: inherit; color: inherit; cursor: pointer; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; }
.masthead { margin-bottom: 13px; }
.brand { display: flex; align-items: center; gap: 12px; }
.mark { width: 41px; height: 41px; border-radius: 9px; display: grid; place-items: center; color: #fff; background: var(--blue); flex: none; }
.mark svg { width: 24px; height: 24px; }

.roadmap-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.roadmap-tabs button {
  min-height: 42px;
  padding: 6px 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  color: var(--muted);
  font-weight: 500;
}
.roadmap-tabs button:is(:hover, [aria-selected="true"]) {
  border-color: #aec0e5;
  background: var(--blue-soft);
  color: var(--blue-dark);
}

.board { border: 1px solid var(--line); background: var(--paper); border-radius: 9px; overflow: hidden; }
.board-toolbar {
  min-height: 46px;
  padding: 8px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 4px 12px;
  border-bottom: 1px solid var(--line);
}
.board-toolbar h2 { font-size: 14px; font-weight: 600; }
.period, .board-status { font-size: 12px; color: var(--muted); }
.period:empty { display: none; }
.board-status { padding: 12px 16px; }
.gantt-scroll { overflow-x: auto; }
#strategy-scroll.has-dates { --name-width: 350px; --columns: var(--name-width) minmax(0, 1fr); }
#strategy-scroll.has-dates > * { min-width: calc(var(--name-width) + 52px * var(--months)); }
#strategy-scroll.has-dates :is(.name-cell, .head-left) { position: sticky; inset-inline-start: 0; z-index: 2; background: var(--paper); }
#strategy-scroll:not(.has-dates) :is(.entry, .track-header) { grid-template-columns: minmax(0, 1fr); }
#strategy-scroll:not(.has-dates) .timeline { display: none; }

.timeline-header, .entry, .track-header { display: grid; grid-template-columns: var(--columns); min-width: 0; }
.timeline-header { background: var(--paper); border-bottom: 1px solid var(--line); }
.head-left, .name-cell {
  display: flex;
  align-items: center;
  min-width: 0;
  padding: 6px 14px 6px 17px;
  border-inline-end: 1px solid var(--line);
}
.head-left { color: var(--muted); font-size: 11px; font-weight: 600; }
.head-right { min-width: 0; }
.quarters, .months { display: grid; grid-template-columns: repeat(var(--months), minmax(0, 1fr)); }
.quarters { background: #fafbfd; border-bottom: 1px solid var(--line); }
.quarters span, .months span {
  display: grid;
  place-items: center;
  min-width: 0;
  min-height: 30px;
  padding: 3px;
  text-align: center;
  border-inline-end: 1px solid var(--line);
  font-size: 11px;
}
.quarters span { min-height: 35px; color: #445674; font-size: 12px; font-weight: 600; }
.months span { color: var(--muted); font-weight: 500; }
.quarters span:last-child, .months span:last-child { border-inline-end: 0; }

.entry { min-height: 51px; border-bottom: 1px solid #ecf1f6; }
.entry:last-child { border-bottom: 0; }
.task-cell { padding-inline-start: 27px; gap: 8px; }
.entry-name {
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  text-align: left;
  min-width: 0;
  min-height: 38px;
  padding: 0;
  border: 0;
  background: transparent;
  gap: 2px;
}
.entry-name strong { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; font-weight: 500; }
.entry-name:hover strong { color: var(--blue); }
.entry-name small { color: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.task-indicator { flex: 0 0 5px; width: 5px; height: 5px; border-radius: 50%; background: #92acdf; }

.track { --track-color: var(--blue); }
.track[data-track="improvements"] { --track-color: #55769f; }
.track + .track { border-top: 1px solid var(--line); }
.track-header { min-height: 49px; background: #f9fafc; border-bottom: 1px solid var(--line); list-style: none; cursor: pointer; }
.track-header::-webkit-details-marker { display: none; }
.track-header:hover { background: var(--blue-soft); }
.track-header:focus-visible { outline-offset: -2px; }
.track-label { gap: 8px; font-size: 13px; font-weight: 600; }
.track-name { min-width: 0; overflow-wrap: anywhere; }
.track-chevron { width: 8px; height: 8px; margin-inline: 3px; flex: none; border: solid var(--blue); border-width: 0 2px 2px 0; transform: rotate(-45deg); }
.track[open] .track-chevron { transform: translateY(-2px) rotate(45deg); }
.count { margin-inline-start: auto; color: var(--muted); font-size: 11px; font-weight: 400; font-variant-numeric: tabular-nums; }
.empty { padding: 12px 17px; color: var(--muted); font-size: 12px; }

.timeline {
  position: relative;
  min-width: 0;
  overflow: hidden;
  background:
    linear-gradient(to right, transparent calc(100% - 1px), #e8edf4 0) 0 0 / calc(100% / var(--months)) 100%,
    linear-gradient(to right, #fff 50%, #fafbfd 50%) 0 0 / calc(200% / var(--months)) 100%;
}
.bar, .groupbar { position: absolute; top: 50%; transform: translateY(-50%); border-radius: 5px; }
.bar {
  height: 20px;
  min-width: 3px;
  padding: 0 6px;
  border: 0;
  overflow: hidden;
  color: #fff;
  background: var(--track-color, var(--blue));
  font-size: 11px;
  font-weight: 500;
  line-height: 20px;
  white-space: nowrap;
  text-align: left;
  text-overflow: ellipsis;
}
.bar:hover { filter: brightness(.9); }
.bar.edge-left { border-start-start-radius: 0; border-end-start-radius: 0; }
.bar.edge-right { border-start-end-radius: 0; border-end-end-radius: 0; }
.groupbar { height: 8px; background: #c9d8f5; }

dialog {
  width: min(480px, calc(100vw - 22px));
  max-height: calc(100dvh - 20px);
  padding: 0;
  border: 0;
  border-radius: 12px;
  box-shadow: 0 24px 65px #14295035;
  color: var(--ink);
}
dialog::backdrop { background: #1521378a; }
.dialog-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px 12px; border-bottom: 1px solid var(--line); }
.dialog-header h2 { font-size: 18px; font-weight: 500; overflow-wrap: anywhere; }
.close { width: 34px; min-height: 34px; flex: none; padding: 0; border: 1px solid var(--line); border-radius: 8px; background: var(--paper); color: var(--blue); font-size: 20px; }
.close:hover { background: var(--blue-soft); }
.dialog-body { display: grid; gap: 12px; padding: 17px 20px; }
.description { white-space: pre-wrap; overflow-wrap: anywhere; }
.description:empty { display: none; }
.detail-weeek { color: var(--blue); justify-self: start; }

@media (max-width: 900px) {
  :root { --columns: 275px minmax(0, 1fr); }
  #strategy-scroll.has-dates { --name-width: 275px; }
}
@media (max-width: 680px) {
  :root { --columns: 48% minmax(0, 1fr); }
  .app { padding: 12px 10px 28px; }
  h1 { font-size: 19px; }
  .mark { width: 35px; height: 35px; border-radius: 8px; }
  .mark svg { width: 21px; height: 21px; }
  .board-toolbar { padding-inline: 10px; }
  .head-left, .name-cell { padding-inline: 10px 6px; }
  .task-cell { padding-inline-start: 13px; gap: 5px; }
  .entry { min-height: 59px; }
  .entry-name strong { font-size: 12px; white-space: normal; overflow-wrap: anywhere; }
  .entry-name small, .months span { font-size: 10px; }
  .bar { height: 18px; padding-inline: 4px; font-size: 10px; line-height: 18px; }
  #strategy-scroll.has-dates { --name-width: 150px; }
}
