/* =========================================================================
   UseMyContext - "Refined Ink / Quiet-Luxury"
   Warm bone background · soft warm greys · deep ink · British Racing Green.
   Schibsted Grotesk display. Hairline rules. Generous whitespace. Calm motion.
   ========================================================================= */

/* Fonts (Schibsted Grotesk / Newsreader / Playfair Display) are self-hosted via
   /fonts.css, linked from index.html - no third-party (fonts.googleapis.com) calls. */

:root {
  /* Palette - warm, never pure white, single green accent */
  --bone:        #F4F1EA;  /* page background - warm off-white */
  --bone-2:      #EFEBE2;  /* recessed surfaces */
  --paper:       #FBFAF6;  /* raised cards */
  --ink:         #1A1A17;  /* primary text - deep warm ink */
  --ink-soft:    #4A4843;  /* secondary text */
  --ink-faint:   #5D5B53;  /* tertiary / meta - darkened to meet WCAG AA 4.5:1 on the off-white + green-tint backgrounds */
  --hair:        #DCD7CC;  /* hairline rules */
  --hair-soft:   #E7E2D8;
  --green:       #1F3D2B;  /* British Racing Green - THE accent */
  --green-deep:  #16301F;
  --green-tint:  #E8EDE7;  /* faint green wash */
  --danger:      #7A3B2E;  /* muted oxblood, not red */

  --r:           14px;     /* card radius */
  --r-sm:        9px;

  /* Type */
  --display: "Schibsted Grotesk", ui-sans-serif, sans-serif;
  --serif:   "Newsreader", Georgia, serif;

  /* Motion */
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --slow: 620ms;
  --med:  420ms;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bone);
  color: var(--ink);
  font-family: var(--display);
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-feature-settings: "ss01" 1, "cv01" 1;
}

body {
  min-height: 100vh;
  /* a single, barely-there warm radial - no gradient soup */
  background:
    radial-gradient(120% 90% at 50% -10%, #FAF7F0 0%, var(--bone) 46%) fixed;
}

::selection { background: var(--green); color: var(--bone); }

button { font-family: inherit; cursor: pointer; }
input, textarea { font-family: inherit; }

a { color: var(--green); text-decoration: none; }
a:hover { font-weight: 700; }

/* ---- layout shell ------------------------------------------------------ */

#app { min-height: 100vh; display: flex; flex-direction: column; }

.shell {
  width: 100%;
  max-width: 880px;
  margin: 0 auto;
  padding: 0 28px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* Top nav - appears only when authenticated. Quiet, hairline-anchored. */
.nav {
  display: flex;
  align-items: center;
  gap: 30px;
  padding: 26px 0 22px;
  border-bottom: 1px solid var(--hair);
  margin-bottom: 56px;
}
.brand {
  display: flex; align-items: center; gap: 11px;
  font-weight: 600; letter-spacing: -0.01em; font-size: 16px;
  margin-right: auto;
}
.brand .mark {
  width: 26px; height: 26px; border-radius: 7px;
  background: var(--green);
  display: grid; place-items: center; flex: none;
}
.brand .mark::after {
  content: ""; width: 11px; height: 11px; border-radius: 50%;
  border: 2px solid var(--bone);
}
.nav a.tab {
  color: var(--ink-soft);
  font-size: 14.5px;
  letter-spacing: -0.005em;
  padding: 4px 0;
  position: relative;
  text-decoration: none;
}
.nav a.tab:hover { color: var(--ink); }
.nav a.tab.active { color: var(--green); font-weight: 500; }
.nav a.tab.active::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -23px;
  height: 1.5px; background: var(--green);
}
.nav .signout {
  background: none; border: none; color: var(--ink-faint);
  font-size: 13.5px; padding: 4px 2px;
}
.nav .signout:hover { color: var(--ink); }

/* ---- type scale -------------------------------------------------------- */

.eyebrow {
  font-size: 12px; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--green); font-weight: 600;
}
h1.display {
  font-size: clamp(30px, 5.4vw, 46px);
  line-height: 1.06;
  letter-spacing: -0.025em;
  font-weight: 600;
  margin: 18px 0 0;
  max-width: 16ch;
}
.lede {
  font-family: var(--serif);
  font-size: clamp(17px, 2.4vw, 20px);
  line-height: 1.5;
  color: var(--ink-soft);
  margin: 18px 0 0;
  max-width: 46ch;
}
h2.section {
  font-size: 23px; letter-spacing: -0.02em; font-weight: 600; margin: 0;
}
.muted { color: var(--ink-faint); }
.serif { font-family: var(--serif); }

/* ---- hairline rule ----------------------------------------------------- */
.rule { height: 1px; background: var(--hair); border: 0; margin: 0; }

/* ---- buttons ----------------------------------------------------------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  font-size: 15px; font-weight: 500; letter-spacing: -0.005em;
  padding: 13px 24px; border-radius: 999px;
  border: 1px solid transparent;
  transition: background var(--med) var(--ease), color var(--med) var(--ease),
              border-color var(--med) var(--ease), transform 120ms var(--ease),
              opacity var(--med) var(--ease);
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--green); color: var(--bone); }
.btn-primary:hover { background: var(--green-deep); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--hair); }
.btn-ghost:hover { border-color: var(--ink-faint); background: var(--paper); }
.btn-text {
  background: none; border: none; color: var(--ink-faint);
  padding: 10px 4px; font-size: 14px;
}
.btn-text:hover { color: var(--ink); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }
.btn .arrow { transition: transform var(--med) var(--ease); }
.btn-primary:hover .arrow { transform: translateX(3px); }
.btn-block { width: 100%; }

/* ---- inputs ------------------------------------------------------------ */

.field { display: flex; flex-direction: column; gap: 8px; }
.field label {
  font-size: 13px; color: var(--ink-soft); letter-spacing: 0.005em; font-weight: 500;
}
.input, .textarea {
  background: var(--paper);
  border: 1px solid var(--hair);
  border-radius: var(--r-sm);
  padding: 14px 16px;
  font-size: 16px;
  color: var(--ink);
  width: 100%;
  transition: border-color var(--med) var(--ease), box-shadow var(--med) var(--ease);
}
.input::placeholder, .textarea::placeholder { color: var(--ink-faint); }
.input:focus, .textarea:focus {
  outline: none; border-color: var(--green);
  box-shadow: 0 0 0 3px var(--green-tint);
}
.textarea { resize: vertical; min-height: 84px; line-height: 1.45; }

/* OTP input - wide tracking, centered, monospaced feel */
.otp-input {
  text-align: center;
  letter-spacing: 0.5em;
  font-size: 26px;
  font-weight: 500;
  padding-left: 0.5em; /* compensate tracking */
}

/* ---- choice cards (residency) ----------------------------------------- */

.choices { display: grid; gap: 16px; }
.choice {
  text-align: left;
  background: var(--paper);
  border: 1px solid var(--hair);
  border-radius: var(--r);
  padding: 24px 26px;
  display: flex; align-items: flex-start; gap: 18px;
  transition: border-color var(--med) var(--ease), background var(--med) var(--ease),
              transform 160ms var(--ease);
  width: 100%;
}
.choice:hover { border-color: var(--ink-faint); transform: translateY(-1px); }
.choice.selected {
  border-color: var(--green);
  background: var(--green-tint);
  box-shadow: 0 0 0 1px var(--green) inset;
}
.choice .flag {
  font-size: 26px; line-height: 1; margin-top: 2px; flex: none;
  width: 40px; height: 40px; border-radius: 9px;
  display: grid; place-items: center;
  background: var(--bone-2); border: 1px solid var(--hair-soft);
}
.choice.selected .flag { background: var(--paper); border-color: var(--green); }
.choice .ctitle { font-weight: 600; font-size: 16.5px; letter-spacing: -0.01em; }
.choice .csub { color: var(--ink-faint); font-size: 14px; margin-top: 4px; line-height: 1.45; }
.choice .tick {
  margin-left: auto; flex: none; width: 22px; height: 22px; border-radius: 50%;
  border: 1.5px solid var(--hair); display: grid; place-items: center;
  transition: all var(--med) var(--ease);
}
.choice.selected .tick { border-color: var(--green); background: var(--green); }
.choice.selected .tick::after {
  content: ""; width: 9px; height: 5px; border-left: 2px solid var(--bone);
  border-bottom: 2px solid var(--bone); transform: rotate(-45deg) translate(0, -1px);
}

/* ---- terms acceptance (login email screen) ---------------------------- */

.tos-row { display: flex; align-items: flex-start; gap: 10px; }
.tos-check {
  margin-top: 2px; width: 16px; height: 16px; flex: none; cursor: pointer;
  accent-color: var(--green);
}
.tos-text { font-size: 13.5px; color: var(--ink-soft); line-height: 1.5; cursor: pointer; }
.tos-text a { color: var(--green); text-decoration: underline; text-underline-offset: 2px; }

/* ---- marketing landing (UseMyContext front door) ----------------------- */
.landing {
  position: fixed; inset: 0; overflow-y: auto; z-index: 60;
  background: linear-gradient(135deg, #f4f0f8 0%, #e8e0f4 40%, #ddd8f0 70%, #d8d4ee 100%);
  color: #0a0a0a;
}
.lp-top {
  display: flex; align-items: center; justify-content: space-between;
  width: 100%; max-width: 1024px; margin: 0 auto;
  padding: 24px clamp(20px, 5vw, 48px);
}
.lp-logo { color: #0a0a0a; font-size: 17px; font-weight: 500; letter-spacing: -0.02em; }
.lp-logo b { font-weight: 700; }
.lp-signin { color: #6c5ce7; font-size: 14.5px; font-weight: 600; }
.lp-signin:hover { font-weight: 700; }
.lp-hero {
  min-height: 74vh; display: flex; flex-direction: column;
  align-items: center; justify-content: center; text-align: center;
  padding: 32px 24px 20px;
}
.lp-badge {
  font-size: 11.5px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase;
  color: #6c5ce7; border: 1.5px solid #c8bfff; border-radius: 100px;
  padding: 8px 18px; margin-bottom: 34px;
  animation: lp-fade 0.8s var(--ease) forwards 0.1s; opacity: 0;
}
.lp-title {
  font-family: 'Playfair Display', Georgia, serif; font-weight: 900;
  font-size: clamp(2.5rem, 7vw, 5.4rem); line-height: 1.05; letter-spacing: -0.025em;
  max-width: 14ch; color: #0a0a0a;
  animation: lp-fade 0.8s var(--ease) forwards 0.28s; opacity: 0;
}
.lp-hl {
  background: linear-gradient(180deg, transparent 52%, #bfc8f0 52%, #bfc8f0 88%, transparent 88%);
  padding: 0 0.04em;
}
.lp-sub {
  margin: 28px auto 0; max-width: 46ch; font-size: clamp(15px, 2vw, 18px);
  line-height: 1.55; color: #3a3550;
  animation: lp-fade 0.8s var(--ease) forwards 0.42s; opacity: 0;
}
.lp-cta-row { margin-top: 36px; animation: lp-fade 0.8s var(--ease) forwards 0.54s; opacity: 0; }
.lp-cta {
  display: inline-flex; align-items: center; gap: 9px;
  background: #6c5ce7; color: #fff; border: none; border-radius: 999px;
  font-size: 15.5px; font-weight: 600; padding: 14px 28px;
  transition: background 200ms var(--ease), transform 120ms var(--ease);
}
.lp-cta:hover { background: #5a48d6; }
.lp-cta:active { transform: translateY(1px); }
.lp-cta .arrow { transition: transform 200ms var(--ease); }
.lp-cta:hover .arrow { transform: translateX(3px); }
.lp-cols {
  max-width: 980px; margin: 0 auto; padding: 36px clamp(20px, 5vw, 48px) 12px;
  display: grid; grid-template-columns: 1fr 1fr; gap: clamp(28px, 6vw, 72px);
}
.lp-eyebrow {
  font-size: 12px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase;
  color: #6c5ce7; margin-bottom: 18px;
}
.lp-list { list-style: none; display: flex; flex-direction: column; gap: 15px; }
.lp-point {
  font-size: 16.5px; line-height: 1.5; color: #2a2640;
  padding-left: 26px; position: relative;
}
.lp-point::before {
  content: ""; position: absolute; left: 0; top: 9px; width: 8px; height: 8px;
  border-radius: 50%; background: #c8bfff;
}
.lp-list-value .lp-point::before { background: #6c5ce7; }
.lp-foot { text-align: center; padding: 60px 24px 84px; }
.lp-foot-title {
  font-family: 'Playfair Display', Georgia, serif; font-weight: 700;
  font-size: clamp(1.55rem, 4vw, 2.5rem); letter-spacing: -0.02em;
  margin-bottom: 26px; color: #0a0a0a;
}
@keyframes lp-fade { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }
@media (max-width: 680px) { .lp-cols { grid-template-columns: 1fr; gap: 34px; } .lp-hero { min-height: 64vh; } }

/* landing site footer */
.lp-sitefoot { border-top: 1px solid rgba(108, 92, 231, 0.16); margin-top: 8px; }
.lp-sitefoot-in {
  max-width: 1024px; margin: 0 auto; padding: 26px clamp(20px, 5vw, 48px);
  display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap;
}
.lp-copy { font-size: 13.5px; color: #6a6580; }
.lp-flinks { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }
.lp-flink {
  background: none; border: none; padding: 0; cursor: pointer;
  font-size: 13.5px; color: #4a4560; font-family: inherit; letter-spacing: -0.005em;
}
.lp-flink:hover { color: #6c5ce7; font-weight: 700; }

/* contact-us popup */
.lp-modal-ov {
  position: fixed; inset: 0; z-index: 100; padding: 20px;
  background: rgba(30, 24, 55, 0.34); backdrop-filter: blur(3px);
  display: grid; place-items: center;
  animation: lp-fade 0.18s var(--ease) forwards;
}
.lp-modal {
  position: relative; background: #fbfaff; color: #0a0a0a;
  border-radius: 18px; padding: 42px 38px 36px; max-width: 420px; width: 100%;
  box-shadow: 0 24px 64px rgba(40, 30, 80, 0.30); text-align: left;
}
.lp-modal-x {
  position: absolute; top: 14px; right: 16px; background: none; border: none;
  font-size: 26px; line-height: 1; color: #9a93b5; cursor: pointer;
}
.lp-modal-x:hover { color: #0a0a0a; }
.lp-modal-title {
  font-family: 'Playfair Display', Georgia, serif; font-weight: 700;
  font-size: 30px; letter-spacing: -0.02em; margin: 10px 0 12px;
}
.lp-modal-text { font-size: 15.5px; line-height: 1.55; color: #3a3550; margin: 0 0 20px; }
.lp-modal-email { display: inline-block; font-size: 16px; font-weight: 600; color: #6c5ce7; }
.lp-modal-email:hover { font-weight: 700; }

/* ---- subtle region selector (legacy - no longer on the login screen) -- */

.region { margin-top: 4px; }
.region-row {
  display: flex; align-items: center; gap: 14px;
}
.region-label {
  font-size: 13px; color: var(--ink-soft); font-weight: 500; letter-spacing: 0.005em;
}
.region-segs {
  display: inline-flex; gap: 0;
  border: 1px solid var(--hair); border-radius: 999px;
  background: var(--paper); padding: 3px; margin-left: auto;
}
.region-seg {
  background: none; border: none; border-radius: 999px;
  padding: 6px 16px; font-size: 13.5px; color: var(--ink-faint);
  font-weight: 500; letter-spacing: -0.005em;
  transition: background var(--med) var(--ease), color var(--med) var(--ease);
}
.region-seg:hover { color: var(--ink); }
.region-seg.active { background: var(--green); color: var(--bone); }
.region-note {
  font-family: var(--serif);
  font-size: 13.5px; line-height: 1.45; color: var(--ink-faint);
  margin: 10px 0 0; max-width: 44ch;
}

/* ---- cards / surfaces -------------------------------------------------- */

.card {
  background: var(--paper);
  border: 1px solid var(--hair);
  border-radius: var(--r);
  padding: 26px 28px;
}
.stack { display: flex; flex-direction: column; }
.stack-lg > * + * { margin-top: 22px; }
.stack-md > * + * { margin-top: 16px; }
.stack-sm > * + * { margin-top: 10px; }

/* ---- wizard scaffolding ------------------------------------------------ */

.wizard { padding: 64px 0 90px; }
.steps-meter {
  display: flex; align-items: center; gap: 8px;
  font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--ink-faint); margin-bottom: 8px;
}
.steps-meter .dots { display: flex; gap: 6px; margin-left: 12px; }
.steps-meter .dot {
  width: 6px; height: 6px; border-radius: 50%; background: var(--hair);
  transition: background var(--med) var(--ease), width var(--med) var(--ease);
}
.steps-meter .dot.done { background: var(--ink-faint); }
.steps-meter .dot.now { background: var(--green); width: 18px; border-radius: 4px; }

.wizard-foot {
  display: flex; align-items: center; gap: 14px; margin-top: 36px;
}
.wizard-foot .spacer { margin-left: auto; }

/* ---- the dev-otp / info callout ---------------------------------------- */

.callout {
  border: 1px dashed var(--hair);
  background: var(--bone-2);
  border-radius: var(--r-sm);
  padding: 14px 18px;
  font-size: 14px; color: var(--ink-soft);
  display: flex; align-items: center; gap: 12px;
}
.callout.dev { border-color: var(--green); background: var(--green-tint); }
.callout .tag {
  font-size: 10.5px; letter-spacing: 0.12em; text-transform: uppercase;
  font-weight: 600; color: var(--green); flex: none;
  border: 1px solid var(--green); border-radius: 999px; padding: 3px 9px;
}
.callout.warn { border-style: solid; border-color: #D8C9A8; background: #F6EFDD; }
.callout.warn .tag { color: var(--danger); border-color: var(--danger); }
.callout code {
  font-family: var(--display); font-weight: 600; font-size: 18px;
  letter-spacing: 0.18em; color: var(--ink); margin-left: auto;
}

/* ---- error / status line ----------------------------------------------- */
.formerr { color: var(--danger); font-size: 13.5px; min-height: 18px; }

/* ---- storage + provider rows ------------------------------------------ */

.row {
  display: flex; align-items: center; gap: 16px;
  padding: 20px 22px;
  border: 1px solid var(--hair);
  border-radius: var(--r);
  background: var(--paper);
}
.row + .row { margin-top: 12px; }
.row.disabled { background: var(--bone-2); border-style: dashed; }
.row.disabled .row-name { color: var(--ink-faint); }
.row-icon {
  width: 42px; height: 42px; border-radius: 10px; flex: none;
  display: grid; place-items: center; font-size: 19px;
  background: var(--green-tint); color: var(--green);
  border: 1px solid var(--hair-soft);
}
.row.disabled .row-icon { background: var(--bone); color: var(--ink-faint); }
.row-main { min-width: 0; }
.row-name { font-weight: 600; font-size: 15.5px; letter-spacing: -0.005em; }
.row-meta { color: var(--ink-faint); font-size: 13px; margin-top: 3px; }
.row-aside { margin-left: auto; display: flex; align-items: center; gap: 14px; }

.pill {
  font-size: 11.5px; letter-spacing: 0.04em; font-weight: 600;
  padding: 5px 11px; border-radius: 999px;
}
.pill.live { background: var(--green); color: var(--bone); }
.pill.live::before {
  content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%;
  background: var(--bone); margin-right: 7px; vertical-align: 1px;
  animation: pulse 2.4s var(--ease) infinite;
}
.pill.soon { background: var(--bone); color: var(--ink-faint); border: 1px solid var(--hair); }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.35; } }

/* ---- profile facts ----------------------------------------------------- */

.facts-list { display: flex; flex-direction: column; gap: 10px; }
.fact {
  display: flex; align-items: flex-start; gap: 14px;
  padding: 14px 12px 14px 16px;
  background: var(--paper);
  border: 1px solid var(--hair);
  border-radius: var(--r-sm);
  transition: border-color var(--med) var(--ease), box-shadow var(--med) var(--ease);
}
.fact:focus-within { border-color: var(--green); box-shadow: 0 0 0 3px var(--green-tint); }
.fact-bullet {
  width: 7px; height: 7px; border-radius: 50%; background: var(--green);
  margin-top: 10px; flex: none;
}
.fact-text {
  flex: 1; border: none; background: none; color: var(--ink);
  font-size: 16px; line-height: 1.5; padding: 2px 0; resize: none;
  font-family: var(--display);
}
.fact-text:focus { outline: none; }
.fact-acts { display: flex; align-items: center; gap: 2px; flex: none; }
.fact-act {
  background: none; border: none; cursor: pointer; padding: 5px 7px;
  font-size: 15px; line-height: 1; border-radius: 7px; opacity: 0.45;
  transition: opacity var(--med) var(--ease), background var(--med) var(--ease), transform 120ms var(--ease);
}
.fact:hover .fact-act, .fact:focus-within .fact-act { opacity: 1; }
.fact-act:hover { background: var(--bone-2); }
.fact-act:active { transform: translateY(1px); }

.savebar {
  position: sticky; bottom: 0; margin-top: 28px; padding: 18px 0 24px;
  display: flex; align-items: center; gap: 14px;
  background: linear-gradient(to top, var(--bone) 60%, transparent);
}
.savebar .savestate { font-size: 13.5px; color: var(--ink-faint); margin-left: auto; }
.savebar .savestate.ok { color: var(--green); }

/* ---- activity feed + reserved recommendations slot --------------------- */

.activity-list { list-style: none; margin: 0; padding: 0; }
.activity-item {
  display: flex; align-items: baseline; gap: 14px;
  padding: 12px 0;
}
.activity-item + .activity-item { border-top: 1px solid var(--hair); }
.activity-dot {
  flex: none; width: 6px; height: 6px; margin-top: 6px; border-radius: 50%;
  background: var(--green); opacity: 0.7;
}
.activity-body { flex: 1; min-width: 0; }
.activity-main {
  display: flex; align-items: baseline; gap: 10px;
  min-width: 0; flex-wrap: wrap;
}
/* ACTOR badge — who caused the entry. "You" for the user; a future bot/system
   actor renders its own label via the .bot variant. */
.activity-actor {
  flex: none; font-size: 11.5px; line-height: 1.4; letter-spacing: 0.04em;
  text-transform: uppercase; color: var(--ink-faint);
  border: 1px solid var(--hair); border-radius: 999px; padding: 1px 8px;
}
.activity-actor.bot {
  color: var(--green); border-color: var(--green);
}
.activity-label { font-size: 15px; color: var(--ink); }
.activity-time {
  font-size: 12.5px; color: var(--ink-faint); margin-left: auto;
  white-space: nowrap; letter-spacing: 0.01em;
}
/* DETAIL line — the specific committed diff/file summary, below the header. */
.activity-detail {
  margin-top: 3px; font-size: 14px; line-height: 1.5;
  color: var(--ink-soft, var(--ink-faint));
}
.callout.recs {
  border-style: dashed; border-color: var(--hair); background: var(--bone-2);
  align-items: flex-start;
}
.callout.recs .tag {
  color: var(--ink-faint); border-color: var(--hair);
}

/* ---- connect panel (MCP url + token) ----------------------------------- */

.copyfield {
  display: flex; align-items: stretch; gap: 0;
  border: 1px solid var(--hair); border-radius: var(--r-sm);
  background: var(--paper); overflow: hidden;
}
.copyfield .val {
  flex: 1; min-width: 0; padding: 13px 16px; font-size: 14px;
  color: var(--ink-soft); white-space: nowrap; overflow: hidden;
  text-overflow: ellipsis; align-self: center;
  font-feature-settings: "tnum" 1;
}
.copyfield .copy {
  flex: none; border: none; border-left: 1px solid var(--hair);
  background: var(--bone-2); color: var(--ink); padding: 0 20px; font-size: 13.5px;
  font-weight: 500; transition: background var(--med) var(--ease), color var(--med) var(--ease);
}
.copyfield .copy:hover { background: var(--green); color: var(--bone); }
.copyfield .copy.done { background: var(--green); color: var(--bone); }

.steplist { counter-reset: s; list-style: none; padding: 0; margin: 0; }
.steplist li {
  position: relative; padding: 4px 0 22px 44px; counter-increment: s;
  color: var(--ink-soft); font-size: 15px; line-height: 1.55;
}
.steplist li::before {
  content: counter(s);
  position: absolute; left: 0; top: 0;
  width: 28px; height: 28px; border-radius: 50%;
  border: 1px solid var(--green); color: var(--green);
  display: grid; place-items: center; font-size: 13px; font-weight: 600;
}
.steplist li:not(:last-child)::after {
  content: ""; position: absolute; left: 13.5px; top: 32px; bottom: 8px;
  width: 1px; background: var(--hair);
}
.steplist code {
  background: var(--bone-2); border: 1px solid var(--hair-soft);
  border-radius: 5px; padding: 1px 6px; font-size: 13px; color: var(--ink);
}

.code-block {
  background: #1A1A17; color: #E9E6DE; border-radius: var(--r-sm);
  padding: 18px 20px; font-size: 12.5px; line-height: 1.6;
  overflow-x: auto; white-space: pre;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
}
.code-block .k { color: #9DB8A4; }
.code-block .s { color: #D8C9A8; }

/* ---- success / done flourish ------------------------------------------ */
.done-mark {
  width: 56px; height: 56px; border-radius: 50%; background: var(--green);
  display: grid; place-items: center; margin-bottom: 6px;
}
.done-mark::after {
  content: ""; width: 18px; height: 9px;
  border-left: 2.5px solid var(--bone); border-bottom: 2.5px solid var(--bone);
  transform: rotate(-45deg) translate(0, -2px);
}

/* ---- footer ------------------------------------------------------------ */
.foot {
  margin-top: auto; padding: 40px 0 28px;
  border-top: 1px solid var(--hair);
  display: flex; gap: 18px; align-items: center; flex-wrap: wrap;
  color: var(--ink-faint); font-size: 12.5px; letter-spacing: 0.01em;
}
.foot .dot-sep { width: 3px; height: 3px; border-radius: 50%; background: var(--hair); }

/* ---- motion: staggered reveal ----------------------------------------- */

@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}
.reveal { opacity: 0; animation: rise var(--slow) var(--ease) forwards; }
.reveal.d1 { animation-delay: 70ms; }
.reveal.d2 { animation-delay: 150ms; }
.reveal.d3 { animation-delay: 240ms; }
.reveal.d4 { animation-delay: 340ms; }
.reveal.d5 { animation-delay: 450ms; }

@media (prefers-reduced-motion: reduce) {
  .reveal { animation: none; opacity: 1; }
  .pill.live::before { animation: none; }
}

/* small spinner */
.spin {
  width: 15px; height: 15px; border-radius: 50%;
  border: 2px solid currentColor; border-right-color: transparent;
  display: inline-block; animation: rot 700ms linear infinite;
}
@keyframes rot { to { transform: rotate(360deg); } }

/* ---- first-run onboarding (#/welcome) ---------------------------------- */
.welcome-values {
  list-style: none; padding: 0; margin: 22px 0 0;
  display: grid; gap: 12px; max-width: 56ch;
}
.welcome-point {
  position: relative; padding-left: 26px;
  font-family: var(--serif); font-size: 17px; line-height: 1.5; color: var(--ink-soft);
}
.welcome-point::before {
  content: ""; position: absolute; left: 4px; top: 11px;
  width: 7px; height: 7px; border-radius: 50%; background: var(--green);
}
.welcome-steps { display: grid; gap: 18px; max-width: 640px; }
.welcome-step {
  display: flex; gap: 18px; align-items: flex-start;
  background: var(--paper); border: 1px solid var(--hair);
  border-radius: var(--r-lg, 16px); padding: 22px 24px;
}
.welcome-step-num {
  flex: none; width: 32px; height: 32px; border-radius: 50%;
  border: 1px solid var(--green); color: var(--green);
  display: grid; place-items: center; font-weight: 600; font-size: 15px;
}
.welcome-step-body { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.welcome-step-title { font-size: 17px; font-weight: 600; letter-spacing: -0.01em; }
.welcome-step-sub {
  margin: 0; font-family: var(--serif); font-size: 15px; line-height: 1.5; color: var(--ink-soft);
}
.welcome-step-body .btn { margin-top: 6px; }

/* ---- connect: per-client toggle + advanced ----------------------------- */
.client-toggle {
  display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 22px;
}
.client-tab {
  background: var(--paper); border: 1px solid var(--hair); color: var(--ink-soft);
  border-radius: 999px; padding: 8px 18px; font-size: 14px; font-weight: 500;
  letter-spacing: -0.005em; cursor: pointer;
  transition: background var(--med) var(--ease), color var(--med) var(--ease),
              border-color var(--med) var(--ease);
}
.client-tab:hover { border-color: var(--ink-faint); color: var(--ink); }
.client-tab.active { background: var(--green); color: var(--bone); border-color: var(--green); }

.advanced {
  border: 1px solid var(--hair); border-radius: var(--r-sm);
  background: var(--bone-2); padding: 0 20px;
}
.advanced > summary {
  cursor: pointer; list-style: none; padding: 16px 0;
  font-size: 14px; font-weight: 600; color: var(--ink-soft);
  display: flex; align-items: center; gap: 10px;
}
.advanced > summary::-webkit-details-marker { display: none; }
.advanced > summary::before {
  content: "+"; font-size: 16px; font-weight: 600; color: var(--green);
  width: 18px; text-align: center;
}
.advanced[open] > summary::before { content: "−"; }
.advanced > summary:hover { color: var(--ink); }
.advanced > .stack { padding-bottom: 22px; }

/* Sealed access token: masked value + reveal/hide toggle + copy. The masked
   display uses tabular spacing and a touch more tracking so the bullets read
   as a deliberate seal rather than truncation. */
.copyfield .val.sealed {
  letter-spacing: 0.02em; color: var(--ink-faint);
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
}
.copyfield .copy.seal-toggle { font-weight: 500; }
.copyfield .copy.seal-toggle[aria-pressed="true"] { background: var(--green); color: var(--bone); }

/* Refresh control row beneath the token + its transient confirmation. */
.token-actions {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-top: 4px;
}
.token-actions .refresh-note {
  font-size: 12.5px; color: var(--green); font-weight: 500;
}

/* ---- responsive -------------------------------------------------------- */
@media (max-width: 620px) {
  .shell { padding: 0 20px; }
  .nav { gap: 18px; margin-bottom: 40px; flex-wrap: wrap; }
  .nav a.tab.active::after { bottom: -19px; }
  .wizard { padding: 40px 0 60px; }
  .card { padding: 22px 20px; }
  .row { padding: 16px 18px; }
  .callout { flex-wrap: wrap; }
  .callout code { margin-left: 0; }
  .welcome-step { flex-direction: column; gap: 12px; }
  .client-toggle { gap: 6px; }
}
