:root {
  --ink: #173f35;
  --ink-deep: #0c2922;
  --paper: #f7f4ed;
  --card: #fffdf8;
  --line: #ddd8cc;
  --muted: #6e756f;
  --mint: #bce5d0;
  --lime: #d8ef87;
  --gold: #f1ba56;
  --red: #a94c43;
  --radius: 22px;
  font-family: Inter, ui-rounded, "SF Pro Rounded", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink-deep);
  background: var(--paper);
  font-synthesis: none;
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: var(--paper); }
button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }

.site-header {
  height: 66px; padding: env(safe-area-inset-top) max(20px, env(safe-area-inset-right)) 0 max(20px, env(safe-area-inset-left));
  display: flex; align-items: center; justify-content: space-between; max-width: 760px; margin: 0 auto;
}
.brand { display: flex; align-items: center; gap: 9px; font-weight: 800; text-decoration: none; letter-spacing: -.02em; }
.brand-mark { width: 31px; height: 31px; border-radius: 10px; display: grid; place-items: center; color: white; background: var(--ink); }
.text-button { border: 0; background: none; color: var(--muted); padding: 10px; cursor: pointer; font-weight: 700; }
.text-button.light { color: rgba(255,255,255,.78); margin-top: 8px; }
.text-button.full { width: 100%; }

.page-shell { max-width: 680px; margin: 0 auto; padding: 24px max(16px, env(safe-area-inset-right)) calc(42px + env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left)); }
.page-heading { display: flex; justify-content: space-between; align-items: end; margin: 14px 4px 25px; }
h1, h2, p { margin-top: 0; }
h1 { font-size: clamp(34px, 9vw, 48px); line-height: .98; letter-spacing: -.055em; margin-bottom: 10px; }
h2 { font-size: 24px; letter-spacing: -.035em; margin-bottom: 0; }
.page-heading p, .helper { color: var(--muted); margin-bottom: 0; }
.eyebrow { color: #648078; font-size: 11px; font-weight: 850; letter-spacing: .13em; text-transform: uppercase; margin-bottom: 7px; }
.eyebrow.light { color: rgba(255,255,255,.62); }

.week-nav { display: flex; gap: 8px; }
.week-nav a { width: 42px; height: 42px; display: grid; place-items: center; background: var(--card); border: 1px solid var(--line); border-radius: 14px; text-decoration: none; font-size: 20px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; margin-bottom: 14px; box-shadow: 0 8px 28px rgba(31,50,43,.045); }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.completion-ring { width: 54px; height: 54px; border-radius: 50%; background: conic-gradient(var(--ink) 0 var(--progress, 0%), #e8e5dc var(--progress, 0%)); display: grid; place-items: center; }
.completion-ring::before { content: ""; grid-area: 1/1; width: 42px; height: 42px; border-radius: 50%; background: var(--card); }
.completion-ring span { grid-area: 1/1; z-index: 1; font-size: 11px; font-weight: 800; }

.today-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.toggle-form { margin: 0; }
.task-pill { width: 100%; min-height: 48px; display: flex; align-items: center; gap: 9px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 15px; background: #f8f6f0; color: var(--ink-deep); font-weight: 750; cursor: pointer; text-align: left; }
.checkmark { width: 23px; height: 23px; display: grid; place-items: center; border: 1.5px solid #aaa; border-radius: 8px; color: transparent; }
.task-pill.done { background: #e5f3e9; border-color: #9acbaa; }
.task-pill.done .checkmark { color: white; border-color: var(--ink); background: var(--ink); }

.week-grid { min-width: 100%; }
.grid-header, .grid-row { display: grid; grid-template-columns: minmax(92px, 1.6fr) repeat(7, minmax(30px, 1fr)); align-items: center; gap: 4px; }
.grid-header { color: var(--muted); font-size: 11px; text-align: center; margin-bottom: 7px; }
.grid-row { min-height: 48px; border-top: 1px solid #ece8df; }
.task-label { font-size: 13px; font-weight: 750; }
.toggle-form.compact { display: flex; justify-content: center; }
.day-check { width: 30px; height: 30px; padding: 0; border-radius: 10px; border: 1px solid #d6d2c9; background: #faf8f3; color: transparent; cursor: pointer; font-weight: 900; }
.day-check.done { color: white; background: var(--ink); border-color: var(--ink); }
.day-check:disabled:not(.done) { opacity: .35; cursor: default; }
.helper { font-size: 12px; margin-top: 14px; }
.status-badge { padding: 6px 9px; border-radius: 99px; background: #eeeae2; color: var(--muted); font-size: 10px; font-weight: 850; letter-spacing: .08em; text-transform: uppercase; }
.status-badge.published { background: #fff0c9; color: #795715; }
.status-badge.paid { background: #dcf0e2; color: #275c37; }
.money-positive { color: #477155; white-space: nowrap; }

.wide-toggle { width: 100%; display: flex; align-items: center; gap: 12px; border: 1px solid var(--line); background: #f8f6f0; border-radius: 16px; padding: 14px; text-align: left; color: var(--ink-deep); cursor: pointer; }
.wide-toggle small { display: block; color: var(--muted); margin-top: 3px; }
.toggle-check { width: 30px; height: 30px; flex: none; display: grid; place-items: center; color: transparent; border: 1px solid #a9afa9; border-radius: 10px; }
.wide-toggle.done { background: #e5f3e9; border-color: #9acbaa; }
.wide-toggle.done .toggle-check { background: var(--ink); color: white; }
.result-line { display: flex; justify-content: space-between; }

.reading-list { border-top: 1px solid #ebe7dd; }
.reading-entry { display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 12px; padding: 13px 0; border-bottom: 1px solid #ebe7dd; }
.reading-entry small { display: block; color: var(--muted); margin-top: 3px; }
.reading-reward { font-weight: 850; }
.icon-button { width: 30px; height: 30px; border: 0; border-radius: 50%; background: #f1ede5; color: var(--muted); cursor: pointer; }
.empty-state { color: var(--muted); font-size: 14px; }
.reading-form { display: grid; gap: 9px; margin-top: 16px; }
input { width: 100%; min-height: 46px; border: 1px solid #cbc7bd; border-radius: 13px; background: white; padding: 10px 12px; color: var(--ink-deep); }
.field-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.secondary-button, .primary-button { min-height: 48px; border-radius: 14px; padding: 11px 16px; border: 0; font-weight: 850; cursor: pointer; }
.secondary-button { background: #e5ebe5; color: var(--ink); }
.primary-button { background: var(--ink); color: white; }
.primary-button.light { background: white; color: var(--ink-deep); }
.full { width: 100%; }

.reward-card { color: white; padding: 24px; margin: 18px 0; border-radius: 26px; background: var(--ink); box-shadow: 0 18px 40px rgba(12,41,34,.2); }
.reward-card.paid { background: #315447; }
.reward-total { display: flex; align-items: end; justify-content: space-between; margin: 6px 0 18px; }
.reward-total > span { color: rgba(255,255,255,.78); }
.reward-total strong { font-size: 42px; letter-spacing: -.05em; line-height: 1; }
.reward-breakdown { border-top: 1px solid rgba(255,255,255,.2); border-bottom: 1px solid rgba(255,255,255,.2); padding: 10px 0; margin-bottom: 18px; }
.reward-breakdown div { display: flex; justify-content: space-between; padding: 5px 0; font-size: 13px; }
.publish-form label { color: rgba(255,255,255,.7); font-size: 12px; font-weight: 750; }
.money-input { display: flex; align-items: center; margin: 6px 0 12px; background: rgba(255,255,255,.12); border-radius: 14px; padding-left: 13px; color: white; }
.money-input input { color: white; background: transparent; border: 0; font-weight: 850; }
.paid-stamp { text-align: center; padding: 12px; background: rgba(255,255,255,.1); border-radius: 14px; font-weight: 800; }

.history-section { margin: 32px 2px 20px; }
.history-list { display: grid; gap: 8px; }
.history-list a { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; padding: 15px; background: var(--card); border: 1px solid var(--line); border-radius: 16px; text-decoration: none; }
.history-list small { color: var(--muted); grid-column: 1 / -1; }
.account-links { display: flex; justify-content: center; flex-wrap: wrap; gap: 16px; margin-top: 30px; font-size: 12px; color: var(--muted); }

.login-card, .form-card { max-width: 440px; margin: 8vh auto 0; background: var(--card); border: 1px solid var(--line); border-radius: 28px; padding: clamp(24px, 7vw, 38px); box-shadow: 0 20px 60px rgba(31,50,43,.09); }
.login-card p { color: var(--muted); line-height: 1.5; }
.stacked-form { display: grid; gap: 14px; margin-top: 25px; }
.stacked-form label, .stacked-form p { display: grid; gap: 6px; margin: 0; color: var(--muted); font-size: 13px; font-weight: 750; }
.stacked-form ul { color: var(--muted); font-size: 12px; padding-left: 18px; }
.form-error, .errorlist { color: var(--red); font-size: 13px; }
.messages { display: grid; gap: 8px; margin-bottom: 14px; }
.message { padding: 12px 14px; border-radius: 13px; background: #e3eee5; }
.message.error { background: #f6e1df; color: #7d3029; }

.hero-erin { margin: 12px 0 18px; padding: 32px 26px; border-radius: 28px; color: white; background: linear-gradient(140deg, #173f35, #356d58); position: relative; overflow: hidden; }
.hero-erin::after { content: "★"; position: absolute; right: -4px; top: -32px; color: rgba(216,239,135,.22); font-size: 150px; transform: rotate(12deg); }
.hero-erin p { margin-bottom: 0; color: rgba(255,255,255,.74); }
.erin-progress-list { border-top: 1px solid #ebe7dd; }
.erin-progress-list > div { display: flex; justify-content: space-between; align-items: center; padding: 12px 0; border-bottom: 1px solid #ebe7dd; font-weight: 750; }
.mini-week { display: flex; gap: 4px; }
.mini-week i { width: 9px; height: 9px; border-radius: 50%; background: #dedad1; }
.mini-week i.done { background: var(--ink); }
.xp-status { margin-top: 14px; padding: 11px 13px; border-radius: 13px; background: #efede7; color: var(--muted); font-weight: 750; }
.xp-status span { display: inline-grid; place-items: center; width: 22px; height: 22px; margin-right: 6px; border-radius: 7px; background: #d8d4cb; color: white; }
.xp-status.done { background: #e1f0e5; color: #275c37; }
.xp-status.done span { background: #3c7550; }
.erin-rewards { display: grid; gap: 11px; }
.erin-reward-card { background: var(--card); border: 1px solid var(--line); border-radius: 20px; padding: 18px; }
.erin-reward-card > div:first-child { display: flex; justify-content: space-between; align-items: end; }
.erin-reward-card > div:first-child strong { font-size: 30px; letter-spacing: -.04em; }
.reward-mini-breakdown { display: flex; flex-wrap: wrap; gap: 5px 12px; color: var(--muted); font-size: 11px; margin: 12px 0; }
.payment-state { width: fit-content; padding: 6px 9px; border-radius: 9px; background: #fff0c9; color: #795715; font-size: 11px; font-weight: 850; }
.payment-state.paid { background: #dcf0e2; color: #275c37; }
.empty-reward { text-align: center; padding: 38px 24px; }
.big-star { font-size: 42px; color: var(--gold); margin-bottom: 10px; }

@media (max-width: 430px) {
  .site-header { height: 60px; }
  .page-shell { padding-top: 14px; }
  .card { padding: 17px 15px; }
  .today-actions { grid-template-columns: 1fr 1fr; }
  .grid-header, .grid-row { grid-template-columns: 84px repeat(7, minmax(27px, 1fr)); gap: 2px; }
  .day-check { width: 27px; height: 29px; border-radius: 9px; }
  .task-label { font-size: 12px; }
}
