:root {
  color-scheme: light;
  --paper: #f6f5f1;
  --surface: #ffffff;
  --ink: #111315;
  --muted: #6e7377;
  --line: #dfe1df;
  --soft: #ececea;
  --accent: #138cc2;
  --accent-dark: #0874a4;
  --error: #a93124;
  --max-width: 1120px;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--paper);
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: Arial, Helvetica, sans-serif;
  line-height: 1.45;
}

button,
input,
textarea {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  cursor: pointer;
}

.site-header,
main,
footer {
  width: min(calc(100% - 40px), var(--max-width));
  margin-inline: auto;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 76px;
  border-bottom: 1px solid var(--line);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.02em;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  color: white;
  background: var(--accent);
  font-size: 19px;
  font-weight: 800;
}

.product-label {
  color: var(--muted);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

main {
  min-height: calc(100vh - 158px);
  padding-block: 68px 96px;
}

.setup-panel {
  max-width: 710px;
}

.eyebrow {
  margin: 0 0 16px;
  color: var(--accent-dark);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: clamp(44px, 7vw, 78px);
  line-height: 0.98;
  letter-spacing: -0.055em;
}

.intro {
  max-width: 620px;
  margin: 28px 0 42px;
  color: #484d50;
  font-size: 19px;
  line-height: 1.55;
}

form {
  display: grid;
  gap: 12px;
  max-width: 640px;
  padding-top: 34px;
  border-top: 2px solid var(--ink);
}

label {
  font-size: 14px;
  font-weight: 700;
}

input,
textarea {
  width: 100%;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid #c9ccca;
  border-radius: 2px;
  outline: none;
  transition: border-color 140ms ease, box-shadow 140ms ease;
}

input {
  height: 50px;
  padding: 0 14px;
}

textarea {
  min-height: 112px;
  padding: 13px 14px;
  resize: vertical;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 13px;
  line-height: 1.5;
}

input:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgb(19 140 194 / 14%);
}

.cookie-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 12px;
}

.text-button {
  padding: 0;
  color: var(--accent-dark);
  background: transparent;
  border: 0;
  font-size: 13px;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.cookie-help {
  padding: 14px 18px;
  background: #e9f4f8;
  border-left: 3px solid var(--accent);
  font-size: 14px;
}

.cookie-help ol {
  margin: 0;
  padding-left: 20px;
}

.cookie-help li + li {
  margin-top: 5px;
}

.cookie-help a {
  color: var(--accent-dark);
}

code {
  padding: 2px 5px;
  background: rgb(255 255 255 / 70%);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.privacy-note {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 12px;
}

.primary-button,
.secondary-button {
  min-height: 46px;
  padding: 0 22px;
  border-radius: 2px;
  font-weight: 700;
  transition: background-color 140ms ease, border-color 140ms ease, transform 100ms ease;
}

.primary-button {
  color: white;
  background: var(--accent);
  border: 1px solid var(--accent);
}

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

.primary-button:active,
.secondary-button:active {
  transform: translateY(1px);
}

.primary-button:disabled {
  cursor: wait;
  opacity: 0.66;
}

form > .primary-button {
  width: fit-content;
  min-width: 184px;
  margin-top: 8px;
}

.secondary-button {
  color: var(--ink);
  background: transparent;
  border: 1px solid #b8bcba;
}

.secondary-button:hover {
  background: var(--surface);
  border-color: #777c79;
}

.compact {
  min-height: 42px;
}

.error-message {
  padding: 12px 14px;
  color: var(--error);
  background: #f8e9e7;
  border-left: 3px solid var(--error);
  font-size: 14px;
}

.report-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 28px;
  margin-bottom: 50px;
}

.report-heading h1 {
  font-size: clamp(44px, 6vw, 70px);
}

.report-month {
  margin: 18px 0 0;
  font-size: 24px;
  font-weight: 700;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin-bottom: 42px;
  border-block: 1px solid var(--line);
}

.metric {
  min-width: 0;
  padding: 30px 26px 28px;
  background: var(--surface);
}

.metric + .metric {
  border-left: 1px solid var(--line);
}

.metric strong,
.metric span {
  display: block;
  text-align: center;
}

.metric strong {
  font-size: clamp(36px, 5vw, 54px);
  line-height: 1;
  letter-spacing: -0.04em;
}

.metric span {
  margin-top: 12px;
  color: var(--muted);
  font-size: 14px;
}

.report-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  margin-bottom: 26px;
}

.report-actions p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.action-buttons {
  display: flex;
  gap: 10px;
}

.ledger-heading,
.group-summary,
.session-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 92px;
  align-items: center;
}

.ledger-heading {
  padding: 14px 20px;
  color: #f8f8f6;
  background: var(--ink);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.ledger-heading span:last-child,
.group-hours,
.session-hours {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.ledger details {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.group-summary {
  min-height: 62px;
  padding: 0 20px;
  cursor: pointer;
  font-weight: 700;
  list-style: none;
}

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

.group-name {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 12px;
}

.group-name::before {
  content: "+";
  width: 18px;
  color: var(--accent-dark);
  font-size: 19px;
  font-weight: 400;
}

details[open] .group-name::before {
  content: "−";
}

.group-name span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.session-row {
  min-height: 68px;
  padding: 10px 20px 10px 50px;
  background: var(--soft);
  border-top: 1px solid #d6d8d6;
}

.session-row:nth-child(even) {
  background: #f5f5f3;
}

.session-date {
  color: var(--accent-dark);
  font-size: 15px;
  font-weight: 700;
}

.session-meta {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 13px;
}

.empty-state {
  padding: 72px 24px;
  color: var(--muted);
  background: var(--surface);
  text-align: center;
}

footer {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  min-height: 82px;
  padding-top: 24px;
  color: var(--muted);
  border-top: 1px solid var(--line);
  font-size: 12px;
}

[hidden] {
  display: none !important;
}

@media (max-width: 720px) {
  .site-header,
  main,
  footer {
    width: min(calc(100% - 28px), var(--max-width));
  }

  .site-header {
    min-height: 66px;
  }

  .product-label {
    display: none;
  }

  main {
    padding-block: 44px 70px;
  }

  h1 {
    font-size: clamp(42px, 13vw, 58px);
  }

  .intro {
    margin: 22px 0 34px;
    font-size: 17px;
  }

  form {
    padding-top: 26px;
  }

  form > .primary-button {
    width: 100%;
  }

  .report-heading,
  .report-actions,
  footer {
    align-items: stretch;
    flex-direction: column;
  }

  .report-heading {
    margin-bottom: 34px;
  }

  .report-heading .secondary-button {
    width: 100%;
  }

  .metrics {
    grid-template-columns: 1fr;
    margin-bottom: 32px;
  }

  .metric {
    display: grid;
    grid-template-columns: 1fr 1.4fr;
    align-items: center;
    padding: 22px 20px;
  }

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

  .metric strong,
  .metric span {
    text-align: left;
  }

  .metric span {
    margin-top: 0;
  }

  .action-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .ledger-heading,
  .group-summary,
  .session-row {
    grid-template-columns: minmax(0, 1fr) 72px;
  }

  .ledger-heading {
    padding-inline: 14px;
    font-size: 11px;
  }

  .group-summary {
    min-height: 58px;
    padding-inline: 14px;
    font-size: 14px;
  }

  .group-name {
    gap: 7px;
  }

  .session-row {
    padding: 11px 14px 11px 39px;
  }

  footer {
    min-height: 100px;
    justify-content: flex-start;
  }
}

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