*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #F7F5F0;
  --ink: #1A1814;
  --ink-muted: #8A8680;
  --rule: #DDD9D0;
  --card: #FFFFFF;
}

html { font-size: 16px; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: 'DM Mono', monospace;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}

header {
  width: 100%;
  max-width: 520px;
  padding: 2rem 2rem 0;
  animation: fadeUp 0.4s ease both;
}

.back-link {
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-muted);
  text-decoration: none;
  transition: color 0.2s;
}
.back-link:hover { color: var(--ink); }

main {
  width: 100%;
  max-width: 520px;
  padding: 1.5rem 2rem 3rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.page-hero { animation: fadeUp 0.4s ease both; }
.page-title {
  font-family: 'DM Serif Display', serif;
  font-size: 2.4rem;
  letter-spacing: -0.02em;
  line-height: 1;
}

/* ── AUTH CARD ── */
.auth-card {
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: 12px;
  padding: 1.25rem 1.5rem;
  animation: fadeUp 0.4s 0.05s ease both;
}

.auth-label {
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin-bottom: 0.85rem;
}

.auth-row {
  display: flex;
  gap: 0.5rem;
}

.auth-input {
  font-family: 'DM Mono', monospace;
  font-size: 0.8rem;
  flex: 1;
  border: 1px solid var(--rule);
  border-radius: 8px;
  padding: 0.65rem 0.75rem;
  background: var(--bg);
  color: var(--ink);
  outline: none;
  transition: border-color 0.2s;
}
.auth-input:focus { border-color: var(--ink-muted); }

.auth-btn {
  font-family: 'DM Mono', monospace;
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  white-space: nowrap;
  background: var(--ink);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 0.65rem 1rem;
  cursor: pointer;
  transition: opacity 0.2s;
}
.auth-btn:hover { opacity: 0.8; }

.auth-hint {
  font-size: 0.65rem;
  color: var(--ink-muted);
  margin-top: 0.6rem;
  min-height: 1em;
}

.auth-user {
  font-size: 0.8rem;
  color: var(--ink);
  margin-bottom: 0.5rem;
}

.auth-signout {
  font-family: 'DM Mono', monospace;
  font-size: 0.65rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: none;
  border: none;
  color: var(--ink-muted);
  cursor: pointer;
  padding: 0;
  transition: color 0.2s;
}
.auth-signout:hover { color: var(--ink); }

/* ── STREAK CARD ── */
.streak-card {
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: 14px;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  animation: fadeUp 0.4s 0.05s ease both;
}

.streak-number {
  font-family: 'DM Serif Display', serif;
  font-size: 4rem;
  letter-spacing: -0.04em;
  line-height: 1;
}

.streak-label {
  font-size: 0.65rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin-bottom: 0.75rem;
}

.week-dots {
  display: flex;
  gap: 0.75rem;
}

.week-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
}

.week-dot {
  width: 0.6rem;
  height: 0.6rem;
  border-radius: 50%;
  background: var(--rule);
}
.week-dot.filled { background: var(--ink); }

.week-day {
  font-size: 0.55rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

/* ── STATS ROW ── */
.stats-row {
  display: flex;
  align-items: center;
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: 12px;
  overflow: hidden;
  animation: fadeUp 0.4s 0.1s ease both;
}

.stat {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1rem 0.5rem;
  gap: 0.2rem;
}

.stat-val {
  font-family: 'DM Serif Display', serif;
  font-size: 1.6rem;
  letter-spacing: -0.03em;
}

.stat-label {
  font-size: 0.55rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

.stat-divider {
  width: 1px;
  height: 2.5rem;
  background: var(--rule);
  flex-shrink: 0;
}

/* ── HISTORY LIST ── */
.history-section {
  display: flex;
  flex-direction: column;
  gap: 0;
  animation: fadeUp 0.4s 0.15s ease both;
}

.history-date {
  font-size: 0.6rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-muted);
  padding: 0 0 0.5rem;
}

.history-row {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--rule);
}
.history-row:last-child { border-bottom: none; }

.history-dot {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  flex-shrink: 0;
}

.history-info {
  flex: 1;
  min-width: 0;
}

.history-name {
  font-size: 0.85rem;
  margin-bottom: 0.1rem;
}

.history-meta {
  font-size: 0.6rem;
  color: var(--ink-muted);
}

.history-duration {
  font-size: 0.75rem;
  color: var(--ink-muted);
  flex-shrink: 0;
}

/* ── EMPTY STATE ── */
.hidden { display: none !important; }

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.5rem;
  padding: 3rem 0;
  animation: fadeUp 0.4s ease both;
}

.empty-text {
  font-family: 'DM Serif Display', serif;
  font-size: 1.4rem;
  letter-spacing: -0.02em;
}

.empty-sub {
  font-size: 0.75rem;
  color: var(--ink-muted);
  margin-bottom: 0.5rem;
}

.start-link {
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid var(--ink);
  padding-bottom: 0.1rem;
  transition: opacity 0.2s;
}
.start-link:hover { opacity: 0.6; }

/* ── ANIMATIONS ── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}
