:root {
    --paper: #fbf7f1;
    --card: #ffffff;
    --ink: #241b18;
    --muted: #6f625b;
    --line: #e7ded2;
    --red: #b3122b;
    --red-dark: #8c0c20;
    --red-tint: #fbedec;
    --gold: #e9c98a;
    --green: #2c6a4d;
    --green-tint: #e7f2ec;
    --amber: #8a5a10;
    --amber-tint: #fbf0dc;
    --radius: 14px;
    --shadow: 0 1px 2px rgba(36, 27, 24, .05), 0 8px 24px rgba(36, 27, 24, .06);
    --display: 'Fraunces', Georgia, serif;
    --body: 'Instrument Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
    margin: 0;
    background: var(--paper);
    color: var(--ink);
    font: 400 16px/1.5 var(--body);
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { font-family: var(--display); font-weight: 600; line-height: 1.15; margin: 0; letter-spacing: -.01em; }
p { margin: 0; }
a { color: var(--red); }
img { display: block; max-width: 100%; }
:focus-visible { outline: 3px solid rgba(179, 18, 43, .35); outline-offset: 2px; }

/* Header band */
.hero {
    position: relative;
    overflow: hidden;
    background: var(--red);
    color: #fff;
    padding: 40px 20px 72px;
    text-align: center;
}
.hero .star { position: absolute; right: -60px; top: -70px; width: 320px; height: 320px; color: rgba(255, 255, 255, .13); }
.hero .star.left { right: auto; left: -110px; top: 30px; width: 240px; height: 240px; }
.hero > *:not(.star) { position: relative; }
.eyebrow { font-size: 13px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--gold); }
.hero h1 { font-size: clamp(34px, 7vw, 48px); margin: 8px 0 8px; }
.hero p.lede { font-size: 17px; color: rgba(255, 255, 255, .88); }

.shell { width: min(760px, 100% - 32px); margin: -44px auto 56px; position: relative; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 28px; }
.card h2 { font-size: 26px; }
.card .hint { color: var(--muted); margin-top: 4px; }

/* Fields */
.fields { display: grid; grid-template-columns: 1fr 1fr; gap: 18px 16px; margin-top: 20px; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field.full { grid-column: 1 / -1; }
.field > label, .legend { font-size: 14px; font-weight: 600; }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
legend { padding: 0; margin-bottom: 8px; }
input[type=text], input[type=email], input[type=tel], input[type=password], input[type=search], textarea {
    width: 100%;
    font: inherit;
    color: inherit;
    background: #fff;
    border: 1px solid #d5cabc;
    border-radius: 10px;
    padding: 11px 13px;
    transition: border-color .15s, box-shadow .15s;
}
textarea { min-height: 92px; resize: vertical; }
input:focus, textarea:focus { outline: none; border-color: var(--red); box-shadow: 0 0 0 3px rgba(179, 18, 43, .14); }
.invalid input, .invalid textarea, input.invalid { border-color: var(--red); }
.error { color: var(--red-dark); font-size: 14px; font-weight: 500; }
.form-error { background: var(--red-tint); color: var(--red-dark); border-radius: 10px; padding: 12px 14px; margin-top: 16px; font-weight: 500; }

/* Buttons */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    font: 600 16px/1 var(--body);
    padding: 13px 20px;
    border-radius: 10px;
    border: 1px solid transparent;
    cursor: pointer;
    text-decoration: none;
    transition: background .15s, border-color .15s, color .15s;
}
.btn.primary { background: var(--red); color: #fff; }
.btn.primary:hover:not(:disabled) { background: var(--red-dark); }
.btn.ghost { background: #fff; border-color: #d5cabc; color: var(--ink); }
.btn.ghost:hover:not(:disabled) { border-color: var(--ink); }
.btn.danger { background: #fff; border-color: #e3b9b9; color: var(--red-dark); }
.btn.danger:hover:not(:disabled) { background: var(--red-tint); }
.btn.danger.solid { background: var(--red); border-color: var(--red); color: #fff; }
.btn.danger.solid:hover:not(:disabled) { background: var(--red-dark); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.small { font-size: 14px; padding: 9px 12px; }
.link-btn { background: none; border: 0; padding: 4px 6px; font: 600 14px var(--body); color: var(--muted); cursor: pointer; border-radius: 6px; }
.link-btn:hover:not(:disabled) { color: var(--ink); }
.link-btn.remove:hover { color: var(--red-dark); }
.link-btn:disabled { opacity: .45; cursor: not-allowed; }

/* Passcode + login gate */
.gate { max-width: 420px; margin: 0 auto; text-align: center; }
.gate form { margin-top: 18px; display: grid; gap: 12px; text-align: left; }
.gate .btn { width: 100%; }
.facts { max-width: 420px; margin: 20px auto 0; color: var(--muted); font-size: 14px; text-align: center; display: grid; gap: 2px; }

/* Stepper */
.steps { list-style: none; display: flex; gap: 8px; margin: 0 0 16px; padding: 12px 16px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.steps li { flex: 1; display: flex; align-items: center; gap: 10px; font-size: 14px; font-weight: 600; color: var(--muted); min-width: 0; }
.steps .dot { flex: none; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: #f1e9de; font-size: 14px; }
.steps li.current { color: var(--ink); }
.steps li.current .dot { background: var(--red); color: #fff; }
.steps li.done .dot { background: var(--green); color: #fff; }

.nav-row { display: flex; justify-content: space-between; gap: 12px; margin-top: 24px; }
.nav-row .spacer { flex: 1; }

/* Banner cards */
.banner-list { display: grid; gap: 12px; margin-top: 20px; }
.banner { border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.banner.is-open { border-color: #cdbfae; }
.banner.has-error { border-color: var(--red); }
.banner-head { display: flex; align-items: center; gap: 8px; padding: 10px 12px; }
.banner-toggle { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; background: none; border: 0; padding: 2px; font: inherit; color: inherit; text-align: left; cursor: pointer; border-radius: 8px; }
.banner-toggle .thumb { flex: none; width: 48px; aspect-ratio: 1; border-radius: 6px; object-fit: cover; background: #f1e9de; }
.banner-toggle span.meta { min-width: 0; display: grid; }
.banner-toggle strong { font-weight: 600; }
.banner-toggle small { color: var(--muted); font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.banner-actions { flex: none; display: flex; gap: 2px; }
.banner-body { display: grid; gap: 20px; padding: 8px 16px 18px; border-top: 1px solid var(--line); padding-top: 16px; }

.segmented { display: inline-flex; background: #f4ece1; border-radius: 10px; padding: 3px; gap: 2px; }
.segmented label { position: relative; cursor: pointer; }
.segmented input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.segmented span { display: block; padding: 8px 16px; border-radius: 8px; font-weight: 600; font-size: 15px; color: var(--muted); }
.segmented input:checked + span { background: #fff; color: var(--ink); box-shadow: 0 1px 2px rgba(36, 27, 24, .14); }
.segmented input:focus-visible + span { outline: 3px solid rgba(179, 18, 43, .35); }

.designs { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
.design { position: relative; display: block; cursor: pointer; border-radius: 10px; border: 2px solid var(--line); padding: 6px; background: #fff; transition: border-color .15s; }
.design:hover { border-color: #cdbfae; }
.design input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.design img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 5px; }
.design span { display: block; font-size: 14px; font-weight: 500; padding: 7px 4px 2px; }
.design:has(input:checked) { border-color: var(--red); background: var(--red-tint); }
.design:has(input:focus-visible) { outline: 3px solid rgba(179, 18, 43, .35); outline-offset: 1px; }

.choice-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.choice { position: relative; display: block; min-width: 0; overflow-wrap: anywhere; cursor: pointer; border: 2px solid var(--line); border-radius: 10px; padding: 11px 13px; font-weight: 600; }
.choice input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.choice small { display: block; font-weight: 400; font-size: 14px; color: var(--muted); }
.choice:has(input:checked) { border-color: var(--red); background: var(--red-tint); }
.choice:has(input:focus-visible) { outline: 3px solid rgba(179, 18, 43, .35); outline-offset: 1px; }

.times { display: grid; gap: 10px; margin-bottom: 6px; }
.time-row { display: grid; grid-template-columns: 1fr 1fr auto; gap: 10px; align-items: end; }
.time-row .field > label { font-weight: 500; font-size: 13px; color: var(--muted); }
.time-row + .time-row .field > label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
fieldset.invalid .time-row:first-child input[data-time-field=time] { border-color: var(--red); }

/* Banner preview. Proportions and type sizes come from the Church's 42 x 15 in PDF (3024 x 1080 pt). */
.mock { container-type: inline-size; position: relative; width: 100%; aspect-ratio: 84 / 30; overflow: hidden; background: #c8343c; color: #fff; font-family: 'Open Sans', Arial, sans-serif; box-shadow: 0 1px 3px rgba(36, 27, 24, .25); }
.mock-image { position: absolute; inset: 0 auto 0 0; width: 38.1%; }
.mock-image img { width: 100%; height: 100%; object-fit: cover; }
.mock-image::after { content: ''; position: absolute; inset: 0; background: #c8343c; opacity: .62; clip-path: polygon(100% 0, 100% 100%, 38% 100%); }
.mock-image::before { content: ''; position: absolute; inset: 0; z-index: 1; background: #c8343c; opacity: .35; clip-path: polygon(74% 0, 100% 0, 100% 100%, 82% 62%); }
.mock-text { position: absolute; inset: 0 0 0 41.6%; display: flex; flex-direction: column; padding: 1.75cqw 2cqw 1.6cqw 0; }
.mock-url { font-size: 1.98cqw; font-weight: 700; line-height: 1.2; }
.mock-text strong { margin-top: 2.1cqw; font-size: 5.95cqw; line-height: 1.13; font-weight: 800; overflow-wrap: anywhere; }
.mock-text strong.long { font-size: 5.29cqw; }
.mock-times { display: grid; margin-top: auto; padding-bottom: 2.2cqw; }
.mock-label { font-size: 3.47cqw; font-weight: 400; letter-spacing: .05em; line-height: 1.15; text-transform: uppercase; margin-bottom: .9cqw; }
.mock-time-row { display: flex; flex-wrap: wrap; row-gap: .4cqw; }
.mock-time { display: grid; align-content: start; }
.mock-time b { font-size: max(1.98cqw, 8px); font-weight: 700; line-height: 1.15; white-space: nowrap; }
.mock-time:not(:last-child) b::after { content: '|'; margin: 0 .55em; }
.mock-time small { font-size: max(1.09cqw, 6px); font-weight: 700; line-height: 1.2; margin-left: .3em; white-space: nowrap; }
.mock.star { background: #cb1f33; }
.mock.star .mock-image { width: 33%; }
.mock.star .mock-image::before, .mock.star .mock-image::after { display: none; }
.mock.star .mock-text { left: 33.1%; }
.mock-note { color: var(--muted); font-size: 13px; margin-top: 6px; }

/* Order preview and total */
.proof { aspect-ratio: 84 / 30; display: grid; place-items: center; justify-items: center; align-content: center; gap: 8px; background: #f4ece1; color: var(--muted); font-size: 14px; }
.proof img { width: 100%; height: 100%; object-fit: contain; box-shadow: 0 1px 3px rgba(36, 27, 24, .25); }
.approve { display: flex; align-items: center; gap: 10px; font-weight: 600; padding: 10px 12px; background: var(--paper); border: 1px solid var(--line); border-radius: 10px; cursor: pointer; }
.approve input { width: 20px; height: 20px; flex: none; accent-color: var(--red); }
.approve:has(input:checked) { background: var(--green-tint); border-color: var(--green); }
.approve:has(input:disabled) { opacity: .6; cursor: default; }
.approve-status { margin-top: 14px; color: var(--muted); font-size: 14px; font-weight: 500; }
.not-invoice { margin-top: 10px; color: var(--muted); font-size: 14px; font-weight: 600; }
.order-summary { margin-top: 4px; padding: 14px 16px; background: var(--paper); border: 1px solid var(--line); border-radius: 10px; display: grid; gap: 6px; }
.order-summary div { display: flex; justify-content: space-between; gap: 12px; color: var(--muted); font-size: 15px; }
.order-summary .total { color: var(--ink); font: 600 22px/1.2 var(--display); }
.field-hint { color: var(--muted); font-size: 14px; }
.order-line { font-size: 14px; color: var(--muted); margin-bottom: 12px; }
.order-line strong { color: var(--ink); }

.add-row { display: flex; align-items: center; gap: 12px; margin-top: 12px; color: var(--muted); font-size: 14px; }

/* Review */
.review-section { padding: 18px 0; border-bottom: 1px solid var(--line); }
.review-section:last-of-type { border-bottom: 0; }
.review-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.review-head h3 { font-size: 19px; }
.review-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; }
.review-grid dt { font-size: 13px; color: var(--muted); }
.review-grid dd { margin: 0; overflow-wrap: anywhere; white-space: pre-line; }
.review-grid div.full { grid-column: 1 / -1; }
.review-banner { display: grid; gap: 8px; padding: 10px 0 16px; }
.review-banner p { color: var(--muted); font-size: 14px; overflow-wrap: anywhere; }
.review-banner strong { overflow-wrap: anywhere; }

/* Success */
.success { text-align: center; padding: 40px 28px; }
.success .check { width: 60px; height: 60px; margin: 0 auto 16px; border-radius: 50%; background: var(--green-tint); color: var(--green); display: grid; place-items: center; }
.success .order-no { font-weight: 600; margin-top: 6px; }
.success ul { list-style: none; margin: 18px 0 24px; padding: 0; color: var(--muted); display: grid; gap: 4px; }

/* Admin */
.topbar { background: var(--red); color: #fff; }
.topbar-inner { width: min(1200px, 100% - 32px); margin: 0 auto; padding: 16px 0; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.topbar h1 { font-size: 24px; }
.topbar .eyebrow { font-size: 12px; }
.topbar .btn { background: rgba(255, 255, 255, .14); color: #fff; border-color: rgba(255, 255, 255, .4); }
.topbar .btn:hover { background: rgba(255, 255, 255, .24); }
.admin-shell { width: min(1200px, 100% - 32px); margin: 24px auto 48px; }

.stat-filters { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; }
.stat { text-align: left; font: inherit; color: inherit; background: var(--card); border: 2px solid var(--line); border-radius: var(--radius); padding: 14px 16px; cursor: pointer; transition: border-color .15s; }
.stat:hover { border-color: #cdbfae; }
.stat[aria-pressed=true] { border-color: var(--red); }
.stat span { display: block; font-size: 14px; font-weight: 600; color: var(--muted); }
.stat strong { display: block; font: 600 32px/1.2 var(--display); }

.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); margin-top: 16px; overflow: hidden; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.panel-head h2 { font-size: 20px; }
.panel-head input { max-width: 300px; }

.orders { width: 100%; border-collapse: collapse; }
.orders th { text-align: left; font-size: 13px; font-weight: 600; color: var(--muted); padding: 10px 18px; border-bottom: 1px solid var(--line); }
.orders td { padding: 13px 18px; border-bottom: 1px solid #f1eae0; vertical-align: middle; }
.orders tr:last-child td { border-bottom: 0; }
.orders tbody tr { cursor: pointer; }
.orders tbody tr:hover { background: #fdfaf5; }
.orders .num { font-variant-numeric: tabular-nums; }
.orders .order-link { background: none; border: 0; font: 600 16px var(--body); color: var(--red); cursor: pointer; padding: 0; }
.orders small { display: block; color: var(--muted); font-size: 14px; }
.empty { padding: 48px 20px; text-align: center; color: var(--muted); }

.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 13px; font-weight: 600; white-space: nowrap; background: #f1e9de; color: var(--muted); }
.badge.new { background: var(--red-tint); color: var(--red-dark); }
.badge.in-progress { background: var(--amber-tint); color: var(--amber); }
.badge.complete { background: var(--green-tint); color: var(--green); }

dialog { border: 0; padding: 0; color: inherit; }
dialog::backdrop { background: rgba(36, 27, 24, .45); }
.drawer { position: fixed; inset: 0 0 0 auto; margin: 0; width: min(560px, 100vw); max-width: 100vw; height: 100dvh; max-height: 100dvh; background: var(--paper); }
.drawer-head { position: sticky; top: 0; z-index: 2; display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 16px 20px; background: var(--card); border-bottom: 1px solid var(--line); }
.drawer-head h2 { font-size: 24px; }
.drawer-head small { color: var(--muted); font-size: 14px; display: block; }
.close { background: none; border: 0; width: 38px; height: 38px; border-radius: 8px; font-size: 24px; line-height: 1; cursor: pointer; color: var(--muted); }
.close:hover { background: #f4ece1; color: var(--ink); }
.drawer-body { padding: 16px 20px 28px; display: grid; gap: 14px; }
.block { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; }
.block h3 { font-size: 17px; margin-bottom: 10px; }
.detail { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 4px 12px; margin: 0; }
.detail dt { color: var(--muted); font-size: 14px; }
.detail dd { margin: 0; overflow-wrap: anywhere; white-space: pre-line; }
.admin-banner { padding: 12px 0; border-top: 1px solid #f1eae0; }
.admin-banner:first-of-type { border-top: 0; padding-top: 0; }
.admin-banner img { width: 100%; max-width: 384px; aspect-ratio: 384 / 137; object-fit: cover; border-radius: 6px; margin-bottom: 8px; }
.admin-banner img.square { width: 120px; aspect-ratio: 1; }
.admin-banner .btn { margin-top: 10px; }
.admin-banner h4 { margin: 0 0 4px; font-size: 16px; overflow-wrap: anywhere; }
.drawer-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.confirm { width: min(400px, calc(100vw - 32px)); border-radius: var(--radius); background: var(--card); padding: 22px; }
.confirm h2 { font-size: 22px; margin-bottom: 6px; }
.confirm p { color: var(--muted); }
.confirm .nav-row { margin-top: 18px; justify-content: flex-end; }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 50; background: var(--ink); color: #fff; padding: 11px 16px; border-radius: 10px; font-weight: 500; box-shadow: var(--shadow); max-width: calc(100vw - 32px); }

@media (max-width: 640px) {
    .card { padding: 20px 16px; }
    .fields, .review-grid { grid-template-columns: 1fr; }
    .steps li span.label { display: none; }
    .steps li.current span.label { display: inline; }
    .steps li { flex: none; }
    .steps li.current { flex: 1; }
    .banner-head { flex-wrap: wrap; }
    .banner-toggle { flex-basis: 100%; }
    .banner-actions { margin-left: auto; }
    .banner-body { padding-left: 12px; padding-right: 12px; }
    .designs { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
    .choice-row { grid-template-columns: minmax(0, 1fr); }
    .time-row { grid-template-columns: 1fr 1fr; }
    .time-row .link-btn { grid-column: 1 / -1; justify-self: end; }
    .design span { font-size: 13px; }
    .nav-row .btn { flex: 1; }

    .stat-filters { grid-template-columns: repeat(2, 1fr); }
    .panel-head { flex-direction: column; align-items: stretch; }
    .panel-head input { max-width: none; }
    .orders thead { display: none; }
    .orders, .orders tbody, .orders tr, .orders td { display: block; width: 100%; }
    .orders tr { padding: 12px 16px; border-bottom: 1px solid var(--line); display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; }
    .orders tr:last-child { border-bottom: 0; }
    .orders td { padding: 0; border: 0; width: auto; }
    .orders td.c-date, .orders td.c-count { color: var(--muted); font-size: 14px; }
    .orders td.c-count::after { content: ' banners'; }
    .orders td.c-status { grid-column: 2; grid-row: 1; }
    .detail { grid-template-columns: 96px minmax(0, 1fr); }
}

@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
