/* Palette lifted from the photo: espresso browns, golden-hour skin,
   sage-olive trees, and the soft blue of the sky behind them. */

:root {
  --cream: #f4e6d6;
  --cream-soft: rgba(244, 230, 214, 0.74);
  --cream-faint: rgba(244, 230, 214, 0.5);

  --terracotta: #c18c76;   /* her cheek in the low sun */
  --terracotta-deep: #9d7059;
  --brass: #d0a074;        /* the buttons on his shirt */

  --espresso: #2b2626;     /* what they're both wearing */
  --espresso-deep: #1a1516;
  --bark: #402f2a;
  --sage: #3e4335;         /* the trees */
  --olive: #21231c;
  --sky: #88a9c7;

  --glass: rgba(43, 34, 31, 0.56);
  --glass-line: rgba(244, 230, 214, 0.15);
  --radius: 18px;
  --shadow: 0 18px 48px rgba(15, 10, 9, 0.45);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  overflow-x: hidden;
}

body {
  font-family: ui-sans-serif, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--cream);
  background: var(--espresso-deep);
  -webkit-font-smoothing: antialiased;
}

/* ---------------------------------------------------------- background */

.backdrop,
.scrim {
  position: fixed;
  inset: 0;
  z-index: -1;
}

/* Default stand-in follows the photo top to bottom: sky, then trees, then them. */
.backdrop {
  background-image: linear-gradient(
    168deg,
    #88a9c7 0%,
    #7d9587 20%,
    #4f5843 40%,
    #3e4335 55%,
    #402f2a 78%,
    #21201c 100%
  );
  background-size: cover;
  background-position: center 30%;
  /* A photo cropped to fill a wide screen becomes a distracting close-up, so it
     is softened into a wash of its own colours. The sharp copy lives in the frame. */
  transform: scale(1.14);
  filter: blur(14px) saturate(1.14) brightness(0.92);
}

/* No blur on the plain gradient — there is nothing to soften. */
.backdrop.no-photo { filter: saturate(1.04); transform: scale(1.05); }

/* Warm, not black — keeps the golden tones alive under the text. */
.scrim {
  background:
    radial-gradient(125% 80% at 50% 0%, rgba(38, 28, 24, 0.06) 0%, rgba(26, 20, 18, 0.68) 74%),
    linear-gradient(to bottom, rgba(30, 22, 19, 0.3), rgba(20, 15, 14, 0.84));
}

/* ---------------------------------------------------------- lock screen */

.lock {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.lock-card {
  width: 100%;
  max-width: 340px;
  text-align: center;
}

.lock-card h1 { font-size: 2.6rem; margin-bottom: 4px; }
.lock-card .hint { margin-bottom: 18px; }
.lock-card input { text-align: center; letter-spacing: 0.1em; }

.lock-error {
  margin: 12px 0 0;
  font-size: 0.85rem;
  color: #ffbfa8;
}

.page.hidden { display: none; }

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

.page {
  max-width: 780px;
  margin: 0 auto;
  padding: 48px 20px 64px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.masthead {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 8px 4px 12px;
}

h1 {
  font-family: Georgia, "Iowan Old Style", "Times New Roman", serif;
  font-size: clamp(2.6rem, 9vw, 4rem);
  font-weight: 400;
  letter-spacing: 0.03em;
  margin: 0;
  line-height: 1;
  color: #fbf0e2;
  text-shadow: 0 3px 26px rgba(26, 18, 14, 0.6);
}

.subtitle {
  margin: 8px 0 0;
  font-size: 0.95rem;
  letter-spacing: 0.14em;
  text-transform: lowercase;
  color: var(--cream-soft);
}

/* A little framed print of the two of them, propped beside the title. */

.frame {
  position: relative;
  flex-shrink: 0;
  width: 96px;
  height: 122px;
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  background: rgba(244, 230, 214, 0.07);
  border: 3px solid rgba(244, 230, 214, 0.86);
  box-shadow: 0 10px 26px rgba(15, 10, 9, 0.5);
  transform: rotate(2.5deg);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.frame:hover {
  transform: rotate(0deg) scale(1.03);
  box-shadow: 0 14px 32px rgba(15, 10, 9, 0.58);
}

.frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 22%;
  display: block;
}

/* display:block above beats the browser's own rule for [hidden], so without
   this an empty frame renders a broken-image icon. */
.frame img[hidden] { display: none; }

.frame-empty {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-size: 0.72rem;
  line-height: 1.35;
  letter-spacing: 0.05em;
  color: var(--cream-faint);
}

.frame-empty.hidden { display: none; }

.frame-hint {
  position: absolute;
  inset: auto 0 0 0;
  padding: 5px 0 6px;
  text-align: center;
  font-size: 0.66rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #fff3e6;
  background: linear-gradient(to top, rgba(26, 18, 15, 0.86), rgba(26, 18, 15, 0));
  opacity: 0;
  transition: opacity 0.2s ease;
}

.frame:hover .frame-hint { opacity: 1; }

/* ---------------------------------------------------------- cards */

.card {
  background: var(--glass);
  backdrop-filter: blur(20px) saturate(1.25);
  -webkit-backdrop-filter: blur(20px) saturate(1.25);
  border: 1px solid var(--glass-line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px;
  min-width: 0;
}

h2 {
  margin: 0;
  font-family: Georgia, "Iowan Old Style", serif;
  font-weight: 400;
  font-size: 1.35rem;
  letter-spacing: 0.01em;
  color: #fbeedf;
}

.hint {
  margin: 6px 0 16px;
  font-size: 0.88rem;
  color: var(--cream-faint);
  line-height: 1.5;
}

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

textarea, input[type="text"], input[type="datetime-local"], select {
  width: 100%;
  max-width: 100%;
  font: inherit;
  font-size: 0.98rem;
  color: var(--cream);
  background: rgba(26, 21, 22, 0.5);
  border: 1px solid var(--glass-line);
  border-radius: 12px;
  padding: 12px 14px;
  resize: vertical;
  transition: border-color 0.16s ease, background 0.16s ease;
}

textarea::placeholder, input::placeholder { color: rgba(244, 230, 214, 0.35); }

/* Chrome paints autofilled fields white, which wrecks the dark theme.
   There's no background-color override for it — an inset shadow is the trick. */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--cream);
  -webkit-box-shadow: 0 0 0 1000px #211a1b inset;
  caret-color: var(--cream);
  transition: background-color 9999s ease-in-out 0s;
}

textarea:focus, input:focus, select:focus {
  outline: none;
  border-color: var(--terracotta);
  background: rgba(26, 21, 22, 0.68);
}

select { appearance: none; cursor: pointer; }
select option { background: #2b2626; color: var(--cream); }

/* Mic button lives inside the idea box, out of the way of the text. */

.speak-wrap { position: relative; }
.speak-wrap textarea { padding-right: 54px; }

.mic {
  position: absolute;
  right: 9px;
  bottom: 9px;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 1px solid var(--glass-line);
  background: rgba(244, 230, 214, 0.08);
  color: var(--cream-soft);
  cursor: pointer;
  transition: background 0.16s ease, color 0.16s ease, border-color 0.16s ease;
}

.mic:hover { background: rgba(244, 230, 214, 0.16); color: var(--cream); }

.mic.listening {
  background: var(--terracotta);
  border-color: transparent;
  color: #2a1a12;
  animation: mic-pulse 1.6s ease infinite;
}

@keyframes mic-pulse {
  0% { box-shadow: 0 0 0 0 rgba(193, 140, 118, 0.45); }
  70% { box-shadow: 0 0 0 12px rgba(193, 140, 118, 0); }
  100% { box-shadow: 0 0 0 0 rgba(193, 140, 118, 0); }
}

.field-row {
  display: flex;
  gap: 12px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.field {
  flex: 1 1 220px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field > span {
  font-size: 0.78rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--cream-faint);
}

button.primary {
  margin-top: 12px;
  width: 100%;
  font: inherit;
  font-weight: 600;
  font-size: 0.96rem;
  letter-spacing: 0.02em;
  color: #2a1a12;
  background: linear-gradient(135deg, var(--brass), var(--terracotta-deep));
  border: none;
  border-radius: 12px;
  padding: 13px 18px;
  cursor: pointer;
  transition: filter 0.16s ease, transform 0.12s ease;
}

button.primary:hover:not(:disabled) { filter: brightness(1.09); }
button.primary:active:not(:disabled) { transform: translateY(1px); }
button.primary:disabled { opacity: 0.55; cursor: progress; }

/* ---------------------------------------------------------- banner */

.banner {
  border-radius: 12px;
  padding: 12px 16px;
  font-size: 0.9rem;
  line-height: 1.5;
  border: 1px solid rgba(208, 160, 116, 0.42);
  background: rgba(157, 112, 89, 0.24);
  color: #ffe8d2;
}

.banner.error {
  border-color: rgba(198, 116, 100, 0.5);
  background: rgba(120, 52, 40, 0.34);
  color: #ffdccd;
}

.hidden { display: none; }

/* ---------------------------------------------------------- list */

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

.toggle {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 0.82rem;
  color: var(--cream-faint);
  cursor: pointer;
  white-space: nowrap;
}

.toggle input { accent-color: var(--terracotta); cursor: pointer; }

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

.item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 13px 14px;
  border-radius: 13px;
  background: rgba(244, 230, 214, 0.055);
  border: 1px solid rgba(244, 230, 214, 0.1);
  min-width: 0;
}

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

.item input[type="checkbox"] {
  margin-top: 3px;
  width: 17px;
  height: 17px;
  flex-shrink: 0;
  accent-color: var(--terracotta);
  cursor: pointer;
}

.item-body { flex: 1; min-width: 0; }

.item-title {
  font-size: 1rem;
  line-height: 1.35;
  word-break: break-word;
}

.item-notes {
  margin-top: 4px;
  font-size: 0.84rem;
  color: var(--cream-faint);
  line-height: 1.45;
  word-break: break-word;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 9px;
}

.chip {
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(244, 230, 214, 0.09);
  color: var(--cream-soft);
  white-space: nowrap;
}

/* the three accents straight out of the photo */
.chip.time { background: rgba(208, 160, 116, 0.24); color: #ffdfc0; }
.chip.rain { background: rgba(136, 169, 199, 0.24); color: #d6e6f4; }
.chip.outdoor { background: rgba(110, 128, 88, 0.28); color: #dbe6c9; }

.trash {
  background: none;
  border: none;
  color: var(--cream-faint);
  font-size: 1.1rem;
  line-height: 1;
  padding: 4px 6px;
  cursor: pointer;
  border-radius: 8px;
  flex-shrink: 0;
  transition: color 0.15s ease, background 0.15s ease;
}

.trash:hover { color: #ffbfa8; background: rgba(198, 116, 100, 0.18); }

.empty {
  padding: 22px 4px;
  text-align: center;
  color: var(--cream-faint);
  font-size: 0.9rem;
  line-height: 1.6;
}

/* ---------------------------------------------------------- plan result */

#planResult:not(:empty) { margin-top: 20px; }

.headline {
  font-family: Georgia, "Iowan Old Style", serif;
  font-size: 1.12rem;
  line-height: 1.45;
  color: #ffe2c4;
  margin-bottom: 14px;
}

.conditions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-bottom: 16px;
}

.pick {
  border-left: 3px solid var(--brass);
  padding: 12px 14px;
  margin-bottom: 10px;
  border-radius: 0 12px 12px 0;
  background: rgba(244, 230, 214, 0.065);
  min-width: 0;
}

.pick-rank {
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--brass);
}

.pick-title {
  font-size: 1.04rem;
  margin: 3px 0 6px;
  word-break: break-word;
}

.pick-why {
  font-size: 0.9rem;
  line-height: 1.55;
  color: var(--cream-soft);
}

.skips {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--glass-line);
}

.skips h3 {
  margin: 0 0 8px;
  font-size: 0.76rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 500;
  color: var(--cream-faint);
}

.skip-line {
  font-size: 0.86rem;
  line-height: 1.55;
  color: var(--cream-faint);
  margin-bottom: 5px;
}

.skip-line b { color: var(--cream-soft); font-weight: 500; }

.meeting {
  margin-top: 14px;
  font-size: 0.86rem;
  color: var(--cream-faint);
  line-height: 1.5;
}

.meeting.over-budget { color: #ffbfa8; }

.foot {
  text-align: center;
  font-size: 0.8rem;
  color: rgba(244, 230, 214, 0.36);
  padding-top: 8px;
}

@media (max-width: 520px) {
  .page { padding: 32px 14px 48px; }
  .card { padding: 18px 16px; }
  .field-row { gap: 10px; }
}
