.calc-app {
    max-width: 480px;
    margin: 0 auto;
    padding: 0 0 24px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.calc-head {
    text-align: center;
    margin-bottom: 22px;
}

.calc-title {
    margin: 0 0 8px;
    font-size: clamp(1.35rem, 4vw, 1.65rem);
    font-weight: 700;
    letter-spacing: -0.03em;
    color: #1d1d1f;
}

.calc-lead {
    margin: 0;
    font-size: 14px;
    line-height: 1.55;
    color: #6e6e73;
}

.calc-modes {
    display: flex;
    gap: 8px;
    margin-bottom: 18px;
    padding: 4px;
    background: #f2f2f7;
    border-radius: 14px;
}

.calc-mode {
    flex: 1;
    min-height: 44px;
    border: none;
    border-radius: 11px;
    background: transparent;
    color: #6e6e73;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, color 0.15s, box-shadow 0.15s;
}

.calc-mode.is-active {
    background: #fff;
    color: #1d1d1f;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.calc-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 14px;
}

.calc-field > span {
    font-size: 13px;
    font-weight: 600;
    color: #3a3a3c;
}

.calc-input-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 14px;
    min-height: 52px;
    background: #fff;
    border: 1px solid #e5e5ea;
    border-radius: 14px;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.calc-input-wrap:focus-within {
    border-color: #4e73df;
    box-shadow: 0 0 0 3px rgba(78, 115, 223, 0.14);
}

.calc-input-wrap input {
    flex: 1;
    min-width: 0;
    border: none;
    background: transparent;
    font-size: 22px;
    font-weight: 600;
    color: #1d1d1f;
    outline: none;
}

.calc-input-wrap input::placeholder {
    color: #c7c7cc;
    font-weight: 500;
}

.calc-suffix {
    font-size: 18px;
    font-weight: 600;
    color: #8e8e93;
    flex-shrink: 0;
}

.calc-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 18px;
}

.calc-chip {
    min-height: 40px;
    padding: 8px 14px;
    border: 1px solid #e5e5ea;
    border-radius: 999px;
    background: #fff;
    color: #333;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
}

.calc-chip.is-active {
    background: #4e73df;
    border-color: #4e73df;
    color: #fff;
}

.calc-stepper {
    display: flex;
    align-items: center;
    gap: 12px;
}

.calc-stepper-btn {
    width: 44px;
    height: 44px;
    border: 1px solid #e5e5ea;
    border-radius: 12px;
    background: #fff;
    font-size: 22px;
    line-height: 1;
    color: #4e73df;
    cursor: pointer;
}

.calc-stepper-btn:active {
    transform: scale(0.96);
}

.calc-stepper input {
    width: 56px;
    text-align: center;
    font-size: 22px;
    font-weight: 700;
    border: none;
    background: transparent;
    color: #1d1d1f;
    outline: none;
}

.calc-check {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 44px;
    margin-bottom: 8px;
    font-size: 15px;
    color: #333;
    cursor: pointer;
}

.calc-check input {
    width: 20px;
    height: 20px;
    accent-color: #4e73df;
}

.calc-result {
    margin-top: 8px;
    padding: 20px 18px;
    background: linear-gradient(160deg, #f8faff 0%, #fff 100%);
    border: 1px solid #e8ecf8;
    border-radius: 18px;
    box-shadow: 0 8px 28px rgba(78, 115, 223, 0.08);
}

.calc-result.is-empty {
    background: #fafafa;
    border-color: #ececf0;
    box-shadow: none;
}

.calc-result-main {
    text-align: center;
    margin-bottom: 16px;
}

.calc-result-label {
    display: block;
    font-size: 13px;
    color: #6e6e73;
    margin-bottom: 4px;
}

.calc-result-value {
    font-size: clamp(2rem, 8vw, 2.5rem);
    font-weight: 800;
    letter-spacing: -0.03em;
    color: #1d1d1f;
    line-height: 1.1;
}

.calc-result-value--accent {
    color: #4e73df;
}

.calc-result-value--save {
    color: #15803d;
}

.calc-result-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.calc-result-item {
    padding: 12px;
    background: rgba(255, 255, 255, 0.85);
    border-radius: 12px;
    text-align: center;
}

.calc-result-item strong {
    display: block;
    font-size: 17px;
    font-weight: 700;
    color: #1d1d1f;
    margin-top: 4px;
}

.calc-result-item span {
    font-size: 12px;
    color: #6e6e73;
}

.calc-result-empty {
    margin: 0;
    text-align: center;
    font-size: 14px;
    color: #9ca3af;
}

.calc-note {
    margin: 14px 0 0;
    font-size: 13px;
    line-height: 1.45;
    color: #6e6e73;
    text-align: center;
}

.calc-panel[hidden] {
    display: none !important;
}

.calc-date-row {
    display: flex;
    gap: 8px;
    align-items: stretch;
}

.calc-date-row input[type="date"] {
    flex: 1;
    min-width: 0;
    min-height: 52px;
    padding: 0 14px;
    border: 1px solid #e5e5ea;
    border-radius: 14px;
    background: #fff;
    font-size: 16px;
    font-weight: 600;
    color: #1d1d1f;
    font-family: inherit;
}

.calc-date-row input[type="date"]:focus {
    outline: none;
    border-color: #4e73df;
    box-shadow: 0 0 0 3px rgba(78, 115, 223, 0.14);
}

.calc-date-today {
    flex-shrink: 0;
    min-height: 52px;
    padding: 0 14px;
    border: 1px solid #e5e5ea;
    border-radius: 14px;
    background: #fff;
    color: #4e73df;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}

.calc-toggle {
    display: flex;
    gap: 6px;
    margin-bottom: 14px;
}

.calc-toggle-btn {
    flex: 1;
    min-height: 44px;
    border: 1px solid #e5e5ea;
    border-radius: 12px;
    background: #fff;
    font-size: 18px;
    font-weight: 700;
    color: #6e6e73;
    cursor: pointer;
}

.calc-toggle-btn.is-active {
    background: #4e73df;
    border-color: #4e73df;
    color: #fff;
}

.calc-unit-chips .calc-chip {
    font-size: 14px;
    padding: 8px 12px;
}

.calc-presets-label {
    margin: 0 0 8px;
    font-size: 12px;
    font-weight: 600;
    color: #8e8e93;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.calc-result-grid--3 {
    grid-template-columns: repeat(3, 1fr);
}

.calc-result-sub {
    margin: 0 0 14px;
    text-align: center;
    font-size: 15px;
    line-height: 1.45;
    color: #3a3a3c;
}

.calc-result-list {
    margin: 12px 0 0;
    padding: 0;
    list-style: none;
}

.calc-result-list li {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 0;
    border-top: 1px solid #ececf0;
    font-size: 14px;
    color: #6e6e73;
}

.calc-result-list li strong {
    color: #1d1d1f;
    font-weight: 600;
    text-align: right;
}

@media (max-width: 380px) {
    .calc-mode {
        font-size: 13px;
        padding: 0 4px;
    }

    .calc-result-grid--3 {
        grid-template-columns: 1fr 1fr;
    }
}

.calc-details {
    margin-bottom: 16px;
    border: 1px solid #e5e5ea;
    border-radius: 14px;
    background: #fafafa;
    overflow: hidden;
}

.calc-details summary {
    padding: 14px 16px;
    font-size: 15px;
    font-weight: 600;
    color: #4e73df;
    cursor: pointer;
    list-style: none;
}

.calc-details summary::-webkit-details-marker {
    display: none;
}

.calc-details-body {
    padding: 0 16px 16px;
}

.calc-bracket {
    margin-top: 12px;
}

.calc-bracket-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    font-size: 12px;
    color: #6e6e73;
}

.calc-bracket-row span:first-child {
    width: 36px;
    flex-shrink: 0;
    font-weight: 700;
    color: #1d1d1f;
}

.calc-bracket-bar {
    flex: 1;
    height: 8px;
    background: #ececf0;
    border-radius: 999px;
    overflow: hidden;
}

.calc-bracket-fill {
    height: 100%;
    background: #4e73df;
    border-radius: 999px;
    transition: width 0.2s;
}

.calc-bracket-row.is-active span:first-child {
    color: #4e73df;
}

.calc-bracket-row.is-active .calc-bracket-fill {
    background: linear-gradient(90deg, #4e73df, #6b8cef);
}

.calc-result-value--tax {
    color: #dc2626;
}

.calc-select-wrap select {
    width: 100%;
    min-height: 52px;
    padding: 0 14px;
    border: 1px solid #e5e5ea;
    border-radius: 14px;
    background: #fff;
    font-size: 16px;
    font-weight: 600;
    color: #1d1d1f;
    font-family: inherit;
}

.calc-select-wrap select:focus {
    outline: none;
    border-color: #4e73df;
    box-shadow: 0 0 0 3px rgba(78, 115, 223, 0.14);
}
