:root {
  --time-bg: #090b0d;
  --time-surface: #101316;
  --time-surface-raised: #15191d;
  --time-line: rgba(232, 228, 222, 0.12);
  --time-line-strong: rgba(232, 228, 222, 0.2);
  --time-text: #ece8e1;
  --time-muted: #98958f;
  --time-faint: #827f78;
  --time-accent: #e0a85a;
  --time-accent-bright: #f1c47f;
  --time-green: #80aa92;
  --time-red: #c98277;
  --time-radius: 18px;
  --time-font-mono: ui-monospace, "SFMono-Regular", "Cascadia Code", "Roboto Mono", monospace;
}

body.page-elsewhere {
  min-height: 100%;
  background:
    radial-gradient(circle at 78% -15%, rgba(132, 97, 56, 0.18), transparent 38rem),
    radial-gradient(circle at 8% 58%, rgba(66, 87, 84, 0.1), transparent 32rem),
    var(--time-bg);
  color: var(--time-text);
  font-size: 15px;
}

body.page-elsewhere::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  content: "";
  pointer-events: none;
  opacity: 0.17;
  background-image: radial-gradient(rgba(255, 255, 255, 0.24) 0.55px, transparent 0.55px);
  background-size: 6px 6px;
  mask-image: linear-gradient(to bottom, black, transparent 65%);
}

button,
input,
select {
  font: inherit;
}

button {
  color: inherit;
}

button,
select,
input[type="date"],
input[type="time"] {
  min-height: 44px;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
a:focus-visible {
  outline: 2px solid var(--time-accent-bright);
  outline-offset: 3px;
}

.tool-header,
.time-tool,
.tool-footer {
  width: min(1240px, calc(100% - 64px));
  margin-inline: auto;
}

.tool-header {
  min-height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  border-bottom: 1px solid var(--time-line);
}

.tool-brand {
  display: inline-flex;
  align-items: baseline;
  gap: 0.65rem;
  color: var(--time-muted);
  text-decoration: none;
  letter-spacing: 0.02em;
}

.tool-brand strong {
  color: var(--time-text);
  font-weight: 600;
}

.tool-brand-divider {
  color: var(--time-faint);
}

.tool-status {
  color: var(--time-muted);
  font-family: var(--time-font-mono);
  font-size: 0.75rem;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.03em;
  text-align: right;
}

.time-tool {
  padding: 46px 0 72px;
}

.tool-intro {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(260px, 0.7fr);
  align-items: end;
  gap: 3rem;
  margin-bottom: 34px;
}

.eyebrow {
  margin-bottom: 0.65rem;
  color: var(--time-accent);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  line-height: 1.4;
  text-transform: uppercase;
}

.tool-intro h1 {
  max-width: 820px;
  font-size: clamp(2.5rem, 5.2vw, 4.9rem);
  font-weight: 500;
  letter-spacing: -0.055em;
  line-height: 0.95;
  text-wrap: balance;
}

.tool-intro-copy {
  max-width: 32rem;
  color: var(--time-muted);
  font-size: clamp(0.95rem, 1.3vw, 1.08rem);
  line-height: 1.65;
}

.mode-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin-bottom: 26px;
  border-bottom: 1px solid var(--time-line-strong);
}

.mode-button {
  position: relative;
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0 0 18px;
  border: 0;
  background: none;
  color: var(--time-muted);
  cursor: pointer;
  font-size: clamp(1.05rem, 1.7vw, 1.3rem);
  text-align: left;
}

.mode-button::after {
  position: absolute;
  right: 0;
  bottom: -1px;
  left: 0;
  height: 2px;
  content: "";
  background: var(--time-accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 180ms ease;
}

.mode-button.is-active {
  color: var(--time-text);
}

.mode-button.is-active::after {
  transform: scaleX(1);
}

.mode-index {
  color: var(--time-faint);
  font-family: var(--time-font-mono);
  font-size: 0.7rem;
}

.tool-panel[hidden] {
  display: none;
}

.control-deck {
  display: grid;
  grid-template-columns: minmax(210px, 1.5fr) minmax(155px, 0.8fr) minmax(140px, 0.7fr) auto;
  align-items: end;
  gap: 1px;
  overflow: hidden;
  margin-bottom: 0;
  border: 1px solid var(--time-line);
  border-radius: var(--time-radius);
  background: var(--time-line);
}

.field-group {
  min-width: 0;
}

.control-deck .field-group,
.builder-fields .field-group {
  display: flex;
  min-height: 82px;
  flex-direction: column;
  justify-content: center;
  padding: 13px 18px;
  background: var(--time-surface);
}

.field-group label,
.search-field > label,
.range-label label,
.scrubber-heading label {
  display: block;
  margin-bottom: 0.3rem;
  color: var(--time-faint);
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.11em;
  line-height: 1.3;
  text-transform: uppercase;
}

.field-group select,
.field-group input {
  width: 100%;
  min-height: 32px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--time-text);
  outline: none;
  font-size: 1rem;
  font-variant-numeric: tabular-nums;
}

.field-group select {
  padding-right: 1.5rem;
  cursor: pointer;
}

.field-group input::-webkit-calendar-picker-indicator {
  filter: invert(0.7);
  cursor: pointer;
}

.quiet-button {
  height: 100%;
  min-height: 82px;
  padding: 0 25px;
  border: 0;
  background: var(--time-surface);
  color: var(--time-muted);
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.quiet-button:hover,
.quiet-button.is-live {
  color: var(--time-text);
}

.live-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 0.55rem;
  border-radius: 50%;
  background: var(--time-faint);
}

.quiet-button.is-live .live-dot {
  background: var(--time-green);
  box-shadow: 0 0 0 4px rgba(128, 170, 146, 0.12);
}

.time-scrubber {
  border: 1px solid var(--time-line);
  border-radius: var(--time-radius);
  background: rgba(16, 19, 22, 0.88);
}

.time-scrubber summary,
.custom-hours summary {
  display: flex;
  min-height: 54px;
  align-items: center;
  gap: 1rem;
  padding: 0 24px;
  color: var(--time-muted);
  cursor: pointer;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  list-style: none;
}

.time-scrubber summary::-webkit-details-marker,
.custom-hours summary::-webkit-details-marker { display: none; }

.time-scrubber summary::after,
.custom-hours summary::after {
  width: 7px;
  height: 7px;
  flex: 0 0 auto;
  border-right: 1px solid var(--time-accent-bright);
  border-bottom: 1px solid var(--time-accent-bright);
  content: "";
  transform: rotate(45deg);
}

.time-scrubber[open] summary::after,
.custom-hours[open] summary::after { transform: rotate(225deg); }

.time-scrubber summary:hover,
.custom-hours summary:hover { color: var(--time-text); }

.time-scrubber summary:focus-visible,
.custom-hours summary:focus-visible {
  outline: 2px solid var(--time-accent-bright);
  outline-offset: -3px;
}

.scrubber-body {
  padding: 0 24px 13px;
  border-top: 1px solid var(--time-line);
}

.control-message {
  margin: 0;
  padding: 10px 18px;
  border-right: 1px solid var(--time-line);
  border-left: 1px solid var(--time-line);
  background: rgba(224, 168, 90, 0.08);
  color: var(--time-accent-bright);
  font-size: 0.75rem;
  line-height: 1.45;
}

.control-message:empty {
  display: none;
}

.scrubber-heading,
.range-label {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
}

.time-scrubber .scrubber-heading {
  align-items: center;
  justify-content: flex-start;
}

.scrubber-heading output,
.range-label output {
  color: var(--time-text);
  font-family: var(--time-font-mono);
  font-size: 0.82rem;
  font-variant-numeric: tabular-nums;
}

.scrubber-heading output { margin-left: auto; }

input[type="range"] {
  width: 100%;
  height: 44px;
  margin: 5px 0 0;
  appearance: none;
  background: transparent;
  cursor: pointer;
}

input[type="range"]::-webkit-slider-runnable-track {
  height: 3px;
  border-radius: 999px;
  background: linear-gradient(90deg, #272b31, #5c4932 24%, #b48751 50%, #5c4932 76%, #272b31);
}

input[type="range"]::-webkit-slider-thumb {
  width: 18px;
  height: 18px;
  margin-top: -7.5px;
  appearance: none;
  border: 4px solid var(--time-bg);
  border-radius: 50%;
  background: var(--time-accent-bright);
  box-shadow: 0 0 0 1px var(--time-accent-bright);
}

input[type="range"]::-moz-range-track {
  height: 3px;
  border-radius: 999px;
  background: linear-gradient(90deg, #272b31, #5c4932 24%, #b48751 50%, #5c4932 76%, #272b31);
}

input[type="range"]::-moz-range-thumb {
  width: 12px;
  height: 12px;
  border: 4px solid var(--time-bg);
  border-radius: 50%;
  background: var(--time-accent-bright);
  box-shadow: 0 0 0 1px var(--time-accent-bright);
}

.scrubber-ticks,
.mini-ticks {
  display: flex;
  justify-content: space-between;
  color: var(--time-faint);
  font-family: var(--time-font-mono);
  font-size: 0.61rem;
  font-variant-numeric: tabular-nums;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 2rem;
  margin: 34px 0 14px;
}

.section-heading h2,
.builder-heading h2 {
  font-size: clamp(1.35rem, 2.4vw, 2rem);
  font-weight: 500;
  letter-spacing: -0.035em;
  line-height: 1.1;
}

.section-note {
  color: var(--time-faint);
  font-size: 0.82rem;
  line-height: 1.5;
}

.place-list,
.work-results {
  overflow: hidden;
  border: 1px solid var(--time-line);
  border-radius: var(--time-radius);
  background: rgba(16, 19, 22, 0.82);
}

.place-row {
  display: grid;
  grid-template-columns: minmax(140px, 0.8fr) minmax(165px, 0.65fr) minmax(260px, 1.6fr) minmax(100px, auto);
  gap: 18px;
  align-items: center;
  min-height: 118px;
  padding: 20px 22px;
  border-bottom: 1px solid var(--time-line);
}

.place-row:last-child,
.work-row:last-child {
  border-bottom: 0;
}

.place-identity,
.work-place-heading {
  min-width: 0;
}

.place-identity h3,
.work-place-heading h3 {
  overflow: hidden;
  color: var(--time-text);
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.place-identity p,
.work-place-heading p {
  overflow: hidden;
  margin-top: 0.3rem;
  color: var(--time-faint);
  font-size: 0.78rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.reference-pill,
.day-shift-pill,
.fit-pill {
  display: inline-flex;
  align-items: center;
  min-height: 23px;
  margin-top: 0.65rem;
  padding: 2px 8px;
  border: 1px solid var(--time-line-strong);
  border-radius: 999px;
  color: var(--time-muted);
  font-size: 0.61rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  line-height: 1;
  text-transform: uppercase;
}

.reference-pill {
  border-color: rgba(224, 168, 90, 0.35);
  color: var(--time-accent-bright);
}

.place-time {
  min-width: 0;
}

.place-time time {
  display: block;
  font-family: var(--time-font-mono);
  font-size: clamp(1.65rem, 3vw, 2.35rem);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.055em;
  line-height: 1;
  white-space: nowrap;
}

.place-time p {
  margin-top: 0.55rem;
  color: var(--time-muted);
  font-size: 0.78rem;
}

.timeline-wrap {
  min-width: 0;
}

.day-track,
.work-track {
  position: relative;
  display: grid;
  grid-template-columns: repeat(48, 1fr);
  height: 32px;
  overflow: hidden;
  border: 1px solid var(--time-line);
  border-radius: 8px;
  background: #0c0e11;
}

.day-cell {
  min-width: 0;
  border-right: 1px solid rgba(255, 255, 255, 0.025);
}

.phase-night { background: #202a35; }
.phase-awake { background: #685238; }

.time-marker {
  position: absolute;
  top: -4px;
  bottom: -4px;
  z-index: 3;
  width: 3px;
  background: var(--time-accent-bright);
  box-shadow: 0 0 11px rgba(241, 196, 127, 0.6);
}

.time-marker::before {
  position: absolute;
  top: 0;
  left: 50%;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  content: "";
  background: var(--time-accent-bright);
  transform: translate(-50%, -50%);
}

.track-ticks {
  display: flex;
  justify-content: space-between;
  margin-top: 7px;
  color: var(--time-faint);
  font-family: var(--time-font-mono);
  font-size: 0.67rem;
  font-variant-numeric: tabular-nums;
}

.row-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid var(--time-line-strong);
  border-radius: 9px;
  background: transparent;
  color: var(--time-muted);
  cursor: pointer;
  font-size: 0.76rem;
  line-height: 1;
}

.row-action:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--time-text);
}

.place-actions {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 4px;
}

.place-actions:empty { display: none; }

.row-reference {
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid rgba(224, 168, 90, 0.25);
  border-radius: 9px;
  background: rgba(224, 168, 90, 0.045);
  color: var(--time-accent-bright);
  cursor: pointer;
  font-size: 0.76rem;
  text-align: center;
}

.row-reference:hover { background: rgba(224, 168, 90, 0.12); }

.work-row > .row-action {
  grid-column: 1;
  grid-row: 2;
  justify-self: start;
}

.work-place-heading { grid-column: 1; grid-row: 1; }
.work-details { grid-column: 2; grid-row: 1 / span 2; }

.place-row,
.work-row {
  position: relative;
}

.place-search {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 12px;
  margin: 16px 0;
}

.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.3rem;
  margin: 0 0 14px;
  color: var(--time-muted);
  font-size: 0.75rem;
}

.chart-legend span { display: inline-flex; align-items: center; gap: 0.42rem; }
.chart-legend i { display: inline-block; width: 13px; height: 13px; border-radius: 3px; }
.legend-awake { background: #685238; }
.legend-night { background: #202a35; }
.chart-legend .legend-marker { width: 3px; background: var(--time-accent-bright); }
.legend-work-day { background: var(--time-accent); }
.legend-work-night { background: #a86854; }

.search-field {
  position: relative;
}

.search-input-wrap {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  min-height: 52px;
  padding: 0 16px;
  border: 1px solid var(--time-line);
  border-radius: 12px;
  background: rgba(16, 19, 22, 0.82);
  transition: border-color 150ms ease, background 150ms ease;
}

.search-input-wrap:focus-within {
  border-color: rgba(224, 168, 90, 0.65);
  background: var(--time-surface);
}

.search-input-wrap > span {
  color: var(--time-accent);
  font-size: 1.1rem;
}

.search-input-wrap input {
  width: 100%;
  min-height: 50px;
  border: 0;
  background: transparent;
  color: var(--time-text);
  outline: none;
}

.search-input-wrap input::placeholder {
  color: var(--time-faint);
}

.suggestion-list {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  left: 0;
  z-index: 20;
  max-height: 296px;
  overflow-y: auto;
  padding: 6px;
  border: 1px solid var(--time-line-strong);
  border-radius: 12px;
  background: #171a1e;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
}

.suggestion-option {
  display: grid;
  width: 100%;
  min-height: 48px;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 1rem;
  padding: 8px 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--time-text);
  cursor: pointer;
  text-align: left;
}

.suggestion-option:hover,
.suggestion-option.is-highlighted {
  background: rgba(255, 255, 255, 0.065);
}

.suggestion-option span:last-child {
  color: var(--time-faint);
  font-family: var(--time-font-mono);
  font-size: 0.66rem;
}

.suggestion-empty {
  padding: 12px;
  color: var(--time-muted);
  font-size: 0.78rem;
}

.primary-button {
  min-height: 52px;
  padding: 0 20px;
  border: 1px solid var(--time-accent);
  border-radius: 12px;
  background: var(--time-accent);
  color: #17110a;
  cursor: pointer;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.primary-button:hover {
  border-color: var(--time-accent-bright);
  background: var(--time-accent-bright);
}

.search-message {
  grid-column: 1 / -1;
  min-height: 1.2em;
  margin: 0;
  color: var(--time-muted);
  font-size: 0.77rem;
}

.work-layout {
  display: grid;
  grid-template-columns: minmax(280px, 0.72fr) minmax(0, 1.65fr);
  gap: 42px;
  align-items: start;
}

.schedule-builder {
  position: sticky;
  top: 24px;
  overflow: hidden;
  border: 1px solid var(--time-line);
  border-radius: var(--time-radius);
  background: rgba(16, 19, 22, 0.88);
}

.builder-heading {
  padding: 25px 24px 22px;
  border-bottom: 1px solid var(--time-line);
}

.preset-group {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  padding: 1px 0;
  background: var(--time-line);
}

.preset-button {
  min-height: 48px;
  padding: 0 8px;
  border: 0;
  background: var(--time-surface);
  color: var(--time-muted);
  cursor: pointer;
  font-size: 0.7rem;
  font-weight: 600;
}

.preset-button:hover,
.preset-button.is-active {
  background: var(--time-surface-raised);
  color: var(--time-accent-bright);
}

.builder-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: var(--time-line);
}

.range-control {
  padding: 22px 24px 18px;
  border-top: 1px solid var(--time-line);
}

.source-summary {
  padding: 20px 24px 23px;
  border-top: 1px solid var(--time-line);
  background: rgba(224, 168, 90, 0.055);
}

.source-summary strong {
  display: block;
  margin-bottom: 0.25rem;
  color: var(--time-accent-bright);
  font-family: var(--time-font-mono);
  font-size: 1rem;
  font-variant-numeric: tabular-nums;
  font-weight: 500;
}

.source-summary span {
  color: var(--time-muted);
  font-size: 0.72rem;
}

.custom-hours { border-top: 1px solid var(--time-line); }

.custom-hours summary { min-height: 50px; }

.custom-hours .range-control:first-of-type { border-top: 1px solid var(--time-line); }

.work-comparison {
  min-width: 0;
}

.work-heading {
  margin-top: 0;
}

.heading-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.8rem;
}

.text-button {
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid var(--time-line-strong);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.02);
  color: var(--time-muted);
  cursor: pointer;
  font-size: 0.78rem;
}

.text-button:hover,
.text-button[aria-pressed="true"] {
  border-color: var(--time-accent);
  color: var(--time-text);
}

.work-row {
  display: grid;
  grid-template-columns: minmax(200px, 0.78fr) minmax(0, 1.8fr);
  gap: 24px;
  min-height: 178px;
  padding: 24px 28px;
  border-bottom: 1px solid var(--time-line);
}

.work-time {
  margin-top: 0.9rem;
  font-family: var(--time-font-mono);
  font-size: clamp(1.1rem, 1.75vw, 1.4rem);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.045em;
  line-height: 1.1;
  white-space: nowrap;
}

.work-details {
  min-width: 0;
  align-self: center;
}

.work-track {
  height: 30px;
}

.work-cell {
  position: relative;
  min-width: 0;
  background: rgba(255, 255, 255, 0.02);
  border-right: 1px solid rgba(255, 255, 255, 0.025);
}

.work-cell.is-work {
  background: var(--time-accent);
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.16), inset 0 -1px rgba(0, 0, 0, 0.15);
}

.work-cell.is-night.is-work {
  background: #a86854;
}

.fit-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 16px;
}

.fit-copy strong {
  display: block;
  font-size: 0.84rem;
  font-weight: 600;
}

.fit-copy span {
  display: block;
  margin-top: 0.18rem;
  color: var(--time-muted);
  font-size: 0.78rem;
  line-height: 1.4;
}

.fit-pill {
  flex: 0 0 auto;
  margin-top: 0;
}

.fit-pill[data-fit="easy"] {
  border-color: rgba(128, 170, 146, 0.42);
  color: #9fc7b0;
}

.fit-pill[data-fit="mixed"] {
  border-color: rgba(224, 168, 90, 0.4);
  color: var(--time-accent-bright);
}

.fit-pill[data-fit="overnight"] {
  border-color: rgba(201, 130, 119, 0.42);
  color: #dd9d92;
}

.empty-state {
  padding: 48px 24px;
  color: var(--time-muted);
  text-align: center;
}

.empty-state strong {
  display: block;
  margin-bottom: 0.4rem;
  color: var(--time-text);
  font-weight: 500;
}

.tool-footer {
  display: flex;
  justify-content: space-between;
  gap: 2rem;
  padding: 26px 0 calc(38px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--time-line);
  color: var(--time-faint);
  font-size: 0.7rem;
}

.tool-footer a {
  color: var(--time-muted);
  text-decoration: none;
}

.tool-footer a:hover {
  color: var(--time-text);
}

.field-group select:focus-visible,
.field-group input:focus-visible,
.search-input-wrap input:focus-visible {
  outline: 2px solid var(--time-accent-bright);
  outline-offset: 5px;
}

@media (max-width: 960px) {
  .tool-intro {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .tool-intro-copy {
    max-width: 38rem;
  }

  .place-row {
    grid-template-columns: minmax(115px, 0.8fr) minmax(140px, 0.8fr) minmax(190px, 1.5fr) minmax(86px, auto);
    gap: 12px;
    padding-inline: 18px;
  }

  .work-layout {
    grid-template-columns: 1fr;
  }

  .schedule-builder {
    position: static;
  }

  .builder-fields {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 720px) {
  .tool-header,
  .time-tool,
  .tool-footer {
    width: min(100% - 32px, 1240px);
  }

  .tool-header {
    min-height: 58px;
  }

  .tool-status {
    display: none;
  }

  .time-tool {
    padding: 20px 0 56px;
  }

  .tool-intro {
    gap: 0.8rem;
    margin-bottom: 18px;
  }

  .tool-intro .eyebrow { display: none; }

  .tool-intro h1 {
    font-size: clamp(2.25rem, 10vw, 3.3rem);
  }

  .tool-intro-copy { display: none; }

  .mode-switch {
    gap: 0.8rem;
    margin-bottom: 14px;
  }

  .mode-button {
    gap: 0.55rem;
    padding-bottom: 11px;
    font-size: 0.86rem;
  }

  .control-deck {
    grid-template-columns: 1fr 1fr;
  }

  .control-deck .field-place {
    grid-column: 1 / -1;
  }

  .control-deck .quiet-button {
    min-height: 48px;
    grid-column: 1 / -1;
  }

  .control-deck .field-group,
  .builder-fields .field-group { min-height: 64px; }

  .time-scrubber {
    margin-top: 0;
  }

  .time-scrubber summary,
  .custom-hours summary { padding-inline: 18px; }

  .scrubber-body { padding-inline: 18px; }

  .section-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.45rem;
    margin-top: 21px;
  }

  #time-panel .section-heading .section-note { display: none; }

  .chart-legend { margin-bottom: 8px; }

  .place-search { margin: 12px 0; }

  .place-row {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 13px 12px;
    min-height: 0;
    padding: 18px 16px;
  }

  .place-time {
    text-align: right;
  }

  .place-time time {
    font-size: 1.55rem;
  }

  .timeline-wrap {
    grid-column: 1 / -1;
  }

  .place-actions {
    grid-column: 1 / -1;
    flex-direction: row;
    justify-content: flex-end;
    gap: 8px;
  }

  .row-reference { padding-inline: 12px; }

  .place-search {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .primary-button {
    min-width: 105px;
  }

  .work-layout {
    gap: 22px;
  }

  .builder-heading { padding: 18px 18px 16px; }

  .source-summary { padding: 15px 18px 17px; }

  .work-row {
    grid-template-columns: 1fr;
    gap: 18px;
    min-height: 0;
    padding: 18px 16px;
  }

  .work-time {
    margin-top: 0.5rem;
    white-space: normal;
  }

  .work-row > .row-action {
    grid-column: 1 / -1;
    grid-row: 3;
    justify-self: end;
  }

  .work-place-heading { grid-row: 1; }
  .work-details { grid-column: 1; grid-row: 2; }

  .heading-actions {
    justify-content: flex-start;
  }

  .tool-footer {
    flex-direction: column;
    gap: 0.55rem;
  }
}

@media (max-width: 430px) {
  .tool-header,
  .time-tool,
  .tool-footer {
    width: calc(100% - 24px);
  }

  .tool-brand {
    font-size: 0.86rem;
  }

  .tool-intro-copy {
    font-size: 0.9rem;
  }

  .control-deck .field-group,
  .quiet-button {
    padding-inline: 13px;
  }

  .field-group select,
  .field-group input {
    font-size: 0.88rem;
  }

  .scrubber-ticks span:nth-child(2),
  .scrubber-ticks span:nth-child(4) {
    display: none;
  }

  .builder-fields {
    grid-template-columns: 1fr 1fr;
  }

  .preset-button {
    font-size: 0.78rem;
  }

  .fit-summary {
    align-items: flex-start;
    flex-direction: column;
  }

  .place-search { grid-template-columns: minmax(0, 1fr) 100px; }
  .primary-button { width: 100%; min-width: 0; padding-inline: 7px; }
  .suggestion-option { grid-template-columns: 1fr; gap: 0.15rem; }
  .suggestion-option span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
