* { box-sizing: border-box; }

:root {
  color-scheme: light;
  font-family: system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
  color: #182a2f;
  background: #f8faf9;
  --muted: #4b5e63;
  --line: #cddbd9;
  --accent: #14636c;
}

body { margin: 0; }

main {
  width: min(64rem, calc(100% - 2rem));
  margin-inline: auto;
  padding-block: clamp(2.5rem, 9vw, 7rem) 4rem;
}

h1 {
  font-size: clamp(1.875rem, 4vw, 2.5rem);
  font-weight: 650;
  line-height: 1.15;
  letter-spacing: -0.035em;
  margin: 0;
}

h2 {
  margin: 0;
  font-size: 1.25rem;
  line-height: 1.4;
  font-weight: 650;
}

.intro, .instructions ol, #clipboard-status, noscript { color: var(--muted); }
.intro { margin: 0.75rem 0 0; line-height: 1.5; }

.preview-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1.75rem;
}

.canvas {
  margin-top: 0.75rem;
  padding: clamp(0.5rem, 3vw, 1.5rem);
  border: 1px solid var(--line);
  border-radius: 1rem;
  background: #fff;
}

.canvas[data-dark="true"] { background: #111827; }

.preview {
  container-type: inline-size;
  max-width: 720px;
  margin-inline: auto;
  overflow: auto;
}

iframe {
  display: block;
  width: 720px;
  height: 240px;
  border: 0;
  background: #101e2a;
}

@supports (zoom: calc(1px / 1px)) {
  iframe { zoom: calc(100cqw / 720px); }
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.25rem;
}

button, .button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0.6rem 0.95rem;
  border: 1px solid var(--line);
  border-radius: 0.55rem;
  color: inherit;
  background: #fff;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 620;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}

button:hover, .button:hover, button[aria-pressed="true"] { background: #e7f0ed; }
.primary { color: #fff; background: var(--accent); border-color: var(--accent); }
.primary:hover { background: #0d5158; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
iframe:focus-visible { outline-offset: 0; }

#clipboard-status {
  min-height: 1.5rem;
  margin: 0.75rem 0 0;
  font-size: 0.875rem;
  line-height: 1.5;
}

#plain-fallback { margin-top: 0.5rem; }
#plain-fallback label { display: block; margin-bottom: 0.5rem; }

textarea {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--line);
  border-radius: 0.5rem;
  background: #fff;
  color: inherit;
  font: 0.875rem/1.45 ui-monospace, monospace;
}

.instructions { margin-top: 2.5rem; }
.instructions ol { margin: 0.75rem 0 0; padding-left: 1.25rem; line-height: 1.65; }
.instructions li + li { margin-top: 0.4rem; }
