:root {
  color-scheme: light;
  font: 100%/1.5 system-ui, sans-serif;
  color: #162842;
  background: #f2f5f9;
  --ink: #152741;
  --muted: #536479;
  --border: #d3dde8;
  --accent: #1659b4;
}
* { box-sizing: border-box; }
body { margin: 0; }
.shell { width: min(70rem, calc(100% - 2rem)); margin-inline: auto; }
.masthead { background: var(--ink); color: white; padding: 1.55rem 0 2rem; }
.brand { color: #b4cff2; font-size: .875rem; font-weight: 700; letter-spacing: .12em; }
h1, h2, p { margin: 0; }
h1 { font-size: clamp(1.8rem, 5vw, 2.5rem); line-height: 1.15; margin-top: .2rem; }
h2 { font-size: 1.24rem; line-height: 1.3; }
main { display: grid; gap: 1rem; padding-block: 1.25rem 2rem; }
.panel { background: white; border: 1px solid var(--border); border-radius: .8rem; padding: clamp(1rem, 3vw, 1.5rem); }
.timer-grid { display: grid; grid-template-columns: minmax(10rem, 1fr) minmax(12rem, 2fr) auto; align-items: start; gap: .85rem; margin-top: 1rem; }
.client-fields { display: grid; gap: .65rem; min-width: 0; }
.timer-actions { margin-top: 1.65rem; }
.timer-actions, .section-top, .button-row { display: flex; align-items: center; gap: .65rem; }
.section-top { justify-content: space-between; }
.button-row { flex-wrap: wrap; }
#elapsed { font: 700 1.4rem/1 ui-monospace, Consolas, monospace; }
label { display: grid; min-width: 0; gap: .3rem; font-size: .9rem; font-weight: 650; }
label[hidden] { display: none; }
input, textarea, select, button { font: inherit; }
input, textarea, select {
  width: 100%; min-width: 0; min-height: 2.75rem; padding: .52rem .66rem;
  border: 1px solid #aab9cb; border-radius: .4rem; background: white; color: var(--ink);
  font-size: 1rem; font-weight: 400;
}
textarea { resize: vertical; }
input:disabled { background: #edf2f8; opacity: 1; color: var(--ink); }
button {
  min-height: 2.75rem; padding: .48rem .85rem; border: 1px solid transparent; border-radius: .4rem;
  background: var(--accent); color: white; font-size: .9rem; font-weight: 700; cursor: pointer; white-space: nowrap;
}
button:hover:not(:disabled) { filter: brightness(.9); }
button:disabled { opacity: .58; cursor: default; }
button.secondary { background: #edf4fc; border-color: #c5d7ee; color: #143d73; }
button.stop { background: #a42436; }
:focus-visible { outline: 3px solid #3180dd; outline-offset: 2px; }
.filters { display: grid; grid-template-columns: minmax(9rem, 1.4fr) repeat(2, minmax(9rem, 1fr)) auto; align-items: end; gap: .65rem; margin-top: 1rem; }
.summary { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem; margin-top: 1.2rem; padding: .65rem .8rem; border-radius: .4rem; background: #eaf1fb; font-size: .9rem; }
#empty { padding: 1rem 0 .25rem; color: var(--muted); }
#entries { margin: 0; padding: 0; list-style: none; }
.entry { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: .9rem; padding: .8rem 0; }
.entry + .entry { border-top: 1px solid var(--border); }
.entry-title { overflow-wrap: anywhere; white-space: pre-line; font-weight: 650; }
.entry-meta { color: var(--muted); font-size: .875rem; overflow-wrap: anywhere; }
.entry-time { font-variant-numeric: tabular-nums; font-weight: 700; }
.entry button { padding-inline: .6rem; }
.backup summary { font-weight: 700; cursor: pointer; }
.backup p, #copy-dialog p { margin: .65rem 0; color: var(--muted); }
dialog { width: min(30rem, calc(100% - 2rem)); border: 1px solid var(--border); border-radius: .8rem; padding: 1.25rem; color: var(--ink); }
dialog::backdrop { background: #15274199; }
#edit-form { display: grid; gap: .85rem; }
#edit-error { color: #902032; }
#status { position: fixed; bottom: 1rem; right: 1rem; max-width: min(25rem, calc(100% - 2rem)); padding: .65rem .85rem; border-radius: .4rem; background: var(--ink); color: white; box-shadow: 0 3px 12px #15274130; }
@media (max-width: 46rem) {
  .timer-grid { grid-template-columns: 1fr 1fr; }
  .timer-actions { grid-column: 1 / -1; justify-content: space-between; margin-top: 0; }
  .filters { grid-template-columns: 1fr 1fr; }
  .filters label:first-child { grid-column: 1 / -1; }
  #clear { justify-self: start; }
}
@media (max-width: 32rem) {
  .timer-grid { grid-template-columns: 1fr; }
  .entry { grid-template-columns: minmax(0, 1fr) auto; gap: .4rem; }
  .entry .button-row { grid-column: 1 / -1; }
}
