:root {
    --bg: #f4f5f7;
    --panel: #ffffff;
    --ink: #171a21;
    --muted: #687080;
    --line: #e2e5ea;
    --brand: #9d162c;
    --brand-dark: #781020;
    --success: #147a4a;
    --success-bg: #e8f7ef;
    --warning: #965d05;
    --warning-bg: #fff4d8;
    --danger: #b42318;
    --danger-bg: #fff0ee;
    --shadow: 0 12px 35px rgba(27, 32, 44, .07);
    font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--ink);
    background: var(--bg);
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: var(--bg); }
a { color: var(--brand); text-underline-offset: 3px; }
button, input { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .55; }
.shell { width: min(1120px, calc(100% - 40px)); margin-inline: auto; }
.site-header { background: #181a20; color: #fff; border-bottom: 3px solid var(--brand); }
.header-inner { min-height: 68px; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.header-actions { display: flex; align-items: center; gap: 15px; }
.header-actions form { margin: 0; }
.header-link { color: #e7e8eb; font-size: .9rem; font-weight: 680; text-decoration: none; }
.header-link:hover { color: #fff; text-decoration: underline; }
.brand { color: #fff; text-decoration: none; display: inline-flex; align-items: center; gap: 12px; font-weight: 750; letter-spacing: -.01em; }
.brand-mark { display: grid; place-items: center; width: 45px; height: 30px; background: var(--brand); font-size: 12px; letter-spacing: .12em; }
.main-content { padding-block: 48px 80px; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 10px; font-size: clamp(2rem, 4vw, 3.2rem); line-height: 1.04; letter-spacing: -.04em; }
h2 { margin-bottom: 8px; font-size: 1.25rem; letter-spacing: -.02em; }
.eyebrow { margin-bottom: 8px; color: var(--brand); font-size: .76rem; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; }
.muted, .field-help, .fine-print { color: var(--muted); }
.field-help, .fine-print { font-size: .86rem; line-height: 1.5; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); }
.page-heading { margin-bottom: 34px; }
.heading-actions, .detail-heading, .section-heading, .heading-buttons, .recipient-title, .danger-zone { display: flex; align-items: center; justify-content: space-between; gap: 22px; }
.heading-buttons { flex-wrap: wrap; justify-content: flex-end; }
.heading-buttons form { margin: 0; }
.button { min-height: 42px; border: 1px solid transparent; border-radius: 9px; padding: 9px 16px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; font-weight: 720; text-decoration: none; transition: transform .12s ease, background .12s ease, border-color .12s ease; }
.button:hover { transform: translateY(-1px); }
.button-primary { background: var(--brand); color: #fff; }
.button-primary:hover { background: var(--brand-dark); }
.button-secondary { background: #fff; color: #2c3340; border-color: #cfd4dc; }
.button-secondary:hover { border-color: #9299a6; }
.button-quiet { color: #fff; background: transparent; border-color: #484c56; }
.button-danger { color: #fff; background: var(--danger); }
.button-danger-quiet { color: var(--danger); background: transparent; padding-inline: 8px; }
.watch-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 310px), 1fr)); gap: 20px; }
.watch-card { color: var(--ink); padding: 24px; text-decoration: none; transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease; }
.watch-card:hover { transform: translateY(-3px); box-shadow: 0 16px 42px rgba(27, 32, 44, .11); border-color: #c8cdd5; }
.watch-card h2 { margin-top: 18px; font-size: 1.35rem; }
.card-topline { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: .8rem; font-weight: 650; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; }
.status-dot-ok { background: #21a366; box-shadow: 0 0 0 4px #e3f5eb; }
.status-dot-error { background: var(--danger); box-shadow: 0 0 0 4px var(--danger-bg); }
.venue { color: var(--muted); margin-bottom: 22px; }
.venue-large { margin-bottom: 0; font-size: 1.05rem; }
.card-metrics { display: flex; gap: 22px; padding: 17px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); color: var(--muted); font-size: .9rem; }
.card-metrics strong { color: var(--ink); font-size: 1.08rem; }
.card-footer { margin-top: 17px; display: flex; flex-direction: column; gap: 3px; color: var(--muted); font-size: .78rem; }
.card-footer strong { color: #343a46; font-size: .88rem; }
.empty-state { padding: 64px 30px; text-align: center; }
.empty-icon { width: 54px; height: 54px; margin: 0 auto 18px; display: grid; place-items: center; border-radius: 50%; background: #f6e8eb; color: var(--brand); font-size: 2rem; }
.breadcrumb { display: flex; gap: 9px; margin-bottom: 24px; color: var(--muted); font-size: .86rem; }
.breadcrumb a { color: var(--muted); }
.section-panel { margin-top: 24px; padding: 26px; }
.section-heading { align-items: flex-end; margin-bottom: 22px; }
.section-heading h2 { margin-bottom: 0; font-size: 1.55rem; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 15px 14px; border-top: 1px solid var(--line); text-align: left; vertical-align: middle; }
th { border-top: 0; padding-top: 4px; color: var(--muted); font-size: .74rem; letter-spacing: .08em; text-transform: uppercase; }
td small { display: block; margin-top: 4px; color: var(--muted); }
.row-muted { opacity: .58; }
.pill { display: inline-block; border-radius: 999px; padding: 6px 10px; font-size: .78rem; font-weight: 800; }
.pill-sale { color: var(--success); background: var(--success-bg); }
.pill-announced { color: var(--warning); background: var(--warning-bg); }
.recipient-list { display: grid; gap: 16px; }
.recipient-card { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.recipient-title { padding: 15px 18px; background: #f8f9fb; border-bottom: 1px solid var(--line); }
.recipient-title > div { display: flex; align-items: center; gap: 10px; }
.email-icon { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; color: var(--brand); background: #f4e6e9; font-weight: 800; }
.recipient-settings { padding: 20px; display: grid; grid-template-columns: 1fr 1.2fr auto; align-items: start; gap: 28px; }
fieldset { min-width: 0; padding: 0; border: 0; }
legend { margin-bottom: 12px; font-size: .82rem; color: var(--muted); font-weight: 800; text-transform: uppercase; letter-spacing: .06em; }
.check-row { display: flex; align-items: flex-start; gap: 10px; margin: 10px 0; cursor: pointer; }
.check-row input { width: 17px; height: 17px; margin: 2px 0 0; accent-color: var(--brand); }
.check-row span { display: flex; flex-direction: column; gap: 2px; }
.check-row small { color: var(--muted); line-height: 1.4; }
.check-row.compact { margin-left: 27px; font-size: .9rem; }
.specific-terms { max-height: 185px; overflow-y: auto; }
.inline-empty { padding: 25px; border: 1px dashed #cbd0d9; border-radius: 10px; text-align: center; color: var(--muted); }
.inline-empty p { margin: 0; }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { position: relative; display: flex; gap: 15px; padding: 9px 0 17px; }
.timeline li:not(:last-child)::before { content: ''; position: absolute; left: 5px; top: 23px; bottom: -2px; width: 1px; background: var(--line); }
.timeline-dot { position: relative; z-index: 1; flex: 0 0 11px; width: 11px; height: 11px; margin-top: 5px; border: 2px solid #fff; border-radius: 50%; background: var(--brand); box-shadow: 0 0 0 1px var(--brand); }
.timeline div { display: flex; flex-direction: column; gap: 4px; }
.timeline small { color: var(--muted); }
.danger-zone { margin-top: 38px; padding: 22px 24px; border: 1px solid #efb8b2; border-radius: 13px; background: var(--danger-bg); }
.danger-zone h2 { color: var(--danger); }
.danger-zone p { margin: 0; color: #7f3630; }
.flash { margin-bottom: 20px; padding: 14px 16px; border-radius: 10px; line-height: 1.45; }
.flash-success { color: #0e6540; background: var(--success-bg); border: 1px solid #bce4ce; }
.flash-error { color: #8d251d; background: var(--danger-bg); border: 1px solid #efb8b2; }
.login-wrap { min-height: calc(100vh - 220px); display: grid; place-items: center; }
.login-panel { width: min(430px, 100%); padding: 34px; }
.stack { display: grid; gap: 18px; margin-top: 28px; }
.stack-small { display: grid; gap: 8px; }
label > span:first-child { font-weight: 680; }
input[type="email"], input[type="password"], input[type="url"], select { width: 100%; min-height: 46px; padding: 10px 12px; border: 1px solid #c9ced7; border-radius: 8px; color: var(--ink); background: #fff; }
input:focus { outline: 3px solid rgba(157, 22, 44, .13); border-color: var(--brand); }
.fine-print { margin: 20px 0 0; }
.dialog { width: min(620px, calc(100% - 28px)); padding: 0; border: 0; border-radius: 16px; box-shadow: 0 24px 80px rgba(15, 18, 25, .28); }
.dialog-small { width: min(500px, calc(100% - 28px)); }
.dialog::backdrop { background: rgba(18, 21, 28, .65); backdrop-filter: blur(2px); }
.dialog form { padding: 28px; }
.dialog-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 24px; }
.dialog-header h2 { font-size: 1.65rem; }
.icon-button { width: 36px; height: 36px; border: 0; border-radius: 50%; color: #545b68; background: #f0f1f4; font-size: 1.45rem; }
.dialog-actions { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 10px; margin-top: 24px; }
.preview-result { margin-top: 18px; padding: 14px; border-radius: 9px; display: flex; flex-direction: column; gap: 5px; }
.preview-result.loading { color: var(--muted); background: #f3f4f6; }
.preview-result.success { color: var(--success); background: var(--success-bg); }
.preview-result.error { color: var(--danger); background: var(--danger-bg); }
code { padding: 2px 5px; border-radius: 4px; background: rgba(0,0,0,.06); }
.test-mail-panel { width: min(640px, 100%); padding: 28px; }
.test-mail-note { padding: 16px; border-radius: 10px; color: #63501a; background: var(--warning-bg); }
.test-mail-note p { margin: 6px 0 0; line-height: 1.55; }

@media (max-width: 820px) {
    .recipient-settings { grid-template-columns: 1fr; gap: 18px; }
    .heading-actions, .detail-heading, .section-heading, .danger-zone { align-items: flex-start; flex-direction: column; }
    .heading-buttons { justify-content: flex-start; }
}

@media (max-width: 560px) {
    .shell { width: min(100% - 24px, 1120px); }
    .main-content { padding-top: 30px; }
    .site-header .brand > span:last-child { display: none; }
    .header-link { display: none; }
    .section-panel, .watch-card, .login-panel { padding: 20px; }
    th, td { padding-inline: 10px; }
    .dialog form { padding: 22px; }
}
