/* ===========================================================
   Stuart · mobile app · shared design system
   Used by stuart-app.html (flow board) and standalone frames.
   =========================================================== */
@import url('https://fonts.googleapis.com/css2?family=Inter+Tight:wght@300;400;500;600&display=swap');

:root {
  --stuart-lime:        #84BE3A;
  --stuart-lime-deep:   #6BA02D;
  --stuart-lime-pale:   #E3EBA2;
  --stuart-sage:        #C8D6B3;
  --stuart-cream:       #F5F2E9;
  --stuart-cream-2:     #ECE6D5;
  --stuart-charcoal:    #2D3835;
  --stuart-charcoal-2:  #1E2522;
  --stuart-muted:       #6C7570;
  --stuart-line:        rgba(45, 56, 53, 0.10);
  --font: 'Inter Tight', system-ui, sans-serif;
  --radius: 14px;
  --radius-sm: 8px;
  --radius-lg: 22px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-font-smoothing: antialiased; }
body { font-family: var(--font); color: var(--stuart-charcoal); }

/* ─── Flow board staging ──────────────────────────────────── */
.board {
  background: radial-gradient(1400px 800px at 50% -5%, #efeadd 0%, #e4ddcb 55%, #ddd5c0 100%);
  min-height: 100vh;
  padding: 56px 28px 96px;
}
.board-head { max-width: 1280px; margin: 0 auto 8px; }
.board-title {
  font-weight: 300; font-size: 40px; letter-spacing: -0.03em;
  color: var(--stuart-charcoal);
}
.board-title b { font-weight: 600; }
.board-sub { color: var(--stuart-muted); font-size: 15px; margin-top: 6px; max-width: 720px; line-height: 1.5; }

.flow {
  max-width: 1280px; margin: 0 auto;
  display: flex; flex-wrap: wrap; gap: 40px 34px;
  align-items: flex-start; justify-content: center;
}
.group {
  flex-basis: 100%;
  display: flex; align-items: baseline; gap: 14px;
  margin: 34px 0 -8px; padding-bottom: 12px;
  border-bottom: 1px solid rgba(45,56,53,0.12);
}
.group .g-num {
  font-size: 12px; font-weight: 600; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--stuart-lime-deep);
}
.group .g-name { font-size: 18px; font-weight: 500; letter-spacing: -0.01em; }
.group .g-note { font-size: 13px; color: var(--stuart-muted); margin-left: auto; }

.frame { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.frame-cap {
  font-size: 12px; font-weight: 500; letter-spacing: 0.04em;
  color: var(--stuart-muted); text-align: center;
}
.frame-cap b { color: var(--stuart-charcoal); font-weight: 600; display: block; font-size: 13px; }

/* ─── iPhone device (≈ iPhone 15 / 14 · 393 × 852) ────────── */
.device {
  width: 320px; height: 694px;          /* 0.814 scale of 393×852 */
  background: #000; border-radius: 46px; padding: 11px;
  box-shadow: 0 2px 4px rgba(0,0,0,.30), 0 24px 56px rgba(45,56,53,.30), inset 0 0 2px 2px #2a2a2a;
  position: relative; flex-shrink: 0;
}
.device::before {
  content: ""; position: absolute; left: -3px; top: 150px;
  width: 3px; height: 52px; background: #1a1a1a; border-radius: 2px 0 0 2px;
  box-shadow: 0 78px 0 #1a1a1a, 0 136px 0 #1a1a1a;
}
.device::after {
  content: ""; position: absolute; right: -3px; top: 204px;
  width: 3px; height: 78px; background: #1a1a1a; border-radius: 0 2px 2px 0;
}
.screen {
  width: 100%; height: 100%; background: var(--stuart-cream);
  border-radius: 36px; overflow: hidden; position: relative;
  display: flex; flex-direction: column;
}

/* status bar + island + home indicator (injected by JS) */
.island {
  position: absolute; top: 9px; left: 50%; transform: translateX(-50%);
  width: 100px; height: 28px; background: #000; border-radius: 16px; z-index: 5;
}
.statusbar {
  height: 44px; flex-shrink: 0; padding: 0 24px 6px;
  display: flex; align-items: flex-end; justify-content: space-between;
  font-size: 13px; font-weight: 600; letter-spacing: -0.01em; color: var(--stuart-charcoal);
}
.statusbar .icons { display: flex; gap: 6px; align-items: center; }
.statusbar svg { display: block; }
.home-indicator {
  position: absolute; bottom: 7px; left: 50%; transform: translateX(-50%);
  width: 108px; height: 4px; border-radius: 3px; background: var(--stuart-charcoal); opacity: .26;
}

/* ─── App header ──────────────────────────────────────────── */
.app-header {
  flex-shrink: 0; padding: 4px 18px 2px;
  display: flex; align-items: center; justify-content: space-between; min-height: 30px;
}
.app-header .logo { height: 21px; width: auto; display: block; }
.app-header .strap { font-size: 10px; color: var(--stuart-muted); letter-spacing: .02em; }
.hbtn {
  width: 28px; height: 28px; border-radius: 50%; background: var(--stuart-cream-2);
  border: none; display: grid; place-items: center; color: var(--stuart-muted);
  cursor: pointer; transition: background .15s, color .15s;
}
.hbtn:hover { background: var(--stuart-charcoal); color: var(--stuart-cream); }
.hbtn svg { width: 13px; height: 13px; }
.hgroup { display: flex; gap: 7px; }

/* ─── Body ────────────────────────────────────────────────── */
.body {
  flex: 1; overflow-y: auto; padding: 10px 18px 0;
  display: flex; flex-direction: column;
}
.body::-webkit-scrollbar { width: 0; }
.body.center { justify-content: center; text-align: center; align-items: center; }

.eyebrow {
  display: inline-flex; align-items: center; gap: 7px; align-self: flex-start;
  background: var(--stuart-lime-pale); color: var(--stuart-lime-deep);
  font-size: 10px; font-weight: 600; letter-spacing: .10em; text-transform: uppercase;
  padding: 5px 10px; border-radius: 999px; margin-bottom: 14px;
}
.body.center .eyebrow { align-self: center; }
.ping { width: 6px; height: 6px; border-radius: 50%; background: var(--stuart-lime-deep); position: relative; }
.ping::after {
  content: ""; position: absolute; inset: -4px; border-radius: 50%;
  border: 1.5px solid var(--stuart-lime-deep); opacity: .45; animation: ping 1.8s ease-out infinite;
}
@keyframes ping { 0%{transform:scale(.6);opacity:.6;} 100%{transform:scale(1.5);opacity:0;} }

.title {
  font-weight: 300; font-size: 27px; line-height: 1.08; letter-spacing: -0.03em;
  color: var(--stuart-charcoal); margin-bottom: 8px;
}
.title.sm { font-size: 22px; }
.title b { font-weight: 600; }
.lede { font-size: 14px; color: var(--stuart-muted); line-height: 1.45; letter-spacing: -0.005em; }
.lede + .lede { margin-top: 9px; }
.hl { color: var(--stuart-lime-deep); font-weight: 500; }
.kicker { font-size: 15px; font-weight: 400; color: var(--stuart-muted); line-height: 1.3; }
.big-name { font-weight: 300; font-size: 42px; line-height: 1; letter-spacing: -0.035em; margin: 4px 0 18px; }

.spacer { flex: 1; min-height: 14px; }

/* ─── Form ────────────────────────────────────────────────── */
.field { margin-bottom: 11px; }
.field label, .flabel {
  display: block; font-size: 11px; font-weight: 600; letter-spacing: .06em;
  text-transform: uppercase; color: var(--stuart-muted); margin-bottom: 5px;
}
.input, .textarea {
  width: 100%; font-family: var(--font); font-size: 14px; color: var(--stuart-charcoal);
  background: #fff; border: 1px solid var(--stuart-line); border-radius: var(--radius-sm);
  padding: 11px 13px; outline: none; transition: border-color .15s, box-shadow .15s;
}
.input:focus, .textarea:focus { border-color: var(--stuart-lime); box-shadow: 0 0 0 3px rgba(132,190,58,.16); }
.input::placeholder, .textarea::placeholder { color: #b3ad9e; }
.textarea { resize: none; min-height: 124px; line-height: 1.5; }
.row-2 { display: flex; gap: 9px; }
.row-2 .field { flex: 1; }

.check { display: flex; align-items: flex-start; gap: 9px; font-size: 12.5px; color: var(--stuart-charcoal); line-height: 1.35; cursor: pointer; margin-bottom: 9px; }
.check .box {
  width: 18px; height: 18px; border-radius: 5px; border: 1.5px solid rgba(45,56,53,.30);
  flex-shrink: 0; margin-top: 1px; display: grid; place-items: center; transition: .15s; background: #fff;
}
.check .box svg { width: 11px; height: 11px; color: #fff; opacity: 0; }
.check input { display: none; }
.check input:checked + .box { background: var(--stuart-lime); border-color: var(--stuart-lime); }
.check input:checked + .box svg { opacity: 1; }
.check a { color: var(--stuart-lime-deep); text-decoration: underline; }

/* code entry */
.code-row { display: flex; gap: 8px; justify-content: center; margin: 6px 0 16px; }
.code-cell {
  width: 38px; height: 48px; border-radius: 10px; background: #fff; border: 1px solid var(--stuart-line);
  display: grid; place-items: center; font-size: 22px; font-weight: 500; color: var(--stuart-charcoal);
}
.code-cell.filled { border-color: var(--stuart-lime); }
.code-cell.cursor { border-color: var(--stuart-lime); box-shadow: 0 0 0 3px rgba(132,190,58,.16); }

/* voice / upload io row */
.io-row { display: flex; gap: 9px; margin-top: 12px; }
.io-btn {
  flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  font-family: var(--font); font-size: 13px; font-weight: 500; color: var(--stuart-charcoal);
  background: var(--stuart-cream-2); border: none; border-radius: 999px; padding: 11px; cursor: pointer;
  transition: background .15s;
}
.io-btn:hover { background: var(--stuart-sage); }
.io-btn svg { width: 15px; height: 15px; }

/* uploaded file chip with delete cross */
.file-chip {
  display: inline-flex; align-items: center; gap: 8px; background: #fff; border: 1px solid var(--stuart-line);
  border-radius: 999px; padding: 6px 8px 6px 12px; font-size: 12px; color: var(--stuart-charcoal); margin-top: 10px;
}
.file-chip .x { width: 17px; height: 17px; border-radius: 50%; background: var(--stuart-cream-2); display: grid; place-items: center; cursor: pointer; }
.file-chip .x svg { width: 9px; height: 9px; color: var(--stuart-muted); }

/* psychographic options */
.q { margin-bottom: 18px; }
.q .qt { font-size: 15px; font-weight: 500; color: var(--stuart-charcoal); margin-bottom: 9px; letter-spacing: -0.01em; }
.opts { display: flex; gap: 8px; flex-wrap: wrap; }
.opt {
  font-family: var(--font); font-size: 13px; font-weight: 500; color: var(--stuart-charcoal);
  background: #fff; border: 1.5px solid var(--stuart-line); border-radius: 999px; padding: 9px 15px; cursor: pointer;
  transition: .15s;
}
.opt:hover { border-color: var(--stuart-sage); }
.opt.sel { background: var(--stuart-lime); border-color: var(--stuart-lime); color: var(--stuart-charcoal); }

/* ─── Cards / blocks ──────────────────────────────────────── */
.card {
  background: #fff; border: 1px solid var(--stuart-line); border-radius: var(--radius-lg);
  padding: 16px 16px 15px; box-shadow: 0 6px 20px rgba(45,56,53,.05);
}
.card + .card { margin-top: 10px; }
.card .clabel {
  font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: var(--stuart-lime-deep);
  font-weight: 600; margin-bottom: 7px;
}
.card p { font-size: 13.5px; line-height: 1.5; color: var(--stuart-charcoal); }
.card.quote p { font-style: italic; font-size: 15px; color: var(--stuart-charcoal); }

.who { display: flex; align-items: center; gap: 11px; margin-bottom: 13px; }
.avatar {
  width: 42px; height: 42px; border-radius: 50%; background: var(--stuart-sage);
  display: grid; place-items: center; font-size: 17px; font-weight: 500; color: var(--stuart-charcoal);
  letter-spacing: -0.02em; flex-shrink: 0;
}
.avatar.lg { width: 58px; height: 58px; font-size: 24px; }
.who-role { font-size: 13.5px; font-weight: 500; letter-spacing: -0.01em; }
.who-sub { font-size: 12px; color: var(--stuart-muted); margin-top: 1px; }
.rule { height: 1px; background: var(--stuart-line); margin: 13px -16px; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 13px; }
.chip { background: var(--stuart-cream-2); color: var(--stuart-charcoal); font-size: 11px; font-weight: 500; padding: 4px 10px; border-radius: 999px; }
.chip--sage { background: var(--stuart-sage); }
.chip--lime { background: var(--stuart-lime); }

.callout {
  background: #fff; border-left: 3px solid var(--stuart-lime); padding: 13px 15px;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0; font-size: 13px; color: var(--stuart-charcoal); line-height: 1.5;
}
.callout strong { color: var(--stuart-lime-deep); font-weight: 600; }

.how { display: flex; flex-direction: column; gap: 10px; margin: 4px 0; }
.how li { display: flex; gap: 10px; font-size: 13px; color: var(--stuart-charcoal); line-height: 1.45; list-style: none; }
.how li .n {
  width: 19px; height: 19px; border-radius: 50%; background: var(--stuart-lime-pale); color: var(--stuart-lime-deep);
  font-size: 11px; font-weight: 600; display: grid; place-items: center; flex-shrink: 0; margin-top: 1px;
}

/* event select list */
.ev { display: flex; align-items: center; gap: 11px; background: #fff; border: 1px solid var(--stuart-line); border-radius: var(--radius); padding: 13px 14px; margin-bottom: 9px; cursor: pointer; transition: .15s; }
.ev.sel { border-color: var(--stuart-lime); background: #fff; }
.ev .tick { width: 20px; height: 20px; border-radius: 6px; border: 1.5px solid rgba(45,56,53,.30); flex-shrink: 0; display: grid; place-items: center; }
.ev.sel .tick { background: var(--stuart-lime); border-color: var(--stuart-lime); }
.ev .tick svg { width: 11px; height: 11px; color: #fff; opacity: 0; }
.ev.sel .tick svg { opacity: 1; }
.ev .ev-name { font-size: 13.5px; font-weight: 500; letter-spacing: -0.01em; }
.ev .ev-when { font-size: 11.5px; color: var(--stuart-muted); margin-top: 1px; }

/* settings list */
.list { display: flex; flex-direction: column; }
.list a {
  display: flex; align-items: center; gap: 13px; padding: 14px 4px; font-size: 14px; color: var(--stuart-charcoal);
  border-bottom: 1px solid var(--stuart-line); cursor: pointer; text-decoration: none;
}
.list a:last-child { border-bottom: none; }
.list a .ic { width: 30px; height: 30px; border-radius: 9px; background: var(--stuart-cream-2); display: grid; place-items: center; color: var(--stuart-charcoal); flex-shrink: 0; }
.list a .ic svg { width: 15px; height: 15px; }
.list a .chev { margin-left: auto; color: var(--stuart-muted); }
.list a .chev svg { width: 14px; height: 14px; }
.list a.danger { color: #b4452f; }
.list a.danger .ic { background: #f6e3dd; color: #b4452f; }

/* photo oval */
.photo-oval {
  width: 150px; height: 188px; border-radius: 50%; margin: 6px auto 4px; overflow: hidden;
  background: linear-gradient(150deg, var(--stuart-sage), var(--stuart-cream-2));
  display: grid; place-items: center; border: 1px solid var(--stuart-line); position: relative;
}
.photo-oval img { width: 100%; height: 100%; object-fit: cover; }
.photo-oval .ph { color: var(--stuart-muted); display: grid; place-items: center; gap: 6px; font-size: 11px; }
.photo-oval .ph svg { width: 26px; height: 26px; }

/* reveal countdown ring */
.reveal-wrap { position: relative; width: 184px; height: 230px; margin: 4px auto 0; }
.reveal-oval { width: 100%; height: 100%; border-radius: 50%; overflow: hidden; background: linear-gradient(150deg, var(--stuart-sage), #b9c8a4); }
.reveal-oval img { width: 100%; height: 100%; object-fit: cover; }
.count-pill {
  position: absolute; top: 8px; right: 8px; background: var(--stuart-charcoal); color: var(--stuart-cream);
  font-size: 12px; font-weight: 600; padding: 5px 11px; border-radius: 999px; display: flex; align-items: center; gap: 6px;
}
.count-pill .d { width: 6px; height: 6px; border-radius: 50%; background: var(--stuart-lime); }

/* nodes visual (holding / searching) */
.nodes { width: 168px; height: 168px; margin: 4px auto 2px; position: relative; }
.nodes .core {
  position: absolute; top: 50%; left: 50%; width: 16px; height: 16px; margin: -8px 0 0 -8px;
  border-radius: 50%; background: var(--stuart-lime-deep);
  box-shadow: 0 0 0 6px rgba(107,160,45,.18), 0 0 0 13px rgba(107,160,45,.08);
}
.nodes .spin { position: absolute; inset: 0; animation: spin 14s linear infinite; }
.nodes .node { position: absolute; width: 9px; height: 9px; border-radius: 50%; background: var(--stuart-sage); }
.nodes .node::before {
  content: ""; position: absolute; top: 50%; left: 50%; height: 1px; transform-origin: left center;
  background: linear-gradient(90deg, rgba(107,160,45,.30), rgba(107,160,45,0));
}
@keyframes spin { to { transform: rotate(360deg); } }
.nodes.fast .spin { animation-duration: 5s; }

/* ─── Action stack ────────────────────────────────────────── */
.actions {
  flex-shrink: 0; padding: 11px 18px 6px; display: flex; flex-direction: column; gap: 8px;
  background: linear-gradient(to top, var(--stuart-cream) 72%, rgba(245,242,233,0));
}
.actions.split { flex-direction: row; }
.actions.split .btn { flex: 1; }
.btn {
  width: 100%; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--font); font-weight: 500; font-size: 14.5px; padding: 13px 18px; border-radius: 999px;
  border: none; cursor: pointer; transition: background .15s, transform .1s, color .15s, border-color .15s; letter-spacing: -0.005em;
}
.btn:active { transform: scale(.985); }
.btn--primary { background: var(--stuart-lime); color: var(--stuart-charcoal); }
.btn--primary:hover { background: var(--stuart-lime-deep); color: var(--stuart-cream); }
.btn--dark { background: var(--stuart-charcoal); color: var(--stuart-cream); }
.btn--dark:hover { background: var(--stuart-charcoal-2); }
.btn--secondary { background: transparent; color: var(--stuart-charcoal); border: 1.5px solid rgba(45,56,53,.22); }
.btn--secondary:hover { border-color: var(--stuart-charcoal); }
.btn--ghost { background: transparent; color: var(--stuart-muted); font-weight: 500; padding: 8px; }
.btn--ghost:hover { color: var(--stuart-charcoal); }
.btn--sm { font-size: 13px; padding: 10px 14px; width: auto; }
.btn svg { width: 16px; height: 16px; }
.linkrow { text-align: center; margin-top: 9px; font-size: 12.5px; color: var(--stuart-muted); }
.linkrow a { color: var(--stuart-lime-deep); text-decoration: none; font-weight: 500; }
.linkrow a:hover { text-decoration: underline; }

/* ─── Footer (every page) ─────────────────────────────────── */
.app-footer {
  flex-shrink: 0; padding: 7px 18px 22px; display: flex; align-items: center; justify-content: center; gap: 8px;
  font-size: 10.5px; color: var(--stuart-muted);
}
.app-footer img { height: 11px; width: auto; opacity: .8; }
.app-footer .dot { width: 3px; height: 3px; border-radius: 50%; background: var(--stuart-muted); opacity: .5; }
.app-footer a { color: var(--stuart-muted); text-decoration: none; }
.app-footer a:hover { color: var(--stuart-charcoal); text-decoration: underline; }

/* ─── Modal overlay (in-frame) ────────────────────────────── */
.overlay {
  position: absolute; inset: 0; z-index: 8; background: rgba(30,37,34,.46);
  display: flex; align-items: flex-end; justify-content: center; padding: 14px; border-radius: 36px;
}
.overlay.center { align-items: center; }
.sheet {
  background: var(--stuart-cream); border-radius: var(--radius-lg); padding: 20px 18px 16px; width: 100%;
  box-shadow: 0 -10px 40px rgba(0,0,0,.2);
}
.sheet h4 { font-weight: 500; font-size: 18px; letter-spacing: -0.02em; margin-bottom: 7px; }
.sheet p { font-size: 13px; color: var(--stuart-muted); line-height: 1.45; margin-bottom: 14px; }
.sheet .actions { padding: 0; background: none; }
.alert-emoji { font-size: 26px; margin-bottom: 6px; }
.danger-text { color: #b4452f; }

/* warning / status icon */
.big-ic {
  width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; margin: 0 auto 16px;
  background: var(--stuart-lime-pale); color: var(--stuart-lime-deep);
}
.big-ic.warn { background: #fbeede; color: #c98a2e; }
.big-ic svg { width: 30px; height: 30px; }
