:root {
    --ink: #18312f;
    --ink-soft: #55706d;
    --green-950: #0c312e;
    --green-900: #123f3a;
    --green-800: #18564f;
    --green-700: #1f7167;
    --mint: #dff2e9;
    --mint-2: #edf8f2;
    --cream: #f7f5ef;
    --paper: #fffefa;
    --line: #dfe6e1;
    --coral: #eb765f;
    --coral-soft: #fff0eb;
    --amber: #e7aa31;
    --amber-soft: #fff7df;
    --blue: #5d9fc1;
    --shadow: 0 20px 60px rgba(18, 63, 58, .12);
    --shadow-soft: 0 8px 28px rgba(18, 63, 58, .08);
    --radius-xl: 26px;
    --radius-lg: 19px;
    --radius-md: 14px;
    --sidebar: 250px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html { color-scheme: light; scroll-behavior: smooth; }

body {
    margin: 0;
    min-width: 320px;
    background: var(--cream);
    color: var(--ink);
    font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    -webkit-font-smoothing: antialiased;
}

button, input, select { font: inherit; }
button { color: inherit; }
button, [data-action], [data-view] { -webkit-tap-highlight-color: transparent; }
button:focus-visible, input:focus-visible, select:focus-visible { outline: 3px solid rgba(31, 113, 103, .28); outline-offset: 2px; }

.skip-link { position: fixed; top: -60px; left: 20px; z-index: 999; background: white; padding: 12px 18px; border-radius: 10px; color: var(--green-900); }
.skip-link:focus { top: 14px; }
.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; }

.app-shell { min-height: 100vh; }
.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 20;
    width: var(--sidebar);
    display: flex;
    flex-direction: column;
    padding: 26px 18px 20px;
    background: var(--green-950);
    color: white;
}

.brand { display: flex; align-items: center; gap: 11px; border: 0; background: transparent; color: white; cursor: pointer; padding: 0 8px 28px; font-size: 21px; letter-spacing: -.4px; }
.brand strong { font-weight: 800; }
.brand-mark { position: relative; width: 31px; height: 31px; display: grid; align-content: center; gap: 3px; padding: 5px; border-radius: 9px; background: var(--mint); transform: rotate(-3deg); }
.brand-mark i { display: block; height: 4px; border-radius: 5px; background: var(--green-900); }
.brand-mark i:nth-child(1) { width: 68%; }
.brand-mark i:nth-child(2) { width: 100%; }
.brand-mark i:nth-child(3) { width: 82%; align-self: end; }

.nav-list { display: grid; gap: 5px; }
.nav-item { display: flex; align-items: center; gap: 13px; width: 100%; min-height: 46px; padding: 0 13px; border: 0; border-radius: 12px; background: transparent; color: rgba(255,255,255,.68); cursor: pointer; text-align: left; transition: .18s ease; }
.nav-item:hover { color: white; background: rgba(255,255,255,.07); }
.nav-item.is-active { color: var(--green-950); background: var(--mint); font-weight: 750; }
.nav-icon { display: grid; place-items: center; width: 23px; font-size: 20px; }

.sidebar-card { margin-top: auto; padding: 16px; border: 1px solid rgba(255,255,255,.1); border-radius: var(--radius-md); background: rgba(255,255,255,.06); }
.sidebar-card .eyebrow { color: #90c9bb; }
.sidebar-card strong { display: block; margin: 5px 0 11px; font-size: 14px; line-height: 1.35; }
.sidebar-card small { display: block; color: rgba(255,255,255,.56); font-size: 11px; line-height: 1.4; }
.progress { height: 5px; margin-bottom: 10px; overflow: hidden; border-radius: 20px; background: rgba(255,255,255,.1); }
.progress span { display: block; height: 100%; border-radius: inherit; background: #89c8b7; }

.pharmacy-card { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; margin-top: 13px; padding: 12px 7px; border: 0; background: transparent; color: white; cursor: pointer; text-align: left; }
.pharmacy-card strong, .pharmacy-card small { display: block; }
.pharmacy-card strong { font-size: 12px; }
.pharmacy-card small { margin-top: 2px; color: rgba(255,255,255,.48); font-size: 10px; }
.avatar { display: grid; place-items: center; width: 34px; height: 34px; flex: 0 0 auto; border-radius: 11px; background: #97cabb; color: var(--green-950); font-size: 11px; font-weight: 850; }

.main-content { min-height: 100vh; margin-left: var(--sidebar); padding: 0 34px 60px; }
.topbar { position: sticky; top: 0; z-index: 15; display: flex; align-items: center; justify-content: space-between; min-height: 100px; padding: 20px 0; background: rgba(247,245,239,.93); backdrop-filter: blur(16px); }
.topbar h1 { margin: 3px 0 0; font-size: clamp(25px, 2.2vw, 34px); letter-spacing: -1.1px; }
.topbar-actions, .section-actions { display: flex; align-items: center; gap: 10px; }
.eyebrow { display: block; margin: 0; color: var(--green-700); font-size: 10px; font-weight: 850; letter-spacing: 1.25px; text-transform: uppercase; }
.sync-state { display: inline-flex; align-items: center; gap: 7px; color: var(--ink-soft); font-size: 12px; }
.sync-state i { width: 7px; height: 7px; border-radius: 50%; background: #43a676; box-shadow: 0 0 0 4px rgba(67,166,118,.12); }

button { border: 0; }
.primary-button, .secondary-button, .light-button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 17px; border-radius: 12px; cursor: pointer; font-weight: 760; font-size: 13px; transition: transform .15s ease, box-shadow .15s ease, background .15s ease; }
.primary-button { background: var(--green-800); color: white; box-shadow: 0 8px 18px rgba(24,86,79,.16); }
.primary-button:hover { background: var(--green-900); transform: translateY(-1px); box-shadow: 0 11px 24px rgba(24,86,79,.2); }
.primary-button:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.secondary-button { border: 1px solid var(--line); background: var(--paper); color: var(--green-900); }
.secondary-button:hover { border-color: #b5cbc3; background: var(--mint-2); }
.light-button { background: white; color: var(--green-900); box-shadow: 0 8px 24px rgba(8,40,37,.16); }
.light-button:hover { transform: translateY(-1px); }
.compact { min-height: 39px; padding: 0 13px; font-size: 12px; }
.full { width: 100%; }
.text-button { padding: 5px; background: transparent; color: var(--green-700); cursor: pointer; font-size: 12px; font-weight: 800; }
.text-button:hover { color: var(--green-950); }
.text-button:disabled { opacity: .35; cursor: not-allowed; }
.centered { display: block; margin-inline: auto; }
.icon-button { display: grid; place-items: center; width: 39px; height: 39px; border: 1px solid var(--line); border-radius: 12px; background: var(--paper); cursor: pointer; font-weight: 800; }
.icon-button.small { width: 30px; height: 30px; border-radius: 9px; }
.round-icon { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; background: var(--mint); color: var(--green-900); font-weight: 800; }
.round-icon.large { width: 62px; height: 62px; font-size: 27px; }

.view { display: none; animation: fadeIn .25s ease; }
.view.is-active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(4px); } }

.hero-grid { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(260px, .8fr); gap: 18px; }
.welcome-card { position: relative; min-height: 285px; overflow: hidden; display: flex; border-radius: var(--radius-xl); background: linear-gradient(140deg, #174d47, #0e3834); color: white; box-shadow: var(--shadow); }
.welcome-card::before { content: ""; position: absolute; width: 420px; height: 420px; right: -180px; top: -230px; border-radius: 50%; border: 60px solid rgba(255,255,255,.035); }
.welcome-copy { position: relative; z-index: 2; width: 56%; padding: 34px; }
.welcome-copy h2 { max-width: 500px; margin: 15px 0 11px; font-size: clamp(28px, 3vw, 42px); line-height: 1.03; letter-spacing: -1.7px; }
.welcome-copy p { max-width: 490px; margin: 0 0 24px; color: rgba(255,255,255,.72); font-size: 14px; line-height: 1.55; }
.pill { display: inline-flex; align-items: center; min-height: 25px; padding: 0 10px; border-radius: 20px; font-size: 10px; font-weight: 800; letter-spacing: .4px; }
.pill-light { background: rgba(255,255,255,.12); color: #d6eee7; }
.pill.dark { background: rgba(4,24,22,.66); color: #d5eee6; }
.hero-planogram { position: absolute; right: 30px; bottom: 24px; width: 38%; padding: 12px 12px 5px; border: 1px solid rgba(255,255,255,.16); border-radius: 18px 18px 8px 8px; background: rgba(255,255,255,.08); transform: perspective(600px) rotateY(-5deg) rotateX(2deg); box-shadow: 0 22px 40px rgba(0,0,0,.16); }
.hero-shelf { display: flex; align-items: end; gap: 4px; height: 55px; padding: 5px 5px 0; border-bottom: 4px solid rgba(255,255,255,.42); }
.hero-shelf i { width: var(--w); height: calc(65% + var(--w) / 2); max-height: 43px; border-radius: 3px 3px 0 0; background: var(--c); box-shadow: inset -4px 0 rgba(0,0,0,.06); }

.capture-card { min-height: 285px; padding: 25px; border: 1px solid var(--line); border-radius: var(--radius-xl); background: var(--paper); box-shadow: var(--shadow-soft); }
.capture-card p { margin: 30px 0 38px; color: var(--ink-soft); font-size: 14px; line-height: 1.55; }
.card-heading, .panel-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.card-heading h3, .panel-heading h3 { margin: 5px 0 0; font-size: 18px; letter-spacing: -.4px; }
.scan-symbol { font-size: 18px; }

.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-top: 18px; }
.stat-card { min-height: 124px; padding: 20px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--paper); }
.stat-card > span { color: var(--ink-soft); font-size: 11px; font-weight: 700; }
.stat-card strong { display: block; margin: 8px 0 3px; font-size: 30px; line-height: 1; letter-spacing: -1px; }
.stat-card strong span { margin-left: 2px; color: var(--ink-soft); font-size: 13px; letter-spacing: 0; }
.stat-card small { color: #7b908d; font-size: 10px; }

.content-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(280px, .8fr); gap: 18px; margin-top: 18px; }
.panel { padding: 24px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--paper); box-shadow: 0 5px 18px rgba(18,63,58,.035); }
.project-list { margin-top: 18px; }
.project-row { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 14px; padding: 13px 0; border-top: 1px solid #edf0ed; cursor: pointer; }
.project-row:first-child { border-top: 0; }
.project-thumbnail { width: 57px; height: 46px; padding: 6px; border-radius: 10px; background: var(--mint-2); }
.project-thumbnail span { display: block; height: 7px; margin-bottom: 4px; border-bottom: 2px solid #7ba89d; }
.project-row strong, .project-row small { display: block; }
.project-row strong { font-size: 13px; }
.project-row small { margin-top: 4px; color: var(--ink-soft); font-size: 10px; }
.project-status { min-width: 72px; padding: 6px 9px; border-radius: 20px; background: var(--mint-2); color: var(--green-700); text-align: center; font-size: 9px; font-weight: 850; text-transform: uppercase; }
.project-status.draft { background: var(--amber-soft); color: #9a6c10; }

.donut-wrap { display: flex; align-items: center; justify-content: center; gap: 26px; min-height: 155px; }
.donut { position: relative; display: grid; place-items: center; width: 116px; height: 116px; border-radius: 50%; background: conic-gradient(var(--green-700) calc(var(--value) * 1%), #e8eee9 0); }
.donut::before { content: ""; position: absolute; inset: 13px; border-radius: 50%; background: var(--paper); }
.donut span { position: relative; text-align: center; }
.donut strong, .donut small { display: block; }
.donut strong { font-size: 21px; }
.donut small { color: var(--ink-soft); font-size: 9px; }
.legend { display: grid; gap: 12px; color: var(--ink-soft); font-size: 10px; }
.legend span, .stage-legend span { display: flex; align-items: center; gap: 7px; }
.legend b { color: var(--ink); }
.legend-dot { width: 8px; height: 8px; border-radius: 3px; background: #d9dfda; }
.legend-dot.verified { background: var(--green-700); }
.legend-dot.pending { background: var(--amber); }
.legend-dot.missing { background: #d9dfda; }
.legend-dot.locked { background: var(--coral); }

.section-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin: 10px 0 25px; }
.section-heading h2 { margin: 4px 0 3px; font-size: clamp(28px, 3vw, 40px); letter-spacing: -1.3px; }
.section-heading p { margin: 0; color: var(--ink-soft); font-size: 13px; }
.project-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.shelf-card { overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--paper); cursor: pointer; box-shadow: var(--shadow-soft); transition: transform .18s ease; }
.shelf-card:hover { transform: translateY(-3px); }
.shelf-card-visual { min-height: 170px; padding: 26px; background: linear-gradient(145deg, #e8f4ef, #d9ebe4); }
.shelf-card-visual .mini-planogram { transform: scale(.85); }
.shelf-card-body { padding: 18px; }
.shelf-card-body h3 { margin: 4px 0 6px; font-size: 16px; }
.shelf-card-body p { margin: 0; color: var(--ink-soft); font-size: 11px; }
.shelf-card-meta { display: flex; justify-content: space-between; align-items: center; margin-top: 15px; }
.new-shelf-card { display: grid; place-items: center; min-height: 280px; padding: 30px; border: 1.5px dashed #aac2ba; border-radius: var(--radius-lg); background: rgba(255,255,255,.42); cursor: pointer; text-align: center; }
.new-shelf-card > span { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 50%; background: var(--mint); color: var(--green-700); font-size: 25px; }
.new-shelf-card strong { margin: 13px 0 5px; }
.new-shelf-card small { color: var(--ink-soft); }

.catalog-toolbar { display: flex; align-items: center; gap: 14px; margin-bottom: 20px; }
.search-field { display: flex; align-items: center; gap: 9px; width: min(390px, 100%); min-height: 45px; padding: 0 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--paper); }
.search-field input { width: 100%; border: 0; outline: 0; background: transparent; color: var(--ink); }
.filter-chips { display: flex; gap: 7px; overflow-x: auto; scrollbar-width: none; }
.filter-chip, .tool-chip { white-space: nowrap; min-height: 35px; padding: 0 12px; border: 1px solid var(--line); border-radius: 20px; background: var(--paper); color: var(--ink-soft); cursor: pointer; font-size: 11px; font-weight: 750; }
.filter-chip.is-active, .tool-chip.is-active { border-color: var(--green-800); background: var(--green-800); color: white; }
.product-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.product-card { position: relative; display: flex; flex-direction: column; min-height: 320px; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--paper); cursor: pointer; box-shadow: 0 4px 14px rgba(18,63,58,.035); transition: transform .18s ease, box-shadow .18s ease; }
.product-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-soft); }
.product-card-visual { display: grid; place-items: end center; min-height: 165px; padding: 24px 18px 0; background: linear-gradient(155deg, color-mix(in srgb, var(--product-color) 16%, white), #f6f4ef); }
.product-pack { position: relative; width: 88px; height: 125px; overflow: hidden; display: flex; flex-direction: column; align-items: center; justify-content: center; border-radius: 4px 8px 3px 3px; background: white; color: color-mix(in srgb, var(--product-color) 75%, #17322f); box-shadow: 8px 10px 18px rgba(24,49,47,.16), inset -7px 0 rgba(0,0,0,.035); transform: perspective(350px) rotateY(-5deg); text-align: center; }
.product-pack::before { content: ""; position: absolute; left: -15%; right: -15%; top: 35%; height: 34%; background: color-mix(in srgb, var(--product-color) 72%, white); transform: rotate(-8deg); opacity: .86; }
.product-pack span, .product-pack small { position: relative; z-index: 1; }
.product-pack span { max-width: 78px; font-size: 8px; font-weight: 900; letter-spacing: .7px; }
.product-pack small { margin-top: 30px; max-width: 70px; font-size: 7px; font-weight: 800; }
.product-pack.bottle { width: 70px; border-radius: 12px 12px 15px 15px; }
.product-pack.bottle::after { content: ""; position: absolute; top: -8px; width: 34px; height: 16px; border-radius: 4px 4px 0 0; background: color-mix(in srgb, var(--product-color) 50%, white); }
.product-pack.tube { width: 72px; clip-path: polygon(8% 0, 92% 0, 100% 94%, 88% 100%, 12% 100%, 0 94%); }
.confidence-badge { position: absolute; top: 12px; right: 12px; padding: 5px 8px; border-radius: 20px; background: rgba(255,255,255,.9); color: var(--green-700); box-shadow: 0 3px 10px rgba(0,0,0,.06); font-size: 9px; font-weight: 850; }
.confidence-badge.pending { color: #a77716; }
.confidence-badge.missing { color: var(--coral); }
.product-card-body { flex: 1; padding: 16px; }
.product-card-body .product-brand { color: var(--green-700); font-size: 9px; font-weight: 850; letter-spacing: .8px; text-transform: uppercase; }
.product-card-body h3 { margin: 5px 0; font-size: 14px; line-height: 1.25; }
.product-card-body p { margin: 0; color: var(--ink-soft); font-size: 10px; }
.product-card-footer { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; border-top: 1px solid #edf0ed; color: var(--ink-soft); font-size: 9px; }
.product-card-footer strong { color: var(--ink); }

.planogram-heading { align-items: center; }
.planogram-workspace { display: grid; grid-template-columns: 265px minmax(0, 1fr); gap: 16px; }
.rules-panel { align-self: start; padding: 20px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--paper); }
.rules-title { display: flex; align-items: center; justify-content: space-between; }
.rules-title h3 { margin: 0; font-size: 15px; }
.rules-panel > p { margin: 7px 0 16px; color: var(--ink-soft); font-size: 10px; line-height: 1.45; }
.rule-list { display: grid; gap: 7px; margin-bottom: 17px; }
.rule-row { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 9px; padding: 10px; border: 1px solid var(--line); border-radius: 11px; background: #fbfcfa; cursor: grab; }
.rule-row .drag-handle { color: #9aaca9; letter-spacing: -2px; }
.rule-row strong, .rule-row small { display: block; }
.rule-row strong { font-size: 11px; }
.rule-row small { margin-top: 2px; color: var(--ink-soft); font-size: 8px; }
.rule-rank { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 7px; background: var(--mint); color: var(--green-700); font-size: 9px; font-weight: 850; }
.toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 0; border-top: 1px solid #edf0ed; cursor: pointer; }
.toggle-row strong, .toggle-row small { display: block; }
.toggle-row strong { font-size: 11px; }
.toggle-row small { margin-top: 3px; color: var(--ink-soft); font-size: 8px; line-height: 1.35; }
.toggle-row input { position: absolute; opacity: 0; pointer-events: none; }
.toggle-row > i { position: relative; width: 36px; height: 21px; flex: 0 0 auto; border-radius: 20px; background: #d7deda; transition: .2s; }
.toggle-row > i::after { content: ""; position: absolute; width: 15px; height: 15px; top: 3px; left: 3px; border-radius: 50%; background: white; box-shadow: 0 1px 4px rgba(0,0,0,.18); transition: .2s; }
.toggle-row input:checked + i { background: var(--green-700); }
.toggle-row input:checked + i::after { transform: translateX(15px); }
.optimization-score { display: flex; align-items: baseline; gap: 3px; margin-top: 16px; padding: 14px; border-radius: 12px; background: var(--mint-2); }
.optimization-score span { margin-right: auto; color: var(--green-700); font-size: 9px; font-weight: 750; }
.optimization-score strong { font-size: 23px; }
.optimization-score small { color: var(--ink-soft); font-size: 9px; }

.planogram-stage-wrap { min-width: 0; }
.stage-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 49px; margin-bottom: 9px; padding: 7px 10px; border: 1px solid var(--line); border-radius: 13px; background: var(--paper); }
.stage-toolbar > div { display: flex; gap: 6px; }
.stage-legend { align-items: center; color: var(--ink-soft); font-size: 9px; }
.planogram-stage { position: relative; overflow: auto; padding: 25px 28px 34px; border: 1px solid #d9e0dc; border-radius: var(--radius-lg); background-color: #e9e5da; background-image: radial-gradient(#cfc9ba 1px, transparent 1px); background-size: 18px 18px; box-shadow: inset 0 0 60px rgba(61,57,44,.045); }
.shelf-unit { position: relative; min-width: 680px; max-width: 980px; margin: 0 auto 20px; }
.shelf-label { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; color: #6f746e; font-size: 9px; font-weight: 750; }
.shelf-products { position: relative; display: flex; align-items: flex-end; gap: 2px; min-height: 132px; padding: 7px 7px 0; border: 7px solid #d0cbc0; border-bottom-width: 11px; border-radius: 4px; background: linear-gradient(#f8f7f1, #eeece3); box-shadow: 0 10px 14px rgba(72,66,50,.08), inset 0 5px 12px rgba(61,57,44,.05); }
.shelf-products::after { content: ""; position: absolute; left: -10px; right: -10px; bottom: -16px; height: 6px; border-radius: 2px; background: #bdb7aa; box-shadow: 0 4px 7px rgba(60,55,44,.15); }
.plan-product { position: relative; flex: 0 0 var(--block-width); min-width: 28px; height: var(--block-height); max-height: 112px; display: flex; overflow: hidden; border: 2px solid transparent; border-radius: 4px 6px 2px 2px; background: white; box-shadow: 2px 3px 6px rgba(29,42,39,.13); cursor: pointer; transition: transform .15s ease, box-shadow .15s ease, border .15s ease; }
.plan-product:hover { z-index: 3; transform: translateY(-3px); box-shadow: 3px 8px 12px rgba(29,42,39,.18); }
.plan-product.is-selected { border-color: var(--green-700); box-shadow: 0 0 0 3px rgba(31,113,103,.18); }
.plan-product.is-locked { border-color: var(--coral); }
.plan-product[draggable="true"] { cursor: grab; }
.plan-product.is-dragging { opacity: .45; }
.facing-face { position: relative; flex: 1 1 0; min-width: 0; overflow: hidden; display: flex; flex-direction: column; align-items: center; justify-content: center; border-right: 1px solid rgba(0,0,0,.08); color: color-mix(in srgb, var(--product-color) 75%, #18312f); background: linear-gradient(160deg, white 0 47%, color-mix(in srgb, var(--product-color) 72%, white) 48% 72%, white 73%); text-align: center; }
.facing-face:last-child { border-right: 0; }
.facing-face strong { max-width: 90%; overflow: hidden; font-size: clamp(5px, .65vw, 8px); line-height: 1.05; text-overflow: ellipsis; white-space: nowrap; }
.facing-face small { margin-top: 24%; max-width: 90%; overflow: hidden; font-size: clamp(4px, .5vw, 6px); text-overflow: ellipsis; white-space: nowrap; }
.plan-product-controls { position: absolute; z-index: 5; inset: 4px 4px auto auto; display: flex; gap: 3px; opacity: 0; transition: opacity .15s; }
.plan-product:hover .plan-product-controls, .plan-product.is-selected .plan-product-controls { opacity: 1; }
.plan-product-controls button { display: grid; place-items: center; width: 19px; height: 19px; padding: 0; border-radius: 6px; background: rgba(12,49,46,.86); color: white; cursor: pointer; font-size: 9px; }
.facing-controls { position: absolute; left: 50%; bottom: 4px; z-index: 5; display: none; align-items: center; gap: 4px; padding: 2px 4px; border-radius: 8px; background: rgba(12,49,46,.9); color: white; transform: translateX(-50%); }
.facing-mode .facing-controls, .plan-product.is-selected .facing-controls { display: flex; }
.facing-controls button { width: 16px; height: 16px; padding: 0; border-radius: 4px; background: white; color: var(--green-950); cursor: pointer; font-size: 10px; }
.facing-controls span { min-width: 14px; text-align: center; font-size: 8px; font-weight: 850; }
.empty-space { display: grid; place-items: center; align-self: stretch; flex: 1; min-width: 28px; border: 1px dashed #c6c2b8; border-radius: 5px; color: #aaa69b; font-size: 8px; }
.overflow-products { margin-top: 12px; padding: 13px; border: 1px solid #efd7a8; border-radius: 12px; background: var(--amber-soft); color: #866118; font-size: 11px; }

.mobile-nav { display: none; }

/* Dialogs */
.app-dialog { width: min(560px, calc(100vw - 28px)); max-height: calc(100dvh - 28px); padding: 0; overflow: auto; border: 0; border-radius: 24px; background: var(--paper); color: var(--ink); box-shadow: 0 30px 100px rgba(7,40,36,.28); }
.app-dialog::backdrop { background: rgba(8,35,32,.58); backdrop-filter: blur(5px); }
.dialog-close { position: absolute; z-index: 10; top: 15px; right: 15px; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: rgba(255,255,255,.9); color: var(--ink); cursor: pointer; font-size: 22px; box-shadow: 0 4px 12px rgba(0,0,0,.08); }
.dialog-close.light { background: rgba(10,35,32,.6); color: white; }
.wide-dialog { width: min(980px, calc(100vw - 28px)); }
.small-dialog { width: min(440px, calc(100vw - 28px)); padding: 34px; }
.small-dialog h2 { margin: 7px 0 7px; font-size: 25px; }
.small-dialog > p { margin: 0 0 22px; color: var(--ink-soft); font-size: 12px; line-height: 1.5; }
.small-dialog label { display: grid; gap: 7px; margin-bottom: 14px; }
.small-dialog label > span { font-size: 11px; font-weight: 750; }
.small-dialog input, .small-dialog select { width: 100%; min-height: 43px; padding: 0 12px; border: 1px solid var(--line); border-radius: 10px; background: white; color: var(--ink); }

.login-dialog { width: min(430px, calc(100vw - 28px)); padding: 38px; }
.login-dialog::backdrop { background: linear-gradient(135deg, rgba(7,31,29,.91), rgba(18,63,58,.78)); }
.login-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 35px; color: var(--green-900); font-size: 20px; }
.login-brand .brand-mark { background: var(--green-900); }
.login-brand .brand-mark i { background: var(--mint); }
.login-dialog h2 { margin: 7px 0 7px; font-size: 29px; letter-spacing: -1px; }
.login-dialog > p { margin: 0 0 24px; color: var(--ink-soft); font-size: 12px; line-height: 1.5; }
.login-dialog form { display: grid; gap: 15px; }
.login-dialog label { display: grid; gap: 7px; }
.login-dialog label span { font-size: 10px; font-weight: 800; }
.login-dialog input { width: 100%; min-height: 46px; padding: 0 13px; border: 1px solid var(--line); border-radius: 11px; background: white; color: var(--ink); }
.login-note { display: block; margin-top: 20px; padding: 12px; border-radius: 10px; background: var(--mint-2); color: var(--ink-soft); font-size: 8px; line-height: 1.5; }
.form-error { margin: -5px 0 0; padding: 9px 11px; border-radius: 9px; background: var(--coral-soft); color: #9e4434; font-size: 9px; }

.tutorial-dialog { overflow: hidden; }
.tutorial-progress { display: flex; gap: 5px; padding: 17px 20px 0; }
.tutorial-progress span { flex: 1; height: 4px; border-radius: 10px; background: #e7ebe8; }
.tutorial-progress span.is-active { background: var(--green-700); }
.tutorial-slides { min-height: 545px; }
.tutorial-slide { display: none; padding: 15px 38px 15px; text-align: center; animation: tutorialIn .3s ease; }
.tutorial-slide.is-active { display: block; }
@keyframes tutorialIn { from { opacity: 0; transform: translateX(12px); } }
.tutorial-slide h2 { margin: 7px 0 9px; font-size: 27px; letter-spacing: -.8px; }
.tutorial-slide > p { max-width: 430px; margin: 0 auto; color: var(--ink-soft); font-size: 13px; line-height: 1.55; }
.tutorial-visual { position: relative; height: 330px; margin-bottom: 17px; overflow: hidden; border-radius: 20px; background: linear-gradient(145deg, #e2f2ea, #f1eee4); }
.tutorial-actions { display: flex; align-items: center; justify-content: space-between; padding: 17px 25px 22px; border-top: 1px solid var(--line); }
.visual-badge { position: absolute; left: 50%; bottom: 18px; z-index: 4; min-width: 180px; padding: 9px 13px; border-radius: 20px; background: white; box-shadow: 0 6px 20px rgba(18,63,58,.13); transform: translateX(-50%); font-size: 10px; font-weight: 850; }
.visual-badge.good { color: var(--green-700); }
.visual-badge.warning { color: #9b6910; }
.camera-frame { position: absolute; inset: 48px 70px 52px; display: grid; place-items: center; border: 2px solid rgba(31,113,103,.26); border-radius: 8px; }
.camera-frame > i, .scan-brackets > i, .scanner-frame > i { position: absolute; width: 30px; height: 30px; border-color: var(--green-700); border-style: solid; }
.camera-frame > i:nth-child(1), .scan-brackets > i:nth-child(1), .scanner-frame > i:nth-child(1) { left: -3px; top: -3px; border-width: 4px 0 0 4px; border-radius: 7px 0 0 0; }
.camera-frame > i:nth-child(2), .scan-brackets > i:nth-child(2), .scanner-frame > i:nth-child(2) { right: -3px; top: -3px; border-width: 4px 4px 0 0; border-radius: 0 7px 0 0; }
.camera-frame > i:nth-child(3), .scan-brackets > i:nth-child(3), .scanner-frame > i:nth-child(3) { left: -3px; bottom: -3px; border-width: 0 0 4px 4px; border-radius: 0 0 0 7px; }
.camera-frame > i:nth-child(4), .scan-brackets > i:nth-child(4), .scanner-frame > i:nth-child(4) { right: -3px; bottom: -3px; border-width: 0 4px 4px 0; border-radius: 0 0 7px 0; }
.mini-shelf { width: 210px; height: 160px; padding: 8px 16px; border: 9px solid #d0c6b6; border-bottom-width: 13px; background: #f8f6ee; box-shadow: 0 14px 18px rgba(58,51,38,.13); }
.mini-shelf b { display: block; height: 46px; border-bottom: 7px solid #c9c0b1; background: repeating-linear-gradient(90deg, #80b7ad 0 17px, transparent 17px 20px, #e6b578 20px 37px, transparent 37px 40px); }

.scan-tutorial { display: grid; place-items: center; background: linear-gradient(145deg, #183e3b, #0e2f2c); }
.pack-demo { position: relative; z-index: 2; width: 112px; height: 162px; overflow: hidden; display: flex; flex-direction: column; justify-content: center; align-items: center; border-radius: 5px 9px 4px 4px; background: white; box-shadow: 10px 14px 25px rgba(0,0,0,.22); color: var(--green-900); }
.pack-demo span { z-index: 1; font-size: 10px; font-weight: 900; letter-spacing: 1px; }
.pack-demo i { position: absolute; left: -20px; right: -20px; top: 54px; height: 58px; background: #eca75c; transform: rotate(-7deg); }
.pack-demo small { z-index: 1; margin-top: 52px; font-size: 9px; font-weight: 800; }
.pack-demo.blue i { background: #76afc8; }
.scan-brackets { position: absolute; width: 190px; height: 220px; }
.scan-brackets > i, .scanner-frame > i { border-color: #9cdec9; }
.scan-brackets b, .scanner-frame b { position: absolute; left: 6px; right: 6px; top: 48%; height: 2px; background: #83e3c6; box-shadow: 0 0 12px #83e3c6; animation: scanLine 2.2s ease-in-out infinite; }
@keyframes scanLine { 0%,100% { transform: translateY(-65px); } 50% { transform: translateY(65px); } }

.measure-tutorial { display: grid; place-items: center; }
.paper-a4 { position: relative; width: 190px; height: 268px; display: grid; place-items: center; background: white; box-shadow: 0 10px 22px rgba(38,55,51,.14); transform: perspective(500px) rotateX(2deg); }
.paper-a4 .pack-demo { width: 73px; height: 112px; box-shadow: 5px 7px 12px rgba(0,0,0,.15); }
.paper-a4 .pack-demo span { font-size: 7px; }
.paper-a4 .pack-demo small { margin-top: 37px; font-size: 6px; }
.corner { position: absolute; width: 18px; height: 18px; border-color: #3ab287; border-style: solid; z-index: 4; }
.corner.tl { top: -2px; left: -2px; border-width: 3px 0 0 3px; }
.corner.tr { top: -2px; right: -2px; border-width: 3px 3px 0 0; }
.corner.bl { bottom: -2px; left: -2px; border-width: 0 0 3px 3px; }
.corner.br { bottom: -2px; right: -2px; border-width: 0 3px 3px 0; }
.phone-shadow { position: absolute; width: 88px; height: 120px; right: -37px; top: 45px; border-radius: 18px; background: rgba(34,47,44,.15); filter: blur(8px); transform: rotate(-8deg); }
.light-arrow { position: absolute; top: 28px; left: 25px; display: grid; gap: 3px; color: #c08318; font-size: 20px; }
.light-arrow span { font-size: 8px; font-weight: 800; text-transform: uppercase; }
.optimize-tutorial { display: grid; place-items: center; }
.tiny-plan { width: 275px; padding: 15px 15px 6px; border-radius: 11px 11px 3px 3px; background: rgba(255,255,255,.66); box-shadow: 0 18px 30px rgba(18,63,58,.13); }
.tiny-plan div { display: flex; align-items: end; gap: 4px; height: 67px; padding: 5px 8px 0; border-bottom: 7px solid #c8bfb0; }
.tiny-plan i { flex: 1; height: 49px; border-radius: 3px 4px 0 0; background: #83b7cb; box-shadow: inset -4px 0 rgba(0,0,0,.04); }
.tiny-plan i.orange { background: #f0ae65; }.tiny-plan i.pink { background: #e7a8b6; }.tiny-plan i.yellow { background: #ead676; }.tiny-plan i.green { background: #8fc2ad; }
.sparkle { position: absolute; color: #d69b26; animation: sparkle 1.6s ease-in-out infinite; }
.sparkle.one { top: 50px; right: 75px; font-size: 24px; }.sparkle.two { top: 100px; left: 70px; animation-delay: .5s; }
@keyframes sparkle { 50% { opacity: .25; transform: scale(.7) rotate(20deg); } }

.wizard-header { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 28px 34px 20px; border-bottom: 1px solid var(--line); }
.wizard-header h2 { margin: 5px 0 0; font-size: 24px; }
.wizard-steps { display: flex; align-items: center; }
.wizard-steps span { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: #e5ebe7; color: var(--ink-soft); font-size: 10px; font-weight: 850; }
.wizard-steps span.is-active { background: var(--green-700); color: white; }
.wizard-steps i { width: 28px; height: 2px; background: #dde4df; }
.wizard-page { display: none; min-height: 495px; padding: 28px 34px; }
.wizard-page.is-active { display: block; }
.wizard-footer { display: flex; justify-content: space-between; align-items: center; padding: 17px 34px; border-top: 1px solid var(--line); }
.capture-zone { display: grid; grid-template-columns: 1fr auto; gap: 12px; margin-bottom: 22px; padding: 18px; border: 1.5px dashed #abc4bb; border-radius: 16px; background: var(--mint-2); }
.shelf-preview { position: relative; min-height: 210px; overflow: hidden; display: flex; flex-direction: column; align-items: center; justify-content: center; border-radius: 12px; background: linear-gradient(145deg, #d8e9e2, #eff3eb); color: var(--ink-soft); text-align: center; }
.shelf-preview.has-image { background-size: cover; background-position: center; }
.shelf-preview.has-image > .round-icon, .shelf-preview.has-image > strong, .shelf-preview.has-image > small { display: none; }
.shelf-preview strong { margin: 10px 0 4px; color: var(--ink); font-size: 12px; }
.shelf-preview small { font-size: 9px; }
.detected-frame { position: absolute; inset: 12%; display: none; border: 2px solid #59d5aa; }
.shelf-preview.has-image .detected-frame { display: block; }
.detected-frame > i { position: absolute; width: 15px; height: 15px; border: 3px solid white; border-radius: 50%; background: #43b98e; transform: translate(-50%,-50%); }
.detected-frame > i:nth-child(1) { left: 0; top: 0; }.detected-frame > i:nth-child(2) { left: 100%; top: 0; }.detected-frame > i:nth-child(3) { left: 0; top: 100%; }.detected-frame > i:nth-child(4) { left: 100%; top: 100%; }
.detected-shelves { position: absolute; inset: 5%; display: grid; grid-template-rows: repeat(3, 1fr); }
.detected-shelves b { border-bottom: 2px dashed rgba(89,213,170,.9); }
.capture-zone > button { align-self: end; }
.form-grid { display: grid; gap: 15px; }
.form-grid.two { grid-template-columns: repeat(2, minmax(0,1fr)); }
.form-grid label, .small-dialog label { color: var(--ink); }
.form-grid label > span { display: block; margin-bottom: 6px; font-size: 10px; font-weight: 750; }
.form-grid input, .form-grid select { width: 100%; min-height: 42px; padding: 0 12px; border: 1px solid var(--line); border-radius: 10px; background: white; color: var(--ink); }
.unit-input { position: relative; }
.unit-input input { padding-right: 45px; }
.unit-input b { position: absolute; right: 12px; top: 50%; color: var(--ink-soft); font-size: 10px; transform: translateY(-50%); }
.stepper { display: grid; grid-template-columns: 40px 1fr 40px; }
.stepper input { border-radius: 0; text-align: center; }
.stepper button { border: 1px solid var(--line); background: white; cursor: pointer; }
.stepper button:first-child { border-radius: 10px 0 0 10px; }.stepper button:last-child { border-radius: 0 10px 10px 0; }
.quality-strip { display: flex; align-items: center; gap: 11px; margin-top: 17px; padding: 11px 13px; border-radius: 11px; background: var(--mint-2); }
.quality-dot { width: 9px; height: 9px; flex: 0 0 auto; border-radius: 50%; }
.quality-dot.good { background: #42ae7d; box-shadow: 0 0 0 4px rgba(66,174,125,.14); }
.quality-strip strong, .quality-strip small { display: block; }
.quality-strip strong { font-size: 10px; }.quality-strip small { margin-top: 2px; color: var(--ink-soft); font-size: 8px; }
.wizard-two-columns { display: grid; grid-template-columns: minmax(0,1.4fr) minmax(260px,.7fr); gap: 22px; }
.wizard-product-list { max-height: 390px; overflow: auto; margin-top: 14px; }
.wizard-product-row, .suggested-row { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid #edf0ed; }
.mini-pack { width: 35px; height: 48px; border-radius: 3px; background: linear-gradient(160deg, white 0 43%, var(--product-color) 44% 70%, white 71%); box-shadow: 2px 3px 6px rgba(0,0,0,.11); }
.wizard-product-row strong, .wizard-product-row small, .suggested-row strong, .suggested-row small { display: block; }
.wizard-product-row strong, .suggested-row strong { font-size: 10px; }.wizard-product-row small, .suggested-row small { margin-top: 2px; color: var(--ink-soft); font-size: 8px; }
.wizard-product-row button, .suggested-row button { display: grid; place-items: center; width: 27px; height: 27px; border-radius: 8px; background: var(--mint); color: var(--green-700); cursor: pointer; }
.suggestion-panel { padding: 18px; border-radius: 15px; background: var(--mint-2); }
.suggestion-panel h3 { margin: 5px 0; font-size: 15px; }.suggestion-panel > p { margin: 0 0 12px; color: var(--ink-soft); font-size: 9px; line-height: 1.4; }
.rule-choice-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 12px; }
.rule-choice { position: relative; min-height: 130px; padding: 18px; border: 1.5px solid var(--line); border-radius: 15px; background: white; cursor: pointer; text-align: left; }
.rule-choice.is-selected { border-color: var(--green-700); background: var(--mint-2); }
.rule-choice > strong, .rule-choice > small { display: block; }.rule-choice > strong { margin: 12px 0 4px; font-size: 12px; }.rule-choice > small { color: var(--ink-soft); font-size: 9px; }
.rule-choice > i { position: absolute; right: 12px; top: 12px; display: none; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--green-700); color: white; font-size: 9px; font-style: normal; font-weight: 800; }
.rule-choice.is-selected > i { display: grid; }
.choice-icon { display: grid; place-items: center; width: 35px; height: 35px; border-radius: 10px; background: var(--mint); color: var(--green-700); font-weight: 850; }
.color-wheel { background: conic-gradient(#ed765f, #f1c75b, #63b48c, #6aa8d0, #c28ed5, #ed765f); }
.toggle-row.emphasized { margin: 16px 0; padding: 15px; border: 0; border-radius: 13px; background: #f7f8f5; }
.compact-grid { max-width: 520px; }

.scanner-dialog { overflow: hidden; width: min(520px, calc(100vw - 20px)); background: #0a2826; color: white; }
.scanner-surface { position: relative; min-height: 500px; overflow: hidden; display: grid; place-items: center; background: radial-gradient(circle at center, #295c55, #071d1b 70%); }
.scanner-surface video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: none; }
.scanner-surface.has-video video { display: block; }
.scanner-placeholder { opacity: .3; }
.barcode-art { display: flex; align-items: center; gap: 5px; height: 90px; }
.barcode-art i { width: 6px; height: 100%; background: white; }.barcode-art i:nth-child(2), .barcode-art i:nth-child(5) { width: 13px; }.barcode-art i:nth-child(3), .barcode-art i:nth-child(7) { height: 78%; }
.scanner-frame { position: absolute; width: 73%; height: 190px; top: 155px; }
.scanner-copy { position: absolute; left: 0; right: 0; top: 38px; text-align: center; }
.scanner-copy h2 { margin: 12px 0 5px; font-size: 24px; }.scanner-copy p { margin: 0; color: rgba(255,255,255,.65); font-size: 11px; }
.scanner-controls { padding: 19px 24px 22px; background: var(--paper); color: var(--ink); }
.scan-result { display: flex; align-items: center; gap: 11px; min-height: 58px; padding: 9px 12px; border-radius: 12px; background: var(--mint-2); }
.scan-result strong, .scan-result small { display: block; }.scan-result strong { font-size: 11px; }.scan-result small { margin-top: 3px; color: var(--ink-soft); font-size: 8px; }
.scan-result.found { background: #e5f6eb; animation: flashFound .5s ease; }
@keyframes flashFound { 50% { transform: scale(1.015); } }
.manual-barcode { margin: 15px 0; }
.manual-barcode label { display: block; margin-bottom: 6px; color: var(--ink-soft); font-size: 9px; }
.manual-barcode > div { display: grid; grid-template-columns: 1fr auto; gap: 7px; }
.manual-barcode input { min-width: 0; min-height: 43px; padding: 0 12px; border: 1px solid var(--line); border-radius: 10px; }

.measure-layout { display: grid; grid-template-columns: minmax(0,1.15fr) minmax(340px,.85fr); min-height: 650px; }
.measure-camera { position: relative; min-height: 650px; display: grid; place-items: center; overflow: hidden; background: linear-gradient(145deg, #cdd5ce, #9faea5); }
.measure-preview { position: absolute; inset: 0; display: grid; place-items: center; background-size: cover; background-position: center; }
.paper-detection { position: relative; width: 286px; height: 405px; display: grid; place-items: center; background: #fffef9; box-shadow: 0 20px 38px rgba(31,45,40,.22); }
.product-silhouette { position: relative; z-index: 2; width: 114px; height: 175px; display: grid; place-items: center; border: 2px solid #63d4a9; border-radius: 6px; background: linear-gradient(160deg, white 0 45%, #83b8cd 46% 70%, white 71%); color: #487a8f; box-shadow: 5px 7px 13px rgba(0,0,0,.14); font-size: 9px; font-weight: 850; }
.shadow-overlay { position: absolute; width: 130px; height: 220px; top: 82px; right: -50px; border-radius: 50%; background: rgba(25,35,32,.15); filter: blur(18px); opacity: 0; transition: opacity .2s; }
.measure-preview.shadow-risk .shadow-overlay { opacity: 1; }
.camera-level { position: absolute; top: 20px; left: 50%; width: 95px; height: 28px; border-radius: 20px; background: rgba(8,31,29,.68); transform: translateX(-50%); }
.camera-level span { position: absolute; left: 50%; top: 50%; width: 5px; height: 5px; border-radius: 50%; background: white; transform: translate(-50%,-50%); }
.camera-level i { position: absolute; left: 50%; top: 50%; width: 17px; height: 17px; border: 2px solid #68d7af; border-radius: 50%; transform: translate(-50%,-50%); }
.camera-button { position: absolute; z-index: 3; bottom: 24px; left: 50%; transform: translateX(-50%); white-space: nowrap; }
.camera-button:hover { transform: translateX(-50%) translateY(-1px); }
.measure-panel { padding: 46px 34px 30px; }
.measure-panel h2 { margin: 7px 0 8px; font-size: 27px; letter-spacing: -.8px; }
.measure-panel > p { margin: 0 0 21px; color: var(--ink-soft); font-size: 11px; line-height: 1.55; }
.template-download { display: flex; align-items: center; gap: 11px; margin: -8px 0 18px; padding: 10px 12px; border: 1px solid #c9ddd5; border-radius: 12px; background: var(--mint-2); color: var(--green-900); text-decoration: none; transition: border-color .15s ease, transform .15s ease, background .15s ease; }
.template-download:hover { border-color: var(--mint); background: #e4f5ed; transform: translateY(-1px); }
.template-download > span:first-child { display: grid; place-items: center; width: 30px; height: 30px; flex: 0 0 30px; border-radius: 9px; background: var(--green-700); color: white; font-size: 18px; font-weight: 850; }
.template-download > span:last-child { display: grid; gap: 2px; }
.template-download strong { font-size: 10px; }
.template-download small { color: var(--ink-soft); font-size: 8px; }
.capture-checks { display: grid; gap: 8px; }
.capture-checks span { display: flex; align-items: center; gap: 9px; color: var(--ink-soft); font-size: 10px; }
.capture-checks i { display: grid; place-items: center; width: 21px; height: 21px; border-radius: 50%; background: var(--mint); color: var(--green-700); font-style: normal; font-size: 9px; font-weight: 900; }
.capture-checks span.is-pending { color: #899895; }
.capture-checks span.is-pending i { background: #edf0ed; color: #899895; }
.capture-checks span.is-warning { color: #96650f; }.capture-checks span.is-warning i { background: var(--amber-soft); color: #a66f0d; }
.measure-warning { display: grid; gap: 3px; margin: 15px 0; padding: 12px; border-radius: 11px; background: var(--amber-soft); color: #855e12; }
.measure-warning strong { font-size: 10px; }.measure-warning span { font-size: 8px; line-height: 1.4; }
.measurement-result { display: grid; grid-template-columns: repeat(3,1fr); gap: 7px; margin: 20px 0 15px; }
.measurement-result > div { padding: 11px 8px; border-radius: 10px; background: #f5f6f3; text-align: center; }
.measurement-result span { display: block; min-height: 22px; color: var(--ink-soft); font-size: 7px; line-height: 1.3; }.measurement-result strong { font-size: 21px; }.measurement-result small { margin-left: 2px; color: var(--ink-soft); font-size: 7px; }

.product-dialog { width: min(620px, calc(100vw - 28px)); }
.product-detail { display: grid; grid-template-columns: 210px 1fr; min-height: 410px; }
.product-detail-visual { display: grid; place-items: center; background: linear-gradient(145deg, color-mix(in srgb, var(--product-color) 15%, white), #f4f2eb); }
.product-detail-visual .product-pack { width: 108px; height: 155px; }
.product-detail-body { padding: 40px 30px 25px; }
.product-detail-body h2 { margin: 7px 0 5px; font-size: 25px; }.product-detail-body > p { margin: 0; color: var(--ink-soft); font-size: 11px; }
.detail-grid { display: grid; grid-template-columns: repeat(2,1fr); gap: 9px; margin: 20px 0; }
.detail-grid div { padding: 10px; border-radius: 10px; background: #f5f6f3; }.detail-grid span, .detail-grid strong { display: block; }.detail-grid span { color: var(--ink-soft); font-size: 8px; }.detail-grid strong { margin-top: 3px; font-size: 11px; }
.palette { display: flex; gap: 7px; margin: 8px 0 18px; }.palette i { width: 27px; height: 27px; border: 3px solid white; border-radius: 50%; background: var(--swatch); box-shadow: 0 0 0 1px var(--line); }
.source-note { padding: 10px; border-radius: 10px; background: var(--mint-2); color: var(--green-700); font-size: 9px; line-height: 1.4; }

.team-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 15px; }
.member-card { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px; }
.avatar.large { width: 45px; height: 45px; border-radius: 14px; }.avatar.coral { background: #f6c4b9; color: #893d30; }
.member-card strong { font-size: 12px; }.member-card p { margin: 4px 0 0; color: var(--ink-soft); font-size: 9px; }
.status-badge { padding: 5px 8px; border-radius: 20px; background: #edf0ed; color: var(--ink-soft); font-size: 8px; font-weight: 800; }.status-badge.online { background: var(--mint); color: var(--green-700); }
.invite-card { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 120px; border-style: dashed; cursor: pointer; text-align: center; }
.invite-card > span { font-size: 23px; color: var(--green-700); }.invite-card strong { margin: 7px 0 3px; font-size: 11px; }.invite-card small { color: var(--ink-soft); font-size: 8px; }

.toast-region { position: fixed; z-index: 1000; right: 20px; bottom: 20px; display: grid; gap: 8px; pointer-events: none; }
.toast { min-width: 260px; padding: 13px 16px; border-radius: 12px; background: var(--green-950); color: white; box-shadow: var(--shadow); font-size: 11px; animation: toastIn .25s ease; }
.toast strong, .toast small { display: block; }.toast small { margin-top: 3px; color: rgba(255,255,255,.66); }
@keyframes toastIn { from { opacity: 0; transform: translateY(10px); } }

@media (max-width: 1180px) {
    :root { --sidebar: 214px; }
    .main-content { padding-inline: 24px; }
    .welcome-copy { width: 63%; padding: 28px; }
    .hero-planogram { right: 18px; width: 35%; }
    .product-grid { grid-template-columns: repeat(3,minmax(0,1fr)); }
    .stats-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
    .planogram-workspace { grid-template-columns: 230px minmax(0,1fr); }
}

@media (max-width: 900px) {
    :root { --sidebar: 76px; }
    .sidebar { padding-inline: 10px; }
    .brand { justify-content: center; padding-inline: 0; }.brand > span:last-child, .nav-item span:last-child, .sidebar-card, .pharmacy-card > span:not(.avatar) { display: none; }
    .nav-item { justify-content: center; padding: 0; }.pharmacy-card { display: flex; justify-content: center; padding-inline: 0; }
    .hero-grid, .content-grid { grid-template-columns: 1fr; }
    .capture-card { min-height: auto; }.capture-card p { margin: 18px 0; }
    .project-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
    .planogram-workspace { grid-template-columns: 1fr; }
    .rules-panel { display: none; }.rules-panel.is-open { display: block; }
    .planogram-stage { padding-inline: 16px; }
    .measure-layout { grid-template-columns: 1fr; }.measure-camera { min-height: 500px; }.measure-panel { padding-top: 30px; }
    .team-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
}

@media (max-width: 680px) {
    :root { --radius-xl: 20px; --radius-lg: 16px; }
    body { padding-bottom: 78px; }
    .sidebar { display: none; }
    .main-content { margin-left: 0; padding: 0 15px 36px; }
    .topbar { min-height: 78px; }.topbar .eyebrow { display: none; }.topbar h1 { font-size: 23px; }.sync-state { display: none; }.topbar-actions .primary-button { display: none; }
    .mobile-nav { position: fixed; z-index: 30; left: 10px; right: 10px; bottom: max(10px, env(safe-area-inset-bottom)); display: grid; grid-template-columns: repeat(5,1fr); align-items: center; min-height: 62px; padding: 6px 7px; border: 1px solid rgba(255,255,255,.5); border-radius: 19px; background: rgba(12,49,46,.96); color: white; box-shadow: 0 16px 45px rgba(8,35,32,.28); backdrop-filter: blur(15px); }
    .mobile-nav button { display: grid; place-items: center; gap: 2px; min-height: 46px; border-radius: 12px; background: transparent; color: rgba(255,255,255,.6); }.mobile-nav button.is-active { color: white; background: rgba(255,255,255,.1); }.mobile-nav span { font-size: 17px; }.mobile-nav small { font-size: 7px; }
    .mobile-nav .scan-fab { width: 52px; height: 52px; min-height: 52px; margin: -20px auto 0; border: 5px solid var(--cream); border-radius: 50%; background: var(--mint); color: var(--green-950); font-size: 21px; box-shadow: 0 7px 16px rgba(0,0,0,.25); }
    .welcome-card { min-height: 420px; }.welcome-copy { width: 100%; padding: 27px 23px; }.welcome-copy h2 { font-size: 35px; }.welcome-copy p { width: 90%; }.hero-planogram { right: 18px; bottom: 18px; width: 65%; opacity: .9; }
    .stats-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 9px; }.stat-card { min-height: 105px; padding: 15px; }.stat-card strong { font-size: 25px; }
    .panel { padding: 18px; }.donut-wrap { gap: 18px; }
    .section-heading { align-items: flex-start; flex-direction: column; margin-top: 4px; }.section-heading h2 { font-size: 31px; }.section-heading > .primary-button, .section-heading .section-actions { width: 100%; }.section-heading .section-actions > button { flex: 1; }
    .project-grid, .product-grid, .team-grid { grid-template-columns: 1fr; }.product-card { min-height: 260px; display: grid; grid-template-columns: 42% 1fr; }.product-card-visual { min-height: 220px; grid-row: span 2; }.product-card-footer { grid-column: 2; }.product-pack { width: 76px; height: 112px; }
    .catalog-toolbar { align-items: stretch; flex-direction: column; }.filter-chips { width: calc(100vw - 30px); }
    .planogram-heading .section-actions { display: grid; grid-template-columns: repeat(2,1fr); }.planogram-heading .section-actions .primary-button { grid-column: span 2; }
    .stage-toolbar { align-items: flex-start; flex-direction: column; }.stage-legend { width: 100%; justify-content: space-between; }.planogram-stage { margin-inline: -15px; border-radius: 0; border-inline: 0; padding: 18px 12px 28px; }.shelf-unit { min-width: 600px; }
    .tutorial-dialog { width: calc(100vw - 16px); max-height: calc(100dvh - 16px); }.tutorial-slides { min-height: 510px; }.tutorial-slide { padding: 12px 18px; }.tutorial-visual { height: 300px; }.camera-frame { inset-inline: 35px; }.tutorial-slide h2 { font-size: 24px; }
    .wide-dialog { width: calc(100vw - 10px); max-height: calc(100dvh - 10px); border-radius: 20px; }.wizard-header { align-items: flex-start; padding: 24px 20px 16px; }.wizard-header h2 { padding-right: 35px; font-size: 21px; }.wizard-steps { display: none; }.wizard-page { min-height: auto; padding: 20px; }.wizard-footer { padding: 14px 20px; }
    .capture-zone { grid-template-columns: 1fr; }.shelf-preview { min-height: 180px; }.form-grid.two, .rule-choice-grid { grid-template-columns: 1fr; }.wizard-two-columns { grid-template-columns: 1fr; }.suggestion-panel { display: none; }
    .scanner-dialog { width: 100vw; height: 100dvh; max-height: none; border-radius: 0; }.scanner-surface { min-height: 63dvh; }.scanner-frame { top: 28%; height: 180px; }.scanner-copy { top: 8%; }
    .measure-dialog { width: 100vw; height: 100dvh; max-height: none; border-radius: 0; }.measure-layout { display: block; }.measure-camera { min-height: 55dvh; }.paper-detection { width: 205px; height: 290px; }.product-silhouette { width: 82px; height: 125px; }.measure-panel { padding: 25px 20px 28px; }.measure-panel h2 { font-size: 23px; }.capture-checks { grid-template-columns: repeat(2,1fr); }.capture-checks span { font-size: 8px; }.measurement-result { margin-top: 15px; }
    .product-detail { grid-template-columns: 1fr; }.product-detail-visual { min-height: 210px; }.product-detail-body { padding: 25px 22px; }
    .toast-region { left: 14px; right: 14px; bottom: 88px; }.toast { min-width: 0; width: 100%; }
}

@media print {
    body { background: white; }.sidebar, .topbar, .mobile-nav, .rules-panel, .stage-toolbar, .section-heading .section-actions { display: none !important; }.main-content { margin: 0; padding: 0; }.view { display: none !important; }.view[data-view-panel="planogram"] { display: block !important; }.section-heading { margin: 0 0 12px; }.planogram-workspace { display: block; }.planogram-stage { overflow: visible; border: 0; background: white; padding: 0; }.shelf-unit { min-width: 0; break-inside: avoid; }.shelf-products { box-shadow: none; }.plan-product-controls, .facing-controls { display: none !important; }
}

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