:root {
  color-scheme: dark;
  --navy-950: #050d18;
  --navy-900: #071522;
  --navy-850: #0a1b2b;
  --navy-800: #0d2135;
  --navy-700: #102b43;
  --blue: #0089bd;
  --blue-bright: #13b6ef;
  --blue-soft: #9adbf2;
  --amber: #f2a900;
  --ink: #f3f7fb;
  --muted: #b4c4d2;
  --line: #29425a;
  font-family: 'Segoe UI', 'Aptos', system-ui, sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--navy-950); scroll-behavior: smooth; }
body {
  min-width: 320px;
  min-height: 100svh;
  margin: 0;
  overflow-x: hidden;
  color: var(--ink);
  background:
    radial-gradient(ellipse at 78% 4%, rgba(10, 64, 110, .48), transparent 34rem),
    linear-gradient(145deg, #071522, #040b14 75%);
}
button, a { font: inherit; -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
a:focus-visible, button:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }

.stage {
  min-height: 100svh;
  padding: 24px;
  display: grid;
  place-items: center;
}
.app-window {
  container-type: inline-size;
  width: min(700px, 100%);
  margin: auto;
  overflow: hidden;
  border: 1px solid #28425b;
  border-radius: 16px;
  background: linear-gradient(145deg, #081a2b, #061322 60%, #08182a);
  box-shadow: 0 24px 80px #0009;
}
.titlebar {
  height: 32px;
  padding: 0 13px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #1e3449;
  background: #040b14;
  color: #c7d4e0;
  font-size: 12px;
  letter-spacing: .02em;
}
.window-controls { display: flex; align-items: center; gap: 13px; }
.window-controls i { display: block; width: 8px; height: 1px; background: #9aabba; }
.window-controls i:nth-child(2) { height: 7px; border: 1px solid #9aabba; background: transparent; }
.window-controls i:nth-child(3) { width: 8px; height: 8px; position: relative; background: transparent; }
.window-controls i:nth-child(3)::before, .window-controls i:nth-child(3)::after {
  position: absolute; top: 3px; left: 0; width: 8px; height: 1px; background: #9aabba; content: '';
}
.window-controls i:nth-child(3)::before { transform: rotate(45deg); }
.window-controls i:nth-child(3)::after { transform: rotate(-45deg); }

.topbar {
  min-height: 74px;
  padding: 9px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-bottom: 1px solid #1b344d;
  background: #081525;
}
.brand { display: flex; align-items: center; gap: 6px; min-width: 0; }
.brand-logo {
  width: 112px;
  height: 52px;
  padding: 3px 5px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 6px;
  background: #fff;
}
.brand-logo img { display: block; width: 100%; height: 100%; object-fit: contain; }
.brand-logo-rosi { width: 100px; }
.topbar-actions { display: flex; align-items: center; gap: 6px; min-width: 0; }
.program-pill, .account-pill {
  min-height: 35px;
  padding: 0 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid #29435d;
  border-radius: 8px;
  background: #0b1c2e;
  color: #e7f1fc;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}
.program-pill svg, .account-pill svg { width: 14px; height: 14px; fill: none; stroke: #b9d2e9; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; flex: none; }
.account-pill .chevron { width: 12px; height: 12px; }

.content { padding: 0 0 10px; }
.heading {
  margin: 0;
  padding: 22px 18px 19px;
  display: flex;
  align-items: center;
  gap: 13px;
}
.heading-mark {
  width: 4px;
  height: 37px;
  flex: none;
  border-radius: 4px;
  background: var(--amber);
  box-shadow: 0 0 18px #f2a90066;
}
.heading h1 {
  margin: 0;
  color: #fff;
  font-size: 30px;
  font-weight: 780;
  letter-spacing: -.035em;
  line-height: 1.1;
}
.heading p { margin: 5px 0 0; color: var(--muted); font-size: 14px; }

.core-card {
  position: relative;
  margin: 0 14px;
  padding: 13px;
  overflow: hidden;
  border: 1px solid #007eae;
  border-radius: 12px;
  background: linear-gradient(110deg, #092742, #071b30 72%, #0b2036);
  box-shadow: inset 0 0 0 1px #00a9df22, 0 8px 30px #00101e80;
}
.core-card::after {
  position: absolute;
  top: 0;
  right: 0;
  width: 48px;
  height: 100%;
  border-radius: 0 11px 11px 0;
  background:
    linear-gradient(125deg, transparent 0 43%, #007fa850 44% 66%, transparent 67%),
    linear-gradient(125deg, transparent 0 72%, #00a9df55 73% 88%, transparent 89%);
  content: '';
  pointer-events: none;
}
.core-header {
  position: relative;
  z-index: 1;
  min-height: 30px;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.core-header h2 { margin: 0; display: flex; align-items: center; gap: 9px; color: #fff; font-size: 17px; font-weight: 760; }
.core-header h2 svg { width: 22px; height: 22px; flex: none; fill: none; stroke: var(--amber); stroke-linecap: round; stroke-linejoin: round; stroke-width: 2; }
.pollu-badge {
  padding: 5px 8px;
  border: 1px solid var(--amber);
  border-radius: 6px;
  background: var(--amber);
  color: #132134;
  font-size: 10px;
  font-weight: 850;
  white-space: nowrap;
}
.core-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}
.core-action {
  min-height: 62px;
  padding: 9px 8px;
  display: flex;
  align-items: center;
  gap: 7px;
  border: 1px solid #3d5872;
  border-radius: 9px;
  background: linear-gradient(180deg, #112a43, #0c1e31);
  color: #f3f8fc;
  font-size: 12px;
  font-weight: 750;
  line-height: 1.16;
  transition: border-color .16s ease, background .16s ease, transform .16s ease;
}
.core-action svg { width: 21px; height: 21px; flex: none; fill: none; stroke: var(--amber); stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.9; }
.core-action span { min-width: 0; white-space: normal; }
.core-action.is-primary { border-color: #0088b9; background: linear-gradient(140deg, #0d4772, #102c48); }
.core-action:hover { transform: translateY(-1px); border-color: var(--blue-bright); background: #113756; }

.other-grid {
  margin: 12px 14px 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}
.other-action {
  min-height: 54px;
  padding: 8px 9px;
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid #243d57;
  border-radius: 9px;
  background: linear-gradient(180deg, #0b1c2d, #081421);
  color: #d5e2ef;
  font-size: 11px;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
}
.other-action svg { width: 18px; height: 18px; flex: none; fill: none; stroke: #8db5d5; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }
.other-action .arrow { margin-left: auto; color: var(--amber); font-size: 19px; line-height: 1; }
a.other-action:hover { border-color: var(--blue-bright); background: #113756; }
.other-action.unavailable { opacity: .9; cursor: not-allowed; }

.footer {
  min-height: 54px;
  margin: 8px 14px 0;
  padding: 8px 2px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: #a9bbca;
  font-size: 11px;
}
.release-note { display: flex; align-items: center; gap: 8px; }
.release-note i { width: 7px; height: 7px; flex: none; border-radius: 50%; background: #29c58a; box-shadow: 0 0 10px #29c58a66; }
.footer-actions { display: flex; align-items: center; gap: 7px; }
.edition {
  padding: 6px 10px;
  border: 1px solid #2e4c67;
  border-radius: 999px;
  background: #0b1e30;
  color: #dcecf8;
  font-size: 10px;
  font-weight: 750;
  white-space: nowrap;
}
.install-button {
  min-height: 34px;
  padding: 0 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid #008bb9;
  border-radius: 8px;
  background: #07293e;
  color: #e8f8ff;
  font-size: 11px;
  font-weight: 750;
  white-space: nowrap;
  cursor: pointer;
}
.install-button:hover { border-color: var(--blue-bright); background: #0d3a55; }
.install-button svg { width: 15px; height: 15px; fill: none; stroke: #66cef3; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }
.install-button[hidden] { display: none; }

.install-dialog {
  width: min(420px, calc(100vw - 28px));
  padding: 0;
  border: 1px solid #3b5c78;
  border-radius: 14px;
  background: #0a1b2b;
  color: var(--ink);
  box-shadow: 0 28px 90px #000b;
}
.install-dialog::backdrop { background: #020812b8; backdrop-filter: blur(4px); }
.install-dialog form { position: relative; padding: 24px; }
.dialog-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 32px;
  height: 32px;
  border: 1px solid #35516a;
  border-radius: 7px;
  background: #0c2438;
  color: #dbe9f4;
  font-size: 20px;
  cursor: pointer;
}
.dialog-eyebrow { margin: 0 40px 8px 0; color: #7bc9e9; font-size: 12px; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; }
.install-dialog h2 { margin: 0 40px 9px 0; color: #fff; font-size: 22px; }
.install-dialog p, .install-dialog li { color: #c5d3df; font-size: 14px; line-height: 1.5; }
.install-dialog p { margin: 0 0 12px; }
.install-dialog ol { margin: 0 0 18px; padding-left: 22px; }
.install-dialog li + li { margin-top: 6px; }
.dialog-done {
  min-height: 38px;
  padding: 0 16px;
  border: 0;
  border-radius: 8px;
  background: #0084b0;
  color: white;
  font-weight: 750;
  cursor: pointer;
}

@container (min-width: 641px) and (max-width: 760px) {
  .topbar { min-height: 74px; padding: 9px 14px; gap: 10px; }
  .brand { gap: 6px; }
  .brand-logo { width: 112px; height: 52px; }
  .brand-logo-rosi { width: 100px; }
  .topbar-actions { gap: 6px; }
  .program-pill, .account-pill { min-height: 35px; padding: 0 8px; gap: 6px; font-size: 11px; }
  .heading { padding: 22px 18px 19px; }
  .core-card { margin: 0 14px; padding: 13px; }
  .core-action { min-height: 62px; padding: 9px 8px; gap: 7px; font-size: 12px; }
  .other-grid { margin: 12px 14px 0; gap: 8px; }
  .other-action { min-height: 54px; padding: 8px 9px; font-size: 11px; }
  .footer { margin: 8px 14px 0; }
}

@media (max-width: 640px) {
  .stage { min-height: 100svh; padding: 0; }
  .app-window { width: 100%; min-height: 100svh; border: 0; border-radius: 0; }
  .topbar { align-items: flex-start; flex-direction: column; padding: 12px 14px; gap: 10px; }
  .brand-logo { width: 112px; height: 52px; }
  .brand-logo-rosi { width: 100px; }
  .topbar-actions { width: 100%; flex-wrap: wrap; }
  .program-pill, .account-pill { min-height: 35px; font-size: 11px; }
  .heading { padding: 20px 14px 16px; }
  .heading h1 { font-size: 28px; }
  .heading p { font-size: 13px; }
  .core-card { margin: 0 12px; padding: 12px; }
  .core-header { flex-wrap: wrap; }
  .core-header h2 { font-size: 16px; }
  .pollu-badge { font-size: 9px; }
  .core-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .core-action { min-height: 56px; padding: 8px; font-size: 12px; }
  .other-grid { margin: 11px 12px 0; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .other-action { min-height: 46px; padding: 8px; font-size: 11px; }
  .footer { min-height: 68px; margin: 7px 12px 0; align-items: flex-start; flex-direction: column; gap: 8px; }
  .footer-actions { width: 100%; justify-content: flex-end; }
}

@media (max-width: 380px) {
  .brand-logo { width: 104px; }
  .brand-logo-rosi { width: 94px; }
  .topbar-actions { gap: 6px; }
  .program-pill, .account-pill { padding: 0 7px; font-size: 10px; }
  .core-header h2 { font-size: 15px; }
  .pollu-badge { padding: 4px 6px; }
  .other-action { gap: 6px; font-size: 10px; }
  .footer { font-size: 10px; }
}

@media (display-mode: standalone) {
  .stage { padding: 0; }
  .app-window { width: min(100%, 900px); min-height: 100svh; border-radius: 0; }
  .titlebar { display: none; }
}

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