:root {
    --bg: #f7f4ef;
    --card: #ffffff;
    --muted: #efe8dd;
    --text: #1f1a17;
    --soft: #6f645d;
    --line: #d8cdc0;
    --accent: #5b7c8d;
    --accent-dark: #436170;
    --danger: #9f3b30;
    --success: #1f6a4f;
    --shadow: 0 12px 30px rgba(0,0,0,.08);
    --radius: 18px;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
}
a { color: inherit; }
img { max-width: 100%; display: block; }
.wrap { width: min(1120px, calc(100% - 2rem)); margin: 0 auto; }
.section { padding: 4.5rem 0; }
.section-muted { background: rgba(255,255,255,.45); }
.site-header {
    position: sticky;
    top: 0;
    z-index: 20;
    backdrop-filter: blur(10px);
    background: rgba(247,244,239,.85);
    border-bottom: 1px solid var(--line);
}
.compact-header { position: static; }
.nav-wrap, .page-actions { display: flex; gap: 1rem; justify-content: space-between; align-items: center; }
.nav-wrap { min-height: 74px; }
.brand { display: flex; flex-direction: column; }
.brand span { color: var(--soft); font-size: .92rem; }
.site-nav { display: flex; flex-wrap: wrap; gap: 1rem; }
.site-nav a { text-decoration: none; font-weight: 600; color: var(--soft); }
.site-nav a:hover { color: var(--text); }
.hero { padding: 4rem 0 3rem; }
.hero-grid, .two-col, .artwork-detail-grid { display: grid; gap: 2rem; grid-template-columns: 1.2fr 1fr; align-items: start; }
.hero h1, .artwork-detail-grid h1 { font-size: clamp(2.3rem, 5vw, 4rem); line-height: 1.05; margin: .2rem 0 1rem; }
.lead { font-size: 1.1rem; color: var(--soft); max-width: 60ch; }
.eyebrow { text-transform: uppercase; letter-spacing: .14em; font-size: .78rem; color: var(--accent-dark); font-weight: 700; }
.hero-card, .panel, .info-panel, .contact-card, .placeholder-card, .stat-card, .login-card, .message-card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}
.hero-card, .contact-card, .info-panel, .panel, .message-card, .login-card { padding: 1.25rem; }
.hero-card img, .artwork-detail-image { border-radius: calc(var(--radius) - 6px); }
.hero-actions { display: flex; gap: .75rem; flex-wrap: wrap; margin-top: 1.5rem; }
.button {
    display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
    padding: .8rem 1.1rem; border-radius: 999px; border: 0; cursor: pointer;
    text-decoration: none; background: var(--accent); color: #fff; font-weight: 700;
}
.button:hover { background: var(--accent-dark); }
.button-secondary { background: #e8ddd0; color: var(--text); }
.button-secondary:hover { background: #ddd0c0; }
.button-danger { background: var(--danger); }
.button-small { padding: .55rem .8rem; font-size: .88rem; }
.text-link { display: inline-block; margin-top: .75rem; color: var(--accent-dark); font-weight: 700; }
.section-heading { margin-bottom: 1.5rem; }
.art-grid { display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.art-card { overflow: hidden; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.art-card-link { display: block; text-decoration: none; }
.art-card img { aspect-ratio: 4 / 3; width: 100%; object-fit: cover; }
.art-card-body { padding: 1rem; }
.meta { color: var(--soft); font-size: .92rem; }
.large-meta { font-size: 1rem; }
.process-gallery { display: grid; gap: 1rem; grid-template-columns: repeat(2, 1fr); }
.process-gallery img { aspect-ratio: 1 / 1; object-fit: cover; border-radius: 14px; border: 1px solid var(--line); }
.info-panel ul { margin: 0; padding-left: 1.1rem; }
.contact-form { margin-top: 1rem; }
.form-grid { display: grid; gap: 1rem; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-grid label { display: flex; flex-direction: column; gap: .45rem; font-weight: 700; }
.form-grid .full { grid-column: 1 / -1; }
input, textarea {
    width: 100%; border: 1px solid var(--line); border-radius: 12px; padding: .82rem .9rem;
    font: inherit; background: #fff;
}
textarea { resize: vertical; }
.checkbox-row { justify-content: center; align-items: center; flex-direction: row !important; gap: .6rem; }
.preview-wrap { padding: .5rem; background: var(--muted); border-radius: 14px; }
.preview-image, .thumb { border-radius: 12px; }
.thumb { width: 64px; height: 64px; object-fit: cover; }
.flash { padding: .95rem 1rem; border-radius: 14px; margin-bottom: 1rem; font-weight: 700; }
.flash-success { background: #e4f4ec; color: var(--success); border: 1px solid #b8dec9; }
.flash-error { background: #fae8e6; color: var(--danger); border: 1px solid #e5bdb7; }
.empty-state { padding: 2rem; text-align: center; background: var(--card); border: 1px dashed var(--line); border-radius: var(--radius); }
.login-shell { min-height: 100vh; display: grid; place-items: center; padding: 2rem; }
.login-card { width: min(460px, 100%); }
.login-card form, .narrow-form { max-width: 560px; }
.admin-body { background: #f2ede5; }
.admin-shell { display: grid; grid-template-columns: 260px 1fr; min-height: 100vh; }
.admin-sidebar { background: #201a17; color: #f6eee4; padding: 1.4rem; }
.admin-sidebar nav { display: grid; gap: .5rem; margin-top: 1rem; }
.admin-sidebar nav a { color: inherit; text-decoration: none; padding: .7rem .8rem; border-radius: 10px; }
.admin-sidebar nav a:hover { background: rgba(255,255,255,.08); }
.admin-user { color: #d5c7bb; margin-top: 1.2rem; font-size: .92rem; }
.admin-main { padding: 1.4rem; }
.stats-grid, .panel-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.stat-card { padding: 1.1rem; }
.stat-card strong { display: block; font-size: 2rem; }
.admin-table { width: 100%; border-collapse: collapse; }
.admin-table th, .admin-table td { text-align: left; padding: .8rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
.sortable-table tbody tr.dragging { opacity: .45; }
.drag-handle { cursor: grab; font-size: 1.2rem; color: var(--soft); width: 36px; }
.message-card-header { display: flex; justify-content: space-between; gap: 1rem; align-items: start; }
.message-actions { display: flex; flex-direction: column; gap: .5rem; align-items: end; }
.pill { background: var(--muted); padding: .35rem .65rem; border-radius: 999px; font-size: .82rem; }
.is-archived { opacity: .8; }
.stacked-panels { display: grid; gap: 1rem; }
.artwork-detail-image { width: 100%; background: #fff; border: 1px solid var(--line); }
.sticky-panel { position: sticky; top: 90px; }
.detail-secondary { margin-top: 1.25rem; }
@media (max-width: 900px) {
    .hero-grid, .two-col, .artwork-detail-grid, .admin-shell { grid-template-columns: 1fr; }
    .admin-sidebar { position: static; }
    .sticky-panel { position: static; }
}
@media (max-width: 640px) {
    .form-grid { grid-template-columns: 1fr; }
    .site-nav { display: none; }
    .admin-main { padding: 1rem; }
    .admin-table { font-size: .92rem; }
}
