:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --background: #f3f5f8;
  --surface: #ffffff;
  --text: #172033;
  --muted: #647087;
  --line: #dce2ea;
  --accent: #1769e0;
  --accent-dark: #0f55bd;
  --success: #16835d;
  --radius: 14px;
  --shadow: 0 12px 32px rgb(22 34 55 / 9%);
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  color: var(--text);
  background: var(--background);
}

a { color: var(--accent-dark); }

button, a { font: inherit; }

.topbar {
  min-height: 82px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 16px 24px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.topbar h1 { margin: 2px 0 0; font-size: 21px; line-height: 1.2; }
.eyebrow { margin: 0; color: var(--accent); font-size: 12px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.topbar__actions { display: flex; flex-wrap: wrap; gap: 10px; }

.button {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 9px 14px;
  border: 1px solid var(--accent);
  border-radius: 9px;
  color: #fff;
  background: var(--accent);
  text-decoration: none;
  font-weight: 700;
}

.button:hover { background: var(--accent-dark); }
.button:focus-visible, .segmented button:focus-visible { outline: 3px solid rgb(23 105 224 / 30%); outline-offset: 2px; }
.button--secondary { color: var(--accent-dark); background: #fff; }
.button--secondary:hover { background: #eef5ff; }

.layout {
  min-height: calc(100vh - 82px);
  display: grid;
  grid-template-columns: minmax(270px, 340px) minmax(0, 1fr);
  gap: 16px;
  padding: 16px;
}

.panel, .viewer { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.panel { padding: 20px; overflow: auto; }
.panel section + section { margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--line); }
.panel h2 { margin: 10px 0 16px; font-size: 20px; }
.panel h3 { margin: 0 0 10px; font-size: 14px; }

.status { display: flex; align-items: center; gap: 8px; margin: 0; color: var(--success); font-size: 13px; font-weight: 700; }
.status__dot { width: 9px; height: 9px; border-radius: 50%; background: var(--success); box-shadow: 0 0 0 4px rgb(22 131 93 / 12%); }

.facts { margin: 0; }
.facts div { display: grid; grid-template-columns: 102px minmax(0, 1fr); gap: 10px; padding: 9px 0; border-top: 1px solid #eef1f5; }
.facts dt { color: var(--muted); font-size: 12px; }
.facts dd { min-width: 0; margin: 0; overflow-wrap: anywhere; font-size: 13px; font-weight: 650; }

.segmented { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; border-radius: 10px; background: #edf1f6; }
.segmented button { min-height: 38px; border: 0; border-radius: 7px; color: var(--muted); background: transparent; font-weight: 750; cursor: pointer; }
.segmented button[aria-pressed="true"] { color: var(--text); background: #fff; box-shadow: 0 2px 8px rgb(19 32 52 / 12%); }
.note { color: var(--muted); font-size: 13px; line-height: 1.55; }
.note p { margin: 8px 0 0; }

.viewer { min-width: 0; min-height: 620px; overflow: hidden; }
.viewer__bar { height: 44px; display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 0 14px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 12px; }
.viewer__bar span { color: var(--text); font-weight: 750; }
.viewer__bar code { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.launch { min-height: 575px; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 32px; text-align: center; background: radial-gradient(circle at 50% 25%, #f5f9ff, #fff 58%); }
.launch__icon { width: 72px; height: 72px; display: grid; place-items: center; border-radius: 20px; color: #fff; background: linear-gradient(145deg, var(--accent), #5a97ec); box-shadow: 0 15px 34px rgb(23 105 224 / 24%); font-size: 22px; font-weight: 850; letter-spacing: .06em; }
.launch__eyebrow { margin: 22px 0 5px; color: var(--accent); font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.launch h2 { margin: 0; font-size: clamp(24px, 4vw, 38px); }
.launch > p:not(.launch__eyebrow) { max-width: 610px; margin: 13px 0 0; color: var(--muted); line-height: 1.6; }
.launch__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 24px; }

.error { margin: 18px; padding: 16px; border: 1px solid #e8a7a7; border-radius: 10px; color: #8a1f1f; background: #fff4f4; }

@media (max-width: 900px) {
  .topbar { align-items: flex-start; }
  .layout { grid-template-columns: 1fr; }
  .panel { overflow: visible; }
  .launch { min-height: 480px; }
}

@media (max-width: 560px) {
  .topbar { flex-direction: column; padding: 14px; }
  .topbar__actions, .button { width: 100%; }
  .layout { padding: 10px; gap: 10px; }
  .panel { padding: 16px; }
  .facts div { grid-template-columns: 1fr; gap: 3px; }
  .viewer { min-height: 520px; }
  .launch { min-height: 476px; padding: 26px 18px; }
  .launch__actions, .launch__actions .button { width: 100%; }
}
