/* Tokens copied from the weft-whetstone site (Option 1 mockup). */
:root {
  --bg: #F5F0E8; --bg-secondary: #ECE8F0; --bg-page-card: #FFFFFF;
  --fg: #1A1210; --fg-muted: rgba(26,18,16,0.65);
  --accent: #B44315; --accent-brand: #F66733; --accent-strong: #C9501F;
  --rule: #D9CFC7; --btn-bg: #B84415; --btn-fg: #FFFFFF; --btn-hover-bg: #C9501F;
  --ok: #3D7A4F; --err: #B3261E; --warn: #B45309;
  --also-free: #6B4FA0; --also-free-bg: #F0EBFA;  /* T-023 Phase A: "you're both free" slot highlight */
  --shadow-card: 0 1px 3px rgba(26,18,16,0.08), 0 8px 24px rgba(26,18,16,0.08);
  --font-display: 'Playfair Display', Georgia, 'Times New Roman', serif;
  --font-body: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --radius-md: 8px; --radius-lg: 12px; --radius-pill: 999px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #333333; --bg-secondary: #404040; --bg-page-card: #3B3B3B;
    --fg: #FFFFFF; --fg-muted: #C9C2D6; --accent: #FB9166; --accent-brand: #F66733;
    --accent-strong: #F87845; --rule: #4A4A4A; --btn-bg: #F66733; --btn-fg: #1A1210;
    --btn-hover-bg: #F87845; --ok: #6FBF83; --err: #F2B8B5; --warn: #F5B14C;
    --also-free: #C9B6F0; --also-free-bg: #4A3B66;
    --shadow-card: 0 1px 3px rgba(0,0,0,0.3), 0 8px 24px rgba(0,0,0,0.35);
  }
}
:root[data-theme="dark"] {
  --bg: #333333; --bg-secondary: #404040; --bg-page-card: #3B3B3B;
  --fg: #FFFFFF; --fg-muted: #C9C2D6; --accent: #FB9166; --accent-brand: #F66733;
  --accent-strong: #F87845; --rule: #4A4A4A; --btn-bg: #F66733; --btn-fg: #1A1210;
  --btn-hover-bg: #F87845; --ok: #6FBF83; --err: #F2B8B5; --warn: #F5B14C;
  --also-free: #C9B6F0; --also-free-bg: #4A3B66;
  --shadow-card: 0 1px 3px rgba(0,0,0,0.3), 0 8px 24px rgba(0,0,0,0.35);
}
* { box-sizing: border-box; }
/* Brand links (Matty M-133622 item 5): without this, a plain <a> falls back to the browser's default
   blue/purple instead of the brand orange. Component-specific rules (nav links, .w-cta.link buttons)
   are more specific than this bare selector and continue to win where a link shouldn't look like a link. */
a { color: var(--accent); text-decoration: underline; }
a:hover { color: var(--fg); }
body { margin: 0; background: var(--bg); color: var(--fg); font-family: var(--font-body);
  padding: 1rem; display: flex; justify-content: center; }
body.embedded { background: transparent; padding: 0; }
.widget { width: 100%; max-width: 420px; background: var(--bg-page-card); border-radius: var(--radius-md);
  box-shadow: var(--shadow-card); overflow: hidden; font-size: 0.9rem; }
.embedded .widget { box-shadow: none; border-radius: 0; max-width: none; }
.w-head { padding: 1.1rem 1.25rem 0.9rem; border-bottom: 1px solid var(--rule); }
.w-name-row { display: flex; align-items: center; gap: 0.6rem; }
.w-avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--btn-bg); color: var(--btn-fg);
  display: flex; align-items: center; justify-content: center; font-family: var(--font-display);
  font-weight: 700; font-size: 0.9rem; flex: 0 0 auto; }
.w-head h1 { margin: 0; font-size: 1rem; font-weight: 700; }
.w-sub { margin: 0.15rem 0 0; font-size: 0.78rem; color: var(--fg-muted); }
.w-body { padding: 1.1rem 1.25rem 1.25rem; display: flex; flex-direction: column; gap: 1rem; }
.field-label { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.06em; font-weight: 700;
  color: var(--fg-muted); margin-bottom: 0.5rem; display: block; }
.seg { display: flex; border: 1px solid var(--rule); border-radius: var(--radius-pill); padding: 3px; gap: 3px;
  background: var(--bg-secondary); }
.seg button { flex: 1; border: none; background: none; padding: 0.5rem 0.6rem; font-family: var(--font-body);
  font-size: 0.82rem; font-weight: 600; border-radius: var(--radius-pill); color: var(--fg-muted); cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 0.4rem; }
.seg button.active { background: var(--btn-bg); color: var(--btn-fg); }
.seg svg { width: 14px; height: 14px; }
select, input[type=text], input[type=email], input[type=tel], input[type=password], input[type=number], input[type=time], textarea { width: 100%; font-family: var(--font-body); font-size: 0.85rem;
  padding: 0.6rem 0.7rem; border-radius: var(--radius-md); border: 1px solid var(--rule);
  background: var(--bg-page-card); color: var(--fg); }
textarea { resize: vertical; min-height: 4rem; }
.stack { display: flex; flex-direction: column; gap: 0.5rem; }
.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 0.5rem; }
.cal-head .field-label { margin: 0; }
.cal-nav { display: flex; gap: 0.25rem; }
/* T-052 (T-043 panel finding, converged by all 3 reviewers): 28px is well under the ~44px touch-target
   guideline (Apple HIG / Material / WCAG 2.5.5) -- raised toward it. Not a breakpoint-gated change (no
   width-based media query existed in this file at all) since this is a small circular icon button a
   mobile visitor hits just as often as a desktop one. */
.cal-nav button { border: 1px solid var(--rule); background: none; color: var(--fg); border-radius: 50%;
  width: 36px; height: 36px; cursor: pointer; font-size: 0.9rem; }
.cal-nav button:disabled { opacity: 0.3; cursor: default; }
.mini-cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; text-align: center; }
.dow { font-size: 0.65rem; color: var(--fg-muted); font-weight: 700; padding-bottom: 2px; }
.day { aspect-ratio: 1; display: flex; align-items: center; justify-content: center; border-radius: 50%;
  font-size: 0.78rem; color: var(--rule); border: none; background: none; font-family: var(--font-body); padding: 0; }
.day.has-slots { color: var(--fg); cursor: pointer; position: relative; }
.day.has-slots::after { content: ''; position: absolute; bottom: 14%; width: 4px; height: 4px; border-radius: 50%; background: var(--accent-brand); }
.day.selected::after { background: var(--btn-fg); }
.day.has-slots:hover { background: var(--bg-secondary); }
.day.selected { background: var(--btn-bg); color: var(--btn-fg); font-weight: 700; }
.slot-row { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.slot { padding: 0.5rem 0.85rem; border: 1px solid var(--accent); border-radius: var(--radius-pill);
  font-size: 0.8rem; font-weight: 600; color: var(--accent); cursor: pointer; background: var(--bg-page-card);
  font-family: var(--font-body); }
.slot.picked { background: var(--btn-bg); border-color: var(--btn-bg); color: var(--btn-fg); }
.w-cta { width: 100%; padding: 0.75rem; border-radius: var(--radius-md); border: none; background: var(--btn-bg);
  color: var(--btn-fg); font-family: var(--font-body); font-weight: 700; font-size: 0.82rem;
  text-transform: uppercase; letter-spacing: 0.04em; cursor: pointer; }
.w-cta:hover:not(:disabled) { background: var(--btn-hover-bg); }
.w-cta:disabled { opacity: 0.5; cursor: default; }
.muted { color: var(--fg-muted); font-size: 0.78rem; }
.error { color: var(--err); font-size: 0.82rem; }
.done { text-align: center; padding: 1rem 0; }
.done h2 { font-family: var(--font-display); margin: 0.25rem 0 0.5rem; }
.done .tick { color: var(--ok); font-size: 2rem; }
button:focus-visible, select:focus-visible, input:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px; }

.fallback { text-align: center; padding: 0.5rem 0; }
.fallback p { margin: 0 0 0.9rem; font-size: 1rem; line-height: 1.5; }
.fallback .fallback-title { font-size: 1.2rem; font-weight: 700; }
a.w-cta.link { display: inline-block; width: auto; padding: 0.7rem 1rem; text-decoration: none; margin: 0.2rem; }

/* Review screen (Matty M-133622 item 6): picking a time moves to its own screen with the selections
   summarized, the details form, and a way back -- instead of the form just appearing under the grid. */
.w-back { background: none; border: none; padding: 0; margin: 0 0 0.3rem; color: var(--accent);
  font-family: var(--font-body); font-size: 0.8rem; font-weight: 600; cursor: pointer;
  display: inline-flex; align-items: center; gap: 0.3rem; text-decoration: underline; }
.w-back:hover { color: var(--accent-strong); }
.review-card { border: 1px solid var(--rule); border-radius: var(--radius-md); padding: 0.7rem 0.9rem;
  background: var(--bg-secondary); }
.review-row { display: flex; justify-content: space-between; gap: 0.75rem; padding: 0.35rem 0; font-size: 0.85rem; }
.review-row:not(:last-child) { border-bottom: 1px solid var(--rule); }
.review-row .rk { color: var(--fg-muted); }
.review-row .rv { font-weight: 600; text-align: right; }

.slot.warn { border-style: dashed; }
.slot.warn.picked { border-style: solid; }
/* T-023 Phase A (plan 24.6): never color alone -- the checkmark (.slot-also-free, rendered in the
   button's own label) carries the meaning too, for visitors who can't distinguish the purple fill. */
.slot.also-free { border-color: var(--also-free); color: var(--also-free); background: var(--also-free-bg); }
.slot.also-free.picked { background: var(--also-free); border-color: var(--also-free); color: var(--btn-fg); }
.slot-also-free { font-weight: 700; }
.peek-row { font-size: 0.82rem; line-height: 1.5; margin: 0.6rem 0; }
.peek-explainer { margin: 0.3rem 0 0; }
/* T-089 (Matty M-135833, verified: "Put this in purple instead of orange"): this button is what
   TURNS ON the "you're both free" purple highlighting (.slot.also-free below, already purple) --
   using the brand orange (--accent) here instead of --also-free made it look disconnected from what
   it actually does. */
.peek-connect-btn { display: inline-block; padding: 0.55rem 0.9rem; border-radius: var(--radius-pill);
  border: 1px solid var(--also-free); background: var(--bg-page-card); color: var(--also-free);
  font-family: var(--font-body); font-size: 0.8rem; font-weight: 600; cursor: pointer; }
.peek-connect-btn:hover:not(:disabled) { background: var(--bg-secondary); }
.peek-connect-btn:disabled { opacity: 0.6; cursor: default; }
.link-btn { background: none; border: none; padding: 0; margin: 0; color: var(--accent);
  font-family: var(--font-body); font-size: inherit; font-weight: 600; cursor: pointer; text-decoration: underline; }
.link-btn:hover { color: var(--accent-strong); }
.sug-list { display: flex; flex-direction: column; gap: 0.25rem; }
.sug-list .sug { text-align: left; border: 1px solid var(--rule); background: var(--bg-secondary); color: var(--fg); border-radius: var(--radius-md);
  padding: 0.5rem 0.7rem; font-family: var(--font-body); font-size: 0.82rem; cursor: pointer; }
.sug-list .sug:hover { border-color: var(--accent); }
.place-note { font-size: 0.8rem; line-height: 1.4; padding: 0.4rem 0.6rem; border-radius: var(--radius-md); background: var(--bg-secondary); color: var(--fg-muted); }
.place-note.ok { color: var(--ok); }
.place-note.warn { border-left: 3px solid var(--accent-brand); color: var(--fg); }

/* T-052 (T-043 panel finding): same 28px -> touch-target raise as .cal-nav above -- the grid column,
   spacer, and wrap widths all move together with .loc-status itself so the icon stays centered and
   aligned with .loc-spacer's placeholder rows. */
.loc-grid { display: grid; grid-template-columns: 36px 1fr; gap: 0.5rem; align-items: start; }
.loc-spacer { display: block; width: 36px; }
.loc-status-wrap { position: relative; display: flex; align-items: center; justify-content: center; width: 36px; height: 2.45rem; }
.loc-status { border: none; background: none; padding: 0; width: 36px; height: 36px; cursor: help; display: flex; align-items: center; justify-content: center; color: var(--fg-muted); border-radius: 50%; }
.loc-status.none { opacity: 0.45; }
.loc-status.ok { color: var(--ok); }
.loc-status.bad { color: var(--warn); }
.loc-status svg { width: 24px; height: 24px; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.loc-pop { display: none; position: absolute; left: 0; top: calc(100% - 0.2rem); z-index: 20; width: min(280px, calc(100vw - 3rem)); box-sizing: border-box;
  background: var(--bg-page-card); color: var(--fg); border: 1px solid var(--rule); border-left: 4px solid var(--rule); border-radius: var(--radius-md);
  box-shadow: var(--shadow-card); padding: 0.6rem 0.75rem; font-size: 0.82rem; line-height: 1.4; text-align: left; }
.loc-pop.ok { border-left-color: var(--ok); }
.loc-pop.bad { border-left-color: var(--warn); }
.loc-status-wrap:hover .loc-pop, .loc-status-wrap:focus-within .loc-pop, .loc-status-wrap.pinned .loc-pop { display: block; }
.loc-pop .ps-head { display: flex; align-items: center; gap: 0.4rem; margin-bottom: 0.15rem; }
.loc-pop.ok .ps-head { color: var(--ok); }
.loc-pop.bad .ps-head { color: var(--warn); }
.loc-pop.none .ps-head { color: var(--fg-muted); }
.loc-pop svg { width: 16px; height: 16px; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; flex: 0 0 auto; }
.loc-pop .ps-line { overflow-wrap: anywhere; }
.loc-pop .ps-line.muted { color: var(--fg-muted); }
.legend { margin: 0 0 0.6rem; font-size: 0.78rem; line-height: 1.4; color: var(--fg-muted); }

.muted.hint { min-height: 3.6rem; }  /* room below the location row so the hover popup is never clipped by the card */

/* choose_person member picker (T-020, plan 23.9) */
.member-list { display: flex; flex-direction: column; gap: 0.5rem; }
.member-pick { display: flex; align-items: center; gap: 0.6rem; width: 100%; text-align: left;
  border: 1px solid var(--rule); border-radius: var(--radius-md); background: var(--bg-page-card);
  color: var(--fg); padding: 0.6rem 0.8rem; font-family: var(--font-body); font-size: 0.85rem; font-weight: 600;
  cursor: pointer; }
.member-pick:hover { border-color: var(--accent); background: var(--bg-secondary); }
.member-avatar { width: 28px; height: 28px; border-radius: 50%; background: var(--accent-brand); color: #fff;
  display: flex; align-items: center; justify-content: center; font-family: var(--font-display);
  font-weight: 700; font-size: 0.85rem; flex: 0 0 auto; }
/* combined_availability slot counts (plan 23.7: count only, never who) */
.slot-count { font-weight: 400; opacity: 0.85; }

/* Floating credit: stays at the bottom of the screen (or of the popup) while the form scrolls. `overflow: clip` keeps
   the card's rounded corners without turning it into a scroll container, which would stop the footer sticking. */
.widget { overflow: hidden; overflow: clip; }
.w-foot { position: sticky; bottom: 0; z-index: 10; display: flex; align-items: center; justify-content: center; gap: 0.5rem;
  padding: 0.55rem 0.75rem; background: var(--bg-page-card); border-top: 1px solid var(--rule); text-decoration: none;
  color: var(--fg-muted); font-size: 0.68rem; letter-spacing: 0.03em; }
.w-foot:hover .w-foot__by { color: var(--fg); }
/* T-132 (Matty M-136611 item 1: "a little smaller"): scales the whole wordmark down proportionally --
   the SVG's viewBox and internal font-sizes (.wm/.amp below) are tuned together as a tight-fit unit, so
   shrinking the rendered height (not font-size, which would leave empty space inside the same viewBox)
   keeps everything in proportion with zero risk of introducing awkward whitespace. Was 15px. */
.w-foot__logo { height: 13px; width: auto; display: block; overflow: visible; }
.w-foot__logo text { font-family: 'Playfair Display', Georgia, 'Times New Roman', serif; }
.w-foot__logo .wm { font-size: 34px; font-weight: 700; font-variant: small-caps; letter-spacing: 0.06em; fill: var(--fg); }
.w-foot__logo .amp { font-size: 28px; font-weight: 400; fill: var(--accent-brand); }
.w-foot:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }

/* T-161: visually hidden status line for screen readers (step changes are announced here, not by a live <main>). */
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden;
  clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
.demo-note { margin: 0 0 0.75rem; padding: 0.4rem 0.6rem; border: 1px dashed var(--rule); border-radius: var(--radius-md); color: var(--fg-muted); font-size: 0.8rem; }
