/* =====================================================================
   ResumePort — design system for the main site (landing, auth, dashboard).
   Built on Bootstrap 5.3: we re-skin it through its CSS variables, then add our own components.
   Portfolio themes have their own stylesheets under css/themes.
   ===================================================================== */
:root {
    --pm-primary: #4f46e5; --pm-primary-hover: #4338ca; --pm-primary-soft: #eef2ff; --pm-primary-rgb: 79, 70, 229;
    --pm-violet: #8b5cf6; --pm-fuchsia: #d946ef;
    --pm-gradient: linear-gradient(135deg, #2336ec 0%, #7a2df0 52%, #f025c4 100%); /* matches the logo */
    --pm-ink: #0f172a; --pm-ink-2: #334155; --pm-muted: #64748b; --pm-line: #e6e8f0; --pm-surface: #ffffff; --pm-bg: #f7f8fc;
    --pm-radius: 14px; --pm-radius-lg: 20px;
    --pm-shadow-sm: 0 1px 2px rgba(15, 23, 42, .05);
    --pm-shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 10px 30px -14px rgba(15, 23, 42, .16);
    --pm-shadow-lg: 0 2px 4px rgba(15, 23, 42, .04), 0 30px 60px -24px rgba(30, 27, 75, .28);
    --pm-ease: cubic-bezier(.2, .8, .2, 1);

    /* Bootstrap re-skin */
    --bs-body-font-family: Inter, "Segoe UI", system-ui, -apple-system, sans-serif;
    --bs-body-color: var(--pm-ink); --bs-body-bg: var(--pm-bg); --bs-secondary-color: var(--pm-muted);
    --bs-border-color: var(--pm-line); --bs-tertiary-bg: #f1f3f9;
    --bs-primary: #4f46e5; --bs-primary-rgb: 79, 70, 229;
    --bs-link-color: #4f46e5; --bs-link-color-rgb: 79, 70, 229; --bs-link-hover-color: #3730a3; --bs-link-hover-color-rgb: 55, 48, 163;
    --bs-border-radius: 10px; --bs-border-radius-sm: 8px; --bs-border-radius-lg: 14px;
    --bs-focus-ring-color: rgba(99, 102, 241, .3);
}
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { background: var(--pm-bg); font-feature-settings: "cv11", "ss01"; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
h1, h2, h3, .h1, .h2, .h3, .h4 { letter-spacing: -.02em; font-weight: 700; color: var(--pm-ink); }
::selection { background: #c7d2fe; }
a { text-underline-offset: 3px; }
.text-gradient { background: var(--pm-gradient); -webkit-background-clip: text; background-clip: text; color: transparent; }
.skip-link { position: absolute; left: 12px; top: -60px; z-index: 2000; padding: 10px 14px; border-radius: 10px; background: var(--pm-ink); color: #fff; }
.skip-link:focus { top: 12px; }

/* Buttons */
.btn { --bs-btn-font-weight: 600; --bs-btn-padding-x: 1rem; --bs-btn-padding-y: .55rem; --bs-btn-border-radius: 10px; letter-spacing: -.005em;
    transition: transform .2s var(--pm-ease), box-shadow .2s, background-color .2s, border-color .2s, color .2s; }
.btn:active { transform: translateY(1px); }
.btn-lg { --bs-btn-padding-x: 1.4rem; --bs-btn-padding-y: .8rem; --bs-btn-font-size: 1.02rem; --bs-btn-border-radius: 12px; }
.btn-sm { --bs-btn-padding-x: .75rem; --bs-btn-padding-y: .38rem; --bs-btn-border-radius: 8px; }
.btn-primary { --bs-btn-bg: var(--pm-primary); --bs-btn-border-color: var(--pm-primary); --bs-btn-hover-bg: var(--pm-primary-hover); --bs-btn-hover-border-color: var(--pm-primary-hover);
    --bs-btn-active-bg: #3730a3; --bs-btn-active-border-color: #3730a3; --bs-btn-disabled-bg: #a5b4fc; --bs-btn-disabled-border-color: #a5b4fc;
    box-shadow: 0 1px 2px rgba(15,23,42,.1), 0 6px 16px -6px rgba(var(--pm-primary-rgb), .55), inset 0 1px 0 rgba(255,255,255,.15); }
.btn-primary:hover { box-shadow: 0 1px 2px rgba(15,23,42,.1), 0 10px 24px -8px rgba(var(--pm-primary-rgb), .6), inset 0 1px 0 rgba(255,255,255,.15); }
.btn-gradient { color: #fff; border: 0; background: var(--pm-gradient); background-size: 160% 100%; box-shadow: 0 10px 26px -10px rgba(139, 92, 246, .75); }
.btn-gradient:hover, .btn-gradient:focus { color: #fff; background-position: 100% 0; box-shadow: 0 14px 30px -10px rgba(139, 92, 246, .85); }
.btn-outline-secondary, .btn-light { --bs-btn-color: var(--pm-ink); --bs-btn-bg: #fff; --bs-btn-border-color: var(--pm-line); --bs-btn-hover-color: var(--pm-ink);
    --bs-btn-hover-bg: #f6f7fb; --bs-btn-hover-border-color: #d5d9e6; --bs-btn-active-bg: #eef0f6; --bs-btn-active-border-color: #cfd4e2; --bs-btn-active-color: var(--pm-ink); box-shadow: var(--pm-shadow-sm); }
.btn-outline-danger { --bs-btn-bg: #fff; box-shadow: var(--pm-shadow-sm); }
.btn-link { --bs-btn-font-weight: 600; }

/* Forms */
.form-label { font-weight: 600; font-size: .9rem; color: var(--pm-ink-2); margin-bottom: .4rem; }
.form-control, .form-select { border-radius: 10px; border-color: #dfe3ec; padding: .62rem .85rem; background-color: #fff; box-shadow: var(--pm-shadow-sm); transition: border-color .15s, box-shadow .15s; }
.form-control:hover, .form-select:hover { border-color: #cbd2e1; }
.form-control:focus, .form-select:focus { border-color: #818cf8; box-shadow: 0 0 0 4px rgba(99, 102, 241, .16); }
.form-control::placeholder { color: #a0a8b9; }
.form-text { color: var(--pm-muted); font-size: .82rem; }
.form-check-input:checked { background-color: var(--pm-primary); border-color: var(--pm-primary); }
.form-check-input:focus { box-shadow: 0 0 0 4px rgba(99, 102, 241, .16); border-color: #818cf8; }
.form-switch .form-check-input { width: 2.6em; height: 1.4em; }
.input-group-text { background: #f6f7fb; border-color: #dfe3ec; color: var(--pm-muted); font-size: .92rem; }

/* Cards, lists, badges, alerts */
.card { --bs-card-border-color: var(--pm-line); --bs-card-border-radius: var(--pm-radius); --bs-card-inner-border-radius: calc(var(--pm-radius) - 1px); box-shadow: var(--pm-shadow); }
.card-body { padding: 1.4rem; }
.list-group { --bs-list-group-border-color: var(--pm-line); --bs-list-group-border-radius: var(--pm-radius); box-shadow: var(--pm-shadow); }
.list-group-item { padding: 1rem 1.15rem; }
.badge { font-weight: 600; letter-spacing: .01em; border-radius: 999px; padding: .38em .7em; }
.alert { border-radius: 12px; border-width: 1px; box-shadow: var(--pm-shadow-sm); }
.alert-success { --bs-alert-bg: #ecfdf5; --bs-alert-border-color: #a7f3d0; --bs-alert-color: #065f46; }
.alert-info { --bs-alert-bg: #eef2ff; --bs-alert-border-color: #c7d2fe; --bs-alert-color: #3730a3; }
.alert-danger { --bs-alert-bg: #fef2f2; --bs-alert-border-color: #fecaca; --bs-alert-color: #991b1b; }
.alert-warning { --bs-alert-bg: #fffbeb; --bs-alert-border-color: #fde68a; --bs-alert-color: #92400e; }

/* ---------------- Site header ---------------- */
.pm-header { position: sticky; top: 0; z-index: 1030; background: rgba(255, 255, 255, .78); backdrop-filter: saturate(180%) blur(14px); -webkit-backdrop-filter: saturate(180%) blur(14px);
    border-bottom: 1px solid rgba(230, 232, 240, .8); }
.pm-header .navbar { padding: .7rem 0; }
.pm-brand { display: inline-flex; align-items: center; gap: .6rem; font-weight: 750; font-size: 1.08rem; color: var(--pm-ink) !important; letter-spacing: -.02em; text-decoration: none; }
.pm-brand img { width: auto; height: 30px; }
.pm-header .nav-link { font-weight: 500; color: var(--pm-ink-2); padding: .5rem .8rem !important; border-radius: 8px; }
.pm-header .nav-link:hover, .pm-header .nav-link.active { color: var(--pm-ink); background: rgba(15, 23, 42, .04); }
.pm-header .navbar-toggler { border: 0; padding: .4rem; box-shadow: none !important; }
.pm-user { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--pm-gradient); color: #fff; font-weight: 700; font-size: .85rem; }
@media (max-width: 767.98px) {
    .pm-header .navbar-collapse { padding: .75rem 0 .5rem; }
    .pm-header .navbar-nav .btn { width: 100%; margin-top: .25rem; }
}

/* ---------------- Site footer ---------------- */
.pm-footer-site { background: #0b1020; color: #a3acc2; padding: 64px 0 32px; margin-top: auto; }
.pm-footer-site a { color: #cbd2e1; text-decoration: none; }
.pm-footer-site a:hover { color: #fff; }
.pm-footer-site .pm-brand { color: #fff !important; }
.pm-footer-site h2 { font-size: .78rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: #7c86a2; margin-bottom: 1rem; }
.pm-footer-site ul { list-style: none; padding: 0; margin: 0; display: grid; gap: .6rem; font-size: .95rem; }
.pm-footer-bottom { margin-top: 48px; padding-top: 24px; border-top: 1px solid rgba(255,255,255,.08); display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; font-size: .88rem; }

/* ---------------- Auth pages ---------------- */
.auth-shell { display: grid; min-height: calc(100vh - 62px); background: #fff; }
.auth-aside { display: none; }
.auth-main { display: grid; place-items: center; padding: 40px 16px 56px; }
.auth-card { width: 100%; max-width: 420px; }
.auth-card h1 { font-size: 1.75rem; margin-bottom: .35rem; }
.auth-card .lead-sm { color: var(--pm-muted); margin-bottom: 1.75rem; }
.auth-card .form-control { padding: .7rem .9rem; }
.auth-card .btn-primary { padding-top: .72rem; padding-bottom: .72rem; }
.auth-divider { display: flex; align-items: center; gap: 12px; color: var(--pm-muted); font-size: .85rem; margin: 1.5rem 0; }
.auth-divider::before, .auth-divider::after { content: ""; flex: 1; height: 1px; background: var(--pm-line); }
.auth-foot { margin-top: 1.5rem; text-align: center; color: var(--pm-muted); font-size: .92rem; }
.otp-input { letter-spacing: .6em; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; text-align: center; font-size: 1.5rem !important; font-weight: 700; }
.password-toggle { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); border: 0; background: none; color: var(--pm-muted); font-size: .82rem; font-weight: 600; padding: 6px 8px; border-radius: 6px; }
.password-toggle:hover { color: var(--pm-ink); background: #f1f3f9; }
@media (min-width: 992px) {
    .auth-shell { grid-template-columns: minmax(420px, 46%) 1fr; }
    .auth-aside { display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; padding: 48px; color: #e0e7ff;
        background: radial-gradient(60% 50% at 20% 10%, rgba(139,92,246,.55), transparent 70%), radial-gradient(60% 60% at 90% 90%, rgba(217,70,239,.35), transparent 70%), #0b1020; }
    .auth-aside h2 { color: #fff; font-size: 2.1rem; line-height: 1.12; letter-spacing: -.03em; max-width: 15ch; }
    .auth-aside ul { list-style: none; padding: 0; margin: 1.5rem 0 0; display: grid; gap: .8rem; }
    .auth-aside li { display: flex; gap: .7rem; align-items: flex-start; color: #c7d2fe; }
    .auth-aside li::before { content: "✓"; display: grid; place-items: center; flex: 0 0 22px; height: 22px; border-radius: 50%; background: rgba(255,255,255,.12); color: #fff; font-size: .75rem; font-weight: 700; }
    .auth-shots { position: relative; height: 260px; margin-top: 2rem; }
    .auth-shots img { position: absolute; width: 62%; border-radius: 12px; box-shadow: 0 30px 60px -20px rgba(0,0,0,.6); border: 1px solid rgba(255,255,255,.12); }
    .auth-shots img:nth-child(1) { left: 0; top: 30px; transform: rotate(-6deg); }
    .auth-shots img:nth-child(2) { right: 0; top: 0; transform: rotate(5deg); }
    .auth-shots img:nth-child(3) { left: 22%; top: 90px; z-index: 1; }
}

/* ---------------- Dashboard ---------------- */
.page-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 1rem; margin-bottom: 1.5rem; }
.page-head h1 { font-size: 1.6rem; margin: 0; }
.page-head p { margin: .25rem 0 0; color: var(--pm-muted); }
.dashboard-nav { gap: 2px; }
.dashboard-nav .nav-link { display: flex; align-items: center; gap: .65rem; color: var(--pm-ink-2); font-weight: 500; border-radius: 10px; padding: .55rem .75rem; }
.dashboard-nav .nav-link svg { width: 18px; height: 18px; flex-shrink: 0; opacity: .7; }
.dashboard-nav .nav-link:hover { background: #fff; color: var(--pm-ink); box-shadow: var(--pm-shadow-sm); }
.dashboard-nav .nav-link.active { background: #fff; color: var(--pm-primary); box-shadow: var(--pm-shadow-sm), inset 0 0 0 1px #e0e3ff; }
.dashboard-nav .nav-link.active svg { opacity: 1; }
.nav-section { font-size: .7rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: #94a3b8; padding: .9rem .75rem .35rem; }

.empty-state { padding: 3rem 1.5rem; text-align: center; color: var(--pm-muted); border: 1.5px dashed #d5dae6; border-radius: var(--pm-radius); background: #fff; }
.empty-state .empty-icon { width: 52px; height: 52px; margin: 0 auto 1rem; border-radius: 14px; display: grid; place-items: center; background: var(--pm-primary-soft); color: var(--pm-primary); }
.empty-state h2 { font-size: 1.1rem; margin-bottom: .35rem; }

.stat-card { display: block; padding: 1.15rem 1.2rem; border-radius: var(--pm-radius); background: #fff; border: 1px solid var(--pm-line); box-shadow: var(--pm-shadow); text-decoration: none; color: inherit;
    transition: transform .2s var(--pm-ease), box-shadow .2s; }
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--pm-shadow-lg); color: inherit; }
.stat-card .stat-icon { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; margin-bottom: .8rem; }
.stat-card .stat-icon svg { width: 20px; height: 20px; }
.stat-card .stat-num { font-size: 1.9rem; font-weight: 750; letter-spacing: -.03em; line-height: 1; }
.stat-card .stat-label { color: var(--pm-muted); font-size: .88rem; margin-top: .3rem; }
.tone-indigo { background: #eef2ff; color: #4f46e5; } .tone-pink { background: #fdf2f8; color: #db2777; }
.tone-green { background: #ecfdf5; color: #059669; } .tone-amber { background: #fffbeb; color: #d97706; }

.share-card { position: relative; overflow: hidden; color: #e0e7ff; border: 0; background: radial-gradient(80% 120% at 100% 0%, rgba(217,70,239,.45), transparent 60%), radial-gradient(70% 100% at 0% 100%, rgba(99,102,241,.6), transparent 60%), #111427; }
.share-card .card-body { padding: 1.6rem; }
.share-card h2 { color: #fff; font-size: 1.15rem; }
.share-link { display: flex; align-items: center; gap: .5rem; padding: .35rem .35rem .35rem .9rem; border-radius: 12px; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.14); }
.share-link code { color: #fff; font-size: .92rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; min-width: 0; }
.share-link .btn { flex-shrink: 0; }
.status-pill { display: inline-flex; align-items: center; gap: .45rem; padding: .3rem .75rem; border-radius: 999px; font-size: .8rem; font-weight: 600; }
.status-pill i { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.status-live { background: rgba(16,185,129,.15); color: #34d399; } .status-draft { background: rgba(255,255,255,.1); color: #cbd5e1; }

.progress-ring { --p: 0; width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; flex-shrink: 0;
    background: radial-gradient(closest-side, #fff 78%, transparent 80% 100%), conic-gradient(var(--pm-primary) calc(var(--p) * 1%), #e8eaf3 0); }
.progress-ring span { font-weight: 700; font-size: .95rem; }
.checklist { list-style: none; padding: 0; margin: 0; display: grid; gap: .25rem; }
.checklist li { display: flex; align-items: center; gap: .7rem; padding: .55rem .6rem; border-radius: 10px; color: var(--pm-ink-2); }
.checklist li:hover { background: #f6f7fb; }
.checklist .tick { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; border: 1.5px solid #cfd5e3; font-size: .7rem; flex-shrink: 0; }
.checklist li.done { color: var(--pm-muted); }
.checklist li.done .tick { background: #10b981; border-color: #10b981; color: #fff; }
.checklist li.done span { text-decoration: line-through; text-decoration-color: #cbd5e1; }
.checklist a { margin-left: auto; font-size: .85rem; font-weight: 600; text-decoration: none; }

.item-row { display: flex; align-items: center; gap: 1rem; }
.item-thumb { width: 64px; height: 44px; border-radius: 8px; object-fit: cover; background: #eef0f6; flex-shrink: 0; border: 1px solid var(--pm-line); }
.item-thumb-ph { display: grid; place-items: center; color: #94a3b8; font-weight: 700; }
.tag { display: inline-block; font-size: .74rem; font-weight: 500; padding: .18rem .55rem; border-radius: 999px; background: #f1f3f9; color: var(--pm-ink-2); }

.skill-chip { display: inline-flex; align-items: center; gap: .4rem; padding: .38rem .7rem; background: #fff; border: 1px solid var(--pm-line); border-radius: 999px; box-shadow: var(--pm-shadow-sm); font-weight: 500; }
.skill-chip a { text-decoration: none; color: inherit; }
.btn-close-sm { width: .5rem; height: .5rem; background-size: .5rem; }

/* Theme picker (dashboard) */
.theme-option { display: block; cursor: pointer; overflow: hidden; border-radius: var(--pm-radius); background: #fff; border: 1.5px solid var(--pm-line); box-shadow: var(--pm-shadow-sm);
    transition: border-color .2s, box-shadow .2s, transform .2s var(--pm-ease); }
.theme-option:hover { transform: translateY(-2px); box-shadow: var(--pm-shadow); }
.btn-check:checked + .theme-option { border-color: var(--pm-primary); box-shadow: 0 0 0 4px rgba(79,70,229,.15), var(--pm-shadow); }
.btn-check:focus-visible + .theme-option { outline: 3px solid #a5b4fc; outline-offset: 2px; }
.theme-thumb { position: relative; display: block; aspect-ratio: 16 / 10; background: #eef0f6; border-bottom: 1px solid var(--pm-line); overflow: hidden; }
.theme-thumb img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.theme-check { position: absolute; right: 10px; top: 10px; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--pm-primary); color: #fff; font-weight: 700; font-size: .8rem;
    box-shadow: 0 4px 12px rgba(79,70,229,.5); opacity: 0; transform: scale(.6); transition: .2s var(--pm-ease); }
.btn-check:checked + .theme-option .theme-check { opacity: 1; transform: none; }
.theme-badge { background: #f3e8ff; color: #6d28d9; font-size: .68rem; }
.tg-filters { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 1rem; }
.tg-filters-sm .tg-chip { min-height: 34px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--pm-line); background: #fff; font-weight: 600; font-size: .82rem; color: var(--pm-ink-2); }
.tg-filters-sm .tg-chip.is-active { background: var(--pm-ink); border-color: var(--pm-ink); color: #fff; }
.settings-save { position: sticky; bottom: 0; margin: 0 -1.4rem -1.4rem; padding: 1rem 1.4rem; background: rgba(255,255,255,.92); backdrop-filter: blur(8px); border-top: 1px solid var(--pm-line); border-radius: 0 0 var(--pm-radius) var(--pm-radius); }
.theme-swatch { display: block; height: 72px; }
.theme-swatch-bentodark { background: linear-gradient(135deg, #0b0d12 0 60%, #7c5cff 60% 80%, #22d3ee 80%); }
.theme-swatch-minimallight { background: linear-gradient(180deg, #fafaf7 0 70%, #e7e5df 70%); }
.theme-swatch-terminal { background: #0a0f0a repeating-linear-gradient(0deg, transparent 0 10px, rgba(57,255,20,.15) 10px 11px); }

/* ---------------- Studio: nav | editor | live preview ---------------- */
.studio { display: grid; gap: 1.25rem; grid-template-columns: minmax(0, 1fr); align-items: start; }
.studio > * { min-width: 0; }
.studio-preview { display: none; }

@media (min-width: 1200px) {
    .studio { grid-template-columns: 170px minmax(380px, 5fr) 7fr; }
    .studio-nav { position: sticky; top: 1rem; }
    .studio-preview {
        display: flex; flex-direction: column; position: sticky; top: 1rem;
        height: calc(100vh - 6.5rem); min-height: 520px;
        background: var(--bs-body-bg); border: 1px solid var(--bs-border-color); border-radius: 1rem;
        overflow: hidden; box-shadow: 0 10px 30px rgba(15, 23, 42, .08);
    }
    /* Forms are narrower next to the preview: stack their columns. */
    .studio-editor .row > [class*="col-md-"] { flex: 0 0 100%; max-width: 100%; }
    .studio-editor .row > .col-md-4, .studio-editor .row > .col-md-6.half { flex: 0 0 50%; max-width: 50%; }
    .preview-fab { display: none; }
}
@media (min-width: 1600px) {
    .studio { grid-template-columns: 190px minmax(440px, 4fr) 6fr; }
}

.preview-toolbar {
    display: flex; align-items: center; gap: .5rem; padding: .6rem .8rem;
    border-bottom: 1px solid var(--bs-border-color); background: var(--bs-tertiary-bg);
}
.preview-title { font-weight: 600; display: inline-flex; align-items: center; gap: .45rem; }
.preview-dot { width: .55rem; height: .55rem; border-radius: 50%; background: #22c55e; box-shadow: 0 0 0 3px rgba(34,197,94,.2); }
.preview-stage {
    flex: 1; display: flex; justify-content: center; overflow: auto;
    background: repeating-conic-gradient(var(--bs-tertiary-bg) 0 25%, var(--bs-body-bg) 0 50%) 0 0 / 18px 18px;
}
.preview-stage iframe { width: 100%; height: 100%; border: 0; background: #fff; transition: width .25s ease; }
.preview-stage[data-device="tablet"] { padding: 1rem 0; }
.preview-stage[data-device="tablet"] iframe { width: 768px; max-width: 100%; border-radius: 12px; box-shadow: 0 6px 24px rgba(0,0,0,.15); }
.preview-stage[data-device="mobile"] { padding: 1rem 0; }
.preview-stage[data-device="mobile"] iframe { width: 390px; border-radius: 28px; box-shadow: 0 0 0 10px #111, 0 12px 30px rgba(0,0,0,.25); }
.preview-fab { position: fixed; right: 1rem; bottom: calc(1rem + env(safe-area-inset-bottom)); z-index: 1030; border-radius: 999px; min-height: 48px; padding-inline: 1.1rem; display: inline-flex; align-items: center; box-shadow: 0 8px 20px rgba(0,0,0,.2); }
.preview-close { display: none; }

/* Phones & tablets: live preview as a full-screen sheet */
@media (max-width: 1199.98px) {
    .studio.is-previewing .studio-preview {
        display: flex; flex-direction: column; position: fixed; inset: 0; z-index: 1050; background: var(--bs-body-bg);
        padding-bottom: env(safe-area-inset-bottom); animation: sheet-up .28s cubic-bezier(.2,.8,.2,1);
    }
    .studio.is-previewing ~ .preview-fab { display: none; }
    .studio.is-previewing .preview-close { display: inline-block; }
    .studio-preview .preview-devices { display: none; }
    .studio-preview .preview-toolbar { flex-wrap: wrap; padding-top: calc(.6rem + env(safe-area-inset-top)); }
    .studio-preview .preview-stage[data-device] { padding: 0; }
    .studio-preview .preview-stage iframe { width: 100% !important; border-radius: 0 !important; box-shadow: none !important; }
    body.preview-open { overflow: hidden; }
}
@media (max-width: 575.98px) { .studio-preview .preview-status { display: none; } }
@keyframes sheet-up { from { transform: translateY(100%); } }
@media (prefers-reduced-motion: reduce) { .studio.is-previewing .studio-preview { animation: none; } }

/* Dashboard on phones: comfortable tap targets, scrollable nav pills */
@media (max-width: 767.98px) {
    .dashboard-nav { flex-wrap: nowrap; overflow-x: auto; gap: .25rem; padding-bottom: .25rem; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
    .dashboard-nav::-webkit-scrollbar { display: none; }
    .dashboard-nav .nav-link { white-space: nowrap; min-height: 44px; display: inline-flex; align-items: center; }
    .studio-editor .form-control, .studio-editor .form-select { font-size: 16px; } /* stops iOS zooming into inputs */
    .studio-editor .btn { min-height: 44px; }
}

/* ---------------- Theme picker ---------------- */
.theme-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(min(220px, 100%), 1fr)); }
.premium-badge { background: linear-gradient(135deg, #b8893b, #e9c77b); color: #2b1d05; font-weight: 600; }
.theme-swatch-noireditorial { background: #0e0d0b linear-gradient(180deg, transparent 0 58%, #c9a45c 58% 61%, transparent 61%); position: relative; }
.theme-swatch-noireditorial::after { content: "Aa"; position: absolute; left: 14px; top: 8px; font: italic 600 34px/1 Georgia, serif; color: #efe8da; }
.theme-swatch-auroraglass { background: radial-gradient(60% 90% at 20% 20%, #7c3aed 0, transparent 60%), radial-gradient(60% 90% at 85% 30%, #06b6d4 0, transparent 60%), radial-gradient(70% 90% at 50% 100%, #f472b6 0, transparent 60%), #0b1020; }
.theme-swatch-executive { background: linear-gradient(90deg, #0f1e3a 0 34%, #fbfaf7 34%); position: relative; }
.theme-swatch-executive::after { content: ""; position: absolute; left: 38%; right: 10%; top: 26px; height: 3px; background: #b8893b; box-shadow: 0 12px 0 -1px #d9d5cc, 0 22px 0 -1px #d9d5cc; }
.theme-swatch-swissgrid { background: #fff linear-gradient(90deg, #e4002b 0 22%, transparent 22%); position: relative; }
.theme-swatch-swissgrid::after { content: "01"; position: absolute; right: 12px; bottom: 4px; font: 900 34px/1 Arial, sans-serif; color: #111; letter-spacing: -2px; }

/* ---------------- Media: photo, resume, GitHub import, gallery ---------------- */
.media-cards { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.media-card-wide { grid-column: 1 / -1; }
.avatar-thumb { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; flex-shrink: 0; border: 2px solid var(--bs-border-color); }
.avatar-empty { display: grid; place-items: center; font-size: 1.5rem; color: var(--bs-secondary-color); background: var(--bs-tertiary-bg); }
.file-badge { font-size: .7rem; font-weight: 700; padding: .2rem .45rem; border-radius: .35rem; background: #dc2626; color: #fff; }
.thumb-sm { width: 56px; height: 40px; object-fit: cover; border-radius: .35rem; border: 1px solid var(--bs-border-color); }
.preview-img { width: 160px; height: 84px; object-fit: cover; border-radius: .5rem; border: 1px solid var(--bs-border-color); flex-shrink: 0; }
.edit-hero-img { max-height: 260px; object-fit: cover; width: 100%; }

.upload-drop { border: 2px dashed var(--bs-border-color); transition: border-color .2s, background .2s; cursor: pointer; }
.upload-drop:hover { border-color: var(--pm-primary); background: rgba(91,91,214,.04); }
.upload-icon { display: block; font-size: 2rem; line-height: 1; color: var(--pm-primary); margin-bottom: .4rem; }

.gallery-admin { display: grid; gap: .8rem; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
.gallery-tile { margin: 0; border-radius: .75rem; overflow: hidden; border: 1px solid var(--bs-border-color); background: var(--bs-body-bg); }
.gallery-tile img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: block; }
.gallery-tile figcaption { display: flex; justify-content: space-between; align-items: center; gap: .4rem; padding: .4rem .5rem; font-size: .8rem; }
.gallery-tile form { display: inline; }

.theme-swatch-cinematic { background: radial-gradient(80% 120% at 50% 120%, #c8a96a55, transparent 60%), #08080a; position: relative; overflow: hidden; }
.theme-swatch-cinematic::after { content: "LUXE"; position: absolute; inset: 0; display: grid; place-items: center; font: 500 22px/1 Georgia, serif; letter-spacing: .5em; color: #e9d8b0; animation: swatch-pulse 3s ease-in-out infinite; }
.theme-swatch-kinetic { background: #f4f1ea; position: relative; overflow: hidden; }
.theme-swatch-kinetic::after { content: "MOVE MOVE MOVE MOVE"; position: absolute; top: 16px; left: 0; white-space: nowrap; font: 900 34px/1 Arial, sans-serif; color: #121212; -webkit-text-stroke: 0; animation: swatch-slide 6s linear infinite; }
.theme-swatch-kinetic::before { content: ""; position: absolute; right: 12px; bottom: 10px; width: 22px; height: 22px; border-radius: 50%; background: #ff5a1f; }
.theme-swatch-cosmos { background: radial-gradient(1px 1px at 20% 30%, #fff, transparent), radial-gradient(1px 1px at 70% 60%, #fff, transparent), radial-gradient(1.5px 1.5px at 40% 80%, #c7d2fe, transparent), radial-gradient(1px 1px at 85% 20%, #fff, transparent), radial-gradient(60% 80% at 30% 40%, #4c1d95aa, transparent), radial-gradient(60% 80% at 80% 70%, #0e7490aa, transparent), #05060f; }
.theme-swatch-neonholo { background: linear-gradient(110deg, #7df9ff, #b388ff 35%, #ff6ad5 65%, #fffb7d); background-size: 250% 100%; animation: swatch-shift 5s linear infinite; position: relative; }
.theme-swatch-neonholo::after { content: ""; position: absolute; inset: 8px; border-radius: 6px; background: #06060c linear-gradient(rgba(125,249,255,.2) 1px, transparent 1px) 0 0 / 100% 12px; }
.theme-swatch-luxegold { background: #f7f2e8; position: relative; overflow: hidden; }
.theme-swatch-luxegold::after { content: "Or"; position: absolute; inset: 0; display: grid; place-items: center; font: italic 500 34px/1 Georgia, serif; color: transparent;
    background: linear-gradient(100deg, #7a5c1f, #b08a3e 30%, #fff6dc 50%, #b08a3e 70%, #7a5c1f); background-size: 250% 100%; -webkit-background-clip: text; background-clip: text; animation: swatch-shift 4s ease-in-out infinite alternate; }
.theme-swatch-parallaxmono { background: #0b0b0b; position: relative; overflow: hidden; }
.theme-swatch-parallaxmono::after { content: "MONO"; position: absolute; left: 10px; bottom: -6px; font: 900 44px/1 Arial, sans-serif; letter-spacing: -3px; color: transparent; -webkit-text-stroke: 1px #f1efe9; }
.theme-swatch-liquidgradient { background: radial-gradient(50% 70% at 20% 30%, #c4b5fd, transparent 70%), radial-gradient(50% 70% at 80% 40%, #fda4af, transparent 70%), radial-gradient(60% 80% at 50% 100%, #99f6e4, transparent 70%), #f6f5fb; position: relative; }
.theme-swatch-liquidgradient::after { content: ""; position: absolute; left: 50%; bottom: 8px; width: 60%; height: 14px; transform: translateX(-50%); border-radius: 8px; background: rgba(255,255,255,.85); box-shadow: 0 4px 10px rgba(76,29,149,.2); }
.theme-swatch-bentostudio { background: #f3f1ec; display: grid; grid-template-columns: 2fr 1fr 1fr; grid-template-rows: 1fr 1fr; gap: 4px; padding: 6px; }
.theme-swatch-bentostudio::before { content: ""; grid-row: span 2; border-radius: 8px; background: #fff; }
.theme-swatch-bentostudio::after { content: ""; grid-column: span 2; grid-row: span 2; border-radius: 8px; background: linear-gradient(90deg, #ffe58a 0 48%, transparent 48% 52%, #ddd1ff 52%); }
.theme-swatch-bentopro { background: #07080a; display: grid; grid-template-columns: 2fr 1fr; gap: 4px; padding: 6px; }
.theme-swatch-bentopro::before { content: ""; border-radius: 8px; background: radial-gradient(60px circle at 30% 40%, rgba(200,255,61,.35), transparent 70%), #14171c; box-shadow: inset 0 0 0 1px rgba(200,255,61,.4); }
.theme-swatch-bentopro::after { content: ""; border-radius: 8px; background: #14171c; box-shadow: inset 0 0 0 1px rgba(255,255,255,.08); }
.theme-swatch-obsidian { background: #050505; position: relative; overflow: hidden; }
.theme-swatch-obsidian::after { content: ""; position: absolute; left: 10px; right: 10px; top: 10px; height: 34px; background: linear-gradient(120deg, #2b2b2b, #0f0f0f); box-shadow: 0 46px 0 -40px #ededea; }
.theme-swatch-index { background: #0c0c0c repeating-linear-gradient(180deg, transparent 0 17px, rgba(233,233,228,.15) 17px 18px); position: relative; }
.theme-swatch-index::after { content: "01 — Work"; position: absolute; left: 10px; top: 6px; font: 500 15px/1 system-ui, sans-serif; color: #e9e9e4; }
.theme-swatch-index::before { content: ""; position: absolute; right: 12px; top: 8px; width: 8px; height: 8px; border-radius: 50%; background: #ff4f1a; }
.theme-swatch-ethereal { background: linear-gradient(90deg, #e6e1ff 0 33%, #ffe1ea 33% 66%, #dff0fb 66%); position: relative; overflow: hidden; }
.theme-swatch-ethereal::after { content: "→ → →"; position: absolute; inset: 0; display: grid; place-items: center; font: italic 300 22px/1 Georgia, serif; color: #8b7fff; letter-spacing: .3em; animation: swatch-glide 3s ease-in-out infinite; }
.theme-swatch-chronicle { background: #12100d; position: relative; overflow: hidden; }
.theme-swatch-chronicle::after { content: ""; position: absolute; left: 50%; top: -10px; bottom: -10px; width: 30px; margin-left: -15px; border-left: 2px solid #e8743b; border-radius: 50%; filter: drop-shadow(0 0 4px #e8743b); }
.theme-swatch-chronicle::before { content: "Act I"; position: absolute; left: 10px; top: 8px; font: italic 300 18px/1 Georgia, serif; color: #d9b26f; }
@keyframes swatch-glide { 50% { transform: translateX(12px); } }
@keyframes swatch-shift { to { background-position: 250% 0; } }
@keyframes swatch-pulse { 50% { opacity: .55; letter-spacing: .6em; } }
@keyframes swatch-slide { to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) { .theme-swatch-cinematic::after, .theme-swatch-kinetic::after, .theme-swatch-neonholo, .theme-swatch-luxegold::after, .theme-swatch-ethereal::after { animation: none; } }
.min-w-0 { min-width: 0; }
.studio-editor > h1.h3, .studio-editor h1.h3.mb-4 { font-size: 1.6rem; letter-spacing: -.02em; }
.studio-editor .card h2.h6 { font-size: .74rem; letter-spacing: .1em; font-weight: 700; color: #94a3b8 !important; }
.empty-state p { max-width: 460px; margin-left: auto; margin-right: auto; }

/* Validation summary: only show the alert box when there are errors */
.validation-summary-valid { display: none !important; }

/* Overview layout adapts to the editor column (not the viewport), since the preview pane takes space */
.studio-editor { container-type: inline-size; }
.ov-top { display: grid; gap: 1rem; grid-template-columns: minmax(0, 1fr); }
.ov-top > *, .ov-stats > * { min-width: 0; }
.ov-stats { display: grid; gap: 1rem; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@container (min-width: 620px) {
    .ov-top { grid-template-columns: 1.45fr 1fr; }
    .ov-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
.auth-aside-kicker { font-size: .78rem; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: #a5b4fc; }
@media (max-width: 575.98px) {
    .list-group-item.d-flex { flex-wrap: wrap; }
    .list-group-item > .item-row, .list-group-item > div:first-child { flex: 1 1 220px; }
}
@media (max-width: 1199.98px) { .settings-save { padding-right: 170px; } }

/* ---------------- Studio variants (resume builder) ---------------- */
.nav-badge { margin-left: auto; font-size: .62rem; font-weight: 700; letter-spacing: .06em; padding: .12rem .4rem; border-radius: 999px; background: var(--pm-gradient); color: #fff; }
@media (min-width: 1200px) {
    .studio.studio-wide { grid-template-columns: 170px minmax(0, 1fr); }
    .studio.studio-resume { grid-template-columns: 170px minmax(400px, 5fr) 6fr; }
    .studio-resume .preview-stage { background: #e6e9f0; }
}
@media (min-width: 1600px) {
    .studio.studio-wide { grid-template-columns: 190px minmax(0, 1fr); }
    .studio.studio-resume { grid-template-columns: 190px minmax(460px, 1fr) minmax(560px, 1.15fr); }
}
.rz-promo { border: 1px solid #bbf7d0; background: linear-gradient(120deg, #fff 60%, #f0fdf4); transition: box-shadow .2s, transform .2s var(--pm-ease); }
.rz-promo:hover { box-shadow: var(--pm-shadow); transform: translateY(-1px); }
.rz-promo .stat-icon { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; flex-shrink: 0; }
.rz-promo .stat-icon svg { width: 20px; height: 20px; }
.studio-editor .card.rz-promo h2.h6 { font-size: 1rem !important; letter-spacing: -.01em !important; color: var(--pm-ink) !important; text-transform: none; }
.min-w-0 { min-width: 0; }
