:root {
    --color-bg-page: #f8fcfe;
    --color-bg-surface: #ffffff;
    --color-bg-article: #f8fcfe;
    --color-bg-navbar: #354052;
    --color-bg-footer: #333333;
    --color-ad-blue: #00a0f0;
    --color-ad-border: #0078c8;
    --color-ad-text: #ffffff;
    --color-brand-accent: #ffa101;
    --color-title-bar: #303030;
    --color-text-bar: #bbc5d5;
    --color-text-primary: #11141a;
    --color-text-muted: #354052;
    --color-border: #e2e7ee;
    --toolbar-height: 4.5rem;
    --desktop-min-width: 1200px;
    --container-max-width: 1180px;
    --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
    width: 100%;
    min-height: 100%;
    font-family: var(--font-sans);
    background-color: var(--color-bg-surface);
    color: var(--color-text-primary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ==================== UTILITY STATES ==================== */
.is-hidden {
    display: none !important;
}

/* ==================== TOP TOOLBAR ==================== */
.preview-toolbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--toolbar-height);
    background-color: var(--color-bg-surface);
    box-shadow: 0 1px 10px 1px rgba(0, 0, 0, 0.12);
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 1.5rem;
}

.toolbar-actions {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    background-color: #f1f5f9;
    padding: 0.375rem;
    border-radius: 0.5rem;
}

.device-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 0.375rem;
    background-color: transparent;
    color: var(--color-text-muted);
    font-family: inherit;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.device-btn:hover {
    color: var(--color-text-primary);
}

.device-btn.is-active {
    background-color: var(--color-bg-surface);
    color: var(--color-brand-accent);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

.device-icon {
    width: 1.25rem;
    height: 1.25rem;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* ==================== MAIN STAGE ==================== */
.preview-stage {
    padding-top: var(--toolbar-height);
    min-height: 100vh;
}

/* ==================== AD BANNER UNITS ==================== */
.ad-unit {
    position: relative;
    overflow: visible;
    user-select: none;
}

.ad-banner {
    width: 100%;
    height: 100%;
    background-color: var(--color-ad-blue);
    border: 1px solid var(--color-ad-border);
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 0.25rem;
}

.ad-dimension {
    color: var(--color-ad-text);
    font-weight: 700;
    font-size: 1.5rem;
    letter-spacing: 0.02em;
    line-height: 1.2;
}

/* Close (X) Button on Dismissible Banners */
.ad-close-btn {
    position: absolute;
    top: 0;
    left: 0;
    width: 1.375rem;
    height: 1.375rem;
    padding: 0;
    border: none;
    background-color: var(--color-bg-surface);
    color: var(--color-text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    transition: background-color 0.15s ease, color 0.15s ease;
}

.ad-close-btn:hover {
    background-color: #f1f5f9;
    color: #000000;
}

.ad-close-btn--floating {
    top: -1.375rem;
    left: 0;
}

.close-icon {
    width: 0.875rem;
    height: 0.875rem;
    stroke: currentColor;
    stroke-width: 2.2;
    stroke-linecap: round;
}

/* Specific Ad Zone Dimensions */
.ad-zone-header {
    width: 100%;
    height: 5.625rem; /* 90px */
}

.ad-zone-468x60 {
    width: 29.25rem; /* 468px */
    height: 3.75rem; /* 60px */
    flex-shrink: 0;
}

.ad-zone-468x60 .ad-dimension {
    font-size: 1.25rem;
}

.ad-zone-300x250 {
    width: 18.75rem; /* 300px */
    height: 15.625rem; /* 250px */
    flex-shrink: 0;
}

.ad-zone-728x90 {
    width: 45.5rem; /* 728px */
    height: 5.625rem; /* 90px */
    margin: 0 auto 1.5rem;
}

.ad-zone-300x600 {
    width: 18.75rem; /* 300px */
    height: 37.5rem; /* 600px */
    margin: 0 auto 1.5rem;
}

.ad-zone-160x600 {
    width: 10rem; /* 160px */
    height: 37.5rem; /* 600px */
    margin: 0 auto 1.5rem;
}

.ad-zone-160x600 .ad-dimension {
    font-size: 1.25rem;
}

.ad-zone-970x250 {
    width: 60.625rem; /* 970px */
    height: 15.625rem; /* 250px */
    margin: 0 auto;
}

.ad-zone-sticky-desktop {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    height: 3rem; /* 48px */
    z-index: 150;
}

.ad-zone-sticky-desktop .ad-dimension {
    font-size: 1.125rem;
}

/* Mobile Ad Zone Dimensions */
.ad-zone-mobile-header {
    width: 100%;
    height: 5.625rem; /* 90px */
}

.ad-zone-mobile-header .ad-dimension {
    font-size: 1.25rem;
}

.ad-zone-320x100 {
    width: 100%;
    max-width: 20rem; /* 320px */
    height: 6.25rem; /* 100px */
    margin: 0 auto 1rem;
}

.ad-zone-320x100 .ad-dimension {
    font-size: 1.25rem;
}

.ad-zone-mobile-300x250 {
    width: 18.75rem; /* 300px */
    height: 15.625rem; /* 250px */
    margin: 0 auto 1.5rem;
}

.ad-zone-320x50 {
    width: 100%;
    max-width: 20rem; /* 320px */
    height: 3.125rem; /* 50px */
    margin: 0 auto 1.5rem;
}

.ad-zone-320x50 .ad-dimension {
    font-size: 1.125rem;
}

.ad-zone-sticky-mobile {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    height: 4.6875rem; /* 75px */
    z-index: 50;
}

.ad-zone-sticky-mobile .ad-banner {
    border-bottom-left-radius: 2.5rem;
    border-bottom-right-radius: 2.5rem;
}

.ad-zone-sticky-mobile .ad-dimension {
    font-size: 1.25rem;
}

/* ==================== MOCK SKELETON BARS ==================== */
.bar {
    border-radius: 0.625rem;
    margin-top: 0.5rem;
}

.bar--brand {
    background-color: var(--color-brand-accent);
    border-radius: 0.875rem;
    width: 12.5rem;
    height: 1.25rem;
    margin-top: 0;
    flex-shrink: 0;
}

.bar--nav {
    background-color: var(--color-bg-surface);
    border-radius: 0.375rem;
    width: 100%;
    height: 0.625rem;
    margin-top: 0;
}

.bar--title-full {
    background-color: var(--color-title-bar);
    width: 100%;
    height: 1.25rem;
}

.bar--title-part {
    background-color: var(--color-title-bar);
    width: 75%;
    height: 1.25rem;
}

.bar--line {
    background-color: var(--color-text-bar);
    width: 100%;
    height: 0.625rem;
}

.bar--line-thin {
    background-color: var(--color-text-bar);
    width: 100%;
    height: 0.3125rem;
}

.bar--line-thin-short {
    background-color: var(--color-text-bar);
    width: 70%;
    height: 0.3125rem;
}

.bar--line-accent {
    background-color: var(--color-brand-accent);
    width: 100%;
    height: 0.3125rem;
}

/* ==================== DESKTOP LAYOUT (FIXED FIDELITY) ==================== */
.view-desktop {
    width: 100%;
    overflow-x: auto;
}

.desktop-canvas {
    min-width: var(--desktop-min-width);
    padding-bottom: 3rem;
}

.mock-navbar {
    background-color: var(--color-bg-navbar);
    margin-bottom: 2rem;
}

.mock-navbar-inner {
    max-width: var(--container-max-width);
    height: 6.5rem;
    margin: 0 auto;
    padding: 0 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.mock-navbar-left {
    display: flex;
    align-items: center;
    gap: 5.5rem;
    width: 70%;
}

.mock-navbar-right {
    width: 18.9rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.mock-container {
    max-width: var(--container-max-width);
    margin: 0 auto;
}

.mock-columns {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
}

.mock-col-main {
    width: 74%;
}

.mock-col-sidebar {
    width: 26%;
}

.article-box {
    background-color: var(--color-bg-article);
    padding: 1rem 1.5rem;
    margin-bottom: 1.5rem;
}

.article-box--lg {
    min-height: 37.5rem; /* 600px */
}

.article-box--sm {
    min-height: 18.75rem; /* 300px */
}

.article-box--widget {
    min-height: 25rem; /* 400px */
    padding: 1rem;
}

.article-split {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 0 0.5rem;
}

.article-split-text {
    width: 50%;
}

.article-split-ad {
    width: 50%;
    display: flex;
    justify-content: center;
    padding-top: 0.3rem;
}

.widget-item {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    height: 6.25rem;
    margin-top: 1rem;
}

.widget-thumb {
    width: 60%;
    height: 100%;
    background-color: var(--color-bg-navbar);
    border-radius: 0.625rem;
}

.widget-lines {
    width: 40%;
    height: 100%;
}

.mock-billboard-row {
    padding: 0.5rem 0 2rem;
    display: flex;
    justify-content: center;
}

/* Mock Footer */
.mock-footer {
    background-color: var(--color-bg-footer);
    color: var(--color-bg-surface);
    min-height: 5rem;
}

.mock-footer-inner {
    max-width: var(--container-max-width);
    margin: 0 auto;
    padding: 2rem;
}

.mock-footer-grid {
    display: flex;
    justify-content: space-between;
}

.mock-footer-col {
    width: 20%;
}

.mock-footer-bottom {
    width: 46.66%;
    margin: 2rem auto 0;
}

/* ==================== MOBILE VIEW & CSS PHONE FRAME ==================== */
.view-mobile {
    background-color: var(--color-bg-page);
    min-height: calc(100vh - var(--toolbar-height));
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 3rem 1rem 5rem;
}

.phone-stage {
    display: flex;
    justify-content: center;
    width: 100%;
}

/* Pure CSS Smartphone Hardware Chassis */
.phone-frame {
    position: relative;
    width: 22.25rem; /* 356px outer width */
    height: 44.5rem; /* 712px outer height */
    background-color: #0b0d10;
    border-radius: 3.5rem;
    padding: 0.75rem;
    box-shadow:
        inset 0 0 0 2px #3a414e,
        inset 0 0 0 4px #161920,
        0 20px 50px rgba(17, 20, 26, 0.25);
    flex-shrink: 0;
}

/* Physical Side Buttons */
.phone-btn {
    position: absolute;
    background: linear-gradient(180deg, #2b303c, #161920);
    border-radius: 2px;
}

.phone-btn--mute {
    left: -3px;
    top: 6.25rem;
    width: 3px;
    height: 1.625rem;
}

.phone-btn--vol-up {
    left: -3px;
    top: 9.25rem;
    width: 3px;
    height: 3.125rem;
}

.phone-btn--vol-down {
    left: -3px;
    top: 13.125rem;
    width: 3px;
    height: 3.125rem;
}

.phone-btn--power {
    right: -3px;
    top: 10.5rem;
    width: 3px;
    height: 4.75rem;
}

/* Inner Display Screen */
.phone-screen {
    position: relative;
    width: 100%;
    height: 100%;
    background-color: var(--color-bg-surface);
    border-radius: 2.75rem;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* Status Bar & Notch */
.phone-statusbar {
    position: relative;
    height: 2.375rem;
    background-color: var(--color-bg-surface);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.25rem;
    z-index: 40;
    flex-shrink: 0;
    user-select: none;
}

.phone-time {
    font-size: 0.75rem;
    font-weight: 600;
    color: #000000;
    padding-top: 0.25rem;
}

.phone-notch {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 8.5rem;
    height: 1.625rem;
    background-color: #0b0d10;
    border-bottom-left-radius: 1rem;
    border-bottom-right-radius: 1rem;
}

.phone-camera {
    position: absolute;
    top: 50%;
    left: 0.75rem;
    transform: translateY(-50%);
    width: 0.75rem;
    height: 0.75rem;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 35%, #2b3548 0%, #12161f 70%);
}

.phone-status-icons {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    padding-top: 0.25rem;
}

.status-svg {
    width: 0.9rem;
    height: 0.75rem;
    fill: #000000;
}

.status-svg--battery {
    width: 1.35rem;
}

.battery-body {
    fill: none;
    stroke: #000000;
    stroke-width: 1.5;
    opacity: 0.4;
}

.battery-fill {
    fill: #000000;
}

/* Scrollable Container Inside Phone */
.phone-scroll-view {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding-bottom: 4.6875rem; /* Space for 75px sticky bottom banner */
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.phone-scroll-view::-webkit-scrollbar {
    display: none;
}

.mock-navbar--mobile {
    margin-bottom: 1rem;
}

.mock-navbar--mobile .mock-navbar-inner {
    height: 3.5rem;
    padding: 0 1rem;
}

.mock-navbar--mobile .mock-navbar-left {
    width: auto;
}

.mock-navbar--mobile .bar--brand {
    width: 4.875rem;
}

.mock-navbar--mobile .mock-navbar-right {
    width: 10.25rem;
    gap: 0.75rem;
}

.mobile-body-padding {
    padding: 0 0.875rem;
}

.article-box--mobile {
    padding: 1rem 1.25rem 1.25rem;
    margin-bottom: 1.5rem;
}

.article-box--widget-mobile {
    padding: 1rem;
    margin-bottom: 1.5rem;
}

.mock-footer--mobile {
    padding: 1.75rem 1rem 2rem;
}

.mock-footer-grid--mobile {
    gap: 1rem;
}

.mock-footer-grid--mobile .mock-footer-col {
    width: 50%;
}