:root {
  --bg: #16120c;
  --bg-2: #1e1912;
  --paper: #f3e6d0;
  --paper-2: #e8d5b5;
  --ink: #1c140c;
  --ink-soft: #5c4a38;
  --line: #d9c4a3;
  --accent: #e25b2a;
  --accent-2: #ffb25a;
  --gold: #e8b05a;
  --muted: #b5a28a;
  --ok: #2f7d4a;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
  --font-ui: "Inter Tight", "IBM Plex Sans", "Helvetica Neue", sans-serif;
  --font-serif: "Fraunces", "Newsreader", Georgia, serif;
  --pad-top: 20px;
  --pad-bottom: 24px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font-ui);
  background:
    radial-gradient(1200px 600px at 50% -10%, #2a2118 0%, var(--bg) 55%);
  color: var(--paper);
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
}

.app {
  width: min(460px, 100%);
  margin: 0 auto;
  padding: var(--pad-top) 20px calc(var(--pad-bottom) + 16px);
}

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: inherit;
  text-decoration: none;
}

.mark {
  width: 32px;
  height: 32px;
  display: block;
}

.wordmark {
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: 22px;
  letter-spacing: -0.03em;
}

.streak-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(226, 91, 42, 0.14);
  color: var(--accent-2);
  border: 1px solid rgba(226, 91, 42, 0.35);
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 13px;
  font-weight: 600;
}

.card {
  background: var(--paper);
  color: var(--ink);
  border-radius: 22px;
  padding: 22px 22px 18px;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}

.card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 6px;
  background: linear-gradient(90deg, var(--accent), var(--gold));
}

.meta {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 14px;
}

.nav-date {
  display: flex;
  align-items: center;
  gap: 4px;
}
.nav-date button {
  background: transparent;
  border: 0;
  color: var(--ink-soft);
  width: 28px;
  height: 28px;
  border-radius: 8px;
  font-size: 16px;
  cursor: pointer;
}
.nav-date button:hover { background: rgba(28, 20, 12, 0.06); }

.kicker {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 8px;
}

.prompt {
  font-family: var(--font-serif);
  font-size: 28px;
  line-height: 1.2;
  font-weight: 500;
  letter-spacing: -0.03em;
  margin: 0 0 18px;
}

.answer {
  width: 100%;
  border: 1px solid var(--line);
  background: #fffaf1;
  color: var(--ink);
  border-radius: 14px;
  padding: 14px;
  font-family: var(--font-ui);
  font-size: 16px;
  line-height: 1.45;
  resize: vertical;
  min-height: 120px;
  outline: none;
}
.answer:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(226, 91, 42, 0.15); }

.count {
  display: flex;
  justify-content: space-between;
  margin: 8px 0 14px;
  color: var(--ink-soft);
  font-size: 12px;
}

.actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

button, .btn {
  font-family: var(--font-ui);
  font-weight: 650;
  font-size: 15px;
  border-radius: 12px;
  border: 0;
  padding: 13px 14px;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
}

.btn-primary {
  background: var(--ink);
  color: var(--paper);
}
.btn-primary:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-secondary {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line);
}
.btn-ghost {
  background: transparent;
  color: var(--ink-soft);
}

.week {
  margin-top: 18px;
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
}

.day {
  aspect-ratio: 1;
  border-radius: 10px;
  background: var(--bg-2);
  border: 1px solid #2c261d;
  color: var(--muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  font-size: 10px;
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.day b { font-size: 13px; font-weight: 700; color: var(--paper); }
.day.done { background: rgba(226, 91, 42, 0.2); border-color: rgba(226, 91, 42, 0.5); color: var(--accent-2); }
.day.done b { color: var(--accent-2); }
.day.today { box-shadow: 0 0 0 2px var(--gold); }

.panel {
  margin-top: 16px;
  padding: 16px 4px 0;
}
.panel h2 {
  font-size: 13px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 10px;
  font-weight: 700;
}

.row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
  padding: 10px 0;
  border-top: 1px solid #2c261d;
  color: var(--paper);
  text-decoration: none;
  font-size: 14px;
}
.row span { color: var(--muted); font-size: 12px; white-space: nowrap; }

.banner, .status {
  margin: 14px 0 0;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.45;
}
.status.ok { color: #d4f0c8; }
.status.warn { color: var(--gold); }

.addbar {
  margin-top: 16px;
  background: #241c14;
  border: 1px solid #3a2f24;
  border-radius: 16px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.addbar p { margin: 0; font-size: 14px; color: var(--paper-2); }
.addbar .btn-primary { background: var(--accent); color: #fff; }

.footer {
  margin-top: 28px;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
  line-height: 1.5;
}
.footer a { color: var(--gold); text-decoration: none; }

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(24px + var(--pad-bottom));
  transform: translateX(-50%);
  background: var(--ink);
  color: var(--paper);
  padding: 10px 14px;
  border-radius: 999px;
  font-size: 13px;
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}
.toast.show { opacity: 1; }

@media (max-width: 400px) {
  .prompt { font-size: 24px; }
}
