/* The app's own screens, around the shared panel. DRAFT for review: nothing here is approved.
   The panel's tokens (panel.css :root) are the palette; one obvious thing per screen, the big action in thumb reach. */
:root {
  --press: 140ms;
  --tile: #1C1C1E;
}
html { -webkit-tap-highlight-color: transparent; }
body.remote:not(.on-panel) #app { display: none; }
body.remote.on-panel .screens { display: none; }
input, textarea, select { font-size: 17px; }
a.big, button.big, button.quiet, .hold { touch-action: manipulation; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }

/* ---- a screen: the words at the top, the one action at the bottom ---- */
.screens {
  position: fixed; inset: 0; overflow-y: auto; overscroll-behavior: contain;
  padding: calc(var(--st) + 28px) calc(var(--sr) + 24px) calc(var(--sb) + 20px) calc(var(--sl) + 24px);
  display: flex; flex-direction: column;
}
.screen { flex: 1; display: flex; flex-direction: column; width: 100%; max-width: 28rem; margin: 0 auto; }
.screen[hidden], .unconfirmed[hidden] { display: none; }
.screen .top { flex: 1; display: flex; flex-direction: column; justify-content: center; gap: 0; padding-bottom: 24px; }
.screen .act { display: flex; flex-direction: column; gap: 4px; }
.screen h1 { font-size: 28px; line-height: 1.15; font-weight: 700; letter-spacing: -0.02em; margin: 0 0 12px; text-wrap: balance; }
.screen p { font-size: 17px; line-height: 1.45; color: var(--muted); margin: 0 0 16px; text-wrap: pretty; }
.screen p b { color: var(--text); font-weight: 600; }
.screen .small { font-size: 15px; }

/* The mark at the top of a screen: one icon in a rounded tile, coloured by what it means. */
.mark { width: 72px; height: 72px; border-radius: 20px; background: var(--card); display: grid; place-items: center; margin-bottom: 24px; color: var(--blue); }
.mark svg { width: 40px; height: 40px; }
.mark.amber { color: var(--amber); }
.mark.green { color: var(--green); }
.mark.quiet { color: var(--muted); }
.mark.busy svg { animation: breathe 1600ms ease-in-out infinite; }
@keyframes breathe { 50% { opacity: 0.45; } }

/* ---- the one big action ---- */
.big {
  display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 56px; width: 100%;
  padding: 0 20px; border-radius: 16px; border: 0; background: var(--blue); color: #fff;
  font: 600 18px/1.2 inherit; letter-spacing: -0.01em; text-decoration: none; text-align: center;
  transition: transform var(--press) var(--ease-out), background-color var(--press) ease;
}
.big:active { transform: scale(0.97); background: #0071e3; }
.big svg { width: 24px; height: 24px; }
.big:disabled { background: var(--raised); color: var(--muted); }
.quiet { min-height: 48px; background: none; border: 0; color: var(--blue); font: 500 17px inherit; border-radius: 12px; transition: transform var(--press) var(--ease-out), opacity var(--press) ease; }
.quiet:active { transform: scale(0.97); opacity: 0.6; }
@media (hover: hover) and (pointer: fine) {
  .big:hover { background: #2b95ff; }
  .quiet:hover { opacity: 0.8; }
}

/* ---- naming the phone ---- */
#nameForm { display: flex; flex-direction: column; gap: 16px; }
#phoneName {
  width: 100%; min-height: 56px; padding: 0 16px; border-radius: 14px; border: 1px solid var(--hair);
  background: var(--sheet); color: var(--text); font-size: 18px; caret-color: var(--blue);
  transition: border-color 160ms ease;
}
#phoneName:focus { outline: none; border-color: var(--blue); }
#phoneName::placeholder { color: var(--dim); }

/* ---- step 2's page in Safari or Chrome: how to add the icon, with pictures ---- */
.steps { list-style: none; counter-reset: step; display: flex; flex-direction: column; gap: 14px; margin: 8px 0 20px; }
.steps li { counter-increment: step; display: grid; grid-template-columns: 32px 1fr; gap: 12px; align-items: start; font-size: 17px; line-height: 1.4; }
.steps li::before { content: counter(step); width: 32px; height: 32px; border-radius: 50%; background: var(--card); color: var(--text); display: grid; place-items: center; font-weight: 600; font-size: 15px; }
.pic { grid-column: 2; margin-top: 8px; border-radius: 14px; background: var(--sheet); border: 1px solid var(--hair); padding: 12px; display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 15px; }
.pic svg { width: 26px; height: 26px; flex: none; }
.pic .hot { color: var(--blue); }
.pic .bar { flex: 1; height: 30px; border-radius: 9px; background: var(--card); }
.pic.row { justify-content: space-between; color: var(--text); }

/* ---- waiting for the tablet's yes: a picture of what the tablet shows ---- */
.tabletpic { border-radius: 18px; background: var(--sheet); border: 1px solid var(--hair); padding: 18px; margin: 8px 0 16px; text-align: center; }
.tabletpic .q { font-weight: 600; font-size: 17px; margin-bottom: 12px; }
.tabletpic .pin { display: flex; justify-content: center; gap: 10px; margin-bottom: 14px; }
.tabletpic .pin i { width: 12px; height: 12px; border-radius: 50%; border: 1.5px solid var(--muted); }
.tabletpic .btns { display: flex; gap: 8px; }
.tabletpic .btns span { flex: 1; padding: 10px; border-radius: 10px; background: var(--card); font-size: 15px; }
.tabletpic .btns span.yes { background: var(--blue); color: #fff; font-weight: 600; }

/* ---- "Can't reach your van": calm, one button ---- */
.retrying { display: flex; align-items: center; justify-content: center; gap: 8px; color: var(--dim); font-size: 14px; min-height: 32px; }
.retrying i { width: 6px; height: 6px; border-radius: 50%; background: var(--dim); animation: breathe 1600ms ease-in-out infinite; }

/* ---- over the panel: a press not confirmed within 3 seconds ---- */
.unconfirmed {
  position: fixed; z-index: 30; left: calc(var(--sl) + 12px); right: calc(var(--sr) + 12px); bottom: calc(var(--sb) + 12px);
  display: flex; gap: 12px; align-items: center; justify-content: space-between; padding: 12px 12px 12px 16px;
  border-radius: 18px; background: rgba(44, 44, 46, 0.86); -webkit-backdrop-filter: blur(20px) saturate(160%); backdrop-filter: blur(20px) saturate(160%);
  color: var(--text); font-size: 15px; box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
  transition: opacity 200ms ease, transform 240ms var(--ease-out);
  @starting-style { opacity: 0; transform: translateY(12px); }
}
.unconfirmed .pill { flex: none; display: flex; align-items: center; gap: 6px; color: #fff; background: var(--blue); min-height: 40px; padding: 0 14px; border-radius: 999px; text-decoration: none; font-weight: 600; }
.unconfirmed .pill svg { width: 18px; height: 18px; }

/* ---- the panel's corner: which way it's connected (a globe over the internet) ---- */
.via { width: 30px; height: 30px; display: grid; place-items: center; color: var(--muted); }
.via svg { width: 20px; height: 20px; }
body.remote .corner .dot { display: none; }

/* ---- press and hold (fridge off, all off, charging off, remove a phone, internet off) ---- */
.hold {
  position: relative; overflow: hidden; isolation: isolate; display: flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 52px; padding: 0 18px; border-radius: 14px; border: 0; background: var(--card); color: var(--text);
  font: 600 16px/1.2 inherit; transition: transform var(--press) var(--ease-out);
}
.hold:active { transform: scale(0.97); }
.hold svg { width: 20px; height: 20px; }
.hold-fill { position: absolute; inset: 0; z-index: -1; background: var(--red); clip-path: inset(0 100% 0 0); transition: clip-path 200ms var(--ease-out); }
.hold.holding .hold-fill { clip-path: inset(0 0 0 0); transition: clip-path var(--hold-ms, 900ms) linear; }
.hold.held .hold-fill { clip-path: inset(0 0 0 0); }
.hold.danger { color: var(--red); }
.hold.danger.holding, .hold.danger.held { color: #fff; }

/* ---- the heater card's start from away ---- */
.away-card { border-radius: 18px; background: var(--sheet); padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.away-card .head { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 17px; }
.away-card .head svg { width: 22px; height: 22px; color: var(--ember); }
.away-card .run { display: flex; align-items: baseline; gap: 6px; }
.away-card .run b { font-size: 34px; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.away-card .run span { color: var(--muted); font-size: 15px; }
.away-card .note { color: var(--muted); font-size: 14px; line-height: 1.4; }
.away-card .big.ember { background: var(--ember); }
.away-card .big.ember:active { background: #e8692f; }

@media (prefers-reduced-motion: reduce) {
  .mark.busy svg, .retrying i { animation: none; }
  .big:active, .quiet:active, .hold:active { transform: none; }
  .hold.holding .hold-fill { transition: clip-path var(--hold-ms, 900ms) linear; }
}
