:root {
    --ink: #111827;
    --muted: #5b6472;
    --line: #dbe3ee;
    --bg: #f4f7fb;
    --panel: #ffffff;
    --night: #080d1a;
    --night-soft: #111827;
    --teal: #00a7b5;
    --rose: #ff4f8b;
    --yellow: #ffc629;
    --violet: #7c5cff;
    --green: #17a673;
    --shadow: 0 18px 50px rgba(17, 24, 39, .12);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    background:
        linear-gradient(180deg, #eef4f8 0, var(--bg) 420px);
    color: var(--ink);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    line-height: 1.5;
}
html,
body {
  touch-action: manipulation;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; }
main { min-height: calc(100vh - 156px); }

.topbar {
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 12px clamp(18px, 4vw, 56px);
    background: rgba(8, 13, 26, .96);
    color: #f8fafc;
    backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(255,255,255,.08);
    box-shadow: 0 18px 50px rgba(8, 13, 26, .22);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-weight: 900;
    font-size: 1.18rem;
}

.brand-logo {
    width: 32px;
    height: 32px;
    display: block;
    object-fit: contain;
    filter: drop-shadow(0 8px 18px rgba(0,0,0,.35));
}

.nav {
    display: flex;
    align-items: center;
    gap: 16px;
    color: #cbd5e1;
    font-weight: 700;
}
.nav a,
.nav-button {
    min-height: 36px;
    display: inline-flex;
    align-items: center;
    border-radius: 8px;
}
.nav a:hover, .nav-button:hover { color: #fff; }
.nav a {
    padding: 0 10px;
}
.nav a:hover {
    background: rgba(255,255,255,.08);
}
.inline-form { display: inline; margin: 0; }
.nav-button {
    border: 0;
    background: transparent;
    color: #cbd5e1;
    font: inherit;
    cursor: pointer;
    padding: 0 10px;
}

.flash {
    margin: 18px auto 0;
    width: min(1180px, calc(100% - 32px));
    padding: 12px 16px;
    border-radius: 8px;
    font-weight: 700;
}
.flash-ok { background: #e7f8f2; color: #0b6d4c; }
.flash-error { background: #ffeaf1; color: #a51547; }
.auth-note {
    margin: 0 0 16px;
    padding: 12px 14px;
    border-radius: 8px;
    background: #edf7f8;
    color: #0b6670;
    font-weight: 800;
}

.hero-grid {
    width: min(1180px, calc(100% - 32px));
    margin: 34px auto 0;
    display: grid;
    grid-template-columns: minmax(0, .9fr) minmax(360px, 1.1fr);
    gap: 28px;
    align-items: center;
}

.hero-copy h1,
.page-title h1,
.canvas-header h1,
.block-hero h1,
.paint-tools h1 {
    margin: 0;
    font-size: clamp(1.3rem, 5vw, 3.8rem);
    line-height: .94;
    letter-spacing: 0;
}
.lede { font-size: 1.15rem; color: var(--muted); max-width: 620px; }
.eyebrow {
    margin: 0 0 8px;
    color: var(--teal);
    font-weight: 900;
    text-transform: uppercase;
    font-size: .78rem;
    letter-spacing: .08em;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0 18px;
    border: 1px solid transparent;
    border-radius: 8px;
    font-weight: 900;
    cursor: pointer;
    transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}
.button:hover { transform: translateY(-1px); }
.button:disabled {
    cursor: not-allowed;
    opacity: .55;
    transform: none;
}
[hidden] {
    display: none !important;
}
.primary { background: var(--ink); color: #fff; box-shadow: var(--shadow); }
.secondary { background: #fff; border-color: var(--line); color: var(--ink); }
.whatsapp { background: #1fbf75; color: #fff; }
.hero-actions, .card-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 22px; }
.muted-action {
    color: var(--muted);
    font-weight: 900;
}
.dashboard-section {
    margin-top: 24px;
}
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 18px;
}
.dashboard-card {
    min-height: 220px;
    padding: 18px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 170px;
    gap: 18px;
    align-items: stretch;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 18px 44px rgba(17,24,39,.08);
}
.dashboard-card-info {
    min-width: 0;
    display: flex;
    flex-direction: column;
}
.dashboard-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}
.dashboard-card h2 {
    margin: 18px 0 6px;
    font-size: 2rem;
}
.dashboard-card p {
    margin: 0;
    color: var(--muted);
}
.dashboard-card .card-actions {
    margin-top: auto;
    padding-top: 18px;
}
.dashboard-drawing {
    position: relative;
    min-height: 174px;
    border: 1px solid #172033;
    border-radius: 8px;
    overflow: hidden;
    background:
        linear-gradient(135deg, rgba(255,255,255,.08) 25%, transparent 25%) 0 0 / 14px 14px,
        linear-gradient(135deg, transparent 75%, rgba(255,255,255,.08) 75%) 0 0 / 14px 14px,
        #0b1120;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,.04);
}
.dashboard-drawing canvas {
    width: 100%;
    height: 100%;
    min-height: 174px;
}
.dashboard-drawing span {
    position: absolute;
    inset: auto 12px 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 28px;
    border-radius: 999px;
    background: rgba(8,13,26,.76);
    color: #dbeafe;
    font-size: .8rem;
    font-weight: 900;
}
.dashboard-drawing.has-pixels span {
    display: none;
}
.status-pill {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: 0 10px;
    border-radius: 999px;
    font-size: .82rem;
    font-weight: 900;
}
.status-pill.pending {
    background: #fff5d8;
    color: #8a6400;
}
.status-pill.ready {
    background: #e7f8f2;
    color: #0b6d4c;
}
.status-pill.active {
    background: #eef0ff;
    color: #4935b5;
}

.mosaic-preview {
    display: grid;
    grid-template-columns: repeat(14, minmax(18px, 1fr));
    gap: 8px;
    aspect-ratio: 16 / 10;
    padding: clamp(16px, 3vw, 28px);
    background: #101827;
    border-radius: 8px;
    box-shadow: var(--shadow);
    overflow: hidden;
}
.mosaic-preview span {
    border-radius: 4px;
    background: var(--teal);
    opacity: .92;
}
.mosaic-preview span:nth-child(4n) { background: var(--rose); }
.mosaic-preview span:nth-child(5n) { background: var(--yellow); }
.mosaic-preview span:nth-child(7n) { background: var(--violet); }
.mosaic-preview span:nth-child(11n) { opacity: .2; }

.section {
    width: min(1180px, calc(100% - 32px));
    margin: 42px auto;
}
.page-title { margin-top: 24px;    width: calc(100% - 60px); }
.page-title p { max-width: 720px; color: var(--muted); }
.section-head {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
}
.section-head h2 { margin: 0; font-size: 1.6rem; }
.section-head a { color: var(--teal); font-weight: 900; }
.empty {
    padding: 18px;
    border: 1px dashed var(--line);
    border-radius: 8px;
    color: var(--muted);
    background: #fff;
}

.screen-list,
.block-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
}
.screen-card,
.block-card,
.quote-panel,
.form-panel,
.sponsor-panel,
.paint-tools {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 18px 44px rgba(17,24,39,.08);
}
.screen-card a,
.block-card a {
    display: block;
    padding: 18px;
    min-height: 180px;
}
.screen-preview-frame,
.screen-option-preview {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    margin: 0 0 14px;
    overflow: hidden;
    border: 1px solid #172033;
    border-radius: 8px;
    background: #0f172a;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,.04);
}
.screen-preview-canvas {
    display: block;
    width: 100%;
    height: 100%;
    image-rendering: pixelated;
}
.screen-card h2,
.screen-card h3,
.block-card h2,
.block-card h3,
.quote-panel h2 {
    margin: 10px 0 8px;
}
.screen-card p,
.block-card p,
.quote-panel p {
    color: var(--muted);
    margin: 0;
}
.screen-size,
.block-card span {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 0 10px;
    border-radius: 999px;
    background: #edf7f8;
    color: #0b6670;
    font-size: .82rem;
    font-weight: 900;
}
.block-card.sponsored { border-color: #ffd66b; }

.field-label {
    display: block;
    margin: 0 0 8px;
    color: var(--ink);
    font-weight: 900;
}
.screen-picker {
    margin-bottom: 18px;
}
.screen-picker-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 10px;
}
.screen-option {
    width: 100%;
    min-width: 0;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    color: var(--ink);
    text-align: left;
    cursor: pointer;
    transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease;
}
.screen-option:hover,
.screen-option:focus {
    outline: 0;
    border-color: #7fd8dc;
    box-shadow: 0 12px 28px rgba(17,24,39,.12);
    transform: translateY(-1px);
}
.screen-option.selected {
    border-color: var(--teal);
    box-shadow: 0 0 0 2px rgba(18,165,173,.18), 0 14px 32px rgba(17,24,39,.14);
}
.screen-option-preview {
    margin-bottom: 10px;
}
.screen-option-body {
    display: grid;
    gap: 4px;
}
.screen-option-title {
    color: var(--ink);
    font-weight: 900;
    line-height: 1.2;
}
.screen-option-size {
    color: var(--muted);
    font-size: .82rem;
    font-weight: 800;
}

.canvas-header,
.block-hero {
    width: min(1180px, calc(100% - 32px));
    margin: 34px auto 16px;
    display: flex;
    justify-content: space-between;
    align-items: end;
    gap: 18px;
}
.canvas-header h1,
.block-hero h1 { font-size: clamp(2rem, 5vw, 4.5rem); }
.canvas-header p,
.block-hero p { color: var(--muted); max-width: 680px; }

.sponsored-marquee {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto 14px;
    overflow: hidden;
    border: 1px solid rgba(148, 163, 184, .34);
    border-radius: 8px;
    background: linear-gradient(90deg, #050814 0, #0f172a 100%);
    box-shadow: 0 16px 34px rgba(8,13,26,.22);
}
.sponsored-marquee-track {
    min-width: max-content;
    display: inline-flex;
    align-items: stretch;
    gap: 10px;
    padding: 10px 12px;
    animation: sponsored-marquee-scroll 48s linear infinite;
}
.sponsored-marquee:hover .sponsored-marquee-track {
    animation-play-state: paused;
}
.sponsored-marquee-item {
    appearance: none;
    width: 340px;
    max-width: 76vw;
    min-height: 56px;
    display: grid;
    grid-template-columns: 40px minmax(0, 1fr);
    grid-template-rows: auto auto;
    column-gap: 10px;
    row-gap: 2px;
    align-items: center;
    padding: 10px;
    border: 1px solid rgba(148, 163, 184, .32);
    border-radius: 8px;
    background: rgba(15, 23, 42, .7);
    color: #e2e8f0;
    text-align: left;
    font: inherit;
    transition: border-color .16s ease, background .16s ease;
    cursor: pointer;
}
.sponsored-marquee-item:hover {
    border-color: rgba(45, 212, 191, .62);
    background: rgba(15, 23, 42, .94);
}
.sponsored-marquee-item img,
.sponsored-marquee-dot {
    grid-row: 1 / span 2;
    width: 40px;
    height: 40px;
    border-radius: 8px;
}
.sponsored-marquee-item img {
    object-fit: cover;
    border: 1px solid rgba(148, 163, 184, .38);
    background: #fff;
}
.sponsored-marquee-dot {
    display: block;
    background: linear-gradient(135deg, #0ea5b7 0, #34d399 100%);
    box-shadow: inset 0 0 0 1px rgba(255,255,255,.28);
}
.sponsored-marquee-item strong {
    color: #f8fafc;
    font-size: .9rem;
    font-weight: 900;
    line-height: 1.15;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.sponsored-marquee-item small {
    color: #cbd5e1;
    font-size: .78rem;
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}
@keyframes sponsored-marquee-scroll {
    from { transform: translateX(0); }
    to { transform: translateX(-50%); }
}

.canvas-shell,
.mini-canvas-shell,
.paint-canvas-shell {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
    background: #0f172a;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #172033;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    position: relative;
}
.mini-canvas-shell {
    width: min(920px, calc(100% - 32px));
}
.canvas-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    color: #dbeafe;
    font-weight: 800;
    padding: 10px 14px;
    border-bottom: 1px solid #27334c;
}
.toolbar-actions {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}
.block-canvas-toolbar {
    min-height: 52px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px 10px 16px;
    color: #e5edf7;
    font-weight: 900;
    border-bottom: 1px solid #27334c;
    background: #0b1120;
}
.icon-action {
    min-height: 36px;
    border: 1px solid rgba(255,255,255,.16);
    border-radius: 8px;
    padding: 0 12px;
    color: #f8fafc;
    background: rgba(255,255,255,.08);
    font: inherit;
    font-weight: 900;
    cursor: pointer;
}
.icon-action:hover {
    background: rgba(255,255,255,.14);
}
.canvas-focus-toggle {
    position: absolute;
    top: 64px;
    right: 14px;
    z-index: 3;
    width: 46px;
    height: 46px;
    border: 1px solid rgba(255,255,255,.18);
    border-radius: 999px;
    padding: 0;
    color: #fff;
    background: rgba(8, 13, 26, .86);
    box-shadow: 0 18px 40px rgba(8,13,26,.28);
    backdrop-filter: blur(10px);
    cursor: pointer;
}
.canvas-focus-toggle:hover {
    background: rgba(8, 13, 26, .96);
}
.canvas-focus-exit {
    display: none;
}
.focus-icon,
.focus-icon:before,
.focus-icon:after {
    position: absolute;
    inset: 12px;
    display: block;
}
.focus-icon:before,
.focus-icon:after {
    content: "";
    inset: 0;
    border: 2px solid #fff;
}
.focus-icon:before {
    border-right: 0;
    border-bottom: 0;
}
.focus-icon:after {
    border-left: 0;
    border-top: 0;
}
canvas {
    display: block;
    width: 100%;
    min-height: 360px;
    touch-action: none;
}
.mini-canvas-shell canvas {
    min-height: 440px;
}
.canvas-shell.is-focus-mode,
.paint-canvas-shell.is-focus-mode {
    position: fixed;
    inset: 0;
    z-index: 9999;
    width: 100vw;
    height: 100vh;
    margin: 0;
    border: 0;
    border-radius: 0;
    background: #050814;
}
.canvas-shell.is-focus-mode .canvas-toolbar,
.canvas-shell.is-focus-mode .canvas-focus-toggle {
    display: none;
}
.canvas-shell.is-focus-mode canvas,
.paint-canvas-shell.is-focus-mode canvas {
    flex: 1;
    width: 100vw;
    height: 100vh;
    min-height: 0;
}
body.is-screen-focus {
    overflow: hidden;
}
.canvas-shell.is-focus-mode .canvas-focus-exit {
    display: block;
    position: fixed;
    top: 18px;
    right: 18px;
    z-index: 10000;
    width: 42px;
    height: 42px;
    border: 0px solid rgba(255,255,255,.18);
    border-radius: 999px;
    background:
        linear-gradient(45deg, transparent 44%, #fff 45% 55%, transparent 56%),
        linear-gradient(-45deg, transparent 44%, #fff 45% 55%, transparent 56%),
        rgba(8, 13, 26, .74);
    cursor: pointer;
}
.screen-page {
    padding-bottom: 240px;
}
.screen-selection-panel {
    position: fixed;
    left: 50%;
    bottom: 14px;
    transform: translateX(-50%);
    z-index: 10001;
    width: min(1180px, calc(100% - 20px));
    margin: 0;
    padding: 18px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
    gap: 18px;
    border: 1px solid rgba(148, 163, 184, .34);
    border-radius: 8px;
    background: rgba(8, 13, 26, .9);
    backdrop-filter: blur(18px);
    color: #f8fafc;
    box-shadow: 0 18px 42px rgba(2, 6, 23, .42);
    padding-right: 54px;
}
.screen-selection-close {
    position: absolute;
    top: 8px;
    right: 8px;
    left: auto;
    bottom: auto;
    margin: 0;
    min-width: 32px;
    min-height: 32px;
    border-radius: 999px;
    border-color: rgba(255,255,255,.24);
    background: rgba(255,255,255,.12);
    color: #f8fafc;
    z-index: 4;
    pointer-events: auto;
}
.screen-selection-close:hover {
    background: rgba(255,255,255,.2);
}
.screen-selection-panel.has-selection {
    border-color: rgba(45, 212, 191, .62);
    box-shadow: 0 0 0 2px rgba(45, 212, 191, .2), 0 18px 42px rgba(2, 6, 23, .42);
}
.screen-selection-panel.sponsored {
    border-color: rgba(251, 191, 36, .92);
    box-shadow: 0 0 0 2px rgba(251, 191, 36, .24), 0 18px 42px rgba(2, 6, 23, .42);
}
.screen-selection-panel h2 {
    margin: 0 0 6px;
    font-size: clamp(1.25rem, 2.2vw, 1.8rem);
    line-height: 1.08;
}
.screen-selection-panel p {
    margin: 0;
}
#screenSelectionAuthor {
    color: #cbd5e1;
    font-weight: 800;
}
#screenSelectionMessage {
    margin-top: 8px;
    color: #e2e8f0;
    max-width: 880px;
}
.screen-selection-actions {
    display: grid;
    gap: 8px;
    min-width: 180px;
}
.screen-selection-actions .button {
    border-color: rgba(255,255,255,.24);
    background: rgba(255,255,255,.08);
    color: #f8fafc;
}
.screen-selection-actions .button:hover {
    background: rgba(255,255,255,.16);
}
.screen-report-form {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    padding-top: 14px;
    border-top: 1px solid rgba(148, 163, 184, .36);
    max-height: 42vh;
    overflow: auto;
    padding-right: 4px;
}
.screen-report-form label:nth-child(3),
.screen-report-form .report-status {
    grid-column: 1 / -1;
}
.screen-report-form label {
    color: #dbeafe;
}
.screen-report-form input,
.screen-report-form textarea {
    border-color: rgba(148, 163, 184, .46);
    background: rgba(15, 23, 42, .72);
    color: #fff;
}
.screen-report-form textarea {
    min-height: 96px;
    resize: vertical;
}
.report-status {
    color: #cbd5e1;
    font-weight: 800;
}
.block-card.selected {
    border-color: var(--teal);
    box-shadow: 0 0 0 2px rgba(0,167,181,.16), 0 18px 44px rgba(17,24,39,.10);
}
.block-card.sponsored.selected {
    border-color: #ffd66b;
    box-shadow: 0 0 0 2px rgba(255,214,107,.22), 0 18px 44px rgba(17,24,39,.10);
}
.paint-canvas-shell.is-focus-mode .canvas-focus-exit {
    display: block;
    position: fixed;
    top: 18px;
    right: 18px;
    z-index: 10000;
    width: 42px;
    height: 42px;
    border: 0px solid rgba(255,255,255,.18);
    border-radius: 999px;
    background:
        linear-gradient(45deg, transparent 44%, #fff 45% 55%, transparent 56%),
        linear-gradient(-45deg, transparent 44%, #fff 45% 55%, transparent 56%),
        rgba(8, 13, 26, .74);
    cursor: pointer;
}
.auth-wrap {
    min-height: calc(100vh - 210px);
    display: grid;
    place-items: center;
    padding: 32px 16px;
}
.form-panel {
    width: 100%;
    padding: 22px;
}
.form-panel h1 { margin: 0 0 16px; }
.auth-links {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 16px;
    color: var(--teal);
    font-weight: 900;
}
.auth-links a:hover {
    color: var(--ink);
}
label {
    display: grid;
    gap: 7px;
    color: var(--muted);
    font-weight: 800;
    margin-bottom: 14px;
}
input, select, textarea {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 12px 12px;
    font: inherit;
    color: var(--ink);
    background: #fff;
}
textarea { min-height: 96px; resize: vertical; }
input[type=color]{
    padding: 0px 3px;
}
.iti {
    width: 100%;
    --iti-border-color: var(--line);
    --iti-dialcode-color: var(--muted);
    --iti-dropdown-bg: #fff;
    --iti-hover-color: #edf7f8;
}
.iti input.iti__tel-input,
.iti input[type=tel] {
    width: 100%;
    min-height: 48px;
}
.iti__country-list {
    border-radius: 8px;
    box-shadow: var(--shadow);
}
.field-help {
    margin: -4px 0 16px;
    color: var(--muted);
    font-size: .92rem;
}
.pin-inputs {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 10px;
    margin: 18px 0 16px;
}
.pin-inputs input {
    height: 58px;
    padding: 0;
    text-align: center;
    border: 2px solid #dbeafe;
    border-radius: 8px;
    background:
        linear-gradient(180deg, #ffffff 0, #f8fbff 100%);
    color: var(--night);
    font-size: 1.65rem;
    font-weight: 900;
    box-shadow: 0 12px 24px rgba(17,24,39,.06);
}
.pin-inputs input:focus {
    outline: 0;
    border-color: var(--teal);
    box-shadow: 0 0 0 4px rgba(0,167,181,.14);
}
.form-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}
.check-row {
    display: flex;
    align-items: center;
    gap: 10px;
}
.check-row input { width: 18px; height: 18px; }

.buy-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 20px;
    align-items: start;
}
.checkout-section {
    width: min(1180px, calc(100% - 32px));
    margin: 32px auto;
}
.checkout-panel {
    padding: 24px;
    display: grid;
    gap: 20px;
}
.checkout-head {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    padding-bottom: 18px;
    border-bottom: 1px solid var(--line);
}
.checkout-head h1 {
    margin: 0;
    font-size: clamp(2rem, 5vw, 4.5rem);
    line-height: .96;
}
.checkout-head p:not(.eyebrow) {
    max-width: 720px;
    margin: 10px 0 0;
    color: var(--muted);
}
.checkout-config-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(320px, 440px);
    gap: 16px;
    align-items: start;
}
.checkout-fields {
    display: grid;
    gap: 12px;
}
.size-stepper-row {
    align-items: end;
}
.dimension-control {
    margin: 0;
}
.dimension-stepper {
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr) 38px;
    align-items: center;
    gap: 6px;
}
.dimension-stepper input[type=number] {
    margin: 0;
    text-align: center;
    font-weight: 800;
}
.dimension-stepper-btn {
    min-height: 40px;
    min-width: 38px;
    padding: 0;
    font-size: 1.1rem;
    font-weight: 900;
    line-height: 1;
}
.checkout-visual-panel {
    display: grid;
    gap: 12px;
}
.pixel-simulator-card {
    display: grid;
    gap: 12px;
    padding: 16px;
    border: 1px solid #172033;
    border-radius: 8px;
    background: #0f172a;
    color: #fff;
}
.pixel-simulator-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.pixel-simulator-head .screen-size {
    background: rgba(255,255,255,.12);
    color: #dbeafe;
}
.pixel-simulator-head strong {
    color: #fff;
    font-weight: 900;
    text-align: right;
}
.pixel-simulator-canvas {
    display: block;
    width: 100%;
    aspect-ratio: 14 / 9;
    min-height: 240px;
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 8px;
    background: #08111f;
    image-rendering: pixelated;
}
.quote-panel {
    position: sticky;
    top: 88px;
    padding: 22px;
}
.quote-panel h2 { font-size: 2.1rem; }
.checkout-summary {
    position: static;
    display: grid;
    align-content: center;
    min-height: 126px;
    border-color: #172033;
    background: #0f172a;
    color: #fff;
    box-shadow: none;
}
.checkout-summary .screen-size {
    width: fit-content;
    background: rgba(255,255,255,.12);
    color: #dbeafe;
}
.checkout-summary h2 {
    margin: 14px 0 8px;
    color: #fff;
}
.checkout-summary p {
    color: #dbeafe;
}

.block-public { margin-top: 22px; }
.admin-nav-grid,
.admin-block-grid,
.admin-user-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(500px, 1fr));
    gap: 16px;
}
.admin-tile {
    display: grid;
    gap: 8px;
    min-height: 150px;
    padding: 20px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 18px 44px rgba(17,24,39,.08);
}
.admin-tile span {
    color: var(--teal);
    font-weight: 900;
}
.admin-tile strong {
    color: var(--ink);
    font-size: 1.35rem;
    line-height: 1.15;
}
.admin-tile-count {
    display: inline-flex;
    width: fit-content;
    min-height: 26px;
    align-items: center;
    padding: 0 10px;
    border-radius: 999px;
    border: 1px solid #d7e2ee;
    background: #f7fbff;
    color: #0f4f6a;
    font-size: .8rem;
    font-weight: 900;
}
.admin-two-col {
    display: grid;
    grid-template-columns: minmax(280px, 420px) minmax(0, 1fr);
    gap: 18px;
    align-items: start;
}
.admin-stack,
.admin-list {
    display: grid;
    gap: 14px;
}
.admin-screen-form textarea {
    min-height: 82px;
}
.admin-record-head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: start;
    margin-bottom: 14px;
}
.admin-record-head h2 {
    margin: 8px 0 0;
}
.admin-record-head code,
.admin-data-list code,
.admin-list-row code {
    overflow-wrap: anywhere;
    white-space: normal;
}
.admin-data-list {
    display: grid;
    grid-template-columns: 110px minmax(0, 1fr);
    gap: 8px 12px;
    margin: 16px 0;
}
.admin-data-list dt {
    color: var(--muted);
    font-weight: 900;
}
.admin-data-list dd {
    margin: 0;
    overflow-wrap: anywhere;
}
.admin-block-card {
    min-height: 340px;
}
.admin-large-preview {
    min-height: 420px;
    margin-top: 16px;
}
.admin-list-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #f8fbff;
}
.inline-admin-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    align-items: end;
    margin-bottom: 14px;
}
.report-row {
    align-items: start;
}
.report-row p {
    margin: 6px 0;
    color: var(--ink);
}
.admin-user-card textarea,
.moderation-form textarea {
    min-height: 92px;
    resize: vertical;
}
.moderation-note {
    padding: 10px 12px;
    border-left: 4px solid #f43f5e;
    border-radius: 8px;
    background: #fff1f2;
    color: #9f1239;
    font-weight: 800;
}
.legal-content {
    width: min(880px, calc(100% - 32px));
}
.legal-content h2 {
    margin-top: 24px;
}
.legal-content p {
    color: var(--muted);
    line-height: 1.7;
}
.sponsor-panel {
    width: min(820px, calc(100% - 32px));
    margin: 18px auto;
    padding: 18px;
    display: grid;
    grid-template-columns: 120px minmax(0, 1fr);
    gap: 16px;
    align-items: center;
}
.sponsor-panel img {
    width: 120px;
    height: 120px;
    object-fit: contain;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
}
.sponsor-panel h2 { margin: 0 0 6px; }
.sponsor-panel p { color: var(--muted); }
.sponsor-panel a { color: var(--teal); font-weight: 900; }

.paint-layout {
    width: min(1240px, calc(100% - 32px));
    margin: 32px auto;
    display: grid;
    grid-template-columns: 290px minmax(0, 1fr);
    gap: 18px;
}
.paint-layout .paint-canvas-shell {
    width: 100%;
    margin: 0;
}
.paint-tools {
    padding: 18px;
    align-self: start;
}
.paint-tools h1 { font-size: 2rem; margin-bottom: 16px; }
.tool-note {
    margin: -6px 0 16px;
    color: var(--muted);
    font-size: .95rem;
}
.place-form {
    margin: 0 0 12px;
}
.editor-mode-tabs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin: 0 0 14px;
    padding: 5px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #f3f7fb;
}
.mode-tab {
    min-height: 32px;
    border: 0;
    border-radius: 7px;
    color: var(--muted);
    background: transparent;
    font: inherit;
    font-weight: 900;
    cursor: pointer;
}
.mode-tab.active {
    color: #fff;
    background: var(--night-soft);
    box-shadow: 0 10px 24px rgba(17,24,39,.14);
}
.paint-tools .button {
    width: 100%;
    margin-top: 10px;
}
.history-actions {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin: 0 0 14px;
}
.history-actions .button {
    min-height: 38px;
    margin-top: 0;
    padding: 0 8px;
    font-size: .86rem;
}
.button.danger {
    border-color: #ffc9d8;
    background: #fff2f6;
    color: #a51547;
}
.button.danger:hover,
.button.danger:focus {
    background: #ffe3ec;
    color: #8b0f3c;
}
.paint-actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    margin-top: 8px;
}
.paint-actions .button {
    margin-top: 0;
}
.block-details-panel,
.pixelit-panel,
.emoji-panel,
.used-colors {
    margin: 0 0 14px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #f8fbff;
}
.block-details-panel h2,
.pixelit-panel h2,
.emoji-panel h2,
.used-colors h2 {
    margin: 0 0 10px;
    color: var(--ink);
    font-size: .95rem;
}
.block-details-panel textarea {
    min-height: 88px;
    resize: vertical;
}
.pixelit-panel label {
    margin-bottom: 10px;
}
.pixelit-panel input[type=file] {
    min-height: 42px;
    padding: 8px;
    font-size: .9rem;
}
.emoji-stamp-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}
.emoji-stamp {
    min-height: 38px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    color: var(--ink);
    font: inherit;
    font-weight: 900;
    cursor: pointer;
}
.emoji-stamp:hover,
.emoji-stamp.active {
    border-color: var(--teal);
    background: #e8f7f8;
    color: #075963;
}
.used-color-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    min-height: 34px;
    max-height: 34px;
    align-items: center;
    overflow: hidden;
    padding: 2px;
}
.used-colors.expanded .used-color-list {
    max-height: 186px;
    overflow-y: auto;
    padding-right: 6px;
}
.color-swatch {
    width: 30px;
    height: 30px;
    border: 2px solid #fff;
    border-radius: 999px;
    box-shadow: 0 0 0 1px rgba(17,24,39,.18), 0 8px 18px rgba(17,24,39,.12);
    cursor: pointer;
}
.color-swatch:hover,
.color-swatch:focus {
    outline: 0;
    transform: translateY(-1px);
    box-shadow: 0 0 0 2px var(--teal), 0 10px 20px rgba(17,24,39,.16);
}
.used-colors-empty {
    color: var(--muted);
    font-size: .9rem;
    font-weight: 800;
}
.used-colors-toggle {
    margin: 9px 0 0;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--teal);
    font: inherit;
    font-size: .88rem;
    font-weight: 900;
    cursor: pointer;
}
.used-colors-toggle:hover,
.used-colors-toggle:focus {
    color: #075963;
    text-decoration: underline;
}
.paint-tools output {
    display: block;
    margin: 8px 0 20px;
    font-weight: 900;
    color: var(--violet);
}

.paint-editor {
    width: min(1280px, calc(100% - 24px));
    margin: 24px auto 34px;
    display: grid;
    gap: 12px;
}
.paint-workspace {
    min-height: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 360px;
    gap: 12px;
    align-items: stretch;
}
.place-publish-fab {
    position: fixed;
    right: 14px;
    bottom: 36px;
    z-index: 10002;
    min-height: 40px;
    padding: 0 16px;
    border-radius: 999px;
    box-shadow: 0 14px 26px rgba(2, 6, 23, .38);
}
.place-publish-fab--blue {
    border-color: #1d4ed8;
    background: #2563eb;
    color: #ffffff;
    box-shadow: 0 12px 26px rgba(37, 99, 235, .42);
}
.place-publish-fab--blue:hover {
    background: #1d4ed8;
}
.place-zoom-controls {
    position: fixed;
    right: 14px;
    bottom: 88px;
    z-index: 10002;
    display: grid;
    gap: 8px;
}
.place-zoom-fab {
    width: 38px;
    min-width: 38px;
    min-height: 38px;
    padding: 0;
    border-radius: 999px;
    box-shadow: 0 10px 20px rgba(2, 6, 23, .3);
    border-color: rgba(148, 163, 184, .6);
    background: rgba(255, 255, 255, .95);
}
.paint-canvas-shell.is-focus-mode .place-publish-fab {
    bottom: 14px;
}
.paint-canvas-shell.is-focus-mode .place-zoom-controls {
    bottom: 66px;
}
.paint-details-drawer {
    margin: 0;
    padding: 14px;
    max-height: calc(100dvh - 220px);
    overflow: auto;
}
.paint-details-drawer-head {
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}
.paint-details-drawer-head h2 {
    margin: 0;
}
.paint-details-drawer-head .icon-only {
    min-width: 34px;
    min-height: 34px;
}
.paint-toolbar-top {
    padding: 14px 16px;
    display: grid;
    gap: 12px;
}
.paint-toolbar-head {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 14px;
}
.paint-title-group h1 {
    margin: 0;
    font-size: clamp(1.3rem, 2.5vw, 2rem);
    line-height: 1;
}
.paint-toolbar-head .tool-note {
    margin: 0;
    max-width: 620px;
}
.paint-toolbar-row {
    display: grid;
    grid-template-columns: auto auto minmax(0, 1fr) auto;
    gap: 6px;
    align-items: center;
    padding: 6px 8px;
    border: 1px solid #d7e2ee;
    border-radius: 8px;
    background: #f8fbff;
}
.paint-toolbar-row .editor-mode-tabs {
    
    font-size: 14px;
    width: 196px;
    margin: 0;
    padding: 3px;
    border-color: #d7e2ee;
    background: #fff;
}
.paint-toolbar-row .history-actions {
    margin: 0;
    padding: 3px;
    border: 1px solid #d7e2ee;
    border-radius: 8px;
    background: #fff;
}
.paint-toolbar-row .history-actions .button {
    min-height: 32px;
    font-size: .78rem;
}
.icon-only {
    min-width: 32px;
    padding: 0 8px;
}
.icon-only i {
    font-size: .92rem;
    line-height: 1;
}
.color-indicator {
    --picker-color: #000000;
}
.color-indicator i {
    color: var(--picker-color);
    text-shadow:
        0 0 0.5px rgba(255,255,255,.45),
        0 0 1.5px rgba(255,255,255,.35),
        0 0 3px rgba(0,0,0,.2);
    filter: drop-shadow(0 1px 1px rgba(0,0,0,.15));
}
.icon-only.is-active {
    border-color: #0ea5b7;
    box-shadow: 0 0 0 1px rgba(14,165,183,.22);
}
.paint-quick-tools {
    min-width: 0;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    padding: 3px;
    border: 1px solid #d7e2ee;
    border-radius: 8px;
    background: #fff;
}
.paint-quick-tools .button {
    width: auto;
    margin: 0;
    min-height: 32px;
    padding: 0 9px;
}
.active-stamp-badge {
    min-height: 32px;
    display: inline-flex;
    align-items: center;
    padding: 0 8px;
    border: 1px solid #d7e2ee;
    border-radius: 8px;
    background: #f7fbff;
    color: #334155;
    font-size: .72rem;
    font-weight: 900;
}
.paint-toolbar-row .paint-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 0;
    padding: 3px;
    border: 1px solid #d7e2ee;
    border-radius: 8px;
    background: #fff;
}
.paint-toolbar-row .paint-actions .button {
    width: auto;
    margin: 0;
    min-height: 32px;
    padding: 0 10px;
}
#paintDetailsToggle,
#paintDetailsClose {
    display: none;
}
.color-popover {
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #f8fbff;
}
.word-color-ribbon {
    min-height: 50px;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
    padding: 8px 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #f7fbff;
}
.word-color-label {
    font-size: .82rem;
    font-weight: 900;
    color: var(--ink);
}
.word-color-swatches {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 6px;
    overflow-x: auto;
    scrollbar-width: thin;
    padding: 2px;
}
.word-color-chip {
    flex: 0 0 auto;
    width: 24px;
    height: 24px;
    border: 1px solid #d0dbe6;
    border-radius: 4px;
    cursor: pointer;
}
.word-color-chip.active {
    box-shadow: 0 0 0 2px #0ea5b7;
    border-color: #0ea5b7;
}
.word-color-picker {
    width: auto;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--muted);
    font-size: .82rem;
    font-weight: 900;
}
.word-color-picker input[type=color] {
    width: 34px;
    min-height: 28px;
    padding: 1px;
    border: 1px solid #d0dbe6;
    border-radius: 4px;
    background: #fff;
    cursor: pointer;
}
.used-colors.compact {
    margin: 0;
    padding: 8px 10px;
    background: #f8fbff;
}
.used-colors.compact h2 {
    margin: 0 0 8px;
    font-size: .82rem;
}
.used-colors.compact .used-color-list {
    max-height: 34px;
}
.paint-toolbar-top output {
    margin: 0;
    color: #0f4f6a;
    font-size: .9rem;
}
#paintStatus {
    position: fixed;
    bottom: 0px;
    width: 100%;
    margin-top: 6px;
    min-height: 24px;
    display: block;
    padding: 4px 10px;
    background: #050814;
    color: #cbd5e1;
    font-size: .74rem;
    font-weight: 800;
    line-height: 1.25;
    letter-spacing: 0;
}
.paint-details-bottom {
    padding: 16px;
}
.paint-details-bottom h2 {
    margin: 0 0 12px;
}
.details-bottom-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}
.details-bottom-grid .full-row {
    grid-column: 1 / -1;
}
.swal2-popup .stamp-popup-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(88px, 1fr));
    gap: 8px;
    margin-top: 8px;
}
.swal2-popup .stamp-popup-option {
    min-height: 70px;
    display: grid;
    place-items: center;
    gap: 4px;
    border: 1px solid #d9e4ef;
    border-radius: 8px;
    background: #fff;
    color: #0f172a;
    cursor: pointer;
}
.swal2-popup .stamp-popup-option span {
    font-size: 1rem;
    font-weight: 900;
}
.swal2-popup .stamp-popup-option small {
    font-size: .72rem;
    color: #475569;
    font-weight: 800;
}
.swal2-popup .stamp-popup-option.selected {
    border-color: #0ea5b7;
    box-shadow: 0 0 0 2px rgba(14,165,183,.22);
    background: #edf7f8;
}
.swal2-popup .text-tool-form {
    display: grid;
    gap: 10px;
    text-align: left;
}
.swal2-popup .text-tool-form label {
    font-size: .85rem;
    font-weight: 800;
    color: #1f2937;
}
.swal2-popup .text-tool-form input,
.swal2-popup .text-tool-form select {
    width: 100%;
    min-height: 38px;
    border: 1px solid #d9e4ef;
    border-radius: 8px;
    padding: 8px 10px;
    font: inherit;
}
.swal2-popup .text-tool-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}
.block-resize-panel {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid var(--line);
}
.block-resize-panel h3 {
    margin: 0 0 6px;
    font-size: 1rem;
}
.block-resize-panel p {
    margin: 0 0 10px;
    color: var(--muted);
    font-size: .9rem;
}
.resize-buy-form .button {
    margin-top: 8px;
}

.footer {
    display: flex;
    justify-content: center;
    gap: 18px;
    padding: 32px 16px;
    color: var(--muted);
    border-top: 1px solid var(--line);
}

@media (max-width: 820px) {
    .topbar { align-items: flex-start; flex-direction: column; }
    .nav { flex-wrap: wrap; gap: 12px; }
    .hero-grid,
    .buy-grid,
    .checkout-config-grid,
    .admin-two-col,
    .paint-layout,
    .sponsor-panel {
        grid-template-columns: 1fr;
    }
    .paint-workspace {
        grid-template-columns: 1fr;
    }
    .paint-details-drawer {
        position: fixed;
        top: 0;
        right: 0;
        z-index: 1102;
        width: min(88vw, 380px);
        height: 100dvh;
        max-height: 100dvh;
        border-radius: 0;
        transform: translateX(100%);
        transition: transform .22s ease;
        box-shadow: -10px 0 28px rgba(2, 6, 23, .36);
        background: #fff;
    }
    .paint-details-drawer.open {
        transform: translateX(0);
    }
    .paint-layout .paint-canvas-shell {
        order: 1;
    }
    .place-publish-fab {
        right: 20px;
        bottom: 34px;
        min-height: 38px;
        padding: 0 14px;
    }
    .place-zoom-controls {
        right: 20px;
        bottom: 84px;
    }
    .paint-tools {
        order: 2;
    }
    .canvas-header,
    .block-hero {
        align-items: start;
        flex-direction: column;
    }
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
    .dashboard-card {
        grid-template-columns: 1fr;
    }
    .dashboard-drawing {
        min-height: 210px;
        order: -1;
    }
    .dashboard-drawing canvas {
        min-height: 210px;
    }
    .quote-panel { position: static; }
    canvas { min-height: 300px; }
    .toolbar-actions {
        width: 100%;
        justify-content: space-between;
    }
    .canvas-toolbar {
        align-items: stretch;
        flex-direction: column;
    }
    .canvas-focus-toggle {
        top: 88px;
        right: 10px;
    }
    .auth-links {
        align-items: flex-start;
        flex-direction: column;
    }
    .pin-inputs {
        gap: 7px;
    }
    .pin-inputs input {
        height: 50px;
        font-size: 1.35rem;
    }
    .paint-editor {
        width: calc(100% - 16px);
        margin: 12px auto 20px;
    }
    .paint-toolbar-head {
        align-items: start;
        flex-direction: column;
    }
    .paint-toolbar-row {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
        gap: 6px;
        align-items: stretch;
        overflow: visible;
    }
    .paint-toolbar-row .editor-mode-tabs,
    .paint-toolbar-row .history-actions,
    .paint-toolbar-row .paint-quick-tools,
    .paint-toolbar-row .paint-actions {
        width: 100%;
        min-width: 0;
    }
    .paint-toolbar-row .paint-actions {
        display: flex;
        flex-wrap: wrap;
    }
    .paint-toolbar-row .paint-actions .button,
    .paint-quick-tools .button {
        width: auto;
    }
    #paintDetailsToggle,
    #paintDetailsClose {
        display: inline-flex;
    }
    .word-color-ribbon {
        grid-template-columns: 1fr;
        align-items: stretch;
    }
    .word-color-picker {
        justify-content: flex-start;
    }
    .details-bottom-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    main {
        min-height: auto;
    }
    .paint-layout {
        width: calc(100% - 16px);
        margin: 12px auto;
        gap: 10px;
    }
    .checkout-section {
        width: calc(100% - 16px);
        margin: 8px auto;
    }
    .checkout-panel {
        padding: 10px;
        gap: 10px;
    }
    .checkout-head {
        gap: 8px;
        padding-bottom: 8px;
    }
    .checkout-head h1 {
        font-size: 1.32rem;
        line-height: 1.04;
    }
    .checkout-head p:not(.eyebrow) {
        margin-top: 6px;
        font-size: .85rem;
    }
    .checkout-summary {
        min-height: auto;
        padding: 10px;
    }
    .checkout-summary h2 {
        margin: 6px 0 4px;
        font-size: 1.35rem;
    }
    .checkout-summary p {
        font-size: .82rem;
    }
    .pixel-simulator-card {
        gap: 8px;
        padding: 10px;
    }
    .pixel-simulator-head {
        align-items: flex-start;
        flex-direction: column;
        gap: 6px;
    }
    .pixel-simulator-head strong {
        font-size: .95rem;
        text-align: left;
    }
    .pixel-simulator-canvas {
        min-height: 150px;
    }
    .checkout-fields {
        gap: 8px;
    }
    .size-stepper-row {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }
    .dimension-stepper {
        grid-template-columns: 34px minmax(0, 1fr) 34px;
        gap: 5px;
    }
    .dimension-stepper-btn {
        min-height: 34px;
        min-width: 34px;
        font-size: 1rem;
    }
    .dimension-stepper input[type=number] {
        min-height: 34px;
        padding: 6px 8px;
    }
    .checkout-panel > .button.primary {
        min-height: 38px;
        padding: 0 12px;
        font-size: .9rem;
    }
    .paint-tools {
        padding: 12px;
    }
    .paint-tools h1 {
        font-size: 1.25rem;
        margin-bottom: 8px;
    }
    .tool-note {
        margin: -2px 0 10px;
        font-size: .82rem;
        line-height: 1.35;
    }
    .paint-tools label {
        gap: 5px;
        margin-bottom: 8px;
        font-size: .86rem;
    }
    .paint-tools input,
    .paint-tools select {
        min-height: 40px;
        padding: 8px 10px;
        font-size: .92rem;
    }
    .paint-tools input[type=color] {
        min-height: 38px;
        padding: 4px;
    }
    .paint-tools output {
        margin: 6px 0 10px;
        font-size: .9rem;
    }
    .history-actions {
        gap: 6px;
        margin-bottom: 10px;
    }
    .history-actions .button {
        min-height: 34px;
        padding: 0 4px;
        font-size: .78rem;
    }
    .block-details-panel,
    .pixelit-panel,
    .emoji-panel,
    .used-colors {
        margin-bottom: 10px;
        padding: 10px;
    }
    .block-details-panel h2,
    .pixelit-panel h2,
    .emoji-panel h2,
    .used-colors h2 {
        margin-bottom: 8px;
        font-size: .86rem;
    }
    .block-details-panel textarea {
        min-height: 72px;
    }
    .emoji-stamp-grid {
        grid-template-columns: repeat(6, minmax(0, 1fr));
        gap: 6px;
    }
    .emoji-stamp {
        min-height: 34px;
        padding: 0 4px;
        font-size: .78rem;
    }
    .editor-mode-tabs {
        margin-bottom: 10px;
    }
    .mode-tab,
    .paint-tools .button {
        min-height: 38px;
        font-size: .9rem;
    }
    .paint-actions {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .color-swatch {
        width: 26px;
        height: 26px;
    }
    .screen-picker-grid {
        grid-template-columns: 1fr;
    }
    .screen-option {
        display: grid;
        grid-template-columns: 96px minmax(0, 1fr);
        gap: 10px;
        align-items: center;
    }
    .screen-option-preview {
        margin: 0;
    }
    .screen-option-title,
    .screen-option-size {
        overflow-wrap: anywhere;
    }
    .sponsored-marquee {
        width: calc(100% - 16px);
        margin-bottom: 10px;
    }
    .sponsored-marquee-track {
        gap: 8px;
        padding: 8px;
        animation-duration: 38s;
    }
    .sponsored-marquee-item {
        width: 280px;
        max-width: 82vw;
        padding: 8px;
    }
    .sponsored-marquee-item strong {
        font-size: .84rem;
    }
    .sponsored-marquee-item small {
        font-size: .72rem;
    }
    .used-color-list {
        max-height: 30px;
        gap: 6px;
    }
    .used-colors.expanded .used-color-list {
        max-height: 162px;
    }
    .paint-canvas-shell canvas {
        min-height: 36vh;
    }
    .paint-canvas-shell:not(.is-focus-mode) canvas {
        min-height: 36vh;
    }
    .paint-toolbar-top {
        padding: 12px;
        gap: 10px;
    }
    .paint-title-group h1 {
        font-size: 1.18rem;
    }
    .paint-toolbar-head .tool-note {
        font-size: .8rem;
        line-height: 1.35;
    }
    #paintStatus {
        font-size: .7rem;
        padding: 4px 8px;
    }
    .paint-toolbar-row .history-actions .button,
    .paint-toolbar-row .paint-actions .button,
    .paint-quick-tools .button,
    .paint-toolbar-row .mode-tab {
        min-height: 34px;
        font-size: .76rem;
        padding: 0 8px;
    }
    #paintDetailsToggle {
        min-height: 34px;
        font-size: .72rem;
        padding: 0 8px;
    }
    .icon-only {
        min-width: 34px;
        padding: 0 7px;
    }
    .icon-only i {
        font-size: .92rem;
    }
    .active-stamp-badge {
        font-size: .7rem;
    }
    .word-color-ribbon {
        padding: 7px 8px;
        gap: 8px;
    }
    .word-color-chip {
        width: 22px;
        height: 22px;
    }
    .word-color-picker input[type=color] {
        width: 30px;
        min-height: 24px;
    }
    .used-colors.compact .used-color-list {
        max-height: 30px;
    }
    .paint-details-bottom {
        padding: 12px;
    }
    .paint-details-bottom h2 {
        font-size: .92rem;
    }
    .swal2-popup .stamp-popup-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
    .swal2-popup .stamp-popup-option {
        min-height: 62px;
    }
    .swal2-popup .text-tool-row {
        grid-template-columns: 1fr;
    }
    .screen-selection-panel {
        left: 8px;
        right: 8px;
        bottom: 8px;
        transform: none;
        width: auto;
        padding: 14px;
        align-items: stretch;
        grid-template-columns: 1fr;
    }
    .screen-page {
        padding-bottom: 320px;
    }
    .screen-selection-actions {
        min-width: 0;
    }
    .screen-selection-panel .button {
        width: 100%;
    }
    .screen-report-form,
    .inline-admin-form,
    .admin-data-list {
        grid-template-columns: 1fr;
    }
    .admin-list-row,
    .admin-record-head {
        align-items: stretch;
        flex-direction: column;
    }
}

.swal2-select{
    max-width: 86% !important;
}
.swal2-input{
    width: 100%;
}
.swal2-textarea{
    width: 100%;
}
@media (max-width: 820px) {
    .swal2-container {
        align-items: flex-start !important;
        padding-top: max(8px, env(safe-area-inset-top)) !important;
        padding-left: 8px !important;
        padding-right: 8px !important;
        padding-bottom: 8px !important;
        z-index: 999999;
    }
    .swal2-popup {
        width: min(96vw, 460px) !important;
        margin: 0 !important;
        padding: 10px 10px 9px !important;
        border-radius: 10px !important;
    }
    .swal2-title {
        margin: 0 !important;
        padding: 0 !important;
        font-size: 1rem !important;
        line-height: 1.2 !important;
    }
    .swal2-html-container {
        margin: 8px 0 0 !important;
        font-size: .86rem !important;
        line-height: 1.3 !important;
    }
    .swal2-actions {
        margin: 10px 0 0 !important;
        gap: 6px !important;
    }
    .swal2-popup .swal2-input,
    .swal2-popup .swal2-textarea,
    .swal2-popup .swal2-select {
        margin: 6px 0 0 !important;
        min-height: 34px !important;
        padding: 7px 9px !important;
        font-size: .86rem !important;
    }
    .swal2-popup .swal2-textarea {
        min-height: 84px !important;
    }
    .swal2-popup .swal-report-form label {
        margin-top: 6px;
        font-size: .8rem;
        font-weight: 800;
        color: #1f2937;
    }
}

/* Full-width layout overrides: use the available viewport space on desktop and mobile */
.flash,
.hero-grid,
.section,
.canvas-header,
.block-hero,
.sponsored-marquee,
.canvas-shell,
.mini-canvas-shell,
.paint-canvas-shell,
.checkout-section,
.legal-content,
.sponsor-panel,
.paint-layout,
.paint-editor {
    width: 100%;
    max-width: none;
}

.flash,
.hero-grid,
.section,
.canvas-header,
.block-hero,
.sponsored-marquee,
.checkout-section,
.legal-content,
.sponsor-panel,
.paint-layout,
.paint-editor {
    padding-inline: clamp(10px, 1.8vw, 22px);
}

.section,
.checkout-section,
.paint-layout,
.paint-editor {
    margin-inline: 0;
}

.page-title {
    width: 100%;
}

.canvas-shell,
.mini-canvas-shell,
.paint-canvas-shell {
    border-radius: 0;
}

.screen-selection-panel {
    width: calc(100% - 24px);
    max-width: none;
}

@media (max-width: 820px) {
    .flash,
    .hero-grid,
    .section,
    .canvas-header,
    .block-hero,
    .sponsored-marquee,
    .checkout-section,
    .legal-content,
    .sponsor-panel,
    .paint-layout,
    .paint-editor {
        padding-inline: 8px;
    }
    .screen-selection-panel {
        width: auto;
    }
}

/* Topbar title + mobile right drawer */
.topbar {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto auto;
    align-items: center;
    column-gap: 12px;
}
.topbar-page-title {
    margin: 0;
    margin-left: 12px;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #e2e8f0;
    font-weight: 900;
    font-size: 1rem;
}
.nav-toggle {
    display: none;
    width: 40px;
    height: 40px;
    border: 1px solid rgba(255,255,255,.2);
    border-radius: 8px;
    background: rgba(255,255,255,.08);
    color: #f8fafc;
}
.nav-drawer-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1100;
    background: rgba(2, 6, 23, .55);
}
.nav-drawer {
    position: fixed;
    top: 0;
    right: 0;
    z-index: 1101;
    width: min(84vw, 320px);
    height: 100vh;
    padding: 14px;
    transform: translateX(100%);
    transition: transform .22s ease;
    background: #0b1120;
    border-left: 1px solid rgba(148,163,184,.22);
    box-shadow: -10px 0 28px rgba(2, 6, 23, .36);
}
.nav-drawer.open {
    transform: translateX(0);
}
.nav-drawer-head {
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: #f8fafc;
    font-weight: 900;
}
.nav-drawer-close {
    width: 36px;
    height: 36px;
    border: 1px solid rgba(255,255,255,.2);
    border-radius: 8px;
    background: rgba(255,255,255,.08);
    color: #fff;
}
.nav-drawer-links {
    margin-top: 10px;
    display: grid;
    gap: 8px;
}
.nav-drawer-links a,
.nav-drawer-links .nav-button {
    min-height: 40px;
    padding: 0 10px;
    display: inline-flex;
    align-items: center;
    border-radius: 8px;
    color: #dbeafe;
    font-weight: 800;
}
.nav-drawer-links a:hover,
.nav-drawer-links .nav-button:hover {
    color: #fff;
    background: rgba(255,255,255,.08);
}
body.nav-drawer-open {
    overflow: hidden;
}

@media (max-width: 900px) {
    .topbar {
        grid-template-columns: auto minmax(0, 1fr) auto;
        align-items: center;
    }
    .nav-desktop {
        display: none;
    }
    .nav-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
}

/* Screen page: keep canvas at full available height and prevent overflow */
.screen-page {
    height: calc(100dvh - 84px);
    padding-bottom: 0;
    overflow: hidden;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    gap: 10px;
}
.screen-page .canvas-shell {
    width: 100%;
    height: 100%;
    min-height: 0;
    max-height: 100%;
    margin: 0;
    overflow: hidden;
}
#screenCanvas {
    width: 100%;
    height: 100%;
    min-height: 0;
}

@media (max-width: 640px) {
    .screen-page {
        height: calc(100dvh - 76px);
        gap: 8px;
    }
}

/* Screen detail panel: compact + responsive on desktop, mobile vertical and mobile horizontal */
.screen-selection-panel {
    left: 12px;
    right: 12px;
    bottom: 10px;
    transform: none;
    width: auto;
    padding: 12px 14px;
    gap: 12px;
    max-height: min(44vh, 290px);
    overflow: auto;
}
.screen-selection-panel h2 {
    margin: 0 0 4px;
    font-size: clamp(1rem, 1.8vw, 1.35rem);
}
.screen-selection-panel p {
    font-size: .9rem;
    line-height: 1.3;
}
#screenSelectionMessage {
    margin-top: 6px;
    max-width: none;
}
.screen-selection-actions .button {
    min-height: 36px;
    padding: 0 12px;
    font-size: .86rem;
}

@media (min-width: 1024px) {
    .screen-selection-panel {
        left: 50%;
        right: auto;
        transform: translateX(-50%);
        width: min(1180px, calc(100% - 24px));
        max-height: min(38vh, 250px);
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: start;
    }
    .screen-selection-actions {
        min-width: 190px;
    }
}

@media (max-width: 900px) {
    .screen-selection-panel {
        grid-template-columns: 1fr;
        align-items: stretch;
        max-height: min(50vh, 320px);
    }
    .screen-selection-actions {
        min-width: 0;
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }
    .screen-selection-actions .button {
        width: 100%;
    }
}

@media (max-width: 640px) and (orientation: portrait) {
    .screen-selection-panel {
        left: 8px;
        right: 8px;
        bottom: 8px;
        padding: 10px 10px;
        gap: 8px;
        border-radius: 8px;
        max-height: min(46vh, 270px);
    }
    .screen-selection-panel h2 {
        font-size: 1rem;
    }
    .screen-selection-panel p {
        font-size: .82rem;
    }
    .screen-selection-actions {
        grid-template-columns: 1fr;
        gap: 6px;
    }
    .screen-selection-actions .button {
        min-height: 34px;
        font-size: .8rem;
    }
    .screen-report-form {
        gap: 8px;
        padding-top: 10px;
    }
}

@media (max-height: 520px) and (orientation: landscape) {
    .screen-selection-panel {
        left: 8px;
        right: 8px;
        bottom: 6px;
        padding: 8px 10px;
        gap: 8px;
        max-height: min(56vh, 220px);
    }
    .screen-selection-panel h2 {
        font-size: .96rem;
    }
    .screen-selection-panel p {
        font-size: .78rem;
        line-height: 1.24;
    }
    .screen-selection-actions {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 6px;
    }
    .screen-selection-actions .button {
        min-height: 32px;
        font-size: .76rem;
        padding: 0 8px;
    }
    .screen-report-form textarea {
        min-height: 72px;
    }
}

/* Immersive screen view (screen.php) */
body.screen-immersive {
    background: #050814;
}
body.screen-immersive .topbar,
body.screen-immersive .footer,
body.screen-immersive .flash {
    display: none !important;
}
body.screen-immersive main {
    min-height: 100dvh;
    height: 100dvh;
    padding: 0;
    margin: 0;
}
body.screen-immersive .screen-page {
    position: relative;
    height: 100dvh;
    padding: 0;
    gap: 0;
}
body.screen-immersive .sponsored-marquee-top {
    position: fixed;
    top: 8px;
    left: 8px;
    right: 56px;
    z-index: 10025;
    width: auto;
    margin: 0;
    border-radius: 8px;
}
body.screen-immersive .sponsored-marquee-top .sponsored-marquee-track {
    padding: 6px 8px;
    gap: 8px;
}
body.screen-immersive .sponsored-marquee-top .sponsored-marquee-item {
    min-height: 54px;
}
body.screen-immersive .screen-page .canvas-shell {
    width: 100vw;
    height: 100dvh;
    min-height: 100dvh;
    max-height: 100dvh;
    margin: 0;
    border: 0;
    border-radius: 0;
    box-shadow: none;
}
body.screen-immersive #screenCanvas {
    width: 100vw;
    height: 100dvh;
    min-height: 0;
}
body.screen-immersive .screen-selection-panel {
    left: 10px;
    right: 92px;
    bottom: 10px;
    transform: none;
    width: auto;
    max-height: min(42vh, 260px);
    padding: 10px 12px;
    padding-right: 48px;
    gap: 10px;
    z-index: 10020;
}
body.screen-immersive .screen-selection-close {
    position: absolute !important;
    top: 6px !important;
    right: 6px !important;
    left: auto !important;
    bottom: auto !important;
    margin: 0 !important;
    min-width: 30px;
    min-height: 30px;
}
body.screen-immersive .screen-selection-panel h2 {
    font-size: clamp(.92rem, 1.4vw, 1.15rem);
    margin-bottom: 3px;
}
body.screen-immersive .screen-selection-panel p {
    font-size: .82rem;
    line-height: 1.24;
}
body.screen-immersive .screen-selection-actions {
    min-width: 0;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}
body.screen-immersive .screen-selection-actions .button {
    min-height: 34px;
    font-size: .78rem;
    padding: 0 8px;
}
body.screen-immersive .screen-buy-fab {
    position: fixed;
    right: 10px;
    bottom: 10px;
    z-index: 10030;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 0 15px;
    border-radius: 999px;
    border: 1px solid rgba(255,255,255,.22);
    background: linear-gradient(135deg, #0ea5b7 0%, #06b6d4 52%, #22d3ee 100%);
    color: #f8fafc;
    box-shadow: 0 16px 34px rgba(2, 6, 23, .45), 0 0 0 1px rgba(255,255,255,.12) inset;
    font-weight: 900;
    letter-spacing: 0;
}
body.screen-immersive .screen-buy-fab i {
    font-size: .92rem;
}
body.screen-immersive .screen-buy-fab:hover {
    transform: translateY(-1px);
    filter: brightness(1.04);
}
body.screen-immersive .screen-buy-fab:active {
    transform: translateY(0);
}
body.screen-immersive .screen-close-fab {
    position: fixed;
    top: 10px;
    right: 10px;
    z-index: 10031;
    min-width: 40px;
    min-height: 40px;
    border-radius: 999px;
    background: rgba(8, 13, 26, .84);
    border-color: rgba(255,255,255,.18);
    color: #fff;
    backdrop-filter: blur(8px);
}
body.screen-immersive .screen-close-fab i {
    font-size: 1rem;
}

@media (max-width: 820px) {
    body.screen-immersive .sponsored-marquee-top {
        top: 6px;
        left: 6px;
        right: 44px;
    }
    body.screen-immersive .sponsored-marquee-top .sponsored-marquee-track {
        padding: 5px 6px;
        gap: 6px;
    }
    body.screen-immersive .sponsored-marquee-top .sponsored-marquee-item {
        width: 240px;
        max-width: 72vw;
        min-height: 48px;
        padding: 6px;
    }
    body.screen-immersive .sponsored-marquee-top .sponsored-marquee-item strong {
        font-size: .78rem;
    }
    body.screen-immersive .sponsored-marquee-top .sponsored-marquee-item small {
        font-size: .68rem;
    }
    body.screen-immersive .screen-selection-panel {
        left: 8px;
        right: 8px;
        bottom: 58px;
        max-height: min(34vh, 220px);
        padding: 8px 9px;
        gap: 8px;
    }
    body.screen-immersive .screen-selection-close {
        top: 5px !important;
        right: 5px !important;
        width: 20px;
    }
    body.screen-immersive .screen-selection-panel h2 {
        font-size: .96rem;
    }
    body.screen-immersive .screen-selection-panel p {
        font-size: .78rem;
    }
    body.screen-immersive .screen-selection-actions {
        grid-template-columns: 1fr 1fr;
        gap: 6px;
    }
    body.screen-immersive .screen-selection-actions .button {
        min-height: 32px;
        font-size: .74rem;
    }
    body.screen-immersive .screen-buy-fab {
        right: 8px;
        bottom: 8px;
        min-height: 38px;
        font-size: .8rem;
        padding: 0 11px;
        gap: 6px;
    }
    body.screen-immersive .screen-close-fab {
        top: 8px;
        right: 8px;
        min-width: 36px;
        min-height: 36px;
    }
}
    
.swal2-container{
    z-index: 99999 !important;
}
