/* Shared chrome for download (Worker) + operators (Pages).
   Keep both copies identical: apps/site + apps/operators-site public/. */
:root {
  --bg: rgb(255, 255, 255);
  --layer: rgb(249, 250, 251);
  --sidebar: rgb(249, 250, 251);
  --label: rgb(15, 17, 21);
  --muted: rgb(97, 102, 107);
  --tertiary: rgb(129, 133, 140);
  --border: rgba(0, 0, 0, 0.1);
  --border-l1: rgba(0, 0, 0, 0.04);
  --border-thin: rgba(0, 0, 0, 0.1);
  --hover: rgba(38, 49, 72, 0.06);
  --bubble: rgb(237, 243, 254);
  --input: rgb(255, 255, 255);
  --send: rgb(65, 118, 230);
  --send-hover: rgb(103, 158, 254);
  --add: rgb(245, 246, 247);
  --btn: rgb(15, 17, 21);
  --btn-ink: rgb(255, 255, 255);
  --chip: color-mix(in srgb, var(--muted) 12%, transparent);
  --shadow-lv2: 0 4px 12px 0 rgba(0, 0, 0, 0.02), 0 2px 8px 0 rgba(0, 0, 0, 0.04);
  --radius: 12px;
  --radius-sm: 8px;
  --radius-pill: 999px;
  --page-max: 1400px;
  --page-pad-x: 24px;
  --page-pad-y: 24px;
  --page-pad-bottom: 56px;
  --top-h: 48px;
  --top-pad-x: 16px;
  --mast-min-h: 0;
  --mast-gap-y: 14px;
  --mast-gap-x: 28px;
  --mast-visual-min: 220px;
  --section-gap: 20px;
  --foot-gap-top: 40px;
  --tap: 44px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --mono: "SF Mono", "JetBrains Mono", Consolas, "Liberation Mono", Menlo,
    "PingFang SC", "Microsoft YaHei";
}
html[data-theme="dark"] {
  --bg: rgb(21, 21, 23);
  --layer: rgb(35, 35, 36);
  --sidebar: rgb(27, 27, 28);
  --label: rgb(249, 250, 251);
  --muted: rgb(207, 211, 214);
  --tertiary: rgb(173, 178, 184);
  --border: rgba(255, 255, 255, 0.12);
  --border-l1: rgba(255, 255, 255, 0.06);
  --border-thin: rgba(255, 255, 255, 0.06);
  --hover: rgba(255, 255, 255, 0.08);
  --bubble: rgb(44, 44, 46);
  --input: rgb(44, 44, 46);
  --send: rgb(103, 158, 254);
  --send-hover: rgb(65, 118, 230);
  --add: rgb(53, 54, 56);
  --btn: rgb(249, 250, 251);
  --btn-ink: rgb(15, 17, 21);
  --chip: color-mix(in srgb, var(--muted) 18%, transparent);
  --shadow-lv2: 0 8px 28px rgb(0 0 0 / 0.45);
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
html { color-scheme: light; }
html[data-theme="dark"] { color-scheme: dark; }
body {
  background: var(--bg);
  color: var(--label);
  font-family: var(--font);
  font-size: 13px;
  line-height: 18px;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
::selection { background: rgb(65, 118, 230); color: rgb(255, 255, 255); }

.skip {
  position: absolute;
  left: 12px;
  top: -40px;
  z-index: 8;
  padding: 8px 12px;
  border-radius: 8px;
  background: var(--btn);
  color: var(--btn-ink);
  text-decoration: none;
}
.skip:focus { top: 12px; }

.top {
  position: sticky;
  top: 0;
  z-index: 4;
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 8px;
  height: var(--top-h);
  padding: 0 var(--top-pad-x);
  padding-left: max(var(--top-pad-x), env(safe-area-inset-left, 0px));
  padding-right: max(var(--top-pad-x), env(safe-area-inset-right, 0px));
  border-bottom: 1px solid var(--border);
  background: var(--sidebar);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-right: auto;
  min-width: 0;
  height: 100%;
  text-decoration: none;
}
.mark-wrap {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: rgb(21, 21, 23);
  flex: none;
}
.mark { width: 18px; height: 18px; display: block; }
.name {
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
}
.nav-menu {
  display: none;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: 10px;
  background: var(--hover);
  color: var(--label);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.nav-menu-icon {
  position: relative;
  display: block;
  width: 16px;
  height: 12px;
}
.nav-menu-icon::before,
.nav-menu-icon::after,
.nav-menu-icon span {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: 2px;
  border-radius: 1px;
  background: currentColor;
}
.nav-menu-icon::before { top: 0; }
.nav-menu-icon span { top: 5px; }
.nav-menu-icon::after { bottom: 0; }
.top[data-nav-open="true"] .nav-menu-icon span { opacity: 0; }
.top[data-nav-open="true"] .nav-menu-icon::before {
  top: 5px;
  transform: rotate(45deg);
}
.top[data-nav-open="true"] .nav-menu-icon::after {
  bottom: 5px;
  top: auto;
  transform: rotate(-45deg);
}
.ghost, .lang, .theme {
  height: 28px;
  padding: 0 10px;
  border: 0;
  border-radius: 14px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  line-height: 1;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  cursor: pointer;
}
.ghost:hover, .lang:hover, .theme:hover, .nav-menu:hover {
  background: var(--hover);
  color: var(--label);
}
.theme[aria-pressed="true"] { background: var(--hover); color: var(--label); }

.page {
  max-width: var(--page-max);
  margin: 0 auto;
  padding:
    var(--page-pad-y)
    max(var(--page-pad-x), env(safe-area-inset-right, 0px))
    calc(var(--page-pad-bottom) + env(safe-area-inset-bottom, 0px))
    max(var(--page-pad-x), env(safe-area-inset-left, 0px));
}

.hero,
.sky {
  display: grid;
  gap: var(--mast-gap-y) var(--mast-gap-x);
  align-items: center;
  padding: 4px 0 0;
}
/* Download hero: content-sized right column — no fake empty plane. */
.hero {
  grid-template-columns: minmax(0, 1fr) auto;
}
/* Operators sky: keep a real visual column for the constellation. */
.sky {
  grid-template-columns: minmax(0, 1.05fr) minmax(var(--mast-visual-min), 0.95fr);
}
.hero h1,
.sky h1 {
  margin: 0;
  font-size: clamp(2rem, 5vw, 3.25rem);
  line-height: 1.08;
  font-weight: 600;
  letter-spacing: -0.03em;
  text-wrap: balance;
}
.lead {
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 24px;
  text-wrap: pretty;
  max-width: 40rem;
}
.cta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-top: 16px;
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 36px;
  min-width: 5.5rem;
  padding: 0 14px;
  border-radius: 18px;
  background: var(--btn);
  color: var(--btn-ink);
  text-decoration: none;
  font-size: 14px;
  line-height: 1;
  border: 0;
  cursor: pointer;
}
.btn:active:not([aria-disabled="true"]) { transform: scale(0.96); }
.btn:hover { filter: brightness(1.08); }
html[data-theme="dark"] .btn:hover { filter: brightness(0.94); }
.btn-outline {
  background: transparent;
  color: var(--label);
  box-shadow: inset 0 0 0 1px var(--border);
}
.btn[aria-disabled="true"] {
  background: transparent;
  color: var(--tertiary);
  box-shadow: inset 0 0 0 1px var(--border);
  pointer-events: none;
  filter: none;
}

.foot {
  margin-top: var(--foot-gap-top);
  padding-top: 16px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  gap: 12px 20px;
  color: var(--tertiary);
  font-size: 12px;
}
.foot a { text-decoration: none; }
.foot a:hover { color: var(--label); }

@media (max-width: 960px) {
  .page { --page-pad-x: 16px; }
  .hero,
  .sky {
    grid-template-columns: 1fr;
    min-height: 0;
  }
}

/* Phone */
@media (max-width: 860px) {
  :root {
    --page-pad-x: 16px;
    --page-pad-y: 12px;
    --page-pad-bottom: 32px;
    --section-gap: 18px;
    --foot-gap-top: 28px;
    --mast-min-h: 0;
    --mast-visual-min: 0;
    --mast-gap-y: 12px;
    --top-h: 52px;
    --top-pad-x: 12px;
  }

  .top {
    flex-wrap: wrap;
    height: auto;
    min-height: calc(var(--top-h) + env(safe-area-inset-top, 0px));
    padding-top: env(safe-area-inset-top, 0px);
    row-gap: 0;
  }
  .brand {
    height: var(--top-h);
  }
  .nav-menu {
    display: inline-flex;
    margin: 8px 0;
  }
  .nav {
    display: none;
    order: 3;
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    padding: 0 0 8px;
    border-top: 1px solid var(--border-l1);
  }
  .top[data-nav-open="true"] .nav { display: flex; }
  .nav .ghost,
  .nav .lang,
  .nav .theme {
    height: 42px;
    padding: 0 12px;
    border-radius: 10px;
    justify-content: flex-start;
    font-size: 14px;
  }

  .hero,
  .sky {
    gap: 12px;
    padding: 0;
  }
  .hero h1,
  .sky h1 {
    font-size: 1.75rem;
    line-height: 1.15;
  }
  .lead {
    margin-top: 8px;
    font-size: 14px;
    line-height: 21px;
  }
  .cta {
    margin-top: 12px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
  }
  /* One shared phone size for hero / catalog / download actions. */
  .cta .btn,
  .member-actions .btn,
  .dl-actions .btn {
    height: 42px;
    min-width: 5.5rem;
    padding: 0 14px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
  }
  .cta .btn {
    flex: 1 1 calc(50% - 4px);
    min-width: 0;
  }
  .cta .btn:only-child {
    flex: 1 1 100%;
  }
  .member-actions .btn,
  .dl-actions .btn {
    flex: 0 0 auto;
  }

  .foot {
    gap: 8px 14px;
    font-size: 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .btn { transition: none; }
}
