:root {
  --app-scale: 0.75;
  --bg: #050505;
  --bg-soft: #0b0b0b;
  --panel: #0f0f0f;
  --line: #222;
  --line-strong: #2d2d2d;
  --text: #f1f1f1;
  --muted: #9a9a9a;
  --accent: #f5f5f5;
  --red-line: #a23228;
  --red-soft: #22100f;
  --shadow: 0 18px 42px rgba(0, 0, 0, 0.42);
  --radius: 14px;
}

* {
  box-sizing: border-box;
}

html {
  scrollbar-gutter: stable both-edges;
  zoom: var(--app-scale);
}

body {
  margin: 0;
  min-height: 100vh;
  font: 15px/1.45 "IBM Plex Mono", "JetBrains Mono", "Consolas", monospace;
  color: var(--text);
  background: var(--bg);
}

@supports not (zoom: 1) {
  html {
    zoom: 1;
  }

  body {
    width: calc(100% / var(--app-scale));
    min-height: calc(100vh / var(--app-scale));
    transform: scale(var(--app-scale));
    transform-origin: top left;
  }
}

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

button,
.file-input {
  border: 1px solid #343434;
  border-radius: 8px;
  background: #141414;
  color: var(--accent);
  padding: 0.62rem 0.8rem;
  cursor: pointer;
  transition: transform 140ms ease, border-color 140ms ease, background 140ms ease;
}

button:hover,
.file-input:hover {
  transform: translateY(-1px);
  border-color: #4a4a4a;
}

button.ghost,
.file-input.ghost {
  background: #0d0d0d;
  border-color: #2f2f2f;
}

button:disabled,
input:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

.mini {
  padding: 0.38rem 0.6rem;
  font-size: 0.82rem;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid #2f2f2f;
  border-radius: 8px;
  background: #0a0a0a;
  color: var(--text);
  padding: 0.72rem 0.8rem;
}

input[type="number"] {
  -moz-appearance: textfield;
  appearance: textfield;
}

input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: #4f4f4f;
}

.shell {
  width: min(966px, 100%);
  margin: 0 auto;
  padding: 1rem 1rem 2rem;
}

.shell-topbar {
  position: sticky;
  top: 1rem;
  z-index: 20;
  margin: 0 0 0.9rem;
}

.shell-topbar::before {
  content: "";
  position: absolute;
  left: -1rem;
  right: -1rem;
  top: -1rem;
  height: calc(100% + 2.2rem);
  background:
    linear-gradient(180deg, rgba(5, 5, 5, 0.96) 0%, rgba(5, 5, 5, 0.92) 72%, rgba(5, 5, 5, 0.72) 88%, rgba(5, 5, 5, 0) 100%);
  pointer-events: none;
  z-index: -1;
}

.hero,
.panel {
  background: linear-gradient(180deg, #111 0%, #0d0d0d 100%);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.hero {
  position: relative;
  display: block;
  padding: 0.9rem 1rem;
  margin-bottom: 0.85rem;
}

.hero-copy {
  display: grid;
  gap: 0.35rem;
  width: 100%;
  padding-right: 8.5rem;
}

.hero-actions {
  position: absolute;
  top: 0.9rem;
  right: 1rem;
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
}

.eyebrow {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  margin: 0;
  font: inherit;
  font-size: 1rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

h1 {
  font-size: 1.08rem;
}

.hero .eyebrow {
  color: var(--text);
}

.hero h1 {
  color: var(--muted);
  font-size: 1rem;
}

h3 {
  font-size: 0.92rem;
}

.intro,
.hint {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.queue-help {
  position: relative;
}

.queue-help summary {
  list-style: none;
  border: 1px solid #343434;
  border-radius: 8px;
  background: #0d0d0d;
  color: var(--accent);
  padding: 0.38rem 0.6rem;
  font-size: 0.82rem;
  cursor: pointer;
}

.queue-help summary::-webkit-details-marker {
  display: none;
}

.queue-help[open] .hint {
  position: absolute;
  right: 0;
  top: calc(100% + 0.5rem);
  width: min(30rem, 70vw);
  padding: 0.7rem 0.8rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #101010;
  box-shadow: 0 28px 64px rgba(0, 0, 0, 0.72);
  z-index: 2;
}

.stat,
.summary-grid article {
  display: grid;
  gap: 0.15rem;
  padding: 0.72rem;
  border-radius: 10px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
}

.stat span,
.summary-grid span {
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
}

.stacked-field {
  display: grid;
  gap: 0.35rem;
}

.actions {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.file-input {
  display: inline-flex;
  align-items: center;
}

.file-input input {
  display: none;
}

.tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0;
}

.tab-button {
  min-width: 0;
  width: 100%;
}

.tab-button.active {
  background: linear-gradient(180deg, #131821 0%, #0d1016 100%);
  border-color: #446286;
  color: #cfe2ff;
}

#settings-toggle.active {
  background: linear-gradient(180deg, #131821 0%, #0d1016 100%);
  border-color: #446286;
  color: #cfe2ff;
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

.grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1rem;
  align-items: start;
}

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

.full-width {
  grid-column: 1 / -1;
}

.panel {
  padding: 1rem;
}

.panel-header,
.info-list-head {
  display: flex;
  justify-content: space-between;
  gap: 0.8rem;
  align-items: start;
  margin-bottom: 0.9rem;
}

.panel-header > div:first-child {
  display: grid;
  gap: 0.12rem;
}

.panel-header-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem;
}

.queue-header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 1rem;
  flex: 1 1 auto;
  min-width: 0;
}

.queue-search-wrap {
  display: flex;
  align-items: center;
  flex: 1 1 24rem;
  min-width: 12rem;
  max-width: 34rem;
}

.queue-search-wrap > input {
  width: 100%;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.queue-search-wrap > input::placeholder {
  text-overflow: ellipsis;
}

.completed-search-wrap {
  flex: 0 1 22rem;
  min-width: 12rem;
  max-width: 22rem;
  gap: 0.75rem;
}

.completed-search-wrap > input {
  flex: 1 1 auto;
}

#completed-today-button {
  flex: 0 0 4.75rem;
}

#completed-today-button.is-hidden {
  visibility: hidden;
  pointer-events: none;
}

.notes-header-actions {
  display: inline-flex;
  align-items: center;
  width: min(24rem, 100%);
}

.notes-header-actions > input {
  width: 100%;
}

.subhead-row {
  margin-top: 1rem;
}

.pill,
.task-meta span,
.timesheet-row,
.empty {
  border-radius: 8px;
  background: #101010;
  border: 1px solid var(--line);
}

.pill {
  padding: 0.35rem 0.55rem;
  color: var(--muted);
  white-space: nowrap;
}

.hero-pill {
  padding-inline: 0.5rem;
}

.timer-header-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
}

.hero #work-toggle {
  background: linear-gradient(180deg, #6d1c17 0%, #4d1512 100%);
  border-color: var(--red-line);
  color: #fff2f1;
}

.hero #work-toggle.active {
  background: var(--red-soft);
  border-color: #5c201c;
  color: #f4cdca;
}

.icon-button {
  width: 2.8rem;
  height: 2.8rem;
  padding: 0;
  display: inline-grid;
  place-items: center;
  font-size: 1rem;
  line-height: 1;
}

.hero > #work-toggle:not(.active) {
  opacity: 0.72;
}

.timer-face {
  display: grid;
  place-items: center;
  min-height: 180px;
  margin-bottom: 0.9rem;
  border-radius: 10px;
  border: 1px solid var(--line);
  background:
    radial-gradient(circle at 50% 30%, rgba(255, 255, 255, 0.04), transparent 40%),
    linear-gradient(180deg, #101010, #0a0a0a);
}

.timer-display-row {
  display: inline-flex;
  align-items: baseline;
  gap: 0.65rem;
  width: min(18rem, 100%);
  justify-content: center;
}

#timer-display {
  font-size: clamp(2.6rem, 9vw, 4rem);
  letter-spacing: 0.04em;
  width: min(12rem, 100%);
  border: 0;
  background: transparent;
  text-align: center;
  padding: 0;
}

#timer-display:focus {
  border: 0;
  outline: none;
}

#timer-subtext {
  color: var(--muted);
  text-align: left;
  width: min(52rem, 100%);
  margin: 0 auto;
  padding: 0.25rem 0.3rem;
}

#timer-subtext.is-empty {
  text-align: center;
}

.timer-focus-card {
  padding-left: calc(var(--depth, 0) * 1.25rem);
}

.timer-focus-card .task-minimal {
  grid-template-columns: auto auto minmax(0, 1fr) auto auto;
  gap: 0.6rem;
  padding: 0.1rem 0.15rem;
}

.timer-focus-card .task-title-label {
  line-height: 1.4;
  white-space: pre-wrap;
  word-break: break-word;
}

.timer-focus-card .task-side {
  white-space: nowrap;
  font-size: 0.76rem;
  opacity: 0.82;
}

.timer-focus-card .task-billing {
  align-self: start;
}

.timer-task-context {
  opacity: 0.78;
}

.summary-grid,
.form-row,
.filters,
.detail-actions,
.estimate-picker {
  display: flex;
  gap: 0.75rem;
}

.timer-controls {
  display: grid;
  grid-template-columns: 1fr;
}

.timer-controls > *,
.summary-grid > *,
.form-row > *,
.filters > *,
.detail-actions > * {
  flex: 1;
}

.timer-controls button {
  background: linear-gradient(180deg, #6d1c17 0%, #4d1512 100%);
  border-color: var(--red-line);
  color: #fff2f1;
}

.timer-controls button.ghost {
  background: var(--red-soft);
  border-color: #5c201c;
  color: #f4cdca;
}

.timer-controls button.active {
  background: linear-gradient(180deg, #893029 0%, #63211c 100%);
  border-color: #bb4a40;
  color: #fff4f3;
}

.timer-panel .summary-grid {
  margin-top: 0.75rem;
}

.completed-summary-grid {
  margin-bottom: 0.8rem;
}

body.focus-active .tabs,
body.focus-active .queue-panel,
body.focus-active .detail-panel,
body.focus-active #tab-lists,
body.focus-active #tab-stats {
  opacity: 0.38;
}

body.focus-active .timer-panel {
  position: relative;
  z-index: 1;
  box-shadow: 0 24px 52px rgba(0, 0, 0, 0.55);
}

body.work-idle #tab-tasks .timer-panel,
body.work-idle #tab-tasks .queue-panel,
body.work-idle #tab-tasks .detail-panel,
body.work-idle #tab-tasks .completed-panel,
body.work-idle #tab-stats .panel,
body.work-idle #tab-lists .panel {
  opacity: 0.56;
}

.task-form {
  display: grid;
  gap: 0.75rem;
}

.toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--muted);
  cursor: pointer;
  user-select: none;
}

.toggle input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.toggle-box {
  width: 1.15rem;
  height: 1.15rem;
  flex: 0 0 auto;
  display: inline-grid;
  place-items: center;
  border-radius: 0.35rem;
  border: 1px solid #353535;
  background: linear-gradient(180deg, #141414 0%, #101010 100%);
  transition: border-color 140ms ease, background 140ms ease, box-shadow 140ms ease, color 140ms ease;
  color: transparent;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.02);
}

.toggle-box::after {
  content: "";
  width: 0.38rem;
  height: 0.62rem;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(40deg) translate(-0.02rem, -0.03rem);
}

.toggle-label {
  min-width: 0;
}

.toggle:hover .toggle-box {
  border-color: #4a4a4a;
  background: linear-gradient(180deg, #171717 0%, #121212 100%);
}

.toggle input:checked + .toggle-box {
  border-color: #9f3d34;
  background: linear-gradient(180deg, #62211b 0%, #471815 100%);
  color: #ffd7d2;
}

.toggle input:focus-visible + .toggle-box {
  outline: none;
  box-shadow: 0 0 0 2px rgba(224, 85, 73, 0.25);
}

.toggle input:disabled + .toggle-box,
.toggle input:disabled + .toggle-box + .toggle-label {
  opacity: 0.5;
}

.estimate-picker {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.form-row .estimate-picker {
  flex: 0 0 auto;
}

.estimate-picker input {
  width: 72px;
  text-align: center;
}

.estimate-label {
  color: var(--muted);
  font-size: 0.84rem;
}

.detail-fields-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 0.55rem;
}

.detail-daily-toggle {
  justify-content: flex-end;
  white-space: nowrap;
  margin-left: 0.15rem;
}

.detail-daily-toggle.is-hidden {
  display: none !important;
}

.lists-container,
.stats-groups {
  display: grid;
  gap: 0.75rem;
}

.stats-week-panel {
  display: grid;
  gap: 0.75rem;
  align-content: start;
}

.stats-week-panel .panel-header {
  margin-bottom: 0;
}

.task-card,
.stats-card,
.note-block {
  border-radius: 9px;
  background: #0a0a0a;
  border: 1px solid #2c2c2c;
}

.task-card {
  padding: 0.15rem 0;
  border: 0;
  background: transparent;
  border-radius: 0;
  padding-left: calc(var(--depth, 0) * 1.25rem);
}

.queue-editor {
  display: grid;
  gap: 0.7rem;
  padding: 0.55rem 0.6rem;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #0a0a0a;
}

.queue-total-line {
  margin-top: 0.55rem;
  padding: 0 0.15rem;
  color: var(--muted);
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-align: right;
}

.queue-section {
  display: grid;
  gap: 0.3rem;
}

.queue-section-header {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 0.6rem;
  min-height: 1.15rem;
}

.queue-section-label {
  color: #f3f0ea;
  font-size: 0.78rem;
  line-height: 1.3;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.queue-section-header::after {
  content: "";
  height: 1px;
  background: linear-gradient(90deg, rgba(112, 112, 112, 0.42) 0%, rgba(52, 52, 52, 0.2) 100%);
  transform: translateY(1px);
}

.queue-section-body {
  display: grid;
  gap: 0.15rem;
  min-height: 0;
}

.queue-section-body.is-empty-section {
  min-height: 0.3rem;
}

.queue-section-body.drop-section {
  position: relative;
  min-height: 0.9rem;
}

.queue-section-body.drop-section::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 2px;
  transform: translateY(-50%);
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(126, 178, 240, 0.92) 0%, rgba(126, 178, 240, 0.5) 100%);
  box-shadow: 0 0 0 1px rgba(126, 178, 240, 0.16);
  pointer-events: none;
}

.queue-section-body.drop-section::after {
  content: attr(data-drop-label);
  position: absolute;
  top: -0.5rem;
  right: 0;
  padding: 0.08rem 0.42rem;
  border-radius: 999px;
  background: #0c0c0c;
  border: 1px solid rgba(126, 178, 240, 0.6);
  color: #a9cdf8;
  font-size: 0.68rem;
  line-height: 1.2;
  pointer-events: none;
  z-index: 2;
}

.editor-task {
  display: grid;
  gap: 0.15rem;
}

.task-card.selected {
  background: rgba(156, 184, 228, 0.08);
  box-shadow: inset 0 0 0 1px rgba(166, 194, 236, 0.56);
}

.task-card.multi-selected {
  position: relative;
  background: rgba(140, 168, 210, 0.032);
  border-radius: 10px;
  box-shadow: none;
}

.task-card.selected.multi-selected:not(.selection-anchor) {
  background: rgba(146, 174, 216, 0.05);
}

.task-card.multi-selected::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 10px;
  background: rgba(140, 168, 210, 0.032);
  box-shadow: inset 0 0 0 1px rgba(164, 188, 226, 0.34);
  pointer-events: none;
}

.task-card.selected.multi-selected:not(.selection-anchor)::before {
  background: rgba(146, 174, 216, 0.05);
  box-shadow: inset 0 0 0 1px rgba(166, 190, 228, 0.4);
}

.task-card.selection-anchor {
  background: rgba(156, 184, 228, 0.08);
}

.task-card.selection-anchor::before {
  background: rgba(156, 184, 228, 0.08);
  box-shadow: inset 0 0 0 1px rgba(166, 194, 236, 0.56);
}

.task-card.multi-selected.multi-join-top {
  border-top-left-radius: 4px;
  border-top-right-radius: 4px;
}

.task-card.multi-selected.multi-join-bottom {
  border-bottom-left-radius: 4px;
  border-bottom-right-radius: 4px;
}

.task-card.multi-selected.multi-join-middle {
  border-radius: 4px;
}

.task-card.multi-selected.multi-join-top::before {
  top: -0.15rem;
  border-top-left-radius: 0;
  border-top-right-radius: 0;
}

.task-card.multi-selected.multi-join-bottom::before {
  bottom: -0.15rem;
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
}

.task-card.multi-selected.multi-join-middle::before {
  top: -0.15rem;
  bottom: -0.15rem;
  border-radius: 0;
}

.task-card.completed {
  opacity: 0.7;
}

.task-card.queue-highlighted {
  background: var(--queue-highlight-bg);
}

.task-card.dragging {
  opacity: 0.55;
}

.task-card.drop-before {
  box-shadow: inset 0 2px 0 #7eb2f0;
  background: linear-gradient(180deg, rgba(126, 178, 240, 0.16) 0, rgba(126, 178, 240, 0.04) 0.65rem, transparent 0.65rem);
}

.task-card.drop-after {
  box-shadow: inset 0 -2px 0 #7eb2f0;
  background: linear-gradient(0deg, rgba(126, 178, 240, 0.16) 0, rgba(126, 178, 240, 0.04) 0.65rem, transparent 0.65rem);
}

.task-card.drop-child {
  box-shadow: inset 0 0 0 2px rgba(126, 178, 240, 0.78);
  background: rgba(126, 178, 240, 0.08);
}

.task-card.drop-before,
.task-card.drop-after,
.task-card.drop-child {
  position: relative;
}

.task-card.drop-before::after,
.task-card.drop-after::after,
.task-card.drop-child::after {
  content: attr(data-drop-label);
  position: absolute;
  top: -0.72rem;
  right: 0.55rem;
  padding: 0.08rem 0.42rem;
  border-radius: 999px;
  background: #0c0c0c;
  border: 1px solid rgba(126, 178, 240, 0.6);
  color: #a9cdf8;
  font-size: 0.68rem;
  line-height: 1.2;
  pointer-events: none;
  z-index: 2;
}

.task-minimal {
  display: flex;
  flex-wrap: wrap;
  align-items: start;
  gap: 0.55rem;
  padding: 0.1rem 0.2rem;
  border-radius: 6px;
}

.task-minimal > * {
  min-width: 0;
}

.task-active-check,
.task-complete {
  width: 18px;
  height: 18px;
  margin: 0;
}

.task-active-check {
  flex: 0 0 auto;
  display: inline-grid;
  place-items: center;
  padding: 0;
  border-radius: 999px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.82rem;
  line-height: 1;
  transform: translateY(1px);
  margin-right: -0.22rem;
  transition: border-color 140ms ease, background 140ms ease, color 140ms ease, box-shadow 140ms ease;
}

.task-active-check:hover {
  transform: translateY(1px);
  border-color: rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.03);
  color: #d9d9d9;
}

.task-active-check.is-active {
  border-color: #e05549;
  color: #ff8f85;
}

.task-complete {
  display: inline-grid;
  place-items: center;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  opacity: 0.8;
  font: inherit;
  font-size: 0.8rem;
  line-height: 1;
  flex: 0 0 auto;
  margin-left: auto;
  transition: border-color 140ms ease, background 140ms ease, color 140ms ease, opacity 140ms ease, box-shadow 140ms ease;
}

.task-complete:hover {
  transform: none;
  border-color: rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.03);
  opacity: 1;
}

.task-complete.is-complete {
  color: #d9d9d9;
  opacity: 0.95;
}

.task-title-wrap {
  min-width: 0;
  display: block;
  flex: 1 1 16rem;
}

.task-title-label {
  display: block;
  line-height: 1.55;
  white-space: pre-wrap;
  overflow-wrap: break-word;
  word-break: normal;
  width: 100%;
  max-width: 100%;
}

.task-title-label.empty {
  display: none;
}

.task-card.active-task .queue-title-input,
.task-card.active-task .task-title-label {
  font-weight: 700;
}

.queue-panel .task-card.active-task .queue-title-input,
.queue-panel .task-card.active-task .task-title-label,
.queue-panel .task-card.active-task .task-billing,
.queue-panel .task-card.active-task .task-side {
  color: #ff8f85;
}

.task-billing {
  min-width: 0;
  align-self: start;
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.55;
  transform: translateY(1px);
  opacity: 0.82;
  white-space: nowrap;
  flex: 0 0 auto;
}

.task-billing.empty {
  display: none;
}

.queue-title-input {
  display: block;
  width: 100%;
  border: 0;
  background: transparent;
  padding: 0;
  border-radius: 0;
  font: inherit;
  line-height: 1.55;
  min-height: 1.55em;
  overflow: hidden;
  resize: none;
  white-space: pre-wrap;
  overflow-wrap: break-word;
  word-break: normal;
}

.queue-title-input:focus {
  border: 0;
  outline: none;
}

.queue-highlighted .queue-title-input,
.queue-highlighted .task-title-label,
.queue-highlighted .task-complete,
.queue-highlighted .task-active-check,
.queue-highlighted .timer-task-title {
  color: var(--queue-highlight-fg);
}

.queue-highlighted .task-complete:hover {
  border-color: color-mix(in srgb, var(--queue-highlight-accent) 72%, transparent);
  background: color-mix(in srgb, var(--queue-highlight-accent) 12%, transparent);
}

.queue-highlighted .task-active-check {
  border-color: transparent;
}

.queue-highlighted .task-active-check:hover {
  border-color: color-mix(in srgb, var(--queue-highlight-accent) 72%, transparent);
  background: color-mix(in srgb, var(--queue-highlight-accent) 12%, transparent);
}

.queue-highlighted .task-active-check.is-active {
  border-color: var(--queue-highlight-accent);
}

.task-side {
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.55;
  text-align: right;
  white-space: nowrap;
  opacity: 0.8;
  flex: 0 0 auto;
  margin-left: auto;
}

.task-side:empty {
  display: none;
}

.task-card.over-budget .task-side {
  color: #ff6c63;
  font-weight: 700;
  opacity: 1;
}

.queue-delete {
  padding: 0.1rem 0.35rem;
  min-width: 1.4rem;
  color: var(--muted);
  flex: 0 0 auto;
  margin-left: auto;
}

.timesheet-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: baseline;
  gap: 0.8rem;
  padding: 0.28rem 0.45rem;
  color: var(--muted);
  font-size: 0.76rem;
}

.timesheet-row span {
  min-width: 0;
}

.timesheet-row strong {
  flex: 0 0 auto;
}

.timesheet-bar-wrap {
  position: relative;
}

.timesheet-bar {
  display: flex;
  position: relative;
  width: 100%;
  height: 0.72rem;
  overflow: visible;
  border-radius: 999px;
  background-color: #111;
  border: 1px solid var(--line);
}

.timesheet-bar-segment {
  display: block;
  position: relative;
  flex: 0 0 auto;
  min-width: 2px;
  height: 100%;
}

.timesheet-hover-label {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 0.35rem);
  transform: translate(-50%, 0.2rem);
  opacity: 0;
  pointer-events: none;
  z-index: 1;
  padding: 0.2rem 0.45rem;
  border-radius: 999px;
  background: rgba(10, 10, 10, 0.95);
  border: 1px solid var(--line);
  color: var(--text);
  font-size: 0.72rem;
  line-height: 1.2;
  white-space: nowrap;
  transition: opacity 120ms ease, transform 120ms ease;
}

.timesheet-bar-segment:hover .timesheet-hover-label {
  opacity: 1;
  transform: translate(-50%, 0);
}

.timesheet-label {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-width: 0;
}

.timesheet-dot {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 999px;
  flex: 0 0 auto;
}

.timesheet-day-section {
  display: grid;
  gap: 0.4rem;
}

.timesheet-day-section.is-separated {
  border-top: 1px solid var(--line);
  padding-top: 0.8rem;
  margin-top: 0.15rem;
}

.timesheet-day-line {
  display: grid;
  grid-template-columns: var(--stats-label-width, auto) minmax(0, 1fr) var(--stats-total-width, auto);
  gap: 0.8rem;
  align-items: center;
}

#tab-stats {
  --stats-label-width: 10rem;
  --stats-total-width: 4.9rem;
}

.timesheet-day-meta {
  display: grid;
  grid-template-columns: auto auto;
  gap: 0.65rem;
  align-items: center;
  color: var(--muted);
  white-space: nowrap;
}

.timesheet-day-meta h3 {
  margin: 0;
  color: var(--text);
  font-size: 0.92rem;
  min-width: 2.8rem;
}

.timesheet-day-meta span {
  font-size: 0.78rem;
}

.timesheet-breakdown-toggle {
  text-transform: none;
}

.timesheet-breakdown-toggle.is-open {
  color: #d8e6ff;
  border-color: #53729b;
  background: #141d29;
}

.timesheet-day-total {
  color: var(--muted);
  white-space: nowrap;
}

.timesheet-day-line .timesheet-bar-wrap {
  margin: 0;
  padding-top: 0;
  display: inline-flex;
  align-items: center;
  align-self: center;
}

.timesheet-day-breakdown {
  display: grid;
  gap: 0.1rem;
}

.timesheet-day-breakdown.is-collapsed {
  display: none;
}

.week-group-section {
  display: grid;
  gap: 0.4rem;
}

.week-group-section.is-separated {
  border-top: 1px solid var(--line);
  padding-top: 0.8rem;
  margin-top: 0.15rem;
}

.week-group-heading {
  margin: 0;
  color: var(--text);
  font-size: 0.92rem;
}

.week-group-heading-note {
  color: var(--muted);
  font-size: 0.82em;
  font-weight: 400;
  text-transform: none;
}

.week-day-line {
  display: grid;
  grid-template-columns: var(--stats-label-width, auto) minmax(0, 1fr) var(--stats-total-width, auto);
  gap: 0.8rem;
  align-items: center;
  width: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  text-align: left;
}

.week-day-line:hover {
  transform: none;
  border-color: transparent;
}

.week-day-meta {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 0.65rem;
  align-items: center;
  color: var(--muted);
  white-space: nowrap;
}

.week-day-kind {
  font-size: 0.78rem;
  text-transform: none;
}

.week-day-submeta {
  min-width: 0;
  justify-self: end;
  color: var(--muted);
  font-size: inherit;
  text-align: right;
}

.week-day-bar-toggle {
  margin: 0;
  padding: 0.2rem 0;
  border: 0;
  background: transparent;
  width: 100%;
  text-align: left;
}

.week-day-bar-toggle:hover {
  transform: none;
  border-color: transparent;
}

.week-day-row-toggle.is-open .timesheet-bar {
  border-color: #53729b;
}

.week-day-total {
  color: var(--muted);
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.35rem;
  text-align: right;
}

.split-summary-total {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.35rem;
}

.expand-hint {
  display: inline-block;
  color: #6f6f6f;
  font-size: 1em;
  line-height: 1;
  transition: transform 140ms ease, color 140ms ease;
}

.week-day-row-toggle:hover .expand-hint,
.split-summary-row-toggle:hover .expand-hint {
  color: #9a9a9a;
}

.week-day-row-toggle.is-open .expand-hint,
.split-summary-row-toggle.is-open .expand-hint {
  transform: rotate(90deg);
  color: #b7c9e8;
}

.split-summary-meta {
  display: grid;
  grid-template-columns: auto auto;
  gap: 0.65rem;
  align-items: center;
  color: var(--muted);
  white-space: nowrap;
}

.split-summary-title {
  color: var(--text);
  font-size: 0.92rem;
  min-width: 4.2rem;
}

.split-summary-meta span {
  font-size: 0.78rem;
  text-transform: none;
}

.split-summary-line {
  display: grid;
  grid-template-columns: var(--stats-label-width, auto) minmax(0, 1fr) var(--stats-total-width, auto);
  gap: 0.8rem;
  align-items: center;
  width: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  text-align: left;
}

.split-summary-line:hover {
  transform: none;
  border-color: transparent;
}

.split-summary-line.is-empty {
  cursor: default;
}

.split-summary-line .timesheet-bar-wrap {
  margin: 0;
  padding: 0.2rem 0;
  display: inline-flex;
  align-items: center;
  align-self: center;
}

.split-summary-bar-toggle {
  border: 0;
  background: transparent;
  width: 100%;
  text-align: left;
}

.split-summary-bar-toggle:hover {
  transform: none;
  border-color: transparent;
}

.split-summary-row-toggle.is-open .timesheet-bar {
  border-color: #53729b;
}

.split-summary-total {
  color: var(--muted);
  white-space: nowrap;
}

.split-summary-breakdown {
  display: grid;
  gap: 0.1rem;
}

.split-summary-breakdown.is-collapsed {
  display: none;
}

.summary-split-card .timesheet-label,
.summary-split-card .timesheet-hover-label,
.summary-split-card .split-summary-bar-toggle,
.summary-split-card .split-summary-meta span {
  text-transform: none;
}

.summary-split-card .split-summary-toggle.is-open {
  color: #d8e6ff;
  border-color: #53729b;
  background: #141d29;
}

.timesheet-color-0 {
  background-color: #c64c43;
}

.timesheet-color-1 {
  background-color: #638cc9;
}

.timesheet-color-2 {
  background-color: #7fa36b;
}

.timesheet-color-3 {
  background-color: #c39a4d;
}

.timesheet-color-4 {
  background-color: #8a6bc0;
}

.session-log-details {
  display: grid;
  gap: 0.45rem;
}

.session-log-summary {
  display: block;
  align-items: center;
  color: var(--muted);
}

.session-day-list {
  display: grid;
  gap: 0.45rem;
}

.session-day-section {
  display: grid;
  gap: 0.35rem;
}

.session-day-section.is-separated {
  border-top: 1px solid var(--line);
  padding-top: 0.8rem;
  margin-top: 0.15rem;
}

.session-day-toggle {
  display: grid;
  grid-template-columns: minmax(2.8rem, auto) 4.25rem minmax(0, 1fr) 4.25rem;
  gap: 0.65rem;
  align-items: center;
  width: 100%;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: inherit;
  text-align: left;
}

.session-day-toggle:hover {
  color: var(--text);
}

.session-day-name {
  color: var(--text);
  font-size: 0.84rem;
  min-width: 2.8rem;
  letter-spacing: 0.04em;
}

.session-day-edge {
  color: var(--muted);
  font-size: 0.72rem;
  white-space: nowrap;
}

.session-day-edge-right {
  text-align: right;
}

.session-day-bar-wrap {
  min-width: 0;
  padding-top: 0;
  align-self: center;
}

.session-day-segment {
  height: 100%;
}

.session-day-segment.is-outside {
  background: transparent;
  pointer-events: none;
}

.session-day-segment.is-tracked {
  background: linear-gradient(180deg, #9a9a9a 0%, #767676 100%);
}

.session-day-segment.is-gap {
  background: linear-gradient(180deg, #313131 0%, #252525 100%);
}

.session-day-segment.is-short-gap {
  background: linear-gradient(180deg, #7c7c7c 0%, #5e5e5e 100%);
}

.session-day-segment.is-paid-lunch {
  background: linear-gradient(180deg, rgba(117, 158, 219, 0.95) 0%, rgba(86, 122, 181, 0.9) 100%);
}

.session-day-breakdown.is-collapsed {
  display: none;
}

.session-log-list {
  display: grid;
  gap: 0.2rem;
}

.session-log-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 0.8rem;
  align-items: baseline;
  padding: 0.28rem 0.45rem;
  color: var(--muted);
  font-size: 0.76rem;
  border-radius: 8px;
  background: #101010;
  border: 1px solid var(--line);
}

.completed-panel #completed-timeline {
  display: grid;
}

.completed-timeline-card {
  display: grid;
  gap: 0.6rem;
  padding: 0.8rem;
}

.completed-search-results {
  gap: 0.9rem;
}

.completed-search-day {
  display: grid;
  gap: 0.45rem;
}

.completed-search-day + .completed-search-day {
  padding-top: 0.15rem;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.completed-search-day-label {
  color: var(--muted);
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.completed-timeline-nav {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 0.75rem;
  align-items: center;
}

.completed-timeline-day-label {
  text-align: center;
  color: var(--text);
  font-size: 0.92rem;
  font-weight: 600;
}

.completed-timeline-list {
  display: grid;
  gap: 0.2rem;
}

.completed-day-rows {
  display: grid;
  gap: 0.24rem;
}

.completed-day-row {
  display: grid;
  grid-template-columns: 5rem 1rem minmax(0, 1fr);
  align-items: stretch;
  gap: 0.55rem;
}

.completed-day-row.is-active {
  min-height: 2.6rem;
}

.completed-day-row.is-gap {
  min-height: 1.05rem;
  align-items: center;
}

.completed-day-entry-time {
  color: var(--muted);
  font-size: 0.76rem;
  white-space: nowrap;
  transform: translateY(0.58rem);
}

.completed-day-entry-dot {
  position: relative;
  width: 1rem;
  height: 100%;
}

.completed-day-entry-dot::before {
  content: "";
  position: absolute;
  top: 0.96rem;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 0.28rem;
  height: 0.28rem;
  border-radius: 999px;
  background: #7a7a7a;
}

.completed-day-entry-dot::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 1px;
  background: rgba(255, 255, 255, 0.14);
}

.completed-day-row.is-gap .completed-day-entry-dot::before {
  top: calc(50% - 0.18rem);
  transform: translate(-50%, -50%);
  width: 0.22rem;
  height: 0.22rem;
  background: #5e5e5e;
}

.completed-day-row.is-gap .completed-day-entry-dot::after {
  top: calc(50% - 0.02rem);
  width: 1px;
  border-left: 0;
  background: rgba(255, 255, 255, 0.14);
}

.completed-day-row.is-active .completed-day-entry-dot::after {
  width: 1px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  box-shadow: none;
}

.completed-day-gap {
  height: 100%;
  display: flex;
  align-items: center;
  padding-left: 0.2rem;
  transform: translateY(-0.1rem);
}

.completed-day-gap-duration {
  color: #6f6f6f;
  font-size: 0.72rem;
  line-height: 1.2;
  white-space: nowrap;
}

.completed-day-task-slot {
  min-width: 0;
  height: 100%;
}

.completed-day-lane {
  min-width: 0;
}

.completed-timeline-task {
  width: 100%;
  min-width: 0;
  padding-left: 0;
  border-radius: 8px;
  border: 1px solid #2c2c2c;
  background: #0a0a0a;
}

.completed-timeline-task.completed {
  opacity: 1;
}

.completed-timeline-task .task-minimal {
  padding: 0.14rem 0.2rem;
}

.completed-timeline-task .task-side {
  font-size: 0.76rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.completed-timeline-task .task-title-label {
  line-height: 1.55;
}

.completed-timeline-task .task-complete {
  margin-left: auto;
}

.completed-day-row:hover .timesheet-hover-label,
.completed-day-lane:hover .timesheet-hover-label {
  opacity: 1;
  transform: translate(-50%, 0);
}

@media (max-width: 720px) {
  .completed-timeline-nav {
    gap: 0.55rem;
  }

  .completed-day-row {
    grid-template-columns: 4rem 0.9rem minmax(0, 1fr);
  }

  .completed-day-row {
    gap: 0.45rem;
  }
}

.session-log-start {
  min-width: 0;
}

.session-log-duration {
  justify-self: center;
  text-align: center;
  color: var(--text);
}

.session-log-stop {
  min-width: 0;
  justify-self: end;
  text-align: right;
}

.session-log-row.is-gap {
  color: #7d7d7d;
  background: #0d0d0d;
  border-color: #1c1c1c;
}

.session-log-row.is-gap .session-log-duration {
  color: #a6a6a6;
}

.session-log-row.is-short-gap {
  color: #9a9a9a;
  background: #111;
  border-color: #242424;
}

.session-log-row.is-short-gap .session-log-duration {
  color: #c4c4c4;
}

.session-log-row.is-paid-lunch {
  color: #a9c1e6;
  background: rgba(60, 84, 122, 0.18);
  border-color: rgba(104, 141, 201, 0.32);
}

.session-log-row.is-paid-lunch .session-log-duration {
  color: #cbe0ff;
}

.tracking-session-details {
  display: block;
}

.tracking-session-summary {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 0.6rem;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  text-align: left;
  user-select: none;
}

.tracking-session-summary:hover {
  transform: none;
}

.tracking-session-summary.is-open .expand-hint {
  transform: rotate(90deg);
  color: #b7c9e8;
}

.tracking-session-summary-meta {
  color: var(--muted);
  font-size: 0.78rem;
}

.tracking-session-panel.is-collapsed {
  display: none;
}

.tracking-session-list {
  display: grid;
  gap: 0.45rem;
  margin-top: 0.6rem;
}

.tracking-session-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg-soft);
}

.tracking-session-meta {
  display: grid;
  gap: 0.18rem;
  min-width: 0;
}

.tracking-session-meta strong {
  font-size: 0.82rem;
}

.tracking-session-meta span {
  color: var(--muted);
  font-size: 0.78rem;
}

.tracking-session-meta-compact {
  gap: 0.08rem;
  min-width: 7rem;
}

.tracking-session-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
  gap: 0.55rem;
  width: 100%;
  align-items: end;
}

.tracking-session-field {
  display: grid;
  gap: 0.3rem;
  min-width: 0;
}

.tracking-session-field > span {
  color: var(--muted);
  font-size: 0.76rem;
  text-transform: uppercase;
}

.tracking-session-input {
  min-width: 0;
  padding: 0.52rem 0.62rem;
}

.tracking-session-actions {
  display: inline-flex;
  gap: 0.35rem;
  align-items: center;
  flex-wrap: wrap;
}

.danger-text {
  color: #f1a29a;
}

.empty {
  padding: 0.85rem;
  color: var(--muted);
  text-align: center;
}

.stats-card {
  padding: 0.85rem;
}

.stats-card {
  display: grid;
  gap: 0.45rem;
}

.summary-split-card {
  width: 100%;
}

.notes-container {
  display: grid;
  gap: 0.75rem;
}

.note-block {
  position: relative;
  padding: 0.45rem 0.55rem;
}

.note-block.dragging {
  opacity: 0.55;
}

.queue-new-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: center;
  padding: 0.15rem 0.2rem 0.15rem calc(0.2rem + 16px + 0.55rem);
  opacity: 0.65;
}

.queue-new-input::placeholder {
  color: var(--muted);
}

.note-text {
  min-height: 0;
  resize: none;
  overflow: hidden;
  border: 0;
  background: transparent;
  padding: 0 2rem 0 0;
  line-height: 1.55;
}

.note-text:focus {
  border: 0;
}

.note-draft .note-text {
  min-height: 4.65em;
}

.note-delete {
  position: absolute;
  top: 0.35rem;
  right: 0.35rem;
  padding: 0.1rem 0.35rem;
  min-width: 1.4rem;
  color: var(--muted);
}


@media (max-width: 920px) {
  .hero,
  .form-row,
  .filters,
  .detail-actions {
    grid-template-columns: 1fr;
    display: grid;
  }

  .timer-panel .summary-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .detail-panel .detail-fields-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
  }
}

@media (max-width: 560px) {
  .shell {
    padding: 0.5rem 0.35rem 1rem;
  }

  .panel {
    padding: 0.65rem;
  }

  .hero {
    padding-top: 0.75rem;
  }

  .hero-copy {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
    gap: 0.35rem 0.75rem;
    padding-right: 0;
  }

  .hero-actions {
    position: static;
    grid-column: 2;
    grid-row: 1 / span 2;
    align-self: start;
  }

  .hero-copy .eyebrow,
  .hero-copy h1 {
    grid-column: 1;
    min-width: 0;
  }

  .hero-copy h1 {
    display: none;
  }

  .icon-button {
    width: 2.5rem;
    height: 2.5rem;
  }

  #timer-subtext {
    width: 100%;
  }

  .queue-editor {
    padding: 0.25rem 0.2rem;
  }

  .task-minimal {
    grid-template-columns: auto auto minmax(0, 1fr) auto;
    row-gap: 0.15rem;
    column-gap: 0.45rem;
  }

  .task-title-wrap {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .task-active-check {
    grid-column: 1;
    grid-row: 1;
  }

  .task-billing {
    grid-column: 2;
    grid-row: 1;
  }

  .task-side {
    grid-column: 3;
    grid-row: 1;
    justify-self: end;
    text-align: right;
    white-space: nowrap;
    font-size: 0.72rem;
  }

  .task-complete,
  .queue-delete {
    grid-column: 4;
    grid-row: 1;
    justify-self: end;
  }

  .queue-title-input,
  .task-title-label {
    width: 100%;
  }

  .timer-focus-card .task-minimal {
    grid-template-columns: auto auto minmax(0, 1fr) auto;
    row-gap: 0.15rem;
  }

  .timer-focus-card .task-active-check {
    grid-column: 1;
    grid-row: 1;
  }

  .timer-focus-card .task-billing {
    grid-column: 2;
    grid-row: 1;
  }

  .timer-focus-card .task-side {
    grid-column: 3;
    grid-row: 1;
    justify-self: end;
    text-align: right;
    white-space: nowrap;
    font-size: 0.72rem;
  }

  .timer-focus-card .task-complete {
    grid-column: 4;
    grid-row: 1;
    justify-self: end;
  }

  .timer-focus-card .task-title-wrap {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .summary-grid article,
  .stat {
    padding: 0.62rem;
  }

  .detail-panel .panel-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 0.55rem;
  }

  .detail-panel input {
    padding: 0.62rem 0.65rem;
  }

  .queue-header-actions {
    gap: 0.55rem;
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  .session-day-toggle {
    grid-template-columns: 4.25rem minmax(0, 1fr) 4.25rem;
    gap: 0.4rem 0.6rem;
  }

  .session-day-name {
    grid-column: 1 / -1;
  }

  .session-day-edge {
    width: 100%;
  }

  .session-day-edge-right {
    text-align: right;
  }

  .session-day-bar-wrap {
    grid-column: 2;
  }

  .session-log-row {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.25rem 0.7rem;
  }

  .session-log-start {
    grid-column: 1;
    grid-row: 1;
  }

  .session-log-duration {
    grid-column: 2;
    grid-row: 1 / span 2;
    align-self: center;
  }

  .session-log-stop {
    grid-column: 1;
    grid-row: 2;
    justify-self: start;
    text-align: left;
  }
}
