/* ============================================================
   Rufus flow (Turn 10) — layout helpers ONLY.
   Sits on top of app.css: reuses its tokens and its .tf-* wizard,
   .card, .btn.*, .setup-*, .metric-chip classes. Add NOTHING here
   that app.css already provides.

   Namespace rule: every helper in this file is .rf-* — app.css already
   owns several .rufus-* classes (.rufus-split, .rufus-seg, …) with
   different meanings and live usages. Before adding a class, grep
   app.css for the name first.

   Load AFTER app.css. All rules use var(--*) tokens (no hard hex
   except the fixed brand-dark strips and the documented Google dot),
   so light/dark both work. Every multi-column layout collapses to one
   column <=720px.
   ============================================================ */

/* mono eyebrow / kicker (P1, P7, P11, P12…) */
.rf-eyebrow{
  font:600 10px/1 var(--font-mono);
  letter-spacing:.14em;text-transform:uppercase;
  color:var(--ink-soft);
}

/* segmented control — P6 queue tabs + tone, P11 source, P15 channel + mode
   (rf-seg: app.css already owns .rufus-seg for the cadence radiogroup) */
.rf-seg{
  display:inline-flex;flex-wrap:wrap;gap:4px;
  background:var(--surface2);padding:4px;border-radius:11px;
}
.rf-seg a,.rf-seg button{
  padding:8px 15px;border:0;border-radius:8px;background:transparent;
  font:500 12.5px var(--font);color:var(--ink-soft);
  cursor:pointer;text-decoration:none;
}
.rf-seg .active,.rf-seg .rf-seg-opt:has(input:checked){
  background:var(--surface);color:var(--ink);
  font-family:var(--font-display);font-weight:600;
  box-shadow:0 1px 3px rgba(0,0,0,.08);
}

/* radio-backed seg option — same look as .rf-seg a, real input inside */
.rf-seg-opt{
  position:relative;display:inline-flex;align-items:center;
  padding:8px 15px;border-radius:8px;
  font:500 12.5px var(--font);color:var(--ink-soft);
  cursor:pointer;
}
/* radio stays in the a11y tree (focusable) but is invisible */
.rf-seg-opt input[type="radio"]{
  position:absolute;width:1px;height:1px;margin:0;opacity:0;pointer-events:none;
}
.rf-seg-opt:has(input:focus-visible){
  outline:2px solid var(--accent);outline-offset:2px;
}

/* brand-dark strip — save nudge (P5), agent status (P5/P12), sending timer (P6) */
.rf-strip{
  display:flex;align-items:center;gap:12px;
  padding:12px 16px;border-radius:13px;
  background:var(--vaitros-dark);color:#d6ede7;
  font-size:13px;line-height:1.45;
}
.rf-strip strong{color:#fff;font-weight:600;}
.rf-strip .rf-strip-ico{
  width:28px;height:28px;flex:none;border-radius:50%;
  background:rgba(46,232,197,.16);color:var(--vaitros-bright);
  display:flex;align-items:center;justify-content:center;
}
.rf-strip .rf-strip-undo{color:var(--vaitros-bright);font-weight:600;text-decoration:none;}
/* compact strip — sending timer in the P6 header */
.rf-strip.rf-strip-sm{padding:8px 13px;}

/* two-pane: work column + decision rail — P6, P11, P14
   (rf-split: app.css already owns .rufus-split for the wizard shell) */
.rf-split{display:grid;grid-template-columns:1fr 300px;gap:18px;align-items:start;}
.rf-split.greenlight{grid-template-columns:1fr 270px;}

/* today grid — P12 */
.rf-today{display:grid;grid-template-columns:1.3fr 1fr;gap:18px;}

/* waiting-for-you counts — P12 (reuses .stat from app.css; de-boxed vs inputs) */
.rf-counts{display:flex;gap:0;}
.rf-counts .stat{
  flex:1;text-align:center;padding:14px 16px;
  background:transparent;border:0;border-radius:0;box-shadow:none;
}
.rf-counts .stat + .stat{border-left:1px solid var(--border);}
.rf-counts .stat-link:hover,
.rf-counts .stat-link:focus-visible{
  box-shadow:none;
  background:var(--surface2);
}
.rf-counts .num.is-ok{color:var(--good);}
.rf-counts .num.is-warn{color:var(--rufus-warn);}

/* unlock / payoff cards — P12 (brand-dark, worded as outcomes) */
.rf-unlock{display:flex;gap:12px;}
.rf-unlock a{flex:1;padding:15px;border-radius:12px;background:var(--vaitros-dark);text-decoration:none;}
.rf-unlock .t{font:600 13px var(--font-display);color:#fff;}
.rf-unlock .s{font:400 11px/1.4 var(--font);color:#8fd6c6;margin-top:6px;}

/* plain activity log — P12 */
.rf-log{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:9px;
  font-size:12.5px;line-height:1.4;color:var(--ink-soft);}
.rf-log li{display:flex;gap:9px;}
.rf-log li::before{content:"•";color:var(--accent);}

/* required-choice card — P11 provenance */
.rf-required{border:1.5px solid var(--accent);border-radius:var(--radius);padding:16px;background:var(--surface);}

/* status dot — P14 connections */
.rf-dot{width:7px;height:7px;border-radius:50%;display:inline-block;}
.rf-dot.ok{background:var(--good);}
.rf-dot.bad{background:var(--bad);border-radius:2px;}
.rf-dot.off{background:transparent;box-shadow:inset 0 0 0 1.5px var(--border-strong);}

/* broken-tool recovery card — P14 (uses --bad tokens, theme-safe) */
.rf-broken{border:1.5px solid var(--bad-soft);border-radius:var(--radius);padding:20px;
  background:var(--surface);display:flex;flex-direction:column;gap:11px;}
.rf-broken-title{color:var(--bad);font-family:var(--font-display);font-size:1.05rem;}
/* neutral (non-warning) note inside the recovery card */
.warn.is-neutral{background:var(--surface2);border-color:var(--border);color:var(--ink-soft);}
.warn.is-neutral strong{color:var(--ink);}

/* the "why" trail — P13 (reuses app.css .field-grid for the 2-col reflow) */
.card.rf-why-row{
  background:transparent;border:0;border-radius:0;box-shadow:none;
  padding:14px 0;border-bottom:1px solid var(--border);
}
.rf-why-row .lbl{font:600 9px/1 var(--font-mono);letter-spacing:.1em;text-transform:uppercase;color:var(--ink-soft);}
.rf-why-row.worked .lbl{color:var(--good);}
.rf-why-row.didnt .lbl{color:var(--bad);}
.rf-why-row.span-2{grid-column:1/-1;border-bottom-style:dashed;}

.rf-go{display:flex;flex-wrap:wrap;gap:8px;margin:0 0 18px;}
.rf-go-in{margin:10px 0 0;}
.rf-ways{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;margin:0 0 14px;}
.rf-way{
  display:flex;flex-direction:column;gap:6px;padding:16px 18px;text-decoration:none;color:inherit;
  background:var(--surface2);border-color:transparent;
}
.rf-way:hover{border-color:var(--accent);background:var(--accent-dim);}
.rf-way strong{font:600 15px var(--font-display);color:var(--ink);}
.rf-way span{font:400 13px/1.45 var(--font);color:var(--ink-soft);}
.rf-why-actions{display:grid;grid-template-columns:1.2fr 1fr;gap:16px;margin:0 0 22px;align-items:stretch;}
.rf-why-rec{border-color:var(--accent);}
.rf-why-quiet{display:flex;align-items:center;gap:12px;margin-top:12px;font-size:13px;}
.rf-cat-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px;}
.rf-cat-card{
  padding:0 0 16px;background:transparent;border:0;border-radius:0;box-shadow:none;
  border-bottom:1px solid var(--border);
}
.rf-cat-title{margin:0 0 12px;font:600 1.05rem var(--font-display);}
.rf-cat-tools{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:0;}
.rf-cat-tools li{
  display:flex;align-items:center;gap:10px;flex-wrap:wrap;
  padding:10px 0;border-bottom:1px solid var(--border);
}
.rf-cat-tools li:last-child{border-bottom:0;}
.rf-cat-tool-name{font-weight:600;flex:1;min-width:4rem;}
.rf-tool-logo{display:inline-flex;align-items:center;justify-content:center;width:28px;height:28px;flex:none;}
.rf-tool-logo img{max-width:100%;max-height:100%;object-fit:contain;}
.rf-tool-logo--wordmark{width:72px;}

/* suggested-hook chips — P15 (reuses .tag/.tag.hook look) */
.tags.is-start{justify-content:flex-start;}

/* wizard progress fills — P1–P10 topbar (fixed per-screen widths) */
.tf-progress .w8{width:8%;}
.tf-progress .w16{width:16%;}
.tf-progress .w28{width:28%;}
.tf-progress .w40{width:40%;}
.tf-progress .w60{width:60%;}
.tf-progress .w68{width:68%;}

/* page-head as flex row — P6 queue header, P11 working-set title, P13 why header */
.rf-page-head{display:flex;align-items:center;gap:16px;flex-wrap:wrap;}
.rf-page-head.rf-page-head-split{align-items:flex-start;justify-content:space-between;}

/* first-suggestion hero — P3 */
.rf-play-hero{font-size:32px;}
.rf-play-hero-title{font-size:1.5rem;margin-top:14px;}
.rf-play-hero-reason{font-size:1rem;margin-top:10px;}

/* positive accent text — P1/P7/P8/P9 reassurance lines, P14 "nothing lost" */
.rf-ok{color:var(--good);}

/* OAuth connect — P8 logo tile + sign-in button */
.rf-oauth-logo{
  width:60px;height:60px;font-size:28px;
  border:1px solid var(--border);border-radius:16px;background:var(--surface);
  margin:8px 0 6px;display:flex;align-items:center;justify-content:center;
}
.rf-oauth-btn{display:inline-flex;align-items:center;gap:10px;background:var(--surface);}
/* Google brand mark — fixed brand colors, the one allowed hard-hex exception */
.rf-google-dot{
  width:20px;height:20px;border-radius:50%;
  background:conic-gradient(#ea4335 0 25%,#fbbc05 25% 50%,#34a853 50% 75%,#4285f4 75% 100%);
}

/* radio rows inside .setup-fields — P11 provenance
   (scoped to beat app.css .setup-fields label column rule) */
.setup-fields label.rf-radio-row{flex-direction:row;align-items:center;gap:9px;font-weight:500;}
/* compact field stack — P11 provenance radio group */
.setup-fields.is-compact{margin-top:12px;gap:10px;}

/* gate note in the good state — P10 */
.setup-gate-note.is-good{border-left-color:var(--good);}

/* accent-tinted card — P6 batch shortcut */
.card.rf-card-accent{background:var(--accent-soft);border-color:var(--accent);}

/* .actions without the default divider chrome — P12 next card, P13 header */
.rf-actions-flush{border:0;padding:0;margin-top:14px;}

/* option note line under a tf-option label — P4 alternates, P7 vendors */
.rf-option-note{display:block;font-weight:500;}

/* short-label pickers (P7 Gmail/Outlook…, P10 Slack/Teams…) — hug content, not a 760px input */
.tf-options.rf-compact{flex-direction:row;flex-wrap:wrap;}
.rf-compact .tf-option{flex:0 1 auto;padding:11px 16px;font-size:.92rem;gap:8px;}
.setup-fields .tf-options.rf-compact label.tf-option{
  max-width:none;width:auto;align-self:flex-start;
}
.rf-inbox-warn{max-width:38rem;}

/* option tile as a real submit button — P4 alternates (the form carries the
   .tf-option card chrome; the button inside is invisible but focusable) */
form.tf-option.rf-option-form{padding:0;}
form.tf-option .rf-option-btn{
  display:flex;align-items:center;gap:14px;width:100%;
  padding:16px 18px;border:0;background:transparent;color:inherit;
  font:inherit;text-align:left;cursor:pointer;border-radius:var(--radius);
}
form.tf-option .rf-option-btn:focus-visible{outline:2px solid var(--accent);outline-offset:2px;}

/* generic layout/spacing helpers (no per-element one-offs) */
.rf-row{display:flex;align-items:center;gap:9px;flex-wrap:wrap;}
.rf-col{display:flex;flex-direction:column;gap:12px;}
.rf-col.rf-col-sm{gap:8px;}
.rf-col.rf-col-md{gap:14px;}
.rf-col.rf-col-lg{gap:20px;}
.rf-grow{flex:1;}
.rf-self-start{align-self:flex-start;}
.rf-ml-auto{margin-left:auto;}
.rf-m-0{margin:0;}
.rf-mt-0{margin-top:0;}
.rf-mt-1{margin-top:8px;}
.rf-mt-2{margin-top:16px;}
.rf-mt-auto{margin-top:auto;}
.rf-mb-1{margin-bottom:12px;}
.rf-mr-1{margin-right:4px;}
.rf-small{font-size:.8rem;}

/* ---- mobile: collapse every multi-column layout ---- */
@media(max-width:720px){
  .rf-split,.rf-split.greenlight,.rf-today,.rf-ways,.rf-why-actions,.rf-cat-grid{grid-template-columns:1fr;}
  .rf-unlock{flex-direction:column;}
}
@media(max-width:520px){
  .rf-counts{flex-direction:column;}
  .rf-seg{width:100%;}
  .rf-seg a,.rf-seg button{flex:1;text-align:center;}
  .rf-seg .rf-seg-opt{flex:1;justify-content:center;}
}

/* flow-mode: wizard screens drop the app chrome (sidebar, setup rail,
   next-step banner, demo banner, FAQ widget) — the tf-* wizard topbar
   carries its own progress + non-blocking exit. */
body.flow-mode .sidebar,
body.flow-mode .setup-rail,
body.flow-mode .next-step-bar,
body.flow-mode .demo-lifecycle-banner,
body.flow-mode .site-notices,
body.flow-mode .faq-widget { display: none; }
body.flow-mode .app-main { padding: 0 20px; max-width: none; }

/* /start/account only: no Plan output pane or greenlight shell columns */
body.account-setup .gl-nav,
body.account-setup .gl-chat,
body.account-setup .gl-doc,
body.account-setup .gl-gutter,
body.account-setup .gl-rail-label { display: none !important; }
body.account-setup.app-shell.gl-shell,
body.account-setup .app-shell.gl-shell { grid-template-columns: minmax(0, 1fr) !important; }
body.account-setup .app-main,
body.account-setup .gl-chat-scroll { max-width: none; width: 100%; }
