











:root {
    --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --scale: 1;



    --t-sm: 12.5px; --t-base: 14px; --t-md: 15.5px;
    --fs-xs: max(12px, calc(12px * var(--scale)));
    --fs-sm: max(12px, calc(var(--t-sm) * var(--scale)));
    --fs-base: max(12px, calc(var(--t-base) * var(--scale)));
    --fs-md: max(12px, calc(var(--t-md) * var(--scale)));
    --fs-lg: calc(clamp(17px, 0.9vw + 11px, 20px) * var(--scale));
    --fs-kpi: calc(clamp(24px, 1.6vw + 14px, 30px) * var(--scale));
    --gutter: clamp(16px, 2.2vw, 26px);
    --rail-w: 72px;
    --nav-w: 284px;
    --icon-box: 36px;
    --icon-center-x: calc(var(--rail-w) / 2);
    --label-start-x: 88px;
    --header-h: 64px;
    --content-left: var(--rail-w);
    --radius: 14px;
    --radius-sm: 9px;
    --gap: 16px;
    --pad: 18px;
    --ease: cubic-bezier(.2, .8, .2, 1);
}
:root[data-density="compact"] { --gap: 10px; --pad: 12px; }

:root, :root[data-theme="dark"] {
    color-scheme: dark;
    --bg: #0e0e11;
    --surface: #16161b;
    --surface-2: #1d1d24;
    --surface-3: #272730;
    --border: #2b2b35;
    --text: #f2f1f4;
    --text-2: #b9b6c0;
    --muted: #8b8894;
    --accent: #e0668a;
    --accent-ink: #1a0d12;
    --accent-text: #f08fab;
    --gold: #cfa862;
    --ok: #4ccf9a;
    --warn: #f0b545;
    --bad: #f27272;
    --info: #86b7f7;
    --shadow: 0 4px 14px rgba(0, 0, 0, .28);
    --overlay: rgba(0, 0, 0, .62);

    --zone: rgba(150, 44, 58, .78);
    --viz-1: #d55181; --viz-2: #008300; --viz-3: #3987e5; --viz-4: #c98500; --viz-5: #199e70; --viz-6: #d95926;
    --viz-other: #5d5a66;
}
:root[data-theme="light"] {
    color-scheme: light;
    --bg: #f8f4f3;
    --surface: #ffffff;
    --surface-2: #f6efef;
    --surface-3: #ece2e3;
    --border: #e3d8d9;
    --text: #2b2426;
    --text-2: #554a4d;
    --muted: #7a6d70;
    --accent: #c9456d;
    --accent-ink: #ffffff;
    --accent-text: #b03a5e;
    --gold: #94702c;
    --ok: #1f8a5f;
    --warn: #9a6a08;
    --bad: #c23a3a;
    --info: #2f6fbe;
    --shadow: 0 3px 10px rgba(80, 40, 50, .08);
    --overlay: rgba(40, 25, 30, .42);
    --zone: rgba(38, 26, 31, .9);
    --viz-1: #e87ba4; --viz-2: #008300; --viz-3: #2a78d6; --viz-4: #eda100; --viz-5: #1baf7a; --viz-6: #eb6834;
    --viz-other: #b9b3b5;
}

* { box-sizing: border-box; margin: 0; padding: 0; scrollbar-width: thin; scrollbar-color: var(--surface-3) transparent; }
html, body { height: 100%; }
[hidden] { display: none !important; }
body {
    font-family: var(--font);
    font-size: var(--fs-base);
    line-height: 1.45;
    background: var(--bg);
    color: var(--text);
    -webkit-font-smoothing: antialiased;
    transition: background-color .25s, color .25s;
}
a { color: var(--accent-text); }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
svg.ic { width: 1.15em; height: 1.15em; flex: none; stroke: currentColor; fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; vertical-align: -0.18em; transition: transform .2s var(--ease); }






html.auth-pending:not(.frame-first) body > :not(.brand-loader):not(.auth-stuck-box):not(.page-skeleton) { visibility: hidden; }


html:not(.board-ready) main .board { visibility: hidden; }
.topbar-tools { min-height: 36px; }
.signed-in-as { min-height: 1.3em; }
.brand-loader { display: none; }
html.auth-pending:not(.frame-first) .brand-loader {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; position: fixed; inset: 0; z-index: 5000;
    background: var(--bg); color: var(--text);
}
.brand-loader-mark { width: 72px; height: 72px; border-radius: 22px; display: grid; place-items: center; margin-bottom: 10px;
    background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--accent-text); animation: brand-breathe 1.6s ease-in-out infinite; }
.brand-loader-mark svg.ic { width: 56%; height: 56%; }
.brand-loader-name { font-size: var(--fs-lg); font-weight: 700; letter-spacing: .2px; }
.brand-loader-text { font-size: var(--fs-sm); color: var(--muted); }
@keyframes brand-breathe { 0%, 100% { transform: scale(.94); box-shadow: 0 0 0 0 color-mix(in srgb, var(--gold) 0%, transparent); } 50% { transform: scale(1.04); box-shadow: 0 0 0 10px color-mix(in srgb, var(--gold) 16%, transparent); } }

.auth-stuck-box {
    position: fixed; z-index: 5200; left: 50%; top: 22px; translate: -50% 0; display: flex; align-items: center; flex-wrap: wrap; gap: 6px 12px; max-width: min(640px, calc(100vw - 32px));
    padding: 12px 14px 12px 18px; border-radius: var(--radius); background: var(--surface); color: var(--text); font-size: var(--fs-sm);
    border: 1px solid color-mix(in srgb, var(--bad) 45%, var(--border)); box-shadow: var(--shadow); visibility: visible;
}
.auth-stuck-box b { color: var(--bad); }
html.auth-stuck .brand-loader-mark { animation: none; }

@view-transition { navigation: auto; }
.sidebar { view-transition-name: glowup-sidebar; }
.topbar { view-transition-name: glowup-topbar; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .14s; }
@media (prefers-reduced-motion: reduce) {
    @view-transition { navigation: none; }
    .brand-loader-mark { animation: none; }
}




.page-skeleton { display: none; }
html.auth-pending .page-skeleton, body.leaving .page-skeleton {
    display: grid; grid-template-columns: 232px 1fr; visibility: visible; position: fixed; inset: 0; z-index: 5000; background: var(--bg);
    --sk-a: color-mix(in srgb, var(--accent) 11%, var(--surface-2)); --sk-b: color-mix(in srgb, var(--gold) 26%, var(--surface-2));
}
html.auth-pending .page-skeleton.login, body.leaving .page-skeleton.login { grid-template-columns: 1fr; place-items: center; }

.sk, .skeleton {
    display: block; border-radius: var(--radius-sm); color: transparent !important; user-select: none;
    background: linear-gradient(100deg, var(--sk-a, color-mix(in srgb, var(--accent) 11%, var(--surface-2))) 30%, var(--sk-b, color-mix(in srgb, var(--gold) 26%, var(--surface-2))) 50%, var(--sk-a, color-mix(in srgb, var(--accent) 11%, var(--surface-2))) 70%);
    background-size: 240% 100%; animation: shimmer 1.5s ease-in-out infinite;
}
.sk-side { display: flex; flex-direction: column; gap: 6px; padding: 20px 14px; background: var(--surface); border-right: 1px solid var(--border); }
.sk-brand { display: flex; align-items: center; gap: 10px; padding: 0 6px 18px; color: var(--text); }
.sk-brand b { display: block; font-size: var(--fs-md); line-height: 1.15; } .sk-brand small { font-size: var(--fs-xs); color: var(--muted); }
.sk-mark { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; flex: none; background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--accent-text); }
.sk-mark svg { width: 60%; height: 60%; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linejoin: round; }
.sk-mark.big { width: 64px; height: 64px; border-radius: 18px; }
.sk-nav { height: 42px; border-radius: var(--radius-sm); opacity: .7; }
.sk-nav.on { opacity: 1; outline: 1px solid color-mix(in srgb, var(--accent) 38%, transparent); }
.sk-main { display: flex; flex-direction: column; gap: var(--gap); padding: 16px 26px 26px; min-width: 0; overflow: hidden; }
.sk-top { display: flex; flex-direction: column; gap: 8px; padding-bottom: 12px; border-bottom: 1px solid var(--border); }
.sk-text { height: 12px; border-radius: 999px; } .sk-text.title { height: 22px; width: 300px; max-width: 60%; } .sk-text.thin { height: 9px; opacity: .75; }
.w10 { width: 10%; } .w15 { width: 15%; } .w30 { width: 30%; } .w35 { width: 35%; } .w45 { width: 45%; } .w50 { width: 50%; } .w60 { width: 60%; } .w70 { width: 70%; }
.sk-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--gap); } .sk-tiles.five { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.sk-tile { display: flex; align-items: center; gap: 12px; height: 68px; padding: 0 var(--pad); border-radius: var(--radius); }
.sk-tiles.five .sk-tile { height: 118px; align-items: flex-start; padding-top: var(--pad); }
.sk-chip { width: 34px; height: 34px; border-radius: 10px; flex: none; background: color-mix(in srgb, var(--gold) 30%, transparent); }
.sk-tile > span { display: flex; flex-direction: column; gap: 7px; flex: 1; }
.sk-num { display: block; width: 46px; height: 18px; border-radius: 6px; background: color-mix(in srgb, var(--text) 16%, transparent); }
.sk-cap { display: block; width: 60%; height: 9px; border-radius: 999px; background: color-mix(in srgb, var(--text) 10%, transparent); }
.sk-cap.thin { height: 7px; }
.sk-panel { display: flex; flex-direction: column; gap: 4px; padding: var(--pad); border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); flex: 1; min-height: 0; overflow: hidden; }
.sk-panel.slim { flex: none; flex-direction: row; gap: 10px; align-items: center; }
.sk-split { display: grid; grid-template-columns: 2fr 1fr; gap: var(--gap); flex: 1; min-height: 0; }
.sk-field { height: 38px; border-radius: var(--radius-sm); } .sk-panel:not(.slim) > .sk-field { margin-bottom: 6px; }
.sk-button { height: 42px; border-radius: var(--radius-sm); --sk-a: color-mix(in srgb, var(--accent) 55%, var(--surface-2)); --sk-b: color-mix(in srgb, var(--accent) 80%, #fff); }
.sk-line-row { display: flex; align-items: center; gap: 12px; padding: 11px 4px; border-bottom: 1px solid var(--border); }
.sk-line-row:last-child { border-bottom: none; }
.sk-line-row > span { flex: 1; display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.sk-dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.sk-pill { width: 62px; height: 20px; border-radius: 999px; flex: none; }


.sk-line-row.one, .sk-line-row.rank, .sk-line-row.sugg { padding-block: 0; }
.sk-line-row.one { min-height: 43px; }
.sk-line-row.rank { min-height: 45px; }
.sk-line-row.sugg { min-height: 61px; }
.sk-line-row.one > span, .sk-line-row.rank > span, .sk-line-row.sugg > span { gap: 0; }
.sk-pill.short { width: 30px; }
.sk-rank { width: 24px; height: 24px; border-radius: 50%; flex: none; }
.sk-time { width: 52px; height: 9px; border-radius: 999px; flex: none; }
.result-legend li.sk-legend { display: flex; height: 30px; cursor: default; background: none; }
.sk-legend .sk-text { flex: 1; max-width: 45%; }
.sk-legend .sk-time { margin-left: auto; width: 36px; }
.sk-note { height: 48px; }
.sk-review-tile { height: 44px; border-radius: var(--radius-sm); }
.assist-sk { height: 36px; flex: none; }
.sk-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.sk-card { display: flex; flex-direction: column; justify-content: center; gap: 9px; height: 66px; padding: 0 16px 0 42px; border-radius: var(--radius-sm); }
.sk-login { display: flex; flex-direction: column; align-items: center; gap: 14px; width: 360px; max-width: calc(100vw - 48px); padding: 32px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); }
.sk-login .sk-field, .sk-login .sk-button { width: 100%; }

.sk-wait { position: absolute; right: 22px; bottom: 18px; display: flex; align-items: center; gap: 10px; padding: 8px 14px 8px 8px; border-radius: 999px; font-size: var(--fs-sm); color: var(--text-2);
    background: var(--surface); border: 1px solid color-mix(in srgb, var(--gold) 40%, var(--border)); box-shadow: var(--shadow); }
.sk-wait .sk-mark { width: 30px; height: 30px; border-radius: 50%; color: var(--gold); background: color-mix(in srgb, var(--gold) 16%, transparent); }
.sk-mark.pulse svg { animation: sparkle-breathe 1.2s ease-in-out infinite; }
@keyframes sparkle-breathe { 0%, 100% { transform: scale(.82) rotate(0deg); opacity: .7; } 50% { transform: scale(1.12) rotate(45deg); opacity: 1; } }
@media (max-width: 1023px) {
    html.auth-pending .page-skeleton:not(.login), body.leaving .page-skeleton:not(.login) { grid-template-columns: 72px 1fr; }
    .sk-brand span { display: none; } .sk-tiles, .sk-tiles.five { grid-template-columns: repeat(2, minmax(0, 1fr)); } .sk-split { grid-template-columns: 1fr; }
}
html.auth-stuck .page-skeleton { display: none !important; }

html.auth-stuck body:not(:has(.auth-stuck-box))::before {
    content: "Could not reach the sign-in service. Check your internet connection, then reload this page.";
    visibility: visible; position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; font-size: var(--fs-sm);
    color: var(--bad); padding: 24px; text-align: center;
}

.sk-list { display: flex; flex-direction: column; width: 100%; }
.empty-state.loading { border-style: solid; border-color: transparent; padding: 0; align-items: stretch; }
.empty-state.loading > :not(.sk-list) { display: none; }
.empty-state:not(.loading) > .sk-list { display: none; }




html.resizing *, html.resizing *::before, html.resizing *::after { transition: none !important; animation-duration: 0s !important; animation-delay: 0s !important; }


@media (max-width: 1023px) { :root { --t-base: 13.5px; --t-md: 15px; } }
@media (max-width: 767px) { :root { --t-sm: 12px; --t-base: 13px; --t-md: 14.5px; } }


.brand-logo { width: 34px; height: 34px; border-radius: 10px; flex: none; overflow: hidden; display: block; }
.brand-logo img { display: block; width: 100%; height: 100%; }
.brand-title { font-size: var(--fs-md); font-weight: 700; line-height: 1.15; letter-spacing: .1px; }
.brand-subtitle { font-size: var(--fs-xs); color: var(--muted); }
.nav-links { list-style: none; display: flex; flex-direction: column; gap: 4px; flex: 1; position: relative; }


.nav-links .nav-drop {
    position: absolute; left: 0; right: 0; z-index: 0; border-radius: var(--radius-sm); pointer-events: none; opacity: 0;
    background: color-mix(in srgb, var(--gold) 12%, transparent); border: 1px solid color-mix(in srgb, var(--gold) 38%, transparent);
}
.nav-links a {
    display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: var(--radius-sm);
    color: var(--text-2); text-decoration: none; font-size: var(--fs-base); border: 1px solid transparent;
}
.nav-links a { position: relative; z-index: 1; transition: color .2s; }
.nav-links a:hover { color: var(--text); }


.nav-links a.active {
    color: var(--text); font-weight: 600;
    background: color-mix(in srgb, var(--accent) 15%, transparent); border-color: color-mix(in srgb, var(--accent) 40%, transparent);
}
.nav-links a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.nav-links a.fx:hover { transform: none; box-shadow: none; }
.nav-links a:hover svg.ic { transform: scale(1.12); }
.nav-links a.active svg.ic { color: var(--accent-text); }
.nav-links a.is-navigating { pointer-events: none; opacity: .6; }
.sidebar-footer { border-top: 1px solid var(--border); padding-top: 12px; display: flex; flex-direction: column; gap: 6px; }
.signed-in-as { font-size: var(--fs-xs); color: var(--muted); padding: 0 12px; min-height: 1.4em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sign-out { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 12px; border: 0; border-radius: var(--radius-sm); background: transparent; color: var(--bad); text-decoration: none; font: inherit; font-size: var(--fs-base); text-align: left; cursor: pointer; }
.sign-out:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.sign-out:hover { background: color-mix(in srgb, var(--bad) 12%, transparent); }

.main-content { display: flex; flex-direction: column; min-width: 0; min-height: 0; overflow: auto; }
.topbar {
    position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 14px;
    padding: 14px var(--gutter); background: color-mix(in srgb, var(--bg) 95%, transparent);
    border-bottom: 1px solid var(--border);
}

.bin-link { position: relative; display: inline-grid; place-items: center; color: var(--text-2); text-decoration: none; }
.bin-link:hover { color: var(--text); }
.bin-link:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.bin-badge {
    position: absolute; top: -6px; right: -6px; min-width: 19px; height: 19px; padding: 0 4px; border-radius: 999px; display: grid; place-items: center;
    font-size: 12px; font-weight: 700; line-height: 1; color: #fff; background: var(--accent); border: 2px solid var(--bg);
}
.bin-badge[hidden] { display: none; }
.topbar-tools { display: flex; align-items: center; gap: 8px; }
.operator-chip {
    display: inline-flex; align-items: center; gap: 7px; padding: 8px 14px; border-radius: 999px; font-size: var(--fs-sm); font-weight: 600; cursor: pointer;
    background: var(--surface-2); color: var(--text); border: 1px solid var(--border); white-space: nowrap;
    transition: transform .16s var(--ease), box-shadow .2s, background-color .2s;
}
.operator-chip:hover svg.ic { transform: rotate(-12deg) scale(1.1); }


.board { position: relative; display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: var(--gap); padding: 20px var(--gutter) 40px; align-items: start; }
.panel {
    grid-column: span var(--w, 12); min-width: 0; position: relative;
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
    transition: border-color .2s, box-shadow .25s, background-color .25s, transform .25s var(--ease);
}

.panel-inner { display: flex; flex-direction: column; gap: 12px; padding: var(--pad); height: 100%; min-height: 0; border-radius: inherit; }
.panel[data-fixed-h] > .panel-inner { overflow: auto; }

.panel[data-pshadow] { box-shadow: var(--panel-shadow); }
.panel[data-cshadow] :is(.kpi, .stat, .w-tile, .w-card, .ingredient-card, .tile):not(:hover) { box-shadow: var(--card-shadow); }

.panel.bare { background: none; border: none; }
.panel.bare > .panel-inner { padding: 0; }
.panel-head { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 8px; min-height: 30px; user-select: none; }

.panel-head > .pager, .panel-head > .head-end, .panel-head > .icon-btn, .panel-head > .guide-badge { flex: none; }
.panel-title { min-width: min(7ch, 100%); overflow-wrap: anywhere; }
.panel-title { font-size: var(--fs-md); font-weight: 650; }
.panel-head .spacer { flex: 1; }
.panel-count { font-size: var(--fs-xs); color: var(--muted); }

@property --spin { syntax: "<angle>"; inherits: false; initial-value: 0deg; }
.panel:not(.bare)::before {
    content: ""; position: absolute; inset: -1px; border-radius: inherit; padding: 1.5px; pointer-events: none; opacity: 0; transition: opacity .18s ease-out;
    background: conic-gradient(from 200deg, transparent 0 68%, var(--gold) 84%, var(--accent) 93%, transparent 100%);
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude;
}
.panel:not(.bare):hover::before { opacity: .85; }
.panel.member::before, .panel.preview::before, body.layout-editing .panel::before { display: none; }
@keyframes edge-light { to { --spin: 360deg; } }

.panel-menu-btn { opacity: 1; background: transparent; border-color: transparent; color: var(--muted); transition: background-color .15s, color .15s; }
.panel-menu-btn:hover { color: var(--text); }
.panel:hover > .panel-inner > .panel-head > .panel-menu-btn, .panel:hover > .panel-inner > .panel-head > .head-end > .panel-menu-btn, .panel-menu-btn:focus-visible, .panel-menu-btn[aria-expanded] { opacity: 1; }
@media (hover: none) { .panel-menu-btn { opacity: 1; } }




.board.fit { grid-auto-flow: row dense; grid-auto-rows: var(--row-unit, 4px); row-gap: 0; align-items: stretch; }
.board.fit > .panel { grid-row: span var(--rows, 40); margin-bottom: var(--gap); }
.board.fit.measuring { grid-auto-rows: auto; align-items: start; }
.board.fit.measuring > .panel { grid-row: auto; }


.panel-head > .panel-fold-btn, .head-end > .panel-fold-btn { margin-left: auto; background: transparent; border-color: transparent; box-shadow: none; color: var(--muted); }
.panel-head > .panel-fold-btn:hover, .panel-head > .panel-fold-btn:focus-visible, .head-end > .panel-fold-btn:hover, .head-end > .panel-fold-btn:focus-visible { background: color-mix(in srgb, var(--text) 8%, transparent); color: var(--text); }
.panel-head > .spacer ~ .panel-fold-btn, .head-end > .panel-fold-btn { margin-left: 0; }
.panel-fold-btn svg.ic { transition: transform .2s var(--ease); }
.panel.folded > .panel-inner > .panel-head > .panel-fold-btn svg.ic, .panel.folded > .panel-inner > .panel-head > .head-end > .panel-fold-btn svg.ic { transform: rotate(-90deg); }
.panel-summary { display: none; flex: 1; min-width: 0; font-size: var(--fs-xs); color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.panel.folded { height: auto !important; }
.panel.folded > .panel-inner { padding-block: calc(var(--pad) * .5); overflow: visible; }
.panel.folded > .panel-inner > :not(.panel-head) { display: none !important; }
.panel.folded > .panel-inner > .panel-head > .head-end > :not(.panel-fold-btn):not(.panel-menu-btn) { display: none !important; }
.panel.folded > .panel-inner > .panel-head > :not(.panel-title):not(.guide-badge):not(.panel-summary):not(.panel-fold-btn):not(.panel-menu-btn):not(.head-end) { display: none !important; }
.panel.folded > .panel-inner > .panel-head > .panel-summary { display: block; }
.panel.folded > .panel-inner > .panel-head > .panel-title { color: var(--text-2); }
.panel.member > .panel-inner > .panel-head > .panel-fold-btn, .panel.member > .panel-inner > .panel-head > .head-end > .panel-fold-btn, .panel.member > .panel-inner > .panel-head > .panel-summary,
.panel.group > .panel-inner > .panel-head > .panel-fold-btn, .panel.group > .panel-inner > .panel-head > .head-end > .panel-fold-btn, .panel.preview .panel-fold-btn { display: none; }
body.layout-editing .board > .panel .panel-fold-btn { pointer-events: auto; }


.panel.alt-view > .panel-inner > :not(.panel-head):not(.widget-body):not(.assist) { display: none !important; }
.panel.alt-view > .panel-inner > .panel-head .pager:not(.widget-pager) { display: none; }




.board { container: board / inline-size; }
@container board (max-width: 999px) { html:not(.qs-open) .board > .panel { grid-column: span calc(6 + 6 * clamp(0, var(--w, 12) - 6, 1)) !important; } }


@media (min-width: 1024px) { @container board (max-width: 719px) { html.qs-open .board > .panel { grid-column: span calc(6 + 6 * clamp(0, var(--w, 12) - 6, 1)) !important; } } }

@media (max-width: 1023px) { @container board (max-width: 999px) { html.qs-open .board > .panel { grid-column: span calc(6 + 6 * clamp(0, var(--w, 12) - 6, 1)) !important; } } }


html.qs-open .board > .panel[data-qs-grow] { grid-column: span var(--qs-span) !important; }
@container board (max-width: 639px) {
    .board > .panel { grid-column: 1 / -1 !important; }
    .panel.group[data-group="side"] > .panel-inner > .group-body { grid-template-columns: minmax(0, 1fr); }
}


.btn, .primary-btn, .secondary-btn, .row-btn, .cancel-btn, .save-btn, .login-btn, .icon-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 7px; cursor: pointer; white-space: nowrap;
    border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--surface-2); color: var(--text);
    padding: 9px 14px; font-size: var(--fs-base); font-weight: 550; line-height: 1.1; text-decoration: none;
    transition: transform .16s var(--ease), box-shadow .2s, background-color .2s, border-color .2s, color .2s;
}
.btn:hover, .secondary-btn:hover, .row-btn:hover, .cancel-btn:hover, .icon-btn:hover { background: var(--surface-3); }
.primary-btn, .save-btn, .login-btn, .btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.primary-btn:hover, .save-btn:hover, .login-btn:hover, .btn.primary:hover { background: color-mix(in srgb, var(--accent) 88%, #fff); }
.btn.ghost { background: transparent; }
.btn.danger, .row-btn.danger, .danger-btn { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 40%, transparent); }
.btn.danger:hover, .row-btn.danger:hover { background: color-mix(in srgb, var(--bad) 14%, transparent); }
.btn.danger.solid { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn.danger.solid:hover { background: color-mix(in srgb, var(--bad) 86%, #000); }
.primary-btn:hover svg.ic, .btn.primary:hover svg.ic, .save-btn:hover svg.ic { transform: translateX(2px) scale(1.1); }
.row-btn { padding: 6px 10px; font-size: var(--fs-sm); border-radius: 8px; }
.row-btn.approve { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 45%, transparent); background: color-mix(in srgb, var(--ok) 10%, transparent); }
.row-btn.approve:hover { background: color-mix(in srgb, var(--ok) 20%, transparent); }
.row-btn.as-text { pointer-events: none; }
.icon-btn { padding: 0; width: 36px; height: 36px; border-radius: 10px; flex: none; }
.icon-btn.small { width: 30px; height: 30px; border-radius: 8px; }
button:disabled, .btn[disabled] { opacity: .5; cursor: not-allowed; }


.btn-group {
    display: inline-flex; align-items: center; gap: 4px; padding: 4px; border-radius: calc(var(--radius-sm) + 4px);
    background: var(--surface-2); border: 1px solid var(--border);
}
.btn-group > .btn, .btn-group > .primary-btn, .btn-group > .secondary-btn, .btn-group > .row-btn, .btn-group > .icon-btn { border-color: transparent; background: transparent; }
.btn-group > .btn:hover, .btn-group > .secondary-btn:hover, .btn-group > .row-btn:hover, .btn-group > .icon-btn:hover { background: var(--surface-3); }
.btn-group > .primary-btn, .btn-group > .btn.primary { background: var(--accent); }
.btn-group > .row-btn.approve { background: color-mix(in srgb, var(--ok) 12%, transparent); }
.btn-group .sep { width: 1px; align-self: stretch; margin: 4px 2px; background: var(--border); }
.with-guide { display: inline-flex; align-items: center; gap: 2px; }


.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.toolbar .spacer { flex: 1; }
.search-container { position: relative; flex: 1; min-width: min(200px, 100%); max-width: 420px; }
.search-container svg.ic, .search-icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.search-input, .toolbar-select, .field input[type=text], .field input[type=number], .field input[type=email], .field input[type=password], .field select, .field textarea, .text-input {
    width: 100%; padding: 9px 12px; border-radius: var(--radius-sm); border: 1px solid var(--border);
    background: var(--bg); color: var(--text); font-size: var(--fs-base); outline: none; transition: border-color .2s, box-shadow .2s;
}
.search-input { padding-left: 36px; }
.toolbar-select { width: auto; max-width: 240px; }
.search-input:focus, .toolbar-select:focus, .field input:focus, .field select:focus, .field textarea:focus, .text-input:focus {
    border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent);
}
::placeholder { color: var(--muted); opacity: .8; }


.table-container { overflow: auto; border: 1px solid var(--border); border-radius: var(--radius-sm); }
.admin-table { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
.admin-table th {
    position: sticky; top: 0; z-index: 1; text-align: left; padding: 10px 12px; font-size: var(--fs-xs); font-weight: 650;
    text-transform: uppercase; letter-spacing: .5px; color: var(--muted); background: var(--surface-2); border-bottom: 1px solid var(--border); white-space: nowrap;
}
.admin-table td { padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
.admin-table tr:last-child td { border-bottom: none; }
.admin-table tbody tr { transition: background-color .15s; }
.admin-table tbody tr:hover { background: color-mix(in srgb, var(--accent) 5%, transparent); }
.text-right { text-align: right; }
.table-message { text-align: center; color: var(--muted); padding: 30px !important; }
.table-message.error, .error-text { color: var(--bad); }
.row-sub { display: block; font-size: var(--fs-xs); color: var(--muted); margin-top: 2px; font-weight: 400; }
.row-sub.warn { color: var(--warn); }
.row-sub.review { color: var(--info); }




.status-badge {
    display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px 2px 8px; border-radius: 999px; font-size: var(--fs-xs); font-weight: 600;
    white-space: nowrap; --c: var(--muted); color: var(--c); background: color-mix(in srgb, var(--c) 13%, transparent);
    border: 1px solid color-mix(in srgb, var(--c) 30%, transparent);
}


.status-badge { padding: 2px 10px; color: color-mix(in srgb, var(--c) 75%, var(--text)); }
.status-badge.active, .status-badge.tone-ok { --c: var(--ok); }
.status-badge.pending, .status-badge.tone-warn { --c: var(--warn); }
.status-badge.inactive, .status-badge.tone-muted { --c: var(--muted); }
.status-badge.bin, .status-badge.tone-bad { --c: var(--bad); }
.status-badge.tone-info { --c: var(--info); }
th .guide-badge { margin-left: 6px; vertical-align: 1px; }
.guide-pop { white-space: pre-line; }


.status-pill, .risk-pill, .chip, .badge {
    display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 999px; font-size: var(--fs-xs); font-weight: 600;
    white-space: nowrap; border: 1px solid transparent; --c: var(--muted);
    color: color-mix(in srgb, var(--c) 75%, var(--text)); background: color-mix(in srgb, var(--c) 13%, transparent); border-color: color-mix(in srgb, var(--c) 30%, transparent);
}
.status-pill.active, .risk-pill.safe, .chip.good { --c: var(--ok); }
.status-pill.pending, .risk-pill.caution, .chip.warn { --c: var(--warn); }
.status-pill.inactive, .risk-pill.auto { --c: var(--muted); }
.risk-pill.harmful, .chip.bad { --c: var(--bad); }
.chip.pink { --c: var(--accent-text); }
.chip.review { --c: var(--info); }
.chip { margin: 0 6px 6px 0; font-weight: 500; }
.chip:not(.warn):not(.good):not(.pink):not(.review):not(.bad) { --c: var(--text-2); }
.muted { color: var(--muted); }
.small { font-size: var(--fs-xs); }
.count-link { color: var(--accent-text); text-decoration: none; font-weight: 600; }
.count-link:hover { text-decoration: underline; }
.source-link { color: var(--info); text-decoration: underline; text-underline-offset: 2px; }

.chip.source-kind { margin: 0 2px; font-size: var(--fs-xs); cursor: help; vertical-align: baseline; }
.source-guide { display: block; margin-top: 6px; }
.source-line { font-size: var(--fs-xs); color: var(--muted); line-height: 1.6; overflow-wrap: anywhere; }
.review-note {
    font-size: var(--fs-sm); line-height: 1.55; color: var(--text-2); overflow-wrap: anywhere; margin-top: 10px; padding: 10px 12px;
    border-radius: var(--radius-sm); background: color-mix(in srgb, var(--info) 10%, transparent); border: 1px solid color-mix(in srgb, var(--info) 32%, transparent);
}




.panel-inner { container: panel / inline-size; }
.stat-row, .kpi-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--gap); }
.stat-row > :last-child:nth-child(odd), .kpi-row > :last-child:nth-child(odd) { grid-column: 1 / -1; }

@container panel (min-width: 520px) {
    .stat-row:not(:has(> :nth-child(5))) { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); }
    .stat-row:not(:has(> :nth-child(5))) > :last-child:nth-child(odd) { grid-column: auto; }
}
@container panel (min-width: 640px) {
    .stat-row, .kpi-row { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); }
    .stat-row > :last-child:nth-child(odd), .kpi-row > :last-child:nth-child(odd) { grid-column: auto; }
}
.stat, .kpi {
    display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; column-gap: 8px; row-gap: 2px; padding: 10px 12px; min-width: 0;
    text-align: left; text-decoration: none; cursor: pointer; font-weight: 400; color: var(--text);
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: none;
    transition: border-color .2s, background-color .2s;
}
.stat:hover, .kpi:hover { border-color: color-mix(in srgb, var(--accent) 40%, var(--border)); }
.stat.on { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 9%, var(--surface)); }
.stat > span:last-child, .kpi-text { display: contents; }
.stat-icon, .kpi-icon { display: grid; place-items: center; width: 20px; height: 20px; flex: none; color: var(--gold); background: none; border-radius: 0; font-size: 16px; }
.stat-icon svg.ic, .kpi-icon svg.ic { width: 18px; height: 18px; }
.stat-value, .kpi-value { font-size: calc(22px * var(--scale)); font-weight: 700; line-height: 1.15; letter-spacing: -.3px; font-variant-numeric: tabular-nums; min-width: 1.4em; width: fit-content; }
.stat-title, .kpi-title { grid-column: 1 / -1; font-size: var(--fs-xs); line-height: 1.3; color: var(--muted); overflow-wrap: anywhere; }


.empty-state { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; text-align: center; padding: 28px 16px; border: 1px dashed var(--border); border-radius: var(--radius-sm); min-height: 120px; }
.empty-message { font-size: var(--fs-base); font-weight: 600; }
.empty-hint { font-size: var(--fs-xs); color: var(--muted); max-width: 46ch; }


.modal-overlay { display: none; position: fixed; inset: 0; background: var(--overlay); z-index: 1000; align-items: center; justify-content: center; padding: 24px; }
.modal-content {
    background: var(--surface); border: 1px solid var(--border); padding: 24px; border-radius: var(--radius); width: min(440px, 100%); max-width: 100%; max-height: 100%;
    overflow-y: auto; color: var(--text); box-shadow: var(--shadow); animation: pop-in .22s var(--ease);
}
.modal-content.wide { width: min(720px, 100%); }
.audit-list { max-height: 60vh; overflow-y: auto; display: grid; gap: 6px; margin: 8px 0; }
.audit-row { border: 1px solid var(--border); border-radius: 10px; padding: 8px 12px; background: var(--surface-2); }
.audit-row summary { cursor: pointer; font-size: var(--fs-sm); }
.audit-row .confirm-list { margin: 8px 0 2px; }
.modal-content h3 { font-size: var(--fs-md); font-weight: 650; }
.modal-intro { font-size: var(--fs-sm); color: var(--muted); margin-top: 4px; }
.modal-form { display: flex; flex-direction: column; gap: 14px; margin-top: 16px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label, .field > .field-label { font-size: var(--fs-sm); color: var(--text-2); font-weight: 550; display: flex; align-items: center; gap: 4px; }
.field .required { color: var(--accent-text); }
.field textarea { resize: vertical; line-height: 1.45; }
.field-hint { font-size: var(--fs-xs); color: var(--muted); line-height: 1.4; }
.field-hint.warn { color: var(--warn); }
.form-section { border-top: 1px solid var(--border); padding-top: 14px; display: flex; flex-direction: column; gap: 14px; }
.form-section-title { font-size: var(--fs-sm); font-weight: 650; color: var(--accent-text); text-transform: uppercase; letter-spacing: .5px; }

.form-row { align-items: start; }
.form-row > .field > label, .form-row > .field > .field-label { min-height: 24px; }
@media (max-width: 640px) { .form-row { grid-template-columns: 1fr; } }
.inline-actions { display: flex; align-items: center; gap: 8px; }
.inline-actions > input, .inline-actions > select { flex: 1 1 0; min-width: 0; }
.inline-actions > .btn { flex: none; white-space: nowrap; }

.name-clash { display: flex; flex-direction: column; gap: 8px; padding: 10px 12px; border: 1px solid color-mix(in srgb, var(--warn) 40%, transparent); border-radius: var(--radius-sm); background: color-mix(in srgb, var(--warn) 10%, var(--surface)); font-size: var(--fs-sm); color: var(--text-2); }
.name-clash[hidden] { display: none; }
.name-clash-row { display: flex; align-items: center; gap: 8px 12px; flex-wrap: wrap; justify-content: space-between; }
.name-clash-row > span { flex: 1 1 260px; min-width: 0; }
.name-clash-row .btn { flex: none; }
.name-clash-actions { display: inline-flex; gap: 8px; flex-wrap: wrap; }
.checks { display: flex; flex-wrap: wrap; gap: 6px 14px; }
.check { display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-sm); cursor: pointer; }
.check input { accent-color: var(--accent); width: 15px; height: 15px; }

.checks.pills { gap: 8px; }
.checks.pills .check { position: relative; padding: 6px 12px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface-2); color: var(--text-2); transition: background .15s var(--ease), border-color .15s var(--ease); }
.checks.pills .check input { position: absolute; opacity: 0; width: 0; height: 0; }
.checks.pills .check:hover { border-color: var(--accent); }
.checks.pills .check:has(input:checked) { background: color-mix(in srgb, var(--accent) 18%, var(--surface)); border-color: var(--accent); color: var(--text); font-weight: 600; }
.checks.pills .check:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }


.fit-list { display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; }
.fit-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 6px 8px 6px 12px; font-size: var(--fs-sm); }
.fit-row + .fit-row { border-top: 1px solid var(--border); }
.fit-name { min-width: 0; }
.fit-choices { display: inline-flex; flex: none; padding: 2px; gap: 2px; border-radius: 999px; background: var(--surface-2); }
.fit-choice { position: relative; cursor: pointer; }
.fit-choice input { position: absolute; opacity: 0; width: 0; height: 0; }
.fit-choice span { display: inline-block; min-width: 30px; padding: 3px 10px; border-radius: 999px; text-align: center; font-size: var(--fs-xs); font-weight: 600; color: var(--muted); }
.fit-choice:hover span { color: var(--text); }
.fit-choice.none input:checked + span { background: var(--surface); color: var(--text-2); }
.fit-choice.avoid input:checked + span { background: color-mix(in srgb, var(--warn) 24%, var(--surface)); color: var(--warn); }
.fit-choice.good input:checked + span { background: color-mix(in srgb, var(--ok) 24%, var(--surface)); color: var(--ok); }
.fit-choice input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 1px; }
.form-error {
    display: none; font-size: var(--fs-sm); color: var(--bad); border-radius: var(--radius-sm); padding: 8px 10px;
    background: color-mix(in srgb, var(--bad) 12%, var(--surface)); border: 1px solid color-mix(in srgb, var(--bad) 35%, transparent);
}
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 4px; }
.confirm-list { margin: 12px 0 0 18px; font-size: var(--fs-sm); color: var(--text-2); max-height: 230px; overflow: auto; line-height: 1.6; }

.modal-form .modal-actions { position: sticky; bottom: -24px; margin: 0 -24px -24px; padding: 12px 24px 24px; background: var(--surface); z-index: 2; border-top: 1px solid var(--border); }
.modal-form .form-error { position: sticky; bottom: 76px; z-index: 2; }


.swatch { display: inline-block; width: 16px; height: 16px; border-radius: 50%; border: 1px solid color-mix(in srgb, var(--text) 35%, transparent); margin-right: 4px; vertical-align: middle; }
.shade-editor { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.shade-item { display: inline-flex; align-items: center; gap: 4px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 999px; padding: 3px 6px 3px 3px; }
.shade-item input[type=color] { width: 26px; height: 26px; border: none; background: none; padding: 0; cursor: pointer; }
.shade-item code { font-size: var(--fs-xs); color: var(--text-2); }
.shade-item button { background: none; border: none; color: var(--muted); cursor: pointer; font-size: 15px; line-height: 1; padding: 0 2px; }
.shade-item button:hover { color: var(--bad); }


.toast-host { position: fixed; right: 20px; bottom: 20px; display: flex; flex-direction: column; gap: 8px; z-index: 2000; max-width: 380px; }
.toast {
    background: var(--surface); color: var(--text); border: 1px solid var(--border); border-left: 4px solid var(--muted); border-radius: var(--radius-sm);
    padding: 10px 14px; font-size: var(--fs-sm); line-height: 1.4; box-shadow: var(--shadow); animation: slide-in .25s var(--ease);
}
.toast { display: flex; align-items: center; gap: 12px; }
.toast > span { flex: 1; }
.toast.ok { border-left-color: var(--ok); }
.toast.error { border-left-color: var(--bad); }
.toast.warn { border-left-color: var(--warn); }


.guide-badge {
    display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; flex: none; cursor: help; padding: 0;
    border: 1px solid color-mix(in srgb, var(--gold) 55%, transparent); color: var(--gold); background: transparent;
    font-size: 12px; font-weight: 700; font-style: normal; line-height: 1; transition: background-color .15s, transform .15s;
}
.guide-badge:hover, .guide-badge:focus-visible { background: color-mix(in srgb, var(--gold) 18%, transparent); transform: scale(1.12); }
.guide-pop {
    position: fixed; z-index: 3000; width: max-content; max-width: 300px; padding: 10px 12px; border-radius: var(--radius-sm);
    background: var(--surface-3); color: var(--text); border: 1px solid color-mix(in srgb, var(--gold) 40%, var(--border));
    box-shadow: var(--shadow); font-size: var(--fs-sm); line-height: 1.45; pointer-events: none; opacity: 0; transform: translateY(4px);
    transition: opacity .14s, transform .14s;
}
.guide-pop.show { opacity: 1; transform: none; }
.guide-pop b { display: block; font-size: var(--fs-sm); margin-bottom: 2px; }
.guide-pop .preview { display: flex; gap: 6px; align-items: flex-start; margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--border); color: var(--text-2); font-size: var(--fs-xs); }
.guide-pop .preview svg.ic { color: var(--gold); margin-top: 1px; }


.pager { display: flex; align-items: center; gap: 8px; justify-content: flex-end; font-size: var(--fs-xs); color: var(--muted); flex-wrap: wrap; }
.pager .btn-group { padding: 3px; }
.pager .icon-btn { width: 28px; height: 28px; }
.pager .page-now { min-width: 76px; text-align: center; color: var(--text-2); }
.pager:empty { display: none; }


.pager .page-short { display: none; }
.panel-head .widget-pager { gap: 4px; }
.panel-head .widget-pager .btn-group { padding: 2px; }
.panel-head .widget-pager .icon-btn { width: 24px; height: 24px; }
.panel-head .widget-pager .page-now { min-width: 0; padding-inline: 4px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.panel-head .widget-pager .page-long { display: none; }
.panel-head .widget-pager .page-short { display: inline; }

.panel-head:has(> .head-end > .widget-pager:not(:empty)) { flex-wrap: nowrap; }
.panel-head:has(> .head-end > .widget-pager:not(:empty)) > .panel-title { flex: 0 1 auto; min-width: 0; }


.skeleton { min-height: 1em; }
.skeleton-line { height: 14px; margin: 9px 0; }
.skeleton-line.short { width: 55%; }
.skeleton-row { height: 46px; margin-bottom: 8px; }




.fx { position: relative; isolation: isolate; }

.fx:is(button, a[href], [role=button], .can-open, .can-pick, .w-tile, .ingredient-card, .tile):not(.kpi):not(.stat):hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 45%, transparent), 0 3px 8px color-mix(in srgb, var(--accent) 10%, transparent); }
.fx:not(.kpi):not(.stat):active:not(:disabled) { transform: translateY(0) scale(.985); }
.fx::after {
    content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; opacity: 0; z-index: 1;
    background: color-mix(in srgb, var(--fx, var(--accent)) 55%, #fff 10%);
    -webkit-mask-image: repeating-linear-gradient(0deg, #000 0 7px, transparent 7px 9px), repeating-linear-gradient(90deg, #000 0 7px, transparent 7px 9px), linear-gradient(45deg, transparent 38%, #000 46%, #000 54%, transparent 62%);
    mask-image: repeating-linear-gradient(0deg, #000 0 7px, transparent 7px 9px), repeating-linear-gradient(90deg, #000 0 7px, transparent 7px 9px), linear-gradient(45deg, transparent 38%, #000 46%, #000 54%, transparent 62%);
    -webkit-mask-size: auto, auto, 300% 300%; mask-size: auto, auto, 300% 300%;
    -webkit-mask-composite: source-in; mask-composite: intersect;
    -webkit-mask-position: 0 0, 0 0, 100% 0%; mask-position: 0 0, 0 0, 100% 0%;
}

[data-btn="pixel"] .fx.fx-run::after { animation: fx-sweep .52s var(--ease); }
.fx.fx-run { animation: fx-glow .52s ease-out; }
[data-btn="none"] .fx.fx-run { animation: none; }
.primary-btn.fx, .save-btn.fx, .login-btn.fx, .btn.primary.fx { --fx: #ffffff; }
@keyframes fx-sweep {
    0% { opacity: .0; -webkit-mask-position: 0 0, 0 0, 100% 0%; mask-position: 0 0, 0 0, 100% 0%; }
    15% { opacity: .55; }
    100% { opacity: 0; -webkit-mask-position: 0 0, 0 0, 0% 100%; mask-position: 0 0, 0 0, 0% 100%; }
}
@keyframes fx-glow {
    0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 70%, transparent); }
    60% { box-shadow: 0 0 0 5px color-mix(in srgb, var(--accent) 22%, transparent), 0 0 22px color-mix(in srgb, var(--accent) 40%, transparent); }
    100% { box-shadow: 0 0 0 0 transparent; }
}
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: 0 0; } }
@keyframes pop-in { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes slide-in { from { opacity: 0; transform: translateX(14px); } to { opacity: 1; transform: none; } }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.panel { animation: rise .35s var(--ease) both; }
.board > .panel:nth-child(2) { animation-delay: .04s; } .board > .panel:nth-child(3) { animation-delay: .08s; }
.board > .panel:nth-child(4) { animation-delay: .12s; } .board > .panel:nth-child(5) { animation-delay: .16s; } .board > .panel:nth-child(n+6) { animation-delay: .2s; }
@media (prefers-reduced-motion: reduce) { *, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; } }



body.own-layout .board > .panel > .panel-inner > .panel-head { cursor: grab; }
body.is-dragging { user-select: none; cursor: grabbing; }
body.is-dragging * { cursor: grabbing !important; }

.panel-tools { display: none; }
.resize-x, .resize-y { display: none; position: absolute; z-index: 4; }
.resize-x::after, .resize-y::after { content: ""; position: absolute; background: var(--gold); border-radius: 4px; opacity: .85; transition: scale .15s; }
.resize-x::after { top: 35%; bottom: 35%; left: 4px; width: 4px; }
.resize-y::after { left: 40%; right: 40%; top: 4px; height: 4px; }
.resize-x:hover::after { scale: 1.6 1; } .resize-y:hover::after { scale: 1 1.6; }


body.layout-editing .board > .panel { outline: 1px dashed color-mix(in srgb, var(--gold) 60%, transparent); outline-offset: 2px; cursor: grab; user-select: none; }
body.layout-editing .board > .panel > .panel-inner { pointer-events: none; opacity: .82; }
body.layout-editing .board > .panel .panel-menu-btn { pointer-events: auto; opacity: 1; }
body.layout-editing .board > .panel:hover { transform: translateY(-4px); box-shadow: 0 18px 40px rgba(0, 0, 0, .32); outline-style: solid; }
body.layout-editing .panel-tools {
    display: flex; align-items: center; gap: 6px; position: absolute; top: -13px; left: 12px; z-index: 5; padding: 3px 8px 3px 4px; border-radius: 999px;
    background: var(--gold); color: #1b1408; font-size: var(--fs-xs); font-weight: 700; box-shadow: var(--shadow); pointer-events: none;
}
.panel-tools button { background: rgba(0, 0, 0, .14); border: none; color: inherit; width: 20px; height: 20px; border-radius: 50%; cursor: pointer; display: grid; place-items: center; pointer-events: auto; opacity: 1; padding: 0; }
.panel-tools .size { font-weight: 500; opacity: .8; }
body.layout-editing .resize-x { display: block; top: 12px; bottom: 12px; right: -7px; width: 12px; cursor: ew-resize; }
body.layout-editing .resize-y { display: block; left: 12px; right: 12px; bottom: -7px; height: 12px; cursor: ns-resize; }
.panel.is-hidden { display: none; }
body.layout-editing .panel.is-hidden { display: block; opacity: .35; }


.panel.held, .panel.floating {
    z-index: 20; outline: 1px solid var(--gold) !important; outline-offset: 2px; border-color: var(--gold) !important;
    animation: beacon 1.15s ease-out infinite !important;
}
.panel.held { transform: translateY(-6px) !important; }
.panel.floating { transition: none; transform: none !important; scale: 1.015; rotate: .4deg; }
.panel.floating > .panel-inner { opacity: .92; }
@keyframes beacon {
    0% { box-shadow: 0 24px 54px rgba(0, 0, 0, .42), 0 0 0 0 color-mix(in srgb, var(--gold) 80%, transparent), 0 0 0 0 color-mix(in srgb, var(--gold) 50%, transparent); }
    65% { box-shadow: 0 24px 54px rgba(0, 0, 0, .42), 0 0 0 12px color-mix(in srgb, var(--gold) 0%, transparent), 0 0 0 28px color-mix(in srgb, var(--gold) 0%, transparent); }
    100% { box-shadow: 0 24px 54px rgba(0, 0, 0, .42), 0 0 0 12px transparent, 0 0 0 28px transparent; }
}

.drop-slot {
    position: absolute; z-index: 0; pointer-events: none; border-radius: var(--radius);
    border: 2px dashed color-mix(in srgb, var(--gold) 75%, transparent); background: color-mix(in srgb, var(--gold) 9%, transparent);
    transition: left .24s var(--ease), top .24s var(--ease), width .24s var(--ease), height .24s var(--ease);
}
.board.settled > .panel { animation: none; }

.editing-bar {
    display: none; position: sticky; top: 0; z-index: 25; margin: 12px var(--gutter) 0; padding: 8px 12px; border-radius: var(--radius-sm); align-items: center; gap: 10px;
    background: color-mix(in srgb, var(--gold) 16%, var(--surface)); border: 1px solid color-mix(in srgb, var(--gold) 50%, transparent); font-size: var(--fs-sm);
}
body.layout-editing .editing-bar { display: flex; animation: rise .25s var(--ease); }
.editing-bar .spacer { flex: 1; }


.group-tabs { display: inline-flex; flex-wrap: wrap; gap: 2px; padding: 3px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); }
.group-tab { border: 0; background: transparent; color: var(--text-2); padding: 6px 13px; border-radius: 999px; font-size: var(--fs-sm); font-weight: 600; cursor: pointer; transition: background-color .22s, color .22s, transform .16s var(--ease); }
.group-tab:hover { color: var(--text); transform: translateY(-1px); }
.group-tab.on { background: var(--accent); color: var(--accent-ink); }
.panel.group[data-group="tabs"] > .panel-inner > .panel-head > .panel-title { display: none; }
.panel.group:not([data-group="tabs"]) > .panel-inner > .panel-head > .group-tabs { display: none; }
.group-body { display: flex; flex-direction: column; gap: var(--gap); min-width: 0; }
.panel.group[data-group="side"] > .panel-inner > .group-body { display: grid; grid-template-columns: repeat(var(--n, 2), minmax(0, 1fr)); align-items: start; }
.panel.member { grid-column: auto; border: 0; background: none; box-shadow: none !important; animation: rise .28s var(--ease); min-width: 0; }
.panel.member > .panel-inner { padding: 0; }
.panel.member:not(.active-member) { display: none; }
.panel.member > .panel-tools, .panel.member > .resize-x, .panel.member > .resize-y { display: none !important; }
.panel.group[data-group="tabs"] .panel.member > .panel-inner > .panel-head > .panel-title { display: none; }
.panel.group[data-group="stack"] .panel.member + .panel.member { border-top: 1px solid var(--border); border-radius: 0; padding-top: var(--gap); }
@container panel (max-width: 520px) { .panel.group[data-group="side"] > .panel-inner > .group-body { grid-template-columns: 1fr; } }


.layout-view h4 { font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: .6px; color: var(--muted); font-weight: 650; display: flex; align-items: center; gap: 6px; }
.lw-theme-tabs { align-self: flex-start; }
.layout-view > .drawer-section.first { border-top: 0; padding-top: 0; }
.drawer-section { display: flex; flex-direction: column; gap: 10px; padding-top: 14px; border-top: 1px solid var(--border); }
.drawer-row { display: flex; align-items: center; gap: 10px; justify-content: space-between; font-size: var(--fs-sm); }
.drawer-row > span { color: var(--text-2); }
.drawer-row select, .drawer-row input[type=range] { width: min(170px, 100%); }
.drawer-row select { padding: 8px 9px; border-radius: 8px; border: 1px solid var(--border); background: var(--bg); }
.drawer-row #profileSelect { flex: 1; width: auto; min-width: 0; }
.drawer-row input[type=color] { width: 40px; height: 28px; border: 1px solid var(--border); border-radius: 8px; background: none; padding: 2px; cursor: pointer; }
.drawer-actions { display: flex; gap: 8px; }

.switch { position: relative; width: 38px; height: 22px; flex: none; padding: 0; border-radius: 999px; border: 1px solid var(--border); background: var(--surface-2); cursor: pointer; transition: background-color .2s, border-color .2s; }
.switch i { position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: var(--muted); transition: transform .2s var(--ease), background-color .2s; }
.switch[aria-checked="true"] { background: color-mix(in srgb, var(--accent) 30%, var(--surface-2)); border-color: var(--accent); }
.switch[aria-checked="true"] i { transform: translateX(16px); background: var(--accent); }
.drawer-row > span .guide-badge { vertical-align: middle; }
.drawer-actions .btn { flex: 1; }
.drawer-note { font-size: var(--fs-xs); color: var(--muted); line-height: 1.5; }
input[type=range] { accent-color: var(--accent); }



.menu {
    position: fixed; z-index: 3500; min-width: min(230px, calc(100vw - 16px)); max-width: min(320px, calc(100vw - 16px)); max-height: min(72vh, 540px); overflow: auto; padding: 6px; border-radius: var(--radius-sm);
    background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow);
    opacity: 0; transform: translateY(-6px) scale(.97); transform-origin: top right; transition: opacity .14s, transform .18s var(--ease);
}
.menu.show { opacity: 1; transform: none; }
.menu-item { width: 100%; display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 0; border-radius: 8px; background: transparent; color: var(--text); font-size: var(--fs-sm); text-align: left; cursor: pointer; transition: background-color .15s; }
.menu-item:hover, .menu-item:focus-visible { background: var(--surface-2); outline: none; }
.menu-item:hover svg.ic:first-child { transform: scale(1.14); }
.menu-item svg.ic { color: var(--muted); }
.menu-item.checked svg.ic { color: var(--accent-text); }
.menu-item.danger, .menu-item.danger svg.ic { color: var(--bad); }
.menu-item:disabled { opacity: .45; cursor: not-allowed; }
.menu-text { flex: 1; display: flex; flex-direction: column; min-width: 0; overflow-wrap: anywhere; }
.menu-text small { color: var(--muted); font-size: var(--fs-xs); line-height: 1.35; }
.menu-gap { width: 1.15em; flex: none; }
.menu-heading { padding: 8px 10px 4px; font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: .6px; color: var(--muted); font-weight: 650; }
.menu-sep { height: 1px; margin: 5px 4px; background: var(--border); }


.segmented { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 4px; border-radius: calc(var(--radius-sm) + 4px); background: var(--surface-2); border: 1px solid var(--border); width: fit-content; }
.seg { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border: 0; border-radius: var(--radius-sm); background: transparent; color: var(--text-2); font-size: var(--fs-sm); font-weight: 600; cursor: pointer; }
.seg.on { background: var(--accent); color: var(--accent-ink); }
.seg:disabled { opacity: .4; cursor: not-allowed; }
.panel.preview { grid-column: auto; animation: none; max-height: 290px; overflow: auto; }
.panel.preview .widget-body { pointer-events: none; }


.row-actions, .suggestion-actions { opacity: 0; transition: opacity .18s; }
tr:hover .row-actions, tr:focus-within .row-actions, .ingredient-card:hover .row-actions, .ingredient-card:focus-within .row-actions,
.suggestion-item:hover .suggestion-actions, .suggestion-item:focus-within .suggestion-actions, .row-actions:has(.approve) { opacity: 1; }
@media (hover: none) { .row-actions, .suggestion-actions { opacity: 1; } }
.product-row, .ingredient-card, .rank-item.can-open, .activity-item { cursor: pointer; }


.widget-body { position: relative; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.tone-dot { width: 9px; height: 9px; border-radius: 50%; flex: none; background: var(--c, var(--viz-other)); box-shadow: 0 0 0 4px color-mix(in srgb, var(--c, var(--viz-other)) 18%, transparent); }
.tone-ok { --c: var(--ok); } .tone-warn { --c: var(--warn); } .tone-bad { --c: var(--bad); } .tone-info { --c: var(--info); } .tone-pink { --c: var(--accent); } .tone-muted { --c: var(--viz-other); }

.w-list { list-style: none; display: flex; flex-direction: column; }
.w-item { display: flex; align-items: center; gap: 12px; padding: 9px 6px; border-bottom: 1px solid var(--border); border-radius: 8px; transition: background-color .15s, transform .16s var(--ease); }
.w-item:last-child { border-bottom: none; }
.w-item.can-open { cursor: pointer; }
.w-item.can-open:hover { background: color-mix(in srgb, var(--accent) 7%, transparent); transform: translateX(3px); }
.w-main { flex: 1; min-width: 0; }
.w-title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.w-sub { font-size: var(--fs-xs); color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.w-meta { font-size: var(--fs-xs); color: var(--muted); white-space: nowrap; }
.w-value { font-weight: 650; font-variant-numeric: tabular-nums; white-space: nowrap; }
.w-value small { font-weight: 400; color: var(--muted); font-size: var(--fs-xs); }
.w-swatches .swatch { width: 13px; height: 13px; margin-right: 2px; }


.w-strip { display: flex; gap: 12px; overflow-x: auto; padding: 4px 2px 10px; scroll-snap-type: x proximity; cursor: grab; scrollbar-width: none; }
.w-strip::-webkit-scrollbar { height: 0; }
.w-strip.dragging { cursor: grabbing; scroll-snap-type: none; user-select: none; }
.w-card, .w-tile {
    display: flex; flex-direction: column; gap: 4px; padding: 12px; border-radius: var(--radius-sm); min-width: 0;
    background: var(--surface-2); border: 1px solid var(--border); transition: transform .16s var(--ease), box-shadow .2s, border-color .2s, background-color .2s, scale .2s var(--ease);
}
.w-card { flex: 0 0 210px; scroll-snap-align: start; }
.w-card.can-open { cursor: pointer; }
.w-card.more { flex-basis: 140px; align-items: center; justify-content: center; color: var(--muted); font-size: var(--fs-sm); }
.w-card-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 16px; }
.w-foot { margin-top: auto; padding-top: 6px; display: flex; justify-content: flex-end; min-height: 20px; }
.w-card .w-title, .w-tile .w-title { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }


.w-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 12px; }
.w-tile { cursor: pointer; user-select: none; touch-action: pan-y; }

.w-tile.is-selected { border-color: var(--accent); scale: 1.03; background: color-mix(in srgb, var(--accent) 10%, var(--surface-2)); animation: neon 1.7s ease-in-out infinite; }
@keyframes neon {
    0%, 100% { box-shadow: 0 0 0 1px var(--accent), 0 0 14px color-mix(in srgb, var(--accent) 45%, transparent); }
    50% { box-shadow: 0 0 0 1px var(--accent), 0 0 24px color-mix(in srgb, var(--accent) 72%, transparent); }
}

.widget-body.shaking .w-tile { animation: wiggle .3s ease-in-out infinite alternate; cursor: grab; }
.widget-body.shaking .w-tile:nth-child(2n) { animation-duration: .26s; animation-delay: -.12s; }
.widget-body.shaking .w-tile:nth-child(3n) { animation-duration: .34s; animation-delay: -.2s; }
@keyframes wiggle { from { rotate: -1.3deg; } to { rotate: 1.3deg; } }
.w-tile.dragging { animation: none !important; z-index: 6; scale: 1.06; rotate: -2deg; box-shadow: var(--shadow); cursor: grabbing; transition: none; }

.w-tile.popping { animation: pop-away .26s ease-in forwards !important; pointer-events: none; }
@keyframes pop-away { 0% { scale: 1; opacity: 1; } 65% { scale: 1.18; opacity: 1; } 100% { scale: .2; opacity: 0; } }
.w-tile.arriving { animation: pop-back .32s var(--ease) both; }
@keyframes pop-back { from { scale: .6; opacity: 0; } to { scale: 1; opacity: 1; } }

.remove-zone {
    position: absolute; left: calc(var(--pad) * -1 + 2px); top: -6px; bottom: 30px; width: 44%; z-index: 3; pointer-events: none; opacity: 0; transition: opacity .25s;
    border-radius: var(--radius-sm); background: linear-gradient(90deg, var(--zone) 0%, color-mix(in srgb, var(--zone) 50%, transparent) 55%, transparent 100%);
    display: flex; flex-direction: column; justify-content: center; gap: 10px; padding-left: 26px; color: #fff;
}
.widget-body.shaking .remove-zone { opacity: .55; }
.zone-disc { width: 54px; height: 54px; border-radius: 50%; display: grid; place-items: center; font-size: 24px; background: var(--surface); color: var(--bad); border: 2px solid var(--bad); transition: scale .2s var(--ease); }
.remove-zone.armed .zone-disc { scale: 1.22; }
.zone-text { font-size: var(--fs-sm); font-weight: 650; max-width: 120px; text-shadow: 0 1px 6px rgba(0, 0, 0, .55); }

.w-bar {
    position: sticky; bottom: 0; z-index: 4; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 8px 10px 8px 18px; border-radius: 999px;
    background: var(--text); color: var(--bg); box-shadow: var(--shadow); font-size: var(--fs-sm); animation: rise .25s var(--ease);
}
.w-bar .spacer { flex: 1; }
.w-bar .row-btn { border-radius: 999px; border-color: transparent; }
.w-bar .bar-main { background: var(--accent); color: var(--accent-ink); }
.w-bar .bar-quiet { background: transparent; color: inherit; text-decoration: underline; text-underline-offset: 3px; }
.w-bar .bar-quiet.danger { color: color-mix(in srgb, var(--bad) 62%, var(--bg)); }
.w-bar.busy { opacity: .6; pointer-events: none; }


.chart-cap { font-size: var(--fs-sm); color: var(--text-2); }
.chart-cap b { color: var(--text); font-size: var(--fs-md); }
.chart-note { font-size: var(--fs-xs); color: var(--muted); }
.chart.bars { display: flex; flex-direction: column; gap: 5px; }
.bar-row { display: grid; grid-template-columns: minmax(70px, 30%) 1fr; align-items: center; gap: 10px; padding: 4px 6px; border-radius: 8px; transition: background-color .15s; }
.bar-row.can-pick:hover, .bar-row:focus-visible { background: color-mix(in srgb, var(--text) 6%, transparent); outline: none; }
.bar-row.can-pick { cursor: pointer; }
.bar-label { font-size: var(--fs-sm); color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: right; }
.bar-line { display: flex; align-items: center; gap: 8px; min-width: 0; }
.bar-fill { height: 14px; min-width: 2px; border-radius: 0 4px 4px 0; transform-origin: left; animation: grow-x .5s var(--ease) both; transition: filter .15s; }
.bar-row.can-pick:hover .bar-fill, .bar-row:focus-visible .bar-fill { filter: brightness(1.14); }
.bar-value { font-size: var(--fs-sm); font-weight: 650; color: var(--text); font-variant-numeric: tabular-nums; }
@keyframes grow-x { from { transform: scaleX(0); } }
.widget-body.calm .bar-fill, .widget-body.calm .slice { animation: none; }

svg.chart { display: block; max-width: 100%; overflow: visible; }
.axis-grid { stroke: var(--border); stroke-width: 1; }
.axis-base { stroke: color-mix(in srgb, var(--muted) 70%, transparent); stroke-width: 1; }
.axis-text { fill: var(--muted); font-size: 12px; font-family: var(--font); font-variant-numeric: tabular-nums; }
.mark-label { fill: var(--text); font-size: 12px; font-weight: 650; font-family: var(--font); }
.column { fill: var(--viz-1); transition: filter .15s; }
.column.lit { filter: brightness(1.2); }
.line-path { fill: none; stroke: var(--viz-1); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.line-area { fill: var(--viz-1); opacity: .1; }
.line-dot { fill: var(--viz-1); stroke: var(--surface); stroke-width: 2; }
.line-dot.hover { opacity: 0; }
.line-dot.hover.on { opacity: 1; }
.crosshair { stroke: var(--muted); stroke-width: 1; opacity: 0; }
.crosshair.on { opacity: .7; }
.hit { fill: transparent; outline: none; }
.hit.can-pick { cursor: pointer; }

.donut-wrap { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.slice { fill: none; transition: stroke-width .18s, opacity .18s; animation: slice-in .5s var(--ease) both; outline: none; }
.slice.can-pick { cursor: pointer; }
.donut.has-lit .slice:not(.lit) { opacity: .42; }
.slice.lit { stroke-width: 21; }
.donut-total { fill: var(--text); font-size: 22px; font-weight: 700; font-family: var(--font); }
@keyframes slice-in { from { opacity: 0; } }
.legend { list-style: none; flex: 1; min-width: 170px; display: flex; flex-direction: column; gap: 2px; }
.legend-row { display: grid; grid-template-columns: 14px 1fr auto auto; align-items: center; gap: 8px; padding: 4px 6px; border-radius: 8px; font-size: var(--fs-sm); outline: none; }
.legend-row.lit, .legend-row:focus-visible { background: color-mix(in srgb, var(--text) 7%, transparent); }
.legend-row.can-pick { cursor: pointer; }
.legend-key { width: 12px; height: 12px; border-radius: 3px; }
.legend-label { color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.legend-value { font-weight: 650; font-variant-numeric: tabular-nums; }
.legend-share { color: var(--muted); font-size: var(--fs-xs); font-variant-numeric: tabular-nums; min-width: 34px; text-align: right; }
.w-table .num { font-variant-numeric: tabular-nums; }


.toolbar .search-container { flex: 0 1 300px; }
.toolbar .toolbar-select { max-width: 200px; }
.row-actions { padding: 2px; }




.shelf { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.shelf .spacer { flex: 1; }

.panel-head > .shelf { display: contents; }
.panel-head > .shelf .folder-chip { padding-block: 4px; }

.panel-head.wraps { flex-wrap: wrap; row-gap: 8px; }
.panel-head.wraps > :not(.spacer):not(.shelf) { flex: none; }
.panel-head.wraps > .shelf > * { flex: none; }

.panel-head.wraps > .spacer { display: none; }
.panel-head.wraps > .segmented[hidden] { display: none; }
.head-end { margin-left: auto; flex: none; display: flex; align-items: center; gap: 8px; }
.head-end > .shelf { display: contents; }
.head-end > .shelf .folder-chip { padding-block: 4px; }
.folder-chip {
    display: inline-flex; align-items: center; gap: 6px; padding: 6px 11px; border-radius: 999px; cursor: pointer; white-space: nowrap; max-width: 220px;
    font-size: var(--fs-sm); font-weight: 600; color: var(--text-2); background: var(--surface-2); border: 1px solid var(--border);
    transition: transform .16s var(--ease), box-shadow .2s, background-color .2s, border-color .2s, color .2s, scale .18s var(--ease);
}
.folder-chip > .chip-name { overflow: hidden; text-overflow: ellipsis; }
.folder-chip svg.ic { color: var(--gold); }
.folder-chip:hover { color: var(--text); background: var(--surface-3); }
.folder-chip.on { color: var(--accent-ink); background: var(--accent); border-color: var(--accent); }
.folder-chip.on svg.ic { color: inherit; }
.chip-count { font-size: var(--fs-xs); font-variant-numeric: tabular-nums; opacity: .72; }
.folder-chip.add { border-style: dashed; background: transparent; color: var(--muted); }


.folder-chip.bin-chip { border-color: transparent; background: transparent; color: var(--muted); opacity: .6; padding-inline: 8px; transition: opacity .15s var(--ease), border-color .15s var(--ease); }
.folder-chip.bin-chip svg.ic { color: var(--muted); }
.folder-chip.bin-chip:hover, .folder-chip.bin-chip:focus-visible, .folder-chip.bin-chip.on, body.is-moving-items .folder-chip.bin-chip { opacity: 1; border-color: var(--border); }
.folder-chip.bin-chip:hover svg.ic, body.is-moving-items .folder-chip.bin-chip svg.ic { color: var(--bad); }
.folder-chip.bin-chip.on { color: var(--text); background: color-mix(in srgb, var(--bad) 16%, var(--surface)); border-color: var(--bad); }
.folder-chip.bin-chip.on svg.ic { color: var(--bad); }
.shelf-note { font-size: var(--fs-xs); color: var(--muted); }


body.is-moving-items .shelf [data-drop] { border-style: dashed; border-color: color-mix(in srgb, var(--gold) 70%, transparent); }
body.is-moving-items .shelf [data-drop="bin"] { border-color: color-mix(in srgb, var(--bad) 70%, transparent); }
[data-drop].drop-on { scale: 1.09; border-style: solid !important; border-color: var(--gold) !important; box-shadow: 0 0 0 3px color-mix(in srgb, var(--gold) 35%, transparent), 0 10px 26px rgba(0, 0, 0, .3); }
[data-drop="bin"].drop-on { border-color: var(--bad) !important; box-shadow: 0 0 0 3px color-mix(in srgb, var(--bad) 38%, transparent), 0 10px 26px rgba(0, 0, 0, .3); }
[data-drop].gulp { animation: gulp .4s var(--ease); }
@keyframes gulp { 0% { scale: 1.09; } 40% { scale: 1.22; } 100% { scale: 1; } }

.bin-ic .bin-lid { transition: transform .22s var(--ease); transform-origin: 20px 7px; }
.drop-on .bin-ic .bin-lid, .bin-chip:hover .bin-ic .bin-lid { transform: rotate(22deg) translate(1px, -1.5px); }


.dock {
    position: fixed; left: 50%; bottom: 22px; translate: -50% 0; z-index: 2500; display: flex; align-items: stretch; gap: 10px; padding: 10px;
    max-width: min(940px, calc(100vw - 32px)); border-radius: calc(var(--radius) + 6px);
    background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow);
    animation: dock-in .26s var(--ease);
}
.dock.leaving { opacity: 0; translate: -50% 16px; transition: opacity .2s, translate .2s var(--ease); }
@keyframes dock-in { from { opacity: 0; translate: -50% 26px; } }
.dock-folders { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; align-items: stretch; padding: 3px; max-height: 46vh; overflow-y: auto; scrollbar-width: none; }
.dock-target {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; flex: none; min-width: 96px; max-width: 150px; padding: 11px 12px;
    border-radius: var(--radius-sm); border: 1.5px dashed color-mix(in srgb, var(--gold) 55%, var(--border)); background: var(--surface-2);
    color: var(--text-2); font-size: var(--fs-xs); font-weight: 600; text-align: center;
    transition: scale .16s var(--ease), border-color .16s, box-shadow .2s, background-color .2s;
}
.dock-target svg.ic { width: 22px; height: 22px; color: var(--gold); }
.dock-target > span { max-width: 124px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dock-target.dock-bin { min-width: 124px; border-color: color-mix(in srgb, var(--bad) 60%, var(--border)); }
.dock-target.dock-bin svg.ic { width: 28px; height: 28px; color: var(--bad); }


.drag-ghost {
    position: fixed; left: 0; top: 0; z-index: 2600; pointer-events: none; display: flex; align-items: center; gap: 8px; padding: 9px 12px 9px 14px; max-width: 300px;
    border-radius: var(--radius-sm); background: var(--surface); color: var(--text); border: 1px solid var(--accent); font-size: var(--fs-sm); font-weight: 600; rotate: -2deg;
    box-shadow: 0 14px 34px rgba(0, 0, 0, .42), 0 0 18px color-mix(in srgb, var(--accent) 40%, transparent);
}
.drag-ghost.many { box-shadow: 5px 5px 0 -1px var(--surface-2), 5px 5px 0 0 var(--border), 0 14px 34px rgba(0, 0, 0, .42), 0 0 18px color-mix(in srgb, var(--accent) 40%, transparent); }
.ghost-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.ghost-count { flex: none; min-width: 22px; height: 22px; padding: 0 7px; border-radius: 999px; display: grid; place-items: center; background: var(--accent); color: var(--accent-ink); font-size: var(--fs-xs); font-weight: 700; font-variant-numeric: tabular-nums; }
.drag-ghost.over-bin { border-color: var(--bad); }
.drag-ghost.over-bin .ghost-count { background: var(--bad); color: var(--bg); }
.drag-ghost.dropping { transition: translate .22s var(--ease), scale .22s var(--ease), opacity .22s; scale: .25; opacity: 0; }
.drag-ghost.popping { transition: translate .14s var(--ease); animation: pop-away .26s ease-in forwards; }
.drag-ghost.back { transition: translate .3s cubic-bezier(.3, 1.4, .5, 1), opacity .3s; opacity: 0; }


.pick {
    width: 18px; height: 18px; flex: none; padding: 0; border-radius: 6px; cursor: pointer; display: inline-grid; place-items: center; vertical-align: -4px;
    border: 1.5px solid color-mix(in srgb, var(--muted) 75%, transparent); background: transparent; opacity: .4;
    transition: opacity .15s, background-color .15s, border-color .15s, scale .15s var(--ease);
}
.pick::after { content: ""; width: 9px; height: 5px; border: solid var(--accent-ink); border-width: 0 0 2px 2px; rotate: -45deg; translate: 0 -1px; opacity: 0; transition: opacity .12s; }
.pick:hover { border-color: var(--accent); }
tr:hover .pick, .ingredient-card:hover .pick, .pick:focus-visible, .picking .pick, .pick[aria-checked="true"], .pick[aria-checked="mixed"], th .pick, .panel-head .pick { opacity: 1; }
.pick[aria-checked="true"], .pick[aria-checked="mixed"] { background: var(--accent); border-color: var(--accent); scale: 1.06; }
.pick[aria-checked="true"]::after { opacity: 1; }
.pick[aria-checked="mixed"]::after { opacity: 1; width: 8px; height: 0; border-width: 0 0 2px 0; rotate: 0deg; translate: 0 0; }
@media (hover: none) { .pick { opacity: 1; } }
[data-drag] { user-select: none; -webkit-user-select: none; }
[data-drag].held { outline: 2px solid var(--gold); outline-offset: -2px; }
.lifting { opacity: .32; }
tr.is-picked > td { background: color-mix(in srgb, var(--accent) 11%, transparent); }
tr.is-picked > td:first-child { box-shadow: inset 3px 0 0 var(--accent); }
.sel-bar { margin-top: 2px; }
body.is-moving-items .sel-bar { visibility: hidden; }
.th-line { display: inline-flex; align-items: center; gap: 10px; }
.th-line .pick { vertical-align: 0; }


tr.open > td { background: color-mix(in srgb, var(--accent) 5%, transparent); border-bottom-color: transparent; }
tr.detail-row > td { padding: 0 12px 12px; background: color-mix(in srgb, var(--accent) 5%, transparent); }
.detail-box { display: flex; flex-direction: column; gap: 12px; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--surface); border: 1px solid var(--border); animation: rise .22s var(--ease); cursor: default; }
.detail-grid { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 7px 18px; font-size: var(--fs-sm); }
.detail-grid dt { color: var(--muted); font-size: var(--fs-xs); font-weight: 650; text-transform: uppercase; letter-spacing: .4px; padding-top: 2px; white-space: nowrap; }
.detail-grid dd { color: var(--text-2); min-width: 0; overflow-wrap: anywhere; line-height: 1.55; }
.detail-grid dd .chip { margin: 0 4px 4px 0; }
.detail-actions { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.detail-actions .spacer { flex: 1; }
.detail-box { user-select: text; -webkit-user-select: text; }
.row-btn.main { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.row-btn.main:hover { background: color-mix(in srgb, var(--accent) 88%, #fff); }
.row-btn svg.ic { width: 1.05em; height: 1.05em; }


.filter-chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 6px 3px 10px; border-radius: 999px; font-size: var(--fs-xs); font-weight: 600; cursor: pointer; color: var(--accent-text); background: color-mix(in srgb, var(--accent) 12%, transparent); border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent); animation: pop-back .25s var(--ease); }
.filter-chip svg.ic { width: 1em; height: 1em; }


.assist {
    display: flex; align-items: center; gap: 8px; min-height: 34px; padding: 4px 4px 4px 10px; border-radius: var(--radius-sm); font-size: var(--fs-sm); color: var(--text-2);
    background: color-mix(in srgb, var(--gold) 7%, transparent); border: 1px solid color-mix(in srgb, var(--gold) 24%, transparent);
}
.assist-icon { display: inline-grid; color: var(--gold); flex: none; }
.assist:hover .assist-icon svg.ic { animation: twinkle .7s var(--ease); }
@keyframes twinkle { 40% { transform: scale(1.3) rotate(18deg); } }
.assist[data-tone="bad"] .assist-icon { color: var(--bad); }
.assist[data-tone="warn"] .assist-icon { color: var(--warn); }
.assist[data-tone="info"] .assist-icon { color: var(--info); }
.assist[data-tone="ok"] .assist-icon { color: var(--ok); }






.assist { flex-wrap: wrap; row-gap: 4px; column-gap: 12px; padding: 6px 6px 6px 10px; }
.assist-main { display: flex; align-items: flex-start; gap: 8px; flex: 1000 1 max-content; min-width: 0; }
.assist-text { flex: 1 1 auto; min-width: min(7ch, 100%); overflow-wrap: anywhere; padding-block: 3px; }
.assist-text.swap { animation: rise .25s var(--ease); }
.assist-icon { padding-top: 4px; }
.assist-controls { display: flex; align-items: center; gap: 6px; flex: 1 0 auto; justify-content: flex-start; }
.assist-act, .assist-next, .assist-x { flex: none; }
.assist-pager { display: flex; align-items: center; gap: 2px; margin-left: auto; }
.assist-act { padding: 5px 11px; border-radius: 999px; font-size: var(--fs-xs); font-weight: 650; }
.assist-next, .assist-x { display: inline-flex; align-items: center; gap: 2px; height: 26px; padding: 0 6px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); font-size: var(--fs-xs); cursor: pointer; font-variant-numeric: tabular-nums; }
.assist-next:hover, .assist-x:hover { background: color-mix(in srgb, var(--text) 8%, transparent); color: var(--text); }
.assist-x { opacity: 0; transition: opacity .15s; }
.assist:hover .assist-x, .assist-x:focus-visible { opacity: 1; }
@media (hover: none) { .assist-x { opacity: 1; } }
.panel.bare > .panel-inner > .assist { background: color-mix(in srgb, var(--gold) 7%, var(--surface)); }
.chart-insight { display: flex; align-items: center; gap: 6px; font-size: var(--fs-xs); color: var(--text-2); }
.chart-insight svg.ic { color: var(--gold); }


.toolbar .segmented { padding: 3px; }
.toolbar .seg { padding: 6px 11px; transition: background-color .2s, color .2s, transform .16s var(--ease); }
.sort-now { color: var(--muted); font-weight: 500; }
@media (max-width: 1280px) { .sort-now { display: none; } }


.modal-content.xl { width: min(1040px, 100%); display: flex; flex-direction: column; padding: 0; overflow: hidden; }
.xl-head { display: flex; align-items: flex-start; gap: 12px; padding: 20px 24px 14px; border-bottom: 1px solid var(--border); }
.xl-titles { flex: 1; min-width: 0; }
.xl-body { flex: 1; min-height: 120px; overflow-y: auto; padding: 16px 24px; display: flex; flex-direction: column; gap: 12px; }
.xl-foot { display: flex; align-items: center; gap: 12px; padding: 12px 24px 16px; border-top: 1px solid var(--border); }
.xl-foot .spacer, .dup-bar .spacer { flex: 1; }
.modal-content.xl.is-busy .xl-body { opacity: .55; pointer-events: none; }

.plan-done, .plan-clean { font-size: var(--fs-sm); padding: 10px 12px; border-radius: var(--radius-sm); }
.plan-done { color: var(--ok); background: color-mix(in srgb, var(--ok) 10%, transparent); border: 1px solid color-mix(in srgb, var(--ok) 30%, transparent); }
.plan-clean { color: var(--text-2); background: var(--surface-2); text-align: center; }
.plan-step { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px 14px; background: var(--surface-2); }
.plan-step.careful { border-color: color-mix(in srgb, var(--warn) 45%, var(--border)); }
.plan-step.note { background: transparent; }
.plan-step.note summary { cursor: pointer; font-size: var(--fs-sm); }
.plan-head { display: flex; align-items: center; gap: 10px; }
.plan-title { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; font-size: var(--fs-base); }
.plan-toggle { display: inline-grid; place-items: center; width: 30px; height: 30px; flex: none; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--text-2); cursor: pointer; }
.plan-toggle svg.ic { transition: rotate .2s var(--ease); rotate: -90deg; }
.plan-toggle[aria-expanded="true"] svg.ic { rotate: 0deg; }
.plan-why { font-size: var(--fs-sm); color: var(--text-2); margin: 8px 0 0; line-height: 1.5; }
.plan-list { margin-top: 10px; }
.plan-list .table-container { max-height: 340px; background: var(--surface); }
.plan-table th:first-child, .plan-table td:first-child { width: 34px; padding-right: 0; }
.plan-table .chip { margin: 0; }
.plan-reason { color: var(--text-2); max-width: 40ch; }

.dup-bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.dup-slider { display: inline-flex; align-items: center; gap: 10px; font-size: var(--fs-sm); color: var(--text-2); }
.dup-slider input[type=range] { width: min(180px, 100%); accent-color: var(--accent); }
.dup-list { display: flex; flex-direction: column; gap: 12px; }
.dup-group { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px 14px; background: var(--surface-2); }
.dup-group.sure { border-color: color-mix(in srgb, var(--bad) 40%, var(--border)); }
.dup-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.dup-head .chip, .dup-title .chip { margin: 0; }
.dup-items { display: flex; flex-direction: column; gap: 6px; }
.dup-item { display: flex; align-items: flex-start; gap: 10px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); cursor: pointer; }
.dup-item.keep { border-color: var(--accent); box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 18%, transparent); }
.dup-item input[type=radio] { accent-color: var(--accent); margin-top: 3px; }
.dup-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.dup-title { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.dup-role { font-size: var(--fs-xs); font-weight: 650; color: var(--accent-text); white-space: nowrap; }
.dup-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }


.search-clear { position: absolute; right: 6px; top: 50%; translate: 0 -50%; display: inline-grid; place-items: center; width: 26px; height: 26px; border: 0; border-radius: 7px; background: transparent; color: var(--muted); cursor: pointer; }
.search-clear:hover { background: var(--surface-3); color: var(--text); }
.search-container .search-clear svg.ic { position: static; transform: none; pointer-events: auto; width: 14px; height: 14px; }
.search-container:has(.search-clear:not([hidden])) .search-input { padding-right: 36px; }
@media (max-width: 720px) { .modal-content.xl { width: 100%; } .xl-head, .xl-body, .xl-foot { padding-left: 14px; padding-right: 14px; } .plan-head { flex-wrap: wrap; } }


.import-dropbox {
    width: 100%; min-height: 88px; display: flex; align-items: center; gap: 14px; padding: 16px;
    border: 1px dashed var(--line-strong, var(--line)); border-radius: 12px; background: var(--surface-2);
    color: var(--text); text-align: left; cursor: pointer; transition: border-color .15s, background .15s;
}
.import-dropbox:hover, .import-dropbox.drag-over { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 8%, var(--surface-2)); }
.import-dropbox strong, .import-dropbox small { display: block; }
.import-dropbox small { color: var(--muted); font-size: var(--fs-xs); line-height: 1.5; margin-top: 4px; }
.import-drop-icon { color: var(--accent); display: inline-grid; flex: 0 0 auto; }
.import-status { margin: 8px 0 0; overflow-wrap: anywhere; color: var(--text-2); font-size: var(--fs-sm); line-height: 1.5; text-decoration: none; }
.import-status.error { color: var(--bad); }
.import-status:empty { display: none; }
.import-panel .import-dropbox { flex-direction: column; justify-content: center; text-align: center; min-height: 190px; padding: 22px 18px; gap: 12px; }
.import-panel .import-drop-icon svg.ic { width: 34px; height: 34px; }
.import-panel .import-dropbox strong { font-size: var(--fs-md); line-height: 1.35; }
.import-panel .import-dropbox small { font-size: var(--fs-sm); }
.import-types { margin: 10px 0 0; font-size: var(--fs-sm); font-weight: 600; color: var(--text-2); }


.tile-stack { display: flex; flex-direction: column; gap: 8px; }
.tile-pair { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; }
.tile.small { padding: 9px 12px; font-size: var(--fs-sm); }
.tile {
    flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: var(--radius-sm); text-decoration: none; color: var(--text);
    background: var(--surface-2); border: 1px solid var(--border); font-size: var(--fs-base); font-weight: 550;
    transition: transform .16s var(--ease), box-shadow .2s, background-color .2s;
}

.tile .tile-title { flex: 1; min-width: min(7ch, 100%); overflow-wrap: anywhere; line-height: 1.25; }
.tile-pair { grid-template-columns: repeat(auto-fit, minmax(min(100%, 140px), 1fr)); }
.result-legend li > span:not(.num) { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.rank-name { flex: 1; min-width: min(7ch, 100%); overflow-wrap: anywhere; }
.rank-value { flex: none; white-space: nowrap; }
.tile svg.ic:first-child { color: var(--gold); }
.tile svg.ic:last-child { color: var(--muted); }
.tile.review { border-color: color-mix(in srgb, var(--info) 45%, transparent); background: color-mix(in srgb, var(--info) 10%, var(--surface)); }
.tile.review svg.ic:first-child { color: var(--info); }
button.tile { font: inherit; font-weight: 550; text-align: left; cursor: pointer; width: 100%; }
button.tile.small { width: auto; }
.tile:hover { background: var(--surface-3); }
.tile:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }


.info-slot { display: inline-flex; vertical-align: middle; margin-left: 6px; }
.info-badge { cursor: pointer; position: relative; }
.info-badge[data-tone="bad"] { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 55%, transparent); }
.info-badge[data-tone="warn"] { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 55%, transparent); }
.info-badge[data-count]::after {
    content: attr(data-count); position: absolute; top: -8px; right: -10px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 999px;
    display: grid; place-items: center; font-size: 12px; font-weight: 700; line-height: 1; color: #fff; background: var(--accent);
}
.info-pop {
    position: fixed; z-index: 5000; width: max-content; max-width: min(340px, calc(100vw - 16px)); padding: 10px 12px; border-radius: var(--radius-sm);
    background: var(--surface-3); color: var(--text); border: 1px solid color-mix(in srgb, var(--gold) 40%, var(--border));
    box-shadow: var(--shadow); font-size: var(--fs-sm); line-height: 1.45; opacity: 0; visibility: hidden; transform: translateY(4px);
    transition: opacity .14s, transform .14s, visibility 0s .14s;
}
.info-pop.show { opacity: 1; visibility: visible; transform: none; transition: opacity .14s, transform .14s; }
.info-line { margin: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.info-line + .info-line { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--border); }
.info-line[data-tone="bad"] { color: var(--bad); }

.refresh-btn.is-blocked { opacity: .5; cursor: not-allowed; }
.refresh-btn.is-working svg.ic { animation: refresh-spin 1s linear infinite; }
@keyframes refresh-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .refresh-btn.is-working svg.ic { animation: none; } }

.toolbar.split { justify-content: space-between; }
.tool-group { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; min-width: 0; }
.tool-group.end { margin-left: auto; flex-wrap: nowrap; }



.toolbar.inv-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.inv-tools .search-container { flex: 1 1 260px; max-width: none; min-width: min(260px, 100%); }
.inv-tools .toolbar-select { flex: 0 1 180px; width: auto; max-width: 220px; min-width: 140px; }
.inv-tools .tool-group.narrow { flex: none; flex-wrap: nowrap; }
.inv-tools .tool-group.end { flex: none; margin-left: auto; justify-content: flex-end; }
@container panel (max-width: 700px) {
    .inv-tools .search-container { flex-basis: 100%; min-width: 0; }
    .inv-tools .toolbar-select { flex: 1 1 140px; max-width: none; }
}


.snapshots-chip { gap: 8px; }
.count-badge { min-width: 24px; height: 22px; padding: 0 7px; border-radius: 999px; display: inline-grid; place-items: center; font-size: var(--fs-xs); font-weight: 700;
    font-variant-numeric: tabular-nums; background: var(--surface-3); color: var(--text-2); }
.snapshots-chip.has-waiting { border-color: color-mix(in srgb, var(--accent) 55%, var(--border)); }
.snapshots-chip.has-waiting .count-badge { background: var(--accent); color: #fff; }

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }


.board.pinned > .panel[data-right] { grid-column: calc(13 - var(--w, 4)) / span var(--w, 4); }
@media (max-width: 1023px) { .board.pinned > .panel[data-right] { grid-column: span 12 !important; } }


.info-window {
    position: fixed; z-index: 4500; display: none; flex-direction: column; width: min(380px, calc(100vw - 8px)); max-height: min(70vh, 560px);
    background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden;
}
.info-window.open { display: flex; }
.info-window:focus { outline: none; }
.info-window.moving { user-select: none; box-shadow: 0 18px 44px rgba(0, 0, 0, .35); }
.iw-head {
    display: flex; align-items: center; gap: 8px; padding: 9px 10px 9px 14px; cursor: grab; touch-action: none;
    background: var(--surface-2); border-bottom: 1px solid var(--border);
}
.info-window.moving .iw-head { cursor: grabbing; }
.iw-head:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.iw-title { flex: 1; min-width: 0; font-size: var(--fs-base); font-weight: 650; }
.iw-count { min-width: 20px; padding: 1px 7px; border-radius: 999px; text-align: center; font-size: var(--fs-xs); font-weight: 700; color: var(--text-2); background: var(--surface-3); }
.info-window[data-serious="1"] .iw-count { color: #fff; background: var(--bad); }
.iw-list { list-style: none; margin: 0; padding: 0; overflow-y: auto; }
.iw-row { display: flex; align-items: flex-start; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--border); border-left: 3px solid transparent; }
.iw-row:last-child { border-bottom: 0; }
.iw-row[data-tone="bad"] { border-left-color: var(--bad); background: color-mix(in srgb, var(--bad) 9%, transparent); }
.iw-row[data-tone="warn"] { border-left-color: var(--warn); background: color-mix(in srgb, var(--warn) 8%, transparent); }
.iw-row[data-tone="info"] { border-left-color: var(--info); }
.iw-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.iw-tag { font-size: 12px; font-weight: 700; letter-spacing: .5px; text-transform: uppercase; color: var(--muted); }
.iw-row[data-tone="bad"] .iw-tag { color: var(--bad); }
.iw-row[data-tone="warn"] .iw-tag { color: var(--warn); }
.iw-row[data-tone="info"] .iw-tag { color: var(--info); }
.iw-text { margin: 0; font-size: var(--fs-sm); line-height: 1.45; overflow-wrap: anywhere; }
.iw-row[data-tone="bad"] .iw-text { font-weight: 600; }
.iw-row .row-btn { flex: none; align-self: center; white-space: nowrap; }
@container panel (max-width: 480px) { .iw-row { flex-wrap: wrap; } .iw-row .row-btn { align-self: flex-start; } }


.shade-item { gap: 6px; padding: 3px 6px 3px 4px; }
.shade-swatch { position: relative; flex: none; width: 26px; height: 26px; border-radius: 50%; overflow: hidden; border: 1px solid var(--border); cursor: pointer; }
.shade-item .shade-picker { position: absolute; inset: -6px; width: 40px; height: 40px; opacity: 0; cursor: pointer; border: 0; padding: 0; }
.shade-item .shade-hex { width: 92px; padding: 4px 6px; font: 12px/1.2 ui-monospace, Consolas, monospace; border-radius: 8px; }
.shade-item .shade-code { width: 72px; padding: 4px 6px; font: 12px/1.2 ui-monospace, Consolas, monospace; border-radius: 8px; text-transform: uppercase; }
.shade-item button:disabled { opacity: .3; cursor: default; }
.shade-item.shade-new { border-style: dashed; border-color: color-mix(in srgb, var(--accent) 50%, var(--border)); }
.shade-msg { flex-basis: 100%; color: var(--bad); }

.shade-strip { display: flex; flex-wrap: wrap; gap: 8px; width: 100%; max-height: 440px; overflow-y: auto; overscroll-behavior-y: contain; padding: 2px 6px 2px 2px; scrollbar-width: thin; }
.shade-strip .shade-item { flex: none; }
.shade-strip + .field-hint { flex-basis: 100%; }


.field-label .list-edit { width: 22px; height: 22px; margin-left: 6px; vertical-align: middle; }
.field-label .list-edit svg.ic { width: 13px; height: 13px; }
.lists-box { width: min(760px, 100%); }
.lists-rows { list-style: none; margin: 8px 0 12px; padding: 0; display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: var(--radius-sm); max-height: 46vh; overflow-y: auto; }
.lists-row { display: grid; grid-template-columns: auto minmax(0, 1fr) 120px auto; gap: 10px; align-items: center; padding: 8px 10px; border-bottom: 1px solid var(--border); }
.lists-row:last-child { border-bottom: 0; }
.lists-row.retired { opacity: .6; background: color-mix(in srgb, var(--text) 4%, transparent); }
.lists-move { display: inline-flex; flex-direction: column; gap: 2px; }
.lists-move .icon-btn { width: 22px; height: 18px; border-radius: 6px; }
.lists-move .icon-btn svg.ic { width: 12px; height: 12px; }
.lists-mid { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.lists-mid input { width: 100%; min-width: 0; }
.lists-label { font-weight: 600; }
.lists-keys { font-size: var(--fs-xs); }
.lists-meta { display: flex; flex-direction: column; gap: 2px; font-size: var(--fs-xs); color: var(--muted); min-width: 0; }
.lists-meta code { overflow: hidden; text-overflow: ellipsis; }
.lists-actions { display: inline-flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.lists-add { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.lists-add input { flex: 1 1 180px; min-width: 0; }
.lists-add-note, .lists-note { min-height: 1.2em; margin: 6px 0 0; }
@container panel (max-width: 640px) { .lists-row { grid-template-columns: auto minmax(0, 1fr); } .lists-meta, .lists-actions { grid-column: 2; flex-direction: row; justify-content: flex-start; gap: 10px; } }


.ing-search { position: relative; }
.ing-search input { width: 100%; }
.ing-results { position: absolute; z-index: 20; left: 0; right: 0; top: calc(100% + 4px); margin: 0; padding: 4px; list-style: none; max-height: 260px; overflow-y: auto;
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); box-shadow: var(--shadow); }
.ing-result { display: flex; align-items: baseline; gap: 10px; padding: 8px 10px; border-radius: 8px; cursor: pointer; font-size: var(--fs-sm); }
.ing-result.active, .ing-result:hover { background: color-mix(in srgb, var(--accent) 10%, transparent); }
.ing-result-name { font-weight: 600; }
.ing-result-tech { color: var(--muted); font-size: var(--fs-xs); font-style: italic; }
.ing-result.none { cursor: default; color: var(--muted); }
.ing-result.none:hover { background: none; }
.ing-result.create { color: var(--accent-text); font-weight: 650; border-top: 1px solid var(--border); border-radius: 0 0 8px 8px; margin-top: 2px; }
.ing-pills { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; min-height: 4px; }
.ing-pill { display: inline-flex; align-items: center; gap: 2px; padding: 2px 4px 2px 10px; border-radius: 999px; font-size: var(--fs-sm); border: 1px solid var(--border); background: var(--surface-2); }
.ing-pill.linked { border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); background: color-mix(in srgb, var(--accent) 9%, var(--surface-2)); }
.ing-pill.unlinked { border-style: dashed; color: var(--text-2); }
.ing-pill-name { background: none; border: 0; padding: 2px 2px; font: inherit; color: inherit; }
button.ing-pill-name { cursor: pointer; text-decoration: underline dotted; }
.ing-pill-x, .ing-pill-note { background: none; border: 0; padding: 0 5px; cursor: pointer; color: var(--muted); font-size: 14px; line-height: 1; }
.ing-pill-note { font-size: 12px; opacity: .55; }
.ing-pill-note.has { opacity: 1; color: var(--gold); }
.ing-pill-x:hover { color: var(--bad); }
.ing-pill-note:hover { color: var(--text); }


.facet-panel { position: fixed; z-index: 3500; width: min(320px, calc(100vw - 16px)); padding: 14px; display: flex; flex-direction: column; gap: 12px;
    background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.facet-title { margin: 0; font-size: var(--fs-md); }
.facet-field { display: flex; flex-direction: column; gap: 6px; }
.facet-label { font-size: var(--fs-xs); font-weight: 650; color: var(--text-2); }
.facet-checks { display: flex; flex-direction: column; gap: 6px; }
.facet-actions { display: flex; justify-content: flex-end; gap: 8px; }
.btn.on { border-color: var(--accent); color: var(--accent-text); }


.snapshots-open {
    display: flex; align-items: center; gap: 12px; width: 100%; padding: 14px; border-radius: var(--radius-sm); cursor: pointer; text-align: left;
    background: var(--surface-2); border: 1px solid var(--border); color: var(--text); font: inherit;
    transition: border-color .2s, background-color .2s, transform .16s var(--ease);
}
.snapshots-open:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); }
.snapshots-open:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.snapshots-open.has-waiting { border-color: color-mix(in srgb, var(--accent) 55%, var(--border)); background: color-mix(in srgb, var(--accent) 7%, var(--surface-2)); }
.snapshots-icon { display: grid; place-items: center; width: 40px; height: 40px; flex: none; border-radius: 12px; color: var(--accent-text); background: color-mix(in srgb, var(--accent) 14%, transparent); }
.snapshots-icon svg.ic { width: 22px; height: 22px; }
.snapshots-text { display: flex; flex-direction: column; gap: 3px; flex: 1; min-width: 0; }
.snapshots-text strong { font-size: var(--fs-base); }
.snapshots-text small { font-size: var(--fs-xs); color: var(--muted); line-height: 1.4; }
.snapshots-count { flex: none; min-width: 34px; height: 30px; padding: 0 10px; border-radius: 999px; display: grid; place-items: center; font-weight: 700; font-variant-numeric: tabular-nums;
    background: var(--surface-3); color: var(--text-2); }
.snapshots-open.has-waiting .snapshots-count { background: var(--accent); color: #fff; }


body.snapx-open { overflow: hidden; }
.snapx-overlay { position: fixed; inset: 0; z-index: 2500; display: grid; place-items: center; padding: 20px;
    background: color-mix(in srgb, #140c0e 68%, transparent); opacity: 0; transition: opacity .2s; }
.snapx-overlay.show { opacity: 1; }
.snapx-window { width: min(1040px, 100%); max-height: calc(100vh - 40px); display: flex; flex-direction: column; overflow: hidden;
    background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: 0 10px 30px rgba(0, 0, 0, .22);
    transform: translateY(10px) scale(.985); transition: transform .22s var(--ease); }
.snapx-overlay.show .snapx-window { transform: none; }
.snapx-top { display: flex; align-items: center; gap: 12px; padding: 14px 18px 10px; }
.snapx-title { margin: 0; font-size: var(--fs-md); flex: 1; min-width: 0; }
.snapx-progress { font-size: var(--fs-sm); font-weight: 650; color: var(--text-2); font-variant-numeric: tabular-nums; }
.snapx-bar { height: 4px; margin: 0 18px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.snapx-fill { display: block; height: 100%; width: 100%; background: var(--accent); transform: scaleX(0); transform-origin: left center; transition: transform .2s ease-out; }
.snapx-stage { padding: 16px 18px 18px; overflow-y: auto; min-height: 280px; }
.snapx-loading { padding: 40px; text-align: center; color: var(--muted); }
.snapx-card { display: grid; grid-template-columns: minmax(0, 340px) minmax(0, 1fr); grid-template-areas: "left right" "actions actions"; gap: 16px 20px;
    transition: transform .32s var(--ease), opacity .32s var(--ease); }
.snapx-card.enter { transform: translateX(36px); opacity: 0; }
.snapx-card.enter-back { transform: translateX(-36px); opacity: 0; }
.snapx-card.leaving-ok { transform: translateX(-60px) scale(.98); opacity: 0; }
.snapx-card.leaving-out { transform: translateY(24px) scale(.98); opacity: 0; }
.snapx-left { grid-area: left; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.snapx-photo { aspect-ratio: 3 / 4; border-radius: var(--radius-sm); background: var(--surface-3); display: grid; place-items: center; overflow: hidden;
    color: var(--muted); font-size: var(--fs-sm); text-align: center; padding: 10px; border: 1px solid var(--border); }
.snapx-photo img { width: 100%; height: 100%; object-fit: contain; }
.snapx-caption { margin: 0; font-size: var(--fs-xs); color: var(--muted); }
.snapx-ocr { font-size: var(--fs-xs); color: var(--text-2); }
.snapx-ocr summary { cursor: pointer; }
.snapx-ocr-text { margin-top: 4px; max-height: 160px; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; font: inherit; padding: 8px; border-radius: var(--radius-sm); background: var(--surface-2); }
.snapx-right { grid-area: right; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.snapx-summary { display: flex; align-items: flex-start; gap: 8px; padding: 10px 12px; border-radius: var(--radius-sm); font-size: var(--fs-sm); line-height: 1.4; }
.snapx-summary.ok { background: color-mix(in srgb, var(--ok) 12%, transparent); color: var(--text); }
.snapx-summary.check { background: color-mix(in srgb, var(--warn) 14%, transparent); color: var(--text); }
.snapx-fields { display: flex; flex-direction: column; gap: 10px; }
.snapx-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.snapx-field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.snapx-field-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.snapx-field-head label { font-size: var(--fs-xs); font-weight: 650; color: var(--text-2); }
.snapx-field input, .snapx-field select, .snapx-field textarea { width: 100%; min-width: 0; }
.snapx-field input[readonly], .snapx-field textarea[readonly], .snapx-field select:disabled { background: var(--surface-2); color: var(--text); opacity: 1; cursor: default; }
.snapx-card.editing .snapx-field input, .snapx-card.editing .snapx-field select { outline: 1px solid color-mix(in srgb, var(--accent) 35%, transparent); }
.snapx-cue { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 650; white-space: nowrap; }
.snapx-cue.ok { color: var(--ok); background: color-mix(in srgb, var(--ok) 13%, transparent); }
.snapx-cue.check { color: var(--warn); background: color-mix(in srgb, var(--warn) 15%, transparent); }
.snapx-cue-icon { display: inline-grid; place-items: center; }
.snapx-cue-icon svg.ic { width: 13px; height: 13px; }
.snapx-summary .snapx-cue-icon svg.ic { width: 16px; height: 16px; }
.snapx-summary.ok .snapx-cue-icon { color: var(--ok); }
.snapx-summary.check .snapx-cue-icon { color: var(--warn); }
.snapx-shade { display: flex; align-items: center; gap: 8px; }
.snapx-swatch { width: 26px; height: 26px; flex: none; border-radius: 50%; border: 1px solid var(--border); }
.snapx-pills { display: flex; flex-wrap: wrap; gap: 6px; max-height: 150px; overflow-y: auto; padding: 2px; }
.snapx-pill { padding: 3px 10px; border-radius: 999px; font-size: var(--fs-xs); border: 1px solid var(--border); background: var(--surface-2); }
.snapx-pill.safe { border-color: color-mix(in srgb, var(--ok) 50%, transparent); background: color-mix(in srgb, var(--ok) 10%, transparent); }
.snapx-pill.caution { border-color: color-mix(in srgb, var(--warn) 55%, transparent); background: color-mix(in srgb, var(--warn) 12%, transparent); }
.snapx-pill.harmful { border-color: color-mix(in srgb, var(--bad) 55%, transparent); background: color-mix(in srgb, var(--bad) 12%, transparent); font-weight: 650; }
.snapx-pill.new { border-style: dashed; color: var(--text-2); }
.snapx-badge { margin: 0; width: fit-content; padding: 3px 10px; border-radius: 999px; font-size: var(--fs-xs); font-weight: 600; color: var(--text); border: 1px dashed color-mix(in srgb, var(--warn) 70%, transparent); background: color-mix(in srgb, var(--warn) 10%, transparent); }
.snapx-extra { display: flex; flex-direction: column; gap: 6px; }

.snapx-web { display: flex; flex-direction: column; gap: 10px; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 14px; background: var(--surface-2); }
.snapx-web > summary { cursor: pointer; font-weight: 600; min-height: 44px; display: flex; align-items: center; }
.snapx-web[open] > summary { margin-bottom: 6px; }
.snapx-web textarea { width: 100%; resize: vertical; min-height: 4.5em; box-sizing: border-box; }
.snapx-stack { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.snapx-link { font-size: var(--fs-sm); overflow-wrap: anywhere; }
.snapx-none { color: var(--muted); }
.snapx-details, .snapx-sources { margin: 0; font-size: var(--fs-sm); color: var(--muted); overflow-wrap: anywhere; }
.snapx-sources a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.snapx-sources a:focus-visible { outline: 2px solid var(--focus, currentColor); outline-offset: 2px; }
.snapx-similar { margin: 0; padding: 8px 10px; border-radius: var(--radius-sm); font-size: var(--fs-sm); line-height: 1.4; background: color-mix(in srgb, var(--warn) 14%, transparent); color: var(--text); }
.snapx-legend { margin: 0; font-size: var(--fs-xs); color: var(--muted); }
.snapx-error { margin: 0; min-height: 1.2em; color: var(--bad); font-size: var(--fs-sm); }
.snapx-actions { grid-area: actions; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding-top: 12px; border-top: 1px solid var(--border); }
.snapx-actions .spacer { flex: 1; }
.snapx-nav { display: inline-flex; gap: 6px; }
.snapx-empty { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 36px 16px; text-align: center; }
.snapx-empty-mark { display: grid; place-items: center; width: 64px; height: 64px; border-radius: 50%; color: var(--ok); background: color-mix(in srgb, var(--ok) 14%, transparent); }
.snapx-empty-mark svg.ic { width: 32px; height: 32px; }
.snapx-empty-title { margin: 0; font-size: var(--fs-lg); font-weight: 700; }
.snapx-empty-text { margin: 0 0 8px; color: var(--text-2); max-width: 460px; }
@media (max-width: 760px) {
    .snapx-card { grid-template-columns: 1fr; grid-template-areas: "left" "right" "actions"; }
    .snapx-photo { aspect-ratio: 4 / 3; }
    .snapx-pair { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
    .snapx-overlay, .snapx-window, .snapx-card, .snapx-fill { transition: none; }
}

body.snapx-open .modal-overlay { z-index: 3000; }



.topbar-controls > .search-container { height: 36px; flex: 1 1 260px; max-width: 520px; min-width: min(160px, 100%); margin: 0; }
.topbar-controls > .search-container .search-input { height: 36px; }
.topbar-tools .tool-group.end { margin-left: 0; flex-wrap: nowrap; }

.toolbar.inv-tools { flex-wrap: nowrap; }
.inv-tools .toolbar-select { flex: 1 1 200px; max-width: 320px; min-width: 120px; }

.table-tools { display: inline-flex; align-items: center; gap: 8px; flex-wrap: nowrap; }
.table-tools .btn { padding-block: 5px; white-space: nowrap; }

.panel-head .head-select { width: auto; max-width: 180px; height: calc(var(--fs-base) * 1.1 + 12px); padding-block: 0; line-height: 1.1; font-weight: 550; background: var(--surface-2); }

.pager-range { display: none; }

.notes-list { display: flex; flex-direction: column; gap: 8px; }
.note-row { display: flex; align-items: center; gap: 12px; padding: 8px 12px; border-radius: var(--radius-sm); background: var(--surface-2);
    border-left: 4px solid var(--border); }
.note-level { flex: none; min-width: 58px; text-align: center; padding: 2px 8px; border-radius: 999px; font-size: var(--fs-xs); font-weight: 700; letter-spacing: .02em;
    background: var(--surface-3); color: var(--text-2); }
.note-text { flex: 1; min-width: 0; font-size: var(--fs-sm); line-height: 1.45; }
.note-act { flex: none; white-space: nowrap; }
.note-row[data-tone="bad"] { border-left-color: var(--bad); background: color-mix(in srgb, var(--bad) 9%, var(--surface-2)); }
.note-row[data-tone="bad"] .note-level { background: var(--bad); color: var(--bg); }
.note-row[data-tone="warn"] { border-left-color: var(--warn); background: color-mix(in srgb, var(--warn) 9%, var(--surface-2)); }
.note-row[data-tone="warn"] .note-level { background: var(--warn); color: var(--bg); }
.note-row[data-tone="info"] { border-left-color: var(--info); background: color-mix(in srgb, var(--info) 8%, var(--surface-2)); }
.note-row[data-tone="info"] .note-level { background: var(--info); color: var(--bg); }
.note-row[data-tone="ok"] { border-left-color: var(--ok); }
.note-row[data-tone="ok"] .note-level { background: color-mix(in srgb, var(--ok) 22%, transparent); color: var(--ok); }
.note-row[data-tone=""] .note-text { color: var(--muted); }
@container panel (max-width: 700px) { .note-row { flex-wrap: wrap; } .note-text { flex-basis: 100%; order: 3; } }


.topbar-controls > .header-tabs { flex: none; padding-block: 0; height: 36px; }
.topbar-controls > .header-tabs .seg { padding-block: 0; height: 30px; align-self: center; }
.topbar.has-tabs .topbar-controls > .search-container { order: 0; flex: 0 1 300px; max-width: none; min-width: 0; margin: 0; overflow: hidden; }
.topbar.has-tabs .topbar-controls > .search-container .search-input { height: 36px; padding-block: 0; }

@media (max-width: 900px) { .topbar-controls > .header-tabs .seg svg.ic, .topbar-controls > .header-tabs .tab-count { display: none; } }


.combo { position: relative; }
.combo-native { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.combo-btn {
    display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; min-height: 40px; padding: 8px 12px; cursor: pointer;
    background: var(--surface-2); color: var(--text); border: 1px solid var(--border); border-radius: var(--radius-sm); font: inherit; text-align: left;
}
.combo-btn:hover { background: var(--surface-3); }
.combo-btn:focus-visible, .combo-btn[aria-expanded="true"] { outline: 2px solid var(--accent); outline-offset: 1px; }
.combo-btn.is-placeholder .combo-label { color: var(--muted); }
.combo-caret { flex: none; width: 8px; height: 8px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg) translateY(-2px); }
.combo-pop {
    position: fixed; z-index: 5000; display: flex; flex-direction: column; overflow: hidden; outline: none;
    background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: var(--radius-sm); box-shadow: var(--shadow);
}
.combo-pop[hidden] { display: none; }
.combo-filter { flex: none; margin: 6px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--bg); color: var(--text); font: inherit; }
.combo-filter[hidden] { display: none; }
.combo-filter:focus { outline: 2px solid var(--accent); outline-offset: 0; }
.combo-list { list-style: none; margin: 0; padding: 4px; overflow: auto; min-height: 0; }
.combo-item { padding: 8px 10px; border-radius: 8px; cursor: pointer; }
.combo-item.active, .combo-item:hover:not([aria-disabled="true"]) { background: color-mix(in srgb, var(--accent) 22%, var(--surface)); }
.combo-item[aria-selected="true"] { background: color-mix(in srgb, var(--accent) 34%, var(--surface)); font-weight: 600; }
.combo-item[aria-disabled="true"] { color: var(--muted); opacity: .6; cursor: default; }
.combo-item.is-add { color: var(--accent); font-weight: 600; }
.combo-sep { height: 1px; margin: 4px 6px; background: var(--border); }
.combo-none { padding: 10px; color: var(--muted); font-size: var(--fs-sm); }



.panel[data-panel-bg] { background: var(--panel-bg); }
.panel[data-card-bg] > .panel-inner { --surface: var(--card-bg); --surface-2: var(--card-bg); }
.panel[data-pscale] {
    --fs-xs: max(12px, calc(12px * var(--scale) * var(--pscale)));
    --fs-sm: max(12px, calc(var(--t-sm) * var(--scale) * var(--pscale)));
    --fs-base: max(12px, calc(var(--t-base) * var(--scale) * var(--pscale)));
    --fs-md: max(12px, calc(var(--t-md) * var(--scale) * var(--pscale)));
    --fs-kpi: calc(clamp(24px, 1.6vw + 14px, 30px) * var(--scale) * var(--pscale));
}
.panel-subtitle-text { margin: -6px 0 0; font-size: var(--fs-sm); color: var(--muted); line-height: 1.4; overflow-wrap: anywhere; }
.panel-note { margin: 0; padding: 8px 12px; border-radius: var(--radius-sm); background: color-mix(in srgb, var(--accent) 7%, transparent);
    border-left: 3px solid color-mix(in srgb, var(--accent) 55%, transparent); font-size: var(--fs-sm); color: var(--text-2); line-height: 1.45; white-space: pre-line; overflow-wrap: anywhere; }

.board:not(.settled) > .panel[data-anim="none"] { animation: none; }
.board:not(.settled) > .panel[data-anim="fade"] { animation-name: p-fade; }
.board:not(.settled) > .panel[data-anim="zoom"] { animation-name: p-zoom; }
.board:not(.settled) > .panel[data-anim="pop"] { animation-name: p-pop; animation-duration: .45s; }
.board:not(.settled) > .panel[data-anim="left"] { animation-name: p-left; }
.board:not(.settled) > .panel[data-anim="right"] { animation-name: p-right; }
.board:not(.settled) > .panel[data-anim="drop"] { animation-name: p-drop; }
.board:not(.settled) > .panel[data-anim="flip"] { animation-name: p-flip; }
.board:not(.settled) > .panel[data-anim="blur"] { animation-name: p-blur; }
@keyframes p-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes p-zoom { from { opacity: 0; transform: scale(.92); } to { opacity: 1; transform: none; } }
@keyframes p-pop { 0% { opacity: 0; transform: scale(.9); } 70% { opacity: 1; transform: scale(1.03); } 100% { opacity: 1; transform: none; } }
@keyframes p-left { from { opacity: 0; transform: translateX(-26px); } to { opacity: 1; transform: none; } }
@keyframes p-right { from { opacity: 0; transform: translateX(26px); } to { opacity: 1; transform: none; } }
@keyframes p-drop { from { opacity: 0; transform: translateY(-18px); } to { opacity: 1; transform: none; } }
@keyframes p-flip { from { opacity: 0; transform: perspective(900px) rotateX(-14deg); } to { opacity: 1; transform: none; } }
@keyframes p-blur { from { opacity: 0; filter: blur(6px); } to { opacity: 1; filter: none; } }

.panel[data-edge="off"]::before { display: none; }
.panel[data-edge="always"]::before { opacity: .85; background: conic-gradient(from var(--spin), transparent 0 68%, var(--gold) 84%, var(--accent) 93%, transparent 100%); animation: edge-light 5s linear infinite; }

.panel[data-trans] :is(button, a, .fx, .kpi, .stat, .w-tile, .w-card, .w-item, .rank-item, .activity-item, .bar-row, .bar-fill, .row-btn, .chip) { transition-timing-function: var(--p-ease, var(--ease)); }
.panel[data-trans="quick"] :is(button, a, .fx, .kpi, .stat, .w-tile, .w-card, .w-item, .rank-item, .activity-item, .bar-row, .bar-fill, .row-btn, .chip) { transition-duration: .08s !important; }
.panel[data-trans="slow"] :is(button, a, .fx, .kpi, .stat, .w-tile, .w-card, .w-item, .rank-item, .activity-item, .bar-row, .bar-fill, .row-btn, .chip) { transition-duration: .5s !important; }
.panel[data-trans="springy"] { --p-ease: cubic-bezier(.34, 1.56, .64, 1); }
.panel[data-trans="none"] :is(button, a, .fx, .kpi, .stat, .w-tile, .w-card, .w-item, .rank-item, .activity-item, .bar-row, .bar-fill, .row-btn, .chip) { transition: none !important; }

.panel[data-orient="row"] :is(.kpi-row, .stat-row) { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); }
.panel[data-orient="row"] :is(.kpi-row, .stat-row) > :last-child:nth-child(odd) { grid-column: auto; }
.panel[data-orient="column"] :is(.kpi-row, .stat-row) { grid-template-columns: minmax(0, 1fr); grid-auto-flow: row; }
.panel[data-orient="column"] :is(.kpi-row, .stat-row) > :last-child:nth-child(odd) { grid-column: auto; }
@container panel (max-width: 520px) {
    .panel[data-orient="row"] :is(.kpi-row, .stat-row) { grid-auto-flow: row; grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.style-dialog .form-section + .form-section { margin-top: 4px; }
.style-dialog .contrast-note { min-height: 1.4em; }
.style-dialog .contrast-note.warn { color: var(--warn); }
.style-dialog input[type=color] { width: 44px; height: 30px; padding: 2px; border: 1px solid var(--border); border-radius: 8px; background: none; cursor: pointer; }
.style-dialog .colour-row { display: flex; flex-wrap: wrap; gap: 10px 16px; }
.style-dialog .colour-row label { display: inline-flex; align-items: center; gap: 8px; font-size: var(--fs-sm); }
.style-dialog .colour-row .row-btn { padding: 2px 8px; }
.undo-row { display: flex; gap: 8px; flex-wrap: nowrap; }
.undo-row .btn { flex: 1 1 0; min-width: 0; padding-inline: 8px; white-space: nowrap; justify-content: center; }
.sd-play { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; margin: 4px 0 12px; }
@media (prefers-reduced-motion: reduce) { .panel[data-edge="always"]::before { animation: none; } }

.modal-overlay.style-overlay { justify-content: flex-end; align-items: stretch; padding: 0; background: color-mix(in srgb, #000 10%, transparent); }
.style-overlay .style-dialog { width: min(460px, 100%); height: 100%; max-height: none; border-radius: 0; border-width: 0 0 0 1px; animation: slide-in .22s var(--ease); }
.style-dialog .modal-actions { position: sticky; bottom: -24px; z-index: 2; margin: 16px -24px -24px; padding: 12px 24px; background: var(--surface); border-top: 1px solid var(--border); flex-wrap: wrap; }
.style-dialog .modal-actions .spacer { flex: 1; }
.panel.style-target { outline: 2px solid var(--gold); outline-offset: 3px; }
@media (max-width: 767px) {
    .modal-overlay.style-overlay { align-items: flex-end; }
    .style-overlay .style-dialog { width: 100%; height: 62vh; border-radius: var(--radius) var(--radius) 0 0; border-width: 1px 0 0; }
}


.import-drop-holder { position: relative; }
.import-drop-holder > .import-dropbox { width: 100%; }

.import-cover { position: absolute; inset: 0; z-index: 2; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 14px;
    border-radius: var(--radius); background: var(--surface); border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--border));
    text-align: center; animation: p-fade .2s var(--ease); }
.import-cover-text { font-weight: 650; font-size: var(--fs-base); color: var(--text); overflow-wrap: anywhere; }
.import-cover-sub { font-size: var(--fs-sm); color: var(--text-2); line-height: 1.45; min-height: 1.45em; max-width: 46ch; overflow-wrap: anywhere; }
.import-cover-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 4px; }
.import-spinner { width: 26px; height: 26px; border-radius: 50%; border: 3px solid color-mix(in srgb, var(--accent) 22%, transparent); border-top-color: var(--accent); animation: spin .9s linear infinite; }
.import-cover.ready .import-spinner { animation: none; border-color: var(--ok); background: color-mix(in srgb, var(--ok) 14%, transparent); }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .import-spinner { animation-duration: 2.5s !important; } }

.import-check { height: min(860px, 100%); }
.import-check .xl-head .icon-btn { margin-left: auto; }
.ic-head-text { min-width: 0; }
.ic-head-text h3 { overflow-wrap: anywhere; }
.ic-tabs { margin: 10px 24px 0; flex-wrap: wrap; align-self: flex-start; }
.ic-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; position: sticky; top: -16px; z-index: 1; margin: -16px -24px 0; padding: 10px 24px; background: var(--surface); border-bottom: 1px solid var(--border); }
.ic-pager { display: inline-flex; align-items: center; gap: 6px; margin-left: auto; font-size: var(--fs-sm); color: var(--text-2); }
.ic-row { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 12px; background: var(--surface-2); container: icrow / inline-size; }
.ic-row.off { opacity: .55; }
.ic-row.off .ic-fields { display: none; }
.ic-row-head { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; cursor: pointer; }
.ic-row-head b { overflow-wrap: anywhere; }
.ic-fields { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 8px 12px; margin-top: 8px; }
.ic-fields .field.wide { grid-column: 1 / -1; }
.ic-fields textarea, .ic-fields input, .ic-fields select { width: 100%; min-width: 0; }
.ic-text { width: 100%; min-height: 50vh; font-family: Consolas, "Courier New", monospace; font-size: var(--fs-sm); line-height: 1.5; }
.import-check .xl-foot { flex-wrap: wrap; }
.ic-notes { flex: 1 1 260px; min-width: 0; overflow-wrap: anywhere; }
@media (max-width: 720px) { .ic-tabs { margin-left: 14px; margin-right: 14px; } .ic-bar { margin-left: -14px; margin-right: -14px; padding-left: 14px; padding-right: 14px; } }

@media (max-width: 480px) { .toast-host { left: 12px; right: 12px; bottom: 12px; max-width: none; } }

body:has(> .modal-overlay[style*="flex"]) .toast-host { bottom: 96px; }


@container panel (max-width: 1150px) {
    .panel-head .pager .page-long { display: none; }
    .panel-head .pager .page-short { display: inline; }
    .panel-head .pager { gap: 4px; }
    .panel-head .pager .btn-group { padding: 2px; }
    .panel-head .pager .icon-btn { width: 24px; height: 24px; }
    .panel-head .pager .page-now { min-width: 0; padding-inline: 4px; white-space: nowrap; font-variant-numeric: tabular-nums; }
    .panel-head .sort-now { display: none; }
}


@container panel (max-width: 900px) {
    .panel-head .table-tools .btn-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
    .panel-head .table-tools .btn { padding-inline: 9px; gap: 0; }
    .panel-head .folder-chip.add .chip-name { display: none; }
    .panel-head .folder-chip.add { padding-inline: 8px; }
}



:root { --z-layer: 1000; --z-layer-top: 1100; }
.kb-layer { z-index: var(--z-layer); }
.kb-layer.kb-top { align-items: flex-start; padding-top: min(12vh, 96px); }

.kb-combo { display: inline-flex; align-items: center; gap: 3px; flex: none; white-space: nowrap; vertical-align: middle; }
.kb-key { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 6px; border: 1px solid var(--border); border-bottom-width: 2px;
    border-radius: 6px; background: var(--surface-2); color: var(--text); font: 600 var(--fs-xs)/1 var(--font); font-variant-numeric: tabular-nums; }
.kb-combo.is-partial .kb-key { border-style: dashed; }
.kb-dots { color: var(--muted); font-size: var(--fs-xs); padding-left: 2px; }

@media (hover: none) and (pointer: coarse) { .kb-hint, .menu-item .kb-combo { display: none; } }


.keys-view { display: flex; flex-direction: column; gap: 12px; }
.keys-view[hidden] { display: none; }
.kb-actions .btn { flex: 1 1 0; min-width: 0; white-space: nowrap; justify-content: center; }
.kb-group { display: flex; flex-direction: column; gap: 6px; }
.kb-row { display: flex; align-items: flex-start; gap: 10px; padding: 10px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); }
.kb-row.is-off { opacity: .62; }
.kb-row.is-loading .kb-row-main { gap: 8px; }
.kb-row-main { flex: 1 1 auto; min-width: min(10ch, 100%); display: flex; flex-direction: column; gap: 4px; }
.kb-row-head { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.kb-action { font-size: var(--fs-sm); font-weight: 600; max-width: 100%; overflow-wrap: break-word; }
.kb-desc { margin: 0; font-size: var(--fs-xs); color: var(--muted); line-height: 1.4; overflow-wrap: break-word;
    display: -webkit-box; -webkit-line-clamp: 3; line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.kb-flag { margin: 0; display: flex; gap: 6px; align-items: flex-start; font-size: var(--fs-xs); color: var(--warn); line-height: 1.4; }
.kb-flag svg.ic, .kb-note svg.ic, .kb-msg > svg.ic { width: 15px; height: 15px; flex: none; margin-top: 1px; }
.kb-row-tools { display: flex; align-items: center; gap: 4px; flex: none; }
.kb-row-tools .switch { margin-right: 4px; }
.kb-empty-group { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 10px; border: 1px dashed var(--border); border-radius: var(--radius-sm); }
.kb-note { display: flex; align-items: flex-start; gap: 8px; padding: 8px 10px; border-radius: var(--radius-sm); font-size: var(--fs-sm); line-height: 1.45; }
.kb-note > span { flex: 1; min-width: 0; }
.kb-note.warn { color: var(--text); background: color-mix(in srgb, var(--warn) 12%, var(--surface)); border: 1px solid color-mix(in srgb, var(--warn) 40%, transparent); }
.kb-note.bad { color: var(--text); background: color-mix(in srgb, var(--bad) 10%, var(--surface)); border: 1px solid color-mix(in srgb, var(--bad) 40%, transparent); }
.kb-note.warn svg.ic { color: var(--warn); } .kb-note.bad svg.ic { color: var(--bad); }


.kb-modal { width: min(620px, 100%); max-height: 100%; }
.kb-modal .xl-body { min-height: 0; }
.kb-help { width: min(560px, 100%); }
.kb-palette { width: min(600px, 100%); max-height: min(560px, 100%); }
.kb-form.modal-form { margin-top: 0; }
.kb-record { display: flex; align-items: center; gap: 8px; width: 100%; min-height: 44px; padding: 8px 12px; text-align: left; cursor: pointer;
    border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2); color: var(--text); font: inherit; }
.kb-record:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.kb-record.is-recording { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }
.kb-placeholder { color: var(--muted); font-size: var(--fs-sm); }

.kb-collapse { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .2s var(--ease); }
.kb-collapse.open { grid-template-rows: 1fr; }
.kb-collapse > .kb-msgs { overflow: hidden; min-height: 0; display: flex; flex-direction: column; gap: 6px; }
.kb-msg { display: flex; align-items: flex-start; gap: 8px; padding: 8px 10px; border-radius: var(--radius-sm); font-size: var(--fs-sm); line-height: 1.45; color: var(--text); }
.kb-msg p { margin: 0; overflow-wrap: break-word; }
.kb-msg-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.kb-msg-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.kb-msg.block { background: color-mix(in srgb, var(--bad) 10%, var(--surface)); border: 1px solid color-mix(in srgb, var(--bad) 40%, transparent); }
.kb-msg.block > svg.ic { color: var(--bad); }
.kb-msg.warn { background: color-mix(in srgb, var(--warn) 12%, var(--surface)); border: 1px solid color-mix(in srgb, var(--warn) 40%, transparent); }
.kb-msg.warn > svg.ic { color: var(--warn); }
.kb-msg.info { background: color-mix(in srgb, var(--info) 10%, var(--surface)); border: 1px solid color-mix(in srgb, var(--info) 35%, transparent); }
.kb-msg.info > svg.ic { color: var(--info); }
.kb-answer { color: var(--text-2); font-size: var(--fs-xs); }
.btn.small { padding: 5px 10px; font-size: var(--fs-xs); }
.kb-test { min-height: 44px; display: flex; flex-direction: column; justify-content: center; gap: 6px; font-size: var(--fs-sm); }
.kb-test p { margin: 0; }
.kb-test.ok { color: var(--ok); font-weight: 600; }
.kb-test .kb-bar { display: block; height: 3px; border-radius: 999px; background: var(--accent); transform-origin: left; animation: kb-count 5s linear forwards; }
@keyframes kb-count { from { transform: scaleX(1); } to { transform: scaleX(0); } }
.kb-save-error { display: flex; align-items: center; gap: 8px; font-size: var(--fs-sm); color: var(--bad); min-width: 0; }
.kb-save-error[hidden] { display: none; }


.kb-help-list { display: grid; grid-template-columns: max-content 1fr; gap: 8px 14px; margin: 4px 0 8px; align-items: baseline; }
.kb-help-list dt { margin: 0; }
.kb-help-list dd { margin: 0; display: flex; flex-direction: column; gap: 2px; min-width: 0; font-size: var(--fs-sm); }
.kb-help-list dd span { color: var(--muted); font-size: var(--fs-xs); overflow-wrap: break-word; }
@media (max-width: 480px) { .kb-help-list { grid-template-columns: 1fr; } }


.kb-search { width: 100%; }
.kb-results { display: flex; flex-direction: column; gap: 2px; margin-top: 4px; }
.kb-result { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; cursor: pointer; font-size: var(--fs-sm); }
.kb-result > svg.ic { flex: none; color: var(--muted); }
.kb-result .menu-text { flex: 1; min-width: min(12ch, 100%); }
.kb-result .menu-text > span { overflow-wrap: break-word; }
.kb-result.is-at { background: color-mix(in srgb, var(--accent) 12%, var(--surface)); }
.kb-result.is-off { color: var(--muted); cursor: default; }
.kb-result.is-off .kb-combo { opacity: .6; }
.menu-item .kb-combo { margin-left: auto; }

@media (prefers-reduced-motion: reduce) {
    .kb-collapse { transition: none; }
    .kb-modal { animation: none; }
    .kb-test .kb-bar { animation: none; }
}









:is(#addIngredientModal, #addBrandModal, #productModal) {
    --im-input-bg: #1d1d24; --im-border: #8b8894; --im-hint: #b0adb8; --im-placeholder: #a8a5b0; --im-link: #86b7f7; --im-danger: #ff8a8a;
    --im-selected: #4a2433; --im-text: #f2f1f4;
}
:root[data-theme="light"] :is(#addIngredientModal, #addBrandModal, #productModal) {
    --im-input-bg: #ffffff; --im-border: #857a7d; --im-hint: #6a5e61; --im-placeholder: #6f6366; --im-link: #1f5fae; --im-danger: #b42323;
    --im-selected: #f9e3ea; --im-text: #2b2426;
}
:is(#addIngredientModal, #addBrandModal, #productModal) .ing-modal {
    width: min(760px, 100%); max-height: 100%; padding: 0; overflow: hidden; display: flex; flex-direction: column; border-radius: 16px;
    font-size: 14px; line-height: 1.45; overflow-wrap: anywhere;
}
.ing-head { flex: none; display: flex; align-items: flex-start; gap: 16px; padding: 16px 24px 14px; background: var(--surface-2); border-bottom: 1px solid var(--border); }
.ing-eyebrow { margin: 0 0 2px; font-size: 12px; font-weight: 600; line-height: 1.3; letter-spacing: .04em; text-transform: uppercase; color: var(--accent-text); }
.ing-title-row { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; }
.ing-head .src-count { margin: 0; }
.ing-body > .ing-intro { margin: -8px 0 0; font-size: 13px; line-height: 1.45; color: var(--im-hint); }
.ing-head-text { flex: 1; min-width: 0; }
.ing-head h3 { margin: 0; font-size: 20px; font-weight: 600; line-height: 1.3; color: var(--text); }
.ing-head .modal-intro { margin: 4px 0 0; font-size: 13px; line-height: 1.45; color: var(--im-hint); }
.ing-close { width: 32px; height: 32px; border-radius: 8px; flex: none; color: var(--im-hint); }


.ing-nav { flex: none; display: flex; flex-wrap: wrap; gap: 8px; padding: 10px 24px 10px; border-bottom: 1px solid var(--border); }
.ing-nav-btn {
    flex: none; min-height: 32px; padding: 4px 12px; border: 1px solid transparent; border-radius: 8px; background: transparent; color: var(--text-2);
    font: inherit; font-size: 13px; font-weight: 500; cursor: pointer; white-space: nowrap;
}
.ing-nav-btn:hover { background: var(--surface-2); }
.ing-nav-btn[aria-current="true"] { color: var(--accent-text); border-color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, transparent); font-weight: 600; }
.ing-nav-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.ing-form { flex: 1 1 auto; min-height: 0; margin: 0; padding: 0; gap: 0; display: flex; flex-direction: column; }
.ing-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 24px 24px 32px; scroll-padding: 16px 0 24px; display: flex; flex-direction: column; gap: 32px; }
.ing-body > .review-note { margin: 0; }
.ing-section { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.ing-section + .ing-section { border-top: 1px solid var(--border); padding-top: 32px; }
.ing-section-title { margin: 0; font-size: 14px; font-weight: 600; line-height: 1.4; color: var(--text); text-transform: none; letter-spacing: 0; }
.ing-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 24px 16px; align-items: start; }
.ing-grid > * { min-width: 0; }
.ing-grid > .full { grid-column: 1 / -1; }
.ing-grid > .half { grid-column: span 6; }
.ing-modal .section-note { margin: -8px 0 0; }


.ing-modal .field { display: flex; flex-direction: column; gap: 0; min-width: 0; }
.label-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 32px; margin-bottom: 2px; min-width: 0; }
.label-row > label, .label-row > .label-text { font-size: 14px; font-weight: 600; line-height: 1.3; color: var(--text); min-width: 0; display: block; }
.label-row .optional { font-size: 13px; font-weight: 400; color: var(--im-hint); }
.label-row .required { color: var(--im-danger); font-weight: 600; }
.label-actions { display: inline-flex; align-items: center; gap: 8px; flex: none; }
.label-actions .info-slot { margin: 0; display: inline-flex; vertical-align: baseline; }
.label-actions .icon-btn, .label-actions .guide-badge {
    width: 32px; height: 32px; min-width: 32px; border-radius: 8px; padding: 0; display: inline-grid; place-items: center;
    border: 1px solid var(--border); background: transparent; color: var(--im-hint); font-size: 14px; transform: none;
}
.label-actions .icon-btn svg.ic { width: 16px; height: 16px; }
.label-actions .icon-btn:hover, .label-actions .guide-badge:hover { background: var(--surface-2); color: var(--text); transform: none; }
.label-actions .icon-btn:focus-visible, .label-actions .guide-badge:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.ing-modal .field > input:not([type="checkbox"]):not([type="radio"]):not([type="color"]), .ing-modal .field > select:not(.combo-native), .ing-modal .field > textarea, .ing-modal .ing-search > input, .ing-modal .source-row > input, .ing-modal .combo-btn {
    width: 100%; min-width: 0; min-height: 40px; padding: 8px 12px; border: 1px solid var(--im-border); border-radius: 8px;
    background: var(--im-input-bg); color: var(--im-text); font: inherit; font-size: 15px; font-weight: 400; line-height: 1.4;
}
.ing-modal select.combo-native { width: 1px; height: 1px; min-height: 0; padding: 0; border: 0; }
.ing-modal textarea, .ing-modal .field > textarea { min-height: 96px; resize: vertical; }
.ing-modal input::placeholder, .ing-modal textarea::placeholder { color: var(--im-placeholder); opacity: 1; }
.ing-modal .combo-btn.is-placeholder .combo-label { color: var(--im-placeholder); }
.ing-modal input:not([type="checkbox"]):not([type="radio"]):focus-visible, .ing-modal select:not(.combo-native):focus-visible, .ing-modal textarea:focus-visible, .ing-modal .combo-btn:focus-visible {
    outline: 2px solid var(--accent); outline-offset: 2px; border-color: var(--accent);
}
:is(#addIngredientModal, #addBrandModal, #productModal) .ing-modal [aria-invalid="true"] { border-color: var(--im-danger); box-shadow: 0 0 0 1px var(--im-danger); }
.hint-row { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 4px 12px; margin-top: 6px; min-width: 0; }
.ing-modal .field-hint { margin: 0; font-size: 13px; font-weight: 400; line-height: 1.45; color: var(--im-hint); min-width: 0; }
.hint-row .field-hint { flex: 1 1 220px; }
.ing-modal textarea.limited { min-height: 0; resize: vertical; }
.hint-row .counter.is-full { color: var(--im-danger); font-weight: 600; }
.hint-row .counter { margin-left: auto; flex: none; font-size: 13px; color: var(--im-hint); font-variant-numeric: tabular-nums; }
.ing-modal .field-hint.warn { color: var(--im-danger); }
.ing-modal .paste-note { margin-top: 6px; }
.ing-modal .name-clash { margin: 0; }


.ing-modal .field-sources { margin-top: 8px; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.ing-modal .field-sources[hidden] { display: none; }
.ing-modal .definition-basis { margin: 0; font-size: 13px; line-height: 1.45; color: var(--im-hint); }
.ing-modal .source-link { color: var(--im-link); text-decoration: underline; text-underline-offset: 2px; }
.ing-modal .source-link:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
details.sources-box { border: 1px solid var(--border); border-radius: 8px; min-width: 0; }
details.sources-box > summary {
    display: flex; align-items: center; gap: 8px; min-height: 32px; padding: 4px 12px; cursor: pointer; list-style: none;
    font-size: 13px; font-weight: 600; color: var(--text-2); border-radius: 8px;
}
details.sources-box > summary::-webkit-details-marker { display: none; }
details.sources-box > summary::before { content: ""; width: 7px; height: 7px; border-right: 2px solid var(--im-hint); border-bottom: 2px solid var(--im-hint); transform: rotate(-45deg); transition: transform .15s var(--ease); flex: none; }
details.sources-box[open] > summary::before { transform: rotate(45deg); }
details.sources-box > summary:hover { background: var(--surface-2); }
details.sources-box > summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.lookup-list { list-style: none; margin: 0; padding: 0 12px; display: flex; flex-direction: column; }
.lookup-row { display: grid; grid-template-columns: minmax(120px, 190px) minmax(0, 1fr) auto; gap: 4px 12px; align-items: start; padding: 8px 0; border-top: 1px solid var(--border); min-width: 0; }
.lookup-name { font-size: 13px; font-weight: 500; min-width: 0; }
.lookup-name .site-hint { display: inline-block; font-size: 12px; font-weight: 400; color: var(--im-hint); }
.lookup-text { font-size: 13px; line-height: 1.45; color: var(--text-2); min-width: 0; }
.lookup-act { justify-self: end; }
.ref-add {
    min-height: 32px; padding: 0 12px; border: 1px solid var(--im-border); border-radius: 8px; background: var(--im-input-bg); color: var(--text);
    font: inherit; font-size: 13px; font-weight: 500; cursor: pointer;
}
.ref-add:hover:not(:disabled) { background: var(--surface-2); }
.ref-add:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.ref-add:disabled { cursor: not-allowed; color: var(--im-hint); border-style: dashed; opacity: .75; }
details.sources-box > .field-hint { padding: 0 12px 8px; }
details.sources-box > .field-hint:first-of-type { padding-top: 8px; }


.ing-modal .checks.pills { display: flex; flex-wrap: wrap; gap: 8px; }
.ing-modal .checks.pills + .checks.pills { margin-top: 8px; }
.ing-modal .checks.pills:empty { display: none; }
.ing-modal .checks.pills .check {
    position: relative; display: inline-flex; align-items: center; gap: 4px; min-height: 32px; padding: 4px 12px; border: 1px solid var(--im-border);
    border-radius: 999px; background: transparent; color: var(--text); font-size: 13px; font-weight: 500; cursor: pointer;
}
.ing-modal .checks.pills .check:hover { background: var(--surface-2); }
.ing-modal .checks.pills .check:has(input:checked) { background: var(--im-selected); border-color: var(--accent); color: var(--im-text); font-weight: 600; }
.ing-modal .checks.pills .check:has(input:checked)::before { content: "\2713"; font-size: 12px; line-height: 1; }
.ing-modal .checks.pills .check:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }


.ing-modal .fit-list { display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.ing-modal .fit-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; min-height: 48px; margin: 0; padding: 8px 12px; border: 0; min-width: 0; font-size: 14px; }
.ing-modal .fit-row + .fit-row { border-top: 1px solid var(--border); }
.ing-modal .fit-name { min-width: 0; flex: 1 1 140px; color: var(--text); font-weight: 500; }
.ing-modal .fit-choices { display: inline-flex; flex: none; gap: 0; padding: 0; border: 1px solid var(--im-border); border-radius: 8px; background: transparent; overflow: hidden; }
.ing-modal .fit-choice { position: relative; cursor: pointer; }
.ing-modal .fit-choice span {
    display: inline-flex; align-items: center; justify-content: center; gap: 4px; min-width: 76px; min-height: 32px; padding: 0 12px; border-radius: 0;
    font-size: 13px; font-weight: 500; color: var(--text-2);
}
.ing-modal .fit-choice + .fit-choice span { border-left: 1px solid var(--im-border); }
.ing-modal .fit-choice:hover span { background: var(--surface-2); color: var(--text); }
.ing-modal .fit-choice input:checked + span { color: var(--im-text); font-weight: 600; }
.ing-modal .fit-choice.avoid input:checked + span { background: color-mix(in srgb, var(--bad) 24%, transparent); }
.ing-modal .fit-choice.none input:checked + span { background: var(--surface-3); }
.ing-modal .fit-choice.good input:checked + span { background: color-mix(in srgb, var(--ok) 24%, transparent); }
.ing-modal .fit-choice.avoid input:checked + span::before { content: "\2715"; font-size: 11px; }
.ing-modal .fit-choice.none input:checked + span::before { content: "\2022"; font-size: 13px; }
.ing-modal .fit-choice.good input:checked + span::before { content: "\2713"; font-size: 12px; }
.ing-modal .fit-choice input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: -2px; }


.ing-foot { flex: none; display: flex; flex-direction: column; gap: 8px; padding: 12px 24px 16px; border-top: 1px solid var(--border); background: var(--surface); }
:is(#addIngredientModal, #addBrandModal, #productModal) .ing-foot .form-error {
    position: static; margin: 0; padding: 8px 12px; font-size: 13px; line-height: 1.45; color: var(--im-danger); border-radius: 8px;
    background: color-mix(in srgb, var(--bad) 10%, var(--surface)); border: 1px solid var(--im-danger); overflow-wrap: anywhere;
}
:is(#addIngredientModal, #addBrandModal, #productModal) .ing-foot .form-error::before { content: "\26A0\FE0E"; margin-right: 8px; font-weight: 700; }
:is(#addIngredientModal, #addBrandModal, #productModal) .ing-foot .modal-actions { position: static; margin: 0; padding: 0; border: 0; background: none; display: flex; justify-content: flex-end; gap: 8px; }
.ing-foot .cancel-btn, .ing-foot .save-btn { min-height: 40px; padding: 0 16px; border-radius: 8px; font-size: 14px; font-weight: 600; }
.ing-foot .cancel-btn { background: var(--surface-2); color: var(--text); border: 1px solid var(--im-border); }
.ing-foot .cancel-btn:focus-visible, .ing-foot .save-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.ing-foot .save-btn { background: var(--accent); color: var(--accent-ink); border: 1px solid var(--accent); }


body:has(> :is(#addIngredientModal, #addBrandModal, #productModal)[style*="flex"]) .toast-host { top: 16px; bottom: auto; left: 50%; right: auto; transform: translateX(-50%); align-items: center; max-width: min(380px, calc(100vw - 32px)); }

@media (pointer: coarse) {
    .ing-close, .label-actions .icon-btn, .label-actions .guide-badge { width: 40px; height: 40px; min-width: 40px; }
    .ref-add, .ing-nav-btn { min-height: 40px; }
}
@media (max-width: 767px) {
    :is(#addIngredientModal, #addBrandModal, #productModal) { padding: 8px; }
    .ing-head { padding: 16px 16px 8px; }
    .ing-nav { padding: 8px 16px; }
    .ing-nav-btn { flex: 1 1 28%; white-space: normal; text-align: center; line-height: 1.25; padding: 4px 8px; }
    .ing-body { padding: 16px 16px 24px; }
    .ing-foot { padding: 12px 16px; }
    .ing-grid > .half { grid-column: 1 / -1; }
    .ing-modal .field > input:not([type="checkbox"]):not([type="radio"]):not([type="color"]), .ing-modal .field > select:not(.combo-native), .ing-modal .field > textarea, .ing-modal .ing-search > input, .ing-modal .source-row > input, .ing-modal .combo-btn { font-size: 16px; }
    .lookup-row { grid-template-columns: minmax(0, 1fr) auto; }
    .lookup-text { grid-column: 1 / -1; grid-row: 2; }
    .ing-modal .fit-choices { width: 100%; }
    .ing-modal .fit-choice { flex: 1; }
    .ing-modal .fit-choice span { min-width: 0; width: 100%; }
}
@media (prefers-reduced-motion: reduce) { details.sources-box > summary::before { transition: none; } }
.ing-modal .source-link.is-wait { opacity: .6; cursor: progress; }


.ing-modal .label-actions .row-btn { min-height: 32px; border-radius: 8px; font-size: 13px; }
.ing-modal .check-line { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; line-height: 1.45; color: var(--im-hint); }
.ing-modal .check-line input { margin-top: 2px; flex: none; width: 16px; height: 16px; accent-color: var(--accent); }
.ing-modal .website-box, .ing-modal .sources-box { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.ing-modal .sources-box .field-label, .ing-modal .field-sub { font-size: 14px; font-weight: 600; color: var(--text); margin-top: 8px; }
.ing-modal .sources-box .field-label:first-child { margin-top: 0; }
.ing-modal .source-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; min-width: 0; }
.ing-modal .source-row > input { flex: 1 1 240px; min-width: 0; }
.ing-modal .source-row .row-btn { min-height: 32px; border-radius: 8px; white-space: nowrap; }
.ing-modal .ing-search { position: relative; }
.ing-modal .ing-results { border-radius: 8px; }
.ing-modal .ing-pills { margin: 8px 0 0; }
.ing-modal .ing-pills:empty { display: none; }
.ing-modal .shade-editor { gap: 8px; }
.ing-modal .shade-strip { max-height: none; overflow: visible; padding: 0; }
.ing-modal .shade-item { min-height: 32px; }
.ing-modal .field-text { min-width: 0; font-size: 13px; line-height: 1.45; color: var(--im-hint); margin: 0; }

.ing-modal .hint-row:has(> .field-hint:empty) { display: none; }
#addBrandModal .ing-foot .form-error, #productModal .ing-foot .form-error, #addIngredientModal .ing-foot .form-error { max-height: 96px; overflow-y: auto; }





.ing-modal { container-type: inline-size; container-name: ingwindow; }
.ing-modal .field.has-src {
    display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); column-gap: 16px; row-gap: 0; align-items: start;
    grid-template-areas: "label slabel" "control sbody" "hint sbody" "note note" "sources sources" "finder finder";
    grid-template-rows: auto auto 1fr auto auto auto;
}
.ing-modal .field.has-src > .label-row { grid-area: label; }
.ing-modal .field.has-src > input, .ing-modal .field.has-src > textarea, .ing-modal .field.has-src > select { grid-area: control; }
.ing-modal .field.has-src > .src-label { grid-area: slabel; }
.ing-modal .field.has-src > .src-body { grid-area: sbody; }
.ing-modal .field.has-src > .hint-row { grid-area: hint; }
.ing-modal .field.has-src > .paste-note { grid-area: note; }
.ing-modal .field.has-src > .field-sources { grid-area: sources; }
.ing-modal .field.has-src > .src-finder { grid-area: finder; }
@container ingwindow (max-width: 639px) {
    .ing-modal .field.has-src {
        grid-template-columns: minmax(0, 1fr);
        grid-template-areas: "label" "control" "slabel" "sbody" "hint" "note" "sources" "finder";
        grid-template-rows: none;
    }
    .ing-modal .field.has-src > .src-label { margin-top: 8px; }
}
.ing-modal .src-label { display: flex; align-items: center; min-height: 32px; margin-bottom: 2px; min-width: 0; }
.ing-modal .src-label > label { font-size: 13px; font-weight: 600; color: var(--text); }
.ing-modal .src-label .optional { font-weight: 400; color: var(--im-hint); }
.ing-modal .src-body { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.ing-modal .src-input-row { display: flex; gap: 8px; align-items: center; min-width: 0; }
.ing-modal .src-input-row > input {
    flex: 1 1 auto; min-width: 0; height: 40px; padding: 8px 12px; border: 1px solid var(--im-border); border-radius: 8px;
    background: var(--im-input-bg); color: var(--im-text); font: inherit; font-size: 14px; text-overflow: ellipsis;
}
.ing-modal .src-input-row > input::placeholder { color: var(--im-placeholder); opacity: 1; }
.ing-modal .src-input-row > input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-color: var(--accent); text-overflow: clip; }
.ing-modal .src-input-row > input.src-bad { border-color: var(--im-danger); box-shadow: 0 0 0 1px var(--im-danger); }
.ing-modal .src-open { flex: none; width: 40px; height: 40px; border-radius: 8px; border: 1px solid var(--border); display: inline-grid; place-items: center; color: var(--im-hint); }
.ing-modal .src-open[aria-disabled="true"] { opacity: .45; pointer-events: none; }
.ing-modal .src-open:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.ing-modal .src-open svg.ic { width: 16px; height: 16px; }
.ing-modal .src-status { margin: 0; display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: center; font-size: 12px; line-height: 1.4; color: var(--im-hint); min-width: 0; }
.ing-modal .src-status:empty { display: none; }
.ing-modal .src-status .chip { margin: 0; font-size: 12px; }
.ing-modal .src-tier.official { --c: var(--ok); }
.ing-modal .src-tier.industry { --c: var(--info); }
.ing-modal .src-tier.unofficial, .ing-modal .src-tier.other { --c: var(--warn); }
.ing-modal .src-msg, .ing-modal .src-tag { display: inline-flex; gap: 6px; align-items: flex-start; min-width: 0; overflow-wrap: anywhere; }
.ing-modal .src-msg.bad { color: var(--im-danger); }
.ing-modal .src-msg.warn { color: var(--text-2); }
.ing-modal .src-msg.ok { color: var(--ok); }
.ing-modal .src-glyph {
    flex: none; display: inline-grid; place-items: center; width: 16px; height: 16px; border-radius: 50%; border: 1.5px solid currentColor;
    font-size: 11px; font-weight: 700; line-height: 1;
}
.ing-modal .src-glyph.none { border-style: dashed; }
.ing-modal .src-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; min-width: 0; }
.ing-modal .src-actions .row-btn { min-height: 32px; padding: 0 12px; border-radius: 8px; font-size: 13px; }
.ing-modal .src-find { background: none; border: 0; padding: 4px 0; min-height: 32px; font: inherit; font-size: 13px; font-weight: 600; color: var(--im-link); text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
.ing-modal .src-find:disabled { color: var(--im-hint); text-decoration: none; cursor: not-allowed; }
.ing-modal .src-find:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.ing-modal .src-find-hint { font-size: 12px; color: var(--im-hint); }
.ing-modal .src-find-hint:empty { display: none; }
.ing-modal .src-count { margin: 8px 0 0; display: inline-block; font-size: 12px; }
.ing-modal .src-count.ok { --c: var(--ok); }

.ing-modal .src-finder { margin-top: 12px; padding: 12px 16px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2); display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.ing-modal .src-finder[hidden] { display: none; }
.ing-modal .finder-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.ing-modal .finder-title { margin: 0; font-size: 14px; font-weight: 600; color: var(--text); }
.ing-modal .finder-close { width: 32px; height: 32px; border-radius: 8px; flex: none; color: var(--im-hint); }
.ing-modal .finder-close svg.ic { width: 16px; height: 16px; }
.ing-modal .finder-name { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.ing-modal .finder-name label { font-size: 13px; font-weight: 600; color: var(--text); }
.ing-modal .finder-name input { flex: 1 1 200px; min-width: 0; height: 40px; padding: 8px 12px; border: 1px solid var(--im-border); border-radius: 8px; background: var(--im-input-bg); color: var(--im-text); font: inherit; font-size: 14px; }
.ing-modal .finder-name input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.ing-modal .finder-sub { margin: 4px 0 0; font-size: 13px; font-weight: 600; color: var(--text); }
.ing-modal .finder-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.ing-modal .finder-row { display: grid; grid-template-columns: minmax(110px, 180px) minmax(0, 1fr) auto; gap: 4px 12px; align-items: start; padding: 8px 0; border-top: 1px solid var(--border); font-size: 13px; min-width: 0; }
.ing-modal .finder-row .row-btn { min-height: 32px; border-radius: 8px; font-size: 13px; white-space: nowrap; }
.ing-modal .finder-what { color: var(--text-2); line-height: 1.45; min-width: 0; overflow-wrap: anywhere; }
.ing-modal .finder-inci { font-weight: 600; overflow-wrap: anywhere; min-width: 0; }
.ing-modal .finder-inci .chip { margin: 0 0 0 4px; font-size: 11px; }
.ing-modal .src-note { font-size: 12px; color: var(--im-hint); margin: 0; }
.ing-modal .finder-cosing { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.ing-modal .finder-official { align-self: flex-start; min-height: 32px; border-radius: 8px; font-size: 13px; }
@container ingwindow (max-width: 639px) {
    .ing-modal .finder-row { grid-template-columns: minmax(0, 1fr) auto; }
    .ing-modal .finder-row .finder-what { grid-column: 1 / -1; grid-row: 2; }
}


.modal-content.confirm-inline { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 14px 28px; }
.modal-content.confirm-inline > h3 { margin: 0; flex: 0 1 auto; }
.modal-content.confirm-inline > .modal-actions { margin: 0; flex: 0 0 auto; }


html.sb-pinned { --content-left: var(--nav-w); }
html.sb-mobile-open { --content-left: 0px; }
body.app { display: block; min-height: 100%; overflow-x: hidden; overflow-y: visible; }
.sidebar {
    position: fixed; z-index: 900; top: var(--header-h); bottom: 0; left: 0; width: var(--rail-w);
    display: flex; flex-direction: column; gap: 18px; overflow: hidden; padding: 12px 9px 12px 10px;
    background: var(--surface); border-right: 1px solid var(--border);
    transition: width .2s var(--ease), translate .2s var(--ease);
}
.sidebar > * { width: 100%; min-width: 0; flex-shrink: 0; }
.sidebar > .nav-links { flex: 1; min-height: 0; flex-shrink: 1; }
.nav-icon { width: var(--icon-box); height: var(--icon-box); flex: 0 0 var(--icon-box); display: grid; place-items: center; border-radius: var(--radius-sm); }
.sidebar .nav-links a {
    height: 38px; gap: calc(var(--label-start-x) - var(--icon-center-x) - var(--icon-box) / 2);
    padding: 0 12px 0 calc(var(--icon-center-x) - var(--icon-box) / 2 - 11px);
}
.sidebar .label { display: inline-block; flex: 1; min-width: 0; overflow: hidden; text-overflow: clip; white-space: nowrap; }
html.sb-collapsed:not(.sb-hover) .sidebar .label { visibility: hidden; }
html.sb-pinned .sidebar { width: var(--nav-w); }
html.sb-pinned .sidebar .label, html.sb-hover .sidebar .label { visibility: visible; }
html.sb-collapsed.sb-hover .sidebar { width: var(--nav-w); box-shadow: var(--shadow); }
.sidebar .sign-out {
    height: 38px; gap: calc(var(--label-start-x) - var(--icon-center-x) - var(--icon-box) / 2);
    padding: 0 12px 0 calc(var(--icon-center-x) - var(--icon-box) / 2 - 10px);
}
.brand-home { display: flex; align-items: center; gap: 10px; flex: none; min-width: 0; color: inherit; text-decoration: none; cursor: pointer; border-radius: 12px; }
.topbar > .brand-home { height: 100%; margin-left: calc(var(--label-start-x) - var(--rail-w)); }
.brand-home:hover .brand-title { color: var(--accent-text); }
.brand-home:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.brand-logo { width: 34px; height: 34px; border-radius: 10px; flex: none; overflow: hidden; display: block; }
.brand-logo img { display: block; width: 100%; height: 100%; }
.brand-title { font-size: var(--fs-md); font-weight: 700; line-height: 1.15; letter-spacing: .1px; }
.main-content {
    display: flex; flex-direction: column; min-width: 0; min-height: 100vh;
    margin-left: var(--content-left); padding-top: var(--header-h); overflow: visible;
}
.main-content > .topbar {
    position: fixed; z-index: 950; top: 0; left: 0; right: 0; height: var(--header-h);
    display: flex; align-items: center; gap: 0; padding: 0;
    background: color-mix(in srgb, var(--bg) 95%, transparent); border-bottom: 1px solid var(--border);
}
.topbar-leading { width: var(--rail-w); height: 100%; flex: 0 0 var(--rail-w); display: grid; place-items: center; }
.topbar .menu-btn { width: var(--icon-box); height: var(--icon-box); padding: 0; flex: none; display: grid; place-items: center; border-radius: var(--radius-sm); }
.topbar-controls {
    position: absolute; top: 0; bottom: 0;
    left: max(calc(var(--content-left) + var(--gutter)), calc(var(--brand-right, 0px) + 16px));
    right: var(--gutter); min-width: 0; display: flex; align-items: center; gap: 12px; overflow-x: auto; overflow-y: hidden;
    scrollbar-width: none; transition: left .2s var(--ease);
}
.topbar-controls::-webkit-scrollbar { display: none; }
.topbar-controls > .search-container { flex: 1 1 260px; max-width: 520px; min-width: min(160px, 100%); margin: 0; }
.topbar-tools { display: flex; align-items: center; gap: 8px; flex: none; }
html.sb-ready .main-content { transition: margin-left .2s var(--ease); }
html.sb-mobile-open body::after { content: ""; position: fixed; z-index: 899; inset: var(--header-h) 0 0; background: var(--overlay); }
.editing-bar { top: var(--header-h); }
@media (max-width: 768px), (hover: none) {
    :root { --content-left: 0px; }
    .sidebar { width: min(var(--nav-w), calc(100vw - 56px)); translate: -100% 0; visibility: hidden; transition: translate .2s var(--ease), visibility 0s .2s; }
    html.sb-mobile-open .sidebar { translate: 0 0; visibility: visible; transition: translate .2s var(--ease); box-shadow: var(--shadow); }
    html.sb-mobile-open .sidebar .label { display: inline-block !important; visibility: visible !important; }
    .main-content { margin-left: 0; }
    .topbar-controls { gap: 8px; }
}
@media (prefers-reduced-motion: reduce) {
    html.sb-ready .main-content, .sidebar, html.sb-mobile-open .sidebar, .topbar-controls { transition: none !important; }
}
