:root {
  --bg: #0f1419;
  --surface: #1a2332;
  --surface2: #243044;
  --border: #334155;
  --text: #e2e8f0;
  --muted: #94a3b8;
  --accent: #f43f5e;
  --accent2: #38bdf8;
  --ok: #4ade80;
  --warn: #fbbf24;
  --radius: 8px;
  --font: "Segoe UI", system-ui, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: var(--accent2); text-decoration: none; }
a:hover { text-decoration: underline; }

.site-header {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding: 0.75rem 1.25rem;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}

.brand {
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
}

.site-nav {
  display: flex;
  gap: 0.5rem;
  flex: 1;
}

.site-nav a {
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius);
  color: var(--muted);
  text-decoration: none;
}

.site-nav a.active,
.site-nav a:hover {
  background: var(--surface2);
  color: var(--text);
}

.cookie-badge {
  font-size: 0.8rem;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  border: 1px solid var(--border);
}

.cookie-badge.ok { border-color: var(--ok); color: var(--ok); }
.cookie-badge.warn { border-color: var(--warn); color: var(--warn); }

.site-main {
  flex: 1;
  padding: 1.25rem;
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
}

.site-footer {
  padding: 0.75rem 1.25rem;
  font-size: 0.85rem;
  color: var(--muted);
  border-top: 1px solid var(--border);
  display: flex;
  gap: 0.5rem;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin-bottom: 1rem;
}

.card h2, .card h3 { margin-top: 0; }

.muted { color: var(--muted); font-size: 0.9rem; }

.grid-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
}

.btn {
  display: inline-block;
  padding: 0.5rem 1rem;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-size: 0.9rem;
  cursor: pointer;
  text-decoration: none;
}

.btn:hover { filter: brightness(1.1); text-decoration: none; }

.btn-secondary {
  background: var(--surface2);
  color: var(--text);
  border: 1px solid var(--border);
}

.alert {
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  margin-bottom: 1rem;
  font-size: 0.9rem;
}

.alert-info { background: #0c4a6e; border: 1px solid #0369a1; }
.alert-warn { background: #422006; border: 1px solid #a16207; }
.alert-ok { background: #14532d; border: 1px solid #15803d; }

/* Browser lab */
.browser-shell {
  display: grid;
  grid-template-columns: 220px 1fr 280px;
  gap: 0;
  min-height: calc(100vh - 140px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
}

@media (max-width: 960px) {
  .browser-shell {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto 1fr;
  }
}

.browser-sidebar {
  background: var(--surface2);
  border-right: 1px solid var(--border);
  padding: 0.75rem;
  overflow-y: auto;
}

.browser-sidebar h3 {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  margin: 0 0 0.5rem;
}

.preset-link {
  display: block;
  padding: 0.5rem 0.6rem;
  margin-bottom: 0.25rem;
  border-radius: var(--radius);
  color: var(--text);
  font-size: 0.85rem;
  text-decoration: none;
}

.preset-link:hover,
.preset-link.active {
  background: var(--bg);
}

.preset-link small {
  display: block;
  color: var(--muted);
  font-size: 0.72rem;
  margin-top: 0.15rem;
}

.browser-main {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.browser-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--border);
  align-items: center;
  background: var(--bg);
}

.browser-toolbar input[type="url"] {
  flex: 1;
  min-width: 200px;
  padding: 0.45rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  font-size: 0.85rem;
}

.browser-frame-wrap {
  flex: 1;
  min-height: 480px;
  position: relative;
  background: #fff;
}

.browser-frame-wrap iframe {
  width: 100%;
  height: 100%;
  min-height: 520px;
  border: 0;
}

.frame-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 400px;
  padding: 2rem;
  text-align: center;
  color: var(--muted);
  background: var(--bg);
}

.browser-panel {
  border-left: 1px solid var(--border);
  padding: 0.75rem;
  overflow-y: auto;
  font-size: 0.85rem;
}

.browser-panel textarea {
  width: 100%;
  min-height: 100px;
  padding: 0.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--text);
  font-family: inherit;
  font-size: 0.85rem;
  resize: vertical;
}

.browser-panel label {
  display: block;
  margin: 0.5rem 0 0.25rem;
  color: var(--muted);
  font-size: 0.75rem;
}

.form-row { margin-bottom: 1rem; }

.form-row input[type="text"],
.form-row textarea {
  width: 100%;
  max-width: 640px;
  padding: 0.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
}

ol.steps { padding-left: 1.25rem; }
ol.steps li { margin-bottom: 0.5rem; }
