/* BACK ON TRACK — warm rose background, glass cards, gold hairlines, black text. */

:root {
  --ink: #111111;
  --ink-soft: #4a3a40;
  --rose: #b0456a;
  --rose-deep: #7e2a4a;
  --gold: #c9a461;
  --gold-soft: rgba(201, 164, 97, 0.55);
  --glass: rgba(255, 255, 255, 0.34);
  --glass-strong: rgba(255, 255, 255, 0.6);
  --danger: #8a1c1c;
  --focus: #7e2a4a;
  --radius: 22px;
  --font-ui: "Heebo", "Arial Hebrew", "Helvetica Neue", Arial, sans-serif;
  --font-display: "Frank Ruhl Libre", "David", Georgia, serif;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-ui);
  font-size: 16px;
  line-height: 1.5;
  color: var(--ink);
  background-color: #f2d6d3;
  background-image:
    radial-gradient(60% 40% at 85% 8%, rgba(255, 214, 226, 0.9), transparent 70%),
    radial-gradient(50% 35% at 10% 40%, rgba(255, 236, 228, 0.7), transparent 70%),
    linear-gradient(170deg, #f6d8d6 0%, #e7a6b3 52%, #f1c9bb 100%);
  background-attachment: fixed;
  padding-bottom: calc(96px + env(safe-area-inset-bottom));
}

button, input, select { font: inherit; color: inherit; }

:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0);
  white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute;
  inset-inline-start: 12px;
  top: -60px;
  background: var(--ink);
  color: #fff;
  padding: 8px 12px;
  border-radius: 10px;
  z-index: 10;
}
.skip-link:focus { top: 12px; }

/* ----- top bar ----- */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px 6px;
  flex-wrap: wrap;
}

.brand { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; min-width: 0; }

.brand-name {
  font-size: 12px;
  letter-spacing: 0.22em;
  font-weight: 500;
  color: var(--ink-soft);
}

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

.pill {
  font-size: 12px;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--glass-strong);
  border: 1px solid var(--gold-soft);
  color: var(--ink-soft);
}

.ghost-btn {
  background: var(--glass);
  border: 1px solid var(--gold-soft);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 13px;
  cursor: pointer;
  min-height: 36px;
}
.ghost-btn:disabled { opacity: 0.55; cursor: not-allowed; }

/* ----- page layout ----- */

.page {
  max-width: 640px;
  margin: 0 auto;
  padding: 8px 16px 24px;
  display: grid;
  gap: 16px;
}

.hero { padding: 12px 4px 0; }

.greeting {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(40px, 11vw, 60px);
  line-height: 1.05;
  margin: 0;
}

.tagline {
  margin: 6px 0 4px;
  font-size: 18px;
  color: var(--ink-soft);
}

.today-label {
  margin: 0;
  font-size: 13px;
  letter-spacing: 0.08em;
  color: var(--rose-deep);
}

.card {
  background: var(--glass);
  border: 1px solid var(--gold-soft);
  border-radius: var(--radius);
  padding: 18px 18px 16px;
  box-shadow: 0 10px 30px rgba(126, 42, 74, 0.12);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
}

.card-title {
  margin: 0 0 10px;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.sub-title {
  margin: 4px 0 2px;
  font-size: 14px;
  font-weight: 700;
  color: var(--rose-deep);
}

.hint {
  margin: 2px 0 8px;
  font-size: 13px;
  color: var(--ink-soft);
}

.empty {
  margin: 6px 0 10px;
  color: var(--ink-soft);
  font-size: 15px;
  list-style: none;
}

.notice {
  margin: 0;
  padding: 10px 14px;
  border-radius: 14px;
  background: var(--glass-strong);
  border: 1px solid var(--danger);
  color: var(--danger);
}

.save-status {
  min-height: 1.5em;
  margin: 0;
  text-align: center;
  font-size: 13px;
  color: var(--rose-deep);
}

/* ----- intention ----- */

.intention-input {
  width: 100%;
  border: 0;
  border-bottom: 1px solid var(--gold);
  background: transparent;
  font-family: var(--font-display);
  font-size: clamp(18px, 5.5vw, 24px);
  padding: 6px 0;
  border-radius: 0;
}
.intention-input::placeholder { color: rgba(17, 17, 17, 0.45); }

/* ----- lists ----- */

.item-list { list-style: none; margin: 0; padding: 0; }

.item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(201, 164, 97, 0.35);
}
.item:last-child { border-bottom: 0; }

.item.is-done .item-title { text-decoration: line-through; opacity: 0.6; }

.check {
  width: 22px;
  height: 22px;
  accent-color: var(--rose);
  margin: 0;
  cursor: pointer;
}

.item-main { display: flex; flex-direction: column; min-width: 0; cursor: pointer; }
.item-title { overflow-wrap: anywhere; }

.meta { font-size: 12px; color: var(--ink-soft); }

.badge {
  align-self: flex-start;
  font-size: 11px;
  padding: 1px 8px;
  border-radius: 999px;
  border: 1px solid var(--gold);
  color: var(--rose-deep);
  margin-bottom: 2px;
}

.row-actions { display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }

.text-btn {
  background: none;
  border: 0;
  padding: 6px 8px;
  min-height: 36px;
  font-size: 13px;
  color: var(--rose-deep);
  cursor: pointer;
  border-radius: 10px;
}
.text-btn:hover { background: rgba(255, 255, 255, 0.5); }

.overdue { grid-template-columns: 1fr; }
.overdue .row-actions { justify-content: flex-start; }

.rename-input {
  width: 100%;
  padding: 6px 8px;
  border-radius: 10px;
  border: 1px solid var(--gold);
  background: var(--glass-strong);
}

/* ----- forms ----- */

.inline-form {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.inline-form input,
.stack-form input,
.stack-form select {
  flex: 1;
  min-width: 0;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid var(--gold-soft);
  background: var(--glass-strong);
}

.primary-btn {
  background: linear-gradient(180deg, #bf5a7d, var(--rose));
  color: #fff;
  border: 1px solid var(--gold);
  border-radius: 14px;
  padding: 10px 16px;
  min-height: 44px;
  cursor: pointer;
  white-space: nowrap;
}

.habit-add { margin-top: 12px; }
.habit-add summary {
  cursor: pointer;
  color: var(--rose-deep);
  font-weight: 500;
  padding: 6px 0;
  min-height: 36px;
}

.stack-form {
  display: grid;
  gap: 8px;
  margin-top: 8px;
}
.stack-form label { font-size: 13px; color: var(--ink-soft); }

.weekday-fieldset {
  border: 0;
  padding: 0;
  margin: 4px 0 0;
}
.weekday-fieldset legend { font-size: 13px; color: var(--ink-soft); padding: 0; margin-bottom: 6px; }

.weekday-picker { display: flex; gap: 6px; flex-wrap: wrap; }

.day-chip {
  min-width: 44px;
  min-height: 44px;
  border-radius: 999px;
  border: 1px solid var(--gold);
  background: var(--glass-strong);
  cursor: pointer;
}
.day-chip[aria-pressed="true"] {
  background: var(--rose);
  color: #fff;
  border-color: var(--rose-deep);
}

.form-error { margin: 0; color: var(--danger); font-size: 14px; }

/* ----- bottom navigation ----- */

.bottom-nav {
  position: fixed;
  inset-inline: 0;
  bottom: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
  background: rgba(255, 255, 255, 0.55);
  border-top: 1px solid var(--gold-soft);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  z-index: 5;
}

.nav-item {
  background: none;
  border: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  min-height: 52px;
  font-size: 12px;
  color: var(--ink-soft);
  cursor: pointer;
}
.nav-item:disabled { opacity: 0.45; cursor: not-allowed; }
.nav-item.is-active { color: var(--rose-deep); font-weight: 700; }
.nav-icon { font-size: 18px; line-height: 1; }

/* ----- small screens and reduced motion ----- */

@media (max-width: 380px) {
  .inline-form { flex-direction: column; }
  .primary-btn { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
