/* Gorilla To Go styles. Colors come from docs/design.md. */

/* ---------- Fonts (in the app, so it works offline) ---------- */
@font-face { font-family: 'Outfit'; font-style: normal; font-weight: 400; font-display: swap; src: url('../fonts/outfit-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'Outfit'; font-style: normal; font-weight: 500; font-display: swap; src: url('../fonts/outfit-latin-500-normal.woff2') format('woff2'); }
@font-face { font-family: 'Outfit'; font-style: normal; font-weight: 600; font-display: swap; src: url('../fonts/outfit-latin-600-normal.woff2') format('woff2'); }
@font-face { font-family: 'Outfit'; font-style: normal; font-weight: 700; font-display: swap; src: url('../fonts/outfit-latin-700-normal.woff2') format('woff2'); }
@font-face { font-family: 'Playfair Display'; font-style: normal; font-weight: 700; font-display: swap; src: url('../fonts/playfair-display-latin-700-normal.woff2') format('woff2'); }

/* ---------- Color tokens ---------- */
:root {
    color-scheme: light;
    --bg: #f8f6f2;
    --bg-2: #f0ebe1;
    --card: #ffffff;
    --border: #e3dcd0;
    --text: #2b2927;
    --muted: #66615c;
    --primary: #596e57;
    --primary-hover: #455643;
    --on-primary: #ffffff;
    --link: #455643;
    --ok-bg: #e4ebe3;
    --ok-text: #3f513d;
    --fail-bg: #f5e1d8;
    --fail-text: #8a4a30;
    --shadow: 0 8px 24px rgba(43, 41, 39, 0.18);
    --blog-bg: #e4ebe3;
    --blog-text: #3f513d;
    --page-bg: #f5ead6;
    --page-text: #7a5a22;
    --gallery-bg: #f5e1d8;
    --gallery-text: #8a4a30;
    --font-ui: 'Outfit', system-ui, -apple-system, 'Segoe UI', sans-serif;
    --font-title: 'Playfair Display', Georgia, serif;
    --radius: 12px;
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        color-scheme: dark;
        --bg: #1c1a18;
        --bg-2: #242120;
        --card: #2b2826;
        --border: #3d3834;
        --text: #f0ebe1;
        --muted: #a8a19a;
        --primary: #8fa88c;
        --primary-hover: #a5bca2;
        --on-primary: #1c1a18;
        --link: #a5bca2;
        --ok-bg: #2f3a2e;
        --ok-text: #b5c9b2;
        --fail-bg: #3f2c24;
        --fail-text: #eab59c;
        --shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
        --blog-bg: #2f3a2e;
        --blog-text: #b5c9b2;
        --page-bg: #3d3324;
        --page-text: #e6c78f;
        --gallery-bg: #3f2c24;
        --gallery-text: #eab59c;
    }
}

:root[data-theme="dark"] {
    color-scheme: dark;
    --bg: #1c1a18;
    --bg-2: #242120;
    --card: #2b2826;
    --border: #3d3834;
    --text: #f0ebe1;
    --muted: #a8a19a;
    --primary: #8fa88c;
    --primary-hover: #a5bca2;
    --on-primary: #1c1a18;
    --link: #a5bca2;
    --ok-bg: #2f3a2e;
    --ok-text: #b5c9b2;
    --fail-bg: #3f2c24;
    --fail-text: #eab59c;
    --shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
    --blog-bg: #2f3a2e;
    --blog-text: #b5c9b2;
    --page-bg: #3d3324;
    --page-text: #e6c78f;
    --gallery-bg: #3f2c24;
    --gallery-text: #eab59c;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }

/* The hidden attribute wins over display rules (for example .banner { display: flex }). */
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    min-height: 100vh;
    min-height: 100dvh;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-ui);
    font-size: 16px;
    line-height: 1.45;
}

a { color: var(--link); }
a:hover { color: var(--text); }

button, input, textarea { font: inherit; color: inherit; }

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

/* The router moves focus to the screen title (tabindex="-1") for screen readers. The title is not
   a control, so it shows no focus ring (Chrome shows one after a page load). */
[tabindex="-1"]:focus { outline: none; }

.visually-hidden {
    position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
    overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.noscript { padding: 24px; }

/* ---------- Screen layout ---------- */
.app { min-height: 100vh; min-height: 100dvh; }

.screen {
    max-width: 560px;
    min-height: 100vh;
    min-height: 100dvh;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
}

.screen-body {
    flex: 1;
    padding: 20px 20px 24px;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.screen-footer {
    padding: 16px 20px calc(24px + env(safe-area-inset-bottom));
}

/* Top bar with a back button and a title (Add a site, help pages). */
.topbar {
    position: sticky;
    top: 0;
    z-index: 2;
    padding: calc(10px + env(safe-area-inset-top)) 12px 10px;
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
}

.topbar h1 {
    margin: 0;
    font-family: var(--font-title);
    font-size: 24px;
    font-weight: 700;
}

/* Header row with the site switcher and the theme toggle. */
.header-row {
    padding: calc(12px + env(safe-area-inset-top)) 20px 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.header-row--end { justify-content: flex-end; }

.page-title {
    margin: 0;
    font-family: var(--font-title);
    font-size: 34px;
    font-weight: 700;
    line-height: 1.1;
    overflow-wrap: anywhere;
}

/* ---------- Buttons ---------- */
.btn {
    min-height: 52px;
    padding: 0 20px;
    border: 0;
    border-radius: var(--radius);
    font-size: 17px;
    font-weight: 600;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    width: 100%;
}

.btn-primary { background: var(--primary); color: var(--on-primary); }
.btn-primary:hover { background: var(--primary-hover); color: var(--on-primary); }
.btn-primary:disabled { opacity: 0.45; cursor: not-allowed; }

.btn-secondary { background: var(--card); color: var(--text); border: 1px solid var(--border); }

.btn-danger { background: var(--card); color: var(--fail-text); border: 1px solid var(--border); }

.btn-small {
    min-height: 44px;
    padding: 0 12px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--bg-2);
    color: var(--text);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}

.icon-btn {
    flex: none;
    width: 44px;
    height: 44px;
    border: 1px solid var(--border);
    border-radius: 50%;
    background: var(--card);
    color: var(--text);
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    cursor: pointer;
}

.icon-btn--plain { border-color: transparent; background: transparent; }

.text-link {
    min-height: 44px;
    font-size: 15px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.text-link--small { min-height: 44px; font-size: 14px; justify-content: flex-start; }

/* ---------- Cards and chips ---------- */
.card {
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--card);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.card-title { font-size: 16px; font-weight: 600; margin: 0; }

.chip {
    padding: 3px 12px;
    border-radius: 999px;
    background: var(--bg-2);
    color: var(--muted);
    font-size: 13px;
    font-weight: 500;
}

.muted { color: var(--muted); }
.small { font-size: 13px; }

/* ---------- Welcome ---------- */
.welcome-hero {
    flex: 1;
    padding: 24px 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    text-align: center;
}

.welcome-hero img { width: 125px; height: 160px; object-fit: contain; }
.welcome-hero h1 { margin: 6px 0 0; font-family: var(--font-title); font-size: 34px; font-weight: 700; line-height: 1.1; }
.welcome-hero p { margin: 0; font-size: 17px; color: var(--muted); }

.steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.steps li { display: flex; gap: 10px; align-items: flex-start; font-size: 15px; line-height: 1.4; }

.step-num {
    flex: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--ok-bg);
    color: var(--ok-text);
    font-size: 13px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

.note { display: flex; align-items: center; justify-content: center; gap: 6px; color: var(--muted); font-size: 13px; }

.welcome-actions { display: flex; flex-direction: column; gap: 12px; }

/* ---------- Forms ---------- */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field label { font-size: 15px; font-weight: 600; }
.field-hint { font-size: 13px; color: var(--muted); }
.field-hint--error { color: var(--fail-text); font-weight: 600; }
.field-row { display: flex; gap: 12px; }
.field-row .field:first-child { flex: 1; }
.field-row .field:last-child { flex: 1.4; }

.input {
    width: 100%;
    min-height: 48px;
    padding: 0 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--card);
    color: var(--text);
    font-size: 16px; /* 16 px or more: iPhone does not zoom in on focus. */
}

.input-group {
    min-height: 48px;
    padding: 0 4px 0 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--card);
    display: flex;
    align-items: center;
    gap: 4px;
}

.input-group:focus-within { outline: 3px solid var(--primary); outline-offset: 2px; }

.input-group input {
    flex: 1;
    min-width: 0;
    min-height: 46px;
    border: 0;
    outline: 0;
    background: transparent;
    font-size: 16px;
}

/* ---------- Checks ---------- */
.checks { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }

.check { display: flex; align-items: flex-start; gap: 10px; font-size: 15px; line-height: 1.4; }
.check-text { display: flex; flex-direction: column; gap: 2px; padding-top: 1px; }

.check-icon {
    flex: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-2);
    color: var(--muted);
}

.check--pass .check-icon { background: var(--ok-bg); color: var(--ok-text); }
.check--fail .check-icon { background: var(--fail-bg); color: var(--fail-text); }
.check--fail .check-label { color: var(--fail-text); font-weight: 600; }
.check--waiting .check-label { color: var(--muted); }

.spinner {
    width: 14px;
    height: 14px;
    border: 2px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
    .spinner { animation: none; }
}

.message-error {
    padding: 12px 14px;
    border-radius: var(--radius);
    background: var(--fail-bg);
    color: var(--fail-text);
    font-size: 15px;
}

.message-error:empty { display: none; }

/* ---------- Site screen ---------- */
.site-switch {
    min-height: 44px;
    max-width: 100%;
    padding: 0 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--card);
    color: var(--text);
    font-size: 15px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    min-width: 0;
}

.site-switch span:not(.dot) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.dot { flex: none; width: 10px; height: 10px; border-radius: 50%; background: var(--primary); }

.site-meta { margin: 0; color: var(--muted); font-size: 15px; overflow-wrap: anywhere; }

/* ---------- Bottom sheet (dialog) ---------- */
.sheet {
    width: 100%;
    max-width: 560px;
    margin: auto auto 0;
    padding: 0;
    border: 0;
    border-radius: 20px 20px 0 0;
    background: var(--card);
    color: var(--text);
    box-shadow: var(--shadow);
}

.sheet::backdrop { background: rgba(28, 26, 24, 0.5); }

.sheet-body {
    padding: 20px 20px calc(24px + env(safe-area-inset-bottom));
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.sheet-title { margin: 0; font-size: 20px; font-weight: 600; }

.sheet-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }

.sheet-item {
    width: 100%;
    min-height: 52px;
    padding: 8px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg);
    color: var(--text);
    text-align: left;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.sheet-item[aria-current="true"] { border-color: var(--primary); }

.sheet-item-text { display: flex; flex-direction: column; min-width: 0; }
.sheet-item-text span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- Help pages ---------- */
.prose { display: block; font-size: 16px; line-height: 1.55; }
.prose > :first-child { margin-top: 0; }
.prose h2 { margin: 24px 0 8px; font-size: 20px; font-weight: 600; }
.prose ol, .prose ul { padding-left: 1.4em; }
.prose li { margin: 4px 0; }
.prose code { padding: 1px 6px; border-radius: 6px; background: var(--bg-2); font-size: 0.92em; overflow-wrap: anywhere; }
.prose pre { padding: 12px 14px; border-radius: var(--radius); background: var(--bg-2); overflow-x: auto; }
.prose pre code { padding: 0; background: none; }

/* ---------- Pages list ---------- */
.header-actions { display: flex; gap: 8px; flex: none; }

.search {
    min-height: 48px;
    padding: 0 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--card);
    color: var(--muted);
    display: flex;
    align-items: center;
    gap: 10px;
}

.search:focus-within { outline: 3px solid var(--primary); outline-offset: 2px; }

.search input {
    flex: 1;
    min-width: 0;
    min-height: 46px;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--text);
    font-size: 16px;
}

.filters { display: flex; flex-wrap: wrap; gap: 8px; }

.filter {
    min-height: 44px;
    padding: 0 16px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--card);
    color: var(--text);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
}

.filter[aria-pressed="true"] { border-color: var(--primary); background: var(--primary); color: var(--on-primary); font-weight: 600; }

.list-meta { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 44px; }
.list-meta .btn-small { display: inline-flex; align-items: center; gap: 6px; }

.page-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }

.page-card {
    padding: 14px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--card);
    color: var(--text);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 2px 8px rgba(43, 41, 39, 0.04);
}

.page-card:hover { color: var(--text); border-color: var(--primary); }
.page-card > svg { flex: none; color: var(--muted); }
.page-card-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.page-card-title { font-size: 16px; font-weight: 600; line-height: 1.3; overflow-wrap: anywhere; }

.page-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; }

.type-label { padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.type-label--blog { background: var(--blog-bg); color: var(--blog-text); }
.type-label--page { background: var(--page-bg); color: var(--page-text); }
.type-label--gallery { background: var(--gallery-bg); color: var(--gallery-text); }

.draft-label { padding: 1px 10px; border: 1px dashed var(--muted); border-radius: 999px; color: var(--muted); font-size: 12px; font-weight: 600; }

.error-label { padding: 2px 10px; border-radius: 999px; background: var(--fail-bg); color: var(--fail-text); font-size: 12px; font-weight: 600; }

.empty { padding: 24px 0; color: var(--muted); text-align: center; }

.banner {
    padding: 12px 14px;
    border-radius: var(--radius);
    background: var(--fail-bg);
    color: var(--fail-text);
    font-size: 15px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.banner a { color: inherit; }

/* ---------- Page view ---------- */
.fields { margin: 0; display: grid; grid-template-columns: minmax(80px, max-content) 1fr; gap: 6px 14px; font-size: 15px; }
.fields dt { color: var(--muted); }
.fields dd { margin: 0; overflow-wrap: anywhere; }

.image-list { margin: 0; padding-left: 1.4em; display: flex; flex-direction: column; gap: 8px; }
.image-list li span { display: block; overflow-wrap: anywhere; }

.page-text {
    margin: 0;
    font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
    font-size: 15px;
    line-height: 1.5;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

/* ---------- Editor ---------- */
/* The editor fills the visual viewport, so the toolbar stays above the phone keyboard. */
.editor-screen {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 100vh;
    height: 100dvh;
    max-width: 560px;
    min-height: 0;
    margin: 0 auto;
    background: var(--bg);
}

.editor-topbar { position: static; justify-content: space-between; }

.segmented { display: flex; padding: 3px; border-radius: var(--radius); background: var(--bg-2); }

.segmented button {
    min-height: 44px;
    padding: 0 16px;
    border: 0;
    border-radius: 9px;
    background: transparent;
    color: var(--muted);
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
}

.segmented button[aria-pressed="true"] { background: var(--card); color: var(--text); font-weight: 600; box-shadow: 0 2px 8px rgba(43, 41, 39, 0.08); }

.btn-publish {
    min-height: 44px;
    padding: 0 16px;
    border: 0;
    border-radius: var(--radius);
    background: var(--primary);
    color: var(--on-primary);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
}

.btn-publish:disabled { opacity: 0.5; cursor: wait; }

.editor-head { padding: 14px 20px 10px; display: flex; flex-direction: column; gap: 6px; }
.editor-meta-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.editor-meta-row .btn-small { display: inline-flex; align-items: center; gap: 6px; }
.editor-title { margin: 0; font-family: var(--font-title); font-size: 24px; font-weight: 700; line-height: 1.2; overflow-wrap: anywhere; }
.banner-actions { display: flex; gap: 8px; margin-top: 6px; }

.editor-body { flex: 1; min-height: 0; padding: 0 20px; display: flex; }

.editor-text,
.editor-preview {
    flex: 1;
    min-height: 0;
    width: 100%;
    padding: 14px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--card);
    color: var(--text);
    overflow-y: auto;
}

.editor-text {
    resize: none;
    font-size: 17px; /* 16 px or more: iPhone does not zoom in on focus. */
    line-height: 1.6;
}

.editor-text:focus { outline: 3px solid var(--primary); outline-offset: -1px; }

.preview-image { display: block; padding: 8px 10px; border: 1px dashed var(--border); border-radius: 8px; color: var(--muted); font-size: 14px; overflow-wrap: anywhere; }
.editor-preview img { display: block; max-width: 100%; height: auto; margin: 12px 0; border-radius: 8px; }
.editor-preview img:not([src]) { width: 100%; min-height: 120px; background: var(--bg-2); }
.image-thumb { display: block; max-width: 100%; max-height: 35vh; margin: 0 auto; border-radius: 8px; object-fit: contain; }
.editor-preview table { border-collapse: collapse; }
.editor-preview th, .editor-preview td { padding: 4px 8px; border: 1px solid var(--border); }
.editor-preview blockquote { margin: 0; padding-left: 14px; border-left: 3px solid var(--border); color: var(--muted); }

.editor-status { margin: 0; padding: 8px 20px; min-height: 36px; color: var(--muted); font-size: 13px; }

.editor-toolbar {
    padding: 8px 8px calc(8px + env(safe-area-inset-bottom));
    border-top: 1px solid var(--border);
    background: var(--bg-2);
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 4px;
}

.editor-toolbar button {
    height: 44px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: var(--text);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.editor-toolbar button:active { background: var(--border); }
.tool-heading { font-family: var(--font-title); font-size: 19px; font-weight: 700; }
.tool-bold { font-size: 18px; font-weight: 700; }
.tool-italic { font-family: var(--font-title); font-size: 19px; font-style: italic; }

.input-multiline { min-height: 88px; padding: 10px 14px; resize: vertical; line-height: 1.4; }
.btn .icon, .btn svg { flex: none; }

.error-details { margin: 0; padding: 10px 12px; border-radius: var(--radius); background: var(--bg-2); color: var(--muted); font-size: 12px; white-space: pre-wrap; overflow-wrap: anywhere; }

/* ---------- New page ---------- */
/* "New page": a round sage button at the bottom right (design.md). */
.fab {
    position: fixed;
    right: max(20px, calc((100vw - 560px) / 2 + 20px));
    bottom: calc(28px + env(safe-area-inset-bottom));
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--primary);
    color: var(--on-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow);
    z-index: 3;
}

.fab:hover { background: var(--primary-hover); color: var(--on-primary); }

/* Room at the end of the list, so the round button does not cover the last page. */
#page-list { padding-bottom: 88px; }

.section-title { margin: 0 0 10px; }

.editor-head-actions { display: flex; gap: 8px; }

.type-choice { margin: 0; padding: 0; border: 0; min-width: 0; }
.type-choice legend { padding: 0; margin-bottom: 6px; font-size: 15px; font-weight: 600; }
.type-options { display: flex; flex-wrap: wrap; gap: 8px; }

.type-option {
    min-height: 44px;
    padding: 0 16px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--card);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
    cursor: pointer;
}

.type-option:has(input:checked) { border-color: var(--primary); background: var(--primary); color: var(--on-primary); font-weight: 600; }
.type-option input { margin: 0; accent-color: var(--primary); }
.type-option:has(input:focus-visible) { outline: 3px solid var(--primary); outline-offset: 2px; }

/* ---------- About ---------- */
.about { align-items: center; text-align: center; }
.about p { margin: 0; }
.about-logo { width: 63px; height: 80px; object-fit: contain; }
.about-links { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; align-items: center; }
.about .btn { align-self: stretch; }

/* ---------- Photos of a gallery page (step 8) ---------- */
.segmented--three button { padding: 0 10px; }
.photos { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; padding-bottom: 12px; }
.photos .btn { flex: none; }
.photo-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.photo-grid > li { display: flex; }
.photo-card { width: 100%; min-height: 44px; padding: 0 0 8px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--card); color: var(--text); font: inherit; text-align: left; display: flex; flex-direction: column; gap: 6px; overflow: hidden; cursor: pointer; }
.photo-card:focus-visible { outline: 3px solid var(--primary); outline-offset: 2px; }
.photo-frame { display: block; aspect-ratio: 4 / 3; background: var(--bg-2); }
.photo-frame img { display: block; width: 100%; height: 100%; object-fit: cover; }
.photo-label { padding: 0 10px; font-size: 14px; line-height: 1.3; overflow-wrap: anywhere; }
.photo-marks { padding: 0 10px; display: flex; flex-wrap: wrap; gap: 4px; }
.photo-marks:empty { display: none; }
.photo-mark { padding: 2px 8px; border-radius: 999px; background: var(--gallery-bg); color: var(--gallery-text); font-size: 12px; font-weight: 500; }
.photo-mark--warn { background: var(--fail-bg); color: var(--fail-text); }
.sheet-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.preview-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; margin-top: 16px; }
.segmented button:disabled { opacity: 0.45; cursor: not-allowed; }
.preview-gallery figure { margin: 0; }
.preview-gallery figcaption { margin-top: 4px; color: var(--muted); font-size: 13px; }
.editor-preview .preview-gallery img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; margin: 0; }
