/* Home — the front door of the house apps (Shopping, Nyochi, ...), in their "shelf edge & till receipt" family.
   Day: warm receipt paper, ink-blue type, shelf-tag yellow for promotions and actions, green for savings.
   Night: an after-hours aisle (green-charcoal) where the yellow tags glow. */

@font-face { font-family: "Bricolage"; src: url("fonts/BricolageGrotesque-latin.ada540c0e24a.woff2") format("woff2"); font-weight: 200 800; font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Bricolage"; src: url("fonts/BricolageGrotesque-latin-ext.b1ae2c312cfb.woff2") format("woff2"); font-weight: 200 800; font-display: swap; unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Figtree"; src: url("fonts/Figtree-latin.202cfb54d4e6.woff2") format("woff2"); font-weight: 300 900; font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Figtree"; src: url("fonts/Figtree-latin-ext.eca8d8b337ff.woff2") format("woff2"); font-weight: 300 900; font-display: swap; unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "JetBrains Mono"; src: url("fonts/JetBrainsMono-latin.b058178d7f30.woff2") format("woff2"); font-weight: 100 800; font-display: swap; }

:root {
  color-scheme: light;
  --bg: #efe9dd;            /* the counter */
  --paper: #fbf8f1;         /* receipts, panels */
  --paper-2: #f4efe4;       /* inset fields, table stripes */
  --paper-3: #e9e1d1;
  --ink: #1c2436;           /* ink blue-black */
  --ink-2: #3b4458;
  --muted: #747a86;
  --faint: #a5a59f;
  --line: #ddd3c0;
  --line-2: #cbbfa8;
  --tag: #f6c427;           /* shelf-edge promotion yellow */
  --tag-2: #ffe27a;
  --tag-ink: #2b2104;
  --tag-wash: #fbefc2;      /* unseen rows */
  --save: #1e8a4f;
  --save-wash: #dcefe2;
  --loss: #c0412b;
  --loss-wash: #f6dcd5;
  --accent: #f6c427;        /* shelf-tag yellow for primary actions */
  --accent-2: #ffd84f;
  --accent-ink: #2b2104;
  --accent-text: #8a6400;   /* the accent as text or a thin line, readable on paper */
  --focus: #c08f00;
  --shadow: 0 1px 0 rgba(255,255,255,.6) inset, 0 1px 2px rgba(60,45,20,.08), 0 6px 18px -8px rgba(60,45,20,.22);
  --shadow-lg: 0 24px 60px -20px rgba(40,30,10,.38), 0 2px 6px rgba(40,30,10,.10);
  --glow: none;
  --radius: 14px;
  --radius-s: 9px;
  --font: "Figtree", ui-sans-serif, system-ui, sans-serif;
  --display: "Bricolage", "Figtree", ui-sans-serif, system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
  --rail: 232px;
  --app-h: 100dvh;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0e1517; --paper: #152023; --paper-2: #1a272b; --paper-3: #213236;
    --ink: #e7eee8; --ink-2: #c3d0ca; --muted: #8fa29c; --faint: #5f716c;
    --line: #253539; --line-2: #33474b;
    --tag: #ffd23f; --tag-2: #ffe27a; --tag-ink: #241b00; --tag-wash: #2b2a17;
    --save: #4bd18b; --save-wash: #153325; --loss: #ff7c64; --loss-wash: #3a1f1a;
    --accent: #ffd23f; --accent-2: #ffe27a; --accent-ink: #1c1600; --accent-text: #ffd23f; --focus: #ffd23f;
    --shadow: 0 1px 0 rgba(255,255,255,.03) inset, 0 8px 22px -12px rgba(0,0,0,.7);
    --shadow-lg: 0 30px 70px -20px rgba(0,0,0,.8), 0 2px 8px rgba(0,0,0,.5);
    --glow: 0 0 0 1px rgba(255,210,63,.25), 0 0 18px -2px rgba(255,210,63,.35);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0e1517; --paper: #152023; --paper-2: #1a272b; --paper-3: #213236;
  --ink: #e7eee8; --ink-2: #c3d0ca; --muted: #8fa29c; --faint: #5f716c;
  --line: #253539; --line-2: #33474b;
  --tag: #ffd23f; --tag-2: #ffe27a; --tag-ink: #241b00; --tag-wash: #2b2a17;
  --save: #4bd18b; --save-wash: #153325; --loss: #ff7c64; --loss-wash: #3a1f1a;
  --accent: #ffd23f; --accent-2: #ffe27a; --accent-ink: #1c1600; --accent-text: #ffd23f; --focus: #ffd23f;
  --shadow: 0 1px 0 rgba(255,255,255,.03) inset, 0 8px 22px -12px rgba(0,0,0,.7);
  --shadow-lg: 0 30px 70px -20px rgba(0,0,0,.8), 0 2px 8px rgba(0,0,0,.5);
  --glow: 0 0 0 1px rgba(255,210,63,.25), 0 0 18px -2px rgba(255,210,63,.35);
}

/* ------------------------------------------------------------------ base */
*, *::before, *::after { box-sizing: border-box; }
html { font-size: clamp(14px, 0.55vw + 8.4px, 16px); -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink); font: 400 1rem/1.45 var(--font);
  font-feature-settings: "tnum" 1; -webkit-font-smoothing: antialiased;
}
/* the counter top: a faint fibre texture, pure CSS */
body::before {
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 0; opacity: .5;
  background:
    radial-gradient(1200px 600px at 85% -10%, color-mix(in srgb, var(--tag) 10%, transparent), transparent 60%),
    repeating-linear-gradient(115deg, transparent 0 7px, color-mix(in srgb, var(--ink) 1.6%, transparent) 7px 8px);
}
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3 { font-family: var(--display); font-weight: 700; letter-spacing: -0.015em; margin: 0; line-height: 1.1; }
.ic { width: 1.25em; height: 1.25em; fill: currentColor; flex: none; vertical-align: -0.25em; }
.mono { font-family: var(--mono); font-size: .86em; letter-spacing: -0.01em; }
.muted { color: var(--muted); }
.hidden { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
::selection { background: var(--tag); color: var(--tag-ink); }

/* theme-specific bits */
.when-dark { display: none; }
:root[data-theme="dark"] .when-dark { display: inline-flex; }
:root[data-theme="dark"] .when-light { display: none; }

/* ------------------------------------------------------------------ buttons & fields */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .45em; height: 2.4rem; padding: 0 1rem;
  border-radius: 999px; border: 1px solid var(--line-2); background: var(--paper); color: var(--ink);
  font-weight: 650; font-size: .93rem; cursor: pointer; white-space: nowrap; text-decoration: none;
  transition: transform .12s, background .15s, border-color .15s, box-shadow .15s;
}
.btn:hover { border-color: var(--ink-2); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.btn-primary { background: var(--accent); border-color: color-mix(in srgb, var(--accent) 70%, var(--ink)); color: var(--accent-ink); box-shadow: var(--glow); }
.btn-primary:hover { background: var(--accent-2); border-color: var(--accent-2); }
.btn-tag { background: var(--tag); border-color: color-mix(in srgb, var(--tag) 70%, var(--ink)); color: var(--tag-ink); }
.btn-tag:hover { background: var(--tag-2); }
.btn-danger { color: var(--loss); border-color: color-mix(in srgb, var(--loss) 45%, var(--line-2)); }
.btn-danger.solid { background: var(--loss); color: #fff; border-color: var(--loss); }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-ghost:hover { background: var(--paper-2); border-color: transparent; }
.btn-icon { width: 2.4rem; padding: 0; }
.btn-sm { height: 2rem; padding: 0 .75rem; font-size: .85rem; }
.btn-sm.btn-icon { width: 2rem; }

.input, .select, .textarea {
  width: 100%; height: 2.5rem; padding: 0 .8rem; border-radius: var(--radius-s); border: 1px solid var(--line-2);
  background: var(--paper); color: var(--ink); transition: border-color .15s, box-shadow .15s;
}
.textarea { height: auto; min-height: 5rem; padding: .6rem .8rem; resize: vertical; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--focus); box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 22%, transparent); }
.select option, .select optgroup { background-color: var(--paper); color: var(--ink); }
.select { appearance: none; padding-right: 2rem; cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 15px) 1.05rem, calc(100% - 10px) 1.05rem; background-size: 5px 5px; background-repeat: no-repeat; }
.field { display: grid; gap: .35rem; }
.label { font-size: .78rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.help { font-size: .82rem; color: var(--muted); }
.search { position: relative; }
.search .ic { position: absolute; left: .75rem; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.search .input { padding-left: 2.4rem; }
kbd { font: 600 .72rem var(--mono); padding: .05rem .35rem; border-radius: 5px; border: 1px solid var(--line-2); border-bottom-width: 2px; background: var(--paper); color: var(--muted); }

/* switch */
.switch { display: flex; align-items: center; gap: .7rem; cursor: pointer; user-select: none; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch .track { width: 2.3rem; height: 1.35rem; border-radius: 999px; background: var(--paper-3); border: 1px solid var(--line-2); position: relative; flex: none; transition: background .18s; }
.switch .track::after { content: ""; position: absolute; top: 2px; left: 2px; width: calc(1.35rem - 6px); height: calc(1.35rem - 6px); border-radius: 50%; background: var(--paper); box-shadow: 0 1px 2px rgba(0,0,0,.25); transition: transform .18s; }
.switch input:checked + .track { background: var(--accent); border-color: color-mix(in srgb, var(--accent) 70%, var(--ink)); }
.switch input:checked + .track::after { transform: translateX(.95rem); }
.switch input:focus-visible + .track { outline: 2px solid var(--focus); outline-offset: 2px; }
.switch .txt { display: grid; line-height: 1.25; }
.switch .txt small { color: var(--muted); font-size: .8rem; }

/* segmented control */
.seg { display: inline-flex; padding: 3px; gap: 2px; border-radius: 999px; background: var(--paper-2); border: 1px solid var(--line); }
.seg button, .seg a { border: 0; background: transparent; height: 2rem; padding: 0 .85rem; border-radius: 999px; font-weight: 650; font-size: .86rem; color: var(--muted); cursor: pointer; display: inline-flex; align-items: center; gap: .35rem; text-decoration: none; white-space: nowrap; }
.seg [aria-pressed="true"], .seg .on { background: var(--paper); color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.12); }

/* chips */
.chip { display: inline-flex; align-items: center; gap: .3rem; height: 1.55rem; padding: 0 .55rem; border-radius: 999px; font-size: .76rem; font-weight: 700; border: 1px solid var(--line-2); color: var(--ink-2); background: var(--paper); white-space: nowrap; }
.chip.good { color: var(--save); border-color: color-mix(in srgb, var(--save) 40%, transparent); background: var(--save-wash); }
.chip.bad { color: var(--loss); border-color: color-mix(in srgb, var(--loss) 40%, transparent); background: var(--loss-wash); }
.chip.warn { color: var(--tag-ink); border-color: color-mix(in srgb, var(--tag) 70%, transparent); background: var(--tag-wash); }
:root[data-theme="dark"] .chip.warn { color: var(--tag); }
.dot { width: .5rem; height: .5rem; border-radius: 50%; background: currentColor; display: inline-block; }

/* the price tag: notched left end with a punched hole */
.tag {
  --h: 1.65rem; position: relative; display: inline-flex; align-items: center; height: var(--h);
  padding: 0 .6rem 0 calc(var(--h) * .62); font-weight: 750; font-size: .8rem; letter-spacing: .005em;
  color: var(--tag-ink); background: var(--tag); white-space: nowrap; border-radius: 0 5px 5px 0;
  clip-path: polygon(calc(var(--h) * .38) 0, 100% 0, 100% 100%, calc(var(--h) * .38) 100%, 0 50%);
  box-shadow: var(--glow); max-width: 100%; overflow: hidden; text-overflow: ellipsis;
}
.tag::before { content: ""; position: absolute; left: calc(var(--h) * .28); top: 50%; width: .3rem; height: .3rem; margin-top: -.15rem; border-radius: 50%; background: var(--paper); box-shadow: inset 0 1px 1px rgba(0,0,0,.25); }
.tag.lg { --h: 2.2rem; font-size: .98rem; padding-right: .85rem; }
.tag.soft { background: var(--tag-wash); color: var(--ink-2); }
:root[data-theme="dark"] .tag.soft { color: var(--tag-2); }
.tag.past { background: var(--paper-3); color: var(--muted); box-shadow: none; }
.tags { display: flex; flex-wrap: wrap; gap: .3rem; min-width: 0; }

/* torn receipt edge (bottom), pure mask */
.receipt {
  --zz: 9px; position: relative; background: var(--paper); padding-bottom: calc(var(--zz) + .5rem);
  -webkit-mask: linear-gradient(#000 0 0) top / 100% calc(100% - var(--zz)) no-repeat,
                conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) bottom / calc(var(--zz) * 2) var(--zz) repeat-x;
          mask: linear-gradient(#000 0 0) top / 100% calc(100% - var(--zz)) no-repeat,
                conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) bottom / calc(var(--zz) * 2) var(--zz) repeat-x;
  filter: drop-shadow(0 6px 10px rgba(50,35,10,.12));
}
.dashed { border-top: 1.5px dashed var(--line-2); }

/* ------------------------------------------------------------------ app shell */
body.app { height: var(--app-h); overflow: hidden; }
.shell { position: relative; z-index: 1; display: grid; grid-template-columns: var(--rail) minmax(0, 1fr); height: var(--app-h); }
.rail { display: flex; flex-direction: column; gap: .3rem; padding: 1.1rem .8rem .9rem; border-right: 1px solid var(--line); background: color-mix(in srgb, var(--paper) 55%, transparent); backdrop-filter: blur(8px); min-height: 0; }
.brand { display: flex; align-items: center; gap: .6rem; padding: .2rem .55rem 1.1rem; text-decoration: none; }
.brand-name { font: 800 1.35rem/1 var(--display); letter-spacing: -0.03em; }
.brand-name em { font-style: normal; color: var(--tag); -webkit-text-stroke: .6px color-mix(in srgb, var(--tag-ink) 55%, transparent); }
:root[data-theme="dark"] .brand-name em { -webkit-text-stroke: 0; text-shadow: 0 0 14px rgba(255,210,63,.45); }
.mark { width: 2.25rem; height: 2.25rem; flex: none; }
.mark .bg { fill: var(--tag); }
.mark .bar { fill: var(--tag-ink); }
.nav { display: grid; gap: .15rem; }
.nav a { position: relative; display: flex; align-items: center; gap: .75rem; height: 2.6rem; padding: 0 .75rem; border-radius: 11px; text-decoration: none; color: var(--ink-2); font-weight: 600; transition: background .15s, color .15s; }
.nav a .ic { color: var(--muted); transition: color .15s; }
.nav a:hover { background: var(--paper-2); color: var(--ink); }
.nav a.sister small { margin-left: auto; font-size: .72rem; font-weight: 500; color: var(--muted); }
.nav a[aria-current="page"] { background: var(--paper); color: var(--ink); box-shadow: var(--shadow); }
.nav a[aria-current="page"] .ic { color: var(--ink); }
.nav a[aria-current="page"]::before { content: ""; position: absolute; left: -.8rem; top: .55rem; bottom: .55rem; width: 4px; border-radius: 0 4px 4px 0; background: var(--tag); box-shadow: var(--glow); }
.nav .count { margin-left: auto; min-width: 1.5rem; height: 1.3rem; padding: 0 .4rem; border-radius: 999px; background: var(--tag); color: var(--tag-ink); font-size: .72rem; font-weight: 800; display: grid; place-items: center; }
.nav-sep { height: 1px; background: var(--line); margin: .55rem .6rem; }
.rail-foot { margin-top: auto; display: flex; align-items: center; gap: .25rem; padding: .5rem .2rem 0; border-top: 1px solid var(--line); }
.rail-foot .who { font-size: .82rem; color: var(--muted); margin-right: auto; padding-left: .5rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.main { min-width: 0; min-height: 0; display: flex; flex-direction: column; }
.page { flex: 1; min-height: 0; overflow: auto; padding: 1.6rem clamp(1rem, 2.4vw, 2.4rem) 2.5rem; scrollbar-gutter: stable; }
.page-head { display: flex; align-items: flex-end; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.4rem; }
.page-head h1 { font-size: clamp(1.7rem, 1.3rem + 1.2vw, 2.4rem); }
.page-head .sub { color: var(--muted); margin-top: .35rem; }
.page-head .actions { margin-left: auto; display: flex; gap: .5rem; flex-wrap: wrap; }
.eyebrow { font: 800 .72rem var(--font); text-transform: uppercase; letter-spacing: .14em; color: var(--muted); }

.panel { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.panel-head { display: flex; align-items: center; gap: .6rem; padding: 1rem 1.15rem .2rem; }
.panel-head h2 { font-size: 1.12rem; }
.panel-head .more { margin-left: auto; }
.panel-body { padding: .8rem 1.15rem 1.15rem; }
.empty { display: grid; place-items: center; gap: .5rem; text-align: center; padding: 2.2rem 1rem; color: var(--muted); }
.empty > .ic { width: 2.2rem; height: 2.2rem; color: var(--faint); }


/* ------------------------------------------------------------------ dialogs */
dialog { border: 0; padding: 0; background: transparent; color: var(--ink); max-width: min(560px, calc(100vw - 2rem)); width: 100%; max-height: calc(var(--app-h) - 2rem); overflow: visible; }
dialog::backdrop { background: rgba(12,14,10,.45); backdrop-filter: blur(2px); }
dialog[open] .dlg { animation: rise .22s cubic-bezier(.2,.8,.2,1); }
@keyframes rise { from { transform: translateY(14px) scale(.98); opacity: 0; } }
.dlg { background: var(--paper); border-radius: 18px; box-shadow: var(--shadow-lg); border: 1px solid var(--line); display: flex; flex-direction: column; max-height: calc(var(--app-h) - 2rem); }
.dlg-head { display: flex; align-items: center; gap: .6rem; padding: 1.15rem 1.3rem .4rem; }
.dlg-head h2 { font-size: 1.3rem; }
.dlg-head .btn { margin-left: auto; }
.dlg-body { padding: .6rem 1.3rem 1rem; overflow: auto; display: grid; gap: 1rem; }
.dlg-foot { display: flex; gap: .5rem; justify-content: flex-end; padding: .9rem 1.3rem 1.1rem; border-top: 1px solid var(--line); flex-wrap: wrap; }
.dlg-foot .left { margin-right: auto; display: flex; align-items: center; }
.formerr { color: var(--loss); font-size: .88rem; display: flex; gap: .4rem; align-items: center; }
/* toasts */
.toasts { position: fixed; z-index: 90; bottom: 1.2rem; left: 50%; transform: translateX(-50%); display: grid; gap: .5rem; pointer-events: none; }
.toast { display: flex; align-items: center; gap: .55rem; padding: .7rem 1rem; border-radius: 12px; background: var(--ink); color: var(--paper); box-shadow: var(--shadow-lg); font-weight: 600; font-size: .92rem; animation: rise .25s; pointer-events: auto; }
.toast.bad { background: var(--loss); color: #fff; }
.toast .ic { color: var(--tag); }
.toast.bad .ic { color: #fff; }

/* ------------------------------------------------------------------ login */
.auth { position: relative; z-index: 1; min-height: 100dvh; display: grid; place-items: center; padding: 1.5rem; }
.auth-card { width: min(420px, 100%); }
.auth-card .receipt { padding: 1.8rem 1.7rem calc(9px + 1.6rem); display: grid; gap: 1rem; }
.auth-card .top { display: flex; align-items: center; justify-content: space-between; }
.auth-card h1 { font-size: 2rem; }
.auth-card .lead { margin: -.5rem 0 0; color: var(--muted); }
.alert { display: flex; gap: .5rem; align-items: center; padding: .7rem .85rem; border-radius: 10px; background: var(--loss-wash); color: var(--loss); font-size: .9rem; }
.auth-card .barcode { width: 60%; height: 2.4rem; justify-self: center; color: var(--ink); opacity: .75; }
.auth-card .foot { text-align: center; font: 600 .74rem var(--mono); letter-spacing: .25em; color: var(--muted); }

/* ------------------------------------------------------------------ the community switcher (labauth/switcher.html) */
.lab-switch { display: grid; gap: .15rem; margin: 0 .2rem .9rem; padding: .55rem .7rem; border-radius: 12px; border: 1px dashed var(--line-2); background: color-mix(in srgb, var(--paper) 70%, transparent); }
.lab-switch-k { font: 800 .64rem var(--font); text-transform: uppercase; letter-spacing: .14em; color: var(--muted); }
.lab-switch b { font: 700 .98rem var(--display); }
.lab-switch select { all: unset; cursor: pointer; font: 700 .98rem var(--display); padding-right: 1.2rem;
  background: linear-gradient(45deg, transparent 50%, var(--muted) 50%) calc(100% - 7px) 55% / 5px 5px no-repeat, linear-gradient(135deg, var(--muted) 50%, transparent 50%) calc(100% - 2px) 55% / 5px 5px no-repeat; }
.lab-switch select option { background: var(--paper); color: var(--ink); }
.lab-msg { padding: 1.8rem 1.7rem calc(9px + 1.6rem); display: grid; gap: 1rem; }

/* ------------------------------------------------------------------ the hub: one price-tag card per app */
.hub-head { display: flex; align-items: flex-end; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.6rem; }
.hub-head h1 { font-size: clamp(2rem, 1.4rem + 2vw, 3rem); letter-spacing: -0.03em; }
.hub-head h1 em { font-style: normal; color: var(--accent-text); }
:root[data-theme="dark"] .hub-head h1 em { color: var(--tag); }
.hub-head .sub { color: var(--muted); margin-top: .35rem; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 270px), 1fr)); gap: 1.1rem; }
.tile { position: relative; display: grid; grid-template-rows: auto 1fr auto; gap: .8rem; min-height: 12.5rem; padding: 1.25rem 1.3rem 1.1rem 1.6rem;
  text-decoration: none; color: var(--ink); background: var(--paper); border: 1px solid var(--line); border-radius: 6px var(--radius) var(--radius) 6px; box-shadow: var(--shadow);
  transition: transform .16s cubic-bezier(.2,.8,.2,1), box-shadow .16s, border-color .16s; overflow: hidden; }
/* the tag's punched hole and its string, on the left edge */
.tile::before { content: ""; position: absolute; left: .55rem; top: 1.45rem; width: .55rem; height: .55rem; border-radius: 50%; background: var(--bg); box-shadow: inset 0 1px 2px rgba(0,0,0,.25); }
.tile::after { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--tile, var(--tag)); }
.tile:hover { transform: translateY(-3px) rotate(-.4deg); box-shadow: var(--shadow-lg); border-color: var(--line-2); }
.tile .tile-top { display: flex; align-items: center; gap: .8rem; }
.tile .tile-ic { width: 3rem; height: 3rem; border-radius: 14px; display: grid; place-items: center; background: var(--tile, var(--tag)); color: var(--tag-ink); box-shadow: var(--glow); }
.tile .tile-ic .ic { width: 1.7rem; height: 1.7rem; }
.tile h2 { font-size: 1.45rem; }
.tile .host { font: 500 .78rem var(--mono); color: var(--muted); }
.tile p { margin: 0; color: var(--ink-2); line-height: 1.5; }
.tile .tile-foot { display: flex; align-items: center; gap: .5rem; padding-top: .7rem; border-top: 1.5px dashed var(--line-2); font-size: .82rem; color: var(--muted); }
.tile .tile-foot .go { margin-left: auto; display: inline-flex; align-items: center; gap: .3rem; font-weight: 700; color: var(--ink); }
.tile:hover .tile-foot .go .ic { transform: translateX(3px); }
.tile .tile-foot .go .ic { transition: transform .16s; }
.tile.app-shopping { --tile: var(--tag); }
.tile.app-nyochi { --tile: #9fd27a; }
.tile.app-admin { --tile: #b9c3d9; }
:root[data-theme="dark"] .tile.app-nyochi { --tile: #8fd36a; }
:root[data-theme="dark"] .tile.app-admin { --tile: #aab8d6; }
.locked { margin-top: 1.1rem; display: flex; flex-wrap: wrap; gap: .4rem .8rem; align-items: center; color: var(--muted); font-size: .86rem; }
.locked .chip { opacity: .75; }

.hub-cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(260px, 340px); gap: 1.4rem; align-items: start; }
.section-title { display: flex; align-items: center; gap: .6rem; margin: 0 0 .8rem; }
.section-title h2 { font-size: 1.15rem; }
.comms { display: grid; gap: .5rem; }
.comm { display: flex; align-items: center; gap: .7rem; padding: .7rem .8rem; border-radius: 12px; border: 1px solid var(--line); background: var(--paper); }
.comm.on { border-color: var(--accent-text); background: color-mix(in srgb, var(--accent) 10%, var(--paper)); }
.comm .nm { font-weight: 700; }
.comm .sub { font-size: .78rem; color: var(--muted); }
.comm form, .comm .here { margin-left: auto; }
.comm .here { font-size: .78rem; font-weight: 700; color: var(--accent-text); }
:root[data-theme="dark"] .comm .here { color: var(--tag); }
.role { display: inline-flex; align-items: center; height: 1.35rem; padding: 0 .45rem; border-radius: 6px; font: 700 .68rem var(--mono); letter-spacing: .04em; text-transform: uppercase; border: 1px solid var(--line-2); color: var(--ink-2); }
.role.creator { background: var(--tag); border-color: transparent; color: var(--tag-ink); }
.role.admin { background: var(--paper-3); }
.role.superuser { background: var(--ink); color: var(--paper); border-color: transparent; }

/* forms on a panel (account, invite) */
.stack { display: grid; gap: 1rem; }
.errlist, .field ul { margin: 0; padding: 0; list-style: none; color: var(--loss); font-size: .84rem; }
.ok-note { display: flex; gap: .5rem; align-items: center; padding: .7rem .85rem; border-radius: 10px; background: var(--save-wash); color: var(--save); font-size: .9rem; }
.auth-card .invite-to { display: grid; gap: .1rem; padding: .8rem .9rem; border-radius: 12px; background: var(--paper-2); border: 1px dashed var(--line-2); }
.auth-card .invite-to b { font: 800 1.3rem var(--display); }
.auth-card .alt { text-align: center; font-size: .88rem; color: var(--muted); }

/* ------------------------------------------------------------------ phone */
.tabbar, .phone-head { display: none; }
@media (max-width: 1100px) {
  :root { --rail: 76px; }
  .rail .brand-name, .nav a span, .nav a.sister small, .rail-foot .who, .rail .lab-switch { display: none; }
  .nav a { justify-content: center; padding: 0; }
  .brand { justify-content: center; padding-left: 0; padding-right: 0; }
  .rail-foot { flex-direction: column; }
  .hub-cols { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .shell { grid-template-columns: 1fr; grid-template-rows: auto minmax(0, 1fr) auto; }
  .rail { display: none; }
  .phone-head { display: flex; align-items: center; gap: .6rem; padding: calc(env(safe-area-inset-top) + .6rem) 1rem .6rem; border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--paper) 80%, transparent); backdrop-filter: blur(10px); }
  .phone-head .brand { padding: 0; }
  .phone-head .brand .mark { width: 1.9rem; height: 1.9rem; }
  .phone-head .ttl { font: 800 1.2rem var(--display); }
  .phone-head .acts { margin-left: auto; display: flex; gap: .2rem; }
  .tabbar { display: grid; grid-template-columns: repeat(var(--tabs, 3), 1fr); border-top: 1px solid var(--line); background: var(--paper); padding: .35rem .3rem calc(env(safe-area-inset-bottom) + .35rem); }
  .tabbar a, .tabbar button { all: unset; display: grid; justify-items: center; gap: .1rem; font-size: .68rem; font-weight: 700; color: var(--muted); padding: .3rem 0; border-radius: 10px; cursor: pointer; }
  .tabbar .ic { width: 1.5rem; height: 1.5rem; }
  .tabbar [aria-current="page"] { color: var(--ink); }
  .tabbar [aria-current="page"] .ic { background: var(--tag); color: var(--tag-ink); border-radius: 999px; padding: .1rem .7rem; box-sizing: content-box; box-shadow: var(--glow); }
  .tabbar form { display: contents; }
  .page { padding: 1.1rem 1rem 1.6rem; }
  .phone-switch { display: block; margin-bottom: 1rem; }
  .phone-switch .lab-switch { margin: 0; }
  dialog { max-width: 100vw; margin: auto 0 0; }
  .dlg { border-radius: 22px 22px 0 0; max-height: calc(var(--app-h) - 1rem); }
  .toasts { bottom: 5.5rem; }
}
.phone-switch { display: none; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
