/* =========================================================
   RazyNo — Unified UI/UX refinement
   Loaded after site.css and icons.css. Keeps the existing
   cosmic palette, SVG icon sprite and Bootstrap icon classes.
   ========================================================= */

:root {
    --rz-surface: rgba(17, 13, 34, .82);
    --rz-surface-raised: rgba(27, 20, 49, .94);
    --rz-surface-soft: rgba(255,255,255,.045);
    --rz-line: rgba(192,132,252,.20);
    --rz-line-strong: rgba(192,132,252,.38);
    --rz-focus: 0 0 0 .22rem rgba(192,132,252,.23);
    --rz-radius-lg: 24px;
    --rz-radius-md: 17px;
    --rz-radius-sm: 12px;
    --rz-ease: cubic-bezier(.2,.8,.2,1);
}

/* Base and typography */
html { scroll-padding-top: 6rem; }
body { text-rendering: optimizeLegibility; }
main, .main-content { min-width: 0; }
main.main-content { padding-bottom: clamp(2rem,5vw,4rem); }
h1,h2,h3,h4,h5,h6 { letter-spacing: -.025em; }
p { overflow-wrap: break-word; }
a, button, input, select, textarea { -webkit-tap-highlight-color: transparent; }
a:focus-visible, button:focus-visible, input:focus-visible,
select:focus-visible, textarea:focus-visible, [tabindex]:focus-visible {
    outline: 2px solid var(--gold);
    outline-offset: 3px;
}
::selection { background: rgba(192,132,252,.34); color: #fff; }

/* Keep the site's own SVG sprite icons crisp and consistent */
svg.icon, .icon-wrap .icon, .fi-icon .icon, .saved-type-icon .icon,
.fortune-request-icon .icon, .ticket-list-icon .icon {
    display: inline-block;
    width: 1.35em;
    height: 1.35em;
    flex: 0 0 auto;
    vertical-align: middle;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.6;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.icon-wrap .icon { width: 2.25rem; height: 2.25rem; }
.fal-card .icon-wrap { color: var(--gold); }
.fal-card:hover .icon-wrap { color: #fff; }
.fi-icon .icon { color: var(--gold); }
button .icon, a .icon { margin-inline-end: .25rem; }

/* Navigation */
.glass-nav {
    min-height: 70px;
    padding-block: .65rem;
    border-bottom-color: rgba(192,132,252,.18);
}
.glass-nav .navbar-brand { gap: .65rem; }
.glass-nav .navbar-toggler {
    border: 1px solid var(--rz-line);
    border-radius: 12px;
    padding: .45rem .65rem;
    box-shadow: none;
}
.glass-nav .navbar-toggler:focus { box-shadow: var(--rz-focus); }
.glass-nav .navbar-collapse {
    border-radius: 0 0 18px 18px;
}
.glass-nav .nav-link {
    display: inline-flex;
    align-items: center;
    min-height: 42px;
}
.glass-nav .nav-link.active { color: #fff !important; }
.dropdown-menu {
    background: #17122b;
    border: 1px solid var(--rz-line);
    border-radius: 14px;
    box-shadow: 0 18px 44px rgba(0,0,0,.35);
    padding: .45rem;
}
.dropdown-item {
    color: var(--text-muted);
    border-radius: 9px;
    padding: .6rem .8rem;
}
.dropdown-item:hover,.dropdown-item:focus {
    color: #fff;
    background: rgba(192,132,252,.14);
}

/* Consistent surfaces and hover behavior */
.glass-card {
    border-color: var(--rz-line);
    box-shadow: 0 14px 38px rgba(0,0,0,.24);
}
.glass-card:hover {
    border-color: var(--rz-line-strong);
    box-shadow: 0 18px 44px rgba(0,0,0,.30), 0 0 30px rgba(192,132,252,.10);
}
.stat-card, .pricing-card, .result-card { overflow: hidden; }
.stat-card { border-radius: var(--rz-radius-md); }
.stat-card .num { line-height: 1.35; }
.section-title { max-width: 760px; margin-inline: auto; }
.section-title h2 { line-height: 1.45; }
.section-title p { line-height: 1.9; }

/* Buttons */
.btn {
    min-height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .4rem;
    font-weight: 650;
    transition: transform .22s var(--rz-ease), box-shadow .22s ease,
                border-color .22s ease, background .22s ease;
}
.btn:active { transform: translateY(1px) scale(.99); }
.btn:disabled,.btn.disabled { opacity: .58; transform: none; box-shadow: none; }
.btn-primary { border: 0; }
.btn-outline-light { border-color: rgba(216,196,255,.32); }
.btn-sm { min-height: 34px; padding: .42rem .8rem; border-radius: 10px; }
.btn-lg { min-height: 52px; }
.btn-link { color: var(--accent-bright); }

/* Form controls */
.form-control,.form-select {
    min-height: 48px;
    border-color: rgba(192,132,252,.24);
    background-color: rgba(255,255,255,.045);
}
textarea.form-control { min-height: 130px; }
.form-control:hover,.form-select:hover { border-color: rgba(192,132,252,.42); }
.form-control:focus,.form-select:focus {
    border-color: var(--accent);
    box-shadow: var(--rz-focus);
}
.form-check { display: flex; align-items: flex-start; gap: .55rem; }
.form-check-input { flex: 0 0 auto; margin-top: .35rem; }
.form-check-label { line-height: 1.85; }
.input-group .form-control { min-width: 0; }
.validation-summary-errors,.field-validation-error { font-size: .82rem; }
.text-danger { color: #ff9baf !important; }

/* Tables and lists */
.table-responsive { border-radius: var(--rz-radius-md); }
.table { color: var(--text); margin-bottom: 0; }
.table thead th {
    color: #eadcff;
    background: rgba(192,132,252,.10);
    border-bottom-color: var(--rz-line-strong);
    white-space: nowrap;
    font-weight: 700;
}
.table td,.table th { vertical-align: middle; border-color: rgba(192,132,252,.12); }
.table-hover tbody tr:hover { color: #fff; background: rgba(192,132,252,.07); }
.list-group { gap: .65rem; }
.list-group-item {
    border: 1px solid var(--rz-line) !important;
    border-radius: var(--rz-radius-md) !important;
    padding: 1rem 1.15rem;
    transition: border-color .2s ease, background .2s ease, transform .2s ease;
}
.list-group-item-action:hover {
    background: rgba(192,132,252,.08);
    border-color: var(--rz-line-strong) !important;
    transform: translateY(-2px);
}

/* Homepage and fortune catalogue */
.hero { padding-top: clamp(1.5rem,4vw,3.5rem); }
.hero h1 { max-width: 900px; margin-inline: auto; }
.hero p { max-width: 620px; }
.hero-visual { max-width: 100%; }
.fal-card {
    border-radius: var(--rz-radius-lg);
    min-height: 250px;
    padding: clamp(1.25rem,2.5vw,2rem) 1.2rem;
}
.fal-card p { max-width: 28ch; }
.fal-card .icon-wrap {
    flex: 0 0 auto;
    width: 76px;
    height: 76px;
}
.feature-item { border-radius: var(--rz-radius-md); }
.feature-item:hover { transform: translateY(-3px); }
.feature-item .fi-icon { border: 1px solid rgba(192,132,252,.15); }
.mystic-banner { isolation: isolate; }
.mystic-banner--notice { max-width: 960px; }

/* Fortune request and image upload */
.fortune-request-shell { width: min(100% - 1.5rem, 980px); }
.fortune-request-heading { text-align: center; }
.fortune-request-card { background: var(--rz-surface); box-shadow: var(--shadow); }
.image-dropzone {
    outline: none;
    min-height: clamp(210px,30vw,300px);
}
.image-dropzone:focus-visible { box-shadow: var(--rz-focus); }
.upload-placeholder strong { font-size: 1rem; }
.upload-select-link { transition: background .2s ease, transform .2s ease; }
.upload-select-link:hover { transform: translateY(-1px); background: rgba(167,139,250,.24); }
.upload-preview img { box-shadow: 0 12px 30px rgba(0,0,0,.25); }
.upload-file-meta { overflow-wrap: anywhere; }
.fortune-submit-btn { width: 100%; }
.image-upload-tips { line-height: 1.9; }
.privacy-note { align-items: flex-start; }

/* Result */
.result-card { width: min(100%, 820px); border-radius: 28px; }
.result-card .result-text {
    font-size: clamp(.98rem,1.6vw,1.08rem);
    line-height: 2.15;
    overflow-wrap: anywhere;
}
.result-card .result-icon { line-height: 1.2; }
.fal-section-title { line-height: 1.8; }
.hafez-poem { overflow-wrap: anywhere; }

/* Saved readings */
.saved-page,.tickets-page,.ticket-detail-page,.ticket-form-page { width: min(100% - 1.5rem, 980px); }
.saved-reading-link { background: linear-gradient(155deg,rgba(255,255,255,.055),rgba(255,255,255,.025)); }
.saved-reading-link:focus-visible,.ticket-list-card:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
.saved-type-icon { color: var(--gold); }
.saved-toolbar .form-control { min-height: 46px; }

/* Support tickets */
.ticket-list-card { border-radius: 18px; }
.ticket-list-card h2,.ticket-list-card h3 { margin-bottom: .25rem; }
.ticket-detail-header,.ticket-form-card,.ticket-reply-card { background: var(--rz-surface); border: 1px solid var(--rz-line); }
.conversation-bubble { line-height: 1.9; }
.conversation-bubble p { white-space: pre-wrap; }
.ticket-reply-card { box-shadow: 0 12px 34px rgba(0,0,0,.18); }

/* Account, profile, subscriptions */
.account-page,.profile-page { width: min(100% - 1.5rem, 920px); margin-inline: auto; }
.profile-page .glass-card { border-radius: var(--rz-radius-lg); }
.progress { overflow: hidden; border-radius: 999px; }
.progress-bar { border-radius: inherit; }
.pricing-card { border-radius: var(--rz-radius-lg); }
.pricing-card.featured { border-width: 1.5px; }
.pricing-features { line-height: 1.9; }
.pricing-features li { border-bottom: 1px solid rgba(255,255,255,.045); }
.pricing-features li:last-child { border-bottom: 0; }

/* Authentication pages */
.auth-card {
    width: min(100%, 560px);
    margin-inline: auto;
}
.auth-card .glass-card { border-radius: 26px; }
.auth-card .form-control { min-height: 50px; }

/* Legal, FAQ and content pages */
.legal-page,.content-page,.faq-page { width: min(100% - 1.5rem, 900px); margin-inline: auto; }
.legal-page .glass-card,.content-page .glass-card { padding: clamp(1.2rem,3vw,2.4rem); }
.accordion-item {
    overflow: hidden;
    border: 1px solid var(--rz-line) !important;
    border-radius: 14px !important;
    background: rgba(255,255,255,.035);
    margin-bottom: .7rem;
}
.accordion-button {
    background: rgba(255,255,255,.035);
    color: var(--text);
    font-weight: 650;
    box-shadow: none !important;
}
.accordion-body { color: var(--text-muted); line-height: 1.95; }

/* Admin area */
.admin-sidebar {
    background: rgba(10,8,22,.97);
    border-left-color: var(--rz-line);
    box-shadow: -12px 0 36px rgba(0,0,0,.18);
}
.admin-sidebar a { display: flex; align-items: center; gap: .65rem; min-height: 42px; }
.admin-sidebar a.active { border: 1px solid var(--rz-line); }
.admin-content { min-width: 0; }
.admin-content .glass-card { border-radius: var(--rz-radius-md); }
.admin-content .table-responsive { overflow-x: auto; }

/* Alerts, badges and empty states */
.alert { border-radius: 14px; }
.badge { letter-spacing: 0; }
.empty-state,.saved-empty,.ticket-empty {
    background: rgba(255,255,255,.025);
    border-color: var(--rz-line);
}
.empty-orbit { border: 1px solid var(--rz-line); }

/* Footer */
.glass-footer { margin-top: 3rem; }
.glass-footer a { color: var(--text-muted); transition: color .2s ease; }
.glass-footer a:hover { color: var(--gold); }

/* Responsive refinements */
@media (max-width: 991.98px) {
    .glass-nav .navbar-collapse {
        margin-top: .6rem;
        padding: .6rem;
        background: rgba(9,7,19,.97);
        border: 1px solid var(--rz-line);
        border-radius: 16px;
    }
    .glass-nav .nav-link { width: 100%; padding-inline: .8rem !important; }
    .admin-sidebar { position: relative; width: 100%; min-height: auto; }
    .admin-content { margin-right: 0; padding: 1rem; }
}
@media (max-width: 767.98px) {
    .main-content { padding-top: 82px; }
    .hero { padding-inline: .6rem; }
    .hero h1 { font-size: clamp(1.7rem,7vw,2.25rem); }
    .hero p { font-size: .98rem; }
    .hero-cta { gap: .6rem; }
    .hero-cta .btn { width: min(100%, 320px); }
    .fal-card { min-height: 205px; }
    .glass-card:hover,.fal-card:hover { transform: none; }
    .pricing-card { padding: 1.6rem 1.2rem; }
    .result-card { padding: 1.15rem; border-radius: 20px; }
    .result-card .result-text { padding-right: .85rem; }
    .ticket-list-card { align-items: start; }
    .admin-content { padding: .8rem; }
    .table { font-size: .82rem; }
}
@media (max-width: 480px) {
    .saved-grid { grid-template-columns: 1fr; }
    .fal-card { min-height: 185px; padding: 1.1rem .7rem; }
    .fal-card .icon-wrap { width: 58px; height: 58px; font-size: 1.7rem; }
    .fortune-request-shell,.saved-page,.tickets-page,.ticket-detail-page,.ticket-form-page,
    .legal-page,.content-page,.faq-page { width: min(100% - 1rem, 980px); }
    .glass-card { border-radius: 17px; }
    .btn-lg { width: 100%; }
    .upload-file-meta { font-size: .76rem; }
    .conversation-message { gap: .45rem; }
    .conversation-avatar { flex-basis: 32px; height: 32px; border-radius: 10px; }
    .conversation-bubble { max-width: calc(100% - 38px); padding: .75rem; }
}
@media (prefers-reduced-motion: reduce) {
    *,*::before,*::after {
        scroll-behavior: auto !important;
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
    }
}


/* ===== RazyNo cohesive layout pass ===== */
:root {
    --rz-page-width: 1180px;
}
body { overflow-x: clip; }
.container { width: min(100% - 2rem, var(--rz-page-width)); }
.main-content > .container { padding-top: 1.5rem !important; }
.glass-card:not(.fal-card):hover { transform: translateY(-2px); }
.glass-card.result-card:hover,
.glass-card.fortune-request-card:hover,
.glass-card.ticket-form-card:hover,
.glass-card.ticket-reply-card:hover { transform: none; }
.glass-nav { z-index: 1030; }
.glass-nav .navbar-brand { flex-shrink: 0; }
.glass-nav .navbar-collapse { min-width: 0; }
.glass-nav .navbar-nav { gap: .15rem; }
.glass-nav .nav-link::after { pointer-events: none; }
.glass-nav .navbar-toggler-icon { width: 1.25rem; height: 1.25rem; }
.glass-nav .btn-link.nav-link { border: 0; background: transparent; }
.glass-footer { position: relative; z-index: 1; border-top: 1px solid var(--rz-line); }
.glass-footer .row { align-items: center; }
.enamad-logo { display: block; width: 82px; height: auto; max-width: 100%; }
.brand-logo { width: 42px; height: 42px; object-fit: contain; }
.footer-logo { width: 38px; height: 38px; object-fit: contain; }
#particles-canvas, .float-symbols, .orb { pointer-events: none; }
.page-enter { animation: rzPageEnter .45s ease both; }
@keyframes rzPageEnter { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* Request form */
.fortune-request-shell { width: min(100%, 820px); margin-inline: auto; }
.fortune-request-heading { padding: 1rem .5rem 1.5rem; }
.fortune-request-heading h1 { font-weight: 800; }
.fortune-request-icon { display: grid; place-items: center; width: 76px; height: 76px; margin: 0 auto 1rem; border-radius: 23px; color: var(--gold); background: linear-gradient(145deg,rgba(167,139,250,.2),rgba(251,191,36,.08)); border: 1px solid var(--rz-line-strong); box-shadow: 0 14px 35px rgba(0,0,0,.22); }
.fortune-request-icon .icon { width: 2.4rem; height: 2.4rem; }
.fortune-request-card { width: 100%; max-width: none; padding: clamp(1.1rem,3.8vw,2.4rem); border-radius: 25px; }
.fortune-request-card .form-label { margin-bottom: .6rem; font-weight: 650; }
.fortune-request-card .form-control,
.fortune-request-card .form-select { border-radius: 13px; }
.fortune-request-card textarea { resize: vertical; }
.fortune-eyebrow,.page-kicker { color: var(--gold); letter-spacing: .04em; }
.back-to-fortunes,.ticket-back-link { margin: 0 0 1rem; }
.image-upload-block { min-width: 0; }
.image-dropzone { min-height: clamp(230px,32vw,340px); border: 1.5px dashed rgba(192,132,252,.5); border-radius: 22px; background: radial-gradient(circle at 50% 0,rgba(192,132,252,.11),transparent 62%),rgba(255,255,255,.018); }
.image-dropzone[aria-invalid="true"] { border-color: #ff819b; }
.upload-placeholder { width: 100%; padding: 1rem .5rem; }
.upload-icon-wrap { display: grid; place-items: center; width: 68px; height: 68px; margin-bottom: .45rem; border: 1px solid var(--rz-line); border-radius: 21px; color: var(--gold); background: rgba(192,132,252,.12); }
.upload-icon-wrap .icon { width: 2.35rem; height: 2.35rem; }
.upload-select-link { color: #fff; background: linear-gradient(135deg,#8055c7,#a85cc7); border: 1px solid rgba(255,255,255,.14); }
.upload-preview { max-height: 420px; }
.upload-preview img { width: auto; max-width: 100%; max-height: min(52vh,390px); border: 1px solid rgba(255,255,255,.1); background: rgba(0,0,0,.18); }
.upload-file-meta { border: 1px solid rgba(192,132,252,.13); }
.upload-file-info { display: flex; flex-direction: column; min-width: 0; gap: .15rem; }
.upload-file-info strong { max-width: 100%; overflow-wrap: anywhere; }
.upload-rules { justify-content: center; gap: .5rem 1.1rem; }
.upload-rules span { display: inline-flex; align-items: center; gap: .35rem; }
.upload-rules span::before { content: "✓"; color: #79d9ad; font-weight: 800; }
.image-upload-tips { background: rgba(251,191,36,.045); border-color: rgba(251,191,36,.13); }
.image-upload-tips ul { padding-right: 1.15rem; line-height: 2; }
.privacy-note { padding: .75rem .9rem; border: 1px solid rgba(100,210,160,.13); border-radius: 13px; background: rgba(70,180,130,.055); }
.form-section-divider { margin: 1.7rem 0; }
.personalized-note { border: 1px solid var(--rz-line); line-height: 1.9; }
.fortune-submit-btn { background: linear-gradient(115deg,#8255ca,#a94fc0); border: 0; }
.fortune-submit-btn:hover { filter: brightness(1.08); }
#loadingOverlay { z-index: 2000; }
#loadingOverlay .loading-panel { padding: 1.6rem 2rem; border: 1px solid var(--rz-line); border-radius: 20px; background: rgba(14,10,28,.94); box-shadow: 0 20px 60px rgba(0,0,0,.4); }

/* Result reading */
.result-card { margin-inline: auto; padding: clamp(1.2rem,4vw,2.5rem); }
.result-card .result-text { max-width: 72ch; margin-inline: auto; }
.result-card .result-text p { margin-bottom: 1.15rem; }
.result-card .result-text h2,.result-card .result-text h3 { margin: 1.5rem 0 .7rem; color: #f1d7ff; }
.result-card .result-text ul,.result-card .result-text ol { padding-right: 1.35rem; line-height: 2.1; }
.result-card .result-text blockquote { margin: 1rem 0; padding: .9rem 1rem; border-right: 3px solid var(--gold); border-radius: 12px; background: rgba(251,191,36,.06); }
.result-card .d-flex .btn { min-width: 130px; }

/* Saved readings */
.saved-page,.tickets-page { width: min(100%, 1000px); }
.saved-page-header,.tickets-page-header { padding: .4rem 0 1.2rem; border-bottom: 1px solid rgba(192,132,252,.12); }
.saved-grid { grid-template-columns: repeat(3,minmax(0,1fr)); }
.saved-reading-link { min-height: 230px; gap: .4rem; }
.saved-reading-link .icon { width: 1.7rem; height: 1.7rem; }
.saved-reading-card[hidden] { display: none !important; }
.saved-search-wrap { display: block; }
.saved-count { white-space: nowrap; }
.saved-empty,.ticket-empty { background: linear-gradient(145deg,rgba(25,18,46,.85),rgba(12,10,25,.8)); }
.ticket-list-summary { display: flex; gap: .6rem; flex-wrap: wrap; }
.ticket-open-summary { margin-right: auto; color: #79d9ad; }
.ticket-list-card { grid-template-columns: minmax(0,1fr) auto 18px; }
.ticket-list-card h2 { line-height: 1.65; }
.ticket-list-card:hover { transform: translateY(-2px); }
.ticket-detail-page { width: min(100%,900px); }
.ticket-detail-header { margin-top: 0; }
.ticket-conversation { padding: 1.4rem 0; }
.conversation-message.user-message { flex-direction: row; }
.conversation-message.support-message { flex-direction: row-reverse; }
.support-message .conversation-bubble { border-radius: 17px 5px 17px 17px; }
.user-message .conversation-bubble { border-radius: 5px 17px 17px 17px; }
.conversation-bubble { overflow-wrap: anywhere; }
.ticket-form-page { width: min(100%,760px); }
.ticket-form-card { padding: clamp(1.2rem,4vw,2.3rem); }
.ticket-form-heading { padding-bottom: 1.1rem; border-bottom: 1px solid rgba(192,132,252,.13); }

/* Admin layout */
.admin-layout { min-height: 100vh; }
.admin-sidebar { position: fixed; inset: 0 0 0 auto; z-index: 1020; display: flex; flex-direction: column; width: 252px; min-height: 100vh; padding: 1.3rem 1rem; background: rgba(9,7,20,.97); border-left: 1px solid var(--rz-line); }
.admin-brand { display: flex; align-items: center; gap: .75rem; padding: .4rem .55rem 1.4rem; margin-bottom: 1rem; color: var(--text); text-decoration: none; border-bottom: 1px solid rgba(255,255,255,.08); }
.admin-brand img { width: 46px; height: 46px; object-fit: contain; }
.admin-brand span { display: flex; flex-direction: column; line-height: 1.5; }
.admin-brand small { color: var(--text-muted); font-size: .72rem; }
.admin-nav { display: grid; gap: .35rem; }
.admin-nav a,.admin-sidebar-footer a { display: flex; align-items: center; gap: .7rem; min-height: 46px; padding: .65rem .8rem; border: 1px solid transparent; border-radius: 12px; color: var(--text-muted); text-decoration: none; transition: .2s ease; }
.admin-nav a span,.admin-sidebar-footer a span { display: grid; place-items: center; width: 25px; color: var(--gold); }
.admin-nav a:hover,.admin-nav a.active,.admin-sidebar-footer a:hover { color: #fff; background: rgba(192,132,252,.12); border-color: var(--rz-line); }
.admin-sidebar-footer { margin-top: auto; padding-top: 1rem; border-top: 1px solid rgba(255,255,255,.08); }
.admin-content { min-height: 100vh; margin-right: 252px; padding: 1.5rem clamp(1rem,3vw,2.5rem); }
.admin-topbar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .5rem 0 1.25rem; margin-bottom: 1.4rem; border-bottom: 1px solid rgba(192,132,252,.14); }
.admin-page-content { min-width: 0; }
.admin-page-content .glass-card { padding: clamp(1rem,2.5vw,1.6rem); }
.admin-page-content .table-responsive { max-width: 100%; }
.admin-page-content .btn { white-space: nowrap; }

/* Shared responsive and motion */
@media (max-width: 991.98px) {
    .admin-sidebar { position: relative; inset: auto; width: 100%; min-height: 0; padding: .8rem 1rem; }
    .admin-brand { padding-bottom: .7rem; margin-bottom: .65rem; }
    .admin-nav { display: flex; flex-wrap: wrap; gap: .35rem; }
    .admin-nav a { flex: 1 1 150px; min-height: 40px; }
    .admin-sidebar-footer { margin-top: .6rem; padding-top: .5rem; }
    .admin-content { margin-right: 0; padding: 1rem; }
}
@media (max-width: 767.98px) {
    .container { width: min(100% - 1.1rem, var(--rz-page-width)); }
    .main-content { padding-top: 82px; }
    .hero-visual { width: min(76vw,300px); height: min(76vw,300px); }
    .saved-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
    .ticket-list-card { grid-template-columns: minmax(0,1fr) auto; }
    .ticket-list-arrow { display: none; }
    .admin-topbar { align-items: flex-start; flex-direction: column; }
}
@media (max-width: 480px) {
    .saved-grid { grid-template-columns: 1fr; }
    .saved-reading-link { min-height: 185px; }
    .saved-toolbar { gap: .65rem; }
    .saved-count { align-self: flex-end; }
    .ticket-list-card { grid-template-columns: minmax(0,1fr); }
    .ticket-list-side { align-items: flex-start; flex-direction: row; flex-wrap: wrap; }
    .image-dropzone { min-height: 215px; padding: .8rem; }
    .upload-file-meta { align-items: flex-start; flex-direction: column; }
    .upload-file-meta .btn { width: 100%; }
    .fortune-request-card { padding: 1rem; }
    .result-card .d-flex .btn { flex: 1 1 100%; }
    .admin-nav a { flex-basis: calc(50% - .35rem); }
}
@media (prefers-reduced-motion: reduce) {
    .page-enter { animation: none; }
    .glass-card,.btn,.ticket-list-card,.saved-reading-link { transition: none !important; }
}

/* Catalogue and result detail components */
.fal-catalogue-page { max-width: 1120px; margin-inline: auto; }
.catalogue-heading { max-width: 760px; margin: .5rem auto 2rem; }
.catalogue-heading h1 { font-size: clamp(1.65rem,4vw,2.35rem); font-weight: 800; line-height: 1.65; }
.catalogue-heading p { line-height: 2; }
.fal-catalogue-grid .fal-card { min-height: 250px; }
.fal-card-action { display: inline-flex; align-items: center; gap: .4rem; color: var(--gold); font-size: .82rem; font-weight: 700; }
.catalogue-footnote { display: flex; align-items: center; gap: .9rem; padding: 1rem 1.2rem; margin-top: 1.8rem; }
.catalogue-footnote-icon { display: grid; place-items: center; flex: 0 0 42px; height: 42px; border-radius: 13px; color: var(--gold); background: rgba(251,191,36,.1); }
.catalogue-footnote p { flex: 1; color: var(--text-muted); font-size: .83rem; }
.result-back-link { display: inline-flex; color: var(--text-muted); text-decoration: none; font-size: .82rem; margin-bottom: 1.2rem; }
.result-back-link:hover { color: var(--gold); }
.result-heading { max-width: 720px; margin-inline: auto; }
.result-icon-wrap { display: grid; place-items: center; width: 72px; height: 72px; margin: 0 auto 1rem; border-radius: 22px; color: var(--gold); background: rgba(192,132,252,.13); border: 1px solid var(--rz-line); }
.result-icon-wrap .icon { width: 2.3rem; height: 2.3rem; }
.result-context-badges { display: flex; justify-content: center; flex-wrap: wrap; gap: .5rem; }
.result-context-badge { max-width: 100%; padding: .42rem .7rem; border: 1px solid var(--rz-line); border-radius: 999px; background: rgba(255,255,255,.035); color: var(--text-muted); font-size: .76rem; overflow-wrap: anywhere; }
.result-actions { display: flex; justify-content: center; align-items: center; flex-wrap: wrap; gap: .65rem; }
.result-actions form { display: contents; }
.result-actions .btn { min-height: 44px; }
.result-text { overflow-wrap: anywhere; }
@media (max-width: 575.98px) {
    .catalogue-footnote { align-items: flex-start; flex-wrap: wrap; }
    .catalogue-footnote p { flex-basis: calc(100% - 60px); }
    .catalogue-footnote .btn { width: 100%; }
    .fal-catalogue-grid .fal-card { min-height: 205px; }
}


/* =========================================================
   Mobile home stability + category visibility (combined fix)
   ========================================================= */
@media (max-width: 768px), (pointer: coarse) {
    body.home-mobile-stable {
        overflow-x: hidden;
        overscroll-behavior-x: none;
    }

    body.home-mobile-stable .stars-bg,
    body.home-mobile-stable .stars-bg::before,
    body.home-mobile-stable .orb,
    body.home-mobile-stable .float-deco,
    body.home-mobile-stable #particles-canvas,
    body.home-mobile-stable .float-symbols {
        display: none !important;
        animation: none !important;
    }

    body.home-mobile-stable .page-enter,
    body.home-mobile-stable .hero,
    body.home-mobile-stable .hero *,
    body.home-mobile-stable .reveal,
    body.home-mobile-stable .glass-card,
    body.home-mobile-stable .fal-card,
    body.home-mobile-stable .feature-item,
    body.home-mobile-stable .stat-mini,
    body.home-mobile-stable .quote-card,
    body.home-mobile-stable .step-item,
    body.home-mobile-stable .mystic-banner {
        animation: none !important;
        transition: none !important;
    }

    body.home-mobile-stable .reveal,
    body.home-mobile-stable .reveal.visible,
    body.home-mobile-stable .hero-visual,
    body.home-mobile-stable .hero-logo-wrap,
    body.home-mobile-stable .hero-ring,
    body.home-mobile-stable .hero-ring-2,
    body.home-mobile-stable .hero h1,
    body.home-mobile-stable .hero-badge,
    body.home-mobile-stable .hero p,
    body.home-mobile-stable .hero-cta,
    body.home-mobile-stable .fal-card,
    body.home-mobile-stable .glass-card,
    body.home-mobile-stable .feature-item {
        opacity: 1 !important;
        visibility: visible !important;
        transform: none !important;
    }

    body.home-mobile-stable .hero-visual {
        will-change: auto !important;
    }

    .home-fal-types-grid {
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: .85rem !important;
        margin-inline: 0 !important;
    }

    .home-fal-types-grid > [class*="col-"] {
        width: auto !important;
        max-width: none !important;
        min-width: 0;
        padding: 0 !important;
    }

    .home-fal-types-grid .fal-card {
        display: flex;
        width: 100%;
        height: 100%;
        min-width: 0;
        min-height: 185px;
        padding: 1rem .65rem;
    }

    .home-fal-types-grid .fal-card h3 {
        font-size: .98rem;
        line-height: 1.6;
    }

    .home-fal-types-grid .fal-card p {
        font-size: .76rem;
        line-height: 1.7;
        overflow-wrap: anywhere;
    }
}

@media (max-width: 380px) {
    .home-fal-types-grid { gap: .65rem !important; }
    .home-fal-types-grid .fal-card { min-height: 175px; padding: .85rem .5rem; }
}


/* Profile: image-fortune quota card (scoped; does not alter the dashboard grid) */
.profile-image-quota {
    background: rgba(255,255,255,.035);
    border: 1px solid var(--rz-line);
    border-radius: var(--rz-radius-md);
    color: #eee7fb;
}
.profile-image-quota .text-muted { color: #bdb3d0 !important; }
.profile-image-quota strong { color: var(--gold); }
.profile-image-quota .btn { white-space: nowrap; }

.image-dropzone.is-processing {
  opacity: .6;
  pointer-events: none;
}

/* ---------- Camera modal: mobile full-screen ---------- */
.camera-controls-spacer { width: 48px; height: 48px; }

.camera-error-icon {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: rgba(251, 191, 36, .1);
  color: #fbbf24;
}
.camera-error-action { margin-top: .25rem; min-height: 44px; padding-inline: 1.25rem; }

/* در حالت خطا فقط پیام و دکمه بازگشت دیده شود؛ دکمه‌های غیرفعال گیج‌کننده‌اند */
.camera-modal.is-error .camera-controls,
.camera-modal.is-error .camera-hint { display: none; }

@media (max-width: 767.98px) {
  .camera-modal { align-items: stretch !important; }

  .camera-modal-backdrop {
    background: #05050e;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }

  /* پنل تمام‌صفحه مثل اپ دوربین */
  .camera-modal-panel {
    max-width: none !important;
    width: 100% !important;
    height: 100% !important;
    max-height: none !important;
    border: none !important;
    border-radius: 0 !important;
    background: #07060f;
    box-shadow: none;
  }

  /* سرتیتر روی تصویر شناور است تا بیشترین فضا به پیش‌نمایش برسد */
  .camera-modal-header {
    position: absolute;
    top: 0;
    inset-inline: 0;
    z-index: 3;
    border-bottom: none;
    padding: calc(.75rem + env(safe-area-inset-top, 0px)) 1rem .75rem;
    background: linear-gradient(to bottom, rgba(5, 5, 14, .85), rgba(5, 5, 14, 0));
  }
  .camera-modal-close {
    background: rgba(5, 5, 14, .55);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
  }

  .camera-viewport {
    flex: 1 1 auto;
    min-height: 0;
    max-height: none;
  }
  .camera-guide-frame { inset: 16% 8% 14%; }

  .camera-controls {
    padding: 1rem 1.5rem .35rem;
    background: #07060f;
  }
  .camera-btn-capture { width: 76px; height: 76px; }
  .camera-btn-capture:active .camera-capture-inner { transform: scale(.92); }
  .camera-capture-inner { transition: transform .12s ease; }

  .camera-hint {
    background: #07060f;
    /* env() روی صفحه‌هایی که viewport-fit=cover ندارند صفر است؛ پس حداقل فاصله ثابت داریم */
    padding-bottom: max(calc(.9rem + env(safe-area-inset-bottom, 0px)), 1.5rem);
  }
}
