:root {
  color-scheme: dark;
  --page: #0f1418;
  --surface: #141a20;
  --raised: #1d252d;
  --hover: #273440;
  --line: #2d3943;
  --strong-line: #465667;
  --ink: #e6ebef;
  --muted: #a4b2be;
  --link: #9ac8ed;
  --green: #3dbe7a;
  --amber: #e0a526;
  --red: #f26e59;
  --blue: #88bde5;
  --neutral: #71808c;
  font-family: "IBM Plex Sans KR", "Malgun Gothic", "Apple SD Gothic Neo", system-ui, sans-serif;
  font-variant-numeric: tabular-nums;
  text-size-adjust: 100%;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--page);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.5;
  word-break: keep-all;
  overflow-wrap: anywhere;
}
button, input, select, textarea { font: inherit; }
button, a, summary { touch-action: manipulation; }
button, summary, a { -webkit-tap-highlight-color: transparent; }
button {
  min-height: 36px;
  padding: 6px 13px;
  border: 1px solid var(--strong-line);
  border-radius: 6px;
  background: var(--raised);
  color: var(--ink);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
button:disabled { cursor: default; }
button:enabled:hover { background: var(--hover); border-color: #7290a8; }
a { color: var(--link); text-underline-offset: .2em; }
button:focus-visible, a:focus-visible, summary:focus-visible, input:focus-visible,
select:focus-visible, textarea:focus-visible, [tabindex]:focus-visible {
  outline: 2px solid #b1dcff;
  outline-offset: 3px;
}
::selection { color: #f6faff; background: #345678; }
h1, h2, h3, p, ul, ol { margin: 0; }
h1, h2, h3 { color: var(--ink); line-height: 1.35; }
h1 { font-size: clamp(23px, 2.7vw, 31px); letter-spacing: -.055em; }
h2 { font-size: clamp(17px, 2vw, 21px); letter-spacing: -.045em; }
h3 { font-size: 16px; letter-spacing: -.03em; }
main, .topbar {
  width: min(1180px, 100%);
  margin-inline: auto;
  padding-inline: clamp(16px, 3.8vw, 46px);
}
main { padding-block: clamp(20px, 3.6vw, 42px) 64px; }
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 20px;
  min-height: 54px;
  padding-block: 8px;
  border-bottom: 1px solid var(--line);
}
.topbar nav:empty { display: none; }
#connection:not([hidden]) {
  width: min(1088px, calc(100% - 32px));
  margin: 12px auto 0;
  padding: 9px 12px;
  border: 1px solid #694736;
  border-radius: 6px;
  background: #2c231c;
  color: #f6c68a;
}
.brand { color: var(--ink); font-weight: 700; letter-spacing: -.04em; text-decoration: none; }
nav, .tabs, .actions, .legend, .dhsteps { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
nav a { display: inline-flex; align-items: center; min-height: 35px; padding: 4px 8px; font-size: 13px; text-decoration: none; }
nav a:hover, .trackname a:hover { text-decoration: underline; }
.heading { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 6px 16px; margin-bottom: 18px; }
.date, .time, time { font-variant-numeric: tabular-nums; }
.sub, .date, .time, .muted, small { color: var(--muted); }
.sub, .muted { font-size: 13px; }
.date, .time { font-size: 14px; }
.datepick { display: block; max-width: 100%; }
.datepick input[type="date"] { min-height: 34px; width: auto; max-width: 100%; font-size: 13px; }
.tabs {
  display: inline-flex;
  width: fit-content;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
}
.tabs button, .tabs a { min-height: 32px; padding: 5px 15px; border: 0; border-radius: 4px; background: transparent; color: var(--muted); font-size: 13px; text-decoration: none; }
.tabs :is(.active, [aria-selected="true"], [aria-pressed="true"], [aria-current="page"]) { background: #2d3a46; color: #fff; }
.board, .period, .log { min-width: 0; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); }
.board { margin-block: 12px; }
.trackrow {
  display: grid;
  grid-template-columns: clamp(65px, 13%, 140px) minmax(0, 1fr);
  align-items: center;
  gap: clamp(6px, 1.4vw, 18px);
  min-height: 56px;
  padding: 7px clamp(12px, 1.7vw, 20px);
}
.trackrow + .trackrow { border-top: 1px solid var(--line); }
.trackname { color: var(--ink); font-weight: 680; font-size: 14px; text-align: left; }
.trackrow button.trackname {
  justify-self: start;
  min-height: 38px;
  padding: 0 3px 0 0;
  border: 0;
  background: transparent;
  color: var(--link);
}
.trackrow button.trackname:hover { text-decoration: underline; }
.trackname a, a.trackname { color: var(--link); text-decoration: none; }
.trackstaff { display: flex; align-items: center; flex-wrap: wrap; gap: 1px 7px; min-width: 0; }
.trackstaff .past-missed {
  min-height: 26px;
  padding: 1px 4px;
  border-color: #75433a;
  background: #302220;
  color: #ffa797;
  font-size: 11px;
  white-space: nowrap;
}
.past-list { padding: 0; list-style: none; }
.past-list li { padding-block: 8px; border-block-start: 1px solid var(--line); }
.past-list time { color: var(--muted); font-size: 13px; }
.axisrow {
  min-height: 33px;
  padding-block: 6px;
  color: var(--muted);
  background: #192127;
  border-radius: 9px 9px 0 0;
}
.axislabels { display: flex; justify-content: space-between; gap: 1px; padding-inline: 2%; font-size: 11px; }
.trackbody { position: relative; min-width: 0; }
.unscheduled { display: block; width: fit-content; margin: -4px 0 1px 1%; color: var(--muted); font-size: 11px; }
.untimed { display: inline-flex; align-items: center; gap: 4px; margin-inline: 1%; color: var(--muted); font-size: 12px; }
.lane {
  position: relative;
  min-width: 0;
  min-height: 32px;
}
.markgroup {
  position: absolute;
  top: 50%;
  display: grid;
  grid-auto-flow: row;
  grid-template-columns: repeat(2, auto);
  gap: 2px;
  align-items: center;
  justify-content: center;
  transform: translate(-50%, -50%);
  border-radius: 2px;
}
.markgroup:has(:only-child) { display: inline-flex; }
.markgroup .dot { width: 9px; height: 9px; border-radius: 2px; }
.markgroup:has(:nth-child(5)) .dot { width: 6px; height: 6px; }
.slot, .dot, .status { --signal: var(--neutral); }
.ok { --signal: var(--green); }
.warn { --signal: var(--amber); }
.late, .issue { --signal: var(--red); }
.active { --signal: var(--blue); }
.future { --signal: #536471; }
.pending { --signal: #8798a5; }
.slot {
  position: absolute;
  top: 50%;
  display: inline-block;
  min-height: 12px;
  height: 12px;
  padding: 0;
  border: 1px solid var(--signal);
  border-radius: 3px;
  background: var(--signal);
  transform: translateY(-50%);
}
.slot:is(.pending, .future) { background: transparent; }
.slot:enabled:hover { border-color: var(--ink); background: var(--signal); }
.slots { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; }
.slots .slot { position: static; width: 20px; max-width: 100%; transform: none; }
.legend { gap: 5px 15px; margin-block: 8px 18px; color: var(--muted); font-size: 12px; }
.legend > *, .dhsteps > * { display: inline-flex; align-items: center; gap: 5px; }
.dot { display: inline-block; flex: 0 0 auto; width: 9px; height: 9px; border: 1px solid var(--signal); border-radius: 50%; background: var(--signal); }
.dot:is(.future, .pending) { background: transparent; }
.dot.issue { border-radius: 1px; transform: rotate(45deg) scale(.84); }
.dhsteps { gap: 5px 16px; color: var(--muted); font-size: 13px; }
.stage[data-state="ok"] { color: #bde7cf; }
.stage[data-state="issue"] { color: #ffc2b6; }
.status { display: inline-flex; align-items: center; gap: 6px; color: var(--signal); font-size: 12px; font-weight: 650; }
.status:not(:has(.dot))::before { content: ""; flex: 0 0 auto; width: 7px; height: 7px; border-radius: 50%; background: var(--signal); }
.status:is(.future, .pending) { color: var(--muted); }
.period, .log { margin-block: 16px; padding: 0 clamp(12px, 2.1vw, 22px); }
.period > :is(h2, h3, header, .heading), .log > :is(h2, h3) { padding-block: 14px; margin-bottom: 0; }
.sectionhead { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 5px 12px; padding-block: 13px; }
.period > p, .log > p { padding-block: 12px; }
.task {
  display: grid;
  grid-template-columns: minmax(42px, auto) minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px 14px;
  padding-block: 12px;
  min-width: 0;
  border-top: 1px solid var(--line);
}
.task > * { min-width: 0; }
.task-title { font-weight: 570; }
.task-info > summary { width: fit-content; }
.task-info > summary::marker { color: var(--muted); font-size: .75em; }
.task-info > p { margin-top: 5px; color: var(--muted); font-size: 13px; font-weight: 400; }
.task .time { min-width: 72px; font-size: 13px; }
.task .actions { justify-content: flex-end; }
.task .actions button { padding-inline: 10px; }
.task input[type="checkbox"] { width: 19px; height: 19px; margin: 0; accent-color: var(--green); }
.actions label { display: inline-flex; align-items: center; gap: 7px; cursor: pointer; }
.log { font-size: 14px; }
details > summary { cursor: pointer; }
.log > summary { padding-block: 14px; font-weight: 650; }
.log ol, .log ul { padding: 0; list-style: none; }
.log li { padding-block: 9px; border-top: 1px solid var(--line); }
.log time { color: var(--muted); }

.dhpage { width: 100%; padding: 0; }
body:has(.dhmain) .topbar { display: none; }
.dhmain { width: min(100%, 466px); margin: 0 auto; padding: clamp(32px, 10svh, 96px) 16px 40px; }
.dhmain .date { display: block; margin: 0 0 12px 2px; color: var(--muted); font-weight: 650; }
.dhgrid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: clamp(12px, 3.5vw, 20px);
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}
.dhbutton {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  width: 100%;
  min-height: 88px;
  padding: 10px 5px;
  font-size: clamp(15px, 2.5vw, 18px);
  letter-spacing: -.045em;
  line-height: 1.45;
}
.dhresult, .dhgrid > .dhbutton:nth-child(n+3) { grid-column: 1 / -1; min-height: 64px; }
.dhbutton .sub, .dhbutton small { font-size: 13px; font-weight: 500; letter-spacing: -.02em; }
.dhbutton:disabled { border-color: var(--line); background: #181f25; color: #8b99a5; }
.dhbutton:is(.ok, [data-state="done"]) { border-color: #377654; background: #204937; color: #c5f4da; }
.dhbutton:is(.ok, [data-state="done"]) .sub { color: #b1e9c9; }
.dhbutton:is(.issue, [data-state="issue"]) { border-color: #a75b50; background: #4c2b29; color: #ffd5cb; }
.dhbutton:is(.issue, [data-state="issue"]) .sub { color: #efb6a9; }

dialog {
  width: min(410px, calc(100vw - 32px));
  max-height: calc(100svh - 32px);
  margin: auto;
  padding: clamp(18px, 3vw, 25px);
  overflow-y: auto;
  border: 1px solid var(--strong-line);
  border-radius: 11px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 18px 60px #0006;
}
dialog::backdrop { background: rgb(6 10 14 / 77%); }
dialog > h2 { margin-bottom: 13px; }
dialog > p { color: var(--muted); }
dialog:has([data-commit]) { max-width: 350px; }
dialog:has([data-commit]) .actions { display: grid; grid-template-columns: 1fr 1.4fr; }
dialog .error:not([hidden]) { margin-top: 14px; }
dialog [data-commit="dh-issue"] { border-color: #d59686; background: #e3a18f; color: #321d17; }
dialog [data-commit="dh-issue"]:enabled:hover { border-color: #ffb8a8; background: #eeb9a9; }
dialog .actions { justify-content: flex-end; margin-top: 20px; }
dialog button { min-height: 42px; }
form { display: grid; gap: 12px; }
.field, form > label { display: grid; gap: 5px; min-width: 0; font-size: 13px; color: var(--muted); }
input:not([type=checkbox]):not([type=radio]), select, textarea {
  min-width: 0;
  width: 100%;
  min-height: 39px;
  padding: 7px 9px;
  border: 1px solid var(--strong-line);
  border-radius: 5px;
  background: var(--page);
  color: var(--ink);
}
input::placeholder, textarea::placeholder { color: #8796a2; }
.primary { border-color: #8dbbe0; background: #91bbe0; color: #10222f; }
.primary:enabled:hover { border-color: #c3e3ff; background: #b2d7f4; }
.danger { border-color: #805249; background: #322624; color: #ffc2b6; }
.danger:enabled:hover { border-color: #c37969; background: #492e29; }
.error { color: #ffa591; font-size: 14px; }
.access { max-width: 460px; margin: 12svh auto 0; padding: 22px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.access > * + * { margin-top: 10px; }
@media (max-width: 560px) {
  main { padding-block: 18px 40px; }
  .heading { align-items: center; margin-bottom: 12px; }
  .trackrow { grid-template-columns: 54px minmax(0, 1fr); gap: 6px; min-height: 52px; padding-inline: 10px; }
  .dhsteps, .legend { column-gap: 9px; }
  .axisrow { min-height: 29px; }
  .axislabels { font-size: 10px; padding-inline: 0; }
  .task { grid-template-columns: minmax(38px, max-content) minmax(0, 1fr); gap: 5px 10px; }
  .task .time { min-width: 43px; }
  .task > .actions { grid-column: 2; justify-content: flex-start; }
  .task .actions button { min-height: 40px; }
  .task .actions:empty { display: none; }
  main.dhpage { padding: 0; }
}
@media (pointer: coarse) {
  .tabs button, .actions button, nav a, .actions label { min-height: 44px; }
}
@media (forced-colors: active) {
  .slot, .dot, .status::before { forced-color-adjust: none; }
  .slot, .dot { outline: 1px solid CanvasText; }
}
