:root {
    color-scheme: light;
    --ink: #10231f;
    --ink-soft: #40544f;
    --muted: #6e7f7a;
    --line: #dbe4e0;
    --line-strong: #c6d3ce;
    --paper: #ffffff;
    --canvas: #f3f6f4;
    --canvas-warm: #f8f5ed;
    --green: #176b59;
    --green-dark: #0e5244;
    --green-soft: #e3f2ed;
    --mint: #cfe9df;
    --lime: #eef5c9;
    --gold: #d7a521;
    --danger: #a53f35;
    --danger-soft: #fff0ed;
    --shadow-sm: 0 1px 2px rgba(16, 35, 31, 0.05), 0 8px 24px rgba(16, 35, 31, 0.04);
    --shadow-lg: 0 30px 80px rgba(16, 35, 31, 0.18);
    --radius-sm: 10px;
    --radius-md: 16px;
    --radius-lg: 24px;
    font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-synthesis: none;
}

* {
    box-sizing: border-box;
}

html {
    min-width: 320px;
    background: var(--canvas);
    color: var(--ink);
}

body {
    min-height: 100vh;
    margin: 0;
    background:
        radial-gradient(circle at 13% 0%, rgba(207, 233, 223, 0.4), transparent 28rem),
        var(--canvas);
}

body.modal-open {
    overflow: hidden;
}

button,
input,
select,
textarea {
    font: inherit;
}

button,
select {
    cursor: pointer;
}

button:disabled,
select:disabled,
input:disabled {
    cursor: not-allowed;
    opacity: 0.55;
}

a {
    color: inherit;
}

[hidden] {
    display: none !important;
}

.boot-screen {
    min-height: 100vh;
    display: grid;
    place-content: center;
    justify-items: center;
    gap: 16px;
    color: var(--muted);
    font-weight: 650;
}

.brand-glyph {
    width: 43px;
    height: 43px;
    display: inline-grid;
    place-items: center;
    border-radius: 13px;
    background: var(--ink);
    color: white;
    box-shadow: inset 0 -3px 0 rgba(255, 255, 255, 0.08);
    font-size: 20px;
    font-weight: 800;
}

.eyebrow {
    margin: 0 0 8px;
    color: var(--green);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.12em;
}

.button {
    min-height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    border: 1px solid transparent;
    border-radius: 11px;
    padding: 10px 16px;
    text-decoration: none;
    font-weight: 750;
    transition: transform 140ms ease, box-shadow 140ms ease, background 140ms ease, border-color 140ms ease;
}

.button:not(:disabled):hover {
    transform: translateY(-1px);
}

.button-primary {
    background: var(--green);
    color: #fff;
    box-shadow: 0 10px 24px rgba(23, 107, 89, 0.18);
}

.button-primary:not(:disabled):hover {
    background: var(--green-dark);
    box-shadow: 0 13px 28px rgba(23, 107, 89, 0.24);
}

.button-quiet {
    border-color: var(--line);
    background: rgba(255, 255, 255, 0.72);
    color: var(--ink-soft);
}

.button-quiet:not(:disabled):hover {
    border-color: var(--line-strong);
    background: white;
}

.button-wide {
    width: 100%;
}

.icon-button {
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: white;
    color: var(--ink-soft);
    font-size: 18px;
}

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

.login-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(390px, 0.95fr);
    background: var(--paper);
}

.login-panel {
    width: min(520px, calc(100% - 64px));
    align-self: center;
    justify-self: center;
    padding: 56px 0;
}

.login-brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 74px;
    font-size: 20px;
    font-weight: 800;
}

.login-panel h1 {
    max-width: 460px;
    margin: 0;
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(42px, 5vw, 66px);
    font-weight: 500;
    letter-spacing: -0.045em;
    line-height: 0.98;
}

.login-copy {
    max-width: 470px;
    margin: 24px 0 34px;
    color: var(--muted);
    font-size: 16px;
    line-height: 1.65;
}

.login-form {
    display: grid;
    gap: 16px;
}

.login-form label,
.field {
    display: grid;
    gap: 7px;
    color: var(--ink-soft);
    font-size: 12px;
    font-weight: 750;
}

.login-form label > span,
.field > span {
    display: flex;
    align-items: center;
    gap: 6px;
}

.field small {
    color: var(--muted);
    font-size: 10px;
    font-weight: 550;
}

input,
select,
textarea {
    width: 100%;
    border: 1px solid var(--line-strong);
    border-radius: 10px;
    outline: none;
    background: white;
    color: var(--ink);
    transition: border-color 120ms ease, box-shadow 120ms ease;
}

input,
select {
    height: 44px;
    padding: 0 12px;
}

textarea {
    min-height: 82px;
    resize: vertical;
    padding: 11px 12px;
    line-height: 1.45;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--green);
    box-shadow: 0 0 0 3px rgba(23, 107, 89, 0.12);
}

input[aria-invalid="true"],
select[aria-invalid="true"] {
    border-color: var(--danger);
    box-shadow: 0 0 0 3px rgba(165, 63, 53, 0.1);
}

.form-error {
    margin: -4px 0 0;
    border-radius: 9px;
    background: var(--danger-soft);
    padding: 10px 12px;
    color: var(--danger);
    font-size: 12px;
    font-weight: 650;
}

.login-aside {
    position: relative;
    min-height: 100vh;
    overflow: hidden;
    background:
        linear-gradient(145deg, rgba(255, 255, 255, 0.08), transparent 40%),
        var(--ink);
}

.login-aside::before {
    content: "";
    position: absolute;
    width: 330px;
    height: 330px;
    right: -75px;
    top: -62px;
    border-radius: 50%;
    background: var(--lime);
    opacity: 0.94;
}

.login-aside::after {
    content: "";
    position: absolute;
    width: 190px;
    height: 190px;
    left: 14%;
    bottom: 14%;
    border-radius: 44% 56% 54% 46%;
    background: var(--mint);
    transform: rotate(18deg);
}

.login-preview-card {
    position: absolute;
    z-index: 2;
    top: 50%;
    left: 50%;
    width: min(360px, calc(100% - 80px));
    display: grid;
    gap: 10px;
    transform: translate(-50%, -50%) rotate(-2deg);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.12);
    box-shadow: 0 34px 90px rgba(0, 0, 0, 0.28);
    padding: 28px;
    color: white;
    backdrop-filter: blur(10px);
}

.preview-kicker {
    color: var(--lime);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.12em;
}

.login-preview-card strong {
    font-family: Georgia, "Times New Roman", serif;
    font-size: 38px;
    font-weight: 500;
}

.login-preview-card > span:last-child {
    color: rgba(255, 255, 255, 0.72);
    font-size: 13px;
}

.login-orbit {
    position: absolute;
    border: 1px solid rgba(255, 255, 255, 0.13);
    border-radius: 50%;
}

.orbit-one {
    width: 530px;
    height: 530px;
    top: 21%;
    left: 4%;
}

.orbit-two {
    width: 680px;
    height: 680px;
    top: 10%;
    left: -8%;
}

.app-shell {
    min-height: 100vh;
}

.app-header {
    position: sticky;
    z-index: 20;
    top: 0;
    min-height: 72px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    border-bottom: 1px solid rgba(198, 211, 206, 0.82);
    background: rgba(255, 255, 255, 0.9);
    padding: 10px clamp(18px, 3vw, 44px);
    backdrop-filter: blur(16px);
}

.app-brand {
    display: inline-flex;
    align-items: center;
    gap: 11px;
    color: var(--ink);
    text-decoration: none;
}

.app-brand > span:last-child {
    display: grid;
}

.app-brand strong {
    font-size: 16px;
}

.app-brand small {
    margin-top: 1px;
    color: var(--muted);
    font-size: 10px;
    font-weight: 650;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.header-actions,
.user-menu {
    display: flex;
    align-items: center;
}

.header-actions {
    gap: 18px;
}

.user-menu {
    gap: 9px;
    border-left: 1px solid var(--line);
    padding-left: 18px;
}

.user-avatar {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: var(--green-soft);
    color: var(--green-dark);
    font-size: 13px;
    font-weight: 850;
}

.user-copy {
    display: grid;
    min-width: 94px;
}

.user-copy strong {
    font-size: 12px;
}

.user-copy small {
    color: var(--muted);
    font-size: 10px;
    text-transform: capitalize;
}

.workspace {
    width: min(1540px, 100%);
    margin: 0 auto;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 390px;
    align-items: start;
    gap: 24px;
    padding: 36px clamp(18px, 3vw, 44px) 70px;
}

.builder {
    min-width: 0;
}

.builder-heading,
.panel-heading,
.cart-heading,
.modal-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
}

.builder-heading {
    align-items: flex-end;
    margin-bottom: 22px;
}

.builder-heading h1 {
    margin: 0;
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(30px, 3.3vw, 46px);
    font-weight: 500;
    letter-spacing: -0.035em;
    line-height: 1.05;
}

.progress-steps {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 4px;
    margin-bottom: 14px;
}

.progress-steps span {
    display: flex;
    align-items: center;
    gap: 8px;
    border-bottom: 2px solid var(--line);
    padding: 0 4px 10px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 750;
}

.progress-steps span.is-active {
    border-color: var(--green);
    color: var(--green-dark);
}

.progress-steps b {
    width: 20px;
    height: 20px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: var(--line);
    font-size: 10px;
}

.progress-steps .is-active b {
    background: var(--green);
    color: white;
}

.panel,
.quote-cart {
    border: 1px solid rgba(198, 211, 206, 0.92);
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.94);
    box-shadow: var(--shadow-sm);
}

.panel {
    margin-bottom: 18px;
    padding: 24px;
}

.panel-heading {
    margin-bottom: 22px;
}

.heading-group {
    display: flex;
    align-items: flex-start;
    gap: 13px;
}

.step-number {
    flex: 0 0 auto;
    width: 28px;
    height: 28px;
    display: grid;
    place-items: center;
    border-radius: 9px;
    background: var(--green-soft);
    color: var(--green-dark);
    font-size: 12px;
    font-weight: 850;
}

.panel-heading h2,
.cart-heading h2,
.modal-header h2 {
    margin: 0;
    font-size: 18px;
    letter-spacing: -0.015em;
}

.panel-heading p,
.modal-header p {
    margin: 5px 0 0;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.5;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
}

.field-span-2 {
    grid-column: span 2;
}

.field b {
    color: var(--danger);
}

.profit-control {
    min-height: 68px;
    grid-column: span 2;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border: 1px solid var(--line);
    border-radius: 11px;
    background: var(--canvas);
    padding: 10px 12px;
}

.switch-row {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.switch-row input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.switch {
    position: relative;
    width: 38px;
    height: 22px;
    flex: 0 0 auto;
    border-radius: 999px;
    background: #b9c6c2;
    transition: background 130ms ease;
}

.switch::after {
    content: "";
    position: absolute;
    width: 16px;
    height: 16px;
    top: 3px;
    left: 3px;
    border-radius: 50%;
    background: white;
    box-shadow: 0 2px 5px rgba(16, 35, 31, 0.25);
    transition: transform 130ms ease;
}

.switch-row input:checked + .switch {
    background: var(--green);
}

.switch-row input:checked + .switch::after {
    transform: translateX(16px);
}

.switch-row > span:last-child {
    display: grid;
    gap: 2px;
}

.switch-row strong {
    font-size: 12px;
}

.switch-row small {
    color: var(--muted);
    font-size: 10px;
}

.profit-rate {
    width: 84px;
    display: flex;
    align-items: center;
    border: 1px solid var(--line-strong);
    border-radius: 9px;
    background: white;
    padding-right: 10px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 750;
}

.profit-rate input {
    height: 38px;
    border: 0;
    box-shadow: none;
    padding-right: 3px;
    text-align: right;
}

.catalog-count {
    flex: 0 0 auto;
    border-radius: 999px;
    background: var(--lime);
    padding: 7px 10px;
    color: #536317;
    font-size: 10px;
    font-weight: 850;
}

.catalog-toolbar {
    display: grid;
    grid-template-columns: minmax(180px, 0.8fr) minmax(180px, 0.8fr) minmax(240px, 1.4fr);
    gap: 12px;
}

.catalog-meta {
    min-height: 34px;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 13px;
    color: var(--muted);
    font-size: 10px;
}

.catalog-meta a,
.text-button {
    color: var(--green);
    font-weight: 750;
}

.text-button {
    border: 0;
    background: transparent;
    padding: 0;
}

.live-dot {
    width: 7px;
    height: 7px;
    flex: 0 0 auto;
    border-radius: 50%;
    background: #39a978;
    box-shadow: 0 0 0 4px rgba(57, 169, 120, 0.12);
}

.catalog-placeholder {
    min-height: 260px;
    display: grid;
    place-content: center;
    justify-items: center;
    margin-top: 16px;
    border: 1px dashed var(--line-strong);
    border-radius: 13px;
    background: linear-gradient(145deg, rgba(238, 245, 201, 0.18), rgba(227, 242, 237, 0.23));
    padding: 30px;
    text-align: center;
}

.placeholder-icon {
    width: 46px;
    height: 46px;
    display: grid;
    place-items: center;
    margin-bottom: 14px;
    border-radius: 14px;
    background: var(--green-soft);
    color: var(--green);
    font-size: 24px;
}

.catalog-placeholder h3 {
    margin: 0;
    font-size: 15px;
}

.catalog-placeholder p {
    max-width: 430px;
    margin: 8px 0 0;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.55;
}

.catalog-loading {
    min-height: 220px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    color: var(--muted);
    font-size: 11px;
}

.catalog-loading span {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--green);
    animation: pulse 900ms ease-in-out infinite alternate;
}

.catalog-loading span:nth-child(2) {
    animation-delay: 180ms;
}

.catalog-loading span:nth-child(3) {
    animation-delay: 360ms;
}

@keyframes pulse {
    to { transform: translateY(-6px); opacity: 0.45; }
}

.product-list {
    max-height: 620px;
    overflow: auto;
    margin-top: 16px;
    border: 1px solid var(--line);
    border-radius: 13px;
    scrollbar-color: var(--line-strong) transparent;
}

.product-row {
    min-height: 92px;
    display: grid;
    grid-template-columns: minmax(220px, 1fr) 128px 128px 42px;
    align-items: center;
    gap: 14px;
    border-bottom: 1px solid var(--line);
    padding: 15px 14px;
    background: white;
}

.product-row:last-child {
    border-bottom: 0;
}

.product-row:hover {
    background: #fbfcfb;
}

.product-main {
    min-width: 0;
}

.product-tags {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 6px;
}

.product-sku,
.promo-badge,
.product-category {
    border-radius: 999px;
    padding: 4px 7px;
    font-size: 9px;
    font-weight: 750;
}

.product-sku {
    background: var(--canvas);
    color: var(--ink-soft);
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.product-category {
    background: var(--green-soft);
    color: var(--green-dark);
}

.promo-badge {
    background: #fff5d8;
    color: #805d00;
}

.product-main h3 {
    margin: 0;
    overflow: hidden;
    color: var(--ink);
    font-size: 13px;
    line-height: 1.35;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.product-main p {
    margin: 5px 0 0;
    color: var(--muted);
    font-size: 10px;
}

.price-block {
    display: grid;
    gap: 3px;
}

.price-block span {
    color: var(--muted);
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
}

.price-block strong {
    font-size: 13px;
}

.price-block small {
    color: var(--muted);
    font-size: 9px;
}

.add-product {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border: 1px solid var(--green);
    border-radius: 10px;
    background: white;
    color: var(--green);
    font-size: 20px;
    transition: background 120ms ease, color 120ms ease;
}

.add-product:hover {
    background: var(--green);
    color: white;
}

.empty-products {
    padding: 54px 20px;
    color: var(--muted);
    text-align: center;
    font-size: 12px;
}

.quote-cart {
    position: sticky;
    top: 96px;
    max-height: calc(100vh - 122px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.cart-heading {
    align-items: center;
    border-bottom: 1px solid var(--line);
    padding: 20px;
}

.cart-heading .eyebrow {
    margin-bottom: 4px;
}

.item-count {
    min-width: 28px;
    height: 28px;
    display: grid;
    place-items: center;
    border-radius: 999px;
    background: var(--ink);
    padding: 0 8px;
    color: white;
    font-size: 11px;
    font-weight: 800;
}

.empty-cart {
    min-height: 210px;
    display: grid;
    place-content: center;
    justify-items: center;
    padding: 30px;
    text-align: center;
}

.empty-cart > span {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    margin-bottom: 12px;
    border: 1px dashed var(--line-strong);
    border-radius: 13px;
    color: var(--green);
    font-size: 21px;
}

.empty-cart strong {
    font-size: 13px;
}

.empty-cart p {
    margin: 6px 0 0;
    color: var(--muted);
    font-size: 11px;
}

.cart-items {
    min-height: 110px;
    overflow: auto;
    border-bottom: 1px solid var(--line);
    scrollbar-color: var(--line-strong) transparent;
}

.cart-item {
    display: grid;
    gap: 11px;
    border-bottom: 1px solid var(--line);
    padding: 15px 18px;
}

.cart-item:last-child {
    border-bottom: 0;
}

.cart-item-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
}

.cart-item-heading strong {
    display: block;
    font-size: 12px;
    line-height: 1.35;
}

.cart-item-heading small {
    display: block;
    margin-top: 4px;
    color: var(--muted);
    font-size: 9px;
}

.remove-item {
    flex: 0 0 auto;
    border: 0;
    background: transparent;
    color: var(--muted);
    font-size: 17px;
}

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

.cart-item-controls {
    display: grid;
    grid-template-columns: 76px minmax(110px, 1fr) auto;
    align-items: end;
    gap: 9px;
}

.cart-item-controls label {
    display: grid;
    gap: 5px;
    color: var(--muted);
    font-size: 8px;
    font-weight: 750;
    text-transform: uppercase;
}

.cart-item-controls input {
    height: 36px;
    font-size: 11px;
}

.cart-line-total {
    min-width: 78px;
    padding-bottom: 8px;
    text-align: right;
    font-size: 12px;
}

.cart-bottom {
    overflow: auto;
    padding: 18px;
}

.notes-field {
    margin-bottom: 16px;
}

.totals {
    display: grid;
    gap: 8px;
    margin: 0;
}

.totals > div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    color: var(--muted);
    font-size: 11px;
}

.totals dt,
.totals dd {
    margin: 0;
}

.totals dd {
    color: var(--ink-soft);
    font-weight: 750;
}

.totals .total-final {
    margin-top: 5px;
    border-top: 1px solid var(--line);
    padding-top: 12px;
    color: var(--ink);
    font-size: 14px;
    font-weight: 800;
}

.totals .total-final dd {
    color: var(--ink);
    font-size: 23px;
}

.totals-note {
    margin: 10px 0 15px;
    color: var(--muted);
    font-size: 9px;
    line-height: 1.45;
}

.generate-button {
    min-height: 48px;
}

.modal {
    width: min(680px, calc(100% - 28px));
    max-height: calc(100vh - 36px);
    overflow: auto;
    border: 0;
    border-radius: var(--radius-lg);
    background: transparent;
    padding: 0;
    color: var(--ink);
    box-shadow: var(--shadow-lg);
}

.modal::backdrop {
    background: rgba(7, 24, 20, 0.58);
    backdrop-filter: blur(5px);
}

.modal-card {
    margin: 0;
    border: 1px solid rgba(255, 255, 255, 0.7);
    border-radius: var(--radius-lg);
    background: white;
    padding: 26px;
}

.modal-header {
    border-bottom: 1px solid var(--line);
    padding-bottom: 20px;
}

.modal-header .eyebrow {
    margin-bottom: 6px;
}

.product-config-grid {
    display: grid;
    gap: 18px;
    padding: 22px 0;
}

.mode-picker {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin: 0;
    border: 0;
    padding: 0;
}

.mode-picker legend {
    grid-column: 1 / -1;
    margin-bottom: 2px;
    color: var(--ink-soft);
    font-size: 11px;
    font-weight: 750;
}

.mode-picker label {
    cursor: pointer;
}

.mode-picker input {
    position: absolute;
    opacity: 0;
}

.mode-picker label > span {
    min-height: 72px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    border: 1px solid var(--line-strong);
    border-radius: 12px;
    padding: 14px;
    transition: border-color 120ms ease, background 120ms ease, box-shadow 120ms ease;
}

.mode-picker input:checked + span {
    border-color: var(--green);
    background: var(--green-soft);
    box-shadow: inset 0 0 0 1px var(--green);
}

.mode-picker strong,
.mode-picker small {
    display: block;
}

.mode-picker strong {
    font-size: 12px;
}

.mode-picker small {
    color: var(--green-dark);
    font-size: 11px;
    font-weight: 800;
}

.promo-option {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    border: 1px solid #ead79d;
    border-radius: 11px;
    background: #fffae9;
    padding: 12px;
    cursor: pointer;
}

.promo-option input {
    width: 17px;
    height: 17px;
    flex: 0 0 auto;
    margin: 1px 0 0;
    accent-color: var(--green);
}

.promo-option span {
    display: grid;
    gap: 3px;
}

.promo-option strong {
    color: #694e00;
    font-size: 11px;
}

.promo-option small {
    color: #836a24;
    font-size: 10px;
}

.config-fields {
    display: grid;
    grid-template-columns: 0.8fr 1.2fr;
    gap: 14px;
}

.quantity-input,
.money-input {
    display: flex;
    align-items: center;
    border: 1px solid var(--line-strong);
    border-radius: 10px;
    overflow: hidden;
    background: white;
}

.quantity-input:focus-within,
.money-input:focus-within {
    border-color: var(--green);
    box-shadow: 0 0 0 3px rgba(23, 107, 89, 0.12);
}

.quantity-input button {
    width: 39px;
    height: 42px;
    flex: 0 0 auto;
    border: 0;
    background: var(--canvas);
    color: var(--ink-soft);
    font-size: 18px;
}

.quantity-input input,
.money-input input {
    height: 42px;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    text-align: center;
}

.money-input > span {
    padding-left: 12px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 750;
}

.money-input input {
    text-align: right;
}

.config-fields .field > small {
    line-height: 1.4;
}

.modal-total {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    border-radius: 12px;
    background: var(--ink);
    padding: 16px 18px;
    color: white;
}

.modal-total span {
    color: rgba(255, 255, 255, 0.68);
    font-size: 11px;
}

.modal-total strong {
    font-size: 21px;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 18px;
}

.history-modal {
    width: min(820px, calc(100% - 28px));
}

.history-list {
    max-height: 540px;
    overflow: auto;
    margin: 18px -4px -4px;
}

.history-row {
    display: grid;
    grid-template-columns: 1fr auto auto;
    align-items: center;
    gap: 18px;
    border-bottom: 1px solid var(--line);
    padding: 14px 6px;
}

.history-row:last-child {
    border-bottom: 0;
}

.history-primary {
    min-width: 0;
}

.history-primary strong,
.history-primary span {
    display: block;
}

.history-primary strong {
    margin-bottom: 4px;
    overflow: hidden;
    font-size: 12px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.history-primary span,
.history-meta {
    color: var(--muted);
    font-size: 9px;
}

.history-total {
    text-align: right;
    font-size: 13px;
    font-weight: 800;
}

.history-total small {
    display: block;
    margin-top: 3px;
    color: var(--muted);
    font-size: 8px;
    font-weight: 600;
}

.history-loading,
.history-empty {
    padding: 46px 20px;
    color: var(--muted);
    text-align: center;
    font-size: 12px;
}

.success-modal {
    width: min(470px, calc(100% - 28px));
}

.success-card {
    display: grid;
    justify-items: center;
    padding: 36px;
    text-align: center;
}

.success-mark {
    width: 54px;
    height: 54px;
    display: grid;
    place-items: center;
    margin-bottom: 20px;
    border-radius: 18px;
    background: var(--green-soft);
    color: var(--green);
    font-size: 25px;
    font-weight: 850;
}

.success-card h2 {
    margin: 0;
    font-size: 22px;
}

.success-card > p:not(.eyebrow) {
    margin: 10px 0 16px;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.5;
}

.success-total {
    margin-bottom: 8px;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 36px;
    font-weight: 500;
}

.modal-actions-stack {
    width: 100%;
    display: grid;
}

.toast {
    position: fixed;
    z-index: 100;
    right: 22px;
    bottom: 22px;
    max-width: min(390px, calc(100% - 44px));
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 12px;
    background: var(--ink);
    box-shadow: var(--shadow-lg);
    padding: 13px 15px;
    color: white;
    font-size: 11px;
    font-weight: 650;
    line-height: 1.45;
}

.toast.is-error {
    background: #742f29;
}

noscript {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: grid;
    place-items: center;
    background: white;
    padding: 30px;
    text-align: center;
}

@media (max-width: 1180px) {
    .workspace {
        grid-template-columns: minmax(0, 1fr) 350px;
    }

    .form-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .catalog-toolbar {
        grid-template-columns: 1fr 1fr;
    }

    .search-field {
        grid-column: 1 / -1;
    }

    .product-row {
        grid-template-columns: minmax(180px, 1fr) 110px 110px 40px;
        gap: 10px;
    }
}

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

    .quote-cart {
        position: static;
        max-height: none;
    }

    .cart-items,
    .cart-bottom {
        max-height: none;
    }

    .login-shell {
        grid-template-columns: 1fr;
    }

    .login-aside {
        display: none;
    }
}

@media (max-width: 680px) {
    .app-header {
        min-height: 66px;
    }

    .user-copy {
        display: none;
    }

    .header-actions > .button {
        width: 40px;
        min-height: 38px;
        overflow: hidden;
        padding: 0;
        color: transparent;
        font-size: 0;
    }

    .header-actions > .button::before {
        content: "≡";
        color: var(--ink-soft);
        font-size: 19px;
    }

    .user-menu {
        border-left: 0;
        padding-left: 0;
    }

    .workspace {
        padding-top: 24px;
    }

    .builder-heading {
        align-items: flex-start;
    }

    .builder-heading > .button {
        width: 40px;
        overflow: hidden;
        padding: 10px;
        color: transparent;
    }

    .builder-heading > .button::before {
        content: "↺";
        color: var(--ink);
        font-size: 18px;
    }

    .progress-steps span {
        justify-content: center;
        font-size: 0;
    }

    .progress-steps b {
        font-size: 10px;
    }

    .panel {
        padding: 18px;
    }

    .panel-heading-split {
        align-items: flex-start;
    }

    .form-grid,
    .catalog-toolbar,
    .config-fields {
        grid-template-columns: 1fr;
    }

    .field-span-2,
    .profit-control,
    .search-field {
        grid-column: auto;
    }

    .profit-control {
        min-height: 62px;
    }

    .catalog-meta {
        flex-wrap: wrap;
    }

    .product-list {
        max-height: 540px;
    }

    .product-row {
        grid-template-columns: 1fr 1fr 38px;
    }

    .product-main {
        grid-column: 1 / -1;
    }

    .product-main h3 {
        white-space: normal;
    }

    .mode-picker {
        grid-template-columns: 1fr;
    }

    .modal-card {
        padding: 20px;
    }

    .history-row {
        grid-template-columns: 1fr auto;
    }

    .history-meta {
        display: none;
    }
}

@media (max-width: 430px) {
    .login-panel {
        width: calc(100% - 36px);
    }

    .login-brand {
        margin-bottom: 50px;
    }

    .login-panel h1 {
        font-size: 42px;
    }

    .cart-item-controls {
        grid-template-columns: 68px 1fr;
    }

    .cart-line-total {
        grid-column: 1 / -1;
        text-align: left;
    }
}
