:root {
  --accent: #8A123C; --ink: #1D1D1F; --ink-2: #3A3A3C; --muted: #6E6E73; --faint: #8E8E93;
  --line: #E5E5EA; --soft: #F5F5F7; --bg: #FFFFFF;
  --ok: #1E7B45; --ok-bg: #E8F5EC; --warn: #8A5A00; --warn-bg: #FFF4DB; --danger: #B3261E;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; background: var(--soft); color: var(--ink); font: 15px/1.45 var(--font); -webkit-font-smoothing: antialiased; }
h1, h2, p { margin: 0; }
code { font-size: 0.9em; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.eyebrow { font-size: 11px; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase; color: var(--accent); }

.btn { font: inherit; font-weight: 500; border: 1px solid var(--line); background: var(--bg); color: var(--ink); border-radius: 9px; padding: 7px 14px; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.btn:hover { border-color: #C7C7CC; }
.btn:disabled { opacity: 0.55; cursor: progress; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { filter: brightness(1.08); }
.btn.primary.attention { box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.link { border: 0; background: none; color: var(--muted); padding: 4px 0; }
.btn.small { padding: 4px 10px; font-size: 13px; }
.btn.danger { color: var(--danger); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.demo-note { background: var(--warn-bg); color: var(--warn); padding: 10px 20px; font-size: 14px; border-bottom: 1px solid #F1DFB5; }

/* auth */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.card { background: var(--bg); border: 1px solid var(--line); border-radius: 16px; }
.auth-card { width: min(400px, 100%); padding: 32px; display: flex; flex-direction: column; gap: 14px; }
.auth-card h1 { font-size: 26px; letter-spacing: -0.02em; }
.lede { color: var(--muted); margin-bottom: 6px; }
label { display: flex; flex-direction: column; gap: 5px; font-size: 13px; font-weight: 500; color: var(--ink-2); }
input, select { font: inherit; font-size: 15px; color: var(--ink); background: var(--bg); border: 1px solid #D2D2D7; border-radius: 9px; padding: 8px 10px; width: 100%; }
input[readonly] { background: var(--soft); color: var(--muted); }
.form-error { color: var(--danger); font-size: 13px; min-height: 1em; }
.form-error:empty { display: none; }

/* top bar */
.topbar { position: sticky; top: 0; z-index: 3; display: flex; align-items: center; gap: 18px; padding: 12px 24px; background: rgba(255,255,255,0.92); backdrop-filter: saturate(180%) blur(12px); border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.brand { display: flex; flex-direction: column; line-height: 1.2; }
.brand strong { font-size: 17px; }
.publish-state { color: var(--muted); font-size: 13px; display: flex; align-items: center; gap: 8px; flex: 1; min-width: 200px; }
.top-actions { display: flex; align-items: center; gap: 8px; }
.account { position: relative; }
.account summary { list-style: none; }
.account summary::-webkit-details-marker { display: none; }
.menu { position: absolute; right: 0; top: calc(100% + 6px); background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: 6px; min-width: 230px; box-shadow: 0 10px 30px rgba(0,0,0,0.08); display: flex; flex-direction: column; }
.menu button, .menu-file { font: inherit; font-size: 14px; font-weight: 400; color: var(--ink); text-align: left; background: none; border: 0; border-radius: 7px; padding: 8px 10px; cursor: pointer; display: block; }
.menu button:hover, .menu-file:hover { background: var(--soft); }
.menu hr { border: 0; border-top: 1px solid var(--line); margin: 4px 0; }
.menu [hidden] { display: none; }

.pill { display: inline-block; font-size: 12px; font-weight: 600; padding: 2px 9px; border-radius: 99px; white-space: nowrap; }
.pill.ok { background: var(--ok-bg); color: var(--ok); }
.pill.warn { background: var(--warn-bg); color: var(--warn); }
.pill.muted { background: var(--soft); color: var(--muted); }

/* list */
.content { max-width: 1200px; margin: 0 auto; padding: 24px; }
.toolbar { display: flex; gap: 12px; align-items: center; margin-bottom: 16px; flex-wrap: wrap; }
.toolbar input[type=search] { flex: 1; min-width: 200px; }
.segmented { display: inline-flex; background: #E9E9ED; border-radius: 10px; padding: 3px; }
.segmented button { font: inherit; font-size: 14px; border: 0; background: none; padding: 5px 14px; border-radius: 8px; cursor: pointer; color: var(--ink-2); }
.segmented button.is-on { background: var(--bg); box-shadow: 0 1px 3px rgba(0,0,0,0.1); font-weight: 600; }
.table-wrap { background: var(--bg); border: 1px solid var(--line); border-radius: 14px; overflow-x: auto; }
table.list { width: 100%; border-collapse: collapse; }
.list th { text-align: left; font-size: 12px; font-weight: 600; color: var(--muted); padding: 10px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.list td { padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
.list tr:last-child td { border-bottom: 0; }
.list td small { display: block; color: var(--muted); font-size: 13px; }
.list td small.tag { display: inline-block; margin: 3px 0 0 6px; border: 1px solid var(--line); border-radius: 99px; padding: 0 7px; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; }
.list td.date { white-space: nowrap; }
.list td.title span { font-weight: 600; }
.list tr.is-hidden td { opacity: 0.55; }
.list .actions { text-align: right; white-space: nowrap; }
.status { font-size: 13px; text-transform: capitalize; }
.status.s-confirmed { color: var(--ok); } .status.s-tentative { color: var(--warn); } .status.s-draft { color: var(--muted); }
.list-empty { padding: 36px; text-align: center; color: var(--muted); }
.help { color: var(--muted); font-size: 13px; margin-top: 14px; }

/* countdowns */
.cd-admin { margin-top: 40px; }
.cd-admin-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.cd-admin-head h2 { font-size: 19px; }
.cd-admin-head .help { margin-top: 4px; }
.notice { background: var(--warn-bg); color: var(--warn); border-radius: 10px; padding: 10px 14px; font-size: 14px; margin-bottom: 12px; }

/* dialogs */
.dialog { border: 0; border-radius: 16px; padding: 0; width: min(640px, calc(100vw - 32px)); box-shadow: 0 30px 80px rgba(0,0,0,0.25); color: var(--ink); }
.dialog.narrow { width: min(500px, calc(100vw - 32px)); }
.dialog::backdrop { background: rgba(0,0,0,0.3); }
.dialog form { padding: 22px 24px; display: flex; flex-direction: column; gap: 14px; }
.dialog header { display: flex; align-items: center; justify-content: space-between; }
.dialog h2 { font-size: 19px; }
.dialog footer { display: flex; justify-content: flex-end; align-items: center; gap: 8px; }
.dialog footer .meta { margin-right: auto; font-size: 12px; color: var(--faint); }
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 14px; }
.span2 { grid-column: span 2; }
.req, .opt { font-weight: 400; font-size: 11px; color: var(--faint); margin-left: 4px; }
.req { color: var(--accent); }
label.check { flex-direction: row; align-items: flex-start; gap: 9px; font-size: 14px; flex-wrap: wrap; }
label.check input { width: auto; margin-top: 3px; }
label.check small { flex-basis: 100%; padding-left: 24px; color: var(--muted); font-weight: 400; }
.form-note { font-size: 13px; color: var(--muted); background: var(--soft); border-radius: 9px; padding: 8px 12px; }
.mono { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 13px; }
.skipped { margin: 4px 0 0; padding-left: 18px; font-size: 13px; color: var(--muted); }

.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 10px 18px; border-radius: 12px; font-size: 14px; z-index: 10; box-shadow: 0 10px 30px rgba(0,0,0,0.2); max-width: calc(100vw - 32px); }
.toast[data-kind=error] { background: var(--danger); }

@media (max-width: 700px) {
  .grid { grid-template-columns: 1fr; } .span2 { grid-column: auto; }
  .list th:nth-child(3), .list td:nth-child(3), .list th:nth-child(4), .list td:nth-child(4) { display: none; }
  .topbar { padding: 10px 14px; } .content { padding: 14px; }
}
