:root {
    color-scheme: dark;
    font: 16px/1.45 system-ui, sans-serif;
    color: #e8edfa;
    background: #111421;
    --surface: #191d2d;
    --border: #3b425a;
    --text-muted: #bac3da;
    --accent: #a8b9ff;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { max-width: 75rem; margin: 0 auto; padding: clamp(1rem, 4vw, 3rem); }
h1, h2, p { margin: 0; }
h1 { font-size: clamp(2.15rem, 6vw, 3.65rem); line-height: 1.05; letter-spacing: -.045em; }
h2 { font-size: 1.1rem; font-weight: 650; }
p { color: var(--text-muted); }
a { color: var(--accent); text-underline-offset: .2em; }
button, select, input, textarea { font: inherit; }
button, select, input[type="text"], input[type="number"], textarea {
    color: inherit;
    background: #141827;
    border: 1px solid var(--border);
    border-radius: .52rem;
    padding: .55rem .75rem;
}
button, summary, input[type="checkbox"], input[type="color"] { cursor: pointer; }
button:hover { border-color: var(--accent); }
:focus-visible { outline: 2px solid #c7ceff; outline-offset: 3px; }
.page-heading { display: flex; justify-content: space-between; gap: 1rem; align-items: end; margin-bottom: 1.8rem; }
.page-heading p { margin-top: .65rem; }
.page-heading a { flex: none; }
.cards { display: flex; flex-wrap: wrap; gap: .45rem; margin-bottom: .85rem; }
.cards button { font-size: .9rem; }
.cards [aria-pressed="true"] { background: #2c3659; border-color: #9babf5; color: #eef1ff; }
.workspace { display: grid; grid-template-columns: minmax(16.75rem, 20rem) minmax(0, 1fr); gap: .85rem; align-items: start; }
.panel { min-width: 0; background: var(--surface); border: 1px solid var(--border); border-radius: .85rem; padding: 1.15rem; }
#settings { display: flex; flex-direction: column; gap: .65rem; }
#settings > label, fieldset label { font-size: .92rem; }
#settings select, fieldset input[type="text"] { width: 100%; }
fieldset { border: 0; margin: .65rem 0 0; padding: .45rem 0 0; min-width: 0; }
fieldset legend { font-weight: 650; padding: 0; }
fieldset input[type="text"] { margin-top: .3rem; }
summary { color: var(--accent); }
.check { display: block; margin: .3rem 0; }
.color-options { display: grid; grid-template-columns: 1fr auto; gap: .35rem .5rem; align-items: center; margin-top: .5rem; }
input[type="color"] { width: 2.4rem; height: 1.65rem; border: 1px solid var(--border); border-radius: .33rem; background: transparent; padding: .12rem; }
input[type="color"]:disabled { cursor: default; opacity: .65; }
.number-options { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; margin-bottom: .6rem; }
.number-options label input { width: 100%; margin-top: .3rem; }
.actions, .preview-heading, .embed-bar { display: flex; gap: .55rem; align-items: center; }
.actions { margin-top: .5rem; flex-wrap: wrap; }
.primary { border-color: #a8b9ff; color: #111528; background: #a8b9ff; font-weight: 650; }
.primary:hover { background: #c4ceff; }
.preview-heading { justify-content: space-between; margin-bottom: .8rem; }
.preview-canvas {
    display: grid;
    min-height: 13rem;
    place-items: center;
    padding: clamp(.75rem, 3vw, 1.4rem);
    background: #101321 radial-gradient(#2a3146 1px, transparent 1px) 0 0 / 14px 14px;
    border: 1px solid #333a50;
    border-radius: .6rem;
}
.preview-canvas img { display: block; height: auto; max-width: 100%; }
.embed-bar { flex-wrap: wrap; margin: .6rem 0 .5rem; }
.embed-bar label { font-size: .91rem; }
#copy { margin-left: auto; }
#embed-code { width: 100%; resize: vertical; min-height: 4.5rem; font: .83rem/1.5 ui-monospace, monospace; }
#preview-status, #copy-status { font-size: .85rem; min-height: 1.25rem; margin-top: .35rem; }
@media (max-width: 44rem) {
    .page-heading { display: grid; }
    .workspace { grid-template-columns: minmax(0, 1fr); }
    .preview-canvas { min-height: 0; }
    .embed-bar { display: grid; grid-template-columns: minmax(0, 1fr) auto; }
    .embed-bar label { grid-column: 1 / -1; }
}
