/* Family Hub: a dark, warm kitchen screen, drawn at 1920x1080 and zoomed to fit (see app.js). */
:root {
  color-scheme: dark;
  --bg: #15130F;
  --card: #201D18;
  --raised: #2A2620;
  --line: #39342C;
  --text: #F4EFE6;
  --muted: #B5AC9E;
  --faint: #9A9182;
  --over: #F0956A;
  --ok: #8FCB9B;
  --wet: #7FB2F0;
  --display: 'Bricolage Grotesque', 'Segoe UI', sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Atkinson Hyperlegible', 'Segoe UI', system-ui, sans-serif;
  overflow: hidden;
}

button { font: inherit; color: inherit; cursor: pointer; }
h1, h2 { margin: 0; font-weight: 600; }
ul { margin: 0; padding: 0; list-style: none; }
.display { font-family: var(--display); font-weight: 600; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }

#stage {
  width: 1920px;
  height: 1080px;
  padding: 36px 40px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

/* Header: clock, dates, the weather now */
.top { height: 150px; flex-shrink: 0; display: flex; align-items: flex-end; justify-content: space-between; gap: 40px; }
.when { display: flex; align-items: flex-end; gap: 40px; }
.clock { display: flex; align-items: baseline; gap: 10px; }
.time { font-size: 150px; line-height: 0.82; letter-spacing: -5px; }
.ampm { font-size: 38px; color: var(--muted); }
.dates { display: flex; flex-direction: column; gap: 10px; padding-bottom: 4px; }
.date { font-size: 44px; line-height: 1.05; }
.sub { display: flex; align-items: center; gap: 18px; font-size: 25px; }
.persian { font-family: 'Vazirmatn', 'Segoe UI', sans-serif; }
.now-weather { display: flex; align-items: center; gap: 26px; }
.now-weather .temp { font-family: var(--display); font-size: 116px; font-weight: 600; line-height: 0.85; letter-spacing: -3px; }
.now-weather .about { display: flex; flex-direction: column; gap: 6px; font-size: 24px; color: var(--muted); }
.now-weather .about strong { font-size: 29px; color: var(--text); }

/* Cards */
.grid {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr;
  grid-template-rows: minmax(0, 1fr) 330px;
  gap: 24px;
}
.card { background: var(--card); border-radius: 32px; padding: 28px 32px; display: flex; flex-direction: column; gap: 18px; overflow: hidden; min-width: 0; }
.card h2 { font-size: 32px; }
.card-head { display: flex; align-items: center; gap: 20px; }
.card-head h2 { flex: 1; }
.card-head .muted { font-size: 20px; }
.notice { font-size: 22px; color: var(--muted); line-height: 1.35; }
.pill { display: flex; align-items: center; gap: 10px; min-height: 60px; padding: 0 26px; border: 0; border-radius: 30px; background: var(--raised); font-size: 22px; font-weight: 700; }
.pill.primary { background: var(--text); color: var(--bg); }

/* Schedule */
.schedule { grid-row: 1 / 3; padding: 30px 36px; gap: 20px; }
.schedule h2 { font-size: 40px; }
.legend { display: flex; flex-wrap: wrap; gap: 26px; font-size: 21px; color: var(--muted); }
.legend span { display: flex; align-items: center; gap: 10px; }
.dot { width: 18px; height: 18px; flex-shrink: 0; border-radius: 9px; background: var(--c); }
.legend .dot { width: 16px; height: 16px; }
.events { display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
.now-line { display: flex; align-items: center; gap: 14px; padding: 4px 0 10px; font-size: 18px; font-weight: 700; letter-spacing: 2px; }
.now-line::after { content: ''; flex: 1; height: 2px; background: #5A5347; }
.event { display: flex; align-items: flex-start; gap: 22px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.event:last-child { border-bottom: 0; }
.event.past { opacity: 0.5; }
.event .at { width: 118px; flex-shrink: 0; display: flex; flex-direction: column; gap: 2px; }
.event .at .display { font-size: 32px; }
.event .at .faint { font-size: 19px; }
.event .dot { margin-top: 12px; }
.event .what { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.event .title { font-size: 31px; font-weight: 700; }
.event .who { font-size: 21px; font-weight: 700; color: var(--c); }
.tomorrow { margin-top: auto; display: flex; flex-direction: column; gap: 12px; padding: 22px 24px; border-radius: 24px; background: var(--raised); }
.tomorrow:empty { display: none; }
.tomorrow .label { font-size: 19px; font-weight: 700; letter-spacing: 2px; color: var(--muted); }
.tomorrow .row { display: flex; align-items: center; gap: 16px; font-size: 24px; }
.tomorrow .row .dot { width: 14px; height: 14px; }
.tomorrow .row .muted { width: 112px; flex-shrink: 0; }
.tomorrow .row strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Weather */
.hours { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; text-align: center; }
.hours div { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.hours .h { font-size: 19px; color: var(--muted); }
.hours .t { font-size: 28px; font-weight: 700; }
.hours .p { font-size: 18px; color: var(--faint); }
.hours .p.wet { color: var(--wet); font-weight: 700; }
.hint { padding: 16px 20px; border-radius: 20px; background: var(--raised); font-size: 22px; line-height: 1.35; }
.days { display: flex; flex-direction: column; gap: 4px; font-size: 23px; margin-top: 18px; }
.days div { display: grid; grid-template-columns: 90px 1fr auto; align-items: center; gap: 12px; padding: 6px 0; }

/* Money */
.money { display: flex; flex-direction: column; gap: 16px; flex: 1; }
.money .lead { display: flex; flex-direction: column; gap: 4px; font-size: 21px; }
.money .big { font-family: var(--display); font-size: 92px; font-weight: 600; line-height: 1; letter-spacing: -2px; }
.bar { position: relative; height: 22px; border-radius: 11px; background: var(--line); margin-top: 6px; }
.bar .fill { height: 22px; border-radius: 11px; background: var(--c); }
.bar .mark { position: absolute; top: -7px; width: 4px; height: 36px; border-radius: 2px; background: var(--text); }
.money .pace { display: flex; flex-direction: column; gap: 6px; font-size: 21px; line-height: 1.3; }
.money .bills { margin-top: auto; display: flex; flex-direction: column; gap: 4px; padding: 14px 18px; border-radius: 18px; background: var(--raised); }
.money .bills .muted { font-size: 18px; }
.money .bills strong { font-size: 28px; }

/* Reminders */
.reminders { grid-column: 2 / 4; padding: 24px 30px; gap: 10px; }
.tasks { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 28px; align-content: start; overflow: hidden; }
.task { width: 100%; display: flex; align-items: center; gap: 16px; min-height: 64px; padding: 4px 0; border: 0; background: transparent; text-align: left; }
.ring { width: 44px; height: 44px; flex-shrink: 0; border-radius: 22px; border: 3px solid var(--c); display: flex; align-items: center; justify-content: center; }
.task.done .ring { background: var(--c); border: 0; }
.task .text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.task .title { font-size: 23px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.task .meta { font-size: 18px; color: var(--muted); }
.task .meta b { color: var(--c); }
.task .meta .late { color: var(--over); font-weight: 700; }
.task.done .text { opacity: 0.55; text-decoration: line-through; }
.tasks .empty { grid-column: 1 / -1; font-size: 22px; color: var(--muted); padding: 8px 0; }

/* Add a reminder */
dialog { width: 860px; border: 0; border-radius: 32px; padding: 36px 40px; background: var(--card); color: var(--text); }
dialog::backdrop { background: rgb(14 12 10 / 0.8); }
dialog form { display: flex; flex-direction: column; gap: 18px; }
dialog h2 { font-size: 40px; }
dialog label[for], legend { font-size: 21px; font-weight: 700; color: var(--muted); }
dialog input:not([type]) { height: 72px; padding: 0 22px; border: 2px solid var(--line); border-radius: 20px; background: var(--raised); color: var(--text); font: inherit; font-size: 28px; }
dialog input:not([type]):focus { outline: 3px solid var(--text); outline-offset: 2px; }
fieldset { margin: 0; padding: 0; border: 0; display: flex; flex-direction: column; gap: 10px; }
.chips { display: flex; flex-wrap: wrap; gap: 12px; }
.chip { display: flex; align-items: center; gap: 10px; min-height: 56px; padding: 0 22px; border-radius: 28px; background: var(--raised); font-size: 22px; font-weight: 700; cursor: pointer; }
.chip input { width: 22px; height: 22px; margin: 0; accent-color: var(--text); }
.chip:has(input:checked) { background: var(--text); color: var(--bg); }
.chip:has(input:focus-visible) { outline: 3px solid var(--text); outline-offset: 3px; }
.error { margin: 0; min-height: 1em; font-size: 20px; color: var(--over); }
.actions { display: flex; justify-content: flex-end; gap: 14px; }

.unpaired { position: fixed; inset: 0; background: var(--bg); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 24px; font-size: 32px; text-align: center; }
.unpaired h1 { font-size: 72px; }
.unpaired[hidden] { display: none; }
