.tc-kyc {
    --tc-ink: #1c1917;
    --tc-muted: #78716c;
    --tc-line: #e7e5e4;
    --tc-soft: #faf7f5;
    max-width: 560px;
    margin: 24px auto;
    color: var(--tc-ink);
    font-family: Vazirmatn, Tahoma, sans-serif;
}

.tc-kyc * { box-sizing: border-box; }

.tc-kyc fieldset.tc-date {
    border: 0;
    margin: 0;
    padding: 0;
    min-width: 0;
    width: 100%;
}

.tc-kyc fieldset.tc-date .tc-date-row {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: flex-end !important;
    gap: 8px !important;
    width: 100% !important;
    max-width: 100% !important;
}

.tc-kyc fieldset.tc-date .tc-date-field {
    flex: 1 1 0 !important;
    min-width: 0 !important;
    width: auto !important;
    max-width: none !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 6px !important;
    margin: 0 !important;
    padding: 0 !important;
    float: none !important;
}

.tc-kyc fieldset.tc-date .tc-date-label {
    display: block !important;
    font-size: 12px;
    line-height: 1.3;
    color: var(--tc-muted);
    margin: 0 !important;
    width: auto !important;
}

.tc-kyc fieldset.tc-date select.tc-select-native-date {
    display: block !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    height: 48px;
    margin: 0 !important;
    padding: 0 10px;
    border: 1px solid #d6d3d1;
    border-radius: 12px;
    background: #fff;
    color: var(--tc-ink);
    font: inherit;
    appearance: auto;
    -webkit-appearance: menulist;
}

.tc-kyc fieldset.tc-date select.tc-select-native-date.tc-select-native {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    margin: 0 !important;
    padding: 0 !important;
    opacity: 0 !important;
    pointer-events: none !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0);
}

.tc-kyc fieldset.tc-date .tc-date-trigger {
    width: 100% !important;
    min-width: 0 !important;
}

.tc-card {
    background: #fff;
    border: 1px solid var(--tc-line);
    border-radius: 24px;
    padding: 28px 24px;
    box-shadow: 0 20px 50px rgba(28, 25, 23, 0.06);
}

.tc-steps {
    display: flex;
    gap: 8px;
    margin-bottom: 22px;
}

.tc-steps span {
    flex: 1;
    text-align: center;
    font-size: 12px;
    color: var(--tc-muted);
    background: var(--tc-soft);
    border-radius: 999px;
    padding: 7px 8px;
}

.tc-steps .is-current,
.tc-steps .is-done {
    color: #fff;
    background: var(--tc-accent, #e11d48);
}

.tc-steps .is-done { opacity: 0.72; }
.tc-steps .is-current { opacity: 1; }

.tc-kicker {
    margin: 0 0 4px;
    color: var(--tc-muted);
    font-size: 13px;
}

.tc-head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: flex-start;
}

.tc-kyc h2 {
    margin: 0 0 8px;
    font-size: 26px;
    line-height: 1.4;
}

.tc-lead {
    color: #44403c;
    line-height: 1.9;
    margin: 0 0 18px;
}

.tc-badge {
    background: #fff1f2;
    color: var(--tc-accent, #e11d48);
    border-radius: 999px;
    padding: 6px 12px;
    font-size: 13px;
    white-space: nowrap;
}

.tc-alert {
    border-radius: 14px;
    padding: 12px 14px;
    margin-bottom: 16px;
    line-height: 1.8;
}

.tc-alert.is-error { background: #fff1f2; color: #9f1239; }
.tc-alert.is-success { background: #ecfdf3; color: #166534; }

.tc-alert-debug {
    margin-top: 10px;
    font-size: 12px;
}

.tc-alert-debug summary {
    cursor: pointer;
    font-weight: 600;
}

.tc-alert-debug pre {
    margin: 8px 0 0;
    padding: 10px;
    background: rgba(0, 0, 0, 0.06);
    border-radius: 10px;
    overflow: auto;
    white-space: pre-wrap;
    word-break: break-word;
    font-size: 11px;
    line-height: 1.6;
}

.tc-form-bio + .tc-status {
    margin-top: 28px;
    padding-top: 20px;
    border-top: 1px solid var(--tc-line);
}

.tc-status {
    display: grid;
    gap: 10px;
    margin: 0 0 18px;
}

.tc-status div {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--tc-line);
}

.tc-status dt { color: var(--tc-muted); }
.tc-status dd { margin: 0; font-weight: 650; text-align: left; }

.tc-form { display: grid; gap: 14px; }
.tc-form > label { display: grid; gap: 6px; font-size: 13px; color: #44403c; }

.tc-field-hint {
    display: block;
    min-height: 0;
    font-size: 12px;
    line-height: 1.6;
    color: var(--tc-muted);
}

.tc-field-hint.is-error,
.tc-form-client-alert {
    color: #9f1239;
}

.tc-form-client-alert {
    margin-bottom: 12px;
}

.tc-field-national.is-invalid input,
fieldset.tc-date.is-invalid .tc-date-trigger,
fieldset.tc-date.is-invalid select.tc-select-native-date {
    border-color: #e11d48 !important;
    outline: 3px solid color-mix(in srgb, #e11d48 18%, white);
}

.tc-date legend {
    font-size: 13px;
    color: #44403c;
    margin-bottom: 8px;
    padding: 0;
}

.tc-date-field { position: relative; }

.tc-form input,
.tc-form select:not(.tc-select-native-date),
.tc-select-trigger {
    width: 100%;
    height: 48px;
    border: 1px solid #d6d3d1;
    border-radius: 12px;
    padding: 0 12px;
    background: #fff;
    color: var(--tc-ink);
    font: inherit;
}

.tc-select-native {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    margin: 0 !important;
    padding: 0 !important;
    opacity: 0 !important;
    pointer-events: none !important;
    overflow: hidden !important;
}

.tc-select-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    text-align: right;
    cursor: pointer;
}

.tc-select-trigger.is-placeholder { color: #a8a29e; }

.tc-select-trigger svg {
    flex: 0 0 auto;
    color: #a8a29e;
}

.tc-select-trigger.is-open {
    border-color: var(--tc-accent, #e11d48);
    outline: 3px solid color-mix(in srgb, var(--tc-accent, #e11d48) 25%, white);
}

.tc-sheet {
    position: fixed;
    inset: 0;
    z-index: 100000;
    display: grid;
    align-items: end;
    justify-items: center;
    font-family: Vazirmatn, Tahoma, sans-serif;
}

.tc-sheet[hidden] { display: none; }

.tc-sheet-backdrop {
    position: absolute;
    inset: 0;
    border: 0;
    background: rgba(28, 25, 23, 0.46);
    cursor: pointer;
}

.tc-sheet-panel {
    position: relative;
    width: min(560px, 100%);
    max-height: min(78vh, 640px);
    display: flex;
    flex-direction: column;
    background: #fff;
    border-radius: 22px 22px 0 0;
    box-shadow: 0 -16px 50px rgba(28, 25, 23, 0.18);
    padding-bottom: env(safe-area-inset-bottom);
    animation: tc-sheet-in 0.22s ease;
}

.tc-sheet-handle {
    width: 42px;
    height: 5px;
    margin: 10px auto 0;
    border-radius: 999px;
    background: #e7e5e4;
}

.tc-sheet-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 16px 8px;
}

.tc-sheet-bar strong { font-size: 16px; }

.tc-sheet-close {
    border: 0;
    background: var(--tc-soft, #faf7f5);
    color: var(--tc-ink, #1c1917);
    border-radius: 999px;
    min-height: 36px;
    padding: 0 14px;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

.tc-sheet-list {
    overflow: auto;
    padding: 6px 12px 16px;
    -webkit-overflow-scrolling: touch;
}

.tc-sheet-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    min-height: 52px;
    margin: 0 0 6px;
    padding: 0 14px;
    border: 0;
    border-radius: 14px;
    background: transparent;
    color: var(--tc-ink, #1c1917);
    font: inherit;
    font-size: 18px;
    text-align: right;
    cursor: pointer;
}

.tc-sheet-option.is-selected {
    background: #fff1f2;
    background: color-mix(in srgb, var(--tc-accent, #e11d48) 12%, white);
    color: var(--tc-accent, #e11d48);
    font-weight: 700;
}

.tc-sheet-option:active { background: var(--tc-soft, #f5f5f4); }

@media (min-width: 821px) {
    .tc-sheet { align-items: start; justify-items: start; background: transparent; }
    .tc-sheet-backdrop { background: transparent; }
    .tc-sheet-panel {
        position: absolute;
        width: 220px;
        max-height: 320px;
        border-radius: 16px;
        border: 1px solid #e7e5e4;
        box-shadow: 0 18px 40px rgba(28, 25, 23, 0.14);
        animation: none;
    }
    .tc-sheet-handle,
    .tc-sheet-bar { display: none; }
    .tc-sheet-list { padding: 8px; }
    .tc-sheet-option { min-height: 42px; font-size: 15px; }
}

@keyframes tc-sheet-in {
    from { transform: translateY(24px); opacity: 0.6; }
    to { transform: none; opacity: 1; }
}

.tc-form input[readonly] { background: var(--tc-soft); }
.tc-form input:focus,
.tc-form select:focus:not(.tc-select-native-date),
.tc-kyc fieldset.tc-date select.tc-select-native-date:focus,
.tc-date-field .tc-select-trigger:focus {
    outline: 3px solid color-mix(in srgb, var(--tc-accent, #e11d48) 25%, white);
    border-color: var(--tc-accent, #e11d48);
}

.tc-date-field .tc-select-trigger,
.tc-date-field select {
    width: 100%;
}

.tc-button {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    min-height: 48px;
    border: 0;
    border-radius: 14px;
    background: var(--tc-accent, #e11d48);
    color: #fff !important;
    text-decoration: none;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

.tc-button-ghost {
    margin-top: 10px;
    background: transparent;
    color: var(--tc-accent, #e11d48) !important;
    border: 1px solid var(--tc-accent, #e11d48);
}

.tc-file input { height: auto; padding: 12px; }
.tc-preview {
    width: 140px;
    height: 140px;
    object-fit: cover;
    border-radius: 18px;
    border: 1px solid var(--tc-line);
}

.tc-script {
    margin: 0 0 16px;
    padding: 14px 16px;
    background: linear-gradient(135deg, #fff7f8 0%, #faf7f5 100%);
    border-right: 4px solid var(--tc-accent, #e11d48);
    border-radius: 16px;
    line-height: 2;
    font-size: 15px;
}

.tc-lead-compact {
    margin-bottom: 12px;
    font-size: 14px;
}

.tc-bio {
    margin-bottom: 12px;
}

.tc-bio-stage {
    position: relative;
    overflow: hidden;
    border-radius: 22px;
    background: #0c0a09;
    aspect-ratio: 3 / 4;
    max-height: min(62vh, 420px);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.tc-bio-script-bar {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 2;
    padding: 12px 14px 14px;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.82) 0%, rgba(0, 0, 0, 0.35) 70%, transparent 100%);
    color: #fff;
    text-align: center;
    pointer-events: none;
}

.tc-bio-script-label {
    display: block;
    font-size: 11px;
    opacity: 0.85;
    margin-bottom: 4px;
}

.tc-bio-script-text {
    margin: 0;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.85;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
}

.tc-bio-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 12px;
    padding-bottom: 4px;
}

.tc-bio-serial span {
    display: block;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 6px;
}

.tc-bio-serial input {
    width: 100%;
    min-height: 44px;
    border: 1px solid var(--tc-line);
    border-radius: 12px;
    padding: 10px 12px;
    font: inherit;
}

.tc-bio-serial small {
    display: block;
    margin-top: 6px;
    color: var(--tc-muted);
    font-size: 12px;
    line-height: 1.6;
}

@media (max-width: 640px) {
    .tc-bio-actions {
        position: sticky;
        bottom: 8px;
        z-index: 5;
        padding: 10px 0 6px;
        background: linear-gradient(180deg, transparent, #fff 28%);
    }
}

.tc-bio-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scaleX(-1);
    display: block;
}

.tc-bio-overlay {
    position: absolute;
    inset: 0;
    pointer-events: none;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tc-bio-oval {
    position: relative;
    z-index: 1;
    width: 72%;
    max-width: 300px;
    aspect-ratio: 4 / 5;
    border-radius: 50%;
    border: 3px solid #ef4444;
    box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.62);
    transition: border-color 0.12s ease, box-shadow 0.12s ease;
}

.tc-bio-stage[data-face-state="pending"] .tc-bio-oval {
    border-color: #facc15;
    box-shadow: 0 0 20px rgba(250, 204, 21, 0.55), 0 0 0 9999px rgba(0, 0, 0, 0.58);
}

.tc-bio-stage[data-face-state="bad"] .tc-bio-oval {
    border-color: #ef4444;
    box-shadow: 0 0 16px rgba(239, 68, 68, 0.4), 0 0 0 9999px rgba(0, 0, 0, 0.62);
}

.tc-bio-stage[data-face-state="ok"] .tc-bio-oval {
    border-color: #22c55e;
    box-shadow: 0 0 22px rgba(34, 197, 94, 0.5), 0 0 0 9999px rgba(0, 0, 0, 0.55);
}

.tc-bio-stage[data-face-state="done"] .tc-bio-oval {
    border-color: #38bdf8;
}

.tc-bio-status {
    position: absolute;
    left: 10px;
    right: 10px;
    bottom: 10px;
    margin: 0;
    padding: 11px 12px;
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.72);
    color: #fff;
    text-align: center;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.55;
    backdrop-filter: blur(8px);
    z-index: 2;
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.tc-bio-stage[data-tone="ok"] .tc-bio-status {
    background: rgba(22, 101, 52, 0.88);
    border-color: rgba(134, 239, 172, 0.35);
}

.tc-bio-stage[data-tone="warn"] .tc-bio-status {
    background: rgba(120, 53, 15, 0.88);
    border-color: rgba(253, 186, 116, 0.35);
}

.tc-bio-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    margin-top: 14px;
}

.tc-bio-toolbar .tc-button {
    flex: 1 1 160px;
    margin: 0;
    transition: opacity 0.2s ease, filter 0.2s ease;
}

.tc-bio-toolbar .tc-button:disabled,
.tc-bio-toolbar .tc-button.is-disabled {
    opacity: 0.35;
    cursor: not-allowed;
    filter: saturate(0.6);
    pointer-events: none;
}

.tc-bio-timer {
    font-weight: 700;
    color: var(--tc-accent, #e11d48);
    min-width: 56px;
}

.tc-bio-ready {
    margin: 0;
    color: #15803d;
    font-weight: 700;
    font-size: 14px;
    text-align: center;
}

.tc-form-bio .tc-bio-submit {
    margin-top: 0;
}

.tc-form-bio .tc-bio-submit:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

@media (max-width: 640px) {
    .tc-card { padding: 20px 16px; }
    .tc-kyc fieldset.tc-date .tc-date-row {
        gap: 6px !important;
    }
    .tc-kyc fieldset.tc-date select.tc-select-native-date {
        padding: 0 6px;
        font-size: 14px;
    }
    .tc-kyc fieldset.tc-date .tc-date-label {
        font-size: 11px;
    }
}

.tc-wheel-sheet {
    position: fixed;
    inset: 0;
    z-index: 100001;
    display: grid;
    align-items: end;
    justify-items: center;
    font-family: Vazirmatn, Tahoma, sans-serif;
}

.tc-wheel-sheet[hidden] {
    display: none !important;
}

.tc-wheel-backdrop {
    position: absolute;
    inset: 0;
    border: 0;
    background: rgba(28, 25, 23, 0.5);
    cursor: pointer;
}

.tc-wheel-panel {
    position: relative;
    width: min(560px, 100%);
    background: #fff;
    border-radius: 22px 22px 0 0;
    box-shadow: 0 -20px 60px rgba(28, 25, 23, 0.22);
    padding-bottom: env(safe-area-inset-bottom);
    animation: tc-sheet-in 0.22s ease;
}

.tc-wheel-handle {
    width: 42px;
    height: 5px;
    margin: 10px auto 0;
    border-radius: 999px;
    background: #e7e5e4;
}

.tc-wheel-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 16px 8px;
    border-bottom: 1px solid var(--tc-line, #e7e5e4);
}

.tc-wheel-title {
    font-size: 15px;
    font-weight: 700;
    text-align: center;
    flex: 1;
}

.tc-wheel-cancel,
.tc-wheel-confirm {
    border: 0;
    background: transparent;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
    min-height: 40px;
    padding: 0 4px;
}

.tc-wheel-cancel {
    color: var(--tc-muted, #78716c);
}

.tc-wheel-confirm {
    color: var(--tc-accent, #e11d48);
}

.tc-wheel-search {
    display: block;
    padding: 10px 16px 0;
}

.tc-wheel-search-input {
    width: 100%;
    height: 44px;
    border: 1px solid #d6d3d1;
    border-radius: 12px;
    padding: 0 14px;
    font: inherit;
    background: var(--tc-soft, #faf7f5);
}

.tc-wheel-search-input:focus {
    outline: 3px solid color-mix(in srgb, var(--tc-accent, #e11d48) 22%, white);
    border-color: var(--tc-accent, #e11d48);
    background: #fff;
}

.tc-wheel-frame {
    position: relative;
    height: 224px;
    margin: 8px 0 12px;
    overflow: hidden;
    isolation: isolate;
}

.tc-wheel-frame::before,
.tc-wheel-frame::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    height: 72px;
    z-index: 2;
    pointer-events: none;
}

.tc-wheel-frame::before {
    top: 0;
    background: linear-gradient(180deg, #fff 10%, rgba(255, 255, 255, 0));
}

.tc-wheel-frame::after {
    bottom: 0;
    background: linear-gradient(0deg, #fff 10%, rgba(255, 255, 255, 0));
}

.tc-wheel-highlight {
    position: absolute;
    left: 16px;
    right: 16px;
    top: 50%;
    height: 48px;
    margin-top: -24px;
    border-radius: 14px;
    border: 2px solid var(--tc-accent, #e11d48);
    background: #fff;
    box-shadow: 0 6px 24px rgba(28, 25, 23, 0.08);
    z-index: 3;
    pointer-events: none;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tc-wheel-value {
    font-size: 28px;
    font-weight: 800;
    line-height: 1;
    color: var(--tc-ink, #1c1917);
    letter-spacing: 0.02em;
}

.tc-wheel-list {
    position: relative;
    z-index: 2;
    height: 224px;
    overflow-y: auto;
    scroll-snap-type: y mandatory;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
}

.tc-wheel-item {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 44px;
    border: 0;
    background: transparent;
    font: inherit;
    font-size: 18px;
    font-weight: 600;
    color: #78716c;
    scroll-snap-align: center;
    cursor: pointer;
    transition: opacity 0.12s ease, transform 0.12s ease;
    opacity: 0.35;
}

.tc-wheel-item.is-near {
    opacity: 0.65;
    font-size: 19px;
}

.tc-wheel-item.is-active {
    opacity: 0;
    visibility: hidden;
}

.tc-wheel-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 120px;
    color: var(--tc-muted, #78716c);
    font-size: 14px;
}

.tc-kyc .screen-reader-text {
    position: absolute !important;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}
