/* ==========================================================================
   /install - public Android app install guide (v2.3 redesign, direction B "Indigo Pearl";
   behaviour unchanged from v2.2). Loaded after aq.css and public.css: colours come from the
   --pb-* bridge of public.css (which reads the design tokens), so light and dark follow the phone's setting.
   ========================================================================== */

.ins, .ins *, .ins *::before, .ins *::after { box-sizing: border-box; }
.ins {
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--pb-bg);
  color: var(--pb-text);
  overflow-x: clip;
  -webkit-text-size-adjust: 100%;
}
.ins [hidden] { display: none !important; }
.ins svg { flex: none; }
.ins :focus-visible { outline: 2px solid var(--pb-accent); outline-offset: 2px; }

/* two languages: the page ships both, one is shown */
.ins .t-ur { display: none; }
html.is-ur .ins .t-en { display: none; }
html.is-ur .ins .t-ur { display: inline; }

.ins-wrap { width: 100%; max-width: 760px; margin: 0 auto; padding: 0 16px; }

/* ---------- pearl head: header + hero on the page background, under the iridescent glow ---------- */
.ins-head { position: relative; isolation: isolate; color: var(--pb-text); }
.ins-head::before {
  content: ""; position: absolute; left: -20%; right: -20%; top: -160px; height: 620px; z-index: -2; pointer-events: none;
  background: var(--pb-pearl); opacity: var(--pb-glow-op);
}
.ins-head::after {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background-color: var(--pb-accent); opacity: .045;
  -webkit-mask-image: var(--pb-doodle-url), linear-gradient(180deg, #000 45%, transparent 100%); mask-image: var(--pb-doodle-url), linear-gradient(180deg, #000 45%, transparent 100%);
  -webkit-mask-size: 232px 232px, 100% 100%; mask-size: 232px 232px, 100% 100%;
  -webkit-mask-repeat: repeat, no-repeat; mask-repeat: repeat, no-repeat;
  -webkit-mask-composite: source-in; mask-composite: intersect;
}
.ins-top { padding: calc(10px + env(safe-area-inset-top)) 0 0; }
.ins-hero { padding: 18px 0 26px; }
.ins-top-in { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 56px; }
.ins-brand { display: flex; align-items: center; gap: 10px; min-width: 0; text-decoration: none; font: 700 19px/24px var(--pb-font); letter-spacing: -.015em; border-radius: 12px; }
.ins a.ins-brand, .ins a.ins-brand:hover, .ins a.ins-brand:focus, .ins a.ins-brand:visited { color: var(--pb-text); }
.ins-tile { width: 36px; height: 36px; border-radius: 11px; box-shadow: var(--pb-shadow-2); box-shadow: 0 6px 14px -4px color-mix(in srgb, var(--pb-accent) 45%, transparent); }
.ins-tile svg { width: 24px; height: 24px; }
.ins-brand > span:last-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* language switch: a sunken segmented control */
.ins-lang { flex: none; display: inline-flex; padding: 3px; border-radius: 999px; background: var(--pb-sunken); border: 1px solid var(--pb-hairline); }
.ins-lang-btn { min-height: 40px; padding: 0 14px; border: 0; border-radius: 999px; background: none; color: var(--pb-text-2); font: 600 13.5px/16px var(--pb-font); white-space: nowrap; cursor: pointer; -webkit-tap-highlight-color: transparent; transition: background-color var(--pb-dur-fast), color var(--pb-dur-fast), box-shadow var(--pb-dur-fast); }
.ins-lang-btn:hover { color: var(--pb-text); }
.ins-lang-btn.is-on { background: var(--pb-raised); color: var(--pb-accent-text); box-shadow: var(--pb-shadow-2); }
.ins-lang-btn .lg-short { display: none; }
@media (max-width: 400px) {
  .ins-brand { gap: 8px; font-size: 17px; }
  .ins-tile { width: 32px; height: 32px; border-radius: 10px; }
  .ins-tile svg { width: 21px; height: 21px; }
  .ins-btn-xl { padding: 0 16px; gap: 8px; }
  .ins-lang-btn { padding: 0 11px; }
  .ins-lang-btn .lg-long { display: none; }
  .ins-lang-btn .lg-short { display: inline; }
}

.ins-eyebrow { display: inline-flex; align-items: center; gap: 7px; margin: 0 0 14px; padding: 5px 12px 5px 9px; border-radius: 999px; background: var(--pb-accent-soft); font: 600 13px/16px var(--pb-font); color: var(--pb-accent-text); }
.ins-eyebrow svg { width: 16px; height: 16px; }
.ins-hero h1 { margin: 0; max-width: 18ch; font: 700 30px/35px var(--pb-font); letter-spacing: -.026em; color: var(--pb-text); overflow-wrap: anywhere; text-wrap: balance; }
.ins-lead { margin: 12px 0 0; max-width: 34em; font: 400 15.5px/23px var(--pb-font); color: var(--pb-text-2); }
.ins-fallback :focus-visible { outline-color: #fff; }

.ins-flow { position: relative; z-index: 1; display: flex; flex-direction: column; gap: 26px; padding-bottom: calc(40px + env(safe-area-inset-bottom)); }

/* ---------- download card (slides over the hero like a sheet) ---------- */
.ins-card { background: var(--pb-surface); border: 1px solid var(--pb-border); border-radius: var(--pb-r-xl); padding: 18px; box-shadow: var(--pb-shadow-2); }
.ins-app { display: flex; align-items: center; gap: 14px; }
.ins-app-ico { flex: none; width: 56px; height: 56px; border-radius: 15px; box-shadow: var(--pb-shadow-2); }
.ins-app-text { min-width: 0; }
.ins-app-text h2 { margin: 0; font: 700 21px/26px var(--pb-font); letter-spacing: -.018em; color: var(--pb-text); }
.ins-app-text p { margin: 2px 0 0; font: 400 14px/19px var(--pb-font); color: var(--pb-text-2); }

.ins-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(86px, 1fr)); gap: 8px; margin: 16px 0 0; padding: 0; list-style: none; }
.ins-facts li { display: flex; flex-direction: column; gap: 2px; min-width: 0; padding: 10px 12px; border-radius: var(--pb-r-md); background: var(--pb-sunken); }
.ins-fact-k { font: 500 12px/15px var(--pb-font); color: var(--pb-text-2); }
.ins-facts b { font: 600 15px/20px var(--pb-font); font-variant-numeric: tabular-nums; color: var(--pb-text); overflow-wrap: anywhere; }

.ins-dl-wrap { margin-top: 16px; }
.ins-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 52px; padding: 0 22px;
  border: 1px solid transparent; border-radius: 16px; font: 600 16px/20px var(--pb-font); letter-spacing: -.006em;
  text-align: center; text-decoration: none; cursor: pointer; -webkit-tap-highlight-color: transparent;
  transition: transform var(--pb-dur-fast) var(--pb-e-std), background-color var(--pb-dur-fast), filter var(--pb-dur-fast), box-shadow var(--pb-dur-fast);
}
.ins-btn:active { transform: scale(.97); }
.ins-btn svg { width: 22px; height: 22px; }
/* aq.css colours every a:hover: keep the button colours on hover, focus and after a tap */
.ins a.ins-btn-primary, .ins a.ins-btn-primary:hover, .ins a.ins-btn-primary:focus, .ins a.ins-btn-primary:visited { color: var(--pb-on-accent); }
.ins a.ins-btn-light, .ins a.ins-btn-light:hover, .ins a.ins-btn-light:focus, .ins a.ins-btn-light:visited { color: var(--pb-accent-strong); }
.ins-btn-primary { width: 100%; background: var(--pb-brand); box-shadow: var(--pb-shadow-fab); }
.ins-btn-primary:hover { filter: brightness(1.07); }
.ins-btn-xl { min-height: 60px; font-size: 17.5px; border-radius: 18px; }
.ins-btn-light { background: #fff; box-shadow: 0 10px 26px rgba(10, 8, 30, .28); }
.ins-btn-light:hover { filter: brightness(.96); }
.ins-btn-outline { background: rgba(255, 255, 255, .12); color: var(--pb-on-hero); border-color: rgba(255, 255, 255, .28); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); }
.ins-btn-outline:hover { background: rgba(255, 255, 255, .17); }

.ins-after { display: flex; flex-direction: column; gap: 2px; margin-top: 12px; padding: 12px 14px; border-radius: var(--pb-r-md); background: var(--pb-success-tint); color: var(--pb-success-text); font: 400 14.5px/21px var(--pb-font); }
.ins-after b { font-weight: 600; }
.ins-none { margin: 16px 0 0; padding: 14px; border-radius: var(--pb-r-md); background: var(--pb-warning-tint); color: var(--pb-warning-text); font: 500 14.5px/21px var(--pb-font); }
.ins-note { margin: 8px 0 0; font: 400 13.5px/20px var(--pb-font); color: var(--pb-text-2); }

/* SHA-256 */
.ins-sha { margin-top: 16px; padding: 12px 14px; border: 1.5px dashed var(--pb-border); border-radius: var(--pb-r-md); background: var(--pb-sunken); }
.ins-sha-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.ins-sha-k { font: 600 13px/16px var(--pb-font); color: var(--pb-accent-text); }
.ins-sha-v { display: block; margin-top: 6px; padding: 0; background: none; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12.5px; line-height: 1.55; color: var(--pb-text); word-break: break-all; overflow-wrap: anywhere; user-select: all; -webkit-user-select: all; }
.ins-copy { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 14px; border: 1px solid var(--pb-border); border-radius: 12px; background: var(--pb-surface); color: var(--pb-text); font: 600 14px/18px var(--pb-font); cursor: pointer; -webkit-tap-highlight-color: transparent; box-shadow: var(--pb-shadow-1); transition: background-color var(--pb-dur-fast), color var(--pb-dur-fast), border-color var(--pb-dur-fast); }
.ins-copy:hover { border-color: var(--pb-accent); }
.ins-copy svg { width: 16px; height: 16px; }
.ins-copy .ins-copy-done { display: none; }
.ins-copy.is-copied { border-color: var(--pb-success); background: var(--pb-success-tint); color: var(--pb-success-text); }
.ins-copy.is-copied .ins-copy-txt { display: none; }
.ins-copy.is-copied .ins-copy-done { display: inline; }
html.is-ur .ins-copy.is-copied .ins-copy-done .t-en { display: none; }

.ins-notes { margin-top: 14px; border-top: 1px solid var(--pb-border); padding-top: 4px; }
.ins-notes summary { display: flex; align-items: center; min-height: 44px; cursor: pointer; font: 600 14.5px/20px var(--pb-font); color: var(--pb-accent-text); }
.ins-notes ul { margin: 4px 0 0; padding-left: 20px; font: 400 14.5px/22px var(--pb-font); color: var(--pb-text-2); }

/* ---------- notices ---------- */
.ins-notices { display: flex; flex-direction: column; gap: 10px; }
.ins-notices:empty, .ins-notices:not(:has(.ins-notice:not([hidden]))) { display: none; }
.ins-notice { display: flex; align-items: flex-start; gap: 12px; padding: 14px 16px; border-radius: 18px; font: 400 14.5px/21px var(--pb-font); }
.ins-notice svg { width: 20px; height: 20px; margin-top: 1px; }
.ins-notice > div { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.ins-notice b { font-weight: 600; font-size: 15px; overflow-wrap: anywhere; }
.ins-notice-info { background: var(--pb-accent-soft); color: var(--pb-text); }
.ins-notice-info svg { color: var(--pb-accent-text); }
.ins-notice-warn { background: var(--pb-warning-tint); color: var(--pb-warning-text); }

/* ---------- sections ---------- */
.ins-sec h2 { margin: 0; font: 700 22px/28px var(--pb-font); letter-spacing: -.018em; color: var(--pb-text); }
.ins-sub { margin: 4px 0 0; font: 400 15px/21px var(--pb-font); color: var(--pb-text-2); }

/* the 4 steps: one card, a dashed line joins the numbers */
.ins-steps { list-style: none; margin: 14px 0 0; padding: 6px 16px; display: flex; flex-direction: column; border-radius: var(--pb-r-card); background: var(--pb-surface); border: 1px solid var(--pb-border); box-shadow: var(--pb-shadow-1); }
.ins-steps li { position: relative; display: flex; gap: 14px; padding: 14px 0; }
.ins-steps li:not(:last-child)::after { content: ""; position: absolute; left: 17px; top: 56px; bottom: -8px; width: 2px; background: repeating-linear-gradient(180deg, var(--pb-accent) 0 5px, transparent 5px 10px); opacity: .4; }
.ins-step-n { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 12px; background: var(--pb-brand); color: var(--pb-on-accent); font: 700 16px/1 var(--pb-font); font-variant-numeric: tabular-nums; box-shadow: var(--pb-shadow-fab); }
.ins-steps li > div { min-width: 0; }
.ins-steps h3 { margin: 6px 0 0; font: 600 17px/22px var(--pb-font); letter-spacing: -.011em; color: var(--pb-text); }
.ins-steps p { margin: 6px 0 0; font: 400 15px/22px var(--pb-font); color: var(--pb-text-2); overflow-wrap: anywhere; }

/* brand tips: a grouped list */
.ins-tips { display: flex; flex-direction: column; margin-top: 14px; border-radius: var(--pb-r-card); background: var(--pb-surface); border: 1px solid var(--pb-border); box-shadow: var(--pb-shadow-1); overflow: hidden; }
.ins-tip { border-top: 1px solid var(--pb-hairline); transition: background-color var(--pb-dur-med); }
.ins-tip:first-child { border-top: 0; }
.ins-tip.is-you { background: var(--pb-accent-softer); }
.ins-tip summary { display: flex; align-items: center; gap: 12px; min-height: 60px; padding: 8px 14px 8px 12px; cursor: pointer; list-style: none; -webkit-tap-highlight-color: transparent; }
.ins-tip summary::-webkit-details-marker { display: none; }
.ins-tip summary::marker { content: ""; }
.ins-tip summary:hover { background: var(--pb-accent-softer); }
.ins-tip summary:focus-visible { outline-offset: -2px; }
.ins-tip-ico { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; border-radius: 12px; background: var(--pb-accent-soft); color: var(--pb-accent-text); font: 700 13px/1 var(--pb-font); }
.ins-tip.is-you .ins-tip-ico { background: var(--pb-brand); color: var(--pb-on-accent); }
.ins-tip-name { flex: 1; min-width: 0; font: 600 16px/21px var(--pb-font); color: var(--pb-text); overflow-wrap: anywhere; }
.ins-tip-you { flex: none; display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 7px; background: var(--pb-accent); color: var(--pb-on-accent); font: 600 12px/1 var(--pb-font); white-space: nowrap; }
.ins-tip-chev { flex: none; width: 18px; height: 18px; color: var(--pb-text-3); transition: transform var(--pb-dur-med) var(--pb-e-std); }
.ins-tip[open] .ins-tip-chev { transform: rotate(180deg); }
.ins-tip ol { margin: 0; padding: 0 16px 16px 62px; list-style: none; counter-reset: tip; }
.ins-tip li { position: relative; padding: 5px 0 5px 32px; font: 400 15px/22px var(--pb-font); color: var(--pb-text-2); counter-increment: tip; overflow-wrap: anywhere; }
.ins-tip li::before { content: counter(tip); position: absolute; left: 0; top: 6px; width: 22px; height: 22px; border-radius: 50%; background: var(--pb-sunken); color: var(--pb-accent-text); font: 700 12px/22px var(--pb-font); text-align: center; }
@media (max-width: 400px) {
  .ins-tip-you { padding: 0 6px; font-size: 11.5px; }
  .ins-tip ol { padding-left: 16px; }
}

/* troubleshooting table: cards on a phone, a real table from 720px */
.ins-tablewrap { margin-top: 14px; }
.ins-table { width: 100%; border-collapse: collapse; }
.ins-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.ins-table, .ins-table tbody, .ins-table tr, .ins-table th, .ins-table td { display: block; }
.ins-table tr { margin-bottom: 10px; padding: 14px 16px; border-radius: var(--pb-r-card); background: var(--pb-surface); border: 1px solid var(--pb-border); box-shadow: var(--pb-shadow-1); }
.ins-table tbody th { padding: 0 0 6px; font: 600 16px/22px var(--pb-font); text-align: left; color: var(--pb-text); overflow-wrap: anywhere; }
.ins-table q { quotes: "\201C" "\201D"; color: var(--pb-text); }
.ins-table td { padding: 8px 0 0; font: 400 14.5px/21px var(--pb-font); color: var(--pb-text-2); overflow-wrap: anywhere; }
.ins-table td::before { content: attr(data-l-en); display: block; margin-bottom: 2px; font: 600 12.5px/16px var(--pb-font); color: var(--pb-accent-text); }
html.is-ur .ins-table td::before { content: attr(data-l-ur); }

/* fallback: the hero gradient as a card */
.ins-fallback { position: relative; isolation: isolate; overflow: hidden; padding: 24px 20px; border-radius: var(--pb-r-xl); color: var(--pb-on-hero); background: var(--pb-hero-card); box-shadow: var(--pb-shadow-2); }
.ins-fallback::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background-color: #fff; opacity: .07;
  -webkit-mask-image: var(--pb-doodle-url); mask-image: var(--pb-doodle-url);
  -webkit-mask-size: 232px 232px; mask-size: 232px 232px;
}
.ins-fallback h2 { font-size: 21px; line-height: 27px; color: var(--pb-on-hero); }
.ins-fallback p { margin: 8px 0 0; font: 400 15px/22px var(--pb-font); color: var(--pb-on-hero-2); }
.ins-actions { display: flex; flex-direction: column; gap: 10px; margin-top: 18px; }
.ins-fallback .ins-note { min-height: 1.5em; color: var(--pb-on-hero); }

/* the app does not run on iPhone: hide the download, keep the explanation */
.ins[data-os="ios"] .ins-dl-wrap, .ins[data-os="ios"] .ins-after, .ins[data-os="ios"] #ins-login { display: none; }

.ins-foot { padding: 0 8px; text-align: center; font: 400 13.5px/20px var(--pb-font); color: var(--pb-text-3); }
.ins-foot p { margin: 0; }

@media (min-width: 720px) {
  .ins-top-in { min-height: 64px; }
  .ins-hero { padding: 36px 0 34px; }
  .ins-hero h1 { font-size: 44px; line-height: 48px; letter-spacing: -.03em; }
  .ins-lead { font-size: 17px; line-height: 26px; }
  .ins-flow { gap: 34px; }
  .ins-card { padding: 26px; }
  .ins-btn-primary { width: auto; min-width: 320px; }
  .ins-dl-wrap { display: flex; flex-direction: column; align-items: flex-start; }
  .ins-actions { flex-direction: row; flex-wrap: wrap; }
  .ins-sec h2 { font-size: 26px; line-height: 32px; }
  .ins-steps { padding: 8px 24px; }
  .ins-fallback { padding: 30px 28px; }

  .ins-table { display: table; border-collapse: separate; border-spacing: 0; border-radius: var(--pb-r-card); overflow: hidden; background: var(--pb-surface); border: 1px solid var(--pb-border); box-shadow: var(--pb-shadow-1); }
  .ins-table thead { position: static; width: auto; height: auto; overflow: visible; clip: auto; display: table-header-group; }
  .ins-table tbody { display: table-row-group; }
  .ins-table tr { display: table-row; margin: 0; padding: 0; border: 0; border-radius: 0; background: none; box-shadow: none; }
  .ins-table th, .ins-table td { display: table-cell; vertical-align: top; padding: 14px 16px; border-bottom: 1px solid var(--pb-hairline); text-align: left; }
  .ins-table thead th { background: var(--pb-sunken); font: 600 13px/16px var(--pb-font); color: var(--pb-text-2); }
  .ins-table tbody th { width: 26%; padding: 14px 16px; }
  .ins-table tbody tr:last-child th, .ins-table tbody tr:last-child td { border-bottom: 0; }
  .ins-table td { padding-top: 14px; }
  .ins-table td::before, html.is-ur .ins-table td::before { content: none; }
}

@media (prefers-reduced-motion: reduce) {
  .ins-btn, .ins-tip-chev, .ins-tip, .ins-lang-btn, .ins-copy { transition: none; }
  .ins-btn:active { transform: none; }
}
