html {
    -webkit-text-size-adjust: none;
    text-size-adjust: none;
    font-size: 16px !important;
}

:root {
    --dash-primary: #9cbf56;
    --dash-secondary: #0f172a;
    --dash-sidebar-bg: #1e293b;
    --dash-top-nav-bg: #0f172a;
    --dash-text-light: #f8fafc;
    --dash-text-muted: #94a3b8;
    --dash-accent-violet: #8b5cf6;
    --dash-accent-teal: #14b8a6;
    --dash-accent-blue: #3b82f6;
    --dash-btn-grey: #334155;
    --dash-glass: rgba(255, 255, 255, 0.05);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: #ffffff;
    color: #1e293b;
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
}

/* Layout Hierarchy */
.dashboard-container {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* Utility Menu Bar */
.utility-bar {
    background: linear-gradient(to bottom, #dce7f5, #f8fafc);
    padding: 0 10px;
    display: flex;
    justify-content: space-between;
    align-items: flex-end; /* Align items to the bottom to allow tabs to sit on the border */
    border-bottom: 1px solid #cbd5e1;
    font-size: 13px;
    color: #475569;
    height: 34px;
}

.utility-left {
    /* 남는 가로 공간을 이쪽이 받아서 .menu-items 가 가운데 정렬될 여지를 만든다 */
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    height: 100%;
    overflow: visible; /* Changed from hidden to allow dropdowns to show */
}

.utility-center {
    flex: 0 0 auto;
    display: flex;
    align-items: flex-end;
    gap: 4px;
    height: 100%;
}



.menu-icon {
    font-size: 1.15rem;
    color: #64748b;
    cursor: pointer;
}

.menu-items {
    /* 남는 공간을 모두 차지한 뒤 그 안에서 가운데 정렬한다.
       폭이 빠듯할 때는 자연스럽게 예전처럼 왼쪽부터 채워진다. */
    flex: 1 1 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.2rem;
}

.menu-item, .dm-menu-item {
    cursor: pointer;
    font-weight: 600;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    transition: background 0.2s;
    color: #475569;
    white-space: nowrap;
    font-size: 13.5px;
    position: relative;
    display: inline-flex;
    align-items: center;
}

.menu-item:hover, .dm-menu-item:hover {
    background-color: #f1f5f9;
    color: #1e293b;
}

.dm-only-menu {
    display: none !important;
}

body.active-dosimachine .dm-only-menu {
    display: inline-flex !important;
}

/* Dropdown visibility for both standard and dm- prefixed menus */
.dropdown:hover .dropdown-content,
.dm-menu-item:hover .dm-dropdown-content {
    display: block;
}



.utility-right {
    /* 콘텐츠 폭만 차지한다. 1 1 0 이면 남는 공간을 전부 흡수해 메뉴가 왼쪽에 몰린다 */
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    height: 100%;
    padding-bottom: 2px;
}

.home-icon {
    font-size: 1rem;
    color: #64748b;
    cursor: pointer;
    transition: color 0.2s;
}

.home-icon:hover {
    color: white;
}

/* Quick View Toggles */
.view-toggles {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-right: 12px;
    padding-right: 12px;
    border-right: 1px solid #e2e8f0;
}

.view-toggle-icon {
    font-size: 14px;
    cursor: pointer;
    opacity: 0.5;
    transition: all 0.2s ease;
    padding: 2px 6px;
    border-radius: 4px;
}

.view-toggle-icon:hover {
    opacity: 1;
    background-color: rgba(255, 255, 255, 0.1);
}

.view-toggle-icon.active {
    opacity: 1;
    background-color: #f8fafc;
    color: #0f172a;
    box-shadow: none;
}

/* Dropdown Menu */
.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-content, .dm-dropdown-content {
    display: none;
    position: absolute;
    background-color: white;
    min-width: 180px;
    box-shadow: 0 8px 16px rgba(0,0,0,0.1);
    border-radius: 8px;
    z-index: 1000;
    top: 100%;
    left: 0;
    margin-top: 0px; /* Ref 1: Removed 5px gap to prevent hover loss */
    border: 1px solid #e2e8f0;
    overflow: visible; /* Ref 2: Changed from hidden to avoid clipping */
}

.dropdown:hover .dropdown-content,
.dm-menu-item:hover .dm-dropdown-content {
    display: block;
}

/* Hover Bridge: Creates an invisible link between the menu button and the dropdown 
   to prevent losing hover state when moving the mouse across the vertical gap. */
.dropdown-content::before, .dm-dropdown-content::before {
    content: '';
    position: absolute;
    top: -15px; 
    left: 0;
    right: 0;
    height: 15px;
    background: transparent;
}

.dropdown-item, .dm-dropdown-item {
    padding: 10px 15px;
    font-size: 14px;
    color: #475569;
    cursor: pointer;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.dropdown-item:hover, .dm-dropdown-item:hover {
    background-color: #f1f5f9;
}

.dm-separator {
    height: 1px;
    background-color: #f1f5f9;
    margin: 4px 0;
}

.dropdown-item.active, .dm-dropdown-item.active {
    background-color: #eff6ff;
    color: #3b82f6;
    font-weight: 600;
}

/* Sub-dropdown & Shortcuts */
.menu-shortcut {
    margin-left: auto;
    font-size: 12.5px;
    color: #94a3b8;
    padding-left: 12px;
}

.dm-dropdown-item.has-submenu {
    position: relative;
    justify-content: space-between;
}

.dm-dropdown-item.has-submenu .dm-sub-dropdown-content {
    display: none;
    position: absolute;
    top: 0;
    left: 100%;
    background-color: white;
    min-width: 180px;
    box-shadow: 0 8px 16px rgba(0,0,0,0.1);
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    z-index: 1001;
}

.dm-dropdown-item.has-submenu:hover .dm-sub-dropdown-content {
    display: block;
}

.view-icon {
    font-size: 14px;
}

/* Top Navigation Bar */
.top-nav {
    background-color: var(--dash-top-nav-bg);
    padding: 4px 6px;
    display: flex;
    gap: 4px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    overflow-x: auto;
}

.top-nav::-webkit-scrollbar {
    display: none;
}

.nav-btn {
    flex: 1;
    min-width: 0;
    text-align: center;
    padding: 0.3rem 4px;
    border-radius: 8px;
    font-size: 10px;
    font-weight: 600;
    border: none;
    color: white;
    cursor: pointer;
    transition: all 0.2s ease;
    background-color: var(--dash-btn-grey);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.nav-btn:active {
    transform: scale(0.95);
    filter: brightness(1.2);
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.2);
}

.nav-btn:hover {
    transform: translateY(-2px);
    filter: brightness(1.1);
}

.nav-btn.service { background-color: #3730a3; } /* Indigo/Blue-ish */

/* Sidebar */
.sidebar {
    width: 170px;
    background-color: var(--dash-sidebar-bg);
    color: var(--dash-text-light);
    display: flex;
    flex-direction: column;
    padding: 12px;
    gap: 16px;
    transition: all 0.3s ease;
    overflow-x: hidden;
}

.sidebar.collapsed {
    width: 0;
    padding: 0;
    margin: 0;
    opacity: 0;
    pointer-events: none;
}

.sidebar h2 {
    font-size: 18px;
    color: #93c5fd;
    margin-bottom: 1rem;
}

.sidebar-section {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.sidebar-label {
    font-size: 12px;
    color: var(--dash-text-muted);
}

.sidebar select, .sidebar input {
    width: 100%;
    padding: 64px 96px;
    border-radius: 6px;
    background-color: var(--dash-secondary);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
    font-size: 13.6px;
}

.sidebar-footer-text {
    margin-top: 32px;
    font-size: 13.5px;
    color: var(--dash-text-muted);
    line-height: 1.5;
}

/* Main Page Brochure Button (Slide 1 Integrated) */
.main-brochure-btn {
    position: relative;
    margin-top: 20px;
    margin-left: -390px; /* Desktop alignment offset */
    background: linear-gradient(135deg, #0d9488, #14b8a6);
    color: white;
    padding: 12px 28px;
    border-radius: 50px;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 15px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 15px rgba(13, 148, 136, 0.3);
    border: 1.5px solid rgba(255, 255, 255, 0.2);
    z-index: 10;
}

/* Mobile Responsiveness */
@media (max-width: 1024px) {
    .main-brochure-btn {
        margin-left: 0; /* Clear desktop offset */
        margin-right: 0;
        transform: scale(0.9);
    }
}

@media (max-width: 768px) {
    .main-brochure-btn {
        margin-left: 0;
        padding: 10px 20px;
        transform: scale(0.85); /* Slightly smaller for mobile */
    }
}

.main-brochure-btn:hover {
    transform: translateY(-5px) scale(1.05);
    box-shadow: 0 10px 25px rgba(13, 148, 136, 0.45);
    filter: brightness(1.1);
}

/* Maintain hover effect even with mobile scale */
@media (max-width: 1024px) {
    .main-brochure-btn:hover {
        transform: scale(0.95) translateY(-5px);
    }
}

.main-brochure-btn .btn-icon {
    font-size: 22px;
    background: rgba(255, 255, 255, 0.2);
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    flex-shrink: 0;
}

.main-brochure-btn .btn-text {
    display: flex;
    flex-direction: column;
}

.main-brochure-btn .btn-label {
    font-size: 14px;
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -0.01em;
}

.main-brochure-btn .btn-sub {
    font-size: 10px;
    font-weight: 500;
    opacity: 0.9;
}

/* Main Content Area */
.main-content {
    flex: 1;
    background-color: white;
    padding: 0; /* Removed fixed 2rem padding */
    display: flex;
    flex-direction: column;
    position: relative;
    overflow-y: auto;
}

.dashboard-home {
    padding: 0;
}

.content-inner {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 32px;
}

.hero-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 32px;
}

.sample-screen {
    display: none;
    flex: 1;
    background-color: #f8fafc;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    color: #cbd5e1;
    font-weight: 700;
}

.active-view .sample-screen {
    display: flex;
}

/* To-Do List Component */
.todo-panel {
    width: 320px;
    background: #f8fafc;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    border: 1px solid #e2e8f0;
}

.todo-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.todo-title {
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-add {
    background-color: var(--dash-accent-blue);
    color: white;
    border: none;
    padding: 4.8px 9.6px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
}

.todo-item {
    display: flex;
    gap: 12.8px;
    margin-bottom: 16px;
}

.todo-checkbox {
    width: 18px;
    height: 18px;
    margin-top: 3.2px;
}

.todo-text-group {
    display: flex;
    flex-direction: column;
    gap: 3.2px;
}

.todo-date {
    font-size: 11.2px;
    color: var(--dash-text-muted);
    font-weight: 600;
}

.todo-desc {
    font-size: 13.6px;
    color: #475569;
}

/* Footer Section */
.content-footer {
    margin-top: auto;
    text-align: right;
    padding-top: 32px;
    color: var(--dash-text-muted);
}

.version-info {
    font-size: 12px;
}

/* Category Content Transition */
.sidebar-controls, .sidebar-content {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.sidebar-img {
    width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 0;
}

.category-sidebar {
    display: none;
    margin-top: 24px; /* Add some space above the file list when in MyQA view */
}

.active-myqa .home-sidebar { display: none; }
.active-myqa #myqa-sidebar { display: flex; }

.active-myqasql .home-sidebar { display: none; }
.active-myqasql #myqasql-sidebar { display: flex; }

.active-tlog .home-sidebar { display: none; }
.active-tlog #tlog-sidebar { display: flex; }

.active-mpc .home-sidebar { display: none; }
.active-mpc #mpc-sidebar { display: flex; }

.active-bcplus .home-sidebar { display: none; }
.active-bcplus #bcplus-sidebar { display: flex; }

.active-beamcheck .home-sidebar { display: none; }
.active-beamcheck #beamcheck-sidebar { display: flex; }

.active-quickcheck .home-sidebar { display: none; }
.active-quickcheck #quickcheck-sidebar { display: flex; }

.active-fieldanalysis .home-sidebar { display: none; }
.active-fieldanalysis #fieldanalysis-sidebar { display: flex; }

.active-starshot .home-sidebar { display: none; }
.active-starshot #starshot-sidebar { display: flex; }

.active-wlutz .home-sidebar { display: none; }
.active-wlutz #wlutz-sidebar { display: flex; }

.active-picketfence .home-sidebar { display: none; }
.active-picketfence #picketfence-sidebar { display: flex; }

.active-output .home-sidebar { display: none; }
.active-output #output-sidebar { display: flex; }

.active-gangle .home-sidebar { display: none; }
.active-gangle #gangle-sidebar { display: flex; }

.active-pdd .home-sidebar { display: none; }
.active-pdd #pdd-sidebar { display: flex; }

.active-profile .home-sidebar { display: none; }
.active-profile #profile-sidebar { display: flex; }

.active-gating .home-sidebar { display: none; }
.active-gating #gating-sidebar { display: flex; }

.active-study .home-sidebar { display: none; }
.active-study #study-sidebar { display: flex; }

.active-service .home-sidebar { display: none; }
.active-service #service-sidebar { display: flex; }
.active-daily .home-sidebar { display: none; }
.active-daily #daily-sidebar { display: flex; }

.active-monthly .home-sidebar { display: none; }
.active-monthly #monthly-sidebar { display: flex; }

.active-yearly .home-sidebar { display: none; }
.active-yearly #yearly-sidebar { display: flex; }

/* HUB Slide Integration directly into home view */
.full-image-container {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column; /* Ensure vertical layout for image + button */
    justify-content: center;
    align-items: center;
    background-color: white;
    overflow: hidden;
    position: relative;
}

/* Orbit wrapper for satellites on index page */
.index-orbit-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    perspective: 800px;
}

.full-home-img {
    width: 100%;
    height: 100%;
    object-fit: contain; /* Keeps aspect ratio but fills as much as possible */
    transition: all 0.3s ease;
}

/* ─── Index Page Orbiting Satellites ─── */
/* Follow the 3 orbital rings in the QA HUB image:
   Ring A: Near-horizontal equatorial ring
   Ring B: Tilted ~58° CW
   Ring C: Tilted ~-58° CCW */
.idx-satellite-orbit {
    position: absolute;
    top: 47%; left: 33%;
    transform-style: preserve-3d;
    pointer-events: none;
    border-radius: 50%;
}

.idx-orbit-1 {
    width: 320px; height: 320px;
    margin-left: -160px; margin-top: -160px;
    animation: idxOrbit1 10s linear infinite;
}
.idx-orbit-2 {
    width: 310px; height: 310px;
    margin-left: -155px; margin-top: -155px;
    animation: idxOrbit2 8s linear infinite;
}
.idx-orbit-3 {
    width: 305px; height: 305px;
    margin-left: -152px; margin-top: -152px;
    animation: idxOrbit3 12s linear infinite;
}

@keyframes idxOrbit1 {
    from { transform: rotateZ(5deg) rotateX(76deg) rotateZ(0deg); }
    to   { transform: rotateZ(5deg) rotateX(76deg) rotateZ(360deg); }
}
@keyframes idxOrbit2 {
    from { transform: rotateZ(58deg) rotateX(74deg) rotateZ(0deg); }
    to   { transform: rotateZ(58deg) rotateX(74deg) rotateZ(360deg); }
}
@keyframes idxOrbit3 {
    from { transform: rotateZ(-58deg) rotateX(74deg) rotateZ(0deg); }
    to   { transform: rotateZ(-58deg) rotateX(74deg) rotateZ(360deg); }
}

.idx-sat {
    position: absolute;
    width: 14px; height: 14px;
    background: radial-gradient(circle, #ffffff 0%, #5eead4 30%, #14b8a6 60%, #0d9488 100%);
    border-radius: 50%;
    box-shadow: 0 0 14px 5px rgba(20, 184, 166, 0.8),
                0 0 35px 10px rgba(20, 184, 166, 0.35),
                0 0 50px 18px rgba(20, 184, 166, 0.12);
    top: 0; left: 50%;
    margin-left: -7px;
    margin-top: -7px;
    animation: idxSatPulse 2s ease-in-out infinite;
}
@keyframes idxSatPulse {
    0%, 100% { filter: brightness(1); transform: scale(1); }
    50% { filter: brightness(1.5); transform: scale(1.15); }
}
.idx-sat::after {
    content: '';
    position: absolute;
    width: 22px; height: 5px;
    background: linear-gradient(90deg, transparent, rgba(20, 184, 166, 0.5), transparent);
    top: 4px; left: -14px;
    border-radius: 50%;
    filter: blur(2px);
}

.idx-sat-sm {
    width: 11px; height: 11px;
    margin-left: -5px; margin-top: -5px;
    box-shadow: 0 0 12px 5px rgba(94, 234, 212, 0.7),
                0 0 28px 9px rgba(94, 234, 212, 0.25);
    background: radial-gradient(circle, #ffffff 0%, #99f6e4 30%, #5eead4 60%, #2dd4bf 100%);
    animation: idxSatPulse 2.8s ease-in-out infinite;
}
.idx-sat-sm::after {
    width: 18px; height: 4px;
    top: 3px; left: -11px;
    background: linear-gradient(90deg, transparent, rgba(94, 234, 212, 0.4), transparent);
}

.idx-sat-xs {
    width: 9px; height: 9px;
    margin-left: -4px; margin-top: -4px;
    box-shadow: 0 0 10px 4px rgba(20, 184, 166, 0.7),
                0 0 22px 7px rgba(20, 184, 166, 0.2);
    background: radial-gradient(circle, #ffffff 0%, #ccfbf1 30%, #5eead4 60%, #14b8a6 100%);
    animation: idxSatPulse 3.5s ease-in-out infinite;
}
.idx-sat-xs::after { display: none; }

/* MyQA Folder & File Styles */
.folder-item {
    display: flex;
    align-items: center;
    gap: 12.8px;
    padding: 12.8px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 14.4px;
    font-weight: 600;
}

.folder-icon {
    color: #f59e0b; /* Yellow/Orange folder */
}

.file-list {
    display: flex;
    flex-direction: column;
    gap: 12.8px;
}

.file-item {
    padding: 12px;
    background: #243447;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.file-item:hover {
    background: #2d3f55;
}

.file-item.active {
    background: #243447;
    border-color: #3b82f6;
    box-shadow: 0 0 0 1px #3b82f6;
}

.file-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 5px;
    bottom: 5px;
    width: 5px;
    background-color: #3b82f6;
    border-radius: 0 4px 4px 0;
}

.file-meta {
    display: flex;
    justify-content: space-between;
    font-size: 10px;
    color: var(--dash-text-muted);
    margin-bottom: 4.8px;
}

.file-name {
    font-size: 12.5px;
    font-weight: 600;
    color: var(--dash-text-light);
    word-break: break-all;
    display: block;
    margin-bottom: 8px;
}

.file-badge {
    background-color: #ef4444; /* PDF Red */
    color: white;
    font-size: 10.4px;
    padding: 1.6px 6.4px;
    border-radius: 4px;
    font-weight: 800;
}

/* Report Display Area */
.report-view {
    display: none;
    width: 100%;
    height: 100%;
    background-color: transparent;
    padding: 0;
    overflow-y: auto;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
}

.report-frame {
    background-color: transparent;
    box-shadow: none;
    width: 100%;
    min-height: 100vh;
    padding: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    margin-top: 0;
}

.report-image {
    width: 100%;
    height: auto;
    object-fit: contain;
}

.active-report .dashboard-home,
.active-report .sample-screen {
    display: none;
}

.active-report .report-view {
    display: flex !important;
}

/* Ensure all DM views are hidden when a report is active */
.active-report .dosimachine-home,
.active-report .dm-hero,
.active-report .dm-feature-grid,
.active-report .dm-field-analysis-view,
.active-report .dm-starshot-analysis-view,
.active-report .dm-picket-fence-analysis-view,
.active-report .dm-winston-lutz-analysis-view,
.active-report .dm-photon-calibration-view,
.active-report .dm-ele-calibration-view,
.active-report .dm-mlc-log-view,
.active-report .dm-mpc-analyzer-view,
.active-report .dm-gating-qa-view,
.active-report .dm-invert-color-view,
.active-report .dm-dicom-composite-view,
.active-report .dm-profile-comparison-view,
.active-report .dm-pdd-comparison-view,
.active-report .dm-convert-to-accept-view,
.active-report .dm-save-profile-asc-view,
.active-report .dm-vertual-gantry-starshot-view,
.active-report .dm-gantry-angle-cal-view,
.active-report .dm-profile-report-view,
.active-report .dm-3d-epid-pdd-view,
.active-report .dm-configuration-view {
    display: none !important;
}

/* HUB Section Integration inside Dashboard */
.hub-nav-list {
    display: flex;
    flex-direction: column;
    gap: 12.8px;
}

.hub-sidebar-item {
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 11px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.hub-sidebar-item:hover {
    background: rgba(255, 255, 255, 0.1);
}

.hub-sidebar-item.active {
    background: #9cbf56;
    color: #0f172a;
    font-weight: 700;
}

.hub-sidebar-item .nav-num {
    opacity: 0.6;
    margin-right: 6px;
    font-size: 10px;
}

/* Slide Styles for Dashboard */
.hub-main-dashboard {
    padding: 0;
    height: 100%;
    overflow: hidden;
}

.hub-slide {
    display: none;
    animation: slideIn 0.4s ease-out forwards;
}

.hub-slide.active {
    display: block;
}

/* Main Navigation Tabs in Utility Bar */
.main-tab {
    padding: 6px 25px;
    border-radius: 10px 10px 0 0;
    background: #334155;
    color: #94a3b8;
    font-weight: 700;
    font-size: 13.5px;
    letter-spacing: -0.02em;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid transparent;
    border-bottom: none;
    margin-bottom: -2px; /* Pull down to overlap with parent border */
    white-space: nowrap;
    opacity: 0.85;
}

.main-tab:hover {
    color: #f8fafc;
    background: #1e293b;
    opacity: 1;
}

.main-tab.active {
    background: linear-gradient(to bottom, #1e293b, #0f172a);
    color: white;
    border-color: #0f172a;
    z-index: 10;
    opacity: 1;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.15);
}

.main-tab.dosimachine.active {
    background: #1e293b;
    color: #94a3b8;
}

body.active-dosimachine .main-tab.dosimachine.active {
    background: #1a5276;
    color: white;
}

.main-tab:hover {
    background: #2d3f55;
    color: #f8fafc;
}


/* DosiMachine Section Styles */
.dosimachine-home {
    display: none;
    flex-direction: column;
    padding: 0;
    animation: fadeIn 0.5s ease-out;
}

.active-dosimachine .dosimachine-home {
    display: flex;
}

.active-dosimachine .dashboard-home,
.active-dosimachine .report-view,
.active-dosimachine .sample-screen {
    display: none;
}

.dm-hero {
    background: white;
    color: #1a5276;
    padding: 2px 0; /* Minimal vertical space */
    text-align: center;
    position: relative;
    overflow: hidden;
}

/* Removed unused overlay and text/logo styles for cleaner layout */

.dm-hero-image-container {
    width: 100%;
    max-width: 1100px; /* Increased from 800px for better harmony */
    margin: 0 auto;
    overflow: hidden;
}

.dm-hero-img-full {
    width: 100%;
    height: auto;
    display: block;
}

.dm-feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
    padding: 60px 40px;
    background: #f8fafc;
}

.dm-feature-card {
    background: white;
    padding: 40px;
    border-radius: 24px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
    border: 1px solid rgba(0,0,0,0.05);
    transition: all 0.3s ease;
}

.dm-feature-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 50px rgba(26, 82, 118, 0.1);
}

.dm-feature-icon {
    font-size: 40px;
    margin-bottom: 24px;
    display: block;
}

.dm-feature-card h3 {
    font-size: 22px;
    color: #1a5276;
    margin-bottom: 16px;
    font-weight: 700;
}

.dm-feature-card p {
    font-size: 15px;
    color: #64748b;
    line-height: 1.6;
}

.dm-value-section {
    padding: 80px 40px;
    background: white;
    display: flex;
    flex-wrap: wrap;
    gap: 60px;
    align-items: center;
}

.dm-value-image {
    flex: 1.2;
    min-width: 400px;
}

.dm-value-image img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
}

.dm-value-content {
    flex: 1;
    min-width: 400px;
}

.dm-value-content h2 {
    font-size: 36px;
    color: #1a5276;
    margin-bottom: 30px;
    font-weight: 800;
}

.dm-value-list {
    list-style: none;
}

.dm-value-item {
    padding-left: 40px;
    position: relative;
    margin-bottom: 24px;
}

.dm-value-item::before {
    content: '★';
    position: absolute;
    left: 0;
    color: #3b82f6;
    font-size: 24px;
}

.dm-value-item h4 {
    font-size: 18px;
    margin-bottom: 8px;
    font-weight: 700;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@media (max-width: 768px) {
    .dm-hero h1 { font-size: 32px; }
    .dm-hero p { font-size: 16px; }
    .dm-value-image { min-width: 100%; }
    .dm-value-content { min-width: 100%; }
}


/* DosiMachine Menu Bar */
.dm-menu-bar {
    display: flex;
    padding: 2px 10px;
    background-color: #f1f5f9;
    gap: 2px;
}

.dm-menu-item {
    position: relative;
    /* 좌우 여백을 줄여 메뉴바에 여유 공간을 만든다 (.menu-items 가운데 정렬용) */
    padding: 6px 10px;
    font-size: 13.5px;
    font-weight: 600;
    color: #475569;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.2s;
}

.dm-menu-item:hover {
    background-color: #f1f5f9;
    color: #1e293b;
}

/* Configuration Menu Button Hover Effect */
.config-menu-btn {
    user-select: none;
}
.config-menu-btn:hover {
    background: #25426b !important;
    color: #ffffff !important;
}
.config-menu-btn.active {
    background: #2b4c7e !important;
    color: #ffffff !important;
    border-left-color: #38bdf8 !important;
}

.dm-only-menu {
    display: none;
}

.active-dosimachine .dm-only-menu {
    display: block;
}

.dm-dropdown-item:hover {
    background-color: #f8fafc;
    color: #2563eb;
}

.dm-separator {
    height: 1px;
    background-color: #e2e8f0;
    margin: 4px 0;
}


.dm-tool-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    cursor: pointer;
    background-color: #1a5276;
    transition: all 0.2s;
    color: white;
    font-size: 18px;
}

.dm-tool-btn:hover {
    background-color: #2980b9;
}

.dm-tool-sep {
    width: 1px;
    height: 24px;
    background-color: rgba(255, 255, 255, 0.2);
}

.dm-zoom-label {
    color: #aed6f1;
    font-weight: 700;
    font-size: 14px;
    min-width: 50px;
    text-align: center;
}

/* DosiMachine Status Bar (Bottom) */
.dm-status-bar {
    display: none;
    align-items: center;
    padding: 8px 20px;
    background-color: #d6eaf8;
    border-top: 1px solid #a9cce3;
    gap: 20px;
    font-size: 13px;
}

.active-dosimachine .dm-status-bar {
    display: flex;
}

.dm-status-btn {
    padding: 6px 15px;
    background-color: #aed6f1;
    border: none;
    border-radius: 6px;
    color: #1a5276;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.dm-status-btn:hover {
    background-color: #85c1e9;
}

.dm-status-label {
    color: #1a5276;
    font-weight: 500;
}

.dm-grid-spacing {
    display: flex;
    align-items: center;
    gap: 8px;
}

.dm-grid-input {
    width: 50px;
    padding: 4px 8px;
    border: 1px solid #a9cce3;
    border-radius: 4px;
    text-align: center;
}

@keyframes slideIn {
    from { opacity: 0; transform: translateY(15px); }
    to { opacity: 1; transform: translateY(0); }
}

.hub-slide h3 {
    font-size: 24px;
    margin-bottom: 32px;
    color: var(--dash-secondary);
    display: flex;
    align-items: center;
    gap: 16px;
    border-bottom: 2px solid var(--dash-primary);
    padding-bottom: 12px;
}

.hub-content-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 48px;
    align-items: start;
}

.hub-text-content {
    padding-left: 96px;
}

.hub-text-content h4 {
    font-size: 20.8px;
    color: var(--dash-primary);
    margin: 24px 0 12.8px;
}

.hub-text-content p {
    font-size: 12.5px;
    color: #475569;
    line-height: 1.7;
    margin-bottom: 24px;
}

.hub-feature-list {
    list-style: none;
    margin-top: 16px;
}

.hub-feature-list li {
    position: relative;
    padding-left: 1.8rem;
    margin-bottom: 1rem;
    font-weight: 600;
    font-size: 13.5px;
}

.hub-feature-list li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: var(--dash-primary);
    font-weight: 800;
}

.hub-feature-list li span {
    display: block;
    font-size: 13.6px;
    color: #64748b;
    font-weight: 400;
}

.hub-image-box {
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    border: 1px solid rgba(0,0,0,0.05);
}

.hub-image-box img, .hub-video {
    width: 100%;
    height: auto;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.video-box {
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.video-caption-box {
    padding: 19.2px;
    background-color: #f8fafc;
    border-radius: 12px;
    border-left: 4px solid var(--dash-accent-blue);
}

.video-caption-box p {
    font-size: 13.6px;
    line-height: 1.6;
    color: #475569;
    font-weight: 500;
    margin: 0;
    word-break: keep-all;
}

/* Target Cards */
.target-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    margin-top: 32px;
}

.target-card {
    padding: 1.5rem;
    background: #f8fafc;
    border-radius: 16px;
    border: 1px solid rgba(0,0,0,0.05);
    transition: all 0.3s ease;
}

.target-card h5 {
    color: var(--dash-secondary);
    margin-bottom: 12.8px;
    font-size: 17.6px;
}

/* Slide 6 Footer Visual */
.hub-footer-visual {
    margin-top: 48px;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0.9;
}

.footer-machine-img {
    max-width: 80%;
    height: auto;
    border-radius: 20px;
    filter: drop-shadow(0 20px 40px rgba(0,0,0,0.1));
    transition: transform 0.3s ease;
}

.footer-machine-img:hover {
    transform: translateY(-5px);
}

/* Module Info Grid in Slide 2 */
.module-info-wrap {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #f1f5f9;
}

.info-title {
    font-size: 15.2px;
    color: var(--dash-secondary);
    font-weight: 700;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.8rem 1.5rem;
}

.info-item {
    font-size: 0.75rem;
    color: #475569;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    line-height: 1.4;
}

.info-tag {
    background: #f1f5f9;
    color: var(--dash-secondary);
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-weight: 700;
    font-size: 0.65rem;
    min-width: 80px;
    text-align: center;
    border: 1px solid #e2e8f0;
}

/* Smart Phone Mode Optimizations */
.smartphone-mode {
    overflow-y: auto !important;
    max-width: 100vw;
    overflow-x: hidden;
}

.smartphone-mode .dashboard-container {
    flex-direction: column;
    overflow: visible;
}

.smartphone-mode:not(.active-dosimachine) .sidebar {
    width: 100%;
    height: auto;
    position: static;
    display: flex; /* Sidebar visible by default in mobile mode */
}

/* Specific rule to hide the sidebar when the collapsed class is present */
.smartphone-mode:not(.active-dosimachine) .sidebar.collapsed {
    display: none;
}
.smartphone-mode .sidebar h2 {
    display: none;
}

.smartphone-mode:not(.active-dosimachine) .top-nav {
    display: flex !important;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
    overflow-x: auto;
    position: sticky;
    top: 32px; /* Below utility bar (30px height + small buffer) */
    z-index: 999;
    flex-shrink: 0;
    min-height: 40px;
    background-color: var(--dash-top-nav-bg);
    width: 100%;
}

.smartphone-mode .utility-bar {
    display: flex !important;
    position: sticky;
    top: 0;
    z-index: 1000;
    height: 30px; /* Matched to desktop */
    padding: 0 10px;
    flex-shrink: 0;
    align-items: center;
    background-color: #ffffff;
    border-bottom: 1px solid #e2e8f0;
    width: 100%;
}

.smartphone-mode .utility-right {
    display: flex !important;
    align-items: center;
}

.smartphone-mode .view-toggles {
    display: flex !important;
}

.smartphone-mode .menu-icon, 
.smartphone-mode .home-icon {
    font-size: 18px;
    padding: 4px 8px;
    color: #94a3b8;
}

.smartphone-mode .menu-items {
    gap: 0.2rem; /* Matched to desktop */
}

.smartphone-mode .menu-item,
.smartphone-mode .dm-menu-item {
    font-size: 10px; /* Matched to desktop */
    padding: 0.2rem 0.4rem; /* Matched to desktop */
}

.smartphone-mode .nav-btn {
    min-width: 60px;
    padding: 4px 6px;
    font-size: 10px;
    flex-shrink: 0;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.smartphone-mode .main-content {
    padding: 0 !important; /* Full width for dashboard */
    overflow: visible !important;
}

.smartphone-mode .report-view {
    display: none;
    overflow: visible !important;
}

.smartphone-mode .active-report .report-view {
    display: flex;
}

.smartphone-mode .report-frame {
    padding: 0;
    overflow: visible !important;
}

.smartphone-mode .hub-content-grid {
    grid-template-columns: 1fr;
    gap: 20px;
}

.smartphone-mode .hub-text-content {
    padding-left: 0;
}

.smartphone-mode .hub-slide h3 {
    font-size: 18px;
    margin-bottom: 15px;
}

.smartphone-mode .hub-text-content h4 {
    font-size: 16px;
}

.smartphone-mode .hub-feature-list li {
    font-size: 12px;
}

.smartphone-mode .target-grid {
    grid-template-columns: 1fr;
}

.smartphone-mode .info-grid {
    grid-template-columns: 1fr;
}

.smartphone-mode .full-home-img {
    height: auto;
}

.smartphone-mode .video-caption-box p {
    font-size: 12px;
}

.smartphone-mode .report-frame {
    padding: 0;
}

/* Full width for all DosiMachine views in smartphone mode */
.smartphone-mode .dm-field-analysis-view,
.smartphone-mode .dm-starshot-analysis-view,
.smartphone-mode .dm-picket-fence-analysis-view,
.smartphone-mode .dm-winston-lutz-analysis-view,
.smartphone-mode .dm-photon-calibration-view,
.smartphone-mode .dm-ele-calibration-view,
.smartphone-mode .dm-mlc-log-view,
.smartphone-mode .dm-mpc-analyzer-view,
.smartphone-mode .dm-gating-qa-view,
.smartphone-mode .dm-invert-color-view,
.smartphone-mode .dm-dicom-composite-view,
.smartphone-mode .dm-profile-comparison-view,
.smartphone-mode .dm-pdd-comparison-view,
.smartphone-mode .dm-convert-to-accept-view,
.smartphone-mode .dm-save-profile-asc-view,
.smartphone-mode .dm-vertual-gantry-starshot-view,
.smartphone-mode .dm-gantry-angle-cal-view,
.smartphone-mode .dm-profile-report-view,
.smartphone-mode .dm-3d-epid-pdd-view,
.smartphone-mode .dm-configuration-view {
    padding: 0 !important; /* Override inline padding: 2rem */
    width: 100% !important;
}

/* Reduce header constraints on smartphone */
.smartphone-mode .dm-fa-header,
.smartphone-mode .dm-sa-header,
.smartphone-mode .dm-pfa-header,
.smartphone-mode .dm-wla-header,
.smartphone-mode .dm-pc-header,
.smartphone-mode .dm-ec-header,
.smartphone-mode .dm-ml-header,
.smartphone-mode .dm-ma-header,
.smartphone-mode .dm-gq-header,
.smartphone-mode .dm-ic-header,
.smartphone-mode .dm-dc-header {
    max-width: 100% !important;
    border-radius: 0 !important;
    padding: 1rem !important;
}

.smartphone-mode .dm-wla-content img,
.smartphone-mode .dm-fa-item img,
.smartphone-mode .dm-sa-item img,
.smartphone-mode .dm-pfa-item img {
    border-radius: 0 !important;
    box-shadow: none !important;
    width: 100% !important;
}

/* DosiMachine Field Analysis View Styles */
.dm-field-analysis-view {
    display: none;
    flex-direction: column;
    padding: 40px;
    background-color: #f8fafc;
    min-height: 100%;
    animation: fadeIn 0.5s ease-out;
}

.dm-fa-header {
    text-align: center;
    max-width: 800px;
    margin: 0 auto 40px;
    padding-bottom: 30px;
    border-bottom: 2px solid #e2e8f0;
}

.dm-fa-header h2 {
    font-size: 28px;
    color: #1e293b;
    margin-bottom: 15px;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.dm-fa-header p {
    font-size: 16px;
    color: #475569;
    line-height: 1.6;
    word-break: keep-all;
}

.dm-fa-content {
    display: flex;
    flex-direction: column;
    gap: 50px;
    max-width: 900px;
    margin: 0 auto;
}

.dm-fa-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    background: white;
    padding: 30px;
    border-radius: 20px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

.dm-fa-item:hover {
    transform: translateY(-5px);
}

.dm-fa-item img {
    width: 100%;
    max-width: 700px;
    height: auto;
    border-radius: 12px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
}

.dm-fa-item p {
    font-size: 15px;
    color: #334155;
    font-weight: 500;
    text-align: center;
    background: #f1f5f9;
    padding: 12px 25px;
    border-radius: 30px;
}

/* Smartphone Adjustments for Field Analysis */
/* Replaced with general rule */

.smartphone-mode .dm-fa-header h2 {
    font-size: 20px;
}

.smartphone-mode .dm-fa-header p {
    font-size: 14px;
}

.smartphone-mode .dm-fa-item {
    padding: 15px;
}

.smartphone-mode .dm-fa-item p {
    font-size: 13px;
    padding: 8px 15px;
}

/* DosiMachine Starshot Analysis View Styles */
.dm-starshot-analysis-view {
    display: none;
    flex-direction: column;
    padding: 40px;
    background-color: #f8fafc;
    min-height: 100%;
    animation: fadeIn 0.5s ease-out;
}

.dm-sa-header {
    text-align: center;
    max-width: 800px;
    margin: 0 auto 40px;
    padding-bottom: 30px;
    border-bottom: 2px solid #e2e8f0;
}

.dm-sa-header h2 {
    font-size: 28px;
    color: #1e293b;
    margin-bottom: 15px;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.dm-sa-header p {
    font-size: 16px;
    color: #475569;
    line-height: 1.6;
    word-break: keep-all;
}

.dm-sa-content {
    display: flex;
    flex-direction: column;
    gap: 50px;
    max-width: 900px;
    margin: 0 auto;
}

.dm-sa-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    background: white;
    padding: 30px;
    border-radius: 20px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

.dm-sa-item:hover {
    transform: translateY(-5px);
}

.dm-sa-item img {
    width: 100%;
    max-width: 700px;
    height: auto;
    border-radius: 12px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
}

.dm-sa-item p {
    font-size: 15px;
    color: #334155;
    font-weight: 500;
    text-align: center;
    background: #f1f5f9;
    padding: 12px 25px;
    border-radius: 30px;
}

/* Smartphone Adjustments for Starshot Analysis */
/* Replaced with general rule */

.smartphone-mode .dm-sa-header h2 {
    font-size: 20px;
}

.smartphone-mode .dm-sa-header p {
    font-size: 14px;
}

.smartphone-mode .dm-sa-content {
    gap: 30px;
}

.smartphone-mode .dm-sa-item {
    padding: 15px;
}

.smartphone-mode .dm-sa-item p {
    font-size: 13px;
    padding: 8px 15px;
}

/* DosiMachine Picket Fence Analysis View Styles */
.dm-picket-fence-analysis-view {
    display: none;
    flex-direction: column;
    padding: 40px;
    background-color: #f8fafc;
    min-height: 100%;
    animation: fadeIn 0.5s ease-out;
}

.dm-pfa-header {
    text-align: center;
    max-width: 800px;
    margin: 0 auto 40px;
    padding-bottom: 30px;
    border-bottom: 2px solid #e2e8f0;
}

.dm-pfa-header h2 {
    font-size: 28px;
    color: #1e293b;
    margin-bottom: 15px;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.dm-pfa-header p {
    font-size: 16px;
    color: #475569;
    line-height: 1.6;
    word-break: keep-all;
}

.dm-pfa-content {
    display: flex;
    flex-direction: column;
    gap: 50px;
    max-width: 900px;
    margin: 0 auto;
}

.dm-pfa-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    background: white;
    padding: 30px;
    border-radius: 20px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

.dm-pfa-item:hover {
    transform: translateY(-5px);
}

.dm-pfa-item img {
    width: 100%;
    max-width: 700px;
    height: auto;
    border-radius: 12px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
}

.dm-pfa-item p {
    font-size: 15px;
    color: #334155;
    font-weight: 500;
    text-align: center;
    background: #f1f5f9;
    padding: 12px 25px;
    border-radius: 30px;
}

/* Smartphone Adjustments for Picket Fence Analysis */
/* Replaced with general rule */

.smartphone-mode .dm-pfa-header h2 {
    font-size: 20px;
}

.smartphone-mode .dm-pfa-header p {
    font-size: 14px;
}

.smartphone-mode .dm-pfa-content {
    gap: 30px;
}

.smartphone-mode .dm-pfa-item {
    padding: 15px;
}

.smartphone-mode .dm-pfa-item p {
    font-size: 13px;
    padding: 8px 15px;
}

/* --- HUB Report View Styles --- */
.report-view {
    display: none;
    width: 100%;
    min-height: calc(100vh - 180px);
    padding: 60px 40px 40px 40px;
    background: #f1f5f9;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    animation: fadeIn 0.4s ease-out;
    position: relative;
    z-index: 100;
}

.active-report .report-view {
    display: flex !important;
    opacity: 1 !important;
    visibility: visible !important;
}

.report-frame {
    width: 100%;
    max-width: 1200px;
    background: transparent;
    padding: 0;
    border-radius: 0;
    box-shadow: none;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
}

.report-image {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    display: block;
}

.smartphone-mode .report-view {
    padding: 15px;
}

.smartphone-mode .report-frame {
    padding: 10px;
    border-radius: 10px;
}

/* --- Premium MyQA Summary View Styles --- */
.myqa-summary-view {
    display: flex; /* Changed from none to ensure it's managed correctly by JS and layout */
    flex-direction: column;
    padding: 3rem 2rem;
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    min-height: 100%;
    animation: premiumFadeIn 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes premiumFadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.myqa-premium-header {
    text-align: left;
    max-width: 1050px;
    margin: 0 auto 2.5rem;
    padding: 2.5rem;
    background: white;
    border-radius: 24px;
    border: 1px solid rgba(14, 165, 233, 0.15);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.04);
    position: relative;
    /* Removed overflow: hidden to prevent content clipping */
}

.myqa-premium-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 6px;
    background: linear-gradient(90deg, #0ea5e9, #6366f1);
}

.myqa-premium-header h2 {
    font-size: 2rem;
    color: #0f172a;
    margin-bottom: 2rem;
    font-weight: 800;
    letter-spacing: -0.025em;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.myqa-premium-header h2 .icon {
    color: #0ea5e9;
}

.myqa-premium-list {
    list-style: none;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    width: 100%;
}

.myqa-premium-item {
    flex: 1 1 300px;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 1.25rem;
    background: #f8fafc;
    border-radius: 16px;
    transition: all 0.3s ease;
    border: 1px solid transparent;
}

.myqa-premium-item:hover {
    transform: translateY(-5px);
    background: white;
    border-color: #0ea5e9;
    box-shadow: 0 12px 24px rgba(14, 165, 233, 0.08);
}

.myqa-premium-item .item-top-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.25rem;
}

.myqa-premium-item .item-num {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, #0ea5e9, #3b82f6);
    color: white;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
    flex-shrink: 0;
}

.myqa-premium-item .item-title {
    font-size: 1.15rem;
    color: #1e293b;
    font-weight: 700;
}

.myqa-premium-item .item-desc {
    color: #64748b;
    line-height: 1.6;
    font-size: 0.95rem;
    word-break: keep-all;
}

.myqa-content {
    display: flex;
    justify-content: center;
    width: 100%;
    animation: premiumSlideUp 1s cubic-bezier(0.16, 1, 0.3, 1) 0.2s backwards;
}

@keyframes premiumSlideUp {
    from { opacity: 0; transform: translateY(40px); }
    to { opacity: 1; transform: translateY(0); }
}

.myqa-content div {
    max-width: 1100px;
    width: 100%;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 30px 60px rgba(0,0,0,0.12);
    border: 1px solid rgba(0,0,0,0.05);
}

.myqa-content img {
    width: 100%;
    display: block;
    transition: transform 0.5s ease;
}

.myqa-content div:hover img {
    transform: scale(1.02);
}

/* Smartphone Adjustments for MyQA (Updated) */
.smartphone-mode .myqa-summary-view {
    padding: 1.5rem 1rem !important;
}

.smartphone-mode .myqa-premium-header {
    padding: 1.5rem !important;
    margin-bottom: 2rem;
    border-radius: 16px !important;
}

.smartphone-mode .myqa-premium-header h2 {
    font-size: 1.5rem;
}

.smartphone-mode .myqa-premium-list {
    flex-direction: column;
    gap: 1.5rem;
}

.smartphone-mode .myqa-content div {
    border-radius: 12px;
}


/* --- Premium StarShot Summary View Styles --- */
.starshot-summary-view {
    display: flex;
    flex-direction: column;
    padding: 3rem 2rem;
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
    min-height: 100%;
    animation: premiumFadeIn 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.starshot-premium-header {
    text-align: left;
    max-width: 1050px;
    margin: 0 auto 3.5rem;
    padding: 3rem;
    background: white;
    border-radius: 24px;
    border: 1px solid rgba(16, 185, 129, 0.15);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.04);
    position: relative;
}

.starshot-premium-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 6px;
    background: linear-gradient(90deg, #10b981, #059669);
}

.starshot-premium-header h2 {
    font-size: 2rem;
    color: #064e3b;
    margin-bottom: 2rem;
    font-weight: 800;
    letter-spacing: -0.025em;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.starshot-premium-header h2 .icon {
    color: #10b981;
}

.starshot-premium-list {
    list-style: none;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    width: 100%;
}

.starshot-premium-item {
    flex: 1 1 300px;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 1.5rem;
    background: #f0fdf4;
    border-radius: 16px;
    transition: all 0.3s ease;
    border: 1px solid transparent;
}

.starshot-premium-item:hover {
    transform: translateY(-5px);
    background: white;
    border-color: #10b981;
    box-shadow: 0 12px 24px rgba(16, 185, 129, 0.08);
}

.starshot-premium-item .item-num {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.starshot-premium-item .item-title {
    font-size: 1.2rem;
    color: #064e3b;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.starshot-premium-item .item-desc {
    color: #374151;
    line-height: 1.6;
    font-size: 0.95rem;
    word-break: keep-all;
}

.starshot-content {
    display: flex;
    justify-content: center;
    width: 100%;
    animation: premiumSlideUp 1s cubic-bezier(0.16, 1, 0.3, 1) 0.2s backwards;
}

.starshot-content div {
    max-width: 1100px;
    width: 100%;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 30px 60px rgba(0,0,0,0.12);
    border: 1px solid rgba(0,0,0,0.05);
}

.starshot-content img {
    width: 100%;
    display: block;
    transition: transform 0.5s ease;
}

.starshot-content div:hover img {
    transform: scale(1.02);
}

/* Smartphone Adjustments for StarShot */
.smartphone-mode .starshot-summary-view {
    padding: 1.5rem 1rem !important;
}

.smartphone-mode .starshot-premium-header {
    padding: 1.5rem !important;
    margin-bottom: 2rem;
    border-radius: 16px !important;
}

.smartphone-mode .starshot-premium-header h2 {
    font-size: 1.5rem;
}

.smartphone-mode .starshot-premium-list {
    flex-direction: column;
    gap: 1.5rem;
}

.smartphone-mode .starshot-content div {
    border-radius: 12px;
}


/* ── Menu Overview (상단 메뉴 클릭 시 하부 항목 한눈에 보기) ───────────── */
.dm-mo-lede {
    font-size: 1rem;
    line-height: 1.75;
    color: #475569;
    margin: 0 0 1.75rem;
    max-width: 62rem;
}

.dm-mo-list {
    list-style: none;
    padding: 0;
    margin: 0;
    border-top: 1px solid #e2e8f0;
}

.dm-mo-row {
    display: grid;
    grid-template-columns: minmax(0, 18rem) 1fr auto;
    gap: 0.25rem 1.5rem;
    align-items: baseline;
    padding: 0.85rem 0.75rem;
    border-bottom: 1px solid #eef2f7;
    border-radius: 6px;
}

.dm-mo-name {
    font-family: "Consolas", "Cascadia Mono", ui-monospace, monospace;
    font-size: 0.9rem;
    font-weight: 700;
    color: #0f172a;
    overflow-wrap: anywhere;
}

.dm-mo-desc {
    font-size: 0.94rem;
    color: #64748b;
    line-height: 1.6;
}

.dm-mo-go {
    font-size: 0.8rem;
    font-weight: 700;
    color: #0ea5e9;
    white-space: nowrap;
    opacity: 0;
    transition: opacity 0.18s;
}

.dm-mo-live {
    cursor: pointer;
    transition: background 0.18s, box-shadow 0.18s;
}

.dm-mo-live:hover {
    background: #f0f9ff;
    box-shadow: inset 3px 0 0 #0ea5e9;
}

.dm-mo-live:hover .dm-mo-name { color: #0369a1; }
.dm-mo-live:hover .dm-mo-go { opacity: 1; }

.dm-mo-foot {
    margin: 1.5rem 0 0;
    font-size: 0.85rem;
    color: #94a3b8;
}

.smartphone-mode .dm-mo-row {
    grid-template-columns: 1fr;
    gap: 0.2rem;
}

.smartphone-mode .dm-mo-go { display: none; }




@media (max-width: 768px) {
}

/* 스크린리더 전용 (레이아웃에 영향 없음) */
.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;
}

/* ─── 좁은 화면: 앱 메뉴바가 가로 스크롤/겹침을 만들지 않도록 여러 줄로 접는다 ───
   (.menu-items 에 overflow 를 주면 드롭다운이 잘리므로 wrap 으로 처리)
   한 줄에 [햄버거+메뉴+탭+아이콘]이 모두 들어가려면 약 1345px 이 필요하다.
   여유를 두어 1399px 이하에서 접는다. */
@media (max-width: 1399px) {
    .utility-bar {
        height: auto;
        min-height: 34px;
        flex-wrap: wrap;
        row-gap: 4px;
        padding: 4px 8px;
        align-items: center;
    }
    /* height:100% 가 auto 높이 컨테이너 안에서 잘못 해석되므로 해제한다 */
    .utility-left,
    .utility-center,
    .utility-right {
        height: auto;
    }
    .utility-left {
        flex: 1 1 100%;
        min-width: 0;
        gap: 0.5rem;
    }
    .menu-items {
        flex-wrap: wrap;
        row-gap: 2px;
    }
    .utility-center {
        flex: 1 1 auto;
        align-items: center;
        flex-wrap: wrap;
    }
    .utility-right {
        flex: 0 0 auto;
        margin-left: auto;
    }
    .main-tab { margin-bottom: 0; }
}

.dm-guide-pill,
.dm-brochure-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border-radius: 30px;
    padding: 0.55rem 1.6rem;
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    white-space: nowrap;
}

.dm-guide-pill {
    background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
    border: 1.5px solid #38bdf8;
    color: #ffffff;
    box-shadow: 0 4px 15px rgba(2, 132, 199, 0.35);
}

.dm-brochure-pill {
    background: #ffffff;
    border: 1.5px solid #cbd5e1;
    color: #0f172a;
    text-decoration: none;
    box-shadow: 0 2px 10px rgba(15, 23, 42, 0.08);
    transition: border-color 0.18s ease, color 0.18s ease,
                box-shadow 0.18s ease, transform 0.18s ease;
}

.dm-brochure-pill:hover,
.dm-brochure-pill:focus-visible {
    border-color: #0284c7;
    color: #0369a1;
    box-shadow: 0 4px 15px rgba(2, 132, 199, 0.22);
    transform: translateY(-1px);
}

@media (max-width: 520px) {
    .dm-guide-pill,
    .dm-brochure-pill {
        padding: 0.5rem 1.1rem;
        font-size: 0.88rem;
    }
}

/* ─── 홈 안내 배지 + 브로슈어 바로가기 ─── */
.dm-guide-row {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.7rem;
    margin: 0.2rem 0 1rem 0;
}

/* 두 배지는 형태·크기·그림자 처리를 공유하고 색으로만 구분한다 */
.dm-guide-pill,
.dm-brochure-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border-radius: 30px;
    padding: 0.55rem 1.6rem;
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    line-height: 1.2;
    color: #ffffff;
    white-space: nowrap;
}

/* 안내 배지 — 기존 디자인 그대로 */
.dm-guide-pill {
    background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
    border: 1.5px solid #38bdf8;
    box-shadow: 0 4px 15px rgba(2, 132, 199, 0.35);
}

/* 브로슈어 — 같은 형태, 사이트의 기존 브로슈어 색(teal) */
.dm-brochure-pill {
    background: linear-gradient(135deg, #0d9488 0%, #14b8a6 100%);
    border: 1.5px solid #5eead4;
    box-shadow: 0 4px 15px rgba(13, 148, 136, 0.35);
    text-decoration: none;
    transition: box-shadow 0.2s ease, transform 0.2s ease, filter 0.2s ease;
}

.dm-brochure-pill:hover,
.dm-brochure-pill:focus-visible {
    color: #ffffff;
    filter: brightness(1.07);
    box-shadow: 0 7px 20px rgba(13, 148, 136, 0.45);
    transform: translateY(-2px);
}

@media (max-width: 520px) {
    .dm-guide-pill,
    .dm-brochure-pill {
        padding: 0.5rem 1.1rem;
        font-size: 0.88rem;
    }
}
