/* Layout idea: one calm column, three numbered steps, results as copy-ready cards.
   Brand: Ron. Brand & Social (forest green, gold, white, Bebas Neue + Familjen Grotesk).
   December hints: light string under the header, candy-stripe edge on results, snowflake eyebrow.
   Single light theme by choice. Spacing runs on an 8px scale: --s1 4 ... --s8 64. */
:root {
  --bg: #FFFFFF;
  --surface: #FFFFFF;
  --surface-2: #F1EEE2;
  --ink: #111111;
  --muted: #5E5B52;
  --line: #DAD5C3;
  --brand: #234A14;
  --on-brand: #FFFFFF;
  --cta: #F5D317;
  --on-cta: #111111;
  --holly: #B3202A;
  --gold: #F5D317;
  --ok: #234A14;
  --display: "Bebas Neue", Impact, "Arial Narrow", sans-serif;
  --body: "Familjen Grotesk", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px; --s7: 48px; --s8: 64px;
  color-scheme: light;
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font: 17px/1.6 var(--body); -webkit-text-size-adjust: 100%; }
main { max-width: 760px; margin: 0 auto; padding: var(--s6) 20px var(--s8); display: flex; flex-direction: column; gap: var(--s6); }
h1, h2 { font-family: var(--display); font-weight: 400; line-height: 1.05; letter-spacing: .02em; text-wrap: balance; margin: 0; }
h1 { font-size: clamp(2.6rem, 10vw, 4.2rem); color: var(--brand); text-wrap: pretty; }
h2 { font-size: 1.75rem; display: flex; align-items: center; gap: var(--s3); }
p { margin: 0; }

.top { display: flex; flex-direction: column; gap: var(--s4); padding-top: var(--s2); }
.eyebrow { display: flex; align-items: center; gap: var(--s2); font-size: .8rem; line-height: 1.4; letter-spacing: .14em; text-transform: uppercase; color: var(--holly); font-weight: 700; margin-bottom: var(--s1); }
.eyebrow svg { width: 16px; height: 16px; flex: none; }
.lede { color: var(--muted); max-width: none; font-size: 1.05rem; line-height: 1.65; text-wrap: pretty; }
.muted { color: var(--muted); font-weight: 400; }
.lights { display: block; width: 100%; height: 22px; margin-top: var(--s3); }

form { display: flex; flex-direction: column; gap: var(--s5); }
.codebar { display: flex; flex-direction: column; gap: var(--s2); }
.codebar label { font-size: .88rem; font-weight: 700; line-height: 1.4; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: var(--s5); display: flex; flex-direction: column; gap: var(--s5); }
.num { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--brand); color: var(--on-brand); font: 400 1.15rem/1 var(--display); letter-spacing: 0; flex: none; padding-top: 2px; }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; display: flex; flex-direction: column; gap: var(--s4); }
legend { padding: 0; margin-bottom: var(--s4); font-weight: 700; font-size: 1rem; line-height: 1.4; }
fieldset[hidden] { display: none; }
fieldset + fieldset { margin-top: var(--s1); }

.drop { display: flex; flex-direction: column; gap: var(--s2); align-items: center; text-align: center; padding: var(--s7) var(--s5); border: 2px dashed var(--line); border-radius: 14px; background: var(--bg); transition: border-color .15s, background .15s; cursor: default; }
.drop:hover, .drop.over { border-color: var(--brand); }
.drop.over { background: var(--surface-2); }
.drop:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-color: var(--brand); }
.drop-title { font-weight: 700; font-size: 1.1rem; line-height: 1.4; }
.drop-sub { color: var(--muted); font-size: .95rem; line-height: 1.55; max-width: 44ch; }
.drop-or { color: var(--muted); font-size: .9rem; margin-top: var(--s2); }
.choose { min-height: 48px; padding: 0 var(--s5); border: 1px solid var(--ink); border-radius: 999px; background: var(--bg); color: var(--ink); font-weight: 700; cursor: pointer; }
.choose:hover { background: var(--surface-2); }
.choose:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

.thumbs { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: var(--s3); }
.thumbs:empty { display: none; }
.thumb { position: relative; width: 104px; height: 104px; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); background: var(--surface-2); }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb .n { position: absolute; left: var(--s2); top: var(--s2); background: var(--ink); color: var(--bg); border-radius: 999px; font-size: .75rem; font-weight: 700; min-width: 22px; height: 22px; display: grid; place-items: center; padding: 0 6px; }
.thumb button { position: absolute; right: 6px; top: 6px; width: 30px; height: 30px; border-radius: 50%; border: 0; background: var(--ink); color: var(--bg); cursor: pointer; font-size: 1.1rem; line-height: 1; }

.chips { display: flex; flex-wrap: wrap; gap: var(--s3); }
.chip, .opt { position: relative; }
.chip input, .opt input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; cursor: pointer; margin: 0; }
.chip span { display: inline-flex; align-items: center; min-height: 48px; padding: 0 var(--s5); border: 1px solid var(--ink); border-radius: 999px; background: var(--bg); font-weight: 600; transition: background .15s, color .15s; }
.chip input:checked + span { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
.chip input:focus-visible + span, .opt input:focus-visible + span { outline: 2px solid var(--brand); outline-offset: 2px; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(112px, 1fr)); gap: var(--s3); }
.opt span { display: flex; flex-direction: column; gap: var(--s2); height: 100%; padding: var(--s4); min-height: 92px; border: 1px solid var(--line); border-radius: 14px; background: var(--bg); transition: border-color .15s, background .15s; }
.opt b { font-weight: 700; line-height: 1.3; }
.opt small { color: var(--muted); font-size: .85rem; line-height: 1.45; }
.opt input:checked + span { border-color: var(--brand); background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--brand); }

.more summary { cursor: pointer; display: flex; align-items: center; gap: var(--s3); min-height: 56px; padding: 0 var(--s4) 0 var(--s5); border: 1px solid var(--line); border-radius: 12px; background: var(--bg); list-style: none; transition: background .15s, border-color .15s; }
.more summary::-webkit-details-marker { display: none; }
.more summary:hover { background: var(--surface-2); border-color: var(--brand); }
.sum-title { font-weight: 700; }
.sum-sub { color: var(--muted); font-size: .9rem; min-width: 0; }
.chev { margin-left: auto; width: 24px; height: 24px; flex: none; color: var(--brand); transition: transform .2s; }
.more[open] .chev { transform: rotate(180deg); }
.more[open] summary { margin-bottom: var(--s5); }
@media (max-width: 480px) { .sum-sub { display: none; } }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: var(--s4); margin-bottom: var(--s4); }
.field { display: flex; flex-direction: column; gap: var(--s2); }
.field label { font-size: .88rem; font-weight: 700; line-height: 1.4; }
input[type="text"] { font: inherit; padding: var(--s3) var(--s4); min-height: 48px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); color: var(--ink); width: 100%; }
input[type="text"]:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }
input::placeholder { color: var(--muted); opacity: .8; }
.check { display: flex; align-items: center; gap: var(--s3); min-height: 48px; cursor: pointer; line-height: 1.45; }
.check input { width: 20px; height: 20px; accent-color: var(--brand); flex: none; }

.actions { display: flex; flex-direction: column; gap: var(--s4); align-items: stretch; padding-top: var(--s2); }
button { font: inherit; }
.primary { min-height: 56px; border: 0; border-radius: 999px; background: var(--cta); color: var(--on-cta); font-weight: 700; font-size: 1.05rem; cursor: pointer; padding: 0 var(--s6); transition: filter .15s; }
.primary:hover:not(:disabled) { filter: brightness(.96); }
.primary:disabled { background: var(--surface-2); color: var(--muted); cursor: not-allowed; }
.secondary { min-height: 56px; padding: 0 var(--s5); border: 1px solid var(--ink); border-radius: 999px; background: var(--bg); color: var(--ink); font-weight: 700; font-size: 1.05rem; cursor: pointer; transition: background .15s; }
.secondary:hover:not(:disabled) { background: var(--surface-2); }
.secondary:disabled { opacity: .5; cursor: not-allowed; }
.secondary[hidden] { display: none; }
.secondary:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.primary:focus-visible, .copy:focus-visible, .thumb button:focus-visible, .more summary:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.hint { color: var(--muted); font-size: .95rem; line-height: 1.5; text-align: center; min-height: 1.5em; }
.error { background: color-mix(in srgb, var(--holly) 8%, var(--surface)); border: 1px solid var(--holly); border-radius: 12px; padding: var(--s4) var(--s5); line-height: 1.55; }
.error[hidden], .bar[hidden], #results[hidden] { display: none; }
.bar { height: 4px; border-radius: 4px; background: var(--surface-2); overflow: hidden; }
.bar span { display: block; height: 100%; width: 35%; background: var(--brand); border-radius: 4px; animation: slide 1.1s ease-in-out infinite; }
@keyframes slide { 0% { transform: translateX(-100%); } 100% { transform: translateX(290%); } }

#results { display: flex; flex-direction: column; gap: var(--s5); }
.res { position: relative; overflow: hidden; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: calc(var(--s5) + 6px) var(--s5) var(--s5); display: flex; flex-direction: column; gap: var(--s5); }
.res::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 6px; background: repeating-linear-gradient(135deg, var(--holly) 0 8px, var(--surface) 8px 16px); }
.res-head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--s3) var(--s4); flex-wrap: wrap; }
.res-head h2 { font-size: 1.7rem; color: var(--brand); }
.tag { font-size: .78rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 700; line-height: 1.4; }
.block { display: flex; flex-direction: column; gap: var(--s3); }
.block-top { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); }
.block-top .lbl { font-size: .82rem; letter-spacing: .06em; text-transform: uppercase; font-weight: 700; color: var(--muted); line-height: 1.4; }
.copy { min-height: 44px; min-width: 84px; padding: 0 var(--s5); border: 1px solid var(--ink); border-radius: 999px; background: var(--bg); color: var(--ink); font-weight: 700; cursor: pointer; }
.copy:hover { background: var(--surface-2); }
.copy.done { border-color: var(--ok); color: var(--ok); }
.text { white-space: pre-wrap; overflow-wrap: anywhere; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: var(--s4) var(--s5); font-size: 1rem; line-height: 1.65; max-width: 70ch; }
.text.mono { font-size: .92rem; max-width: none; max-height: 420px; overflow: auto; }
.count { font-size: .85rem; line-height: 1.4; color: var(--muted); font-variant-numeric: tabular-nums; }
.tags { display: flex; flex-wrap: wrap; gap: var(--s2) var(--s3); }
.tags span { background: var(--surface-2); border-radius: 999px; padding: var(--s2) var(--s4); font-size: .95rem; line-height: 1.4; }
.note { color: var(--muted); font-size: .95rem; line-height: 1.6; border-left: 3px solid var(--holly); padding: var(--s1) 0 var(--s1) var(--s4); }

@media (min-width: 720px) {
  .res-end { align-self: flex-start; }
  main { padding: var(--s7) var(--s5) 96px; gap: var(--s7); }
  .top { gap: var(--s5); }
  .card { padding: var(--s6); gap: var(--s6); }
  .res { padding: calc(var(--s6) + 6px) var(--s6) var(--s6); gap: var(--s6); }
  form { gap: var(--s6); }
  .actions { flex-direction: row; align-items: center; gap: var(--s5); padding-top: var(--s3); }
  .primary { min-width: 320px; }
  .hint { text-align: left; }
}
