:root {
  --bg: #f8f8f5;
  --surface: #fff;
  --soft: #eaeee2;
  --card: #f0f2e9;
  --text: #282c26;
  --muted: #6d7467;
  --line: #e3e5dd;
  --accent: #68794b;
  --hover: #e8ebe2;
  --danger: #aa453b;
  --amber: #927029;
  color-scheme: light;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 14px;
}
:root[data-theme="dark"] {
  --bg: #171a17;
  --surface: #1e221e;
  --soft: #2c3524;
  --card: #252c21;
  --text: #e6e9df;
  --muted: #a0a895;
  --line: #30362c;
  --accent: #b5c595;
  --hover: #2b3326;
  --danger: #efa698;
  --amber: #d5b679;
  color-scheme: dark;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}
button,
a,
input,
select,
textarea,
summary {
  outline-offset: 4px;
}
:focus-visible {
  outline: 2px solid var(--accent);
}
button {
  cursor: pointer;
}
button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}
a {
  color: inherit;
  text-decoration: none;
}
h1,
h2,
h3,
p {
  margin: 0;
}
h1,
h2,
h3 {
  font-weight: 500;
}
h1 {
  font-size: 36px;
  letter-spacing: -1.4px;
  line-height: 1.2;
}
h2 {
  font-size: 17px;
  letter-spacing: -0.35px;
}
h3 {
  font-size: 15px;
}
p {
  line-height: 1.7;
}
[hidden] {
  display: none !important;
}
::selection {
  background: var(--soft);
}
.shell {
  max-width: 1200px;
  margin: auto;
  padding: 0 48px;
}
.app-header {
  height: 105px;
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--line);
  gap: 45px;
}
.brand {
  display: inline-flex;
  align-items: center;
  font-size: 23px;
  letter-spacing: -0.9px;
  font-weight: 600;
  white-space: nowrap;
}
.brand-logo { display: block; width: 230px; height: auto; }
.brand-logo-dark { display: none; }
:root[data-theme="dark"] .brand-logo-light { display: none; }
:root[data-theme="dark"] .brand-logo-dark { display: block; }
.footer-brand { display: inline-flex; align-items: center; gap: 8px; }
.footer-brand img { flex-shrink: 0; }

nav {
  display: flex;
  gap: 5px;
}
nav a {
  padding: 9px 17px;
  color: var(--muted);
  border-radius: 5px;
  font-size: 13px;
}
nav a[aria-current="page"] {
  color: var(--text);
  background: var(--soft);
}
nav a:hover {
  background: var(--hover);
}
.header-tools {
  margin-left: auto;
  display: flex;
  gap: 12px;
  align-items: center;
}
.icon-button {
  background: transparent;
  border: 0;
  width: 40px;
  height: 40px;
  border-radius: 5px;
  font-size: 22px;
  color: var(--muted);
}
.icon-button:hover,
.quiet-button:hover {
  background: var(--hover);
  color: var(--text);
}
.quiet-button {
  background: none;
  border: 0;
  padding: 10px;
  border-radius: 5px;
  color: var(--muted);
  font-size: 12px;
}
.page-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  padding: 43px 0 32px;
}
.eyebrow {
  font-size: 10px;
  letter-spacing: 1.8px;
  color: var(--accent);
  margin-bottom: 13px;
}
.page-heading p {
  margin-top: 10px;
  color: var(--muted);
  font-size: 13px;
}
.page-heading time {
  font-size: 12px;
  color: var(--muted);
}
.today-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr);
  gap: 38px;
}
.timer-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 27px 32px;
}
.section-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
}
.state-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--muted);
}
.state-pill:before,
.status-dot {
  content: "";
  height: 6px;
  width: 6px;
  border-radius: 50%;
  background: var(--muted);
  display: inline-block;
}
.state-pill.running {
  color: var(--accent);
}
.state-pill.running:before {
  background: var(--accent);
}
.state-pill.paused {
  color: var(--amber);
}
.state-pill.paused:before {
  background: var(--amber);
}
label {
  display: flex;
  flex-direction: column;
  gap: 7px;
  font-size: 12px;
  color: var(--muted);
}
input,
select,
textarea {
  width: 100%;
  min-width: 0;
  padding: 11px 12px;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 5px;
}
textarea {
  resize: vertical;
}
input::placeholder,
textarea::placeholder {
  color: var(--muted);
}
select {
  padding-right: 28px;
}
input[type="color"] {
  height: 43px;
  padding: 5px;
  cursor: pointer;
}
#timer-project {
  margin-top: 8px;
  background: var(--bg);
}
.timer-digits {
  position: relative;
  width: fit-content;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 66px;
  letter-spacing: -4px;
  line-height: 1.2;
  margin: 29px 0 24px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.timer-digits.is-running::after {
  content: "";
  position: absolute;
  inset: -8px -12px;
  border-radius: 8px;
  pointer-events: none;
  animation: timer-breathe 3s ease-out infinite;
}
@keyframes timer-breathe {
  0% {
    box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 20%, transparent);
  }
  75%,
  100% {
    box-shadow: 0 0 0 10px transparent;
  }
}
.timer-digits > span {
  font-size: 37px;
  letter-spacing: -2px;
  color: var(--muted);
}
.timer-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 42px;
  background: var(--text);
  color: var(--bg);
  border: 1px solid var(--text);
  border-radius: 5px;
  padding: 11px 18px;
  font-size: 12px;
  line-height: 1.4;
  transition: background 0.15s;
}
.button:hover {
  opacity: 0.86;
}
.button.secondary {
  color: var(--text);
  background: transparent;
  border-color: var(--line);
}
.button.secondary:hover {
  background: var(--hover);
  opacity: 1;
}
.note-label {
  display: block;
  margin: 26px 0 8px;
}
#timer-note {
  background: transparent;
}
.muted {
  color: var(--muted);
}
.timer-options {
  margin-top: 17px;
}
summary {
  cursor: pointer;
  font-size: 12px;
  color: var(--muted);
  padding: 8px 0;
}
.options-row {
  display: flex;
  align-items: end;
  gap: 20px;
  margin-top: 10px;
}
.options-row label {
  flex: 1;
}
.text-danger {
  color: var(--danger);
  background: none;
  border: 0;
  padding: 10px 0;
  font-size: 12px;
}
.goal-progress {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 18px;
  font-size: 11px;
  color: var(--accent);
}
progress {
  height: 5px;
  width: 100px;
  accent-color: var(--accent);
}
.today-aside {
  display: flex;
  flex-direction: column;
  gap: 29px;
  padding-top: 4px;
}
.daily-summary {
  border-bottom: 1px solid var(--line);
  padding-bottom: 25px;
}
.daily-summary .eyebrow {
  margin-bottom: 6px;
}
.large-stat {
  font-size: 47px;
  letter-spacing: -2px;
  font-weight: 400;
  line-height: 1.4;
}
.daily-summary > p {
  font-size: 12px;
}
.category-totals {
  display: grid;
  gap: 9px;
  margin: 21px 0;
}
.category-total {
  display: flex;
  gap: 9px;
  align-items: center;
  font-size: 12px;
  color: var(--muted);
}
.category-total strong {
  margin-left: auto;
  font-weight: 400;
  color: var(--text);
}
.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex: none;
  display: inline-block;
}
.text-link {
  font-size: 12px;
  color: var(--accent);
  display: inline-flex;
  gap: 12px;
  align-items: center;
}
.text-link:hover {
  text-decoration: underline;
}
.recent-section .section-top {
  margin-bottom: 10px;
}
.recent-row {
  width: 100%;
  display: flex;
  align-items: center;
  text-align: left;
  gap: 10px;
  background: none;
  border: 0;
  border-bottom: 1px solid var(--line);
  padding: 13px 0;
  font-size: 12px;
}
.recent-row span:nth-child(2) {
  flex: 1;
  overflow-wrap: anywhere;
}
.recent-row .arrow {
  color: var(--muted);
}
.recent-row:hover {
  color: var(--accent);
}
.records-section {
  margin-top: 38px;
}
.section-description {
  font-size: 12px;
  margin-top: 5px;
}
.record-header,
.record-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 155px 88px 72px;
  gap: 20px;
  align-items: center;
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
}
.record-header {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--muted);
  padding: 10px 0;
}
.record-row {
  font-size: 13px;
}
.record-project {
  display: flex;
  gap: 9px;
  align-items: center;
  min-width: 0;
}
.record-project strong {
  font-weight: 500;
  overflow-wrap: anywhere;
}
.record-note {
  color: var(--muted);
  font-size: 12px;
  margin-top: 4px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.record-date {
  font-size: 12px;
}
.record-date small {
  display: block;
  color: var(--muted);
  font-size: 11px;
  margin-top: 2px;
}
.record-mins {
  font-size: 13px;
  white-space: nowrap;
}
.edit-button {
  background: none;
  border: 1px solid var(--line);
  border-radius: 4px;
  min-height: 36px;
  font-size: 11px;
  padding: 7px 10px;
}
.edit-button:hover {
  background: var(--hover);
}
.empty-state {
  text-align: center;
  padding: 32px 20px;
  border: 1px dashed var(--line);
  border-radius: 6px;
  color: var(--muted);
  font-size: 13px;
}
.empty-state strong {
  display: block;
  color: var(--text);
  font-size: 15px;
  font-weight: 500;
  margin-bottom: 6px;
}
.empty-state .button {
  margin-top: 16px;
}
.compact-timer {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 18px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 0 0 6px 6px;
}
.compact-timer > a {
  display: flex;
  gap: 12px;
  align-items: center;
  flex: 1;
  min-width: 0;
  font-size: 12px;
}
.compact-timer strong {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.compact-timer .status-dot {
  background: var(--accent);
}
#compact-project {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
#compact-status {
  color: var(--muted);
  font-size: 11px;
}
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  padding: 21px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.filter-bar > label {
  flex: 1;
  min-width: 150px;
}
.custom-range {
  display: flex;
  gap: 16px;
  flex-basis: 100%;
}
.custom-range label {
  flex: 1;
}
.overview-stats {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 25px;
  margin: 29px 0;
}
.overview-stats span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}
.overview-stats strong {
  display: block;
  font-size: 31px;
  font-weight: 400;
  letter-spacing: -1px;
  margin-top: 7px;
}
.chart-panel {
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 25px 28px;
  background: var(--surface);
}
.chart-panel .muted {
  font-size: 11px;
}
.activity-chart {
  height: 160px;
  display: flex;
  gap: 12px;
  align-items: stretch;
  overflow-x: auto;
}
.chart-column {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  min-width: 25px;
  gap: 7px;
  font-size: 10px;
  color: var(--muted);
}
.chart-track {
  width: 100%;
  max-width: 75px;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}
.chart-stack {
  display: flex;
  flex-direction: column-reverse;
  min-height: 0;
  border-radius: 3px;
  overflow: hidden;
}
.chart-column strong {
  font-weight: 400;
  font-size: 10px;
  white-space: nowrap;
}
.chart-day {
  white-space: nowrap;
}
.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 24px;
  font-size: 11px;
  color: var(--muted);
}
.chart-legend span {
  display: flex;
  align-items: center;
  gap: 7px;
}
.project-breakdown-section {
  margin-top: 30px;
}
.breakdown-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(60px, 1fr) 80px;
  gap: 18px;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  font-size: 12px;
}
.breakdown-name {
  display: flex;
  align-items: center;
  gap: 9px;
  overflow-wrap: anywhere;
}
.breakdown-track {
  height: 4px;
  background: var(--line);
  border-radius: 2px;
}
.breakdown-track span {
  height: 100%;
  display: block;
  border-radius: 2px;
}
.breakdown-row > strong {
  text-align: right;
  font-weight: 400;
}
.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 19px;
  gap: 12px;
  font-size: 12px;
}
.project-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 17px;
}
.project-card {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
}
.project-card h2 {
  font-size: 16px;
  overflow-wrap: anywhere;
  line-height: 1.4;
  margin: 14px 0 8px;
}
.project-card .project-category {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: var(--muted);
}
.project-card .project-meta {
  font-size: 12px;
  color: var(--muted);
  margin: 18px 0;
}
.project-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.project-card-actions button {
  font-size: 11px;
}
.archived-section {
  margin-top: 32px;
}
.archived-section > summary {
  font-size: 14px;
  padding: 16px 0;
}
.archived-section > p {
  font-size: 12px;
  margin-bottom: 20px;
}
footer {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 23px 0;
  border-top: 1px solid var(--line);
  margin-top: 49px;
  font-size: 11px;
  color: var(--muted);
}
footer > span:last-child {
  font-size: 10px;
}
.footer-separator {
  padding: 0 12px;
  color: var(--accent);
}
dialog {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 28px;
  width: 510px;
  max-width: calc(100vw - 32px);
  max-height: 90vh;
  overflow: auto;
}
dialog::backdrop {
  background: rgba(20, 25, 18, 0.45);
  backdrop-filter: blur(3px);
}
.dialog-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}
.dialog-heading h2 {
  font-size: 21px;
}
.dialog-heading .icon-button {
  margin-right: -10px;
}
dialog label {
  margin-bottom: 18px;
}
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.dialog-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 24px;
  flex-wrap: wrap;
}
.spacer {
  flex: 1;
}
.field-help {
  font-size: 12px;
  color: var(--muted);
  margin: 8px 0 18px;
}
.form-error,
.error-text {
  font-size: 12px;
  color: var(--danger);
  margin-top: 12px;
}
.form-error:empty {
  display: none;
}
.settings-section {
  border-top: 1px solid var(--line);
  padding-top: 22px;
  margin-top: 23px;
}
.settings-section p {
  font-size: 12px;
  color: var(--muted);
  margin: 9px 0 18px;
}
.settings-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.import-preview {
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 5px;
  margin-top: 16px;
}
.import-preview .button {
  margin: 0 5px 5px 0;
}
.toast {
  position: fixed;
  bottom: 25px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--text);
  color: var(--bg);
  padding: 13px 22px;
  border-radius: 6px;
  box-shadow: 0 4px 18px #0001;
  z-index: 50;
  font-size: 13px;
  max-width: calc(100vw - 32px);
  width: max-content;
}
.error-banner {
  border: 1px solid var(--danger);
  padding: 20px;
  margin: 22px 0;
  border-radius: 6px;
}
.error-banner p {
  font-size: 13px;
  margin: 8px 0 15px;
}
.error-banner .button {
  margin-right: 10px;
}
.skip-link {
  position: absolute;
  top: -100px;
  left: 20px;
  background: var(--surface);
  padding: 10px;
  z-index: 20;
}
.skip-link:focus {
  top: 10px;
}
@media (min-width: 1400px) {
  .shell {
    padding: 0 36px;
  }
  .page-heading {
    padding-top: 50px;
  }
  .timer-card {
    padding: 30px 36px;
  }
  .timer-digits {
    font-size: 76px;
  }
  .timer-digits > span {
    font-size: 43px;
  }
}
@media (max-width: 850px) {
  .shell {
    padding: 0 25px;
  }
  .app-header {
    gap: 20px;
  }
  .header-tools {
    gap: 2px;
  }
  nav a {
    padding: 9px 12px;
  }
  .today-grid {
    gap: 25px;
    grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  }
  .timer-card {
    padding: 24px;
  }
  .timer-digits {
    font-size: 52px;
    letter-spacing: -3px;
  }
  .timer-digits > span {
    font-size: 30px;
  }
  .project-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .page-heading time {
    max-width: 140px;
    text-align: right;
  }
  .record-header,
  .record-row {
    gap: 14px;
    grid-template-columns: minmax(0, 1fr) 120px 75px 65px;
  }
  .timer-actions .button {
    padding: 10px 13px;
  }
}
@media (max-width: 640px) {
  .shell {
    padding: 0 20px;
  }
  .app-header {
    height: auto;
    flex-wrap: wrap;
    padding: 20px 0 13px;
    gap: 14px;
  }
  .brand {
    font-size: 21px;
  }
  .brand-logo { width: 195px; }
  nav {
    order: 3;
    width: 100%;
    gap: 6px;
  }
  nav a {
    flex: 1;
    text-align: center;
    padding: 9px;
  }
  .header-tools .quiet-button {
    padding: 8px;
    font-size: 11px;
  }
  .page-heading {
    padding: 29px 0 24px;
    flex-wrap: wrap;
    gap: 14px;
  }
  .page-heading time {
    max-width: none;
    text-align: left;
    font-size: 11px;
  }
  h1 {
    font-size: 29px;
    letter-spacing: -1px;
  }
  .eyebrow {
    font-size: 9px;
  }
  .today-grid {
    grid-template-columns: 1fr;
    gap: 27px;
  }
  .timer-card {
    padding: 23px;
  }
  .timer-digits {
    font-size: 58px;
  }
  .timer-digits > span {
    font-size: 33px;
  }
  .today-aside {
    gap: 24px;
  }
  .large-stat {
    font-size: 39px;
  }
  .category-totals {
    margin: 15px 0;
  }
  .daily-summary {
    padding-bottom: 20px;
  }
  .records-section {
    margin-top: 30px;
  }
  .section-top {
    gap: 10px;
  }
  .section-top h2 {
    font-size: 16px;
  }
  .section-top .button {
    font-size: 11px;
    padding: 10px 12px;
  }
  .record-header {
    display: none;
  }
  .record-row {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    padding: 17px 0;
  }
  .record-row > div:first-child {
    grid-column: 1;
    grid-row: 1;
  }
  .record-date {
    grid-column: 1;
    grid-row: 2;
    font-size: 11px;
    display: flex;
    gap: 8px;
  }
  .record-date small {
    margin: 0;
  }
  .record-mins {
    grid-column: 2;
    grid-row: 1;
    text-align: right;
  }
  .record-row > .edit-button {
    grid-column: 2;
    grid-row: 2;
    justify-self: end;
  }
  .record-note {
    font-size: 11px;
  }
  .overview-stats {
    gap: 13px;
    grid-template-columns: 1.5fr 1fr 1fr;
  }
  .overview-stats span {
    font-size: 10px;
  }
  .overview-stats strong {
    font-size: 25px;
  }
  .filter-bar {
    gap: 12px;
  }
  .filter-bar > label:first-child {
    flex-basis: 100%;
  }
  .filter-bar > label {
    min-width: 110px;
  }
  .chart-panel {
    padding: 20px 16px;
  }
  .activity-chart {
    gap: 6px;
  }
  .chart-column {
    font-size: 9px;
  }
  .chart-column strong {
    font-size: 9px;
  }
  .chart-legend {
    gap: 10px;
    font-size: 10px;
  }
  .project-grid {
    grid-template-columns: 1fr;
  }
  .compact-timer {
    padding: 10px;
    gap: 6px;
    flex-wrap: wrap;
  }
  .compact-timer > a {
    flex-basis: 100%;
  }
  .compact-timer .button {
    min-height: 34px;
    padding: 7px 12px;
  }
  .compact-timer .quiet-button {
    margin-left: auto;
    padding: 7px;
  }
  .form-grid {
    gap: 12px;
  }
  dialog {
    padding: 23px;
  }
  .dialog-actions .button {
    padding: 10px 13px;
  }
  footer {
    font-size: 10px;
    margin-top: 35px;
  }
  footer > span:last-child {
    display: none;
  }
  .breakdown-row {
    grid-template-columns: minmax(0, 1fr) 60px 60px;
    gap: 12px;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition: none !important;
    animation: none !important;
  }
}

.category-management-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.category-management-row > span {
  overflow-wrap: anywhere;
  min-width: 0;
}
.category-management-row .edit-button {
  flex-shrink: 0;
}
#category-form {
  margin-top: 22px;
}
