/* WEB3 adapter -- the Safari layer's CSS (extra / web-only; see adapter/safari.js for the two host regimes). Linked by the generated index.html
   AFTER the renderer's own stylesheets; it edits no renderer rule, it only adds the browser-regime terms. env() is 0 outside a notched
   iOS viewport, so in Chromium and on desktop browsers every rule below leaves the desktop layout unchanged. */

/* insets: the app box stays edge-to-edge (its background fills the notch / home-indicator areas, as Android draws behind the system
   bars), its CONTENT is inset -- Android's edge-to-edge + WindowInsets, one formula */
html[data-wk-web] .wk-app,
html[data-wk-web] .wk-full {
  box-sizing: border-box;
  padding-top: env(safe-area-inset-top, 0px);
  padding-right: env(safe-area-inset-right, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  padding-left: env(safe-area-inset-left, 0px);
}

/* W1/117 R15 (iOS): at the first layout, while the layout viewport disagrees with the visual one, the app box takes the visual size
   (adapter/safari.js settle; cleared at the first viewport event that finds them equal). Before the keyboard rule: the keyboard's height wins. */
html[data-wk-vpfix] .wk-app,
html[data-wk-vpfix] .wk-full,
html[data-wk-vpfix] .wk-web-auth {
  right: auto; bottom: auto;
  width: var(--wk-vpw, 100%);
  height: var(--wk-vph, 100%);
}

/* keyboard (iOS): the app box follows the visual viewport while the keyboard is up (adapter/safari.js sets the vars) */
html[data-wk-kb] .wk-app,
html[data-wk-kb] .wk-full {
  bottom: auto;
  height: var(--wk-vvh, 100%);
  transform: translateY(var(--wk-vvtop, 0px));
  padding-bottom: 0;   /* the keyboard covers the home indicator */
}

/* the shell never rubber-bands or scrolls behind the fixed app box; the panes scroll inside it */
html[data-wk-web], html[data-wk-web] body { overscroll-behavior: none; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
html[data-wk-web] { -webkit-tap-highlight-color: transparent; }
html[data-wk-web] button, html[data-wk-web] [role="button"], html[data-wk-web] a { touch-action: manipulation; }

/* iOS: no system callout / magnifier over a long-press that opens the app's own menu; text fields keep theirs */
html[data-wk-ios] .wk-app, html[data-wk-ios] .wk-full, html[data-wk-ios] .wk-overlays { -webkit-touch-callout: none; }
html[data-wk-ios] input, html[data-wk-ios] textarea, html[data-wk-ios] [contenteditable="true"] { -webkit-touch-callout: default; }

/* iOS zooms the page on focus of a field under 16 px: on a touch screen the fields are at least 16 px (Android's composer text is 16 sp) */
@media (pointer: coarse) {
  html[data-wk-web] input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]),
  html[data-wk-web] textarea,
  html[data-wk-web] select { font-size: max(16px, 1em) !important; }
  /* W1/125 Q12 (his "Any language and Any Topic ... make it visible whole"; Android's two pickers share one text size): the roll-out
     pickers are ONE look -- the language picker (a button) and its arrow get the same 16 px floor the topic select gets above, so a
     touch screen never shows the two words at two sizes (measured 11.6 px vs 16 px at text -2 before this) */
  html[data-wk-web] .rooms-picker,
  html[data-wk-web] .wk-pick-mark { font-size: max(16px, 1em) !important; }
}

/* r3 (review C3): calls are not built on the web -- the Settings "Call devices" card (screens/devpick.js buildDevicesCard: card
   .set-calldevices, its label the element before it, core/kit.js pageCard) is hidden, as the desktop hides a capability it lacks.
   :has() is iOS 15.4+; older WebKit keeps the bare label (the card itself is hidden everywhere). */
html[data-wk-nocalls] .set-calldevices,
html[data-wk-nocalls] *:has(+ .set-calldevices) { display: none !important; }

/* r3 (review L3): a long-press on these opens the app's menu (adapter/safari.js) -- no WebKit selection / loupe / callout under it.
   Text fields are not listed; text copy stays in the menu (Copy text), as on Android. */
html[data-wk-ios] .post-row, html[data-wk-ios] .rooms-row, html[data-wk-ios] .wk-chip, html[data-wk-ios] .wk-tab,
html[data-wk-ios] .wk-kit-row, html[data-wk-ios] button, html[data-wk-ios] img {
  -webkit-user-select: none; user-select: none; -webkit-touch-callout: none;
}

/* r3 (review L4): the 3 renderer heights in 100vh (core/base.css:117 dialog, :156 sheet, screens/signin.css:10) -- iOS's 100vh is the LARGE
   viewport (toolbar hidden); dvh follows the toolbar. The vh line stays first as the fallback for a WebKit without dvh (< 15.4). */
html[data-wk-web] .wk-dialog { max-height: calc(100vh - 48px); max-height: calc(100dvh - 48px); }
html[data-wk-web] .wk-sheet { max-height: calc(100vh - 24px); max-height: calc(100dvh - 24px); }
html[data-wk-web] .signin-root { min-height: 100vh; min-height: 100dvh; }

/* r5 (LOOK 1-3): the web's signed-out screen (adapter/auth.js) -- the Android first screen, as W1/78/SITE/draft/auth_overlay.fragment.html
   draws it (dark field with the accent light, brand, title, line, ONE gradient button, the wallets, the foot links). Over the renderer's
   own sign-in START view only; the renderer's pairing step and the app are never covered. */
.wk-web-auth {
  position: fixed; inset: 0; z-index: 90; overflow-y: auto; box-sizing: border-box; display: flex; align-items: center; justify-content: center;
  /* W1/106 fix round L4: the field, the box and every word follow the PAGE theme (the tokens), as Android's onboarding follows
     Day / Night; the two accent lights kept, drawn from the accent token (color-mix: Safari 16.2+, inside the iOS 17 acceptance §6.753) */
  background: radial-gradient(900px 600px at 80% -10%, color-mix(in srgb, var(--c-accent-shown) 26%, transparent), transparent 70%),
              radial-gradient(700px 500px at -10% 110%, color-mix(in srgb, var(--c-accent-shown) 14%, transparent), transparent 70%), var(--c-page-bg);
  color: var(--c-text); font-family: var(--wk-font, inherit);
  padding: max(24px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(24px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
}
.wk-web-auth .wa-box { width: 100%; max-width: 400px; box-sizing: border-box; margin: auto; padding: 36px 32px 28px; border-radius: var(--frame-corner);
  --wa-card-fill: var(--c-card-fill); --wa-card-stroke: var(--c-card-border);   /* W1/114: the trademark frame's colours (auth.js trademarkCard) */
  background: var(--wa-card-fill); border: 1px solid var(--wa-card-stroke); box-shadow: 0 8px 48px color-mix(in srgb, var(--c-page-bg) 50%, transparent); display: flex; flex-direction: column; }
.wk-web-auth .wa-box.wa-box-shaped { background: none; border-color: transparent; }   /* W1/114: the shape paints them; the radius stays only for the shadow */
.wk-web-auth .wa-brand { display: flex; align-items: center; justify-content: center; gap: 10px; margin: 0 0 28px; font-size: 30px; font-weight: 800;
  letter-spacing: 0.06em; color: var(--c-lit-text, var(--c-text-accent)); }
.wk-web-auth .wa-brand img { width: 40px; height: 40px; border-radius: var(--control-corner); }
.wk-web-auth .wa-title { margin: 0 0 10px; font-size: 22px; font-weight: 700; color: var(--c-text); }
.wk-web-auth .wa-sub { margin: 0 0 26px; font-size: 15px; line-height: 1.45; color: var(--c-subtext); }
.wk-web-auth .wa-status { margin: 0 0 8px; font-size: 13px; color: var(--c-subtext); min-height: 0; }
.wk-web-auth .wa-status:empty { display: none; }
.wk-web-auth .wa-claim { margin: 0 0 12px; font-size: 13px; color: var(--c-subtext); overflow-wrap: anywhere; }
/* W1/106 ICONPASTE item 3: the plate, corner and colours are THE app button's (core/kit.js dressButton, core/base.css .wk-btn-primary --
   the Wik capsule); here only the place, the size and the words' face. Disabled / .off = the kit's state (dimmed), never a second hex. */
.wk-web-auth .wa-btn { display: flex; align-items: center; justify-content: center; box-sizing: border-box; width: 100%; min-height: 48px; padding: 12px 14px;   /* W1/114: = the account box's 48 px ("make it the same as the other buttons") */
 
  font: inherit; font-size: 16px; font-weight: 600; text-decoration: none; cursor: pointer; }
.wk-web-auth .wa-btn:disabled, .wk-web-auth .wa-btn.off { cursor: default; pointer-events: none; }
.wk-web-auth .wa-btn + .wa-btn { margin-top: 12px; }   /* W1/114: two stacked buttons never touch (measured 0 px, Cancel + Remove) */
.wk-web-auth .wa-wallets-row { display: flex; flex-direction: column; gap: 10px; }
.wk-web-auth .wa-icons { display: flex; justify-content: center; gap: 14px; margin: 10px 0 12px; }   /* W1/114: right under "Connect with" */
.wk-web-auth .wa-icons img { width: 28px; height: 28px; border-radius: var(--control-corner); opacity: 0.9; }
.wk-web-auth .wa-link { margin: 14px auto 0; border: 0; background: none; font: inherit; font-size: 15px; color: var(--c-lit-text, var(--c-text-accent)); cursor: pointer; min-height: 44px; }
.wk-web-auth .wa-error { color: var(--c-red-on-card, var(--c-red)); font-size: 13px; margin-top: 10px; text-align: center; }
.wk-web-auth .wa-foot { display: flex; justify-content: center; gap: 18px; margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--c-card-border); font-size: 13px; }
.wk-web-auth .wa-foot a { color: var(--c-subtext); text-decoration: none; }
/* W1/107 Q18 (A9): the welcome GATEWAY (screens/gateway.js) -- tagline, one lead, three points, then the actions in his order. Colours are
   the theme's tokens (Day / Night); every text wraps, never clips (a German / Finnish / Vietnamese lead at 390). Touch targets >= 44 px. */
.wk-web-auth .gw-hero { margin: 0 0 22px; text-align: center; }
.wk-web-auth .gw-tagline { margin: 0 0 10px; font-size: 24px; line-height: 1.25; font-weight: 800; color: var(--c-text); overflow-wrap: anywhere; }
.wk-web-auth .gw-lead { margin: 0 0 16px; font-size: 15px; line-height: 1.45; color: var(--c-subtext); overflow-wrap: anywhere; }
.wk-web-auth .gw-points { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; text-align: start; }
.wk-web-auth .gw-point { position: relative; padding-inline-start: 22px; font-size: 14px; line-height: 1.4; color: var(--c-text); overflow-wrap: anywhere; }
.wk-web-auth .gw-point::before { content: ''; position: absolute; inset-inline-start: 4px; top: 0.45em; width: 8px; height: 8px; border-radius: 50%;
  background: var(--c-accent-shown, var(--c-accent)); }
.wk-web-auth .acc-entry + .wa-go, .wk-web-auth .wa-go + .acc-entry { margin-top: 10px; }
.wk-web-auth .gw-more-host { font-size: 13px; opacity: 0.85; }   /* W1/114: the intro's address, line 2 */
.wk-web-auth .gw-more { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; min-height: 44px; margin: 12px auto 0; font-size: 15px;
  color: var(--c-lit-text, var(--c-text-accent)); text-decoration: none; text-align: center; }
/* W1/108 DL: the ONE download row (screens/gateway.js gatewayDownloads) -- quiet: the shared theme's secondary button (core/base.css
   .wk-btn-secondary, dressed by core/kit.js), its own width, centred, 44 px; the iPhone line is plain sub text. No heading, no caption. */
.wk-web-auth .gw-dl { display: flex; justify-content: center; margin: 16px 0 0; }
.wk-web-auth .gw-dl-btn { display: inline-flex; align-items: center; justify-content: center; box-sizing: border-box; min-height: 44px;
  max-width: 100%; padding: 10px 20px; font: inherit; font-size: 15px; font-weight: 600; text-decoration: none; text-align: center;
  overflow-wrap: anywhere; cursor: pointer; }
.wk-web-auth .gw-dl-note { margin: 0; font-size: 14px; line-height: 1.4; color: var(--c-subtext); text-align: center; overflow-wrap: anywhere; }
@media (max-width: 480px) {
  .wk-web-auth { align-items: flex-start; }
  .wk-web-auth .wa-box { background: transparent; border: 0; box-shadow: none; padding: 28px 12px 16px; --wa-card-fill: transparent; --wa-card-stroke: transparent; }
}
/* r5 (LOOK 3): the web pairing step draws the QR it now has (adapter/pair.js); an empty QR box never shows (no QR = no box) */
html[data-wk-web] .signin-qr:not(:has(img)) { display: none; }
