/* Making a page an app (ADR-0097): the 📲 line at the foot of every page, its
   panel of steps, and the guide page. Loaded by shared/js/install.js. */

/* ---- the line ---- */
app-link { display: block; margin-block: var(--space-8) var(--space-12); text-align: center; }
.ins-line { display: grid; justify-items: center; gap: var(--space-2); }
.ins-line small { color: var(--ink-soft); font-size: var(--step--1); }

/* ---- the panel: a sheet from the bottom on a phone, a box in the middle on anything wider ---- */
dialog.ins-sheet {
  width: min(100%, 34rem); max-width: 100%; max-height: min(92dvh, 52rem);
  margin: auto auto 0; padding: var(--space-6) var(--space-4) max(var(--space-6), env(safe-area-inset-bottom));
  border: 0; border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  background: var(--bg); color: var(--ink); box-shadow: 0 -8px 40px rgb(0 0 0 / .3);
  overflow: auto; overscroll-behavior: contain; text-align: start;
}
dialog.ins-sheet[open] { display: grid; gap: var(--space-4); grid-template-rows: none; align-content: start; }
dialog.ins-sheet::backdrop { background: rgb(0 0 0 / .55); }
@media (min-width: 40rem) and (min-height: 34rem) {
  dialog.ins-sheet { margin: auto; border-radius: var(--radius-lg); padding: var(--space-8); }
}
dialog.ins-sheet p { margin: 0; }
.ins-head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--space-3); }
.ins-head h2 { font-size: var(--step-1); margin: 0; padding-top: var(--space-2); }
.ins-x { flex: 0 0 auto; width: var(--tap); padding: 0; }
.ins-go { justify-self: start; }
.ins-by { color: var(--ink-soft); }
.ins-done { font-weight: 700; color: var(--accent); }
.ins-more { justify-self: start; }
.ins-small, .ins-wifi { color: var(--ink-soft); font-size: var(--step--1); }
.ins-warn { padding: var(--space-3) var(--space-4); border-radius: var(--radius); background: var(--surface-2, var(--surface)); box-shadow: inset 0 0 0 2px var(--accent); }

/* ---- which device ---- */
/* one row of three when the words fit (English, Russian); otherwise the last one takes a row of its own */
.ins-devices { display: flex; flex-wrap: wrap; gap: var(--space-2); max-width: 34rem; }
.ins-devices .btn { flex: 1 1 auto; padding-inline: var(--space-3); line-height: 1.2; text-align: center; }
.ins-devices .btn[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); box-shadow: none; }

/* ---- the steps ---- */
.ins-for h3 { font-size: var(--step-0); margin: 0 0 var(--space-3); color: var(--ink-soft); }
.ins-steps { list-style: none; counter-reset: ins; margin: 0; padding: 0; display: grid; gap: var(--space-3); }
.ins-steps li {
  counter-increment: ins; position: relative; display: grid; gap: var(--space-1);
  min-height: 2.5rem; padding: var(--space-3) var(--space-4) var(--space-3) calc(2.5rem + var(--space-4));
  border-radius: var(--radius); background: var(--surface);
}
.ins-steps li::before {
  content: counter(ins); position: absolute; left: var(--space-3); top: var(--space-3);
  display: grid; place-items: center; width: 2rem; height: 2rem; border-radius: var(--radius-full);
  background: var(--accent); color: var(--accent-ink); font-weight: 800;
}
.ins-steps li > span { line-height: 1.7; }
.ins-steps small { color: var(--ink-soft); font-size: var(--step--1); line-height: 1.6; }
.ins-steps strong { font-weight: 700; }

/* A picture of the button to press, inline in the sentence, like a key on a keyboard. */
.ins-key {
  display: inline-grid; place-items: center; vertical-align: middle;
  width: 1.9em; height: 1.6em; margin-inline: .15em; border-radius: var(--radius-sm);
  background: var(--bg); box-shadow: inset 0 0 0 1.5px var(--line); color: var(--ink);
}
.ins-key svg { width: 1.15em; height: 1.15em; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; display: block; }
.ins-key--more svg, .ins-key--dots svg { stroke-width: 3.2; }

/* ---- the guide page ---- */
.guide { display: grid; gap: var(--space-8); padding-bottom: var(--space-12); }
.guide > section { display: grid; gap: var(--space-4); }
.guide h2 { margin: 0; font-size: var(--step-2); }
.guide p { margin: 0; }
.guide .lead { font-size: var(--step-1); color: var(--ink-soft); max-width: 40rem; }
.guide .zero { display: grid; gap: var(--space-2); }
.guide .zero small { color: var(--ink-soft); }
.guide .rooms { display: flex; flex-wrap: wrap; gap: var(--space-2); margin: 0; padding: 0; list-style: none; }
.guide .rooms a { padding-inline: var(--space-4); }
.guide .browsers { display: grid; gap: var(--space-4); grid-template-columns: repeat(auto-fit, minmax(min(19rem, 100%), 1fr)); align-items: start; }
.guide .browsers .card { display: grid; gap: var(--space-3); padding: var(--space-4); rotate: none; }
.guide .browsers .card h3 { margin: 0; color: var(--ink); display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); }
.guide .browsers .card .badge { margin: 0; }
.guide .browsers .card .ins-steps li { background: var(--bg); }
.guide .gets { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-3); grid-template-columns: repeat(auto-fit, minmax(min(15rem, 100%), 1fr)); }
.guide .gets li { display: flex; gap: var(--space-3); align-items: flex-start; padding: var(--space-4); border-radius: var(--radius); background: var(--surface); }
.guide .gets li b { font-size: var(--step-1); line-height: 1.2; }
.guide .how { display: grid; gap: var(--space-3); max-width: 44rem; }

/* the helper, drawn: the room asks the helper, the helper asks the internet — or hands over its copy */
.guide .flow { display: grid; gap: var(--space-3); grid-template-columns: repeat(auto-fit, minmax(min(17rem, 100%), 1fr)); }
.guide .flow figure { margin: 0; padding: var(--space-4); border-radius: var(--radius); background: var(--surface); display: grid; gap: var(--space-3); }
.guide .flow figcaption { font-weight: 700; }
.guide .flow ol { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); margin: 0; padding: 0; list-style: none; }
.guide .flow li { display: grid; justify-items: center; gap: var(--space-1); min-width: 4.5rem; text-align: center; font-size: var(--step--1); }
.guide .flow li b { font-size: var(--step-2); line-height: 1; }
.guide .flow .arrow { min-width: 0; font-size: var(--step-1); color: var(--ink-soft); }
.guide .flow .gone { opacity: .35; text-decoration: line-through; }

.guide details { border-radius: var(--radius); background: var(--surface); }
.guide summary { min-height: var(--tap); display: flex; align-items: center; padding: var(--space-3) var(--space-4); font-weight: 700; cursor: pointer; }
.guide details > p { padding: 0 var(--space-4) var(--space-4); }
.guide .faq { display: grid; gap: var(--space-2); max-width: 44rem; }

/* the front pages: the 📲 line sits just above the footer, which needs no gap of its own then */
app-link + footer { padding-top: 0 !important; }
