* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', Roboto, sans-serif;
    background: #f5f5f7;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.app-container {
    width: 100%;
    max-width: 480px;
    background: #ffffff;
    border-radius: 24px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.12);
    overflow: hidden;
    position: relative;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.app-content {
    padding: 32px 24px 24px;
    background: #f5f5f7;
}

.dashboard-layout {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

@media (max-width: 480px) {
    .app-container {
        max-width: 100%;
        border-radius: 0;
        min-height: 100vh;
    }
    body {
        padding: 0;
    }
}

@media (min-width: 900px) {
    body {
        padding: 40px 20px;
        background: #eaebef;
    }

    .app-container {
        max-width: 1100px;
        width: 100%;
        border-radius: 28px;
    }

    .app-content {
        padding: 40px;
    }

    .app-content h1 {
        text-align: left;
        margin-bottom: 32px;
        font-size: 32px;
    }

    .dashboard-layout {
        display: grid;
        grid-template-columns: 380px 1fr;
        gap: 32px;
        align-items: stretch;
        margin-bottom: 24px;
    }

    .left-panel {
        display: flex;
        flex-direction: column;
        gap: 16px;
    }

    .right-panel {
        background: #ffffff;
        border-radius: 20px;
        padding: 24px;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.02);
        display: flex;
        flex-direction: column;
        height: 100%;
        min-height: 580px;
        max-height: 660px;
        border: 1px solid rgba(0, 0, 0, 0.05);
    }

    .plan-table {
        overflow-y: auto;
        flex: 1;
        box-shadow: none;
        border-radius: 0;
        margin-top: 8px;
    }

    .plan-table th {
        position: sticky;
        top: 0;
        z-index: 10;
        background: #f5f5f7;
    }

    .action-buttons {
        max-width: 380px;
    }
}

.plan-table::-webkit-scrollbar {
    width: 6px;
}

.plan-table::-webkit-scrollbar-thumb {
    background: #cbd5e0;
    border-radius: 3px;
}

.app-content::-webkit-scrollbar {
    width: 4px;
}

.app-content::-webkit-scrollbar-thumb {
    background: #cbd5e0;
    border-radius: 2px;
}

h1 {
    font-size: 28px;
    font-weight: 700;
    color: #1d1d1f;
    text-align: center;
    margin-bottom: 24px;
    letter-spacing: -0.5px;
}

.input-group {
    background: #ffffff;
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 16px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
}

.input-group h3 {
    font-size: 17px;
    font-weight: 600;
    color: #1d1d1f;
    margin-bottom: 16px;
    letter-spacing: -0.3px;
}

.input-field {
    margin-bottom: 12px;
}

.input-field:last-child {
    margin-bottom: 0;
}

.input-field label {
    display: block;
    font-size: 13px;
    color: #86868b;
    margin-bottom: 8px;
    font-weight: 500;
}

.input-field input {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid #d2d2d7;
    border-radius: 12px;
    font-size: 17px;
    color: #1d1d1f;
    transition: all 0.2s;
    background: #ffffff;
    -webkit-appearance: none;
    appearance: none;
}

.input-field input:focus {
    outline: none;
    border-color: #007aff;
    box-shadow: 0 0 0 4px rgba(0, 122, 255, 0.1);
}

.input-field input::placeholder {
    color: #c7c7cc;
}

.result-card {
    background: linear-gradient(135deg, #007aff 0%, #5856d6 100%);
    border-radius: 20px;
    padding: 24px;
    margin-bottom: 16px;
    color: #fff;
}

.result-card h3 {
    font-size: 15px;
    font-weight: 500;
    opacity: 0.9;
    margin-bottom: 8px;
}

.result-card .value {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 6px;
    letter-spacing: -0.5px;
}

.result-card .sub-value {
    font-size: 14px;
    opacity: 0.85;
}

.tabs {
    display: flex;
    background: #e5e5ea;
    border-radius: 12px;
    padding: 4px;
    margin-bottom: 16px;
}

.tab {
    flex: 1;
    padding: 12px;
    text-align: center;
    font-size: 15px;
    font-weight: 500;
    color: #86868b;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    background: transparent;
}

.tab.active {
    background: #ffffff;
    color: #007aff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.plan-table {
    background: #ffffff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
}

.plan-table table {
    width: 100%;
    border-collapse: collapse;
}

.plan-table th {
    background: #f5f5f7;
    color: #1d1d1f;
    padding: 14px 8px;
    font-size: 12px;
    font-weight: 600;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.plan-table td {
    padding: 12px 8px;
    font-size: 13px;
    color: #1d1d1f;
    text-align: center;
    border-bottom: 1px solid #e5e5ea;
}

.plan-table tr:last-child td {
    border-bottom: none;
}

.plan-table tr:nth-child(even) {
    background: #f9f9f9;
}

.plan-table .highlight {
    background: #fff3cd;
    font-weight: 600;
}

.action-buttons {
    display: flex;
    gap: 10px;
    margin-bottom: 16px;
}

.action-btn {
    flex: 1;
    padding: 12px;
    border: none;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.btn-save {
    background: #34c759;
    color: #fff;
}

.btn-save:hover {
    background: #2db84e;
}

.btn-send {
    background: #007aff;
    color: #fff;
}

.btn-send:hover {
    background: #0056b3;
}

.btn-install {
    background: #ff9500;
    color: #fff;
}

.btn-install:hover {
    background: #e68300;
}

.info-box {
    background: #e8f4ff;
    border-left: 4px solid #007aff;
    padding: 14px 16px;
    border-radius: 12px;
    margin-bottom: 16px;
    font-size: 13px;
    color: #1d1d1f;
    line-height: 1.5;
}

.hidden {
    display: none;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
    font-size: 14px;
}

.summary-row:last-child {
    border-bottom: none;
}

.summary-row span:first-child {
    opacity: 0.85;
}

.summary-row span:last-child {
    font-weight: 600;
}

.toast {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.9);
    color: #fff;
    padding: 24px 32px;
    border-radius: 16px;
    font-size: 15px;
    font-weight: 500;
    z-index: 1000;
    opacity: 0;
    transition: all 0.3s ease;
    pointer-events: none;
    max-width: 90%;
    text-align: center;
    line-height: 1.6;
    white-space: pre-line;
}

.toast.show {
    opacity: 1;
    pointer-events: auto;
}

.toast.success {
    background: rgba(52, 199, 89, 0.95);
}

.toast.error {
    background: rgba(255, 59, 48, 0.95);
}

.toast.info {
    background: rgba(0, 122, 255, 0.95);
}

.rate-select-container {
    margin-bottom: 16px;
}

.rate-select {
    width: 100%;
    padding: 14px 40px 14px 16px;
    border: 2px solid #007aff;
    border-radius: 12px;
    font-size: 17px;
    font-weight: 600;
    color: #007aff;
    transition: all 0.2s;
    background: linear-gradient(135deg, #e8f4ff 0%, #f0f8ff 100%);
    -webkit-appearance: none;
    appearance: none;
    cursor: pointer;
    position: relative;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23007aff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 20px;
}

.rate-select:hover {
    background: linear-gradient(135deg, #d0e8ff 0%, #e0f0ff 100%);
    border-color: #0056b3;
}

.rate-select:focus {
    outline: none;
    border-color: #0056b3;
    box-shadow: 0 0 0 4px rgba(0, 122, 255, 0.2);
}
