/* Time tracker styles. Mobile first; tokens first, then layout, then components. */

:root {
  color-scheme: light dark;
  --bg: #f2f2f7;
  --card: #ffffff;
  --soft: #f2f2f7;
  --segment-track: #e3e3e8;
  --text: #000000;
  --text-2: #6c6c70;
  --line: #e5e5ea;
  --line-strong: #aeaeb2;
  --field-border: #86868b;
  --tint: #0040dd;
  --tint-text: #0040dd;
  --tint-soft: #e9eefc;
  --on-tint: #ffffff;
  --signal: #1e7b34;
  --signal-text: #1b6e2d;
  --signal-soft: #e3f3e6;
  --noise: #8e8e93;
  --noise-soft: #e5e5ea;
  --noise-text: #3a3a3c;
  --danger: #d70015;
  --danger-text: #b3000f;
  --target-mark: #000000;
  --swatch-edge: transparent;
  --shadow: 0 8px 24px rgb(0 0 0 / 10%);
  --radius-card: 22px;
  --radius-list: 16px;
  --radius-tile: 18px;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 22px;
  --tap: 44px;
  --font:
    -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  --font-round:
    ui-rounded, 'SF Pro Rounded', -apple-system, BlinkMacSystemFont, 'Helvetica Neue', sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000000;
    --card: #1c1c1e;
    --soft: #2c2c2e;
    --segment-track: #2c2c2e;
    --text: #ffffff;
    --text-2: #a1a1a6;
    --line: #38383a;
    --line-strong: #636366;
    --field-border: #8e8e93;
    --swatch-edge: rgb(255 255 255 / 45%);
    --tint-text: #6ea8ff;
    --tint-soft: #16264d;
    --signal-text: #5ad17a;
    --signal-soft: #173a22;
    --noise-soft: #3a3a3c;
    --noise-text: #e5e5ea;
    --danger-text: #ff6961;
    --target-mark: #ffffff;
    --shadow: 0 8px 24px rgb(0 0 0 / 50%);
  }
}

* {
  box-sizing: border-box;
}

html {
  /* Keeps a focused control from hiding behind the floating tab bar. */
  scroll-padding-bottom: 120px;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.3;
  -webkit-text-size-adjust: 100%;
}

h1,
h2,
p,
ul,
fieldset {
  margin: 0;
  padding: 0;
}

ul {
  list-style: none;
}

fieldset {
  border: 0;
  min-width: 0;
}

button,
input,
select {
  font: inherit;
  color: inherit;
}

a {
  color: var(--tint-text);
}

:focus-visible {
  outline: 3px solid var(--tint-text);
  outline-offset: 2px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.icon {
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}

/* Layout */

.view {
  display: flex;
  flex-direction: column;
  max-width: 480px;
  margin: 0 auto;
  padding: calc(env(safe-area-inset-top) + var(--space-3)) var(--space-4)
    calc(env(safe-area-inset-bottom) + 120px);
}

.top-line,
.nav-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  min-height: var(--tap);
  padding: 0 var(--space-1);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
}

.nav-bar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  padding: 0;
}

.nav-title {
  font-size: 17px;
  font-weight: 600;
  color: var(--text);
}

h1:focus {
  outline: none;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  min-height: var(--tap);
  font-size: 17px;
  font-weight: 400;
  text-decoration: none;
}

.nav-action {
  justify-self: end;
  font-weight: 600;
}

.page-title {
  padding: 0 var(--space-1);
  font-size: 34px;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: var(--tap);
  margin-top: var(--space-5);
  padding: 0 var(--space-1);
}

.section-title {
  font-size: 20px;
  font-weight: 700;
}

.group-label {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin: 20px 0 6px;
  padding: 0 var(--space-4);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
}

.text-link {
  display: inline-flex;
  align-items: center;
  min-height: var(--tap);
  font-size: 16px;
  font-weight: 400;
  color: var(--tint-text);
  text-decoration: none;
}

.footnote {
  margin-top: var(--space-2);
  padding: 0 var(--space-4);
  font-size: 13px;
  line-height: 1.4;
  color: var(--text-2);
}

.muted {
  font-size: 14px;
  color: var(--text-2);
}

.lead {
  margin-top: 6px;
  padding: 0 var(--space-1);
  font-size: 15px;
}

.caption {
  font-size: 13px;
  color: var(--text-2);
}

.caption-strong {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
}

.split {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-2);
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 20px;
}

/* Cards and lists */

.card {
  margin-top: var(--space-3);
  background: var(--card);
  border-radius: var(--radius-card);
}

.pad {
  padding: 18px;
}

.list {
  overflow: hidden;
  border-radius: var(--radius-list);
}

.row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-height: 56px;
  padding: 6px 14px;
  border-bottom: 1px solid var(--line);
  color: var(--text);
}

.list > :last-child,
.list > :last-child > .row:last-child,
.list > li:last-child > .entry-main {
  border-bottom: 0;
}

.row-main {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
  overflow-wrap: anywhere;
}

.row-value {
  flex-shrink: 0;
  color: var(--text-2);
  font-variant-numeric: tabular-nums;
}

.row-link {
  justify-content: center;
  min-height: var(--tap);
  color: var(--text);
  text-decoration: none;
}

a.row.text-link,
.row.text-link {
  color: var(--tint-text);
}

.move-buttons {
  display: flex;
  flex-shrink: 0;
}

/* Compass and numbers */

.compass {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: 14px 18px;
  color: var(--text);
  text-decoration: none;
}

.compass-side {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  gap: var(--space-2);
  min-width: 0;
}

.compass-detail {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--space-1) var(--space-2);
  font-size: 12px;
  color: var(--text-2);
}

.big-number,
.huge-number,
.clock {
  font-family: var(--font-round);
  font-weight: 700;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.big-number {
  font-size: 38px;
}

.huge-number {
  margin-bottom: var(--space-3);
  font-size: 56px;
  letter-spacing: -1px;
}

.clock {
  margin-top: 10px;
  font-size: 60px;
  letter-spacing: -1px;
}

.ratio-bar {
  position: relative;
  height: 10px;
  border-radius: 5px;
  background: var(--noise);
}

.ratio-bar.is-empty {
  background: var(--line);
}

.ratio-fill {
  width: var(--fill);
  height: 100%;
  /* The gap separates signal from noise without relying on colour alone. */
  border-right: 3px solid var(--card);
  border-radius: 5px 0 0 5px;
  background: var(--signal);
}

.ratio-bar.is-empty .ratio-fill {
  border-right: 0;
}

.ratio-target {
  position: absolute;
  top: -4px;
  left: var(--target);
  width: 2px;
  height: 18px;
  background: var(--target-mark);
}

/* Now card */

.now-card {
  display: flex;
  flex-direction: column;
  margin-top: 10px;
  padding: 18px 18px var(--space-4);
}

.now-head {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.now-name {
  font-size: 20px;
  font-weight: 700;
}

.button-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 10px;
}

/* Buttons */

.button {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 var(--space-4);
  border: 0;
  border-radius: 24px;
  background: var(--card);
  color: var(--tint-text);
  font-size: 16px;
  font-weight: 600;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}

.now-card .button,
.dialog .button {
  background: var(--soft);
}

.button-primary,
.dialog .button-primary {
  background: var(--tint);
  color: var(--on-tint);
}

.button-danger,
.dialog .button-danger {
  background: var(--danger);
  color: #ffffff;
}

.text-danger {
  color: var(--danger-text);
}

.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--tap);
  height: var(--tap);
  flex-shrink: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text-2);
  cursor: pointer;
}

.icon-button:disabled {
  color: var(--line-strong);
  cursor: default;
}

.round-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  border-radius: 50%;
  color: #ffffff;
}

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

.round-add {
  background: var(--signal);
}

/* Badges, dots, pills */

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  flex-shrink: 0;
  border-radius: 10px;
  background: var(--badge-color);
  color: #ffffff;
}

.badge-large {
  width: 44px;
  height: 44px;
  border-radius: 12px;
}

.badge-small {
  width: 30px;
  height: 30px;
  border-radius: 8px;
}

.badge-soft {
  background: var(--tint-soft);
  color: var(--tint-text);
}

.dot {
  display: inline-block;
  width: 12px;
  height: 12px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--dot-color);
}

.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 76px;
  min-height: 30px;
  flex-shrink: 0;
  padding: 0 10px;
  border: 1px solid transparent;
  border-radius: 15px;
  font-size: 13px;
  font-weight: 600;
}

button.pill {
  min-height: var(--tap);
  border-radius: 22px;
  cursor: pointer;
}

.pill-signal {
  background: var(--signal-soft);
  color: var(--signal-text);
}

.pill-noise {
  background: var(--noise-soft);
  color: var(--noise-text);
}

.pill-neutral {
  border-color: var(--line-strong);
  background: transparent;
  color: var(--text-2);
}

/* Chips and tiles */

.chips {
  display: flex;
  gap: var(--space-2);
  margin: 0 calc(var(--space-4) * -1);
  padding: 2px var(--space-4) var(--space-3);
  overflow-x: auto;
  scrollbar-width: none;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: var(--tap);
  flex-shrink: 0;
  padding: 0 var(--space-4);
  border: 0;
  border-radius: 22px;
  background: var(--card);
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
}

.chip .dot {
  width: 8px;
  height: 8px;
}

.chip[aria-pressed='true'] {
  background: var(--text);
  color: var(--bg);
  font-weight: 600;
}

.tiles {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.tile {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 68px;
  padding: 0 var(--space-3);
  border: 0;
  border-radius: var(--radius-tile);
  background: var(--card);
  color: var(--text);
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}

.tile-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.tile-name {
  font-size: 15px;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.tile-total {
  font-size: 13px;
  color: var(--text-2);
}

.tile.is-running {
  background: var(--tile-color);
  color: #ffffff;
}

.tile.is-running .tile-total {
  color: #ffffff;
}

.tile.is-running .badge {
  background: #ffffff;
  color: var(--tile-color);
}

.tile-new {
  border: 1.5px dashed var(--line-strong);
  background: transparent;
  color: var(--tint-text);
}

/* Forms */

.field {
  display: flex;
  flex-direction: column;
  margin-top: 20px;
}

.field-label {
  display: block;
  margin-bottom: 6px;
  padding: 0 var(--space-4);
  font-size: 13px;
  color: var(--text-2);
}

.input {
  width: 100%;
  min-height: 52px;
  padding: 0 var(--space-4);
  border: 1px solid var(--field-border);
  border-radius: 14px;
  background: var(--card);
  font-size: 17px;
}

.segmented {
  margin-top: var(--space-3);
}

.field + .segmented,
.footnote + .segmented {
  margin-top: 20px;
}

.segments {
  display: grid;
  grid-auto-columns: minmax(0, 1fr);
  grid-auto-flow: column;
  gap: 2px;
  padding: 2px;
  border-radius: 11px;
  background: var(--segment-track);
}

.segment {
  position: relative;
  display: block;
  cursor: pointer;
}

.segment input,
.choice input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.segment span {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: var(--tap);
  border-radius: 9px;
  font-size: 15px;
}

.segment input:checked + span {
  background: var(--card);
  box-shadow: 0 1px 3px rgb(0 0 0 / 12%);
  font-weight: 600;
}

.segment input:focus-visible + span,
.choice input:focus-visible + span,
.visually-hidden:focus-visible + .button {
  outline: 3px solid var(--tint-text);
  outline-offset: 2px;
}

.choice {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.swatches {
  display: flex;
  justify-content: space-between;
  margin-top: 0;
  padding: 6px var(--space-2);
  border-radius: var(--radius-list);
}

.swatches .choice {
  width: var(--tap);
  height: var(--tap);
}

.swatch {
  width: 30px;
  height: 30px;
  border: 1px solid var(--swatch-edge);
  border-radius: 50%;
  background: var(--swatch-color);
}

.choice input:checked + .swatch {
  box-shadow:
    0 0 0 3px var(--card),
    0 0 0 5px var(--swatch-color);
}

.icon-choices {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: var(--space-2);
  margin-top: 0;
  padding: var(--space-3);
  border-radius: var(--radius-list);
}

.icon-choice {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 48px;
  border-radius: 12px;
  background: var(--soft);
  color: var(--text);
}

.choice input:checked + .icon-choice {
  background: var(--tint);
  color: var(--on-tint);
}

.form-error {
  margin-top: var(--space-2);
  padding: 0 var(--space-4);
  font-size: 14px;
  font-weight: 600;
  color: var(--danger-text);
}

.form-error:empty {
  display: none;
}

/* Day summary */

.stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-2);
  margin-top: var(--space-4);
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.stat-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
}

.stat-label .dot {
  width: 8px;
  height: 8px;
}

.stat-value {
  font-size: 17px;
  font-weight: 600;
}

.chart-title {
  margin-top: var(--space-4);
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.chart {
  display: flex;
  align-items: stretch;
  gap: 6px;
  height: 60px;
  margin-top: var(--space-2);
}

.chart-column {
  display: flex;
  flex: 1 1 0;
  flex-direction: column;
  justify-content: flex-end;
  overflow: hidden;
  border-radius: 5px;
  background: var(--soft);
}

.chart-part {
  height: var(--part);
}

.part-signal {
  background: var(--signal);
}

.part-noise {
  background: var(--noise);
}

.part-neutral {
  background: var(--line-strong);
}

.chart-axis {
  display: flex;
  justify-content: space-between;
  margin-top: 6px;
  font-size: 12px;
}

.category-block {
  border-bottom: 1px solid var(--line);
}

.category-block > summary {
  border-bottom: 0;
  list-style: none;
  cursor: pointer;
}

.category-block > summary::-webkit-details-marker {
  display: none;
}

.category-block > summary::after {
  content: '';
  width: 8px;
  height: 8px;
  flex-shrink: 0;
  border-right: 2px solid var(--line-strong);
  border-bottom: 2px solid var(--line-strong);
  transform: rotate(-45deg);
}

.category-block[open] > summary::after {
  transform: rotate(45deg);
}

.category-block > .row:not(summary) {
  min-height: 46px;
  padding-left: 40px;
  border-bottom: 0;
  font-size: 15px;
}

.meter {
  display: block;
  height: 4px;
  border-radius: 2px;
  background: var(--soft);
}

.meter-fill {
  display: block;
  width: var(--fill);
  height: 100%;
  border-radius: 2px;
  background: var(--meter-color);
}

.entry {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding-right: 14px;
}

.entry-main {
  display: flex;
  flex: 1 1 auto;
  align-items: center;
  gap: 10px;
  min-width: 0;
  min-height: 58px;
  padding: 6px 0 6px 14px;
  color: var(--text);
  text-decoration: none;
}

.entry + .entry {
  border-top: 1px solid var(--line);
}

.entry-bar {
  width: 4px;
  height: 30px;
  flex-shrink: 0;
  border-radius: 2px;
  background: var(--bar-color);
}

.entry-time {
  width: 86px;
  flex-shrink: 0;
  font-size: 13px;
  color: var(--text-2);
  font-variant-numeric: tabular-nums;
}

/* Tab bar, toast, banner, dialog */

.tabs {
  position: fixed;
  right: 0;
  bottom: calc(env(safe-area-inset-bottom) + var(--space-3));
  left: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--space-1);
  width: min(380px, calc(100% - 24px));
  margin: 0 auto;
  padding: 6px;
  border-radius: 34px;
  background: var(--card);
  box-shadow: var(--shadow);
}

.tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-height: 52px;
  border-radius: 28px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-2);
  text-decoration: none;
}

.tab[aria-current='page'] {
  background: var(--tint-soft);
  color: var(--tint-text);
}

.toast {
  position: fixed;
  right: var(--space-4);
  bottom: calc(env(safe-area-inset-bottom) + 96px);
  left: var(--space-4);
  max-width: 448px;
  margin: 0 auto;
  padding: var(--space-3) var(--space-4);
  border-radius: 14px;
  background: var(--text);
  color: var(--bg);
  font-size: 15px;
  text-align: center;
  box-shadow: var(--shadow);
}

.banner {
  margin: 0;
  padding: calc(env(safe-area-inset-top) + var(--space-3)) var(--space-4) var(--space-3);
  background: var(--danger);
  color: #ffffff;
  font-size: 15px;
  font-weight: 600;
}

.dialog {
  width: min(340px, calc(100% - 32px));
  padding: 0;
  border: 0;
  border-radius: var(--radius-card);
  background: var(--card);
  color: var(--text);
}

.dialog::backdrop {
  background: rgb(0 0 0 / 45%);
}

.dialog-body {
  display: flex;
  flex-direction: column;
  padding: 20px;
}

.dialog-title {
  font-size: 18px;
  font-weight: 700;
}

.dialog-text {
  margin-top: var(--space-2);
  font-size: 15px;
  color: var(--text-2);
}

.dialog .field-label {
  padding: 0;
}

.dialog .input {
  background: var(--soft);
}

.dialog-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 20px;
}

@media (prefers-reduced-motion: no-preference) {
  .category-block > summary::after {
    transition: transform 0.15s ease;
  }
}

/* Three levels: Now screen shares, the subcategory list and its rows */
.button-row-three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-2);
}
.button-row-three .button {
  padding: 0 var(--space-1);
  font-size: 14px;
}
.compass {
  margin-top: 10px;
}
.row-button {
  width: 100%;
  border-top: 0;
  border-right: 0;
  border-left: 0;
  background: transparent;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.list > li:last-child > .row-button {
  border-bottom: 0;
}
.row-button.is-current .pick-name {
  font-weight: 700;
}
.row-button.is-current .caption {
  font-weight: 600;
  color: var(--tint-text);
}
.pick-head {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-top: var(--space-2);
  padding: 0 var(--space-1);
}
.pick-title {
  margin: 0;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.4px;
  overflow-wrap: anywhere;
}
.pick-name {
  font-size: 17px;
}
.pick-new {
  margin-top: var(--space-3);
}
.stats-two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 0;
  border-top: 0;
}
.category-block > .row:not(summary) .pill {
  min-width: 68px;
  min-height: 26px;
  font-size: 12px;
}
.page-title + .chips {
  margin-top: var(--space-3);
}

/* Now screen: ring chart of the day with its legend */
.ring {
  position: relative;
  width: 176px;
  height: 176px;
  margin: 2px auto 0;
  border-radius: 50%;
  background: var(--ring);
}
.ring::before {
  content: '';
  position: absolute;
  inset: 26px;
  border-radius: 50%;
  background: var(--card);
}
.ring-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
}
.ring-total {
  font-family: var(--font-round);
  font-size: 26px;
  font-weight: 700;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}
.legend {
  display: flex;
  flex-direction: column;
  margin: var(--space-4) 0 0;
  padding: 0;
  list-style: none;
}
.legend-item {
  border-top: 1px solid var(--line);
}
.legend-item:first-child {
  border-top: 0;
}
.legend-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
}
.legend-name {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 16px;
  font-weight: 600;
  overflow-wrap: anywhere;
}
.legend-percent {
  flex-shrink: 0;
  min-width: 44px;
  font-size: 16px;
  font-weight: 700;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.legend-time {
  flex-shrink: 0;
  min-width: 58px;
  font-size: 14px;
  color: var(--text-2);
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.inside {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin: 0 0 var(--space-3) 22px;
  padding: 10px var(--space-3);
  border-radius: 12px;
  background: var(--soft);
}
.inside-bar {
  display: flex;
  gap: 2px;
  height: 8px;
  overflow: hidden;
  border-radius: 4px;
  background: var(--line-strong);
}
.inside-part {
  width: var(--part);
  background: var(--dot-color);
  opacity: var(--part-opacity);
}
.inside-list {
  display: flex;
  flex-direction: column;
  margin: 0;
  padding: 0;
  list-style: none;
}
.inside-row {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  min-height: 30px;
}
.inside-mark {
  width: 10px;
  height: 10px;
  flex-shrink: 0;
  border-radius: 3px;
  background: var(--dot-color);
  opacity: var(--part-opacity);
}
.inside-name {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 14px;
  overflow-wrap: anywhere;
}
.inside-percent {
  flex-shrink: 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-2);
  font-variant-numeric: tabular-nums;
}
.inside .legend-time {
  min-width: 46px;
  font-size: 13px;
}

/* Now screen: the Today / All time switch above the summary cards */
.now-card + .segmented {
  margin-top: var(--space-4);
}

/* Day screen: the entries list opens and closes */
.entries-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  width: 100%;
  min-height: 56px;
  padding: 6px 14px;
  border: 0;
  border-radius: var(--radius-list);
  background: var(--card);
  color: var(--text);
  font: inherit;
  font-size: 16px;
  text-align: left;
  cursor: pointer;
}
.entries-toggle .row-value {
  color: var(--tint-text);
  font-weight: 600;
}
.entries-toggle + .list {
  margin-top: var(--space-2);
}

/* Polish pass: softer depth, calmer titles, empty states */
.card,
.tile:not(.tile-new),
.chip,
.entries-toggle {
  box-shadow: 0 1px 2px rgb(0 0 0 / 5%);
}
.page-title {
  line-height: 1.15;
  text-wrap: balance;
}
.stack[hidden],
.month-section[hidden],
.history-list > li[hidden] {
  display: none;
}
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 28px 24px;
  text-align: center;
}
.empty-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--tint-soft);
  color: var(--tint-text);
}
.empty-title {
  margin: 6px 0 0;
  font-size: 17px;
  font-weight: 600;
}
.now-card .button-primary {
  background: var(--tint);
  color: var(--on-tint);
}
.now-start {
  margin-top: 14px;
}
.settings-form .button {
  width: 100%;
  margin-top: var(--space-3);
}

/* History: summary, search with date jump, days grouped by month */
.summary-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-2);
  padding: 14px 18px;
}
.search-row {
  display: flex;
  gap: 10px;
  margin-top: var(--space-3);
}
.search-box,
.date-jump {
  display: flex;
  align-items: center;
  min-height: var(--tap);
  border: 1px solid var(--field-border);
  border-radius: 12px;
  background: var(--card);
}
.search-box {
  flex: 1 1 auto;
  gap: var(--space-2);
  min-width: 0;
  padding: 0 var(--space-3);
  color: var(--text-2);
  cursor: text;
}
.search-box:focus-within,
.date-jump:focus-within {
  outline: 3px solid var(--tint-text);
  outline-offset: 1px;
}
.search-input {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 42px;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 16px;
  appearance: none;
}
.date-jump {
  position: relative;
  justify-content: center;
  width: var(--tap);
  flex-shrink: 0;
  color: var(--tint-text);
}
.date-jump-input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}
.search-row + .chips {
  margin-top: var(--space-3);
  padding-bottom: 0;
}
.day-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-height: 64px;
  padding: var(--space-2) 14px;
  border-bottom: 1px solid var(--line);
  color: var(--text);
  text-decoration: none;
}
.history-list > li:last-child > .day-row {
  border-bottom: 0;
}
.day-row > svg {
  flex-shrink: 0;
  color: var(--line-strong);
}
.day-date {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 40px;
  flex-shrink: 0;
}
.day-weekday {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  color: var(--text-2);
}
.day-number {
  font-family: var(--font-round);
  font-size: 22px;
  font-weight: 700;
  line-height: 1.1;
}
.day-main {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}
.day-tracked {
  font-size: 15px;
}
.day-meter {
  height: 6px;
  border-radius: 3px;
  background: var(--noise-soft);
}
.day-meter .meter-fill {
  border-radius: 3px;
}
.day-percent {
  flex-shrink: 0;
  min-width: 46px;
  font-size: 17px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.day-percent.is-reached {
  color: var(--signal-text);
}
.page-title-compact {
  font-size: 26px;
  letter-spacing: -0.3px;
}
