:root {
    --gold: #c88a0a;
    --gold-strong: #ad7300;
    --gold-soft: #fff8e8;
    --ink: #202124;
    --muted: #6f737b;
    --line: #e2e3e7;
    --surface: #ffffff;
    --page: #f6f6f7;
    --success: #17733b;
    --danger: #b42318;
    --focus: rgba(200, 138, 10, .24);
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
    background: var(--page);
    color: var(--ink);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    font-size: 15px;
    line-height: 1.45;
}
button, input, textarea, select { font: inherit; }
button, a, label, select { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible {
    outline: 3px solid var(--focus);
    outline-offset: 2px;
}
.is-hidden, [hidden] { display: none !important; }
.sr-only {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

.settings-app {
    width: min(1440px, 100%);
    min-height: 100vh;
    margin: 0 auto;
    background: var(--surface);
    border: 1px solid var(--line);
}
.topbar {
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 0 20px;
    border-bottom: 1px solid var(--line);
}
.header-actions { display: flex; align-items: center; justify-content: flex-end; gap: 12px; min-width: 0; }
.store-field { display: flex; align-items: center; gap: 8px; min-width: 0; }
.store-field > span { color: var(--muted); font-size: 13px; }
.store-field select {
    width: min(330px, 27vw);
    min-height: 42px;
    padding: 8px 34px 8px 12px;
    border: 1px solid #cfd1d6;
    border-radius: 8px;
    background: #fff;
    color: var(--ink);
}
.store-hint { display: none; }
.save-state { display: inline-flex; align-items: center; gap: 8px; min-width: 105px; color: var(--muted); white-space: nowrap; }
.save-state-mark, .inline-message-mark {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #9aa0a6;
    position: relative;
    flex: 0 0 auto;
}
.save-state.is-saved, .save-state.is-saving, .save-state.is-error { color: var(--success); }
.save-state.is-saved .save-state-mark, .inline-message.is-saved .inline-message-mark { background: var(--success); }
.save-state.is-saved .save-state-mark::after, .inline-message.is-saved .inline-message-mark::after {
    content: "";
    position: absolute;
    left: 5px;
    top: 3px;
    width: 5px;
    height: 8px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}
.save-state.is-saving { color: var(--gold-strong); }
.save-state.is-saving .save-state-mark { background: var(--gold); }
.save-state.is-error { color: var(--danger); }
.save-state.is-error .save-state-mark { background: var(--danger); }
.header-link { color: #4f535a; text-decoration: none; font-weight: 600; white-space: nowrap; }
.header-link:hover { color: var(--ink); text-decoration: underline; }
.fullscreen-button, .secondary-button {
    min-height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 16px;
    border: 1px solid var(--gold);
    border-radius: 8px;
    background: #fff;
    color: #332a18;
    text-decoration: none;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
}
.fullscreen-form { display: inline-flex; margin: 0; }
.fullscreen-button:hover, .secondary-button:hover { background: var(--gold-soft); }

.section-tabs {
    display: flex;
    gap: 24px;
    min-height: 59px;
    padding: 0;
}
.section-tab {
    min-height: 59px;
    padding: 0 4px;
    border: 0;
    border-bottom: 3px solid transparent;
    background: transparent;
    color: #50545b;
    font-weight: 600;
    cursor: pointer;
}
.section-tab:hover { color: var(--ink); }
.section-tab.is-active { color: var(--gold-strong); border-bottom-color: var(--gold); }
.section-tab:disabled { color: var(--muted); opacity: .48; cursor: not-allowed; }
.section-tab:disabled:hover { color: var(--muted); }

.workspace {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 410px;
    min-height: 650px;
}
.editor-pane { min-width: 0; padding: 22px 32px 20px; }
.preview-pane {
    padding: 20px 28px 18px;
    border-left: 1px solid var(--line);
    background: #fcfcfc;
}
.section-panel { max-width: 820px; }
.section-heading { margin-bottom: 24px; }
.section-heading h2, .preview-heading h2, .dialog-header h2 { margin: 0; font-size: 21px; line-height: 1.3; }
.section-heading p, .dialog-header p { margin: 6px 0 0; color: var(--muted); }
.form-field { margin-bottom: 24px; }
.form-field label { display: block; margin-bottom: 7px; font-weight: 650; }
.form-field small, .theme-summary-copy small, .slide-item-title small { display: block; color: var(--muted); }
.form-field small { margin-top: 6px; }
.input {
    width: 100%;
    min-height: 44px;
    padding: 10px 12px;
    border: 1px solid #cfd1d6;
    border-radius: 8px;
    background: #fff;
    color: var(--ink);
}
.input:focus { border-color: var(--gold); }
.compact-textarea { min-height: 72px; resize: vertical; }
.subsection-title { margin: 0 0 9px; font-size: 14px; }

.mode-choice {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin: 0 0 24px;
    padding: 0;
    border: 0;
}
.mode-option {
    min-height: 82px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border: 1px solid #cfd1d6;
    border-radius: 9px;
    cursor: pointer;
}
.mode-option:has(input:checked) { border-color: var(--gold); background: var(--gold-soft); }
.mode-option input { width: 19px; height: 19px; accent-color: var(--gold-strong); }
.mode-option strong, .mode-option small { display: block; }
.mode-option small { margin-top: 3px; color: var(--muted); }
.info-note {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 14px 16px;
    border-left: 3px solid var(--success);
    background: #f2f8f4;
    color: #315640;
}
.info-note.is-warning { border-left-color: var(--gold); background: var(--gold-soft); color: #6b5118; }
.info-note span { color: inherit; opacity: .86; }
.section-panel[data-panel="appearance"] .info-note { margin-bottom: 20px; }

.theme-summary {
    display: grid;
    grid-template-columns: 54px minmax(0, 1fr) auto;
    align-items: center;
    gap: 16px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 10px;
}
.theme-summary-preview {
    width: 54px;
    aspect-ratio: 378 / 840;
    border-radius: 8px;
    background: #eee center / cover no-repeat;
    overflow: hidden;
}
.theme-summary-preview.is-classic { display: grid; place-items: center; background: #fff8dc; }
.settings-subsection {
    margin-top: 20px;
    padding-top: 18px;
    border-top: 1px solid var(--line);
}
.settings-subsection-heading { margin-bottom: 12px; }
.settings-subsection-heading h3 { margin: 0; font-size: 16px; }
.settings-subsection-heading p { margin: 4px 0 0; color: var(--muted); font-size: 13px; line-height: 1.45; }
.settings-subsection .form-field { margin-bottom: 0; }
.theme-summary-preview img { width: 32px; height: 32px; object-fit: contain; }
.theme-summary-copy > span { display: block; margin-bottom: 3px; color: var(--muted); font-size: 12px; }
.theme-summary-copy strong { display: block; font-size: 17px; }
.theme-summary-copy small { margin-top: 3px; }

.slide-settings-grid { display: grid; gap: 10px; margin-top: 18px; }
.slide-item {
    display: grid;
    grid-template-columns: 88px minmax(0, 1fr);
    gap: 14px;
    padding: 10px 0;
    border-bottom: 1px solid var(--line);
}
.slide-item:last-child { border-bottom: 0; }
.slide-thumb {
    width: 88px;
    height: 74px;
    display: grid;
    place-items: center;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #f0f0f2 center/cover no-repeat;
    color: var(--muted);
    font-size: 12px;
    text-align: center;
}
.slide-thumb.is-text { background: #fff8dc; color: #806016; font-weight: 650; }
.slide-item-body { min-width: 0; }
.slide-item-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.slide-actions { display: flex; align-items: center; gap: 12px; }
.file-button { min-height: 38px; padding: 7px 12px; }
.file-button input { display: none; }
.text-danger { border: 0; background: transparent; color: var(--danger); cursor: pointer; text-decoration: underline; }
.switch-control { display: inline-flex; align-items: center; cursor: pointer; }
.switch-control input { position: absolute; opacity: 0; pointer-events: none; }
.switch-control > span {
    width: 42px;
    height: 24px;
    padding: 3px;
    border-radius: 999px;
    background: #c8cbd0;
    transition: background .18s ease;
}
.switch-control > span::after {
    content: "";
    display: block;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #fff;
    transition: transform .18s ease;
}
.switch-control input:checked + span { background: var(--gold); }
.switch-control input:checked + span::after { transform: translateX(18px); }
.switch-control input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 2px; }

.inline-message {
    max-width: 820px;
    display: flex;
    align-items: center;
    gap: 9px;
    min-height: 44px;
    margin-top: 24px;
    padding: 10px 12px;
    color: var(--success);
    background: #f2f8f4;
    border-radius: 8px;
}
.inline-message.is-saving { color: #7a5810; background: var(--gold-soft); }
.inline-message.is-error { color: var(--danger); background: #fff1f0; }
.inline-message.is-saving .inline-message-mark { background: var(--gold); }
.inline-message.is-error .inline-message-mark { background: var(--danger); }

.preview-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.preview-heading span { max-width: 140px; color: var(--muted); font-size: 12px; text-align: right; }
.preview-tabs { display: flex; margin-bottom: 18px; }
.preview-tab {
    flex: 1 1 0;
    min-height: 38px;
    padding: 7px 5px;
    border: 1px solid var(--line);
    border-right: 0;
    background: #fff;
    color: var(--muted);
    cursor: pointer;
    font-size: 12px;
}
.preview-tab[aria-hidden="true"] { display: none; }
.preview-tab:first-child { border-radius: 7px 0 0 7px; }
#previewSlidesTab[aria-hidden="true"] + .preview-tab { border-radius: 7px 0 0 7px; }
.preview-tab:last-child { border-right: 1px solid var(--line); border-radius: 0 7px 7px 0; }
.preview-tab.is-active { color: #61450b; background: var(--gold-soft); border-color: var(--gold); }
.preview-tab.is-active + .preview-tab { border-left-color: var(--gold); }
.terminal-device {
    width: 240px;
    margin: 0 auto;
    padding: 16px 7px 25px;
    border-radius: 20px;
    background: #171717;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .18);
    position: relative;
}
.terminal-device::after {
    content: "ЭВОТОР";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 7px;
    color: #777;
    font-size: 8px;
    letter-spacing: .22em;
    text-align: center;
}
.terminal-screen {
    width: 100%;
    aspect-ratio: 378 / 840;
    position: relative;
    overflow: hidden;
    background: #ececef center / cover no-repeat;
}
.terminal-screen.is-classic { background: linear-gradient(180deg, #fffdf4, #f3e5bd); }
.terminal-intro,
.terminal-classic-title,
.terminal-amount-controls,
.terminal-payment-controls,
.terminal-classic-thanks { display: none; }
.terminal-screen[data-preview="slides"] {
    background: linear-gradient(180deg, #fffdf4, #f0e2b7) !important;
}
.terminal-screen[data-preview="slides"] .terminal-intro {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    gap: 7px;
    padding: 10px 9px 16px;
}
.terminal-slides { min-height: 0; flex: 1 1 auto; position: relative; }
.terminal-preview-slide { height: 100%; display: flex; flex-direction: column; gap: 5px; }
.terminal-preview-slide[hidden] { display: none; }
.terminal-slide-card {
    min-height: 0;
    flex: 1 1 auto;
    display: grid;
    place-items: center;
    border: 2px solid #d7a316;
    border-radius: 18px;
    background: #fff8dd center / cover no-repeat;
    overflow: hidden;
}
.terminal-slide-card img { width: 48px; height: 48px; opacity: .45; }
.terminal-slide-card.is-text {
    padding: 14px;
    background: #fff8dd;
    color: #6f4c0b;
    font-family: Georgia, serif;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.3;
    text-align: center;
    white-space: pre-line;
}
.terminal-slides-empty {
    height: 100%;
    display: grid;
    place-items: center;
    align-content: center;
    gap: 10px;
    padding: 20px;
    border: 2px dashed #d7a316;
    border-radius: 18px;
    color: #7a5810;
    font-size: 12px;
    line-height: 1.35;
    text-align: center;
}
.terminal-slides-empty[hidden] { display: none; }
.terminal-slides-empty img { width: 46px; height: 46px; opacity: .5; }
.terminal-church-name {
    min-height: 20px;
    color: #b47700;
    font-family: Georgia, serif;
    font-size: 12px;
    font-weight: 650;
    text-align: center;
}
.terminal-church-name:empty { display: none; }
.terminal-slide-pager {
    min-height: 30px;
    display: grid;
    grid-template-columns: 34px 1fr 34px;
    align-items: center;
    gap: 6px;
    color: #6f4c0b;
    font-size: 11px;
    font-weight: 650;
    text-align: center;
}
.terminal-slide-pager[hidden] { display: none; }
.terminal-slide-pager button {
    min-width: 34px;
    min-height: 30px;
    border: 1px solid #c58a09;
    border-radius: 9px;
    background: #fff8dd;
    color: #6f4c0b;
    cursor: pointer;
    font-size: 16px;
}
.terminal-donate-button {
    min-height: 42px;
    display: grid;
    place-items: center;
    border: 1px solid #c58a09;
    border-radius: 14px;
    background: #edb809;
    color: #2d2516;
    font-family: Georgia, serif;
    font-size: 12px;
    font-weight: 700;
}
.terminal-classic-title {
    position: absolute;
    top: 13%;
    left: 8px;
    right: 8px;
    color: #6f4c0b;
    font-family: Georgia, serif;
    font-size: 16px;
    font-weight: 700;
    line-height: 1.25;
    text-align: center;
}
.terminal-screen.is-classic[data-preview="amounts"] .terminal-classic-title,
.terminal-screen.is-classic[data-preview="payment"] .terminal-classic-title { display: block; }
.terminal-screen {
    --primary-start: #ffd700;
    --primary-end: #d4af37;
    --primary-border: #a67c00;
    --on-primary: #2c2416;
    --secondary-start: #fff8dc;
    --secondary-end: #e8d5b7;
    --secondary-border: #b8860b;
    --on-secondary: #2c2416;
}
.terminal-screen[data-theme="hram1"] { --primary-start:#315a3a; --primary-end:#1f3b2a; --primary-border:#c9a94a; --on-primary:#fff8e6; --secondary-start:#f2e8c9; --secondary-end:#d7c596; --secondary-border:#a99045; --on-secondary:#243223; }
.terminal-screen[data-theme="hram2"] { --primary-start:#7c2d12; --primary-end:#4b1f12; --primary-border:#c89b3c; --on-primary:#fff9e8; --secondary-start:#f3e3c3; --secondary-end:#d9bf8d; --secondary-border:#9a6a2a; --on-secondary:#4a2514; }
.terminal-screen[data-theme="hram3"] { --primary-start:#7a5810; --primary-end:#4f3606; --primary-border:#e6c65a; --on-primary:#fff4c2; --secondary-start:#132c4a; --secondary-end:#081a30; --secondary-border:#d4af37; --on-secondary:#f9e8a8; }
.terminal-screen[data-theme="hram4"] { --primary-start:#1e4f7a; --primary-end:#173554; --primary-border:#d6b358; --on-primary:#fff; --secondary-start:#edf3f6; --secondary-end:#c9d7df; --secondary-border:#8ba6b5; --on-secondary:#18364d; }
.terminal-screen[data-theme="hram5"] { --primary-start:#7a233c; --primary-end:#481322; --primary-border:#d7b8c1; --on-primary:#fff7f8; --secondary-start:#f3e6ea; --secondary-end:#d6bdc5; --secondary-border:#a87584; --on-secondary:#4b1726; }
.terminal-screen[data-theme="hram6"] { --primary-start:#1f5a84; --primary-end:#123653; --primary-border:#b8d8e8; --on-primary:#fff; --secondary-start:#e7f1f6; --secondary-end:#c2dce9; --secondary-border:#7daac1; --on-secondary:#16405e; }
.terminal-screen[data-theme="hram7"] { --primary-start:#8c1d25; --primary-end:#5e1018; --primary-border:#f4d7d7; --on-primary:#fff; --secondary-start:#fff; --secondary-end:#fff; --secondary-border:#c83a43; --on-secondary:#a31d29; }
.terminal-screen[data-theme="hram8"] { --primary-start:#1464a5; --primary-end:#0a3c70; --primary-border:#e4f4ff; --on-primary:#fff; --secondary-start:#f4faff; --secondary-end:#d8eaf7; --secondary-border:#5a8fbd; --on-secondary:#0d3154; }
.terminal-amount-controls {
    position: absolute;
    left: 8px;
    right: 8px;
    bottom: 9%;
    height: 42%;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr .82fr;
    gap: 5px;
}
.terminal-screen[data-preview="amounts"] .terminal-amount-controls { display: grid; }
.terminal-amount-controls span,
.terminal-amount-controls strong,
.terminal-payment-amount,
.terminal-payment-options span,
.terminal-payment-controls > b {
    display: grid;
    place-items: center;
    border: 1px solid var(--secondary-border);
    border-radius: 9px;
    background: linear-gradient(135deg, var(--secondary-start), var(--secondary-end));
    color: var(--on-secondary);
    font-family: Georgia, serif;
    font-weight: 700;
    text-align: center;
}
.terminal-amount-controls span { font-size: 16px; }
.terminal-amount-controls strong { grid-column: 1 / -1; font-size: 13px; }
.terminal-amount-controls span,
.terminal-amount-controls strong,
.terminal-payment-options span {
    border-color: var(--primary-border);
    background: linear-gradient(135deg, var(--primary-start), var(--primary-end));
    color: var(--on-primary);
}
.terminal-screen[data-theme="hram7"] .terminal-amount-controls span,
.terminal-screen[data-theme="hram7"] .terminal-amount-controls strong,
.terminal-screen[data-theme="hram7"] .terminal-payment-options span,
.terminal-screen[data-theme="hram8"] .terminal-amount-controls span,
.terminal-screen[data-theme="hram8"] .terminal-amount-controls strong,
.terminal-screen[data-theme="hram8"] .terminal-payment-options span {
    border-color: var(--secondary-border);
    background: linear-gradient(135deg, var(--secondary-start), var(--secondary-end));
    color: var(--on-secondary);
}
.terminal-screen[data-theme="classic"] .terminal-payment-amount,
.terminal-screen[data-theme="classic"] .terminal-payment-controls > b {
    border-color: var(--primary-border);
    background: linear-gradient(135deg, var(--primary-start), var(--primary-end));
    color: var(--on-primary);
}
.terminal-payment-controls {
    position: absolute;
    left: 8px;
    right: 8px;
    bottom: 3%;
    height: 48%;
    grid-template-rows: .8fr 2.8fr .7fr;
    gap: 5px;
}
.terminal-screen[data-preview="payment"] .terminal-payment-controls { display: grid; }
.terminal-payment-amount { font-size: 17px; }
.terminal-payment-options { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; }
.terminal-payment-options span { font-size: 10px; line-height: 1.15; }
.terminal-payment-icon {
    width: 32px;
    height: 32px;
    margin-bottom: 5px;
    background: currentColor;
    -webkit-mask: center / contain no-repeat;
    mask: center / contain no-repeat;
}
.terminal-payment-icon.is-card { -webkit-mask-image: url("/svg/ic_payment_card.svg"); mask-image: url("/svg/ic_payment_card.svg"); }
.terminal-payment-icon.is-qr { -webkit-mask-image: url("/svg/ic_payment_qr.svg"); mask-image: url("/svg/ic_payment_qr.svg"); }
.terminal-payment-controls > b { font-size: 11px; }
.terminal-classic-thanks {
    position: absolute;
    inset: 0;
    place-items: center;
    align-content: center;
    gap: 28px;
    padding: 20px;
    color: #7a5810;
    font-family: Georgia, serif;
    text-align: center;
}
.terminal-screen.is-classic[data-preview="thanks"] .terminal-classic-thanks { display: grid; }
.terminal-classic-thanks img { width: 72px; height: 72px; }
.terminal-classic-thanks strong { font-size: 15px; line-height: 1.4; }

.theme-dialog {
    width: min(960px, calc(100vw - 32px));
    max-height: min(760px, calc(100vh - 32px));
    padding: 0;
    border: 0;
    border-radius: 12px;
    box-shadow: 0 24px 70px rgba(0, 0, 0, .3);
}
.theme-dialog[open] { display: flex; flex-direction: column; }
.theme-dialog::backdrop { background: rgba(20, 20, 22, .58); }
.dialog-header { flex: 0 0 auto; display: flex; justify-content: space-between; gap: 20px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.dialog-close { min-height: 40px; padding: 7px 12px; border: 1px solid var(--line); border-radius: 7px; background: #fff; cursor: pointer; }
.theme-grid { min-height: 0; flex: 1 1 auto; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; padding: 14px 18px 16px; overflow: auto; }
.theme-option { cursor: pointer; }
.theme-option input { position: absolute; opacity: 0; pointer-events: none; }
.theme-card { height: 100%; display: block; overflow: hidden; padding-top: 7px; border: 2px solid transparent; border-radius: 9px; background: #fff; }
.theme-option input:checked + .theme-card { border-color: var(--gold); box-shadow: 0 0 0 2px var(--focus); }
.theme-option input:focus-visible + .theme-card { outline: 3px solid var(--focus); outline-offset: 2px; }
.theme-card-preview { width: min(116px, 100%); aspect-ratio: 378 / 840; display: grid; place-items: center; margin: 0 auto; border-radius: 7px; background: #eee center / cover no-repeat; }
.theme-card-preview.is-classic { background: #fff7d8; }
.theme-card-preview img { width: 58px; height: 58px; object-fit: contain; }
.theme-card-name { display: block; padding: 8px 10px; font-weight: 650; text-align: center; }

.save-toast {
    position: fixed;
    z-index: 1000;
    top: max(14px, env(safe-area-inset-top));
    left: 50%;
    width: min(520px, calc(100% - 28px));
    padding: 12px 15px;
    border-radius: 9px;
    background: #176b3a;
    color: #fff;
    box-shadow: 0 10px 28px rgba(0, 0, 0, .22);
    font-weight: 650;
    text-align: center;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translate(-50%, -10px);
    transition: opacity .18s ease, transform .18s ease, visibility .18s;
}
.save-toast.is-visible { opacity: 1; visibility: visible; transform: translate(-50%, 0); }

.organization-fields-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px 16px;
}
.organization-fields-grid .field-wide { grid-column: 1 / -1; }
.auth-message { max-width: 560px; margin: 80px auto; padding: 24px; background: #fff; border: 1px solid var(--line); border-radius: 12px; }
.auth-message h1 { margin: 0 0 8px; }
.auth-message p { margin: 0; color: var(--muted); }

html.embedded body { background: #fff; }
html.embedded .settings-app { width: 100%; min-height: 100vh; border: 0; }
html.embedded .topbar { min-height: 50px; padding: 0 16px; gap: 12px; }
html.embedded .store-field > span, html.embedded .header-link { display: none; }
html.embedded .store-field select { width: min(270px, 24vw); min-height: 40px; }
html.embedded .terminal-field select { width: min(210px, 20vw); }
html.embedded .header-actions { gap: 10px; }
html.embedded .section-tabs { min-height: 49px; gap: 22px; }
html.embedded .section-tab { min-height: 49px; }
html.embedded .workspace { grid-template-columns: minmax(0, 1fr) 400px; min-height: 0; }
html.embedded .editor-pane { padding: 12px 24px 10px; }
html.embedded .preview-pane { padding: 14px 24px 12px; }
html.embedded .section-heading { margin-bottom: 12px; }
html.embedded .section-heading h2, html.embedded .preview-heading h2 { font-size: 18px; }
html.embedded .section-heading p { margin-top: 3px; font-size: 13px; }
html.embedded .form-field { margin-bottom: 12px; }
html.embedded .theme-summary { grid-template-columns: 48px minmax(0, 1fr) auto; gap: 12px; padding: 9px; }
html.embedded .theme-summary-preview { width: 48px; }
html.embedded .inline-message { min-height: 40px; margin-top: 10px; padding: 8px 10px; font-size: 13px; }
html.embedded .preview-heading { margin-bottom: 9px; }
html.embedded .preview-tabs { margin-bottom: 10px; }
html.embedded .preview-tab { min-height: 34px; font-size: 11px; }
html.embedded .terminal-device { width: 225px; padding: 13px 6px 22px; border-radius: 16px; }
html.embedded .terminal-church-name { font-size: 10px; line-height: 1.15; }
html.embedded .mode-choice { margin-bottom: 16px; }
html.embedded .mode-option { min-height: 68px; padding: 10px 12px; }
html.embedded .info-note { padding: 8px 12px; font-size: 13px; }
html.embedded .slide-settings-grid { margin-top: 10px; }
html.embedded .slide-item { grid-template-columns: 70px minmax(0, 1fr); gap: 10px; padding: 5px 0; }
html.embedded .slide-thumb { width: 70px; height: 56px; }
html.embedded .slide-item-title { margin-bottom: 5px; }
html.embedded .compact-textarea { min-height: 58px; }

@media (max-width: 960px) {
    .topbar { align-items: flex-start; flex-wrap: wrap; padding-block: 8px; }
    .header-actions { flex-wrap: wrap; }
    .workspace { grid-template-columns: minmax(0, 1fr) 300px; }
    .editor-pane { padding-inline: 22px; }
    .preview-pane { padding-inline: 18px; }
    .terminal-device { width: 195px; }
    .theme-summary { grid-template-columns: 52px minmax(0, 1fr); }
    .theme-summary-preview { width: 52px; }
    .theme-summary .secondary-button { grid-column: 1 / -1; }
}

@media (max-width: 760px) {
    .settings-app { border: 0; }
    .topbar { position: static; flex-direction: column; padding: 8px 16px; }
    .header-actions { width: 100%; justify-content: flex-start; }
    .store-field { flex: 1 1 100%; }
    .store-field select { width: 100%; }
    .save-state { margin-right: auto; }
    .header-link { display: none; }
    .section-tabs { width: 100%; overflow-x: auto; gap: 18px; }
    .workspace { display: block; }
    .editor-pane { padding: 20px 16px 14px; }
    .preview-pane { border-top: 1px solid var(--line); border-left: 0; }
    .mode-choice { grid-template-columns: 1fr; }
    .theme-summary { grid-template-columns: 48px minmax(0, 1fr); }
    .theme-summary-preview { width: 48px; }
    .theme-summary .secondary-button { grid-column: 1 / -1; }
    .theme-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 14px; }
    .organization-fields-grid { grid-template-columns: 1fr; }
    .organization-fields-grid .field-wide { grid-column: auto; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
