/* PK Salary Tax Calculator — v3.0.0 */

.pkstc-wrap {
    --g: #1B6B3A;
    --g2: #0d4a26;
    --r: #C8102E;
    --b: #185FA5;
    --border: #e2e8f0;
    --bg: #f8fafc;
    --surface: #ffffff;
    --text: #1a202c;
    --muted: #64748b;
    --rad: 10px;

    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    color: var(--text);
    max-width: 720px;
    margin: 0 auto;
    padding: 0 12px 32px;
    box-sizing: border-box;
}

.pkstc-wrap *, .pkstc-wrap *::before, .pkstc-wrap *::after {
    box-sizing: inherit;
}

/* Header */
.pkstc-hdr {
    background: linear-gradient(135deg, var(--g), var(--g2));
    color: #fff;
    text-align: center;
    padding: 32px 24px 26px;
    border-radius: var(--rad) var(--rad) 0 0;
}
.pkstc-flag { font-size: 36px; margin-bottom: 8px; }
.pkstc-title {
    font-size: 22px;
    font-weight: 700;
    margin: 0 0 6px;
    letter-spacing: -0.3px;
}
.pkstc-sub {
    font-size: 12px;
    opacity: 0.75;
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 0.6px;
}

/* Form */
.pkstc-form {
    background: var(--surface);
    border: 1px solid var(--border);
    border-top: none;
    padding: 26px 24px 20px;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.pkstc-field { display: flex; flex-direction: column; gap: 5px; }

.pkstc-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 5px;
}

.pkstc-tip {
    color: var(--muted);
    font-size: 13px;
    cursor: help;
}

.pkstc-select,
.pkstc-input {
    width: 100%;
    padding: 10px 13px;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    font-size: 15px;
    color: var(--text);
    background: var(--bg);
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
    -webkit-appearance: none;
    appearance: none;
}

.pkstc-select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='7'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%231B6B3A' stroke-width='1.8' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 13px center;
    padding-right: 36px;
    cursor: pointer;
}

.pkstc-select:focus,
.pkstc-input:focus {
    border-color: var(--g);
    box-shadow: 0 0 0 3px rgba(27,107,58,0.12);
    background: #fff;
}

.pkstc-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}
@media (max-width: 520px) { .pkstc-grid-2 { grid-template-columns: 1fr; } }

/* Toggle */
.pkstc-toggle {
    display: flex;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
}
.pkstc-tog {
    flex: 1;
    padding: 10px;
    border: none;
    background: var(--bg);
    color: var(--muted);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}
.pkstc-tog-on {
    background: var(--g) !important;
    color: #fff !important;
}
.pkstc-tog:hover:not(.pkstc-tog-on) {
    background: #e8f5ee;
    color: var(--g);
}

/* Checkbox row */
.pkstc-chk-row {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    font-size: 13px;
    color: var(--muted);
    cursor: pointer;
    line-height: 1.5;
}
.pkstc-chk-row input[type="checkbox"] {
    width: 16px;
    height: 16px;
    margin-top: 2px;
    flex-shrink: 0;
    accent-color: var(--g);
    cursor: pointer;
}

/* Calculate button */
.pkstc-calc-btn {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, var(--g), var(--g2));
    color: #fff;
    border: none;
    border-radius: 9px;
    font-size: 17px;
    font-weight: 700;
    cursor: pointer;
    letter-spacing: 0.2px;
    transition: opacity 0.15s, transform 0.1s;
    margin-top: 2px;
}
.pkstc-calc-btn:hover { opacity: 0.9; }
.pkstc-calc-btn:active { transform: scale(0.98); opacity: 0.8; }

/* Error */
.pkstc-error {
    background: #fff0f0;
    border: 1px solid #fca5a5;
    color: #dc2626;
    border-radius: 8px;
    padding: 11px 15px;
    font-size: 14px;
    margin-top: 6px;
    border-top: none;
    border-radius: 0 0 8px 8px;
}

/* Results */
.pkstc-results {
    background: var(--bg);
    border: 1px solid var(--border);
    border-top: none;
    padding: 26px 24px;
    border-radius: 0 0 var(--rad) var(--rad);
    animation: pkstcIn 0.3s ease;
}
@keyframes pkstcIn {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Cards */
.pkstc-cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 26px;
}
@media (max-width: 460px) { .pkstc-cards { grid-template-columns: 1fr; } }

.pkstc-card {
    border-radius: 10px;
    padding: 16px 14px;
    text-align: center;
    border: 1.5px solid transparent;
}
.pkstc-card-red { background: #fff5f5; border-color: #fecaca; }
.pkstc-card-grn { background: #f0faf4; border-color: #86efac; }
.pkstc-card-blu { background: #eff6ff; border-color: #93c5fd; }

.pkstc-clbl {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.7px;
    color: var(--muted);
    margin-bottom: 5px;
}
.pkstc-cval {
    font-size: 22px;
    font-weight: 800;
    word-break: break-all;
}
.pkstc-card-red .pkstc-cval { color: var(--r); }
.pkstc-card-grn .pkstc-cval { color: var(--g); }
.pkstc-card-blu .pkstc-cval { color: var(--b); }
.pkstc-csub { font-size: 11px; color: var(--muted); margin-top: 3px; }

/* Section title */
.pkstc-sec-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--text);
    margin: 0 0 10px;
}

/* Breakdown table */
.pkstc-tbl {
    width: 100%;
    border-collapse: collapse;
    font-size: 13.5px;
    margin-bottom: 24px;
}
.pkstc-tbl td {
    padding: 8px 10px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}
.pkstc-tbl td:first-child { color: var(--muted); }
.pkstc-tbl td:last-child {
    text-align: right;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}
.pkstc-hl { background: #f1f5f9; }
.pkstc-hl td { font-weight: 700 !important; }
.pkstc-grn { color: var(--g) !important; }
.pkstc-red { color: var(--r) !important; }

/* Slab bars */
.pkstc-slab-row {
    display: grid;
    grid-template-columns: 150px 1fr 44px;
    align-items: center;
    gap: 10px;
    font-size: 12px;
    margin-bottom: 8px;
}
@media (max-width: 460px) {
    .pkstc-slab-row { grid-template-columns: 100px 1fr 36px; }
}
.pkstc-slab-lbl { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pkstc-slab-track {
    height: 20px;
    background: var(--border);
    border-radius: 4px;
    overflow: hidden;
}
.pkstc-slab-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.45s ease;
}
.pkstc-slab-pct { font-weight: 700; text-align: right; color: var(--text); }

/* Note */
.pkstc-note {
    font-size: 12px;
    color: var(--muted);
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 11px 14px;
    line-height: 1.6;
    margin: 16px 0 0;
}
