/* ---------- BASE ---------- */
* { box-sizing: border-box; margin: 0; }

:root {
  --ink: #1e2430;
  --muted: #667085;
  --line: #e4e7ec;
  --accent: #4f46e5;
}

body {
  min-height: 100vh;
  background: #f6f7fb;
  color: var(--ink);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

.top { max-width: 1100px; margin: 0 auto; padding: 28px 16px 8px; }
.top h1 { font-size: clamp(24px, 4vw, 34px); letter-spacing: -.5px; }
.top p { color: var(--muted); margin-top: 6px; }

.layout {
  max-width: 1100px;
  margin: 0 auto;
  padding: 16px;
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  grid-template-areas: "controls preview" "code preview";
  gap: 16px;
  align-items: start;
}
.controls { grid-area: controls; }
.preview { grid-area: preview; }
.code { grid-area: code; }
.panel { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 18px; }
code { font-family: ui-monospace, Consolas, monospace; }
/* ---------- END BASE ---------- */

/* ---------- CONTROLS ---------- */
.label { display: block; font: 600 13px ui-monospace, Consolas, monospace; margin-bottom: 8px; }
.opts { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 18px; }
.opt {
  padding: 7px 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: inherit;
  font: 13px ui-monospace, Consolas, monospace;
  cursor: pointer;
}
.opt:hover { border-color: #a5b4fc; }
.opt[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: #fff; }
.opt:focus-visible, .copy:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

.ctl { display: block; margin-bottom: 14px; font: 600 13px ui-monospace, Consolas, monospace; }
.ctl > span { display: flex; margin-bottom: 6px; }
.ctl output { margin-left: auto; color: var(--accent); }
.ctl input { width: 100%; accent-color: var(--accent); }
.ctl.off { opacity: .4; }

.check { display: flex; align-items: center; gap: 8px; font-size: 13px; margin-bottom: 16px; cursor: pointer; }
.check input { accent-color: var(--accent); width: 16px; height: 16px; }

.facts { display: grid; gap: 8px; }
.fact { display: flex; gap: 10px; padding: 10px 12px; border-radius: 10px; background: #f8f9fb; font-size: 13px; line-height: 1.45; }
.fact b { flex: none; width: 92px; color: var(--muted); font-weight: 600; }
.facts .say { padding: 12px; border-radius: 10px; background: #eef2ff; color: #3730a3; font-size: 13.5px; line-height: 1.5; }
/* ---------- END CONTROLS ---------- */

/* ---------- PREVIEW ---------- */
.browser { border: 1px solid #d0d5dd; border-radius: 12px; overflow: hidden; }
.bar { display: flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px; background: #f2f4f7; border-bottom: 1px solid #e4e7ec; }
.bar i { width: 11px; height: 11px; border-radius: 50%; background: #d0d5dd; }
.bar span { margin-left: 10px; font-size: 12px; color: var(--muted); }
.frame { display: block; width: 100%; height: 520px; border: 0; background: #fff; }
/* ---------- END PREVIEW ---------- */

/* ---------- CODE ---------- */
.code-head { display: flex; justify-content: space-between; align-items: center; }
.code-head h2 { font: 700 15px ui-monospace, Consolas, monospace; color: var(--accent); }
.copy { padding: 6px 12px; border: 0; border-radius: 8px; background: var(--accent); color: #fff; font: 600 13px system-ui, sans-serif; cursor: pointer; }
.code pre { margin-top: 12px; padding: 14px 16px; border-radius: 10px; background: #111827; color: #e5e7eb; font: 13.5px/1.6 ui-monospace, Consolas, monospace; overflow-x: auto; }
.css .sel { color: #f9a8d4; } .css .k { color: #93c5fd; } .css .v { color: #fcd34d; } .css .c { color: #6b7280; }
/* ---------- END CODE ---------- */

/* ---------- SMALL SCREENS ---------- */
@media (max-width: 860px) {
  .layout { grid-template-columns: minmax(0, 1fr); grid-template-areas: "controls" "preview" "code"; }
  .frame { height: 440px; }
}
/* ---------- END SMALL SCREENS ---------- */
