/* Home screen guide (public/install.js, ported from the Fam room). The red felt letterboard on top, steps numbered with
   felt tiles, and a replica of the exact button to press under each step; the thing to tap wears a hard red ring. */
.inst { --tap: var(--red); position: fixed; left: 0; right: 0; top: var(--app-top, 0px); height: var(--app-h); z-index: 32; display: flex; flex-direction: column; background: var(--wall); color: var(--ink); opacity: 0; transform: translateY(18px); transition: opacity .2s, transform .26s cubic-bezier(.2, .8, .2, 1); overscroll-behavior: contain; }
.inst.open { opacity: 1; transform: none; }
@media (prefers-color-scheme: dark) { .inst { --tap: #5a97ff; } }
.inst-board { flex: none; display: flex; align-items: center; gap: 12px; padding: calc(16px + env(safe-area-inset-top)) 14px 16px 22px; }
.inst-rows { flex: 1; min-width: 0; }
.inst-board .row1 { font-size: 34px; letter-spacing: .1em; }
.inst-board .row2 { margin-top: 7px; font-size: 16px; }
.inst-x { flex: none; width: 44px; height: 44px; border: 0; background: #ffffff1f; color: var(--letter); display: grid; place-items: center; }
.inst-x svg { width: 20px; height: 20px; }
.inst-scroll { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
.inst-body { max-width: 560px; margin: 0 auto; padding: 22px 20px 4px; }
.inst-lede { margin: 0 0 18px; font-size: 18px; line-height: 1.45; max-width: 36ch; }
.inst-done { display: flex; gap: 12px; align-items: flex-start; margin: 0 0 18px; padding: 14px 16px; background: var(--paper); border-radius: 4px; box-shadow: 0 0 0 1px var(--rule); }
.inst-done > svg { flex: none; width: 28px; height: 28px; padding: 5px; border-radius: 50%; background: var(--ok); color: #fff; }
.inst-done b { display: block; }
.inst-done span { color: var(--ink-2); font-size: 15px; }
.inst-one { width: 100%; display: flex; align-items: center; justify-content: center; gap: 10px; padding: 16px 18px; font-size: 18px; }
.inst-one svg { width: 24px; height: 24px; }
.inst-or { margin: 18px 0 10px; color: var(--ink-2); font-size: 15px; }

.inst-tabs { display: flex; gap: 0; margin: 0 0 22px; background: var(--paper); box-shadow: 0 0 0 1.5px var(--felt); }
.inst-tabs button { flex: 1; min-height: 42px; border: 0; background: none; font: 600 17px/1 var(--board); letter-spacing: .12em; text-transform: uppercase; color: var(--felt); }
.inst-tabs button[aria-selected="true"] { background: var(--felt); color: var(--letter); }
@media (prefers-color-scheme: dark) { .inst-tabs button { color: var(--ink); } }

.inst-steps { list-style: none; margin: 0; padding: 0; }
.inst-steps li { position: relative; display: grid; grid-template-columns: 36px 1fr; gap: 14px; padding-bottom: 26px; }
.inst-steps li:not(:last-child)::before { content: ""; position: absolute; left: 17px; top: 44px; bottom: 6px; width: 2px; border-radius: 1px; background: var(--rule); }
/* a letter pressed into the felt board */
.inst-n { width: 36px; height: 40px; display: grid; place-items: center; border-radius: 2px; background-color: var(--felt); background-image: repeating-linear-gradient(to bottom, transparent 0 7px, var(--felt-groove) 7px 9px); color: var(--letter); font: 600 24px/1 var(--board); text-shadow: 0 1px 0 #000a; }
.inst-step { min-width: 0; padding-top: 6px; }
.inst-t { margin: 0; font-size: 18px; font-weight: 700; line-height: 1.35; }
.inst-s { margin: 4px 0 0; color: var(--ink-2); font-size: 15px; line-height: 1.45; }
.inst-v { margin-top: 12px; display: flex; flex-wrap: wrap; align-items: flex-start; gap: 12px; }
.inst-acts { margin-top: 12px; display: flex; flex-wrap: wrap; gap: 8px; }
.inst-acts .btn { text-decoration: none; display: inline-block; }

/* ---- replicas of the phone's own buttons (system type, system colours, light and dark like the phone) ---- */
.iv { --sys-bg: #fff; --sys-ink: #000; --sys-blue: #007aff; --sys-rule: #3c3c4329; font-family: -apple-system, system-ui, "Segoe UI", Roboto, sans-serif; color: var(--sys-ink); }
@media (prefers-color-scheme: dark) { .iv { --sys-bg: #2c2c2e; --sys-ink: #fff; --sys-blue: #0a84ff; --sys-rule: #54545899; } }
.iv svg { width: 24px; height: 24px; flex: none; }
.iv-ios { display: inline-flex; flex-direction: column; align-items: center; gap: 5px; }
.iv-round { width: 48px; height: 48px; display: grid; place-items: center; border-radius: 50%; background: var(--sys-bg); color: var(--sys-blue); box-shadow: 0 0 0 1px var(--sys-rule); }
.iv-cap { font-size: 12px; color: var(--ink-2); }
.iv-round, .iv-row:not(.iv-toggle), .iv-add, .iv-mrow.on, .iv-dbtn.on, .iv-droidbar svg, .iv-dinst, .iv-app img { box-shadow: 0 0 0 3px var(--tap); }
.iv-sheet { display: block; width: min(100%, 300px); background: var(--sys-bg); border-radius: 12px; overflow: hidden; box-shadow: 0 0 0 1px var(--sys-rule); }
.iv-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; font-size: 16px; border-radius: 12px; }
.iv-addsheet .iv-row { border-radius: 0; border-top: 1px solid var(--sys-rule); }
.iv-nav { display: flex; align-items: center; justify-content: space-between; gap: 6px; padding: 11px 12px; font-size: 14px; }
.iv-nav span { color: var(--sys-blue); }
.iv-nav b { font-weight: 600; white-space: nowrap; }
.iv-add { font-weight: 600; padding: 3px 9px; border-radius: 99px; }
.iv-switch { width: 46px; height: 28px; border-radius: 14px; background: #34c759; position: relative; flex: none; }
.iv-switch::after { content: ""; position: absolute; right: 2px; top: 2px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px #0003; }
.iv-toggle { box-shadow: inset 0 0 0 3px var(--tap); border-radius: 0 0 12px 12px; }
.iv-home { display: grid; place-items: center; width: 132px; height: 104px; border-radius: 16px; background: linear-gradient(160deg, #3a1c52, #22598a); }
.iv-app { display: grid; justify-items: center; gap: 5px; font-size: 12px; font-weight: 500; color: #fff; }
.iv-app img { width: 58px; height: 58px; border-radius: 13px; }
.iv-droidbar { display: flex; align-items: center; gap: 10px; width: min(100%, 300px); padding: 6px 8px 6px 16px; border-radius: 26px; background: var(--sys-bg); box-shadow: 0 0 0 1px var(--sys-rule); font-family: Roboto, system-ui, sans-serif; }
.iv-url { flex: 1; min-width: 0; font-size: 15px; opacity: .7; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.iv-droidbar svg { padding: 6px; width: 36px; height: 36px; border-radius: 50%; }
.iv-droid { display: grid; width: min(100%, 260px); padding: 6px 0; border-radius: 12px; background: var(--sys-bg); box-shadow: 0 0 0 1px var(--sys-rule); font-family: Roboto, system-ui, sans-serif; font-size: 15px; }
.iv-mrow { display: flex; align-items: center; gap: 14px; margin: 0 6px; padding: 10px 12px; border-radius: 8px; }
.iv-mrow:not(.on) { opacity: .45; }
.iv-mrow i { width: 24px; }
.iv-dialog { padding: 16px; gap: 14px; }
.iv-dialog b { font-weight: 500; font-size: 17px; }
.iv-dbtns { display: flex; justify-content: flex-end; gap: 6px; }
.iv-dbtn { padding: 8px 14px; border-radius: 99px; color: #0b57d0; font-weight: 500; }
.iv-dbtn.on { background: #0b57d0; color: #fff; }
@media (prefers-color-scheme: dark) { .iv-dbtn { color: #a8c7fa; } .iv-dbtn.on { background: #a8c7fa; color: #062e6f; } }
.iv-desk { display: flex; align-items: center; gap: 10px; width: min(100%, 360px); padding: 6px 6px 6px 16px; border-radius: 10px; background: var(--sys-bg); box-shadow: 0 0 0 1px var(--sys-rule); }
.iv-dinst { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 8px; }
.iv-dinst svg { width: 22px; height: 22px; }

/* ---- who's set up ---- */
.inst-crew { margin-top: 6px; padding-top: 22px; border-top: 1px solid var(--rule); }
.inst-crew h3 { margin: 0 0 10px; font-size: 17px; }
.inst-people { list-style: none; margin: 0 0 12px; padding: 0; background: var(--paper); border-radius: 4px; overflow: hidden; box-shadow: 0 0 0 1px var(--rule); }
.inst-people li { display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-top: 1px solid var(--rule); }
.inst-people li:first-child { border-top: 0; }
.inst-dot { flex: none; width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--rule); display: grid; place-items: center; }
.inst-dot.on { border: 0; background: var(--ok); color: #fff; }
.inst-dot svg { width: 14px; height: 14px; }
.inst-name { flex: 1; min-width: 0; font-weight: 700; color: color-mix(in oklab, var(--c, var(--ink)) 70%, var(--ink)); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (prefers-color-scheme: dark) { .inst-name { color: color-mix(in oklab, var(--c, var(--ink)) 55%, white); } }
.inst-st { flex: none; font-size: 14px; color: var(--ink-2); text-align: right; }
.inst-fine { font-size: 14px; }
.inst-foot { display: flex; justify-content: center; padding: 22px 20px calc(28px + var(--sab)); }
.inst:has(.inst-point:not([hidden])) .inst-foot { padding-bottom: calc(96px + var(--sab)); }
.inst-foot .btn { min-width: 160px; }

/* iPhone Safari: where the first step starts (the toolbar under the page) */
.inst-point { position: fixed; z-index: 1; left: 50%; bottom: calc(10px + var(--sab)); display: flex; align-items: center; gap: 6px; padding: 8px 12px 8px 16px; border-radius: 3px; background: var(--felt); color: var(--letter); font: 600 15px/1 var(--board); letter-spacing: .12em; text-transform: uppercase; box-shadow: 0 0 0 3px var(--tap); translate: -50% 0; animation: inst-nudge 1.4s ease-in-out infinite; pointer-events: none; }
.inst-point.right { left: auto; right: 12px; translate: 0 0; }
.inst-point svg { width: 20px; height: 20px; }
@keyframes inst-nudge { 50% { transform: translateY(6px); } }
@media (prefers-reduced-motion: reduce) { .inst { transition: opacity .2s; transform: none; } .inst-point { animation: none; } }

/* ---- elsewhere: the chat banner, the menu row, the reminder card ---- */
.banner.home { display: grid; grid-template-columns: auto 1fr auto; column-gap: 12px; row-gap: 8px; align-items: center; padding: 10px 14px; }
.banner.home .home-ic { grid-row: span 2; }
.banner.home .txt { line-height: 1.35; }
.banner.home .btn { grid-column: 2; justify-self: start; }
.banner.home .x { grid-column: 3; grid-row: 1 / span 2; align-self: center; }
.home-ic { width: 38px; height: 38px; border-radius: 9px; flex: none; }
.home-item.todo { box-shadow: inset 4px 0 0 var(--red); }
.inst-card .btn { margin-top: 10px; }
