:root {
  --accent: #5B2A86;
  --accent-tint: #F3EEF8;
  --ink: #1C1B22;
  --ink-2: #3F3B48;
  --muted: #5F5B6B;
  --line: #E7E3EC;
  --line-2: #D9D3E2;
  --soft: #F6F4F8;
  --danger: #9F1239;
  --radius: 14px;
  font-family: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--ink);
  background: #FFFFFF;
}
* { box-sizing: border-box; }
body { margin: 0; background: #F3F1F5; }
a { color: var(--accent); }
button, input, select, textarea { font: inherit; color: inherit; }
img, svg { flex: none; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

.skip { position: absolute; left: -999px; top: 8px; background: #fff; padding: 8px 12px; border-radius: 8px; z-index: 50; }
.skip:focus { left: 8px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.app { max-width: 520px; min-height: 100vh; margin: 0 auto; background: #FFFFFF; display: flex; flex-direction: column; position: relative; }
@media (min-width: 560px) { .app { border-left: 1px solid var(--line); border-right: 1px solid var(--line); } }

/* header */
.top { position: sticky; top: 0; z-index: 10; height: 56px; display: flex; align-items: center; gap: 8px; padding: 0 12px 0 16px; background: #FFFFFF; border-bottom: 1px solid #EEEAF2; }
.brand { display: flex; align-items: baseline; gap: 8px; text-decoration: none; }
.brand__mark { font-family: "Space Grotesk", sans-serif; font-weight: 700; font-size: 22px; color: var(--accent); }
.brand__sub { font-size: 15px; font-weight: 500; color: var(--muted); }
.backbtn { height: 44px; display: flex; align-items: center; gap: 4px; padding: 0 8px 0 0; border: 0; background: none; font-size: 15px; font-weight: 600; cursor: pointer; }
.push { margin-left: auto; }
.icon-btn { width: 44px; height: 44px; border: 0; background: none; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; color: var(--ink); cursor: pointer; text-decoration: none; }
.icon-btn--accent { background: var(--accent); color: #fff; width: 48px; height: 48px; }
.flip svg { transform: scaleX(-1); }

/* tabs */
.main { flex: 1; padding-bottom: 92px; }
.tabs { position: fixed; bottom: 0; left: 50%; transform: translateX(-50%); width: 100%; max-width: 520px; height: 76px; display: flex; background: #FFFFFF; border-top: 1px solid #EEEAF2; padding: 4px 4px calc(12px + env(safe-area-inset-bottom)); z-index: 10; }
.tab { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; font-size: 12px; font-weight: 600; color: var(--muted); text-decoration: none; }
.tab.is-on { color: var(--accent); }

/* layout */
.screen { padding: 20px 16px 24px; display: flex; flex-direction: column; gap: 16px; }
.stack-4, .stack-8, .stack-10, .stack-12, .stack-14 { display: flex; flex-direction: column; }
.stack-4 { gap: 4px; } .stack-8 { gap: 8px; } .stack-10 { gap: 10px; } .stack-12 { gap: 12px; } .stack-14 { gap: 14px; }
.row-8 { display: flex; gap: 8px; }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.grow { flex: 1; } .grow2 { flex: 2; } .center { text-align: center; } .pad-top { padding-top: 8px; } .pad-x { padding: 0 6px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }

/* type */
.h1 { margin: 0; font-family: "Space Grotesk", sans-serif; font-size: 26px; line-height: 1.15; }
.h1--big { font-size: 28px; }
.h2 { margin: 0; font-family: "Space Grotesk", sans-serif; font-size: 20px; }
.h3 { margin: 0; font-size: 16px; font-weight: 600; }
.muted { color: var(--muted); margin: 0; }
p { margin: 0; line-height: 1.5; }
.small { font-size: 14px; } .xsmall { font-size: 12px; }
.strong { font-weight: 600; } .strong-500 { font-weight: 500; }
.eyebrow { font-size: 13px; font-weight: 600; color: var(--accent); }
.body { font-size: 15px; line-height: 1.55; }
.error { color: var(--danger); }
.accent { color: var(--accent); }
.link { color: var(--accent); font-weight: 600; }
.list { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; font-size: 14px; line-height: 1.45; }

/* surfaces */
.panel { padding: 16px; border-radius: 16px; background: var(--accent-tint); line-height: 1.5; }
.box { border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; background: #fff; }
.box--list { padding: 0; }
.note { padding: 14px 16px; border-radius: var(--radius); background: var(--soft); font-size: 14px; color: var(--ink-2); }
.dashed { margin: 0; padding: 14px 16px; border-radius: var(--radius); border: 1.5px dashed var(--line-2); font-size: 14px; color: var(--muted); line-height: 1.45; }
.dashed--link { display: block; border-color: var(--accent); color: var(--ink); text-decoration: none; }
.logline { padding: 10px 12px; border-radius: 10px; background: var(--soft); font-size: 13px; color: var(--ink-2); }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 16px; border-radius: 12px; border: 1.5px solid var(--line-2); background: #fff; font-size: 15px; font-weight: 600; color: var(--ink); text-decoration: none; cursor: pointer; }
.btn--primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn--primary:disabled { background: var(--line); border-color: var(--line); color: #6B6677; cursor: not-allowed; }
.btn--lg { min-height: 52px; border-radius: 14px; font-size: 16px; }
.btn--sm { min-height: 40px; padding: 0 12px; border-radius: 10px; font-size: 13px; }
.btn--left { justify-content: flex-start; }
.btn--seg { flex: 1; border-radius: 999px; }
.btn--seg.is-on { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn--outline-accent { border-color: var(--accent); color: var(--accent); }
.btn--danger { color: var(--danger); border-color: #E8C5CD; }
.btn--danger-on { background: var(--danger); border-color: var(--danger); color: #fff; }
.link-btn { min-height: 44px; border: 0; background: none; color: var(--muted); font-size: 15px; font-weight: 500; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; }
.pill { min-height: 44px; padding: 0 14px; border-radius: 999px; border: 1.5px solid var(--accent); background: #fff; color: var(--accent); font-size: 14px; font-weight: 600; cursor: pointer; }
.pill.is-on { background: var(--accent); color: #fff; }
.pill:disabled { border-color: var(--line-2); color: #8A8496; cursor: not-allowed; }

/* chips */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips--scroll { flex-wrap: nowrap; overflow-x: auto; margin: 0 -16px; padding: 0 16px 4px; }
.chip { flex: none; min-height: 40px; padding: 8px 14px; border-radius: 999px; border: 1.5px solid var(--line-2); background: #fff; font-size: 14px; font-weight: 500; cursor: pointer; text-align: left; }
.chip.is-on { background: var(--accent); border-color: var(--accent); color: #fff; }
.tag { font-size: 13px; font-weight: 500; background: #F3F0F6; border-radius: 999px; padding: 6px 10px; }
.lean { font-size: 13px; font-weight: 500; padding: 5px 10px; border-radius: 999px; background: #fff; border: 1px solid var(--line-2); }
.lean--neg { background: transparent; color: var(--muted); border: 1px dashed #C9C2D3; }
.xchip { display: inline-flex; align-items: center; gap: 2px; height: 40px; padding: 0 4px 0 14px; border-radius: 999px; background: var(--accent-tint); font-size: 14px; font-weight: 600; }
.xchip--neg { background: #fff; border: 1.5px solid var(--line-2); color: var(--muted); font-weight: 500; }
.xchip button { width: 36px; height: 36px; border: 0; background: none; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: var(--muted); cursor: pointer; }
.badge { font-size: 12px; font-weight: 600; color: #fff; background: var(--accent); border-radius: 999px; padding: 2px 8px; }

/* segmented control */
.seg { display: flex; gap: 4px; padding: 4px; background: #F3F0F6; border-radius: 12px; }
.seg__btn { flex: 1; height: 40px; border: 0; border-radius: 9px; background: transparent; color: var(--muted); font-size: 14px; font-weight: 600; cursor: pointer; }
.seg__btn.is-on { background: #fff; color: var(--ink); box-shadow: 0 1px 2px rgba(28, 27, 34, .14); }

/* event card */
.card { display: flex; gap: 12px; padding: 12px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; text-decoration: none; color: var(--ink); }
.card--pinned { border: 1.5px solid var(--accent); }
.datebox { width: 56px; flex: none; border-radius: 10px; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 8px 0; }
.datebox__dow { font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; }
.datebox__day { font-family: "Space Grotesk", sans-serif; font-size: 22px; font-weight: 700; line-height: 1.1; }
.card__body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.card__type { font-size: 12px; font-weight: 600; }
.card__title { font-size: 16px; font-weight: 600; color: var(--ink); }
.card__meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13px; color: var(--muted); }
.reason { font-size: 13px; font-weight: 500; line-height: 1.35; color: var(--accent); }
.pick { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.pick .card { border: 0; border-radius: 0; }
.pick__actions { display: flex; border-top: 1px solid #F0EDF3; }
.pick__actions button { flex: 1; height: 44px; border: 0; background: #fff; font-size: 13px; font-weight: 600; color: var(--muted); cursor: pointer; }
.pick__actions button + button { border-left: 1px solid #F0EDF3; }
.pick__actions .accent { color: var(--accent); }

/* calendar */
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.cal__dow { text-align: center; font-size: 12px; font-weight: 600; color: var(--muted); padding: 4px 0; }
.cal__day { height: 44px; border: 0; border-radius: 10px; background: transparent; color: var(--muted); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 14px; cursor: pointer; }
.cal__day.has { background: var(--accent-tint); color: var(--ink); font-weight: 700; }
.cal__day.is-on { background: var(--accent); color: #fff; font-weight: 700; }
.dot { width: 5px; height: 5px; border-radius: 50%; background: var(--accent); }
.cal__day.is-on .dot { background: #fff; }

/* detail */
.cover { padding: 24px 20px; display: flex; flex-direction: column; gap: 6px; }
.info { display: flex; gap: 12px; align-items: flex-start; font-size: 15px; line-height: 1.4; }
.info svg { color: var(--muted); margin-top: 1px; }
.slot { display: flex; align-items: center; gap: 12px; min-height: 52px; border-top: 1px solid #F0EDF3; padding-top: 6px; }

/* setup */
.bars { display: flex; gap: 6px; }
.bar { flex: 1; height: 4px; border-radius: 999px; background: var(--line); }
.bar.is-on { background: var(--accent); }
.rank { position: relative; display: flex; flex-direction: column; gap: 6px; min-height: 138px; padding: 12px; border-radius: 14px; border: 2px solid transparent; text-align: left; cursor: pointer; color: var(--ink-2); }
.rank.is-on { border-color: var(--accent); }
.rank__title { font-size: 15px; font-weight: 600; line-height: 1.25; color: var(--ink); }
.rank__num { position: absolute; top: 8px; right: 8px; width: 28px; height: 28px; border-radius: 50%; background: var(--accent); color: #fff; font-size: 14px; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.availgrid { display: grid; grid-template-columns: 52px repeat(3, minmax(0, 1fr)); gap: 6px; align-items: center; font-size: 14px; }
.slotbtn { height: 44px; border-radius: 10px; border: 1.5px solid var(--line-2); background: #fff; display: flex; align-items: center; justify-content: center; cursor: pointer; }
.slotbtn.is-on { background: var(--accent); border-color: var(--accent); color: #fff; }
.check { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 14px; border: 1.5px solid var(--line-2); background: #fff; text-align: left; cursor: pointer; line-height: 1.4; }
.check.is-on { background: var(--accent-tint); border-color: var(--accent); }
.check__box { width: 22px; height: 22px; border-radius: 6px; border: 1.5px solid #B9B1C6; display: flex; align-items: center; justify-content: center; color: #fff; }
.check.is-on .check__box { background: var(--accent); border-color: var(--accent); }

/* settings */
.lrow { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; font-size: 15px; line-height: 1.4; }
.lrow + .lrow { border-top: 1px solid #F0EDF3; }
.lrow svg { color: var(--accent); margin-top: 2px; }
.lrow--switch { align-items: center; padding: 10px 14px; }
.switch { width: 52px; height: 44px; border: 0; background: none; padding: 0; display: flex; align-items: center; cursor: pointer; }
.switch::before { content: ""; }
.switch .switch__knob { display: block; width: 46px; height: 28px; border-radius: 999px; background: #B9B1C6; position: relative; }
.switch .switch__knob::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(28, 27, 34, .25); transition: left .15s; }
.switch.is-on .switch__knob { background: var(--accent); }
.switch.is-on .switch__knob::after { left: 21px; }

/* forms */
.field { display: flex; flex-direction: column; gap: 6px; font-size: 14px; font-weight: 600; }
.field input, .field select, .field textarea, .input { min-height: 48px; border: 1.5px solid var(--line-2); border-radius: 12px; padding: 10px 14px; font-size: 16px; font-weight: 400; background: #fff; }
.input { min-width: 0; }
.checkrow { display: flex; gap: 10px; align-items: center; font-size: 15px; min-height: 44px; }
.checkrow input { width: 22px; height: 22px; accent-color: var(--accent); }

/* ask */
.bubble { align-self: flex-start; max-width: 88%; background: #F3F0F6; border-radius: 16px 16px 16px 4px; padding: 10px 14px; font-size: 15px; line-height: 1.45; }
.bubble--me { align-self: flex-end; max-width: 80%; background: var(--accent); color: #fff; border-radius: 16px 16px 4px 16px; }

/* toast */
.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: 92px; width: calc(100% - 32px); max-width: 488px; background: var(--ink); color: #fff; border-radius: 12px; padding: 12px 16px; font-size: 14px; line-height: 1.4; opacity: 0; pointer-events: none; transition: opacity .2s; z-index: 20; }
.toast.is-on { opacity: 1; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
.codeinput { font-size: 24px !important; letter-spacing: .3em; text-align: center; font-variant-numeric: tabular-nums; }

/* engine */
.stack-16 { display: flex; flex-direction: column; gap: 16px; }
.danger { color: var(--danger); }
.action { display: flex; flex-direction: column; gap: 4px; padding: 16px; border-radius: var(--radius); border: 1.5px solid var(--line-2); background: #fff; text-decoration: none; color: var(--ink); }
.action:hover { border-color: var(--accent); }
.action__title { font-size: 16px; font-weight: 700; color: var(--accent); }
.tpl { display: flex; flex-direction: column; gap: 4px; min-height: 96px; padding: 12px; border-radius: 14px; border: 1.5px solid var(--line-2); background: #fff; text-align: left; cursor: pointer; line-height: 1.35; }
.tpl:hover { border-color: var(--accent); }
.copyrow { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); background: #fff; text-align: left; cursor: pointer; line-height: 1.35; min-height: 52px; }
.dotsq { width: 32px; height: 32px; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-weight: 700; flex: none; }
.fs { border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px 16px; margin: 0; display: flex; flex-direction: column; gap: 12px; }
.fs legend { padding: 0 6px; font-weight: 700; font-size: 15px; }
.radios { display: flex; flex-wrap: wrap; gap: 8px; }
.radio { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 14px; border: 1.5px solid var(--line-2); border-radius: 999px; font-size: 14px; cursor: pointer; }
.radio:has(input:checked) { border-color: var(--accent); background: var(--accent-tint); font-weight: 600; }
.radio input { accent-color: var(--accent); }
.checkrow { align-items: flex-start; line-height: 1.4; }
.checkrow input { margin-top: 1px; flex: none; }
.slotrow { display: flex; gap: 8px; align-items: center; }
.slotrow .need { width: 72px; flex: none; }
.slotrow .need input { text-align: center; padding: 10px 6px; }
.errbox { margin: 0; padding: 12px 16px; border-radius: var(--radius); background: #FDECEF; color: #7F1030; font-size: 14px; line-height: 1.45; }
.again { display: flex; align-items: flex-start; gap: 4px; padding: 12px 8px 12px 16px; border-radius: var(--radius); border: 1.5px solid var(--accent); background: var(--accent-tint); }
.again__body { flex: 1; color: var(--ink); text-decoration: none; font-size: 15px; line-height: 1.45; }
.link-btn--left { justify-content: flex-start; gap: 5px; padding: 0; color: var(--ink); }
.series { display: inline-flex; align-items: center; gap: 4px; align-self: flex-start; font-size: 12px; font-weight: 600; color: var(--ink-2); background: #F3F0F6; border-radius: 999px; padding: 2px 8px 2px 6px; }

/* compact rows and side boxes (used on desktop) */
.stack-6 { display: flex; flex-direction: column; gap: 6px; }
.card__desc { display: none; }
.mini { display: flex; gap: 10px; align-items: center; padding: 6px; margin: 0 -6px; border-radius: 10px; text-decoration: none; color: var(--ink); }
.mini:hover { background: var(--soft); }
.mini__date { width: 44px; height: 44px; flex: none; border-radius: 9px; display: flex; flex-direction: column; align-items: center; justify-content: center; font-size: 10px; font-weight: 600; text-transform: uppercase; line-height: 1.1; }
.mini__date strong { font-family: "Space Grotesk", sans-serif; font-size: 17px; }
.mini__body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.mini__title { font-size: 14px; font-weight: 600; line-height: 1.3; }
.sidebox { border: 1px solid var(--line); border-radius: 16px; padding: 16px; background: #fff; display: flex; flex-direction: column; gap: 12px; }
.sidebox .cal__day { height: 36px; font-size: 13px; }
.top__in { display: contents; }

/* desktop */
@media (min-width: 960px) {
  body { background: #F3F1F5; }
  .app.app--desk { max-width: none; border: 0; background: #F7F5FA; }
  .top--desk { height: 64px; padding: 0; background: #fff; border-bottom: 1px solid var(--line); }
  .top--desk .top__in { display: flex; align-items: center; gap: 32px; width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 32px; }
  .topnav { display: flex; gap: 4px; }
  .topnav__link { padding: 10px 14px; border-radius: 10px; font-size: 15px; font-weight: 600; color: var(--muted); text-decoration: none; }
  .topnav__link:hover { background: var(--soft); color: var(--ink); }
  .topnav__link.is-on { background: var(--accent-tint); color: var(--accent); }
  .app--desk .main { padding-bottom: 48px; }
  .app--desk .screen { max-width: 720px; width: 100%; margin: 0 auto; padding: 32px 32px 40px; }
  .app--desk .screen--wide { max-width: 1200px; gap: 24px; }
  .h1--xl { font-size: 34px; }
  .body--lg { font-size: 17px; line-height: 1.6; }
  .split { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 32px; align-items: start; }
  .split__side { position: sticky; top: 88px; max-height: calc(100vh - 104px); overflow-y: auto; padding-bottom: 8px; }
  .cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; align-items: stretch; }
  .cards > .card, .cards > .pick, .cards > .stack-4 { height: 100%; }
  .cards .card { padding: 16px; }
  .cards .pick { display: flex; flex-direction: column; background: #fff; }
  .cards .pick .card { flex: 1; }
  .card { transition: border-color .15s, box-shadow .15s; }
  .card:hover { border-color: var(--line-2); box-shadow: 0 2px 10px rgba(28, 27, 34, .06); }
  .card__desc { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: 13px; line-height: 1.45; color: var(--ink-2); margin-top: 2px; }
  .grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
  .grid-3 .action { min-height: 120px; }
  .app--desk .cover { padding: 40px 0; }
  .app--desk .cover__in { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 32px; display: flex; flex-direction: column; gap: 8px; }
  .app--desk .cover .h1--big { font-size: 40px; }
  .app--desk .grid-2 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .app--desk .chips--scroll { flex-wrap: wrap; margin: 0; padding: 0; }
  .toast { bottom: 24px; }
  .app--desk .box, .app--desk .panel { background-clip: padding-box; }
}

/* roomier event cards */
.card { gap: 16px; padding: 16px; border-radius: 16px; }
.datebox { width: 60px; height: 72px; align-self: flex-start; border-radius: 12px; padding: 0; }
.datebox__dow { font-size: 11px; }
.datebox__day { font-size: 24px; }
.card__body { gap: 5px; padding-top: 1px; }
.card__type { font-size: 12px; letter-spacing: .02em; }
.card__title { font-size: 17px; line-height: 1.3; }
.card__body > .muted.small { font-size: 14px; line-height: 1.4; }
.card__meta { margin-top: 4px; gap: 10px; }
.series { margin-top: 2px; }
.why { display: flex; flex-direction: column; gap: 3px; margin-top: 6px; padding: 8px 12px; border-radius: 10px; background: var(--accent-tint); }
.why__line { position: relative; padding-left: 12px; font-size: 13px; line-height: 1.4; font-weight: 500; color: var(--accent); }
.why__line::before { content: ""; position: absolute; left: 0; top: .55em; width: 5px; height: 5px; border-radius: 50%; background: currentColor; opacity: .6; }
.stack-10 > .card + .card, .stack-10 > .pick + .pick { margin-top: 2px; }
.pick { border-radius: 16px; background: #fff; }
.pick__actions button { height: 48px; font-size: 14px; }
.pick__actions button:hover { background: var(--soft); }
@media (min-width: 960px) {
  .cards { gap: 20px; }
  .cards .card { padding: 20px; gap: 18px; }
  .card__desc { margin-top: 4px; font-size: 14px; line-height: 1.5; }
}
.box > div:first-child { display: flex; flex-direction: column; gap: 4px; line-height: 1.45; }
.box { padding: 16px 18px; border-radius: 16px; }
