:root {
    color-scheme: light;
    --ink: #28201d;
    --muted: #675b55;
    --paper: #f7f2eb;
    --surface: #fffdfa;
    --line: #e5dbcf;
    --rust: #9a402b;
    --rust-hover: #803321;
    --tint: #f8e8dc;
    font: 15px/1.5 system-ui, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--paper); color: var(--ink); }
button, input, select, textarea { font: inherit; }
button, a, .upload { -webkit-tap-highlight-color: transparent; }
a { color: var(--rust); }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .52; }
button, a, input, select, textarea, .upload { outline-offset: 4px; }
:focus-visible { outline: 2px solid var(--rust); }

.top { background: var(--surface); border-bottom: 1px solid var(--line); }
.top-inner { max-width: 1192px; margin: auto; padding: 0 32px; min-height: 71px; display: flex; align-items: center; gap: 42px; }
.brand { color: var(--ink); display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-size: 19px; font-weight: 750; letter-spacing: -.04em; white-space: nowrap; }
.mark { display: inline-grid; width: 29px; height: 29px; gap: 2px; padding: 5px; background: var(--rust); border-radius: 7px; grid-template: 1fr 1fr / 1fr 1fr; transform: rotate(-7deg); }
.mark i { background: #fff7e9; border-radius: 1px; }
.mark i:first-child { grid-row: 1 / 3; }
nav { display: flex; gap: 22px; align-self: stretch; }
.tab { align-self: stretch; color: var(--muted); border: 0; border-bottom: 2px solid transparent; background: none; padding: 1px 3px 0; font-weight: 620; white-space: nowrap; }
.tab.active { color: var(--ink); border-bottom-color: var(--rust); }
.logout { margin-left: auto; }
.plain { border: 0; padding: 2px 0; background: transparent; color: var(--rust); font-weight: 650; }
.plain:hover:not(:disabled) { text-decoration: underline; }

.shell { max-width: 1192px; margin: auto; padding: 48px 32px 72px; }
.hero { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; margin-bottom: 25px; }
h1, h2, p { margin: 0; }
h1 { font: 500 clamp(2.5rem, 6vw, 4.25rem)/1 Georgia, serif; letter-spacing: -.064em; }
h2 { font-size: 1.13rem; line-height: 1.3; font-weight: 750; letter-spacing: -.025em; }
.hero p { margin-top: 10px; color: var(--muted); font-size: 1.05rem; }
.connection { display: flex; flex-wrap: wrap; align-items: center; gap: 9px 13px; color: var(--muted); font-size: .9rem; }
.card { border: 1px solid var(--line); border-radius: 17px; padding: 23px; background: var(--surface); }
.source { margin-bottom: 18px; }
.inline { display: flex; gap: 10px; }
.inline input { flex: 1; min-width: 0; }
.workspace { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: 18px; align-items: start; }
.stack { display: grid; gap: 16px; }
.section-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.hint { color: var(--muted); font-size: .87rem; font-weight: 400; }
h2 + .hint { margin-top: 4px; }

label { display: block; font-size: .9rem; font-weight: 650; }
label + .inline, label > input:not([type=color]), label > select, label > textarea { margin-top: 6px; }
input:not([type=color], [type=file]), select, textarea {
    width: 100%; min-height: 44px; padding: 10px 12px; border: 1px solid #d8cabc;
    border-radius: 8px; background: #fff; color: var(--ink); font-weight: 450;
}
textarea { display: block; resize: vertical; }
input::placeholder, textarea::placeholder { color: #71665e; }
.primary, .secondary {
    display: inline-flex; align-items: center; justify-content: center; gap: 12px;
    padding: 10px 16px; min-height: 44px; border: 1px solid transparent;
    border-radius: 8px; font-weight: 680; white-space: nowrap;
}
.primary { background: var(--rust); color: #fff; }
.primary:hover:not(:disabled) { background: var(--rust-hover); }
.secondary { background: var(--surface); color: var(--ink); border-color: #d8cabc; }
.secondary:hover:not(:disabled) { background: var(--tint); }
.small { min-height: 35px; padding: 5px 11px; font-size: .88rem; }
.notice { margin: 0 0 20px; padding: 10px 14px; color: #314b36; background: #e6efe3; border: 1px solid #cdddc9; border-radius: 8px; overflow-wrap: anywhere; }
.notice.error { color: #752d1e; background: #fcebe2; border-color: #efcab9; }

.image-grid { margin: 13px 0; display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); }
.image-grid:empty { margin-bottom: 0; }
.image-option { display: block; width: 100%; aspect-ratio: 1.15; border: 2px solid var(--line); border-radius: 8px; overflow: hidden; padding: 2px; background: var(--surface); }
.image-option[aria-pressed="true"] { border-color: var(--rust); }
.image-option img { width: 100%; height: 100%; object-fit: cover; display: block; border-radius: 4px; }
.upload { display: inline-flex; align-items: center; min-height: 36px; color: var(--rust); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; clip-path: inset(50%); }
.upload:has(+ input:focus-visible) { outline: 2px solid var(--rust); }

.templates { display: flex; gap: 7px; flex-wrap: wrap; margin-top: 15px; }
.layout { background: transparent; color: var(--muted); border: 1px solid var(--line); border-radius: 20px; min-height: 35px; padding: 5px 11px; font-size: .87rem; font-weight: 670; }
.layout.selected { background: var(--tint); color: #762f20; border-color: #e7c7b6; }
.stage { margin: 15px 0; min-height: 300px; padding: 16px; display: grid; place-items: center; border-radius: 11px; background: #efe7dd; }
.stage canvas { display: block; width: min(100%, 288px); height: auto; border-radius: 4px; box-shadow: 0 8px 20px #3e2d221b; }
#blank { text-align: center; color: var(--muted); display: grid; place-items: center; gap: 12px; }
.mark.large { width: 40px; height: 40px; padding: 8px; background: #b75f46; }
.color-label { display: inline-flex; align-items: center; gap: 9px; }
.color-label input { background: #fff; border: 1px solid #d8cabc; border-radius: 5px; width: 37px; height: 30px; padding: 3px; cursor: pointer; }
#timezone { display: block; margin-top: 5px; }

.queue-card { overflow-wrap: anywhere; }
.queue-row { display: grid; grid-template-columns: 57px minmax(0, 1fr) auto; align-items: center; gap: 15px; padding: 15px 0; border-bottom: 1px solid var(--line); }
.queue-row:first-child { padding-top: 0; }
.queue-row:last-child { padding-bottom: 0; border-bottom: 0; }
.queue-row img { width: 57px; aspect-ratio: 2 / 3; border-radius: 4px; background: var(--tint); }
.queue-row p { color: var(--muted); margin-top: 4px; font-size: .88rem; }
.queue-actions { display: flex; flex-direction: column; gap: 6px; align-items: flex-end; font-size: .89rem; }
.state { border-radius: 18px; padding: 3px 9px; background: #f0e8df; color: #5d493d; text-transform: capitalize; white-space: nowrap; }
.state.published { background: #e6efe3; color: #314b36; }
.state.failed, .state.review { background: #fcebe2; color: #752d1e; }
.login-shell { display: grid; place-items: start center; padding: 70px 20px; }
.login-card { width: min(100%, 445px); padding: 30px; }
.login-card h1 { font-size: 2.7rem; margin-bottom: 20px; }

@media (max-width: 720px) {
    .top-inner { padding: 0 16px; gap: 15px; min-height: 62px; }
    nav { gap: 12px; }
    .tab, .logout { font-size: .84rem; }
    .brand { gap: 6px; font-size: 1rem; }
    .shell { padding: 32px 16px 48px; }
    .hero { align-items: flex-start; flex-direction: column; gap: 15px; }
    .workspace { grid-template-columns: minmax(0, 1fr); }
    .card { padding: 17px; }
}
@media (max-width: 380px) {
    .top-inner { gap: 11px; }
    .brand .mark { display: none; }
    .inline { flex-direction: column; }
    .queue-row { grid-template-columns: 45px minmax(0, 1fr); }
    .queue-row img { width: 45px; }
    .queue-actions { grid-column: 2; align-items: flex-start; }
}
