:root {
  color-scheme: light;
  --navy: #102b4e;
  --navy-2: #173d67;
  --teal: #24a99a;
  --gold: #f4c65e;
  --ink: #18324f;
  --muted: #748399;
  --line: #e5ebf2;
  --surface: #ffffff;
  --page: #f3f6fa;
  font-family: "Segoe UI", Tahoma, Arial, sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--page); }
body { margin: 0; min-height: 100vh; min-height: 100dvh; color: var(--ink); background: var(--page); }
button, a { font: inherit; }
a { color: inherit; }
.app-shell { width: min(100%, 1440px); min-height: 100vh; min-height: 100dvh; margin-inline: auto; display: flex; flex-direction: column; padding: 0 clamp(14px, 3vw, 38px) 14px; }
.topbar { min-height: 76px; display: flex; align-items: center; justify-content: space-between; gap: 18px; border-bottom: 1px solid var(--line); }
.brand { display: inline-flex; align-items: center; gap: 11px; text-decoration: none; min-width: 0; }
.brand-icon { width: 46px; height: 46px; object-fit: cover; border-radius: 14px; box-shadow: 0 4px 12px #102b4e22; }
.brand-copy { display: grid; gap: 2px; }
.brand-copy strong { color: var(--navy); font-size: 20px; letter-spacing: -.04em; }
.brand-copy small { color: var(--muted); font-size: 11px; }
.top-actions { display: flex; align-items: center; gap: 9px; }
.button { min-height: 42px; display: inline-flex; justify-content: center; align-items: center; gap: 8px; padding: 0 15px; border: 1px solid transparent; border-radius: 12px; text-decoration: none; font-weight: 700; font-size: 13px; cursor: pointer; transition: transform .18s ease, box-shadow .18s ease, background .18s ease; }
.button:hover, .open-link:hover { transform: translateY(-1px); }
.button-install { background: var(--navy); color: white; box-shadow: 0 5px 14px #102b4e1c; }
.button-install:hover { background: var(--navy-2); box-shadow: 0 8px 20px #102b4e28; }
.install-symbol { font-size: 22px; line-height: 1; color: var(--gold); font-weight: 400; }
.button-open { color: var(--navy); background: white; border-color: var(--line); }
main { flex: 1; display: flex; flex-direction: column; gap: 16px; padding-top: 18px; }
.intro { position: relative; min-height: 126px; display: flex; align-items: center; justify-content: space-between; overflow: hidden; padding: 20px clamp(20px, 4vw, 42px); border-radius: 20px; color: #fff; background: radial-gradient(circle at 12% 15%, #ffffff18 0 2px, transparent 3px), radial-gradient(circle at 88% 100%, #1b557d 0, transparent 35%), linear-gradient(110deg, #102b4e 0%, #173f69 72%, #1b5971 100%); }
.intro::after { content: ""; position: absolute; width: 245px; height: 245px; border: 1px solid #ffffff16; border-radius: 50%; inset-inline-start: 28%; top: -175px; box-shadow: 0 0 0 24px #ffffff08, 0 0 0 49px #ffffff05; }
.intro-copy { position: relative; z-index: 1; max-width: 780px; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; color: #d5e7f0; font-size: 11px; font-weight: 700; }
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 0 4px #f4c65e1f; }
h1 { margin: 9px 0 4px; font-size: clamp(23px, 3vw, 32px); line-height: 1.15; letter-spacing: -.04em; }
.intro p { max-width: 640px; margin: 0; color: #dae6f1; line-height: 1.7; font-size: 13px; }
.intro-mark { position: relative; z-index: 1; width: 70px; height: 70px; display: grid; place-items: center; flex: 0 0 auto; margin-inline-end: 8%; border: 1px solid #ffffff31; border-radius: 22px; color: #fff; background: #ffffff0e; transform: rotate(-5deg); }
.intro-mark span { font-size: 38px; line-height: 1; font-weight: 800; }
.intro-mark i { position: absolute; top: 9px; inset-inline-end: 8px; color: var(--gold); font-style: normal; font-size: 15px; }
.platform-card { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; overflow: hidden; box-shadow: 0 9px 28px #173d670b; }
.platform-heading { min-height: 64px; display: flex; justify-content: space-between; align-items: center; gap: 14px; padding: 10px 17px; border-bottom: 1px solid var(--line); }
.platform-title { display: flex; align-items: center; gap: 10px; min-width: 0; }
.book-mark { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 11px; color: #137a80; background: #e4f6f3; font-size: 25px; line-height: 1; }
.platform-title div { display: grid; gap: 3px; }
.platform-title strong { font-size: 13px; color: var(--navy); }
.platform-title small { color: var(--muted); font-size: 11px; }
.open-link { white-space: nowrap; display: inline-flex; align-items: center; gap: 7px; color: var(--navy-2); text-decoration: none; font-size: 12px; font-weight: 700; transition: transform .18s ease; }
.open-link span { color: var(--teal); font-size: 17px; }
.frame-wrap { width: 100%; min-height: 680px; background: #f6f8fb; }
iframe { display: block; width: 100%; height: clamp(680px, 78vh, 980px); height: clamp(680px, 78dvh, 980px); border: 0; background: white; }
.frame-note { display: flex; gap: 8px; align-items: flex-start; margin: 0; padding: 11px 16px 13px; color: #64748b; border-top: 1px solid var(--line); background: #fbfcfe; font-size: 11px; line-height: 1.65; }
.frame-note span { color: #367f98; font-weight: 800; }
.app-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 38px; color: var(--muted); font-size: 11px; }
#connectionStatus { display: inline-flex; align-items: center; gap: 7px; }
.status-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: #25a878; }
#connectionStatus.offline .status-dot { background: #d66a5f; }
.install-dialog { position: fixed; max-width: min(420px, calc(100% - 28px)); padding: 28px; border: 0; border-radius: 22px; color: var(--ink); box-shadow: 0 24px 90px #0b1d3355; text-align: center; }
.install-dialog::backdrop { background: #0c1d33a8; backdrop-filter: blur(3px); }
.dialog-close { position: absolute; top: 10px; inset-inline-start: 12px; width: 34px; height: 34px; border: 0; border-radius: 50%; color: #6c788b; background: #f2f5f8; font-size: 23px; cursor: pointer; }
.dialog-icon img { width: 58px; height: 58px; border-radius: 18px; }
.install-dialog h2 { margin: 13px 0 8px; color: var(--navy); font-size: 21px; }
.install-dialog p { margin: 0 0 18px; color: #65758b; line-height: 1.9; font-size: 14px; }
.dialog-action { color: white; background: var(--navy); }

@media (max-width: 640px) {
  .app-shell { padding: 0 12px max(10px, env(safe-area-inset-bottom)); }
  .topbar { min-height: 66px; gap: 7px; }
  .brand { gap: 8px; }
  .brand-icon { width: 39px; height: 39px; border-radius: 12px; }
  .brand-copy strong { font-size: 18px; }
  .brand-copy small { font-size: 9px; }
  .top-actions { gap: 6px; }
  .button { min-height: 38px; padding: 0 10px; border-radius: 10px; font-size: 11px; }
  .button-open { display: none; }
  .install-symbol { font-size: 19px; }
  main { gap: 11px; padding-top: 12px; }
  .intro { min-height: 126px; padding: 18px 17px; border-radius: 16px; }
  .intro-mark { width: 48px; height: 48px; margin-inline-end: 0; border-radius: 15px; }
  .intro-mark span { font-size: 28px; }
  .intro-mark i { top: 5px; inset-inline-end: 4px; font-size: 11px; }
  h1 { margin-top: 8px; font-size: 25px; }
  .intro p { max-width: 290px; font-size: 11px; line-height: 1.65; }
  .platform-card { border-radius: 15px; }
  .platform-heading { min-height: 58px; padding: 9px 12px; }
  .open-link { font-size: 10px; }
  .frame-wrap { min-height: 650px; }
  iframe { height: max(650px, calc(100svh - 255px)); }
  .frame-note { padding: 9px 12px 11px; font-size: 10px; }
  .app-footer { min-height: 32px; font-size: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; }
}
