/* ============================================================
   WPS SIF Generator — scoped styles (based on CoreLedger original)
   ============================================================ */

/* ── Base app wrapper ── */
#wps-app {
    width: 100%;
    overflow-x: hidden;
    padding-top: 40px;
}

/* ── Reset & base ── */
#wps-app *, #wps-app *::before, #wps-app *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

#wps-app {
    --bg:        #EEF2F7;
    --bg2:       #E2E8F0;
    --white:     #ffffff;
    --navy:      #1E293B;
    --navy2:     #263548;
    --text:      #1E293B;
    --text2:     #4a5568;
    --text3:     #8a96aa;
    --border:    #CBD5E1;
    --border2:   #B8C8D9;
    --green:     #2d7a3a;
    --green2:    #236030;
    --radius:    8px;
    --radius-lg: 14px;
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    line-height: 1.65;
    color: var(--text);
    background: var(--bg);
}

/* ── Hide built-in header (site has its own) ── */
#wps-app .wps-header { display: none; }

/* ── Hero ── */
#wps-app .wps-hero {
    background: var(--navy);
    color: white;
    padding: 38px 0 36px;
    position: relative;
    overflow: hidden;
}

#wps-app .wps-hero .wps-hero-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    box-sizing: border-box;
    position: relative;
}

/* WPS watermark */
#wps-app .wps-hero-inner::after {
    content: 'WPS';
    position: absolute;
    left: 420px;
    top: 50%;
    transform: translateY(-50%);
    font-family: 'Playfair Display', serif;
    font-size: 180px;
    font-weight: 700;
    color: rgba(255,255,255,0.07);
    line-height: 1;
    pointer-events: none;
    letter-spacing: -6px;
    white-space: nowrap;
    user-select: none;
    z-index: 0;
}

#wps-app .wps-hero-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.5);
    border: 1px solid rgba(255,255,255,0.15);
    padding: 4px 11px;
    border-radius: 100px;
    margin-bottom: 18px;
    position: relative;
    z-index: 1;
}

#wps-app .wps-hero h1 {
    font-family: 'Playfair Display', serif;
    font-size: 34px;
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: -0.02em;
    margin-bottom: 10px;
    position: relative;
    z-index: 1;
    color: #ffffff;
}

#wps-app .wps-hero p {
    color: rgba(255,255,255,0.55);
    font-size: 13px;
    max-width: 500px;
    position: relative;
    z-index: 1;
    margin: 0;
}

/* ── Outer layout: left-col (steps + main) + sidebar ── */
#wps-app .wps-outer {
    max-width: 1200px;
    margin: 0 auto;
    padding: 36px 24px 80px;
    display: flex;
    flex-direction: row;
    gap: 28px;
    align-items: flex-start;
}

#wps-app .wps-left-col {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

#wps-app .wps-main    { min-width: 0; overflow: hidden; }
#wps-app .wps-sidebar { flex: 0 0 290px; width: 290px; display: flex; flex-direction: column; gap: 16px; transition: opacity 0.2s ease; }

/* Step 2: left-col goes full-width, sidebar wraps below as a row */
#wps-app .wps-outer.step2-active { flex-wrap: wrap; }
#wps-app .wps-outer.step2-active .wps-left-col { flex: 0 0 100%; }
#wps-app .wps-outer.step2-active .wps-steps    { max-width: calc(100% - 290px - 28px); }
#wps-app .wps-outer.step2-active .wps-sidebar  { flex: 0 0 100%; width: 100%; flex-direction: row; flex-wrap: wrap; gap: 24px; }
#wps-app .wps-outer.step2-active .wps-sidebar > * { flex: 1 1 300px; }
#wps-app .wps-section { display: none; }
#wps-app .wps-section.active { display: block; }
#wps-app .wps-tbl-wrap { overflow-x: auto; max-width: 100%; }

/* ── Steps ── */
#wps-app .wps-steps {
    display: flex;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 100px;
    overflow: hidden;
    margin-bottom: 0;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

#wps-app .wps-step-btn {
    flex: 1;
    padding: 14px 6px;
    background: none;
    border: none;
    border-right: 1px solid var(--border);
    color: var(--text3);
    font-family: 'Inter', sans-serif;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s;
}

#wps-app .wps-step-btn:last-child { border-right: none; }
#wps-app .wps-step-btn.active { background: var(--navy); color: white; }
#wps-app .wps-step-btn.done { color: #16a34a; background: #f0fdf4; }

#wps-app .wps-step-num {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--bg);
    border: 1px solid var(--border);
    display: grid;
    place-items: center;
    font-size: 10px;
    font-weight: 700;
    flex-shrink: 0;
    transition: all 0.2s;
}

#wps-app .wps-step-btn.active .wps-step-num { background: rgba(255,255,255,0.2); border-color: rgba(255,255,255,0.3); color: white; }
#wps-app .wps-step-btn.done .wps-step-num  { background: #16a34a; border-color: #16a34a; color: white; }

/* ── Card ── */
#wps-app .wps-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-bottom: 20px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.05);
}

#wps-app .wps-card-header {
    padding: 16px 24px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg);
}

#wps-app .wps-card-title {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text2);
    display: flex;
    align-items: center;
    gap: 10px;
}

#wps-app .wps-rtag {
    font-size: 10px;
    font-weight: 700;
    background: var(--navy);
    color: white;
    padding: 2px 8px;
    border-radius: 4px;
    letter-spacing: 0.08em;
}

#wps-app .wps-card-body { padding: 24px; }

/* ── Grid ── */
#wps-app .g2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
#wps-app .g3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }

/* ── Field ── */
#wps-app .wps-field { display: flex; flex-direction: column; gap: 5px; }

#wps-app .wps-field label {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text2);
    min-height: 16px;
}

#wps-app .wps-field label .req,
#wps-app .req { color: #c0392b; }

#wps-app .wps-field .fhint {
    font-size: 11px;
    color: var(--text3);
    margin-top: 4px;
    font-style: italic;
    min-height: 16px;
    display: block;
}

#wps-app .wps-field input,
#wps-app .wps-field select {
    background: var(--bg);
    border: 1px solid var(--border2);
    border-radius: var(--radius);
    color: var(--text);
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    padding: 0 13px;
    height: 42px;
    line-height: 42px;
    transition: all 0.18s;
    outline: none;
    width: 100%;
    box-sizing: border-box;
}

#wps-app .wps-field input[type="date"],
#wps-app .wps-field input[type="month"] {
    padding: 0 10px;
    cursor: pointer;
}

#wps-app .wps-field input:focus,
#wps-app .wps-field select:focus {
    border-color: var(--navy);
    background: var(--white);
    box-shadow: 0 0 0 3px rgba(22,47,80,0.08);
}

#wps-app .wps-field input::placeholder { color: var(--text3); }
#wps-app .wps-field input.mono { font-family: 'Inter', sans-serif; font-size: 13px; letter-spacing: 0; }

/* ── Date wrap — DD.MM.YYYY overlay (standalone fields only) ── */
#wps-app .wps-field .wps-date-wrap {
    position: relative;
    height: 42px;
}

#wps-app .wps-field .wps-date-wrap input[type="date"] {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 42px !important;
    opacity: 0;
    cursor: pointer;
    z-index: 2;
    border: none !important;
    background: transparent !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin: 0;
    line-height: normal;
}

#wps-app .wps-field .wps-date-dmy {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    padding: 0 32px 0 13px;
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    color: var(--text);
    background: var(--bg) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238a96aa' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='18' rx='2'/%3E%3Cline x1='16' y1='2' x2='16' y2='6'/%3E%3Cline x1='8' y1='2' x2='8' y2='6'/%3E%3Cline x1='3' y1='10' x2='21' y2='10'/%3E%3C/svg%3E") no-repeat right 10px center / 14px 14px;
    border: 1px solid var(--border2);
    border-radius: var(--radius);
    pointer-events: none;
    z-index: 1;
    white-space: nowrap;
    overflow: hidden;
    box-sizing: border-box;
    letter-spacing: 0;
}

#wps-app .wps-field .wps-date-wrap input[type="date"]:focus ~ .wps-date-dmy {
    border-color: var(--navy);
    background-color: var(--white);
    box-shadow: 0 0 0 3px rgba(22,47,80,0.08);
}

#wps-app .wps-field .wps-date-dmy:empty::before {
    content: 'ДД.ММ.ГГГГ';
    color: var(--text3);
}

/* Table date cells — overlay approach (DD.MM.YYYY, calendar on click) */
#wps-app .wps-tbl .wps-date-wrap {
    position: relative;
    height: 34px;
    min-width: 108px;
}

#wps-app .wps-tbl .wps-date-wrap input[type="date"] {
    position: absolute !important;
    inset: 0 !important;
    width: 100% !important;
    height: 34px !important;
    opacity: 0 !important;
    cursor: pointer !important;
    z-index: 2 !important;
    border: none !important;
    background: transparent !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin: 0 !important;
    line-height: normal !important;
}

#wps-app .wps-tbl .wps-date-dmy {
    position: absolute !important;
    inset: 0 !important;
    display: flex !important;
    align-items: center !important;
    padding: 0 26px 0 8px !important;
    font-family: 'Inter', sans-serif !important;
    font-size: 12px !important;
    color: var(--text) !important;
    background: #fafbfc url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238a96aa' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='18' rx='2'/%3E%3Cline x1='16' y1='2' x2='16' y2='6'/%3E%3Cline x1='8' y1='2' x2='8' y2='6'/%3E%3Cline x1='3' y1='10' x2='21' y2='10'/%3E%3C/svg%3E") no-repeat right 6px center / 12px 12px !important;
    border: 1px solid var(--border) !important;
    border-radius: 6px !important;
    pointer-events: none !important;
    z-index: 1 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    min-height: auto !important;
    letter-spacing: 0 !important;
}

#wps-app .wps-tbl .wps-date-wrap input[type="date"]:focus ~ .wps-date-dmy {
    border-color: var(--navy) !important;
    background-color: var(--white) !important;
    box-shadow: 0 0 0 2px rgba(22,47,80,0.1) !important;
}

#wps-app .wps-tbl .wps-date-dmy:empty::before {
    content: 'ДД.ММ.ГГГГ';
    color: var(--text3);
    font-size: 11px;
}

#wps-app .wps-divider { height: 1px; background: var(--border); margin: 20px 0; }

/* ── Table ── */
#wps-app .wps-tbl-wrap { border-radius: var(--radius); border: 1px solid var(--border); }
#wps-app .wps-tbl { width: 100%; border-collapse: collapse; font-size: 12px; }

#wps-app .wps-tbl th {
    background: var(--bg);
    color: var(--text2);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    padding: 10px 11px;
    text-align: left;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

#wps-app .wps-tbl td { padding: 0; border-bottom: 1px solid var(--border); vertical-align: middle; }
#wps-app .wps-tbl tr:last-child td { border-bottom: none; }
#wps-app .wps-tbl tr:hover td { background: #fafaf8; }

#wps-app .wps-tbl td input {
    background: transparent;
    border: none;
    color: var(--text);
    font-family: 'Inter', sans-serif;
    font-size: 12px;
    padding: 13px 11px;
    width: 100%;
    outline: none;
}

#wps-app .wps-tbl td input:focus { background: #fff; outline: 2px solid var(--navy); outline-offset: -2px; }
#wps-app .wps-tbl td input.mono { font-family: 'Inter', sans-serif; font-size: 12px; }
#wps-app .wps-tbl td.acts { padding: 6px 10px; text-align: center; width: 40px; }

#wps-app .wps-tbtn {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text3);
    padding: 4px;
    border-radius: 4px;
    transition: all 0.15s;
    display: grid;
    place-items: center;
}

#wps-app .wps-tbtn:hover { color: #c0392b; background: #fff0f0; }
#wps-app .mono { font-family: 'Inter', sans-serif; }

/* ── Buttons ── */
#wps-app .btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 10px 18px;
    border-radius: var(--radius);
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.18s;
    border: none;
    text-decoration: none;
}

#wps-app .btn-navy { background: var(--navy); color: white; font-weight: 600; }
#wps-app .btn-navy:hover { background: var(--navy2); color: white; text-decoration: none; }
#wps-app .btn-ghost { background: var(--white); color: var(--text); border: 1px solid var(--border2); }
#wps-app .btn-ghost:hover { background: var(--bg); text-decoration: none; }
#wps-app .btn-outline { background: transparent; color: var(--navy); border: 1.5px solid var(--navy); }
#wps-app .btn-outline:hover { background: var(--navy); color: white; text-decoration: none; }
#wps-app .btn:disabled { opacity: 0.5; cursor: not-allowed; pointer-events: none; }

#wps-app .wps-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    background: var(--bg);
    border-top: 1px solid var(--border);
}

/* ── Toggle / EVP ── */
#wps-app .wps-toggle-row {
    display: flex;
    align-items: center;
    gap: 13px;
    padding: 14px 24px;
    border-top: 1px solid var(--border);
    background: var(--bg);
    cursor: pointer;
    transition: background 0.15s;
}

#wps-app .wps-toggle-row:hover { background: var(--bg2); }
#wps-app .wps-toggle { position: relative; width: 36px; height: 20px; flex-shrink: 0; }
#wps-app .wps-toggle input { opacity: 0; width: 0; height: 0; }
#wps-app .wps-ttrack { position: absolute; inset: 0; background: var(--border2); border-radius: 20px; transition: background 0.2s; }
#wps-app .wps-toggle input:checked + .wps-ttrack { background: var(--navy); }
#wps-app .wps-tthumb { position: absolute; width: 14px; height: 14px; background: white; border-radius: 50%; top: 3px; left: 3px; transition: left 0.2s; box-shadow: 0 1px 3px rgba(0,0,0,0.2); }
#wps-app .wps-toggle input:checked ~ .wps-tthumb { left: 19px; }
#wps-app .evp-section { display: none; }
#wps-app .evp-section.open { display: block; }

/* ── Stats ── */
#wps-app .wps-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
    margin-bottom: 24px;
}

#wps-app .wps-stat {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px 18px;
}

#wps-app .wps-stat-label {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text3);
    margin-bottom: 5px;
}

#wps-app .wps-stat-value {
    font-size: 20px;
    font-weight: 700;
    color: var(--navy);
    font-family: 'Playfair Display', serif;
}

/* ── Preview ── */
#wps-app .wps-preview {
    background: var(--navy);
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid var(--navy2);
    box-shadow: 0 4px 20px rgba(22,47,80,0.15);
}

#wps-app .wps-preview-hdr {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 18px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    background: rgba(0,0,0,0.15);
}

#wps-app .wps-preview-title { font-family: 'Courier New', monospace; font-size: 11px; color: rgba(255,255,255,0.45); letter-spacing: 0.1em; }
#wps-app .wps-preview-dots { display: flex; gap: 5px; }
#wps-app .wps-preview-dots span { width: 10px; height: 10px; border-radius: 50%; }

#wps-app .wps-preview-body {
    padding: 20px;
    font-family: 'Courier New', monospace;
    font-size: 11.5px;
    line-height: 2;
    white-space: pre;
    overflow-x: auto;
    min-height: 140px;
    color: rgba(255,255,255,0.65);
    user-select: none;
    -webkit-user-select: none;
}

#wps-app .wps-preview-body .ls { color: #fbbf24; font-weight: bold; }
#wps-app .wps-preview-body .le { color: #93c5fd; }
#wps-app .wps-preview-body .lv { color: #c4b5fd; }
#wps-app .wps-preview-empty { color: rgba(255,255,255,0.25); font-family: 'Inter', sans-serif; font-size: 12px; font-style: italic; }

/* ── Export ── */
#wps-app .wps-export-block {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-bottom: 20px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.05);
}

#wps-app .wps-summary { padding: 22px 24px; }

#wps-app .wps-summary-lbl {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text3);
    margin-bottom: 14px;
}

#wps-app .wps-srow {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    font-size: 13px;
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
}

#wps-app .wps-srow:last-child { border-bottom: none; }
#wps-app .wps-skey { color: var(--text2); }
#wps-app .wps-sval { font-family: 'Courier New', monospace; font-size: 12px; color: var(--text); font-weight: 600; }
#wps-app .wps-sval.green { color: #15803d; font-size: 14px; }

#wps-app .wps-export-cols {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    border-top: 1px solid var(--border);
}

#wps-app .wps-export-col { padding: 22px 24px; display: flex; flex-direction: column; gap: 10px; }
#wps-app .wps-export-divider { width: 1px; background: var(--border); margin: 16px 0; }

#wps-app .wps-export-col-title {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text2);
    display: flex;
    align-items: center;
    gap: 7px;
}

#wps-app .wps-export-col-desc { font-size: 12px; color: var(--text3); margin: 0; line-height: 1.4; }

#wps-app .wps-export-btn { width: 100%; justify-content: center; padding: 11px 16px; font-size: 13px; }

/* ── Mini tabs ── */
#wps-app .wps-mini-tabs { display: flex; border-bottom: 2px solid var(--border); gap: 0; }

#wps-app .wps-mini-tab {
    padding: 7px 14px;
    background: none;
    border: none;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    font-size: 11px;
    font-weight: 600;
    color: var(--text3);
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all 0.18s;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

#wps-app .wps-mini-tab.active { color: var(--navy); border-bottom-color: var(--navy); }
#wps-app .wps-mini-tab:hover:not(.active) { color: var(--text2); }
#wps-app .wps-tab-panel { display: none; padding-top: 14px; }
#wps-app .wps-tab-panel.active { display: block; }

/* ── Inline email row ── */
#wps-app .wps-inline-row { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: stretch; }

#wps-app .wps-inline-input {
    background: var(--bg);
    border: 1px solid var(--border2);
    border-radius: var(--radius);
    color: var(--text);
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    padding: 0 13px;
    height: 42px;
    outline: none;
    width: 100%;
    transition: all 0.18s;
}

#wps-app .wps-inline-input:focus { border-color: var(--navy); background: var(--white); box-shadow: 0 0 0 3px rgba(22,47,80,0.08); }
#wps-app .wps-inline-input::placeholder { color: var(--text3); }

#wps-app .wps-guide-desc { font-size: 11px; color: var(--text3); margin: 0 0 6px; line-height: 1.5; }

/* ── Download success ── */
#wps-app .wps-dl-ok { display: none; align-items: center; gap: 6px; font-size: 11px; color: #15803d; font-weight: 500; word-break: break-all; }
#wps-app .wps-dl-ok.show { display: flex; }

/* ── Email status ── */
#wps-app .wps-email-status { margin-top: 12px; font-size: 12px; padding: 10px 14px; border-radius: 6px; display: none; align-items: center; gap: 8px; }
#wps-app .wps-email-status.sending { display: flex; background: #eef6ff; color: #1a5fb4; border: 1px solid #c3daf5; }
#wps-app .wps-email-status.sent    { display: flex; background: #f0fdf4; color: #15803d; border: 1px solid #bbf7d0; }
#wps-app .wps-email-status.error   { display: flex; background: #fff0f0; color: #c0392b; border: 1px solid #fecaca; }

@keyframes wps-spin { to { transform: rotate(360deg); } }
#wps-app .wspin { animation: wps-spin 1s linear infinite; display: inline-block; width: 14px; text-align: center; }

/* ── Consent checkbox ── */
#wps-app .wps-consent-row { display: flex; align-items: flex-start; gap: 10px; margin-top: 14px; cursor: pointer; user-select: none; }
#wps-app .wps-consent-row input[type="checkbox"] { display: none; }

#wps-app .wps-consent-box {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    border: 2px solid var(--border2);
    border-radius: 4px;
    background: var(--bg);
    margin-top: 1px;
    transition: all 0.15s;
    position: relative;
}

#wps-app .wps-consent-row input:checked + .wps-consent-box { background: var(--navy); border-color: var(--navy); }
#wps-app .wps-consent-row input:checked + .wps-consent-box::after {
    content: '';
    position: absolute;
    left: 4px;
    top: 1px;
    width: 6px;
    height: 10px;
    border: 2px solid white;
    border-top: none;
    border-left: none;
    transform: rotate(45deg);
}

#wps-app .wps-consent-text { font-size: 12px; color: var(--text2); line-height: 1.5; }
#wps-app .wps-consent-text a { color: var(--navy); text-decoration: underline; }
#wps-app .wps-consent-text a:hover { color: var(--navy2); }
#wps-app .wps-consent-err { display: none; font-size: 11px; color: #c0392b; margin-top: 8px; padding: 7px 11px; background: #fff0f0; border: 1px solid #fecaca; border-radius: 6px; }
#wps-app .wps-consent-err.show { display: block; }
#wps-app .wps-empty { padding: 24px; text-align: center; color: var(--text3); font-size: 12px; }

/* ── Section fade-in ── */
@keyframes wps-fade-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}

#wps-app .wps-section.active {
    animation: wps-fade-in 0.25s ease;
}

/* ── Sidebar ── */
#wps-app .wps-sidebar { display: flex; flex-direction: column; gap: 16px; }

#wps-app .wps-info-card { background: var(--navy); color: white; border-radius: var(--radius-lg); overflow: hidden; }
#wps-app .wps-info-hdr { padding: 16px 20px; border-bottom: 1px solid rgba(255,255,255,0.08); display: flex; align-items: center; gap: 10px; }
#wps-app .wps-info-ico { width: 28px; height: 28px; background: rgba(255,255,255,0.1); border-radius: 6px; display: grid; place-items: center; flex-shrink: 0; }
#wps-app .wps-info-title { font-size: 12px; font-weight: 600; color: rgba(255,255,255,0.9); }
#wps-app .wps-info-body { padding: 16px 20px; }
#wps-app .wps-ilist { list-style: none; display: flex; flex-direction: column; gap: 10px; }
#wps-app .wps-ilist li { display: flex; align-items: flex-start; gap: 10px; font-size: 12px; color: rgba(255,255,255,0.65); line-height: 1.5; }
#wps-app .wps-ilist li::before { content: '—'; color: rgba(255,196,0,0.8); flex-shrink: 0; font-weight: 700; margin-top: 1px; }
#wps-app .wps-ilist li strong { color: rgba(255,255,255,0.9); font-weight: 600; }

#wps-app .wps-cta { background: linear-gradient(135deg, var(--navy) 0%, #2e3f6e 100%); border-radius: var(--radius-lg); padding: 20px; color: white; }
#wps-app .wps-cta strong { display: block; font-size: 14px; font-weight: 600; color: white; margin-bottom: 6px; }
#wps-app .wps-cta p { font-size: 12px; color: rgba(255,255,255,0.65); margin-bottom: 14px; line-height: 1.6; }

#wps-app .wps-cta-list { list-style: none; padding: 0; margin: 0 0 14px; display: flex; flex-direction: column; gap: 6px; }
#wps-app .wps-cta-list li { display: flex; align-items: flex-start; gap: 8px; font-size: 12px; color: rgba(255,255,255,0.75); line-height: 1.45; }
#wps-app .wps-cta-list li::before { content: '✓'; color: #86efac; flex-shrink: 0; font-size: 11px; margin-top: 2px; }

#wps-app .wps-cta-btn {
    display: block;
    text-align: center;
    background: white;
    color: var(--navy) !important;
    font-family: 'Inter', sans-serif;
    font-size: 12px;
    font-weight: 700;
    padding: 10px 16px;
    border-radius: var(--radius);
    text-decoration: none !important;
    transition: all 0.18s;
}

#wps-app .wps-cta-btn:hover { background: #EEF2F7; }

/* ── Toast ── */
#wps-toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: var(--navy, #1E293B);
    color: white;
    border-radius: 8px;
    padding: 13px 18px;
    font-size: 13px;
    font-family: 'Inter', sans-serif;
    z-index: 99999;
    display: none;
    align-items: center;
    gap: 9px;
    box-shadow: 0 8px 32px rgba(22,47,80,0.3);
    max-width: 340px;
}

#wps-toast.show { display: flex; }
#wps-toast.err  { background: #7f1d1d; }

/* ── Scrollbar ── */
#wps-app ::-webkit-scrollbar { width: 5px; height: 5px; }
#wps-app ::-webkit-scrollbar-track { background: var(--bg); }
#wps-app ::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 4px; }

/* ── Error fields ── */
#wps-app .wps-tbl td input.wps-err { background: #fff0f0 !important; outline: 2px solid #c0392b !important; outline-offset: -2px; }
#wps-app .wps-tbl td input.wps-err:focus { background: #fff0f0 !important; outline: 2px solid #c0392b !important; }

/* ── Remove footer separator on this page ── */
.site-footer { border-top: none !important; }

/* ============================================================
   RESPONSIVE
   ============================================================ */

/* Tablet ≤ 900px — stack sidebar below main content */
@media (max-width: 900px) {
    #wps-app .wps-outer {
        flex-direction: column;
        align-items: stretch;
        padding: 28px 20px 60px;
    }

    /* Watermark: larger, overlaps heading from behind */
    #wps-app .wps-hero-inner::after {
        left: 420px;
        right: auto;
        font-size: 160px;
    }

    /* Reset flex-basis (was 290px width on desktop) to avoid it becoming a fixed HEIGHT constraint */
    #wps-app .wps-sidebar {
        flex: 0 0 auto;
        width: 100%;
        flex-direction: row;
        flex-wrap: wrap;
        gap: 16px;
    }

    #wps-app .wps-sidebar > * {
        flex: 1 1 280px;
        min-width: 260px;
    }

    /* Step 2 full-width fix on tablet */
    #wps-app .wps-outer.step2-active .wps-steps {
        max-width: 100%;
    }
}

/* Tablet ≤ 768px */
@media (max-width: 768px) {
    #wps-app .wps-outer {
        padding: 24px 20px 50px;
    }

    #wps-app .wps-hero-inner {
        padding-left: 20px;
        padding-right: 20px;
    }

    /* Watermark: shrink so it doesn't overflow */
    #wps-app .wps-hero-inner::after {
        font-size: 110px;
        left: auto;
        right: -10px;
        opacity: 0.5;
    }

    #wps-app .g2,
    #wps-app .g3 { grid-template-columns: 1fr; }

    #wps-app .wps-stats { grid-template-columns: 1fr 1fr; }

    #wps-app .wps-step-btn .slabel { display: none; }

    /* Sidebar: stack cards vertically on phones and small tablets */
    #wps-app .wps-sidebar {
        flex-direction: column;
    }
    #wps-app .wps-sidebar > * {
        flex: none;
        width: 100%;
        min-width: 0;
    }

    /* Export columns stack vertically */
    #wps-app .wps-export-cols {
        grid-template-columns: 1fr;
    }
    #wps-app .wps-export-divider {
        width: 100%;
        height: 1px;
        margin: 0;
    }

    /* Email input + send button stack vertically */
    #wps-app .wps-inline-row {
        grid-template-columns: 1fr;
    }

    /* Action bar wraps on small screens */
    #wps-app .wps-actions {
        flex-wrap: wrap;
        gap: 10px;
    }

    /* Step 3 nav buttons */
    #wps-app .wps-section #wps-s3 > div[style] {
        flex-wrap: wrap;
    }

    /* Card body padding */
    #wps-app .wps-card-body { padding: 16px; }
    #wps-app .wps-card-header { padding: 14px 16px; }
    #wps-app .wps-actions { padding: 14px 16px; }
    #wps-app .wps-summary { padding: 18px 16px; }
    #wps-app .wps-export-col { padding: 18px 16px; }
}

/* Mobile ≤ 480px */
@media (max-width: 480px) {
    #wps-app .wps-outer {
        padding: 20px 16px 50px;
    }

    #wps-app .wps-hero {
        padding: 28px 0 24px;
    }

    #wps-app .wps-hero-inner {
        padding-left: 16px;
        padding-right: 16px;
    }

    /* Hide decorative watermark on mobile */
    #wps-app .wps-hero-inner::after {
        display: none;
    }

    #wps-app .wps-hero h1 { font-size: 24px; }
    #wps-app .wps-hero p  { font-size: 12px; }

    #wps-app .g2,
    #wps-app .g3 { grid-template-columns: 1fr; }

    #wps-app .wps-stats {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }

    #wps-app .wps-stat { padding: 12px 14px; }
    #wps-app .wps-stat-value { font-size: 17px; }

    #wps-app .wps-step-btn .slabel { display: none; }

    /* Employee table: make it scroll horizontally with visual hint */
    #wps-app .wps-tbl-wrap {
        -webkit-overflow-scrolling: touch;
    }

    #wps-app .wps-tbl th,
    #wps-app .wps-tbl td input { font-size: 11px; }

    #wps-app .wps-tbl th { padding: 8px 8px; }

    #wps-app .wps-card-body { padding: 14px 12px; }
    #wps-app .wps-card-header { padding: 12px 14px; }
    #wps-app .wps-actions { padding: 12px 14px; }

    #wps-app .wps-export-cols { grid-template-columns: 1fr; }
    #wps-app .wps-export-divider { width: 100%; height: 1px; margin: 0; }

    #wps-app .wps-inline-row { grid-template-columns: 1fr; }

    /* Full-width export buttons */
    #wps-app .wps-export-btn { width: 100%; }

    /* Preview body: smaller font */
    #wps-app .wps-preview-body {
        font-size: 10px;
        padding: 14px;
    }
}
