/* R&A Events — R&A design language on Material 3 foundations */
:root {
  --brand: #8e191c;
  --on-brand: #ffffff;
  --brand-soft: #f6e7e4;
  --surface: #fbf8f5;
  --surface-1: #ffffff;
  --surface-2: #f3eee9;
  --surface-3: #ebe4dd;
  --outline: #d8cfc7;
  --text: #2b2522;
  --muted: #6f655f;
  --ok: #2e6b3f;
  --ok-bg: #e4f1e6;
  --warn: #8a5a00;
  --warn-bg: #fbefd5;
  --err: #a1261f;
  --err-bg: #fbe5e2;
  --radius: 16px;
  --radius-sm: 10px;
  --display: 'DM Serif Display', Georgia, serif;
  --body: 'Quattrocento Sans', 'Helvetica Neue', Arial, sans-serif;
  --shadow: 0 1px 2px rgba(43, 37, 34, .06), 0 2px 8px rgba(43, 37, 34, .06);
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--body); font-size: 16px; line-height: 1.6; color: var(--text); background: var(--surface); }
a { color: var(--brand); }
img { max-width: 100%; }
h1, h2, h3 { font-weight: 400; line-height: 1.2; margin: 0 0 .5em; }
.display { font-family: var(--display); letter-spacing: -.3px; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.center { text-align: center; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 20px; }
.narrow { max-width: 680px; }
.material-symbols-outlined { font-size: 22px; vertical-align: middle; line-height: 1; display: inline-block; width: 1em; height: 1em; overflow: hidden; white-space: nowrap; flex: none; }
.hidden { display: none !important; }

/* ---------- buttons, chips, cards ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; padding: 0 22px; border-radius: 999px; border: 1px solid transparent; font: 700 15px/1 var(--body); text-decoration: none; cursor: pointer; transition: background .15s, box-shadow .15s; white-space: nowrap; }
.btn.filled { background: var(--brand); color: var(--on-brand); }
.btn.filled:hover { box-shadow: var(--shadow); filter: brightness(1.06); }
.btn.tonal { background: var(--brand-soft); color: var(--brand); }
.btn.outlined { background: transparent; border-color: var(--outline); color: var(--brand); }
.btn.text { background: transparent; color: var(--brand); padding: 0 12px; }
.btn.danger { background: var(--err-bg); color: var(--err); }
.btn.small { min-height: 34px; padding: 0 14px; font-size: 14px; }
.btn[disabled], .btn.disabled { opacity: .5; pointer-events: none; }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.card { background: var(--surface-1); border-radius: var(--radius); box-shadow: var(--shadow); border: 1px solid var(--surface-3); }
.pad { padding: 20px; }
.pad-lg { padding: 32px; }
.chip { display: inline-block; padding: 2px 10px; border-radius: 8px; font-size: 13px; font-weight: 700; background: var(--surface-2); color: var(--muted); }
.chip-upcoming { background: var(--brand-soft); color: var(--brand); }
.chip-live { background: var(--ok-bg); color: var(--ok); }
.chip-cancelled { background: var(--err-bg); color: var(--err); }
.chip-ok { background: var(--ok-bg); color: var(--ok); }
.chip-warn { background: var(--warn-bg); color: var(--warn); }
.chip-err { background: var(--err-bg); color: var(--err); }
.notice { padding: 14px 16px; border-radius: var(--radius-sm); background: var(--surface-2); margin: 0 0 16px; }
.notice.ok { background: var(--ok-bg); color: var(--ok); }
.notice.warn { background: var(--warn-bg); color: var(--warn); }
.notice.err { background: var(--err-bg); color: var(--err); }

/* ---------- forms ---------- */
.field { display: flex; flex-direction: column; gap: 6px; margin: 0 0 16px; }
.field label { font-weight: 700; font-size: 14px; }
.field .hint { font-size: 13px; color: var(--muted); }
input[type=text], input[type=email], input[type=tel], input[type=url], input[type=password], input[type=number], input[type=date], input[type=time], select, textarea {
  width: 100%; padding: 11px 14px; border: 1px solid var(--outline); border-radius: var(--radius-sm); background: #fff; font: 16px/1.4 var(--body); color: var(--text);
}
textarea { min-height: 110px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--brand); outline-offset: 0; border-color: var(--brand); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 16px; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; margin: 0 0 16px; }
.check input { margin-top: 4px; width: 18px; height: 18px; accent-color: var(--brand); flex: none; }
.hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }
fieldset { border: 1px solid var(--surface-3); border-radius: var(--radius); padding: 16px 20px 4px; margin: 0 0 20px; }
legend { padding: 0 6px; font-weight: 700; }
@media (max-width: 720px) { .grid2, .grid3 { grid-template-columns: 1fr; } }

/* ---------- public site ---------- */
.site-header { background: var(--surface-1); border-bottom: 1px solid var(--surface-3); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; min-height: 72px; gap: 16px; }
.brand .logo { max-height: 44px; display: block; }
.logo-text { font-family: var(--display); font-size: 22px; color: var(--brand); text-decoration: none; }
.site-nav { display: flex; gap: 20px; font-size: 15px; }
.site-nav a { color: var(--text); text-decoration: none; }
.site-nav a:hover { color: var(--brand); }
.site-footer { margin-top: 64px; padding: 32px 0; background: var(--surface-2); font-size: 14px; }
.site-footer .wrap { display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.hero { padding: 56px 0 36px; }
.eyebrow { text-transform: uppercase; letter-spacing: .12em; font-size: 13px; font-weight: 700; color: var(--brand); margin: 0 0 10px; }
.hero h1 { font-family: var(--display); font-size: clamp(34px, 5vw, 52px); letter-spacing: -.5px; margin: 0 0 14px; }
.hero .lede { font-size: 19px; color: var(--muted); max-width: 720px; margin: 0; }
.event-list { display: grid; gap: 18px; }
.event-card { display: grid; grid-template-columns: 120px 1fr auto; gap: 24px; align-items: center; padding: 24px; text-decoration: none; color: inherit; transition: box-shadow .15s, transform .15s; }
.event-card:hover { box-shadow: 0 4px 18px rgba(43, 37, 34, .12); transform: translateY(-1px); }
.datebox { text-align: center; border-radius: var(--radius-sm); background: var(--brand-soft); color: var(--brand); padding: 12px 6px; }
.datebox .m { font-size: 13px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.datebox .d { font-family: var(--display); font-size: 40px; line-height: 1; }
.datebox .y { font-size: 13px; }
.event-card h2 { font-family: var(--display); font-size: 26px; margin: 0 0 6px; }
.event-card p { margin: 0; color: var(--muted); }
@media (max-width: 720px) { .event-card { grid-template-columns: 1fr; } .datebox { display: flex; gap: 8px; justify-content: center; align-items: baseline; } .datebox .d { font-size: 28px; } }
.empty { padding: 48px; text-align: center; }
.landing { display: grid; grid-template-columns: minmax(0, 1fr) 400px; gap: 40px; align-items: start; }
.landing .content h2 { font-family: var(--display); font-size: 28px; margin-top: 28px; }
.landing .content p { margin: 0 0 14px; }
.hero-img { width: 100%; border-radius: var(--radius); margin: 0 0 24px; display: block; }
.when { display: flex; flex-direction: column; gap: 6px; margin: 18px 0 0; font-size: 17px; }
.when div { display: flex; gap: 10px; align-items: center; }
.when .material-symbols-outlined { color: var(--brand); }
.agenda { list-style: none; padding: 0; margin: 0; counter-reset: ag; }
.agenda li { counter-increment: ag; padding: 10px 0 10px 44px; position: relative; border-bottom: 1px solid var(--surface-3); }
.agenda li::before { content: counter(ag); position: absolute; left: 0; top: 9px; width: 30px; height: 30px; border-radius: 50%; background: var(--brand-soft); color: var(--brand); font-weight: 700; display: flex; align-items: center; justify-content: center; font-size: 14px; }
.speakers { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.speaker { display: flex; gap: 14px; padding: 16px; }
.speaker img { width: 72px; height: 72px; border-radius: 50%; object-fit: cover; flex: none; }
.speaker .ph { width: 72px; height: 72px; border-radius: 50%; background: var(--brand-soft); color: var(--brand); display: flex; align-items: center; justify-content: center; font-family: var(--display); font-size: 28px; flex: none; }
.speaker h3 { font-size: 18px; margin: 0; font-weight: 700; }
.speaker .role { font-size: 14px; color: var(--muted); margin: 0 0 6px; }
.speaker p { font-size: 14px; margin: 0; }
.register { position: sticky; top: 20px; }
.register h2 { font-family: var(--display); font-size: 26px; }
.register .btn { width: 100%; margin-top: 4px; }
.local-time { font-size: 14px; color: var(--muted); }
@media (max-width: 920px) { .landing { grid-template-columns: 1fr; } .register { position: static; } }
.cal-links { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin: 18px 0; }

/* ---------- admin ---------- */
body.admin { padding-left: 280px; }
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px; height: 64px; padding: 0 20px; background: var(--surface); border-bottom: 1px solid var(--surface-3); }
.topbar h1 { flex: 1; font-size: 18px; font-weight: 400; letter-spacing: -.3px; font-family: var(--display); margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 50%; border: 0; background: transparent; color: var(--text); cursor: pointer; text-decoration: none; }
.icon-btn:hover { background: var(--surface-2); }
.nav-toggle { display: none; }
.drawer { position: fixed; left: 0; top: 0; bottom: 0; width: 280px; background: var(--surface-1); border-right: 1px solid var(--surface-3); padding: 16px 12px; display: flex; flex-direction: column; z-index: 40; overflow-y: auto; }
.drawer-head { padding: 8px 16px 20px; }
.drawer-logo { max-height: 40px; max-width: 200px; display: block; }
.drawer-sub { font-size: 13px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-top: 8px; }
.drawer nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.drawer form { margin: 0; }
.drawer-item { display: flex; align-items: center; gap: 12px; width: 100%; height: 52px; padding: 0 16px; border-radius: 999px; color: var(--text); text-decoration: none; font: 700 15px var(--body); background: transparent; border: 0; cursor: pointer; text-align: left; }
.drawer-item:hover { background: var(--surface-2); }
.drawer-item.active { background: var(--brand-soft); color: var(--brand); }
.drawer-foot { padding: 12px 16px 0; font-size: 12px; color: var(--muted); }
.scrim { display: none; }
.admin-main { padding: 24px; max-width: 1200px; }
@media (max-width: 960px) {
  body.admin { padding-left: 0; }
  .nav-toggle { display: inline-flex; }
  .drawer { transform: translateX(-100%); transition: transform .2s; }
  body.nav-open .drawer { transform: none; }
  body.nav-open .scrim { display: block; position: fixed; inset: 0; background: rgba(0, 0, 0, .3); z-index: 30; }
  .admin-main { padding: 16px; }
}
.toast { margin: 0 0 16px; padding: 12px 16px; border-radius: var(--radius-sm); background: var(--text); color: #fff; }
.toast-ok { background: var(--ok); }
.toast-err { background: var(--err); }
.toast-warn { background: var(--warn); }
.section { margin: 0 0 24px; }
.section-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin: 0 0 12px; }
.section-head h2 { font-family: var(--display); font-size: 22px; margin: 0; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 16px; margin: 0 0 24px; }
.stat { padding: 18px 20px; }
.stat .n { font-family: var(--display); font-size: 34px; line-height: 1.1; color: var(--brand); }
.stat .l { font-size: 14px; color: var(--muted); }
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 14px; }
table.data th { text-align: left; font-weight: 700; color: var(--muted); font-size: 13px; padding: 10px 12px; border-bottom: 1px solid var(--outline); white-space: nowrap; }
table.data td { padding: 10px 12px; border-bottom: 1px solid var(--surface-3); vertical-align: top; }
table.data tr:last-child td { border-bottom: 0; }
table.data .actions { white-space: nowrap; text-align: right; }
table.data form { display: inline; }
.kv { display: grid; grid-template-columns: 180px 1fr; gap: 8px 16px; font-size: 15px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; word-break: break-word; }
@media (max-width: 720px) { .kv { grid-template-columns: 1fr; } .kv dt { margin-top: 8px; } }
.copy-row { display: flex; gap: 8px; }
.copy-row input { flex: 1; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--surface-3); margin: 0 0 16px; overflow-x: auto; }
.tabs a { padding: 10px 16px; text-decoration: none; color: var(--muted); font-weight: 700; border-bottom: 3px solid transparent; white-space: nowrap; }
.tabs a.active { color: var(--brand); border-color: var(--brand); }
.speaker-row { border: 1px dashed var(--outline); border-radius: var(--radius-sm); padding: 12px 14px 0; margin: 0 0 12px; }
dialog.confirm { border: 0; border-radius: 24px; padding: 24px; max-width: 420px; width: calc(100% - 32px); box-shadow: 0 12px 40px rgba(0, 0, 0, .25); }
dialog.confirm::backdrop { background: rgba(0, 0, 0, .35); }
dialog.confirm h2 { font-family: var(--display); font-size: 22px; }
dialog.confirm .actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }
.login-shell { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; background: var(--surface); }
.login-card { width: 100%; max-width: 420px; padding: 32px; }
.login-card .drawer-logo { margin: 0 auto 20px; }
pre.code { background: var(--surface-2); padding: 12px; border-radius: var(--radius-sm); overflow-x: auto; font-size: 13px; }
.steps { display: flex; gap: 8px; margin: 0 0 20px; flex-wrap: wrap; }
.steps span { padding: 4px 12px; border-radius: 999px; background: var(--surface-2); font-size: 13px; font-weight: 700; color: var(--muted); }
.steps span.on { background: var(--brand); color: #fff; }
/* Icons stay invisible (space reserved) until the icon font has loaded, so a blocked font never shows raw names */
.material-symbols-outlined { visibility: hidden; }
html.icons-ready .material-symbols-outlined { visibility: visible; }
@media (max-width: 560px) { .site-nav { display: none; } .logo-text { font-size: 20px; } }
