@font-face {
    font-family: Inter;
    src: url('/themes/rovell/assets/dynamic/fonts/inter/inter.woff2') format('woff2');
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
}

@font-face {
    font-family: Newsreader;
    src: url('/themes/rovell/assets/dynamic/fonts/newsreader/newsreader.woff2') format('woff2');
    font-style: normal;
    font-weight: 200 800;
    font-display: swap;
}

:root {
    color-scheme: light;
    font-family: Inter, system-ui, sans-serif;
    color: #252537;
    background: #f4f4f7;
    --surface: #ffffff;
    --muted: #656573;
    --toolbar: #F9F9FC;
    --line: #e9e9ef;
    --selected: #ededf2;
    --focus: #656573;
    --accent: #c03800;
}

* {
    box-sizing: border-box;
}

body {
    display: flex;
    flex-direction: column;
    height: 100vh;
    height: 100dvh;
    margin: 0;
    overflow: hidden;
}

button,
select,
summary,
a {
    -webkit-tap-highlight-color: transparent;
}

button,
select {
    font: inherit;
    color: inherit;
}

button,
summary,
select {
    cursor: pointer;
}

button,
a,
select,
summary {
    touch-action: manipulation;
}

button:disabled,
select:disabled {
    cursor: wait;
    opacity: 0.45;
}

:focus-visible {
    outline: 2px solid var(--focus);
    outline-offset: 3px;
}

[hidden] {
    display: none !important;
}

.toolbar {
    position: relative;
    z-index: 2;
    display: grid;
    grid-template-columns: 1fr auto 1fr auto;
    align-items: center;
    gap: 16px;
    flex: 0 0 auto;
    min-height: 54px;
    padding: 8px 20px;
    border-bottom: 1px solid var(--line);
    background: var(--toolbar);
}

.identity {
    display: flex;
    align-items: baseline;
    gap: 9px;
    white-space: nowrap;
}

.identity h1 {
    margin: 0;
    font-family: Newsreader, Georgia, serif;
    font-size: 24px;
    font-weight: 450;
    letter-spacing: -0.5px;
    line-height: 1;
}

.identity__byline {
    color: var(--muted);
    font-size: 11px;
}

.devices {
    display: flex;
    gap: 2px;
}

.toolbar-toggle {
    margin-left: 6px;
}

.icon-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 34px;
    width: 34px;
    height: 34px;
    padding: 0;
    border: 0;
    border-radius: 3px;
    background: transparent;
    text-decoration: none;
}

.icon-button:hover,
.icon-button[aria-pressed='true'] {
    background: #fff;
}

.icon-button[aria-pressed='true'] {
    box-shadow: inset 0 -1px #b6b6b6;
}

.icon-button img {
    width: 17px;
    height: 17px;
}

.toolbar-toggle img {
    width: 16px;
    height: 16px;
}

.options {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 4px;
}

.buy-theme {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 34px;
    padding: 7px 13px;
    border: 1px solid #252537;
    border-radius: 6px;
    background: #252537;
    color: #fff;
    font-size: 12px;
    font-weight: 500;
    line-height: 18px;
    text-decoration: none;
    white-space: nowrap;
}

.buy-theme img {
    flex-shrink: 0;
    filter: invert(1);
}

.buy-theme:hover {
    border-color: #41414f;
    background: #41414f;
}

.palette-picker {
    position: relative;
    font-size: 12px;
}

.palette-picker summary {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 110px;
    min-height: 34px;
    padding: 6px 9px;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: #fff;
    list-style: none;
}

.palette-picker summary::-webkit-details-marker {
    display: none;
}

.palette-picker[open] summary,
.palette-picker summary:hover {
    background: #fff;
}

.chevron {
    margin-left: auto;
}

.swatch {
    display: inline-block;
    flex-shrink: 0;
    width: 15px;
    height: 15px;
    border: 1px solid rgb(0 0 0 / 12%);
    border-radius: 50%;
    background: var(--swatch, var(--accent));
}

.palette-panel {
    position: absolute;
    inset: calc(100% + 12px) 0 auto auto;
    width: 308px;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--surface);
    box-shadow: 0 12px 40px rgb(37 37 55 / 12%);
}

.palette-panel fieldset {
    min-width: 0;
    margin: 0;
    padding: 0;
    border: 0;
}

.palette-panel legend {
    margin-bottom: 14px;
    padding: 0;
    font-size: 12px;
    font-weight: 600;
}

.palette-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 7px;
}

.palette-option {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 9px;
    padding: 12px 4px 9px;
    border: 1px solid transparent;
    border-radius: 7px;
    font-size: 11px;
    cursor: pointer;
}

.palette-option:hover {
    background: #f7f7f9;
}

.palette-option:has(input:checked) {
    border-color: #a3a3af;
    background: #f7f7f9;
}

.palette-option:has(input:focus-visible) {
    outline: 2px solid var(--focus);
    outline-offset: 2px;
}

.palette-option .swatch {
    display: grid;
    place-items: center;
    width: 28px;
    height: 28px;
}

.palette-option .swatch img {
    visibility: hidden;
    filter: invert(1);
}

.palette-option input:checked + .swatch img {
    visibility: visible;
}

.animation-control {
    position: relative;
    flex-shrink: 0;
}

.animation-control select {
    width: 126px;
    height: 34px;
    padding: 0 28px 0 9px;
    border: 1px solid #ddd;
    border-radius: 6px;
    appearance: none;
    background: #fff;
    font-size: 12px;
}

.animation-control select:hover {
    background: #fff;
}

.animation-control option {
    background: var(--surface);
}

.animation-control > img {
    position: absolute;
    top: 9px;
    right: 8px;
    pointer-events: none;
}

.divider {
    height: 18px;
    margin-inline: 5px;
    border-left: 1px solid var(--line);
}

.stage {
    position: relative;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

.frame-shell {
    position: absolute;
    top: 0;
    left: 50%;
    overflow: hidden;
    background: var(--surface);
    transform: translateX(-50%);
}

.stage:not([data-device='desktop']) .frame-shell {
    border-radius: 10px;
    box-shadow: 0 0 0 1px #dcdce2, 0 12px 40px rgb(37 37 55 / 8%);
}

iframe {
    display: block;
    border: 0;
    background: var(--surface);
    transform-origin: top left;
}

.loading {
    position: absolute;
    right: 18px;
    bottom: 18px;
    padding: 10px 14px;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: var(--surface);
    font-size: 12px;
    pointer-events: none;
}

.preview-error {
    position: absolute;
    top: 20px;
    left: 50%;
    width: min(420px, calc(100% - 32px));
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    box-shadow: 0 8px 30px rgb(37 37 55 / 12%);
    font-size: 13px;
    transform: translateX(-50%);
}

.preview-error p {
    margin: 0 0 14px;
}

.preview-error button {
    margin-right: 12px;
    padding: 8px 10px;
    border: 1px solid var(--line);
    border-radius: 5px;
    background: var(--selected);
}

.preview-error a {
    color: inherit;
}

.show-toolbar {
    position: fixed;
    z-index: 3;
    top: 12px;
    right: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 42px;
    padding: 10px 13px;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: var(--surface);
    box-shadow: 0 2px 12px rgb(37 37 55 / 8%);
    font-size: 12px;
}

.no-script {
    position: fixed;
    inset: 100px 16px auto;
    text-align: center;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
}

@media (max-width: 800px) {
    .toolbar {
        grid-template-columns: 1fr auto auto;
        gap: 6px 12px;
        padding: 8px 12px;
    }

    .identity {
        grid-column: 1;
        grid-row: 1;
    }

    .devices {
        grid-column: 2;
        grid-row: 1;
    }

    .buy-theme {
        grid-column: 3;
        grid-row: 1;
    }

    .options {
        grid-column: 1 / -1;
        grid-row: 2;
        justify-content: flex-start;
    }

    .divider {
        margin-left: auto;
    }

    .palette-panel {
        right: auto;
        left: 0;
    }
}

@media (max-width: 480px) {
    .toolbar {
        padding: 7px 10px;
    }

    .identity {
        gap: 8px;
    }

    .identity h1 {
        font-size: 24px;
    }

    .identity__byline {
        display: none;
    }

    .options {
        gap: 4px;
    }

    .palette-picker {
        flex: 1;
    }

    .palette-picker summary {
        min-width: 0;
    }

    .animation-control select {
        width: 125px;
    }

    .divider,
    .reset {
        display: none;
    }

    .palette-panel {
        width: min(308px, calc(100vw - 24px));
    }
}

@media (max-width: 380px) {
    .toolbar {
        column-gap: 6px;
    }

    .devices .icon-button {
        flex-basis: 30px;
        width: 30px;
    }

    .toolbar-toggle {
        margin-left: 0;
    }

    .buy-theme {
        padding-inline: 9px;
        font-size: 11px;
    }
}

@media (max-width: 350px) {
    .identity__byline {
        display: none;
    }

    .options > .icon-button {
        flex-basis: 32px;
        width: 32px;
    }

    .palette-picker summary {
        gap: 5px;
        padding-inline: 7px;
    }

    .animation-control select {
        width: 116px;
    }
}

/* Collapse the toolbar's layout space together with its slide animation. */
.toolbar-shell {
    position: relative;
    z-index: 2;
    display: grid;
    grid-template-rows: 1fr;
    flex: 0 0 auto;
    transition: grid-template-rows 280ms ease;
}

.toolbar-clip {
    min-height: 0;
}

.toolbar-shell .toolbar {
    transition: transform 280ms ease, opacity 280ms ease;
}

.toolbar-shell.is-collapsed {
    grid-template-rows: 0fr;
}

.toolbar-shell.is-collapsed .toolbar-clip {
    overflow: hidden;
}

.toolbar-shell.is-collapsed .toolbar {
    transform: translateY(-100%);
    opacity: 0;
}

.toolbar-toggle img,
.show-toolbar img {
    width: 16px;
    height: 16px;
}

@media (prefers-reduced-motion: reduce) {
    .toolbar-shell,
    .toolbar-shell .toolbar {
        transition: none;
    }
}
