:root {
    --bg: #f5f7fb;
    --bg-elevated: #ffffff;
    --bg-soft: #f8fafc;
    --text: #0f172a;
    --text-muted: #64748b;
    --text-soft: #94a3b8;
    --border: rgba(148, 163, 184, 0.25);
    --border-strong: rgba(148, 163, 184, 0.45);
    --primary: #2563eb;
    --primary-soft: rgba(37, 99, 235, 0.12);
    --dark: #0f172a;
    --success: #059669;
    --danger: #dc2626;
    --warning: #d97706;
    --shadow-lg: 0 24px 60px rgba(15, 23, 42, 0.12);
    --shadow-md: 0 14px 32px rgba(15, 23, 42, 0.08);
    --shadow-sm: 0 8px 20px rgba(15, 23, 42, 0.05);
    --radius-xl: 24px;
    --radius-lg: 18px;
    --radius-md: 14px;
    --radius-sm: 10px;
    --transition: 180ms ease;
}

body[data-theme="dark"] {
    --bg: #08111f;
    --bg-elevated: #111c2f;
    --bg-soft: #18243a;
    --text: #f8fafc;
    --text-muted: #bac5d6;
    --text-soft: #8fa0b9;
    --border: rgba(148, 163, 184, 0.16);
    --border-strong: rgba(148, 163, 184, 0.28);
    --primary: #60a5fa;
    --primary-soft: rgba(96, 165, 250, 0.14);
    --dark: #f8fafc;
    --shadow-lg: 0 24px 60px rgba(2, 6, 23, 0.44);
    --shadow-md: 0 14px 32px rgba(2, 6, 23, 0.28);
    --shadow-sm: 0 8px 20px rgba(2, 6, 23, 0.2);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: var(--text);
    background:
        radial-gradient(circle at top left, rgba(37, 99, 235, 0.08), transparent 30%),
        radial-gradient(circle at bottom right, rgba(14, 165, 233, 0.07), transparent 24%),
        var(--bg);
    transition: background var(--transition), color var(--transition);
}

.app-body {
    position: relative;
}

.app-gradient {
    position: fixed;
    inset: 0;
    background:
        radial-gradient(circle at 15% 18%, rgba(37, 99, 235, 0.12), transparent 20%),
        radial-gradient(circle at 85% 12%, rgba(14, 165, 233, 0.08), transparent 16%),
        radial-gradient(circle at 84% 86%, rgba(99, 102, 241, 0.08), transparent 18%);
    pointer-events: none;
    z-index: 0;
}

a {
    color: inherit;
}

img {
    max-width: 100%;
    display: block;
}

textarea {
    resize: vertical;
}

.form-control,
.form-select {
    border-radius: 14px;
    border-color: var(--border);
    background-color: var(--bg-elevated);
    color: var(--text);
    box-shadow: none !important;
    transition: border-color var(--transition), background-color var(--transition), color var(--transition);
}

.form-control::placeholder,
.form-select::placeholder {
    color: var(--text-soft);
}

.form-control:focus,
.form-select:focus {
    border-color: rgba(37, 99, 235, 0.4);
    background-color: var(--bg-elevated);
}

.form-label {
    font-weight: 600;
    color: var(--text);
}

.form-help {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.surface-card {
    position: relative;
    z-index: 1;
    background: color-mix(in srgb, var(--bg-elevated) 94%, transparent);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-md);
    backdrop-filter: blur(12px);
}

.brand-pill,
.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.7rem;
    border-radius: 999px;
    padding: 0.65rem 1rem;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.38);
    font-weight: 700;
    font-size: 0.93rem;
    color: var(--text);
}

body[data-theme="dark"] .brand-pill,
body[data-theme="dark"] .status-pill {
    background: rgba(15, 23, 42, 0.38);
}

.brand-mark {
    width: 1.9rem;
    height: 1.9rem;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), #14b8a6);
    color: #fff;
}

.status-pill {
    font-weight: 600;
    color: var(--text-muted);
}

.status-pill.neutral {
    background: var(--primary-soft);
    color: var(--primary);
}

.section-kicker {
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--primary);
}

.btn {
    border-radius: 14px;
    font-weight: 700;
    padding: 0.78rem 1.1rem;
    transition: transform var(--transition), box-shadow var(--transition), background-color var(--transition), color var(--transition), border-color var(--transition);
}

.btn:hover {
    transform: translateY(-1px);
}

.btn-primary {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    border: none;
    box-shadow: 0 16px 30px rgba(37, 99, 235, 0.22);
}

.btn-dark {
    background: linear-gradient(135deg, #111827, #0f172a);
    border: none;
    box-shadow: 0 16px 30px rgba(15, 23, 42, 0.22);
}

body[data-theme="dark"] .btn-dark {
    background: linear-gradient(135deg, #e2e8f0, #cbd5e1);
    color: #08111f;
}

.btn-soft,
.btn-icon-soft {
    background: var(--bg-soft);
    color: var(--text);
    border: 1px solid var(--border);
}

.btn-soft:hover,
.btn-icon-soft:hover,
.view-switcher .btn.active {
    background: var(--primary-soft);
    color: var(--primary);
    border-color: rgba(37, 99, 235, 0.22);
}

.btn-icon-soft {
    width: 2.75rem;
    height: 2.75rem;
    display: inline-grid;
    place-items: center;
    padding: 0;
}

.btn-icon-soft.danger,
.remove-item-btn:hover {
    color: var(--danger);
    border-color: rgba(220, 38, 38, 0.2);
    background: rgba(220, 38, 38, 0.08);
}

.toast {
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: var(--shadow-md);
    overflow: hidden;
}

.auth-wrap {
    position: relative;
    z-index: 1;
}

.auth-hero,
.auth-panel {
    padding: clamp(1.5rem, 2vw, 2.4rem);
}

.auth-hero {
    min-height: 100%;
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.mini-feature {
    display: flex;
    gap: 1rem;
    padding: 1rem;
    border-radius: 18px;
    border: 1px solid var(--border);
    background: color-mix(in srgb, var(--bg-soft) 70%, transparent);
    min-height: 126px;
}

.mini-feature i {
    width: 2.75rem;
    height: 2.75rem;
    display: grid;
    place-items: center;
    border-radius: 14px;
    background: var(--primary-soft);
    color: var(--primary);
    font-size: 1.2rem;
    flex-shrink: 0;
}

.mini-feature h3 {
    font-size: 1rem;
    margin: 0 0 0.35rem;
}

.mini-feature p {
    margin: 0;
    color: var(--text-muted);
    line-height: 1.65;
}

.auth-tabs {
    gap: 0.8rem;
}

.auth-tabs .nav-link {
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--bg-soft);
    color: var(--text-muted);
    font-weight: 700;
    padding: 0.85rem 1.2rem;
}

.auth-tabs .nav-link.active {
    background: var(--primary);
    color: #fff;
    border-color: transparent;
}

.modern-input .input-group-text {
    border-radius: 14px 0 0 14px;
    border-color: var(--border);
    background: var(--bg-soft);
    color: var(--text-muted);
}

.modern-input .form-control {
    border-left: 0;
    border-radius: 0 14px 14px 0;
}

.template-showcase {
    position: relative;
    max-width: 330px;
    margin-inline: auto;
}

.template-thumb {
    position: relative;
    border-radius: 26px;
    border: 1px solid var(--border);
    background: #ffffff;
    box-shadow: var(--shadow-lg);
    padding: 1.4rem 1.1rem 1.1rem;
    min-height: 220px;
    overflow: hidden;
}

body[data-theme="dark"] .template-thumb {
    background: #f8fafc;
}

.template-thumb-sidebar {
    min-height: 280px;
    padding-left: 1.3rem;
}

.template-sidebar-strip {
    position: absolute;
    inset: 0 0 0 auto;
    width: 34%;
    background: #0b3258;
}

.template-avatar {
    position: relative;
    z-index: 1;
    width: 3.2rem;
    height: 3.2rem;
    border-radius: 50%;
    background: linear-gradient(135deg, #1d4ed8, #0f766e);
    margin-bottom: 1rem;
}

.template-lines {
    position: relative;
    z-index: 1;
    display: grid;
    gap: 0.58rem;
}

.template-lines .line {
    display: block;
    height: 0.62rem;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.12);
}

.template-lines .line.xl { width: 78%; height: 1rem; }
.template-lines .line.lg { width: 92%; }
.template-lines .line.md { width: 72%; }
.template-lines .line.sm { width: 52%; }
.template-lines .line.right { margin-left: auto; }

.template-badge {
    position: absolute;
    left: 1rem;
    bottom: 1rem;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.9);
    color: #fff;
    font-size: 0.78rem;
    font-weight: 700;
    padding: 0.45rem 0.7rem;
}

.dashboard-shell {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: 320px minmax(0, 1fr);
    min-height: 100vh;
    gap: 1.5rem;
    padding: 1.25rem;
}

.dashboard-sidebar {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 1.25rem;
    position: sticky;
    top: 1.25rem;
    height: calc(100vh - 2.5rem);
}

.user-panel {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    padding: 1rem;
    border-radius: 18px;
    background: var(--bg-soft);
    border: 1px solid var(--border);
}

.user-avatar {
    width: 3rem;
    height: 3rem;
    display: grid;
    place-items: center;
    border-radius: 16px;
    background: linear-gradient(135deg, var(--primary), #0ea5e9);
    color: #fff;
    font-size: 1rem;
    font-weight: 800;
    flex-shrink: 0;
}

.action-stack {
    display: grid;
    gap: 1rem;
}

.action-stack > .btn {
    width: 100%;
}

.status-card,
.library-card {
    border-radius: 20px;
    border: 1px solid var(--border);
    background: var(--bg-soft);
    padding: 1rem;
}

.status-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    font-size: 0.93rem;
    color: var(--text-muted);
}

.status-row + .status-row {
    margin-top: 0.75rem;
}

.cv-library-list {
    display: grid;
    gap: 0.8rem;
    max-height: 42vh;
    overflow: auto;
    padding-right: 0.2rem;
}

.cv-library-item {
    border-radius: 18px;
    border: 1px solid var(--border);
    background: var(--bg-elevated);
    padding: 0.9rem;
    transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition);
}

.cv-library-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.cv-library-item.active {
    border-color: rgba(37, 99, 235, 0.28);
    box-shadow: 0 12px 20px rgba(37, 99, 235, 0.12);
}

.cv-library-item-title {
    font-weight: 700;
    margin-bottom: 0.3rem;
}

.cv-library-item-meta {
    font-size: 0.82rem;
    color: var(--text-muted);
}

.cv-library-item-actions {
    display: flex;
    gap: 0.55rem;
    margin-top: 0.7rem;
}

.cv-library-item-actions .btn {
    flex: 1;
    padding: 0.55rem 0.7rem;
    font-size: 0.82rem;
}

.sidebar-footer {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    padding-top: 1rem;
}

.dashboard-main {
    min-width: 0;
}

.topbar-card {
    padding: 1.15rem 1.25rem;
    margin-bottom: 1.25rem;
}

.topbar-grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: minmax(0, 1.3fr) minmax(400px, 0.9fr);
    align-items: end;
}

.title-input-wrap .form-control {
    min-height: 3.3rem;
    font-size: 1.1rem;
    font-weight: 700;
}

.topbar-controls {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: end;
}

.control-group {
    min-width: 0;
}

.workspace-grid {
    display: grid;
    gap: 1.25rem;
    grid-template-columns: minmax(0, 1.06fr) minmax(420px, 0.94fr);
    align-items: start;
}

.dashboard-main.layout-focus .workspace-grid,
.workspace-grid.layout-focus {
    grid-template-columns: minmax(340px, 0.78fr) minmax(540px, 1.22fr);
}

.editor-column,
.preview-column {
    min-width: 0;
}

.editor-stack {
    display: grid;
    gap: 1.15rem;
}

.editor-card {
    padding: 1.15rem;
}

.card-header-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.form-textarea-lg {
    min-height: 9rem;
}

.tag-input-shell {
    padding: 0.95rem;
    border-radius: 18px;
    border: 1px solid var(--border);
    background: var(--bg-soft);
}

.tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    margin-bottom: 0.8rem;
    min-height: 0.5rem;
}

.tag-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.48rem 0.72rem;
    border-radius: 999px;
    background: var(--primary-soft);
    color: var(--primary);
    border: 1px solid rgba(37, 99, 235, 0.12);
    font-size: 0.88rem;
    font-weight: 700;
}

.tag-pill button {
    background: transparent;
    border: none;
    color: inherit;
    padding: 0;
    line-height: 1;
}

.tag-input-row {
    display: grid;
    gap: 0.8rem;
    grid-template-columns: minmax(0, 1fr) auto;
}

.dynamic-list {
    display: grid;
    gap: 0.95rem;
}

.dynamic-item {
    border-radius: 20px;
    border: 1px solid var(--border);
    background: var(--bg-soft);
    padding: 1rem;
}

.dynamic-item.compact-item {
    padding: 0.85rem;
}

.dynamic-item-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.6rem;
}

.ai-output-box {
    border-radius: 20px;
    border: 1px dashed rgba(37, 99, 235, 0.28);
    background: color-mix(in srgb, var(--primary-soft) 60%, var(--bg-elevated));
    padding: 1rem;
    min-height: 180px;
}

.empty-state-box {
    display: grid;
    place-items: center;
    text-align: center;
}

.empty-state-box i {
    font-size: 1.8rem;
    color: var(--primary);
    margin-bottom: 0.75rem;
}

.empty-state-box h4 {
    margin-bottom: 0.5rem;
}

.empty-state-box p {
    margin: 0;
    color: var(--text-muted);
    max-width: 56ch;
}

.ai-section-block + .ai-section-block {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.ai-section-block h4 {
    font-size: 0.96rem;
    margin-bottom: 0.55rem;
}

.ai-section-block ul {
    margin: 0;
    padding-left: 1.2rem;
    color: var(--text-muted);
}

.ai-section-block li + li {
    margin-top: 0.45rem;
}

.preview-panel {
    position: sticky;
    top: 1.25rem;
    padding: 0;
    overflow: hidden;
    min-height: calc(100vh - 8.25rem);
}

.preview-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.15rem;
    border-bottom: 1px solid var(--border);
    background: color-mix(in srgb, var(--bg-elevated) 85%, transparent);
}

.preview-scroll {
    max-height: calc(100vh - 13rem);
    overflow: auto;
    padding: 1.15rem;
}

.cv-preview-root {
    display: grid;
    place-items: center;
}

.cv-sheet {
    width: 210mm;
    max-width: 100%;
    min-height: 297mm;
    margin: 0 auto;
    background: #ffffff;
    color: #0f172a;
    border-radius: 22px;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

.cv-sheet a {
    color: inherit;
    text-decoration: none;
}

.cv-classic {
    padding: 24mm 20mm 22mm;
}

.cv-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding-bottom: 1.2rem;
}

.cv-header-main {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
}

.cv-header-photo {
    width: 58px;
    height: 58px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid rgba(15, 23, 42, 0.1);
}

.cv-name {
    margin: 0;
    font-size: 2.1rem;
    line-height: 1.05;
    font-weight: 800;
    letter-spacing: -0.04em;
}

.cv-role {
    margin: 0.28rem 0 0;
    font-size: 1.12rem;
    color: #334155;
}

.cv-contacts {
    text-align: right;
    font-size: 0.96rem;
    line-height: 1.8;
    color: #334155;
}

.cv-section {
    margin-top: 1.15rem;
}

.cv-section-title {
    font-size: 1.52rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    margin: 0 0 0.75rem;
    color: #111827;
}

.cv-summary {
    font-size: 1.03rem;
    line-height: 1.8;
    color: #334155;
    margin: 0;
}

.cv-entry + .cv-entry {
    margin-top: 1rem;
}

.cv-entry-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.3rem;
}

.cv-entry-role {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 800;
}

.cv-entry-company {
    margin: 0.12rem 0 0;
    color: #475569;
    font-style: italic;
}

.cv-entry-duration,
.cv-project-period {
    white-space: nowrap;
    color: #475569;
    font-weight: 600;
}

.cv-bullets {
    margin: 0.55rem 0 0;
    padding-left: 1.1rem;
    color: #334155;
    line-height: 1.75;
}

.cv-bullets li + li {
    margin-top: 0.22rem;
}

.cv-inline-list {
    color: #334155;
    line-height: 1.8;
}

.cv-inline-list .separator {
    color: #94a3b8;
    margin-inline: 0.45rem;
}

.cv-sidebar-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.58fr) minmax(240px, 0.92fr);
}

.cv-sidebar-main {
    padding: 18mm 18mm 20mm 20mm;
    background: #f8fafc;
}

.cv-sidebar-side {
    background: #0b3258;
    color: #ffffff;
    padding: 18mm 14mm;
}

.cv-sidebar-top {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    margin-bottom: 1.4rem;
}

.cv-sidebar-avatar {
    width: 74px;
    height: 74px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid rgba(255, 255, 255, 0.22);
    flex-shrink: 0;
}

.cv-sidebar-name {
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: -0.04em;
    line-height: 1.02;
    margin: 0;
}

.cv-sidebar-role {
    margin: 0.4rem 0 0;
    font-size: 0.78rem;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.78);
}

.cv-sidebar-main .cv-section-title {
    font-size: 1.25rem;
    margin-bottom: 0.65rem;
}

.cv-sidebar-side-section + .cv-sidebar-side-section {
    margin-top: 1.4rem;
}

.cv-sidebar-side-title {
    font-size: 1.08rem;
    font-weight: 800;
    margin: 0 0 0.7rem;
}

.cv-sidebar-side-list,
.cv-sidebar-links,
.cv-sidebar-skills {
    display: grid;
    gap: 0.55rem;
    color: rgba(255, 255, 255, 0.92);
    font-size: 0.95rem;
    line-height: 1.7;
}

.cv-sidebar-skills span,
.cv-sidebar-links a,
.cv-sidebar-side-list span {
    display: block;
}

.cv-badge-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
}

.cv-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.38rem 0.65rem;
    border-radius: 999px;
    background: rgba(37, 99, 235, 0.08);
    color: #1e40af;
    font-size: 0.86rem;
    font-weight: 700;
}

.cv-sidebar-side .cv-badge {
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff;
}

.cv-meta-divider {
    height: 1px;
    background: rgba(148, 163, 184, 0.2);
    margin: 1rem 0;
}

.loading-inline {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.spinner-dot {
    width: 0.85rem;
    height: 0.85rem;
    border-radius: 50%;
    border: 2px solid rgba(37, 99, 235, 0.16);
    border-top-color: var(--primary);
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.hidden {
    display: none !important;
}

.text-secondary {
    color: var(--text-muted) !important;
}

.preview-overlay-open .preview-column {
    opacity: 1;
    pointer-events: auto;
}

.empty-library {
    padding: 1rem;
    border-radius: 18px;
    border: 1px dashed var(--border-strong);
    background: transparent;
    text-align: center;
    color: var(--text-muted);
}

.auth-feedback,
.inline-feedback {
    border-radius: 16px;
    padding: 0.85rem 1rem;
    font-weight: 600;
}

.auth-feedback.success,
.inline-feedback.success {
    background: rgba(5, 150, 105, 0.12);
    border: 1px solid rgba(5, 150, 105, 0.18);
    color: #047857;
}

.auth-feedback.error,
.inline-feedback.error {
    background: rgba(220, 38, 38, 0.1);
    border: 1px solid rgba(220, 38, 38, 0.18);
    color: #b91c1c;
}

.form-loading {
    pointer-events: none;
    opacity: 0.8;
}

@media (max-width: 1600px) {
    .topbar-grid {
        grid-template-columns: 1fr;
    }

    .topbar-controls {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 1400px) {
    .dashboard-shell {
        grid-template-columns: 290px minmax(0, 1fr);
    }

    .workspace-grid {
        grid-template-columns: minmax(0, 1fr) minmax(380px, 0.9fr);
    }
}

@media (max-width: 1199.98px) {
    .dashboard-shell {
        grid-template-columns: 1fr;
        padding: 1rem;
    }

    .dashboard-sidebar {
        position: static;
        height: auto;
    }

    .workspace-grid,
    .workspace-grid.layout-focus {
        grid-template-columns: 1fr;
    }

    .preview-column {
        position: fixed;
        inset: 0;
        z-index: 1100;
        padding: 0.75rem;
        background: rgba(15, 23, 42, 0.42);
        opacity: 0;
        pointer-events: none;
        transition: opacity var(--transition);
    }

    .preview-panel {
        position: relative;
        top: 0;
        height: calc(100vh - 1.5rem);
        min-height: auto;
    }

    .preview-scroll {
        max-height: calc(100vh - 7rem);
    }

    body.preview-overlay-open .preview-column {
        opacity: 1;
        pointer-events: auto;
    }
}

@media (max-width: 991.98px) {
    .feature-grid {
        grid-template-columns: 1fr;
    }

    .auth-hero,
    .auth-panel {
        padding: 1.3rem;
    }

    .topbar-controls {
        grid-template-columns: 1fr;
    }

    .cv-header,
    .cv-entry-head {
        flex-direction: column;
    }

    .cv-contacts {
        text-align: left;
    }

    .cv-sidebar-layout {
        grid-template-columns: 1fr;
    }

    .cv-sidebar-side {
        order: -1;
    }
}

@media (max-width: 767.98px) {
    .dashboard-shell {
        gap: 1rem;
        padding: 0.8rem;
    }

    .surface-card {
        border-radius: 20px;
    }

    .cv-sheet {
        border-radius: 18px;
    }

    .cv-classic {
        padding: 16mm 12mm;
    }

    .cv-sidebar-main,
    .cv-sidebar-side {
        padding: 14mm 10mm;
    }

    .cv-name,
    .cv-sidebar-name {
        font-size: 1.65rem;
    }

    .cv-section-title {
        font-size: 1.22rem;
    }

    .tag-input-row {
        grid-template-columns: 1fr;
    }

    .card-header-row {
        flex-direction: column;
        align-items: stretch;
    }
}

@media print {
    body,
    .app-gradient {
        background: #ffffff !important;
    }

    .dashboard-sidebar,
    .topbar-card,
    .editor-column,
    .preview-toolbar {
        display: none !important;
    }

    .dashboard-shell,
    .dashboard-main,
    .workspace-grid,
    .preview-column,
    .preview-panel,
    .preview-scroll,
    .cv-preview-root {
        display: block !important;
        padding: 0 !important;
        margin: 0 !important;
        background: #ffffff !important;
        box-shadow: none !important;
        border: 0 !important;
    }

    .cv-sheet {
        width: 210mm !important;
        min-height: auto !important;
        box-shadow: none !important;
        border-radius: 0 !important;
    }
}
