/* Tandem Baby Monitor (Nov 26, 2026). The site's colors; follows the phone's light or dark setting before a session,
   and the baby phone is always the dark screen during one. */
:root {
  --ground: #FFFEFA; --text: #3B2630; --quiet: #6A5560; --outline: #C9B4BD; --panel: #FFFFFF; --birth: #8E3B52;
  --pri-bg: #8E3B52; --pri-fg: #FFFFFF; --soft: #F4DDEE; --warn-bg: #F7EBBF; --warn-fg: #3B2630; --focus: #8E3B52;
}
@media (prefers-color-scheme: dark) {
  :root { --ground: #171113; --text: #FFF6EF; --quiet: #B9A7AE; --outline: #5A4850; --panel: #2A1F25; --birth: #F2938C; --pri-bg: #F2938C; --pri-fg: #171113; --soft: #3A2A31; --warn-bg: #4A3F1A; --warn-fg: #FFF6EF; --focus: #F2938C; }
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--ground); color: var(--text); font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif; -webkit-text-size-adjust: 100%; line-height: 1.45; }
body { overflow-x: hidden; touch-action: manipulation; }
button, input { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
h1[tabindex="-1"]:focus, h2[tabindex="-1"]:focus { outline: none; }
[hidden] { display: none !important; }
.vh { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

.app { max-width: 560px; margin: 0 auto; padding: calc(12px + env(safe-area-inset-top)) 16px calc(28px + env(safe-area-inset-bottom)); }
.bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 48px; }
.wm { font-family: "Fraunces", Georgia, serif; font-weight: 600; font-size: 1.1rem; }
.wm .r { color: var(--birth); }
h1 { font-family: "Fraunces", Georgia, serif; font-weight: 600; font-size: 1.75rem; line-height: 1.15; margin: 14px 0 2px; }
.by { margin: 0 0 12px; color: var(--quiet); font-size: 15px; }
h2 { font-family: "Fraunces", Georgia, serif; font-weight: 600; font-size: 1.25rem; margin: 20px 0 8px; }
p { margin: 0 0 12px; }
.quiet { color: var(--quiet); }
.small { font-size: 14px; }
.note { background: var(--soft); border-radius: 14px; padding: 12px 14px; margin: 12px 0; }
.warn { background: var(--warn-bg); color: var(--warn-fg); border-radius: 14px; padding: 12px 14px; margin: 12px 0; font-weight: 600; }
ul.needs { padding-left: 20px; margin: 0 0 12px; }
ul.needs li { margin-bottom: 6px; }

.btn { display: block; width: 100%; min-height: 48px; padding: 10px 16px; border-radius: 14px; border: 1.5px solid var(--outline); background: var(--panel); font-weight: 600; text-align: center; cursor: pointer; text-decoration: none; }
.btn.pri { background: var(--pri-bg); color: var(--pri-fg); border-color: var(--pri-bg); }
.btn.big { min-height: 64px; font-size: 1.15rem; }
.btn + .btn { margin-top: 10px; }
.link { background: none; border: 0; padding: 0 4px; min-height: 44px; min-width: 44px; color: var(--birth); font-weight: 600; text-decoration: underline; cursor: pointer; }
.roles { display: grid; gap: 12px; margin: 16px 0; }
.role { display: block; width: 100%; text-align: left; min-height: 96px; padding: 16px; border-radius: 18px; border: 2px solid var(--outline); background: var(--panel); cursor: pointer; }
.role b { display: block; font-size: 1.2rem; margin-bottom: 4px; }
.role span { color: var(--quiet); font-size: 15px; }
.role.pri { border-color: var(--birth); }

.checks { list-style: none; padding: 0; margin: 12px 0; }
.checks li { margin-bottom: 8px; }
.checks label { display: flex; gap: 12px; align-items: flex-start; min-height: 44px; padding: 10px 12px; border-radius: 12px; border: 1.5px solid var(--outline); background: var(--panel); cursor: pointer; }
.checks input { width: 22px; height: 22px; margin: 1px 0 0; flex: none; accent-color: var(--birth); }
.fld { display: block; margin: 10px 0; font-weight: 600; }
.fld input { display: block; width: 100%; min-height: 48px; margin-top: 6px; padding: 8px 12px; border-radius: 12px; border: 1.5px solid #9C8491; background: var(--panel); font-size: 1.15rem; letter-spacing: .08em; text-transform: uppercase; }
.code { font-family: ui-monospace, Menlo, monospace; font-size: 1.5rem; font-weight: 700; letter-spacing: .05em; text-align: center; padding: 12px; border-radius: 12px; background: var(--panel); border: 1.5px solid var(--outline); word-break: break-all; }
.qr { display: flex; justify-content: center; margin: 12px 0; }
.qr svg, .qr img { width: 180px; height: 180px; background: #fff; padding: 8px; border-radius: 10px; }
.req { border: 2px solid var(--birth); border-radius: 14px; padding: 12px; margin: 12px 0; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.row2 .btn + .btn { margin-top: 0; }

/* the baby phone: always dark, a dim clock that moves a little every minute */
body.baby { background: #000; }
.babyscreen { position: fixed; inset: 0; background: #000; color: #8A7A80; display: flex; flex-direction: column; justify-content: space-between; padding: calc(16px + env(safe-area-inset-top)) 16px calc(16px + env(safe-area-inset-bottom)); }
.babyscreen .clock { font-size: 3.2rem; font-weight: 300; color: #6E6066; transition: transform 1.5s; text-align: center; }
.babyscreen .line { font-size: 15px; color: #A8989E; text-align: center; margin: 0; }
.babyscreen .stop { min-height: 48px; width: 100%; border-radius: 14px; border: 1.5px solid #4A3A42; background: transparent; color: #C9B8BE; font-weight: 600; cursor: pointer; }
.babyscreen .stop.armed { border-color: #F2938C; color: #FFD3CF; }
.babyscreen .micbtn { min-height: 48px; width: 100%; border-radius: 14px; border: 2px solid #F2938C; background: transparent; color: #FFD3CF; font-weight: 700; cursor: pointer; margin-bottom: 10px; }

/* the listening phone */
.status { font-size: 1.2rem; font-weight: 700; margin: 12px 0; }
.meter { height: 18px; border-radius: 9px; background: var(--panel); border: 1.5px solid var(--outline); overflow: hidden; }
.meter i { display: block; height: 100%; width: 0; background: var(--birth); transition: width .3s; }
.meter.open i { background: #1F7A54; }
ol.log { padding-left: 0; list-style: none; margin: 0; }
ol.log li { padding: 6px 0; border-bottom: 1px solid var(--outline); font-size: 15px; }
ol.log time { font-weight: 700; margin-right: 6px; }

.alarm { position: fixed; inset: 0; z-index: 50; background: #A3192C; color: #FFFFFF; display: flex; align-items: center; justify-content: center; padding: 24px; }
.alarm-in { max-width: 480px; width: 100%; text-align: center; }
.alarm-t { font-size: 1.6rem; font-weight: 700; line-height: 1.3; margin: 0 0 24px; }
.alarm .btn { background: #FFFFFF; color: #6B0F1C; border-color: #FFFFFF; }
.noscript { padding: 16px; }

/* Nov 27, 2026: pairing first and prominent, settings, keeping the screen on */
.bar-r { display: flex; gap: 4px; align-items: center; }
.pairbox { border: 2px solid var(--birth); border-radius: 18px; padding: 16px; margin: 12px 0 16px; background: var(--panel); }
.pairbox h2 { margin-top: 0; }
.pairbox.ok { border-color: var(--outline); }
.pairbox .btn + .btn { margin-top: 10px; }
.pairbox .row2 .btn + .btn { margin-top: 0; }
.qr.big svg { width: min(78vw, 300px); height: min(78vw, 300px); }
#scanBox video { display: block; width: 100%; max-height: 60vh; object-fit: cover; border-radius: 14px; background: #000; margin: 8px 0; }
.choices { display: grid; gap: 8px; margin: 6px 0 12px; }
.choices label { display: flex; gap: 12px; align-items: center; min-height: 44px; padding: 8px 12px; border-radius: 12px; border: 1.5px solid var(--outline); background: var(--panel); cursor: pointer; }
.choices input { width: 22px; height: 22px; margin: 0; accent-color: var(--birth); flex: none; }
h3 { font-size: 1rem; margin: 14px 0 4px; }
section { padding: 6px 0 14px; border-bottom: 1px solid var(--outline); }
.fld.plain input { letter-spacing: normal; text-transform: none; font-size: 1rem; }
.keep-os ol { padding-left: 20px; margin: 4px 0 10px; }
.keep-os li { margin-bottom: 6px; }
details.keep-more { margin: 10px 0; }
details.keep-more > summary { min-height: 44px; display: flex; align-items: center; cursor: pointer; font-weight: 600; color: var(--birth); }

/* Nov 27, 2026, second pass (Jeff: "ui is a bit crowded and not clean, too many words. settings should be gear") */
.icon-btn { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; padding: 0 8px; border: 0; border-radius: 12px; background: none; color: var(--birth); font-weight: 700; cursor: pointer; }
.icon-btn:hover { background: var(--soft); }
.icon-btn.lang { font-size: 15px; letter-spacing: .04em; }
.pairline { display: flex; align-items: center; gap: 10px; padding: 10px 12px; margin: 10px 0 14px; border-radius: 14px; background: var(--panel); border: 1.5px solid var(--outline); }
.pairline > span:nth-child(2) { flex: 1; min-width: 0; }
.pairline b { display: block; }
.pairline .dot { width: 10px; height: 10px; border-radius: 50%; background: #1F7A54; flex: none; }
.pairbox .small { margin-bottom: 12px; }
.role { min-height: 84px; }
.role b { font-size: 1.1rem; }
.statuscard { border-radius: 18px; padding: 14px; margin: 10px 0 14px; background: var(--panel); border: 1.5px solid var(--outline); }
.statuscard .status { margin: 0 0 10px; }
.statuscard.loud { border-color: #1F7A54; }
.seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; padding: 4px; border-radius: 14px; background: var(--soft); }
.seg button { min-height: 44px; border: 0; border-radius: 10px; background: transparent; font-weight: 600; cursor: pointer; color: var(--text); }
.seg button[aria-pressed="true"] { background: var(--pri-bg); color: var(--pri-fg); }
.seg-note { margin: 6px 2px 12px; }
.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin: 0 0 12px; }
.stats .tile { border-radius: 14px; padding: 10px 12px; background: var(--panel); border: 1.5px solid var(--outline); }
.stats .tile b { display: block; font-size: 1.35rem; font-variant-numeric: tabular-nums; }
.stats .tile span { color: var(--quiet); font-size: 14px; }
.keep-more .needs { margin-top: 6px; }
