:root {
  --brand: #2f4bd8; --brand-dark: #1f33a3; --brand-soft: #eef1ff;
  --accent: #ff7a59; --ink: #14182b; --muted: #5b6275; --line: #e3e6ef;
  --bg: #ffffff; --bg-alt: #f6f7fb; --ok: #17844a; --warn: #a15c00; --err: #c62828;
  --radius: 14px; --shadow: 0 6px 24px rgba(20, 24, 43, .08);
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; font-family: var(--font); color: var(--ink); background: var(--bg); line-height: 1.55; -webkit-font-smoothing: antialiased; }
img { max-width: 100%; }
a { color: var(--brand); }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; }
h1 { font-size: clamp(2rem, 5vw, 3.2rem); letter-spacing: -.02em; }
h2 { font-size: clamp(1.5rem, 3.2vw, 2.2rem); letter-spacing: -.01em; }
p { margin: 0 0 1em; }
.container { width: min(1120px, 100% - 2.5rem); margin-inline: auto; }
.narrow { width: min(560px, 100% - 2.5rem); margin-inline: auto; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.center { text-align: center; }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* header */
.site-header { position: sticky; top: 0; z-index: 20; background: rgba(255,255,255,.92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.site-header .container { display: flex; align-items: center; gap: 1rem; height: 64px; }
.logo { display: flex; align-items: center; gap: .55rem; font-weight: 800; color: var(--ink); text-decoration: none; letter-spacing: -.01em; }
.logo-mark { width: 30px; height: 30px; flex: none; }
@media (max-width: 380px) { .logo-text { font-size: .9rem; } }
.logo-text span { color: var(--brand); }
.nav { margin-left: auto; display: flex; align-items: center; gap: 1.25rem; }
.nav a { color: var(--ink); text-decoration: none; font-weight: 500; }
.nav a:hover { color: var(--brand); }
.nav-toggle { display: none; margin-left: auto; background: none; border: 1px solid var(--line); border-radius: 10px; padding: .4rem .6rem; font-size: 1.1rem; cursor: pointer; }
@media (max-width: 820px) {
  .nav-toggle { display: block; }
  .nav { display: none; position: absolute; top: 64px; left: 0; right: 0; flex-direction: column; align-items: stretch; gap: 0; background: #fff; border-bottom: 1px solid var(--line); padding: .5rem 1.25rem 1rem; }
  .nav.open { display: flex; }
  .nav a { padding: .7rem 0; border-bottom: 1px solid var(--line); }
  .nav .btn { margin-top: .75rem; text-align: center; }
}

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; padding: .7rem 1.2rem; border-radius: 10px; border: 1px solid transparent; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; transition: background .15s, transform .05s; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--brand); color: #fff !important; }
.btn-primary:hover { background: var(--brand-dark); }
.btn-accent { background: var(--accent); color: #fff !important; }
.btn-ghost { background: #fff; border-color: var(--line); color: var(--ink) !important; }
.btn-ghost:hover { border-color: var(--brand); }
.btn-login { background: var(--ink); color: #fff !important; padding: .55rem 1.1rem; }
.btn-lg { padding: .9rem 1.6rem; font-size: 1.05rem; }
.btn-sm { padding: .4rem .75rem; font-size: .875rem; }
.btn-danger { background: #fff; border-color: #f2c7c7; color: var(--err) !important; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.link-btn { background: none; border: none; color: var(--brand); cursor: pointer; font: inherit; padding: 0; text-decoration: underline; }

/* hero */
.hero { padding: 4.5rem 0 3.5rem; background: radial-gradient(1200px 500px at 85% -10%, var(--brand-soft), transparent), linear-gradient(#fff, var(--bg-alt)); }
.hero-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: 3rem; align-items: center; }
.eyebrow { display: inline-block; font-weight: 700; color: var(--brand); background: var(--brand-soft); padding: .3rem .75rem; border-radius: 999px; font-size: .85rem; margin-bottom: 1rem; }
.lead { font-size: 1.2rem; color: var(--muted); max-width: 38rem; }
.hero-cta { display: flex; flex-wrap: wrap; gap: .75rem; margin: 1.5rem 0 1rem; }
.trust { display: flex; flex-wrap: wrap; gap: 1.25rem; color: var(--muted); font-size: .92rem; }
.trust span::before { content: "✓ "; color: var(--ok); font-weight: 700; }
.cal-card { background: #fff; border-radius: 20px; box-shadow: var(--shadow); border: 1px solid var(--line); padding: 1.25rem; }
.cal-head { display: flex; justify-content: space-between; align-items: center; font-weight: 700; margin-bottom: .75rem; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; font-size: .8rem; text-align: center; }
.cal-grid .d { padding: .45rem 0; border-radius: 8px; background: var(--bg-alt); }
.cal-grid .h { color: var(--muted); font-weight: 600; background: none; }
.cal-grid .ev { background: var(--brand); color: #fff; font-weight: 700; }
.cal-grid .ev2 { background: var(--accent); color: #fff; font-weight: 700; }
.cal-list { margin: 1rem 0 0; padding: 0; list-style: none; display: grid; gap: .5rem; }
.cal-list li { display: flex; gap: .6rem; align-items: center; padding: .6rem .75rem; border-radius: 10px; background: var(--bg-alt); font-size: .9rem; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--brand); flex: none; }
.dot.o { background: var(--accent); } .dot.g { background: var(--ok); }
@media (max-width: 900px) { .hero-grid { grid-template-columns: 1fr; } .hero { padding-top: 3rem; } }

/* sections */
section.block { padding: 4.5rem 0; }
section.alt { background: var(--bg-alt); }
.section-head { text-align: center; max-width: 44rem; margin: 0 auto 2.5rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.25rem; }
@media (max-width: 900px) { .grid-3 { grid-template-columns: 1fr; } .grid-2 { grid-template-columns: 1fr; } }
.card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 1.5rem; box-shadow: 0 1px 2px rgba(0,0,0,.03); }
.feature .icon { width: 44px; height: 44px; border-radius: 12px; background: var(--brand-soft); display: grid; place-items: center; font-size: 1.35rem; margin-bottom: .8rem; }
.steps { counter-reset: s; display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.25rem; }
.steps .card::before { counter-increment: s; content: counter(s); display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--brand); color: #fff; font-weight: 800; margin-bottom: .75rem; }
@media (max-width: 900px) { .steps { grid-template-columns: 1fr 1fr; } }
@media (max-width: 540px) { .steps { grid-template-columns: 1fr; } }

/* video */
.video { position: relative; aspect-ratio: 16 / 9; border-radius: var(--radius); overflow: hidden; background: linear-gradient(135deg, #1f2a5c, #2f4bd8); color: #fff; display: grid; place-items: center; text-align: center; }
.video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.video .play { width: 64px; height: 64px; border-radius: 50%; background: rgba(255,255,255,.18); display: grid; place-items: center; font-size: 1.6rem; margin: 0 auto .6rem; }
.video .ph { padding: 1rem; }
.video-title { font-weight: 700; margin-top: .75rem; }

/* pricing */
.pricing { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem; align-items: stretch; }
@media (max-width: 900px) { .pricing { grid-template-columns: 1fr; } }
.pricing.pricing-2 { grid-template-columns: repeat(2, minmax(0, 360px)); justify-content: center; }
@media (max-width: 900px) { .pricing.pricing-2 { grid-template-columns: 1fr; } }
.price-card { position: relative; display: flex; flex-direction: column; }
.price-card.featured { border: 2px solid var(--brand); box-shadow: var(--shadow); }
.badge { position: absolute; top: -12px; left: 50%; transform: translateX(-50%); background: var(--brand); color: #fff; font-size: .78rem; font-weight: 700; padding: .25rem .7rem; border-radius: 999px; white-space: nowrap; }
.badge.accent { background: var(--accent); }
.price { font-size: 2.6rem; font-weight: 800; letter-spacing: -.02em; }
.price small { font-size: 1rem; font-weight: 500; color: var(--muted); }
.eff { color: var(--brand); font-weight: 700; margin-bottom: .5rem; }
.ticks { list-style: none; padding: 0; margin: 1rem 0 1.5rem; display: grid; gap: .45rem; }
.ticks li::before { content: "✓"; color: var(--ok); font-weight: 800; margin-right: .5rem; }
.price-card .btn { margin-top: auto; }

/* faq */
details { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 1rem 1.25rem; margin-bottom: .75rem; }
summary { cursor: pointer; font-weight: 600; }
details p { margin: .75rem 0 0; color: var(--muted); }

/* footer */
.site-footer { background: var(--ink); color: #c9cdda; padding: 2.5rem 0; font-size: .92rem; }
.site-footer a { color: #fff; text-decoration: none; margin-right: 1rem; }
.footer-grid { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem; align-items: center; }

/* forms */
.page { padding: 3rem 0 4rem; background: var(--bg-alt); min-height: calc(100vh - 64px); }
.form-card { background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 2rem; box-shadow: var(--shadow); }
@media (max-width: 540px) { .form-card { padding: 1.25rem; } }
label { display: block; font-weight: 600; margin-bottom: .35rem; font-size: .95rem; }
.req::after { content: " *"; color: var(--err); }
.field { margin-bottom: 1.1rem; }
input[type=text], input[type=email], input[type=password], input[type=date], input[type=time], input[type=number], input[type=tel], select, textarea {
  width: 100%; padding: .7rem .8rem; border: 1px solid #cfd4e2; border-radius: 10px; font: inherit; background: #fff; color: var(--ink);
}
textarea { min-height: 90px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 3px solid rgba(47,75,216,.2); border-color: var(--brand); }
input.invalid, select.invalid, textarea.invalid { border-color: var(--err); }
.hint { color: var(--muted); font-size: .85rem; margin-top: .3rem; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 1rem; }
@media (max-width: 600px) { .row, .row-3 { grid-template-columns: 1fr; } }
.check { display: flex; gap: .6rem; align-items: flex-start; font-weight: 500; margin-bottom: .6rem; }
.check input { margin-top: .3rem; width: 18px; height: 18px; flex: none; }
.alert { padding: .8rem 1rem; border-radius: 10px; margin-bottom: 1rem; font-size: .95rem; }
.alert-error { background: #fdecec; color: var(--err); border: 1px solid #f5c2c2; }
.alert-ok { background: #e8f6ee; color: var(--ok); border: 1px solid #bfe5cf; }
.alert-info { background: var(--brand-soft); color: var(--brand-dark); border: 1px solid #d3daff; }
.pw-rules { list-style: none; padding: 0; margin: .5rem 0 0; font-size: .85rem; display: grid; grid-template-columns: 1fr 1fr; gap: .2rem .8rem; }
.pw-rules li { color: var(--muted); }
.pw-rules li::before { content: "○ "; }
.pw-rules li.ok { color: var(--ok); }
.pw-rules li.ok::before { content: "● "; }

/* segmented choice */
.seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: .6rem; }
.seg label { margin: 0; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span { display: block; text-align: center; padding: .9rem .5rem; border: 2px solid var(--line); border-radius: 12px; cursor: pointer; font-weight: 700; background: #fff; }
.seg span small { display: block; font-weight: 500; color: var(--muted); font-size: .8rem; }
.seg input:checked + span { border-color: var(--brand); background: var(--brand-soft); color: var(--brand-dark); }
.seg input:focus-visible + span { outline: 3px solid rgba(47,75,216,.3); }
@media (max-width: 480px) { .seg { grid-template-columns: 1fr; } }
.tier-pick .seg span { padding: 1rem .5rem; }

/* app shell */
.app-tabs { display: flex; gap: .35rem; overflow-x: auto; border-bottom: 1px solid var(--line); margin-bottom: 1.5rem; }
.app-tabs button { background: none; border: none; padding: .8rem 1rem; font: inherit; font-weight: 600; color: var(--muted); border-bottom: 3px solid transparent; cursor: pointer; white-space: nowrap; }
.app-tabs button.active { color: var(--brand); border-color: var(--brand); }
.stepper { display: flex; gap: .4rem; margin-bottom: 1.5rem; list-style: none; padding: 0; counter-reset: st; }
.stepper li { flex: 1; text-align: center; font-size: .8rem; color: var(--muted); font-weight: 600; }
.stepper li::before { counter-increment: st; content: counter(st); display: block; margin: 0 auto .3rem; width: 30px; height: 30px; line-height: 30px; border-radius: 50%; background: var(--line); color: var(--muted); }
.stepper li.active { color: var(--brand); }
.stepper li.active::before { background: var(--brand); color: #fff; }
.stepper li.done::before { content: "✓"; background: var(--ok); color: #fff; }
@media (max-width: 540px) { .stepper li span { display: none; } }
.step-nav { display: flex; justify-content: space-between; gap: .75rem; margin-top: 1.5rem; padding-top: 1.25rem; border-top: 1px solid var(--line); }
.chips { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .5rem; }
.chip { display: inline-flex; align-items: center; gap: .35rem; background: var(--brand-soft); color: var(--brand-dark); border-radius: 999px; padding: .25rem .4rem .25rem .7rem; font-size: .85rem; font-weight: 600; }
.chip button { background: none; border: none; cursor: pointer; color: inherit; font-size: 1rem; line-height: 1; padding: 0 .2rem; }
.inline { display: flex; gap: .5rem; }
.inline > input, .inline > select { flex: 1; }
.list { list-style: none; padding: 0; margin: 0; display: grid; gap: .6rem; }
.list li { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .6rem 1rem; padding: .8rem 1rem; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.list li .meta { flex: 1 1 14rem; min-width: 0; overflow-wrap: break-word; }
.list li .actions { display: flex; gap: .4rem; flex: none; }
.group-pick { display: grid; gap: .4rem; }
.checklist-item { display: flex; gap: .5rem; align-items: center; margin-bottom: .4rem; }
.checklist-item input[type=text] { flex: 1; }
.dropzone { border: 2px dashed #cfd4e2; border-radius: 12px; padding: 1.5rem; text-align: center; color: var(--muted); cursor: pointer; }
.dropzone.drag { border-color: var(--brand); background: var(--brand-soft); }
.thumb { width: 44px; height: 44px; object-fit: cover; border-radius: 8px; background: var(--bg-alt); flex: none; }
pre.json { background: #0f1430; color: #d9e1ff; padding: 1rem; border-radius: 12px; overflow: auto; font-size: .82rem; max-height: 480px; }
.review dl { display: grid; grid-template-columns: 160px 1fr; gap: .4rem 1rem; margin: 0; }
.review dt { color: var(--muted); font-weight: 600; }
.review dd { margin: 0; overflow-wrap: anywhere; }
@media (max-width: 540px) { .review dl { grid-template-columns: 1fr; } .review dd { margin-bottom: .5rem; } }
.modal { position: fixed; inset: 0; background: rgba(20,24,43,.45); display: grid; place-items: center; z-index: 50; padding: 1rem; }
.modal .form-card { width: min(480px, 100%); max-height: 92vh; overflow: auto; }
.toasts { position: fixed; bottom: 1.25rem; left: 50%; transform: translateX(-50%); z-index: 60; display: grid; gap: .4rem; justify-items: center; }
.toast { background: var(--ink); color: #fff; padding: .7rem 1.1rem; border-radius: 10px; z-index: 60; font-weight: 600; }
.legal { background: #fffbea; border: 1px dashed #e0c25a; padding: 1rem 1.25rem; border-radius: 12px; }
.legal .tag { display: inline-block; background: #e0c25a; color: #3d2f00; font-size: .75rem; font-weight: 800; padding: .1rem .5rem; border-radius: 6px; margin-bottom: .5rem; }

/* add to calendar */
.cal-add { border: 1px solid var(--line); border-radius: 12px; padding: 1rem; margin: 0 0 1.25rem; background: var(--bg-alt); }
.cal-add h3 { font-size: 1rem; margin: 0 0 .6rem; }
.cal-btns { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: .5rem; }
.cal-btns .btn { padding: .6rem .5rem; font-size: .9rem; white-space: nowrap; }
.cal-btns .ico { font-weight: 800; }
@media (max-width: 760px) { .cal-btns { grid-template-columns: 1fr 1fr; } .cal-btns .btn:last-child:nth-child(odd) { grid-column: 1 / -1; } }
.list li.has-cal { flex-wrap: wrap; }
.list li .cal-add { flex-basis: 100%; margin: .5rem 0 0; }

/* subscription */
.renew-strip { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin: 1.5rem 0 .75rem; padding: 1rem 1.25rem; border-radius: var(--radius); background: #fff4ef; border: 1px solid #ffd3c4; }
.renew-strip .btn { flex: none; }
.sub-foot { text-align: center; margin: 2rem 0 0; font-size: .8rem; color: var(--muted); }
.sub-foot .link-btn { color: var(--muted); font-size: .8rem; }
.plan-btns { display: grid; grid-template-columns: repeat(3, 1fr); gap: .6rem; margin: 1rem 0; }
@media (max-width: 600px) { .plan-btns { grid-template-columns: 1fr; } }

/* ---- Phase 3: modes, events editor, recurrence, conflicts, settings ---- */
.mode-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: .5rem; }
.mode-grid label { margin: 0; }
.mode-grid input { position: absolute; opacity: 0; pointer-events: none; }
.mode-grid span { display: block; height: 100%; padding: .75rem .55rem; border: 2px solid var(--line); border-radius: 12px; cursor: pointer; background: #fff; text-align: center; }
.mode-grid span b { display: block; font-size: .95rem; }
.mode-grid span small { display: block; color: var(--muted); font-size: .78rem; line-height: 1.3; margin-top: .15rem; }
.mode-grid input:checked + span { border-color: var(--brand); background: var(--brand-soft); color: var(--brand-dark); }
.mode-grid input:focus-visible + span { outline: 3px solid rgba(47,75,216,.3); }
@media (max-width: 760px) { .mode-grid { grid-template-columns: 1fr 1fr; } .mode-grid label:last-child { grid-column: 1 / -1; } }
.ev-row { padding: 1rem; margin-bottom: .75rem; }
.ev-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: .5rem; }
.ev-row .field { margin-bottom: .6rem; }
.days { display: flex; flex-wrap: wrap; gap: .35rem; }
.day input { position: absolute; opacity: 0; }
.day span { display: inline-block; min-width: 2.6rem; text-align: center; padding: .4rem .3rem; border: 1.5px solid var(--line); border-radius: 999px; cursor: pointer; font-weight: 600; font-size: .85rem; }
.day input:checked + span { background: var(--brand); border-color: var(--brand); color: #fff; }
.day input:focus-visible + span { outline: 3px solid rgba(47,75,216,.3); }
.alert-warn { background: #fff6e5; color: var(--warn); border: 1px solid #f3d9a6; }
.alert-warn ul { margin: .4rem 0; padding-left: 1.2rem; }
.alert-warn p { margin: .2rem 0 0; }
.scan-card { display: flex; gap: .9rem; align-items: flex-start; margin-top: .75rem; }
.scan-card .alert, .scan-card p { margin: 0; flex: 1; }
.scan-thumb { width: 96px; height: 96px; object-fit: cover; border-radius: 10px; border: 1px solid var(--line); flex: none; }
code.addr { flex: 1; display: block; padding: .6rem .75rem; background: var(--bg-alt); border: 1px solid var(--line); border-radius: 10px; overflow-wrap: anywhere; font-size: .9rem; }
.cal-hint { grid-column: 1 / -1; margin: .2rem 0 0; }
.cal-events li { flex-wrap: wrap; }
.cal-events .cal-btns { flex-basis: 100%; }
.list.compact li { padding: .55rem .8rem; }
#repeat-wrap { padding: 1rem; margin-top: .5rem; }
.form-card + .form-card { margin-top: 1.25rem; }
@media (max-width: 560px) { .cal-btns { grid-template-columns: repeat(2, minmax(0, 1fr)); } .scan-thumb { width: 72px; height: 72px; } }
@media (max-width: 560px) { .app-tabs { gap: 0; } .app-tabs button { padding: .7rem .55rem; font-size: .9rem; } }
#review-events h3 { margin: 1.25rem 0 .5rem; font-size: 1.05rem; }
.photo-pick { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: .5rem; }
.photo-pick .btn { flex: 1 1 12rem; }
.photo-pick + .dropzone { padding: .75rem; }
@media (hover: none) { .photo-pick + .dropzone { display: none; } }
/* ---- contact multi-select picker ---- */
.picker { border: 1px solid var(--line); border-radius: 12px; background: #fff; padding: .6rem; margin-bottom: .6rem; }
.picker-bar { display: flex; gap: .4rem; align-items: center; margin-bottom: .5rem; flex-wrap: wrap; }
.picker-bar input[type=search] { flex: 1 1 10rem; min-width: 0; font-size: 16px; }
.picker-bar .btn { min-height: 40px; }
.pick-list { display: grid; gap: .35rem; max-height: 18rem; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
.pick { display: flex; align-items: center; gap: .75rem; min-height: 48px; padding: .5rem .7rem; border: 1.5px solid var(--line); border-radius: 10px; cursor: pointer; margin: 0; font-weight: 500; -webkit-tap-highlight-color: transparent; }
.pick input { width: 22px; height: 22px; flex: none; margin: 0; accent-color: var(--brand); }
.pick:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); }
.pick.disabled { cursor: default; background: var(--bg-alt); color: var(--muted); }
.pick-text { display: flex; flex-direction: column; min-width: 0; overflow-wrap: anywhere; line-height: 1.3; }
.pick-sub { font-size: .82rem; color: var(--muted); font-weight: 400; }
.pick-sub .link-btn { font-size: .82rem; min-height: 32px; }
.picker-count { margin: .4rem 0 0; }
.picker-empty { margin: 0; }

@media (max-width: 560px) { .list li .actions { width: 100%; } .list li .actions .btn { flex: 1; } }

/* ===================== Simple app (New appointment / History / Contacts) ===================== */
.page.ap { padding: 1rem 0 6rem; }
.ap-wrap { width: min(640px, 100% - 1.5rem); }
.ap-tabs { position: sticky; top: 64px; z-index: 10; background: var(--bg-alt); margin-bottom: 1rem; }
.ap-tabs button { flex: 1; padding: .9rem .5rem; font-size: 1rem; }
.ap-h { font-size: 1.5rem; margin: .25rem 0 .9rem; }
.ap-card { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 1rem; box-shadow: 0 2px 10px rgba(20,24,43,.05); margin-bottom: .9rem; }
.ap-label { display: block; font-weight: 700; margin-bottom: .5rem; font-size: 1.05rem; }
.ap-label.sm { font-size: .9rem; margin: .9rem 0 .4rem; }
.ap-hint { color: var(--muted); font-size: .9rem; margin: .5rem 0 0; }
.ap-block { display: flex; width: 100%; margin-top: .75rem; }
.ap-say { position: relative; }
.ap-say textarea { width: 100%; font-size: 1.05rem; min-height: 96px; padding-right: 3.6rem; }
.ap-mic { position: absolute; right: .5rem; bottom: .6rem; width: 48px; height: 48px; border-radius: 50%; border: 1px solid var(--line); background: var(--brand-soft); font-size: 1.35rem; cursor: pointer; }
.ap-mic.on { background: var(--accent); border-color: var(--accent); animation: ap-pulse 1.2s infinite; }
@keyframes ap-pulse { 50% { box-shadow: 0 0 0 8px rgba(255,122,89,.25); } }
.ap-listening { color: var(--accent); font-weight: 600; font-size: .9rem; margin: .4rem 0 0; }
.ap-or { text-align: center; color: var(--muted); margin: .2rem 0 .9rem; font-weight: 600; }
.ap-two { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; }
.ap-big { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .3rem; min-height: 104px; border: 2px solid var(--line); border-radius: 14px; background: var(--bg-alt); font: inherit; font-weight: 700; color: var(--ink); cursor: pointer; padding: .75rem; }
.ap-big:hover, .ap-big:focus-visible { border-color: var(--brand); background: var(--brand-soft); }
.ap-ico { font-size: 1.8rem; line-height: 1; }
.ap-spin { width: 44px; height: 44px; margin: 1rem auto; border-radius: 50%; border: 4px solid var(--brand-soft); border-top-color: var(--brand); animation: ap-rot .8s linear infinite; }
@keyframes ap-rot { to { transform: rotate(360deg); } }
.ap-chips { display: flex; flex-wrap: wrap; gap: .45rem; }
.ap-chip { display: inline-flex; align-items: center; gap: .3rem; min-height: 40px; padding: .4rem .85rem; border-radius: 999px; border: 1px solid var(--line); background: #fff; font: inherit; font-weight: 600; font-size: .92rem; color: var(--ink); cursor: pointer; }
.ap-chip.on { background: var(--brand-soft); border-color: var(--brand); color: var(--brand-dark); }
.ap-chip button { background: none; border: none; font: inherit; color: inherit; cursor: pointer; padding: 0 .1rem 0 .3rem; }
.ap-inline { display: flex; gap: .5rem; margin-top: .75rem; }
.ap-inline input { flex: 1; min-width: 0; }
.ap-top { display: flex; align-items: center; gap: .5rem; }
.ap-top .ap-h { margin: .25rem 0 .9rem; }
.ap-back { width: 44px; height: 44px; margin-bottom: .6rem; border-radius: 50%; border: 1px solid var(--line); background: #fff; font-size: 1.2rem; cursor: pointer; flex: none; }
.ap-ev { display: grid; gap: .65rem; }
.ap-evhead { display: flex; justify-content: space-between; align-items: center; min-height: 0; }
.ap-evhead:empty, .ap-num:empty { display: none; }
.ap-num { font-weight: 700; color: var(--muted); font-size: .85rem; }
.ap-x { background: none; border: none; color: var(--err); font: inherit; font-weight: 600; cursor: pointer; padding: .4rem .5rem; min-height: 36px; }
.ap-f { display: grid; gap: .25rem; min-width: 0; }
.ap-f > span { font-size: .82rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }
.ap-f input, .ap-f select { width: 100%; min-height: 46px; font-size: 1rem; }
.ap-2 { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; }
.ap input.ap-need, .ap textarea.ap-need, .ap select.ap-need { border-color: #e9a23b; background: #fff8ea; box-shadow: 0 0 0 3px rgba(233,162,59,.18); }
.ap-remrow { display: grid; grid-template-columns: 1fr auto; gap: .6rem; align-items: end; }
.ap-all { padding-bottom: .8rem; white-space: nowrap; }
.ap-check summary { cursor: pointer; font-weight: 700; color: var(--brand-dark); padding: .35rem 0; min-height: 36px; }
.ap-cl { list-style: none; margin: .3rem 0 0; padding: 0; display: grid; gap: .3rem; }
.ap-cl li { display: flex; justify-content: space-between; align-items: center; gap: .5rem; padding: .35rem .6rem; background: var(--bg-alt); border-radius: 10px; overflow-wrap: anywhere; }
.ap-cl li::before { content: "☐"; color: var(--muted); margin-right: .2rem; }
.ap-cl li span { flex: 1; }
.ap-warn { margin: 0; }
.ap-cf:empty { display: none; }
.ap-sub { font-size: 1.1rem; margin: 0 0 .6rem; }
.ap-people { list-style: none; margin: .75rem 0 0; padding: 0; display: grid; gap: .4rem; }
.ap-people li { display: flex; align-items: center; justify-content: space-between; gap: .5rem; padding: .5rem .25rem .5rem .6rem; border: 1px solid var(--line); border-radius: 12px; }
.ap-pmeta { display: grid; min-width: 0; }
.ap-pmeta strong, .ap-pmeta span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ap-tgs { display: flex; gap: .35rem; flex: none; }
.ap-tg { min-width: 52px; min-height: 44px; border-radius: 10px; border: 1px solid var(--line); background: #fff; font: inherit; font-weight: 700; cursor: pointer; color: var(--ink); }
.ap-tg.on { background: var(--brand); border-color: var(--brand); color: #fff; }
.ap-tg[disabled] { opacity: .35; cursor: not-allowed; }
#rc-search { width: 100%; margin-top: .75rem; min-height: 44px; }
.ap-add { border-top: 1px dashed var(--line); margin-top: .9rem; }
.ap-addrow { display: grid; grid-template-columns: 1fr 1.3fr; gap: .5rem; }
.ap-addrow input { min-height: 46px; min-width: 0; }
#nc-msg { margin: .6rem 0 0; }
.ap-sendbar { position: sticky; bottom: 0; padding: .6rem 0 calc(.6rem + env(safe-area-inset-bottom)); background: linear-gradient(rgba(246,247,251,0), var(--bg-alt) 35%); z-index: 5; }
.ap-sendbar .btn { margin: 0; }
.ap-done { padding: 1.5rem 1rem; }
.ap-tick { width: 64px; height: 64px; border-radius: 50%; background: var(--ok); color: #fff; font-size: 2rem; display: grid; place-items: center; margin: 0 auto .6rem; }
.cal-btns.one { grid-template-columns: 1fr; }
.ap-each summary { cursor: pointer; margin: .75rem 0 .5rem; font-weight: 600; }
.ap-hist { list-style: none; padding: 0; margin: 0; display: grid; gap: .55rem; }
.ap-hi { background: #fff; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.ap-hi.is-cancelled .ap-htitle { text-decoration: line-through; color: var(--muted); }
.ap-hrow { display: grid; grid-template-columns: 1fr auto; gap: .15rem .6rem; width: 100%; text-align: left; background: none; border: none; font: inherit; color: inherit; padding: .85rem 1rem; cursor: pointer; }
.ap-htitle { font-weight: 700; min-width: 0; overflow-wrap: anywhere; }
.ap-hmeta { grid-column: 1; color: var(--muted); font-size: .88rem; overflow-wrap: anywhere; }
.ap-badge { grid-column: 2; grid-row: 1 / span 2; align-self: center; font-size: .75rem; font-weight: 700; padding: .2rem .55rem; border-radius: 999px; background: var(--bg-alt); color: var(--muted); }
.ap-badge.x { background: #fdecec; color: var(--err); } .ap-badge.u { background: var(--brand-soft); color: var(--brand-dark); }
.ap-hpanel { padding: 0 1rem 1rem; }
.ap-hacts { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; margin-bottom: .75rem; }
.ap-hacts:empty { display: none; }
.ap-hpanel .cal-add { margin: 0; }
.ap-empty { color: var(--muted); padding: 1rem; text-align: center; }
.ap .list { margin-top: .75rem; }
@media (max-width: 420px) { .ap-two { gap: .5rem; } .ap-big { min-height: 96px; font-size: .95rem; } .ap-addrow { grid-template-columns: 1fr; } }
.ap-2:has(> .hidden) { grid-template-columns: 1fr; }
.ap-game { border: 1px solid var(--line); border-radius: 12px; padding: .6rem .7rem; background: var(--bg-alt); display: grid; gap: .55rem; }
.ap-gbody { display: grid; gap: .55rem; }
.ap-switch { display: flex; align-items: center; gap: .55rem; font-weight: 700; min-height: 36px; cursor: pointer; }
.ap-switch input { width: 22px; height: 22px; accent-color: var(--brand); }
.ap-seg { display: grid; grid-template-columns: 1fr 1fr 1fr; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: #fff; }
.ap-seg button { min-height: 46px; border: none; border-right: 1px solid var(--line); background: #fff; font: inherit; font-weight: 700; color: var(--ink); cursor: pointer; }
.ap-seg button:last-child { border-right: none; }
.ap-seg button.on { background: var(--brand); color: #fff; }
.ap-seg.ap-need { border-color: #e9a23b; box-shadow: 0 0 0 3px rgba(233,162,59,.18); }
.ap-seg.ap-need button[data-ha=""].on { background: #fff8ea; color: var(--warn); }
.ap-jersey { font-weight: 700; font-size: .92rem; padding: .45rem .6rem; border-radius: 10px; }
.ap-jersey.home { background: #fff; border: 1px solid var(--line); color: var(--ink); }
.ap-jersey.away { background: var(--ink); color: #fff; }
.ap-jersey.unsure { background: #fff8ea; color: var(--warn); }
.ap textarea.ap-title2 { min-height: 0; width: 100%; font-size: 1rem; resize: none; line-height: 1.35; }
.ap-tools { display: flex; justify-content: space-between; align-items: center; gap: .5rem; margin: 0 0 .5rem; }
.ap-tools .ap-hint { margin: 0; }
.ap-compact { position: relative; padding: 0; margin-bottom: .45rem; }
.ap-compact .ap-cf { padding: 0 .75rem; }
.ap-compact .ap-cf:not(:empty) { padding-bottom: .6rem; }
.ap-sumrow { display: grid; grid-template-columns: auto 1fr auto; gap: .6rem; align-items: center; width: 100%; text-align: left; background: none; border: none; font: inherit; color: inherit; padding: .7rem 2.6rem .7rem .75rem; cursor: pointer; min-height: 60px; }
.ap-sum-num { width: 26px; height: 26px; border-radius: 50%; background: var(--bg-alt); color: var(--muted); font-weight: 700; font-size: .8rem; display: grid; place-items: center; }
.ap-sum-main { display: grid; min-width: 0; }
.ap-sum-title { font-weight: 700; font-size: .95rem; line-height: 1.3; overflow-wrap: anywhere; }
.ap-sum-meta { color: var(--muted); font-size: .85rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ap-sum-side { display: grid; justify-items: end; gap: .2rem; }
.ap-chev { display: none; }
.ap-sum-x { position: absolute; top: .45rem; right: .3rem; color: var(--muted); }
.ap-ha-badge { font-size: .72rem; font-weight: 800; padding: .15rem .5rem; border-radius: 999px; white-space: nowrap; }
.ap-ha-badge.home { background: #fff; border: 1px solid var(--line); color: var(--ink); }
.ap-ha-badge.away { background: var(--ink); color: #fff; }
.ap-ha-badge.unsure, .ap-needs { background: #fff8ea; color: var(--warn); }
.ap-needs { font-size: .72rem; font-weight: 700; padding: .15rem .5rem; border-radius: 999px; white-space: nowrap; }
.ap-done-btn { font-weight: 700; margin-right: auto; }

/* address suggestions under Location */
.ap-place { margin: -4px 0 12px; padding: 10px 12px; border: 1px solid #c9dcf5; background: #f3f8ff; border-radius: 10px; font-size: 14px; }
.ap-place p { margin: 0 0 8px; line-height: 1.35; }
.ap-place .ap-place-ok { color: #17663a; margin-bottom: 6px; }
.ap-place-btns { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.ap-place-list { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 6px; }
.ap-place-opt { width: 100%; text-align: left; background: #fff; border: 1px solid #d5dbe5; border-radius: 8px; padding: 8px 10px; font: inherit; cursor: pointer; display: grid; gap: 2px; }
.ap-place-opt span { color: #555; font-size: 13px; }
.ap-place .ap-place-area { margin: 8px 0 0; color: #666; font-size: 12px; }
.ap-addr-flag { font-size: 11px; font-weight: 600; color: #1d5fb8; background: #e6f0fd; border-radius: 999px; padding: 2px 7px; white-space: nowrap; }
.ap-tools { flex-wrap: wrap; }
#use-addrs { flex-basis: 100%; order: 3; }

/* referral */
.ref-banner { background: #fff6dd; border-bottom: 1px solid #f1d98a; padding: .7rem 0; font-size: .95rem; }
.ref-banner .container { display: flex; flex-wrap: wrap; gap: .5rem .75rem; align-items: center; }
.ref-gift { font-size: 1.3rem; }
.ref-line { margin: .75rem 0 .25rem; }
.ref-status.ok { color: #17663a; }
.ref-status.bad { color: #b42318; }
.ref-status.checking { color: #667; }
input[aria-invalid="true"] { border-color: #b42318; }
.ref-card { display: flex; align-items: center; gap: .75rem; width: 100%; text-align: left; cursor: pointer; font: inherit; color: inherit; margin-top: .75rem; }
.ref-card > span:nth-child(2) { display: grid; gap: .1rem; flex: 1; }
.rf-linkrow input { flex: 1; min-width: 0; font-size: .95rem; }
.rf-share { display: flex; flex-wrap: wrap; gap: .5rem; margin: .75rem 0; }
.rf-stats { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; margin: .5rem 0; }
.rf-stats > div { background: #f3f6ff; border-radius: 10px; padding: .6rem .75rem; display: grid; }
.rf-num { font-size: 1.6rem; font-weight: 800; color: var(--brand, #2f4bd8); }
.notices { display: grid; gap: .5rem; margin: .75rem 0 0; }
.notice { display: flex; gap: .75rem; align-items: flex-start; justify-content: space-between; }
.notice p { margin: .25rem 0 0; }
.notice-x { flex: none; }
.forgot-links { margin: .75rem 0 0; font-size: .95rem; }
.forgot-which { margin: 1rem 0; }
.forgot-which summary { cursor: pointer; color: var(--brand); }

/* install app (PWA) */
.install-card { display: flex; gap: .75rem; align-items: flex-start; background: var(--brand-soft); border: 1px solid #d3daff; color: var(--ink); border-radius: 14px; padding: .85rem .9rem; margin: .75rem 0 0; }
.install-card img { flex: none; border-radius: 10px; }
.install-text { flex: 1; display: grid; gap: .2rem; }
.install-text p { margin: 0; }
.install-text .btn { justify-self: start; margin-top: .35rem; }
.ios-share { display: inline-flex; align-items: center; gap: .2rem; font-weight: 600; color: var(--brand-dark); }
.ios-share svg { vertical-align: -2px; }
.install-x { flex: none; background: none; border: none; font: inherit; font-size: 1rem; color: var(--muted, #667); cursor: pointer; padding: .2rem .4rem; min-height: 32px; }
.offline-card img { border-radius: 16px; margin: .5rem auto 0; display: block; }
@media (display-mode: standalone) { .site-header { padding-top: env(safe-area-inset-top); } }
