:root {
    --background: #f4f6f8;
    --surface: #ffffff;
    --surface-muted: #f7f9fb;
    --border: #dfe4ea;
    --text: #17202a;
    --muted: #657180;
    --primary: #185f70;
    --primary-dark: #104b59;
    --primary-soft: #e5f2f4;
    --danger: #9f2d35;
    --danger-soft: #fff0f1;
    --warning: #7b5814;
    --warning-soft: #fff8e8;
    --success: #17684c;
    --shadow: 0 12px 32px rgba(25, 38, 52, 0.07);
    font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--text);
    background: var(--background);
    font-synthesis: none;
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; background: var(--background); color: var(--text); }
a { color: inherit; }
.shell { width: min(1180px, calc(100% - 40px)); margin-inline: auto; }
.site-header { background: var(--surface); border-bottom: 1px solid var(--border); }
.header-inner { min-height: 76px; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; }
.brand-mark { display: grid; place-items: center; width: 43px; height: 43px; border-radius: 12px; background: var(--primary); color: white; font-size: 12px; font-weight: 800; letter-spacing: .08em; }
.brand strong, .brand small { display: block; }
.brand strong { font-size: 16px; }
.brand small { margin-top: 2px; color: var(--muted); font-size: 12px; }
.main-nav { display: flex; align-items: center; gap: 7px; }
.main-nav a, .nav-button { padding: 8px 11px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); font: inherit; font-size: 13px; font-weight: 700; text-decoration: none; cursor: pointer; }
.main-nav a.active { color: var(--primary); background: var(--primary-soft); }
.page-content { padding-block: 50px 70px; }
.page-heading { max-width: 690px; margin-bottom: 28px; }
.page-heading h1 { margin: 6px 0 10px; font-size: clamp(30px, 4vw, 45px); line-height: 1.08; letter-spacing: -.035em; }
.page-heading p { margin: 0; color: var(--muted); line-height: 1.6; }
.eyebrow { color: var(--primary) !important; font-size: 12px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.breadcrumb { display: flex; gap: 9px; align-items: center; margin-bottom: 27px; color: var(--muted); font-size: 13px; }
.breadcrumb a { color: var(--primary); text-decoration: none; }
.calculator-heading { margin-bottom: 30px; }
.product-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.product-card { min-height: 112px; display: flex; align-items: center; gap: 14px; padding: 20px; border: 1px solid var(--border); border-radius: 16px; background: var(--surface); box-shadow: 0 5px 18px rgba(25, 38, 52, .035); text-decoration: none; transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease; }
.product-card:hover { transform: translateY(-2px); border-color: #aacbd2; box-shadow: var(--shadow); }
.product-card:focus-visible, .button:focus-visible, input:focus-visible, select:focus-visible { outline: 3px solid rgba(24, 95, 112, .23); outline-offset: 2px; }
.product-icon { flex: 0 0 auto; display: grid; place-items: center; width: 48px; height: 48px; border-radius: 13px; color: var(--primary); background: var(--primary-soft); font-weight: 800; }
.product-card-copy { min-width: 0; flex: 1; }
.product-card-copy strong, .product-card-copy small { display: block; }
.product-card-copy strong { line-height: 1.3; }
.product-card-copy small { margin-top: 6px; color: var(--muted); font-size: 12px; }
.card-arrow { color: var(--primary); font-size: 21px; }
.calculator-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(330px, .8fr); gap: 22px; align-items: start; }
.panel { border: 1px solid var(--border); border-radius: 18px; background: var(--surface); box-shadow: var(--shadow); }
.form-panel { padding: 28px; }
.result-panel { position: sticky; top: 22px; padding: 26px; }
.panel-heading { display: flex; align-items: flex-start; gap: 13px; padding-bottom: 22px; border-bottom: 1px solid var(--border); }
.panel-heading h2 { margin: 0 0 4px; font-size: 19px; }
.panel-heading p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.5; }
.step-number { flex: 0 0 auto; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--primary); color: white; font-size: 13px; font-weight: 800; }
.form-section { padding: 25px 0; border-bottom: 1px solid var(--border); }
.form-section h3 { margin: 0 0 15px; font-size: 13px; letter-spacing: .04em; text-transform: uppercase; }
.field-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.field-stack { display: grid; gap: 15px; }
.field { display: grid; gap: 7px; color: #384451; font-size: 13px; font-weight: 650; }
.field input, .field select { width: 100%; min-height: 45px; padding: 10px 12px; border: 1px solid #ccd4dd; border-radius: 9px; background: var(--surface); color: var(--text); font-size: 14px; font-weight: 450; }
.field select { appearance: auto; }
.total-field output { min-height: 45px; display: flex; align-items: center; padding: 10px 12px; border-radius: 9px; background: var(--surface-muted); color: var(--primary); font-size: 15px; font-weight: 800; }
.button { min-height: 47px; display: inline-flex; align-items: center; justify-content: center; margin-top: 24px; padding: 11px 20px; border: 0; border-radius: 10px; font-weight: 750; cursor: pointer; }
.button-primary { width: 100%; background: var(--primary); color: white; }
.button-primary:hover { background: var(--primary-dark); }
.result-placeholder { min-height: 245px; display: grid; place-items: center; align-content: center; gap: 12px; text-align: center; color: var(--muted); }
.result-placeholder span { display: grid; place-items: center; width: 58px; height: 58px; border-radius: 50%; background: var(--surface-muted); color: #97a2ae; font-size: 24px; }
.result-placeholder p { max-width: 230px; margin: 0; font-size: 14px; line-height: 1.55; }
.price-list { margin: 18px 0 0; }
.price-list > div { display: flex; justify-content: space-between; gap: 20px; padding: 11px 0; color: #465361; font-size: 13px; }
.price-list dt, .price-list dd { margin: 0; }
.price-list dd { flex: 0 0 auto; color: var(--text); font-variant-numeric: tabular-nums; font-weight: 700; text-align: right; }
.price-list .price-discount dd { color: var(--success); }
.price-list .price-net { margin-top: 5px; padding-top: 16px; border-top: 1px solid var(--border); font-size: 14px; font-weight: 700; }
.price-list .price-total { align-items: baseline; margin-top: 5px; padding-top: 17px; border-top: 2px solid var(--text); color: var(--text); font-size: 17px; font-weight: 800; }
.price-list .price-total dd { color: var(--primary); font-size: 25px; }
.shipping-note { display: grid; gap: 4px; margin-top: 21px; padding: 14px; border-radius: 10px; background: var(--primary-soft); color: var(--primary-dark); }
.shipping-note strong { font-size: 13px; }
.shipping-note span { font-size: 12px; line-height: 1.45; }
.alert { margin-bottom: 22px; padding: 15px 17px; border: 1px solid; border-radius: 11px; font-size: 13px; line-height: 1.5; }
.alert strong { display: block; margin-bottom: 4px; }
.alert p { margin: 0; }
.alert ul { margin: 5px 0 0; padding-left: 18px; }
.alert-error { border-color: #efc5c8; background: var(--danger-soft); color: var(--danger); }
.alert-warning { border-color: #efd99e; background: var(--warning-soft); color: var(--warning); }
.alert-success { border-color: #b9dfcf; background: #edf9f4; color: var(--success); }
.empty-state { padding: 40px; border: 1px dashed #bfc8d1; border-radius: 16px; text-align: center; background: var(--surface); }
.empty-state h2 { margin: 0 0 8px; }
.empty-state p { margin: 0; color: var(--muted); }
.login-panel { width: min(460px, 100%); margin: 30px auto; padding: 32px; }
.login-panel h1, .admin-form h1 { margin: 5px 0 24px; }
.form-link { color: var(--primary); font-size: 13px; font-weight: 700; text-align: center; }
.account-panel { margin-inline: auto; }
.check { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; }
.admin-nav { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 32px; }
.admin-nav a { padding: 8px 11px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--primary); font-size: 12px; font-weight: 700; text-decoration: none; }
.admin-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 24px; }
.admin-heading h1 { margin: 4px 0 0; }
.button-secondary { width: auto; margin: 0; border: 1px solid var(--primary); background: var(--surface); color: var(--primary); text-decoration: none; }
.table-wrap { overflow-x: auto; }
.admin-table { width: 100%; border-collapse: collapse; }
.admin-table th, .admin-table td { padding: 14px 16px; border-bottom: 1px solid var(--border); text-align: left; font-size: 13px; }
.admin-table th { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .06em; }
.actions { display: flex; justify-content: flex-end; gap: 13px; white-space: nowrap; }
.actions a, .link-button { border: 0; background: none; color: var(--primary); font: inherit; font-weight: 700; cursor: pointer; text-decoration: none; }
.actions .link-danger, .link-danger { color: var(--danger); }
.status { padding: 4px 8px; border-radius: 99px; background: #edf0f3; color: var(--muted); font-size: 11px; font-weight: 800; }
.status.is-active { background: #e4f6ee; color: var(--success); }
.admin-form { max-width: 900px; padding: 28px; }
.admin-product-form { display: grid; gap: 20px; }
.admin-product-form .admin-form { max-width: none; }
.admin-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 15px; margin-bottom: 18px; }
.admin-grid select[multiple] { min-height: 150px; }
.admin-section { margin-top: 20px; }
.help { color: var(--muted); font-size: 13px; }
.tier-grid { display: grid; grid-template-columns: repeat(5, 1fr) auto auto; gap: 8px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--border); }
.tier-grid input { min-width: 0; min-height: 40px; padding: 8px; border: 1px solid #ccd4dd; border-radius: 7px; }
.discount-grid { grid-template-columns: repeat(4, 1fr) auto auto; }
.button-small { min-height: 40px; margin: 0; padding: 8px 12px; background: var(--primary); color: white; }
.button-danger { width: auto; border: 1px solid #d7a9ad; background: var(--surface); color: var(--danger); }

@media (max-width: 900px) {
    .product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .calculator-grid { grid-template-columns: 1fr; }
    .result-panel { position: static; }
}

@media (max-width: 620px) {
    .shell { width: min(100% - 28px, 1180px); }
    .site-header .phase-label { display: none; }
    .header-inner { align-items: flex-start; flex-direction: column; padding-block: 12px; }
    .main-nav { width: 100%; overflow-x: auto; }
    .page-content { padding-block: 34px 50px; }
    .product-grid { grid-template-columns: 1fr; }
    .form-panel, .result-panel { padding: 20px; border-radius: 14px; }
    .field-grid { grid-template-columns: 1fr; }
    .admin-grid, .tier-grid, .discount-grid { grid-template-columns: 1fr; }
    .page-heading h1 { font-size: 32px; }
}
