:root {
    --primary: #2c3e50;
    --primary-dark: #1a252f;
    --primary-light: #34495e;
    --secondary: #3498db;
    --secondary-light: #5dade2;
    --secondary-dark: #2980b9;
    --bg: #f8f9fa;
    --bg-alt: #ffffff;
    --bg-gradient: linear-gradient(135deg, #f8fafd, #eef2f6);
    --text: #2c3e50;
    --text-muted: #5a6c7d;
    --text-light: #8b9aa8;
    --border: #e1e8ed;
    --border-light: #f0f4f7;
    --error: #e74c3c;
    --warning: #f39c12;
    --success: #15803d;
    --success-light: #16a34a;
    --code-bg: #f6f8fa;
    --code-border: #d0d7de;
    --shadow-sm: 0 1px 2px rgba(44, 62, 80, 0.06);
    --shadow: 0 4px 12px rgba(44, 62, 80, 0.08);
    --shadow-lg: 0 12px 32px rgba(44, 62, 80, 0.12);
    --shadow-xl: 0 24px 48px rgba(44, 62, 80, 0.18);
    --radius-sm: 6px;
    --radius: 12px;
    --radius-lg: 16px;
    --sidebar-width: 280px;
    --content-max: 920px;

    --brand-bg: #2c3e50;
    --brand-bg-dark: #1a252f;
    --on-brand: #ffffff;
    --footer-bg: #2c3e50;
    --code-text: #cdd6f4;
    --code-block-bg: #1e1e2e;
}

[data-theme="dark"] {
    --primary: #f1f5f9;
    --primary-dark: #cbd5e1;
    --primary-light: #f8fafc;
    --secondary: #60a5fa;
    --secondary-light: #93c5fd;
    --secondary-dark: #3b82f6;
    --bg: #0f172a;
    --bg-alt: #1e293b;
    --bg-gradient: linear-gradient(135deg, #0f172a, #1a2438);
    --text: #e2e8f0;
    --text-muted: #94a3b8;
    --text-light: #64748b;
    --border: #334155;
    --border-light: #1e293b;
    --error: #f87171;
    --warning: #fbbf24;
    --success: #4ade80;
    --success-light: #6ee7b7;
    --code-bg: #1e293b;
    --code-border: #334155;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.6);
    --shadow-xl: 0 24px 48px rgba(0, 0, 0, 0.75);

    --brand-bg: #1e3a5f;
    --brand-bg-dark: #0c1b30;
    --on-brand: #f1f5f9;
    --footer-bg: #0a0f1c;
    --code-text: #cdd6f4;
    --code-block-bg: #0d1224;
}

html {
    color-scheme: light dark;
}

[data-theme="dark"] html {
    color-scheme: dark;
}

[data-theme="light"] html {
    color-scheme: light;
}

body,
.sidebar,
.section,
.hero,
.feature,
.problem,
.callout,
.tier-card,
.role-card,
.objective-card,
.info-card,
.tech-card,
.db-card,
.future-card,
.security-card,
.status-card,
.image-grid figure,
.diagram-image,
.mockup-showcase,
.mobile-mockup-grid,
.http-card,
.meta-card,
.step-list li,
.tool-list li,
.data-table,
.scroll-top,
.fab,
.menu-toggle {
    transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease, box-shadow 0.3s ease;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 24px;
}

body {
    font-family: "Segoe UI", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.65;
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ============================ SIDEBAR ============================ */

.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--bg-alt);
    border-right: 1px solid var(--border);
    overflow-y: auto;
    z-index: 100;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease;
}

.sidebar-header {
    padding: 28px 24px 20px;
    border-bottom: 1px solid var(--border-light);
    text-align: center;
}

.sidebar-logo {
    max-width: 180px;
    height: auto;
    margin-bottom: 8px;
}

.sidebar-subtitle {
    font-size: 0.78rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-weight: 600;
}

.sidebar-nav {
    flex: 1;
    padding: 16px 0;
    overflow-y: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.sidebar,
.sidebar-nav {
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.sidebar::-webkit-scrollbar,
.sidebar-nav::-webkit-scrollbar {
    width: 0;
    height: 0;
    display: none;
}

.sidebar-nav ol {
    list-style: none;
    counter-reset: nav-counter;
}

.sidebar-nav li {
    counter-increment: nav-counter;
}

.sidebar-nav a {
    display: block;
    padding: 10px 24px 10px 56px;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9rem;
    border-left: 3px solid transparent;
    transition: all 0.18s ease;
    position: relative;
}

.sidebar-nav a::before {
    content: counter(nav-counter, decimal-leading-zero);
    position: absolute;
    left: 24px;
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--text-light);
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.04em;
}

.sidebar-nav a:hover {
    color: var(--secondary);
    background: var(--bg);
    border-left-color: var(--secondary-light);
}

.sidebar-nav a.active {
    color: var(--secondary-dark);
    background: linear-gradient(90deg, rgba(52, 152, 219, 0.08), transparent);
    border-left-color: var(--secondary);
    font-weight: 600;
}

.sidebar-nav a.active::before {
    color: var(--secondary);
}

.sidebar-footer {
    padding: 18px 24px;
    border-top: 1px solid var(--border-light);
    font-size: 0.78rem;
    color: var(--text-muted);
    text-align: center;
    line-height: 1.5;
}

.sidebar-footer p:first-child {
    font-weight: 600;
    color: var(--primary);
}

/* ============================ MENU TOGGLE (mobile) ============================ */

.menu-toggle {
    display: none;
    position: fixed;
    top: 16px;
    left: 16px;
    z-index: 110;
    width: 44px;
    height: 44px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--bg-alt);
    color: var(--primary);
    cursor: pointer;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow);
}

.menu-toggle:hover {
    background: var(--secondary);
    color: white;
    border-color: var(--secondary);
}

/* ============================ MAIN ============================ */

.content {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    background: var(--bg);
}

/* ============================ HERO ============================ */

.hero {
    min-height: 100vh;
    background: var(--bg-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px 32px;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        radial-gradient(circle at 20% 30%, rgba(52, 152, 219, 0.08), transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(44, 62, 80, 0.06), transparent 50%);
    pointer-events: none;
}

.hero-inner {
    position: relative;
    max-width: 880px;
    width: 100%;
    text-align: center;
}

.hero-logo {
    max-width: 280px;
    height: auto;
    margin-bottom: 32px;
    filter: drop-shadow(0 8px 24px rgba(44, 62, 80, 0.15));
}

.hero-title {
    font-size: clamp(2.2rem, 5vw, 3.8rem);
    color: var(--primary);
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.1;
    margin-bottom: 16px;
}

.hero-subtitle {
    font-size: clamp(1rem, 2.5vw, 1.35rem);
    color: var(--text-muted);
    font-weight: 400;
    max-width: 680px;
    margin: 0 auto 40px;
    line-height: 1.5;
}

.hero-meta {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 16px;
    max-width: 760px;
    margin: 0 auto 40px;
}

.meta-card {
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px 14px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.meta-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.meta-label {
    font-size: 0.72rem;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 600;
}

.meta-value {
    font-size: 0.95rem;
    color: var(--primary);
    font-weight: 700;
}

.hero-description {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 32px;
    font-style: italic;
}

.hero-cta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 32px;
    background: var(--brand-bg);
    color: var(--on-brand);
    text-decoration: none;
    border-radius: 100px;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.2s ease;
    box-shadow: var(--shadow);
}

.hero-cta:hover {
    background: var(--secondary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.hero-cta svg {
    transition: transform 0.2s ease;
}

.hero-cta:hover svg {
    transform: translateY(3px);
}

/* ============================ SECTIONS ============================ */

.section {
    max-width: var(--content-max);
    margin: 0 auto;
    padding: 100px 32px 80px;
    position: relative;
}

.section-number {
    display: inline-block;
    font-size: 0.78rem;
    color: var(--secondary);
    font-weight: 700;
    letter-spacing: 0.16em;
    background: rgba(52, 152, 219, 0.1);
    padding: 6px 14px;
    border-radius: 100px;
    margin-bottom: 14px;
    font-variant-numeric: tabular-nums;
}

.section-title {
    font-size: clamp(1.8rem, 3.5vw, 2.6rem);
    color: var(--primary);
    font-weight: 800;
    letter-spacing: -0.01em;
    line-height: 1.2;
    margin-bottom: 24px;
    padding-bottom: 18px;
    border-bottom: 2px solid var(--border);
}

.section h3 {
    font-size: 1.35rem;
    color: var(--primary);
    font-weight: 700;
    margin: 36px 0 16px;
    line-height: 1.3;
}

.section h4 {
    font-size: 1.05rem;
    color: var(--primary);
    font-weight: 700;
    margin-bottom: 8px;
}

.section p {
    margin-bottom: 16px;
    color: var(--text);
}

.section p.lead {
    font-size: 1.1rem;
    color: var(--text);
    line-height: 1.7;
    margin-bottom: 24px;
}

.section ul,
.section ol {
    margin: 12px 0 20px 24px;
    color: var(--text);
}

.section li {
    margin-bottom: 6px;
}

.section a {
    color: var(--secondary-dark);
    text-decoration: none;
    font-weight: 500;
}

.section a:hover {
    text-decoration: underline;
}

/* ============================ CODE ============================ */

code {
    font-family: "Cascadia Code", "Consolas", "Monaco", "Courier New", monospace;
    font-size: 0.88em;
    background: var(--code-bg);
    color: var(--primary-dark);
    padding: 2px 7px;
    border-radius: 5px;
    border: 1px solid var(--code-border);
    font-weight: 500;
}

pre {
    background: var(--code-block-bg);
    color: var(--code-text);
    padding: 22px 24px;
    border-radius: var(--radius);
    overflow-x: auto;
    margin: 20px 0;
    font-size: 0.86rem;
    line-height: 1.6;
    box-shadow: var(--shadow);
    position: relative;
}

pre code {
    background: transparent;
    color: inherit;
    border: none;
    padding: 0;
    font-size: inherit;
}

.section pre {
    margin: 20px 0 28px;
}

/* ============================ LISTS ============================ */

.checklist {
    list-style: none;
    margin-left: 0 !important;
}

.checklist li {
    position: relative;
    padding-left: 32px;
    margin-bottom: 10px;
    line-height: 1.6;
}

.checklist li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 7px;
    width: 18px;
    height: 18px;
    background: var(--secondary);
    border-radius: 50%;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'><polyline points='20 6 9 17 4 12'></polyline></svg>");
    background-repeat: no-repeat;
    background-position: center;
}

.numbered-list {
    counter-reset: nlist;
    list-style: none;
    margin-left: 0 !important;
}

.numbered-list li {
    counter-increment: nlist;
    position: relative;
    padding-left: 44px;
    margin-bottom: 12px;
    line-height: 1.6;
}

.numbered-list li::before {
    content: counter(nlist);
    position: absolute;
    left: 0;
    top: -1px;
    width: 30px;
    height: 30px;
    background: var(--brand-bg);
    color: var(--on-brand);
    border-radius: 50%;
    font-weight: 700;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-variant-numeric: tabular-nums;
}

.step-list {
    counter-reset: slist;
    list-style: none;
    margin-left: 0 !important;
}

.step-list li {
    counter-increment: slist;
    position: relative;
    padding: 14px 18px 14px 56px;
    margin-bottom: 10px;
    line-height: 1.6;
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-left: 3px solid var(--secondary);
    border-radius: var(--radius-sm);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.step-list li:hover {
    transform: translateX(3px);
    box-shadow: var(--shadow-sm);
}

.step-list li::before {
    content: counter(slist);
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 28px;
    height: 28px;
    background: var(--secondary);
    color: white;
    border-radius: 6px;
    font-weight: 700;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-variant-numeric: tabular-nums;
}

.tool-list {
    list-style: none;
    margin-left: 0 !important;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 12px;
}

.tool-list li {
    background: var(--bg-alt);
    border: 1px solid var(--border);
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    margin-bottom: 0;
    transition: border-color 0.15s ease;
}

.tool-list li:hover {
    border-color: var(--secondary);
}

.result-list,
.index-list {
    list-style: none;
    margin-left: 0 !important;
}

.result-list li,
.index-list li {
    position: relative;
    padding-left: 28px;
    margin-bottom: 10px;
    line-height: 1.6;
}

.result-list li::before,
.index-list li::before {
    content: "→";
    position: absolute;
    left: 0;
    top: 0;
    color: var(--secondary);
    font-weight: 700;
    font-size: 1.1rem;
}

/* ============================ ROLE CARDS ============================ */

.role-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 16px;
}

.role-card {
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 26px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.role-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow);
}

.role-icon {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
    color: white;
}

.role-icon-user {
    background: linear-gradient(135deg, var(--secondary), var(--secondary-dark));
}

.role-icon-admin {
    background: linear-gradient(135deg, var(--brand-bg), var(--brand-bg-dark));
}

.role-card h4 {
    margin-bottom: 8px;
    font-size: 1.15rem;
}

.role-card p {
    color: var(--text-muted);
    margin: 0;
    font-size: 0.95rem;
}

/* ============================ TWO COL ============================ */

.two-col {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin: 20px 0;
}

.objective-card,
.info-card {
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
}

.objective-card h3 {
    margin-top: 0;
    color: var(--primary);
    padding-bottom: 12px;
    border-bottom: 2px solid var(--secondary);
    margin-bottom: 16px;
}

.info-card {
    border-top: 4px solid var(--secondary);
}

.info-card h4 {
    color: var(--secondary-dark);
    margin-bottom: 12px;
    font-size: 1.1rem;
}

.info-card p {
    margin-bottom: 8px;
    font-size: 0.92rem;
}

.info-card-warning {
    border-top-color: var(--warning);
}

.info-card-warning h4 {
    color: var(--warning);
}

.info-card-success {
    border-top-color: var(--success);
}

.info-card-success h4 {
    color: var(--success);
}

/* ============================ TIER ============================ */

.tier-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 18px;
    margin: 28px 0;
}

.tier-card {
    background: var(--bg-alt);
    border-radius: var(--radius);
    padding: 24px;
    border-top: 5px solid;
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.tier-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.tier-presentation {
    border-top-color: var(--secondary);
}

.tier-application {
    border-top-color: var(--primary);
}

.tier-data {
    border-top-color: var(--success);
}

.tier-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: var(--text-light);
    font-weight: 700;
    margin-bottom: 6px;
}

.tier-card h3 {
    margin: 0 0 6px;
    font-size: 1.3rem;
}

.tier-tech {
    color: var(--secondary-dark);
    font-weight: 600;
    margin-bottom: 16px;
    font-size: 0.92rem;
}

.tier-card ul {
    margin: 0 0 16px 18px;
    font-size: 0.9rem;
}

.tier-card ul li {
    margin-bottom: 4px;
}

.tier-role {
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.6;
    margin: 0;
    padding-top: 14px;
    border-top: 1px dashed var(--border);
}

/* ============================ CALLOUT ============================ */

.callout {
    padding: 18px 22px;
    margin: 24px 0;
    border-radius: var(--radius);
    border-left: 4px solid;
    background: var(--bg-alt);
    line-height: 1.65;
}

.callout strong {
    color: var(--primary);
}

.callout-info {
    background: linear-gradient(135deg, rgba(52, 152, 219, 0.06), rgba(52, 152, 219, 0.02));
    border-left-color: var(--secondary);
}

.callout-success {
    background: linear-gradient(135deg, rgba(21, 128, 61, 0.06), rgba(21, 128, 61, 0.02));
    border-left-color: var(--success);
}

.callout-warning {
    background: linear-gradient(135deg, rgba(243, 156, 18, 0.06), rgba(243, 156, 18, 0.02));
    border-left-color: var(--warning);
}

.callout-final {
    background: linear-gradient(135deg, rgba(44, 62, 80, 0.04), rgba(52, 152, 219, 0.04));
    border-left-color: var(--primary);
    padding: 24px 28px;
}

.callout-final h4 {
    color: var(--primary);
    margin-bottom: 8px;
    font-size: 1.1rem;
}

.callout-final p {
    margin: 0;
}

/* ============================ HTTP EXCHANGE ============================ */

.http-exchange {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 18px;
    margin: 24px 0;
}

.http-card {
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.http-card-header {
    padding: 12px 18px;
    background: var(--code-bg);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.http-badge {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    padding: 4px 10px;
    border-radius: 4px;
    color: white;
}

.http-badge-req {
    background: var(--secondary);
}

.http-badge-res {
    background: var(--success);
}

.http-direction {
    font-size: 0.78rem;
    color: var(--text-muted);
    font-family: "Cascadia Code", "Consolas", monospace;
}

.http-card pre {
    margin: 0;
    border-radius: 0;
    box-shadow: none;
}

/* ============================ TABLE ============================ */

.table-wrapper {
    overflow-x: auto;
    margin: 18px 0 28px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--bg-alt);
    box-shadow: var(--shadow-sm);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.92rem;
}

.data-table thead {
    background: var(--brand-bg);
    color: var(--on-brand);
}

.data-table th {
    padding: 14px 16px;
    text-align: left;
    font-weight: 600;
    font-size: 0.85rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.data-table td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}

.data-table tbody tr:last-child td {
    border-bottom: none;
}

.data-table tbody tr:hover {
    background: var(--bg);
}

.data-table code {
    font-size: 0.82rem;
}

.http-method {
    display: inline-block;
    padding: 3px 9px;
    border-radius: 4px;
    color: white;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    font-family: "Cascadia Code", "Consolas", monospace;
}

.http-method-get {
    background: var(--secondary);
}

.http-method-post {
    background: var(--success);
}

.http-method-put {
    background: var(--warning);
}

.http-method-delete {
    background: var(--error);
}

.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 100px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-public {
    background: rgba(108, 117, 125, 0.12);
    color: #495057;
}

.badge-user {
    background: rgba(52, 152, 219, 0.12);
    color: var(--secondary-dark);
}

.badge-admin {
    background: rgba(44, 62, 80, 0.12);
    color: var(--primary);
}

/* ============================ STATUS GRID ============================ */

.status-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 14px;
    margin: 20px 0 28px;
}

.status-card {
    background: var(--bg-alt);
    border-radius: var(--radius);
    padding: 18px 16px;
    border-left: 4px solid;
    box-shadow: var(--shadow-sm);
    transition: transform 0.15s ease;
}

.status-card:hover {
    transform: translateY(-2px);
}

.status-success {
    border-left-color: var(--success);
}

.status-warning {
    border-left-color: var(--warning);
}

.status-error {
    border-left-color: var(--error);
}

.status-code {
    font-size: 2rem;
    font-weight: 800;
    line-height: 1;
    letter-spacing: -0.02em;
    font-variant-numeric: tabular-nums;
    margin-bottom: 4px;
}

.status-success .status-code {
    color: var(--success);
}

.status-warning .status-code {
    color: var(--warning);
}

.status-error .status-code {
    color: var(--error);
}

.status-name {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 8px;
}

.status-card p {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin: 0;
    line-height: 1.5;
}

/* ============================ DB CARDS ============================ */

.db-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
    margin: 20px 0 28px;
}

.db-card {
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 22px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.db-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow);
}

.db-card h4 {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--primary);
    font-size: 1.05rem;
    margin-bottom: 4px;
}

.db-icon {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, var(--secondary), var(--secondary-dark));
    color: white;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 0.95rem;
    font-family: "Cascadia Code", monospace;
}

.db-desc {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-bottom: 14px;
    font-style: italic;
}

.db-card ul {
    list-style: none;
    margin: 0 !important;
}

.db-card li {
    padding: 5px 0;
    border-bottom: 1px dashed var(--border-light);
    font-size: 0.88rem;
    color: var(--text);
}

.db-card li:last-child {
    border-bottom: none;
}

/* ============================ TECH ============================ */

.tech-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 14px;
    margin: 20px 0 28px;
}

.tech-card {
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.tech-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.tech-badge {
    display: inline-block;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    padding: 4px 10px;
    border-radius: 100px;
    margin-bottom: 12px;
}

.tech-frontend {
    background: rgba(52, 152, 219, 0.12);
    color: var(--secondary-dark);
}

.tech-backend {
    background: rgba(44, 62, 80, 0.12);
    color: var(--primary);
}

.tech-data {
    background: rgba(21, 128, 61, 0.12);
    color: var(--success);
}

.tech-card h4 {
    font-size: 1.1rem;
    margin-bottom: 8px;
}

.tech-card p {
    font-size: 0.88rem;
    color: var(--text-muted);
    margin: 0;
    line-height: 1.55;
}

/* ============================ FEATURE ============================ */

.feature {
    display: grid;
    grid-template-columns: 80px 1fr;
    gap: 24px;
    margin: 28px 0;
    padding: 24px;
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.feature:hover {
    transform: translateX(4px);
    box-shadow: var(--shadow);
}

.feature-number {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--secondary);
    line-height: 1;
    padding-top: 4px;
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.02em;
}

.feature-body h3 {
    margin-top: 0;
    margin-bottom: 12px;
}

.feature-body ul {
    margin-bottom: 0;
}

.feature-body p {
    margin-bottom: 12px;
}

/* ============================ SECURITY GRID ============================ */

.security-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 14px;
    margin: 20px 0 28px;
}

.security-card {
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    border-top: 4px solid var(--error);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.security-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
    border-top-color: var(--success);
}

.security-risk {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--error);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px dashed var(--border);
}

.security-card:hover .security-risk {
    color: var(--success);
}

.security-card p {
    font-size: 0.88rem;
    color: var(--text);
    margin: 0;
    line-height: 1.6;
}

/* ============================ PROBLEM ============================ */

.problem {
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin: 18px 0;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: box-shadow 0.2s ease;
}

.problem:hover {
    box-shadow: var(--shadow);
}

.problem-header {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 18px 24px;
    background: linear-gradient(135deg, rgba(231, 76, 60, 0.06), rgba(231, 76, 60, 0.02));
    border-bottom: 1px solid var(--border);
}

.problem-num {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    background: var(--error);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 0.95rem;
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.02em;
}

.problem-header h3 {
    margin: 0;
    font-size: 1.1rem;
    color: var(--primary);
    line-height: 1.3;
}

.problem-body {
    padding: 22px 24px;
}

.problem-section {
    margin-bottom: 12px;
    line-height: 1.7;
    color: var(--text);
}

.problem-section:last-child {
    margin-bottom: 0;
}

.problem-section strong {
    color: var(--primary);
}

.problem-solution {
    background: linear-gradient(135deg, rgba(21, 128, 61, 0.06), rgba(21, 128, 61, 0.02));
    padding: 14px 18px;
    border-radius: var(--radius-sm);
    border-left: 3px solid var(--success);
    margin-top: 8px;
}

.problem-solution strong {
    color: var(--success);
}

/* ============================ FUTURE ============================ */

.future-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 14px;
    margin: 20px 0;
}

.future-card {
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 22px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.future-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow);
}

.future-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--secondary), var(--secondary-dark));
    color: white;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 0.95rem;
    margin-bottom: 14px;
    font-family: "Cascadia Code", monospace;
    letter-spacing: -0.04em;
}

.future-card h4 {
    margin-bottom: 8px;
    font-size: 1rem;
}

.future-card p {
    font-size: 0.88rem;
    color: var(--text-muted);
    margin: 0;
    line-height: 1.55;
}

/* ============================ FILE TREE ============================ */

.file-tree {
    background: var(--code-block-bg);
    color: var(--code-text);
    font-family: "Cascadia Code", "Consolas", monospace;
    font-size: 0.85rem;
    line-height: 1.7;
}

/* ============================ IMAGE BLOCKS ============================ */

.image-block {
    margin: 28px 0;
    text-align: center;
    padding: 0;
}

.image-block > img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
    border-radius: var(--radius);
}

.image-block > figcaption {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 12px;
    font-style: italic;
    line-height: 1.5;
}

.screenshot > img {
    border: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
    background: white;
}

.diagram-image {
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px 24px 18px;
    box-shadow: var(--shadow-sm);
    margin: 28px 0;
    text-align: center;
}

.diagram-image .diagram-title {
    font-size: 0.85rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 600;
    margin-bottom: 18px;
    padding-bottom: 12px;
    border-bottom: 1px dashed var(--border);
}

.diagram-image > img {
    max-width: 100%;
    height: auto;
    margin: 0 auto;
    display: block;
    border-radius: 0;
}

.diagram-image > figcaption {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 14px;
    font-style: italic;
}

.code-screenshot {
    background: var(--code-block-bg);
    border-radius: var(--radius);
    padding: 14px;
    box-shadow: var(--shadow);
    overflow: hidden;
    margin: 22px 0;
    text-align: center;
}

.code-screenshot > img {
    max-width: 100%;
    height: auto;
    display: block;
    border-radius: 6px;
    margin: 0 auto;
}

.code-screenshot > figcaption {
    color: rgba(255, 255, 255, 0.65);
    font-size: 0.78rem;
    text-align: center;
    margin-top: 12px;
    font-style: italic;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.http-card .code-screenshot {
    margin: 0;
    border-radius: 0;
    box-shadow: none;
}

.image-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 18px;
    margin: 24px 0 28px;
}

.image-grid figure {
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    margin: 0;
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.image-grid figure:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.image-grid img {
    width: 100%;
    height: auto;
    display: block;
}

.image-grid figcaption {
    padding: 10px 14px;
    font-size: 0.82rem;
    color: var(--text-muted);
    text-align: center;
    border-top: 1px solid var(--border);
    background: var(--bg);
    font-style: italic;
}

.mockup-showcase {
    margin: 28px 0;
    background: var(--bg-gradient);
    border-radius: var(--radius-lg);
    padding: 32px 24px;
    text-align: center;
    border: 1px solid var(--border);
    position: relative;
    overflow: hidden;
}

.mockup-showcase::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        radial-gradient(circle at 30% 40%, rgba(52, 152, 219, 0.06), transparent 50%),
        radial-gradient(circle at 70% 60%, rgba(44, 62, 80, 0.04), transparent 50%);
    pointer-events: none;
}

.mockup-showcase img {
    position: relative;
    max-width: 100%;
    height: auto;
    max-height: 520px;
    margin: 0 auto;
    display: block;
    filter: drop-shadow(0 24px 48px rgba(44, 62, 80, 0.18));
}

.mockup-showcase figcaption {
    position: relative;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 18px;
    font-style: italic;
}

.mobile-mockup-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 24px;
    margin: 24px 0;
    align-items: center;
    justify-items: center;
    background: var(--bg-gradient);
    border-radius: var(--radius-lg);
    padding: 32px 20px;
    border: 1px solid var(--border);
}

.mobile-mockup-grid img {
    max-width: 100%;
    max-height: 460px;
    height: auto;
    filter: drop-shadow(0 16px 36px rgba(44, 62, 80, 0.18));
}

/* ============================ FOOTER ============================ */

.site-footer {
    background: var(--footer-bg);
    color: rgba(255, 255, 255, 0.85);
    padding: 50px 32px 24px;
    margin-top: 60px;
}

.footer-content {
    max-width: var(--content-max);
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 32px;
    padding-bottom: 32px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-section h4 {
    color: white;
    font-size: 1rem;
    margin-bottom: 12px;
    font-weight: 700;
}

.footer-section p {
    font-size: 0.88rem;
    margin-bottom: 6px;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.75);
}

.footer-bottom {
    max-width: var(--content-max);
    margin: 0 auto;
    padding-top: 20px;
    text-align: center;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.6);
}

.footer-school {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 10px;
}

.footer-school img {
    width: 64px;
    height: 64px;
    object-fit: contain;
    background: white;
    padding: 6px;
    border-radius: 8px;
    flex-shrink: 0;
}

.footer-qr {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.footer-qr img {
    width: 120px;
    height: 120px;
    background: white;
    padding: 8px;
    border-radius: 10px;
}

.footer-qr small {
    font-size: 0.72rem;
    color: rgba(255, 255, 255, 0.6);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 600;
}

/* ============================ FAB GROUP ============================ */

.fab-group {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 95;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.fab {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: var(--bg-alt);
    color: var(--primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow);
    transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.fab:hover {
    background: var(--secondary);
    color: var(--on-brand);
    border-color: var(--secondary);
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

.fab:active {
    transform: translateY(-1px);
}

.fab svg {
    width: 20px;
    height: 20px;
}

.fab .fab-icon-sun,
[data-theme="dark"] .fab .fab-icon-moon {
    display: none;
}

[data-theme="dark"] .fab .fab-icon-sun {
    display: block;
}

.scroll-top {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: none;
    background: var(--brand-bg);
    color: var(--on-brand);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-lg);
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.25s ease, transform 0.25s ease, background 0.18s ease, color 0.18s ease;
    pointer-events: none;
    margin-top: 6px;
}

.scroll-top.visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.scroll-top:hover {
    background: var(--secondary);
    color: var(--on-brand);
    transform: translateY(-4px);
}

/* ============================ COPY BUTTON ============================ */

.copy-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 6px;
    padding: 5px 10px;
    font-size: 0.72rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
    font-family: inherit;
    letter-spacing: 0.04em;
    opacity: 0;
}

pre:hover .copy-btn {
    opacity: 1;
}

.copy-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    color: white;
    border-color: rgba(255, 255, 255, 0.25);
}

.copy-btn.copied {
    background: var(--success);
    color: white;
    border-color: var(--success);
    opacity: 1;
}

/* ============================ RESPONSIVE ============================ */

@media (max-width: 1024px) {
    :root {
        --sidebar-width: 240px;
    }

    .section {
        padding: 80px 28px 60px;
    }
}

@media (max-width: 768px) {
    .menu-toggle {
        display: flex;
    }

    .sidebar {
        transform: translateX(-100%);
        box-shadow: var(--shadow-xl);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .content {
        margin-left: 0;
    }

    .hero {
        padding: 80px 20px 60px;
        min-height: auto;
    }

    .hero-logo {
        max-width: 200px;
        margin-bottom: 24px;
    }

    .hero-meta {
        grid-template-columns: repeat(2, 1fr);
    }

    .section {
        padding: 60px 20px 50px;
    }

    .section-title {
        font-size: 1.7rem;
    }

    .feature {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .feature:hover {
        transform: none;
    }

    .feature-number {
        font-size: 1.2rem;
    }

    .problem-header {
        padding: 14px 18px;
    }

    .problem-body {
        padding: 18px;
    }

    .site-footer {
        padding: 40px 20px 20px;
    }

    pre {
        font-size: 0.78rem;
        padding: 16px;
    }

    .scroll-top {
        bottom: 16px;
        right: 16px;
        width: 42px;
        height: 42px;
    }
}

@media (max-width: 480px) {
    .hero-meta {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }

    .meta-card {
        padding: 14px 10px;
    }

    .meta-value {
        font-size: 0.85rem;
    }
}

/* ============================ SLIDE DECK ============================ */

.deck {
    padding: 40px 24px 80px;
    background:
        radial-gradient(circle at 0% 0%, rgba(52, 152, 219, 0.05), transparent 35%),
        radial-gradient(circle at 100% 100%, rgba(44, 62, 80, 0.04), transparent 35%);
    min-height: 100vh;
}

[data-theme="dark"] .deck {
    background:
        radial-gradient(circle at 0% 0%, rgba(96, 165, 250, 0.06), transparent 35%),
        radial-gradient(circle at 100% 100%, rgba(241, 245, 249, 0.03), transparent 35%);
}

.slide {
    width: 100%;
    max-width: 1280px;
    aspect-ratio: 16 / 9;
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    margin: 36px auto;
    position: relative;
    overflow: hidden;
    container-type: inline-size;
    transition: box-shadow 0.25s ease, transform 0.25s ease, border-color 0.25s ease;
}

.slide:hover {
    box-shadow: var(--shadow-xl);
    transform: translateY(-2px);
}

/* ====================== Slide type: INDEX ====================== */

.slide--index .slide-body {
    justify-content: center;
}

.slide--index .index-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1cqw 1.8cqw;
    width: 100%;
    margin: 0;
}

.slide--index .index-item {
    display: flex;
    align-items: center;
    gap: 1.2cqw;
    padding: 0.85cqw 1.2cqw;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 0.75cqw;
    box-shadow: var(--shadow-sm);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.slide--index .index-item:hover {
    border-color: var(--secondary-light);
    box-shadow: var(--shadow);
}

.slide--index .index-num {
    flex-shrink: 0;
    min-width: 2.4cqw;
    font-size: 1.15cqw;
    font-weight: 800;
    color: var(--on-brand);
    background: var(--brand-bg);
    text-align: center;
    padding: 0.35cqw 0.55cqw;
    border-radius: 0.45cqw;
    font-variant-numeric: tabular-nums;
}

.slide--index .index-label {
    font-size: 1.15cqw;
    line-height: 1.35;
    color: var(--text);
    font-weight: 500;
}

[data-theme="dark"] .slide--index .index-item {
    background: rgba(30, 41, 59, 0.6);
}

[data-theme="dark"] .slide--index .index-item:hover {
    border-color: var(--secondary);
}

/* ====================== Slide: INTRODUZIONE (mockup sx / testo / mockup dx) ====================== */

.slide--intro .slide-body {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr) minmax(0, 1fr);
    align-items: center;
    gap: 2cqw;
}

.slide--intro .intro-text {
    display: flex;
    flex-direction: column;
    gap: 1cqw;
    min-width: 0;
}

.slide--intro .intro-text .lead {
    font-size: 1.15cqw;
    line-height: 1.45;
}

.slide--intro .intro-text .checklist li {
    font-size: 1.05cqw;
}

.slide--intro .intro-text .data-table {
    font-size: 0.95cqw;
}

.slide--intro .intro-mockup {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5cqw;
    margin: 0;
    min-width: 0;
    min-height: 0;
}

.slide--intro .intro-mockup img {
    width: 100%;
    max-height: 52cqh;
    object-fit: contain;
    filter: drop-shadow(0 0.8cqw 1.6cqw rgba(44, 62, 80, 0.2));
}

.slide--intro .intro-mockup--right img {
    max-height: 38cqh;
    max-width: 72%;
}

.slide--intro .mockup-caption {
    font-size: 0.85cqw;
    color: var(--text-muted);
    text-align: center;
    margin: 0;
    font-style: italic;
}

/* ====================== Slide: OBIETTIVI ====================== */

.slide--obiettivi .objectives-layout {
    gap: 1.1cqw;
}

.slide--obiettivi .objectives-lead {
    margin: 0;
    padding: 0.75cqw 1.2cqw;
    font-size: 1.15cqw;
    line-height: 1.4;
    font-weight: 500;
    color: var(--text);
    background: var(--bg);
    border: 1px solid var(--border);
    border-left: 0.35cqw solid var(--secondary);
    border-radius: 0.6cqw;
    box-shadow: var(--shadow-sm);
}

.slide--obiettivi .objectives-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.4cqw;
    flex: 1;
    min-height: 0;
    align-items: stretch;
}

.slide--obiettivi .objective-card {
    display: flex;
    flex-direction: column;
    min-height: 0;
    padding: 0;
    border-radius: 0.9cqw;
    border: 1px solid var(--border);
    background: var(--bg-alt);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.slide--obiettivi .objective-card--func {
    border-top: 0.35cqw solid var(--secondary);
}

.slide--obiettivi .objective-card--tech {
    border-top: 0.35cqw solid var(--success);
}

.slide--obiettivi .objective-card__head {
    display: flex;
    align-items: center;
    gap: 1cqw;
    padding: 1cqw 1.2cqw;
    background: var(--bg-gradient);
    border-bottom: 1px solid var(--border);
}

.slide--obiettivi .objective-card__icon {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 3.2cqw;
    height: 3.2cqw;
    border-radius: 0.75cqw;
    color: var(--on-brand);
}

.slide--obiettivi .objective-card--func .objective-card__icon {
    background: linear-gradient(135deg, var(--secondary), var(--secondary-dark));
    box-shadow: 0 0.4cqw 1cqw rgba(52, 152, 219, 0.35);
}

.slide--obiettivi .objective-card--tech .objective-card__icon {
    background: linear-gradient(135deg, var(--success-light), var(--success));
    box-shadow: 0 0.4cqw 1cqw rgba(21, 128, 61, 0.3);
}

.slide--obiettivi .objective-card__icon svg {
    width: 1.65cqw;
    height: 1.65cqw;
}

.slide--obiettivi .objective-card__titles {
    min-width: 0;
}

.slide--obiettivi .objective-card__titles h3 {
    margin: 0;
    padding: 0;
    border: none;
    font-size: 1.35cqw;
    line-height: 1.25;
    color: var(--primary);
}

.slide--obiettivi .objective-card__badge {
    display: inline-block;
    margin-top: 0.25cqw;
    font-size: 0.8cqw;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.slide--obiettivi .objective-card--func .objective-card__badge {
    color: var(--secondary-dark);
}

.slide--obiettivi .objective-card--tech .objective-card__badge {
    color: var(--success);
}

.slide--obiettivi .objective-list {
    list-style: none;
    margin: 0;
    padding: 0.6cqw 0.8cqw 0.8cqw;
    flex: 1;
    min-height: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: 0.35cqw;
}

.slide--obiettivi .objective-list li {
    position: relative;
    margin: 0;
    padding: 0.45cqw 0.55cqw 0.45cqw 1.5cqw;
    font-size: 0.98cqw;
    line-height: 1.35;
    color: var(--text);
    background: var(--bg);
    border: 1px solid var(--border-light);
    border-radius: 0.5cqw;
    transition: border-color 0.2s ease, background-color 0.2s ease;
}

.slide--obiettivi .objective-list li::before {
    content: "";
    position: absolute;
    left: 0.55cqw;
    top: 50%;
    transform: translateY(-50%);
    width: 0.45cqw;
    height: 0.45cqw;
    border-radius: 50%;
    background: var(--secondary);
}

.slide--obiettivi .objective-card--tech .objective-list li::before {
    background: var(--success);
}

.slide--obiettivi .objective-list li:hover {
    border-color: var(--secondary-light);
    background: var(--bg-alt);
}

.slide--obiettivi .objective-card--tech .objective-list li:hover {
    border-color: var(--success-light);
}

.slide--obiettivi .objective-list li strong {
    color: var(--primary);
    font-weight: 700;
}

[data-theme="dark"] .slide--obiettivi .objectives-lead {
    background: rgba(30, 41, 59, 0.55);
}

[data-theme="dark"] .slide--obiettivi .objective-card {
    background: rgba(30, 41, 59, 0.45);
}

[data-theme="dark"] .slide--obiettivi .objective-card__head {
    background: rgba(15, 23, 42, 0.5);
}

[data-theme="dark"] .slide--obiettivi .objective-list li {
    background: rgba(15, 23, 42, 0.35);
    border-color: var(--border);
}

[data-theme="dark"] .slide--obiettivi .objective-list li:hover {
    background: rgba(30, 41, 59, 0.65);
}

/* ====================== Slide: ARCHITETTURA 3-TIER ====================== */

.slide--arch .slide-header {
    margin-bottom: 0.4cqw;
}

.slide--arch .arch-layout {
    display: flex;
    flex-direction: column;
    gap: 0.45cqw;
    flex: 1;
    min-height: 0;
}

.slide--arch .arch-lead {
    margin: 0;
    font-size: 1.08cqw;
    line-height: 1.4;
    flex-shrink: 0;
}

.slide--arch .tier-grid--arch {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.5cqw;
    margin: 0;
    flex: 1;
    min-height: 0;
    align-items: stretch;
}

.slide--arch .tier-card {
    display: flex;
    flex-direction: column;
    min-height: 0;
    padding: 0.55cqw 0.65cqw;
    border-radius: 0.55cqw;
    border-top-width: 0.28cqw;
    box-shadow: var(--shadow-sm);
}

.slide--arch .tier-label {
    font-size: 0.72cqw;
    margin-bottom: 0.2cqw;
    line-height: 1.2;
}

.slide--arch .tier-desc {
    margin: 0 0 0.25cqw;
    font-size: 0.88cqw;
    line-height: 1.35;
    color: var(--text);
}

.slide--arch .tier-spec,
.slide--arch .tier-tasks {
    margin: 0 0 0.2cqw;
    padding-left: 1cqw;
    font-size: 0.8cqw;
    line-height: 1.34;
}

.slide--arch .tier-spec {
    color: var(--text-muted);
}

.slide--arch .tier-spec li,
.slide--arch .tier-tasks li {
    margin-bottom: 0.12cqw;
}

.slide--arch .tier-spec li:last-child,
.slide--arch .tier-tasks li:last-child {
    margin-bottom: 0;
}

.slide--arch .tier-tasks-title {
    margin: 0.1cqw 0 0.15cqw;
    font-size: 0.76cqw;
    font-weight: 700;
    color: var(--primary);
    letter-spacing: 0.03em;
}

.slide--arch .tier-tasks {
    margin-bottom: 0;
    color: var(--text);
}

.slide--arch .tier-spec code,
.slide--arch .tier-desc code {
    font-size: 0.76cqw;
}

.slide--arch .arch-footer {
    margin: 0;
    font-size: 0.92cqw;
    line-height: 1.38;
    color: var(--text-muted);
    flex-shrink: 0;
    padding: 0.35cqw 0.5cqw;
    background: var(--bg);
    border-radius: 0.45cqw;
    border-left: 0.25cqw solid var(--secondary);
}

.slide--arch .arch-diagram {
    margin: 0;
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 0.45cqw 0.8cqw;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 0.55cqw;
    box-shadow: var(--shadow-sm);
}

.slide--arch .arch-diagram img {
    display: block;
    width: auto;
    max-width: 100%;
    max-height: 16.5cqh;
    height: auto;
    object-fit: contain;
}

[data-theme="dark"] .slide--arch .arch-diagram {
    background: rgba(15, 23, 42, 0.35);
}

/* ====================== Slide: CLIENT-SERVER ====================== */

/* --- Slide flusso client-server (slide--cs-flow) --- */

.slide--cs-flow .slide-header {
    margin-bottom: 0.3cqw;
}

.slide--cs-flow .cs-layout {
    display: flex;
    flex-direction: column;
    gap: 0.5cqw;
    flex: 1;
    min-height: 0;
}

.slide--cs-flow .cs-lead {
    margin: 0;
    font-size: 1.02cqw;
    line-height: 1.42;
    padding: 0.55cqw 0.8cqw;
    background: var(--bg);
    border: 1px solid var(--border);
    border-left: 0.32cqw solid var(--secondary);
    border-radius: 0.5cqw;
    flex-shrink: 0;
}

.slide--cs-flow .cs-main--flow {
    display: grid;
    grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.82fr);
    gap: 0.7cqw;
    flex: 1 1 auto;
    min-height: 0;
    align-items: stretch;
}

.slide--cs-flow .cs-flow {
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 0;
    padding: 0.55cqw 0.65cqw;
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-radius: 0.6cqw;
    box-shadow: var(--shadow-sm);
}

.slide--cs-flow .cs-section-title {
    margin: 0 0 0.4cqw;
    padding-bottom: 0.3cqw;
    font-size: 0.98cqw;
    font-weight: 700;
    color: var(--primary);
    border-bottom: 1px solid var(--border);
}

.slide--cs-flow .cs-step-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.38cqw;
    margin: 0;
    flex: 1 1 auto;
    min-height: 0;
    counter-reset: slist;
    list-style: none;
    align-content: start;
}

.slide--cs-flow .slide-body .cs-step-list li,
.slide--cs-flow .cs-step-list li {
    display: flex;
    align-items: flex-start;
    gap: 0.5cqw;
    margin: 0;
    padding: 0.45cqw 0.55cqw;
    font-size: 0.84cqw;
    line-height: 1.36;
    background: var(--bg);
    border: 1px solid var(--border-light);
    border-left: 0.24cqw solid var(--secondary);
    border-radius: 0.45cqw;
    box-shadow: var(--shadow-sm);
}

.slide--cs-flow .slide-body .cs-step-list li::before,
.slide--cs-flow .cs-step-list li::before {
    content: counter(slist);
    position: static;
    top: auto;
    left: auto;
    transform: none;
    flex-shrink: 0;
    width: 1.5cqw;
    height: 1.5cqw;
    min-width: 1.5cqw;
    font-size: 0.74cqw;
    border-radius: 0.38cqw;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--secondary), var(--secondary-dark));
    color: #fff;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    box-shadow: 0 0.15cqw 0.4cqw rgba(52, 152, 219, 0.35);
}

.slide--cs-flow .cs-step-list li:hover {
    transform: none;
    border-color: var(--secondary-light);
}

.slide--cs-flow .cs-step-list li:nth-child(7) {
    grid-column: 1 / -1;
}

.slide--cs-flow .cs-step-list li code {
    font-size: 0.8cqw;
}

.slide--cs-flow .cs-sequence {
    margin: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.35cqw;
    min-height: 0;
    height: 100%;
    padding: 0.55cqw 0.65cqw 0.45cqw;
    background: #f8fafd;
    border: 1px solid var(--border);
    border-radius: 0.6cqw;
    box-shadow: var(--shadow);
}

.slide--cs-flow .cs-sequence img {
    width: 100%;
    max-height: calc(100% - 1.8cqw);
    flex: 1 1 auto;
    min-height: 12cqh;
    object-fit: contain;
    background: #ffffff;
    padding: 0.55cqw;
    border-radius: 0.45cqw;
    border: 1px solid #e1e8ed;
}

.slide--cs-flow .cs-sequence figcaption {
    margin: 0;
    font-size: 0.78cqw;
    font-weight: 600;
    color: var(--text-muted);
    font-style: normal;
    text-align: center;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    flex-shrink: 0;
}

[data-theme="dark"] .slide--cs-flow .cs-lead {
    background: rgba(30, 41, 59, 0.55);
}

[data-theme="dark"] .slide--cs-flow .cs-flow {
    background: rgba(30, 41, 59, 0.4);
}

[data-theme="dark"] .slide--cs-flow .cs-step-list li {
    background: rgba(15, 23, 42, 0.45);
    border-color: var(--border);
}

[data-theme="dark"] .slide--cs-flow .cs-sequence {
    background: #eef2f6;
    border-color: #cbd5e1;
}

[data-theme="dark"] .slide--cs-flow .cs-sequence img {
    background: #ffffff;
    border-color: #e1e8ed;
}

[data-theme="dark"] .slide--cs-flow .cs-sequence figcaption {
    color: #475569;
}

/* --- Slide esempio HTTP (slide--cs-http) --- */

.slide--cs .cs-section-title {
    margin: 0 0 0.35cqw;
    font-size: 0.95cqw;
    font-weight: 700;
    color: var(--primary);
    letter-spacing: 0.02em;
}

.slide--cs .cs-layout {
    display: flex;
    flex-direction: column;
    gap: 0.45cqw;
    flex: 1;
    min-height: 0;
}

.slide--cs-http .cs-layout--http {
    gap: 0.5cqw;
}

.slide--cs-http .cs-section-title {
    flex-shrink: 0;
    font-size: 1cqw;
    margin-bottom: 0.25cqw;
}

.slide--cs-http .cs-http-exchange {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.65cqw;
    margin: 0;
    flex: 1 1 auto;
    min-height: 0;
    align-items: stretch;
}

.slide--cs-http .http-card {
    display: flex;
    flex-direction: column;
    min-height: 0;
    border-radius: 0.55cqw;
    overflow: hidden;
    box-shadow: var(--shadow);
}

.slide--cs-http .http-card--req {
    border-top: 0.28cqw solid var(--secondary);
}

.slide--cs-http .http-card--res {
    border-top: 0.28cqw solid var(--success);
}

.slide--cs-http .http-card-header {
    padding: 0.5cqw 0.7cqw;
    flex-shrink: 0;
}

.slide--cs-http .http-badge {
    font-size: 0.68cqw;
    padding: 0.18cqw 0.5cqw;
    letter-spacing: 0.08em;
}

.slide--cs-http .http-direction {
    font-size: 0.72cqw;
}

.slide--cs-http .http-card .code-screenshot {
    flex: 1 1 auto;
    display: flex;
    align-items: stretch;
    justify-content: center;
    margin: 0;
    padding: 0;
    min-height: 0;
    background: transparent;
    border: none;
    box-shadow: none;
}

.slide--cs-http .http-card .code-screenshot img {
    width: 100%;
    max-width: 100%;
    height: auto;
    max-height: none;
    min-height: 0;
    flex: 1;
    object-fit: contain;
    object-position: center top;
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 0;
}

[data-theme="dark"] .slide--cs .cs-lead {
    background: rgba(30, 41, 59, 0.5);
}

[data-theme="dark"] .slide--cs .cs-sequence {
    background: rgba(15, 23, 42, 0.35);
}

.slide--index .index-item--sub {
    margin-left: 1.2cqw;
    padding: 0.65cqw 1cqw;
    border-style: dashed;
}

.slide--index .index-item--sub .index-num {
    background: var(--secondary);
    font-size: 1cqw;
}

.slide-school-badge {
    position: absolute;
    right: 2.2cqw;
    bottom: 1.8cqw;
    width: 4.2cqw;
    height: auto;
    max-width: 48px;
    max-height: 48px;
    object-fit: contain;
    z-index: 5;
    pointer-events: none;
    opacity: 0.88;
    padding: 0.35cqw;
    border-radius: 0.45cqw;
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

[data-theme="dark"] .slide-school-badge {
    background: rgba(255, 255, 255, 0.95);
    opacity: 0.92;
}

.slide-content {
    position: absolute;
    inset: 0;
    padding: 4.5cqw 5.5cqw;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    gap: 2cqw;
}

.slide-meta {
    position: absolute;
    top: 1.6cqw;
    right: 2cqw;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1cqw;
    color: var(--text-light);
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    font-variant-numeric: tabular-nums;
    z-index: 2;
}

.slide-category {
    color: var(--secondary);
    font-size: 0.95cqw;
}

.slide-number {
    background: var(--brand-bg);
    color: var(--on-brand);
    padding: 0.4cqw 0.9cqw;
    border-radius: 100px;
    letter-spacing: 0.06em;
    font-size: 0.95cqw;
}

.slide-header {
    margin-bottom: 0.5cqw;
    padding-right: 14cqw;
}

.slide-title {
    font-size: 3.2cqw;
    color: var(--primary);
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: -0.01em;
    margin: 0;
    padding: 0 0 1.5cqw;
    border-bottom: 0.2cqw solid var(--border);
    position: relative;
}

.slide-title::after {
    content: "";
    position: absolute;
    bottom: -0.2cqw;
    left: 0;
    width: 5cqw;
    height: 0.2cqw;
    background: var(--secondary);
}

.slide-body {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: 1.5cqw;
    font-size: 1.4cqw;
    line-height: 1.55;
    color: var(--text);
    overflow: hidden;
}

.slide-body p {
    margin: 0;
    font-size: 1.4cqw;
    line-height: 1.55;
}

.slide-body p.lead {
    font-size: 1.6cqw;
    line-height: 1.5;
}

.slide-body ul,
.slide-body ol {
    margin: 0;
    padding-left: 1.6cqw;
    font-size: 1.35cqw;
}

.slide-body ul.checklist,
.slide-body ol.numbered-list,
.slide-body ol.step-list,
.slide-body ul.result-list,
.slide-body ul.index-list {
    padding-left: 0;
}

.slide-body li {
    margin-bottom: 0.6cqw;
    line-height: 1.5;
}

.slide-body h3 {
    font-size: 1.9cqw;
    color: var(--primary);
    margin: 0.6cqw 0 0.4cqw;
    line-height: 1.25;
}

.slide-body h4 {
    font-size: 1.45cqw;
    color: var(--primary);
    margin: 0;
}

.slide-body code {
    font-size: 0.95em;
    padding: 0.1cqw 0.4cqw;
}

.slide-body pre {
    font-size: 1cqw;
    line-height: 1.5;
    padding: 1.5cqw 1.8cqw;
    margin: 0;
    flex-shrink: 1;
    min-height: 0;
}

.slide-body pre code {
    font-size: 1cqw;
}

.slide-body strong {
    color: var(--primary);
}

/* ====================== Slide type: COVER ====================== */

.slide--cover {
    background: var(--bg-gradient);
    border-color: var(--border);
}

.slide--cover .slide-content {
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 4cqw;
}

.slide--cover .cover-logo {
    width: 22cqw;
    height: auto;
    margin-bottom: 2.5cqw;
    filter: drop-shadow(0 1.5cqw 3cqw rgba(44, 62, 80, 0.15));
}

.slide--cover .cover-title {
    font-size: 6cqw;
    font-weight: 800;
    color: var(--primary);
    line-height: 1.05;
    letter-spacing: -0.02em;
    margin-bottom: 1cqw;
}

.slide--cover .cover-subtitle {
    font-size: 1.9cqw;
    color: var(--text-muted);
    line-height: 1.4;
    max-width: 70cqw;
    margin: 0 auto 3cqw;
    font-weight: 400;
}

.slide--cover .cover-meta {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 1.4cqw;
    width: 100%;
    max-width: 75cqw;
    margin-bottom: 2cqw;
}

.slide--cover .cover-meta-card {
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-radius: 1cqw;
    padding: 1.4cqw 1cqw;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4cqw;
    box-shadow: var(--shadow-sm);
}

.slide--cover .cover-meta-label {
    font-size: 0.85cqw;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 600;
}

.slide--cover .cover-meta-value {
    font-size: 1.2cqw;
    color: var(--primary);
    font-weight: 700;
}

.slide--cover .cover-discipline {
    font-size: 1.1cqw;
    color: var(--text-muted);
    font-style: italic;
}

/* ====================== Slide type: TEXT-IMAGE (split) ====================== */

.slide--split .slide-body {
    flex-direction: row;
    align-items: stretch;
    gap: 3cqw;
}

.slide--split .split-text {
    flex: 1 1 50%;
    display: flex;
    flex-direction: column;
    gap: 1.2cqw;
    min-width: 0;
}

.slide--split .split-image {
    flex: 1 1 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
    min-height: 0;
}

.slide--split .split-image img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: white;
    box-shadow: var(--shadow);
}

.slide--split.split-reverse .slide-body {
    flex-direction: row-reverse;
}

/* ====================== Slide type: FULL IMAGE ====================== */

.slide--image .slide-body {
    flex: 1;
    align-items: center;
    justify-content: center;
    min-height: 0;
}

.slide--image .full-image-wrap {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 0;
}

.slide--image img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
}

.slide--image.image-on-bg img {
    background: white;
    padding: 1cqw;
}

/* ====================== Slide type: CALLOUT ====================== */

.slide--callout .slide-body {
    align-items: center;
    justify-content: center;
    text-align: center;
}

.slide--callout .callout-big {
    max-width: 75cqw;
    font-size: 2.2cqw;
    line-height: 1.5;
    color: var(--text);
}

.slide--callout .callout-big strong {
    color: var(--secondary);
}

/* ====================== Slide type: CLOSING ====================== */

.slide--closing {
    background: var(--bg-gradient);
}

.slide--closing .slide-content {
    align-items: center;
    justify-content: center;
    text-align: center;
}

.slide--closing .closing-title {
    font-size: 5.5cqw;
    color: var(--primary);
    font-weight: 800;
    margin-bottom: 1.5cqw;
    line-height: 1;
}

.slide--closing .closing-subtitle {
    font-size: 1.8cqw;
    color: var(--text-muted);
    margin-bottom: 3cqw;
}

.slide--closing .closing-grid {
    display: grid;
    grid-template-columns: auto auto;
    gap: 4cqw;
    align-items: center;
    justify-content: center;
}

.slide--closing .closing-qr {
    background: white;
    border-radius: 1cqw;
    padding: 1cqw;
    box-shadow: var(--shadow-lg);
}

.slide--closing .closing-qr img {
    width: 14cqw;
    height: 14cqw;
    object-fit: contain;
}

.slide--closing .closing-info {
    text-align: left;
    display: flex;
    flex-direction: column;
    gap: 0.8cqw;
}

.slide--closing .closing-info strong {
    color: var(--primary);
    font-size: 1.5cqw;
}

.slide--closing .closing-info p {
    margin: 0;
    color: var(--text-muted);
    font-size: 1.2cqw;
}

.slide--closing .closing-school {
    margin-top: 2.5cqw;
    display: flex;
    align-items: center;
    gap: 1cqw;
    color: var(--text-muted);
    font-size: 1.05cqw;
}

.slide--closing .closing-school img {
    width: 4cqw;
    height: 4cqw;
    object-fit: contain;
    background: white;
    padding: 0.4cqw;
    border-radius: 0.6cqw;
}

/* ====================== Slide body internals (compact card overrides) ====================== */

.slide-body .role-grid,
.slide-body .tier-grid,
.slide-body .db-grid,
.slide-body .tech-grid,
.slide-body .future-grid,
.slide-body .status-grid,
.slide-body .security-grid,
.slide-body .image-grid,
.slide-body .two-col {
    margin: 0;
    gap: 1.2cqw;
}

.slide-body .role-card,
.slide-body .tier-card,
.slide-body .db-card,
.slide-body .tech-card,
.slide-body .future-card,
.slide-body .status-card,
.slide-body .security-card,
.slide-body .objective-card,
.slide-body .info-card,
.slide-body .meta-card {
    padding: 1.4cqw;
    border-radius: 0.9cqw;
}

.slide-body .role-card h4,
.slide-body .tier-card h3,
.slide-body .db-card h4,
.slide-body .tech-card h4,
.slide-body .future-card h4,
.slide-body .info-card h4,
.slide-body .objective-card h3 {
    font-size: 1.35cqw;
    margin-bottom: 0.4cqw;
}

.slide--obiettivi .slide-body .objective-card {
    padding: 0;
}

.slide--obiettivi .slide-body .objective-card__titles h3 {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.slide-body .role-card p,
.slide-body .tier-card p,
.slide-body .db-card p,
.slide-body .tech-card p,
.slide-body .future-card p,
.slide-body .info-card p {
    font-size: 1.05cqw;
    line-height: 1.45;
}

.slide-body .role-card ul,
.slide-body .tier-card ul,
.slide-body .db-card ul,
.slide-body .info-card ul {
    font-size: 1.02cqw;
    padding-left: 1.2cqw;
}

.slide-body .role-icon,
.slide-body .db-icon,
.slide-body .future-icon {
    width: 3.2cqw;
    height: 3.2cqw;
    border-radius: 0.7cqw;
    font-size: 1.1cqw;
}

.slide-body .role-icon svg {
    width: 1.8cqw;
    height: 1.8cqw;
}

.slide-body .tier-label,
.slide-body .tier-tech,
.slide-body .db-desc,
.slide-body .tech-badge {
    font-size: 0.85cqw;
}

.slide-body .tier-card h3 {
    font-size: 1.5cqw;
}

.slide-body .data-table {
    font-size: 1.05cqw;
}

.slide-body .data-table th,
.slide-body .data-table td {
    padding: 0.9cqw 1cqw;
}

.slide-body .table-wrapper {
    margin: 0;
    overflow: hidden;
    flex-shrink: 1;
    min-height: 0;
    max-height: 100%;
}

.slide-body .http-method {
    font-size: 0.85cqw;
    padding: 0.15cqw 0.6cqw;
}

.slide-body .badge {
    font-size: 0.85cqw;
    padding: 0.15cqw 0.7cqw;
}

.slide-body .status-card {
    padding: 1.1cqw 1cqw;
}

.slide-body .status-code {
    font-size: 2.2cqw;
    margin-bottom: 0.2cqw;
}

.slide-body .status-name {
    font-size: 0.9cqw;
    margin-bottom: 0.5cqw;
}

.slide-body .status-card p {
    font-size: 0.9cqw;
    line-height: 1.4;
}

.slide-body .security-card {
    padding: 1.2cqw;
}

.slide-body .security-risk {
    font-size: 0.95cqw;
    margin-bottom: 0.6cqw;
}

.slide-body .security-card p {
    font-size: 1cqw;
    line-height: 1.45;
}

.slide-body .feature {
    padding: 1.3cqw;
    gap: 1.5cqw;
    margin: 0;
    grid-template-columns: 5cqw 1fr;
}

.slide-body .feature-number {
    font-size: 2cqw;
}

.slide-body .feature-body h3 {
    font-size: 1.5cqw;
}

.slide-body .feature-body p,
.slide-body .feature-body li {
    font-size: 1.15cqw;
    line-height: 1.5;
}

.slide-body .problem {
    margin: 0;
}

.slide-body .problem-header {
    padding: 1.1cqw 1.4cqw;
}

.slide-body .problem-num {
    width: 3cqw;
    height: 3cqw;
    font-size: 1.05cqw;
}

.slide-body .problem-header h3 {
    font-size: 1.4cqw;
    margin: 0;
}

.slide-body .problem-body {
    padding: 1.3cqw 1.6cqw;
    font-size: 1.15cqw;
    line-height: 1.55;
}

.slide-body .problem-section {
    margin-bottom: 0.7cqw;
}

.slide-body .callout {
    padding: 1.2cqw 1.6cqw;
    margin: 0;
    font-size: 1.2cqw;
    line-height: 1.55;
}

.slide-body .checklist li,
.slide-body .step-list li,
.slide-body .numbered-list li,
.slide-body .result-list li,
.slide-body .index-list li {
    font-size: 1.2cqw;
    line-height: 1.5;
    margin-bottom: 0.6cqw;
}

.slide-body .checklist li {
    padding-left: 2cqw;
}

.slide-body .checklist li::before {
    width: 1.3cqw;
    height: 1.3cqw;
    top: 0.4cqw;
}

.slide-body .numbered-list li,
.slide-body .step-list li {
    padding-left: 3cqw;
}

.slide-body .numbered-list li::before,
.slide-body .step-list li::before {
    width: 2.2cqw;
    height: 2.2cqw;
    font-size: 1cqw;
}

.slide-body .step-list li {
    padding: 1cqw 1.3cqw 1cqw 4cqw;
    margin-bottom: 0.5cqw;
}

.slide-body .step-list li::before {
    left: 1cqw;
}

.slide-body .image-block,
.slide-body .diagram-image,
.slide-body .mockup-showcase,
.slide-body .mobile-mockup-grid,
.slide-body .code-screenshot {
    margin: 0;
}

.slide-body .image-block img,
.slide-body .diagram-image img {
    max-height: 100%;
}

.slide-body .file-tree {
    font-size: 0.95cqw;
    line-height: 1.55;
    padding: 1.5cqw 1.8cqw;
    margin: 0;
}

.slide-body .http-exchange {
    gap: 1.2cqw;
    margin: 0;
}

.slide-body .http-card-header {
    padding: 0.7cqw 1cqw;
    font-size: 0.95cqw;
}

.slide-body .http-badge {
    font-size: 0.8cqw;
    padding: 0.2cqw 0.6cqw;
}

.slide-body .image-grid figcaption,
.slide-body .diagram-image figcaption,
.slide-body .mockup-showcase figcaption,
.slide-body .code-screenshot figcaption {
    font-size: 0.85cqw;
    margin-top: 0.5cqw;
}

.slide-body .diagram-title {
    font-size: 0.85cqw;
    margin-bottom: 0.8cqw;
    padding-bottom: 0.5cqw;
}

.slide-body .mobile-mockup-grid {
    padding: 2cqw 1.5cqw;
    gap: 2cqw;
}

.slide-body .mockup-showcase {
    padding: 2cqw 1.5cqw;
}

.slide-body .image-grid {
    align-items: stretch;
}

.slide-body .image-grid figure {
    margin: 0;
}

/* ============================ PRESENTATION MODE ============================ */

body.presentation-mode {
    overflow: hidden;
    background: #000;
}

body.presentation-mode .sidebar,
body.presentation-mode .menu-toggle,
body.presentation-mode .site-footer,
body.presentation-mode .scroll-top,
body.presentation-mode .fab-group .fab:not(#exitPresentation):not(#themeToggle) {
    display: none !important;
}

body.presentation-mode .content {
    margin-left: 0 !important;
}

body.presentation-mode .deck {
    padding: 0;
    background: #000;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

body.presentation-mode .slide {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    margin: 0;
    width: min(100vw, calc(100vh * 16 / 9));
    height: min(100vh, calc(100vw * 9 / 16));
    max-width: none;
    aspect-ratio: 16 / 9;
    border-radius: 0;
    border: none;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

body.presentation-mode .slide:hover {
    transform: translate(-50%, -50%);
}

body.presentation-mode .slide.is-active {
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
}

.presentation-hud {
    display: none;
}

body.presentation-mode .presentation-hud {
    display: flex;
    align-items: center;
    gap: 6px;
    position: fixed;
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(20, 25, 40, 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: white;
    padding: 6px 10px;
    border-radius: 100px;
    font-size: 0.85rem;
    z-index: 200;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
}

.presentation-hud button {
    background: transparent;
    color: white;
    border: none;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 100px;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s ease;
}

.presentation-hud button:hover {
    background: rgba(255, 255, 255, 0.15);
}

.presentation-hud button:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.presentation-hud .hud-counter {
    padding: 0 14px;
    font-variant-numeric: tabular-nums;
    font-weight: 600;
    letter-spacing: 0.04em;
    min-width: 70px;
    text-align: center;
}

body.presentation-mode .fab-group {
    bottom: 16px;
    right: 16px;
    flex-direction: row;
}

body.presentation-mode #exitPresentation {
    background: rgba(239, 68, 68, 0.9);
    color: white;
    border-color: rgba(239, 68, 68, 0.9);
}

body.presentation-mode #exitPresentation:hover {
    background: rgb(220, 38, 38);
}

.fab.fab-present.is-active,
body.presentation-mode .fab.fab-present {
    background: var(--secondary);
    color: white;
    border-color: var(--secondary);
}

/* ============================ MOBILE / RESPONSIVE SLIDES ============================ */

@media (max-width: 768px) {
    .deck {
        padding: 24px 12px 60px;
    }

    .slide {
        margin: 20px auto;
        border-radius: var(--radius);
    }

    .slide-content {
        padding: 4cqw 5cqw;
    }
}

/* ============================ PRINT ============================ */

@page {
    size: 297mm 167mm;
    margin: 0;
}

@media print {

    :root,
    [data-theme="dark"],
    [data-theme="light"] {
        --primary: #2c3e50;
        --primary-dark: #1a252f;
        --secondary: #3498db;
        --bg: #ffffff;
        --bg-alt: #ffffff;
        --bg-gradient: linear-gradient(135deg, #f8fafd, #eef2f6);
        --text: #1a252f;
        --text-muted: #4a5568;
        --text-light: #718096;
        --border: #cbd5e0;
        --border-light: #e2e8f0;
        --error: #c0392b;
        --warning: #b7791f;
        --success: #15803d;
        --brand-bg: #2c3e50;
        --brand-bg-dark: #1a252f;
        --on-brand: #ffffff;
        --footer-bg: #2c3e50;
        --code-bg: #f6f8fa;
        --code-border: #d0d7de;
        --code-block-bg: #1e1e2e;
        --code-text: #cdd6f4;
        --shadow-sm: none;
        --shadow: none;
        --shadow-lg: none;
        --shadow-xl: none;
    }

    html,
    body {
        background: white !important;
        color: #1a252f !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    .sidebar,
    .menu-toggle,
    .scroll-top,
    .fab-group,
    .presentation-hud,
    .site-footer,
    .copy-btn,
    [data-no-print] {
        display: none !important;
    }

    .content {
        margin-left: 0 !important;
    }

    .deck {
        padding: 0 !important;
        background: white !important;
        min-height: 0 !important;
    }

    .slide {
        width: 297mm !important;
        height: 167mm !important;
        max-width: none !important;
        aspect-ratio: auto !important;
        margin: 0 !important;
        border: none !important;
        border-radius: 0 !important;
        box-shadow: none !important;
        page-break-after: always;
        break-after: page;
        page-break-inside: avoid;
        break-inside: avoid;
        overflow: hidden !important;
    }

    .slide:last-of-type {
        page-break-after: auto;
        break-after: auto;
    }

    .slide:hover {
        transform: none !important;
    }

    .slide-content {
        padding: 11mm 14mm !important;
    }

    .slide-meta {
        top: 5mm !important;
        right: 8mm !important;
    }

    .slide--cover,
    .slide--closing {
        background: linear-gradient(135deg, #f8fafd, #eef2f6) !important;
    }

    pre,
    .file-tree {
        background: #1e1e2e !important;
        color: #cdd6f4 !important;
    }

    .slide .code-screenshot,
    .slide .code-screenshot img {
        background: transparent !important;
        border: none !important;
        box-shadow: none !important;
        padding: 0 !important;
    }

    pre code {
        color: #cdd6f4 !important;
    }

    code:not(pre code) {
        background: #f1f5f9 !important;
        color: #1a252f !important;
        border: 1px solid #cbd5e0 !important;
    }

    .data-table thead {
        background: #2c3e50 !important;
        color: white !important;
    }

    .http-method {
        color: white !important;
    }

    .http-method-get {
        background: #3498db !important;
    }

    .http-method-post {
        background: #15803d !important;
    }

    .http-method-put {
        background: #b7791f !important;
    }

    .http-method-delete {
        background: #c0392b !important;
    }

    .badge-public {
        background: rgba(108, 117, 125, 0.2) !important;
        color: #495057 !important;
    }

    .badge-user {
        background: rgba(52, 152, 219, 0.2) !important;
        color: #2980b9 !important;
    }

    .badge-admin {
        background: rgba(44, 62, 80, 0.2) !important;
        color: #2c3e50 !important;
    }

    .tech-frontend {
        background: rgba(52, 152, 219, 0.18) !important;
        color: #2980b9 !important;
    }

    .tech-backend {
        background: rgba(44, 62, 80, 0.18) !important;
        color: #2c3e50 !important;
    }

    .tech-data {
        background: rgba(21, 128, 61, 0.18) !important;
        color: #15803d !important;
    }

    .problem-num,
    .feature-number,
    .role-icon,
    .db-icon,
    .future-icon,
    .numbered-list li::before,
    .step-list li::before,
    .checklist li::before,
    .slide-number,
    .slide-title::after {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    a {
        color: #2980b9 !important;
        text-decoration: none !important;
    }

    details {
        display: block;
    }

    details > summary {
        cursor: default;
    }
}

body.exporting-pdf {
    overflow: hidden;
}

/* ============================ PDF EXPORT (client-side) ============================ */

.pdf-export-overlay {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(15, 23, 42, 0.72);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.pdf-export-overlay[hidden] {
    display: none !important;
}

.pdf-export-overlay-card {
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 32px 40px;
    text-align: center;
    box-shadow: var(--shadow-xl);
    max-width: 360px;
    width: calc(100% - 48px);
}

.pdf-export-spinner {
    width: 44px;
    height: 44px;
    margin: 0 auto 20px;
    border: 3px solid var(--border);
    border-top-color: var(--secondary);
    border-radius: 50%;
    animation: pdf-spin 0.85s linear infinite;
}

@keyframes pdf-spin {
    to { transform: rotate(360deg); }
}

.pdf-export-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 8px;
}

.pdf-export-status {
    font-size: 0.95rem;
    color: var(--text-muted);
    font-variant-numeric: tabular-nums;
    margin-bottom: 6px;
}

.pdf-export-hint {
    font-size: 0.8rem;
    color: var(--text-light);
}

body.pdf-export-capture {
    overflow: hidden !important;
}

body.pdf-export-capture .sidebar,
body.pdf-export-capture .menu-toggle,
body.pdf-export-capture .fab-group,
body.pdf-export-capture .presentation-hud,
body.pdf-export-capture .site-footer {
    visibility: hidden !important;
}

body.pdf-export-capture .pdf-export-overlay {
    visibility: visible !important;
    z-index: 100001 !important;
}

body.pdf-export-capture .deck {
    padding: 0 !important;
    background: #ffffff !important;
    min-height: 0 !important;
}

html[data-theme="dark"] body.pdf-export-capture .deck,
body.pdf-export-capture-dark .deck {
    background: #0f172a !important;
}

body.pdf-export-capture .slide {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 1280px !important;
    height: 720px !important;
    max-width: none !important;
    aspect-ratio: auto !important;
    margin: 0 !important;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
    transform: none !important;
    overflow: hidden !important;
}

body.pdf-export-capture .slide.pdf-capture-active {
    visibility: visible !important;
    opacity: 1 !important;
    z-index: 99999 !important;
}

body.pdf-export-capture .slide.pdf-capture-active img {
    visibility: visible !important;
    opacity: 1 !important;
    display: inline-block !important;
}

/* ============================ DARK MODE TWEAKS ============================ */

[data-theme="dark"] .sidebar-nav a.active {
    background: linear-gradient(90deg, rgba(96, 165, 250, 0.14), transparent);
}

[data-theme="dark"] .section-number {
    background: rgba(96, 165, 250, 0.16);
}

[data-theme="dark"] .callout-info {
    background: linear-gradient(135deg, rgba(96, 165, 250, 0.1), rgba(96, 165, 250, 0.04));
}

[data-theme="dark"] .callout-success {
    background: linear-gradient(135deg, rgba(74, 222, 128, 0.1), rgba(74, 222, 128, 0.04));
}

[data-theme="dark"] .callout-warning {
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.1), rgba(251, 191, 36, 0.04));
}

[data-theme="dark"] .callout-final {
    background: linear-gradient(135deg, rgba(241, 245, 249, 0.05), rgba(96, 165, 250, 0.06));
}

[data-theme="dark"] .problem-header {
    background: linear-gradient(135deg, rgba(248, 113, 113, 0.12), rgba(248, 113, 113, 0.04));
}

[data-theme="dark"] .problem-solution {
    background: linear-gradient(135deg, rgba(74, 222, 128, 0.12), rgba(74, 222, 128, 0.04));
}

[data-theme="dark"] .badge-public {
    background: rgba(148, 163, 184, 0.18);
    color: #cbd5e1;
}

[data-theme="dark"] .badge-user {
    background: rgba(96, 165, 250, 0.18);
    color: #93c5fd;
}

[data-theme="dark"] .badge-admin {
    background: rgba(148, 163, 184, 0.22);
    color: #e2e8f0;
}

[data-theme="dark"] .tech-frontend {
    background: rgba(96, 165, 250, 0.18);
    color: #93c5fd;
}

[data-theme="dark"] .tech-backend {
    background: rgba(148, 163, 184, 0.22);
    color: #e2e8f0;
}

[data-theme="dark"] .tech-data {
    background: rgba(74, 222, 128, 0.18);
    color: #6ee7b7;
}

[data-theme="dark"] .screenshot > img {
    border-color: var(--border);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.55);
}

[data-theme="dark"] .diagram-image > img {
    background: #ffffff;
    padding: 8px;
    border-radius: 6px;
}

[data-theme="dark"] .footer-school img {
    background: rgba(255, 255, 255, 0.95);
}

[data-theme="dark"] .hero::before {
    background-image:
        radial-gradient(circle at 20% 30%, rgba(96, 165, 250, 0.12), transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(96, 165, 250, 0.08), transparent 50%);
}

[data-theme="dark"] .mockup-showcase::before {
    background-image:
        radial-gradient(circle at 30% 40%, rgba(96, 165, 250, 0.08), transparent 50%),
        radial-gradient(circle at 70% 60%, rgba(241, 245, 249, 0.04), transparent 50%);
}

[data-theme="dark"] .copy-btn {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .copy-btn:hover {
    background: rgba(255, 255, 255, 0.12);
}

[data-theme="dark"] details > summary {
    color: var(--secondary-light);
}

/* ====================== SLIDE DESIGN SYSTEM ====================== */

.slide-layout {
    display: flex;
    flex-direction: column;
    gap: 0.55cqw;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

.slide-layout--stack {
    gap: 0.5cqw;
}

.slide-layout--split {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.82fr);
    gap: 0.75cqw;
    align-items: stretch;
}

.slide-panel {
    display: flex;
    flex-direction: column;
    gap: 0.45cqw;
    min-height: 0;
    overflow: hidden;
}

.slide-note {
    margin: 0;
    font-size: 1.08cqw;
    line-height: 1.45;
    color: var(--text);
}

.slide-figure {
    margin: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.35cqw;
    min-height: 0;
    overflow: hidden;
}

.slide-figure--diagram,
.slide-figure--wide {
    padding: 0.5cqw;
    background: #f8fafd;
    border: 1px solid var(--border);
    border-radius: 0.55cqw;
}

.slide-figure--diagram img,
.slide-figure--wide img {
    width: 100%;
    max-height: 100%;
    object-fit: contain;
    background: #fff;
    padding: 0.35cqw;
    border-radius: 0.35cqw;
}

.slide-figure--wide {
    flex: 1;
}

.slide-figure figcaption {
    font-size: 0.78cqw;
    color: var(--text-muted);
    text-align: center;
    font-weight: 500;
}

.slide--arch .slide-layout .tier-grid--arch {
    flex: 1;
    min-height: 0;
    align-items: stretch;
}

.slide--arch-2 .slide-figure--wide img,
.slide--arch.slide--continuation .slide-figure--wide img {
    max-height: 62cqh;
}

[data-theme="dark"] .slide-figure--diagram,
[data-theme="dark"] .slide-figure--wide {
    background: #eef2f6;
}

/* ====================== Slide testo allineato a RELAZIONE ====================== */

.slide-lead {
    margin: 0 0 0.35cqw;
    font-size: 1.08cqw;
    line-height: 1.42;
}

.slide-subtitle {
    margin: 0.3cqw 0 0.25cqw;
    font-size: 1.02cqw;
    font-weight: 700;
    color: var(--primary);
    padding-bottom: 0.2cqw;
    border-bottom: 1px solid var(--border-light);
}

.slide-body--compact,
.slide-layout {
    font-size: 1cqw;
    line-height: 1.4;
}

.slide-body--compact {
    gap: 0.45cqw;
}

.slide-body--compact p,
.slide-layout p {
    font-size: 0.92cqw;
    line-height: 1.4;
    margin: 0 0 0.3cqw;
}

.slide-body--compact .compact-list,
.slide-layout .compact-list {
    margin: 0 0 0.3cqw;
    padding-left: 1.15cqw;
    font-size: 0.9cqw;
    line-height: 1.36;
}

.slide-body--compact .compact-list li,
.slide-layout .compact-list li {
    margin-bottom: 0.22cqw;
}

.data-table--compact th,
.data-table--compact td {
    padding: 0.42cqw 0.5cqw;
    font-size: 0.86cqw;
    line-height: 1.34;
}

.slide-body--compact .code-block {
    margin: 0.25cqw 0 0;
    padding: 0.55cqw 0.65cqw;
    font-size: 0.78cqw;
    line-height: 1.35;
    background: var(--code-block-bg);
    color: var(--code-text);
    border-radius: 0.45cqw;
    overflow: hidden;
}

.slide-body--compact .code-block code {
    background: none;
    padding: 0;
    color: inherit;
    font-size: inherit;
}

.numbered-list--compact {
    margin: 0;
    padding-left: 0;
    list-style: none;
    counter-reset: nlist;
}

.numbered-list--compact li {
    counter-increment: nlist;
    position: relative;
    padding: 0.32cqw 0.45cqw 0.32cqw 1.85cqw;
    margin-bottom: 0.2cqw;
    font-size: 0.88cqw;
    line-height: 1.34;
    background: var(--bg);
    border: 1px solid var(--border-light);
    border-radius: 0.4cqw;
}

.numbered-list--compact li::before {
    content: counter(nlist);
    position: absolute;
    left: 0.42cqw;
    top: 0.36cqw;
    font-weight: 700;
    color: var(--secondary-dark);
    font-size: 0.8cqw;
}

.flow-steps--from-10 {
    counter-reset: nlist 9;
}

.flow-steps li {
    font-size: 0.86cqw;
}

.sessioni-grid,
.db-layout,
.flow-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 0.72fr);
    gap: 0.65cqw;
    flex: 1;
    min-height: 0;
    align-items: start;
}

.sessioni-diagram,
.db-diagram,
.flow-diagram {
    margin: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3cqw;
    padding: 0.45cqw;
    background: #f8fafd;
    border: 1px solid var(--border);
    border-radius: 0.55cqw;
    min-height: 0;
    height: 100%;
}

.sessioni-diagram img,
.db-diagram img,
.flow-diagram img {
    width: 100%;
    max-height: 100%;
    object-fit: contain;
    background: #fff;
    padding: 0.35cqw;
    border-radius: 0.35cqw;
}

.sessioni-diagram figcaption,
.db-diagram figcaption,
.flow-diagram figcaption {
    font-size: 0.72cqw;
    color: var(--text-muted);
    text-align: center;
}

.tech-sections {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.55cqw;
    flex: 1;
    min-height: 0;
    align-content: start;
}

.tech-sections section {
    min-height: 0;
    overflow: hidden;
}

.tech-sections section:last-child {
    grid-column: 1 / -1;
}

.tech-sections .checklist {
    margin: 0;
    padding-left: 1.1cqw;
    font-size: 0.9cqw;
    line-height: 1.36;
}

.tech-sections .checklist li {
    margin-bottom: 0.2cqw;
}

.slide--crit .problem {
    margin-bottom: 0.4cqw;
}

.slide--crit .problem-body p {
    font-size: 0.82cqw;
    margin-bottom: 0.25cqw;
}

[data-theme="dark"] .sessioni-diagram,
[data-theme="dark"] .db-diagram,
[data-theme="dark"] .flow-diagram {
    background: #eef2f6;
}

[data-theme="dark"] .sessioni-diagram img,
[data-theme="dark"] .db-diagram img,
[data-theme="dark"] .flow-diagram img {
    background: #fff;
}

/* ====================== Slide: SALUTI / RINGRAZIAMENTI ====================== */

.slide--thanks {
    background: var(--bg-gradient);
}

.slide--thanks .thanks-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 2.5cqw 5cqw;
    gap: 2.2cqw;
    height: 100%;
}

.slide--thanks .thanks-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.65cqw;
}

.slide--thanks .thanks-logo {
    width: 9cqw;
    height: auto;
    filter: drop-shadow(0 0.6cqw 1.2cqw rgba(44, 62, 80, 0.12));
}

.slide--thanks .thanks-title {
    margin: 0;
    font-size: 3.8cqw;
    font-weight: 800;
    color: var(--primary);
    letter-spacing: -0.02em;
    line-height: 1.1;
}

.slide--thanks .thanks-text {
    margin: 0;
    font-size: 1.05cqw;
    line-height: 1.4;
    color: var(--text-muted);
    font-weight: 500;
}

.slide--thanks .thanks-demo-card {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 2.4cqw;
    padding: 1.4cqw 2.2cqw;
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-radius: 1.1cqw;
    box-shadow: var(--shadow);
    max-width: 72cqw;
}

.slide--thanks .thanks-qr {
    margin: 0;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.45cqw;
}

.slide--thanks .thanks-qr img {
    width: 15cqw;
    height: auto;
    display: block;
    padding: 0.45cqw;
    background: #fff;
    border-radius: 0.5cqw;
    border: 1px solid var(--border);
}

.slide--thanks .thanks-qr figcaption {
    margin: 0;
    font-size: 0.72cqw;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.slide--thanks .thanks-demo-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0.55cqw;
    min-width: 0;
}

.slide--thanks .thanks-demo-title {
    margin: 0;
    font-size: 1.45cqw;
    font-weight: 700;
    color: var(--primary);
}

.slide--thanks .thanks-demo-hint {
    margin: 0;
    font-size: 0.92cqw;
    color: var(--text-light);
    font-style: italic;
}

.slide--thanks .thanks-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-top: 0.25cqw;
    font-size: 1.55cqw;
    line-height: 1.2;
    font-weight: 700;
    letter-spacing: 0.01em;
    color: var(--secondary-dark);
    white-space: nowrap;
    text-decoration: none;
    padding: 0.65cqw 1.4cqw;
    background: rgba(52, 152, 219, 0.1);
    border: 1px solid rgba(52, 152, 219, 0.3);
    border-radius: 0.55cqw;
    transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
}

.slide--thanks .thanks-link:hover {
    color: var(--on-brand);
    background: var(--secondary);
    border-color: var(--secondary);
    transform: translateY(-0.1cqw);
}

.slide--thanks .thanks-author {
    margin: 0.15cqw 0 0;
    font-size: 0.95cqw;
    color: var(--text-muted);
    font-weight: 500;
}

[data-theme="dark"] .slide--thanks .thanks-demo-card {
    background: rgba(30, 41, 59, 0.55);
}

[data-theme="dark"] .slide--thanks .thanks-link {
    color: var(--secondary-light);
    background: rgba(96, 165, 250, 0.14);
    border-color: rgba(96, 165, 250, 0.4);
}

[data-theme="dark"] .slide--thanks .thanks-link:hover {
    color: #0f172a;
    background: var(--secondary-light);
}

/* ====================== NO SCROLL: contenuto sempre dentro la slide ====================== */

.slide .table-wrapper,
.slide .slide-layout,
.slide .slide-panel,
.slide .sessioni-text,
.slide .db-text,
.slide .flow-text,
.slide .tech-sections,
.slide .objectives-layout,
.slide .arch-layout,
.slide .cs-layout,
.slide pre,
.slide .file-tree,
.slide .code-block,
.slide .http-card,
.slide .http-card .code-screenshot,
.slide .problem,
.slide .problem-body,
.slide .feature,
.slide .image-grid,
.slide .intro-text {
    overflow: hidden;
    overflow-x: hidden;
    overflow-y: hidden;
    scrollbar-width: none;
}

.slide .table-wrapper::-webkit-scrollbar,
.slide pre::-webkit-scrollbar,
.slide .file-tree::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
}

.slide .data-table {
    table-layout: fixed;
    width: 100%;
}

.slide .data-table th,
.slide .data-table td {
    word-break: break-word;
    overflow-wrap: anywhere;
    hyphens: auto;
    vertical-align: top;
}

.slide-body .data-table th,
.slide-body .data-table td {
    padding: 0.48cqw 0.45cqw;
    font-size: 0.86cqw;
    line-height: 1.32;
}

.slide-body .data-table--compact th,
.slide-body .data-table--compact td {
    padding: 0.4cqw 0.45cqw;
    font-size: 0.82cqw;
    line-height: 1.32;
}

.slide-body pre,
.slide-body .file-tree {
    flex-shrink: 1;
    min-height: 0;
    max-height: 42cqh;
    overflow: hidden;
    margin: 0;
    font-size: 0.72cqw;
    line-height: 1.3;
    white-space: pre-wrap;
    word-break: break-word;
}

.slide--funz .slide-figure {
    flex-shrink: 1;
    min-height: 0;
    margin-top: 0.3cqw;
}

.slide--funz .slide-figure img {
    max-height: 24cqh;
    width: auto;
    max-width: 100%;
    object-fit: contain;
}

.slide--funz .slide-body--compact,
.slide--sec .slide-layout,
.slide--crit .slide-layout,
.slide--concl .slide-layout,
.slide--db .slide-layout,
.slide--sessioni .slide-layout {
    gap: 0.4cqw;
}

.slide--crit .problem {
    margin-bottom: 0.35cqw;
}

.slide--crit .problem-body p {
    font-size: 0.9cqw;
    line-height: 1.36;
}

.slide--crit .problem-header {
    padding: 0.4cqw 0.55cqw;
}

.slide--crit .problem-body {
    padding: 0.4cqw 0.55cqw;
}

.slide--crit .problem-header h3 {
    font-size: 0.95cqw;
}

.slide--concl .result-list li {
    font-size: 0.9cqw;
    line-height: 1.36;
}

.slide-layout .table-wrapper,
.slide-panel .table-wrapper {
    flex-shrink: 1;
    min-height: 0;
    overflow: hidden;
}

.slide--intro .slide-body {
    overflow: hidden;
}

.slide--intro .intro-text {
    overflow: hidden;
    font-size: 0.95cqw;
}

.slide--intro .intro-text .lead {
    font-size: 1cqw;
}

.slide--intro .intro-text .checklist li {
    font-size: 0.9cqw;
}

.slide--intro .intro-text .data-table {
    font-size: 0.82cqw;
}

/* ====================== Screenshot codice: massima leggibilità ====================== */

.slide .code-screenshot {
    margin: 0;
    padding: 0;
    background: transparent;
    border: none;
    border-radius: 0;
    box-shadow: none;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 0;
    overflow: hidden;
}

.slide .code-screenshot img {
    display: block;
    width: 100%;
    max-width: 100%;
    height: auto;
    object-fit: contain;
    object-position: center center;
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 0;
    box-shadow: none;
}

.slide .code-screenshot--hero {
    flex: 1 1 auto;
    padding: 0;
    min-height: 0;
}

.slide .code-screenshot--hero img {
    width: 100%;
    max-height: 100%;
}

/* Client-server: richiesta / risposta HTTP */
.slide--cs-http .slide-header {
    margin-bottom: 0.25cqw;
}

.slide--cs-http .slide-title {
    font-size: 1.35cqw;
}

.slide--cs-http .cs-section-title {
    font-size: 0.95cqw;
    margin-bottom: 0.2cqw;
}

.slide--cs-http .http-card-header {
    padding: 0.4cqw 0.6cqw;
}

.slide--cs-http .http-direction {
    display: none;
}

.slide--cs-http .http-card .code-screenshot--hero img {
    min-height: 52cqh;
    max-height: 68cqh;
}

/* API: schema JSON a tutta slide */
.slide-layout--code-focus {
    gap: 0.45cqw;
}

.slide--api-json .slide-lead {
    flex-shrink: 0;
    margin-bottom: 0.2cqw;
}

.slide--api-json .code-screenshot--hero {
    flex: 1;
}

.slide--api-json .code-screenshot--hero img {
    min-height: 58cqh;
    max-height: 72cqh;
}

/* Sessioni: due screenshot affiancati */
.slide-layout--code-duo {
    gap: 0.45cqw;
}

.code-duo-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.65cqw;
    flex: 1;
    min-height: 0;
    align-items: stretch;
}

.code-duo-item {
    display: flex;
    flex-direction: column;
    gap: 0.3cqw;
    min-height: 0;
    overflow: hidden;
}

.code-duo-item .slide-subtitle {
    margin: 0;
}

.code-duo-caption {
    margin: 0;
    font-size: 0.88cqw;
    line-height: 1.35;
    flex-shrink: 0;
}

.code-duo-item .code-screenshot {
    flex: 1;
    min-height: 0;
}

.code-duo-item .code-screenshot img {
    min-height: 42cqh;
    max-height: 50cqh;
}

.code-duo-footer {
    flex-shrink: 0;
    padding-top: 0.35cqw;
    border-top: 1px solid var(--border-light);
}

.code-duo-footer .slide-subtitle {
    margin-top: 0;
}

.code-duo-footer p,
.code-duo-footer .numbered-list--compact li {
    font-size: 0.85cqw;
}

[data-theme="dark"] .slide .code-screenshot,
[data-theme="dark"] .slide .code-screenshot img,
[data-theme="dark"] .slide--cs-http .http-card .code-screenshot,
[data-theme="dark"] .slide--cs-http .http-card .code-screenshot img {
    background: transparent;
    border: none;
    box-shadow: none;
}
