:root {
    --portal-bg: #f4f6fb;
    --portal-card: #ffffff;
    --portal-ink: #0f172a;
    --portal-muted: #64748b;
    --portal-line: #e7eaf2;
    --portal-gold: #b45309;
    --portal-gold-2: #9a3412;
    --portal-amber: #f59e0b;
    --portal-soft: #fff7ed;
    --portal-blue: #eef3ff;
    --portal-radius: 22px;
}
body.portal, body.auth-portal {
    margin: 0;
    min-height: 100vh;
    background: var(--portal-bg);
    color: var(--portal-ink);
    font-family: Vazirmatn, Tahoma, sans-serif !important;
    direction: rtl;
}
body.auth-portal,
body.auth-portal *,
body.auth-portal *::before,
body.auth-portal *::after {
    box-sizing: border-box;
}
body.auth-portal button,
body.auth-portal input,
body.auth-portal select,
body.auth-portal textarea,
body.auth-portal a {
    font-family: Vazirmatn, Tahoma, sans-serif;
}
.portal-app { display: flex; min-height: 100vh; }
.portal-side {
    width: 280px;
    flex: 0 0 280px;
    background: #fff;
    border-left: 1px solid var(--portal-line);
    padding: 22px 16px;
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
}
.portal-brand { display: flex; gap: 10px; align-items: center; margin-bottom: 22px; }
.portal-brand strong { display: block; font-size: 15px; }
.portal-brand small { color: var(--portal-muted); }
.portal-mark {
    width: 42px; height: 42px; border-radius: 14px;
    background: linear-gradient(180deg, #f59e0b, #b45309);
    color: #fff; display: grid; place-items: center; font-size: 22px;
}
.portal-user {
    background: #f8fafc; border-radius: 16px; padding: 12px;
    display: flex; gap: 10px; align-items: center; margin-bottom: 14px;
}
.portal-user strong { display: block; font-size: 14px; }
.portal-user small { color: var(--portal-muted); }
.portal-nav a, .portal-nav button {
    display: flex; align-items: center; gap: 8px;
    width: 100%; border: 0; background: transparent;
    color: #334155; text-decoration: none; border-radius: 12px;
    padding: 11px 12px; margin-bottom: 4px; font-weight: 600; cursor: pointer; text-align: right;
}
.portal-nav a.active, .portal-nav a:hover { background: #eef2ff; color: #1e293b; }
.portal-nav .logout { color: #b91c1c; margin-top: auto; }
.portal-main { flex: 1; min-width: 0; }
.portal-top {
    display: flex; align-items: center; gap: 12px;
    padding: 16px 22px; background: rgba(255,255,255,.8);
    border-bottom: 1px solid var(--portal-line); position: sticky; top: 0; z-index: 5;
}
.portal-top .spacer { margin-right: auto; }
.portal-content { padding: 22px; }
body.portal a:hover,
body.portal a:focus {
    color: inherit;
    text-decoration: none;
}
.portal-btn, .auth-submit {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    background: linear-gradient(180deg, #c2410c, #9a3412);
    color: #fff !important; border: 0; border-radius: 14px;
    padding: 12px 18px; font-family: Vazirmatn, Tahoma, sans-serif; font-size: 15px; font-weight: 700;
    text-decoration: none !important; cursor: pointer;
}
.portal-btn:hover, .portal-btn:focus, .auth-submit:hover, .auth-submit:focus {
    background: #9a3412;
    color: #fff !important;
}
.portal-btn--ghost {
    background: #fff; color: var(--portal-ink) !important;
    border: 1px solid var(--portal-line);
}
.portal-btn--ghost:hover, .portal-btn--ghost:focus {
    background: #0f172a;
    color: #fff !important;
    border-color: #0f172a;
}
.portal-card {
    background: var(--portal-card); border: 1px solid var(--portal-line);
    border-radius: var(--portal-radius); padding: 18px; box-shadow: 0 10px 30px rgba(15,23,42,.04);
    margin-bottom: 16px;
}
.portal-hello { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.portal-stats, .portal-grid { display: grid; gap: 14px; }
.portal-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 16px 0; }
.portal-stat, .service-card {
    background: #fff; border: 1px solid var(--portal-line); border-radius: 18px; padding: 16px;
    text-decoration: none; color: inherit;
}
.portal-stat span { display: block; font-size: 28px; font-weight: 800; color: #0f766e; }
.portal-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.service-card h3 { margin: 8px 0 6px; font-size: 18px; }
.service-card p { color: var(--portal-muted); margin: 0 0 10px; min-height: 42px; }
.service-card .tag { display: inline-block; background: #eef2ff; color: #3730a3; border-radius: 999px; padding: 2px 8px; font-size: 12px; }
.portal-content .table { background: #fff; }
.portal-content .file-type-label {
    display: inline-block; background: #fff7ed; color: #9a3412 !important;
    border: 1px solid #fdba74; border-radius: 999px; padding: 3px 10px; font-size: 12px; font-weight: 700;
}
.portal-burger { display: none; border: 1px solid var(--portal-line); background: #fff; border-radius: 12px; padding: 8px 12px; }
.auth-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 28px 16px; }
.auth-split { width: min(1080px, 100%); display: grid; grid-template-columns: 1.15fr .85fr; background: #fff; border-radius: 28px; overflow: hidden; box-shadow: 0 20px 50px rgba(15,23,42,.08); }
.auth-form { padding: 40px 40px 40px 56px; }
.auth-aside { padding: 40px 36px; background: linear-gradient(180deg, #fffaf3, #f8fafc); }
.auth-card { width: min(480px, 100%); background: #fff; border-radius: 28px; padding: 36px 40px; box-shadow: 0 20px 50px rgba(15,23,42,.08); }
.auth-note {
    display: flex; align-items: flex-start; gap: 10px;
    border-radius: 16px; padding: 14px 16px; margin: 0 0 16px;
    border: 1px solid transparent; line-height: 1.7; text-align: right;
}
.auth-note i { font-size: 22px; line-height: 1.4; flex: 0 0 auto; }
.auth-note strong { display: block; font-size: 15px; }
.auth-form .auth-note p, .auth-card .auth-note p { margin: 4px 0 0; color: inherit; font-size: 13px; font-weight: 600; }
.auth-note--ok { background: #ecfdf5; color: #065f46; border-color: #a7f3d0; }
.auth-note--bad { background: #fef2f2; color: #991b1b; border-color: #fecaca; }
.auth-field small { display: block; margin-top: 6px; color: #b91c1c; font-weight: 700; }
.auth-form h1, .auth-card h1 { font-size: 28px; margin: 8px 0; }
.auth-form p, .auth-card p, .auth-aside p { color: var(--portal-muted); }
.auth-form a, .auth-card a,
.auth-form a:hover, .auth-card a:hover,
.auth-form a:focus, .auth-card a:focus {
    font-family: Vazirmatn, Tahoma, sans-serif; font-size: 15px; font-weight: 700;
    color: var(--portal-gold); text-decoration: none;
}
.auth-field { margin-bottom: 14px; max-width: 100%; }
.auth-field label { display: block; font-weight: 700; margin-bottom: 6px; }
.auth-field input {
    width: 100%; max-width: 100%; height: 52px; border: 1px solid #e5e7eb; border-radius: 14px;
    padding: 12px 14px; background: #f8fafc; font-family: Vazirmatn, Tahoma, sans-serif; font-size: 15px;
}
.portal-content .form-control, .portal-content select, .portal-content textarea {
    width: 100%; border: 1px solid #e5e7eb; border-radius: 14px; padding: 12px 14px; background: #fff;
}
.auth-field input:-webkit-autofill,
.auth-field input:-webkit-autofill:hover,
.auth-field input:-webkit-autofill:focus,
.captcha-row input:-webkit-autofill {
    -webkit-text-fill-color: var(--portal-ink);
    box-shadow: 0 0 0 1000px #f8fafc inset;
    font-family: Vazirmatn, Tahoma, sans-serif;
}
.auth-submit { width: 100%; margin-top: 8px; min-height: 52px; }
.auth-links { display: flex; justify-content: space-between; gap: 12px; margin-top: 16px; }
.auth-links a, .auth-links a:hover, .auth-links a:focus { color: var(--portal-gold); text-decoration: none; font-family: Vazirmatn, Tahoma, sans-serif; font-size: 15px; font-weight: 700; }
.auth-back {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    margin-top: 18px; min-height: 48px; padding: 12px 18px; border-radius: 14px;
    background: #fff; color: #0f172a; border: 1px solid var(--portal-line);
    font-weight: 800; text-decoration: none; box-shadow: 0 8px 20px rgba(15,23,42,.05);
}
.auth-back:hover, .auth-back:focus {
    background: #0f172a; color: #fff; border-color: #0f172a; text-decoration: none;
}
.feature-pill { background: #fff; border: 1px solid var(--portal-line); border-radius: 16px; padding: 12px; margin-bottom: 10px; }
.captcha-row { display: flex; gap: 10px; align-items: center; margin: 8px 0 16px; max-width: 100%; }
.captcha-row input {
    flex: 1; min-width: 0; height: 52px; border: 1px solid #e5e7eb; border-radius: 14px;
    padding: 12px 14px; background: #f8fafc; font-family: Vazirmatn, Tahoma, sans-serif;
    font-size: 15px; direction: ltr; text-align: center;
}
.captcha-row img {
    height: 52px; width: 148px; flex: 0 0 148px; object-fit: contain;
    border: 1px solid #e5e7eb; border-radius: 14px; background: #fff7ed; cursor: pointer;
}
.country-picker { position: relative; margin-bottom: 14px; }
.country-picker__btn, .country-picker__search { width: 100%; border: 1px solid #e5e7eb; border-radius: 14px; padding: 10px 12px; background: #fff; text-align: right; }
.country-picker__btn { display: flex; gap: 8px; align-items: center; cursor: pointer; }
.country-picker__menu { position: absolute; z-index: 20; right: 0; left: 0; background: #fff; border: 1px solid var(--portal-line); border-radius: 14px; margin-top: 6px; padding: 8px; box-shadow: 0 12px 30px rgba(15,23,42,.08); }
.country-picker__list { max-height: 220px; overflow: auto; }
.country-picker__item { width: 100%; border: 0; background: transparent; display: flex; gap: 8px; align-items: center; padding: 8px; border-radius: 10px; }
.country-picker__item:hover { background: #fff7ed; }
.phone-row { display: flex; gap: 8px; align-items: center; }
.phone-row .dial { background: #fff7ed; border-radius: 12px; padding: 12px; min-width: 72px; text-align: center; font-weight: 800; direction: ltr; }
.ticket-page { display: flex; flex-direction: column; gap: 16px; }
.ticket-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.ticket-head h1 { margin: 0; font-size: 26px; }
.ticket-head__title { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ticket-head p { margin: 8px 0 0; color: var(--portal-muted); }
.ticket-head code { font-family: inherit; color: var(--portal-ink); font-weight: 800; }
.ticket-back { color: var(--portal-gold-2); font-weight: 800; text-decoration: none; white-space: nowrap; padding: 8px 4px; }
.ticket-layout { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(260px, .8fr); gap: 16px; align-items: start; }
.ticket-section-head, .ticket-card-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding-bottom: 12px; margin-bottom: 16px; border-bottom: 1px solid var(--portal-line); }
.ticket-section-head h2, .ticket-card-head h2, .ticket-card-head h3 { margin: 0; font-size: 18px; }
.ticket-section-head span, .ticket-note { color: var(--portal-muted); font-size: 13px; }
.ticket-thread { display: flex; flex-direction: column; gap: 12px; }
.ticket-bubble { border-radius: 16px; padding: 16px 18px; border: 1px solid transparent; }
.ticket-bubble header { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 8px; font-weight: 800; }
.ticket-bubble time { font-size: 12px; font-weight: 600; }
.ticket-bubble p { margin: 0; white-space: pre-wrap; line-height: 1.9; }
.ticket-bubble.user { background: #fffbeb; border-color: #fde68a; color: #451a03; }
.ticket-bubble.user header, .ticket-bubble.user time { color: #92400e; }
.ticket-bubble.staff { background: #f8fafc; border-color: #e2e8f0; color: #0f172a; }
.ticket-bubble.staff header { color: #1e293b; }
.ticket-bubble.staff time { color: #64748b; font-weight: 600; }
.ticket-role { font-size: 11px; font-weight: 700; background: #e0e7ff; color: #312e81; border-radius: 999px; padding: 2px 8px; }
.ticket-status { display: inline-flex; align-items: center; border-radius: 999px; padding: 4px 10px; font-size: 12px; font-weight: 800; }
.ticket-status--open { background: #fff7ed; color: #9a3412; border: 1px solid #fdba74; }
.ticket-status--answered { background: #ecfdf5; color: #065f46; border: 1px solid #a7f3d0; }
.ticket-status--closed { background: #f1f5f9; color: #475569; border: 1px solid #e2e8f0; }
.ticket-files { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 8px; margin-top: 12px; }
.ticket-file { display: flex; align-items: center; gap: 10px; background: #fff; border: 1px solid #e7eaf2; border-radius: 12px; padding: 10px 12px; text-decoration: none; color: inherit; min-width: 0; }
.ticket-file i { font-size: 26px; color: #c2410c; }
.ticket-file.pdf i { color: #b91c1c; }
.ticket-file.doc i { color: #1d4ed8; }
.ticket-file.zip i { color: #0f766e; }
.ticket-file strong, .ticket-pick strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; direction: ltr; text-align: right; }
.ticket-file small, .ticket-pick small { color: var(--portal-muted); }
.ticket-meta { display: flex; flex-direction: column; gap: 10px; margin: 0; }
.ticket-meta div { display: flex; justify-content: space-between; gap: 12px; padding-bottom: 8px; border-bottom: 1px solid #f1f5f9; }
.ticket-meta dt { color: var(--portal-muted); }
.ticket-meta dd { margin: 0; font-weight: 700; }
.ticket-side-link { display: flex; justify-content: center; margin-top: 14px; text-decoration: none; }
.ticket-reply textarea { min-height: 140px; margin-top: 6px; }
.ticket-drop { margin-top: 8px; border: 2px dashed #d6dbe8; border-radius: 16px; background: #f8fafc; padding: 22px 16px; text-align: center; cursor: pointer; }
.ticket-drop:hover, .ticket-drop.over { border-color: #d97706; background: #fffaf3; }
.ticket-drop input { display: none; }
.ticket-drop i { width: 48px; height: 48px; border-radius: 50%; display: inline-grid; place-items: center; background: #fff; border: 1px solid var(--portal-line); color: #c2410c; font-size: 24px; }
.ticket-drop strong { display: block; margin-top: 8px; }
.ticket-drop span { color: var(--portal-muted); font-size: 13px; }
.ticket-picks { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 8px; margin-top: 12px; }
.ticket-pick { display: flex; align-items: center; gap: 10px; border: 1px solid var(--portal-line); border-radius: 12px; padding: 10px; background: #fff; }
.ticket-pick button { margin-right: auto; border: 0; background: transparent; color: #b91c1c; cursor: pointer; font-size: 18px; }
.ticket-actions { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--portal-line); }
.ticket-list { display: flex; flex-direction: column; gap: 10px; }
.ticket-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px; border: 1px solid var(--portal-line); border-radius: 16px; text-decoration: none; color: inherit; background: #fff; }
.ticket-row:hover { border-color: #fdba74; }
.ticket-row small { display: block; color: var(--portal-muted); margin-top: 4px; }
.program-picker { max-width: 760px; margin: 0 auto; padding: 28px; }
.program-picker h2 { margin: 0 0 8px; font-size: 24px; }
.program-picker p { color: var(--portal-muted); margin: 0 0 16px; }
.program-picker label { display: block; font-weight: 700; margin-bottom: 8px; }
.portal-content .select2-container { width: 100% !important; z-index: 20; }
.portal-content .select2-container--default .select2-selection--single {
    height: 52px; border: 1px solid #e5e7eb; border-radius: 14px; background: #fff;
}
.portal-content .select2-container--default .select2-selection--single .select2-selection__rendered {
    line-height: 50px; padding-right: 14px; color: var(--portal-ink);
}
.portal-content .select2-container--default .select2-selection--single .select2-selection__arrow { height: 50px; }
.select2-dropdown { z-index: 10050; border-radius: 12px; }
.select2-search__field { font-family: Vazirmatn, Tahoma, sans-serif; }
.files-page { display: flex; flex-direction: column; gap: 18px; }
.files-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; }
.files-head h1 { margin: 4px 0 6px; font-size: 28px; }
.files-head p { margin: 0; color: var(--portal-muted); max-width: 640px; }
.files-crumb { color: var(--portal-muted); font-size: 12px; font-weight: 700; }
.files-crumb a { color: inherit; text-decoration: none; }
.files-metrics { display: flex; gap: 10px; flex-shrink: 0; }
.files-metric { display: flex; align-items: center; gap: 10px; background: #fff; border: 1px solid var(--portal-line); border-radius: 16px; padding: 12px 14px; min-width: 180px; }
.files-metric i { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: #fff7ed; color: #c2410c; font-size: 20px; }
.files-metric strong { display: block; font-size: 16px; }
.files-metric span { color: var(--portal-muted); font-size: 12px; }
.files-filters { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 2px; }
.files-filters button { border: 1px solid var(--portal-line); background: #fff; color: #475569; border-radius: 12px; padding: 8px 14px; font-family: Vazirmatn, Tahoma, sans-serif; font-weight: 700; white-space: nowrap; cursor: pointer; }
.files-filters button.is-on { background: #0f172a; color: #fff; border-color: #0f172a; }
.files-filters em { font-style: normal; background: #f1f5f9; color: #0f172a; border-radius: 8px; padding: 0 6px; margin-right: 4px; }
.files-filters button.is-on em { background: rgba(255,255,255,.16); color: #fff; }
.files-split { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.files-trio { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.files-card { background: #fff; border: 1px solid var(--portal-line); border-radius: 18px; padding: 18px; box-shadow: 0 8px 24px rgba(15,23,42,.04); }
.files-card-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding-bottom: 12px; margin-bottom: 14px; border-bottom: 1px solid #f1f5f9; }
.files-card-head h2, .files-card-head h3 { margin: 0; font-size: 18px; }
.files-card-head p { margin: 2px 0 0; color: var(--portal-muted); font-size: 12px; }
.files-card-title { display: flex; align-items: center; gap: 10px; }
.files-ico { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: #f8fafc; color: #c2410c; font-size: 20px; flex: 0 0 40px; }
.files-pill { border-radius: 999px; padding: 4px 10px; font-size: 12px; font-weight: 800; background: #f1f5f9; color: #475569; white-space: nowrap; }
.files-pill.ok { background: #ecfdf5; color: #047857; border: 1px solid #a7f3d0; }
.files-empty { text-align: center; padding: 18px 8px 8px; color: var(--portal-muted); }
.files-empty p { margin: 6px auto; max-width: 320px; }
.files-link { display: inline-flex; align-items: center; gap: 6px; margin-top: 8px; padding: 8px 12px; border-radius: 12px; border: 1px solid var(--portal-line); background: #f8fafc; color: #9a3412; text-decoration: none; font-weight: 700; }
body.portal .files-link:hover, body.portal .files-link:focus { color: #9a3412; background: #fff7ed; border-color: #fdba74; }
.draft-item, .buy-item { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px; border: 1px solid #f1f5f9; border-radius: 14px; margin-bottom: 8px; background: #f8fafc; }
.draft-item strong, .buy-item strong { display: block; }
.draft-item small, .buy-item small { color: var(--portal-muted); }
.draft-actions, .files-downloads { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
body.portal .draft-actions a,
body.portal .draft-actions button,
body.portal .files-downloads a,
body.portal .buy-item > a,
body.portal .act-rebuild {
    display: inline-flex; align-items: center; justify-content: center; border-radius: 10px; padding: 7px 12px;
    font-size: 12px; font-weight: 800; line-height: 1.4; text-decoration: none; border: 0; cursor: pointer;
    font-family: Vazirmatn, Tahoma, sans-serif; white-space: nowrap;
}
body.portal .act-edit,
body.portal .act-edit:hover,
body.portal .act-edit:focus { background: #fff7ed; color: #9a3412; }
body.portal .act-edit:hover { background: #ffedd5; }
body.portal .act-pay,
body.portal .act-pay:hover,
body.portal .act-pay:focus { background: #047857; color: #fff; }
body.portal .act-pay:hover { background: #065f46; }
body.portal .act-rebuild,
body.portal .act-rebuild:hover,
body.portal .act-rebuild:focus {
    background: linear-gradient(180deg, #c2410c, #9a3412); color: #fff; margin-top: 6px;
}
body.portal .act-rebuild:hover { background: #9a3412; }
body.portal .act-del,
body.portal .act-del:hover,
body.portal .act-del:focus { background: #fff; color: #b91c1c; border: 1px solid #fecaca; }
body.portal .act-del:hover { background: #fef2f2; }
body.portal .act-dl,
body.portal .act-dl:hover,
body.portal .act-dl:focus { background: #0f172a; color: #fff; border: 0; margin: 0; box-shadow: none; }
body.portal .act-dl:hover { background: #1e293b; }
.account-grid { display: grid; grid-template-columns: 1.2fr .8fr; gap: 16px; align-items: start; }
.account-facts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.account-fact {
    display: flex; align-items: center; gap: 12px; padding: 14px;
    border: 1px solid #f1f5f9; border-radius: 16px; background: #f8fafc; min-width: 0;
}
.account-fact .files-ico { background: #fff; }
.account-fact > div > span { display: block; color: var(--portal-muted); font-size: 12px; font-weight: 700; }
.account-fact strong { display: block; margin-top: 2px; font-size: 15px; word-break: break-word; }
.account-note {
    margin: 14px 0 0; padding: 12px 14px; border-radius: 14px;
    background: #fff7ed; color: #9a3412; font-size: 13px; font-weight: 700;
}
.account-page .portal-btn { width: 100%; margin-top: 4px; }
.files-table-wrap { overflow-x: auto; }
.files-table { width: 100%; border-collapse: collapse; min-width: 920px; }
.files-table th { text-align: right; background: #f8fafc; color: #64748b; font-size: 13px; padding: 12px; border-bottom: 1px solid var(--portal-line); white-space: nowrap; }
.files-table td { padding: 14px 12px; border-bottom: 1px solid #f1f5f9; vertical-align: middle; }
.files-table tr:hover td { background: #fffaf3; }
.files-id { font-weight: 800; }
.files-track { direction: ltr; text-align: right; color: #64748b; }
.files-ok { color: #047857; font-weight: 800; }
.files-bad { color: #b91c1c; font-weight: 800; }
.files-note { display: flex; justify-content: space-between; gap: 12px; padding: 12px 16px; background: #f8fafc; color: #64748b; font-size: 13px; border-top: 1px solid var(--portal-line); }
.files-card .files-table-wrap { margin: 0 -18px; }
.files-card .files-note { margin: 0 -18px -18px; }
.files-card .files-table th:first-child, .files-card .files-table td:first-child { padding-right: 18px; }
.guide-tools { display: flex; flex-direction: column; gap: 12px; margin-top: 18px; }
.guide-search {
    width: 100%; border: 1px solid var(--portal-line); background: #fff; border-radius: 14px;
    padding: 12px 14px; font-family: Vazirmatn, Tahoma, sans-serif; font-size: 15px; color: #0f172a;
}
.guide-search:focus { outline: 2px solid #fdba74; border-color: #fdba74; }
.guide-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-top: 16px; }
.guide-card {
    display: flex; flex-direction: column; width: 100%; margin: 0; padding: 0; text-align: right;
    background: #fff; border: 1px solid var(--portal-line); border-radius: 18px; overflow: hidden;
    cursor: pointer; font: inherit; color: #0f172a; box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
}
body.portal .guide-card:hover, body.portal .guide-card:focus {
    color: #0f172a; text-decoration: none; border-color: #fdba74;
    box-shadow: 0 12px 28px rgba(15, 23, 42, .08);
}
.guide-thumb { position: relative; display: block; aspect-ratio: 16/9; background: #e2e8f0; }
.guide-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.guide-play {
    position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
    width: 54px; height: 54px; border-radius: 50%; background: rgba(15, 23, 42, .82); color: #fff;
    display: flex; align-items: center; justify-content: center; font-size: 26px;
}
.guide-body { display: flex; flex-direction: column; gap: 6px; padding: 14px 14px 16px; }
.guide-cat { align-self: flex-start; background: #fff7ed; color: #9a3412; border-radius: 999px; padding: 3px 10px; font-size: 12px; font-weight: 800; }
.guide-body strong { font-size: 16px; line-height: 1.6; }
.guide-text { color: #64748b; font-size: 13px; line-height: 1.7; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.guide-empty { margin: 16px 0 0; color: #64748b; }
.guide-modal {
    position: fixed; inset: 0; z-index: 80; background: rgba(15, 23, 42, .72);
    display: flex; align-items: center; justify-content: center; padding: 20px;
}
.guide-modal[hidden] { display: none; }
.guide-dialog {
    width: min(920px, 100%); background: #fff; border-radius: 20px; padding: 18px;
    position: relative; max-height: calc(100vh - 40px); overflow: auto;
}
.guide-close {
    position: absolute; top: 10px; left: 10px; z-index: 2; width: 40px; height: 40px; border: 0; border-radius: 12px;
    background: #0f172a; color: #fff; font-size: 20px; cursor: pointer;
}
body.portal .guide-close:hover, body.portal .guide-close:focus { background: #1e293b; color: #fff; }
.guide-stage { width: 100%; min-height: 180px; background: #0f172a; border-radius: 14px; overflow: hidden; }
.guide-stage iframe { width: 100%; aspect-ratio: 16/9; height: auto; min-height: 220px; border: 0; display: block; }
.guide-dialog h2 { margin: 14px 0 6px; font-size: 20px; }
.guide-dialog p { margin: 0; color: #64748b; }
@media (max-width: 1100px) {
    .guide-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 700px) {
    .guide-grid { grid-template-columns: 1fr; }
}
@media (max-width: 991px) {
    .portal-side { position: fixed; z-index: 30; transform: translateX(110%); transition: .2s ease; }
    .portal-side.open { transform: none; }
    .portal-burger { display: inline-flex; }
    .portal-stats, .portal-grid, .auth-split, .ticket-layout, .files-split, .files-trio, .account-grid, .account-facts { grid-template-columns: 1fr; }
    .files-head, .draft-item, .buy-item { flex-direction: column; align-items: stretch; }
    .ticket-head, .ticket-actions, .ticket-row { flex-direction: column; align-items: stretch; }
    .portal-top { flex-wrap: wrap; }
}
