/* Same look as the Android app (android/.../ui/Theme.kt and Screens.kt). */
:root {
  --teal: #1F6F6B;
  --teal-soft: #CFE6E3;
  --teal-line: #A9C9C6;
  --orange: #D9692A;
  --orange-soft: #FBE3D3;
  --orange-ink: #8A3E12;
  --ground: #F4F5F1;
  --card: #FFFFFF;
  --ink: #1C2321;
  --muted: #5A6461;
  --line: #A9B3AF;
  --track: #E6E9E3;
  --memo-bg: #FFF4EA;
  --memo-ink: #B4531C;
  --done-ink: #7A8480;
  --dialog: #F0F2EE;
  --nav-h: 80px;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: Roboto, system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.35;
  -webkit-tap-highlight-color: transparent;
}
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
.boot { padding: 48px 24px; color: var(--muted); }

/* ---------- Layout ---------- */

.main {
  max-width: 560px;
  margin: 0 auto;
  padding: 0 18px calc(var(--nav-h) + 24px + env(safe-area-inset-bottom));
  padding-top: env(safe-area-inset-top);
}
.header { padding: 24px 4px 16px; }
.header .date { color: var(--muted); font-size: 13px; font-weight: 500; }
.header h1 { margin: 0; font-size: 30px; font-weight: 700; letter-spacing: -0.2px; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.stack.tight { gap: 10px; }

.nav {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  background: var(--card);
  display: flex;
  justify-content: center;
  padding: 12px 0 calc(12px + env(safe-area-inset-bottom));
  box-shadow: 0 -1px 3px rgba(28, 35, 33, 0.08);
  z-index: 5;
}
.nav button {
  flex: 1;
  max-width: 140px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}
.nav .pill-ind {
  width: 64px; height: 32px;
  border-radius: 16px;
  display: grid; place-items: center;
  transition: background-color 0.15s;
}
.nav button[aria-current="page"] { color: var(--teal); }
.nav button[aria-current="page"] .pill-ind { background: var(--teal-soft); }
.nav svg { width: 24px; height: 24px; fill: currentColor; }

/* ---------- Cards ---------- */

.card {
  background: var(--card);
  border-radius: 20px;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.card-head { display: flex; justify-content: space-between; align-items: baseline; }
.card-title { font-size: 16px; font-weight: 700; }
.small-muted { font-size: 13px; color: var(--muted); }
.empty { color: var(--muted); font-size: 14px; }
.empty.padded { margin: 0; padding: 4px; }

.dinner-hero {
  background: var(--teal);
  border-radius: 20px;
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-align: left;
  width: 100%;
}
.dinner-hero .label { display: flex; align-items: center; gap: 8px; color: var(--teal-soft); font-size: 13px; font-weight: 500; }
.dinner-hero .label svg { width: 16px; height: 16px; fill: var(--teal-soft); }
.dinner-hero .meal { color: #fff; font-size: 24px; font-weight: 600; }
.dinner-hero .sub { color: var(--teal-soft); font-size: 14px; }

.progress { height: 8px; border-radius: 4px; background: var(--track); overflow: hidden; }
.progress > div { height: 100%; background: var(--orange); border-radius: 4px; transition: width 0.25s; }

.upcoming { display: flex; gap: 14px; align-items: center; }
.upcoming .when { width: 60px; flex: none; color: var(--teal); font-size: 13px; font-weight: 700; }

.memo-banner {
  background: var(--memo-bg);
  border-radius: 20px;
  padding: 16px;
  display: flex;
  gap: 12px;
}
.memo-banner svg { width: 24px; height: 24px; flex: none; fill: var(--memo-ink); }
.memo-banner .meta { color: var(--memo-ink); font-size: 12px; font-weight: 700; }
.memo-banner .body { display: flex; flex-direction: column; gap: 2px; }
.memo-banner .actions { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }

/* ---------- Chores ---------- */

.chore {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  width: 100%;
  text-align: left;
}
.box {
  width: 30px; height: 30px;
  flex: none;
  border-radius: 9px;
  border: 2px solid var(--line);
  background: var(--card);
  display: grid; place-items: center;
  transition: background-color 0.15s, border-color 0.15s;
}
.box svg { width: 20px; height: 20px; fill: #fff; }
.chore.done .box { background: var(--orange); border-color: var(--orange); }
.chore .name, .chore .sub, .day-row .meal, .day-row .detail { display: block; }
.chore .name { font-size: 15px; }
.chore.done .name { color: var(--done-ink); text-decoration: line-through; }
.chore .sub { font-size: 12px; color: var(--muted); }
.chore .sub.overdue { color: var(--memo-ink); }

.week { display: flex; gap: 6px; }
.week > div {
  flex: 1;
  height: 40px;
  border-radius: 10px;
  display: grid; place-items: center;
  font-size: 12px; font-weight: 700;
  background: var(--track); color: var(--muted);
}
.week > .all { background: var(--orange); color: #fff; }
.week > .some { background: var(--orange-soft); color: var(--orange-ink); }

/* ---------- Dinner ---------- */

.day-row {
  background: var(--card);
  border-radius: 16px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  text-align: left;
  border: 2px solid transparent;
}
.day-row.today { border-color: var(--teal); }
.day-row .dcol { width: 44px; flex: none; display: flex; flex-direction: column; align-items: center; }
.day-row .dow { font-size: 12px; font-weight: 700; color: var(--muted); }
.day-row .dnum { font-size: 20px; font-weight: 700; }
.day-row .meal { font-size: 15px; font-weight: 500; }
.day-row .meal.none { color: var(--muted); }
.day-row .detail { font-size: 12px; color: var(--muted); }

/* ---------- Buttons ---------- */

.pills { display: flex; flex-wrap: wrap; gap: 8px; }
.pill {
  height: 40px;
  padding: 0 18px;
  border-radius: 18px;
  font-size: 13px;
  font-weight: 700;
  color: var(--teal);
  border: 2px solid var(--teal-line);
}
.pill[aria-pressed="true"] { background: var(--teal); border-color: var(--teal); color: #fff; }

.btn {
  min-height: 46px;
  padding: 0 24px;
  border-radius: 14px;
  background: var(--teal);
  color: #fff;
  font-weight: 700;
  font-size: 15px;
}
.btn.block { width: 100%; }
.btn:disabled { background: rgba(28, 35, 33, 0.12); color: rgba(28, 35, 33, 0.38); cursor: default; }
.btn.round { border-radius: 20px; min-height: 40px; font-size: 14px; }
.btn-text { color: var(--teal); font-weight: 700; font-size: 14px; padding: 10px 12px; border-radius: 20px; }
.btn-outline {
  width: 100%;
  min-height: 48px;
  border-radius: 14px;
  border: 2px solid var(--line);
  color: var(--teal);
  font-size: 15px;
  font-weight: 700;
}
.link { color: var(--teal); font-weight: 700; text-decoration: underline; }

/* ---------- Text fields (Material outlined) ---------- */

.field { position: relative; }
.field input, .field textarea {
  width: 100%;
  border: 1px solid #727976;
  border-radius: 4px;
  background: transparent;
  padding: 16px 14px;
  font-size: 16px; /* 16px stops iPhone zooming in */
  outline: none;
  resize: none;
}
.field textarea { min-height: 96px; }
.field input:focus, .field textarea:focus { border: 2px solid var(--teal); padding: 15px 13px; }
.field label {
  position: absolute;
  left: 10px; top: 16px;
  padding: 0 4px;
  color: var(--muted);
  font-size: 16px;
  pointer-events: none;
  transition: all 0.12s;
  background: var(--card);
}
.dialog .field label { background: var(--dialog); }
.field input:focus + label, .field input:not(:placeholder-shown) + label,
.field textarea:focus + label, .field textarea:not(:placeholder-shown) + label {
  top: -8px; font-size: 12px;
}
.field input:focus + label, .field textarea:focus + label { color: var(--teal); }

.field-label { font-weight: 700; font-size: 13px; color: var(--muted); }

/* ---------- Dialog (Material AlertDialog) ---------- */

.scrim {
  position: fixed; inset: 0;
  background: rgba(0, 0, 0, 0.32);
  display: grid; place-items: center;
  padding: 24px;
  z-index: 10;
}
.dialog {
  background: var(--dialog);
  border-radius: 28px;
  padding: 24px;
  width: 100%;
  max-width: 400px;
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.dialog h2 { margin: 0; font-size: 24px; font-weight: 400; }
.dialog .body { display: flex; flex-direction: column; gap: 12px; }
.dialog .actions { display: flex; justify-content: flex-end; gap: 8px; align-items: center; }

/* ---------- Setup screens ---------- */

.setup {
  max-width: 480px;
  margin: 0 auto;
  padding: calc(72px + env(safe-area-inset-top)) 24px 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.setup h1 { margin: 0; font-size: 28px; font-weight: 700; }
.setup p { margin: 0; font-size: 15px; color: var(--muted); }
.setup .rows { display: flex; flex-direction: column; gap: 10px; }
.setup .field label { background: var(--ground); }
.pick {
  background: var(--card);
  border-radius: 16px;
  padding: 18px;
  font-size: 16px;
  font-weight: 500;
  text-align: left;
  width: 100%;
}
.error-text { color: #B3261E; font-size: 14px; }

/* ---------- Memos ---------- */

.memo-card {
  background: var(--card);
  border-radius: 16px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.memo-card .meta { font-size: 12px; font-weight: 700; color: var(--muted); }
.memo-card .text, .memo-banner .text { white-space: pre-wrap; overflow-wrap: anywhere; }
.footnote { text-align: center; font-size: 13px; color: var(--muted); padding: 8px; }

/* ---------- Snackbar ---------- */

#snackbar {
  position: fixed;
  left: 50%;
  bottom: calc(var(--nav-h) + 12px + env(safe-area-inset-bottom));
  transform: translate(-50%, 20px);
  width: calc(100% - 32px);
  max-width: 520px;
  background: #313033;
  color: #F4EFF4;
  border-radius: 4px;
  padding: 14px 16px;
  font-size: 14px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
  z-index: 20;
}
#snackbar.show { opacity: 1; transform: translate(-50%, 0); }
