:root{
  --bg:#EDEFEA; --surface:#FFFFFF; --ink:#1C2433; --muted:#667085; --line:#D7DBD3;
  --wool:#2F5D50; --wool-ink:#FFFFFF; --tag:#E0A526; --tag-ink:#2A1E00; --danger:#B42318; --good:#2F5D50; --warn:#9A5B00;
  box-sizing:border-box;
  padding-top:env(safe-area-inset-top,0px);
  padding-bottom:env(safe-area-inset-bottom,0px);
}
@media (prefers-color-scheme:dark){
  :root:not([data-theme="light"]){
    --bg:#12161C; --surface:#1C222B; --ink:#E8ECF1; --muted:#98A2B3; --line:#2E3642;
    --wool:#7FB8A4; --wool-ink:#0E1A16; --tag:#E7B54A; --tag-ink:#2A1E00; --danger:#F97066; --good:#7FB8A4; --warn:#E7B54A;
  }
}
:root[data-theme="dark"]{
  --bg:#12161C; --surface:#1C222B; --ink:#E8ECF1; --muted:#98A2B3; --line:#2E3642;
  --wool:#7FB8A4; --wool-ink:#0E1A16; --tag:#E7B54A; --tag-ink:#2A1E00; --danger:#F97066; --good:#7FB8A4; --warn:#E7B54A;
}
*,*::before,*::after{box-sizing:inherit}
html{height:100%;scroll-padding-top:env(safe-area-inset-top,0px)}
body{margin:0;min-height:100%;background:var(--bg);color:var(--ink);
  font-family:system-ui,-apple-system,"Segoe UI",Roboto,sans-serif;
  font-size:16px;line-height:1.45;-webkit-font-smoothing:antialiased}
button,input,select,textarea{font:inherit;color:inherit}
button{cursor:pointer}
:focus-visible{outline:3px solid var(--tag);outline-offset:2px}
img{max-width:100%;display:block}

.wrap{max-width:720px;margin:0 auto;padding:20px 18px 120px}
header.top{display:flex;align-items:flex-end;justify-content:space-between;gap:12px;margin-bottom:18px}
h1{font-size:2.4rem;line-height:1;margin:0;font-weight:800;letter-spacing:-.03em}
.count{color:var(--muted);font-size:.9rem;text-align:right}
h2{font-size:1.35rem;margin:0 0 4px;font-weight:800;letter-spacing:-.02em}
.sub{color:var(--muted);margin:0 0 18px}

.filters{display:flex;gap:8px;overflow-x:auto;margin:0 -18px 14px;padding:0 18px 6px;scrollbar-width:none}
.filters::-webkit-scrollbar{display:none}
.grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(150px,1fr));gap:14px}
.item{position:relative;background:var(--surface);border:1px solid var(--line);border-radius:14px;padding:0;text-align:left;overflow:hidden;display:flex;flex-direction:column}
.item .pic{aspect-ratio:1/1;background:var(--bg);display:grid;place-items:center;overflow:hidden}
.item .pic img{width:100%;height:100%;object-fit:cover}
.swatches{display:flex;width:62%;height:62%;border-radius:50%;overflow:hidden;border:1px solid var(--line)}
.swatches span{flex:1}
.item .meta{padding:10px 12px 12px}
.item .name{font-weight:600;line-height:1.2}
.item .cat{font-size:.82rem;color:var(--muted)}
.hole{position:absolute;top:10px;right:10px;width:12px;height:12px;border-radius:50%;background:var(--bg);border:2px solid var(--line)}
.empty{border:2px dashed var(--line);border-radius:16px;padding:28px 20px;text-align:center;color:var(--muted)}
.empty strong{display:block;color:var(--ink);font-size:1.1rem;margin-bottom:4px}

.chip{border:1.5px solid var(--line);background:var(--surface);border-radius:999px;padding:7px 14px;white-space:nowrap;font-size:.95rem}
.chip[aria-pressed="true"]{background:var(--wool);border-color:var(--wool);color:var(--wool-ink)}
.chips{display:flex;flex-wrap:wrap;gap:8px}
.color-chip{display:inline-flex;align-items:center;gap:7px}
.color-chip i{width:14px;height:14px;border-radius:50%;border:1px solid rgba(0,0,0,.2)}

.seg{display:flex;background:var(--surface);border:1.5px solid var(--line);border-radius:14px;padding:4px;margin-bottom:22px}
.seg button{flex:1;border:0;background:transparent;border-radius:10px;padding:10px 8px;font-weight:600;color:var(--muted);line-height:1.2}
.seg button small{display:block;font-weight:400;font-size:.78rem}
.ai-kvote{margin:-12px 0 20px}
.photo-pick .ai-kvote{margin:8px 0 0}
.kvote-bar{height:6px;border-radius:3px;background:var(--line);overflow:hidden}
.kvote-fyll{height:100%;width:0;border-radius:3px;background:var(--wool)}
.kvote-fyll.nesten{background:#D97706}
.kvote-fyll.full{background:var(--danger)}
.kvote-tekst{margin:4px 0 0;font-size:.8rem;color:var(--muted)}
.ai-kvote.tom .kvote-tekst{color:var(--danger)}
.seg button[aria-pressed="true"]{background:var(--ink);color:var(--bg)}
.seg button[aria-pressed="true"] small{color:inherit;opacity:.8}

fieldset{border:0;padding:0;margin:0 0 20px}
legend{font-weight:600;margin-bottom:8px;padding:0}
label.field{display:block;margin-bottom:18px}
label.field>span{display:block;font-weight:600;margin-bottom:6px}
input[type=text],textarea,select{width:100%;background:var(--surface);border:1.5px solid var(--line);border-radius:12px;padding:11px 13px}
textarea{resize:vertical;min-height:64px}
.check{display:flex;align-items:center;gap:10px;margin:6px 0}
.check input{width:20px;height:20px;accent-color:var(--wool)}

.btn{border:0;border-radius:14px;padding:14px 18px;font-weight:600;font-size:1rem}
.btn.primary{background:var(--wool);color:var(--wool-ink);width:100%}
.btn.ghost{background:transparent;border:1.5px solid var(--line)}
.btn.small{padding:9px 14px;font-size:.92rem;border-radius:12px}
.btn.danger{background:transparent;color:var(--danger);border:1.5px solid var(--line)}
.btn:disabled{opacity:.55;cursor:default}
.btn-row{display:flex;gap:10px;flex-wrap:wrap;margin-top:6px}

nav.tabs{position:fixed;left:0;right:0;bottom:0;background:var(--surface);border-top:1px solid var(--line);
  display:flex;justify-content:center;gap:6px;padding:8px 12px;padding-bottom:calc(8px + env(safe-area-inset-bottom,0px));z-index:20}
nav.tabs button{flex:1;max-width:240px;background:transparent;border:0;border-radius:12px;padding:10px;font-weight:600;color:var(--muted);display:flex;flex-direction:column;align-items:center;gap:2px;font-size:.85rem}
nav.tabs button svg{width:24px;height:24px}
nav.tabs button[aria-current="page"]{color:var(--ink);background:var(--bg)}
.fab{position:fixed;right:max(18px,calc(50% - 342px));bottom:calc(84px + env(safe-area-inset-bottom,0px));z-index:21;
  background:var(--tag);color:var(--tag-ink);border:0;border-radius:18px;padding:14px 18px;font-weight:800;font-size:1rem;box-shadow:0 6px 18px rgba(0,0,0,.18)}

.sheet-bg{position:fixed;inset:0;background:rgba(10,14,20,.45);z-index:40;display:none}
.sheet{position:fixed;left:0;right:0;bottom:0;max-height:92%;overflow-y:auto;background:var(--bg);z-index:41;
  border-radius:22px 22px 0 0;padding:18px 18px calc(24px + env(safe-area-inset-bottom,0px));transform:translateY(100%);transition:transform .22s ease}
.sheet.open{transform:none}
.sheet-inner{max-width:640px;margin:0 auto}
.sheet-head{display:flex;justify-content:space-between;align-items:center;margin-bottom:14px}
.close{background:var(--surface);border:1px solid var(--line);border-radius:50%;width:38px;height:38px;font-size:1.2rem;line-height:1}
.photo-pick{display:flex;gap:14px;align-items:center;margin-bottom:18px}
.photo-pick .prev{flex:0 0 84px;width:84px;height:84px;border-radius:14px;background:var(--surface);border:1.5px dashed var(--line);display:grid;place-items:center;overflow:hidden;color:var(--muted);font-size:.8rem;text-align:center}
.photo-pick .prev img{width:100%;height:100%;object-fit:cover}
.row{display:flex;gap:10px}
.row>*{flex:1}
details.more{background:var(--surface);border:1px solid var(--line);border-radius:14px;padding:12px 14px;margin-bottom:18px}
details.more summary{font-weight:600;cursor:pointer}
details.more[open] summary{margin-bottom:12px}
details.more label.field{margin-bottom:12px}

.outfit{background:var(--surface);border:1px solid var(--line);border-radius:18px;padding:16px;margin-bottom:16px}
.outfit h3{margin:0;font-size:1.15rem;letter-spacing:-.01em}
.outfit .src{font-size:.8rem;color:var(--muted)}
.outfit .pieces{display:flex;gap:10px;overflow-x:auto;padding:12px 0 4px}
.piece{flex:0 0 92px}
.piece .pic{width:92px;height:92px;border-radius:12px;background:var(--bg);display:grid;place-items:center;overflow:hidden;border:1px solid var(--line)}
.piece .pic img{width:100%;height:100%;object-fit:cover}
.piece .pic .swatches{width:60%;height:60%}
.piece small{display:block;font-size:.8rem;line-height:1.2;margin-top:5px}
.why{list-style:none;padding:0;margin:10px 0 0}
.why li{position:relative;padding-left:18px;margin:4px 0;font-size:.95rem}
.why li::before{content:"";position:absolute;left:3px;top:.55em;width:8px;height:8px;border-radius:50%;background:var(--good)}
.why li.warn::before{background:var(--warn);border-radius:2px}
.tip{margin-top:10px;padding:10px 12px;border-radius:12px;background:var(--bg);font-size:.92rem}
.status{color:var(--muted);margin:14px 0}
.note{font-size:.88rem;color:var(--muted);margin-top:10px}
.rules{font-size:.92rem}
.rules p{margin:.5em 0}
.foot{margin-top:34px;padding-top:18px;border-top:1px solid var(--line)}
.linkbtn{background:none;border:0;padding:6px 0;text-decoration:underline;color:var(--muted)}
.hidden{display:none!important}
@media (prefers-reduced-motion:reduce){.sheet{transition:none}}
.mt0{margin-top:0}
.mt28{margin-top:28px}
.ib{display:inline-block}
header.top{flex-wrap:wrap}
.hjem{flex-basis:100%;color:var(--muted);text-decoration:none;font-weight:600;font-size:.95rem;margin-bottom:6px}
