/* Shared by widgets.html and dashboard.html: tokens, buttons, panels and the widget stages (the header is in site.css). */
:root {
  color-scheme: dark;
  --bg: #070B12;
  --surface: #0F1622;
  --surface-2: #152030;
  --line: #1C2838;
  --line-2: #2A3A4F;
  --text: #E4EDF5;
  --muted: #8898AB;
  --dim: #54647A;
  --accent: #4FD1FF;
  --accent-rgb: 79, 209, 255;
  --accent-2: #9CE6FF;
  --accent-ink: #00141C;
  --f-display: "Big Shoulders Display", "Oswald", "Arial Narrow", Impact, sans-serif;
  --f-stencil: "Big Shoulders Stencil Display", "Big Shoulders Display", Impact, sans-serif;
  --f-body: "Barlow", "Roboto", "Segoe UI", system-ui, sans-serif;
  --f-mono: "JetBrains Mono", ui-monospace, Consolas, monospace;
  --gutter: clamp(16px, 4vw, 56px);
  --maxw: 1180px;
  --nav-h: 68px;
}
* { box-sizing: border-box; }
html { background: var(--bg); }
.i18n-wait body { visibility: hidden; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--f-body); font-size: 17px; line-height: 1.6; -webkit-font-smoothing: antialiased; }
a { color: var(--accent); }
.wrap { max-width: var(--maxw); margin-inline: auto; padding-inline: var(--gutter); }

/* brand (header and footer) */
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); font-family: var(--f-stencil); font-weight: 900; font-size: 26px; letter-spacing: .04em; }
.brand svg { width: 28px; height: 28px; color: var(--accent); }

/* hero */
.hero { padding-block: clamp(48px, 8vw, 96px) clamp(32px, 5vw, 56px); }
.eyebrow { font-family: var(--f-mono); font-size: 12.5px; letter-spacing: .16em; text-transform: uppercase; color: var(--accent); margin: 0 0 16px; }
h1 { font-family: var(--f-display); font-weight: 900; font-size: clamp(46px, 7vw, 88px); line-height: .92; text-transform: uppercase; margin: 0 0 20px; max-width: 14ch; overflow-wrap: break-word; }
h1 em { font-style: normal; color: var(--accent); }
.sub { color: var(--muted); max-width: 60ch; margin: 0; font-size: clamp(17px, 1.4vw, 19px); }

/* gallery */
.gallery { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.style-card { display: grid; grid-template-rows: auto 1fr; background: var(--surface); border: 1px solid var(--line); }
.stage {
  position: relative;
  height: 210px;
  display: grid;
  place-items: center;
  overflow: hidden;
  background:
    radial-gradient(120% 90% at 15% 20%, #3b4552 0%, transparent 55%),
    radial-gradient(90% 90% at 85% 80%, #6b4a1c 0%, transparent 60%),
    linear-gradient(135deg, #1b2028, #0d1015);
  border-bottom: 1px solid var(--line);
}
/* Wide or tall styles do not fit a gallery column: centre them on the stage and scale them down. */
.stage .pw-card, .stage .pw-bar, .stage .pw-tile, .stage .pw-progress { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%) scale(var(--s, .78)); }
.stage .pw-bar { --s: .5; }
.stage .pw-tile { --s: .82; }
.stage .pw-progress { --s: .8; }
.style-body { padding: 20px 22px 22px; display: grid; gap: 8px; align-content: start; }
.style-body h2 { font-family: var(--f-display); font-weight: 800; font-size: 28px; text-transform: uppercase; letter-spacing: .02em; margin: 0; line-height: 1; }
.style-body p { color: var(--muted); margin: 0 0 6px; font-size: 16px; }

/* builder */
.builder { margin-block: clamp(48px, 7vw, 88px); display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(24px, 4vw, 56px); align-items: start; }
.panel { background: var(--surface); border: 1px solid var(--line); padding: clamp(20px, 3vw, 32px); display: grid; gap: 20px; }
.panel h2 { font-family: var(--f-display); font-weight: 800; font-size: clamp(30px, 3.2vw, 40px); text-transform: uppercase; margin: 0; line-height: 1; }
label, .field-label { display: block; font-family: var(--f-mono); font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; }
input[type="text"], .url { width: 100%; height: 46px; padding: 0 14px; background: var(--bg); border: 1px solid var(--line-2); color: var(--text); font: 500 16px var(--f-body); }
input[type="text"]:focus-visible, .url:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }
.url { font-family: var(--f-mono); font-size: 13px; color: var(--muted); }
.styles { display: flex; flex-wrap: wrap; gap: 8px; border: 0; padding: 0; margin: 0; }
.styles label { display: inline-block; margin: 0; position: relative; }
.styles input { position: absolute; opacity: 0; pointer-events: none; }
.styles span { display: inline-block; padding: 9px 14px; border: 1px solid var(--line-2); font-family: var(--f-mono); font-size: 13px; letter-spacing: .06em; cursor: pointer; color: var(--muted); }
.styles input:checked + span { border-color: var(--accent); color: var(--text); background: rgba(var(--accent-rgb), .1); }
.styles input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.row { display: flex; gap: 8px; flex-wrap: wrap; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 46px; padding: 0 20px; border: 0; cursor: pointer; text-decoration: none; font-family: var(--f-display); font-weight: 800; font-size: 18px; letter-spacing: .04em; text-transform: uppercase; }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: var(--accent-2); }
.btn-ghost { background: var(--surface-2); color: var(--text); box-shadow: inset 0 0 0 1px var(--line-2); }
.btn:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }
.btn[aria-disabled="true"] { opacity: .45; pointer-events: none; }
.size { font-family: var(--f-mono); font-size: 13px; color: var(--dim); margin: 0; }
.preview { min-height: 230px; display: grid; place-items: center; padding: 24px; }
.steps { margin: 0; padding-left: 22px; display: grid; gap: 10px; color: var(--muted); }
.steps b { color: var(--text); font-weight: 600; }
.note { color: var(--dim); font-size: 14.5px; margin: 0; border-left: 2px solid var(--line-2); padding-left: 12px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }


@media (max-width: 960px) {
  .gallery { grid-template-columns: minmax(0, 1fr); }
  .builder { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 480px) {
  .stage { height: 180px; }
  .stage .pw-card { --s: .66; }
  .stage .pw-bar { --s: .44; }
  .stage .pw-tile { --s: .72; }
  .stage .pw-progress { --s: .7; }
  .stage .pw-basic { transform: scale(.82); }
}
.save-cta { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; margin-top: 28px; }
.save-cta p { margin: 0; color: var(--muted); max-width: 46ch; font-size: 15.5px; }
