:root {
    --primary: #3fa9f5;
    --accent: #f5b94c;
    --bg-soft: #f4f6f9;
    --heading: #1a2d4d;
    --navy-strong: #10233f;
    --navy-soft: #16345c;
    --body: #6b7280;
    --white: #ffffff;
    --line: #e4e9f2;
    --shadow-soft: 0 12px 40px rgba(26, 45, 77, 0.08);
    --shadow-card: 0 10px 24px rgba(26, 45, 77, 0.1);
    --page-gutter: clamp(24px, 5vw, 48px);
    --modal-navy: #0c1f38;
    --modal-navy-soft: #16345c;
    --modal-gold: #f5b94c;
    --modal-blue-glow: rgba(63, 169, 245, 0.28);
    --modal-gold-glow: rgba(245, 185, 76, 0.24);
    --modal-surface: linear-gradient(165deg, #ffffff 0%, #f7faff 45%, #eef3fa 100%);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Inter", sans-serif;
    background: radial-gradient(1000px 400px at 10% -20%, rgba(16, 35, 63, 0.2), transparent 60%),
        radial-gradient(900px 380px at 95% 0%, rgba(22, 52, 92, 0.18), transparent 60%),
        radial-gradient(800px 360px at 95% 0%, rgba(245, 185, 76, 0.12), transparent 60%),
        var(--bg-soft);
    color: var(--heading);
    position: relative;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

h1, h2, h3 {
    font-family: "Montserrat", sans-serif;
    color: var(--heading);
    letter-spacing: 0.01em;
}

.starfield {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background-image:
        radial-gradient(2px 2px at 10% 20%, rgba(255, 255, 255, 0.7), transparent 100%),
        radial-gradient(1.5px 1.5px at 30% 65%, rgba(245, 185, 76, 0.55), transparent 100%),
        radial-gradient(2px 2px at 70% 40%, rgba(63, 169, 245, 0.5), transparent 100%),
        radial-gradient(1.5px 1.5px at 85% 75%, rgba(255, 255, 255, 0.6), transparent 100%),
        radial-gradient(1px 1px at 55% 15%, rgba(255, 255, 255, 0.55), transparent 100%);
    animation: stars-float 26s linear infinite;
    opacity: 0.55;
}

.starfield-soft {
    background-image:
        radial-gradient(1.5px 1.5px at 15% 78%, rgba(63, 169, 245, 0.35), transparent 100%),
        radial-gradient(1.5px 1.5px at 40% 25%, rgba(245, 185, 76, 0.35), transparent 100%),
        radial-gradient(1px 1px at 65% 85%, rgba(255, 255, 255, 0.35), transparent 100%),
        radial-gradient(1px 1px at 90% 12%, rgba(255, 255, 255, 0.3), transparent 100%);
    animation-duration: 40s;
    opacity: 0.35;
}

@keyframes stars-float {
    from {
        transform: translateY(0);
    }
    to {
        transform: translateY(-120px);
    }
}

.page-glow {
    position: fixed;
    pointer-events: none;
    width: 320px;
    height: 320px;
    border-radius: 50%;
    filter: blur(80px);
    z-index: 0;
    opacity: 0.26;
}

.page-glow-top {
    top: -120px;
    right: -80px;
    background: rgba(63, 169, 245, 0.8);
}

.page-glow-bottom {
    bottom: -140px;
    left: -100px;
    background: rgba(245, 185, 76, 0.7);
}

.container {
    width: min(1120px, 100%);
    margin: 0 auto;
    padding-left: var(--page-gutter);
    padding-right: var(--page-gutter);
}

.top-nav {
    flex-shrink: 0;
    background: linear-gradient(90deg, rgba(16, 35, 63, 0.95), rgba(26, 45, 77, 0.95));
    border-bottom: 1px solid rgba(63, 169, 245, 0.25);
    backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: 20;
}

.nav-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 0;
    gap: 20px;
}

.brand {
    text-decoration: none;
    color: var(--white);
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.brand-main {
    font-size: 1.28rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    font-family: "Montserrat", sans-serif;
}

.brand-sub {
    font-size: 0.74rem;
    color: rgba(255, 255, 255, 0.72);
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.actions {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.nav-link {
    text-decoration: none;
    color: #e6efff;
    font-weight: 600;
    opacity: 0.86;
    position: relative;
}

.nav-link::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -6px;
    width: 0;
    height: 2px;
    background: var(--accent);
    transition: width 0.2s ease;
}

.nav-link:hover::after {
    width: 100%;
}

.btn {
    border: none;
    border-radius: 999px;
    padding: 10px 18px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    transition: all 0.22s ease;
}

.btn-primary {
    background: linear-gradient(135deg, #1d3f6e, #102b4e);
    color: var(--white);
    box-shadow: 0 10px 20px rgba(16, 35, 63, 0.4);
}

.btn-outline {
    border: 1px solid rgba(16, 35, 63, 0.35);
    color: var(--heading);
    background: rgba(255, 255, 255, 0.92);
}

.btn-ghost {
    background: transparent;
    color: #ebf3ff;
}

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

.language-switcher {
    display: inline-flex;
    gap: 8px;
    align-items: center;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 999px;
    padding: 8px 12px;
    font-size: 0.84rem;
}

.flag-btn {
    width: 38px;
    height: 38px;
    border-radius: 999px;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    text-decoration: none;
    border: 1px solid transparent;
    transition: all 0.2s ease;
    overflow: hidden;
    padding: 0;
}

.flag-icon {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 999px;
    display: block;
}

.flag-btn.active {
    border-color: rgba(245, 185, 76, 0.7);
    background: rgba(245, 185, 76, 0.2);
    box-shadow: 0 8px 16px rgba(16, 35, 63, 0.35);
}

.flag-btn:hover {
    transform: translateY(-1px);
    border-color: rgba(245, 185, 76, 0.6);
    background: #fff8e9;
}

.main-content {
    flex: 1 0 auto;
    padding-top: 40px;
    padding-bottom: 64px;
    position: relative;
    z-index: 1;
    width: 100%;
}

.hero {
    background: linear-gradient(135deg, #122a4a, #1a2d4d 55%, #1f3f69);
    border-radius: 22px;
    border: 1px solid rgba(63, 169, 245, 0.26);
    padding: 30px;
    margin-bottom: 28px;
    box-shadow: var(--shadow-soft);
    position: relative;
    overflow: hidden;
    background-color: var(--heading);
}

.hero::after {
    content: "";
    position: absolute;
    top: -24px;
    right: -16px;
    width: 140px;
    height: 140px;
    background: radial-gradient(circle, rgba(63, 169, 245, 0.25), transparent 70%);
}

.hero h1 {
    margin: 8px 0 0;
    font-size: clamp(1.8rem, 2.8vw, 2.5rem);
    line-height: 1.15;
    max-width: 640px;
    color: var(--white);
}

.hero p {
    color: rgba(235, 243, 255, 0.86);
    max-width: 760px;
    line-height: 1.8;
}

.hero-chip {
    display: inline-flex;
    padding: 7px 14px;
    border-radius: 999px;
    background: rgba(245, 185, 76, 0.22);
    color: #ffe3ab;
    font-size: 0.79rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-weight: 700;
    position: relative;
    z-index: 1;
}

.hero-detail-head {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: flex-start;
}

.hero-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 24px;
    padding: 4px 0;
}

.procedure-search-wrap {
    margin: 0 0 20px;
}

.procedure-search-input {
    width: 100%;
    max-width: 420px;
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 12px 16px;
    font-size: 0.95rem;
    color: var(--heading);
    background: var(--white);
    box-shadow: var(--shadow-soft);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.procedure-search-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(63, 169, 245, 0.15);
}

.procedure-search-input::placeholder {
    color: #9aa5b5;
}

.procedure-search-empty,
.procedure-grid-empty {
    margin: 8px 0 0;
    padding: 28px 20px;
    text-align: center;
    color: var(--body);
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: 16px;
    box-shadow: var(--shadow-soft);
}

.card[hidden] {
    display: none !important;
}

.card {
    background: linear-gradient(180deg, #ffffff 0%, #fcfdff 100%);
    border-radius: 18px;
    border: 1px solid var(--line);
    overflow: hidden;
    box-shadow: var(--shadow-card);
    transition: transform 0.22s ease, box-shadow 0.22s ease;
    background-color: var(--white);
}

.card-clickable {
    position: relative;
    cursor: pointer;
}

.card-stretched-link {
    position: absolute;
    inset: 0;
    z-index: 1;
    border-radius: inherit;
}

.card-stretched-link:focus-visible {
    outline: 3px solid rgba(63, 169, 245, 0.55);
    outline-offset: 2px;
}

.card-link-text {
    color: var(--navy-soft);
    font-weight: 800;
}

.card-action-link {
    position: relative;
    z-index: 2;
    color: var(--primary);
    text-decoration: none;
    font-weight: 800;
}

.card-action-link:hover {
    color: var(--navy-strong);
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(26, 45, 77, 0.14);
}

.card img {
    width: 100%;
    aspect-ratio: 5 / 3;
    object-fit: cover;
}

.card-content {
    padding: 16px 16px 18px;
}

.card-kicker {
    color: var(--navy-soft);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.74rem;
    font-weight: 700;
}

.card-content h3 {
    margin: 8px 0 8px;
    font-size: 1.15rem;
}

.card-content p {
    margin: 0 0 14px;
    color: var(--body);
    font-size: 0.93rem;
    line-height: 1.7;
}

.card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-footer a {
    color: var(--navy-soft);
    text-decoration: none;
    font-weight: 800;
}

.detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.gallery-sections {
    display: grid;
    gap: 28px;
}

.pairs-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
}

.cases-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
}

.case-card {
    background: var(--white);
    border-radius: 16px;
    border: 1px solid var(--line);
    padding: 14px;
    box-shadow: var(--shadow-card);
    cursor: pointer;
    transition: transform 0.22s ease, box-shadow 0.22s ease;
}

.case-card:hover,
.case-card:focus-visible {
    transform: translateY(-4px);
    box-shadow: 0 18px 36px rgba(26, 45, 77, 0.12);
    outline: none;
}

.case-card:focus-visible {
    box-shadow: 0 0 0 3px rgba(63, 169, 245, 0.28), 0 18px 36px rgba(26, 45, 77, 0.12);
}

.case-card-title {
    margin: 0 0 12px;
    font-size: 1rem;
    color: var(--navy-soft);
}

.case-card-preview {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.case-preview-side {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

.case-card-admin {
    margin-top: 12px;
    border-top: 1px solid var(--line);
    padding-top: 10px;
}

.case-card-admin summary {
    cursor: pointer;
    color: var(--navy-soft);
    font-size: 0.84rem;
    font-weight: 700;
    list-style-position: inside;
}

.case-card-admin-body {
    display: grid;
    gap: 10px;
    margin-top: 10px;
}

.case-admin-row {
    display: grid;
    gap: 8px;
    padding: 10px;
    border: 1px dashed #d8e0ed;
    border-radius: 10px;
    background: #f9fbfe;
}

.case-admin-label {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--navy-soft);
    line-height: 1.35;
    word-break: break-word;
}

.pair-section {
    background: var(--white);
    border-radius: 16px;
    border: 1px solid var(--line);
    padding: 14px;
    box-shadow: 0 10px 24px rgba(26, 45, 77, 0.06);
}

.pair-title {
    margin: 0 0 12px;
    font-size: 1rem;
    color: var(--navy-soft);
}

.gallery-rows {
    display: grid;
    gap: 14px;
}

.gallery-row {
    border: 1px dashed #d5deea;
    border-radius: 12px;
    padding: 12px;
    background: #f9fbfe;
}

.app-modal-dialog-wide {
    width: min(860px, 94vw);
}

.pair-images {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.pair-side {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

.side-gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 10px;
}

.side-gallery-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

.image-item-title {
    margin: 0;
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--navy-soft);
    line-height: 1.3;
}

.gallery-sections {
    display: grid;
    gap: 16px;
}

.section-block {
    border: 1px solid #d5deea;
    border-radius: 12px;
    padding: 14px;
    background: #f9fbfe;
}

.section-block-title {
    margin: 0 0 12px;
    font-size: 1rem;
    color: var(--heading);
}

.section-part {
    margin-bottom: 12px;
}

.section-part h5 {
    margin: 0 0 8px;
    font-size: 0.92rem;
    color: var(--navy-soft);
}

.media-rows {
    display: grid;
    gap: 10px;
    margin-bottom: 8px;
}

.media-row {
    display: grid;
    gap: 8px;
    border: 1px dashed #d8e0ed;
    border-radius: 10px;
    padding: 10px;
    background: #fff;
}

.form-card-wide {
    max-width: none;
}

.gallery-block {
    background: var(--white);
    border-radius: 16px;
    border: 1px solid var(--line);
    padding: 18px;
    box-shadow: 0 10px 24px rgba(26, 45, 77, 0.06);
}

.gallery-heading {
    margin: 0 0 14px;
    font-size: 1.15rem;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
}

.gallery-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.gallery-thumb {
    width: 100%;
    aspect-ratio: 3 / 4;
    overflow: hidden;
    border-radius: 12px;
    border: 1px solid #edf1f6;
    background: #eef2f7;
}

.gallery-thumb-empty {
    display: grid;
    place-items: center;
    padding: 10px;
    color: var(--body);
    font-size: 0.82rem;
    text-align: center;
}

.gallery-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
    transition: transform 0.22s ease;
}

.case-card .gallery-thumb img {
    cursor: default;
}

.gallery-thumb:hover img {
    transform: scale(1.03);
}

.case-card:hover .gallery-thumb img {
    transform: scale(1.02);
}

.lightbox {
    position: fixed;
    inset: 0;
    z-index: 60;
}

.lightbox[hidden] {
    display: none !important;
}

body.lightbox-open,
body.preview-open {
    overflow: hidden;
}

.lightbox-backdrop {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse at 18% 12%, var(--modal-blue-glow), transparent 55%),
        radial-gradient(ellipse at 82% 88%, var(--modal-gold-glow), transparent 52%),
        rgba(6, 15, 31, 0.86);
    backdrop-filter: blur(10px);
    opacity: 0;
    transition: opacity 0.36s ease;
}

.lightbox-ambient,
.image-preview-ambient {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
}

.lightbox-orb,
.image-preview-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(70px);
    opacity: 0.45;
    animation: modal-orb-float 9s ease-in-out infinite alternate;
}

.lightbox-orb-blue,
.image-preview-orb-blue {
    width: 280px;
    height: 280px;
    top: 8%;
    left: 6%;
    background: rgba(63, 169, 245, 0.55);
}

.lightbox-orb-gold,
.image-preview-orb-gold {
    width: 240px;
    height: 240px;
    right: 8%;
    bottom: 10%;
    background: rgba(245, 185, 76, 0.5);
    animation-delay: 1.4s;
}

@keyframes modal-orb-float {
    from { transform: translate(0, 0) scale(1); }
    to { transform: translate(18px, -14px) scale(1.08); }
}

@keyframes gallery-slide-in {
    from {
        opacity: 0;
        transform: translateY(18px) scale(0.96);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.lightbox.is-open .lightbox-backdrop,
.lightbox.is-closing .lightbox-backdrop {
    opacity: 1;
}

.lightbox-panel {
    position: absolute;
    top: 50%;
    left: 50%;
    width: min(900px, calc(100% - clamp(48px, 10vw, 112px)));
    height: min(78vh, calc(100% - clamp(72px, 14vh, 140px)));
    z-index: 1;
    display: flex;
    flex-direction: column;
    border-radius: clamp(16px, 2.2vw, 22px);
    overflow: hidden;
    background: var(--modal-surface);
    border: 1px solid rgba(228, 233, 242, 0.95);
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.65) inset,
        0 28px 64px rgba(8, 20, 38, 0.42),
        0 0 48px rgba(63, 169, 245, 0.08);
    transform: translate(-50%, calc(-50% + 18px)) scale(0.96);
    opacity: 0;
    transition: transform 0.38s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.38s ease;
}

.lightbox-panel-glow {
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: linear-gradient(135deg, rgba(63, 169, 245, 0.06), transparent 42%, rgba(245, 185, 76, 0.05));
}

.lightbox.is-open .lightbox-panel {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
}

.lightbox.is-closing .lightbox-panel {
    transform: translate(-50%, calc(-50% + 12px)) scale(0.98);
    opacity: 0;
}

.lightbox-header {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: clamp(16px, 2.8vw, 22px) clamp(18px, 3.2vw, 30px);
    border-bottom: 1px solid rgba(63, 169, 245, 0.14);
    background: linear-gradient(135deg, var(--modal-navy) 0%, var(--navy-strong) 52%, #1a3a62 100%);
    flex-shrink: 0;
    box-shadow: 0 10px 28px rgba(8, 18, 34, 0.22);
}

.lightbox-header-main {
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-width: 0;
}

.lightbox-kicker {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: rgba(245, 185, 76, 0.92);
}

.lightbox-counter {
    font-size: 0.8rem;
    font-weight: 600;
    color: rgba(230, 239, 255, 0.78);
    letter-spacing: 0.03em;
}

.lightbox-close,
.image-preview-close {
    border: none;
    border-radius: 12px;
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
    padding: 0;
    cursor: pointer;
    flex-shrink: 0;
    display: grid;
    place-items: center;
    transition: background 0.22s ease, transform 0.22s ease, box-shadow 0.22s ease;
}

.lightbox-close {
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.1);
}

.image-preview-close {
    background: var(--white);
    border: 1px solid var(--line);
    box-shadow: 0 6px 16px rgba(26, 45, 77, 0.08);
}

.modal-close-icon {
    position: relative;
    width: 14px;
    height: 14px;
    display: block;
}

.modal-close-icon::before,
.modal-close-icon::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 14px;
    height: 2px;
    border-radius: 999px;
    background: var(--heading);
    transform-origin: center;
}

.modal-close-icon--light::before,
.modal-close-icon--light::after {
    background: #f4f8ff;
}

.modal-close-icon::before {
    transform: translate(-50%, -50%) rotate(45deg);
}

.modal-close-icon::after {
    transform: translate(-50%, -50%) rotate(-45deg);
}

@media (hover: hover) and (pointer: fine) {
    .lightbox-close:hover,
    .image-preview-close:hover {
        transform: translateY(-2px);
    }

    .lightbox-close:hover {
        background: rgba(255, 255, 255, 0.18);
        border-color: rgba(245, 185, 76, 0.55);
        box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
    }

    .image-preview-close:hover {
        background: #f4f7fb;
        border-color: rgba(63, 169, 245, 0.35);
        box-shadow: 0 10px 22px rgba(26, 45, 77, 0.12);
    }
}

.lightbox-close:focus-visible,
.image-preview-close:focus-visible {
    outline: 3px solid rgba(63, 169, 245, 0.45);
    outline-offset: 2px;
}

.lightbox-toolbar {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    padding: 4px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.mode-btn {
    border: 1px solid transparent;
    background: transparent;
    color: rgba(235, 243, 255, 0.82);
    border-radius: 999px;
    padding: clamp(9px, 2vw, 11px) clamp(16px, 3vw, 22px);
    font-weight: 700;
    font-size: clamp(0.86rem, 2.3vw, 0.94rem);
    cursor: pointer;
    min-height: 42px;
    transition: background 0.24s ease, color 0.24s ease, transform 0.24s ease, box-shadow 0.24s ease;
}

.mode-btn:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.08);
}

.mode-btn.active {
    background: linear-gradient(135deg, #f5b94c 0%, #e8a934 100%);
    color: var(--modal-navy);
    border-color: transparent;
    box-shadow: 0 8px 22px rgba(245, 185, 76, 0.35);
    transform: translateY(-1px);
}

.lightbox-scroll {
    position: relative;
    z-index: 1;
    flex: 1;
    display: flex;
    align-items: stretch;
    gap: clamp(16px, 2.5vw, 24px);
    overflow-x: auto;
    overflow-y: hidden;
    scroll-behavior: smooth;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    padding: clamp(20px, 3.2vw, 30px) clamp(20px, 3.2vw, 32px) clamp(22px, 3.4vw, 34px);
    background:
        radial-gradient(ellipse at top left, rgba(63, 169, 245, 0.07), transparent 55%),
        radial-gradient(ellipse at bottom right, rgba(245, 185, 76, 0.06), transparent 50%),
        linear-gradient(180deg, #f8fbff 0%, #f1f5fa 100%);
}

.lightbox-scroll::-webkit-scrollbar {
    height: 9px;
}

.lightbox-scroll::-webkit-scrollbar-track {
    background: rgba(26, 45, 77, 0.06);
    border-radius: 999px;
}

.lightbox-scroll::-webkit-scrollbar-thumb {
    background: linear-gradient(90deg, rgba(26, 45, 77, 0.22), rgba(245, 185, 76, 0.45));
    border-radius: 999px;
}

.lightbox-slide {
    flex: 0 0 min(290px, 70vw);
    scroll-snap-align: start;
    display: flex;
    flex-direction: column;
    gap: 14px;
    min-width: 0;
    animation: gallery-slide-in 0.48s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.lightbox-slide-media {
    position: relative;
    border-radius: 18px;
    overflow: hidden;
    border: 1px solid rgba(228, 233, 242, 0.95);
    background: linear-gradient(180deg, #ffffff, #f2f6fb);
    box-shadow:
        0 14px 30px rgba(26, 45, 77, 0.1),
        0 0 0 1px rgba(255, 255, 255, 0.7) inset;
    transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.3s ease;
    touch-action: manipulation;
}

@media (hover: hover) and (pointer: fine) {
    .lightbox-slide:hover .lightbox-slide-media {
        transform: translateY(-5px);
        box-shadow:
            0 22px 40px rgba(26, 45, 77, 0.16),
            0 0 0 1px rgba(63, 169, 245, 0.18);
    }

    .lightbox-slide:hover .lightbox-zoom-hint {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }

    .lightbox-slide:hover img {
        transform: scale(1.04);
        filter: brightness(1.03);
    }

    .lightbox-slide:hover .lightbox-slide-actions,
    .lightbox-slide:focus-within .lightbox-slide-actions {
        opacity: 1;
        transform: translateY(0);
        pointer-events: auto;
    }
}

.lightbox-slide-index {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 2;
    padding: 5px 10px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    color: #ffffff;
    background: linear-gradient(135deg, rgba(16, 35, 63, 0.88), rgba(26, 45, 77, 0.78));
    border: 1px solid rgba(255, 255, 255, 0.18);
    backdrop-filter: blur(6px);
}

.lightbox-zoom-hint {
    position: absolute;
    left: 50%;
    bottom: 14px;
    z-index: 2;
    transform: translateX(-50%) translateY(8px);
    padding: 7px 14px;
    border-radius: 999px;
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #ffffff;
    background: linear-gradient(135deg, rgba(16, 35, 63, 0.82), rgba(29, 63, 110, 0.78));
    border: 1px solid rgba(255, 255, 255, 0.16);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.24s ease, transform 0.24s ease;
}

.lightbox-slide img {
    width: 100%;
    aspect-ratio: 3 / 4;
    object-fit: cover;
    object-position: center;
    display: block;
    cursor: zoom-in;
    -webkit-user-drag: none;
    user-select: none;
    touch-action: manipulation;
    transition: transform 0.34s cubic-bezier(0.22, 1, 0.36, 1), filter 0.34s ease;
}

.lightbox-slide-actions {
    position: absolute;
    left: 10px;
    right: 10px;
    bottom: 10px;
    z-index: 3;
    display: flex;
    gap: 8px;
    justify-content: center;
    flex-wrap: wrap;
    padding: 8px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.94);
    border: 1px solid rgba(228, 233, 242, 0.95);
    box-shadow: 0 10px 24px rgba(26, 45, 77, 0.14);
    opacity: 0;
    transform: translateY(10px);
    pointer-events: none;
    transition: opacity 0.24s ease, transform 0.24s ease;
}

.gallery-crud-btn {
    min-height: 36px;
    font-size: 0.78rem;
    padding: 7px 12px;
}

.lightbox-caption {
    margin: 0;
    padding: 13px 15px;
    font-weight: 600;
    color: var(--heading);
    font-size: clamp(0.88rem, 2.2vw, 0.96rem);
    line-height: 1.45;
    text-align: left;
    background: linear-gradient(180deg, #ffffff, #f9fbff);
    border: 1px solid rgba(228, 233, 242, 0.95);
    border-left: 4px solid var(--accent);
    border-radius: 14px;
    box-shadow: 0 8px 20px rgba(26, 45, 77, 0.06);
}

.lightbox-empty {
    margin: auto;
    padding: 52px 24px;
    text-align: center;
    color: var(--body);
    font-size: 1rem;
    width: 100%;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.72);
    border: 1px dashed rgba(26, 45, 77, 0.16);
}

.image-preview {
    position: fixed;
    inset: 0;
    z-index: 65;
    display: grid;
    place-items: center;
    padding: clamp(16px, 3vw, 28px);
}

.image-preview[hidden] {
    display: none !important;
}

.image-preview-backdrop {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse at 20% 15%, rgba(63, 169, 245, 0.2), transparent 58%),
        radial-gradient(ellipse at 80% 85%, rgba(245, 185, 76, 0.16), transparent 55%),
        rgba(4, 12, 24, 0.9);
    backdrop-filter: blur(12px);
    opacity: 0;
    transition: opacity 0.34s ease;
}

.image-preview.is-open .image-preview-backdrop,
.image-preview.is-closing .image-preview-backdrop {
    opacity: 1;
}

.image-preview-dialog {
    position: relative;
    z-index: 1;
    margin: 0;
    width: min(1080px, 100%);
    max-height: calc(100vh - clamp(24px, 5vh, 48px));
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-radius: 22px;
    background:
        linear-gradient(165deg, rgba(255, 255, 255, 0.98) 0%, rgba(245, 249, 255, 0.97) 48%, rgba(236, 243, 252, 0.96) 100%);
    border: 1px solid rgba(228, 233, 242, 0.95);
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.7) inset,
        0 40px 90px rgba(0, 0, 0, 0.48),
        0 0 60px rgba(63, 169, 245, 0.1);
    transform: translateY(20px) scale(0.94);
    opacity: 0;
    transition: transform 0.36s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.36s ease;
}

.image-preview-header {
    position: sticky;
    top: 0;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: clamp(14px, 2.8vw, 18px) clamp(16px, 3vw, 22px);
    border-bottom: 1px solid rgba(228, 233, 242, 0.95);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 251, 255, 0.96));
    flex-shrink: 0;
}

.image-preview-content {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    display: grid;
    gap: clamp(14px, 2.5vw, 18px);
    padding: clamp(16px, 3vw, 24px);
    scroll-behavior: smooth;
}

.image-preview.is-open .image-preview-dialog {
    transform: translateY(0) scale(1);
    opacity: 1;
}

.image-preview.is-closing .image-preview-dialog {
    transform: translateY(12px) scale(0.97);
    opacity: 0;
}

.image-preview-frame {
    width: 100%;
    border-radius: 18px;
    overflow: hidden;
    border: 1px solid rgba(228, 233, 242, 0.95);
    background: linear-gradient(180deg, #f4f7fb, #eef3fa);
    box-shadow: 0 18px 42px rgba(26, 45, 77, 0.14);
}

#image-preview-img {
    width: 100%;
    max-height: min(72vh, 780px);
    object-fit: contain;
    display: block;
}

.image-preview-caption {
    margin: 0;
    flex: 1;
    min-width: 0;
    padding: 0;
    text-align: left;
    font-family: "Montserrat", sans-serif;
    font-size: clamp(0.92rem, 2.4vw, 1.08rem);
    font-weight: 700;
    color: var(--heading);
    line-height: 1.45;
    letter-spacing: 0.01em;
    background: transparent;
    border: none;
    border-radius: 0;
    box-shadow: none;
    position: static;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.image-preview-caption::before {
    display: none;
}

.image-preview-actions {
    width: 100%;
    display: flex;
    justify-content: center;
}

.image-preview-actions-inner {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
    padding: 10px 14px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid rgba(228, 233, 242, 0.95);
    box-shadow: 0 10px 26px rgba(26, 45, 77, 0.1);
}

.gallery-empty {
    color: var(--body);
    margin: 0;
}

.form-field {
    margin: 0 0 14px;
}

.form-hint {
    margin: 0 0 14px;
    color: var(--body);
    font-size: 0.9rem;
    line-height: 1.6;
}

.image-panel {
    background: var(--white);
    border-radius: 16px;
    border: 1px solid var(--line);
    padding: 16px;
    box-shadow: 0 10px 24px rgba(26, 45, 77, 0.06);
    background: #fff;
}

.panel-title {
    margin: 0 0 12px;
    font-size: 1.05rem;
}

.image-pair {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.image-pair img {
    width: 100%;
    border-radius: 12px;
    border: 1px solid #edf1f6;
    aspect-ratio: 3 / 2;
    object-fit: cover;
}

.zoomable-image {
    cursor: zoom-in;
}

.image-col {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.image-label {
    align-self: flex-start;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 700;
    color: #7e8797;
}

.section-title {
    margin: 30px 0 12px;
    font-size: 1.45rem;
    letter-spacing: 0.01em;
    position: relative;
    display: inline-block;
}

.section-title::after {
    content: "";
    display: block;
    width: 52%;
    height: 3px;
    border-radius: 999px;
    margin-top: 7px;
    background: linear-gradient(90deg, var(--navy-soft), var(--accent));
}

.description-box {
    background: var(--white);
    border-left: 4px solid #f2c468;
    padding: 22px;
    border-radius: 12px;
    border: 1px solid var(--line);
    color: var(--body);
    line-height: 1.8;
    box-shadow: 0 8px 20px rgba(26, 45, 77, 0.05);
}

.form-card {
    max-width: 760px;
    background: var(--white);
    border-radius: 16px;
    border: 1px solid var(--line);
    padding: 24px;
    box-shadow: var(--shadow-soft);
}

form p {
    margin: 0 0 14px;
    color: var(--heading);
    font-weight: 500;
}

label {
    color: var(--heading);
    font-weight: 600;
}

input, textarea, select {
    width: 100%;
    border: 1px solid #d8e0ed;
    border-radius: 10px;
    padding: 12px;
    margin-top: 7px;
    font-family: inherit;
    font-size: 0.95rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: #8ccaf6;
    box-shadow: 0 0 0 4px rgba(63, 169, 245, 0.15);
}

.site-footer {
    flex-shrink: 0;
    margin-top: auto;
    border-top: 1px solid rgba(63, 169, 245, 0.2);
    background: linear-gradient(90deg, var(--navy-strong), var(--heading));
    backdrop-filter: blur(8px);
    position: relative;
    z-index: 2;
    width: 100%;
}

.footer-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 20px 0;
    color: rgba(235, 243, 255, 0.82);
    font-size: 0.88rem;
}

.footer-inner span:first-child {
    font-family: "Montserrat", sans-serif;
    font-weight: 700;
    letter-spacing: 0.06em;
    color: var(--white);
}

.form-actions {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-top: 14px;
    flex-wrap: wrap;
}

.sample-actions {
    margin-top: 10px;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.btn-danger {
    background: #fff;
    color: #8b1c13;
    border: 1px solid #edb3ac;
}

.btn-small {
    font-size: 0.84rem;
    padding: 8px 12px;
}

.auth-layout {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 24px;
    align-items: stretch;
}

.auth-info {
    background: linear-gradient(135deg, #f8fcff, #ffffff);
    border: 1px solid var(--line);
    border-radius: 18px;
    padding: 30px;
    box-shadow: var(--shadow-soft);
}

.auth-title {
    font-size: clamp(1.6rem, 3vw, 2.3rem);
    margin: 14px 0 12px;
    line-height: 1.2;
}

.auth-info p {
    color: var(--body);
    line-height: 1.8;
    margin: 0;
}

.auth-card {
    max-width: none;
}

.auth-card h2 {
    margin: 0 0 14px;
}


.app-modal {
    position: fixed;
    inset: 0;
    z-index: 55;
    display: grid;
    place-items: center;
}

.app-modal[hidden] {
    display: none !important;
}

.app-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(7, 18, 34, 0.62);
    backdrop-filter: blur(4px);
}

.app-modal-dialog {
    position: relative;
    z-index: 1;
    width: min(760px, 94vw);
    max-height: 86vh;
    overflow: auto;
    border-radius: 16px;
    background: #fff;
    border: 1px solid var(--line);
    padding: 18px;
    box-shadow: 0 24px 58px rgba(10, 24, 44, 0.34);
}

.app-modal-dialog h3 {
    margin: 0 0 14px;
}

.app-modal-close {
    position: absolute;
    top: 8px;
    right: 10px;
    border: none;
    background: transparent;
    font-size: 1.9rem;
    color: #79859a;
    cursor: pointer;
}

@media (max-width: 1024px) {
    :root {
        --page-gutter: clamp(22px, 4.5vw, 36px);
    }

    .nav-inner {
        padding: 16px 0;
        gap: 18px;
    }

    .actions {
        gap: 14px 18px;
    }

    .footer-inner {
        padding: 22px 0;
        gap: 14px;
    }

    .cases-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .lightbox-panel {
        width: min(860px, calc(100% - clamp(40px, 8vw, 80px)));
        height: min(76vh, calc(100% - clamp(64px, 12vh, 120px)));
    }

    .lightbox-header {
        padding: 16px 20px;
    }

    .lightbox-scroll {
        gap: 18px;
        padding: 18px 20px 22px;
    }

    .lightbox-slide {
        flex-basis: min(260px, 62vw);
    }

    .image-preview {
        padding: clamp(14px, 2.5vw, 22px);
    }

    .image-preview-dialog {
        max-height: calc(100vh - clamp(28px, 5vh, 40px));
    }

    #image-preview-img {
        max-height: min(68vh, 700px);
    }
}

@media (max-width: 860px) {
    :root {
        --page-gutter: clamp(18px, 5vw, 26px);
    }

    .nav-inner {
        flex-wrap: wrap;
        align-items: flex-start;
        padding: 14px 0 16px;
        gap: 14px;
    }

    .actions {
        width: 100%;
        gap: 12px 16px;
        justify-content: flex-start;
    }

    .nav-link {
        padding: 2px 0;
    }

    .site-footer .footer-inner {
        padding: 24px 0;
        gap: 12px;
    }

    .hero-detail-head,
    .footer-inner {
        flex-direction: column;
        align-items: flex-start;
    }

    .detail-grid,
    .image-pair,
    .pairs-grid,
    .cases-grid {
        grid-template-columns: 1fr;
    }

    .procedure-search-input {
        max-width: none;
    }

    .case-card-preview {
        gap: 8px;
    }

    .lightbox-panel {
        width: calc(100% - 24px);
        height: min(82vh, calc(100% - 40px));
        border-radius: 18px;
    }

    .lightbox-header {
        padding: 14px 16px;
        gap: 12px;
    }

    .lightbox-header-main {
        gap: 8px;
    }

    .lightbox-toolbar {
        width: 100%;
        justify-content: stretch;
    }

    .mode-btn {
        flex: 1;
        min-height: 46px;
        font-size: 0.88rem;
        padding: 10px 14px;
    }

    .lightbox-close,
    .image-preview-close {
        width: 46px;
        height: 46px;
        min-width: 46px;
        min-height: 46px;
    }

    .lightbox-scroll {
        gap: 14px;
        padding: 14px 16px 18px;
        scroll-padding-inline: 16px;
    }

    .lightbox-slide {
        flex-basis: min(240px, 84vw);
        gap: 12px;
    }

    .lightbox-caption {
        padding: 11px 12px;
        font-size: 0.86rem;
    }

    .gallery-crud-btn {
        min-height: 40px;
        font-size: 0.8rem;
        padding: 8px 14px;
    }

    .lightbox-slide-actions {
        opacity: 1;
        transform: translateY(0);
        pointer-events: auto;
        left: 8px;
        right: 8px;
        bottom: 8px;
    }

    .lightbox-zoom-hint {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
        font-size: 0.66rem;
        padding: 6px 10px;
    }

    .image-preview {
        padding: 12px;
    }

    .image-preview-dialog {
        width: 100%;
        max-height: calc(100vh - 24px);
        border-radius: 16px;
    }

    .image-preview-header {
        padding: 12px 14px;
        gap: 10px;
    }

    .image-preview-content {
        padding: 12px 14px 16px;
        gap: 12px;
    }

    .image-preview-caption {
        font-size: 0.9rem;
        white-space: normal;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    #image-preview-img {
        max-height: min(62vh, 560px);
    }

    .image-preview-actions-inner {
        width: 100%;
        border-radius: 14px;
        padding: 10px 12px;
    }

    .pair-images {
        grid-template-columns: 1fr 1fr;
    }

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