/* =====================================================================
 * Time Rich accelerator portal - content styles.
 *
 * Every class is prefixed "trp-" so nothing here can collide with the
 * existing portal pages or with Tailwind's utilities. Colours and fonts
 * are the portal's own, lifted from club/dashboard.html.
 *
 * To restyle: override the custom properties on :root, or just rewrite
 * the rules. No JavaScript depends on any of these declarations, only
 * on the class names.
 * ===================================================================== */

/* "Members" is in the menu for everyone now, carrying a purple Soon pill,
   so the two rules that used to hide it are gone.

   They worked because Tailwind's .flex on the phone-menu link, and
   .trp-nav-link's own display on the desktop one, both beat the browser's
   [hidden] rule -- so [hidden] only did anything here while this file put
   it back. Without them the link shows whatever portal-access.js decides.

   The script itself is untouched: it still asks the Worker whether the
   directory is open and still toggles [hidden] and [data-pending]. That
   answer simply no longer decides anything, which is what lets the gate be
   switched back on by restoring these two rules and dropping the pill. */

/* ---- the palette ------------------------------------------------------
   The redesign's colours, written down once. These mirror the --c-* RGB
   triplets in portal-tailwind-src.css, which is what the Tailwind utilities
   (text-brand-ink, bg-brand-green, ...) resolve from. Both have to stay in
   step: this file names the colours for the hand-written .trp- components,
   that one names them for the generated utilities.

   Only the two themes' values differ, so everything below that is not a
   colour -- the radius, the faces -- is written once.
   --------------------------------------------------------------------- */
:root {
  /* paper */
  --trp-cream:    #FFFCEB;
  --trp-offwhite: #FFFDFB;   /* the page */

  /* the two light greens: a soft button, a code box */
  --trp-sage:     #D8D9B9;
  --trp-sagelt:   #E5E6CF;

  /* the green, for a button and for the active menu item */
  --trp-green:    #424B36;
  --trp-mid:      #4E5840;

  /* type. The green is out of the ink: text is a warm near-black and the
     quiet ink a warm grey, so a page of small print stops reading green. */
  --trp-deep:     #1A1816;
  --trp-soft:     #57534E;

  /* accent */
  --trp-lime:     #CCEEA0;
  --trp-olive:    #67762E;

  /* Purple is reserved for "not yet" -- a Soon pill beside a link, a Coming
     soon pill on a card -- and appears nowhere else. */
  --trp-plumbg:   #EEEBFF;
  --trp-plum:     #4A3DB8;

  --trp-line:     rgba(26, 24, 22, 0.12);
  --trp-shadow:   none;
  --trp-radius:   20px;

  /* Two faces, the same two as portal-tailwind-src.css: Space Grotesk for
     headings, Inter for body copy, menus and labels. --trp-mono is kept as
     a name because rules below still ask for it, but it points at Inter --
     nothing the member reads is monospaced any more. */
  --trp-sans:    "Inter", "Inter Fallback", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, sans-serif;
  --trp-display: "Space Grotesk", "Space Grotesk Fallback", var(--trp-sans);
  --trp-mono:    var(--trp-sans);
}

/* The dark theme swaps the ink family and the paper family over, exactly as
   portal-tailwind-src.css does, so a component written as "green fill, paper
   type" inverts without a rule of its own. */
:root[data-theme='dark'] {
  --trp-cream:    #222320;
  --trp-offwhite: #1C1D1A;
  --trp-sage:     #272824;
  --trp-sagelt:   #2F302B;
  --trp-green:    #E6E4D6;
  --trp-mid:      #CDCEC3;
  --trp-deep:     #F4F1E6;
  --trp-soft:     #C3C3B8;
  --trp-olive:    #CCEEA0;
  --trp-plumbg:   #2F2B4F;
  --trp-plum:     #C7C1FF;
  --trp-line:     rgba(244, 241, 230, 0.22);
}

@media (prefers-color-scheme: dark) {
  :root[data-theme='system'] {
    --trp-cream:    #222320;
    --trp-offwhite: #1C1D1A;
    --trp-sage:     #272824;
    --trp-sagelt:   #2F302B;
    --trp-green:    #E6E4D6;
    --trp-mid:      #CDCEC3;
    --trp-deep:     #F4F1E6;
    --trp-soft:     #C3C3B8;
    --trp-olive:    #CCEEA0;
    --trp-plumbg:   #2F2B4F;
    --trp-plum:     #C7C1FF;
    --trp-line:     rgba(244, 241, 230, 0.22);
  }
}

/* ---- gating -----------------------------------------------------------
 * portal-access.js sets data-tr-portal on <html> to "loading", "in" or
 * "out". Both member content and the login form stay hidden until the
 * script knows which it is, so neither flashes on load.
 * --------------------------------------------------------------------- */

.trp-when-in,
.trp-when-out,
.trp-when-loading { display: none; }

[data-tr-portal="in"]      .trp-when-in      { display: block; }
[data-tr-portal="out"]     .trp-when-out     { display: block; }
[data-tr-portal="loading"] .trp-when-loading { display: block; }

/* ---- whole-page gate ---------------------------------------------------
 * Pages with no login form of their own (dashboard, curriculum, sessions,
 * resources, lesson) opt in with data-trp-gate on <html>. Everything in the
 * body stays hidden until portal-access.js has checked the code, so member
 * content cannot flash. Nothing is given a display value here: once the
 * check passes the rule stops matching and each element goes back to the
 * display its own classes set, so the page's layout is untouched.
 * --------------------------------------------------------------------- */

html[data-trp-gate]:not([data-tr-portal="in"]) body > *:not(script):not(style) {
  display: none !important;
}

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

.trp-wrap {
  box-sizing: border-box;
  width: 100%;
  max-width: 48rem;
  margin: 0 auto;
  padding: 2rem 1rem 4rem;
  font-family: var(--trp-sans);
  color: var(--trp-deep);
}

.trp-wrap *,
.trp-wrap *::before,
.trp-wrap *::after { box-sizing: border-box; }

.trp-section { margin-top: 2.5rem; }

.trp-h1,
.trp-h2 {
  font-family: var(--trp-display);
  letter-spacing: -0.022em;
  color: var(--trp-deep);
  margin: 0 0 0.75rem;
  overflow-wrap: break-word;
}

.trp-h1 { font-size: clamp(1.75rem, 6vw, 2.25rem); font-weight: 700; }
.trp-h2 { font-size: clamp(1.125rem, 4vw, 1.375rem); font-weight: 700; }

/* The comma only appears once there is actually a name to show. */
.trp-name:not(:empty)::before { content: ", "; }

/* ---- weeks -------------------------------------------------------------- */

.trp-week {
  background: var(--trp-offwhite);
  border: 1px solid var(--trp-line);
  border-radius: var(--trp-radius);
  box-shadow: var(--trp-shadow);
  padding: 1.25rem;
  margin-bottom: 1rem;
}

.trp-week-locked { background: transparent; box-shadow: none; }

.trp-week-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.5rem 0.75rem;
  margin-bottom: 0.5rem;
}

.trp-week-title {
  font-family: var(--trp-display);
  font-size: 1.125rem;
  font-weight: 700;
  margin: 0;
  min-width: 0;
  overflow-wrap: break-word;
}

.trp-week-locked .trp-week-title { color: var(--trp-soft); }

.trp-week-summary,
.trp-week-meta {
  margin: 0 0 0.75rem;
  font-size: 0.875rem;
  line-height: 1.6;
  color: var(--trp-mid);
  overflow-wrap: break-word;
}

.trp-week-meta { font-size: 0.8125rem; color: rgba(78, 88, 64, 0.8); }

.trp-badge {
  flex: none;
  padding: 0.125rem 0.5rem;
  border-radius: 0.25rem;
  background: rgba(66, 75, 54, 0.06);
  font-size: 0.5625rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--trp-mid);
  white-space: nowrap;
}

/* ---- items --------------------------------------------------------------- */

.trp-items {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 1rem;
}

.trp-item {
  min-width: 0;
  padding-top: 1rem;
  border-top: 1px solid var(--trp-line);
}

.trp-item:first-child { padding-top: 0; border-top: 0; }

.trp-item-title {
  font-family: var(--trp-display);
  font-size: 0.9375rem;
  font-weight: 700;
  margin: 0 0 0.375rem;
  overflow-wrap: break-word;
}

.trp-item-body {
  margin: 0 0 0.75rem;
  font-size: 0.875rem;
  line-height: 1.6;
  color: var(--trp-mid);
  white-space: pre-wrap;        /* keeps the line breaks in body text */
  overflow-wrap: break-word;
}

.trp-empty {
  margin: 0;
  font-size: 0.875rem;
  color: rgba(78, 88, 64, 0.75);
}

/* ---- video ---------------------------------------------------------------- */

.trp-video {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  margin: 0 0 0.75rem;
  border-radius: 0.75rem;
  overflow: hidden;
  background: var(--trp-sagelt);
}

.trp-video iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

/* Fallback for browsers without aspect-ratio. */
@supports not (aspect-ratio: 16 / 9) {
  .trp-video { height: 0; padding-bottom: 56.25%; }
}

/* ---- sessions --------------------------------------------------------------- */

.trp-session {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  padding: 1rem 0;
  border-bottom: 1px solid var(--trp-line);
}

.trp-session-title {
  font-family: var(--trp-display);
  font-size: 0.9375rem;
  font-weight: 700;
  margin: 0;
  flex: 1 1 14rem;
  min-width: 0;
  overflow-wrap: break-word;
}

.trp-session-meta {
  margin: 0;
  font-size: 0.8125rem;
  color: var(--trp-mid);
  flex: 1 1 100%;
}

/* ---- buttons and links ---------------------------------------------------------- */

.trp-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

/* .trp-btn and its fills are defined once, in portal-tailwind-src.css, with
   the brand's pill shape and a 44px minimum height. The copies that used to
   sit here were a 12px-radius box at 36px tall, and because this file loads
   after portal.css they quietly beat the real ones. */
.trp-btn[disabled] { opacity: 0.5; cursor: not-allowed; }

/* ---- login form ------------------------------------------------------------------- */

.trp-login {
  max-width: 24rem;
  margin: 0 auto;
  padding: 1.5rem;
  background: var(--trp-offwhite);
  border: 1px solid var(--trp-line);
  border-radius: var(--trp-radius);
  box-shadow: var(--trp-shadow);
}

.trp-label {
  display: block;
  margin-bottom: 0.375rem;
  font-family: var(--trp-mono);
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--trp-mid);
}

.trp-input {
  display: block;
  width: 100%;
  padding: 0.75rem 1rem;
  margin-bottom: 0.75rem;
  border: 1px solid var(--trp-sage);
  border-radius: 0.75rem;
  background: var(--trp-offwhite);
  color: var(--trp-deep);
  font-family: var(--trp-mono);
  font-size: 1rem;              /* 16px stops iOS zooming on focus */
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.trp-input::placeholder { color: rgba(78, 88, 64, 0.45); letter-spacing: normal; }

.trp-input:focus {
  outline: none;
  border-color: var(--trp-olive);
  box-shadow: 0 0 0 3px rgba(103, 118, 46, 0.15);
}

.trp-login .trp-btn { width: 100%; }

.trp-error:empty { display: none; }

.trp-error {
  margin: 0.75rem 0 0;
  font-size: 0.8125rem;
  line-height: 1.5;
  color: #8A2F22;
  overflow-wrap: break-word;
}

.trp-hint {
  margin: 0.75rem 0 0;
  font-size: 0.75rem;
  color: rgba(78, 88, 64, 0.8);
}

/* ---- phone ---------------------------------------------------------------------------- */

@media (max-width: 480px) {
  .trp-wrap    { padding: 1.5rem 1rem 3rem; }
  .trp-week    { padding: 1rem; border-radius: 1rem; }
  .trp-login   { padding: 1.25rem; border-radius: 1rem; }
  .trp-actions { width: 100%; }
  .trp-actions .trp-btn { flex: 1 1 auto; }
}

@media (prefers-reduced-motion: reduce) {
  .trp-btn { transition: none; }
}

/* The live-data blocks hide themselves with the hidden attribute. Tailwind's
   display utilities would otherwise win, so make hidden mean hidden. */
[hidden] { display: none !important; }

/* ---- entrance ----------------------------------------------------------
 * A short opacity fade, driven by CSS so the first paint never waits on a
 * script. The old version set opacity:0 inline and removed it from a
 * requestAnimationFrame, which meant a slow script left the page blank:
 * Lighthouse scored it NO_FCP, "the page did not paint any content".
 * No transform, so there is nothing to rasterise twice.
 * --------------------------------------------------------------------- */
@keyframes trp-fade-in { from { opacity: 0; } to { opacity: 1; } }

body { animation: trp-fade-in 180ms ease-out both; }

@media (prefers-reduced-motion: reduce) {
  body { animation: none; }
}

/* The backdrop blur is gone. A card is opaque now -- white, or sage, or the
   deep green on the dashboard -- so there was nothing behind it left to
   blur, and the filter was still forcing every card onto a compositing
   layer of its own on every page. */

/* Tailwind's min-h-screen is 100vh, which on a phone counts the browser bar
   and pushes the last rows out of reach. dvh tracks the bar as it hides, so
   the page is exactly as tall as the space actually available. The vh line
   stays first as the fallback for anything without dvh. */
.min-h-screen { min-height: 100vh; }

@supports (min-height: 100dvh) {
  .min-h-screen { min-height: 100dvh; }
}

/* Compact, keyboard-accessible day/night control. */
.trp-theme[hidden]{display:none}
.trp-day-night{position:relative;display:inline-flex;align-items:center;justify-content:space-around;width:76px;height:38px;padding:4px;border:1px solid var(--trp-rule);border-radius:999px;background:rgb(var(--c-ink)/.04);color:var(--trp-text);cursor:pointer;flex:none}
.trp-day-night svg{position:relative;z-index:1;width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:1.5;stroke-linecap:round;stroke-linejoin:round}
.trp-day-night-thumb{position:absolute;left:4px;top:4px;width:28px;height:28px;border-radius:50%;background:rgb(var(--c-surface));box-shadow:0 1px 4px #00000012;transition:transform .2s ease}
.trp-day-night[aria-checked=true] .trp-day-night-thumb{transform:translateX(38px)}
.trp-day-night:hover{border-color:var(--trp-rule-2)}
.trp-day-night:focus-visible{outline:2px solid rgb(var(--c-olive));outline-offset:3px}
@media(prefers-reduced-motion:reduce){.trp-day-night-thumb{transition:none}}

/* The agent name in the comparison table that portal-agents.js builds. It
   is a link now, on both the Resources page and in Week 1 of the course, and
   the cell it sits in is already set in the heading face at the page's ink --
   so the link only has to say it is one, and not fight the colour. */
.trp-agents .trp-agent-link {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
  text-decoration-color: rgb(var(--c-ink) / .35);
}
.trp-agents .trp-agent-link:hover { text-decoration-color: currentColor; }
.trp-agents .trp-agent-link:focus-visible {
  outline: 2px solid rgb(var(--c-olive));
  outline-offset: 3px;
  border-radius: 3px;
}

/* =====================================================================
 * The feedback form, the pill and the side panel.
 *
 * One component, three places: the full page at /club/feedback, the panel
 * that slides in from the pill on every other Club page, and the thank-you
 * both of them end on. Everything here is built by portal-chrome.js, which
 * every Club page already loads, so no page carries any of it itself.
 *
 * Every colour is a token. In the dark theme --c-green is a light cream and
 * --c-page is near-black, so "green fill, paper type" inverts on its own and
 * nothing below needs a dark rule of its own.
 *
 * Motion lives at the bottom, in one place, so prefers-reduced-motion can
 * take all of it off at once.
 * ------------------------------------------------------------------- */

/* ---- the column the form sits in ----------------------------------- */

.trp-fb-wrap { width: 100%; max-width: 600px; margin: 0 auto; padding: 0 16px; }
@media (min-width: 640px) { .trp-fb-wrap { padding: 0; } }

.trp-fb-back { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; font-size: 14px; font-weight: 600; color: var(--trp-muted); text-decoration: none; }
.trp-fb-back:hover { color: var(--trp-ink); }
.trp-fb-back:focus-visible { outline: 2px solid rgb(var(--c-green)); outline-offset: 3px; border-radius: 6px; }
.trp-fb-back svg { width: 18px; height: 18px; flex: none; }

/* The heading block: smaller than a page title, and centred over the
   column. The h1 is ~30% down from the .trp-title it used to be. */
.trp-fb-head { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; margin: 20px 0 24px; }
.trp-fb-eyebrow { font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--trp-muted); }
.trp-fb-h1 { margin: 0; font-family: var(--trp-face); font-weight: 600; font-size: clamp(24px, 4vw, 30px); line-height: 1.15; letter-spacing: -.02em; color: var(--trp-ink); }
.trp-fb-h1 .trp-stop { color: rgb(var(--c-olive)); }
.trp-fb-lede { margin: 0; font-size: 14px; line-height: 1.5; color: var(--trp-muted); }

/* ---- the two-step indicator ---------------------------------------- */

.trp-fb-steps { display: flex; align-items: center; justify-content: center; gap: 10px; margin: 0 0 20px; }
.trp-fb-step { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 600; color: var(--trp-muted); }
.trp-fb-step-n { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; border-radius: 999px; border: 1px solid var(--trp-rule); font-size: 12px; line-height: 1; }
.trp-fb-step.is-on { color: var(--trp-ink); }
.trp-fb-step.is-on .trp-fb-step-n { background: rgb(var(--c-green)); border-color: rgb(var(--c-green)); color: rgb(var(--c-page)); }
.trp-fb-step-line { width: 36px; height: 1px; background: var(--trp-rule); flex: none; }

/* ---- the card ------------------------------------------------------- */

.trp-fb-card { position: relative; background: rgb(var(--c-surface)); border: 1px solid var(--trp-rule); border-radius: 20px; padding: 24px; }
@media (min-width: 640px) { .trp-fb-card { padding: 28px; } }

/* 32px between a card's sections, 24px between the fields inside one. */
.trp-fb-sections { display: flex; flex-direction: column; gap: 32px; }
.trp-fb-section { display: flex; flex-direction: column; gap: 24px; }
.trp-fb-field { display: flex; flex-direction: column; gap: 8px; border: 0; margin: 0; padding: 0; min-width: 0; }
.trp-fb-label { font-size: 15px; font-weight: 600; color: var(--trp-ink); padding: 0; }
.trp-fb-help { font-size: 13px; line-height: 1.45; color: var(--trp-muted); }
.trp-fb-opt { font-weight: 400; color: var(--trp-muted); }

/* The honeypot. It had no rules at all, so it drew as an empty box above
   "Your email" (Ella, 9 Nov). Taken off-screen rather than display:none or
   hidden: some bots skip what is not rendered, and the whole point of the
   field is that a bot fills it in. A screen reader does not reach it
   either -- the input carries aria-hidden and tabindex -1. */
.trp-fb-pot { position: absolute !important; left: -10000px !important; top: auto; width: 1px; height: 1px; overflow: hidden; opacity: 0; }

.trp-fb-input, .trp-fb-area {
  width: 100%; font: inherit; font-size: 15px; color: var(--trp-ink);
  background: rgb(var(--c-page)); border: 1px solid var(--trp-rule);
  border-radius: 12px; padding: 11px 14px; min-height: 46px;
}
.trp-fb-area { min-height: 62px; resize: none; overflow: hidden; line-height: 1.5; }
.trp-fb-input:focus-visible, .trp-fb-area:focus-visible { outline: 2px solid rgb(var(--c-green)); outline-offset: 1px; }
.trp-fb-input[aria-invalid='true'] { border-color: #B3261E; }

/* ---- the 1 to 10 chips ---------------------------------------------- */

/* Ten equal columns that fill the row. On a narrow phone they wrap to two
   even rows of five rather than shrinking to nothing or scrolling. */
.trp-fb-scale { display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); gap: 6px; }
@media (max-width: 420px) { .trp-fb-scale { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
.trp-fb-scale input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.trp-fb-chip {
  display: flex; align-items: center; justify-content: center;
  min-height: 38px; border: 1px solid var(--trp-rule); border-radius: 10px;
  background: rgb(var(--c-page)); font-size: 14px; font-weight: 600;
  color: var(--trp-ink); cursor: pointer;
}
.trp-fb-chip:hover { border-color: rgb(var(--c-green)); }
.trp-fb-scale input:checked + .trp-fb-chip { background: rgb(var(--c-green)); border-color: rgb(var(--c-green)); color: rgb(var(--c-page)); }
.trp-fb-scale input:focus-visible + .trp-fb-chip { outline: 2px solid rgb(var(--c-green)); outline-offset: 2px; }
.trp-fb-ends { display: flex; justify-content: space-between; font-size: 12px; color: var(--trp-muted); }

/* The chips a question is answered with: checkboxes where more than one
   answer is true, radios where only one is. They wrap rather than sit on a
   grid, because the labels are words of very different lengths -- a grid
   would set every chip to the width of "Not sure what to do next". */
.trp-fb-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.trp-fb-chips input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.trp-fb-chips .trp-fb-chip { padding: 0 14px; }
.trp-fb-chips input:checked + .trp-fb-chip { background: rgb(var(--c-green)); border-color: rgb(var(--c-green)); color: rgb(var(--c-page)); }
.trp-fb-chips input:focus-visible + .trp-fb-chip { outline: 2px solid rgb(var(--c-green)); outline-offset: 2px; }

/* A founder per row: three fields side by side with room for them, stacked
   on a phone where three boxes on one line would each be 80px wide. */
.trp-fb-rows { display: flex; flex-direction: column; gap: 16px; }
.trp-fb-row { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
@media (min-width: 640px) { .trp-fb-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr) minmax(0, 1.2fr); gap: 8px; } }
.trp-fb-rowlabel { font-size: 12px; font-weight: 600; color: var(--trp-muted); }

/* A link inside a label or a line of copy, where the words around it carry
   the weight and only the link itself is marked. */
.trp-fb-link { color: var(--trp-ink); text-decoration: underline; text-underline-offset: 2px; }
.trp-fb-link:hover { color: rgb(var(--c-green)); }
.trp-fb-link:focus-visible { outline: 2px solid rgb(var(--c-green)); outline-offset: 2px; border-radius: 4px; }

/* The quiet line that points somewhere else: the testimonial page from the
   feedback form, the VIP prize under the testimonial form. */
.trp-fb-nudge { margin: 4px 0 0; font-size: 13.5px; line-height: 1.5; color: var(--trp-muted); text-align: center; }
.trp-fb-settled .trp-fb-nudge, .trp-fb-thanks .trp-fb-nudge { margin-top: 10px; }

/* The points a video should hit. */
.trp-fb-points { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 4px; font-size: 13.5px; line-height: 1.45; color: var(--trp-muted); }

/* ---- the two short answers, side by side on a laptop ---------------- */

.trp-fb-two { display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px; }
@media (min-width: 640px) { .trp-fb-two { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ---- the card's footer ---------------------------------------------- */

.trp-fb-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 32px; }
.trp-fb-foot.is-end { justify-content: flex-end; }
.trp-fb-foot-right { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-left: auto; }

.trp-fb-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 22px; border: 0; border-radius: 999px;
  font: inherit; font-size: 15px; font-weight: 600; cursor: pointer; text-decoration: none;
  background: rgb(var(--c-green)); color: rgb(var(--c-page));
}
.trp-fb-btn:hover { background: var(--trp-mid); }
.trp-fb-btn:disabled { opacity: .5; cursor: default; }
.trp-fb-btn:focus-visible { outline: 2px solid var(--trp-ink); outline-offset: 2px; }

.trp-fb-btn.is-soft { background: rgb(var(--c-page)); color: var(--trp-ink); border: 1px solid var(--trp-rule); }
.trp-fb-btn.is-soft:hover { background: rgb(var(--c-ink) / .04); }

.trp-fb-quiet {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 4px;
  background: none; border: 0; font: inherit; font-size: 14px; font-weight: 600;
  color: var(--trp-muted); cursor: pointer; text-decoration: underline; text-underline-offset: 3px;
}
.trp-fb-quiet:hover { color: var(--trp-ink); }
.trp-fb-quiet:focus-visible { outline: 2px solid rgb(var(--c-green)); outline-offset: 2px; border-radius: 6px; }

@media (max-width: 480px) {
  .trp-fb-foot, .trp-fb-foot-right { flex-direction: column; align-items: stretch; margin-left: 0; }
  .trp-fb-btn, .trp-fb-quiet { width: 100%; }
}

/* The spinner in Send it while the POST is in flight. */
.trp-fb-spin { width: 15px; height: 15px; flex: none; border: 2px solid currentColor; border-right-color: transparent; border-radius: 999px; }

.trp-fb-msg { margin: 0; font-size: 14px; line-height: 1.45; color: var(--trp-muted); }
.trp-fb-msg[hidden] { display: none; }
.trp-fb-msg.is-err { color: #B3261E; }
:root[data-theme='dark'] .trp-fb-msg.is-err { color: #F2B8B5; }
@media (prefers-color-scheme: dark) {
  :root[data-theme='system'] .trp-fb-msg.is-err { color: #F2B8B5; }
}

/* ---- step 2: the prize banner and the two tiles --------------------- */

.trp-fb-prize { display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px; border-radius: 14px; background: var(--trp-sagelt); font-size: 13.5px; line-height: 1.45; color: var(--trp-deep); }

.trp-fb-tiles { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; align-items: stretch; }
@media (min-width: 640px) { .trp-fb-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.trp-fb-tile { display: flex; flex-direction: column; gap: 10px; height: 100%; padding: 18px; border: 1px solid var(--trp-rule); border-radius: 16px; background: rgb(var(--c-page)); }
.trp-fb-tile-title { font-size: 15px; font-weight: 600; color: var(--trp-ink); }
.trp-fb-tile-foot { margin-top: auto; }

/* The "I've done it" switch. A real checkbox, hidden, with the track as its
   label, so the keyboard and a screen reader get a checkbox either way. */
.trp-fb-switch { display: inline-flex; align-items: center; gap: 10px; font-size: 14px; font-weight: 600; color: var(--trp-ink); cursor: pointer; }
.trp-fb-switch input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.trp-fb-track { position: relative; width: 42px; height: 24px; flex: none; border-radius: 999px; background: rgb(var(--c-ink) / .14); }
.trp-fb-track::after { content: ''; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 999px; background: rgb(var(--c-surface)); }
.trp-fb-switch input:checked + .trp-fb-track { background: rgb(var(--c-green)); }
.trp-fb-switch input:checked + .trp-fb-track::after { left: 21px; }
.trp-fb-switch input:focus-visible + .trp-fb-track { outline: 2px solid rgb(var(--c-green)); outline-offset: 2px; }

.trp-fb-check { display: flex; align-items: flex-start; gap: 10px; font-size: 14px; line-height: 1.45; color: var(--trp-ink); cursor: pointer; }
.trp-fb-check input { width: 18px; height: 18px; flex: none; margin: 1px 0 0; accent-color: rgb(var(--c-green)); }

/* ---- the thank-you -------------------------------------------------- */

.trp-fb-thanks { display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; padding: 40px 24px; }
.trp-fb-thanks-ring { display: flex; align-items: center; justify-content: center; width: 60px; height: 60px; border-radius: 999px; background: var(--trp-sagelt); }
.trp-fb-thanks-ring svg { width: 30px; height: 30px; }
.trp-fb-thanks-ring path { fill: none; stroke: rgb(var(--c-olive)); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.trp-fb-thanks-title { margin: 0; font-family: var(--trp-face); font-weight: 600; font-size: 22px; letter-spacing: -.01em; color: var(--trp-ink); }
.trp-fb-thanks-line { margin: 0; font-size: 15px; line-height: 1.5; color: var(--trp-muted); max-width: 36ch; }

/* The calm state it settles into, in the same spot. */
.trp-fb-settled { display: flex; flex-direction: column; align-items: center; gap: 14px; text-align: center; padding: 28px 24px; }
.trp-fb-settled-line { margin: 0; font-size: 14px; font-weight: 600; color: var(--trp-muted); }

/* ---- the pills ------------------------------------------------------ */

/* Both pills ride in one row at the bottom right: the testimonial one, then
   feedback nearest the corner, where feedback has always been. The row is
   what is placed, so the two keep their gap however wide either gets, and
   one --trp-pill-lift moves both when the footer comes up.

   150: under the lightbox, the toast and the mobile menu, which are all 200. */
.trp-pills {
  position: fixed; z-index: 150;
  right: calc(20px + env(safe-area-inset-right));
  bottom: calc(20px + env(safe-area-inset-bottom) + var(--trp-pill-lift, 0px));
  display: flex; align-items: center; gap: 10px;
}
.trp-pills[hidden] { display: none; }

.trp-pill {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 16px; border: 0; border-radius: 999px;
  font: inherit; font-size: 13.5px; font-weight: 500; cursor: pointer;
  text-decoration: none;                 /* the testimonial pill is a link */
  background: rgb(var(--c-green)); color: rgb(var(--c-page));
  box-shadow: 0 10px 30px -10px rgb(var(--c-ink) / .45);
}
.trp-pill svg { width: 17px; height: 17px; flex: none; }
.trp-pill:hover { background: var(--trp-mid); }
.trp-pill:focus-visible { outline: 2px solid var(--trp-ink); outline-offset: 3px; }
.trp-pill-emoji { font-size: 15px; line-height: 1; }
/* The testimonial pill's phone label. Only one of the two is ever in the
   pill, so it never measures wider than the words you can see. */
.trp-pill-short { display: none; }

/* Hidden until it is let in, and whenever anything would be covered by it. */
.trp-pill[hidden] { display: none; }
.trp-pill.is-away { opacity: 0; pointer-events: none; }

@media (max-width: 639px) {
  .trp-pills {
    right: calc(16px + env(safe-area-inset-right));
    bottom: calc(16px + env(safe-area-inset-bottom) + var(--trp-pill-lift, 0px));
    gap: 8px;
  }
  /* Both grow to 44px together, so the row stays one height. */
  .trp-pill { height: 44px; }
  /* Feedback has been an icon-only circle on a phone since it shipped. */
  .trp-pill.is-feedback { width: 44px; padding: 0; gap: 0; }
  .trp-pill.is-feedback .trp-pill-text { display: none; }
  /* The testimonial pill keeps a word, just a shorter one, so the row is
     a circle and a pill rather than two unreadable circles. */
  .trp-pill.is-win .trp-pill-text { display: none; }
  .trp-pill.is-win .trp-pill-short { display: inline; }
}

/* The last line of any page clears the row, so nothing ever ends under it. */
html.trp-has-pill main { padding-bottom: 72px; }

/* ---- the side panel ------------------------------------------------- */

.trp-panel-dim { position: fixed; inset: 0; z-index: 180; background: rgb(0 0 0 / .3); }
.trp-panel-dim[hidden], .trp-panel[hidden] { display: none; }

.trp-panel {
  position: fixed; z-index: 181; top: 0; right: 0; bottom: 0;
  width: 100%; max-width: 440px;
  display: flex; flex-direction: column;
  background: rgb(var(--c-page)); border-left: 1px solid var(--trp-rule);
  box-shadow: -20px 0 60px -30px rgb(var(--c-ink) / .5);
}
.trp-panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--trp-rule); }
.trp-panel-title { margin: 0; font-family: var(--trp-face); font-weight: 600; font-size: 17px; letter-spacing: -.01em; color: var(--trp-ink); }
.trp-panel-x { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; flex: none; border: 0; border-radius: 999px; background: none; color: var(--trp-muted); cursor: pointer; }
.trp-panel-x:hover { background: rgb(var(--c-ink) / .06); color: var(--trp-ink); }
.trp-panel-x:focus-visible { outline: 2px solid rgb(var(--c-green)); outline-offset: 2px; }
.trp-panel-x svg { width: 18px; height: 18px; }
.trp-panel-body { flex: 1 1 auto; overflow-y: auto; padding: 20px; }

/* In the panel the card is the panel, so it drops its own frame. */
.trp-panel-body .trp-fb-card { border: 0; background: none; padding: 0; }
.trp-panel-body .trp-fb-wrap { max-width: none; padding: 0; }

/* "Close without sending?" -- inline, never a browser dialog. */
.trp-panel-confirm { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 12px 20px; border-bottom: 1px solid var(--trp-rule); background: var(--trp-sagelt); font-size: 14px; color: var(--trp-deep); }
.trp-panel-confirm[hidden] { display: none; }

/* ---- motion, all of it in one place --------------------------------- */

.trp-fb-anim-out { opacity: 0; transform: translateY(-8px); transition: opacity 200ms ease, transform 200ms ease; }
.trp-fb-anim-in { animation: trp-fb-in 280ms ease-out both; }
.trp-fb-anim-settle { animation: trp-fb-settle 300ms ease-out both; }
.trp-fb-thanks-ring path { stroke-dasharray: 32; stroke-dashoffset: 0; }
.trp-fb-anim-in .trp-fb-thanks-ring path { animation: trp-fb-draw 400ms ease-out both; }
.trp-fb-spin { animation: trp-fb-spin 700ms linear infinite; }

.trp-pill { opacity: 0; transform: translateY(8px); transition: opacity 250ms ease, transform 250ms ease, background-color .18s ease; }
.trp-pill.is-shown { opacity: 1; transform: translateY(0); }
.trp-pill.is-shown:hover { transform: translateY(-1px); }
/* Away wins over shown: hidden and not clickable, never one without the other. */
.trp-pill.is-shown.is-away { opacity: 0; pointer-events: none; }

.trp-panel { transform: translateX(100%); transition: transform 280ms ease-out; }
.trp-panel.is-open { transform: translateX(0); }
.trp-panel-dim { opacity: 0; transition: opacity 280ms ease-out; }
.trp-panel-dim.is-open { opacity: 1; }

@keyframes trp-fb-in { from { opacity: 0; transform: scale(.96); } to { opacity: 1; transform: scale(1); } }
@keyframes trp-fb-settle { from { opacity: .6; transform: scale(1.04); } to { opacity: 1; transform: scale(1); } }
@keyframes trp-fb-draw { from { stroke-dashoffset: 32; } to { stroke-dashoffset: 0; } }
@keyframes trp-fb-spin { to { transform: rotate(360deg); } }

/* Nothing moves. The same states, reached without travel: every transform
   above is cancelled here rather than merely slowed, so a member who asks
   for no motion gets none at all. */
@media (prefers-reduced-motion: reduce) {
  .trp-fb-anim-out, .trp-fb-anim-in, .trp-fb-anim-settle,
  .trp-pill, .trp-pill.is-shown, .trp-pill.is-shown:hover,
  .trp-panel, .trp-panel.is-open, .trp-panel-dim, .trp-fb-spin {
    transform: none;
    animation: none;
    transition-property: opacity;
    transition-duration: 120ms;
  }
  .trp-fb-anim-in, .trp-fb-anim-settle { opacity: 1; }
  .trp-fb-thanks-ring path { stroke-dashoffset: 0; }
}
