/* Cute and tech themes share the production page markup and behavior. */
.theme-canvas,
.cute-decor,
.tech-streams {
    display: none;
}

.theme-canvas {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

body.template-cute,
body.template-tech {
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
    letter-spacing: 0;
}

body.template-cute.custom-background,
body.template-tech.custom-background {
    background: var(--custom-background);
}

body.template-cute .shell,
body.template-tech .shell {
    position: relative;
    z-index: 3;
    width: min(100%, 480px);
    gap: 16px;
}

body.template-cute .bg-orb,
body.template-tech .bg-orb {
    display: none;
}

body.template-cute .brand,
body.template-tech .brand {
    flex: 1;
    min-width: 0;
}

body.template-cute .brand h1,
body.template-cute .brand p,
body.template-tech .brand h1,
body.template-tech .brand p {
    max-width: 100%;
    overflow-wrap: anywhere;
    word-break: break-word;
}

body.template-cute .actions,
body.template-tech .actions {
    flex-shrink: 0;
}

body.template-cute .details,
body.template-tech .details {
    display: block;
    padding: 0 18px 16px;
    border-top: 0;
}

body.template-cute .detail-row,
body.template-tech .detail-row {
    grid-template-columns: 84px minmax(0, 1fr) 38px;
    min-height: 52px;
    padding: 0;
    border-top: 1px solid var(--border-light);
    border-right: 0;
    border-bottom: 0;
}

body.template-cute .detail-row:first-child,
body.template-tech .detail-row:first-child {
    border-top: 0;
}

/* Cute bubblegum theme */
body.template-cute {
    --radius: 28px;
    --radius-sm: 18px;
    --radius-full: 60px;
    --bg-primary: #fdf6f0;
    --bg-panel: rgba(255, 248, 243, 0.88);
    --bg-panel-strong: rgba(255, 248, 243, 0.97);
    --bg-glass: rgba(255, 239, 232, 0.72);
    --border-light: rgba(255, 150, 180, 0.24);
    --border-strong: rgba(255, 122, 165, 0.48);
    --text-primary: #4a2e3a;
    --text-secondary: #7a4e5e;
    --text-muted: #a77e90;
    --text-inverse: #fff8fb;
    --accent-1: #ff729f;
    --accent-2: #ff9fbd;
    --accent-3: #ffd1df;
    --accent-glow: rgba(255, 114, 159, 0.28);
    --success: #44bd84;
    --success-bg: rgba(68, 189, 132, 0.14);
    --wait: #dd9d13;
    --wait-bg: rgba(247, 201, 72, 0.16);
    --danger: #f45d70;
    --danger-bg: rgba(244, 93, 112, 0.14);
    --shadow-panel: 0 22px 55px rgba(197, 86, 125, 0.16), 0 5px 18px rgba(197, 86, 125, 0.08);
    --shadow-glow: 0 14px 34px rgba(255, 114, 159, 0.28);
    background:
        radial-gradient(circle at 12% 18%, rgba(255, 206, 222, 0.78), transparent 34%),
        radial-gradient(circle at 88% 82%, rgba(205, 184, 255, 0.48), transparent 32%),
        #fdf6f0;
    font-family: "Nunito", "Noto Sans SC", "PingFang SC", system-ui, sans-serif;
}

body.template-cute.theme-dark {
    --bg-primary: #211622;
    --bg-panel: rgba(49, 31, 49, 0.90);
    --bg-panel-strong: rgba(48, 30, 48, 0.98);
    --bg-glass: rgba(75, 45, 70, 0.62);
    --border-light: rgba(255, 174, 201, 0.17);
    --border-strong: rgba(255, 143, 181, 0.40);
    --text-primary: #ffedf3;
    --text-secondary: #e7bfd0;
    --text-muted: #b88da0;
    --text-inverse: #301e30;
    --shadow-panel: 0 24px 60px rgba(5, 2, 8, 0.48), 0 5px 18px rgba(255, 114, 159, 0.07);
    background:
        radial-gradient(circle at 18% 24%, rgba(112, 63, 104, 0.66), transparent 34%),
        radial-gradient(circle at 82% 78%, rgba(54, 45, 94, 0.56), transparent 34%),
        #1a111d;
}

body.template-cute .cute-decor {
    display: block;
    position: fixed;
    z-index: 1;
    pointer-events: none;
    font-size: 34px;
    opacity: 0.20;
    animation: cuteFloat 8s ease-in-out infinite;
}

body.template-cute .cute-decor--1 { top: 6%; left: 4%; }
body.template-cute .cute-decor--2 { top: 18%; right: 5%; animation-delay: 1.4s; }
body.template-cute .cute-decor--3 { bottom: 17%; left: 6%; animation-delay: 2.8s; }
body.template-cute .cute-decor--4 { right: 5%; bottom: 8%; animation-delay: 4.2s; }
body.template-cute #cuteCanvas { display: block; z-index: 2; }

body.template-cute .topbar {
    padding: 0 4px;
}

body.template-cute .brand h1 {
    color: #ff789f;
    background: linear-gradient(135deg, #ff6f9b, #ff9fbd 55%, #bb82e8);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-size: 24px;
    font-weight: 800;
    letter-spacing: 0;
}

body.template-cute .brand h1::before {
    content: "🍭 ";
    -webkit-text-fill-color: initial;
}

body.template-cute .brand p {
    margin-top: 5px;
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0;
}

body.template-cute .brand p::before,
body.template-cute .brand p::after {
    content: "✨";
    margin: 0 4px;
}

body.template-cute .contact-btn,
body.template-cute .theme-toggle {
    min-height: 38px;
    padding: 9px 12px;
    border-color: var(--border-light);
    border-radius: 18px;
    background: var(--bg-glass);
    color: var(--text-secondary);
    font-weight: 700;
    letter-spacing: 0;
}

body.template-cute .contact-btn:hover,
body.template-cute .theme-toggle:hover {
    border-color: var(--border-strong);
    background: var(--bg-panel-strong);
    color: var(--accent-1);
    box-shadow: 0 8px 22px var(--accent-glow);
}

body.template-cute .panel {
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    background: var(--bg-panel);
    box-shadow: var(--shadow-panel);
    overflow: hidden;
}

body.template-cute .panel::before {
    border-radius: inherit;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.64), transparent 44%, rgba(255, 153, 188, 0.15));
}

body.template-cute .panel::after {
    top: -30%;
    left: -24%;
    background: radial-gradient(ellipse, rgba(255, 117, 163, 0.22), transparent 70%);
}

body.template-cute .status {
    min-height: 48px;
    padding: 13px 18px;
    border-color: var(--border-light);
    font-size: 13px;
    font-weight: 600;
}

body.template-cute .status-dot {
    width: 10px;
    height: 10px;
    box-shadow: 0 0 0 5px rgba(255, 114, 159, 0.10);
}

body.template-cute .code-area {
    padding: 32px 20px 24px;
}

body.template-cute .code-area .eyebrow {
    margin-bottom: 12px;
    color: var(--accent-1);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0;
}

body.template-cute .code-display {
    min-height: 96px;
    gap: 7px;
    color: var(--text-primary);
    font-size: 72px;
    font-weight: 900;
    letter-spacing: 0;
    text-shadow: 0 8px 30px var(--accent-glow);
}

body.template-cute .code-display.empty {
    color: var(--text-muted);
    font-size: 42px;
    text-shadow: none;
}

body.template-cute .primary-copy {
    margin-top: 22px;
    border-radius: 18px;
    background: linear-gradient(135deg, #ff729f, #ff9fbd);
    box-shadow: var(--shadow-glow);
    font-weight: 800;
    letter-spacing: 0;
}

body.template-cute .primary-copy:hover:not(:disabled) {
    box-shadow: 0 18px 42px rgba(255, 114, 159, 0.36);
}

body.template-cute .detail-label {
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 700;
}

body.template-cute .detail-row:nth-child(1) .detail-label::before { content: "🎁 "; }
body.template-cute .detail-row:nth-child(2) .detail-label::before { content: "📱 "; }
body.template-cute .detail-row:nth-child(3) .detail-label::before { content: "⏰ "; }

body.template-cute .detail-value {
    color: var(--text-primary);
    font-size: 15px;
    font-weight: 700;
}

body.template-cute .icon-btn {
    border-color: var(--border-light);
    border-radius: 12px;
    background: var(--bg-glass);
}

body.template-cute .refresh-bar {
    padding: 14px 18px;
    border-color: var(--border-light);
    background: var(--bg-panel-strong);
}

body.template-cute .refresh-btn {
    border-color: var(--border-light);
    border-radius: 14px;
    background: var(--bg-glass);
    font-weight: 700;
}

body.template-cute .refresh-btn .btn-text::before { content: "🌟 "; }

body.template-cute .ad-slot {
    border-color: var(--border-light);
    border-radius: 18px;
    background: var(--bg-glass);
}

body.template-cute .footer a { color: var(--accent-1); }
body.template-cute .footer::before,
body.template-cute .footer::after {
    content: "🧁";
    margin: 0 5px;
}

/* Futuristic data-field theme */
body.template-tech {
    --radius: 12px;
    --radius-sm: 8px;
    --radius-full: 30px;
    --bg-primary: #e9f1ff;
    --bg-panel: rgba(255, 255, 255, 0.78);
    --bg-panel-strong: rgba(248, 251, 255, 0.94);
    --bg-glass: rgba(220, 234, 255, 0.62);
    --border-light: rgba(54, 119, 219, 0.20);
    --border-strong: rgba(47, 117, 226, 0.48);
    --text-primary: #101d35;
    --text-secondary: #39567d;
    --text-muted: #6883a8;
    --text-inverse: #f2f7ff;
    --accent-1: #286dff;
    --accent-2: #5b8cff;
    --accent-3: #906dff;
    --accent-glow: rgba(40, 109, 255, 0.24);
    --success: #15975f;
    --success-bg: rgba(21, 151, 95, 0.12);
    --wait: #b87506;
    --wait-bg: rgba(184, 117, 6, 0.10);
    --danger: #cf3e5b;
    --danger-bg: rgba(207, 62, 91, 0.10);
    --shadow-panel: 0 28px 70px rgba(45, 82, 145, 0.20), 0 0 36px rgba(59, 122, 255, 0.07);
    --shadow-glow: 0 0 38px rgba(40, 109, 255, 0.20);
    background: #e9f1ff;
    font-family: Inter, "Noto Sans SC", "PingFang SC", system-ui, sans-serif;
}

body.template-tech.theme-dark {
    --bg-primary: #050813;
    --bg-panel: rgba(9, 16, 32, 0.88);
    --bg-panel-strong: rgba(10, 19, 38, 0.96);
    --bg-glass: rgba(24, 45, 78, 0.48);
    --border-light: rgba(89, 155, 255, 0.18);
    --border-strong: rgba(87, 153, 255, 0.46);
    --text-primary: #edf4ff;
    --text-secondary: #b7cceb;
    --text-muted: #6f8db6;
    --text-inverse: #071021;
    --accent-1: #4f8cff;
    --accent-2: #72afff;
    --accent-3: #a98cff;
    --accent-glow: rgba(80, 143, 255, 0.28);
    --success: #2ed184;
    --success-bg: rgba(46, 209, 132, 0.11);
    --wait: #f0aa38;
    --wait-bg: rgba(240, 170, 56, 0.10);
    --danger: #ff5874;
    --danger-bg: rgba(255, 88, 116, 0.10);
    --shadow-panel: 0 30px 80px rgba(0, 0, 0, 0.62), 0 0 46px rgba(46, 105, 255, 0.08);
    --shadow-glow: 0 0 42px rgba(75, 139, 255, 0.20);
    background: #050813;
}

body.template-tech #techCanvas { display: block; z-index: 1; }

body.template-tech .tech-streams {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 2;
    pointer-events: none;
    overflow: hidden;
}

body.template-tech .tech-streams::before,
body.template-tech .tech-streams::after {
    content: "010101  SIGNAL  9F2A  001101  TELEGRAM  7B4C  101100";
    position: absolute;
    top: 8%;
    color: rgba(111, 173, 255, 0.17);
    font-family: "SF Mono", Consolas, monospace;
    font-size: 10px;
    writing-mode: vertical-rl;
    line-height: 1.8;
    animation: dataDrift 16s linear infinite;
}

body.template-tech .tech-streams::before { left: 5%; }
body.template-tech .tech-streams::after { right: 6%; animation-delay: -8s; }

body.template-tech .topbar {
    padding: 0 2px 2px;
}

body.template-tech .brand h1 {
    color: var(--text-primary);
    background: none;
    -webkit-text-fill-color: currentColor;
    font-size: 23px;
    font-weight: 750;
    letter-spacing: 0;
    text-shadow: 0 0 24px rgba(92, 153, 255, 0.16);
}

body.template-tech .brand h1::before {
    content: "// ";
    color: var(--accent-1);
}

body.template-tech .brand p {
    margin-top: 6px;
    color: var(--text-muted);
    font-family: "SF Mono", Consolas, monospace;
    font-size: 11px;
    letter-spacing: 0;
}

body.template-tech .contact-btn,
body.template-tech .theme-toggle {
    min-height: 38px;
    padding: 9px 11px;
    border: 1px solid var(--border-light);
    border-radius: 7px;
    background: var(--bg-glass);
    color: var(--text-secondary);
    font-family: "SF Mono", Consolas, monospace;
    font-size: 11px;
    letter-spacing: 0;
}

body.template-tech .contact-btn:hover,
body.template-tech .theme-toggle:hover {
    border-color: var(--accent-1);
    background: rgba(74, 133, 255, 0.12);
    color: var(--text-primary);
    box-shadow: 0 0 24px rgba(74, 133, 255, 0.16);
}

body.template-tech .panel {
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    background: var(--bg-panel);
    box-shadow: var(--shadow-panel);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
}

body.template-tech .panel::before {
    border-radius: inherit;
    padding: 1px;
    background: linear-gradient(135deg, rgba(82, 149, 255, 0.48), transparent 42%, rgba(168, 108, 255, 0.30));
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
}

body.template-tech .panel::after {
    top: -34%;
    left: -24%;
    background: radial-gradient(ellipse, rgba(69, 131, 255, 0.24), transparent 70%);
}

body.template-tech .status {
    min-height: 46px;
    padding: 12px 18px;
    border-color: var(--border-light);
    font-family: "SF Mono", Consolas, monospace;
    font-size: 11px;
    letter-spacing: 0;
}

body.template-tech .status-dot {
    width: 8px;
    height: 8px;
    border-radius: 2px;
    box-shadow: 0 0 14px currentColor;
}

body.template-tech .code-area {
    padding: 34px 20px 25px;
}

body.template-tech .code-area .eyebrow {
    margin-bottom: 12px;
    color: var(--accent-2);
    font-family: "SF Mono", Consolas, monospace;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0;
}

body.template-tech .code-display {
    min-height: 100px;
    gap: 8px;
    color: var(--text-primary);
    font-size: 74px;
    font-weight: 800;
    letter-spacing: 0;
    text-shadow: 0 0 34px var(--accent-glow);
}

body.template-tech .code-display .digit {
    color: var(--accent-2);
}

body.template-tech .code-display.empty {
    color: var(--text-muted);
    font-size: 42px;
    text-shadow: none;
}

body.template-tech .listen-visual {
    color: var(--text-muted);
    font-family: "SF Mono", Consolas, monospace;
    font-size: 11px;
}

body.template-tech .scan-line {
    width: min(240px, 68%);
    height: 1px;
    background: rgba(94, 155, 255, 0.10);
}

body.template-tech .primary-copy {
    margin-top: 22px;
    border: 1px solid rgba(87, 153, 255, 0.46);
    border-radius: 8px;
    background: linear-gradient(135deg, rgba(58, 116, 238, 0.94), rgba(105, 82, 229, 0.94));
    box-shadow: var(--shadow-glow);
    font-family: "SF Mono", Consolas, monospace;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0;
}

body.template-tech .primary-copy:hover:not(:disabled) {
    box-shadow: 0 0 34px rgba(80, 143, 255, 0.34);
}

body.template-tech .detail-label,
body.template-tech .detail-value,
body.template-tech .refresh-info,
body.template-tech .refresh-btn {
    font-family: "SF Mono", Consolas, monospace;
    letter-spacing: 0;
}

body.template-tech .detail-label {
    color: var(--text-muted);
    font-size: 11px;
}

body.template-tech .detail-value {
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 650;
}

body.template-tech .icon-btn {
    border-color: transparent;
    border-radius: 7px;
    background: var(--bg-glass);
}

body.template-tech .icon-btn:hover:not(:disabled) {
    border-color: var(--border-light);
    color: var(--accent-2);
    box-shadow: 0 0 18px rgba(80, 143, 255, 0.15);
}

body.template-tech .refresh-bar {
    min-height: 54px;
    padding: 11px 18px;
    border-color: var(--border-light);
    background: var(--bg-panel-strong);
}

body.template-tech .refresh-info,
body.template-tech .refresh-btn {
    font-size: 11px;
}

body.template-tech .refresh-btn {
    border-color: var(--border-light);
    border-radius: 7px;
    background: var(--bg-glass);
}

body.template-tech .ad-slot {
    border-style: solid;
    border-color: var(--border-light);
    border-radius: 8px;
    background: var(--bg-glass);
}

body.template-tech .footer {
    font-family: "SF Mono", Consolas, monospace;
    font-size: 10px;
}

body.template-tech .footer a { color: var(--accent-2); }

@keyframes cuteFloat {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-14px) rotate(5deg); }
}

@keyframes dataDrift {
    from { transform: translateY(-18%); }
    to { transform: translateY(18%); }
}

@media (max-width: 560px) {
    body.template-cute,
    body.template-tech {
        padding: 14px 12px;
    }

    body.template-cute .shell,
    body.template-tech .shell {
        gap: 12px;
    }

    body.template-cute .topbar,
    body.template-tech .topbar {
        flex-wrap: nowrap;
    }

    body.template-cute .brand h1,
    body.template-tech .brand h1 {
        font-size: 18px;
    }

    body.template-cute .brand p,
    body.template-tech .brand p {
        font-size: 10px;
    }

    body.template-cute .actions,
    body.template-tech .actions {
        margin-left: 8px;
        gap: 6px;
    }

    body.template-cute .contact-btn,
    body.template-cute .theme-toggle,
    body.template-tech .contact-btn,
    body.template-tech .theme-toggle {
        min-height: 34px;
        padding: 8px 9px;
        font-size: 10px;
    }

    body.template-cute .contact-btn span,
    body.template-tech .contact-btn span {
        display: none;
    }

    body.template-cute .theme-toggle span,
    body.template-tech .theme-toggle span {
        display: none;
    }

    body.template-cute .code-area,
    body.template-tech .code-area {
        padding: 28px 14px 20px;
    }

    body.template-cute .code-display,
    body.template-tech .code-display {
        min-height: 76px;
        gap: 5px;
        font-size: 52px;
    }

    body.template-cute .details,
    body.template-tech .details {
        padding: 0 14px 12px;
    }

    body.template-cute .detail-row,
    body.template-tech .detail-row {
        grid-template-columns: 72px minmax(0, 1fr) 34px;
        min-height: 48px;
    }

    body.template-cute .detail-value,
    body.template-tech .detail-value {
        font-size: 13px;
    }

    body.template-cute .refresh-bar,
    body.template-tech .refresh-bar {
        padding: 10px 14px;
    }

    body.template-cute .cute-decor,
    body.template-tech .tech-streams {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .theme-canvas,
    .cute-decor,
    .tech-streams {
        animation: none !important;
    }
}
