:root {
  color-scheme: dark;
  --ink: #f6f3ec;
  --muted: rgba(246, 243, 236, 0.72);
  --faint: rgba(246, 243, 236, 0.48);
  --line: rgba(255, 255, 255, 0.16);
  --glass: rgba(12, 14, 18, 0.94);
  --glass-strong: rgba(10, 12, 16, 0.96);
  --card: rgba(8, 16, 20, 0.82);
  --card-strong: rgba(8, 20, 22, 0.92);
  --accent: #7dcea0;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, monospace;
  --radius: 22px;
  --safe-top: 0px;
  --safe-right: 0px;
  --safe-bottom: 0px;
  --safe-left: 0px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: #07141c;
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
}

body {
  height: 100svh;
  max-height: 100svh;
  overflow: hidden;
}
body[data-theme="aurora"] {
  background: linear-gradient(180deg, #050814 0%, #0b2434 38%, #12382e 74%, #07140f 100%);
  --ink: #f3f7f4;
  --muted: rgba(214, 236, 224, 0.78);
  --faint: rgba(214, 236, 224, 0.5);
  --line: rgba(125, 206, 160, 0.32);
  --card: rgba(7, 22, 26, 0.84);
  --card-strong: rgba(10, 36, 32, 0.92);
  --accent: #7dcea0;
  --glass: rgba(6, 18, 22, 0.9);
}
body[data-theme="desert"] {
  background: linear-gradient(180deg, #1a1030 0%, #6a3054 26%, #d26545 56%, #e8a15a 76%, #3a2218 100%);
  --ink: #fff6ea;
  --muted: rgba(255, 230, 206, 0.8);
  --faint: rgba(255, 230, 206, 0.55);
  --line: rgba(240, 179, 106, 0.4);
  --card: rgba(48, 22, 24, 0.84);
  --card-strong: rgba(72, 28, 24, 0.92);
  --accent: #f0b36a;
  --glass: rgba(42, 18, 20, 0.9);
}
body[data-theme="golf"] {
  background: linear-gradient(180deg, #7eafd4 0%, #d5e6c4 30%, #6e9460 68%, #1c3a28 100%);
  --ink: #f4f8f1;
  --muted: rgba(232, 242, 220, 0.82);
  --faint: rgba(232, 242, 220, 0.55);
  --line: rgba(183, 224, 168, 0.4);
  --card: rgba(16, 40, 26, 0.82);
  --card-strong: rgba(22, 58, 32, 0.92);
  --accent: #b7e0a8;
  --glass: rgba(14, 36, 24, 0.88);
}
body[data-theme="glass"] {
  background: linear-gradient(180deg, #242830 0%, #12141a 58%, #1a1c22 100%);
  --ink: #f4f5f7;
  --muted: rgba(228, 230, 234, 0.78);
  --faint: rgba(228, 230, 234, 0.5);
  --line: rgba(255, 255, 255, 0.28);
  --card: rgba(32, 34, 40, 0.9);
  --card-strong: rgba(46, 48, 56, 0.94);
  --accent: #d5d8de;
  --glass: rgba(22, 24, 30, 0.92);
}
body.is-dim::before {
  content: "";
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.42);
  pointer-events: none;
  z-index: 0;
}
@media (display-mode: standalone) {
  body, .app { height: 100dvh; max-height: 100dvh; }
}

body,
body * {
  scrollbar-width: none;
}

body *::-webkit-scrollbar {
  width: 0;
  height: 0;
}

[hidden] { display: none !important; }

button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
body.idle, body.idle * { cursor: none !important; }

.glass {
  background: var(--glass);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.boot, .login, .app, .settings { position: relative; z-index: 1; }

.privacy-public {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0.8rem;
  z-index: 2;
  margin: 0;
  text-align: center;
  font-size: 0.875rem;
}
.privacy-public a { color: var(--muted); }
body:has(#board:not([hidden])) .privacy-public { display: none; }

.boot {
  margin: 0;
  min-height: 100svh;
  display: grid;
  place-items: center;
  align-content: center;
  justify-items: center;
  gap: 0.75rem;
  color: var(--muted);
}
.boot-mark {
  margin: 0;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  font-size: 0.875rem;
}
.boot-line {
  margin: 0;
  font-size: 1rem;
  letter-spacing: 0;
  text-transform: none;
}
.boot-dots {
  display: flex;
  gap: 0.4rem;
  margin: 0;
}
.boot-dots span {
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 999px;
  background: currentColor;
  opacity: 0.3;
  animation: boot-dot 1.1s ease-in-out infinite;
}
.boot-dots span:nth-child(2) { animation-delay: 0.16s; }
.boot-dots span:nth-child(3) { animation-delay: 0.32s; }
@keyframes boot-dot {
  0%, 100% { opacity: 0.25; }
  50% { opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .boot-dots span { animation: none; opacity: 0.75; }
}

.login {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 1.5rem;
}
.login-card { width: min(26rem, 100%); padding: 1.6rem 1.5rem 1.4rem; }
.login-card h1 { margin: 0.15rem 0 1rem; font-size: 3rem; font-weight: 500; letter-spacing: -0.04em; }
.eyebrow {
  margin: 0;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--faint);
}
.field { display: grid; gap: 0.35rem; font-size: 0.92rem; color: var(--muted); }
.field input, .field select, .feed-url, .feed-label {
  width: 100%;
  min-height: 48px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.28);
  padding: 0.55rem 0.75rem;
  outline: none;
}
.field input:focus, .field select:focus, .feed-url:focus, .feed-label:focus { border-color: rgba(255,255,255,.45); }
.primary, .text-btn, .icon-btn, .todo-add button, .check, .tiny {
  border: 0;
  background: transparent;
}
.primary {
  margin-top: 0.8rem;
  min-height: 48px;
  width: 100%;
  border-radius: 999px;
  background: var(--ink);
  color: #16181c;
  font-weight: 600;
}
.form-error { min-height: 1.2em; margin: 0.55rem 0 0; color: #ffb4a8; }
.hint { margin: 0.2rem 0 0.7rem; color: var(--faint); font-size: 0.92rem; line-height: 1.4; }
.credit { margin-top: 1.2rem; }

.app {
  container-name: glance;
  container-type: size;
  height: 100svh;
  max-height: 100svh;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: 0.55rem;
  padding:
    calc(0.7rem + max(env(safe-area-inset-top), var(--safe-top)))
    calc(0.85rem + max(env(safe-area-inset-right), var(--safe-right)))
    calc(0.55rem + max(env(safe-area-inset-bottom), var(--safe-bottom)))
    calc(0.85rem + max(env(safe-area-inset-left), var(--safe-left)));
  overflow: hidden;
  min-width: 0;
}
.top {
  display: grid;
  grid-template-columns: minmax(11rem, 0.7fr) minmax(26rem, 1.65fr) minmax(0, 0.85fr);
  gap: 0.7rem;
  align-items: stretch;
  padding-right: 16rem;
}
.place { margin: 0 0 0.15rem; color: var(--muted); letter-spacing: 0.08em; text-transform: uppercase; font-size: 0.875rem; }
.clock-block { min-width: 0; }
.clock {
  margin: 0;
  display: flex;
  align-items: flex-start;
  gap: 0.45rem;
  font-weight: 500;
  letter-spacing: -0.05em;
  line-height: 0.86;
  font-variant-numeric: tabular-nums;
}
#time { font-size: clamp(4.4rem, 10vh, 7.4rem); }
#ampm { margin-top: 0.7rem; font-size: 1.3rem; letter-spacing: 0.08em; color: var(--muted); }
.date { margin: 0.2rem 0 0; font-size: clamp(1.05rem, 2vh, 1.6rem); font-weight: 500; }
.next-line { margin: 0.15rem 0 0; color: var(--ink); font-size: 0.95rem; line-height: 1.3; }
.summary { margin: 0.15rem 0 0; max-width: 36rem; color: var(--muted); font-size: 0.95rem; line-height: 1.3; }
.party {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0.3rem 0 0;
  padding: 0.28rem 0.7rem 0.28rem 0.5rem;
  border-radius: 999px;
  background: #3a2a18;
  border: 1px solid rgba(243, 212, 138, 0.7);
  color: #f6e7c3;
  max-width: 100%;
}
.party-icon { width: 1.1rem; height: 1.1rem; flex: 0 0 auto; }
.party-icon svg { width: 100%; height: 100%; display: block; }
.party p { margin: 0; font-size: 0.95rem; line-height: 1.2; }

.now-card {
  container-name: now;
  container-type: inline-size;
  padding: 0.55rem 0.75rem;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.35rem 0.85rem;
  min-height: 0;
  min-width: 0;
}
.now-main { grid-column: 1; grid-row: 1; display: flex; align-items: center; gap: 0.4rem; min-width: 0; }
.now-details {
  grid-column: 2;
  grid-row: 1;
  display: grid;
  grid-template-columns: repeat(3, max-content);
  gap: 0.15rem 0.7rem;
  min-width: 0;
}
.now-facts {
  grid-column: 3;
  grid-row: 1;
  display: grid;
  grid-template-columns: repeat(3, max-content);
  gap: 0.15rem 0.65rem;
  justify-content: end;
  align-items: start;
  min-width: 0;
}
.stat, .fact { display: grid; gap: 0; white-space: nowrap; text-align: left; }
.stat span, .fact span, .fact em {
  color: var(--faint);
  font-family: var(--font);
  font-size: 0.875rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-style: normal;
  white-space: nowrap;
}
.stat strong, .fact strong {
  color: var(--ink);
  font-family: var(--font);
  font-size: 0.95rem;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.now-copy { display: grid; gap: 0.05rem; min-width: 0; }
.temp { font-size: 2.6rem; font-weight: 500; letter-spacing: -0.04em; line-height: 1; white-space: nowrap; }
.cond { font-size: 1rem; line-height: 1.2; white-space: nowrap; }
.wx { width: 2.8rem; height: 2.8rem; flex: 0 0 auto; }
@container now (max-width: 40rem) {
  .now-facts { grid-column: 1 / -1; grid-row: 2; justify-content: start; }
}
.wx svg { width: 100%; height: 100%; display: block; }

.forecast { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 0.4rem; }
.fday {
  padding: 0.35rem 0.12rem 0.3rem;
  min-width: 0;
  text-align: center;
  border-radius: 16px;
  background: var(--card);
  border: 1px solid var(--line);
}
.fday b { display: block; font-weight: 500; font-size: 0.875rem; }
.fday .wx { width: 1.15rem; height: 1.15rem; margin: 0.05rem auto; }
.fday span { display: block; color: var(--muted); font-size: 0.875rem; font-variant-numeric: tabular-nums; }
.fday .hi { color: var(--ink); }

.hourly {
  display: flex;
  gap: 0.3rem;
  min-height: 0;
  min-width: 0;
  overflow: hidden;
}
.hour {
  flex: 1 1 0;
  width: 0;
  min-width: 0;
  max-width: 100%;
  min-height: 2.45rem;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.02rem;
  text-align: center;
  padding: 0.12rem 0.12rem;
  border-radius: 12px;
  background: var(--card);
  border: 1px solid var(--line);
}
.hour-line {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.18rem;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  white-space: nowrap;
}
.hour .wx { width: 1rem; height: 1rem; margin: 0; flex: 0 0 auto; }
.hour-time,
.hour b,
.hour em {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1.05;
  font-size: 0.875rem;
  font-variant-numeric: tabular-nums;
}
.hour-time { flex: 0 0 auto; color: var(--faint); font-family: var(--mono); }
.hour b { flex: 0 1 auto; font-weight: 500; }
.hour em { flex: 0 1 auto; color: var(--faint); font-style: normal; font-family: var(--mono); }

.lower { min-height: 0; height: 100%; min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr) minmax(20rem, 24rem); grid-template-rows: minmax(0, 1fr); gap: 0.7rem; overflow: hidden; align-items: start; }
.days { min-height: 0; height: 100%; max-height: 100%; align-self: stretch; overflow: hidden; display: grid; grid-template-columns: 1.45fr repeat(6, minmax(0, 1fr)); grid-template-rows: minmax(0, 1fr); gap: 0.45rem; }
.day.setup-only { grid-column: 1 / -1; }
.day, .rail-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 0.7rem 0.7rem 0.6rem;
  display: flex;
  flex-direction: column;
}
.day { min-height: 0; min-width: 0; overflow: hidden; }
.rail-card { flex: 0 0 auto; min-width: 0; max-width: 100%; overflow: hidden; }
.light, .family-line, .family-line div, .day-facts, .card-head { min-width: 0; max-width: 100%; }
.day.is-today { background: var(--card-strong); border-color: var(--accent); }
#ampm, .day.is-today .day-head em { color: var(--accent); }
.day-head { display: flex; justify-content: space-between; align-items: baseline; gap: 0.4rem; margin-bottom: 0.35rem; }
.day-head strong { font-size: 0.875rem; font-weight: 500; min-width: 0; }
.day.is-today .day-head strong { font-size: 1.05rem; }
.day-head em { flex: 0 0 auto; font-style: normal; font-variant-numeric: tabular-nums; color: var(--muted); font-size: 1.35rem; line-height: 1; }
.events { list-style: none; margin: 0; padding: 0; overflow-x: hidden; overflow-y: auto; flex: 1 1 auto; min-height: 0; -webkit-overflow-scrolling: touch; }
.event {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.04rem;
  padding: 0.32rem 0.15rem 0.32rem 0.45rem;
  border-left: 3px solid var(--feed, #f6f3ec);
  margin-bottom: 0.22rem;
}
.event.all-day { grid-template-columns: minmax(0, 1fr); }
.event.is-past { opacity: 0.38; }
.event.is-now {
  background: rgba(226, 75, 74, 0.14);
  border-radius: 8px;
}
.now-line {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 0.35rem;
  margin: 0.05rem 0 0.28rem;
  padding: 0;
  list-style: none;
}
.now-line span {
  color: #e24b4a;
  font-size: 0.875rem;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.now-line i {
  display: block;
  height: 2px;
  background: #e24b4a;
  border-radius: 1px;
}
.event-time {
  font-family: var(--mono);
  font-size: 0.875rem;
  color: var(--faint);
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  line-height: 1.25;
}
.event { cursor: pointer; }
.event-title { font-size: 0.95rem; line-height: 1.25; }
.verse-card { margin-top: 0; cursor: pointer; gap: 0.12rem; }
.verse-head { display: flex; align-items: center; justify-content: space-between; gap: 0.35rem; min-width: 0; }
.verse-head h3 { min-width: 0; flex: 1 1 auto; letter-spacing: 0.04em; }
.verse-card { padding: 0.36rem 0.42rem 0.32rem; }
.verse-open {
  width: 1.75rem;
  height: 1.75rem;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
}
.verse-open svg { width: 1rem; height: 1rem; display: block; margin: auto; }
.verse-ref { margin: 0; font-size: 0.95rem; line-height: 1.25; }
.verse-theme { margin: 0; font-size: 0.875rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--faint); }
.sheet {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 1.25rem;
  background: rgba(6, 8, 12, 0.72);
}
.sheet[hidden] { display: none; }
.sheet.is-on { animation: sheet-in 120ms ease; }
@keyframes sheet-in { from { opacity: 0; } to { opacity: 1; } }
.sheet-card {
  width: min(40rem, 100%);
  max-height: min(86vh, 100%);
  overflow: auto;
  background: #10161c;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.9rem 1rem 1.1rem;
}
.sheet-close {
  display: block;
  margin-left: auto;
  min-height: 2rem;
  border: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 0.95rem;
}
.sheet-body h2 { margin: 0 0 0.35rem; font-size: 1.45rem; line-height: 1.2; }
.sheet-kicker { margin: 0 0 0.75rem; color: var(--muted); font-size: 0.95rem; }
.verse-text { margin: 0 0 0.8rem; font-size: 1.15rem; line-height: 1.45; }
.verse-devotional { margin: 0; font-size: 1rem; line-height: 1.45; color: var(--muted); }
.event-detail { display: grid; gap: 0.15rem; margin: 0 0 0.7rem; font-size: 1rem; line-height: 1.35; }
.event-detail span:first-child { color: var(--faint); font-size: 0.875rem; letter-spacing: 0.08em; text-transform: uppercase; }
.event-link { display: block; margin: 0 0 0.45rem; color: var(--accent); font-size: 0.95rem; word-break: break-all; }
.event-delete { display: flex; flex-wrap: wrap; align-items: center; gap: 0.45rem; margin-top: 0.8rem; }
.danger-btn {
  min-height: 2.4rem;
  padding: 0 0.9rem;
  border: 0;
  border-radius: 999px;
  background: #9c2f2f;
  color: #fff;
  font: inherit;
  font-size: 0.95rem;
}
.danger-btn:disabled { opacity: 0.65; }
.day.is-today .event-title { font-size: 1rem; }
.feed-name, .event.all-day .feed-name { grid-column: 1; color: var(--faint); font-size: 0.875rem; }
.setup, .quiet {
  margin: 0.4rem 0 0;
  color: var(--muted);
  line-height: 1.4;
}
.day.is-today .setup { font-size: 1.15rem; }

.rail { align-self: start; height: auto; max-height: 100%; min-height: 0; min-width: 0; display: flex; flex-direction: column; justify-content: flex-start; gap: 0.26rem; overflow: hidden; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 0.6rem; }
.card-head .text-btn { min-height: 0; margin: 0; font-size: 1rem; text-decoration: none; }
.card-head .text-btn:disabled { opacity: 0.35; }
.rail-card h3 { margin: 0; font-size: 0.875rem; font-weight: 500; letter-spacing: 0.12em; text-transform: uppercase; color: var(--faint); }
.count-title { margin: 0.28rem 0 0; font-size: clamp(1.25rem, 2.1vh, 1.5rem); line-height: 1.2; }
.count-when { margin: 0.05rem 0 0; font-size: clamp(1.7rem, 3.2vh, 2.35rem); font-weight: 500; letter-spacing: -0.04em; }
.day-facts { flex-direction: row; align-items: flex-start; justify-content: space-between; gap: 0.6rem; padding-top: 0.55rem; padding-bottom: 0.55rem; }
.fact { display: grid; gap: 0.05rem; min-width: 0; }
.fact span, .fact em { color: var(--faint); font-size: 0.875rem; letter-spacing: 0.06em; text-transform: uppercase; font-style: normal; }
.fact strong { font-size: clamp(1.2rem, 2.2vh, 1.5rem); font-weight: 500; font-variant-numeric: tabular-nums; }
.aqi-good { color: #b7f0c8; }
.aqi-mid { color: #f0d59a; }
.aqi-bad { color: #ffb4a8; }

.lights { display: grid; gap: 0.15rem; margin-top: 0.35rem; }
.light { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 0.55rem; align-items: center; min-height: 2.35rem; }
.light-schedule { margin: 0.2rem 0 0; color: var(--faint); font-size: 0.875rem; line-height: 1.25; }
.light-name { font-size: 1rem; line-height: 1.2; }
.light-meta { color: var(--muted); font-size: clamp(0.95rem, 1.5vh, 1.12rem); letter-spacing: 0.04em; text-transform: uppercase; }
.light.is-offline { opacity: 0.55; }
.switch {
  width: 52px;
  height: 32px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.1);
  position: relative;
  padding: 0;
}
.switch i {
  position: absolute;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #f6f3ec;
  top: 3px;
  left: 3px;
}
.switch[aria-pressed="true"] { background: var(--accent); }
.switch[aria-pressed="true"] i { left: 24px; }
.switch:disabled { opacity: 0.4; }
.family-line { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 0.55rem; align-items: start; margin-top: 0.4rem; }
.family-line i { width: 0.7rem; height: 0.7rem; border-radius: 50%; margin-top: 0.35rem; }
.family-status, .family-meta { margin: 0; min-width: 0; }
.family-status { font-size: clamp(1.25rem, 2.2vh, 1.55rem); line-height: 1.2; }
.family-meta { margin-top: 0.12rem; color: var(--muted); font-size: clamp(1.02rem, 1.7vh, 1.22rem); line-height: 1.25; }
.setup-box { margin-top: 0.6rem; padding: 0.75rem; border: 1px solid var(--line); border-radius: 14px; }
.setup-box code, .setup-box input { word-break: break-all; }
.light-pref { display: grid; grid-template-columns: auto 1fr auto auto; gap: 0.35rem; align-items: center; margin-bottom: 0.45rem; }

.check, .tiny {
  width: 36px;
  height: 36px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--ink);
}
.check[aria-pressed="true"] { background: var(--ink); color: #16181c; }
.add-card { gap: 0.14rem; flex: 0 0 auto; overflow: visible; padding: 0.34rem 0.4rem 0.28rem; }
.add-card form, .add-quiet { display: grid; gap: 0.16rem; min-width: 0; }
.add-card form { grid-template-columns: minmax(0, 1fr); }
.add-row { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.95fr) minmax(0, 0.85fr); gap: 0.16rem; min-width: 0; }
.add-when { position: relative; min-width: 0; }
.add-card .add-date {
  position: absolute;
  left: 0;
  top: 0;
  width: 1px;
  height: 1px;
  min-width: 0;
  min-height: 0;
  max-width: 1px;
  margin: 0;
  padding: 0;
  border: 0;
  opacity: 0;
  pointer-events: none;
  background: transparent;
}
.add-foot { display: flex; align-items: center; justify-content: space-between; gap: 0.35rem; }
.add-card input, .add-card select {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  min-height: 32px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.28);
  padding: 0 0.32rem;
  font-size: 0.875rem;
}
.add-go, .add-card .text-btn {
  min-height: 32px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.08);
  padding: 0 0.7rem;
  font-size: 0.875rem;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.add-time {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
  min-width: 0;
  min-height: 32px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.28);
  padding: 0 0.32rem;
}
.add-time-face {
  font-size: 0.875rem;
  font-variant-numeric: tabular-nums;
  pointer-events: none;
  white-space: nowrap;
}
.add-time input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  opacity: 0;
  background: transparent;
  min-height: 0;
}
.add-foot { display: flex; align-items: center; justify-content: space-between; gap: 0.45rem; }
.add-allday { display: flex; align-items: center; gap: 0.3rem; min-height: 32px; font-size: 0.875rem; white-space: nowrap; }
.add-go { font-weight: 600; }
.add-go:disabled { opacity: 0.65; }
.add-note { margin: 0; color: var(--muted); font-size: 0.875rem; line-height: 1.25; }
.add-card form.is-busy .add-go { opacity: 0.65; }

.tools { position: absolute; top: 1rem; right: 1rem; display: flex; gap: 0.4rem; z-index: 2; }
.tools button, .icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  line-height: 0;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(12, 14, 18, 0.92);
  color: var(--ink);
  -webkit-appearance: none;
  appearance: none;
}
.tools button svg, .icon-btn svg {
  display: block;
  width: 20px;
  height: 20px;
  margin: 0;
  flex: 0 0 20px;
}

.settings {
  position: fixed;
  inset: 0;
  z-index: 5;
  display: grid;
  justify-content: end;
  background: rgba(0, 0, 0, 0.28);
}
.settings-card {
  width: min(440px, 100%);
  height: 100dvh;
  border-radius: 0;
  overflow: auto;
  padding: 1rem 1rem 2rem;
  background: rgba(12, 14, 18, 0.9);
}
.settings-head { display: flex; justify-content: space-between; align-items: center; }
.settings-head h2 { margin: 0.1rem 0 0; font-size: 2rem; font-weight: 500; }
.settings-body { display: grid; gap: 1rem; }
.settings-body h3 { margin: 0 0 0.4rem; font-size: 0.95rem; font-weight: 500; }
.split, .checks { display: grid; gap: 0.55rem; }
.themes { display: grid; grid-template-columns: repeat(5, 1fr); gap: 0.4rem; }
.theme-btn {
  border: 1px solid var(--line);
  background: #111;
  border-radius: 14px;
  min-height: 64px;
  padding: 0.35rem;
  color: var(--ink);
}
.theme-btn[aria-checked="true"] { outline: 2px solid var(--ink); }
.swatch { display: block; height: 28px; border-radius: 8px; margin-bottom: 0.25rem; }
.swatch.auto { background: linear-gradient(90deg, #16352a, #d36a45, #8fb58a, #222); }
.swatch.aurora { background: linear-gradient(180deg, #102033, #1d6b45); }
.swatch.desert { background: linear-gradient(180deg, #6a3358, #f0b36a); }
.swatch.golf { background: linear-gradient(180deg, #d5e4ef, #2f5a34); }
.swatch.glass { background: linear-gradient(180deg, #2a2d33, #0c0d10); }
.theme-btn span { font-size: 0.68rem; letter-spacing: 0.04em; }
.feed {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.4rem;
  margin-bottom: 0.55rem;
  padding-bottom: 0.55rem;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.feed-label, .feed-url { grid-column: 1 / -1; }
.colors { display: flex; gap: 0.3rem; }
.colors button { width: 28px; height: 28px; border-radius: 50%; border: 2px solid transparent; }
.colors button[aria-pressed="true"] { border-color: white; }
.check { display: flex; align-items: center; gap: 0.5rem; min-height: 36px; }
.password-block { display: grid; gap: 0.45rem; }
.text-btn { justify-self: start; min-height: 44px; padding: 0; color: var(--ink); text-decoration: underline; text-underline-offset: 0.2em; }
.text-btn.danger { color: #ffb4a8; }

.layouts { display: grid; grid-template-columns: 1fr 1fr; gap: 0.4rem; }
.layout-btn {
  min-height: 52px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.28);
  text-align: left;
  padding: 0.45rem 0.7rem;
}
.layout-btn[aria-checked="true"] { outline: 2px solid var(--ink); }
.layout-btn small { display: block; color: var(--faint); font-size: 0.72rem; }

body[data-layout="calendar"] .hourly { display: none; }
body[data-layout="calendar"] .top { grid-template-columns: auto minmax(26rem, 34rem) minmax(0, 1fr); align-items: center; }
body[data-layout="calendar"] #time { font-size: clamp(2.8rem, 6vh, 3.6rem); }
body[data-layout="calendar"] .date, body[data-layout="calendar"] .summary { font-size: 0.95rem; }
body[data-layout="calendar"] .now-card { min-height: 0; padding: 0.45rem 0.7rem; }
body[data-layout="calendar"] .temp { font-size: 2rem; }
body[data-layout="calendar"] .wx { width: 2.4rem; height: 2.4rem; }
body[data-layout="calendar"] .lower { grid-template-columns: minmax(0, 1fr) minmax(20rem, 22rem); }
body[data-layout="calendar"] .event-title { font-size: 1.02rem; }
body[data-layout="calendar"] .day.is-today .event-title { font-size: 1.12rem; }

body[data-layout="today"] .days { grid-template-columns: 1fr; }
body[data-layout="today"] .now-card { min-height: 0; }
body[data-layout="today"] .temp { font-size: clamp(3.4rem, 7vh, 5rem); }
body[data-layout="today"] .event-title, body[data-layout="today"] .day.is-today .event-title { font-size: 1.28rem; }
body[data-layout="today"] .hour:nth-child(n+9) { display: none; }
body[data-layout="today"] .lower { grid-template-columns: minmax(0, 1.15fr) minmax(18rem, 0.95fr); }
body[data-layout="today"] .lights-card, body[data-layout="today"] .family-card { flex: 0 0 auto; }

body[data-layout="threeday"] .days { grid-template-columns: minmax(0, 1.65fr) minmax(0, 0.68fr) minmax(0, 0.68fr); }
body[data-layout="threeday"] .now-card { min-height: 0; }
body[data-layout="threeday"] .temp { font-size: 3rem; }
body[data-layout="threeday"] .lower { grid-template-columns: minmax(0, 1fr) minmax(26rem, 30rem); }

body[data-layout="fiveday"] .days { grid-template-columns: minmax(0, 1.3fr) repeat(4, minmax(0, 1fr)); }
body[data-layout="fiveday"] .now-card { min-height: 0; }
body[data-layout="fiveday"] .lower { grid-template-columns: minmax(0, 1fr) minmax(17.5rem, 20rem); }

body[data-layout="home"] .app { grid-template-rows: auto minmax(0, 1fr); }
body[data-layout="home"] .hourly { display: none; }
body[data-layout="home"] .top { grid-template-columns: auto minmax(26rem, 34rem) minmax(0, 1fr); align-items: center; }
body[data-layout="home"] #time { font-size: clamp(2.8rem, 6vh, 3.8rem); }
body[data-layout="home"] .now-card { min-height: 0; padding: 0.5rem 0.75rem; }
body[data-layout="home"] .temp { font-size: 2.2rem; }
body[data-layout="home"] .wx { width: 2.6rem; height: 2.6rem; }
body[data-layout="home"] .lower { grid-template-columns: minmax(22rem, 1.15fr) minmax(16rem, 0.8fr); }
body[data-layout="home"] .rail { order: -1; }
body[data-layout="home"] .light-name, body[data-layout="home"] .family-status { font-size: clamp(1.28rem, 2.4vh, 1.65rem); }
body[data-layout="home"] .days { grid-template-columns: 1fr; }

@media (max-width: 1500px) {
  .top,
  body[data-layout="balanced"] .top,
  body[data-layout="today"] .top,
  body[data-layout="threeday"] .top,
  body[data-layout="calendar"] .top,
  body[data-layout="home"] .top {
    grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.35fr);
    padding-right: 15rem;
  }
  .forecast,
  body[data-layout="calendar"] .forecast,
  body[data-layout="home"] .forecast { grid-column: 1 / -1; }
  .lower,
  body[data-layout="balanced"] .lower,
  body[data-layout="calendar"] .lower,
  body[data-layout="today"] .lower,
  body[data-layout="threeday"] .lower {
    grid-template-columns: minmax(0, 1fr) minmax(15rem, 17.5rem);
  }
  body[data-layout="home"] .lower { grid-template-columns: minmax(15rem, 17.5rem) minmax(0, 1fr); }
}

@media (max-height: 830px) and (max-width: 1220px) {
  .hourly { display: none; }
  .summary, .place { display: none; }
  .fday .wx { display: none; }
  #time, body[data-layout="today"] #time, body[data-layout="calendar"] #time, body[data-layout="home"] #time { font-size: 2rem; }
  .date, .next-line { font-size: 0.875rem; margin-top: 0; }
  .now-card, body[data-layout="today"] .now-card { padding: 0.2rem 0.4rem; min-height: 0; }
  .temp, body[data-layout="today"] .temp { font-size: 1.55rem; }
  .wx, body[data-layout="today"] .wx { width: 1.35rem; height: 1.35rem; }
  .forecast { gap: 0.2rem; }
  .fday { padding: 0.12rem 0.08rem; }
  .rail { gap: 0.12rem; }
  .rail-card, .add-card { padding: 0.16rem 0.32rem; }
  .light { min-height: 1.3rem; }
  .family-line { margin-top: 0.1rem; }
  .add-card form, .add-times { gap: 0.12rem; }
  .add-time, .add-card input, .add-card select, .add-days button, .add-go, .add-allday { min-height: 26px; }
  .add-foot { flex-wrap: nowrap; }
}

@media (max-height: 780px) {
  .app { gap: 0.25rem; }
  #time, body[data-layout="calendar"] #time, body[data-layout="home"] #time { font-size: 2.15rem; }
  .date, .summary, .next-line { font-size: 0.875rem; }
  .now-facts { display: none; }
  .fday .wx, .hour:nth-child(n+8) { display: none; }
  .temp { font-size: 1.7rem; }
  .wx { width: 1.6rem; height: 1.6rem; }
  .light { min-height: 1.45rem; }
  .family-meta { display: none; }
  .rail { gap: 0.15rem; }
  .rail-card, .add-card { padding: 0.22rem 0.35rem; }
  .add-card form, .add-quiet { gap: 0.16rem; }
  .add-time, .add-card input, .add-card select, .add-days button, .add-go, .add-allday { min-height: 28px; }
}

@media (max-height: 900px) {
  .app { padding: 0.55rem 0.7rem 0.5rem; gap: 0.4rem; }
  #time { font-size: clamp(2.8rem, 8vh, 4.2rem); }
  body[data-layout="today"] .temp { font-size: 3rem; }
  body[data-layout="today"] .now-card { min-height: 0; }
  body[data-layout="today"] .event-title, body[data-layout="today"] .day.is-today .event-title { font-size: 1.05rem; }
  body[data-layout="calendar"] #time, body[data-layout="home"] #time { font-size: 2.4rem; }
  .date { font-size: 1.15rem; }
  .summary, .next-line { font-size: 0.875rem; }
  .now-card { min-height: 0; padding: 0.65rem 0.75rem; }
  .temp { font-size: 2.6rem; }
  .hour { padding: 0.25rem 0.1rem; }
  .day { padding: 0.5rem; }
  .event-title, .day.is-today .event-title { font-size: 0.875rem; }
  .count-when { font-size: 1.55rem; }
  .count-title { font-size: 1.15rem; }
  .rail { gap: 0.3rem; }
  .rail-card { padding: 0.5rem 0.6rem 0.45rem; }
  .light { min-height: 1.65rem; }
  .light-name, body[data-layout="home"] .light-name { font-size: 1.12rem; }
  .family-status, body[data-layout="home"] .family-status { font-size: 1.12rem; }
  .family-meta { font-size: 0.875rem; }
  .fact strong { font-size: 1.12rem; }
  .day-facts { padding-top: 0.35rem; padding-bottom: 0.35rem; }
  .rail { gap: 0.18rem; }
  .add-card { gap: 0.2rem; padding-top: 0.35rem; padding-bottom: 0.28rem; }
  .add-card form { grid-template-columns: minmax(0, 1fr); gap: 0.16rem; }
  .add-row { grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.95fr) minmax(0, 0.85fr); gap: 0.16rem; }
  .add-time, .add-card input, .add-card select, .add-days button, .add-go, .add-allday { min-height: 32px; font-size: 0.875rem; }
}

@media (max-height: 900px) and (max-width: 1250px) {
  .add-card form { grid-template-columns: minmax(0, 1fr); }
  .rail { gap: 0.12rem; }
  .add-card { padding-top: 0.28rem; padding-bottom: 0.18rem; }
  .lower,
  body[data-layout="calendar"] .lower,
  body[data-layout="threeday"] .lower,
  body[data-layout="today"] .lower { grid-template-columns: minmax(0, 1fr) minmax(16.25rem, 18rem); }
  body[data-layout="home"] .lower { grid-template-columns: minmax(16.25rem, 18rem) minmax(0, 1fr); }
  body[data-layout="balanced"] .event,
  body[data-layout="calendar"] .event,
  body[data-layout="threeday"] .event { grid-template-columns: 1fr; gap: 0.02rem; padding-top: 0.2rem; padding-bottom: 0.2rem; }
  body[data-layout="balanced"] .feed-name,
  body[data-layout="calendar"] .feed-name,
  body[data-layout="threeday"] .feed-name { grid-column: 1; }
  .event-time, .day-head strong, .day.is-today .day-head strong { font-size: 0.875rem; letter-spacing: 0; }
  .day-head em { font-size: 1.05rem; }
  body[data-layout="calendar"] .top,
  body[data-layout="home"] .top { grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr); }
  body[data-layout="calendar"] .forecast,
  body[data-layout="home"] .forecast { grid-column: 1 / -1; }
  .fday { min-width: 0; }
  .hour:nth-child(n+9) { display: none; }
}

body { container-name: screen; container-type: inline-size; }

@container screen (max-width: 1060px) {
  .app {
    height: 100svh;
    grid-template-rows: auto auto minmax(0, 1fr);
    gap: 0.3rem;
    padding:
      calc(0.35rem + max(env(safe-area-inset-top), var(--safe-top)))
      calc(0.75rem + max(env(safe-area-inset-right), var(--safe-right)))
      calc(0.7rem + max(env(safe-area-inset-bottom), var(--safe-bottom)))
      calc(0.75rem + max(env(safe-area-inset-left), var(--safe-left)));
  }
  .top {
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
    padding-right: 14.5rem;
    gap: 0.35rem;
    align-items: start;
  }
  .forecast { grid-column: 1 / -1; }
  .summary, .next-line { max-width: none; font-size: 0.875rem; }
  #time { font-size: 2.7rem; }
  .date { font-size: 0.95rem; }
  .temp { font-size: 2rem; }
  .wx { width: 2rem; height: 2rem; }
  .fday { padding: 0.2rem 0.1rem; }
  .fday .wx { width: 1rem; height: 1rem; margin: 0 auto; }
  .top { grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.35fr); }
  .now-card, body[data-layout="today"] .now-card, body[data-layout="calendar"] .now-card, body[data-layout="home"] .now-card {
    min-height: 0;
    padding: 0.35rem 0.5rem;
  }
  .hourly { display: flex; }
  .hour:nth-child(n+7) { display: none; }
  body[data-layout="calendar"] .hourly,
  body[data-layout="home"] .hourly { display: none; }
  .lower,
  body[data-layout="balanced"] .lower,
  body[data-layout="calendar"] .lower,
  body[data-layout="today"] .lower,
  body[data-layout="threeday"] .lower,
  body[data-layout="fiveday"] .lower,
  body[data-layout="home"] .lower {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr) auto;
    min-height: 0;
  }
  .days, body[data-layout="balanced"] .days { grid-template-columns: repeat(7, minmax(0, 1fr)); grid-template-rows: minmax(0, 1fr); }
  body[data-layout="today"] .days,
  body[data-layout="home"] .days { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); }
  body[data-layout="threeday"] .days { grid-template-columns: repeat(3, minmax(0, 1fr)); grid-template-rows: minmax(0, 1fr); }
  body[data-layout="fiveday"] .days { grid-template-columns: minmax(0, 1.3fr) repeat(4, minmax(0, 1fr)); grid-template-rows: minmax(0, 1fr); }
  body[data-layout="home"] .rail { order: 0; }
  .rail { gap: 0.22rem; align-self: stretch; height: auto; max-height: none; overflow: hidden; }
  .rail-card { padding: 0.32rem 0.4rem; }
  .light { min-height: 1.6rem; }
  .light-name, .family-status, body[data-layout="home"] .light-name, body[data-layout="home"] .family-status { font-size: 0.875rem; }
  .family-meta, .event-title, .day.is-today .event-title, body[data-layout="today"] .event-title { font-size: 0.875rem; }
  .event { margin-bottom: 0.1rem; padding: 0.12rem 0.08rem 0.12rem 0.28rem; }
  .add-time, .add-card input, .add-card select, .add-days button, .add-go, .add-allday { min-height: 32px; font-size: 0.875rem; }
  .tools { top: 0.35rem; right: 0.35rem; }
  .tools button { width: 40px; height: 40px; }
}

@media (max-width: 699px) {
  body { overflow: hidden; }
  .app { height: 100dvh; min-height: 0; overflow: hidden; grid-template-rows: auto minmax(0, 1fr); }
  .top { grid-template-columns: 1fr; padding-right: 0; }
  .tools { top: 0.4rem; right: 0.4rem; }
  .hourly { display: none; }
  .forecast { grid-template-columns: repeat(7, minmax(0, 1fr)); }
  .lower { grid-template-columns: 1fr; grid-template-rows: minmax(0, 1fr) auto; }
  .days { grid-template-columns: 1fr; }
  .rail { overflow: hidden; }
}

.week {
  position: fixed;
  inset: 0;
  z-index: 4;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  padding: 0.85rem 1rem 1rem;
  background: #101218;
  height: 100svh;
  max-height: 100svh;
  overflow: hidden;
}
.week-bar { display: flex; align-items: center; gap: 0.45rem; min-width: 0; }
.week-bar h2 {
  margin: 0;
  flex: 1;
  min-width: 0;
  text-align: center;
  font-size: clamp(1.2rem, 2.4vw, 1.8rem);
  font-weight: 500;
  letter-spacing: -0.03em;
  white-space: nowrap;
}
.week-bar button {
  min-height: 44px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.08);
  padding: 0 0.9rem;
  font-size: 1rem;
}
#week-prev, #week-next { width: 44px; padding: 0; font-size: 1.6rem; line-height: 1; }
.week-days {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0.4rem;
}
.week-days .day { min-height: 0; overflow: hidden; }
.week-days .event-time, .week-days .event-title { font-size: 0.875rem; }
.week-status { margin: 0; color: var(--muted); align-self: center; font-size: 0.875rem; }

.slides {
  position: fixed;
  inset: 0;
  z-index: 30;
  background: #000;
}
.slides img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  opacity: 0;
  transition: opacity 1s linear;
}
.slides img.is-show { opacity: 1; }
.slide-scrim {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  padding:
    calc(0.7rem + env(safe-area-inset-top))
    4.8rem
    6.5rem
    calc(0.9rem + env(safe-area-inset-left));
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.72) 0%, rgba(0, 0, 0, 0.42) 46%, rgba(0, 0, 0, 0) 100%);
  pointer-events: none;
}
.slide-when {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  line-height: 1.05;
  color: #fff;
}
#slide-time {
  font-size: clamp(64px, 5.6vw, 80px);
  font-weight: 500;
  letter-spacing: -0.04em;
  color: #fff;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.45);
}
#slide-date {
  font-size: clamp(22px, 1.9vw, 26px);
  font-weight: 500;
  color: #fff;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.45);
}
.slide-banner {
  margin: 0.35rem 0 0;
  max-width: 40rem;
  font-size: clamp(22px, 1.9vw, 26px);
  line-height: 1.25;
  color: #fff;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.45);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
#slide-back {
  position: absolute;
  top: calc(0.7rem + env(safe-area-inset-top));
  right: calc(0.7rem + env(safe-area-inset-right));
  z-index: 1;
  width: 44px;
  height: 44px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: rgba(0, 0, 0, 0.35);
  color: #f6f3ec;
}
#slide-back svg { width: 20px; height: 20px; display: block; margin: auto; }
.slide-tools {
  position: absolute;
  z-index: 2;
  right: calc(0.8rem + env(safe-area-inset-right));
  bottom: calc(0.8rem + env(safe-area-inset-bottom));
  display: flex;
  gap: 0.4rem;
}
.slide-tools button {
  min-height: 44px;
  padding: 0 1rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(0, 0, 0, 0.5);
  color: #fff;
  font: 600 16px/1 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.45);
}
.photo-menu {
  position: absolute;
  top: calc(100% + 0.4rem);
  right: 0;
  z-index: 6;
  display: grid;
  gap: 0.35rem;
  min-width: 12.5rem;
  padding: 0.4rem;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(12, 14, 18, 0.96);
}
.photo-menu button {
  width: auto;
  height: auto;
  min-height: 44px;
  padding: 0 0.85rem;
  border-radius: 10px;
  font: 600 16px/1 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  text-align: left;
}
.photo-menu button:disabled { opacity: 0.45; }
.crop {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 0.7rem;
  padding: calc(0.8rem + env(safe-area-inset-top)) 0.8rem calc(0.8rem + env(safe-area-inset-bottom));
  background: #07141c;
  color: #fff;
}
.crop-count, .crop-status { margin: 0; font-size: 16px; }
.crop-stage {
  touch-action: none;
  border-radius: 16px;
  overflow: hidden;
  background: #000;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.35);
}
.crop-stage canvas { display: block; width: 100%; height: 100%; }
.crop-zoom {
  display: grid;
  gap: 0.25rem;
  width: min(100%, 28rem);
  font-size: 16px;
}
.crop-zoom input { width: 100%; min-height: 44px; }
.crop-actions {
  display: grid;
  grid-template-columns: 1fr 1fr 1.2fr;
  gap: 0.45rem;
  width: min(100%, 28rem);
}
.crop-actions button {
  width: auto;
  height: auto;
  min-height: 44px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: rgba(0, 0, 0, 0.28);
  color: #fff;
  font: 600 16px/1 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
#crop-save { background: #f6f3ec; color: #16181c; }
@container screen (max-width: 1060px) {
  .week { padding: 0.45rem; }
  .week-bar h2 { font-size: 1rem; }
  .week-days { gap: 0.25rem; }
}

@media (min-width: 1061px) {
  body[data-layout="threeday"] .lower {
    grid-template-columns: minmax(0, 1fr) minmax(26rem, 30rem);
  }
  body[data-layout="threeday"] .days {
    grid-template-columns: minmax(0, 1.65fr) minmax(0, 0.68fr) minmax(0, 0.68fr);
  }
  body[data-layout="threeday"] .add-days {
    grid-template-columns: max-content max-content minmax(0, 1fr);
  }
  body[data-layout="threeday"] .add-days button {
    min-width: max-content;
    white-space: nowrap;
  }
  body[data-layout="threeday"] .add-times {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }
}

