:root {
  --bg: #F4F3EF;
  --surface: #FFFFFF;
  --card: #ECEBE6;
  --card-2: #E4E2DB;
  --ink: #1E1E1B;
  --muted: #74726B;
  --line: #DAD8D0;
  --accent: #2F4A36;
  --accent-ink: #F4F3EF;
  --accent-soft: #DCE5DB;
  --warn: #9A5B1E;
  --bad: #A23B2C;
  --radius: 18px;
  --nav-h: 66px;
  --serif: 'Instrument Serif', Georgia, serif;
  --sans: 'Instrument Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.45 var(--sans); -webkit-font-smoothing: antialiased; }
body { min-height: 100dvh; overscroll-behavior-y: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
img { display: block; max-width: 100%; }
[hidden] { display: none !important; }

.page { max-width: 760px; margin: 0 auto; padding: calc(env(safe-area-inset-top) + 14px) 16px calc(var(--nav-h) + env(safe-area-inset-bottom) + 96px); }
.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.who { display: inline-flex; align-items: center; gap: 8px; border: 0; background: var(--surface); padding: 6px 12px 6px 6px; border-radius: 999px; box-shadow: 0 1px 0 var(--line); font-weight: 600; }
.who .av { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font-size: 18px; background: var(--card); }
.who .chev { color: var(--muted); font-size: 12px; }
h1 { font: 400 34px/1.05 var(--serif); margin: 4px 0 2px; letter-spacing: -0.01em; }
h1 em { font-style: italic; }
h2 { font: 600 13px/1.2 var(--sans); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 26px 0 10px; }
.sub { color: var(--muted); margin: 0 0 14px; }

/* Navigatie */
nav.tabs { position: fixed; z-index: 20; left: 0; right: 0; bottom: 0; background: rgba(244, 243, 239, .92); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
nav.tabs .in { max-width: 760px; margin: 0 auto; display: grid; grid-template-columns: repeat(4, 1fr); height: var(--nav-h); }
nav.tabs a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; text-decoration: none; color: var(--muted); font-size: 11.5px; font-weight: 600; }
nav.tabs a svg { width: 23px; height: 23px; }
nav.tabs a[aria-current] { color: var(--accent); }

/* Knoppen */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 0 20px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); font-weight: 600; text-decoration: none; transition: transform .12s ease, background .2s; }
.btn:active { transform: scale(.97); }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn.ghost { background: transparent; }
.btn.danger { color: var(--bad); }
.btn.small { min-height: 36px; padding: 0 14px; font-size: 14px; }
.btn.block { width: 100%; }
.btn[disabled] { opacity: .5; pointer-events: none; }
.round { width: 52px; height: 52px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); display: grid; place-items: center; font-size: 22px; transition: transform .12s ease, background .2s; }
.round:active { transform: scale(.92); }
.round[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.round.bad[aria-pressed="true"] { background: var(--bad); border-color: var(--bad); }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.center { justify-content: center; }
.grow { flex: 1; }

/* Chips */
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 16px 6px; margin: 0 -16px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 8px 14px; font-size: 14px; font-weight: 600; white-space: nowrap; }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.chip .n { color: var(--muted); font-weight: 500; margin-left: 4px; }
.chip[aria-pressed="true"] .n { color: #BDBBB3; }
.chips.wrap { flex-wrap: wrap; overflow: visible; padding: 0; margin: 0; }

/* Segment */
.seg { display: inline-grid; grid-auto-flow: column; background: var(--card); border-radius: 999px; padding: 4px; gap: 2px; }
.seg button { border: 0; background: transparent; padding: 8px 18px; border-radius: 999px; font-weight: 600; color: var(--muted); }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.08); }

/* Weer */
.weather { display: flex; align-items: center; gap: 14px; background: var(--surface); border-radius: var(--radius); padding: 12px 16px; margin: 14px 0; box-shadow: 0 1px 0 var(--line); }
.weather .ic { font-size: 30px; }
.weather b { font-size: 18px; }
.weather .meta { color: var(--muted); font-size: 14px; }

/* Outfitbord (flat-lay) */
.board { position: relative; aspect-ratio: 4 / 5; background: linear-gradient(180deg, #EFEEEA, #E6E5E0); border-radius: 26px; overflow: hidden; }
.board .slot { position: absolute; display: flex; align-items: center; justify-content: center; border: 0; padding: 0; background: none; }
.board .slot img { max-width: 100%; max-height: 100%; object-fit: contain; filter: drop-shadow(0 6px 10px rgba(40, 36, 30, .16)); transition: transform .25s ease; }
.board .slot.photo img { border-radius: 12px; filter: none; box-shadow: 0 4px 14px rgba(40,36,30,.12); }
.board .slot:active img { transform: scale(.96); }
.board .float { position: absolute; right: 12px; bottom: 12px; display: flex; gap: 8px; z-index: 3; }
.board .float .round { width: 44px; height: 44px; font-size: 18px; background: rgba(255,255,255,.85); }
.board .badge { position: absolute; left: 14px; top: 14px; background: var(--accent); color: var(--accent-ink); font-size: 13px; font-weight: 600; padding: 6px 12px; border-radius: 999px; }
.board.empty { display: grid; place-items: center; text-align: center; padding: 30px; }
.board.loading::after { content: ''; position: absolute; inset: 0; background: linear-gradient(100deg, transparent 30%, rgba(255,255,255,.55) 50%, transparent 70%); background-size: 220% 100%; animation: shimmer 1.3s infinite linear; }
@keyframes shimmer { from { background-position: 120% 0; } to { background-position: -120% 0; } }
.board .msg { position: absolute; inset: auto 0 22px; text-align: center; color: var(--muted); font-weight: 600; z-index: 2; }
.look-title { font: 400 28px/1.1 var(--serif); margin: 18px 0 4px; }
.why { color: #45433E; margin: 0 0 16px; }
.actions { display: grid; grid-template-columns: auto auto 1fr; gap: 10px; align-items: center; margin-top: 8px; }
.actions .main { display: flex; gap: 10px; justify-content: flex-end; }
.actions2 { display: flex; gap: 10px; margin-top: 12px; flex-wrap: wrap; }

/* Garderobe */
.search { width: 100%; border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 11px 16px; margin-bottom: 12px; outline: none; }
.search:focus, .field:focus { border-color: var(--ink); }
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 8px; }
@media (min-width: 560px) { .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.card { position: relative; min-width: 0; border: 0; padding: 0; background: none; text-align: left; }
.card .ph { aspect-ratio: 1; background: var(--card); border-radius: var(--radius); display: grid; place-items: center; overflow: hidden; padding: 12%; }
.card .ph img { width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 4px 8px rgba(40,36,30,.12)); }
.card .ph.photo { padding: 6%; }
.card .ph.photo img { border-radius: 10px; filter: none; }
.card .nm { font-size: 13.5px; font-weight: 600; margin: 7px 2px 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card .tg { font-size: 12px; color: var(--muted); margin: 0 2px; }
.card .flag { position: absolute; top: 8px; right: 8px; background: rgba(255,255,255,.9); border-radius: 999px; padding: 3px 8px; font-size: 12px; font-weight: 600; }
.card.busy .ph::after { content: ''; width: 28px; height: 28px; border: 3px solid var(--card-2); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; position: absolute; }
.card.busy .ph { position: relative; }
.card.busy .ph img { opacity: .35; }
@keyframes spin { to { transform: rotate(360deg); } }
.card.err .ph { outline: 2px solid #E9C9C2; }
.fab { position: fixed; z-index: 15; left: 50%; transform: translateX(-50%); bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) + 14px); width: min(420px, calc(100% - 32px)); box-shadow: 0 8px 24px rgba(47, 74, 54, .28); }
.fab:active { transform: translateX(-50%) scale(.98); }
.empty-state { text-align: center; color: var(--muted); padding: 50px 20px; }
.empty-state .big { font-size: 46px; margin-bottom: 8px; }
.banner { background: #FFF5E3; border: 1px solid #EED8B0; color: #6B4A12; border-radius: 14px; padding: 10px 14px; font-size: 14px; margin-bottom: 12px; }

/* Formulier */
.field { width: 100%; border: 1px solid var(--line); background: var(--surface); border-radius: 12px; padding: 11px 14px; outline: none; }
textarea.field { min-height: 76px; resize: vertical; }
label.lbl { display: block; font-size: 13px; font-weight: 600; color: var(--muted); margin: 14px 0 6px; }
.panel { background: var(--surface); border-radius: var(--radius); padding: 4px 16px; box-shadow: 0 1px 0 var(--line); }
.line { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 0; border-bottom: 1px solid #EEEDE8; }
.line:last-child { border-bottom: 0; }
.line .t { font-weight: 600; }
.line .d { font-size: 13px; color: var(--muted); }
.switch { position: relative; width: 50px; height: 30px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch span { position: absolute; inset: 0; background: var(--card-2); border-radius: 999px; transition: .2s; }
.switch span::after { content: ''; position: absolute; left: 3px; top: 3px; width: 24px; height: 24px; background: #fff; border-radius: 50%; box-shadow: 0 1px 3px rgba(0,0,0,.2); transition: .2s; }
.switch input:checked + span { background: var(--accent); }
.switch input:checked + span::after { transform: translateX(20px); }
.switch input:focus-visible + span { outline: 2px solid var(--ink); outline-offset: 2px; }
.dots { display: flex; gap: 6px; }
.dots button { width: 38px; height: 34px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); font-weight: 600; font-size: 14px; }
.dots button[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.scale-hint { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); margin-top: 4px; max-width: 222px; }

/* Stuk-detail */
.hero { background: var(--card); border-radius: 26px; aspect-ratio: 1; display: grid; place-items: center; padding: 10%; margin-bottom: 14px; }
.hero img { max-height: 100%; object-fit: contain; filter: drop-shadow(0 8px 14px rgba(40,36,30,.16)); }
.hero.photo { padding: 6%; }
.hero.photo img { border-radius: 14px; filter: none; }
.stat { color: var(--muted); font-size: 14px; }
.back { border: 0; background: var(--surface); width: 40px; height: 40px; border-radius: 50%; font-size: 18px; box-shadow: 0 1px 0 var(--line); }

/* Looks */
.looks { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.looks a { text-decoration: none; }
.looks .board { border-radius: 18px; }
.looks .board .slot img { filter: drop-shadow(0 3px 5px rgba(40, 36, 30, .14)); }
.looks .cap { font-weight: 600; font-size: 14px; margin: 6px 2px 0; }
.looks .cap span { display: block; color: var(--muted); font-weight: 500; font-size: 12px; }

/* Profielkiezer en login */
.center-screen { min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px; }
.picker { width: min(460px, 100%); text-align: center; }
.picker h1 { font-size: 44px; margin-bottom: 6px; }
.people { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 14px; margin: 26px 0; }
.person { border: 0; background: var(--surface); border-radius: 22px; padding: 18px 10px 14px; box-shadow: 0 1px 0 var(--line); font-weight: 600; }
.person .av { width: 66px; height: 66px; margin: 0 auto 10px; border-radius: 50%; background: var(--card); display: grid; place-items: center; font-size: 34px; }
.person.add { background: transparent; border: 1.5px dashed var(--line); box-shadow: none; color: var(--muted); }
.logo { width: 64px; height: 64px; margin: 0 auto 12px; }

/* Sheet */
.sheet-bg { position: fixed; inset: 0; z-index: 40; background: rgba(30, 30, 27, .35); animation: fade .2s ease; }
.sheet { position: fixed; z-index: 41; left: 0; right: 0; bottom: 0; max-height: 86dvh; overflow: auto; background: var(--bg); border-radius: 26px 26px 0 0; padding: 10px 16px calc(env(safe-area-inset-bottom) + 20px); animation: up .25s cubic-bezier(.2, .8, .2, 1); max-width: 760px; margin: 0 auto; }
.sheet .grab { width: 40px; height: 5px; border-radius: 9px; background: var(--card-2); margin: 0 auto 12px; }
.sheet h3 { font: 400 26px/1.1 var(--serif); margin: 4px 0 14px; }
.option { display: flex; align-items: center; gap: 14px; width: 100%; border: 0; background: var(--surface); border-radius: 16px; padding: 14px; margin-bottom: 10px; text-align: left; box-shadow: 0 1px 0 var(--line); }
.option .ic { width: 44px; height: 44px; border-radius: 12px; background: var(--accent-soft); display: grid; place-items: center; font-size: 22px; flex: none; }
.option b { display: block; }
.option span { font-size: 13px; color: var(--muted); }
.swap-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.swap-grid .card .ph { padding: 14%; }
.swap-grid .card.cur .ph { outline: 2.5px solid var(--accent); }
@keyframes up { from { transform: translateY(40px); opacity: 0; } }
@keyframes fade { from { opacity: 0; } }

#toast { position: fixed; z-index: 60; left: 50%; bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) + 76px); transform: translateX(-50%) translateY(20px); background: var(--ink); color: var(--bg); padding: 10px 18px; border-radius: 999px; font-size: 14px; font-weight: 600; opacity: 0; pointer-events: none; transition: .25s; max-width: calc(100% - 32px); text-align: center; }
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.link-box { background: var(--surface); border-radius: 14px; padding: 14px; margin-top: 10px; }
.code { font: 600 22px/1 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .12em; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* Slepen en plakken */
body.dropping::after { content: 'Laat los om toe te voegen'; position: fixed; inset: 12px; z-index: 70; display: grid; place-items: center; border: 3px dashed var(--accent); border-radius: 26px; background: rgba(244, 243, 239, .9); font: 400 30px/1.1 var(--serif); color: var(--accent); pointer-events: none; }
@media (hover: none) { .desk-only { display: none; } }
