:root {
  --bg:     #feca71;
  --text:   #555352;
  --muted:  #ffffff;
  --yellow: #f2c76e;
  --rule:   rgba(26,26,24,0.12);
  --danger: #c0392b;
  --font:   'Inter', -apple-system, sans-serif;
}

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

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

.hidden { display: none !important; }

.label {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.1em;
  color: var(--muted);
  text-transform: uppercase;
}

.rule {
  width: 100%;
  height: 1px;
  background: var(--rule);
}

/* ── Auth ─────────────────────────────────────────────────────────────────── */

.auth-screen {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  max-width: 480px;
  margin: 0 auto;
}

.auth-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 52px 24px 20px;
}

.auth-toggle {
  display: flex;
  gap: 20px;
}

.toggle-btn {
  font-family: var(--font);
  font-size: 13px;
  font-weight: 500;
  border: none;
  background: none;
  color: var(--muted);
  cursor: pointer;
  padding: 0;
  letter-spacing: 0.01em;
}

.toggle-btn { color: var(--text); font-weight: 700; }

.auth-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 48px 24px 52px;
}

.auth-headline {
  font-size: clamp(40px, 12vw, 56px);
  font-weight: 900;
  line-height: 0.95;
  letter-spacing: -0.03em;
  color: var(--text);
}

.auth-subhead {
  margin-top: 14px;
  font-size: 15px;
  font-weight: 400;
  color: var(--text);
  opacity: 0.6;
  line-height: 1.4;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.auth-form input,
.sheet-body input {
  width: 100%;
  padding: 15px 0;
  border: none;
  border-bottom: 1px solid var(--rule);
  background: transparent;
  color: var(--text);
  font-size: 16px;
  font-family: var(--font);
  font-weight: 400;
  outline: none;
  border-radius: 0;
}

.auth-form input::placeholder,
.sheet-body input::placeholder { color: var(--muted); }

.auth-form input:focus,
.sheet-body input:focus { border-bottom-color: var(--text); }

.auth-error {
  font-size: 13px;
  color: var(--danger);
  font-weight: 500;
}

.btn-submit {
  width: 100%;
  margin-top: 8px;
  padding: 17px;
  border: none;
  background: var(--text);
  color: var(--bg);
  font-size: 15px;
  font-weight: 700;
  font-family: var(--font);
  letter-spacing: 0.01em;
  cursor: pointer;
  border-radius: 0;
}

.btn-submit:active { opacity: 0.85; }

/* ── App shell ────────────────────────────────────────────────────────────── */

#app {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 52px 24px 20px;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 20px;
}

.btn-add {
  font-size: 24px;
  font-weight: 300;
  border: none;
  background: none;
  color: var(--text);
  cursor: pointer;
  padding: 0;
  line-height: 1;
  font-family: var(--font);
}

.btn-text {
  font-family: var(--font);
  font-size: 13px;
  font-weight: 500;
  border: none;
  background: none;
  color: var(--muted);
  cursor: pointer;
  padding: 0;
  letter-spacing: 0.01em;
}

.app-title-row {
  padding: 32px 24px 36px;
}

.app-title {
  font-size: clamp(52px, 16vw, 80px);
  font-weight: 900;
  line-height: 0.9;
  letter-spacing: -0.04em;
  color: var(--text);
}

/* ── Streak list ──────────────────────────────────────────────────────────── */

.streak-list {
  flex: 1;
}

.streak-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  cursor: pointer;
  border-bottom: 1px solid var(--rule);
  transition: background 0.1s;
}

.streak-row:first-child { border-top: none; }
.streak-row:active { background: rgba(26,26,24,0.03); }

.streak-row-left { display: flex; flex-direction: column; gap: 3px; }

.streak-row-name {
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.01em;
}

.streak-row-sub {
  font-size: 12px;
  color: var(--muted);
  font-weight: 400;
}

.streak-row-right {
  display: flex;
  align-items: baseline;
  gap: 5px;
}

.streak-row-num {
  font-size: 32px;
  font-weight: 900;
  letter-spacing: -0.03em;
  color: var(--text);
  line-height: 1;
}

.streak-row-unit {
  font-size: 12px;
  color: var(--muted);
  font-weight: 400;
}

/* ── Empty state ──────────────────────────────────────────────────────────── */

.empty-state {
  padding: 48px 24px;
  font-size: 15px;
  color: var(--muted);
  line-height: 1.6;
}

/* ── Modals ───────────────────────────────────────────────────────────────── */

.modal {
  position: fixed;
  inset: 0;
  background: rgba(26,26,24,0.4);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  z-index: 100;
}

.sheet {
  background: var(--bg);
  width: 100%;
  max-width: 480px;
  max-height: 94vh;
  max-height: 94dvh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

#detailModal {
  align-items: center;
  justify-content: center;
}

#detailModal .sheet {
  max-width: 480px;
  max-height: 100%;
  height: 100%;
  border-radius: 0;
}

.sheet-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 28px 24px 20px;
}

.sheet-body {
  padding: 32px 24px 52px;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.sheet-body input { margin-bottom: 8px; }

/* ── Detail sheet ─────────────────────────────────────────────────────────── */

.detail-sheet { padding-bottom: 0; }

.detail-count-row {
  padding: 40px 24px 36px;
  display: flex;
  align-items: baseline;
  gap: 14px;
}

.detail-days {
  font-size: clamp(80px, 24vw, 120px);
  font-weight: 900;
  letter-spacing: -0.05em;
  line-height: 0.85;
  color: var(--text);
}

.detail-unit {
  font-size: 24px;
  font-weight: 300;
  color: var(--muted);
  letter-spacing: -0.01em;
}

.detail-quote-block {
  padding: 36px 24px 32px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.detail-quote {
  font-size: 19px;
  font-weight: 400;
  line-height: 1.45;
  color: var(--text);
  letter-spacing: -0.01em;
}

.detail-quote-author {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--muted);
}

.detail-since {
  padding: 20px 24px;
  font-size: 12px;
  color: var(--muted);
  font-weight: 400;
  letter-spacing: 0.01em;
}

.btn-end {
  display: block;
  width: 100%;
  padding: 20px 24px;
  border: none;
  border-top: 1px solid var(--rule);
  background: transparent;
  color: var(--danger);
  font-size: 14px;
  font-weight: 600;
  font-family: var(--font);
  cursor: pointer;
  text-align: left;
  letter-spacing: 0.01em;
}

.btn-end:active { background: rgba(192,57,43,0.04); }

.chat-bar {
  padding: 24px 24px 48px;
}

.btn-chat {
  display: block;
  text-align: center;
  text-decoration: none;
}
