:root {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: #f6f6f6;
}

body {
    margin: 0;
}

header {
    background: #111827;
    color: #f9fafb;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    text-align: center;
}

.page {
    max-width: 1100px;
    margin: 0 auto;
    padding: 1rem;
}

.controls {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
    font-size: 0.85rem;
    align-items: center;
}

button {
    padding: 0.4rem 0.8rem;
    border-radius: 999px;
    border: 1px solid #d1d5db;
    background: #ffffff;
    cursor: pointer;
    font-size: 0.8rem;
}

button:hover {
    background: #e5e7eb;
}

.layout {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1rem;
}

@media (max-width: 800px) {
    .layout {
        grid-template-columns: 1fr;
    }
}

main,
aside {
    background: #ffffff;
    padding: 1rem;
    border-radius: 0.5rem;
    box-shadow: 0 0 0 1px #e5e7eb;
}

h2 {
    margin-top: 0;
}

p {
    font-size: 0.9rem;
}

/* Ad slots */
.ad-slot {
    margin: 1rem 0;
    text-align: center;
    position: relative;
    border-radius: 0.25rem;
    border: 1px dashed #d1d5db;
    background: #f9fafb;
    min-height: 40px;
    display: flex;
    align-items: stretch;
    justify-content: center;
    overflow: hidden;
}

.ad-slot[data-size="728x90"] {
    height: 90px;
}

.ad-slot[data-size="300x250"] {
    width: 100%;
    max-width: 320px;
    height: 250px;
    margin-left: auto;
    margin-right: auto;
}

.ad-slot[data-size="300x600"] {
    width: 100%;
    max-width: 320px;
    height: 600px;
    margin-left: auto;
    margin-right: auto;
}

.ad-slot[data-size="320x50"] {
    height: 50px;
}

.ad-label {
    position: absolute;
    top: 4px;
    left: 6px;
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    background: rgba(17, 24, 39, 0.95);
    color: #e5e7eb;
    padding: 1px 6px;
    border-radius: 999px;
    z-index: 2;
}

.ad-status {
    font-size: 0.75rem;
    color: #6b7280;
    padding: 0.25rem 0.5rem;
}

/* Demo creative */
.demo-ad-creative {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    width: 100%;
    padding: 0.5rem 0.75rem;
    text-decoration: none;
    color: #f9fafb;
    box-sizing: border-box;
}

.demo-ad-creative--banner {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    padding: 0.35rem 0.75rem;
}

.demo-ad-brand {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    opacity: 0.85;
    margin-bottom: 0.15rem;
}

.demo-ad-headline {
    font-size: 0.9rem;
    font-weight: 600;
    line-height: 1.2;
    margin-bottom: 0.2rem;
}

.demo-ad-body {
    font-size: 0.75rem;
    opacity: 0.9;
    margin-bottom: 0.35rem;
}

.demo-ad-cta {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.9);
    color: #f9fafb;
    border: 1px solid rgba(148, 163, 184, 0.7);
}

.demo-ad-tagline {
    font-size: 0.7rem;
    opacity: 0.85;
    margin-left: 0.5rem;
}

/* Sticky bottom */
.sticky-wrapper {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 0.25rem;
    z-index: 20;
}

.sticky-inner {
    max-width: 728px;
    margin: 0 auto;
    position: relative;
}

.sticky-close {
    position: absolute;
    top: -14px;
    right: -4px;
    font-size: 11px;
    background: #111827;
    color: #f9fafb;
    padding: 2px 8px;
    border-radius: 999px;
    cursor: pointer;
}

/* Floating Left Banner 300x250 — docked to bottom-left */
.left-float-ad-wrapper {
    position: fixed;
    left: 0.5rem;
    bottom: 0.5rem;
    z-index: 25;
    display: flex;
    align-items: flex-end;
    justify-content: flex-start;
}

.left-float-inner {
    position: relative;
}

/* Close button */
.left-float-close {
    position: absolute;
    top: -12px;
    right: -12px;
    font-size: 11px;
    background: #111827;
    color: #fff;
    padding: 2px 6px;
    border-radius: 10px;
    cursor: pointer;
    z-index: 3;
}

/* Hide left floating ad on small screens */
@media (max-width: 900px) {
    .left-float-ad-wrapper {
        display: none;
    }
}


footer {
    text-align: center;
    margin-top: 3rem;
    padding-bottom: 3.25rem;
    font-size: 0.8rem;
    color: #6b7280;
}

/* Event log panel */
.log-panel {
    position: fixed;
    right: 0.75rem;
    bottom: 0.75rem;
    width: min(320px, 80vw);
    max-height: 40vh;
    background: rgba(17, 24, 39, 0.96);
    color: #e5e7eb;
    border-radius: 0.5rem;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
    display: flex;
    flex-direction: column;
    z-index: 30;
    font-size: 0.7rem;
}

.log-header {
    padding: 0.35rem 0.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(55, 65, 81, 0.9);
}

.log-header span {
    font-weight: 600;
    font-size: 0.75rem;
}

.log-body {
    padding: 0.35rem 0.5rem;
    overflow-y: auto;
}

.log-line {
    white-space: pre-wrap;
    margin-bottom: 0.15rem;
    color: #d1d5db;
}

.log-line span.meta {
    opacity: 0.7;
}

.log-actions button {
    border-color: #4b5563;
    background: #111827;
    color: #e5e7eb;
    font-size: 0.7rem;
}

.log-actions button:hover {
    background: #374151;
}