:root {
  --bg: #ffffff;
  --ink: #111113;
  --soft: #3c3c43;
  --muted: #6b6b72;
  --line: #e4e4e9;
  --fill: #f2f2f6;
  --accent: #0a63e0;
  --accent-press: #0852bb;
  --danger: #c9302a;
  --ok: #1a8a4a;
  --warn: #c77700;
  --ring: #0a63e0;
  --float: 0 12px 40px rgba(0, 0, 0, 0.2);
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.4 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
h1, h2, p, figure { margin: 0; }
h1 { font-size: 30px; font-weight: 700; line-height: 1.15; letter-spacing: -0.02em; overflow-wrap: anywhere; }
h2 { font-size: 20px; font-weight: 700; line-height: 1.2; letter-spacing: -0.01em; overflow-wrap: anywhere; }
button, input { font: inherit; color: inherit; }
button { touch-action: manipulation; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--ring); outline-offset: 2px; }

.icon { width: 20px; height: 20px; flex: none; }
.sub { color: var(--muted); font-size: 14px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 48px;
  padding: 0 20px;
  border: 0;
  border-radius: 12px;
  background: var(--fill);
  color: var(--ink);
  font-weight: 600;
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.15s, opacity 0.15s;
}
.btn:active { opacity: 0.75; }
.btn.coral, .btn.dark, .btn.primary { background: var(--accent); color: #fff; }
.btn.coral:hover, .btn.dark:hover, .btn.primary:hover { background: var(--accent-press); }
.btn.line { height: 44px; padding: 0 16px; font-size: 15px; }
.btn.line:hover { background: var(--line); }
.btn.danger { background: var(--danger); color: #fff; }
.btn.quiet { height: 44px; padding: 0 12px; background: transparent; color: var(--danger); font-size: 15px; }
.btn.wide { width: 100%; height: 52px; font-size: 17px; }
.btn[disabled] { opacity: 0.5; cursor: default; }

.round { width: 44px; height: 44px; flex: none; display: grid; place-items: center; border: 0; border-radius: 50%; background: var(--fill); cursor: pointer; }

input[type="text"], input[type="password"], input[type="number"] {
  width: 100%;
  height: 48px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}
input::placeholder { color: var(--muted); opacity: 1; }
input:focus-visible { outline-offset: 0; border-color: var(--ring); }
.field { display: grid; gap: 6px; }
.label { font-size: 14px; font-weight: 600; color: var(--soft); }
.error { color: var(--danger); font-size: 14px; min-height: 20px; }

.avatar { width: 32px; height: 32px; flex: none; display: grid; place-items: center; border-radius: 50%; background: var(--fill); color: var(--soft); font-size: 14px; font-weight: 700; }
.avatar.md, .avatar.lg { width: 44px; height: 44px; font-size: 18px; }

.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.mark { width: 36px; height: 36px; flex: none; display: grid; place-items: center; border-radius: 10px; background: var(--ink); color: #fff; }
.brand-mark { width: 36px; height: 36px; flex: none; border-radius: 10px; object-fit: cover; }
.brand-mark.lg { width: 48px; height: 48px; border-radius: 12px; }
.icon-row { align-items: center; }
.brand-form { display: grid; gap: 12px; justify-items: start; }
.brand-form .field { width: 100%; }
.brand-form input { width: 100%; }
a.btn.wide { box-sizing: border-box; }
.brand-name { font-size: 18px; font-weight: 700; letter-spacing: -0.01em; white-space: nowrap; }

.sign, .open { min-height: 100dvh; display: grid; place-items: center; padding: 24px 20px; }
.sign-box, .open-box { width: 100%; max-width: 360px; display: grid; gap: 14px; }
.sign.split .sign-box h1 { margin-bottom: 0; font-size: clamp(22px, 7.2vw, 28px); white-space: nowrap; }
.sign-sub { margin: -8px 0 6px; color: var(--muted); font-size: 15px; line-height: 1.4; }
.sign-art { display: none; }
.doc { max-width: 620px; margin: 0 auto; padding: 32px 20px 64px; }
.doc .brand { display: inline-flex; margin-bottom: 28px; color: var(--ink); text-decoration: none; }
.doc h1 { margin-bottom: 14px; }
.doc h2 { margin: 26px 0 6px; font-size: 18px; }
.doc p { color: var(--soft); font-size: 16px; line-height: 1.55; }
.or-line { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 13px; }
.or-line::before, .or-line::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.g-mark { width: 20px; height: 20px; flex: none; }
#google { gap: 10px; background: #fff; border: 1px solid #dadce0; color: #1f1f1f; }
.sign-box .brand, .open-box .brand { margin-bottom: 14px; }
.sign-box h1, .open-box h1 { margin-bottom: 10px; }

.phone { max-width: 640px; margin: 0 auto; padding-bottom: 96px; }
.who { display: flex; align-items: center; gap: 12px; padding: 14px 16px; }
.who-text { flex: 1; min-width: 0; }
.who h1 { font-size: 20px; letter-spacing: -0.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.live { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; padding: 4px 16px 18px; }
.live-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.live-head h2 { font-size: 15px; font-weight: 600; color: var(--soft); letter-spacing: 0; }
.live-state { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 14px; font-weight: 600; white-space: nowrap; }
.live-state::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #b5b5bd; }
.live-state.on::before { background: var(--ok); }
.live-state.paused::before { background: var(--warn); }
.bezel { padding: 12px; border-radius: 14px; background: #1b1b1e; box-shadow: 0 10px 24px rgba(0, 0, 0, 0.18); }
.live-screen { position: relative; display: flex; gap: 3px; width: 100%; aspect-ratio: 4 / 3; overflow: hidden; border-radius: 3px; background: #000; }
.live-screen img { flex: 1 1 0; min-width: 0; min-height: 0; width: 100%; height: 100%; object-fit: contain; }
.live-screen.pair img { object-fit: cover; }
.live-screen p { margin: auto; display: flex; align-items: center; gap: 8px; color: #c9c9d1; font-size: 15px; }
.live-ctl { display: flex; justify-content: center; align-items: center; flex-wrap: wrap; gap: 8px; }
.ctl { width: 48px; height: 48px; display: grid; place-items: center; border: 0; border-radius: 50%; background: var(--fill); cursor: pointer; }
.ctl.main { width: 56px; height: 56px; background: var(--ink); color: #fff; }
.ctl:active { opacity: 0.7; }
.ctl[disabled] { opacity: 0.35; cursor: default; }
.ctl .icon { width: 22px; height: 22px; }

.sendto { display: grid; gap: 8px; padding: 14px 16px; border-top: 1px solid var(--line); font-size: 15px; }
.sendto span { display: flex; align-items: center; gap: 10px; overflow-wrap: anywhere; }
.sendto .icon { width: 18px; height: 18px; color: var(--muted); }
.row-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 16px 16px 10px; border-top: 1px solid var(--line); }
.row-head h2 { font-size: 17px; }
.pair-grid, .cards { display: grid; gap: 2px; }
.pair-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cards { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }

.cell { position: relative; display: block; padding: 0; border: 0; background: var(--fill); cursor: pointer; }
.cell img { display: block; width: 100%; height: auto; aspect-ratio: 1; object-fit: cover; }
.cell:active { opacity: 0.8; }
.cell:focus-visible { outline-offset: -3px; z-index: 1; }
.tag { position: absolute; left: 6px; top: 6px; padding: 2px 8px; border-radius: 999px; background: var(--accent); color: #fff; font-size: 11px; font-weight: 700; }
.month { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 14px 16px 8px; scroll-margin-top: 12px; }
.month h3 { font-size: 15px; font-weight: 600; color: var(--soft); }
.years { display: flex; gap: 8px; padding: 0 16px 4px; overflow-x: auto; }
.years .pick { flex: none; height: 36px; font-size: 14px; font-weight: 600; }
.bezel { position: relative; }
.grow { position: absolute; right: 20px; bottom: 20px; width: 40px; height: 40px; display: grid; place-items: center; border: 0; border-radius: 50%; background: rgba(0, 0, 0, 0.55); color: #fff; cursor: pointer; }
.grow .icon { width: 18px; height: 18px; }
dialog.full { width: 100vw; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; background: #000; }
dialog.full::backdrop { background: #000; }
dialog.full[open] { display: grid; place-items: center; }
dialog.full .live-screen { width: min(100vw, calc(100dvh * 4 / 3)); height: auto; aspect-ratio: 4 / 3; border-radius: 0; gap: 4px; }
dialog.full .shut { position: absolute; top: max(14px, env(safe-area-inset-top)); right: 14px; background: rgba(255, 255, 255, 0.18); color: #fff; }
.btn.link { color: var(--accent); align-self: center; justify-self: center; }
.error.note { color: var(--muted); }
.tag.quiet { background: rgba(0, 0, 0, 0.62); }
.cell.off img { opacity: 0.45; }
.cell-name { position: absolute; left: 0; right: 0; bottom: 0; padding: 18px 8px 6px; background: linear-gradient(to top, rgba(0, 0, 0, 0.62), rgba(0, 0, 0, 0)); color: #fff; font-size: 13px; font-weight: 600; text-align: left; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vid { position: relative; display: block; width: 100%; aspect-ratio: 1; background: #1b1b1e; overflow: hidden; }
.vid video { display: block; width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.vid-mark { position: absolute; left: 50%; top: 50%; width: 44px; height: 44px; margin: -22px 0 0 -22px; display: grid; place-items: center; border-radius: 50%; background: rgba(0, 0, 0, 0.55); color: #fff; }
.vid-mark .icon { width: 20px; height: 20px; }
video.view-img { background: #000; }

.dock { position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; padding: 10px 16px max(10px, env(safe-area-inset-bottom)); background: rgba(255, 255, 255, 0.94); border-top: 1px solid var(--line); }
.dock .btn { display: flex; width: 100%; max-width: 608px; margin: 0 auto; height: 52px; font-size: 17px; }

.empty { display: grid; justify-items: center; gap: 12px; padding: 48px 24px; border-top: 1px solid var(--line); color: var(--muted); text-align: center; }
.empty .mark { width: 52px; height: 52px; border-radius: 14px; background: var(--fill); color: var(--muted); }

.top { max-width: 1080px; margin: 0 auto; padding: 16px 24px 0; display: grid; gap: 14px; border-bottom: 1px solid var(--line); }
.top-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.tabs { display: flex; gap: 4px; max-width: 100%; }
.tab { height: 44px; padding: 0 14px; border: 0; border-bottom: 2px solid transparent; background: none; color: var(--muted); font-size: 15px; font-weight: 600; white-space: nowrap; cursor: pointer; }
.tab[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--ink); }

.page { max-width: 1080px; margin: 0 auto; padding: 0 24px 56px; }
.bar { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 14px 24px; padding: 26px 0 20px; }
.bar .title { flex: 1; min-width: 180px; display: grid; gap: 2px; }
.bar .tools { display: flex; flex-wrap: wrap; gap: 10px; }
.bar form.tools input { flex: 1; min-width: 150px; width: 220px; }

.families { display: grid; max-width: 720px; border-top: 1px solid var(--line); }
.family-row { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 72px; padding: 12px 0; border: 0; border-bottom: 1px solid var(--line); background: none; color: var(--ink); text-align: left; cursor: pointer; }
.family-row:hover { background: #fafafb; }
.family-row .names { flex: 1; min-width: 0; display: grid; gap: 2px; }
.family-row .sub { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.family-row strong { font-size: 17px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.family-row > .icon { width: 18px; height: 18px; color: var(--muted); }
.done { display: grid; justify-items: center; gap: 4px; padding: 6px 0 8px; text-align: center; }
.done-mark { width: 52px; height: 52px; margin-bottom: 8px; display: grid; place-items: center; border-radius: 50%; background: var(--ok); color: #fff; }
.done-mark.plain { background: var(--fill); color: var(--ink); }
.done-mark .icon { width: 26px; height: 26px; }
.state { flex: none; width: 10px; height: 10px; border-radius: 50%; background: #c9c9d1; }
.state.on { background: var(--ok); }
.state.bad { background: var(--danger); }
.big-code { font-size: 34px; font-weight: 700; letter-spacing: 0.06em; text-align: center; color: var(--ink) !important; font-variant-numeric: tabular-nums; }
input.code { font-size: 24px; letter-spacing: 0.08em; text-align: center; font-variant-numeric: tabular-nums; }
.people { display: grid; border-top: 1px solid var(--line); }
.person { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 60px; padding: 8px 0; border: 0; border-bottom: 1px solid var(--line); background: none; color: var(--ink); text-align: left; cursor: pointer; }
.person .names { flex: 1; min-width: 0; display: grid; gap: 2px; }
.person strong { font-size: 15px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.person > .icon { width: 16px; height: 16px; color: var(--muted); }
.chip.plain { padding-right: 14px; }
.who-line { font-size: 14px; font-weight: 600; }
.modal.sheet .row-actions { flex-wrap: nowrap; gap: 6px; }
.modal.sheet .row-actions .btn { padding: 0 12px; }
.modal.sheet { width: min(460px, calc(100vw - 32px)); }
.family { display: grid; grid-template-columns: minmax(0, 1fr); align-content: start; gap: 14px; padding: 20px 0; border-bottom: 1px solid var(--line); }
.family-head { display: flex; align-items: center; gap: 12px; min-height: 48px; }
.family-head .names { flex: 1; min-width: 0; }
.strip { display: flex; flex: none; gap: 4px; }
.strip img { width: 44px; height: 44px; object-fit: cover; border-radius: 6px; background: var(--fill); }
.chips { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; max-width: 440px; }
.chip { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 44px; padding: 0 0 0 14px; border-radius: 12px; background: var(--fill); font-size: 15px; }
.chip span { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chip .icon { width: 16px; height: 16px; margin-right: 8px; vertical-align: -3px; color: var(--muted); }
.chip button { width: 44px; height: 44px; flex: none; display: grid; place-items: center; border: 0; background: none; color: var(--muted); cursor: pointer; }
.chip button:hover { color: var(--danger); }
.chip button .icon { width: 14px; height: 14px; }
.inline { display: flex; gap: 8px; }
.inline input { flex: 1; min-width: 0; height: 44px; font-size: 15px; }
.row-actions { display: flex; flex-wrap: wrap; gap: 8px; }

.panel { max-width: 440px; display: grid; }
.panel .live { padding: 0 0 22px; }
.group { display: grid; gap: 14px; padding: 22px 0; border-top: 1px solid var(--line); }
.group h2 { font-size: 17px; }
.num { display: grid; grid-template-columns: minmax(0, 1fr) 88px; align-items: center; gap: 12px; }
.num label { font-weight: 600; }
.num small, .switch small { display: block; font-size: 13px; font-weight: 400; color: var(--muted); overflow-wrap: anywhere; }
.num input { padding: 0 10px; text-align: center; }
.switch { display: flex; align-items: center; gap: 12px; min-height: 44px; font-weight: 600; cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch .track { flex: none; width: 51px; height: 31px; border-radius: 16px; background: #d9d9de; position: relative; transition: background-color 0.15s; }
.switch .track::after { content: ""; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3); transition: transform 0.15s; }
.switch input:checked + .track { background: #34c759; }
.switch input:checked + .track::after { transform: translateX(20px); }
.switch input:focus-visible + .track { outline: 3px solid var(--ring); outline-offset: 2px; }
.switch input:disabled + .track { opacity: 0.45; }

.log { max-width: 640px; display: grid; border-top: 1px solid var(--line); }
.log-row { display: grid; grid-template-columns: 8px 1fr auto; gap: 2px 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 15px; }
.log-row .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); grid-row: span 2; }
.log-row.bad .dot { background: var(--danger); }
.log-row .who { display: block; padding: 0; font-weight: 600; overflow-wrap: anywhere; }
.log-row time { color: var(--muted); font-size: 13px; white-space: nowrap; }
.log-row .what { grid-column: 2 / 4; color: var(--muted); overflow-wrap: anywhere; }
.none { padding: 16px 0; color: var(--muted); }

.combo { position: relative; flex: 1; min-width: 200px; max-width: 260px; }
.combo input { padding-right: 40px; }
.combo > .icon { position: absolute; right: 14px; top: 14px; pointer-events: none; color: var(--muted); }
.combo-list, .menu-list { position: absolute; z-index: 20; padding: 6px; border-radius: 14px; background: #fff; box-shadow: var(--float); }
.combo input { text-overflow: ellipsis; }
.combo-list { top: calc(100% + 6px); left: 0; min-width: 100%; width: max-content; max-width: min(440px, calc(100vw - 32px)); max-height: 264px; overflow-y: auto; margin: 0; list-style: none; }
.combo-list li { min-height: 44px; display: flex; align-items: baseline; gap: 10px; line-height: 44px; padding: 0 12px; border-radius: 8px; cursor: pointer; white-space: nowrap; }
.combo-list li .main { flex: none; max-width: 60%; overflow: hidden; text-overflow: ellipsis; }
.combo-list li .sub { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; color: var(--muted); font-size: 14px; }
.combo-list li:hover, .combo-list li[aria-selected="true"] { background: var(--fill); }
.combo-list li.none { padding: 0 12px; cursor: default; }
.menu { position: relative; flex: none; }
.menu-list { right: 0; top: calc(100% + 8px); min-width: 190px; }
.menu-list button { width: 100%; min-height: 44px; display: flex; align-items: center; gap: 10px; padding: 0 12px; border: 0; border-radius: 8px; background: none; font-weight: 600; text-align: left; white-space: nowrap; cursor: pointer; }
.menu-list button:hover { background: var(--fill); }
.menu-who { max-width: 260px; padding: 8px 12px 10px; margin-bottom: 4px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.menu-who:empty { display: none; }

.modal { position: fixed; inset: 0; margin: auto; max-height: calc(100dvh - 24px); overflow: auto; width: min(400px, calc(100vw - 32px)); padding: 22px; border: 0; border-radius: 16px; background: #fff; color: var(--ink); box-shadow: var(--float); }
.modal::backdrop { background: rgba(0, 0, 0, 0.45); }
.modal > * + * { margin-top: 12px; }
.modal p { color: var(--muted); overflow-wrap: anywhere; }
.modal.intro { width: min(440px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); padding: 0; overflow: auto; }
.modal.intro > * + * { margin-top: 0; }
.intro-body img { display: block; width: 100%; height: auto; background: #eef1f6; }
.intro-text { padding: 22px 24px 0; }
.intro-text h2 { font-size: 22px; line-height: 1.2; letter-spacing: -0.01em; }
.intro-text p { margin-top: 6px; font-size: 15px; line-height: 1.45; }
.ways { margin: 18px 24px 0; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.way { display: grid; grid-template-columns: 32px minmax(0, 1fr) 18px; gap: 12px; align-items: center; width: 100%; padding: 12px 14px; border: 0; background: #fff; color: var(--ink); font: inherit; text-align: left; text-decoration: none; cursor: pointer; }
.way + .way { border-top: 1px solid var(--line); }
.way:hover { background: #f6f7f9; }
.way-icon { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: #e8f0fd; color: #0a63e0; font-size: 15px; font-weight: 700; }
.way-icon .icon { width: 20px; height: 20px; }
.way-text { display: grid; gap: 1px; min-width: 0; }
.way-text strong { font-size: 16px; font-weight: 600; }
.way-text span { color: var(--muted); font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.way > .icon { width: 18px; height: 18px; color: var(--muted); transform: rotate(-90deg); }
.modal.intro:focus { outline: 0; }
.modal.intro .modal-actions { margin: 0; padding: 18px 24px 22px; }
.modal.intro .modal-actions .btn { flex: 1; height: 48px; font-size: 16px; }
.secret { position: relative; }
.secret input { width: 100%; padding-right: 50px; }
.peek { position: absolute; top: 50%; right: 4px; width: 40px; height: 40px; transform: translateY(-50%); display: grid; place-items: center; border: 0; border-radius: 10px; background: none; color: var(--muted); cursor: pointer; }
.peek.on { color: var(--ink); }
.or { text-align: center; color: var(--muted) !important; font-size: 13px; }
.hint { margin-top: 6px; color: var(--muted); font-size: 13px; }
.modal.even { padding: 24px; }
.modal.even .modal-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 22px; }
.modal.even .modal-actions .btn { height: 48px; font-size: 16px; }
.live-ctl .btn { height: 44px; }
.modal-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 8px; margin-top: 20px; }
.modal-actions .btn { height: 44px; padding: 0 18px; font-size: 15px; }
.modal .stack { display: grid; gap: 12px; }
.modal .combo { max-width: none; }
.modal.view { width: fit-content; min-width: min(340px, calc(100vw - 24px)); max-width: min(560px, calc(100vw - 24px)); padding: 12px; }
.view-img { display: block; width: auto; max-width: 100%; max-height: 62dvh; margin: 0 auto; border-radius: 8px; }
video.view-img { width: 100%; }
.modal.view .vid { aspect-ratio: 4 / 3; border-radius: 8px; }
.modal.view p { padding: 0 4px; font-size: 14px; }
.modal.view > * + * { margin-top: 0; }
.view-shut { position: absolute; top: 20px; right: 20px; background: rgba(0, 0, 0, 0.55); color: #fff; }
.view-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 12px; }
.view-bar p { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.view-tools { display: flex; flex: none; gap: 8px; }
.tool { width: 44px; height: 44px; display: grid; place-items: center; border: 0; border-radius: 50%; background: var(--fill); color: var(--ink); cursor: pointer; }
.tool:hover { background: var(--line); }
.tool.danger { color: var(--danger); }
.copy { display: flex; gap: 8px; }
.copy input { flex: 1; min-width: 0; height: 44px; font-size: 14px; }
.pin { font-size: 32px; font-weight: 700; letter-spacing: 0.14em; font-variant-numeric: tabular-nums; }

.toast { position: fixed; left: 50%; bottom: max(88px, env(safe-area-inset-bottom)); z-index: 100; max-width: calc(100vw - 32px); padding: 10px 16px; border-radius: 12px; background: var(--ink); color: #fff; font-weight: 600; text-align: center; opacity: 0; transform: translate(-50%, 10px); pointer-events: none; transition: opacity 0.2s, transform 0.2s; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.bad { background: var(--danger); }

.missing { min-height: 100dvh; display: grid; place-items: center; align-content: center; gap: 12px; padding: 24px; text-align: center; }
.missing .brand { justify-content: center; margin-bottom: 8px; }
.missing p { color: var(--muted); }

@media (max-width: 520px) {
  .family-row .strip img:nth-child(n+3) { display: none; }
  .top, .page { padding-left: 16px; padding-right: 16px; }
  .tabs { gap: 0; justify-content: space-between; overflow-x: auto; scrollbar-width: none; }
  .tabs::-webkit-scrollbar { display: none; }
  .tab { flex: 1 1 auto; padding: 0 4px; font-size: clamp(12.5px, 3.7vw, 14px); }
  .page .cards { grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 0 -16px; }
  .combo { max-width: none; flex-basis: 100%; }
  .bar .tools { width: 100%; }
  .bar .tools .btn { flex: 1; }
}

@font-face { font-family: "Rubik"; font-weight: 500; font-display: swap; src: url("/fonts/rubik-latin-500-normal.woff2") format("woff2"); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: "Rubik"; font-weight: 500; font-display: swap; src: url("/fonts/rubik-hebrew-500-normal.woff2") format("woff2"); unicode-range: U+0307-0308,U+0590-05FF,U+200C-2010,U+20AA,U+25CC,U+FB1D-FB4F; }
@font-face { font-family: "Frank Ruhl Libre"; font-weight: 700; font-display: swap; src: url("/fonts/frank-ruhl-libre-latin-700-normal.woff2") format("woff2"); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: "Frank Ruhl Libre"; font-weight: 700; font-display: swap; src: url("/fonts/frank-ruhl-libre-hebrew-700-normal.woff2") format("woff2"); unicode-range: U+0307-0308,U+0590-05FF,U+200C-2010,U+20AA,U+25CC,U+FB1D-FB4F; }
@font-face { font-family: "Amatic SC"; font-weight: 700; font-display: swap; src: url("/fonts/amatic-sc-latin-700-normal.woff2") format("woff2"); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: "Amatic SC"; font-weight: 700; font-display: swap; src: url("/fonts/amatic-sc-hebrew-700-normal.woff2") format("woff2"); unicode-range: U+0307-0308,U+0590-05FF,U+200C-2010,U+20AA,U+25CC,U+FB1D-FB4F; }
@font-face { font-family: "Dancing Script"; font-weight: 700; font-display: swap; src: url("/fonts/dancing-script-latin-700-normal.woff2") format("woff2"); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }

.dock-row { display: flex; gap: 8px; max-width: 608px; margin: 0 auto; }
.dock-row #add { flex: 1; min-width: 0; }
.dock-row #collage { flex: none; width: auto; padding: 0 18px; }
.modal.compose { width: min(640px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); padding: 16px; overflow: auto; }
.compose canvas.stage { display: block; width: 100%; height: auto; max-height: 52dvh; object-fit: contain; border-radius: 8px; background: var(--fill); }
.picks { display: flex; flex-wrap: wrap; gap: 8px; }
.pick { height: 44px; padding: 0 14px; display: inline-flex; align-items: center; justify-content: center; border: 2px solid transparent; border-radius: 10px; background: var(--fill); color: var(--ink); font-size: 17px; cursor: pointer; }
.pick canvas { display: block; width: 44px; height: 33px; }
.pick.shape { padding: 0 8px; height: 52px; }
.pick[aria-pressed="true"] { border-color: var(--accent); background: #fff; }
.f-rubik { font-family: "Rubik", sans-serif; font-weight: 500; }
.f-frank { font-family: "Frank Ruhl Libre", serif; font-weight: 700; }
.f-amatic { font-family: "Amatic SC", sans-serif; font-weight: 700; font-size: 22px; }
.f-dancing { font-family: "Dancing Script", cursive; font-weight: 700; font-size: 20px; }
.picks.font { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.picks.font .pick { padding: 0 4px; font-size: 15px; }
.picks.font .f-amatic { font-size: 20px; }
.picks.font .f-dancing { font-size: 18px; }
.modal .error:empty { display: none; }
.modal .chips { max-width: none; }

@media (min-width: 960px) {
  .sign.split { grid-template-columns: minmax(440px, 39%) minmax(0, 1fr); padding: 0; }
  .sign.split .sign-box { order: 1; padding: 40px; box-sizing: content-box; }
  .sign.split .sign-box h1 { margin-bottom: 10px; font-size: 30px; }
  .sign-sub { display: none; }
  .sign-art { order: 2; align-self: stretch; justify-self: stretch; display: grid; place-items: center; container-type: size; background: #f4f4f6; }
  .sign-wall { display: grid; grid-template-columns: repeat(3, min(calc((100cqh - 200px) / 2.834), calc((100cqw - 160px) / 3), 280px)); gap: 12px; }
  .sign-wall div { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; align-content: start; min-width: 0; }
  .sign-wall img { display: block; width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 14px; }
  .sign-wall img.tall { aspect-ratio: 3 / 4; }
  .sign-wall p { display: flex; align-items: flex-end; aspect-ratio: 4 / 3; box-sizing: border-box; margin: 0; padding: 8%; border-radius: 14px; background: #0a63e0; color: #fff; font-size: clamp(13px, 2.1cqw, 21px); overflow: hidden; line-height: 1.3; font-weight: 600; letter-spacing: -0.01em; }
  .phone { max-width: 1440px; padding: 8px 40px 56px; }
  .who { padding: 14px 0 22px; }
  #list { display: grid; grid-template-columns: minmax(420px, 46%) minmax(0, 1fr); column-gap: 48px; align-items: start; }
  #list > * { grid-column: 2; }
  #list > .live { grid-column: 1; grid-row: 1 / span 200; position: sticky; top: 24px; padding: 0; }
  #list > .live + * { border-top: 0; padding-top: 0; }
  .sendto, .row-head, .month, .years { padding-left: 0; padding-right: 0; }
  .pair-grid { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 4px; }
  .dock { top: 22px; bottom: auto; left: auto; right: max(96px, calc(50vw - 624px)); padding: 0; border: 0; background: none; }
  .dock .btn { width: auto; height: 44px; padding: 0 18px; font-size: 15px; }
  .dock-row { max-width: none; }
  .dock-row #add { flex: none; }
  .top, .page { max-width: 1440px; padding-left: 40px; padding-right: 40px; }
  .cards { grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 4px; }
  .families { max-width: none; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 64px; }
  .log { max-width: 1100px; }
  .log-row { grid-template-columns: 8px 170px 240px minmax(0, 1fr); gap: 16px; padding: 10px 0; }
  .log-row .dot { grid-row: auto; }
  .log-row time { order: 1; font-size: 14px; }
  .log-row .who { order: 2; padding: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .log-row .what { order: 3; grid-column: auto; }
  .panel { max-width: none; grid-template-columns: minmax(0, 1.4fr) minmax(400px, 1fr); column-gap: 72px; align-items: start; }
  .panel > * { grid-column: 2; }
  .panel > .live { grid-column: 1; grid-row: 1 / span 5; position: sticky; top: 24px; }
  .panel > .live + * { border-top: 0; padding-top: 0; }
  .panel.plain { grid-template-columns: repeat(2, minmax(0, 460px)); }
  .panel.plain > * { grid-column: auto; }
  .panel.plain > :nth-child(-n+2) { border-top: 0; padding-top: 0; }
  .modal.view { max-width: min(1100px, calc(100vw - 80px)); }
  .view-img { max-height: 76dvh; }
}
@media (min-width: 1400px) {
  .families { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
