/* NextNest host portal — same palette and type as the homepage (nn-pages.css). */
:root {
  --display: "Source Serif 4", Georgia, serif;
  --text: "Libre Franklin", system-ui, sans-serif;
  --ink: #1b2632; --bg: #eee9df; --surface: #e2ded6; --card: #f6f3ed; --field: #fbf9f5;
  --muted: #575f65; --line: rgba(27, 38, 50, .14); --line-strong: rgba(27, 38, 50, .28);
  --accent: #a35139; --accent-dark: #8a4430; --on-accent: #f6f3ed; --accent-soft: rgba(163, 81, 57, .1);
  --us: #2f4a5f; --us-soft: rgba(47, 74, 95, .1);
  --done: #3f6b4e; --done-soft: rgba(63, 107, 78, .12);
  --r-sm: 8px; --r-md: 12px; --r-lg: 20px;
  --shadow: 0 1px 2px rgba(27, 38, 50, .05), 0 8px 24px rgba(27, 38, 50, .06);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 16px/1.55 var(--text); color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; }
h1, h2, h3 { font-family: var(--display); font-weight: 400; letter-spacing: -0.02em; margin: 0; }
h1 { font-size: clamp(30px, 5vw, 44px); line-height: 1.08; }
h2 { font-size: clamp(24px, 3.4vw, 32px); line-height: 1.15; }
h3 { font-size: 20px; line-height: 1.25; }
p { margin: 0 0 12px; }
a { color: var(--accent-dark); }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ── Chrome ── */
.demo-bar { background: var(--ink); color: var(--bg); font-size: 14px; padding: 8px 16px; display: flex; gap: 12px; align-items: center; justify-content: center; flex-wrap: wrap; }
.demo-bar button { background: transparent; border: 1px solid rgba(238, 233, 223, .4); color: var(--bg); border-radius: 999px; padding: 4px 12px; cursor: pointer; font-size: 13px; }
.topbar { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 16px; padding: 12px clamp(16px, 4vw, 40px); background: rgba(238, 233, 223, .92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.brand { font-family: var(--display); font-size: 22px; color: var(--ink); text-decoration: none; letter-spacing: -0.02em; }
.tabs { display: flex; gap: 4px; margin-right: auto; }
.tabs button { background: none; border: 0; padding: 8px 12px; border-radius: 999px; cursor: pointer; color: var(--muted); font-weight: 500; font-size: 15px; }
.tabs button[aria-current="page"] { background: var(--card); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line); }
.me { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--muted); }
.me img, .avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--surface); object-fit: cover; }
.me button { background: none; border: 0; color: var(--muted); cursor: pointer; text-decoration: underline; font-size: 14px; padding: 4px; }
.app { max-width: 1120px; margin: 0 auto; padding: clamp(20px, 4vw, 40px) clamp(16px, 4vw, 40px) 80px; }

/* ── Buttons & fields ── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 0 20px; border-radius: var(--r-md); border: 0; cursor: pointer; font-weight: 600; font-size: 15px; text-decoration: none; transition: background .15s, transform .1s; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); color: var(--on-accent); }
.btn-primary:hover { background: var(--accent-dark); }
.btn-primary:disabled { background: var(--line-strong); color: var(--card); cursor: not-allowed; }
.btn-secondary { background: var(--card); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line-strong); }
.btn-secondary:hover { background: var(--field); }
.btn-ghost { background: none; color: var(--muted); padding: 0 8px; }
.btn-sm { min-height: 36px; padding: 0 14px; font-size: 14px; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-top: 20px; }
.field { margin-bottom: 20px; }
.fl { display: block; font-weight: 500; margin-bottom: 4px; }
.req { color: var(--accent); }
.helper { font-size: 14px; color: var(--muted); margin-bottom: 8px; }
.input, input[type=text], input[type=email], input[type=tel], input[type=url], input[type=number], input[type=date], select, textarea {
  width: 100%; min-height: 46px; padding: 10px 14px; border-radius: var(--r-sm); border: 1px solid var(--line-strong); background: var(--field); }
textarea { min-height: 96px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.field.invalid input, .field.invalid select, .field.invalid textarea, .field.invalid .opt-grid { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); border-radius: var(--r-sm); }
.field-error { display: none; color: var(--accent-dark); font-size: 14px; margin-top: 6px; }
.field.invalid .field-error { display: block; }
.opt-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; }
.opt { position: relative; }
.opt input { position: absolute; opacity: 0; inset: 0; }
.opt label { display: flex; align-items: center; min-height: 46px; padding: 10px 14px; border-radius: var(--r-sm); border: 1px solid var(--line-strong); background: var(--field); cursor: pointer; font-size: 15px; }
.opt input:checked + label { border-color: var(--accent); background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent); }
.opt input:focus-visible + label { outline: 2px solid var(--accent); outline-offset: 2px; }
.check { display: flex; gap: 12px; align-items: flex-start; padding: 12px 0; cursor: pointer; }
.check input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--accent); flex: none; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* ── Cards ── */
.card { background: var(--card); border-radius: var(--r-lg); box-shadow: var(--shadow); border: 1px solid var(--line); padding: clamp(20px, 3.4vw, 32px); }
.card + .card { margin-top: 16px; }
.eyebrow { font-size: 14px; font-weight: 500; color: var(--muted); margin-bottom: 6px; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font-size: 13px; font-weight: 500; white-space: nowrap; }
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pill.host { background: var(--accent-soft); color: var(--accent-dark); }
.pill.nextnest { background: var(--us-soft); color: var(--us); }
.pill.done { background: var(--done-soft); color: var(--done); }
.pill.locked { background: var(--surface); color: var(--muted); }

/* ── Sign in ── */
.signin { min-height: calc(100vh - 80px); display: grid; place-items: center; }
.signin .card { max-width: 460px; width: 100%; text-align: center; }
.signin .jas { width: 96px; height: 96px; border-radius: 50%; object-fit: cover; margin: 0 auto 16px; display: block; background: var(--surface); }
.signin h1 { font-size: 34px; margin-bottom: 10px; }
.signin .gbtn { display: flex; justify-content: center; margin: 24px 0 12px; min-height: 44px; }

/* ── Journey hero ── */
.hero { display: grid; grid-template-columns: auto 1fr; gap: clamp(20px, 4vw, 40px); align-items: center; margin-bottom: 24px; }
.ring { position: relative; width: 128px; height: 128px; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring .track { stroke: var(--surface); }
.ring .bar { stroke: var(--accent); stroke-linecap: round; transition: stroke-dashoffset 1s cubic-bezier(.2, .8, .2, 1); }
.ring .val { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; }
.ring .num { font-family: var(--display); font-size: 34px; line-height: 1; }
.ring .lbl { font-size: 12px; color: var(--muted); margin-top: 2px; }
.hero h1 { margin-bottom: 8px; }
.hero-meta { display: flex; gap: 10px 20px; flex-wrap: wrap; align-items: center; color: var(--muted); font-size: 15px; }
.hero-meta strong { color: var(--ink); font-weight: 600; }

/* ── Journey layout ── */
.journey { display: grid; grid-template-columns: 300px 1fr; gap: 24px; align-items: start; }
.tracker { list-style: none; margin: 0; padding: 8px; position: sticky; top: 84px; }
.tracker li { position: relative; }
.tracker li:not(:last-child)::after { content: ""; position: absolute; left: 27px; top: 46px; bottom: -6px; width: 2px; background: var(--line); }
.tracker li.is-done:not(:last-child)::after { background: var(--done); opacity: .5; }
.tracker button { width: 100%; display: grid; grid-template-columns: 40px 1fr; gap: 12px; align-items: start; text-align: left; background: none; border: 0; padding: 12px 8px; border-radius: var(--r-md); cursor: pointer; }
.tracker button:hover:not(:disabled) { background: var(--field); }
.tracker button[aria-current="step"] { background: var(--field); box-shadow: inset 0 0 0 1px var(--line); }
.tracker button:disabled { cursor: default; opacity: .55; }
.dot { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font-weight: 600; font-size: 15px; background: var(--surface); color: var(--muted); position: relative; z-index: 1; }
.is-done .dot { background: var(--done); color: #fff; }
.is-host .dot { background: var(--accent); color: var(--on-accent); box-shadow: 0 0 0 5px var(--accent-soft); }
.is-nextnest .dot { background: var(--us); color: #fff; box-shadow: 0 0 0 5px var(--us-soft); }
.tracker .t { font-weight: 600; display: block; margin: 2px 0; }
.tracker .s { font-size: 13px; color: var(--muted); display: block; }
.panel-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; margin-bottom: 20px; flex-wrap: wrap; }
.panel-head h2 { flex: 1 1 280px; }

/* ── Waiting state (NextNest's turn) ── */
.waiting { display: grid; grid-template-columns: 64px 1fr; gap: 16px; align-items: center; padding: 20px; background: var(--us-soft); border-radius: var(--r-md); }
.waiting img { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; background: var(--surface); }
.waiting p { margin: 0; }

/* ── Agreement ── */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 8px 0 20px; }
.split div { background: var(--field); border: 1px solid var(--line); border-radius: var(--r-md); padding: 16px; }
.split .n { font-family: var(--display); font-size: 40px; line-height: 1; display: block; }
.split .you .n { color: var(--accent-dark); }
.summary { list-style: none; padding: 0; margin: 0 0 20px; }
.summary li { padding: 10px 0 10px 30px; border-top: 1px solid var(--line); position: relative; }
.summary li::before { content: "✓"; position: absolute; left: 4px; color: var(--done); font-weight: 600; }
.doc { max-height: 420px; overflow: auto; background: var(--field); border: 1px solid var(--line); border-radius: var(--r-md); padding: 24px; font-size: 15px; }
.doc .title { font-family: var(--display); font-size: 24px; margin-bottom: 16px; }
.doc h4 { font-family: var(--display); font-weight: 500; font-size: 18px; margin: 20px 0 8px; }
.doc .li { padding-left: 18px; position: relative; } .doc .li::before { content: "•"; position: absolute; left: 4px; }
.sign-box { margin-top: 20px; padding-top: 20px; border-top: 1px solid var(--line); }
.sig-preview { font-family: var(--display); font-size: 28px; min-height: 40px; color: var(--ink); border-bottom: 1px solid var(--line-strong); margin: 8px 0 4px; padding-bottom: 4px; }

/* ── Form ── */
.form-progress { display: flex; gap: 4px; margin-bottom: 20px; }
.form-progress span { flex: 1; height: 4px; border-radius: 2px; background: var(--surface); }
.form-progress span.on { background: var(--accent); }
.save-note { font-size: 13px; color: var(--muted); }

/* ── Visit ── */
.days { display: grid; gap: 16px; }
.day h4 { margin: 0 0 8px; font-weight: 600; font-size: 15px; }
.slots { display: flex; flex-wrap: wrap; gap: 8px; }
.slot { min-height: 44px; padding: 0 16px; border-radius: var(--r-sm); border: 1px solid var(--line-strong); background: var(--field); cursor: pointer; font-weight: 500; }
.slot[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent); }
.booked { display: grid; grid-template-columns: 72px 1fr; gap: 16px; align-items: center; padding: 16px; background: var(--field); border: 1px solid var(--line); border-radius: var(--r-md); margin-bottom: 16px; }
.cal { text-align: center; border-radius: var(--r-sm); overflow: hidden; border: 1px solid var(--line-strong); background: #fff; }
.cal b { display: block; background: var(--accent); color: var(--on-accent); font-size: 12px; padding: 3px 0; font-weight: 600; }
.cal span { display: block; font-family: var(--display); font-size: 28px; padding: 4px 0; }
.list { list-style: none; padding: 0; margin: 0; }
.list li { padding: 10px 0; border-top: 1px solid var(--line); display: flex; gap: 12px; justify-content: space-between; }

/* ── Listing ── */
.lsec { border: 1px solid var(--line); border-radius: var(--r-md); background: var(--field); padding: 18px 20px; margin-bottom: 12px; }
.lsec h4 { margin: 0 0 8px; font-weight: 600; font-size: 14px; color: var(--muted); }
.lsec .body { white-space: pre-line; }
.lsec.is-title .body { font-family: var(--display); font-size: 26px; line-height: 1.2; }
.comment { margin-top: 10px; padding: 10px 12px; border-radius: var(--r-sm); background: var(--accent-soft); font-size: 14px; }
.comment-form { margin-top: 10px; display: grid; gap: 8px; }

/* ── Checklist ── */
.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.cl h3 { font-family: var(--text); font-size: 15px; font-weight: 600; margin-bottom: 8px; display: flex; justify-content: space-between; }
.cl-item { display: grid; grid-template-columns: 28px 1fr; gap: 10px; align-items: start; padding: 12px; border-radius: var(--r-sm); border: 1px solid var(--line); background: var(--field); margin-bottom: 8px; }
.cl-item button.tick { width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--line-strong); background: #fff; cursor: pointer; display: grid; place-items: center; color: #fff; font-weight: 700; }
.cl-item button.tick:disabled { cursor: default; }
.cl-item.done button.tick { background: var(--done); border-color: var(--done); }
.cl-item.done .lbl { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--line-strong); }
.cl-item .meta { font-size: 13px; color: var(--muted); }

/* ── Documents ── */
.docs-group h3 { font-family: var(--text); font-size: 14px; font-weight: 600; color: var(--muted); margin: 20px 0 8px; }
.doc-row { display: grid; grid-template-columns: 40px 1fr auto; gap: 12px; align-items: center; padding: 12px; border-radius: var(--r-md); background: var(--card); border: 1px solid var(--line); margin-bottom: 8px; }
.doc-ico { width: 40px; height: 40px; border-radius: var(--r-sm); display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-dark); font-size: 12px; font-weight: 600; }

/* ── Admin ── */
.table { width: 100%; border-collapse: collapse; font-size: 15px; }
.table th { text-align: left; font-size: 13px; color: var(--muted); font-weight: 500; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.table td { padding: 12px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table tr.click { cursor: pointer; } .table tr.click:hover td { background: var(--field); }
.admin-box { margin-top: 16px; border: 1px dashed var(--us); background: var(--us-soft); border-radius: var(--r-md); padding: 18px 20px; }
.admin-box h3 { font-family: var(--text); font-size: 15px; font-weight: 600; color: var(--us); margin-bottom: 10px; }
.bar { height: 6px; background: var(--surface); border-radius: 3px; overflow: hidden; width: 90px; }
.bar i { display: block; height: 100%; background: var(--accent); }
.log { font-size: 13px; color: var(--muted); } .log li { border-top: 1px solid var(--line); padding: 6px 0; }

/* ── Overlay / celebration ── */
.overlay { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; background: rgba(27, 38, 50, .55); padding: 20px; }
.celebrate { position: relative; max-width: 440px; width: 100%; text-align: center; background: var(--card); border-radius: var(--r-lg); padding: 36px 28px 28px; box-shadow: 0 24px 60px rgba(0, 0, 0, .25); overflow: hidden; animation: pop .45s cubic-bezier(.2, 1.3, .4, 1); }
.celebrate img { width: 88px; height: 88px; border-radius: 50%; object-fit: cover; margin-bottom: 12px; }
.celebrate h2 { margin-bottom: 8px; }
.confetti { position: absolute; inset: 0; pointer-events: none; }
.confetti i { position: absolute; top: -12px; width: 8px; height: 12px; border-radius: 2px; animation: fall 1.8s ease-in forwards; }
@keyframes pop { from { transform: scale(.9); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes fall { to { transform: translateY(520px) rotate(540deg); opacity: 0; } }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 60; background: var(--ink); color: var(--bg); padding: 12px 18px; border-radius: var(--r-md); font-size: 15px; max-width: calc(100% - 32px); box-shadow: var(--shadow); }
.toast.err { background: var(--accent-dark); }
.skeleton { height: 18px; border-radius: 6px; background: linear-gradient(90deg, var(--surface), var(--field), var(--surface)); background-size: 200% 100%; animation: shimmer 1.2s infinite; margin-bottom: 10px; }
@keyframes shimmer { to { background-position: -200% 0; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
  .confetti { display: none; }
}

/* ── Mobile ── */
@media (max-width: 860px) {
  .journey { grid-template-columns: 1fr; }
  .tracker { position: static; display: flex; overflow-x: auto; gap: 4px; padding: 0 0 4px; scroll-snap-type: x mandatory; scrollbar-width: none; }
  .tracker::-webkit-scrollbar { display: none; }
  .tracker li { flex: 0 0 auto; scroll-snap-align: start; }
  .tracker li::after { display: none; }
  .tracker button { grid-template-columns: 32px auto; padding: 8px 12px 8px 8px; align-items: center; }
  .tracker .dot { width: 32px; height: 32px; font-size: 13px; }
  .tracker .s { display: none; }
  .tracker .t { font-size: 14px; margin: 0; white-space: nowrap; }
}
@media (max-width: 620px) {
  .hero { grid-template-columns: 1fr; text-align: left; }
  .ring { width: 104px; height: 104px; } .ring .num { font-size: 28px; }
  .cols, .row2 { grid-template-columns: 1fr; }
  .topbar { flex-wrap: wrap; gap: 8px; } .tabs { order: 3; width: 100%; } .me span { display: none; }
  .table .hide-sm { display: none; }
  .btn-row .btn { flex: 1 1 auto; }
}
