:root {
  color-scheme: dark;
  accent-color: #c4c4c4;
  --page: #101010;
  --surface: #1c1c1c;
  --line: #2f2f2f;
  --border: #474747;
  --text: #ebebeb;
  --muted: #ababab;
  background: var(--page);
  color: var(--text);
  font: 16px/1.45 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
body, h1, h2, p { margin: 0; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
main { width: min(680px, calc(100% - 32px)); margin: 32px auto; }
h1 { margin-bottom: 15px; font-size: 1.65rem; line-height: 1.2; }
h2 { font-size: 1rem; }
label { min-width: 0; color: var(--muted); font-size: .81rem; }
input, button { height: 34px; border: 1px solid var(--border); border-radius: 4px; background: var(--surface); color: var(--text); font: inherit; }
input { width: 100%; min-width: 0; padding: 0 7px; font-variant-numeric: tabular-nums; }
input::placeholder { color: #9c9c9c; }
input::-webkit-date-and-time-value { text-align: left; min-height: 1.25em; }
input::-webkit-calendar-picker-indicator { margin: 0; padding: 0; }
input[aria-invalid="true"] { border-color: #d7d7d7; }
button { padding: 0 10px; white-space: nowrap; cursor: pointer; font-size: .84rem; }
button:hover:enabled { background: #2e2e2e; }
button:disabled { opacity: .48; cursor: default; }
.primary { color: #111111; background: #dedede; border-color: #dedede; font-weight: 650; }
.primary:hover:enabled { background: #ffffff; }
.plain { border-color: transparent; background: transparent; color: var(--muted); }
.plain:hover:enabled { color: var(--text); }
input:focus-visible, button:focus-visible { outline: 2px solid #cccccc; outline-offset: 2px; }
#shift-form { display: grid; grid-template-columns: minmax(132px, 1.3fr) repeat(2, minmax(104px, 1fr)) minmax(90px, .75fr) auto; align-items: end; gap: 6px 8px; }
#shift-form label { display: grid; gap: 3px; white-space: nowrap; }
#shift-break { max-width: 116px; }
.shift-actions, .rate-controls, .row-actions, .dialog-actions { display: flex; align-items: center; gap: 5px; }
#shift-form .message { grid-column: 1 / -1; }
#shift-preview:empty { display: none; }
.message { font-size: .81rem; color: #dedede; }
#storage-warning { margin-bottom: 10px; }
.summary { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 9px 16px; padding: 12px 0; margin-top: 15px; border-block: 1px solid var(--line); font-size: .92rem; }
.summary p { overflow-wrap: anywhere; }
.summary strong, .shift-row { font-variant-numeric: tabular-nums; }
.vp { color: var(--muted); font-size: .82rem; }
.vp small { font-size: .75rem; }
.rate-controls { gap: 6px; }
#hourly-rate { width: 5.05rem; }
.rate-unit { color: var(--muted); font-size: .81rem; }
#rate-error { margin-top: 4px; }
.list-heading { min-height: 42px; display: flex; justify-content: space-between; align-items: center; margin-top: 4px; }
#shift-list { list-style: none; padding: 0; margin: 0; }
.shift-row { display: grid; grid-template-columns: 93px 112px minmax(0, 1fr) auto; align-items: center; gap: 1px 9px; min-height: 39px; border-top: 1px solid var(--line); font-size: .88rem; }
.row-meta { display: flex; flex-wrap: wrap; align-items: baseline; gap: 1px 6px; font-size: .82rem; }
time, .break-value, .row-note { color: var(--muted); }
.break-value::before { content: "· "; }
.row-note { grid-column: 1 / -1; padding-bottom: 6px; overflow-wrap: anywhere; font-size: .81rem; }
.row-actions { gap: 1px; }
.row-actions button { padding: 0 5px; }
.empty { color: var(--muted); font-size: .86rem; }
footer { margin-top: 18px; color: var(--muted); font-size: .75rem; }
dialog { padding: 16px; width: min(360px, calc(100% - 32px)); border: 1px solid var(--border); border-radius: 5px; background: var(--surface); color: var(--text); }
dialog::backdrop { background: rgba(0, 0, 0, .7); }
dialog p { margin-top: 6px; color: var(--muted); font-size: .88rem; }
.dialog-actions { justify-content: flex-end; margin-top: 12px; }

@media (max-width: 640px) {
  main { width: calc(100% - 28px); margin-block: 20px; }
  h1 { margin-bottom: 12px; font-size: 1.45rem; }
  #shift-form { grid-template-columns: minmax(0, 1.25fr) repeat(2, minmax(0, 1fr)); }
  #shift-form input { padding-inline: 5px; }
  .shift-actions { grid-column: span 2; }
  input, button { height: 40px; }
  .summary { margin-top: 12px; }
  .shift-row { grid-template-columns: max-content minmax(0, 1fr) auto; padding-block: 3px; column-gap: 7px; }
  .row-meta { grid-row: 2; grid-column: 1 / 3; }
  .row-actions { grid-area: 1 / 3 / span 2 / 4; }
}