/* CS Ticketing 1.9.18 — customer and WooCommerce staff interface.
   Strictly limited to .cst-ui, including standalone [cst_new_ticket].
   Intentionally high-specificity form rules prevent common WooCommerce/Elementor/theme overrides. */
.cst-ui {
    --cst-ink: #142b48;
    --cst-muted: #59728f;
    --cst-primary: #246ef0;
    --cst-primary-strong: #1454c3;
    --cst-cyan: #11a3c8;
    --cst-violet: #7550d3;
    --cst-green: #13866a;
    --cst-line: #dbe5f1;
    --cst-field: #f9fbff;
    direction: rtl;
    text-align: right;
    color: var(--cst-ink);
    font-family: inherit;
    font-size: 14px;
    line-height: 1.85;
}
.cst-ui, .cst-ui *, .cst-ui *::before, .cst-ui *::after { box-sizing: border-box; }
.cst-ui.cst-wrap {width:100%; max-width:1180px; min-width:0;}
.cst-ticket-portal.cst-ui {width:100%;min-width:0;}
.cst-ui :is(h2,h3,h4,p) {letter-spacing:normal;}
.cst-ui :is(.cst-card,.cst-access-card,.cst-ticket-form,.cst-preflight,.cst-account-credit) {
    max-width:100%; min-width:0; color:var(--cst-ink);
}
.cst-ui .cst-card {
    border: 1px solid var(--cst-line) !important;
    border-radius: 20px !important;
    background: #fff !important;
    box-shadow: 0 10px 32px rgba(29,57,97,.068) !important;
    padding:22px !important;
    margin:16px 0 !important;
}
.cst-ui .cst-card :is(h2,h3,h4) {color:#143b69 !important;line-height:1.65;}
.cst-ui .cst-card h3 {font-size:18px !important;font-weight:800 !important;}
.cst-ui .cst-card p {color:var(--cst-muted);line-height:2;}
.cst-ui .cst-ui-icon {display:inline-block;width:20px;height:20px;flex:none;vertical-align:middle;stroke:currentColor;fill:none}

/* Structured ticket request and reply composers */
.cst-ui form.cst-form.cst-ticket-form {
    position:relative; overflow:hidden;
    padding: 0 25px 24px !important;
    border: 1px solid #d3e2f3 !important;
    border-radius: 23px !important;
    background: linear-gradient(155deg,#fff 65%,#f6f9ff 125%) !important;
    box-shadow:0 17px 42px rgba(22,59,108,.085) !important;
}
.cst-ui .cst-ticket-form::before {
    content:"";position:absolute;top:0;right:0;left:0;height:4px;
    background:linear-gradient(90deg,#9e6ae8,#4c90ff,#1db9b0);
}
.cst-ui .cst-form-head {
    display:flex;align-items:center;gap:13px;min-width:0;
    margin:0 -25px 22px;padding:20px 25px 19px;
    border-bottom:1px solid #e2eafa;
    background:linear-gradient(110deg,#f3f7ff 0%,#fff 75%);
}
.cst-ui .cst-section-icon {
    width:48px;height:48px;flex:0 0 48px;display:grid;place-items:center;
    color:#2569df;background:linear-gradient(145deg,#e5f1ff,#edebff);
    border:1px solid #d7e5ff;border-radius:15px;
    box-shadow:0 5px 13px #2a6bde13;
}
.cst-ui .cst-section-icon .cst-ui-icon {width:23px;height:23px}
.cst-ui .cst-form-head-copy {min-width:0;flex:1}
.cst-ui .cst-form-head-copy h3 {font-size:18px !important;font-weight:900 !important;margin:0 0 3px !important;color:#173c6a !important}
.cst-ui .cst-form-head-copy p {font-size:12px !important;line-height:1.8;margin:0 !important;color:#6a80a0 !important}
.cst-ui .cst-head-pill {
    padding:5px 13px;border:1px solid #cadfff;border-radius:100px;
    color:#1a66d8;font-size:11px;font-weight:800;background:#ebf4ff;
    white-space:nowrap;
}
.cst-ui .cst-form-grid {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:18px 17px;align-items:start;min-width:0}
.cst-ui .cst-form-grid .cst-field--wide {grid-column:1 / -1}
.cst-ui form.cst-form :is(.cst-field,label) {margin:0;min-width:0;}
.cst-ui form.cst-form .cst-field {display:flex;flex-direction:column;gap:7px;color:#2c4666;font-size:13px;font-weight:700}
.cst-ui form.cst-form .cst-field-label,
.cst-ui .cst-upload-zone > .cst-field-label {display:flex;align-items:center;gap:7px;color:#233f62 !important;font-size:13px !important;font-weight:800 !important;line-height:1.8}
.cst-ui .cst-field-label em {font-style:normal;color:#e45863;font-size:15px}
/* Some themes set fixed sizes, background and padding on all WooCommerce fields. */
.cst-ui form.cst-form :is(input:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]):not([type="file"]), select, textarea),
.woocommerce .woocommerce-MyAccount-content .cst-ui form.cst-form :is(input:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]):not([type="file"]), select, textarea) {
    display:block !important;width:100% !important;min-width:0 !important;max-width:100% !important;
    height:50px !important;min-height:50px !important;box-sizing:border-box !important;
    margin:0 !important;padding:12px 16px !important;
    border:1px solid #d4e1ef !important;border-radius:12px !important;
    outline:none !important;background:#f9fbff !important;color:#193754 !important;
    font:inherit !important;font-size:13px !important;font-weight:500 !important;
    line-height:1.65 !important;direction:rtl !important;text-align:right !important;
    box-shadow:inset 0 1px 3px rgba(21,64,104,.035) !important;
    transition:border-color .16s ease, box-shadow .16s ease, background .16s ease !important;
    -webkit-appearance:none;appearance:none;
}
.cst-ui form.cst-form :is(select),
.woocommerce .woocommerce-MyAccount-content .cst-ui form.cst-form select {
    padding-left:39px !important;cursor:pointer !important;
    background-image:url('data:image/svg+xml,%3Csvg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="%234c7099" stroke-width="2.4" stroke-linecap="round" stroke-linejoin="round"%3E%3Cpath d="m6 9 6 6 6-6"/%3E%3C/svg%3E') !important;
    background-repeat:no-repeat !important;background-position:16px center !important;background-size:16px 16px !important;
}
.cst-ui form.cst-form :is(textarea),
.woocommerce .woocommerce-MyAccount-content .cst-ui form.cst-form textarea {
    height:auto !important;min-height:148px !important;resize:vertical !important;
    line-height:2.05 !important;padding:15px 17px !important;
}
.cst-ui form.cst-form :is(input,select,textarea):focus,
.woocommerce .woocommerce-MyAccount-content .cst-ui form.cst-form :is(input,select,textarea):focus {
    border-color:#4388f7 !important;background:#fff !important;
    box-shadow:0 0 0 4px rgba(44,123,241,.12) !important;
}
.cst-ui form.cst-form :is(input,textarea)::placeholder {color:#93a3b8 !important;opacity:1 !important}
.cst-ui .cst-field-hint {display:block;font-size:11px !important;font-weight:500;color:#7489a3;line-height:1.9;margin:0}
.cst-ui .cst-entitlement-field[hidden] {display:none !important}

/* File selection: genuine native input, safely handled by WordPress/PHP. */
.cst-ui .cst-upload-zone {
    min-width:0;padding:15px 17px;border:1px dashed #b7cfee;
    border-radius:15px;background:linear-gradient(115deg,#f6faff,#fbfdff);
}
.cst-ui .cst-upload-zone .cst-ui-icon {width:17px;height:17px;color:#347de4}
.cst-ui form.cst-form input[type="file"].cst-file-input,
.woocommerce .woocommerce-MyAccount-content .cst-ui form.cst-form input[type="file"].cst-file-input {
    display:block !important;position:static !important;opacity:1 !important;visibility:visible !important;
    width:100% !important;max-width:100% !important;min-width:0 !important;
    margin:2px 0 !important;padding:8px !important;height:auto !important;
    background:#fff !important;color:#59728e !important;border:1px solid #dae5f2 !important;
    border-radius:11px !important;box-shadow:none !important;
    font:inherit !important;font-size:12px !important;cursor:pointer !important;
}
.cst-ui form.cst-form input[type="file"].cst-file-input::file-selector-button {
    display:inline-block;min-height:37px;margin:0 0 0 12px;padding:7px 16px;
    border:1px solid #c5d9fd !important;border-radius:9px !important;
    background:#e9f2ff !important;color:#195ac4 !important;
    font:inherit !important;font-weight:800 !important;font-size:12px !important;cursor:pointer;
}
.cst-ui .cst-file-feedback {color:#177b69;font-size:11px;line-height:2;overflow-wrap:anywhere}
.cst-ui .cst-file-feedback:empty {display:none}
.cst-ui .cst-file-feedback:not(:empty)::before {content:"✓ ";font-weight:900}
.cst-ui .cst-checkbox.cst-inline {display:inline-flex !important;align-items:center;gap:9px;padding:11px 14px;margin:14px 0 !important;
    border-radius:11px;background:#fff8e9;color:#7e5b1d;font-weight:700}
.cst-ui .cst-checkbox.cst-inline input[type="checkbox"] {display:inline-block !important;opacity:1 !important;width:17px !important;height:17px !important;margin:0 !important;accent-color:#286ee9 !important}

/* Submission controls deliberately override theme and WooCommerce .button rules. */
.cst-ui .cst-form-actions {display:flex;justify-content:space-between;align-items:center;gap:15px;flex-wrap:wrap;
    padding-top:19px;margin-top:22px;border-top:1px solid #e4edf7}
.cst-ui .cst-form-privacy {display:inline-flex;align-items:center;gap:7px;color:#617c99;font-size:11px;line-height:1.9;flex:1;min-width:170px}
.cst-ui .cst-form-privacy svg {width:17px;height:17px;color:#29917d}
.cst-ui :is(button.cst-btn,button.cst-submit-btn,a.cst-btn),
.woocommerce .woocommerce-MyAccount-content .cst-ui :is(button.cst-btn,button.cst-submit-btn,a.cst-btn),
.woocommerce .woocommerce-MyAccount-content .cst-ui button[type="submit"].cst-btn {
    display:inline-flex !important;align-items:center !important;justify-content:center !important;gap:10px !important;
    min-height:48px !important;width:auto !important;max-width:100%;
    padding:12px 24px !important;margin:0 !important;border:1px solid #276ad7 !important;
    border-radius:12px !important;background:linear-gradient(110deg,#2e85f5,#2366e7) !important;
    color:#fff !important;font:inherit !important;font-size:13px !important;font-weight:850 !important;
    line-height:1.5 !important;text-align:center !important;text-decoration:none !important;
    text-transform:none !important;letter-spacing:0 !important;
    box-shadow:0 7px 18px rgba(31,99,213,.21) !important;
    cursor:pointer !important;appearance:none !important;
    transition:box-shadow .17s ease, filter .17s ease,transform .17s ease !important;
}
.cst-ui :is(button.cst-btn,button.cst-submit-btn,a.cst-btn):hover,
.woocommerce .woocommerce-MyAccount-content .cst-ui :is(button.cst-btn,button.cst-submit-btn,a.cst-btn):hover {
    background:linear-gradient(110deg,#246ce5,#194bb8) !important;
    color:#fff !important;border-color:#2158b6 !important;
    box-shadow:0 11px 23px rgba(31,99,213,.29) !important;
    transform:translateY(-1px) !important;
}
.cst-ui :is(button.cst-btn,button.cst-submit-btn,a.cst-btn):focus-visible,
.cst-ui a:focus-visible {outline:3px solid #73b5ff !important;outline-offset:3px !important}
.cst-ui button.cst-btn:disabled {opacity:.6 !important;filter:grayscale(.2) !important;cursor:not-allowed !important;transform:none !important}
.cst-ui button.cst-btn .cst-ui-icon {width:19px;height:19px}

/* Remaining frontend surfaces (access summary, FAQ-style preflight, ticket lists, ratings). */
.cst-ui .cst-access-card {background:linear-gradient(130deg,#f5faff,#fff 70%) !important;border-color:#cfe0f6 !important}
.cst-ui .cst-access-card h3 {display:flex;align-items:center;gap:9px;margin:0 0 12px !important}
.cst-ui .cst-access-card h3 svg {color:#1d87ab;width:20px;height:20px}
.cst-ui .cst-access-card p {margin:6px 0;font-size:12px;line-height:1.95}
.cst-ui .cst-notice {border-color:#a3dccd !important;background:#effaf5 !important;color:#1f7658 !important}
.cst-ui .cst-list-heading {display:flex;align-items:center;gap:10px;margin-bottom:16px}
.cst-ui .cst-list-heading .cst-ui-icon {width:23px;height:23px;color:#3176d9}
.cst-ui .cst-list-heading h3 {margin:0 !important}
.cst-ui .cst-table-scroll,.cst-ui .cst-account-credit {max-width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch}
.cst-ui table.cst-table {width:100%;min-width:520px;overflow:hidden;border-collapse:separate;border-spacing:0;
    border:1px solid #dfe8f2 !important;border-radius:13px !important;background:#fff;color:#233e60;font-size:12px}
.cst-ui .cst-table thead th {padding:13px 14px !important;background:#193f6d !important;color:#fff !important;font-size:12px !important;font-weight:800 !important;border:0 !important;text-align:right !important;white-space:nowrap}
.cst-ui .cst-table tbody td {padding:13px 14px !important;color:#304b6a !important;border-bottom:1px solid #e5edf6 !important;text-align:right !important;line-height:1.8}
.cst-ui .cst-table tbody tr:nth-child(even) td {background:#f8fbff !important}
.cst-ui .cst-table tbody tr:hover td {background:#eef6ff !important}
.cst-ui .cst-table a {color:#216bd2 !important;text-decoration:none !important;font-weight:750}
.cst-ui .cst-table a:hover {text-decoration:underline !important}
.cst-ui .cst-ticket-summary {background:linear-gradient(115deg,#f2f7ff,#fff 83%) !important;border-right:4px solid #347ef0 !important}
.cst-ui .cst-ticket-summary h2 {margin:0 0 7px !important;font-size:20px !important;font-weight:900 !important;overflow-wrap:anywhere}
.cst-ui .cst-ticket-summary small {font-size:11px !important;color:#6086ac;font-weight:700}
.cst-ui .cst-ticket-summary p {margin:0 !important;font-size:12px !important;line-height:2.1;color:#5a7290 !important}
.cst-ui .cst-rating-box form.cst-form {display:grid;gap:15px}
.cst-ui .cst-rating-box form.cst-form label {display:flex;flex-direction:column;gap:6px;font-weight:750;color:#314d6c}
.cst-ui .cst-rating-box form.cst-form button {justify-self:start}
.cst-ui .cst-preflight {border-right:4px solid #8b69db !important}
.cst-ui .cst-preflight h3 {margin:0 0 7px !important}
.cst-ui .cst-preflight label {display:flex;flex-direction:column;gap:8px;color:#2d4561;font-size:13px;font-weight:700;margin:13px 0}
.cst-ui .cst-preflight textarea {width:100% !important;min-height:105px;padding:12px 15px;border-radius:12px !important;border:1px solid #d4e1ef !important;background:#f9fbff !important;color:#183653 !important;font:inherit !important;resize:vertical}
.cst-ui .cst-preflight textarea:focus {outline:0;border-color:#7b6cdd !important;box-shadow:0 0 0 4px rgba(123,108,221,.11) !important}
.cst-ui .cst-preflight-answer:not(:empty) {padding:13px;border:1px solid #d9d9f6;border-radius:11px;background:#f8f6ff;color:#3f4382}
.cst-ui .cst-account-credit h4 {font-size:14px !important;font-weight:850 !important;margin:20px 0 12px !important}
.cst-ui .cst-support-panel .cst-stat {background:linear-gradient(125deg,#3b6fe8,#7953cf)!important}
.cst-ui .cst-presence-card {gap:15px;flex-wrap:wrap}
.cst-ui .cst-agent-tools.cst-ticket-form {padding-top:22px !important}
.cst-ui .cst-agent-tools.cst-ticket-form > label {display:inline-flex;vertical-align:top;flex-direction:column;gap:7px;
    width:calc(33.333% - 13px);min-width:155px;margin:0 8px 18px 0 !important}
.cst-ui .cst-agent-tools.cst-ticket-form > button {display:flex !important}

@media (max-width:800px) {
    .cst-ui form.cst-form.cst-ticket-form {padding:0 16px 17px !important}
    .cst-ui .cst-form-head {margin:0 -16px 18px;padding:17px 16px}
    .cst-ui .cst-card {padding:17px !important;border-radius:16px !important}
    .cst-ui .cst-form-grid {gap:14px 12px}
}
@media (max-width:580px) {
    .cst-ui .cst-form-grid {grid-template-columns:minmax(0,1fr)}
    .cst-ui .cst-form-grid .cst-field--wide {grid-column:auto}
    .cst-ui .cst-head-pill {display:none}
    .cst-ui .cst-form-head-copy h3 {font-size:16px !important}
    .cst-ui .cst-form-head-copy p {font-size:11px !important}
    .cst-ui .cst-section-icon {width:43px;height:43px;flex-basis:43px}
    .cst-ui .cst-form-actions {align-items:stretch;gap:11px}
    .cst-ui .cst-form-privacy {order:2;flex:1 1 100%}
    .cst-ui button.cst-submit-btn,
    .woocommerce .woocommerce-MyAccount-content .cst-ui button.cst-submit-btn {width:100% !important;order:1}
    .cst-ui .cst-agent-tools.cst-ticket-form > label {width:100%;margin:0 0 12px !important}
    .cst-ui .cst-ticket-summary h2 {font-size:17px !important}
}
@media (prefers-reduced-motion:reduce) {
    .cst-ui :is(button,select,input,textarea) {transition:none !important;animation:none !important}
}
