/* Colour values and spacing carried over from the Claude Design source. The
   design set them inline per element; here they are theme tokens so the
   light/dark swap is a single attribute flip on the root element. */

:root {
  --bg: oklch(0.985 0.002 260);
  --fg: oklch(0.22 0.005 260);
  --primary-bg: oklch(0.22 0.005 260);
  --primary-fg: oklch(0.98 0.002 260);
  --accent: oklch(0.64 0.13 250);

  --hairline: color-mix(in srgb, currentColor 10%, transparent);
  --edge: color-mix(in srgb, currentColor 14%, transparent);
  --card-edge: color-mix(in srgb, currentColor 12%, transparent);
  --row-edge: color-mix(in srgb, currentColor 9%, transparent);
  --track: color-mix(in srgb, currentColor 10%, transparent);
  --wash: color-mix(in srgb, currentColor 6%, transparent);
  --chip-on: color-mix(in srgb, currentColor 10%, transparent);

  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Helvetica, Arial, sans-serif;
}

:root[data-theme="dark"] {
  --bg: oklch(0.16 0.005 260);
  --fg: oklch(0.96 0.003 260);
  --primary-bg: oklch(0.96 0.003 260);
  --primary-fg: oklch(0.18 0.005 260);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

body {
  -webkit-font-smoothing: antialiased;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font);
  font-variant-numeric: tabular-nums;
  transition: background 0.35s ease, color 0.35s ease;
}

input, button { font: inherit; }

.page { min-height: 100vh; }

.shell {
  max-width: 1080px;
  margin: 0 auto;
  padding: 40px 28px 96px;
  display: flex;
  flex-direction: column;
  gap: 56px;
}

/* Header */

.header { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand { display: flex; align-items: baseline; gap: 12px; }
.brand-lang { font-size: 17px; font-weight: 600; letter-spacing: -0.01em; }
.brand-app { font-size: 15px; opacity: 0.45; letter-spacing: -0.01em; }
.toggles { display: flex; align-items: center; gap: 8px; }

.pill {
  border: 1px solid var(--edge);
  background: transparent;
  color: inherit;
  height: 32px;
  padding: 0 14px;
  border-radius: 999px;
  font-size: 13px;
  letter-spacing: -0.01em;
  cursor: pointer;
  transition: background 0.2s ease;
}
.pill:hover { background: var(--wash); }

/* Hero */

.eyebrow {
  font-size: 13px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  opacity: 0.4;
}

.hero { display: flex; flex-direction: column; gap: 14px; }
.hero-figure { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; }
.hero-number {
  font-size: clamp(64px, 13vw, 132px);
  font-weight: 300;
  letter-spacing: -0.045em;
  line-height: 0.9;
}
.hero-unit {
  font-size: clamp(20px, 3vw, 26px);
  font-weight: 300;
  opacity: 0.4;
  letter-spacing: -0.02em;
}

.hero-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 32px;
  margin-top: 18px;
  padding-top: 24px;
  border-top: 1px solid var(--hairline);
}
.stat { display: flex; flex-direction: column; gap: 5px; }
.stat-value { font-size: 26px; font-weight: 400; letter-spacing: -0.03em; }
.stat-label { font-size: 13px; opacity: 0.45; }

/* Error banner */

.banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: -32px;
  padding: 14px 18px;
  border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent);
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  border-radius: 12px;
  font-size: 14px;
}
.banner[hidden] { display: none; }
.banner-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

/* Timer and manual-entry cards */

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}
.card {
  border: 1px solid var(--card-edge);
  border-radius: 18px;
  padding: 26px;
  display: flex;
  flex-direction: column;
  gap: 22px;
}
.card-head { display: flex; align-items: center; justify-content: space-between; }

/* Double-click the section label to name the session. */
.nameable { min-width: 0; flex: 1; }
.nameable .eyebrow { cursor: text; }
.nameable .eyebrow:focus-visible { outline: 1px solid var(--accent); outline-offset: 3px; }

/* A name is user content, not a section heading, so it drops the uppercase
   label treatment and sits at full reading weight. */
.eyebrow.named {
  text-transform: none;
  letter-spacing: -0.01em;
  font-size: 15px;
  opacity: 0.85;
}

.name-input {
  width: 100%;
  max-width: 260px;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--accent);
  color: inherit;
  font-size: 15px;
  letter-spacing: -0.01em;
  padding: 0 0 4px;
  outline: none;
}
.name-input[hidden] { display: none; }
.name-input::placeholder { color: inherit; opacity: 0.3; }

.recording { display: flex; align-items: center; gap: 7px; font-size: 13px; opacity: 0.6; }
.recording[hidden] { display: none; }
.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  animation: pulseDot 1.6s ease-in-out infinite;
}
@keyframes pulseDot { 0%, 100% { opacity: 1; } 50% { opacity: 0.25; } }
@media (prefers-reduced-motion: reduce) { .dot { animation: none; } }

.timer {
  font-size: clamp(40px, 8vw, 56px);
  font-weight: 200;
  letter-spacing: -0.04em;
  line-height: 1;
}

.chips { display: flex; gap: 8px; }
.chip {
  flex: 1;
  height: 36px;
  border-radius: 10px;
  border: 1px solid var(--edge);
  background: transparent;
  color: inherit;
  cursor: pointer;
  font-size: 13px;
  letter-spacing: -0.01em;
  transition: background 0.2s ease, border-color 0.2s ease;
}
.chip[aria-pressed="true"] { border-color: transparent; background: var(--chip-on); }

.card-actions { display: flex; gap: 10px; }
/* Three controls share this row at 375px, where Japanese labels are widest.
   Wrapping would break the fixed 46px height, so labels stay on one line. */
.card-actions .ghost,
.card-actions .primary { white-space: nowrap; padding: 0 8px; }

.primary {
  flex: 1;
  height: 46px;
  border-radius: 12px;
  border: none;
  cursor: pointer;
  font-size: 15px;
  font-weight: 500;
  letter-spacing: -0.01em;
  background: var(--primary-bg);
  color: var(--primary-fg);
  transition: opacity 0.2s ease;
}
.primary:hover { opacity: 0.85; }

.ghost {
  height: 46px;
  border-radius: 12px;
  border: 1px solid var(--edge);
  background: transparent;
  color: inherit;
  cursor: pointer;
  font-size: 15px;
  letter-spacing: -0.01em;
  transition: background 0.2s ease;
}
.ghost:hover { background: var(--wash); }
.ghost[hidden] { display: none; }
/* Inside the timer's button row the ghost shares width with the primary;
   as the manual card's "Add to log" it stays full width on its own line. */
.card-actions .ghost { flex: 1; }

.icon-button {
  border: none;
  background: transparent;
  color: inherit;
  opacity: 0.25;
  cursor: pointer;
  font-size: 15px;
  padding: 4px;
  transition: opacity 0.2s ease;
}
.icon-button:hover { opacity: 0.8; }
.icon-button[hidden] { display: none; }
.icon-button.square {
  width: 46px;
  height: 46px;
  border: 1px solid var(--edge);
  border-radius: 12px;
  opacity: 0.6;
  font-size: 17px;
}
.icon-button.square:hover { opacity: 1; }

.minutes-row { display: flex; align-items: baseline; gap: 10px; }
.minutes-input {
  width: 120px;
  background: transparent;
  border: none;
  border-bottom: 1px solid color-mix(in srgb, currentColor 20%, transparent);
  color: inherit;
  font-size: 40px;
  font-weight: 200;
  letter-spacing: -0.03em;
  padding: 0 0 8px;
  outline: none;
  -moz-appearance: textfield;
}
.minutes-input::-webkit-outer-spin-button,
.minutes-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.minutes-unit { font-size: 15px; opacity: 0.4; }

/* Charts */

.charts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 48px;
}
.chart { display: flex; flex-direction: column; gap: 24px; }

.breakdown { display: flex; flex-direction: column; gap: 20px; }
.breakdown-row { display: flex; flex-direction: column; gap: 9px; }
.breakdown-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 14px;
}
.breakdown-label { letter-spacing: -0.01em; }
.breakdown-value { opacity: 0.45; }
.breakdown-track { height: 4px; border-radius: 4px; background: var(--track); }
.breakdown-fill {
  height: 4px;
  border-radius: 4px;
  background: var(--accent);
  transition: width 0.3s ease;
}

.week { display: flex; align-items: flex-end; gap: 10px; height: 140px; }
.week-day {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  height: 100%;
  justify-content: flex-end;
}
.week-value { font-size: 12px; opacity: 0.4; }
.week-bar {
  width: 100%;
  border-radius: 6px;
  min-height: 3px;
  background: var(--track);
  transition: height 0.3s ease;
}
.week-bar.has-data { background: var(--accent); }
.week-label { font-size: 12px; opacity: 0.45; }

/* Recent sessions */

.recent { display: flex; flex-direction: column; gap: 20px; }
.session-list { display: flex; flex-direction: column; }

.session {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 0;
  border-bottom: 1px solid var(--row-edge);
}
.session.pending { opacity: 0.5; }
.session-main { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.session-activity { font-size: 15px; letter-spacing: -0.01em; }
.session-when { font-size: 13px; opacity: 0.42; }
.session-side { display: flex; align-items: center; gap: 18px; }
.session-duration { font-size: 15px; opacity: 0.75; }

.empty { margin: 0; font-size: 15px; opacity: 0.4; }
.empty[hidden] { display: none; }

/* Passphrase gate */

.lock {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: var(--bg);
  z-index: 100;
}
.lock[hidden] { display: none; }
.lock-box {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
  max-width: 320px;
}
.lock-title { margin: 0; font-size: 17px; font-weight: 600; letter-spacing: -0.01em; }
.lock-input {
  height: 46px;
  padding: 0 14px;
  border: 1px solid var(--edge);
  border-radius: 12px;
  background: transparent;
  color: inherit;
  font-size: 15px;
  outline: none;
}
.lock-input:focus { border-color: var(--accent); }
.lock-error { margin: 0; font-size: 13px; color: var(--accent); }
.lock-error[hidden] { display: none; }
.lock-hint { margin: 0; font-size: 13px; opacity: 0.4; }
