/* b2b.solarmd.eu: the AdminLTE-style shell from ~/public/olt-styleguide (src/sidebar.html) on top of
   olt-control's app.css (css/app.css, an unchanged copy), then the Solar MD brand layer at the end.
   Shell: dark sidebar on the left (full, icons only, or slide-in on phones), sticky top bar, tiles, cards.
   The sidebar sizes are the shell's; every colour token is set in the brand layer. */

:root {
    --side-w: 15.5rem;
    --side-mini: 4.25rem;
    --nav-h: 3.4rem;
}

.ico {
    width: 1.15rem;
    height: 1.15rem;
    flex: none;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.5;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* Shell */

.app {
    display: grid;
    grid-template-columns: var(--side-w) minmax(0, 1fr);
    min-height: 100vh;
}

.app.is-mini {
    --side-w: var(--side-mini);
}

.main {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

/* Sidebar */

.sidebar {
    position: sticky;
    top: env(safe-area-inset-top, 0px);
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    overflow-y: auto;
    background: var(--side-bg);
    color: var(--side-ink);
    color-scheme: dark;
    z-index: 30;
}

.side-brand {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    min-height: var(--nav-h);
    padding: 0 1.25rem;
    border-bottom: 1px solid var(--side-line);
    color: #ffffff;
    font-family: var(--font-label);
    font-size: 1.15rem;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
}

.side-brand .brand-mark {
    width: 1.6rem;
    height: 1.6rem;
    flex: none;
}

.side-user {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.9rem 1.1rem;
    border-bottom: 1px solid var(--side-line);
    white-space: nowrap;
}

.avatar {
    display: inline-grid;
    place-items: center;
    width: 2.1rem;
    height: 2.1rem;
    flex: none;
    border-radius: 50%;
    background: var(--side-active);
    color: var(--side-active-ink);
    font-family: var(--font-label);
    font-size: 0.85rem;
    font-weight: 600;
}

.side-user div {
    display: grid;
    line-height: 1.25;
    min-width: 0;
}

.side-user strong {
    color: #ffffff;
    font-weight: 600;
}

.side-user small {
    color: var(--side-muted);
    font-size: 0.78rem;
}

.side-nav {
    list-style: none;
    margin: 0;
    padding: 0.6rem 0.6rem 1rem;
    display: grid;
    gap: 2px;
}

.nav-header {
    padding: 0.9rem 0.65rem 0.35rem;
    color: var(--side-muted);
    font-family: var(--font-label);
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    white-space: nowrap;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    width: 100%;
    padding: 0.5rem 0.65rem;
    border: 0;
    border-radius: var(--radius);
    background: none;
    color: var(--side-ink);
    font: inherit;
    font-size: 0.92rem;
    text-align: left;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
}

.nav-link:hover {
    background: var(--side-hover);
    color: #ffffff;
}

.nav-link[aria-current="page"] {
    background: var(--side-active);
    color: var(--side-active-ink);
}

.nav-text {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}

.nav-badge {
    padding: 0 0.45rem;
    border-radius: 1rem;
    background: var(--warn);
    color: #1b1300;
    font-family: var(--font-label);
    font-size: 0.72rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    line-height: 1.5;
}

.nav-chev {
    width: 0.9rem;
    height: 0.9rem;
    transition: transform 0.15s;
}

.has-tree.is-open > .nav-link .nav-chev {
    transform: rotate(90deg);
}

.nav-tree {
    list-style: none;
    margin: 2px 0 0;
    padding: 0 0 0 0.7rem;
    display: grid;
    gap: 2px;
}

/* Without this, display: grid above beats the browser's [hidden] rule and a closed submenu stays visible. */
[hidden] {
    display: none !important;
}

.nav-tree .nav-link {
    font-size: 0.86rem;
    padding-block: 0.38rem;
}

.nav-meta {
    color: var(--side-muted);
    font-family: var(--font-mono);
    font-size: 0.72rem;
}

.nav-link[aria-current="page"] .nav-meta {
    color: inherit;
}

.side-foot {
    margin-top: auto;
    padding: 0.8rem 1.25rem 1rem;
    border-top: 1px solid var(--side-line);
    color: var(--side-muted);
    font-size: 0.78rem;
}

.side-foot strong {
    color: var(--side-ink);
    font-family: var(--font-mono);
    font-weight: 400;
}

/* Icons-only sidebar (desktop) */

@media (min-width: 992px) {
    .app.is-mini .side-brand {
        justify-content: center;
        padding: 0;
    }

    .app.is-mini .side-user {
        justify-content: center;
        padding-inline: 0;
    }

    .app.is-mini .side-brand span,
    .app.is-mini .side-user div,
    .app.is-mini .nav-text,
    .app.is-mini .nav-badge,
    .app.is-mini .nav-chev,
    .app.is-mini .nav-tree,
    .app.is-mini .side-foot {
        display: none;
    }

    .app.is-mini .nav-header {
        height: 1px;
        margin: 0.5rem 0.4rem;
        padding: 0;
        overflow: hidden;
        background: var(--side-line);
        color: transparent;
    }

    .app.is-mini .nav-link {
        justify-content: center;
        position: relative;
    }

    .app.is-mini .nav-item-badge > .nav-link::after {
        content: "";
        position: absolute;
        top: 0.35rem;
        right: 0.6rem;
        width: 0.45rem;
        height: 0.45rem;
        border-radius: 50%;
        background: var(--warn);
    }
}

/* Top bar */

.navbar {
    position: sticky;
    top: env(safe-area-inset-top, 0px);
    z-index: 20;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    min-height: var(--nav-h);
    padding: 0.4rem 1.25rem 0.4rem 0.75rem;
    background: var(--surface);
    border-bottom: 1px solid var(--line);
}

.icon-btn {
    position: relative;
    display: inline-grid;
    place-items: center;
    width: 2.3rem;
    height: 2.3rem;
    flex: none;
    border: 1px solid transparent;
    border-radius: var(--radius);
    background: none;
    color: var(--muted);
    cursor: pointer;
    text-decoration: none;
}

.icon-btn:hover {
    border-color: var(--line);
    color: var(--ink);
}

.icon-btn .ico {
    width: 1.3rem;
    height: 1.3rem;
}

.dot-count {
    position: absolute;
    top: 0.1rem;
    right: 0.05rem;
    min-width: 1.05rem;
    padding: 0 0.25rem;
    border-radius: 1rem;
    background: var(--warn);
    color: #1b1300;
    font-family: var(--font-label);
    font-size: 0.68rem;
    font-weight: 600;
    line-height: 1.05rem;
    text-align: center;
}

.nav-search {
    position: relative;
    flex: 0 1 20rem;
    min-width: 0;
}

.nav-search .ico {
    position: absolute;
    left: 0.6rem;
    top: 50%;
    translate: 0 -50%;
    color: var(--muted);
    pointer-events: none;
}

.nav-search input {
    padding-left: 2.1rem;
}

.nav-right {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.nav-who {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--ink);
    font-size: 0.875rem;
    text-decoration: none;
    white-space: nowrap;
}

.nav-who .avatar {
    width: 1.9rem;
    height: 1.9rem;
    background: var(--accent);
    color: var(--accent-ink);
    font-size: 0.78rem;
}

/* Content */

.content {
    flex: 1;
    display: grid;
    gap: 1.25rem;
    align-content: start;
    padding: 1.25rem 1.5rem 2rem;
    container-type: inline-size;
}

.content-head {
    display: flex;
    flex-wrap: wrap;
    align-items: end;
    justify-content: space-between;
    gap: 0.4rem 1rem;
}

.content-head h1 {
    text-wrap: balance;
}

.content-head p {
    margin: 0.2rem 0 0;
}

.crumbs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin: 0;
    padding: 0;
    list-style: none;
    font-size: 0.85rem;
    color: var(--muted);
}

.crumbs li + li::before {
    content: "/";
    margin-right: 0.4rem;
    color: var(--line);
}

.crumbs a {
    text-decoration: none;
}

/* Summary tiles */

.tiles {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 13rem), 1fr));
}

.tile {
    display: grid;
    grid-template-rows: auto auto 1fr auto;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    position: relative;
    min-width: 0;
}

.tile-label,
.tile-value,
.tile-sub {
    padding-inline: 1rem;
}

.tile-label {
    padding-top: 0.85rem;
    padding-right: 3rem;
    color: var(--muted);
    font-family: var(--font-label);
    font-size: 0.75rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.tile-value {
    font-family: var(--font-label);
    font-size: 2.1rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    line-height: 1.2;
}

.tile-value small {
    color: var(--muted);
    font-family: var(--font-body);
    font-size: 0.85rem;
    font-weight: 400;
}

.tile-sub {
    padding-bottom: 0.75rem;
    color: var(--muted);
    font-size: 0.82rem;
}

.tile > .ico {
    position: absolute;
    top: 0.85rem;
    right: 0.9rem;
    width: 1.9rem;
    height: 1.9rem;
    color: var(--line);
    stroke-width: 1.3;
}

.tile-more {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.45rem 1rem;
    border-top: 1px solid var(--line);
    background: var(--surface-sunk);
    border-radius: 0 0 var(--radius) var(--radius);
    font-size: 0.82rem;
    text-decoration: none;
}

.tile-more .ico {
    width: 0.95rem;
    height: 0.95rem;
}

.tile-warn .tile-value {
    color: var(--warn);
}

.tile-warn > .ico {
    color: color-mix(in srgb, var(--warn) 45%, var(--line));
}

/* Cards */

.card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    min-width: 0;
    scroll-margin-top: calc(var(--nav-h) + 1rem);
}

.card-head {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 0.6rem 0.6rem 1rem;
    border-bottom: 1px solid var(--line);
}

.card.is-collapsed .card-head {
    border-bottom: 0;
}

.card-title {
    flex: 1;
    min-width: 0;
    font-size: 1.05rem;
}

.card-title .muted {
    margin-left: 0.4rem;
    font-family: var(--font-body);
    font-size: 0.82rem;
    font-weight: 400;
}

.card-tools {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.card-tools .icon-btn {
    width: 2rem;
    height: 2rem;
}

.card-tools .icon-btn .ico {
    width: 1.05rem;
    height: 1.05rem;
    transition: transform 0.15s;
}

.card.is-collapsed .card-tools .icon-btn .ico {
    transform: rotate(-90deg);
}

.card-body {
    padding: 1rem;
    min-width: 0;
}

.card-body.flush {
    padding: 0;
}

.card-body.flush .table {
    border: 0;
    border-radius: 0;
}

.card-body .table-wrap .table {
    min-width: 30rem;
}

.card-foot {
    padding: 0.55rem 1rem;
    border-top: 1px solid var(--line);
    font-size: 0.85rem;
}

.card-row {
    display: grid;
    gap: 1.25rem;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 26rem), 1fr));
    align-items: start;
}

.card .legend {
    margin-top: 0.85rem;
}

.main-footer {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 0.5rem 1.5rem;
    padding: 0.9rem 1.5rem;
    background: var(--surface);
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: 0.8rem;
}

.backdrop {
    display: none;
}

/* Phones and tablets: the sidebar slides in over the content */

@media (max-width: 991px) {
    .app,
    .app.is-mini {
        grid-template-columns: minmax(0, 1fr);
        --side-w: 15.5rem;
    }

    .sidebar {
        position: fixed;
        inset: 0 auto 0 0;
        width: min(var(--side-w), 85vw);
        height: auto;
        padding-top: env(safe-area-inset-top, 0px);
        padding-bottom: env(safe-area-inset-bottom, 0px);
        translate: -100% 0;
        transition: translate 0.2s ease;
    }

    .app.is-open .sidebar {
        translate: 0 0;
        box-shadow: 0 0 40px rgb(0 0 0 / 0.35);
    }

    .app.is-open .backdrop {
        display: block;
        position: fixed;
        inset: 0;
        z-index: 25;
        border: 0;
        background: rgb(10 16 22 / 0.5);
    }
}

@media (max-width: 760px) {
    .navbar {
        padding-right: 1rem;
    }

    .content {
        padding: 1rem 1rem 1.5rem;
    }

    .main-footer {
        padding-inline: 1rem;
    }

    .nav-search,
    .nav-who span:last-child {
        display: none;
    }
}

/* Solar MD brand layer.
   Brand colours from solarmd.com (Elementor globals): primary #FFB600, secondary #232121,
   dark #111111, light #F5F5F5. Amber is a fill colour (buttons, active menu, avatars) with
   charcoal text on it; on light backgrounds text links use a darker amber for contrast. */

:root {
    --bg: #f5f5f5;
    --surface: #ffffff;
    --surface-sunk: #faf9f7;
    --ink: #232121;
    --muted: #6b6464;
    --line: #e4e0dc;
    --accent: #ffb600;
    --accent-ink: #232121;
    --link: #8f6200;
    --focus: #c98f00;
    --info: #2f6fb3;
    --up: #1e8a4c;
    --warn: #b35c00;
    --down: #c2362b;
    --idle: #9a928c;

    --side-bg: #232121;
    --side-ink: #d9d4cf;
    --side-muted: #958c86;
    --side-hover: #302d2d;
    --side-line: #383434;
    --side-active: #ffb600;
    --side-active-ink: #232121;
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --bg: #111111;
        --surface: #1b1a1a;
        --surface-sunk: #161515;
        --ink: #ece8e4;
        --muted: #9a928c;
        --line: #2f2c2b;
        --accent: #ffb600;
        --accent-ink: #1a1400;
        --link: #ffc533;
        --focus: #ffb600;
        --info: #6aa7e8;
        --up: #3ccf7f;
        --warn: #f08a3c;
        --down: #f0675b;
        --idle: #6d6661;
        --side-bg: #0a0a0a;
        --side-ink: #d0cbc6;
        --side-muted: #857d78;
        --side-hover: #1a1919;
        --side-line: #222020;
        --side-active: #ffb600;
        --side-active-ink: #1a1400;
    }
}

:root[data-theme="dark"] {
    --bg: #111111;
    --surface: #1b1a1a;
    --surface-sunk: #161515;
    --ink: #ece8e4;
    --muted: #9a928c;
    --line: #2f2c2b;
    --accent: #ffb600;
    --accent-ink: #1a1400;
    --link: #ffc533;
    --focus: #ffb600;
    --info: #6aa7e8;
    --up: #3ccf7f;
    --warn: #f08a3c;
    --down: #f0675b;
    --idle: #6d6661;
    --side-bg: #0a0a0a;
    --side-ink: #d0cbc6;
    --side-muted: #857d78;
    --side-hover: #1a1919;
    --side-line: #222020;
    --side-active: #ffb600;
    --side-active-ink: #1a1400;
}

a,
.tag {
    color: var(--link);
}

.tag {
    border-color: currentColor;
}

/* Brand: the site's own logo (sun mark + white wordmark) on the charcoal sidebar */

.side-brand {
    padding: 0 1rem;
}

.side-brand img {
    height: 2.6rem;
    width: auto;
    display: block;
}

.side-brand .brand-sub {
    margin-left: auto;
    padding: 0.05rem 0.4rem;
    border: 1px solid var(--side-line);
    border-radius: 3px;
    color: var(--accent);
    font-size: 0.7rem;
    letter-spacing: 0.08em;
}

.app.is-mini .side-brand img {
    height: 1.6rem;
    width: 1.6rem;
    object-fit: cover;
    object-position: left;
}

/* A thin amber line under the top bar ties the content side to the brand */

.navbar {
    box-shadow: inset 0 -2px 0 var(--accent);
    border-bottom: 0;
}

/* Order status pills */

.status {
    --s: var(--muted);
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.1rem 0.55rem 0.1rem 0.45rem;
    border-radius: 1rem;
    background: color-mix(in srgb, var(--s) 13%, transparent);
    color: var(--s);
    font-family: var(--font-label);
    font-size: 0.8rem;
    font-weight: 600;
    white-space: nowrap;
}

.status::before {
    content: "";
    width: 0.45rem;
    height: 0.45rem;
    border-radius: 50%;
    background: currentColor;
}

.status-draft { --s: var(--muted); }
.status-sent { --s: var(--warn); }
.status-approved { --s: var(--info); }
.status-production { --s: var(--link); }
.status-ready { --s: var(--up); }
.status-shipped { --s: var(--muted); }

.status-shipped::before {
    background: none;
    border: 1.5px solid currentColor;
}

/* Production progress */

.progress {
    display: grid;
    grid-template-columns: minmax(4rem, 1fr) auto;
    align-items: center;
    gap: 0.5rem;
    min-width: 8rem;
}

.progress-bar {
    height: 0.4rem;
    border-radius: 1rem;
    background: var(--surface-sunk);
    box-shadow: inset 0 0 0 1px var(--line);
    overflow: hidden;
}

.progress-bar > span {
    display: block;
    height: 100%;
    background: var(--accent);
}

.progress-bar.is-done > span {
    background: var(--up);
}

.progress small {
    font-family: var(--font-label);
    font-variant-numeric: tabular-nums;
    color: var(--muted);
}

/* Two order numbers, always labelled */

.numbers {
    display: grid;
    line-height: 1.3;
}

.numbers strong {
    font-family: var(--font-label);
    font-weight: 600;
    white-space: nowrap;
}

.numbers span {
    color: var(--muted);
    font-size: 0.8rem;
    white-space: nowrap;
}

.content-head .btn-primary .ico {
    width: 1rem;
    height: 1rem;
}

.tile-brand {
    box-shadow: inset 0 3px 0 var(--accent);
}

/* Counters in amber with charcoal text (orange + dark text was too low in contrast) */

.nav-badge,
.dot-count {
    background: var(--accent);
    color: var(--accent-ink);
}

.nav-link[aria-current="page"] .nav-badge {
    background: var(--accent-ink);
    color: var(--accent);
}

.sidebar {
    border-right: 1px solid var(--side-line);
}

.auth-form .lang {
    justify-self: start;
}

/* Messages */

.thread {
    display: grid;
    gap: 0.9rem;
}

.msg {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 0.7rem;
}

.msg .avatar {
    width: 2rem;
    height: 2rem;
    font-size: 0.75rem;
}

.msg-staff .avatar {
    background: var(--side-bg);
    color: var(--accent);
}

.msg-body {
    padding: 0.6rem 0.8rem;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface-sunk);
}

.msg-staff .msg-body {
    border-left: 3px solid var(--accent);
}

.msg-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.2rem 0.6rem;
    margin-bottom: 0.25rem;
    font-size: 0.8rem;
    color: var(--muted);
}

.msg-meta strong {
    color: var(--ink);
}

.msg p {
    margin: 0;
}

.attach {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    margin-top: 0.45rem;
    padding: 0.2rem 0.55rem;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    font-size: 0.8rem;
    text-decoration: none;
}

.attach .ico {
    width: 0.95rem;
    height: 0.95rem;
}

.reply {
    display: grid;
    gap: 0.5rem;
    margin-top: 1rem;
}

.reply textarea {
    min-height: 4.5rem;
}

.reply-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
}

/* Login: brand panel + form */

.auth {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    min-height: 100vh;
}

.auth-brand {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 2.5rem 3rem;
    background: var(--side-bg);
    color: var(--side-ink);
    position: relative;
    overflow: hidden;
}

.auth-brand img.logo {
    height: 3rem;
    width: auto;
    align-self: start;
}

.auth-brand .sun-bg {
    position: absolute;
    right: -9rem;
    bottom: -9rem;
    width: 30rem;
    height: 30rem;
    object-fit: cover;
    object-position: left;
    opacity: 0.08;
}

.auth-brand h2 {
    color: #ffffff;
    font-size: 2rem;
    max-width: 22rem;
}

.auth-brand h2 em {
    font-style: normal;
    color: var(--accent);
}

.auth-brand p {
    max-width: 24rem;
    color: var(--side-muted);
}

.auth-form {
    display: grid;
    place-items: center;
    padding: 2rem 1.5rem;
    background: var(--surface);
}

.auth-form .form {
    width: min(100%, 23rem);
}

.auth-form .btn-primary {
    width: 100%;
    padding-block: 0.7rem;
}

.auth-links {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
}

.auth-note {
    padding-top: 1rem;
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: 0.82rem;
}

@media (max-width: 760px) {
    .auth {
        grid-template-columns: 1fr;
    }

    .auth-brand {
        padding: 1.5rem;
    }

    .auth-brand h2,
    .auth-brand p {
        display: none;
    }
}

/* Registration: live password rules */

.rules {
    padding: 0.75rem 0.9rem;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface-sunk);
}

.rules-title {
    margin: 0 0 0.35rem;
    font-size: 0.85rem;
    font-weight: 600;
}

.rules ul {
    margin: 0 0 0.4rem;
    padding: 0;
    list-style: none;
    display: grid;
    gap: 0.15rem;
    font-size: 0.85rem;
    color: var(--muted);
}

.rules li::before {
    content: "";
    display: inline-block;
    width: 0.55rem;
    height: 0.55rem;
    margin-right: 0.5rem;
    border: 1.5px solid currentColor;
    border-radius: 50%;
    vertical-align: 0.05rem;
}

.rules li.is-ok {
    color: var(--up);
}

.rules li.is-ok::before {
    background: currentColor;
}

.auth-form .facts {
    font-size: 0.92rem;
}

/* Orders: draft form */

.order-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 22rem;
    gap: 1.25rem;
    align-items: start;
}

.order-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.5rem;
}

.form-pair {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr));
    gap: 1rem;
}

.new-address {
    margin: 0;
    padding: 1rem;
    border: 1px dashed var(--line);
    border-radius: var(--radius);
}

.line {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 6.5rem 2.2rem;
    gap: 0.75rem;
    align-items: start;
    padding: 0.85rem 1rem;
    border-bottom: 1px solid var(--line);
}

.line-name strong {
    font-family: var(--font-label);
    font-weight: 600;
}

.line-name .muted {
    display: block;
    font-size: 0.82rem;
}

.line-opts {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem 0.9rem;
    margin-top: 0.5rem;
    font-size: 0.85rem;
}

.line-opts label {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.line-opts select {
    width: auto;
    padding: 0.2rem 0.4rem;
    font-size: 0.85rem;
}

.qty input {
    text-align: right;
}

.line-note {
    flex-basis: 100%;
    color: var(--muted);
    font-size: 0.8rem;
    font-style: italic;
}

.remove {
    padding: 0.3rem;
    border: 0;
    background: none;
    color: var(--muted);
    font-size: 1.2rem;
    cursor: pointer;
}

.remove:hover {
    color: var(--down);
}

.suggest {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.6rem 1rem;
    margin: 0;
    padding: 0.7rem 1rem;
    background: color-mix(in srgb, var(--accent) 12%, var(--surface));
    border-left: var(--rail) solid var(--accent);
    font-size: 0.88rem;
}

.suggest span {
    flex: 1 1 20rem;
}

.picker {
    position: sticky;
    top: calc(var(--nav-h) + 1rem);
    max-height: calc(100vh - var(--nav-h) - 2rem);
    overflow-y: auto;
}

.picker-top {
    position: sticky;
    top: 0;
    z-index: 1;
    background: var(--surface);
    border-radius: var(--radius) var(--radius) 0 0;
}

.picker-search {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--line);
}

.picker-group {
    padding: 0.55rem 1rem 0.25rem;
    color: var(--muted);
    font-family: var(--font-label);
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.picker-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
    padding: 0.45rem 1rem;
    font-size: 0.9rem;
}

.picker-item:hover {
    background: var(--surface-sunk);
}

.picker-item .mono {
    color: var(--muted);
    font-family: var(--font-body);
    font-size: 0.8rem;
}

.picker-item .btn-small {
    flex: none;
}

@media (max-width: 1100px) {
    .order-grid {
        grid-template-columns: 1fr;
    }

    .picker {
        position: static;
        max-height: none;
    }
}
