:root {
  color-scheme: light;
  --bg: #f3f5f0;
  --panel: #ffffff;
  --ink: #17211b;
  --muted: #66706a;
  --line: #d9ded8;
  --accent: #0f766e;
  --accent-dark: #115e59;
  --danger: #b42318;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.shell {
  width: min(1040px, calc(100% - 32px));
  margin: 32px auto;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 20px;
  box-shadow: 0 12px 32px rgba(23, 33, 27, 0.06);
}

.auth {
  width: min(420px, 100%);
  margin: 12vh auto 0;
}

.topbar,
.clock,
.summary,
.entryRow,
.entryForm {
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 32px;
}

h2 {
  font-size: 20px;
}

.topbar {
  margin-bottom: 18px;
}

.topbar p,
.eyebrow,
.entryMeta,
.total span,
#authText {
  color: var(--muted);
}

.weekday {
  margin-top: 4px;
  color: var(--ink);
  font-weight: 750;
}

.eyebrow {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0;
  font-weight: 700;
  margin-bottom: 6px;
}

.running {
  margin-top: 8px;
  font-size: 44px;
  font-weight: 750;
  font-variant-numeric: tabular-nums;
}

.clockActions {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) minmax(180px, auto) auto auto auto;
  gap: 10px;
  align-items: end;
}

.activeStart {
  min-width: 180px;
}

.summary,
.editor,
.entries {
  margin-top: 16px;
}

.dateControls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: end;
}

.dateControls label {
  min-width: 160px;
}

.iconButton {
  width: 42px;
  padding: 0;
  font-size: 24px;
  line-height: 1;
}

.total {
  text-align: right;
}

.total strong {
  display: block;
  font-size: 34px;
  font-variant-numeric: tabular-nums;
}

form {
  display: grid;
  gap: 12px;
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 650;
}

input {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 12px;
  color: var(--ink);
  background: #fff;
  font: inherit;
}

button {
  min-height: 42px;
  border: 0;
  border-radius: 6px;
  padding: 0 16px;
  color: white;
  background: var(--accent);
  font: inherit;
  font-weight: 750;
  cursor: pointer;
}

button:hover {
  background: var(--accent-dark);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.ghost {
  color: var(--ink);
  background: transparent;
  border: 1px solid var(--line);
}

.ghost:hover {
  background: #edf1eb;
}

.danger {
  background: var(--danger);
}

.entryForm {
  align-items: end;
}

.entryForm label {
  flex: 1;
}

.entryRow {
  padding: 14px 0;
  border-top: 1px solid var(--line);
}

.entryRow:first-child {
  border-top: 0;
}

.entryMain {
  flex: 1;
}

.entryTitle {
  font-weight: 750;
}

.entryMeta {
  margin-top: 4px;
  font-size: 14px;
}

.entryActions {
  display: flex;
  gap: 8px;
}

.entryActions button {
  min-width: 72px;
}

.editing {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr)) auto auto;
  gap: 8px;
  align-items: end;
  width: 100%;
}

.error {
  margin-top: 12px;
  color: var(--danger);
  font-weight: 700;
}

@media (max-width: 760px) {
  .shell {
    width: min(100% - 20px, 1040px);
    margin: 16px auto;
  }

  .topbar,
  .clock,
  .summary,
  .entryRow,
  .entryForm,
  .editing {
    display: grid;
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .clockActions {
    grid-template-columns: 1fr;
  }

  .dateControls {
    display: grid;
    grid-template-columns: 42px 1fr 42px;
  }

  .dateControls label {
    min-width: 0;
  }

  .dateControls #today,
  .dateControls label:last-child {
    grid-column: 1 / -1;
  }

  .total {
    text-align: left;
  }
}
