/* ============================================================================
   Home-screen setup (req-125/126): the "Add to Home Screen" guide, the resident
   setup panel, and the staff "Set up a device" flow. Same Almanac vocabulary as
   application.css: paper, ink hairlines, one oxblood accent, hard offsets.
   ========================================================================== */

/* ---- The guide ---- */
.ig { font-family: var(--font-ui); color: var(--ink); }
.ig-status { display: flex; align-items: center; gap: 10px; padding: 12px 16px; margin-bottom: 14px;
  border: 1px solid var(--cloth); color: var(--cloth-deep); background: rgba(62, 110, 78, .07); font-weight: 600; }
.ig-native { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 16px; margin-bottom: 14px; border: 1px solid var(--ink); background: var(--oxblood-wash); }
.ig-native p { margin: 0; font-weight: 600; }
.ig-detected { margin: 0 0 10px; font-size: .88rem; }
.ig-platforms { display: flex; flex-direction: column; gap: 10px; }

.ig-platform { border: 1px solid var(--ink); background: var(--plate); }
.ig-platform > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 12px;
  padding: 14px 16px; font-weight: 700; }
.ig-platform > summary::-webkit-details-marker { display: none; }
.ig-platform > summary::after { content: ""; margin-left: auto; width: 9px; height: 9px; flex: 0 0 auto;
  border-right: 2px solid var(--ink); border-bottom: 2px solid var(--ink); transform: rotate(45deg) translate(-2px, -2px);
  transition: transform .15s ease; }
.ig-platform[open] > summary::after { transform: rotate(-135deg) translate(-2px, -2px); }
.ig-platform[open] > summary { border-bottom: 1px solid var(--hairline); }
.ig-platform > summary:focus-visible { outline: 2px solid var(--oxblood); outline-offset: 2px; }
.ig-sum-ic { display: inline-flex; color: var(--oxblood); }
.ig-sum-t { font-size: 1.05rem; }
.ig-sum-b { font-weight: 500; color: var(--ink-faint); font-size: .9rem; }

.ig-body { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 20px 26px; padding: 18px 18px 20px; align-items: start; }
.ig-body > .ig-tip { grid-column: 1 / -1; }
.ig-fig { margin: 0; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.ig-fig > svg { display: block; max-width: 100%; height: auto; }
.ig-fig figcaption { display: inline-flex; align-items: center; gap: 6px; font-size: .78rem; font-weight: 700;
  letter-spacing: .12em; text-transform: uppercase; color: var(--oxblood); }

/* illustration parts */
.ig-dev  { fill: var(--ink); }
.ig-scr  { fill: var(--paper); }
.ig-bar  { fill: var(--ink); }
.ig-ln   { fill: var(--hairline-2); }
.ig-ln-h { fill: var(--ink-soft); }
.ig-blk  { fill: var(--paper-2); stroke: var(--hairline-2); }
.ig-addr { fill: var(--paper-2); stroke: var(--hairline-2); }
.ig-rule { stroke: var(--hairline-2); stroke-width: 1; }
.ig-g    { fill: none; stroke: var(--ink-soft); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.ig-dim  { opacity: .45; }
.ig-hot, .ig-hot * { fill: none; stroke: var(--oxblood); stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.ig-hot circle { fill: var(--oxblood); stroke: none; }
.ig-hotfill { fill: var(--oxblood); }
.ig-ring { fill: none; stroke: var(--oxblood); stroke-width: 2.4; animation: ig-pulse 2.2s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
.ig-menu { fill: var(--plate); stroke: var(--ink); stroke-width: 1; filter: drop-shadow(3px 3px 0 rgba(29, 26, 20, .18)); }
@keyframes ig-pulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) { .ig-ring { animation: none; } }

.ig-steps { margin: 0; padding: 0; list-style: none; counter-reset: ig; display: flex; flex-direction: column; gap: 12px; }
.ig-steps li { counter-increment: ig; position: relative; padding-left: 42px; line-height: 1.5; min-height: 30px; }
.ig-steps li::before { content: counter(ig); position: absolute; left: 0; top: -1px; width: 30px; height: 30px;
  display: grid; place-items: center; border: 1.5px solid var(--ink); background: var(--paper);
  font-family: var(--font-display); font-weight: 600; font-size: 1rem; box-shadow: 2px 2px 0 var(--ink); }
.ig-steps strong { color: var(--oxblood-deep); }
.ig-glyph { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; margin-right: 8px;
  vertical-align: -8px; border: 1px solid var(--hairline-2); background: var(--paper); color: var(--oxblood); }
.ig-tip { margin: 0; padding: 10px 14px; border-left: 3px solid var(--cloth); background: var(--paper);
  font-size: .92rem; line-height: 1.5; color: var(--ink-soft); }
.ig-rename { margin-top: 14px; display: flex; gap: 10px; align-items: flex-start; }
.ig-rename > svg { flex: 0 0 auto; margin-top: 2px; color: var(--cloth); }

@media (max-width: 640px) {
  .ig-body { grid-template-columns: 1fr; }
  .ig-fig > svg { width: 120px; }
  .ig-fig-wide > svg { width: 200px; }
}

/* Large variant: on the resident's own page (older eyes, bigger targets). */
.ig-large { font-size: 1.15rem; text-align: left; }
.ig-large .ig-platform > summary { padding: 18px 18px; font-size: 1.15rem; }
.ig-large .ig-sum-t { font-size: 1.2rem; }
.ig-large .ig-steps li { padding-left: 50px; min-height: 36px; }
.ig-large .ig-steps li::before { width: 36px; height: 36px; font-size: 1.15rem; }
.ig-large .ig-tip { font-size: 1.02rem; }
.ig-large .ig-native .btn { font-size: 1.2rem; }

/* The existing "Save this page" help box now holds the full guide. */
.res-save-help:has(.ig) { text-align: left; padding: 16px; font-size: 1rem; }

/* ---- Resident page: one-time setup panel (?setup=1) ---- */
.res-setup { border: 2px solid var(--ink); background: var(--plate); padding: 20px 18px 18px; margin: 10px 0 26px;
  box-shadow: 6px 6px 0 rgba(29, 26, 20, .12); }
.res-setup h2 { font-size: clamp(1.5rem, 4.4vw, 2rem); margin: .2em 0 .3em; line-height: 1.15; }
.res-setup .eyebrow { display: inline-flex; gap: 6px; align-items: center; margin: 0; }
.res-setup-lead { font-size: 1.15rem; line-height: 1.5; color: var(--ink-soft); margin: 0 0 16px; }
.res-setup-done { margin-top: 16px; font-size: 1.1rem; min-height: 56px; }

/* ---- Staff: "Set up a device for <Name>" ---- */
.launch-cta { margin-bottom: 18px; }
.launch-cta .btn { white-space: normal; text-align: center; }
.launch-cta p { margin: 8px 0 0; font-size: .88rem; }

.setup-flow { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 20px; }
.setup-step-head { display: flex; gap: 16px; align-items: flex-start; margin-bottom: 16px; }
.setup-step-head h2 { font-size: clamp(1.3rem, 2.6vw, 1.7rem); margin: 0 0 .25em; }
.setup-step-head p { margin: 0; }
.setup-num { flex: 0 0 auto; width: 42px; height: 42px; display: grid; place-items: center; background: var(--oxblood);
  color: var(--paper); font-family: var(--font-display); font-size: 1.4rem; font-weight: 600; box-shadow: 3px 3px 0 var(--ink); }
.setup-launch { white-space: normal; }
.setup-share { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 24px; align-items: center; }
.setup-qr { background: #fff; border: 1px solid var(--ink); padding: 10px; }
.setup-qr svg { display: block; width: 180px; height: 180px; }
.setup-link label { display: block; font-size: .82rem; margin-bottom: 6px; }
.setup-link-field { width: 100%; font: 500 .95rem/1.4 ui-monospace, SFMono-Regular, Menlo, monospace; padding: .7em .8em;
  border: 1px solid var(--ink); background: var(--paper); color: var(--ink); border-radius: 0; }
.setup-link-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.setup-link-note { font-size: .85rem; margin: 12px 0 0; }
@media (max-width: 640px) {
  .setup-share { grid-template-columns: 1fr; justify-items: center; }
  .setup-link { width: 100%; }
}

.setup-index { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr); gap: 20px; align-items: start; }
@media (max-width: 960px) { .setup-index { grid-template-columns: 1fr; } }
.setup-roster { list-style: none; margin: 0; padding: 0; }
.setup-roster li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0;
  border-bottom: 1px solid var(--hairline); }
.setup-roster li:last-child { border-bottom: 0; }
.setup-roster .nm { font-weight: 600; min-width: 0; }

@media print {
  .ig-platform { break-inside: avoid; }
  .ig-platform::details-content { content-visibility: visible; display: block; }
  .ig-native, .ig-status, .ig-detected { display: none !important; }
}
