.ttn-decal-calc {
    --ttn-blue: #0875bd;
    --ttn-blue-dark: #075e99;
    --ttn-red: #e53935;
    --ttn-ink: #243447;
    --ttn-muted: #687789;
    --ttn-line: #dce4eb;
    width: 100%;
    max-width: 1120px;
    display: grid;
    grid-template-columns: minmax(0, 68fr) minmax(300px, 32fr);
    align-items: start;
    gap: 20px;
    color: var(--ttn-ink);
    font-family: Arial, Helvetica, sans-serif;
    letter-spacing: 0;
}

.ttn-decal-calc *, .ttn-decal-calc *::before, .ttn-decal-calc *::after { box-sizing: border-box; }
.ttn-decal-calc [hidden] { display: none !important; }

.ttn-calc-panel, .ttn-result, .ttn-price-board {
    border: 1px solid var(--ttn-line);
    border-radius: 6px;
    background: #fff;
    box-shadow: 0 4px 16px rgba(30, 63, 88, .08);
}

.ttn-calc-side { width: 100%; min-width: 0; max-width: 100%; display: grid; gap: 14px; align-content: start; }
.ttn-calc-panel { padding: 14px; }
.ttn-calc-head { display: flex; align-items: center; gap: 10px; margin-bottom: 15px; }
.ttn-calc-mark {
    width: 42px; height: 42px; display: grid; place-items: center; flex: 0 0 42px;
    border-radius: 50%; background: #eaf6fd; color: var(--ttn-blue); font-size: 20px;
}
.ttn-calc-head strong { display: block; color: #263746; font-size: 17px; line-height: 1.2; }
.ttn-calc-head small { display: block; margin-top: 3px; color: var(--ttn-muted); font-size: 12px; }

.ttn-section { min-width: 0; margin: 0 0 14px; padding: 0; border: 0; }
.ttn-section legend {
    display: flex; align-items: center; gap: 7px; width: 100%; margin: 0 0 10px;
    color: #34495b; font-size: 14px; font-weight: 700;
}
.ttn-section legend > span {
    width: 22px; height: 22px; display: inline-grid; place-items: center;
    border-radius: 50%; background: var(--ttn-blue); color: #fff; font-size: 12px;
}

.ttn-shape-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 5px; }
.ttn-shape {
    min-width: 0; min-height: 61px; display: grid; align-content: center; justify-items: center; gap: 5px;
    padding: 7px 2px; border: 1px solid #ccd6df; border-radius: 5px; background: #fff;
    color: #526374; cursor: pointer; text-align: center; transition: border-color .16s, background .16s, color .16s, box-shadow .16s;
}
.ttn-shape:hover { border-color: #75b9e3; background: #f7fcff; }
.ttn-shape.is-active { border-color: var(--ttn-blue); background: #edf8ff; color: var(--ttn-blue-dark); box-shadow: inset 0 0 0 1px var(--ttn-blue); }
.ttn-shape input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.ttn-shape > span:last-child { font-size: 9px; line-height: 1.15; font-weight: 700; overflow-wrap: anywhere; }
.ttn-icon { display: block; width: 24px; height: 17px; border: 2px solid currentColor; }
.ttn-icon-circle { width: 20px; height: 20px; border-radius: 50%; }
.ttn-icon-square { width: 20px; height: 20px; }
.ttn-icon-oval { width: 30px; border-radius: 50%; }
.ttn-icon-custom { width: 27px; clip-path: polygon(12% 6%, 90% 18%, 74% 88%, 18% 74%); }

.ttn-field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.ttn-field, .ttn-field-row label { display: grid; gap: 6px; min-width: 0; margin: 0 0 10px; }
.ttn-field > span, .ttn-field-row label > span { color: #526374; font-size: 12px; font-weight: 700; }
.ttn-field input, .ttn-field-row input, .ttn-field select {
    width: 100%; height: 42px; margin: 0; border: 1px solid #c7d2dc; border-radius: 4px;
    outline: 0; background: #fff; color: #203040; font-size: 14px; padding: 8px 11px;
    transition: border-color .16s, box-shadow .16s;
}
.ttn-field input:focus, .ttn-field-row input:focus, .ttn-field select:focus { border-color: var(--ttn-blue); box-shadow: 0 0 0 3px rgba(8, 117, 189, .12); }
.ttn-field input::placeholder, .ttn-field-row input::placeholder { color: #9aa8b5; }

.ttn-switch-row {
    min-height: 56px; display: flex; align-items: center; gap: 12px; padding: 10px 12px;
    border: 1px solid var(--ttn-line); border-radius: 5px; background: #f8fafc; cursor: pointer;
}
.ttn-switch-row > span { min-width: 0; flex: 1; }
.ttn-switch-row b, .ttn-switch-row small { display: block; }
.ttn-switch-row b { font-size: 13px; }
.ttn-switch-row small { margin-top: 2px; color: var(--ttn-muted); font-size: 11px; line-height: 1.3; }
.ttn-switch-row input { position: absolute; opacity: 0; pointer-events: none; }
.ttn-switch-row i { position: relative; width: 42px; height: 23px; flex: 0 0 42px; border-radius: 12px; background: #b8c3cc; transition: background .16s; }
.ttn-switch-row i::after { content: ''; position: absolute; top: 3px; left: 3px; width: 17px; height: 17px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.2); transition: transform .16s; }
.ttn-switch-row input:checked + i { background: var(--ttn-blue); }
.ttn-switch-row input:checked + i::after { transform: translateX(19px); }

.ttn-calc-btn {
    width: 100%; min-height: 46px; display: flex; align-items: center; justify-content: center; gap: 8px;
    border: 0; border-radius: 4px; background: var(--ttn-blue); color: #fff; cursor: pointer;
    font-size: 15px; font-weight: 700; transition: background .16s, transform .16s;
}
.ttn-calc-btn:hover { background: var(--ttn-blue-dark); }
.ttn-calc-btn:active { transform: translateY(1px); }
.ttn-calc-btn:disabled { cursor: wait; opacity: .76; }
.ttn-spinner { width: 16px; height: 16px; border: 2px solid rgba(255,255,255,.45); border-top-color: #fff; border-radius: 50%; animation: ttn-spin .7s linear infinite; }
@keyframes ttn-spin { to { transform: rotate(360deg); } }
.ttn-status { min-height: 16px; margin-top: 5px; color: var(--ttn-muted); font-size: 11px; text-align: center; }
.ttn-error { margin-top: 8px; padding: 9px 10px; border: 1px solid #efb9b7; border-radius: 4px; background: #fff2f1; color: #b42318; font-size: 12px; line-height: 1.4; }

.ttn-result { position: static; min-height: 240px; overflow: hidden; }
.ttn-result-empty { min-height: 318px; display: grid; align-content: center; justify-items: center; padding: 30px; color: var(--ttn-muted); text-align: center; }
.ttn-result-empty > span { font-size: 36px; filter: grayscale(1); opacity: .55; }
.ttn-result-empty strong { margin-top: 12px; color: #34495b; font-size: 17px; }
.ttn-result-empty p { max-width: 230px; margin: 6px 0 0; font-size: 12px; line-height: 1.45; }
.ttn-result-head { padding: 17px 18px; border-bottom: 1px solid var(--ttn-line); background: #f7fbfe; }
.ttn-result-head > span { display: block; color: var(--ttn-muted); font-size: 11px; font-weight: 700; text-transform: uppercase; }
.ttn-result-head strong { display: block; margin-top: 3px; color: var(--ttn-red); font-size: 28px; line-height: 1.2; }
.ttn-summary { padding: 12px 18px; border-bottom: 1px solid #edf1f4; color: #536475; font-size: 12px; line-height: 1.5; }
.ttn-specs { display: grid; grid-template-columns: repeat(3, 1fr); margin: 0; border-bottom: 1px solid #edf1f4; }
.ttn-specs > div { min-width: 0; padding: 12px 10px; }
.ttn-specs > div + div { border-left: 1px solid #edf1f4; }
.ttn-specs dt { margin: 0 0 4px; color: var(--ttn-muted); font-size: 10px; }
.ttn-specs dd { margin: 0; color: #263746; font-size: 12px; font-weight: 700; overflow-wrap: anywhere; }
.ttn-breakdown { display: flex; flex-wrap: wrap; gap: 6px; padding: 10px 18px; }
.ttn-breakdown span { padding: 5px 7px; border-radius: 3px; background: #f2f6f8; color: #5c6d7d; font-size: 10px; }
.ttn-breakdown b { margin-right: 4px; color: #2e4050; }
.ttn-ref-wrap { max-height: 260px; overflow: auto; border-top: 1px solid #edf1f4; }
.ttn-ref-table { width: 100%; min-width: 320px; border-collapse: collapse; font-size: 11px; }
.ttn-ref-table th, .ttn-ref-table td { padding: 8px 7px; border-bottom: 1px solid #edf1f4; text-align: right; white-space: nowrap; }
.ttn-ref-table th { position: sticky; top: 0; background: #f5f8fa; color: #5d6c7b; }
.ttn-ref-table tr.is-current td { background: #fff4ed; color: #c4322c; font-weight: 700; }

.ttn-price-board { width: 100%; min-width: 0; max-width: 100%; overflow: hidden; }
.ttn-board-head { display: flex; align-items: center; min-height: 70px; padding: 16px 20px; border-bottom: 3px solid #e63378; }
.ttn-board-head strong { display: block; color: #303f4c; font-size: 17px; line-height: 1.25; }
.ttn-board-head small { display: block; margin-top: 4px; color: var(--ttn-muted); font-size: 12px; }
.ttn-price-table-wrap { display: block; width: 100%; max-width: 100%; overflow-x: auto; }
.ttn-price-table { width: 100%; min-width: 620px; border-collapse: collapse; table-layout: fixed; }
.ttn-price-table th, .ttn-price-table td { height: 48px; padding: 9px 14px; border-bottom: 1px solid #e6ebef; text-align: right; vertical-align: middle; }
.ttn-price-table th { background: #f5f7f9; color: #526372; font-size: 12px; font-weight: 700; text-transform: uppercase; }
.ttn-price-table th:first-child, .ttn-price-table td:first-child { width: 19%; text-align: center; }
.ttn-price-table th:nth-child(2), .ttn-price-table td:nth-child(2) { width: 23%; }
.ttn-price-table th:nth-child(3), .ttn-price-table td:nth-child(3) { width: 31%; }
.ttn-price-table th:last-child, .ttn-price-table td:last-child { width: 27%; text-align: center; }
.ttn-price-table td { color: #3b4b59; font-size: 13px; }
.ttn-price-table .ttn-row-qty { color: #263746; font-size: 14px; font-weight: 700; }
.ttn-price-table .ttn-row-total { color: #e13732; font-size: 14px; font-weight: 700; }
.ttn-price-table tbody tr { transition: background .15s, box-shadow .15s; }
.ttn-price-table tbody tr:hover { background: #f8fcff; }
.ttn-price-table tbody tr.is-current { background: #eef8ff; box-shadow: inset 4px 0 0 var(--ttn-blue); }
.ttn-price-table tbody tr.is-current td { color: var(--ttn-blue-dark); font-weight: 700; }
.ttn-row-order, .ttn-order-now { border: 0; border-radius: 4px; background: var(--ttn-blue); color: #fff; cursor: pointer; font-weight: 700; }
.ttn-row-order { min-width: 86px; min-height: 30px; padding: 6px 10px; font-size: 11px; }
.ttn-row-order:hover, .ttn-order-now:hover { background: var(--ttn-blue-dark); }
.ttn-order-now { width: calc(100% - 36px); min-height: 42px; margin: 4px 18px 18px; font-size: 13px; }

@media (max-width: 760px) {
    .ttn-decal-calc { width: 100%; max-width: 100%; display: flex; flex-direction: column; gap: 14px; overflow: hidden; }
    .ttn-calc-side { order: 1; }
    .ttn-price-board { order: 2; }
    .ttn-calc-panel { padding: 15px; }
    .ttn-result { position: static; min-height: 240px; }
    .ttn-result-empty { min-height: 238px; }
}

@media (max-width: 430px) {
    .ttn-shape-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .ttn-field-row { grid-template-columns: 1fr; gap: 0; }
    .ttn-calc-head strong { font-size: 18px; }
    .ttn-specs { grid-template-columns: 1fr; }
    .ttn-specs > div + div { border-left: 0; border-top: 1px solid #edf1f4; }
}
