:root {
    --bg: #f6f3ee;
    --card: #fffdf8;
    --ink: #1d2430;
    --muted: #6d7280;
    --accent: #e76f51;
    --accent-dark: #c85538;
    --line: #e5ded3;
    --header-bg: #fffdf8;
    --hero-start: #ffe8dc;
    --hero-end: #f1e7da;
    --placeholder-start: #f5c7b5;
    --placeholder-end: #e9ddd0;
    --theme-shadow: rgba(29,36,48,.09);
    --shadow: 0 14px 35px var(--theme-shadow);
}
* { box-sizing: border-box; }
body { margin: 0; font-family: Inter, ui-sans-serif, system-ui, -apple-system, Segoe UI, sans-serif; background: var(--bg); color: var(--ink); }
a { color: inherit; }
.site-header { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 18px clamp(18px, 5vw, 70px); background: color-mix(in srgb, var(--header-bg) 92%, transparent); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.logo { display: flex; align-items: center; gap: 10px; font-weight: 900; font-size: 1.25rem; text-decoration: none; }
.logo-mark { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 12px; background: var(--accent); color: white; }
nav { display: flex; gap: 16px; flex-wrap: wrap; font-size: .94rem; }
nav a { text-decoration: none; color: var(--muted); font-weight: 700; }
nav a:hover { color: var(--accent-dark); }
.container { max-width: 1180px; margin: 0 auto; padding: 42px 18px 70px; }
.hero { padding: clamp(36px, 7vw, 80px); border-radius: 36px; background: radial-gradient(circle at top left, var(--hero-start), transparent 35%), linear-gradient(135deg, var(--card), var(--hero-end)); box-shadow: var(--shadow); }
.hero h1 { font-size: clamp(2.3rem, 6vw, 5rem); line-height: .95; margin: 0 0 18px; letter-spacing: -.055em; }
.hero p { max-width: 680px; color: var(--muted); font-size: 1.15rem; line-height: 1.6; }
.page-title { margin-bottom: 26px; }
.page-title h1 { font-size: clamp(2rem, 5vw, 4rem); margin: 0; letter-spacing: -.045em; }
.page-title p { color: var(--muted); font-size: 1.08rem; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 22px; }
.tile { display: flex; flex-direction: column; min-height: 280px; overflow: hidden; border-radius: 26px; background: var(--card); box-shadow: var(--shadow); text-decoration: none; border: 1px solid color-mix(in srgb, var(--line) 65%, transparent); }
.tile img, .placeholder { width: 100%; height: 180px; object-fit: cover; background: linear-gradient(135deg, var(--placeholder-start), var(--placeholder-end)); display: grid; place-items: center; font-size: 3rem; color: white; }
.tile-body { padding: 18px; }
.tile h2, .tile h3 { margin: 0 0 8px; font-size: 1.13rem; }
.tile p { margin: 0; color: var(--muted); line-height: 1.45; }
.badge { display: inline-block; margin-bottom: 10px; padding: 5px 9px; border-radius: 999px; font-size: .75rem; font-weight: 800; color: var(--accent-dark); background: color-mix(in srgb, var(--accent) 14%, var(--card)); }
.btn, button { display: inline-block; border: 0; border-radius: 12px; padding: 11px 15px; background: var(--accent); color: white; font-weight: 800; text-decoration: none; cursor: pointer; }
.btn:hover, button:hover { background: var(--accent-dark); }
.form-card { max-width: 820px; padding: 24px; border-radius: 24px; background: var(--card); box-shadow: var(--shadow); }
label { display: block; margin: 14px 0 6px; font-weight: 800; }
input, textarea, select { width: 100%; border: 1px solid var(--line); border-radius: 12px; padding: 11px 12px; font: inherit; background: var(--card); }
textarea { min-height: 110px; }
.admin-table { width: 100%; border-collapse: collapse; background: var(--card); border-radius: 18px; overflow: hidden; box-shadow: var(--shadow); }
.admin-table th, .admin-table td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.admin-actions { display: flex; gap: 10px; flex-wrap: wrap; margin: 20px 0; }
.offer-frame { width: 100%; min-height: 780px; border: 1px solid var(--line); border-radius: 20px; background: var(--card); box-shadow: var(--shadow); }
.site-footer { text-align: center; color: var(--muted); padding: 24px; border-top: 1px solid var(--line); }
@media (max-width: 800px) { .site-header { align-items: flex-start; flex-direction: column; } }
.logo-image { max-width: 44px; max-height: 44px; object-fit: contain; border-radius: 10px; }
.btn-secondary { background: #6d7280; }
.btn-secondary:hover { background: #4f5563; }
.compact-form { display: grid; grid-template-columns: minmax(180px, 240px) 1fr; gap: 10px 16px; max-width: 980px; align-items: center; }
.compact-form label { margin: 0; }
.compact-form button, .compact-form p { grid-column: 2; }
.compact-form textarea { min-height: 80px; }
@media (max-width: 760px) { .compact-form { display: block; } .compact-form label { margin: 14px 0 6px; } }

.swatch { display:inline-block; width:26px; height:26px; border-radius:8px; border:1px solid var(--line); margin-right:6px; vertical-align:middle; }

/* v4 refinements */
.logo-image { max-width: 92px; max-height: 64px; object-fit: contain; border-radius: 12px; }
.logo:has(.logo-image) { gap: 14px; }

/* Keep native dialogs, admin overlays and browser-painted controls readable in dark themes. */
dialog, .dialog, .modal, .popup {
    color: var(--ink);
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 18px;
    box-shadow: var(--shadow);
}
dialog::backdrop { background: rgba(0,0,0,.55); }
input, textarea, select {
    color: var(--ink);
    background: color-mix(in srgb, var(--card) 94%, white 6%);
    border-color: var(--line);
}
input::placeholder, textarea::placeholder { color: var(--muted); opacity: .85; }
option { color: #111827; background: #ffffff; }
.form-section-title {
    grid-column: 1 / -1;
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid var(--line);
    font-weight: 900;
    font-size: 1.05rem;
}
.check-row {
    grid-column: 2;
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
    font-weight: 700;
}
.check-row input { width: auto; }
@media (max-width: 760px) { .check-row { display: flex; margin: 12px 0; } }
.validation-message {
    color: #b00020;
    font-weight: 700;
}
.notice-message {
    border: 1px solid rgba(180, 120, 0, .35);
    background: rgba(255, 200, 80, .16);
    color: var(--text);
    border-radius: 12px;
    padding: .75rem 1rem;
}
.login-card {
    max-width: 460px;
    margin-inline: auto;
}

/* v7 editable site pages */
.content-card {
    max-width: 920px;
    padding: 26px;
    border-radius: 24px;
    background: var(--card);
    box-shadow: var(--shadow);
}
.rich-content { line-height: 1.7; }
.rich-content h2, .rich-content h3 { margin-top: 1.4em; }
.rich-content a, .site-footer a { color: var(--accent); font-weight: 800; }
.rich-content img { max-width: 100%; height: auto; border-radius: 16px; }
.footer-links { margin-top: 6px; }
.wide-form { max-width: 1100px; }
.large-editor { min-height: 360px; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .94rem; line-height: 1.5; }
.help-text { color: var(--muted); font-size: .95rem; }
.hint { margin-top: -0.4rem; color: var(--muted); font-size: 0.92rem; }
.validation-summary { background: color-mix(in srgb, var(--accent) 12%, var(--card)); border: 1px solid var(--accent); color: var(--ink); border-radius: 14px; padding: 1rem; margin: 1rem 0; }
.validation-summary ul { margin: .5rem 0 0 1.2rem; }

/* v10 homepage/rich intro refinements */
.hero-intro { max-width: 780px; color: var(--muted); font-size: 1.15rem; }
.hero-intro p { margin: 0 0 1rem; }
.hero-intro p:last-child { margin-bottom: 0; }
.home-featured { margin-top: 34px; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 18px; margin-bottom: 16px; }
.section-heading h2 { margin: 0; font-size: clamp(1.6rem, 4vw, 2.6rem); letter-spacing: -.035em; }
.section-heading p { margin: 0; color: var(--muted); }
.featured-grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.stats-cards { display:grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap:16px; margin:24px 0; }
.stat-card { background: var(--card); border:1px solid var(--line); border-radius:18px; padding:20px; box-shadow:0 12px 30px var(--shadow); }
.stat-card strong { display:block; font-size:2.4rem; line-height:1; color:var(--accent); }
.stat-card span { display:block; margin-top:8px; color:var(--muted); }

/* v11.1 admin edit form layout fix
   Edit pages use .compact-form as a two-column grid. Headings, checkbox rows
   and action buttons need explicit grid placement otherwise the browser places
   them into the label/value grid and the card appears squashed/misaligned. */
.compact-form > h2,
.compact-form > h3,
.compact-form > .validation-summary,
.compact-form > .help-text,
.compact-form > .hint {
    grid-column: 1 / -1;
}

.compact-form > label:has(input[type="checkbox"]) {
    grid-column: 2;
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 4px 0;
    font-weight: 800;
}

.compact-form > label:has(input[type="checkbox"]) input {
    flex: 0 0 auto;
    width: auto;
}

.compact-form > button[type="submit"],
.compact-form > a.btn {
    grid-column: 2;
    justify-self: start;
}

.compact-form > a.btn {
    margin-top: -4px;
}

@media (max-width: 760px) {
    .compact-form > label:has(input[type="checkbox"]),
    .compact-form > button[type="submit"],
    .compact-form > a.btn {
        display: inline-flex;
        margin-top: 12px;
    }
}
