/* Design tokens and themes shared by the kiosk and the phone app. */
:root {
  --bg: #f3efe6;
  --card: #ffffff;
  --fg: #1e1d1a;
  --muted: #6f6c64;
  --line: #e2ddd1;
  --accent: #2b6b8f;
  --accent-fg: #ffffff;
  --danger: #b4441c;
  --ok: #3b7a3b;
  --radius: 14px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

/* Dark: neutral, for people who want a dark screen in daytime too. */
body[data-theme="dark"] {
  --bg: #0f1115;
  --card: #181b22;
  --fg: #e8e6e1;
  --muted: #8f8d87;
  --line: #262a33;
  --accent: #6aa9d0;
  --accent-fg: #0f1115;
  --danger: #d9704a;
  --ok: #6cae6c;
}
body[data-theme="dark"] { --wx-cloud: #9aa6b4; --wx-cloud-dark: #5f6b78; --wx-fog: #7a8692; }

/* Night: amber on black, no blue channel to speak of. */
body[data-theme="amber"] {
  --bg: #000000;
  --card: #0a0703;
  --fg: #e08a1e;
  --muted: #7d4e0f;
  --line: #22160a;
  --accent: #e08a1e;
  --accent-fg: #000000;
  --danger: #e06a1e;
  --ok: #b07a1e;
}

/* Sleep: everything off except a faint clock. */
body[data-theme="off"] {
  --bg: #000000;
  --card: #000000;
  --fg: #2a1a06;
  --muted: #1a1004;
  --line: #000000;
  --accent: #2a1a06;
  --accent-fg: #000000;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--font);
  -webkit-text-size-adjust: 100%; text-size-adjust: 100%;  /* no Android WebView font boosting */
  background: var(--bg);
  color: var(--fg);
  -webkit-font-smoothing: antialiased;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  transition: background .6s, color .6s;
}
h1, h2, h3 { margin: 0; font-weight: 600; }
h2 { font-size: .85rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
sup.tm { font-size: .5em; font-weight: 400; line-height: 0; vertical-align: super; margin-left: .08em; letter-spacing: 0; }   /* the ™ beside Sidewell on the website */
ul { list-style: none; margin: 0; padding: 0; }
button, input, select, textarea {
  font: inherit; color: inherit;
}
button { cursor: pointer; border: 0; background: none; }
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px;
}
.muted { color: var(--muted); }
.empty { color: var(--muted); font-style: italic; }
.row { display: flex; align-items: center; gap: 10px; }
.grow { flex: 1; min-width: 0; }
.btn {
  background: var(--accent); color: var(--accent-fg);
  border-radius: 999px; padding: 10px 18px; font-weight: 600;
}
/* The quieter choice beside a filled button (Not now beside Start): a soft tint, no hard outline, so the filled one always stands out most. */
.btn.ghost { background: rgba(127, 127, 127, .16); background: color-mix(in srgb, var(--fg) 9%, transparent); color: var(--fg); border: 1px solid transparent; }
.btn.danger { background: var(--danger); color: #fff; }
.btn:active { opacity: .7; }

/* Check rows used by lists and tasks */
.check {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 4px; border-bottom: 1px solid var(--line);
  min-height: 48px;
}
.check:last-child { border-bottom: 0; }
.check .box {
  width: 24px; height: 24px; flex: none;
  border: 2px solid var(--muted); border-radius: 7px;
  display: grid; place-items: center; font-size: 16px; color: var(--accent-fg);
}
.check .box { color: transparent; }  /* the check mark only shows once done */
.check.done .box { background: var(--accent); border-color: var(--accent); color: var(--accent-fg); }
.check.done .label { color: var(--muted); text-decoration: line-through; }
.check .label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.check .sub { color: var(--muted); font-size: .85em; white-space: nowrap; }
.check .x { color: var(--muted); padding: 6px 10px; font-size: 20px; line-height: 1; }

/* Group heading inside a list (shopping categories) */
.group { color: var(--muted); font-size: .75rem; letter-spacing: .08em; text-transform: uppercase; margin: 12px 0 2px; }
.group:first-child { margin-top: 0; }

/* Alerts (fired reminders, finished timers) */
.alert {
  background: var(--accent); color: var(--accent-fg);
  border-radius: var(--radius); padding: 16px 18px;
  display: flex; align-items: center; gap: 14px;
  font-size: 1.25rem; font-weight: 600;
}
.alert .btn { background: var(--accent-fg); color: var(--accent); }

/* Timer chip */
.timer {
  display: inline-flex; flex-direction: column; align-items: center;
  padding: 10px 16px; border-radius: var(--radius); border: 1px solid var(--line);
  min-width: 110px;
}
.timer .t { font-size: 1.8rem; font-variant-numeric: tabular-nums; font-weight: 600; }
.timer .l { color: var(--muted); font-size: .8rem; }
.timer.done { background: var(--accent); color: var(--accent-fg); border-color: var(--accent); }
.timer.done .l { color: var(--accent-fg); }

/* Mic button */
.mic {
  width: 56px; height: 56px; border-radius: 50%; flex: none;
  background: var(--accent); color: var(--accent-fg);
  display: grid; place-items: center; font-size: 24px;
}
.mic.listening { animation: pulse 1s infinite; }
@keyframes pulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.12); } }

.hidden { display: none !important; }

/* ---------- animated weather icons (web/weather-icons.js) ---------- */
:root {
  --wx-sun: #f6b83c; --wx-moon: #e4ddc8; --wx-cloud: #d5dce4; --wx-cloud-dark: #9aa6b4;
  --wx-rain: #4a90d9; --wx-snow: #eaf3fb; --wx-bolt: #ffd84a; --wx-fog: #b8c2cc;
}
body[data-theme="light"] { --wx-cloud: #c9d2dc; --wx-snow: #6f93b3; --wx-fog: #aab5c0; --wx-moon: #b9a97a; }
/* Clouds stay light here: a dark brown cloud on black reads as something else entirely. */
body[data-theme="amber"], body[data-theme="off"] {
  --wx-sun: #e08a1e; --wx-moon: #d08a3a; --wx-cloud: #d9b57c; --wx-cloud-dark: #b08a52;
  --wx-rain: #c47a1a; --wx-snow: #e0a860; --wx-bolt: #ffb640; --wx-fog: #a8803e;
}
.wx-icon { display: block; }
.wx-rays { animation: wxSpin 40s linear infinite; }
.wx-glow { animation: wxGlow 4s ease-in-out infinite; }
.wx-moon { animation: wxSway 6s ease-in-out infinite; }
.wx-star { animation: wxTwinkle 2.4s ease-in-out infinite; }
.wx-cloud { animation: wxDrift 7s ease-in-out infinite alternate; }
.wx-cloud-slow { animation-duration: 10s; }
.wx-cloud-back { animation-direction: alternate-reverse; animation-duration: 9s; opacity: .85; }
.wx-drop { animation: wxRain 1.1s linear infinite; }
.wx-flake { animation: wxSnow 3.2s ease-in infinite; }
.wx-flake-spin { animation: wxFlakeSpin 5s linear infinite; }
.wx-bolt { animation: wxFlash 3.2s ease-in-out infinite; }
.wx-fog { animation: wxFog 5s ease-in-out infinite alternate; }
@keyframes wxSpin { to { transform: rotate(360deg); } }
@keyframes wxGlow { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.06); } }
@keyframes wxSway { 0%, 100% { transform: rotate(-4deg); } 50% { transform: rotate(4deg); } }
@keyframes wxTwinkle { 0%, 100% { opacity: .2; } 50% { opacity: 1; } }
@keyframes wxDrift { from { transform: translateX(-3px); } to { transform: translateX(3px); } }
@keyframes wxRain { 0% { transform: translateY(0); opacity: 0; } 15% { opacity: 1; } 85% { opacity: .9; } 100% { transform: translateY(24px); opacity: 0; } }
@keyframes wxSnow { 0% { transform: translate(0, 0); opacity: 0; } 15% { opacity: 1; } 50% { transform: translate(3px, 12px); } 100% { transform: translate(-2px, 26px); opacity: 0; } }
@keyframes wxFlakeSpin { to { transform: rotate(360deg); } }
@keyframes wxFlash { 0%, 100% { opacity: .25; } 42% { opacity: .25; } 45% { opacity: 1; } 50% { opacity: .4; } 54% { opacity: 1; } 62% { opacity: .25; } }
@keyframes wxFog { from { transform: translateX(-6px); } to { transform: translateX(6px); } }
/* Nothing is visible while asleep, so stop the animations to save the battery. */
body[data-mode="sleep"] .wx-icon * { animation-play-state: paused; }
@media (prefers-reduced-motion: reduce) { .wx-icon * { animation: none !important; } }

/* "More below" hints (web/scrollhint.js): a pair of soft chevrons sliding down at the bottom of any
   scroller with content past its edge, plainly a motion cue and not a button; a soft shadow at the
   top once scrolled. */
.can-scroll-down::after {
  content: "SCROLL"; position: sticky; bottom: 0; display: block; width: max-content; margin: -54px auto 0; z-index: 2;
  padding: 0 18px 24px; color: var(--muted); font: 700 .6rem/1.2 var(--font, system-ui, sans-serif); letter-spacing: .18em; text-align: center; opacity: .75; pointer-events: none;
  text-shadow: 0 0 10px var(--card, #000), 0 0 16px var(--card, #000);
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 22'%3E%3Cpath d='M4 4 L20 18 L36 4' fill='none' stroke='%23a9b4c0' stroke-width='5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat center bottom 2px / 34px 20px;
  animation: hint-slide 1.8s ease-in-out infinite;
}
.can-scroll-up { box-shadow: inset 0 14px 12px -12px rgba(0,0,0,.55); }
@keyframes hint-slide { 0% { translate: 0 -5px; opacity: .35; } 55% { opacity: 1; } 100% { translate: 0 6px; opacity: 0; } }

/* Dialog scrollers show a real scrollbar on the right (the overlay ones fade away on tablets). */
/* The burn-in confirmation (engine/dialogs.js confirmBurnIn), one dialog for the screen's settings and the phone's Studio. */
.burnin-card { padding: 18px 20px; font-size: 1rem; line-height: 1.45; max-height: 86vh; overflow-y: auto; }
.burnin-card h3 { margin: 0 0 8px; color: var(--danger); }
.burnin-card ul { margin: 0 0 12px; padding-left: 20px; }
.burnin-card li { margin: 8px 0; }
.burnin-card .what { margin: 0 0 10px; color: var(--muted); font-size: .95rem; }
.burnin-card .why { color: var(--muted); font-size: .9rem; }
.burnin-card .muted { color: var(--muted); font-weight: 400; }
.burnin-card label.row { display: flex; align-items: flex-start; gap: 10px; margin: 6px 0 14px; font-weight: 600; }
.burnin-card label.row input { width: 24px; height: 24px; margin-top: 2px; flex: none; }
.burnin-card .row.gap { justify-content: flex-end; gap: 10px; }
.burnin-card .btn.danger { background: var(--danger); color: #fff; border-color: transparent; }
.burnin-card .btn.danger:disabled { opacity: .4; }
.settings [data-pane], .settings .picker, #daydlg .dd-hours, .burnin-card, dialog#meal, #cook .ck-ings, #cook .ck-steps {
  scrollbar-width: thin; scrollbar-color: var(--muted) transparent;
}
.settings [data-pane]::-webkit-scrollbar, .settings .picker::-webkit-scrollbar, #daydlg .dd-hours::-webkit-scrollbar, .burnin-card::-webkit-scrollbar, dialog#meal::-webkit-scrollbar, #cook .ck-ings::-webkit-scrollbar, #cook .ck-steps::-webkit-scrollbar { width: 9px; }
.settings [data-pane]::-webkit-scrollbar-thumb, .settings .picker::-webkit-scrollbar-thumb, #daydlg .dd-hours::-webkit-scrollbar-thumb, .burnin-card::-webkit-scrollbar-thumb, dialog#meal::-webkit-scrollbar-thumb, #cook .ck-ings::-webkit-scrollbar-thumb, #cook .ck-steps::-webkit-scrollbar-thumb { background: var(--muted); border-radius: 5px; border: 2px solid transparent; background-clip: padding-box; }
.settings [data-pane]::-webkit-scrollbar-track, .settings .picker::-webkit-scrollbar-track, #daydlg .dd-hours::-webkit-scrollbar-track, .burnin-card::-webkit-scrollbar-track, dialog#meal::-webkit-scrollbar-track { background: transparent; }

/* Hints (web/engine/hints.js): a small callout beside a control; "always" ones are quiet lines */
.kd-hint { position: fixed; z-index: 9000; max-width: 280px; padding: 9px 12px; border-radius: 12px; background: var(--accent); color: #fff; font: 500 .92rem/1.35 var(--font, system-ui, sans-serif);
  box-shadow: 0 10px 26px rgba(0,0,0,.35); display: flex; gap: 10px; align-items: flex-start; animation: kd-hint-in .25s ease-out; pointer-events: auto; }
.kd-hint::before { content: ""; position: absolute; left: calc(var(--arrow, 50%) - 7px); width: 14px; height: 14px; background: inherit; transform: rotate(45deg); }
.kd-hint.below::before { top: -6px; } .kd-hint.above::before { bottom: -6px; }
.kd-hint .kd-hint-text { flex: 1; min-width: 0; }
.kd-hint .kd-hint-x { flex: none; width: 28px; height: 28px; margin: -5px -6px -5px 0; border-radius: 50%; border: 0; background: rgba(255,255,255,.18); color: inherit; font: inherit; font-size: 1.1rem; line-height: 1; padding: 0; cursor: pointer; }
.kd-hint.always { background: var(--card); color: var(--muted); border: 1px solid var(--line); box-shadow: 0 4px 14px rgba(0,0,0,.18); font-weight: 400; font-size: .85rem; }
.kd-hint.out { opacity: 0; transition: opacity .2s; }
@keyframes kd-hint-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
/* A line of guidance that is part of a page or a tab, not a callout */
.hint-line { display: flex; gap: 8px; align-items: flex-start; padding: 8px 12px; border-radius: 10px; background: color-mix(in srgb, var(--accent) 10%, transparent); color: var(--fg); font-size: .9rem; line-height: 1.4; margin: 0 0 12px; }
.hint-line::before { content: "💡"; flex: none; }

/* A button that cannot do anything right now looks the part */
.btn:disabled, .btn[disabled] { opacity: .35; cursor: default; pointer-events: none; }

/* Whose: a small coloured circle with an initial (web/shared.js personChip) */
.pwho { display: inline-grid; place-items: center; width: 1.45em; height: 1.45em; border-radius: 50%; font-size: .72em; font-weight: 700; color: #0f1115; flex: none; margin-left: .4em; vertical-align: middle; line-height: 1; }
