/* ===== Screens (2026-11-28): the car's dashboard display, the projector, and stand-ins for older browsers. =====
   Linked after app.css. The phone, the iPads and the Mac are untouched by the first two parts. */

/* ---------- 1. Older browsers (the projector's own is a 2020 engine, Chromium 69) ---------- */
/* No blur behind a bar: make the bar solid, or the page shows through it. */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  :root { --glass: var(--surface); --glass-strong: var(--surface); --glass-border: var(--hairline); }
}
/* No aspect-ratio: give every picture box a height of its own. */
@supports not (aspect-ratio: 1 / 1) {
  .recipe-card img, .no-photo, .stock-place img, .stock-place .no-photo, .slime-photo img, .meal-tile__photo, .recipe-card__photo { height: 11rem; }
  .meal-tile__empty { height: 11rem; }
  .week-strip__photo, .week-strip__empty { height: 6rem; }
  .school-post__media img { height: 8rem; }
  .scr__player { height: 33vw; }
}
/* A finger or a mouse leaves no ring behind where the browser can tell them from a keyboard (base.css draws the ring on :focus). */
.tick input:focus:not(:focus-visible) + .tick__box, .swatch input:focus:not(:focus-visible) + span,
.colour-swatch input:focus:not(:focus-visible) + span.dot { outline: none; }

/* ---------- 2. The car screen and the projector ---------- */
/* Everything is sized in rem, so one number scales the whole app to the window:
   the car's 12.3-inch screen is 720 high at full size (1rem = 20px there, whatever the box reports),
   the projector's picture is 1080 high (1rem = 16px there). Both are read from a seat, not held. */
html.surface-car { font-size: 2.7778vh; }
html.surface-screen { font-size: 1.4815vh; }
.surface-car, .surface-screen {
  --fs-caption: 1rem; --fs-footnote: 1.1rem; --fs-sub: 1.25rem; --fs-body: 1.5rem; --fs-headline: 1.6rem;
  --fs-title-3: 1.8rem; --fs-title-2: 2rem; --fs-title-1: 2.4rem; --fs-large: 2.8rem; --fs-menu-label: 1rem;
  --control-h: 4rem; --control-h-lg: 4.5rem; --tap-min: 4rem; --icon-app: 3rem; --icon-app-sheet: 4.5rem;
  --page-pad: 1.75rem; --section-gap: 1.25rem; --rail: 7rem;
  --glass: var(--surface); --glass-strong: var(--surface);   /* no see-through bars: a moving car and a slow box */
}
.surface-car *, .surface-screen * { -webkit-backdrop-filter: none !important; backdrop-filter: none !important; }

/* The menu is a rail down the left edge: the car's screen is wide and short, and a remote finds an edge easily.
   It is the phone's four tabs and its Apps button, stood on end. */
.surface-car .app-bar, .surface-screen .app-bar, .surface-car .tab-bar__fade, .surface-screen .tab-bar__fade,
.surface-car .topline__start, .surface-screen .topline__start { display: none; }
body.surface-car, body.surface-screen { padding: 0 0 0 var(--rail); }
.surface-car .tab-bar, .surface-screen .tab-bar { display: flex; flex-direction: column; position: fixed; top: 0; bottom: 0; left: 0; width: var(--rail);
  z-index: 30; padding: 0.4rem; background: var(--surface); border-right: 1px solid var(--hairline); }
.surface-car .tab-bar__tabs, .surface-screen .tab-bar__tabs { display: flex; flex-direction: column; flex: 4; }
.surface-car .tab-bar__tab, .surface-screen .tab-bar__tab, .surface-car .tab-bar__apps, .surface-screen .tab-bar__apps {
  display: flex; flex-direction: column; align-items: center; justify-content: center; flex: 1; width: auto; height: auto; min-height: var(--control-h);
  border-radius: 1rem; color: var(--text); font-size: var(--fs-menu-label); font-weight: 600; text-decoration: none; }
.surface-car .tab-bar__tab img, .surface-screen .tab-bar__tab img, .surface-car .tab-bar__apps img, .surface-screen .tab-bar__apps img { width: 2.2rem; height: 2.2rem; margin-bottom: 0.2rem; }
.surface-car .tab-bar [aria-current="page"], .surface-screen .tab-bar [aria-current="page"] { background: var(--fill-quiet); color: var(--accent); font-weight: 800; }

/* The page uses the whole width; "who's using this" sits in the top corner and takes no row of its own. */
.surface-car main, .surface-screen main,
.surface-car main[data-page], .surface-screen main[data-page] { max-width: none; padding: 1rem var(--page-pad) 2rem; }
.surface-car .topline, .surface-screen .topline { display: flex; position: absolute; top: 0.6rem; right: var(--page-pad); max-width: none; margin: 0; padding: 0; z-index: 5; }
.surface-car .me-mark .avatar, .surface-screen .me-mark .avatar { width: 3rem; height: 3rem; }
.surface-car .me-mark, .surface-screen .me-mark { min-width: var(--control-h); min-height: var(--control-h); }
.surface-car .page-head, .surface-screen .page-head, .surface-car main > h1:first-child, .surface-screen main > h1:first-child { padding-right: 10rem; }
/* Calendar and Housework: the title, the view switch and previous/next share one row. */
.surface-car.page-calendar main > h1, .surface-screen.page-calendar main > h1, .surface-car.page-housework main > h1, .surface-screen.page-housework main > h1,
.surface-car.page-calendar .cal-views, .surface-screen.page-calendar .cal-views, .surface-car.page-housework .cal-views, .surface-screen.page-housework .cal-views
  { float: left; margin: 0 1.5rem 0.8rem 0; padding-right: 0; }
.surface-car.page-calendar .cal-nav, .surface-screen.page-calendar .cal-nav { margin: 0 10rem 0.8rem 0; }
.surface-car.page-calendar .cal-nav ~ *, .surface-screen.page-calendar .cal-nav ~ *, .surface-car.page-housework .cal-views ~ *, .surface-screen.page-housework .cal-views ~ * { clear: both; }
.surface-car h1, .surface-screen h1 { font-size: var(--fs-large); margin: 0 0 0.6rem; }
/* The car's screen is short: the greeting and the date share one line. */
.surface-car .page-head { align-items: center; margin-bottom: 0.8rem; }
.surface-car .page-head > div { display: flex; flex-wrap: wrap; align-items: baseline; }
.surface-car .page-head h1 { order: -1; margin: 0 1.2rem 0 0; font-size: var(--fs-title-1); }
.surface-car h2, .surface-screen h2, .surface-car .home-section h2, .surface-screen .home-section h2 { margin: 0.8rem 0 0.5rem; }
.surface-car .card, .surface-screen .card { padding: 1.1rem 1.25rem; }
/* These layouts go narrow below a width in pixels; here width is counted in rem, so keep the wide form. */
.surface-car .grid-5, .surface-screen .grid-5, .surface-car .recipe-grid.grid-5, .surface-screen .recipe-grid.grid-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.surface-car .grid-main-side, .surface-screen .grid-main-side { grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); gap: var(--space-6); }

/* Everything pressable is at least as tall as a control here (80px on the car's 720-high screen, 64px on the projector).
   !important: this is the floor for these two screens, whatever a page's own rule says. */
.surface-car button, .surface-screen button, .surface-car select, .surface-screen select, .surface-car summary, .surface-screen summary,
.surface-car input:not([type="checkbox"]):not([type="radio"]), .surface-screen input:not([type="checkbox"]):not([type="radio"]),
.surface-car .btn, .surface-screen .btn, .surface-car .action-link, .surface-screen .action-link, .surface-car .back-link, .surface-screen .back-link,
.surface-car .button-link, .surface-screen .button-link, .surface-car .cell-edit, .surface-screen .cell-edit,
.surface-car .section-head__more, .surface-screen .section-head__more, .surface-car .cal-date, .surface-screen .cal-date,
.surface-car .cal-year a, .surface-screen .cal-year a, .surface-car .cal-nav a, .surface-screen .cal-nav a,
.surface-car .cal-views a, .surface-screen .cal-views a, .surface-car .today-list a, .surface-screen .today-list a,
.surface-car .choice, .surface-screen .choice, .surface-car .segmented label > span, .surface-screen .segmented label > span,
.surface-car .meal-grid td a, .surface-screen .meal-grid td a, .surface-car .meal-days a, .surface-screen .meal-days a,
.surface-car .school-list a, .surface-screen .school-list a, .surface-car .topline__end > a, .surface-screen .topline__end > a,
.surface-car .portions__pick, .surface-screen .portions__pick, .surface-car .tl__date, .surface-screen .tl__date
  { min-height: var(--control-h) !important; min-width: var(--control-h) !important; }
.surface-car summary, .surface-screen summary, .surface-car .section-head__more, .surface-screen .section-head__more,
.surface-car .cell-edit, .surface-screen .cell-edit, .surface-car .button-link, .surface-screen .button-link,
.surface-car .cal-date, .surface-screen .cal-date, .surface-car .cal-year a, .surface-screen .cal-year a,
.surface-car .choice, .surface-screen .choice { display: inline-flex; align-items: center; justify-content: center; }
.surface-car summary, .surface-screen summary { display: flex; justify-content: flex-start; }
.surface-car .apps-sheet__link, .surface-screen .apps-sheet__link { font-size: var(--fs-menu-label); }
.surface-car .tl__ev-title, .surface-screen .tl__ev-title, .surface-kitchen .tl__ev-title { font-size: var(--fs-caption); }

/* Where you are: a thicker ring for the car's control knob and the remote, and the same ring under the remote's pointer. */
.surface-car :focus, .surface-screen :focus { outline-width: 0.3rem; outline-offset: 0.15rem; }
.surface-screen a:hover, .surface-screen button:hover, .surface-screen summary:hover, .surface-screen select:hover, .surface-screen input:hover,
.surface-screen label:hover { outline: 0.3rem solid var(--focus-ring); outline-offset: 0.15rem; text-decoration: none; }
/* Playing YouTube on the projector is no use from the car. */
.surface-car #youtube { display: none; }
.surface-car .home-grid > .home-main, .surface-screen .home-grid > .home-main { grid-column: 1; grid-row: 1 / span 2; }
.surface-screen .home-grid > .yt { grid-column: 2; grid-row: 1; }
.surface-screen .home-grid > .home-side { grid-column: 2; grid-row: 2; }
.surface-car .home-grid > .home-side { grid-column: 2; grid-row: 1 / span 2; }

/* ---------- 3. Fixes from the design review, every device ---------- */
/* Controls a finger can hit: 44px in the hand (the compact layout of 27 Nov), 48px on the kitchen display. */
.brand-mark { align-items: center; justify-content: center; min-width: 2.75rem; min-height: 2.75rem; border-radius: 0; overflow: visible; box-shadow: none; }
.brand-mark img { border-radius: 22.5%; box-shadow: 0 1px 0.1875rem rgba(0, 0, 0, 0.12); }
.tl__date, .back-link, .portions__pick { min-width: 2.75rem; }
summary.sales__shop { display: flex; align-items: center; min-height: 2.75rem; cursor: pointer; }
.cal-year a { display: inline-flex; align-items: center; min-height: 2.75rem; }
.surface-kitchen .me-mark, .surface-kitchen .cal-views a, .surface-kitchen .portions__pick, .surface-kitchen .back-link, .surface-kitchen .brand-mark,
.surface-kitchen .tl__date, .surface-kitchen .search input, .surface-kitchen .slime-buttons button, .surface-kitchen .slime-buttons a,
.surface-kitchen button, .surface-kitchen select, .surface-kitchen summary, .surface-kitchen input:not([type="checkbox"]):not([type="radio"]),
.surface-kitchen .cal-date, .surface-kitchen .cell-edit, .surface-kitchen .cal-year a, .surface-kitchen .segmented label > span,
.surface-kitchen .meal-grid td a, .surface-kitchen .meal-days a, .surface-kitchen .school-list a, .surface-kitchen .today-list a,
.surface-kitchen .topline__end > a { min-width: 3rem !important; min-height: 3rem !important; }
.topline__end > a:not(.me-mark) { display: inline-flex; align-items: center; min-height: 2.75rem; font-size: var(--fs-footnote); }
.surface-kitchen .cal-date, .surface-kitchen .cell-edit { display: inline-flex; align-items: center; justify-content: center; }
input[type="number"] { min-width: 2.75rem !important; }
.cal-year a { min-width: 2.75rem; }
/* Setup, Devices: the kind of device and its Save button stay inside a phone's width. */
.device-kind { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--space-2); align-items: center; max-width: 100%; }
.device-kind select { min-width: 0; width: 100%; }
/* The search box had its ring switched off: show it on the box. */
.search input:focus { outline: 0.1875rem solid var(--focus-ring); outline-offset: 0.125rem; border-radius: var(--r-sm); }
input[type="date"]:focus, input[type="time"]:focus, input[type="number"]:focus, input[type="text"]:focus, input[type="url"]:focus,
input[type="search"]:focus, select:focus, textarea:focus { outline: 0.1875rem solid var(--focus-ring); outline-offset: 0.0625rem; }

/* Home (2026-11-28, Today folded in): on a wide screen YouTube heads the side column and the day fills the main one;
   on a phone they stack in the order they are written: YouTube, the day, the side cards. */
.home-grid > .yt { grid-column: 2; grid-row: 1; margin: 0; align-self: start; }
.home-grid > .home-main { grid-column: 1; grid-row: 1 / span 2; }
.home-grid > .home-side { grid-column: 2; grid-row: 2; }
@media (max-width: 1023px) { .home-grid > .yt, .home-grid > .home-main, .home-grid > .home-side { grid-column: auto; grid-row: auto; } }
.yt__more summary { display: inline-flex; align-items: center; min-height: 2.75rem; color: var(--link); cursor: pointer; }

/* The top line's right-hand end: the language button and who is using this. A grid, so the gap holds in older browsers. */
.topline__end { grid-area: end; justify-self: end; margin-left: auto; display: grid; grid-auto-flow: column; align-items: center; gap: var(--space-3); }
.topline__end .me-mark { margin-left: 0; }
.topline__end .language { margin: 0; }
.topline__end .language button { min-height: 2.75rem; padding: 0 var(--space-4); border: 0; border-radius: var(--r-pill); background: var(--surface-2); color: var(--text); font-size: var(--fs-footnote); font-weight: 600; cursor: pointer; }
.surface-kitchen .topline__end .language button { min-height: 3rem; }
/* A row of a list with its buttons: the buttons drop to the next line on a phone, never off the edge. */
.rule { flex-wrap: wrap; }
