:root {
  color-scheme: light;
  --background: #f5f6f8;
  --surface: #fff;
  --text: #202731;
  --muted: #737b87;
  --line: #e7e9ee;
  --accent: #344c75;
  --accent-hover: #263d62;
  --shadow: 0 3px 6px #202e431f,0 10px 30px #202e4304;
  --radius: 15px;
  font-family: Inter,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
  font-size: 15px;
  line-height: 1.5;
  color: var(--text);
  background: var(--background);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

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

button,a,input,select,textarea,summary {
  -webkit-tap-highlight-color: transparent;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: wait;
  opacity: .65;
}

input,select,textarea {
  display: block;
  width: 100%;
  min-width: 0;
  min-height: 44px;
  border: 1px solid #dbe0e7;
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  padding: 10px 12px;
  transition: border-color .15s,box-shadow .15s;
}

textarea {
  resize: vertical;
  line-height: 1.55;
}

input::placeholder,textarea::placeholder {
  color: #939aa5;
}

select {
  padding-right: 28px;
}

label {
  display: block;
  font-size: .81rem;
  font-weight: 600;
  margin-bottom: 7px;
  color: #525c6a;
}

input:focus,select:focus,textarea:focus {
  border-color: #7a91b9;
  box-shadow: 0 0 0 3px #344c7514;
  outline: none;
}

:focus-visible {
  outline: 3px solid #829aca;
  outline-offset: 3px;
}

h1,h2,h3,p {
  margin: 0;
}

h1 {
  font-size: 2rem;
  line-height: 1.25;
  letter-spacing: -1px;
  font-weight: 650;
}

h2 {
  font-size: 1.12rem;
  line-height: 1.4;
  letter-spacing: -.25px;
  font-weight: 650;
}

h3 {
  font-size: 1rem;
  font-weight: 550;
}

svg {
  display: block;
  width: 20px;
  height: 20px;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.site-header {
  height: 84px;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: var(--text);
  font-size: 1.65rem;
  font-weight: 700;
  letter-spacing: -.8px;
}

.brand:hover {
  text-decoration: none;
}

.brand-mark {
  display: grid;
  place-items: center;
  background: #e9edf4;
  border-radius: 10px;
  width: 35px;
  height: 35px;
  color: var(--accent);
}

.brand-mark svg {
  width: 24px;
  height: 24px;
}

.brand-period {
  color: #637da5;
}

.header-meta {
  display: flex;
  align-items: center;
  gap: 24px;
}

.private-label {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: .77rem;
}

.private-label svg {
  width: 14px;
  height: 14px;
  stroke-width: 1.3;
}

.text-button {
  border: 0;
  background: none;
  color: var(--muted);
  padding: 8px 0;
  font-size: .8rem;
}

.text-button:hover {
  color: var(--text);
}

.main-shell {
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 40px 48px;
}

.page-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 28px;
}

.section-kicker {
  font-size: .72rem;
  font-weight: 650;
  letter-spacing: 1.3px;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 7px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.capture-card {
  padding: 25px 28px;
  margin-bottom: 32px;
}

.section-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
}

.section-heading p {
  font-size: .82rem;
  margin-top: 4px;
}

.quiet-icon {
  color: #a0a9b6;
  font-size: 2rem;
  line-height: 1;
}

.muted {
  color: var(--muted);
}

.small {
  font-size: .78rem;
}

.button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 9px;
  min-height: 44px;
  padding: 10px 18px;
  border: 1px solid transparent;
  border-radius: 8px;
  font-size: .84rem;
  font-weight: 600;
  line-height: 1.4;
  white-space: nowrap;
  transition: background .15s,box-shadow .15s;
  text-decoration: none;
}

.button:hover {
  text-decoration: none;
}

.primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 2px 3px #344c7514;
}

.primary:hover {
  background: var(--accent-hover);
}

.secondary {
  color: #4c586a;
  background: #fff;
  border-color: #dfe3e9;
}

.secondary:hover {
  background: #f7f8fa;
}

.compact {
  min-height: 38px;
  padding: 8px 12px;
  font-size: .78rem;
}

.compact svg {
  width: 16px;
  height: 16px;
}

.start-form {
  display: grid;
  grid-template-columns: minmax(170px,.75fr) minmax(200px,1.65fr) auto;
  align-items: end;
  gap: 16px;
}

.start-button {
  height: 44px;
}

.start-button svg {
  stroke: none;
  width: 16px;
  height: 16px;
}

.optional {
  font-size: .7rem;
  font-weight: 400;
  color: #838b98;
  margin-left: 4px;
}

.active-section {
  margin-bottom: 35px;
}

.compact-heading {
  margin-bottom: 14px;
}

.count {
  display: inline-grid;
  place-items: center;
  border-radius: 6px;
  background: #e7ebf2;
  color: #5a6a83;
  font-size: .72rem;
  min-width: 23px;
  height: 23px;
  margin-left: 7px;
  vertical-align: middle;
}

.active-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit,minmax(min(100%,310px),1fr));
  gap: 18px;
}

.timer-card {
  padding: 22px 24px;
  min-width: 0;
}

.timer-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
}

.project-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: .76rem;
  font-weight: 600;
  line-height: 1.35;
  min-width: 0;
  overflow-wrap: anywhere;
  color: #4c648e;
}

.project-dot {
  width: 7px;
  height: 7px;
  flex: 0 0 7px;
  border-radius: 50%;
  background: currentColor;
}

.blue {
  color: #4c6c9e;
}

.purple {
  color: #8a6caf;
}

.amber {
  color: #aa7e3e;
}

.green {
  color: #497f6c;
}

.rose {
  color: #a6697b;
}

.live-indicator {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #49816c;
  font-size: .7rem;
}

.live-indicator>span {
  width: 6px;
  height: 6px;
  background: #5d977d;
  border-radius: 50%;
  box-shadow: 0 0 0 3px #5d977d13;
}

.timer-duration {
  font-size: 2.65rem;
  font-variant-numeric: tabular-nums;
  font-weight: 450;
  letter-spacing: -1.5px;
  margin: 17px 0 0;
  line-height: 1.3;
}

.timer-since {
  margin-top: 1px;
  margin-bottom: 22px;
}

.stop-form {
  display: grid;
  gap: 14px;
}

.stop-form label {
  font-size: .76rem;
}

.stop-form select,.stop-form textarea {
  font-size: .83rem;
}

.stop-button {
  width: 100%;
  background: #f0f2f5;
  color: #4f5c70;
  margin-top: 1px;
}

.stop-button:hover {
  background: #e5e9ef;
}

.stop-square {
  width: 10px;
  height: 10px;
  border-radius: 2px;
  background: currentColor;
}

.daily-section {
  margin-top: 8px;
}

.day-heading {
  align-items: end;
  margin-bottom: 20px;
}

.day-heading h2 {
  font-size: 1.3rem;
  font-weight: 600;
  letter-spacing: -.5px;
}

.date-navigation {
  display: flex;
  align-items: center;
  gap: 7px;
}

.icon-button {
  background: #fff;
  border-color: var(--line);
  min-width: 34px;
  min-height: 38px;
  padding: 5px 8px;
  font-size: 1.3rem;
  color: #647085;
}

.icon-button:hover {
  background: #eef1f5;
}

.date-form {
  display: flex;
  gap: 6px;
  align-items: center;
}

.date-form input {
  min-height: 38px;
  width: 146px;
  font-size: .75rem;
  padding: 6px 8px;
  border-color: var(--line);
}

.today-link {
  font-size: .75rem;
  margin-left: 4px;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit,minmax(180px,1fr));
  gap: 15px;
}

.summary-card {
  padding: 20px 22px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}

.summary-card strong {
  font-size: 1.65rem;
  font-weight: 550;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.7px;
  line-height: 1.2;
}

.summary-label {
  font-size: .76rem;
  font-weight: 600;
  color: #667184;
}

.total-card {
  background: #eef1f6;
  border-color: #dfe5ee;
  box-shadow: 0 3px 6px #202e4310;
}

.summary-caption {
  font-size: .68rem;
  color: #858d99;
}

.totals-note {
  font-size: .7rem;
  color: #8a929e;
  margin: 12px 2px 25px;
}

.entries-heading {
  margin-bottom: 15px;
}

.entries-list {
  display: grid;
  gap: 12px;
}

.entry-card {
  display: flex;
  justify-content: space-between;
  gap: 25px;
  padding: 22px 25px;
  min-width: 0;
}

.entry-main {
  min-width: 0;
}

.entry-meta {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 9px;
}

.entry-source {
  font-size: .67rem;
  color: #8a929e;
}

.entry-card h3 {
  font-size: .9rem;
  line-height: 1.6;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-weight: 500;
  margin-bottom: 8px;
}

.entry-range {
  font-size: .72rem;
  color: #7d8795;
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.entry-side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  flex: 0 0 auto;
  gap: 3px;
  padding-top: 3px;
}

.entry-side strong {
  font-size: 1.14rem;
  letter-spacing: -.3px;
  font-weight: 550;
  font-variant-numeric: tabular-nums;
}

.entry-day-label {
  font-size: .63rem;
  color: #939ba6;
}

.edit-link {
  font-size: .72rem;
  margin-top: 8px;
  color: #657b9d;
}

.empty-state {
  text-align: center;
  padding: 36px 22px;
}

.empty-clock {
  display: inline-block;
  font-size: 2.5rem;
  color: #b0bac9;
  line-height: 1;
  margin-bottom: 12px;
}

.empty-state h3 {
  font-size: .9rem;
  color: #606c7c;
}

.empty-state p {
  font-size: .8rem;
  color: #929aa6;
  margin-top: 5px;
}

.manual-card {
  margin-top: 20px;
  scroll-margin-top: 25px;
}

.projects-card {
  margin-top: 16px;
  box-shadow: 0 3px 6px #202e4308;
}

details>summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 25px;
  font-size: .88rem;
  font-weight: 600;
}

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

details>summary::before {
  content: '+';
  display: inline-grid;
  place-items: center;
  width: 20px;
  height: 20px;
  font-size: 1.1rem;
  font-weight: 400;
  color: #7b8799;
}

details[open]>summary::before {
  content: '−';
}

.summary-detail {
  margin-left: auto;
  color: #939ba7;
  font-size: .73rem;
  font-weight: 400;
}

.details-body {
  padding: 0 28px 25px;
}

.manual-form {
  display: grid;
  gap: 20px;
}

.time-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.form-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  margin-top: 1px;
}

.field-hint {
  color: #929aa6;
  font-size: .73rem;
  font-weight: 400;
  margin: 0;
}

.project-list {
  display: flex;
  gap: 14px 24px;
  flex-wrap: wrap;
  margin: 0 0 22px;
}

.project-form {
  display: flex;
  align-items: end;
  gap: 15px;
}

.project-form .field {
  flex: 1;
}

.site-footer {
  max-width: 1200px;
  padding: 0 40px 25px;
  margin: 0 auto;
  color: #a0a7b2;
  font-size: .7rem;
  display: flex;
  justify-content: space-between;
  gap: 20px;
}

.notice {
  border-radius: 10px;
  padding: 14px 18px;
  margin-bottom: 24px;
  font-size: .84rem;
  overflow-wrap: anywhere;
}

.notice strong {
  display: block;
  font-size: .78rem;
  margin-bottom: 3px;
}

.notice.error {
  background: #fff3f1;
  border: 1px solid #efdad5;
  color: #9a5147;
}

.notice.success {
  background: #edf6f0;
  border: 1px solid #d3e8db;
  color: #41775b;
}

.auth-shell {
  max-width: 450px;
  min-height: calc(100vh - 145px);
  margin: 0 auto;
  padding: 75px 20px 70px;
}

.login-shell {
  max-width: 360px;
}

.login-panel h1 {
  font-size: 1.45rem;
  margin-bottom: 24px;
}

.login-panel .full-width {
  justify-content: center;
}

.auth-card {
  padding: 35px 32px;
}

.auth-card h1 {
  font-size: 1.7rem;
}

.auth-intro {
  font-size: .85rem;
  margin-top: 10px;
  margin-bottom: 29px;
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.stack label {
  margin: 7px 0 0;
}

.stack .field-hint {
  margin-top: -3px;
  margin-bottom: 4px;
}

.full-width {
  width: 100%;
  margin-top: 18px;
  justify-content: space-between;
}

.edit-card {
  max-width: 760px;
  padding: 28px;
}

.back-link {
  display: inline-block;
  margin-bottom: 24px;
  font-size: .8rem;
}

.skip-link {
  position: fixed;
  top: -80px;
  left: 20px;
  background: var(--accent);
  color: white;
  z-index: 10;
  padding: 10px 16px;
  border-radius: 8px;
}

.skip-link:focus {
  top: 12px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

@media(min-width:1200px) {
  .active-grid:has(.timer-card:only-child) {
    grid-template-columns: 1fr;
  }
  .active-grid:has(.timer-card:only-child) .timer-card {
    display: grid;
    grid-template-columns: 210px 1fr;
    column-gap: 26px;
    align-items: center;
  }
  .active-grid:has(.timer-card:only-child) .timer-top {
    grid-column: 1;
    grid-row: 1;
    justify-content: flex-start;
    gap: 16px;
  }
  .active-grid:has(.timer-card:only-child) .timer-duration {
    grid-column: 1;
    grid-row: 2;
    margin-top: 12px;
  }
  .active-grid:has(.timer-card:only-child) .timer-since {
    grid-column: 1;
    grid-row: 3;
    margin-bottom: 0;
  }
  .active-grid:has(.timer-card:only-child) .stop-form {
    grid-column: 2;
    grid-row: 1/4;
    display: grid;
    grid-template-columns: minmax(150px,.7fr) minmax(180px,1fr);
    align-items: end;
    gap: 12px;
  }
  .active-grid:has(.timer-card:only-child) .stop-form .field:nth-of-type(2) {
    grid-row: 1/3;
    grid-column: 2;
  }
  .active-grid:has(.timer-card:only-child) .stop-form .stop-button {
    grid-column: 1;
    grid-row: 2;
  }
  .active-grid:has(.timer-card:only-child) textarea {
    min-height: 104px;
  }
}

@media(max-width:900px) {
  .main-shell {
    padding: 30px 26px 40px;
  }
  .site-header {
    padding: 0 26px;
    height: 74px;
  }
  .site-footer {
    padding: 0 26px 24px;
  }
  .start-form {
    grid-template-columns: 1fr 1.5fr;
  }
  .start-button {
    grid-column: 1/-1;
    justify-self: end;
  }
  .day-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 17px;
  }
  .summary-grid {
    grid-template-columns: repeat(2,minmax(0,1fr));
  }
  .capture-card {
    padding: 24px;
  }
  .date-navigation {
    width: 100%;
  }
  .date-form {
    flex: 1;
  }
  .date-form input {
    flex: 1;
    width: auto;
  }
  .date-form .button {
    min-width: 80px;
  }
}

@media(max-width:520px) {
  :root {
    font-size: 15px;
  }
  .site-header {
    height: 68px;
    padding: 0 20px;
  }
  .header-meta {
    gap: 17px;
  }
  .private-label {
    font-size: .7rem;
  }
  .brand {
    font-size: 1.5rem;
  }
  .brand-mark {
    width: 31px;
    height: 31px;
  }
  .brand-mark svg {
    width: 22px;
    height: 22px;
  }
  .main-shell {
    padding: 25px 16px 35px;
  }
  .page-heading {
    gap: 12px;
    align-items: flex-end;
    margin-bottom: 22px;
  }
  h1 {
    font-size: 1.75rem;
  }
  .section-kicker {
    font-size: .65rem;
    margin-bottom: 5px;
  }
  .page-heading .button {
    font-size: .68rem;
    padding: 8px;
    gap: 5px;
  }
  .page-heading .button svg {
    width: 14px;
    height: 14px;
  }
  .capture-card {
    padding: 21px 18px;
    margin-bottom: 28px;
  }
  .section-heading {
    gap: 10px;
  }
  .section-heading p {
    font-size: .76rem;
  }
  .start-form {
    grid-template-columns: 1fr;
    gap: 15px;
  }
  .start-button {
    width: 100%;
  }
  .optional {
    font-size: .65rem;
  }
  .timer-card {
    padding: 21px 20px;
  }
  .compact-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 7px;
  }
  .timer-duration {
    font-size: 2.5rem;
  }
  .summary-grid {
    gap: 10px;
  }
  .summary-card {
    padding: 17px 16px;
    gap: 10px;
  }
  .summary-card strong {
    font-size: 1.4rem;
  }
  .summary-card .project-badge {
    font-size: .68rem;
    gap: 6px;
  }
  .summary-caption {
    font-size: .63rem;
  }
  .day-heading h2 {
    font-size: 1.15rem;
  }
  .date-navigation {
    gap: 5px;
    flex-wrap: wrap;
  }
  .date-form {
    gap: 5px;
    min-width: 0;
  }
  .date-form input {
    font-size: .71rem;
    padding: 7px;
    min-width: 0;
  }
  .date-form .button {
    font-size: .7rem;
    min-width: 0;
    padding: 8px;
  }
  .today-link {
    margin-left: 0;
    width: 100%;
    text-align: right;
  }
  .entries-heading .button {
    font-size: .72rem;
    padding: 8px 10px;
  }
  .entry-card {
    padding: 18px 17px;
    gap: 14px;
  }
  .entry-card h3 {
    font-size: .84rem;
  }
  .entry-meta {
    gap: 9px;
  }
  .entry-meta .project-badge {
    font-size: .7rem;
  }
  .entry-source {
    font-size: .6rem;
  }
  .entry-range {
    font-size: .66rem;
    gap: 4px;
  }
  .entry-side strong {
    font-size: 1rem;
  }
  .entry-side {
    max-width: 103px;
  }
  .entry-day-label {
    font-size: .6rem;
  }
  .edit-link {
    font-size: .68rem;
  }
  .totals-note {
    font-size: .66rem;
    margin-top: 11px;
  }
  .empty-state {
    padding: 30px 16px;
  }
  .empty-state p {
    font-size: .74rem;
  }
  details>summary {
    padding: 18px 16px;
    gap: 8px;
    font-size: .83rem;
  }
  .summary-detail {
    font-size: .65rem;
  }
  .details-body {
    padding: 0 18px 21px;
  }
  .time-fields {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  .manual-form {
    gap: 17px;
  }
  .form-footer {
    align-items: stretch;
    flex-direction: column;
    gap: 13px;
  }
  .form-footer .button {
    width: 100%;
  }
  .project-form {
    flex-direction: column;
    align-items: stretch;
  }
  .site-footer {
    padding: 0 20px 22px;
    font-size: .62rem;
  }
  .auth-shell {
    padding-top: 45px;
    min-height: calc(100vh - 126px);
  }
  .auth-card {
    padding: 28px 24px;
  }
  .edit-card {
    padding: 22px 18px;
  }
  .back-link {
    margin-bottom: 20px;
  }
}

@media(prefers-reduced-motion:reduce) {
  * {
    transition: none!important;
    scroll-behavior: auto!important;
  }
}
