:root {
  --bg: #f5f7fb;
  --card: #ffffff;
  --ink: #0F1E3D;
  --ink-soft: #5B6B86;
  --line: #E3E8F2;
  --blue: #2F5BD3;
  --blue-dark: #2549B0;
  --blue-tint: #EEF2FC;
  --green: #0a8f5a;
  --green-tint: #e5f6ee;
  --red: #c8303b;
  --red-tint: #fdecee;
  --amber: #9a5b00;
  --amber-tint: #fff4e0;
  --radius: 12px;
  --sans: "Figtree", "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
}

[x-cloak] { display: none !important; }
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font-family: var(--sans); font-size: 15px; line-height: 1.5; }
::selection { background: var(--blue); color: #fff; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
.muted { color: var(--ink-soft); font-weight: 400; }
.small { font-size: 13px; }
.mono { font-family: var(--mono); }
.right { text-align: right; }
.grow { flex: 1; }
.eyebrow { font-size: 12px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--blue); margin: 0 0 6px; }
.lead { font-size: 17px; color: var(--ink-soft); max-width: 46ch; }

.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; font-size: 20px; color: var(--ink); letter-spacing: -0.02em; }
.brand:hover { text-decoration: none; }
.brand-mark { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; background: var(--blue); color: #fff; font-family: var(--mono); font-size: 16px; }

/* buttons */
.btn { font: inherit; font-weight: 600; font-size: 14px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 18px; border-radius: 999px; border: 1px solid transparent; cursor: pointer; text-decoration: none !important; transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.1s ease; }
.btn:active { transform: scale(0.98); }
.btn[disabled], .btn.is-disabled { opacity: 0.5; pointer-events: none; }
.btn-primary { background: var(--blue); color: var(--on-blue, #fff); }
.btn-primary:hover { background: var(--blue-dark); }
.btn-secondary { background: var(--blue-tint); color: var(--blue); }
.btn-secondary:hover { background: #d6e6ff; }
.btn-ghost { background: transparent; border-color: var(--line); color: var(--ink); }
.btn-ghost:hover { border-color: var(--ink-soft); }
.btn-ghost-danger { background: transparent; border-color: var(--line); color: var(--red); }
.btn-ghost-danger:hover { border-color: var(--red); }
.btn-danger { background: var(--red); color: #fff; }
.btn-provider { background: #fff; border-color: var(--line); color: var(--ink); width: 100%; padding: 12px 18px; }
.btn-provider:hover { border-color: var(--blue); }
.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn-lg { padding: 13px 24px; font-size: 15px; }
.btn-block { width: 100%; }
.icon-btn { background: none; border: 0; color: var(--ink); cursor: pointer; padding: 6px; }

/* forms */
.input { font: inherit; width: 100%; padding: 10px 14px; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink); transition: border-color 0.15s ease, box-shadow 0.15s ease; }
.input:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(47, 91, 211, 0.15); }
.input:disabled { background: var(--bg); color: var(--ink-soft); }
.select { appearance: none; padding-right: 34px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23476788' stroke-width='3'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; }
.select-sm { width: auto; padding: 6px 30px 6px 12px; font-size: 13px; border-radius: 999px; }
.field { display: flex; flex-direction: column; gap: 6px; font-weight: 600; font-size: 14px; }
.hint { font-size: 13px; font-weight: 400; color: var(--ink-soft); min-height: 20px; }
.hint .ok { color: var(--green); }
.hint .bad { color: var(--red); }
.prefix-input { display: flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: #fff; }
.prefix-input:focus-within { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(47, 91, 211, 0.15); }
.prefix { padding: 10px 0 10px 14px; color: var(--ink-soft); font-weight: 400; white-space: nowrap; max-width: 55%; overflow: hidden; text-overflow: ellipsis; direction: rtl; }
.prefix-input input { flex: 1; border: 0; padding: 10px 14px 10px 2px; font: inherit; outline: none; min-width: 0; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.stack-sm { display: flex; flex-direction: column; gap: 10px; }
.row-gap { display: flex; gap: 10px; align-items: center; }
.row-gap.wrap { flex-wrap: wrap; }
.divider { display: flex; align-items: center; gap: 12px; color: var(--ink-soft); font-size: 13px; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }

.alert { padding: 12px 14px; border-radius: 10px; font-size: 14px; margin: 0 0 16px; }
.alert-error { background: var(--red-tint); color: var(--red); }
.alert-warn { background: var(--amber-tint); color: var(--amber); }
.alert-ok { background: var(--green-tint); color: var(--green); }

/* centered pages */
.center-body { min-height: 100vh; display: grid; place-items: center; padding: 32px 16px; background: radial-gradient(1200px 500px at 50% -10%, #dfeaff 0%, var(--bg) 60%); }
.center-card { width: 100%; max-width: 440px; background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 36px; box-shadow: 0 20px 50px -30px rgba(11, 53, 88, 0.35); animation: rise 0.45s ease both; }
.center-card.wide { max-width: 560px; }
.center-card .brand { margin-bottom: 28px; }
.h-title { font-size: 26px; line-height: 1.2; letter-spacing: -0.02em; margin: 0 0 8px; }
.status-code { font-family: var(--mono); font-size: 13px; color: var(--ink-soft); margin: 0; }
.dev-box { margin-top: 28px; padding: 16px; border: 1px dashed #b9c6d8; border-radius: 12px; background: #fafcff; display: flex; flex-direction: column; gap: 12px; }
.dev-title { margin: 0; font-weight: 700; font-size: 13px; }
.chip { display: inline-block; padding: 6px 12px; border-radius: 999px; background: var(--blue-tint); font-weight: 600; font-size: 13px; }

/* landing */
.site-top { display: flex; justify-content: space-between; align-items: center; padding: 20px clamp(20px, 5vw, 64px); }
.landing { display: grid; grid-template-columns: 1.1fr 1fr; gap: 56px; align-items: center; padding: 64px clamp(20px, 5vw, 64px) 96px; max-width: 1240px; }
.landing h1 { font-size: clamp(2.4rem, 5vw, 3.75rem); line-height: 1.05; letter-spacing: -0.035em; margin: 0 0 20px; }
.landing-copy { animation: rise 0.5s ease both; }
.landing-card { background: #fff; border: 1px solid var(--line); border-radius: 20px; padding: 24px; box-shadow: 0 30px 60px -35px rgba(11, 53, 88, 0.4); animation: rise 0.6s 0.1s ease both; }
.mock-head { display: flex; gap: 12px; align-items: center; margin-bottom: 20px; }
.mock-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.mock-day { display: flex; flex-direction: column; gap: 6px; font-size: 12px; font-weight: 600; text-align: center; }
.mock-day i { font-style: normal; border: 1px solid var(--blue); color: var(--blue); border-radius: 8px; padding: 6px 0; }
.mock-day i.pick { background: var(--blue); color: #fff; }

/* app shell */
.app-shell { display: grid; grid-template-columns: 260px 1fr; min-height: 100vh; }
.mobile-bar { display: none; }
.sidebar { background: #fff; border-right: 1px solid var(--line); padding: 22px 16px; display: flex; flex-direction: column; gap: 20px; position: sticky; top: 0; height: 100vh; }
.sidebar > .brand { padding: 0 8px; }
.ws-chip { display: flex; gap: 10px; align-items: center; padding: 10px; border: 1px solid var(--line); border-radius: 12px; }
.ws-initial { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 9px; background: var(--ink); color: #fff; font-weight: 700; }
.ws-chip-name { font-weight: 700; font-size: 14px; }
.ws-chip-slug { font-family: var(--mono); font-size: 12px; color: var(--ink-soft); }
.nav { display: flex; flex-direction: column; gap: 2px; flex: 1; overflow-y: auto; }
.nav-label { font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-soft); padding: 16px 12px 6px; }
.nav-link { display: flex; align-items: center; justify-content: space-between; padding: 9px 12px; border-radius: 10px; color: var(--ink); font-weight: 600; font-size: 14px; transition: background-color 0.15s ease, color 0.15s ease; }
.nav-link:hover { background: var(--bg); text-decoration: none; }
.nav-link.active { background: var(--blue-tint); color: var(--blue); }
.soon { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; padding: 2px 7px; border-radius: 999px; background: var(--bg); color: var(--ink-soft); }
.soon.big { font-size: 12px; padding: 5px 12px; background: var(--blue-tint); color: var(--blue); }
.sidebar-foot { display: flex; flex-direction: column; gap: 12px; border-top: 1px solid var(--line); padding-top: 16px; }
.me { display: flex; align-items: center; gap: 10px; min-width: 0; }
.me-text { min-width: 0; flex: 1; }
.me-name { font-weight: 700; font-size: 14px; }
.me-email { font-size: 12px; color: var(--ink-soft); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.avatar { display: grid; place-items: center; flex: none; width: 34px; height: 34px; border-radius: 50%; background: var(--blue-tint); color: var(--blue); font-weight: 700; font-size: 14px; }
.app-main { padding: 40px clamp(20px, 4vw, 56px) 80px; max-width: 1120px; width: 100%; animation: rise 0.35s ease both; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 28px; }
.h-page { font-size: clamp(1.75rem, 3vw, 2.25rem); letter-spacing: -0.025em; margin: 0; line-height: 1.15; }
.h-page + .muted, .page-head .muted { margin: 6px 0 0; }
.h-section { font-size: 17px; margin: 0 0 16px; }
.h-sub { font-size: 15px; margin: 32px 0 12px; }
.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; margin-bottom: 24px; }
.panel.narrow { max-width: 620px; }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 8px; }
.panel-head .h-section { margin: 0; }
.empty-state { text-align: left; padding: 40px 32px; }
.empty { color: var(--ink-soft); font-size: 14px; }

.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; display: flex; flex-direction: column; gap: 4px; }
.stat-label { font-size: 12px; font-weight: 600; color: var(--ink-soft); text-transform: uppercase; letter-spacing: 0.06em; }
.stat-value { font-size: 26px; font-weight: 800; letter-spacing: -0.02em; }
.stat-value.small { font-size: 16px; padding-top: 8px; }

.checklist { list-style: none; margin: 0; padding: 0; }
.checklist li { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); font-weight: 600; }
.checklist li::before { content: ""; width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--line); flex: none; }
.checklist li.done::before { background: var(--green); border-color: var(--green); box-shadow: inset 0 0 0 3px #fff; }
.checklist li.later { color: var(--ink-soft); }
.checklist a { color: var(--ink); }

/* members */
.invite-form { display: grid; grid-template-columns: 1fr 160px auto; gap: 10px; }
.seat-badge { background: var(--blue-tint); color: var(--blue); padding: 6px 14px; border-radius: 999px; font-size: 14px; }
.invite-link { background: var(--green-tint); border-radius: 12px; padding: 14px 16px; margin: 12px 0 8px; animation: rise 0.3s ease both; }
.invite-link p { margin: 0 0 10px; font-size: 14px; }
.copy-row { display: flex; gap: 8px; }
.copy-row .input { font-size: 12px; }
.copy-row .btn { white-space: nowrap; flex: none; }
.table-wrap { overflow-x: auto; margin-top: 8px; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-size: 12px; font-weight: 600; color: var(--ink-soft); text-transform: uppercase; letter-spacing: 0.05em; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.table td { padding: 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.person { display: flex; gap: 10px; align-items: center; }
.person-name { font-weight: 700; }
.row-actions { display: inline-flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; }
.confirm-row { display: inline-flex; gap: 6px; }
.role-badge { display: inline-block; font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 999px; background: var(--bg); color: var(--ink-soft); }
.role-owner { background: #0F1E3D; color: #fff; }
.role-admin { background: var(--blue-tint); color: var(--blue); }
.status-pill { font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 999px; }
.status-pill.on { background: var(--green-tint); color: var(--green); }
.status-pill.bad { background: var(--red-tint); color: var(--red); }

/* htmx + toasts */
.spinner { width: 14px; height: 14px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin 0.7s linear infinite; }
.htmx-indicator { display: none; }
.htmx-request .htmx-indicator, .htmx-request.htmx-indicator { display: inline-block; }
.htmx-swapping { opacity: 0.5; transition: opacity 0.15s ease; }
.toasts { position: fixed; right: 20px; bottom: 20px; display: flex; flex-direction: column; gap: 8px; z-index: 50; max-width: min(420px, calc(100vw - 40px)); }
.toast { background: var(--ink); color: #fff; padding: 12px 16px; border-radius: 12px; font-size: 14px; font-weight: 500; box-shadow: 0 12px 30px -12px rgba(11, 53, 88, 0.5); }
.toast.success { background: var(--green); }
.toast.error { background: var(--red); }

@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 960px) {
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .landing { grid-template-columns: 1fr; padding-top: 24px; }
}
@media (max-width: 860px) {
  .app-shell { grid-template-columns: 1fr; }
  .mobile-bar { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 30; }
  .sidebar { position: fixed; inset: 0 auto 0 0; width: 280px; z-index: 40; transform: translateX(-100%); transition: transform 0.2s ease; }
  .sidebar.open { transform: none; box-shadow: 20px 0 40px -20px rgba(11, 53, 88, 0.4); }
  .scrim { position: fixed; inset: 0; background: rgba(11, 53, 88, 0.3); z-index: 35; }
  .app-main { padding-top: 24px; }
  .invite-form { grid-template-columns: 1fr; }
  .center-card { padding: 28px 22px; }
}

/* phase 2: scheduling */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.grid-q { display: grid; grid-template-columns: 1fr 150px auto auto; gap: 8px; align-items: center; }
.question { display: flex; flex-direction: column; gap: 8px; padding: 12px; border: 1px dashed var(--line); border-radius: 10px; }
.check { display: inline-flex; gap: 8px; align-items: center; font-weight: 500; font-size: 14px; }
.input-sm { padding: 6px 10px; font-size: 13px; width: auto; }
.chip-on { background: var(--blue); color: #fff; }
.swatches { display: flex; gap: 10px; flex-wrap: wrap; }
.swatch input { position: absolute; opacity: 0; }
.swatch span { display: block; width: 28px; height: 28px; border-radius: 50%; background: var(--c); cursor: pointer; box-shadow: 0 0 0 2px #fff, 0 0 0 3px transparent; transition: box-shadow 0.15s ease; }
.swatch input:checked + span { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--c); }
.et-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 18px; }
.et-card { background: #fff; border: 1px solid var(--line); border-top: 5px solid var(--c); border-radius: var(--radius); padding: 18px 20px; display: flex; flex-direction: column; gap: 6px; transition: opacity 0.2s ease; }
.et-card.off { opacity: 0.6; }
.et-card h3 { margin: 0; font-size: 17px; }
.et-card p { margin: 0; }
.et-top { display: flex; justify-content: space-between; align-items: center; }
.et-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; padding-top: 12px; border-top: 1px solid var(--line); }
.switch { width: 40px; height: 22px; border-radius: 999px; border: 0; background: var(--line); position: relative; cursor: pointer; transition: background-color 0.15s ease; }
.switch span { position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform 0.15s ease; }
.switch.on { background: var(--green); }
.switch.on span { transform: translateX(18px); }
.week { display: flex; flex-direction: column; }
.week-row { display: flex; gap: 14px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.day-name { width: 80px; font-weight: 700; }
.ranges { display: flex; flex-direction: column; gap: 6px; flex: 1; min-width: 220px; }
.range { display: inline-flex; gap: 6px; align-items: center; }
.tabs-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.tabs { display: inline-flex; background: var(--bg); border-radius: 999px; padding: 4px; }
.tab { border: 0; background: none; font: inherit; font-weight: 600; font-size: 13px; padding: 7px 16px; border-radius: 999px; cursor: pointer; color: var(--ink-soft); }
.tab.on { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(11, 53, 88, 0.15); }
.booking-list { list-style: none; margin: 0; padding: 0; }
.booking-link { display: grid; grid-template-columns: 12px minmax(220px, 1.2fr) 1fr auto; gap: 14px; align-items: center; padding: 14px 6px; border-bottom: 1px solid var(--line); color: var(--ink); }
.booking-link:hover { background: var(--bg); text-decoration: none; }
.dot { width: 10px; height: 10px; border-radius: 50%; }
.kv { display: grid; grid-template-columns: 140px 1fr; gap: 10px 16px; margin: 0; }
.kv dt { color: var(--ink-soft); font-size: 13px; font-weight: 600; }
.kv dd { margin: 0; }
.public-body { min-height: 100vh; background: var(--bg); }
.pub-wrap { max-width: 1020px; margin: 0 auto; padding: 48px 16px; }
.pub-card { background: #fff; border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 20px 50px -35px rgba(11, 53, 88, 0.35); animation: rise 0.4s ease both; }
.host-card { max-width: 620px; margin: 0 auto; padding: 36px; text-align: center; }
.avatar-lg { width: 64px; height: 64px; font-size: 26px; margin: 0 auto 12px; }
.pub-et-list { display: flex; flex-direction: column; gap: 10px; margin-top: 24px; text-align: left; }
.pub-et { display: flex; flex-direction: column; padding: 16px 18px; border: 1px solid var(--line); border-left: 5px solid var(--c); border-radius: 12px; color: var(--ink); transition: border-color 0.15s ease; }
.pub-et:hover { border-color: var(--c); text-decoration: none; }
.pub-foot { text-align: center; color: var(--ink-soft); font-size: 13px; margin-top: 20px; }
.event-card { display: grid; grid-template-columns: 300px 1fr; border-top: 6px solid var(--c); }
.event-info { padding: 28px; border-right: 1px solid var(--line); display: flex; flex-direction: column; gap: 8px; }
.event-info .meta { margin: 0; font-weight: 600; color: var(--ink-soft); }
.event-picker { padding: 28px; }
.tz-field { max-width: 340px; margin-bottom: 18px; }
.picker-grid { display: grid; grid-template-columns: 1fr 180px; gap: 24px; }
.cal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.cal-head .icon-btn { font-size: 22px; }
.cal-head .icon-btn[disabled] { opacity: 0.3; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; text-align: center; }
.cal-dow { font-size: 11px; font-weight: 700; color: var(--ink-soft); }
.cal-day { aspect-ratio: 1; display: grid; place-items: center; border-radius: 50%; font-weight: 600; font-size: 14px; color: #a3b1c2; border: 0; background: none; font-family: inherit; }
.cal-day.avail { background: var(--blue-tint); color: var(--blue); cursor: pointer; transition: background-color 0.15s ease, color 0.15s ease; }
.cal-day.avail:hover, .cal-day.sel { background: var(--blue); color: #fff; }
.slots { display: flex; flex-direction: column; gap: 8px; max-height: 420px; overflow-y: auto; }
.slots-date { font-weight: 700; margin: 0 0 4px; }
.slot { display: block; text-align: center; padding: 11px; border: 1px solid var(--blue); border-radius: 10px; color: var(--blue); font-weight: 700; transition: background-color 0.15s ease, color 0.15s ease; }
.slot:hover { background: var(--blue); color: #fff; text-decoration: none; }
.summary { text-align: left; border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; margin: 20px 0; }
.summary p { margin: 6px 0; }
.manage-links { display: flex; flex-direction: column; gap: 8px; align-items: center; margin-bottom: 16px; }
@media (max-width: 860px) {
  .event-card { grid-template-columns: 1fr; }
  .event-info { border-right: 0; border-bottom: 1px solid var(--line); }
  .picker-grid, .grid-2, .grid-3, .grid-q { grid-template-columns: 1fr; }
  .booking-link { grid-template-columns: 12px 1fr; }
}
.kv-row { display: contents; }

/* calendars */
.provider-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.provider-card { border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; display: flex; flex-direction: column; gap: 12px; align-items: flex-start; transition: border-color 0.15s ease; }
.provider-card:hover { border-color: var(--blue); }
.provider-card.dev { border-style: dashed; }
.provider-card form { width: 100%; }
.provider-name { font-weight: 700; }
.help summary { cursor: pointer; font-size: 13px; color: var(--blue); font-weight: 600; }
.help ol { padding-left: 18px; margin: 8px 0; color: var(--ink-soft); }
.conn { border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; margin-top: 14px; }
.conn-bad { border-color: var(--red); background: var(--red-tint); }
.conn-head { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; align-items: center; }
.conn-email { font-weight: 700; }
.conn-error { color: var(--red); margin: 8px 0 0; }
.cal-list { list-style: none; padding: 0; margin: 12px 0 0; display: flex; flex-direction: column; gap: 8px; }
.cal-list li { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.cal-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.chip-warn { background: var(--amber-tint); color: var(--amber); }
.soon-blue { background: var(--blue-tint); color: var(--blue); }

.segmented { display: inline-flex; gap: 4px; padding: 4px; border: 1px solid var(--line); border-radius: 999px; background: var(--bg); margin: 8px 0 16px; }
.seg { border: 0; background: transparent; color: var(--ink-soft); font: inherit; font-weight: 600; padding: 8px 18px; border-radius: 999px; cursor: pointer; transition: background-color .15s, color .15s; }
.seg.active { background: var(--card); color: var(--blue); box-shadow: 0 1px 3px rgba(11,53,88,.12); }
.price-line { font-size: 15px; margin: 0 0 16px; }
.price-line strong { font-size: 28px; color: var(--ink); margin-right: 4px; }

.row-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.row-list .row { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.row-list .row:last-child { border-bottom: 0; }
.row-title { font-weight: 600; color: var(--ink); margin-right: 6px; }
.badge { display: inline-block; font-size: 12px; font-weight: 600; padding: 2px 10px; border-radius: 999px; background: var(--bg); border: 1px solid var(--line); color: var(--ink-soft); }
.badge-muted { opacity: .7; }
.panel .page-head { margin-bottom: 8px; }

.slot-badge { display: block; font-size: 11px; font-weight: 500; opacity: .75; margin-top: 2px; }
.slot-full { border-style: dashed; opacity: .85; }

.load-row { display: grid; grid-template-columns: minmax(140px, 220px) 1fr minmax(150px, auto); gap: 12px; align-items: center; }
.load-track { position: relative; height: 14px; border-radius: 7px; background: rgba(11, 53, 88, .08); }
.load-bar { height: 100%; border-radius: 7px; background: #2F5BD3; transition: width .3s ease; }
.load-fair { position: absolute; top: -4px; bottom: -4px; width: 2px; background: #0F1E3D; }
.load-imbalanced .load-bar { background: #ff4f00; }
.load-former { opacity: .5; }
.load-former .load-bar { background: #8a99a8; }
.badge-warn { background: #fff1e6; color: #b23a00; }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
[data-testid="routing-editor"] .row-actions { display: flex; justify-content: flex-start; align-items: center; }
[data-testid="routing-editor"] .row-actions .input { width: auto; min-width: 180px; flex: 0 1 auto; }
[data-testid="routing-editor"] .card { margin-top: 12px; }
.check { display: inline-flex; align-items: center; gap: 6px; margin-right: 12px; }
.alert-warn { background: #fff7e6; color: #8a5a00; border: 1px solid #f5d28a; }

/* Embed mode */
body.embed { min-height: 0; }
.embed .pub-wrap { padding: 8px; max-width: none; }
.embed .pub-foot { display: none; }
.embed .pub-card { box-shadow: none; }
.embed-hide-details .event-card { grid-template-columns: 1fr; }
.embed-hide-details .event-info { display: none; }
.modal-backdrop { position: fixed; inset: 0; background: rgba(11,53,88,.45); z-index: 1000; display: flex; align-items: center; justify-content: center; padding: 24px; }
.modal { background: var(--card); border-radius: var(--radius); padding: 20px; box-shadow: 0 20px 60px rgba(0,0,0,.25); }
.embed-modal { width: min(1100px, 100%); max-height: 92vh; overflow: auto; }
.embed-grid { display: grid; grid-template-columns: 360px 1fr; gap: 20px; margin-top: 12px; }
.embed-colors { display: flex; gap: 12px; }
.embed-colors input[type=color] { width: 56px; height: 34px; border: 1px solid var(--line); border-radius: 8px; background: none; }
.embed-snippet { font-size: 12px; }
.embed-preview iframe { width: 100%; height: 520px; border: 1px solid var(--line); border-radius: 10px; }
.seg { display: flex; gap: 6px; flex-wrap: wrap; }
[x-cloak] { display: none !important; }
@media (max-width: 860px) { .embed-grid { grid-template-columns: 1fr; } }
.embed-primary .event-card, .embed-primary .pub-card { --c: var(--embed-primary) !important; }
.badge-warn { background: #fff1e0; color: #a14a00; }
[data-testid="workflow-editor"] .row-actions { display: flex; justify-content: flex-start; align-items: center; flex-wrap: wrap; }
[data-testid="workflow-editor"] .row-actions .input { width: auto; min-width: 160px; flex: 0 1 auto; }
[data-testid="workflow-editor"] .card { margin-top: 12px; }
[data-testid="workflow-preview"] pre { white-space: pre-wrap; word-break: break-word; }

.hp-field { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.legal-doc h2 { font-size: 17px; margin: 18px 0 6px; }
.legal-doc p { color: var(--ink-soft); line-height: 1.6; }

.pub-brand { display: flex; justify-content: center; padding: 24px 16px 0; }
.pub-brand img { height: 40px; max-width: 220px; object-fit: contain; }
.embed .pub-brand { padding-top: 12px; }
.brand-logo { height: 30px; width: auto; display: block; }
.brand-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px; align-items: start; }
.brand-logo-current { max-height: 64px; max-width: 260px; width: auto; object-fit: contain; background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 6px; }
.brand-grid input[type=color] { width: 44px; height: 38px; padding: 2px; border: 1px solid var(--line); border-radius: 8px; background: #fff; cursor: pointer; }
.brand-grid .field .input.mono { width: 110px; }
.text-danger { color: var(--red); }
.bp-frame { border: 1px solid var(--line); border-radius: 12px; padding: 20px; display: flex; flex-direction: column; align-items: center; gap: 14px; }
.bp-logo { max-height: 32px; width: auto; }
.bp-card { width: 100%; max-width: 320px; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.bp-slots { display: flex; gap: 8px; }
.bp-slots span { flex: 1; text-align: center; border: 1px solid; border-radius: 8px; padding: 6px 0; font-weight: 600; font-size: 13px; }
.bp-btn { display: inline-block; align-self: flex-start; padding: 8px 16px; border-radius: 999px; font-weight: 600; font-size: 13px; }
.ep-frame { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: #f5f7fb; }
.ep-head { padding: 14px 18px; border-bottom: 1px solid var(--line); }
.ep-head img { max-height: 28px; width: auto; }
.ep-body { background: #fff; margin: 14px; border-radius: 10px; padding: 16px; display: flex; flex-direction: column; gap: 8px; }
@media (max-width: 900px) { .brand-grid { grid-template-columns: 1fr; } }
.badge-amber { background: var(--amber-tint); color: var(--amber); border-color: transparent; }
.away-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.away-list li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; }
.pub-away { margin: 0 0 12px; padding: 10px 14px; border-radius: 10px; background: var(--amber-tint); color: var(--amber); font-weight: 600; grid-column: 1 / -1; }
.an-filters { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; margin-bottom: 20px; }
.an-filters .field { min-width: 150px; }
.an-kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; margin-bottom: 20px; }
.an-kpi { display: flex; flex-direction: column; gap: 4px; }
.an-delta { font-size: 12px; font-weight: 600; }
.an-up { color: var(--green); } .an-down { color: var(--red); } .an-flat { color: var(--ink-soft); }
.an-chart { width: 100%; height: auto; }
.an-chart .grid { stroke: var(--line); } .an-chart .ax { font-size: 10px; fill: var(--ink-soft); }
.bar-ok { fill: var(--blue); } .bar-ns { fill: #C98A12; } .bar-cx { fill: #C2413B; opacity: .75; }
.an-legend { font-size: 12px; color: var(--ink-soft); display: flex; gap: 6px; align-items: center; }
.sw { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-left: 8px; }
.sw-ok { background: var(--blue); } .sw-ns { background: #C98A12; } .sw-cx { background: #C2413B; opacity: .75; }
.an-two { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 16px; margin: 20px 0; }
.heat { display: grid; gap: 3px; overflow-x: auto; }
.heat-row { display: grid; grid-template-columns: 36px repeat(24, minmax(16px, 1fr)); gap: 3px; align-items: center; }
.heat-row > span:first-child { font-size: 11px; color: var(--ink-soft); }
.heat-head span { font-size: 10px; color: var(--ink-soft); text-align: center; }
.heat-cell { height: 22px; border-radius: 4px; font-size: 10px; text-align: center; line-height: 22px; color: #fff;
  background: color-mix(in srgb, var(--blue) calc(var(--a) * 100%), var(--bg)); }
.table.compact td, .table.compact th { padding: 6px 8px; }
@media (max-width: 1000px) { .an-two { grid-template-columns: 1fr; } }
.an-two > *, .an-kpis > * { min-width: 0; }
@media (max-width: 640px) {
  .an-filters .field, .an-filters .an-apply { flex: 1 1 100%; min-width: 0; }
  .an-filters .input { width: 100%; }
  .an-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .page-head { flex-wrap: wrap; }
}
.app-main { min-width: 0; }
.an-two .panel, .an-two section { min-width: 0; overflow: hidden; }
@media (max-width: 640px) {
  .heat-row { grid-template-columns: 30px repeat(24, minmax(11px, 1fr)); gap: 2px; }
  .heat-cell { height: 16px; line-height: 16px; font-size: 0; }
}
.an-table { min-width: 0; overflow-x: auto; }
.pub-away-note { grid-column: 1 / -1; margin: 0 0 8px; font-size: 13px; color: var(--ink-soft); }
.away-sugg { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 10px 12px; border: 1px dashed var(--line); border-radius: 10px; }
.an-click { color: inherit; text-decoration: none; display: block; }
.an-click:hover .stat-value, a.an-row:hover { color: var(--blue); }
.an-chart a:focus rect, .an-chart a:hover rect { stroke: var(--ink); stroke-width: 1.5; }
a.heat-cell { text-decoration: none; }
a.heat-cell:focus-visible { outline: 2px solid var(--ink); }
.import-logo { display: inline-flex; align-items: center; gap: 8px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; background: #fff; cursor: pointer; }
.import-logo img { max-width: 160px; object-fit: contain; background: repeating-conic-gradient(#f1f3f8 0 25%, #fff 0 50%) 0 0/12px 12px; }
.import-swatch { display: inline-flex; align-items: center; gap: 6px; font: 600 12px var(--mono, monospace); }
.import-swatch i { width: 22px; height: 22px; border-radius: 6px; border: 1px solid var(--line); }
.coverage-risk { background: #FFF7E6; }
.weekly-frame { width: 100%; height: 560px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.weekly-text { white-space: pre-wrap; background: #f7f8fb; padding: 12px; border-radius: 10px; font-size: 13px; max-height: 480px; overflow: auto; }
.brand-history { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.brand-history li { padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; }
.hist-swatch { width: 22px; height: 22px; border-radius: 6px; display: inline-block; border: 1px solid var(--line); }
.tabs { display: inline-flex; gap: 4px; flex-wrap: wrap; }
.tab { border: 1px solid var(--line); background: #fff; padding: 6px 10px; border-radius: 8px; cursor: pointer; font: inherit; font-size: 13px; }
.tab.active { background: var(--ink, #0F1E3D); color: #fff; border-color: transparent; }

/* Managed event types (templates) */
.lock-group { border: 0; padding: 0; margin: 0; min-width: 0; display: contents; }
.lock-group:disabled input, .lock-group:disabled select, .lock-group:disabled textarea, fieldset:disabled .input { opacity: .65; cursor: not-allowed; }
.lock-tag { display: inline-flex; align-items: center; gap: 4px; color: var(--muted, #5b6b86); font-weight: 600; margin: 2px 0; }
.lock-toggle { display: inline-flex; align-items: center; gap: 6px; color: var(--muted, #5b6b86); margin: 2px 0; }
.badge-managed { background: #e8eefc; color: #2F5BD3; }

/* Audit log */
.audit-table tr.clickable { cursor: pointer; }
.audit-table tr.clickable:hover { background: rgba(47, 91, 211, .05); }
.audit-table tr.row-danger td { background: #fdecec; }
.badge-danger { background: #fdecec; color: #b42318; }
.badge-warn { background: #fff4e0; color: #9a5b00; }
.drawer-backdrop { position: fixed; inset: 0; background: rgba(15, 23, 42, .35); z-index: 60; display: flex; justify-content: flex-end; }
.drawer { width: min(560px, 100%); height: 100%; overflow-y: auto; border-radius: 0; margin: 0; }
.nowrap { white-space: nowrap; }
