:root {
  --bar-h: 44px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
}

body[data-theme="dark"] {
  color-scheme: dark;
  --bg: #1b1b1d;
  --bar: #232326;
  --line: #34343a;
  --text: #ececf0;
  --muted: #a3a3ad;
  --chip: #2c2c31;
  --chip-hover: #37373d;
  --accent: #f2d27a;
  --accent-text: #1b1b1d;
}

body[data-theme="light"] {
  color-scheme: light;
  --bg: #f4f4f6;
  --bar: #ffffff;
  --line: #dcdce2;
  --text: #1c1c21;
  --muted: #5f5f6b;
  --chip: #ececf0;
  --chip-hover: #e0e0e6;
  --accent: #c99a1c;
  --accent-text: #ffffff;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.45 var(--font);
}

.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

.bar {
  height: var(--bar-h);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 10px;
  background: var(--bar);
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

.brand { display: flex; align-items: center; gap: 8px; flex: none; }
.brand .logo { width: 22px; height: 22px; border-radius: 5px; }
.brand strong { letter-spacing: .04em; font-size: 13px; }
.brand small { color: var(--muted); font-size: 11px; }

.tabs { display: flex; gap: 4px; flex: 1; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }

.tabs button, .actions button, .actions select, .button {
  font: inherit;
  color: var(--text);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 5px 10px;
  cursor: pointer;
  text-decoration: none;
}

.tabs button:hover, .actions button:hover, .button:hover { background: var(--chip-hover); }
.tabs button[aria-selected="true"] { background: var(--accent); color: var(--accent-text); }

.actions { display: flex; align-items: center; gap: 6px; flex: none; }
.actions button, .actions select { background: var(--chip); border-color: var(--line); }

#stage { position: absolute; top: var(--bar-h); left: 0; right: 0; bottom: 0; }
#stage iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; display: none; background: var(--bg); }
#stage iframe.active { display: block; }

.welcome {
  height: 100%;
  overflow: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 48px 16px;
  text-align: center;
}
.welcome[hidden] { display: none; }
.hero-logo { width: 96px; height: 96px; }
.welcome h1 { margin: 12px 0 4px; font-size: 30px; }
.welcome > p { color: var(--muted); max-width: 560px; }
.welcome .note { font-size: 12px; margin-top: 28px; }

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
  width: 100%;
  max-width: 920px;
  margin-top: 28px;
}
.cards button {
  font: inherit;
  text-align: left;
  color: var(--text);
  background: var(--bar);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 18px;
  cursor: pointer;
}
.cards button:hover { border-color: var(--accent); }
.cards strong { display: block; font-size: 15px; margin-bottom: 4px; }
.cards span { color: var(--muted); font-size: 13px; }

body[data-theme="dark"] .theme-light-only, body[data-theme="light"] .theme-dark-only { display: none; }

.dialog {
  max-width: min(460px, calc(100vw - 32px));
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bar);
  color: var(--text);
  padding: 24px;
  text-align: center;
}
.dialog.wide { max-width: min(620px, calc(100vw - 32px)); text-align: left; }
.dialog::backdrop { background: rgba(0, 0, 0, .45); }
.dialog h2 { margin: 8px 0; }
.dialog p { margin: 6px 0; }
.dialog .small { color: var(--muted); font-size: 12px; margin-top: 12px; }
.dialog-logo { width: 84px; height: 84px; }
.dialog .buttons { display: flex; gap: 8px; justify-content: center; margin-top: 18px; }
.dialog.wide .buttons { justify-content: flex-end; }
.dialog button, .dialog .button {
  font: inherit;
  color: var(--text);
  background: var(--chip);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 6px 14px;
  cursor: pointer;
  text-decoration: none;
}

.providers { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; margin-top: 14px; }
.providers a {
  display: block;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  text-decoration: none;
  background: var(--chip);
}
.providers a:hover { border-color: var(--accent); }

@media (max-width: 760px) {
  .brand strong, .brand small { display: none; }
  .actions #cloud { display: none; }
}
