:root {
  --midnight: #262d4a;
  --blush: #c4a8c8;
  --lavender: #b8a9d9;
  --rose: #d4a5b5;
  --bg: #f9f8fc;
  --ink: #262d4a;
  --muted: #6c7088;
  --faint: #9ea2b6;
  --line: #ece9f3;
  --card: #ffffff;
  --shadow: 0 10px 40px rgba(38, 45, 74, 0.08);
  --shadow-sm: 0 4px 18px rgba(38, 45, 74, 0.06);
  --radius: 22px;
  --radius-sm: 14px;
  --serif: "Cormorant Garamond", Georgia, serif;
  --sans: "Jost", system-ui, -apple-system, Helvetica, Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--sans);
  color: var(--ink);
  background: var(--bg);
  background-image: radial-gradient(1200px 600px at 80% -10%, rgba(184, 169, 217, 0.18), transparent),
    radial-gradient(1000px 500px at -10% 10%, rgba(212, 165, 181, 0.14), transparent);
  min-height: 100vh;
  font-weight: 400;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3 {
  font-family: var(--serif);
  font-weight: 600;
  color: var(--midnight);
  line-height: 1.15;
  margin: 0;
}

a {
  color: var(--midnight);
}

button {
  font-family: var(--sans);
  cursor: pointer;
  border: none;
  background: none;
}

svg {
  display: block;
}

/* ── boot / loading ── */
.boot {
  min-height: 100vh;
  display: grid;
  place-items: center;
}
.boot-mark {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 3px solid var(--line);
  border-top-color: var(--lavender);
  animation: spin 0.9s linear infinite;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ── layout shell ── */
.shell {
  max-width: 1040px;
  margin: 0 auto;
  padding: 0 22px 80px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 22px 0 8px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}
.brand-logo {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: linear-gradient(135deg, var(--lavender), var(--rose));
  display: grid;
  place-items: center;
  color: #fff;
  box-shadow: var(--shadow-sm);
}
.brand-name {
  font-family: var(--serif);
  font-size: 21px;
  font-weight: 600;
  letter-spacing: 0.2px;
}
.brand-name small {
  display: block;
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  color: var(--faint);
  font-weight: 500;
}
.topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
}
.who {
  font-size: 13px;
  color: var(--muted);
}

/* ── buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 13px 22px;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 500;
  background: var(--midnight);
  color: #fff;
  transition: transform 0.12s ease, box-shadow 0.2s ease, opacity 0.2s ease;
  box-shadow: var(--shadow-sm);
}
.btn:hover {
  transform: translateY(-1px);
}
.btn:disabled {
  opacity: 0.55;
  cursor: default;
  transform: none;
}
.btn.ghost {
  background: transparent;
  color: var(--midnight);
  box-shadow: none;
  border: 1.5px solid var(--line);
}
.btn.ghost:hover {
  border-color: var(--lavender);
}
.btn.soft {
  background: #fff;
  color: var(--midnight);
  box-shadow: var(--shadow-sm);
}
.btn.small {
  padding: 9px 16px;
  font-size: 13.5px;
}
.btn.block {
  width: 100%;
  justify-content: center;
}

/* ── cards & inputs ── */
.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 30px;
}

label.field {
  display: block;
  margin-bottom: 16px;
}
.field span {
  display: block;
  font-size: 14px;
  color: var(--muted);
  margin-bottom: 7px;
}
input[type="text"],
input[type="email"],
input[type="number"],
textarea,
select {
  width: 100%;
  padding: 13px 15px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--line);
  background: #fdfcff;
  font-family: var(--sans);
  font-size: 15.5px;
  color: var(--ink);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--lavender);
  box-shadow: 0 0 0 4px rgba(184, 169, 217, 0.18);
}
::placeholder {
  color: #c2c5d4;
}

/* ── landing / auth ── */
.hero {
  text-align: center;
  max-width: 620px;
  margin: 56px auto 30px;
}
.eyebrow {
  font-size: 12px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--rose);
  font-weight: 600;
  margin-bottom: 16px;
}
.hero h1 {
  font-size: clamp(38px, 7vw, 60px);
  letter-spacing: -0.5px;
}
.hero h1 em {
  font-style: italic;
  color: var(--lavender);
}
.hero p {
  font-size: 18px;
  color: var(--muted);
  margin: 20px auto 0;
  max-width: 500px;
}
.auth-card {
  max-width: 440px;
  margin: 6px auto 0;
}
.auth-card form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.divider {
  text-align: center;
  font-size: 13px;
  color: var(--faint);
  margin: 18px 0 6px;
}
.note {
  font-size: 13px;
  color: var(--muted);
  text-align: center;
}
.alert {
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  font-size: 14px;
  margin-bottom: 4px;
}
.alert.err {
  background: #fdeef1;
  color: #a4566b;
}
.alert.ok {
  background: #eef3ee;
  color: #4e6b54;
}
.alert.info {
  background: #f1eef8;
  color: #5a4e7a;
}

.feature-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  max-width: 760px;
  margin: 40px auto 0;
}
.feature {
  text-align: center;
  padding: 6px;
}
.feature .ic {
  width: 40px;
  height: 40px;
  margin: 0 auto 10px;
  color: var(--lavender);
}
.feature h3 {
  font-size: 19px;
  margin-bottom: 4px;
}
.feature p {
  font-size: 14px;
  color: var(--muted);
  margin: 0;
}

/* ── section headers ── */
.section-head {
  margin: 36px 0 18px;
}
.section-head h2 {
  font-size: 30px;
}
.section-head p {
  color: var(--muted);
  margin: 6px 0 0;
  font-size: 15px;
}

/* ── area grid ── */
.area-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}
.area-tile {
  text-align: left;
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  border: 1.5px solid transparent;
  transition: transform 0.14s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.area-tile:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
  border-color: var(--line);
}
.area-ic {
  width: 50px;
  height: 50px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  color: #fff;
}
.area-tile h3 {
  font-size: 23px;
}
.area-tile p {
  margin: 0;
  font-size: 14px;
  color: var(--muted);
}
.area-tile .go {
  margin-top: auto;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--lavender);
  display: flex;
  align-items: center;
  gap: 6px;
}

/* tile accent colors */
.c-thisweek {
  background: linear-gradient(135deg, #b8a9d9, #9f8fcb);
}
.c-kids {
  background: linear-gradient(135deg, #d4a5b5, #c98aa0);
}
.c-household {
  background: linear-gradient(135deg, #c4a8c8, #a98fb0);
}
.c-work {
  background: linear-gradient(135deg, #8f9bc4, #6f7ca8);
}
.c-you {
  background: linear-gradient(135deg, #d8b6c4, #c79bae);
}

/* ── madlib flow ── */
.flow {
  max-width: 680px;
  margin: 0 auto;
}
.flow-head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 6px;
}
.flow-head .area-ic {
  width: 44px;
  height: 44px;
  border-radius: 12px;
}
.crumb {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13.5px;
  color: var(--muted);
  margin-bottom: 18px;
  padding: 6px 4px;
}
.crumb:hover {
  color: var(--midnight);
}
.madlib .field span {
  font-size: 15px;
  color: var(--ink);
  font-weight: 400;
}
.madlib .field span b {
  font-weight: 600;
}
.flow-actions {
  display: flex;
  gap: 12px;
  margin-top: 8px;
}
.progresshint {
  font-size: 13px;
  color: var(--faint);
  margin: 2px 0 18px;
}

/* ── output ── */
.output {
  max-width: 720px;
  margin: 0 auto;
}
.output-body {
  font-size: 16px;
  line-height: 1.7;
  color: #3a3f57;
}
.output-body h3 {
  font-size: 22px;
  margin: 26px 0 8px;
  color: var(--midnight);
}
.output-body h3:first-child {
  margin-top: 4px;
}
.output-body h4 {
  font-family: var(--serif);
  font-size: 19px;
  margin: 18px 0 6px;
}
.output-body p {
  margin: 0 0 12px;
}
.output-body ul {
  margin: 0 0 14px;
  padding-left: 4px;
  list-style: none;
}
.output-body li {
  position: relative;
  padding-left: 26px;
  margin-bottom: 9px;
}
.output-body li::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 10px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--lavender), var(--rose));
}
.output-body strong {
  color: var(--midnight);
  font-weight: 600;
}
.cursor::after {
  content: "▍";
  color: var(--lavender);
  animation: blink 1s steps(2) infinite;
}
@keyframes blink {
  50% {
    opacity: 0;
  }
}

.save-prompt {
  margin-top: 22px;
  border: 1.5px dashed var(--blush);
  background: #fbf7fb;
  border-radius: var(--radius);
  padding: 22px;
}
.save-prompt h3 {
  font-size: 21px;
  margin-bottom: 6px;
}
.save-prompt p {
  color: var(--muted);
  font-size: 14.5px;
  margin: 0 0 14px;
}
.save-prompt form {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.save-prompt input {
  flex: 1;
  min-width: 200px;
}

/* ── board ── */
.board-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}
.board-card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  cursor: pointer;
  border: 1.5px solid transparent;
  transition: transform 0.14s ease, box-shadow 0.2s ease, border-color 0.2s;
}
.board-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
  border-color: var(--line);
}
.board-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.pill {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.3px;
  padding: 5px 11px;
  border-radius: 999px;
  background: #f2eef8;
  color: #6a5b8c;
}
.board-date {
  font-size: 12.5px;
  color: var(--faint);
}
.board-actions {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.board-actions li {
  position: relative;
  padding-left: 22px;
  font-size: 14px;
  color: #4a4f67;
}
.board-actions li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 7px;
  width: 7px;
  height: 7px;
  border-radius: 2px;
  background: var(--rose);
}
.empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--muted);
}
.empty .ic {
  width: 54px;
  height: 54px;
  margin: 0 auto 16px;
  color: var(--blush);
}
.empty h3 {
  font-size: 24px;
  margin-bottom: 6px;
}

/* ── modal ── */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(38, 45, 74, 0.4);
  backdrop-filter: blur(3px);
  display: grid;
  place-items: center;
  padding: 22px;
  z-index: 50;
}
.modal {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: 0 20px 60px rgba(38, 45, 74, 0.25);
  max-width: 640px;
  width: 100%;
  max-height: 86vh;
  overflow: auto;
  padding: 30px;
}
.modal-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.modal-close {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--bg);
  display: grid;
  place-items: center;
  color: var(--muted);
}
.modal-close:hover {
  background: var(--line);
}
.narrative-quote {
  border-left: 3px solid var(--lavender);
  padding: 4px 0 4px 14px;
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 14px;
  font-style: italic;
}

/* ── toast ── */
.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%) translateY(20px);
  background: var(--midnight);
  color: #fff;
  padding: 13px 20px;
  border-radius: 999px;
  font-size: 14px;
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
  z-index: 80;
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* spinner inline */
.spin {
  width: 17px;
  height: 17px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-top-color: #fff;
  animation: spin 0.8s linear infinite;
}

.footer {
  text-align: center;
  margin-top: 60px;
  font-size: 12.5px;
  color: var(--faint);
}

@media (max-width: 640px) {
  .feature-row {
    grid-template-columns: 1fr;
  }
  .card {
    padding: 22px;
  }
  .topbar {
    flex-wrap: wrap;
  }
  .who {
    display: none;
  }
}
