:root {
    --bg: #ffffff;
    --paper: #ffffff;
    --text: #20252b;
    --muted: #626b76;
    --line: #e7ebef;
    --accent: #394957;
    --accent-dark: #243442;
    --error: #b42318;
    --success: #217a3d;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Arial, sans-serif;
    color: var(--text);
    background: var(--bg);
    line-height: 1.5;
}

a {
    color: inherit;
}

img {
    max-width: 100%;
    display: block;
}

.site-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px clamp(18px, 5vw, 56px);
    border-bottom: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.98);
    position: sticky;
    top: 0;
    z-index: 10;
}

.brand {
    font-weight: 700;
    text-decoration: none;
    letter-spacing: .02em;
}

.admin-link,
.text-link,
.admin-nav a {
    color: var(--accent-dark);
    text-decoration: none;
    font-weight: 600;
}

.admin-nav {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.container {
    width: min(1120px, calc(100% - 32px));
    margin: 0 auto;
    padding: 36px 0 56px;
}

.narrow {
    max-width: 680px;
}

.hero {
    padding: 38px 0 30px;
}

.hero h1,
.theme-detail h1,
.panel h1 {
    font-size: clamp(30px, 4vw, 54px);
    line-height: 1.04;
    margin: 0 0 14px;
}

.hero p,
.theme-detail p,
.panel p {
    color: var(--muted);
}

.eyebrow {
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: .14em;
    color: var(--accent-dark);
    font-weight: 700;
    margin: 0 0 10px;
}

.theme-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr));
    gap: 22px;
}

.theme-card,
.panel,
.table-wrap {
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 8px;
}

.theme-card {
    overflow: hidden;
}

.theme-card img,
.placeholder {
    aspect-ratio: 4 / 3;
    object-fit: cover;
    width: 100%;
}

.placeholder {
    background: #f5f7f9;
    display: grid;
    place-items: center;
    color: var(--muted);
}

.theme-card-body,
.panel {
    padding: 22px;
}

.theme-card h2 {
    margin: 0 0 8px;
}

.meta-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin: 16px 0;
}

.meta-row span {
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 6px 10px;
    color: var(--accent-dark);
    background: #fff;
    font-size: 14px;
}

.meta-row.large span {
    font-size: 16px;
}

.slot-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 16px 0;
}

.slot-pill,
.button,
.small-button {
    border: 0;
    border-radius: 6px;
    background: var(--accent);
    color: #fff;
    text-decoration: none;
    font-weight: 700;
    cursor: pointer;
}

.slot-pill {
    padding: 9px 11px;
    font-size: 14px;
}

.button {
    display: inline-block;
    padding: 12px 16px;
}

.small-button {
    display: inline-block;
    padding: 8px 10px;
    font-size: 13px;
}

.button.secondary,
.small-button.secondary {
    background: #f0f3f6;
    color: var(--accent-dark);
}

.muted {
    color: var(--muted);
}

.success,
.error {
    padding: 12px 14px;
    border-radius: 6px;
    background: #fff;
}

.success {
    color: var(--success);
    border: 1px solid rgba(33, 122, 61, .25);
}

.error {
    color: var(--error);
    border: 1px solid rgba(180, 35, 24, .25);
}

.theme-detail {
    display: grid;
    grid-template-columns: 1.1fr .9fr;
    gap: 28px;
}

.gallery {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.gallery img {
    border-radius: 8px;
    aspect-ratio: 1;
    object-fit: cover;
}

.form {
    display: grid;
    gap: 10px;
}

label {
    font-weight: 700;
}

input,
textarea,
select {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 11px 12px;
    font: inherit;
    background: #fff;
}

textarea {
    min-height: 130px;
    resize: vertical;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(180px, 100%), 1fr));
    gap: 12px;
}

.table-wrap {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 760px;
}

th,
td {
    padding: 12px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: top;
}

th {
    color: var(--accent-dark);
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: .06em;
}

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

.site-footer {
    border-top: 1px solid var(--line);
    padding: 24px;
    text-align: center;
    color: var(--muted);
}

@media (max-width: 760px) {
    .theme-detail {
        grid-template-columns: 1fr;
    }

    .site-header {
        align-items: flex-start;
        gap: 12px;
        flex-direction: column;
    }
}


/* Light studio layout, shared by public pages and administration. */
:root { color-scheme: light; }
body { overflow-wrap: break-word; }
.hero { max-width: 940px; }
.theme-card, .panel { box-shadow: 0 6px 24px rgba(32, 37, 43, .035); }
.theme-card { min-width: 0; }
.theme-card-body > p { color: var(--muted); }
.theme-card h2 { line-height: 1.25; }
.theme-detail > div { min-width: 0; }
.slot-pill { background: #f2f5f8; color: #243442; border: 1px solid #dde4eb; }
.slot-pill:hover, .slot-pill:focus-visible { background: #e5edf4; border-color: #b8c8d7; }
.button:hover, .small-button:hover { filter: brightness(.94); }
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible {
    outline: 3px solid #7b9eba; outline-offset: 3px;
}
input[type="checkbox"], input[type="radio"] { width: auto; accent-color: var(--accent); }
.form-row > div, input, textarea, select { min-width: 0; }
.panel + .panel, .panel + .table-wrap { margin-top: 24px; }
.site-footer { background: #fafbfc; }
@media (max-width: 760px) {
    .container { padding-top: 24px; }
    .hero { padding: 20px 0 24px; }
    .panel, .theme-card-body { padding: 18px; }
    .admin-nav { gap: 12px; }
}
@media (pointer: coarse) {
    .slot-pill, .button, .small-button { min-height: 44px; display: inline-flex; align-items: center; }
}

/* Administration: record selection and photo management. */
.button.danger, .small-button.danger { background: #b23b32; color: #fff; }
.admin-photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 18px; }
.admin-photo { margin: 0; border: 1px solid var(--line); padding: 10px; }
.admin-photo img { width: 100%; aspect-ratio: 4 / 3; object-fit: contain; margin-bottom: 10px; }
.admin-photo form { margin: 0; }
.delete-photo-preview { max-width: 340px; max-height: 300px; object-fit: contain; margin: 20px 0; }
.bulk-panel { margin-top: 24px; }
.bulk-panel .actions { align-items: center; gap: 12px; }
.slot-select, #select-all-slots { width: 20px; height: 20px; }
.deletion-summary li { margin: 10px 0; }
