/* TURBOKASSI - tyylit.
   Miami Vice: neonpinkki, syaani ja auringonlasku. Tumma tila on pääasia,
   vaalea on Miamin pastelliversio. Yksi paletti tokeneina, ei käännösvaihetta. */

:root {
  color-scheme: dark;

  /* --- Miami-yö, oletus --- */
  --bg:          #0a0420;
  --bg-2:        #150835;
  --surface:     #17093c;
  --surface-2:   #1e0f4d;
  --surface-sunk:#100630;
  --ink:         #f7ecff;
  --ink-2:       #cbb4f0;
  --muted:       #9b83ca;
  --line:        #33195e;
  --line-strong: #532a92;

  --accent:      #ff2e9a;   /* neonpinkki: teksti, reunat ja hehku */
  --accent-ink:  #ffffff;
  --accent-2:    #22e5f5;   /* syaani, toissijainen */
  --accent-3:    #ffc247;   /* auringonlaskun keltainen */
  --accent-soft: rgba(255, 46, 154, .15);
  --accent-line: rgba(255, 46, 154, .42);
  --cyan-soft:   rgba(34, 229, 245, .13);

  --warn:        #ffb037;
  --warn-soft:   rgba(255, 176, 55, .14);
  --danger:      #ff5470;
  --danger-soft: rgba(255, 84, 112, .15);

  --sunset:      linear-gradient(90deg, #ff2e9a 0%, #ff6b3d 55%, #ffc247 100%);
  /* Auringonlasku on koriste, ei tekstin tausta.
     Sääntö: kirkas neonmagenta on etualan väri (teksti, reunat, hehku) ja
     täyttö on syvä magenta, jolla valkoinen teksti on mukava lukea. Tumma
     teksti kirkkaalla kylläisellä pinkillä täytti 5,7:1 mutta oli silti
     raskas lukea, koska kylläisyys ja pieni versaalikirjain syövät
     luettavuutta suhdeluvun lisäksi. */
  --fill:        linear-gradient(90deg, #c9006b 0%, #a8005c 100%);
  --sunset-v:    linear-gradient(160deg, #ff2e9a 0%, #ff6b3d 60%, #ffc247 100%);
  --neon:        linear-gradient(90deg, #22e5f5, #ff2e9a);

  --glow:        0 0 22px rgba(255, 46, 154, .40);
  --glow-strong: 0 0 34px rgba(255, 46, 154, .55);
  --glow-cyan:   0 0 22px rgba(34, 229, 245, .38);

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .5);
  --shadow-md: 0 2px 8px rgba(0, 0, 0, .5), 0 12px 28px -10px rgba(0, 0, 0, .7);
  --shadow-lg: 0 10px 26px rgba(0, 0, 0, .55), 0 32px 64px -18px rgba(0, 0, 0, .8);

  --r-sm: 10px;
  --r:    14px;
  --r-lg: 20px;
  --r-xl: 28px;

  --sp-1: 4px;  --sp-2: 8px;  --sp-3: 12px; --sp-4: 16px;
  --sp-5: 24px; --sp-6: 32px; --sp-7: 48px;

  --font: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
          "Helvetica Neue", "Inter", system-ui, sans-serif;
  /* Kondensoitu leikkaus antaa 80-luvun julistevaikutelman ilman webfonttia.
     Avenir Next Condensed löytyy iOS:stä ja macOS:stä, muut putoavat takaisin. */
  --font-display: "Avenir Next Condensed", "Helvetica Neue Condensed",
                  "Roboto Condensed", var(--font);

  --tab-h: 62px;
  --ease: cubic-bezier(.22, .61, .36, 1);
  --spring: cubic-bezier(.34, 1.4, .64, 1);
}

/* --- Miami-päivä: pastellit, mutta yhtä rohkeat --- */
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    color-scheme: light;
    --bg:          #fff3fa;
    --bg-2:        #e9fbff;
    --surface:     #ffffff;
    --surface-2:   #fff7fc;
    --surface-sunk:#ffe7f4;
    --ink:         #24063f;
    --ink-2:       #5a3673;
    --muted:       #75508c;
    --line:        #ffd2ea;
    --line-strong: #ff9ecd;

    /* Nämä kolme on tummennettu mitatun kontrastin perusteella: vaalealla
       pohjalla 11 pikselin teksti vaatii 4,5:1, ja alkuperäiset jäivät
       3,4-4,5 väliin. */
    --accent:      #d4007a;
    --accent-ink:  #ffffff;
    --fill:        linear-gradient(90deg, #d4007a 0%, #a30057 100%);
    --accent-2:    #006e78;
    --accent-3:    #a04a00;
    --accent-soft: #fff0f8;
    --accent-line: #ffabd6;
    --cyan-soft:   #d9f7fb;

    --warn:        #8a4d00;
    --warn-soft:   #fff0d9;
    --danger:      #c4173c;
    --danger-soft: #ffe4e9;

    --glow:        0 6px 20px rgba(230, 0, 126, .26);
    --glow-strong: 0 8px 28px rgba(230, 0, 126, .34);
    --glow-cyan:   0 6px 20px rgba(0, 145, 159, .24);

    --shadow-sm: 0 1px 2px rgba(90, 10, 60, .07), 0 1px 3px rgba(90, 10, 60, .05);
    --shadow-md: 0 2px 6px rgba(90, 10, 60, .07), 0 10px 24px -8px rgba(90, 10, 60, .16);
    --shadow-lg: 0 6px 14px rgba(90, 10, 60, .10), 0 28px 56px -14px rgba(90, 10, 60, .26);
  }
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg:          #fff3fa;
  --bg-2:        #e9fbff;
  --surface:     #ffffff;
  --surface-2:   #fff7fc;
  --surface-sunk:#ffe7f4;
  --ink:         #24063f;
  --ink-2:       #5a3673;
  --muted:       #75508c;
  --line:        #ffd2ea;
  --line-strong: #ff9ecd;
  --accent:      #d4007a;
  --accent-ink:  #ffffff;
  --fill:        linear-gradient(90deg, #d4007a 0%, #a30057 100%);
  --accent-2:    #006e78;
  --accent-3:    #a04a00;
  --accent-soft: #fff0f8;
  --accent-line: #ffabd6;
  --cyan-soft:   #d9f7fb;
  --warn:        #8a4d00;
  --warn-soft:   #fff0d9;
  --danger:      #c4173c;
  --danger-soft: #ffe4e9;
  --glow:        0 6px 20px rgba(230, 0, 126, .26);
  --glow-strong: 0 8px 28px rgba(230, 0, 126, .34);
  --glow-cyan:   0 6px 20px rgba(0, 145, 159, .24);
  --shadow-sm: 0 1px 2px rgba(90, 10, 60, .07), 0 1px 3px rgba(90, 10, 60, .05);
  --shadow-md: 0 2px 6px rgba(90, 10, 60, .07), 0 10px 24px -8px rgba(90, 10, 60, .16);
  --shadow-lg: 0 6px 14px rgba(90, 10, 60, .10), 0 28px 56px -14px rgba(90, 10, 60, .26);
}

/* ---------------------------------------------------------------- perusta */

*, *::before, *::after { box-sizing: border-box; }

/* hidden-attribuutin pitää voittaa luokan display-arvo. Selaimen oma
   [hidden] { display: none } häviää mille tahansa luokkasäännölle, ja silloin
   esimerkiksi .overlay { display: grid } jättää koko ruudun peittävän kerroksen
   päälle: näkymä sumenee ja kaikki kosketukset osuvat kerrokseen. */
[hidden] { display: none !important; }

html, body { height: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.45;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: none;
}

/* Taustan auringonlasku. Kiinteä kerros pohjalla, ei nappaa kosketuksia. */
body::before {
  content: '';
  position: fixed; inset: 0; z-index: -2; pointer-events: none;
  background:
    radial-gradient(1000px 620px at 12% -12%, var(--accent-soft) 0%, transparent 62%),
    radial-gradient(820px 520px at 108% 4%, var(--cyan-soft) 0%, transparent 58%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-2) 100%);
}

/* Perspektiiviruudukko alalaitaan. Häivytetään maskilla, ettei se kilpaile
   sisällön kanssa. */
body::after {
  content: '';
  position: fixed; left: 0; right: 0; bottom: 0; height: 44vh;
  z-index: -1; pointer-events: none; opacity: .45;
  background:
    repeating-linear-gradient(180deg, transparent 0 38px, var(--accent-line) 38px 39px),
    repeating-linear-gradient(90deg, transparent 0 54px, rgba(34, 229, 245, .16) 54px 55px);
  mask-image: linear-gradient(180deg, transparent 0%, #000 80%);
  -webkit-mask-image: linear-gradient(180deg, transparent 0%, #000 80%);
}

button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: none; padding: 0; }
a { color: var(--accent); text-decoration: none; }
ul, ol { margin: 0; padding: 0; list-style: none; }
h1, h2, h3, h4, p { margin: 0; }
img { max-width: 100%; display: block; }

:focus-visible {
  outline: 2px solid var(--accent-2);
  outline-offset: 2px;
  border-radius: 6px;
}

.sr {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip-path: inset(50%); white-space: nowrap;
}

.num { font-variant-numeric: tabular-nums; }

/* Auringonlaskun gradientti tekstinä. Vain isoissa otsikoissa, joissa se ei
   syö luettavuutta. */
.neon-text,
.auth__title,
.page-head h2,
.stat__value,
.sidebar__brand {
  background: var(--sunset);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
}

/* ---------------------------------------------------------------- lataus */

.boot {
  min-height: 100vh; display: grid; place-content: center;
  gap: var(--sp-4); justify-items: center; color: var(--muted);
}
.boot__mark {
  width: 48px; height: 48px; border-radius: 15px;
  background: var(--sunset-v);
  box-shadow: var(--glow-strong);
  animation: pulse 1.4s var(--ease) infinite;
}
.boot__text {
  font-size: 11px; font-weight: 800; letter-spacing: .22em;
  text-transform: uppercase; font-family: var(--font-display);
}
@keyframes pulse { 0%,100% { opacity: .4; transform: scale(.92); } 50% { opacity: 1; transform: scale(1); } }

/* ---------------------------------------------------------------- kirjautuminen */

.auth { min-height: 100vh; display: grid; place-items: center; padding: var(--sp-5); }
.auth__card {
  width: 100%; max-width: 390px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-xl); padding: var(--sp-6);
  box-shadow: var(--shadow-lg);
  position: relative; overflow: hidden;
}
/* Neonviiva kortin ylälaidassa */
.auth__card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: var(--sunset);
}
.auth__mark {
  width: 58px; height: 58px; border-radius: 17px; margin-bottom: var(--sp-4);
  background: var(--sunset-v);
  display: grid; place-items: center; font-size: 28px;
  box-shadow: var(--glow-strong);
}
.auth__title {
  font-family: var(--font-display);
  font-size: 42px; font-weight: 800; letter-spacing: .01em;
  text-transform: uppercase; line-height: 1;
}
.auth__sub { color: var(--muted); font-size: 14px; margin-top: 8px; }
.auth__form { margin-top: var(--sp-5); display: grid; gap: var(--sp-3); }
.auth__err {
  background: var(--danger-soft); color: var(--danger);
  border: 1px solid var(--danger); border-radius: var(--r-sm);
  padding: 10px 12px; font-size: 13.5px;
}
/* Selaimen oma virheteksti. Pienin sallittu koko on 11px, alempana se ei ole
   luettavissa puhelimessa. Vaimennus tehdaan fonttikoolla ja lihavuudella,
   ei opacityllä: läpinäkyvyys pudotti tämän kontrastin 3,4:1:een. */
.auth__err-detail {
  margin-top: 6px; font-size: 11px; line-height: 1.35; font-weight: 500;
  word-break: break-word; text-transform: none; letter-spacing: 0;
}
.auth__foot {
  margin-top: var(--sp-4); font-size: 10px; color: var(--muted); text-align: center;
  letter-spacing: .14em; text-transform: uppercase; font-weight: 800;
}
.auth__who { display: flex; gap: 6px; flex-wrap: wrap; margin-top: var(--sp-4); }

/* ---------------------------------------------------------------- kentät */

.field { display: grid; gap: 6px; }
.field > label {
  font-size: 11px; font-weight: 800; color: var(--accent-2);
  letter-spacing: .1em; text-transform: uppercase;
}

.input, .select, .textarea {
  width: 100%; padding: 12px 13px;
  background: var(--surface-2); color: var(--ink);
  border: 1px solid var(--line); border-radius: var(--r-sm);
  transition: border-color .15s, box-shadow .15s;
}
.input:focus, .select:focus, .textarea:focus {
  outline: none; border-color: var(--accent);
  box-shadow: var(--glow);
}
.input::placeholder { color: var(--muted); }
.textarea { min-height: 92px; resize: vertical; line-height: 1.5; }
.select {
  appearance: none; padding-right: 34px;
  background-image: linear-gradient(45deg, transparent 50%, var(--accent) 50%),
                    linear-gradient(135deg, var(--accent) 50%, transparent 50%);
  background-position: calc(100% - 17px) 50%, calc(100% - 12px) 50%;
  background-size: 5px 5px, 5px 5px; background-repeat: no-repeat;
}

/* ---------------------------------------------------------------- napit */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 11px 18px; border-radius: 999px;
  font-family: var(--font-display);
  font-size: 13.5px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase;
  border: 1px solid transparent; white-space: nowrap;
  transition: transform .12s var(--spring), box-shadow .18s, background .15s,
              border-color .15s, opacity .15s, color .15s;
}
.btn:active { transform: scale(.95); }
.btn:disabled { opacity: .45; pointer-events: none; }
.btn svg { width: 18px; height: 18px; flex: 0 0 auto; }
.btn--lg svg { width: 20px; height: 20px; }

.btn--primary {
  background: var(--fill); color: var(--accent-ink);
  box-shadow: var(--glow);
}
.btn--primary:hover { box-shadow: var(--glow-strong); }

.btn--ghost {
  background: transparent; color: var(--ink-2); border-color: var(--line-strong);
}
.btn--ghost:hover { color: var(--ink); border-color: var(--accent); box-shadow: var(--glow); }

.btn--soft { background: var(--surface-sunk); color: var(--ink-2); border-color: var(--line); }
.btn--soft:hover { color: var(--accent); border-color: var(--accent-line); }

.btn--danger { background: var(--danger-soft); color: var(--danger); border-color: var(--danger); }
.btn--plain { padding: 8px; color: var(--muted); }
.btn--plain:hover { color: var(--ink); }
.btn--block { width: 100%; }
.btn--sm { padding: 11px 15px; font-size: 12px; }
.btn--lg { padding: 14px 24px; font-size: 15px; }

.icon-btn {
  width: 42px; height: 42px; border-radius: 50%;
  display: grid; place-items: center; color: var(--ink-2);
  transition: background .15s, color .15s, transform .12s var(--spring), box-shadow .18s;
}
.icon-btn:hover { background: var(--surface-sunk); color: var(--accent); }
.icon-btn:active { transform: scale(.9); }
.icon-btn svg { width: 20px; height: 20px; }

/* ---------------------------------------------------------------- runko */

.shell { min-height: 100vh; display: flex; }
.sidebar { display: none; }

.main {
  flex: 1; min-width: 0; display: flex; flex-direction: column;
  padding-bottom: calc(var(--tab-h) + env(safe-area-inset-bottom));
}

.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: var(--sp-2);
  padding: calc(env(safe-area-inset-top) + 10px) var(--sp-4) 10px;
  background: rgba(10, 4, 32, .72);
  backdrop-filter: saturate(180%) blur(16px);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
  border-bottom: 1px solid transparent;
  transition: border-color .2s;
}
:root[data-theme="light"] .topbar { background: rgba(255, 243, 250, .8); }
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) .topbar { background: rgba(255, 243, 250, .8); }
}
.topbar--scrolled { border-bottom-color: var(--accent-line); }

.topbar__title {
  flex: 1; min-width: 0; display: flex; align-items: center; gap: 9px;
  font-family: var(--font-display);
  font-size: 23px; font-weight: 800; letter-spacing: .03em; text-transform: uppercase;
}
.topbar__title span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Kapealla ruudulla otsikko, kaksi nappia ja kaupan nimi eivät mahdu
   samalle riville 23 pikselin kirjaimin. */
@media (max-width: 480px) {
  .topbar__title { font-size: 19px; gap: 7px; }
}
.topbar__sub {
  font-size: 11px; color: var(--accent-2); font-weight: 800;
  letter-spacing: .08em; font-family: var(--font);
}

.content {
  flex: 1; width: 100%; max-width: 760px; margin: 0 auto;
  /* Alareunaan lisäyspalkin mitattu korkeus, muuten listan loppu jää
     kiinteän palkin alle. --composer-h asetetaan app.js:ssä. */
  padding: var(--sp-2) var(--sp-4) calc(var(--sp-7) + var(--composer-h, 0px));
}

.page-head { margin-bottom: var(--sp-4); }
.page-head h2 {
  font-family: var(--font-display);
  font-size: 34px; font-weight: 800; letter-spacing: .02em; text-transform: uppercase;
  line-height: 1.05;
}
.page-head p { color: var(--muted); font-size: 13.5px; margin-top: 4px; }

.section { margin-bottom: var(--sp-6); }
.section__head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: var(--sp-3); margin-bottom: var(--sp-3);
}
.section__head h3 {
  font-size: 11.5px; font-weight: 800; letter-spacing: .14em;
  text-transform: uppercase; color: var(--accent-2);
}

.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r); box-shadow: var(--shadow-sm);
}
.card--pad { padding: var(--sp-4); }

.empty { text-align: center; padding: var(--sp-6) var(--sp-4); color: var(--muted); }
.empty__emoji { font-size: 40px; line-height: 1; margin-bottom: var(--sp-3); }
.empty h4 {
  font-family: var(--font-display);
  font-size: 21px; color: var(--ink); font-weight: 800; margin-bottom: 6px;
  letter-spacing: .04em; text-transform: uppercase;
}
.empty p { font-size: 13.5px; max-width: 34ch; margin: 0 auto; }

/* ---------------------------------------------------------------- alanavigaatio */

.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  display: grid; grid-auto-flow: column; grid-auto-columns: 1fr;
  padding: 8px 6px calc(6px + env(safe-area-inset-bottom));
  background: rgba(16, 6, 48, .9);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-top: 1px solid var(--line);
}
:root[data-theme="light"] .tabbar { background: rgba(255, 255, 255, .92); }
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) .tabbar { background: rgba(255, 255, 255, .92); }
}
/* Neonviiva palkin ylälaidassa */
.tabbar::before {
  content: ''; position: absolute; top: -1px; left: 0; right: 0; height: 2px;
  background: var(--neon); opacity: .8;
}
.tab {
  display: grid; justify-items: center; gap: 4px; padding: 6px 2px;
  border-radius: var(--r-sm); color: var(--muted);
  font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  transition: color .15s, background .15s;
}
.tab svg { width: 22px; height: 22px; }
.tab[aria-current="page"] {
  color: var(--accent);
  filter: drop-shadow(0 0 8px rgba(255, 46, 154, .55));
}
.tab:active { background: var(--surface-sunk); }
.tab__dot {
  position: absolute; transform: translate(14px, -3px);
  width: 7px; height: 7px; border-radius: 50%; background: var(--accent-3);
  border: 2px solid var(--surface);
}

/* ---------------------------------------------------------------- ostoslista */

.listbar {
  display: flex; gap: 7px; overflow-x: auto; scrollbar-width: none;
  padding: 2px var(--sp-4) 7px;
  margin: 0 calc(var(--sp-4) * -1);
  scroll-snap-type: x proximity;
}
.listbar::-webkit-scrollbar { display: none; }
.listchip {
  display: inline-flex; align-items: center; gap: 6px; flex: 0 0 auto;
  padding: 8px 13px; border-radius: 999px; scroll-snap-align: start;
  background: var(--surface); border: 1px solid var(--line);
  font-family: var(--font-display);
  font-size: 13.5px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase;
  color: var(--ink-2);
  max-width: 11rem;
  transition: background .15s, border-color .15s, color .15s,
              transform .12s var(--spring), box-shadow .18s;
}
.listchip > span:first-child { flex: 0 0 auto; }
/* Nimi katkeaa pisteisiin: "Rautakauppa ja puutarha keväälle" venytti
   sirun 183 pikseliä ruudun yli. */
.listchip__name {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0;
}
.listchip:active { transform: scale(.95); }
.listchip:hover { border-color: var(--accent-line); color: var(--ink); }
.listchip[aria-current="true"] {
  background: var(--fill); border-color: transparent; color: var(--accent-ink);
  box-shadow: var(--glow);
}
.listchip__count {
  font-size: 11px; font-weight: 800; padding: 1px 7px; border-radius: 999px;
  background: var(--surface-sunk); color: var(--accent); font-family: var(--font);
}
/* Tummennus, ei vaalennus: valkoinen teksti tarvitsee tummemman pohjan, ja
   vaalennus jäi vaaleassa teemassa 4,1:1:een. */
.listchip[aria-current="true"] .listchip__count {
  background: rgba(0, 0, 0, .28); color: var(--accent-ink);
}

.progress {
  height: 5px; border-radius: 999px; background: var(--surface-sunk);
  overflow: hidden; margin-bottom: var(--sp-2);
  border: 1px solid var(--line);
}
.progress__bar {
  height: 100%; border-radius: 999px;
  background: var(--sunset);
  box-shadow: var(--glow);
  transition: width .45s var(--ease);
}

/* Listan yhteenvetorivi. Oli inline-tyyleina list.js:ssa 14px alamarginaalilla.
   Omana luokkana se saa tiiviimmat mitat ja arvion oman varinsa. */
.summaryrow {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-bottom: 8px;
}
.summaryrow > p { font-size: 12.5px; color: var(--muted); }
/* Yhteenvetorivin napit ovat toissijaisia: kauppatila ja valikko. Ne saavat
   olla matalampia kuin listan omat kosketuskohteet, koska niita painetaan
   kerran kauppareissulla eika kesken keraamisen. */
.summaryrow .btn--sm { padding: 6px 11px; }
.summaryrow .icon-btn { width: 32px; height: 32px; }

.aisle { margin-bottom: 6px; }
.aisle__head {
  position: sticky; top: calc(env(safe-area-inset-top) + 54px); z-index: 10;
  display: flex; align-items: center; gap: 8px;
  padding: 3px 0 4px;
  background: linear-gradient(var(--bg) 62%, transparent);
  font-size: 11px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase;
  color: var(--accent-2);
}
.aisle__head em { font-style: normal; font-size: 13px; }
.aisle__rule {
  flex: 1; height: 1px;
  background: linear-gradient(90deg, var(--accent-line), transparent);
}

.items {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r); overflow: hidden; box-shadow: var(--shadow-sm);
}

.item {
  position: relative; display: flex; align-items: center; gap: 10px;
  padding: 4px var(--sp-3) 4px 11px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  touch-action: pan-y;
  transition: background .15s, opacity .25s;
}
.item:last-child { border-bottom: none; }
.item:hover { background: var(--surface-2); }
.item--checked .item__name {
  color: var(--muted);
  text-decoration: line-through; text-decoration-color: var(--accent);
  text-decoration-thickness: 2px;
}
/* Ei opacityä: se pudottaa myös harmaan metatekstin kontrastin 2,9:1:een.
   Kuittaus näkyy yliväivauksesta, vaimennetusta nimestä ja täytetystä
   ympyrästä, ja kaikki pysyy luettavana. */
.item--checked .item__thumb { opacity: .55; }
.item--dragging { opacity: .4; }
.item--dropzone { box-shadow: inset 0 2px 0 var(--accent-2); }
.item--swiping { transition: none; }

.check {
  position: relative; flex: 0 0 auto;
  /* Kosketusalue 44px, näkyvä ympyrä 26px. Negatiivinen marginaali pitää
     rivin korkeuden ennallaan. Kaupassa 26px oli liian pieni osua. */
  width: 44px; height: 44px;
  margin: -9px -6px -9px -9px;
  border: none; background: none;
  display: grid; place-items: center;
  transition: transform .15s var(--spring);
}
.check::before {
  content: ''; position: absolute; inset: 9px;
  border-radius: 50%; border: 2px solid var(--line-strong);
  transition: background .18s var(--spring), border-color .18s, box-shadow .2s;
}
.check:hover::before { border-color: var(--accent); }
.check:active { transform: scale(.88); }
.check svg {
  position: relative; z-index: 1;
  width: 15px; height: 15px; opacity: 0; transform: scale(.5);
  transition: opacity .18s, transform .22s var(--spring); color: var(--accent-ink);
}
.item--checked .check::before {
  background: var(--fill); border-color: transparent; box-shadow: var(--glow);
}
.item--checked .check svg { opacity: 1; transform: scale(1); }

.item__thumb {
  flex: 0 0 auto; width: 30px; height: 30px; border-radius: 8px;
  object-fit: contain; background: var(--surface-sunk); padding: 2px;
  border: 1px solid var(--line);
}
/* Sama laatikko myös silloin kun kuva puuttuu ja tilalla on kuvake. */
div.item__thumb { display: grid; place-items: center; font-size: 15px; }
.item__body {
  flex: 1; min-width: 0;
  /* Nimi on oma nappi (avaa muokkauksen), joten sillä pitää olla kunnollinen
     kosketuskorkeus. 44px teki rivistä 68px korkean eikä listalle mahtunut
     tarpeeksi ostoksia. 36px + 12px padding on 48px, ja koska kohde on koko
     rivin levyinen, se on yhä helppo osua. Kerätyksi merkintä, se jota
     kaupassa oikeasti painetaan, pitää omat 44px:nsä. Ostoskeikkatila
     palauttaa tämän 44px:ään. */
  min-height: 34px;
  display: flex; flex-direction: column; justify-content: center;
}
.item__name {
  font-size: 15.5px; font-weight: 600; letter-spacing: -.005em;
  /* Peritty rivikorkeus oli 22,5px yhdelle riville. 1.25 riittää suomen
     ääkkösille ja pudottaa rivin kolme pikseliä. */
  line-height: 1.25;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.item__meta {
  /* Oli flex-wrap: wrap. Määrä, hinta, brändi, muistiinpano ja vastuuhenkilö
     yhdessä rivittyivät kahdelle tai kolmelle riville, jolloin yksi ostos vei
     kolmen verran tilaa. Nyt rivi katkeaa ellipsiin ja koko sisältö näkyy
     riviä napauttamalla. */
  display: flex; align-items: center; gap: 6px; flex-wrap: nowrap;
  overflow: hidden;
  font-size: 11px; line-height: 1.3; color: var(--muted); margin-top: 0;
}
.item__meta > * { flex: 0 0 auto; }
.item__qty {
  font-weight: 800; color: var(--accent-2); font-variant-numeric: tabular-nums;
  /* Reunus kasvatti metarivin 16px:stä 18px:ään. Tausta erottaa merkinnän
     yksin yhtä hyvin. */
  background: var(--cyan-soft); padding: 1px 6px; border-radius: 5px;
}
.item__price { font-variant-numeric: tabular-nums; color: var(--accent-3); font-weight: 800; }
/* Arvio erottuu syotetysta hinnasta: vaimeampi vari ja tilde numeron edessa.
   Vaimennus on omalla varilla eika opacitylla, koska lapinakyvyys pudottaisi
   11px tekstin kontrastin alle AA-rajan. */
.item__price--est { color: var(--muted); font-weight: 700; }
.item__note { font-style: italic; overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap; max-width: 22ch; flex: 0 1 auto; min-width: 0; }
.item__who {
  width: 18px; height: 18px; border-radius: 50%; flex: 0 0 auto;
  display: grid; place-items: center; font-size: 10px; font-weight: 800;
  color: #0b0016; letter-spacing: 0;
}
.item__drag { color: var(--line-strong); cursor: grab; padding: 4px; }
.item__drag:hover { color: var(--accent); }
.item__drag svg { width: 16px; height: 16px; }

.item__swipe {
  position: absolute; inset: 0 0 0 auto; width: 92px;
  display: grid; place-items: center;
  background: var(--danger); color: #fff;
  font-size: 11px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase;
}

.checked-block { margin-top: var(--sp-5); }
.checked-block__head {
  display: flex; align-items: center; gap: var(--sp-2); width: 100%;
  padding: 13px 0; color: var(--muted);
  font-size: 11px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase;
}
.checked-block__head svg { width: 15px; height: 15px; transition: transform .2s var(--ease); }
.checked-block--open .checked-block__head svg { transform: rotate(90deg); }

/* ---------------------------------------------------------------- lisäyspalkki */

.composer {
  position: fixed; left: 0; right: 0;
  bottom: calc(var(--tab-h) + env(safe-area-inset-bottom));
  z-index: 35; padding: 6px var(--sp-3);
  background: rgba(10, 4, 32, .84);
  backdrop-filter: saturate(180%) blur(18px);
  -webkit-backdrop-filter: saturate(180%) blur(18px);
  border-top: 1px solid var(--line);
}
:root[data-theme="light"] .composer { background: rgba(255, 243, 250, .9); }
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) .composer { background: rgba(255, 243, 250, .9); }
}
.composer__inner {
  max-width: 760px; margin: 0 auto;
  display: flex; align-items: center; gap: 7px;
  background: var(--surface); border: 1px solid var(--line-strong);
  border-radius: 999px; padding: 4px 4px 4px 15px;
  box-shadow: var(--shadow-md);
  transition: border-color .15s, box-shadow .15s;
}
.composer__inner:focus-within {
  border-color: var(--accent); box-shadow: var(--shadow-md), var(--glow);
}
.composer__input {
  flex: 1; min-width: 0; border: none; background: none; outline: none;
  padding: 8px 0; font-size: 16px;
}
.composer__add {
  flex: 0 0 auto; width: 40px; height: 40px; border-radius: 50%;
  background: var(--fill); color: var(--accent-ink);
  display: grid; place-items: center;
  box-shadow: var(--glow);
  transition: transform .14s var(--spring), box-shadow .18s;
}
.composer__add:hover { box-shadow: var(--glow-strong); }
.composer__add:active { transform: scale(.9) rotate(90deg); }
.composer__add svg { width: 20px; height: 20px; }

.suggestions {
  max-width: 760px; margin: 0 auto var(--sp-2);
  background: var(--surface); border: 1px solid var(--line-strong);
  border-radius: var(--r); box-shadow: var(--shadow-lg);
  overflow: hidden; max-height: 46vh; overflow-y: auto;
  animation: rise .18s var(--ease);
}
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }
.suggestion {
  display: flex; align-items: center; gap: 11px; width: 100%;
  padding: 11px 13px; text-align: left; border-bottom: 1px solid var(--line);
}
.suggestion:last-child { border-bottom: none; }
.suggestion:hover, .suggestion[data-active="true"] {
  background: var(--accent-soft); box-shadow: inset 3px 0 0 var(--accent);
}
.suggestion__thumb {
  width: 34px; height: 34px; border-radius: 8px; flex: 0 0 auto;
  object-fit: contain; background: var(--surface-sunk); padding: 2px;
}
.suggestion__emoji {
  width: 34px; height: 34px; border-radius: 8px; flex: 0 0 auto;
  display: grid; place-items: center; font-size: 17px; background: var(--surface-sunk);
  border: 1px solid var(--line);
}
.suggestion__body { flex: 1; min-width: 0; }
.suggestion__name { font-size: 14.5px; font-weight: 600;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.suggestion__meta { font-size: 11px; color: var(--muted);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.suggestion__tag {
  flex: 0 0 auto; font-size: 11px; font-weight: 800; letter-spacing: .06em;
  text-transform: uppercase; padding: 4px 9px; border-radius: 999px;
  background: var(--surface-sunk); color: var(--muted);
}
.suggestion__tag--price {
  background: var(--accent-soft); color: var(--accent); border: 1px solid var(--accent-line);
}

.quickrow {
  display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none;
  padding: 0 var(--sp-3) 6px; max-width: 760px; margin: 0 auto;
}
.quickrow::-webkit-scrollbar { display: none; }
.quickchip {
  flex: 0 0 auto; padding: 8px 12px; border-radius: 999px;
  font-size: 12px; font-weight: 700; letter-spacing: .03em;
  background: var(--surface); border: 1px solid var(--line-strong);
  color: var(--ink-2); box-shadow: var(--shadow-sm);
  transition: transform .12s var(--spring), background .15s, color .15s,
              box-shadow .18s, border-color .15s;
}
.quickchip:active { transform: scale(.94); }
.quickchip:hover {
  background: var(--accent-soft); color: var(--accent);
  border-color: var(--accent); box-shadow: var(--glow);
}

/* ---------------------------------------------------------------- listakortit */

.listcards { display: grid; gap: var(--sp-3); }
.listcard {
  display: flex; align-items: center; gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4); text-align: left; width: 100%;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r); box-shadow: var(--shadow-sm);
  transition: transform .14s var(--spring), box-shadow .18s, border-color .15s;
  position: relative; overflow: hidden;
}
.listcard::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: var(--sunset); opacity: 0; transition: opacity .18s;
}
.listcard:hover { box-shadow: var(--shadow-md), var(--glow); border-color: var(--accent-line); }
.listcard:hover::before { opacity: 1; }
.listcard:active { transform: scale(.985); }
.listcard__emoji {
  width: 46px; height: 46px; border-radius: 13px; flex: 0 0 auto;
  display: grid; place-items: center; font-size: 22px;
  background: var(--accent-soft); border: 1px solid var(--accent-line);
}
.listcard__body { flex: 1; min-width: 0; }
.listcard__name {
  font-family: var(--font-display);
  font-size: 20px; font-weight: 800; letter-spacing: .03em; text-transform: uppercase;
}
.listcard__meta { font-size: 12px; color: var(--muted); margin-top: 2px; }
.listcard__ring {
  flex: 0 0 auto; width: 48px; height: 48px; position: relative;
  display: grid; place-items: center;
}
.listcard__ring svg { position: absolute; inset: 0; transform: rotate(-90deg); }
/* Rengas on 48px, joten 11px mahtuu myös kolminumeroiseen "100%". */
.listcard__ring span {
  font-size: 11px; font-weight: 800; color: var(--accent-2);
  font-variant-numeric: tabular-nums; letter-spacing: -.02em;
}

/* ---------------------------------------------------------------- reseptit */

.recipes { display: grid; gap: var(--sp-3); grid-template-columns: 1fr; }
@media (min-width: 560px) { .recipes { grid-template-columns: 1fr 1fr; } }
.recipe {
  display: flex; flex-direction: column; text-align: left;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r); overflow: hidden; box-shadow: var(--shadow-sm);
  transition: transform .14s var(--spring), box-shadow .18s, border-color .15s;
}
.recipe:hover {
  box-shadow: var(--shadow-md), var(--glow); border-color: var(--accent-line);
}
.recipe:active { transform: scale(.985); }
.recipe__top {
  height: 92px; display: grid; place-items: center; font-size: 36px;
  background: var(--sunset-v);
  border-bottom: 1px solid var(--line);
}
.recipe__body { padding: var(--sp-3) var(--sp-4) var(--sp-4); }
.recipe__name {
  font-family: var(--font-display);
  font-size: 19px; font-weight: 800; letter-spacing: .03em; text-transform: uppercase;
}
.recipe__meta { font-size: 12px; color: var(--muted); margin-top: 3px; }

.ingredients { display: grid; gap: 6px; }
.ingredient {
  display: flex; align-items: center; gap: var(--sp-2);
  padding: 9px 12px; border-radius: var(--r-sm);
  background: var(--surface-2); border: 1px solid var(--line); font-size: 14px;
}
.ingredient__qty {
  font-variant-numeric: tabular-nums; color: var(--accent-2);
  font-size: 12px; min-width: 60px; font-weight: 800;
}

/* ---------------------------------------------------------------- viikko */

.week { display: grid; gap: var(--sp-2); }
.day {
  display: flex; align-items: center; gap: var(--sp-3);
  padding: var(--sp-3); border-radius: var(--r); text-align: left; width: 100%;
  background: var(--surface); border: 1px solid var(--line);
  transition: border-color .15s, box-shadow .18s;
}
.day:hover { border-color: var(--accent-line); }
.day svg { width: 18px; height: 18px; flex: 0 0 auto; }
.day--today {
  border-color: var(--accent); background: var(--accent-soft);
  box-shadow: var(--glow);
}
.day__date { flex: 0 0 auto; width: 48px; text-align: center; }
.day__dow {
  font-size: 11px; font-weight: 800; letter-spacing: .1em;
  text-transform: uppercase; color: var(--accent-2);
}
.day__num {
  font-family: var(--font-display);
  font-size: 23px; font-weight: 800; font-variant-numeric: tabular-nums;
}
.day__meal { flex: 1; min-width: 0; }
.day__meal strong { font-size: 14.5px; font-weight: 700; }
.day__meal span { color: var(--muted); font-size: 13.5px; }

/* ---------------------------------------------------------------- kulut */

.stats { display: grid; gap: var(--sp-3); grid-template-columns: repeat(2, 1fr); }
.stat {
  padding: var(--sp-4); background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow-sm);
  position: relative; overflow: hidden;
}
.stat::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: var(--sunset);
}
.stat__label {
  font-size: 11px; font-weight: 800; letter-spacing: .12em;
  text-transform: uppercase; color: var(--accent-2);
}
.stat__value {
  font-family: var(--font-display);
  font-size: 36px; font-weight: 800; letter-spacing: .01em;
  font-variant-numeric: tabular-nums; margin-top: 4px; line-height: 1.05;
}
.stat__hint { font-size: 11.5px; color: var(--muted); margin-top: 2px; }

.bars { display: grid; gap: 10px; }
.bar__row { display: grid; grid-template-columns: 1fr auto; gap: var(--sp-2);
  align-items: baseline; font-size: 13.5px; }
.bar__label { display: flex; align-items: center; gap: 7px; min-width: 0; }
.bar__label span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar__value {
  font-variant-numeric: tabular-nums; font-weight: 800; font-size: 12.5px;
  color: var(--accent-3);
}
.bar__track {
  height: 8px; border-radius: 999px; background: var(--surface-sunk);
  overflow: hidden; margin-top: 5px; border: 1px solid var(--line);
}
.bar__fill {
  height: 100%; border-radius: 999px; background: var(--sunset);
  transition: width .5s var(--ease);
}

.rows { display: grid; }
.row {
  display: flex; align-items: center; gap: var(--sp-3);
  padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 14px;
}
.row:last-child { border-bottom: none; }
.row__body { flex: 1; min-width: 0; }
.row__title { font-weight: 600; overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap; }
.row__sub { font-size: 11.5px; color: var(--muted); }
.row__end {
  font-variant-numeric: tabular-nums; font-weight: 800; color: var(--accent-3);
}

/* ---------------------------------------------------------------- perhe */

.members { display: grid; gap: var(--sp-2); }
.member {
  display: flex; align-items: center; gap: var(--sp-3);
  padding: var(--sp-3); background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--r);
  transition: border-color .15s;
}
.member:hover { border-color: var(--accent-line); }
.avatar {
  width: 42px; height: 42px; border-radius: 50%; flex: 0 0 auto;
  display: grid; place-items: center;
  /* Tumma muste, ei valkoinen: jäsenvärit ovat keskisävyisiä, joten
     valkoisella nimikirjain jäi 2,2:1 kontrastiin. */
  color: #0b0016;
  font-size: 16px; font-weight: 800; position: relative;
}
.avatar--sm { width: 26px; height: 26px; font-size: 11px; }
.avatar__online {
  position: absolute; right: -1px; bottom: -1px;
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--accent-2); border: 2.5px solid var(--surface);
  box-shadow: var(--glow-cyan);
}
.member__body { flex: 1; min-width: 0; }
.member__name {
  font-family: var(--font-display);
  font-weight: 800; font-size: 18px; letter-spacing: .03em; text-transform: uppercase;
}
.member__meta { font-size: 11.5px; color: var(--muted); }

.badge {
  font-size: 11px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase;
  padding: 5px 10px; border-radius: 999px;
  background: var(--surface-sunk); color: var(--muted); border: 1px solid var(--line);
}
.badge--ok {
  background: var(--accent-soft); color: var(--accent); border-color: var(--accent-line);
}
.badge--warn {
  background: var(--warn-soft); color: var(--warn); border-color: var(--warn);
}

.kv { display: grid; gap: var(--sp-3); }
.kv__row { display: flex; align-items: center; justify-content: space-between;
  gap: var(--sp-3); }
.kv__label { font-size: 13.5px; color: var(--ink); font-weight: 700; }
.kv__hint { font-size: 11.5px; color: var(--muted); margin-top: 2px; }

.seg {
  display: inline-flex; padding: 3px; gap: 2px; border-radius: 999px;
  background: var(--surface-sunk); border: 1px solid var(--line);
}
.seg button {
  padding: 12px 16px; border-radius: 999px;
  font-size: 11.5px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase;
  color: var(--muted); transition: background .15s, color .15s, box-shadow .18s;
}
.seg button[aria-pressed="true"] {
  background: var(--fill); color: var(--accent-ink); box-shadow: var(--glow);
}

/* ---------------------------------------------------------------- ostoskeikka */

.shopmode .item { padding: 13px var(--sp-3); gap: var(--sp-3); }
.shopmode .item__body { min-height: 44px; }
.shopmode .item__thumb { width: 38px; height: 38px; }
.shopmode div.item__thumb { font-size: 18px; }
.shopmode .item__meta { font-size: 12px; gap: 7px; }
.shopmode .item__name { font-size: 18.5px; }
.shopmode .check { width: 52px; height: 52px; margin: -10px -4px -10px -10px; }
.shopmode .check::before { inset: 10px; }
.shopmode .check svg { width: 20px; height: 20px; }
.shopmode .item__drag { display: none; }

/* ---------------------------------------------------------------- kerroslaatikot */

.overlay {
  position: fixed; inset: 0; z-index: 60;
  background: rgba(6, 2, 20, .62);
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
  display: grid; align-items: end; justify-items: center;
  animation: fade .18s var(--ease);
}
@keyframes fade { from { opacity: 0; } }

.sheet {
  width: 100%; max-width: 520px;
  background: var(--surface); border: 1px solid var(--line-strong);
  border-bottom: none;
  border-radius: var(--r-xl) var(--r-xl) 0 0;
  padding: var(--sp-3) var(--sp-4) calc(var(--sp-5) + env(safe-area-inset-bottom));
  box-shadow: var(--shadow-lg);
  max-height: 88vh; overflow-y: auto;
  animation: slideup .26s var(--ease);
  position: relative;
}
.sheet::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: var(--sunset);
}
@keyframes slideup { from { transform: translateY(100%); } }
.sheet__grip {
  width: 40px; height: 4px; border-radius: 999px; background: var(--line-strong);
  margin: 4px auto var(--sp-3);
}
.sheet__title {
  font-family: var(--font-display);
  font-size: 25px; font-weight: 800; letter-spacing: .03em; text-transform: uppercase;
  margin-bottom: var(--sp-1);
}
.sheet__sub { font-size: 13px; color: var(--muted); margin-bottom: var(--sp-4); }
.sheet__form { display: grid; gap: var(--sp-3); }
.sheet__actions { display: flex; gap: var(--sp-2); margin-top: var(--sp-4); }
.sheet__actions .btn { flex: 1; }

.menu { display: grid; }
.menu button, .menu a {
  display: flex; align-items: center; gap: var(--sp-3);
  padding: 14px 4px; text-align: left; font-size: 15px; color: var(--ink);
  border-bottom: 1px solid var(--line); font-weight: 600;
  transition: color .15s, padding-left .15s;
}
.menu button:last-child, .menu a:last-child { border-bottom: none; }
.menu button:hover, .menu a:hover { color: var(--accent); padding-left: 8px; }
.menu svg { width: 19px; height: 19px; color: var(--accent-2); flex: 0 0 auto; }
.menu .danger { color: var(--danger); }
.menu .danger svg { color: var(--danger); }
.menu .danger:hover { color: var(--danger); }

@media (min-width: 560px) {
  .overlay { place-items: center; }
  .sheet {
    border-radius: var(--r-lg); border-bottom: 1px solid var(--line-strong);
    padding-bottom: var(--sp-5); animation: pop .22s var(--spring);
  }
  @keyframes pop { from { opacity: 0; transform: scale(.95) translateY(12px); } }
}

/* ---------------------------------------------------------------- ilmoitukset */

.toasts {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: calc(var(--tab-h) + env(safe-area-inset-bottom) + 78px);
  z-index: 80; display: grid; gap: 7px; justify-items: center;
  pointer-events: none; width: max-content; max-width: calc(100vw - 32px);
}
.toast {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 17px; border-radius: 999px; pointer-events: auto;
  background: var(--fill); color: var(--accent-ink);
  font-size: 12.5px; font-weight: 800; letter-spacing: .04em;
  box-shadow: var(--shadow-lg), var(--glow-strong);
  animation: toastin .24s var(--spring);
}
.toast--err {
  background: var(--danger); color: #fff;
  box-shadow: var(--shadow-lg), 0 0 26px rgba(255, 84, 112, .5);
}
.toast button { font-weight: 800; text-decoration: underline; color: inherit; }
@keyframes toastin { from { opacity: 0; transform: translateY(14px) scale(.94); } }

/* ---------------------------------------------------------------- viivakoodi */

.scanner {
  position: relative; border-radius: var(--r); overflow: hidden;
  background: #000; aspect-ratio: 4 / 3; border: 1px solid var(--accent-line);
}
.scanner video { width: 100%; height: 100%; object-fit: cover; }
.scanner__frame {
  position: absolute; inset: 18% 12%; border-radius: 12px;
  box-shadow: 0 0 0 9999px rgba(6, 2, 20, .55), var(--glow-strong);
  border: 2px solid var(--accent);
}
.scanner__hint {
  position: absolute; left: 0; right: 0; bottom: 12px; text-align: center;
  color: #fff; font-size: 12px; font-weight: 800; letter-spacing: .08em;
  text-transform: uppercase; text-shadow: 0 1px 4px rgba(0, 0, 0, .9);
}

/* ---------------------------------------------------------------- työpöytä */

@media (min-width: 900px) {
  .sidebar {
    display: flex; flex-direction: column; gap: var(--sp-4);
    width: 268px; flex: 0 0 auto; padding: var(--sp-5) var(--sp-4);
    border-right: 1px solid var(--line);
    background: rgba(23, 9, 60, .5);
    position: sticky; top: 0; height: 100vh; overflow-y: auto;
  }
  :root[data-theme="light"] .sidebar { background: rgba(255, 255, 255, .55); }
  @media (prefers-color-scheme: light) {
    :root:not([data-theme="dark"]) .sidebar { background: rgba(255, 255, 255, .55); }
  }
  .sidebar__brand {
    display: flex; align-items: center; gap: 11px;
    font-family: var(--font-display);
    font-size: 26px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase;
  }
  /* Kuvake ei peri gradienttitekstin läpinäkyvää täyttöä. */
  .sidebar__mark {
    width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center;
    background: var(--sunset-v); font-size: 18px; flex: 0 0 auto;
    box-shadow: var(--glow);
    -webkit-text-fill-color: initial;
  }
  .sidebar__nav { display: grid; gap: 2px; }
  .sidenav {
    display: flex; align-items: center; gap: 11px; padding: 10px 12px;
    border-radius: var(--r-sm);
    font-size: 12px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase;
    color: var(--ink-2); transition: background .15s, color .15s, box-shadow .18s;
  }
  .sidenav svg { width: 19px; height: 19px; }
  .sidenav:hover { background: var(--surface-sunk); color: var(--ink); }
  .sidenav[aria-current="page"] {
    background: var(--accent-soft); color: var(--accent);
    box-shadow: inset 3px 0 0 var(--accent);
  }
  .sidebar__foot { margin-top: auto; }

  .tabbar { display: none; }
  .main { padding-bottom: 0; }
  .composer { left: 268px; bottom: 0; }
  .content { padding-bottom: calc(var(--sp-6) + var(--composer-h, 0px)); }
  .toasts { bottom: 104px; }
  .aisle__head { top: 56px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important; animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}
