@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;1,9..40,400;1,9..40,500&display=swap');


:root {
  /* ── typography ────────────────────────────────────────────── */
  /* One family across the whole app — DM Sans for headings and body alike.
     Hierarchy is carried by size, weight (bold vs regular), caps and spacing,
     never by a second typeface. (The logo wordmark is a separate asset and is
     unaffected.) */
  --font-display: 'DM Sans', system-ui, sans-serif;
  --font-sans: 'DM Sans', system-ui, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, monospace;
  --font-weight-display: 600;
  --line-height-display: 1.12;
  --tracking-display: -0.02em;
  --font-weight-body: 400;
  --line-height-body: 1.6;
  --tracking-body: 0em;
  --font-weight-mono: 400;

  /* ── shadcn base tokens ────────────────────────────────────── */
  /* A private members' club palette: warm paper page, an off-white elevated
     surface (never pure white), bordeaux as the single interactive accent,
     and a near-black ink that never falls to #000. */
  /* The main workspace — the lightest large surface, a warm ivory the content
     sits on. Deeper chrome panels (sidebar, rail) and a near-white top bar
     step off it; cards step brighter still. */
  --background: #F2ECE0;
  --foreground: #211B18;
  --neutral: #B4A492; /* warm taupe, the mixing base for surfaces + borders */
  --card: #FFFDFC;
  --card-foreground: #211B18;
  --popover: #FFFDFC;
  --popover-foreground: #211B18;
  --primary: #6A0303;
  --primary-foreground: #FCFAF7;
  --secondary: #EDE8E1;
  --secondary-foreground: #211B18;
  --muted: #EDE8E1;
  --muted-foreground: #746A5F;
  --accent: color-mix(in srgb, var(--neutral) 14%, var(--background));
  --accent-foreground: var(--foreground);
  --destructive: #6A0303;
  --destructive-foreground: #FCFAF7;
  /* Card contour — a warm beige, a touch more present than before so a card
     reads as a surface even before its shadow. Never a cold grey. */
  --border: #D6CCBE;
  --input: #DED7CE;
  --ring: color-mix(in srgb, var(--primary) 50%, var(--background));
  --success: oklch(0.596 0.145 145.59);
  --warning: oklch(0.769 0.154 71.29);

  /* ── sidebar ───────────────────────────────────────────────── */
  /* The left navigation shares the exact warm ivory of the workspace, so the
     nav, the feed and the right rail read as one continuous sheet of paper —
     the way the mobile experience already feels, where the same panels sit
     directly on the workspace. Chrome and content are separated by the hairline
     border and the dark top bar, never by a colder, whiter rail. */
  --sidebar: #F2ECE0;
  --sidebar-foreground: #211B18;
  --sidebar-primary: #6A0303;
  --sidebar-primary-foreground: #FCFAF7;
  --sidebar-accent: color-mix(in srgb, var(--primary) 10%, var(--sidebar));
  --sidebar-accent-foreground: var(--primary);
  --sidebar-border: #DED7CE;
  --sidebar-ring: color-mix(in srgb, var(--primary) 50%, var(--background));

  /* ── surface hierarchy ─────────────────────────────────────── */
  /* Three clear planes for the app shell. The dark olive top bar caps the
     whole thing; the two navigation rails are white chrome; the beige
     workspace sits between them, and it is now the beige — not a fourth beige
     rail — that separates content from chrome:
       top bar  #463E28  (dark muted olive-brown chrome cap → --surface-topbar)
       rails    #F2ECE0  (left nav + right rail — same warm ivory as the feed → --sidebar / --surface-rail)
       workspace#F2ECE0  (main column — warm ivory content plane → --background)
       card     #FFFDFC  (raised content cards on the beige workspace → --card)
     The rails, feed and workspace are one warm ivory plane; a block embedded in
     a rail steps down to the deeper --background-secondary beige (see the mini
     calendar and the rail panels) so it still reads as its own card. */
  --background-secondary: #EAE2D5;
  --surface-feed: #F2ECE0;
  /* The right rail shares the exact warm ivory of the left nav and the feed, so
     the whole shell reads as one sheet of paper — matching the mobile view,
     where these panels sit directly on the workspace. */
  --surface-rail: #F2ECE0;
  /* The dark olive top bar needs its own on-dark ink: a warm ivory for the
     wordmark, a muted brass-taupe for idle icons, a low olive hairline edge. */
  --surface-topbar: #463E28;
  --surface-topbar-foreground: #F3EDE1;
  --surface-topbar-muted: #ADA189;
  --surface-topbar-border: #574D33;
  --surface-hover: color-mix(in srgb, var(--neutral) 12%, var(--background));
  --surface-active: color-mix(in srgb, var(--neutral) 20%, var(--background));
  --surface-elevated: var(--card);

  /* ── border hierarchy ──────────────────────────────────────── */
  --border-subtle: color-mix(in srgb, var(--border) 72%, var(--background));
  --border-muted: var(--border);
  --border-strong: color-mix(in srgb, var(--neutral) 62%, var(--background));

  /* ── text hierarchy ────────────────────────────────────────── */
  --foreground-secondary: #6B625A;

  /* ── primary depth ─────────────────────────────────────────── */
  --primary-hover: #520202;
  --primary-muted: color-mix(in srgb, var(--primary) 18%, var(--background));
  --primary-soft: color-mix(in srgb, var(--primary) 11%, var(--background));
  --primary-tint: color-mix(in srgb, var(--primary) 6%, var(--background));

  /* ── focus & error ─────────────────────────────────────────── */
  --focus-ring: color-mix(in srgb, var(--primary) 40%, transparent);
  --error: #6A0303;
  --error-foreground: #FCFAF7;

  /* ── brand accents (brass + taupe) ─────────────────────────── */
  /* Brass is reserved for special moments only, gold labels, VIP badges,
     decorative rules, number accents. Never buttons or general UI. */
  /* Brass, deepened to a richer antique gold so it clears the 4.5:1 contrast
     minimum for small text (labels, eyebrows, badges) on the cream + white
     surfaces it sits on. Still unmistakably brass, just a shade more grounded. */
  --gold: #7D6134;
  --gold-foreground: #2A1E08;
  --gold-soft: color-mix(in srgb, var(--gold) 14%, var(--background));
  --gold-tint: color-mix(in srgb, var(--gold) 7%, var(--background));
  --taupe: #B4A492;
  --taupe-soft: color-mix(in srgb, var(--taupe) 22%, var(--background));
  /* A grounded medium-dark brown, deeper than taupe — used for the "Current
     Plan" marker so it reads as settled/secondary and never competes with
     Pro's red "Most Popular" badge. */
  --taupe-deep: #7C6449;
  --taupe-deep-foreground: #FBF6EF;
  /* Muted champagne/gold reserved for the Premium tier's own accents (border,
     crown, decorative details) so Premium reads as the most elevated, luxurious
     Suite without borrowing the deeper brand gold used everywhere else. */
  --champagne: #B99A62;

  /* ── membership tier washes ────────────────────────────────── */
  /* Each plan card carries its own very faint warm wash, so the three tiers
     read as distinct visual systems rather than three white cards — luxury
     hotel / editorial, never a row of saturated SaaS pricing tiles. The
     differentiation is felt in the undertone, not in how colourful the card is;
     borders, badges and CTAs still carry the heavier lifting.
     Exact hex values chosen by the app builder so each tier keeps a very light
     but distinct undertone (differentiation comes from borders/badges/CTAs, not
     a strongly coloured background):
       Basic   → warm off-white / light greige — the quietest, most neutral card.
       Pro     → very light desaturated wine/burgundy tint on cream, never pink
                 or blush; the stronger burgundy lives in the border, badge and
                 CTA, not the background.
       Premium → Champagne Pearl / warm ivory with a subtle golden undertone,
                 visibly lighter and more elevated than the old brown/tan, still
                 clearly set apart from both Basic and the page background. */
  --tier-basic-wash: #F7F4EF;
  --tier-pro-wash: #F6ECEB;
  --tier-premium-wash: #F5EFE2;

  /* ── radius ────────────────────────────────────────────────── */
  /* Graduated corner scale: the corner grows with the element, so a small
     field never reads as round as a big card. Inputs, textareas, selects and
     blocks nested inside a card take the 10px default; chips, tags and badges a
     tighter 7px; content cards and panels a 16px corner — and 16px is the
     ceiling, nothing rounds more than that. Buttons and round avatars stay full
     capsules via --radius-full. (These base values are re-stated verbatim in the
     "Stencil Tweaks" block at the foot of this file, which is authoritative;
     both blocks describe the one graduated system.) */
  --radius: 0.625rem;     /* 10px — inputs, textareas, selects, blocks inside a card */
  --radius-none: 0rem;
  --radius-sm: 0.4375rem; /* 7px — chips, tags, badges, small labels */
  --radius-lg: 1rem;      /* 16px — content cards and panels */
  --radius-xl: 1rem;      /* 16px — large cards / panels, same 16px ceiling as lg */
  --radius-full: 9999px;

  /* ── shadows ───────────────────────────────────────────────── */
  /* Content cards get a single, very soft, warm lift — brown-toned, never a
     cold grey drop — so a card separates from the cream page without floating.
     Deliberately gentle: enough to read as a surface, never a SaaS dashboard.
     A firmer lift stays reserved for genuinely floating overlays (dropdowns,
     dialogs, popovers). */
  --shadow-sm: 0 1px 2px rgba(45, 25, 15, 0.04), 0 2px 8px rgba(45, 25, 15, 0.07);
  --shadow-md: 0 4px 14px -2px rgba(45, 25, 15, 0.12);
  --shadow-lg: 0 14px 34px -6px rgba(45, 25, 15, 0.18);

  /* ── motion ────────────────────────────────────────────────── */
  --duration-fast: 100ms;
  --duration-normal: 180ms;
  --duration-slow: 300ms;
  --ease-standard: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-accelerate: cubic-bezier(0.4, 0, 1, 1);
  --ease-decelerate: cubic-bezier(0, 0, 0.2, 1);

  /* ── spacing ───────────────────────────────────────────────── */
  --spacing-base: 0.25rem;
}

/* ── Reusable card surface ───────────────────────────────────────
   The one global card style for primary content containers — feed posts,
   Getting Started, challenge / upgrade / course / idea / trend / tool /
   audit cards. A near-white warm surface sitting a step above the cream
   feed, held by a warm hairline border plus a very soft brown-toned lift.
   Elegant and minimal — not a floating SaaS card, not a flat website panel.
   Compose it with layout utilities (padding, overflow-hidden, etc.); it owns
   only the surface, border, corner and shadow. */
.app-card {
  background-color: var(--card);
  border-radius: var(--radius-xl);
}

/* ── Social Suite signature texture ──────────────────────────────
   A whisper-quiet Art-Deco chevron field, drawn from the Social Suite
   mark. It belongs under premium *chrome* only — the dark top bar, the
   navigation panel, upgrade / challenge headers — and is tuned to all
   but disappear, surfacing only on a close look. Never laid over reading
   content: cards and the feed stay clean paper. Two tones so it can sit
   on dark olive or on a warm light surface; always layer a bg-* colour
   underneath. ~85% clean app, ~15% quiet hotel identity. */
.ss-deco-dark {
  background-image: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20width='24'%20height='24'%3E%3Cpath%20d='M0%2017L12%209L24%2017M0%2011L12%203L24%2011'%20fill='none'%20stroke='%23F3EDE1'%20stroke-opacity='0.05'%20stroke-width='1'/%3E%3C/svg%3E");
  background-size: 24px 24px;
}
/* The navigation pattern is deliberately fainter than the top bar's — it should
   all but vanish into the cream so the nav labels stay the focus. The top bar
   (.ss-deco-dark, 0.05) may read a touch more. */
.ss-deco {
  background-image: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20width='24'%20height='24'%3E%3Cpath%20d='M0%2017L12%209L24%2017M0%2011L12%203L24%2011'%20fill='none'%20stroke='%23463E28'%20stroke-opacity='0.02'%20stroke-width='1'/%3E%3C/svg%3E");
  background-size: 24px 24px;
}

/* ── Fine stationery grain (dark chrome) ─────────────────────────
   A monochrome paper/linen speckle for the dark olive top bar — sub-2px
   fibre flecks, both a touch lighter and a touch darker than the fill,
   at ~5% so the bar still reads as a flat solid at a glance and adds only
   a tactile "premium stationery" depth on close inspection. No repeating
   weave, no crosshatch, no sheen. Sits over the untouched --surface-topbar
   fill; always layer a bg-* colour underneath. */
.ss-grain-dark {
  background-image: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20width='140'%20height='140'%3E%3Cfilter%20id='g'%3E%3CfeTurbulence%20type='fractalNoise'%20baseFrequency='0.9'%20numOctaves='2'%20stitchTiles='stitch'/%3E%3CfeColorMatrix%20type='saturate'%20values='0'/%3E%3C/filter%3E%3Crect%20width='100%25'%20height='100%25'%20filter='url(%23g)'%20opacity='0.05'/%3E%3C/svg%3E");
  background-size: 140px 140px;
}
/* The same stationery grain tuned for the light paper rails. Grain reads weaker
   on a light surface, so it sits at 0.08 (stronger than the top bar's 0.05).
   After desaturating, a warm colour-matrix nudges the flecks toward antique
   brown rather than a cold grey speckle, so the texture belongs to the paper. */
.ss-grain-light {
  background-image: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20width='140'%20height='140'%3E%3Cfilter%20id='gl'%3E%3CfeTurbulence%20type='fractalNoise'%20baseFrequency='0.9'%20numOctaves='2'%20stitchTiles='stitch'/%3E%3CfeColorMatrix%20type='saturate'%20values='0'/%3E%3CfeColorMatrix%20type='matrix'%20values='1%200%200%200%200.05%200%200.9%200%200%200.02%200%200%200.72%200%200%200%200%200%201%200'/%3E%3C/filter%3E%3Crect%20width='100%25'%20height='100%25'%20filter='url(%23gl)'%20opacity='0.08'/%3E%3C/svg%3E");
  background-size: 140px 140px;
}

/* ── Rich post body ──────────────────────────────────────────────
   Styles the sanitized HTML rendered from the composer. Kept scoped to
   .rich-body so it never leaks into the rest of the UI. */
.rich-body {
  font-family: var(--font-sans) !important;
  font-size: 15px;
  line-height: 1.6;
  color: var(--foreground) !important;
  /* Long pasted URLs and unbroken strings wrap inside the post rather than
     forcing the card (and the page) wider than the screen. */
  overflow-wrap: break-word;
  word-break: break-word;
}
/* Code blocks and tables can be genuinely wide — let them scroll inside their
   own box instead of stretching the whole post. */
.rich-body pre {
  max-width: 100%;
  overflow-x: auto;
}
.rich-body table {
  display: block;
  max-width: 100%;
  overflow-x: auto;
}
/* Force all inline-styled elements inside .rich-body to use the app's
   own font and colour — overrides any style= attributes that survived
   paste-cleaning or were stored in older posts. */
.rich-body * {
  font-family: var(--font-sans) !important;
  color: inherit !important;
  background-color: transparent !important;
  font-size: inherit !important;
}
/* Headings keep their own defined sizes */
.rich-body h1 { font-size: 1.5rem !important; }
.rich-body h2 { font-size: 1.24rem !important; }
.rich-body h3 { font-size: 1.06rem !important; }
.rich-body h4 { font-size: 0.95rem !important; }
.rich-body > :first-child { margin-top: 0; }
.rich-body > :last-child { margin-bottom: 0; }
/* Tiptap placeholder — shown only while the editor doc is empty. */
.rich-body.tiptap p.is-editor-empty:first-child::before {
  content: attr(data-placeholder);
  color: var(--muted-foreground);
  float: left;
  height: 0;
  pointer-events: none;
}
.rich-body p { margin: 0 0 0.5em; }
/* In-body section headings — the editor's H1 → H2 → H3. One clean sans family
   (never a serif); the hierarchy is carried by size, weight and spacing. H1 is
   a section headline INSIDE a longer post — distinct from, and smaller than,
   the auto-displayed Post Title at the top of the post. */
.rich-body h1 {
  font-family: var(--font-sans);
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.18;
  color: var(--foreground);
  margin: 1.1em 0 0.4em;
}
.rich-body h2 {
  font-family: var(--font-sans);
  font-size: 1.24rem;
  font-weight: 700;
  letter-spacing: -0.015em;
  line-height: 1.22;
  color: var(--foreground);
  margin: 0.95em 0 0.35em;
}
.rich-body h3 {
  font-family: var(--font-sans);
  font-size: 1.06rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.3;
  color: var(--foreground);
  margin: 0.8em 0 0.3em;
}
.rich-body h4 {
  font-family: var(--font-sans);
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0;
  line-height: 1.35;
  color: var(--foreground-secondary);
  margin: 0.7em 0 0.25em;
}
.rich-body strong, .rich-body b { font-weight: 700; color: var(--foreground); }
.rich-body em, .rich-body i { font-style: italic; }
.rich-body u { text-decoration: underline; text-underline-offset: 2px; }
.rich-body ul, .rich-body ol { margin: 0.3em 0 0.5em; padding-left: 1.35em; }
.rich-body ul { list-style: disc; }
.rich-body ol { list-style: decimal; }
.rich-body li { margin: 0.15em 0; padding-left: 0.15em; }
.rich-body li::marker { color: var(--primary); }
.rich-body a {
  color: var(--primary);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}
/* @mentions — a highlighted pill referencing a real member id, never plain
   underlined text. Overrides the .rich-body * colour/background reset above. */
.rich-body .mention {
  color: var(--primary) !important;
  background-color: var(--primary-soft) !important;
  font-weight: 600;
  text-decoration: none !important;
  border-radius: 4px;
  padding: 0 4px;
  white-space: nowrap;
  cursor: pointer;
}
.rich-body a.mention:hover {
  background-color: var(--primary-muted) !important;
}
/* The admin @Everyone announcement mention — brass, obviously special. */
.rich-body .mention-everyone {
  color: var(--gold-foreground) !important;
  background-color: var(--gold-soft) !important;
}
.rich-body blockquote {
  margin: 0.6em 0;
  padding: 0.15em 0 0.15em 0.9em;
  border-left: 3px solid var(--primary);
  color: var(--foreground-secondary);
  font-style: italic;
}
.rich-body img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 16px;
  border: 1px solid var(--border-subtle);
  margin: 0.6em 0;
}
/* Consecutive images sit as a tidy stack with an 8px gap. */
.rich-body img + img { margin-top: 0.5rem; }
/* Two pictures side by side (made in The Cinema's composer): two columns with
   a small gap from 640px up, stacked on a phone. Each keeps its own shape,
   never cropped. `.rich-image-pair` is the same pair while editing. */
.rich-body [data-image-pair],
.rich-image-pair {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.5rem;
  align-items: start;
  margin: 0.6em 0;
}
.rich-body [data-image-pair] img,
.rich-image-pair img { margin: 0; }
@media (min-width: 640px) {
  .rich-body [data-image-pair],
  .rich-image-pair { grid-template-columns: 1fr 1fr; }
}
/* The Cinema: a single picture stops at 400px wide on desktop (full width on
   a phone). Tapping it still opens it full size. */
@media (min-width: 768px) {
  .rich-cinema img { max-width: 400px; }
  .rich-cinema [data-image-pair] img { max-width: 100%; }
}
/* A picture in a shown post/comment body that has not arrived yet: a soft
   tinted block with a real height, so the text around it reads at once, lazy
   loading can tell it is off-screen, and the picture fills it when it lands.
   RichContent marks each one `.is-loaded` on load/error (rich-content.tsx);
   the editor never gets `.rich-media-hold`, so its images are untouched. */
.rich-media-hold img:not(.is-loaded) {
  min-height: 180px;
  background-color: var(--background-secondary);
}
.rich-media-hold img:not(.is-loaded)[style*="aspect-ratio"] { min-height: 0; }
.rich-body video {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 16px;
  border: 1px solid var(--border-subtle);
  background: #000;
  margin: 0.6em 0;
}

/* Feed reading rhythm — The Lounge / Lobby Board / Room Service posts and
   comments, compared against Threads: tighter line-height and a smaller,
   consistent paragraph/list gap than the shared .rich-body default above.
   Added as a modifier (.rich-body-feed) rather than changed in place, so the
   course lesson body and the onboarding tour card — which render through the
   same .rich-body — keep their original, looser rhythm. */
.rich-body.rich-body-feed {
  line-height: 1.42;
}
.rich-body-feed p {
  margin: 0 0 11px;
}
.rich-body-feed ul,
.rich-body-feed ol {
  margin: 0.2em 0 11px;
}
.rich-body-feed li {
  margin: 0.1em 0;
}
.rich-body-feed blockquote {
  margin: 11px 0;
}
.rich-body-feed > :last-child {
  margin-bottom: 0;
}

/* Onboarding tour card description — the tour card uses its own warm
   parchment palette (not the app's theme tokens), so this overrides
   .rich-body's app-foreground default to match. Also covers the plain-text
   fallback for any description saved before this field became rich text. */
.onboarding-step-body {
  color: #6E6456 !important;
}
.onboarding-step-body strong,
.onboarding-step-body b {
  color: #211B18 !important;
}
.onboarding-step-body li::marker {
  color: #B2451E;
}
@media (min-width: 640px) {
  .onboarding-step-body {
    font-size: 1rem;
  }
}

/* The composer's editable surface shares the same look while you type. */
.rich-editor:empty::before {
  content: attr(data-placeholder);
  color: var(--muted-foreground);
  pointer-events: none;
}
.rich-editor:focus { outline: none; }

/* ── Inline media blocks (while editing) ─────────────────────────────────────
   Each embedded image / video / link / voice note is a contenteditable="false"
   wrapper placed at the cursor, with a ✕ handle to remove it in place. */
.rich-media {
  position: relative;
  display: block;
  margin: 0.6em 0;
}
.rich-media > img,
.rich-media > video {
  margin: 0;
}
.rich-remove {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 9999px;
  background: color-mix(in srgb, var(--foreground) 82%, transparent);
  color: var(--background);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: transform var(--duration-fast) var(--ease-standard);
}
.rich-remove:hover { transform: scale(1.08); }

/* In-editor inline social link, mirrors <InlineLink> so what you see is what
   posts — a favicon and the domain/handle, no card. */
.rich-linkinline {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  vertical-align: baseline;
  font-family: var(--font-sans);
  font-size: 14.5px;
  font-weight: 500;
  color: var(--primary);
  text-decoration: underline;
  text-decoration-color: color-mix(in oklch, var(--primary) 30%, transparent);
  text-underline-offset: 2px;
}
.rich-linkinline-icon {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
  border-radius: 3px;
  margin: 0;
  text-decoration: none;
}
.rich-linkinline-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* In-editor link preview card, mirrors <LinkCard> so what you see is what
   posts. */
.rich-linkcard {
  display: flex;
  align-items: stretch;
  overflow: hidden;
  max-width: 440px;
  border-radius: 12px;
  border: 1px solid var(--border-subtle);
  background: var(--card);
}
.rich-linkcard-thumb {
  width: 84px;
  align-self: stretch;
  flex-shrink: 0;
  object-fit: cover;
  background: var(--secondary);
  margin: 0;
  border-radius: 0;
  border: 0;
}
.rich-linkcard-thumb--empty {
  width: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--background-secondary);
  border-right: 1px solid var(--border-subtle);
}
.rich-linkcard-thumb--empty > img {
  width: 24px;
  height: 24px;
  border-radius: 5px;
  margin: 0;
}
.rich-linkcard-body {
  display: flex;
  flex-direction: column;
  min-width: 0;
  gap: 2px;
  padding: 10px 14px;
}
.rich-linkcard-domain {
  font-size: 11.5px;
  font-weight: 400;
  color: var(--muted-foreground);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.rich-linkcard-title {
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.3;
  color: var(--foreground);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.rich-linkcard-desc {
  font-size: 12.5px;
  line-height: 1.4;
  color: var(--foreground-secondary);
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* In-editor voice-note placeholder, a compact cream chip standing in for the
   full player, which renders once posted. */
.rich-audio {
  display: flex;
  align-items: center;
  gap: 12px;
  border-radius: var(--radius);
  border: 1px solid var(--border-subtle);
  border-left: 4px solid var(--primary);
  background: #F7F5F2;
  padding: 12px 16px;
}
.rich-audio-play {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  flex-shrink: 0;
  border-radius: 9999px;
  background: var(--primary);
  color: var(--primary-foreground);
  font-size: 13px;
}
.rich-audio-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--foreground-secondary);
}

/* Stencil Tweaks */
/* Graduated corner scale — the corner grows with the element (see the radius
   comment in the :root block above). 16px is the ceiling for cards and panels;
   nothing rounds more than that. Buttons stay full pills via --radius-full. */
:root {
  --radius: 0.625rem;     /* 10px — inputs, textareas, selects, blocks inside a card */
  --radius-sm: 0.4375rem; /* 7px — chips, tags, badges, small labels */
  --radius-lg: 1rem;      /* 16px — content cards and panels */
  --radius-xl: 1rem;      /* 16px — large cards / panels, same 16px ceiling as lg */
  --spacing-base: 0.3rem;
}
/* /Stencil Tweaks */

/* ── Field surface, app-wide ─────────────────────────────────────────────────
   Every text input, textarea and select adopts the surface it sits on, so a
   field reads the same everywhere in the app: a warm-white --card fill when it
   sits directly on the beige workspace, and a --muted fill inside a white card,
   sheet, dialog or popover (white-on-white would vanish). No border; a 2px
   bordeaux ring (--ring) on focus; typed text --foreground, placeholder
   --muted-foreground. Kept unlayered on purpose so it settles the field look
   over per-instance Tailwind utilities. Selects opt in through the shadcn
   trigger's own default (below) and can still override it — a deliberately
   transparent or pill-shaped trigger keeps its own fill. */
:root { --field-bg: var(--card); }
.app-card,
.bg-card,
.bg-popover,
.bg-surface-elevated,
[data-slot="card"],
[data-slot="sheet-content"],
[data-slot="popover-content"],
[data-slot="dialog-content"] {
  --field-bg: var(--muted);
}

input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]):not([type="color"]):not([type="button"]):not([type="submit"]):not([type="image"]),
textarea {
  background-color: var(--field-bg);
  border-color: transparent;
  color: var(--foreground);
}
input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]):not([type="color"]):not([type="button"]):not([type="submit"]):not([type="image"])::placeholder,
textarea::placeholder {
  color: var(--muted-foreground);
  opacity: 1;
}
input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]):not([type="color"]):not([type="button"]):not([type="submit"]):not([type="image"]):focus,
textarea:focus {
  outline: none;
  border-color: transparent;
  box-shadow: 0 0 0 2px var(--ring);
}

/* ── Mobile focus-zoom guard ──────────────────────────────────────
   Pinch-zoom is disabled app-wide (see the viewport meta in root.tsx),
   so any editable field under 16px would trigger iOS Safari's automatic
   zoom-on-focus with no way to pinch back out. Forces every editable
   surface to a safe minimum on mobile only — desktop keeps each
   component's own type scale untouched. */
@media (max-width: 767px) {
  input,
  textarea,
  select,
  [contenteditable="true"] {
    font-size: 16px !important;
  }
}