/*
 * ============================================================
 * FuzzyCode Design System  |  fc-design-system.css
 * ============================================================
 * Single source of truth for the FuzzyCode visual language.
 * Import this file in any template to get brand tokens,
 * base element styling, and reusable component classes.
 *
 * Usage:
 *   <link rel="stylesheet" href="{{ asset_url('WIP_STYLE_REVAMP/fc-design-system.css') }}">
 *
 * Themes:
 *   Default  = warm brand (cream, brown, orange)
 *   .fc-dark = dark tool theme (navy, indigo accents)
 * ============================================================
 */

/* ── Google Fonts ─────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Grandstander:wght@400;500;600;700;800&family=Montserrat:wght@400;500;600;700&family=Fira+Code:wght@400;500;600&display=swap');

/* ============================================================
   1. DESIGN TOKENS
   ============================================================ */
:root {

  /* ── Brand Core ────────────────────────────────────────── */
  --fc-brown:            #683c06;
  --fc-brown-hover:      #8b5a1b;
  --fc-brown-light:      #a35b01;
  --fc-cream:            #edd9c0;
  --fc-cream-light:      #f5ece0;
  --fc-cream-warm:       #ead8c1;
  --fc-tan:              #e6a95e;
  --fc-tan-light:        #fbdcb8;
  --fc-orange:           #e48c21;
  --fc-orange-hover:     #ce7403;
  --fc-blue:             #1d58b1;
  --fc-blue-dark:        #0e2a47;
  --fc-blue-light:       #184a7e;
  --fc-navy:             #011730;
  --fc-yellow:           #fff460;
  --fc-yellow-muted:     #ffed00;

  /* ── Semantic Status ───────────────────────────────────── */
  --fc-success:          #2e7d32;
  --fc-success-light:    #e8f5e9;
  --fc-success-bg:       linear-gradient(135deg, #e8f5e9, #c8e6c9);
  --fc-warning:          #ef8c00;
  --fc-warning-light:    #fff8e1;
  --fc-warning-bg:       linear-gradient(135deg, #fff8e1, #ffecb3);
  --fc-error:            #c62828;
  --fc-error-light:      #ffebee;
  --fc-error-bg:         linear-gradient(135deg, #ffebee, #ffcdd2);
  --fc-info:             #1976d2;
  --fc-info-light:       #e3f2fd;
  --fc-info-bg:          linear-gradient(135deg, #e3f2fd, #bbdefb);

  /* ── Neutrals ──────────────────────────────────────────── */
  --fc-white:            #ffffff;
  --fc-gray-50:          #faf8f5;
  --fc-gray-100:         #f5f3f0;
  --fc-gray-200:         #e9e5df;
  --fc-gray-300:         #d4cfc8;
  --fc-gray-400:         #b8b2a8;
  --fc-gray-500:         #8a8379;
  --fc-gray-600:         #6b6560;
  --fc-gray-700:         #4a453f;
  --fc-gray-800:         #332f2a;
  --fc-gray-900:         #1f1c18;
  --fc-black:            #000000;

  /* ── Typography ────────────────────────────────────────── */
  --fc-font-brand:       "Grandstander", cursive;
  --fc-font-body:        "Montserrat", sans-serif;
  --fc-font-mono:        "Fira Code", monospace;

  --fc-text-xs:          0.75rem;   /* 12px */
  --fc-text-sm:          0.875rem;  /* 14px */
  --fc-text-base:        1rem;      /* 16px */
  --fc-text-lg:          1.125rem;  /* 18px */
  --fc-text-xl:          1.25rem;   /* 20px */
  --fc-text-2xl:         1.5rem;    /* 24px */
  --fc-text-3xl:         1.875rem;  /* 30px */
  --fc-text-4xl:         2.25rem;   /* 36px */

  --fc-leading-tight:    1.25;
  --fc-leading-normal:   1.5;
  --fc-leading-relaxed:  1.75;

  /* ── Border Radius ─────────────────────────────────────── */
  --fc-radius-sm:        5px;
  --fc-radius-md:        8px;
  --fc-radius-lg:        12px;
  --fc-radius-xl:        20px;
  --fc-radius-brand:     50px;
  --fc-radius-full:      50%;
  --fc-radius-pill:      999px;

  /* ── Shadows (surfaces — light elements on white) ──────── */
  --fc-shadow-xs:        0 1px 2px rgba(104, 60, 6, 0.06);
  --fc-shadow-sm:        0 1px 3px rgba(104, 60, 6, 0.1);
  --fc-shadow-md:        0 2px 8px rgba(104, 60, 6, 0.1);
  --fc-shadow-lg:        0 4px 12px rgba(104, 60, 6, 0.12);
  --fc-shadow-xl:        0 8px 25px rgba(104, 60, 6, 0.15);
  --fc-shadow-2xl:       0 16px 40px rgba(104, 60, 6, 0.18);
  --fc-shadow-brand:     9px 16px 10px 5px rgba(0, 0, 0, 0.15);
  --fc-shadow-inset:     inset 0 2px 6px rgba(104, 60, 6, 0.08);

  /* ── Shadows (buttons — dark elements that need visible depth) */
  --fc-shadow-btn:       0 2px 4px rgba(0, 0, 0, 0.25), 0 1px 1px rgba(0, 0, 0, 0.15);
  --fc-shadow-btn-hover: 0 4px 8px rgba(0, 0, 0, 0.3), 0 2px 3px rgba(0, 0, 0, 0.2);
  /* Send button: neutral at rest (matches original's subtle gray),
     warm orange glow on hover as interaction reward */
  --fc-shadow-btn-send:       1px 1px 3px rgba(0, 0, 0, 0.2);
  --fc-shadow-btn-send-hover: 0 3px 10px rgba(228, 140, 33, 0.35), 0 1px 3px rgba(0, 0, 0, 0.12);

  /* ── Z-Index Layers ────────────────────────────────────── */
  --fc-z-base:           1;
  --fc-z-dropdown:       100;
  --fc-z-sticky:         200;
  --fc-z-sidebar:        300;
  --fc-z-modal-backdrop: 400;
  --fc-z-modal:          500;
  --fc-z-popover:        600;
  --fc-z-toast:          700;
  --fc-z-fullscreen:     800;
  --fc-z-spinner:        900;

  /* ── Transitions ───────────────────────────────────────── */
  --fc-ease-fast:        0.15s ease;
  --fc-ease-base:        0.3s ease;
  --fc-ease-slow:        0.5s ease;
  --fc-ease-bounce:      0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  --fc-ease-spring:      0.6s cubic-bezier(0.34, 1.56, 0.64, 1);

  /* ── Spacing (4px base grid + half-steps) ─────────────── */
  --fc-space-0-5:        2px;
  --fc-space-1:          4px;
  --fc-space-1-5:        6px;
  --fc-space-2:          8px;
  --fc-space-2-5:        10px;
  --fc-space-3:          12px;
  --fc-space-3-5:        14px;
  --fc-space-4:          16px;
  --fc-space-5:          20px;
  --fc-space-6:          24px;
  --fc-space-8:          32px;
  --fc-space-10:         40px;
  --fc-space-12:         48px;
  --fc-space-16:         64px;

  /* ── Textures ─────────────────────────────────────────── */
  /* White dots at 50% opacity on a 4x4 grid — the FuzzyCode
     "workshop" texture. Apply via .fc-textured on any colored bg. */
  --fc-texture-dots: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='4' height='4' viewBox='0 0 4 4'%3E%3Cpath fill='%23ffffff' fill-opacity='0.5' d='M1 3h1v1H1V3zm2-2h1v1H3V1z'%3E%3C/path%3E%3C/svg%3E");

  /* ── Surface colors ───────────────────────────────────── */
  /* IMPORTANT: Body text should sit on --fc-surface, not on
     --fc-cream directly. Cream is a container color, not a
     reading surface. The layering is:
       cream container → white surface → text */
  --fc-surface:          #ffffff;
  --fc-surface-dim:      #faf8f5;
  --fc-surface-overlay:  #f5ece0;
  /* Glass: translucent white that lets textured backgrounds show through.
     Matches original tab area (#ffffff73 ≈ rgba 255,255,255,0.45)) */
  --fc-surface-glass:    rgba(255, 255, 255, 0.45);

  /* ── Derived / Computed Colors ─────────────────────────
     Values used by specific components that don't fit neatly
     into the brand core palette. Tokenized here so nothing
     in the component CSS is a bare hex value.             */
  --fc-warning-dark:     #7a5800;
  --fc-navy-hover:       #02244d;
  --fc-code-text:        #f8f8f2;
  --fc-segment-group:    #c49460;
  --fc-segment-border:   #a67c52;
  --fc-segment-text:     #6b4423;
  --fc-segment-active:   #8b5a2b;
  --fc-segment-active-end: #a06830;
  --fc-orange-light:     #ff9f3f;

  /* ── Opacity Utilities ──────────────────────────────────
     Semi-transparent variants of brand/neutral colors
     used for focus rings, overlays, and soft backgrounds. */
  --fc-orange-a15:       rgba(228, 140, 33, 0.15);
  --fc-orange-a60:       rgba(228, 140, 33, 0.6);
  --fc-black-a06:        rgba(0, 0, 0, 0.06);
  --fc-black-a08:        rgba(0, 0, 0, 0.08);
  --fc-black-a12:        rgba(0, 0, 0, 0.12);
  --fc-black-a15:        rgba(0, 0, 0, 0.15);
  --fc-black-a20:        rgba(0, 0, 0, 0.20);
  --fc-black-a25:        rgba(0, 0, 0, 0.25);
  --fc-black-a30:        rgba(0, 0, 0, 0.30);
  --fc-white-a30:        rgba(255, 255, 255, 0.3);
  --fc-white-a50:        rgba(255, 255, 255, 0.5);
  --fc-white-a70:        rgba(255, 255, 255, 0.7);
  --fc-white-a80:        rgba(255, 255, 255, 0.8);
  --fc-white-a90:        rgba(255, 255, 255, 0.9);
  --fc-navy-a50:         rgba(1, 23, 48, 0.5);
  --fc-navy-a60:         rgba(1, 23, 48, 0.6);
  --fc-orange-light-a60: rgba(255, 159, 63, 0.6);
  --fc-error-a20:        rgba(198, 40, 40, 0.2);

  /* ── Toolbar Button Tokens ──────────────────────────────
     Raised white pill buttons used in the version-control
     toolbar. Match the original editor design.             */
  --fc-toolbar-btn-bg:         rgba(255, 255, 255, 0.7);
  --fc-toolbar-btn-border:     rgba(0, 0, 0, 0.15);
  --fc-toolbar-btn-shadow:     0 1px 2px rgba(0, 0, 0, 0.08);
  --fc-toolbar-btn-hover-bg:   rgba(255, 255, 255, 0.9);
  --fc-toolbar-btn-hover-border: rgba(0, 0, 0, 0.25);
  --fc-toolbar-btn-hover-shadow: 0 2px 4px rgba(0, 0, 0, 0.12);

  /* ── Token Tier Gradients ───────────────────────────────
     Background gradients for the complexity-tier indicator
     shown in the toolbar.                                  */
  --fc-tier-simple:    linear-gradient(135deg, #7a9370 0%, #5d7858 100%);
  --fc-tier-moderate:  linear-gradient(135deg, #c49a4a 0%, #a68038 100%);
  --fc-tier-growing:   linear-gradient(135deg, #c07858 0%, #a46048 100%);
  --fc-tier-complex:   linear-gradient(135deg, #8a5848 0%, #6e4438 100%);

  /* ── Responsive Breakpoints ────────────────────────────
     Use in @media queries: @media (max-width: 640px) { }
     Not CSS variables (media queries can't use them) but
     documented here as the canonical breakpoint values.    */
  /* --fc-bp-sm:  640px   — phones                         */
  /* --fc-bp-md:  768px   — tablets                        */
  /* --fc-bp-lg:  1024px  — laptops                        */
  /* --fc-bp-xl:  1280px  — desktops                       */
}


/* ============================================================
   2. DARK TOOL THEME
   ============================================================ */
.fc-dark {
  --fc-brown:            #c4a882;
  --fc-cream:            #1e1e22;
  --fc-cream-light:      #252529;
  --fc-cream-warm:       #2a2a2e;
  --fc-tan:              #e6a95e;
  --fc-orange:           #f0a040;
  --fc-gray-50:          #18181b;
  --fc-gray-100:         #1e1e22;
  --fc-gray-200:         #2a2a30;
  --fc-gray-300:         #3a3a42;
  --fc-gray-400:         #55555f;
  --fc-gray-500:         #8888a0;
  --fc-gray-600:         #aaaabc;
  --fc-gray-700:         #ccccdd;
  --fc-gray-800:         #dddde8;
  --fc-gray-900:         #eeeeF4;
  --fc-white:            #f0f0f5;
  --fc-black:            #000000;

  --fc-shadow-xs:        0 1px 2px rgba(0, 0, 0, 0.3);
  --fc-shadow-sm:        0 1px 3px rgba(0, 0, 0, 0.4);
  --fc-shadow-md:        0 2px 8px rgba(0, 0, 0, 0.4);
  --fc-shadow-lg:        0 4px 12px rgba(0, 0, 0, 0.5);
  --fc-shadow-xl:        0 8px 25px rgba(0, 0, 0, 0.5);

  color-scheme: dark;
}


/* ============================================================
   3. BASE ELEMENT STYLES
   ============================================================ */

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

.fc-base {
  font-family: var(--fc-font-body);
  font-size: var(--fc-text-base);
  line-height: var(--fc-leading-normal);
  color: var(--fc-gray-800);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.fc-base h1, .fc-base h2, .fc-base h3,
.fc-base h4, .fc-base h5, .fc-base h6 {
  font-family: var(--fc-font-brand);
  line-height: var(--fc-leading-tight);
  color: var(--fc-brown);
  margin: 0 0 var(--fc-space-3) 0;
}

.fc-base h1 { font-size: var(--fc-text-4xl); font-weight: 800; }
.fc-base h2 { font-size: var(--fc-text-3xl); font-weight: 700; }
.fc-base h3 { font-size: var(--fc-text-2xl); font-weight: 700; }
.fc-base h4 { font-size: var(--fc-text-xl);  font-weight: 600; }
.fc-base h5 { font-size: var(--fc-text-lg);  font-weight: 600; }
.fc-base h6 { font-size: var(--fc-text-base); font-weight: 600; }

.fc-base p {
  margin: 0 0 var(--fc-space-4) 0;
  color: var(--fc-gray-700);
}

.fc-base a {
  color: var(--fc-orange);
  text-decoration: none;
  transition: color var(--fc-ease-fast);
}
.fc-base a:hover {
  color: var(--fc-orange-hover);
  text-decoration: underline;
}

.fc-base code, .fc-base pre {
  font-family: var(--fc-font-mono);
}

.fc-base small {
  font-size: var(--fc-text-sm);
  color: var(--fc-gray-500);
}


/* ============================================================
   4. BUTTONS
   ============================================================ */

.fc-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--fc-space-2);
  padding: 10px 20px;
  font-family: var(--fc-font-brand);
  font-size: var(--fc-text-base);
  font-weight: 400;
  line-height: 1;
  border: 2px solid transparent;
  border-radius: var(--fc-radius-sm);
  cursor: pointer;
  transition: all var(--fc-ease-base);
  text-decoration: none;
  white-space: nowrap;
  box-shadow: var(--fc-shadow-btn);
}

.fc-btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--fc-shadow-btn-hover);
}

.fc-btn:active {
  transform: translateY(0);
  box-shadow: var(--fc-shadow-btn);
}

.fc-btn:disabled, .fc-btn[aria-disabled="true"] {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
  pointer-events: none;
}

/* -- Variants --
 *
 * Button color strategy (avoids brown-button / brown-tab confusion):
 *
 *   PRIMARY (black)  — Default actions: Run, Submit, Confirm, Save.
 *                      Matches the real app's black button default.
 *   ACCENT (orange)  — Generative / creative: Generate, Create, Publish.
 *   SEND (yellow)    — The big SEND action. Inverts on hover.
 *   DARK (navy)      — Code/developer context: View Code, Debug.
 *   GHOST (brown)    — Secondary: Cancel, Back, Less important actions.
 *   CREAM            — Soft: use on dark backgrounds or inside cards.
 *
 * TABS are brown (#683c06). Buttons are NOT brown. This keeps them
 * visually distinct even when adjacent.
 */

.fc-btn-primary {
  background-color: var(--fc-black);
  color: var(--fc-white);
  border-color: var(--fc-black);
}
.fc-btn-primary:hover {
  background-color: var(--fc-gray-800);
  border-color: var(--fc-gray-800);
}

.fc-btn-accent {
  background-color: var(--fc-orange);
  color: var(--fc-white);
  border-color: var(--fc-orange);
}
.fc-btn-accent:hover {
  background-color: var(--fc-orange-hover);
  border-color: var(--fc-orange-hover);
}

.fc-btn-dark {
  background-color: var(--fc-navy);
  color: var(--fc-white);
  border-color: var(--fc-navy);
}
.fc-btn-dark:hover {
  background-color: var(--fc-navy-hover);
  border-color: var(--fc-navy-hover);
}

.fc-btn-send {
  background-color: var(--fc-yellow);
  color: var(--fc-black);
  border-color: var(--fc-yellow);
  box-shadow: var(--fc-shadow-btn-send);
  letter-spacing: 1px;
}
.fc-btn-send:hover {
  background-color: var(--fc-black);
  color: var(--fc-yellow);
  border-color: var(--fc-black);
  box-shadow: var(--fc-shadow-btn-send-hover);
}

.fc-btn-ghost {
  background-color: transparent;
  color: var(--fc-brown);
  border-color: var(--fc-brown);
}
.fc-btn-ghost:hover {
  background-color: var(--fc-brown);
  color: var(--fc-cream);
}

.fc-btn-cream {
  background-color: var(--fc-cream);
  color: var(--fc-brown);
  border-color: var(--fc-cream);
}
.fc-btn-cream:hover {
  background-color: var(--fc-tan-light);
  border-color: var(--fc-tan-light);
}

/* -- Sizes -- */

.fc-btn-sm {
  padding: 6px 12px;
  font-size: var(--fc-text-sm);
}

.fc-btn-lg {
  padding: 14px 28px;
  font-size: var(--fc-text-lg);
}

.fc-btn-pill {
  border-radius: var(--fc-radius-pill);
}


/* ============================================================
   5. CARDS
   ============================================================ */

.fc-card {
  background: var(--fc-white);
  border: 1px solid var(--fc-gray-200);
  border-radius: var(--fc-radius-lg);
  padding: var(--fc-space-6);
  box-shadow: var(--fc-shadow-sm);
  transition: box-shadow var(--fc-ease-base), transform var(--fc-ease-base);
}

.fc-card:hover {
  box-shadow: var(--fc-shadow-lg);
}

.fc-card-brand {
  background: var(--fc-cream);
  border: 2px solid var(--fc-black);
  border-radius: var(--fc-radius-brand);
  padding: var(--fc-space-8);
  box-shadow: var(--fc-shadow-brand);
}

.fc-card-elevated {
  background: var(--fc-white);
  border: none;
  border-radius: var(--fc-radius-lg);
  padding: var(--fc-space-6);
  box-shadow: var(--fc-shadow-xl);
}


/* ============================================================
   6. FORM ELEMENTS
   ============================================================ */

.fc-input,
.fc-select,
.fc-textarea {
  display: block;
  width: 100%;
  padding: 10px 14px;
  font-family: var(--fc-font-body);
  font-size: var(--fc-text-base);
  color: var(--fc-gray-800);
  background-color: var(--fc-white);
  border: 1.5px solid var(--fc-gray-300);
  border-radius: var(--fc-radius-sm);
  transition: border-color var(--fc-ease-fast), box-shadow var(--fc-ease-fast);
  outline: none;
}

.fc-input:focus,
.fc-select:focus,
.fc-textarea:focus {
  border-color: var(--fc-orange);
  box-shadow: 0 0 0 3px rgba(228, 140, 33, 0.15);
}

.fc-input::placeholder,
.fc-textarea::placeholder {
  color: var(--fc-gray-400);
}

.fc-textarea {
  resize: vertical;
  min-height: 100px;
}

.fc-label {
  display: block;
  font-family: var(--fc-font-brand);
  font-size: var(--fc-text-sm);
  font-weight: 600;
  color: var(--fc-brown);
  margin-bottom: var(--fc-space-1);
}

.fc-form-group {
  margin-bottom: var(--fc-space-5);
}


/* ============================================================
   7. STATUS / TOAST MESSAGES
   ============================================================ */

.fc-status {
  display: flex;
  align-items: flex-start;
  gap: var(--fc-space-3);
  padding: var(--fc-space-4) var(--fc-space-5);
  border-radius: var(--fc-radius-lg);
  font-family: var(--fc-font-body);
  font-size: var(--fc-text-sm);
  border-left: 4px solid transparent;
}

.fc-status-icon {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--fc-text-base);
}

.fc-status-success {
  background: var(--fc-success-bg);
  border-left-color: var(--fc-success);
  color: var(--fc-success);
}

.fc-status-warning {
  background: var(--fc-warning-bg);
  border-left-color: var(--fc-warning);
  color: var(--fc-warning-dark);
}

.fc-status-error {
  background: var(--fc-error-bg);
  border-left-color: var(--fc-error);
  color: var(--fc-error);
}

.fc-status-info {
  background: var(--fc-info-bg);
  border-left-color: var(--fc-info);
  color: var(--fc-info);
}


/* ============================================================
   8. TABS
   ============================================================ */

.fc-tabs {
  display: flex;
  gap: 1px;
  background-color: var(--fc-gray-200);
  border-radius: var(--fc-radius-sm) var(--fc-radius-sm) 0 0;
  overflow: hidden;
  width: fit-content;
}

.fc-tab {
  padding: 10px 18px;
  font-family: var(--fc-font-brand);
  font-size: var(--fc-text-base);
  font-weight: 500;
  background-color: var(--fc-brown);
  color: var(--fc-cream);
  border: none;
  cursor: pointer;
  transition: background-color var(--fc-ease-fast);
}

.fc-tab:hover {
  background-color: var(--fc-orange-hover);
}

.fc-tab[aria-selected="true"],
.fc-tab.active {
  background-color: var(--fc-brown-light);
  color: var(--fc-white);
}

.fc-tab-content {
  border: 1px solid var(--fc-gray-300);
  border-top: none;
  border-radius: 0 0 var(--fc-radius-sm) var(--fc-radius-sm);
  padding: var(--fc-space-5);
  /* Glass surface: translucent white lets textured backgrounds show through */
  background: var(--fc-surface-glass);
}


/* ============================================================
   9. CODE BLOCKS
   ============================================================ */

.fc-code {
  display: block;
  padding: var(--fc-space-5);
  font-family: var(--fc-font-mono);
  font-size: var(--fc-text-sm);
  line-height: 1.7;
  background: var(--fc-gray-900);
  color: var(--fc-code-text);
  border-radius: var(--fc-radius-lg);
  box-shadow: var(--fc-shadow-inset);
  overflow-x: auto;
  white-space: pre;
  -webkit-font-smoothing: auto;
}

.fc-code-inline {
  display: inline;
  padding: 2px 6px;
  font-family: var(--fc-font-mono);
  font-size: 0.9em;
  background: var(--fc-cream-light);
  color: var(--fc-brown);
  border-radius: var(--fc-radius-sm);
  border: 1px solid var(--fc-gray-200);
}

/* Syntax highlighting tokens */
.fc-code .token-keyword  { color: #ff79c6; }
.fc-code .token-string   { color: #f1fa8c; }
.fc-code .token-comment  { color: #6272a4; font-style: italic; }
.fc-code .token-function { color: #50fa7b; }
.fc-code .token-number   { color: #bd93f9; }
.fc-code .token-tag      { color: #8be9fd; }
.fc-code .token-attr     { color: #ffb86c; }


/* ============================================================
   10. TABLES
   ============================================================ */

.fc-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--fc-font-body);
  font-size: var(--fc-text-sm);
}

.fc-table thead {
  background: var(--fc-brown);
  color: var(--fc-white);
}

.fc-table th {
  padding: var(--fc-space-3) var(--fc-space-4);
  text-align: left;
  font-family: var(--fc-font-brand);
  font-weight: 600;
  font-size: var(--fc-text-sm);
}

.fc-table th:first-child { border-radius: var(--fc-radius-md) 0 0 0; }
.fc-table th:last-child  { border-radius: 0 var(--fc-radius-md) 0 0; }

.fc-table td {
  padding: var(--fc-space-3) var(--fc-space-4);
  border-bottom: 1px solid var(--fc-gray-200);
}

.fc-table tbody tr {
  transition: background-color var(--fc-ease-fast);
}

.fc-table tbody tr:hover {
  background-color: var(--fc-cream-light);
}

.fc-table tbody tr:last-child td {
  border-bottom: none;
}


/* ============================================================
   11. MODAL
   ============================================================ */

.fc-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(1, 23, 48, 0.6);
  backdrop-filter: blur(4px);
  z-index: var(--fc-z-modal-backdrop);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity var(--fc-ease-base);
  pointer-events: none;
}

.fc-modal-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

.fc-modal {
  background: var(--fc-white);
  border-radius: var(--fc-radius-lg);
  box-shadow: var(--fc-shadow-2xl);
  padding: var(--fc-space-8);
  max-width: 520px;
  width: 90%;
  z-index: var(--fc-z-modal);
  transform: translateY(20px) scale(0.97);
  transition: transform var(--fc-ease-bounce), opacity var(--fc-ease-base);
  opacity: 0;
}

.fc-modal-backdrop.active .fc-modal {
  transform: translateY(0) scale(1);
  opacity: 1;
}

.fc-modal-header {
  font-family: var(--fc-font-brand);
  font-size: var(--fc-text-2xl);
  font-weight: 700;
  color: var(--fc-brown);
  margin-bottom: var(--fc-space-4);
}

.fc-modal-close {
  position: absolute;
  top: var(--fc-space-4);
  right: var(--fc-space-4);
  background: none;
  border: none;
  font-size: var(--fc-text-xl);
  color: var(--fc-gray-500);
  cursor: pointer;
  padding: var(--fc-space-1);
  line-height: 1;
  transition: color var(--fc-ease-fast);
}

.fc-modal-close:hover {
  color: var(--fc-gray-800);
}


/* ============================================================
   12. LOADING STATES
   ============================================================ */

/* Dot bounce (brand signature loading) */
@keyframes fc-dot-bounce {
  0%, 60%, 100% { transform: translateY(0); }
  30%           { transform: translateY(-8px); }
}

.fc-loading-dots {
  display: inline-flex;
  gap: 4px;
  align-items: center;
}

.fc-loading-dots span {
  width: 8px;
  height: 8px;
  background-color: var(--fc-orange);
  border-radius: var(--fc-radius-full);
  animation: fc-dot-bounce 1.4s ease-in-out infinite;
}

.fc-loading-dots span:nth-child(2) { animation-delay: 0.16s; }
.fc-loading-dots span:nth-child(3) { animation-delay: 0.32s; }

/* Spinner */
@keyframes fc-spin {
  to { transform: rotate(360deg); }
}

.fc-spinner {
  width: 24px;
  height: 24px;
  border: 3px solid var(--fc-gray-200);
  border-top-color: var(--fc-orange);
  border-radius: var(--fc-radius-full);
  animation: fc-spin 0.8s linear infinite;
}

.fc-spinner-sm { width: 16px; height: 16px; border-width: 2px; }
.fc-spinner-lg { width: 40px; height: 40px; border-width: 4px; }

/* Skeleton shimmer */
@keyframes fc-shimmer {
  0%   { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

.fc-skeleton {
  background: linear-gradient(
    90deg,
    var(--fc-gray-200) 25%,
    var(--fc-gray-100) 50%,
    var(--fc-gray-200) 75%
  );
  background-size: 200% 100%;
  animation: fc-shimmer 1.8s ease infinite;
  border-radius: var(--fc-radius-sm);
}


/* ============================================================
   13. BADGES & TAGS
   ============================================================ */

.fc-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--fc-space-1);
  padding: 3px 10px;
  font-family: var(--fc-font-brand);
  font-size: var(--fc-text-xs);
  font-weight: 600;
  border-radius: var(--fc-radius-pill);
  white-space: nowrap;
}

.fc-badge-brown   { background: var(--fc-brown); color: var(--fc-white); }
.fc-badge-orange  { background: var(--fc-orange); color: var(--fc-white); }
.fc-badge-cream   { background: var(--fc-cream-light); color: var(--fc-brown); border: 1.5px solid var(--fc-gray-300); }
.fc-badge-success { background: var(--fc-success-light); color: var(--fc-success); }
.fc-badge-warning { background: var(--fc-warning-light); color: var(--fc-warning-dark); }
.fc-badge-error   { background: var(--fc-error-light); color: var(--fc-error); }
.fc-badge-info    { background: var(--fc-info-light); color: var(--fc-info); }


/* ============================================================
   14. TOKEN INDICATOR (size multiplier pill)
   ============================================================
 *
 * The token indicator shows project size as a multiplier
 * (0x, 1x, 2x, etc.) inside a color-coded pill. The tier
 * color shifts from green → amber → terracotta → cocoa as
 * the project grows. A noise texture overlay adds an organic,
 * handcrafted feel.
 */

.fc-token-indicator {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 42px;
  height: 25px;
  padding: 0 10px;
  border-radius: 12px;
  border: 1px solid rgba(0, 0, 0, 0.12);
  position: relative;
  overflow: hidden;
  cursor: default;
  box-shadow: inset 0 1px 3px rgba(255, 255, 255, 0.15), 0 1px 2px rgba(0, 0, 0, 0.08);
  transition: background 0.4s ease, transform 0.15s ease;
}

/* Grain texture overlay for organic feel */
.fc-token-indicator::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
  opacity: 0.25;
  mix-blend-mode: soft-light;
  pointer-events: none;
}

.fc-token-indicator:hover {
  transform: scale(1.03);
}

/* Tier color variants — warm earth tones */
.fc-token-indicator.tier-simple {
  background: linear-gradient(135deg, #7a9370 0%, #5d7858 100%);
}

.fc-token-indicator.tier-moderate {
  background: linear-gradient(135deg, #c49a4a 0%, #a68038 100%);
}

.fc-token-indicator.tier-growing {
  background: linear-gradient(135deg, #c07858 0%, #a46048 100%);
}

.fc-token-indicator.tier-complex {
  background: linear-gradient(135deg, #8a5848 0%, #6e4438 100%);
}

.fc-token-label {
  position: relative;
  color: var(--fc-white);
  font-family: var(--fc-font-brand);
  font-size: var(--fc-text-xs);
  font-weight: 600;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.2);
  white-space: nowrap;
  letter-spacing: 0.02em;
}


/* ============================================================
   15. UTILITY CLASSES
   ============================================================ */

/* Font families */
.fc-font-brand { font-family: var(--fc-font-brand); }
.fc-font-body  { font-family: var(--fc-font-body); }
.fc-font-mono  { font-family: var(--fc-font-mono); }

/* Text alignment */
.fc-text-left   { text-align: left; }
.fc-text-center { text-align: center; }
.fc-text-right  { text-align: right; }

/* Flex utilities */
.fc-flex       { display: flex; }
.fc-flex-col   { display: flex; flex-direction: column; }
.fc-flex-wrap  { flex-wrap: wrap; }
.fc-items-center { align-items: center; }
.fc-justify-center { justify-content: center; }
.fc-justify-between { justify-content: space-between; }
.fc-gap-2 { gap: var(--fc-space-2); }
.fc-gap-3 { gap: var(--fc-space-3); }
.fc-gap-4 { gap: var(--fc-space-4); }
.fc-gap-6 { gap: var(--fc-space-6); }
.fc-gap-8 { gap: var(--fc-space-8); }

/* Display */
.fc-hidden  { display: none; }
.fc-block   { display: block; }
.fc-inline  { display: inline; }

/* Spacing (margins/padding) */
.fc-m-0  { margin: 0; }
.fc-mt-4 { margin-top: var(--fc-space-4); }
.fc-mt-6 { margin-top: var(--fc-space-6); }
.fc-mt-8 { margin-top: var(--fc-space-8); }
.fc-mb-4 { margin-bottom: var(--fc-space-4); }
.fc-mb-6 { margin-bottom: var(--fc-space-6); }
.fc-mb-8 { margin-bottom: var(--fc-space-8); }
.fc-p-4  { padding: var(--fc-space-4); }
.fc-p-6  { padding: var(--fc-space-6); }
.fc-p-8  { padding: var(--fc-space-8); }

/* Width */
.fc-w-full { width: 100%; }


/* ============================================================
   16. ANIMATIONS
   ============================================================ */

@keyframes fc-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes fc-slide-up {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes fc-slide-in-right {
  from { opacity: 0; transform: translateX(20px); }
  to   { opacity: 1; transform: translateX(0); }
}

@keyframes fc-scale-in {
  from { opacity: 0; transform: scale(0.92); }
  to   { opacity: 1; transform: scale(1); }
}

.fc-animate-fade    { animation: fc-fade-in 0.3s ease both; }
.fc-animate-slide   { animation: fc-slide-up 0.4s ease both; }
.fc-animate-slide-r { animation: fc-slide-in-right 0.4s ease both; }
.fc-animate-scale   { animation: fc-scale-in 0.35s var(--fc-ease-bounce) both; }

/* Stagger helpers */
.fc-delay-1 { animation-delay: 0.05s; }
.fc-delay-2 { animation-delay: 0.1s; }
.fc-delay-3 { animation-delay: 0.15s; }
.fc-delay-4 { animation-delay: 0.2s; }
.fc-delay-5 { animation-delay: 0.25s; }
.fc-delay-6 { animation-delay: 0.3s; }
.fc-delay-7 { animation-delay: 0.35s; }
.fc-delay-8 { animation-delay: 0.4s; }


/* ============================================================
   17. SURFACES (readability layers)
   ============================================================
 *
 * CRITICAL PATTERN: In FuzzyCode, body text never sits directly
 * on the cream (#edd9c0) background. Cream is a *container*
 * color. Text always lives inside a white or near-white surface
 * card cut out within the cream.
 *
 * Layering order (outside → inside):
 *   Blue body → Cream container → White surface → Text
 */

.fc-surface {
  background: var(--fc-surface);
  border-radius: var(--fc-radius-lg);
  padding: var(--fc-space-5);
}

.fc-surface-dim {
  background: var(--fc-surface-dim);
  border-radius: var(--fc-radius-lg);
  padding: var(--fc-space-5);
}

.fc-surface-overlay {
  background: var(--fc-surface-overlay);
  border-radius: var(--fc-radius-sm);
  padding: var(--fc-space-5);
}


/* ============================================================
   18. TEXTURED PANELS (workshop areas)
   ============================================================
 *
 * The dotted-white-on-color texture is the FuzzyCode "workshop"
 * pattern. Use it for interactive areas where the user is
 * actively creating or editing — the tab-container, toolbars,
 * and input regions.
 *
 * DO NOT use on:
 *   - Modals/popups (too busy for focused dialogs)
 *   - Static content pages (terms, profile, history)
 *   - Cards inside the workshop (they should be plain white)
 *
 * The real app nests two textured layers:
 *   .fc-workshop (orange #e6a95e + dots, 3px black border)
 *     └─ .fc-workshop-inner (--fc-surface-glass, shows texture through)
 *          └─ white cards for actual content
 */

.fc-textured {
  background-image: var(--fc-texture-dots);
}

.fc-workshop {
  background-color: var(--fc-tan);
  background-image: var(--fc-texture-dots);
  border: 3px solid var(--fc-black);
  border-radius: var(--fc-radius-brand) var(--fc-radius-brand) 0 0;
  padding: var(--fc-space-5);
}

.fc-workshop-inner {
  background: var(--fc-surface-glass);
  border: 1px solid var(--fc-black);
  border-radius: var(--fc-radius-sm);
  padding: var(--fc-space-3);
}


/* ============================================================
   19. SEGMENTED CONTROL (suggest-tab pattern)
   ============================================================
 *
 * For "Fixes / Improve / Features" style controls that are
 * between buttons and tabs — a set of mutually exclusive options
 * that filter or switch a sub-view within a tab.
 *
 * Visual: pill-shaped group with warm tan gradient border,
 * cream gradient options, active state inverts to dark brown.
 */

.fc-segments {
  display: inline-flex;
  background: linear-gradient(180deg, var(--fc-tan) 0%, var(--fc-segment-group) 100%);
  border-radius: var(--fc-radius-xl);
  padding: 3px;
  box-shadow: var(--fc-shadow-sm), inset 0 1px 0 rgba(255, 255, 255, 0.3);
  border: 2px solid var(--fc-segment-border);
  gap: 0;
}

.fc-segment {
  padding: 8px 16px;
  font-family: var(--fc-font-brand);
  font-size: var(--fc-text-sm);
  font-weight: 600;
  background: linear-gradient(180deg, var(--fc-cream-light) 0%, var(--fc-cream) 100%);
  color: var(--fc-segment-text);
  border: none;
  cursor: pointer;
  transition: all var(--fc-ease-fast);
  display: inline-flex;
  align-items: center;
  gap: var(--fc-space-1);
  box-shadow: var(--fc-shadow-xs), inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.fc-segment:first-child {
  border-radius: var(--fc-radius-xl) 0 0 var(--fc-radius-xl);
}

.fc-segment:last-child {
  border-radius: 0 var(--fc-radius-xl) var(--fc-radius-xl) 0;
}

.fc-segment:hover {
  background: linear-gradient(180deg, var(--fc-white) 0%, var(--fc-cream-light) 100%);
}

.fc-segment.active {
  background: linear-gradient(180deg, var(--fc-segment-active) 0%, var(--fc-segment-active-end) 100%);
  color: var(--fc-white);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3), inset 0 0 0 1px rgba(0, 0, 0, 0.1);
}

.fc-segment.active:hover {
  background: linear-gradient(180deg, var(--fc-brown-hover) 0%, var(--fc-brown-light) 100%);
}


/* ============================================================
   20. PROSE / MARKDOWN CONTENT
   ============================================================
 *
 * Apply .fc-prose to any container rendering markdown or rich
 * text (AI responses, documentation, user-generated content).
 * Reuses the same visual language as the standalone components
 * (.fc-code, .fc-code-inline, .fc-table, .fc-base a, etc.).
 *
 * Usage:
 *   <div class="fc-prose">
 *     <!-- rendered markdown HTML here -->
 *   </div>
 */

.fc-prose {
  font-family: var(--fc-font-body);
  font-size: var(--fc-text-base);
  line-height: var(--fc-leading-normal);
  color: var(--fc-gray-800);
  word-break: break-word;
}

/* ── Headings ── */
.fc-prose h1,
.fc-prose h2,
.fc-prose h3,
.fc-prose h4,
.fc-prose h5,
.fc-prose h6 {
  font-family: var(--fc-font-brand);
  color: var(--fc-brown);
  margin: 1.5em 0 0.5em;
  font-weight: 600;
  line-height: var(--fc-leading-tight);
}

.fc-prose h1:first-child,
.fc-prose h2:first-child,
.fc-prose h3:first-child {
  margin-top: 0;
}

.fc-prose h1 { font-size: 1.5rem; font-weight: 700; padding-bottom: 0.3em; border-bottom: 2px solid var(--fc-cream); }
.fc-prose h2 { font-size: 1.3rem; font-weight: 700; padding-bottom: 0.25em; border-bottom: 1px solid var(--fc-gray-200); }
.fc-prose h3 { font-size: 1.1rem; }
.fc-prose h4 { font-size: 1rem; }

/* ── Paragraphs ── */
.fc-prose p {
  margin: 0 0 1em;
}

/* ── Links ── */
/* Matches .fc-base a */
.fc-prose a {
  color: var(--fc-orange);
  text-decoration: none;
  transition: color var(--fc-ease-fast);
}

.fc-prose a:hover {
  color: var(--fc-orange-hover);
  text-decoration: underline;
}

/* ── Bold, italic, strikethrough ── */
.fc-prose strong { font-weight: 700; color: var(--fc-brown); }
.fc-prose em     { font-style: italic; }
.fc-prose del    { text-decoration: line-through; color: var(--fc-gray-500); }

/* ── Lists ── */
.fc-prose ul,
.fc-prose ol {
  padding-left: 1.5em;
  margin: 0 0 1em;
}

.fc-prose li {
  margin-bottom: 0.4em;
}

.fc-prose li::marker {
  color: var(--fc-brown);
}

.fc-prose ul ul,
.fc-prose ol ol,
.fc-prose ul ol,
.fc-prose ol ul {
  margin-bottom: 0;
  margin-top: 0.3em;
}

/* ── Task lists (checkbox) ── */
.fc-prose input[type="checkbox"] {
  accent-color: var(--fc-orange);
  margin-right: 6px;
}

/* ── Inline code ── */
/* Matches .fc-code-inline */
.fc-prose code {
  font-family: var(--fc-font-mono);
  font-size: 0.9em;
  background: var(--fc-cream-light);
  color: var(--fc-brown);
  padding: 2px 6px;
  border-radius: var(--fc-radius-sm);
  border: 1px solid var(--fc-gray-200);
}

/* ── Code blocks ── */
/* Matches .fc-code */
.fc-prose pre {
  background: var(--fc-gray-900);
  padding: var(--fc-space-5);
  border-radius: var(--fc-radius-lg);
  overflow-x: auto;
  margin: 1em 0;
  box-shadow: var(--fc-shadow-inset);
}

.fc-prose pre code {
  font-family: var(--fc-font-mono);
  font-size: var(--fc-text-sm);
  line-height: 1.7;
  background: transparent;
  color: var(--fc-code-text);
  padding: 0;
  border: none;
}

/* ── Blockquotes ── */
.fc-prose blockquote {
  border-left: 4px solid var(--fc-cream);
  background: var(--fc-cream-light);
  padding: var(--fc-space-3) var(--fc-space-5);
  margin: 1em 0;
  border-radius: 0 var(--fc-radius-md) var(--fc-radius-md) 0;
  color: var(--fc-gray-700);
  font-style: italic;
}

.fc-prose blockquote p:last-child {
  margin-bottom: 0;
}

/* ── Tables ── */
/* Matches .fc-table */
.fc-prose table {
  width: 100%;
  border-collapse: collapse;
  margin: 1em 0;
  font-family: var(--fc-font-body);
  font-size: var(--fc-text-sm);
}

.fc-prose th {
  padding: var(--fc-space-3) var(--fc-space-4);
  text-align: left;
  background: var(--fc-brown);
  color: var(--fc-white);
  font-family: var(--fc-font-brand);
  font-weight: 600;
  font-size: var(--fc-text-sm);
}

.fc-prose td {
  padding: var(--fc-space-3) var(--fc-space-4);
  border-bottom: 1px solid var(--fc-gray-200);
  text-align: left;
}

.fc-prose tbody tr {
  transition: background-color var(--fc-ease-fast);
}

.fc-prose tbody tr:hover {
  background-color: var(--fc-cream-light);
}

.fc-prose tbody tr:last-child td {
  border-bottom: none;
}

/* ── Horizontal rules ── */
.fc-prose hr {
  border: none;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--fc-cream), transparent);
  margin: 2em 0;
}

/* ── Images ── */
.fc-prose img {
  max-width: 100%;
  height: auto;
  border-radius: var(--fc-radius-md);
  box-shadow: var(--fc-shadow-sm);
}

/* ── Definition lists ── */
.fc-prose dt {
  font-weight: 600;
  color: var(--fc-brown);
  margin-top: 1em;
}

.fc-prose dd {
  margin-left: 1.5em;
  margin-bottom: 0.5em;
  color: var(--fc-gray-700);
}

/* ── Keyboard shortcuts ── */
.fc-prose kbd {
  font-family: var(--fc-font-mono);
  font-size: 0.85em;
  padding: 2px 6px;
  background: var(--fc-gray-100);
  border: 1px solid var(--fc-gray-300);
  border-bottom-width: 2px;
  border-radius: 4px;
  color: var(--fc-gray-700);
}

/* ── Mark/highlight ── */
.fc-prose mark {
  background: rgba(255, 244, 96, 0.4);
  color: inherit;
  padding: 1px 4px;
  border-radius: 2px;
}

/* ── Abbreviations ── */
.fc-prose abbr[title] {
  text-decoration: underline dotted;
  cursor: help;
}

/* ── Details/Summary ── */
.fc-prose details {
  border: 1px solid var(--fc-gray-200);
  border-radius: var(--fc-radius-md);
  padding: 12px 16px;
  margin: 1em 0;
}

.fc-prose summary {
  font-weight: 600;
  cursor: pointer;
  color: var(--fc-brown);
  font-family: var(--fc-font-brand);
}

.fc-prose details[open] summary {
  margin-bottom: 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--fc-gray-200);
}

/* ── Subscript / Superscript ── */
.fc-prose sub, .fc-prose sup {
  font-size: 0.75em;
}


/* ============================================================
   21. TOAST NOTIFICATIONS
   ============================================================
 *
 * Slide-in notifications from top-right. Based on the
 * enhanced_toast.js inline styles, using design tokens.
 * Four semantic variants matching the status colors.
 */

.fc-toast-container {
  position: fixed;
  top: var(--fc-space-5);
  right: var(--fc-space-5);
  z-index: var(--fc-z-toast);
  display: flex;
  flex-direction: column;
  gap: var(--fc-space-3);
  max-width: 400px;
  pointer-events: none;
}

.fc-toast {
  background: var(--fc-cream);
  border-radius: var(--fc-radius-lg);
  padding: var(--fc-space-4) var(--fc-space-5);
  box-shadow: var(--fc-shadow-xl);
  display: flex;
  align-items: center;
  gap: var(--fc-space-3);
  border-left: 4px solid var(--fc-gray-400);
  position: relative;
  overflow: hidden;
  font-family: var(--fc-font-brand);
  pointer-events: auto;
  transform: translateX(120%);
  opacity: 0;
  transition: transform var(--fc-ease-bounce), opacity var(--fc-ease-base);
}

.fc-toast.visible {
  transform: translateX(0);
  opacity: 1;
}

.fc-toast-success { border-left-color: var(--fc-success); background: var(--fc-success-bg); }
.fc-toast-error   { border-left-color: var(--fc-error);   background: var(--fc-error-bg); }
.fc-toast-warning { border-left-color: var(--fc-warning); background: var(--fc-warning-bg); }
.fc-toast-info    { border-left-color: var(--fc-info);     background: var(--fc-info-bg); }

.fc-toast-icon {
  font-size: var(--fc-text-xl);
  flex-shrink: 0;
}

.fc-toast-success .fc-toast-icon { color: var(--fc-success); }
.fc-toast-error   .fc-toast-icon { color: var(--fc-error); }
.fc-toast-warning .fc-toast-icon { color: var(--fc-warning); }
.fc-toast-info    .fc-toast-icon { color: var(--fc-info); }

.fc-toast-content {
  flex: 1;
  min-width: 0;
}

.fc-toast-title {
  font-weight: 600;
  font-size: var(--fc-text-sm);
  color: var(--fc-gray-900);
  margin-bottom: 2px;
}

.fc-toast-message {
  font-family: var(--fc-font-body);
  font-size: var(--fc-text-xs);
  line-height: 1.4;
  color: var(--fc-gray-700);
}

.fc-toast-close {
  background: rgba(0, 0, 0, 0.08);
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: var(--fc-radius-md);
  min-width: 28px;
  min-height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--fc-gray-700);
  font-size: var(--fc-text-base);
  transition: all var(--fc-ease-fast);
  flex-shrink: 0;
}

.fc-toast-close:hover {
  background: rgba(0, 0, 0, 0.15);
  transform: scale(1.1);
}

.fc-toast-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 3px;
  background: rgba(104, 60, 6, 0.25);
  transition: width linear;
}

/* -- Toast History Button -- */
.fc-toast-history-btn {
  position: fixed;
  bottom: var(--fc-space-4);
  right: var(--fc-space-4);
  width: 28px;
  height: 28px;
  background: rgba(255, 255, 255, 0.9);
  border-radius: var(--fc-radius-pill);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--fc-gray-500);
  cursor: pointer;
  pointer-events: auto;
  transition: all var(--fc-ease-base);
  z-index: var(--fc-z-toast);
  font-size: var(--fc-text-sm);
  border: 1px solid var(--fc-gray-200);
  box-shadow: var(--fc-shadow-sm);
  opacity: 0;
  visibility: hidden;
  transform: scale(0.8);
}

.fc-toast-history-btn.visible {
  opacity: 1;
  visibility: visible;
  transform: scale(1);
}

.fc-toast-history-btn:hover {
  background: var(--fc-brown);
  border-color: var(--fc-brown);
  color: var(--fc-white);
  transform: scale(1.05);
  box-shadow: var(--fc-shadow-lg);
}

/* -- Toast Drawer Panel -- */
.fc-toast-drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: 400px;
  height: 100vh;
  background: var(--fc-gray-50);
  transform: translateX(100%);
  transition: transform var(--fc-ease-bounce);
  z-index: calc(var(--fc-z-toast) + 2);
  box-shadow: var(--fc-shadow-2xl);
  display: flex;
  flex-direction: column;
  font-family: var(--fc-font-brand);
}

.fc-toast-drawer.open {
  transform: translateX(0);
}

.fc-toast-drawer-header {
  padding: var(--fc-space-5);
  border-bottom: 1px solid var(--fc-gray-200);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--fc-white);
}

.fc-toast-drawer-header h3 {
  color: var(--fc-gray-900);
  font-size: var(--fc-text-xl);
  font-weight: 600;
  margin: 0;
}

.fc-toast-drawer-close {
  background: rgba(0, 0, 0, 0.08);
  border: 1px solid rgba(0, 0, 0, 0.15);
  font-size: var(--fc-text-xl);
  cursor: pointer;
  padding: var(--fc-space-2-5);
  border-radius: var(--fc-radius-lg);
  transition: all var(--fc-ease-fast);
  color: var(--fc-gray-700);
  min-width: 42px;
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.fc-toast-drawer-close:hover {
  background: rgba(0, 0, 0, 0.15);
  border-color: rgba(0, 0, 0, 0.25);
  transform: scale(1.05);
  color: var(--fc-gray-900);
}

.fc-toast-drawer-content {
  flex: 1;
  overflow-y: auto;
  padding: var(--fc-space-5);
}

/* -- Toast drawer empty state -- */
.fc-toast-drawer-empty {
  text-align: center;
  opacity: 0.6;
  margin-top: var(--fc-space-10);
}

/* -- Drawer toast items -- */
.fc-toast-drawer-item {
  background: var(--fc-white);
  border-radius: var(--fc-radius-lg);
  padding: var(--fc-space-3) var(--fc-space-4);
  margin-bottom: var(--fc-space-2-5);
  border-left: 3px solid;
  transition: all var(--fc-ease-fast);
  cursor: pointer;
  box-shadow: var(--fc-shadow-xs);
}

.fc-toast-drawer-item:hover {
  transform: translateX(-5px);
  box-shadow: var(--fc-shadow-md);
}

.fc-toast-drawer-item.fc-toast-success { border-left-color: var(--fc-success); }
.fc-toast-drawer-item.fc-toast-error   { border-left-color: var(--fc-error); }
.fc-toast-drawer-item.fc-toast-warning { border-left-color: var(--fc-warning); }
.fc-toast-drawer-item.fc-toast-info    { border-left-color: var(--fc-info); }

.fc-toast-drawer-item-header {
  display: flex;
  align-items: center;
  gap: var(--fc-space-2);
  margin-bottom: var(--fc-space-1);
}

.fc-toast-drawer-item-icon {
  font-size: var(--fc-text-sm);
  color: var(--fc-gray-700);
}

.fc-toast-drawer-item.fc-toast-success .fc-toast-drawer-item-icon { color: var(--fc-success); }
.fc-toast-drawer-item.fc-toast-error   .fc-toast-drawer-item-icon { color: var(--fc-error); }
.fc-toast-drawer-item.fc-toast-warning .fc-toast-drawer-item-icon { color: var(--fc-warning); }
.fc-toast-drawer-item.fc-toast-info    .fc-toast-drawer-item-icon { color: var(--fc-info); }

.fc-toast-drawer-item-title {
  font-weight: 600;
  font-size: var(--fc-text-xs);
  flex: 1;
  color: var(--fc-gray-900);
}

.fc-toast-drawer-item-time {
  font-size: var(--fc-text-xs);
  margin-left: auto;
  color: var(--fc-gray-500);
}

.fc-toast-drawer-item-message {
  font-size: var(--fc-text-xs);
  margin-left: var(--fc-space-5);
  color: var(--fc-gray-700);
  font-family: var(--fc-font-body);
}

.fc-toast-drawer-item-details {
  margin-left: var(--fc-space-5);
  margin-top: var(--fc-space-2);
  padding: var(--fc-space-3);
  background: var(--fc-gray-100);
  border-radius: var(--fc-radius-md);
  font-size: var(--fc-text-xs);
  display: none;
  border: 1px solid var(--fc-gray-200);
  font-family: var(--fc-font-body);
}

.fc-toast-drawer-item-details.expanded {
  display: block;
}

.fc-toast-drawer-item-details h4 {
  margin: 0 0 var(--fc-space-2);
  font-size: var(--fc-text-sm);
  color: var(--fc-gray-900);
  font-family: var(--fc-font-brand);
}

.fc-toast-drawer-item-details p {
  line-height: var(--fc-leading-normal);
  margin-bottom: var(--fc-space-2);
  color: var(--fc-gray-700);
}

.fc-toast-drawer-item-details code {
  background: rgba(0, 0, 0, 0.08);
  padding: var(--fc-space-0-5) var(--fc-space-1-5);
  border-radius: var(--fc-radius-sm);
  font-family: var(--fc-font-mono);
  font-size: var(--fc-text-xs);
  color: var(--fc-gray-900);
}

.fc-toast-drawer-item-details a {
  color: var(--fc-gray-900);
  text-decoration: underline;
  font-weight: 600;
}

.fc-toast-drawer-item-details a:hover {
  color: var(--fc-black);
}

.fc-toast-drawer-item-details button {
  background: linear-gradient(135deg, var(--fc-brown-hover), var(--fc-brown));
  color: var(--fc-cream);
  border: none;
  padding: var(--fc-space-1-5) var(--fc-space-3);
  border-radius: var(--fc-radius-sm);
  font-size: var(--fc-text-xs);
  cursor: pointer;
  margin-right: var(--fc-space-2);
  margin-top: var(--fc-space-1);
  transition: all var(--fc-ease-fast);
  font-family: var(--fc-font-brand);
}

.fc-toast-drawer-item-details button:hover {
  background: linear-gradient(135deg, var(--fc-brown-light), var(--fc-brown-hover));
  transform: translateY(-1px);
}

/* -- Drawer overlay -- */
.fc-toast-drawer-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(1, 23, 48, 0.4);   /* --fc-navy at 40% — matches confirm backdrop hue */
  opacity: 0;
  visibility: hidden;
  transition: all var(--fc-ease-base);
  z-index: calc(var(--fc-z-toast) + 1);
}

.fc-toast-drawer-overlay.visible {
  opacity: 1;
  visibility: visible;
}

/* -- Clear history button -- */
.fc-toast-drawer-clear {
  background: linear-gradient(135deg, var(--fc-brown-light), var(--fc-brown));
  color: var(--fc-cream);
  border: none;
  padding: var(--fc-space-2-5) var(--fc-space-4);
  border-radius: var(--fc-radius-lg);
  cursor: pointer;
  font-size: var(--fc-text-xs);
  margin: var(--fc-space-2-5) var(--fc-space-5);
  transition: all var(--fc-ease-fast);
  font-family: var(--fc-font-brand);
  font-weight: 600;
}

.fc-toast-drawer-clear:hover {
  transform: translateY(-1px);
  background: linear-gradient(135deg, var(--fc-brown-hover), var(--fc-brown-light));
}

/* -- Admin badge -- */
.fc-toast-admin-badge {
  background: linear-gradient(135deg, var(--fc-brown), var(--fc-gray-800));
  color: var(--fc-cream);
  font-size: var(--fc-text-xs);
  padding: var(--fc-space-0-5) var(--fc-space-2);
  border-radius: var(--fc-radius-pill);
  margin-left: var(--fc-space-1-5);
  font-weight: 600;
}

/* -- Toast details indicator (inline toasts) -- */
.fc-toast-details-indicator {
  background: rgba(0, 0, 0, 0.12);
  border-radius: var(--fc-radius-full);
  width: 16px;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--fc-text-xs);
  cursor: help;
  color: var(--fc-gray-700);
}

/* -- Toast detail hint icon (drawer items) -- */
.fc-toast-drawer-detail-hint {
  margin-left: var(--fc-space-1-5);
  font-size: var(--fc-text-xs);
  opacity: 0.6;
}

/* -- Responsive toast + drawer -- */
@media (max-width: 768px) {
  .fc-toast-container {
    left: var(--fc-space-5);
    right: var(--fc-space-5);
    max-width: none;
  }
  .fc-toast-drawer {
    width: 100%;
  }
}


/* ============================================================
   22. TOOLTIP
   ============================================================ */

.fc-tooltip {
  position: relative;
}

.fc-tooltip::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%) scale(0.95);
  padding: var(--fc-space-1) var(--fc-space-3);
  font-family: var(--fc-font-body);
  font-size: var(--fc-text-xs);
  font-weight: 500;
  color: var(--fc-white);
  background: var(--fc-gray-900);
  border-radius: var(--fc-radius-sm);
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--fc-ease-fast), transform var(--fc-ease-fast);
  z-index: var(--fc-z-popover);
}

.fc-tooltip::before {
  content: '';
  position: absolute;
  bottom: calc(100% + 4px);
  left: 50%;
  transform: translateX(-50%);
  border: 4px solid transparent;
  border-top-color: var(--fc-gray-900);
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--fc-ease-fast);
  z-index: var(--fc-z-popover);
}

.fc-tooltip:hover::after,
.fc-tooltip:focus-visible::after {
  opacity: 1;
  transform: translateX(-50%) scale(1);
}

.fc-tooltip:hover::before,
.fc-tooltip:focus-visible::before {
  opacity: 1;
}

/* Bottom variant */
.fc-tooltip-bottom::after {
  bottom: auto;
  top: calc(100% + 8px);
}
.fc-tooltip-bottom::before {
  bottom: auto;
  top: calc(100% + 4px);
  border-top-color: transparent;
  border-bottom-color: var(--fc-gray-900);
}


/* ============================================================
   23. DROPDOWN MENU
   ============================================================ */

.fc-dropdown {
  position: relative;
  display: inline-block;
}

.fc-dropdown-menu {
  display: none;
  position: absolute;
  top: calc(100% + var(--fc-space-1));
  left: 0;
  min-width: 200px;
  background: var(--fc-white);
  border: 1px solid var(--fc-gray-200);
  border-radius: var(--fc-radius-md);
  box-shadow: var(--fc-shadow-xl);
  padding: var(--fc-space-1) 0;
  z-index: var(--fc-z-dropdown);
  font-family: var(--fc-font-body);
  font-size: var(--fc-text-sm);
}

.fc-dropdown-menu.open {
  display: block;
}

.fc-dropdown-item {
  display: block;
  width: 100%;
  padding: var(--fc-space-2) var(--fc-space-4);
  background: none;
  border: none;
  text-align: left;
  color: var(--fc-gray-800);
  cursor: pointer;
  transition: background-color var(--fc-ease-fast);
  font-family: inherit;
  font-size: inherit;
}

.fc-dropdown-item:hover {
  background-color: var(--fc-cream-light);
}

.fc-dropdown-item.selected {
  font-weight: 600;
  color: var(--fc-brown);
}

.fc-dropdown-divider {
  height: 1px;
  background: var(--fc-gray-200);
  margin: var(--fc-space-1) 0;
}

.fc-dropdown-header {
  padding: var(--fc-space-2) var(--fc-space-4);
  font-family: var(--fc-font-brand);
  font-size: var(--fc-text-xs);
  font-weight: 600;
  color: var(--fc-gray-500);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}


/* ============================================================
   24. SIDEBAR / SLIDE-OUT PANEL
   ============================================================
 *
 * A slide-out panel from the left or right edge. The real app
 * sidebar uses a dark theme (#222); this provides a brand-themed
 * version plus a dark variant via .fc-dark.
 */

.fc-sidebar-overlay {
  position: fixed;
  inset: 0;
  background: rgba(1, 23, 48, 0.4);
  opacity: 0;
  visibility: hidden;
  transition: all var(--fc-ease-base);
  z-index: var(--fc-z-sidebar);
}

.fc-sidebar-overlay.open {
  opacity: 1;
  visibility: visible;
}

.fc-sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: 320px;
  height: 100vh;
  background: var(--fc-white);
  box-shadow: var(--fc-shadow-2xl);
  transform: translateX(-100%);
  transition: transform var(--fc-ease-base);
  z-index: calc(var(--fc-z-sidebar) + 1);
  display: flex;
  flex-direction: column;
  font-family: var(--fc-font-body);
  overflow: hidden;
}

.fc-sidebar.open {
  transform: translateX(0);
}

.fc-sidebar-right {
  left: auto;
  right: 0;
  transform: translateX(100%);
}

.fc-sidebar-right.open {
  transform: translateX(0);
}

.fc-sidebar-header {
  padding: var(--fc-space-5) var(--fc-space-6);
  border-bottom: 1px solid var(--fc-gray-200);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.fc-sidebar-header h3 {
  font-family: var(--fc-font-brand);
  font-size: var(--fc-text-lg);
  font-weight: 600;
  color: var(--fc-brown);
  margin: 0;
}

.fc-sidebar-body {
  flex: 1;
  overflow-y: auto;
  padding: var(--fc-space-4);
}

.fc-sidebar-item {
  display: flex;
  align-items: center;
  gap: var(--fc-space-3);
  padding: var(--fc-space-3) var(--fc-space-4);
  border-radius: var(--fc-radius-md);
  color: var(--fc-gray-700);
  cursor: pointer;
  transition: background-color var(--fc-ease-fast);
  font-size: var(--fc-text-sm);
  border: none;
  background: none;
  width: 100%;
  text-align: left;
}

.fc-sidebar-item:hover {
  background-color: var(--fc-cream-light);
}

.fc-sidebar-item i {
  width: 20px;
  text-align: center;
  color: var(--fc-gray-500);
}


/* ============================================================
   25. SUGGESTION CARD
   ============================================================
 *
 * The AI suggestion cards shown after generation. White card
 * with description text that fades out and a full-width action
 * button at the bottom.
 */

.fc-suggestion-card {
  width: 240px;
  display: flex;
  flex-direction: column;
  background: var(--fc-white);
  border: 1px solid var(--fc-gray-300);
  border-radius: var(--fc-radius-sm);
  box-shadow: var(--fc-shadow-xs);
  overflow: hidden;
  transition: box-shadow var(--fc-ease-fast), border-color var(--fc-ease-fast);
}

.fc-suggestion-card:hover {
  box-shadow: var(--fc-shadow-md);
  border-color: var(--fc-gray-400);
}

.fc-suggestion-desc {
  font-family: var(--fc-font-body);
  font-size: var(--fc-text-sm);
  color: var(--fc-gray-700);
  line-height: var(--fc-leading-normal);
  padding: var(--fc-space-3);
  flex: 1;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(to bottom, black 75%, transparent 100%);
  mask-image: linear-gradient(to bottom, black 75%, transparent 100%);
}

.fc-suggestion-btn {
  width: 100%;
  padding: var(--fc-space-2) var(--fc-space-3);
  font-family: var(--fc-font-brand);
  font-size: var(--fc-text-xs);
  font-weight: 600;
  background: var(--fc-black);
  color: var(--fc-white);
  border: none;
  border-top: 1px solid var(--fc-gray-200);
  cursor: pointer;
  transition: background-color var(--fc-ease-fast);
}

.fc-suggestion-btn:hover {
  background: var(--fc-gray-800);
}


/* ============================================================
   26. TOOLBAR ISLAND
   ============================================================
 *
 * Grouped toolbar buttons in a pill-shaped container. Used in
 * the version-control bar for tool groups (user status, tools,
 * version actions).
 */

.fc-toolbar-island {
  display: inline-flex;
  align-items: center;
  background: rgba(0, 0, 0, 0.06);
  border-radius: 14px;
  padding: 3px 5px;
  gap: 2px;
}

.fc-toolbar-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  min-height: 28px;
  padding: 5px 7px;
  border-radius: var(--fc-radius-md);
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(0, 0, 0, 0.12);
  color: var(--fc-gray-700);
  font-size: var(--fc-text-xs);
  font-family: var(--fc-font-body);
  cursor: pointer;
  transition: all 0.12s ease;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

.fc-toolbar-btn:hover {
  background: rgba(255, 255, 255, 0.9);
  border-color: rgba(0, 0, 0, 0.2);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.12);
}

.fc-toolbar-btn:active {
  background: rgba(255, 255, 255, 0.6);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);
}

.fc-toolbar-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.fc-toolbar-btn i {
  font-size: var(--fc-text-xs);
}

/* Version label inherits the standard toolbar-btn translucent background;
   it just uses the brand font + bolder weight for the version number. */
.fc-toolbar-btn.fc-toolbar-btn-version {
  font-family: var(--fc-font-brand);
  font-weight: 600;
}


/* ============================================================
   27. PROMPT TEXTAREA
   ============================================================
 *
 * The main text input where users type their prompts. An
 * enhanced textarea with Montserrat body font and a prominent
 * focus state. Pair with .fc-btn-send for the SEND button.
 */

.fc-prompt {
  display: block;
  width: 100%;
  min-height: 120px;
  padding: var(--fc-space-4);
  font-family: var(--fc-font-body);
  font-size: var(--fc-text-base);
  line-height: var(--fc-leading-relaxed);
  color: var(--fc-gray-800);
  background: var(--fc-white);
  border: 2px solid var(--fc-gray-300);
  border-radius: var(--fc-radius-md);
  resize: vertical;
  outline: none;
  transition: border-color var(--fc-ease-fast), box-shadow var(--fc-ease-fast);
}

.fc-prompt::placeholder {
  color: var(--fc-gray-400);
  font-style: italic;
}

.fc-prompt:focus {
  border-color: var(--fc-orange);
  box-shadow: 0 0 0 4px rgba(228, 140, 33, 0.15);
}

.fc-prompt-wrapper {
  position: relative;
}

.fc-prompt-wrapper .fc-btn-send {
  position: absolute;
  bottom: var(--fc-space-3);
  right: var(--fc-space-3);
}


/* ============================================================
   28. FOCUS & ACCESSIBILITY
   ============================================================ */

/* Focus-visible ring for keyboard navigation */
.fc-btn:focus-visible,
.fc-tab:focus-visible,
.fc-segment:focus-visible,
.fc-toolbar-btn:focus-visible,
.fc-dropdown-item:focus-visible,
.fc-sidebar-item:focus-visible {
  outline: 2px solid var(--fc-orange);
  outline-offset: 2px;
}

.fc-input:focus-visible,
.fc-select:focus-visible,
.fc-textarea:focus-visible,
.fc-prompt:focus-visible {
  outline: none; /* uses box-shadow focus ring instead */
}

/* Skip link for screen readers */
.fc-skip-link {
  position: absolute;
  top: -100%;
  left: var(--fc-space-4);
  padding: var(--fc-space-2) var(--fc-space-4);
  background: var(--fc-orange);
  color: var(--fc-white);
  font-family: var(--fc-font-brand);
  font-weight: 600;
  border-radius: 0 0 var(--fc-radius-md) var(--fc-radius-md);
  z-index: 10000;
  transition: top var(--fc-ease-fast);
}

.fc-skip-link:focus {
  top: 0;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Screen reader only utility */
.fc-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}


/* ============================================================
   29. RESPONSIVE HELPERS
   ============================================================ */

@media (max-width: 640px) {
  .fc-hide-sm { display: none !important; }
  .fc-sidebar { width: 85vw; }
}

@media (min-width: 641px) and (max-width: 1024px) {
  .fc-hide-md { display: none !important; }
}

@media (min-width: 1025px) {
  .fc-hide-lg { display: none !important; }
}


/* ============================================================
   30. COLLAPSIBLE NAV SIDEBAR
   ============================================================
 *
 * The app's left-edge navigation. Three states:
 *   compact  → icon strip (50px), flyout labels on hover
 *   expanded → full-width (280px), labels inline
 *
 * Dark by default (matches the real app's #222 sidebar).
 * Toggle .expanded class with JS.
 */

.fc-nav-sidebar {
  width: 50px;
  background: var(--fc-gray-900);
  border-radius: var(--fc-radius-xl);
  overflow: visible;
  transition: width var(--fc-ease-base),
              border-radius var(--fc-ease-base);
  display: flex;
  flex-direction: column;
  font-family: var(--fc-font-body);
}

.fc-nav-sidebar.expanded {
  width: 280px;
  border-radius: var(--fc-radius-lg);
}

/* Gear/toggle button at top */
.fc-nav-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 50px;
  background: var(--fc-gray-800);
  color: var(--fc-white);
  border: none;
  cursor: pointer;
  transition: background-color var(--fc-ease-fast);
  border-radius: var(--fc-radius-xl) var(--fc-radius-xl) 0 0;
  font-size: var(--fc-text-lg);
}

.fc-nav-sidebar.expanded .fc-nav-toggle {
  border-radius: var(--fc-radius-lg) var(--fc-radius-lg) 0 0;
}

.fc-nav-toggle:hover {
  background: var(--fc-gray-700);
}

/* Menu list */
.fc-nav-menu {
  list-style: none;
  padding: 0;
  margin: 0;
}

.fc-nav-menu::after {
  content: '';
  display: block;
  height: 12px;
  background: var(--fc-gray-900);
  border-radius: 0 0 var(--fc-radius-xl) var(--fc-radius-xl);
}

.fc-nav-sidebar.expanded .fc-nav-menu::after {
  border-radius: 0 0 var(--fc-radius-lg) var(--fc-radius-lg);
}

/* Menu items */
.fc-nav-item {
  display: flex;
  align-items: center;
  padding: var(--fc-space-4);
  color: var(--fc-white);
  cursor: pointer;
  transition: background-color var(--fc-ease-fast);
  border-bottom: 1px solid var(--fc-gray-800);
  white-space: nowrap;
  position: relative;
  overflow: visible;
  border-left: none;
  border-right: none;
  border-top: none;
  background: none;
  width: 100%;
  text-align: left;
  font-family: inherit;
  font-size: var(--fc-text-sm);
}

.fc-nav-item:hover {
  background: var(--fc-gray-800);
}

.fc-nav-item i {
  width: 20px;
  text-align: center;
  flex-shrink: 0;
}

.fc-nav-item-label {
  margin-left: var(--fc-space-3);
  transition: opacity var(--fc-ease-fast);
}

/* Compact: center icons, hide labels */
.fc-nav-sidebar:not(.expanded) .fc-nav-item {
  justify-content: center;
  height: 50px;
}

.fc-nav-sidebar:not(.expanded) .fc-nav-item-label {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  left: calc(100% + 8px);
  top: 50%;
  transform: translateY(-50%);
  background: var(--fc-gray-900);
  padding: var(--fc-space-2) var(--fc-space-3);
  border-radius: var(--fc-radius-sm);
  white-space: nowrap;
  box-shadow: var(--fc-shadow-lg);
  z-index: var(--fc-z-popover);
  font-size: var(--fc-text-xs);
}

/* Flyout label on hover */
.fc-nav-sidebar:not(.expanded) .fc-nav-item:hover .fc-nav-item-label {
  opacity: 1;
}


/* ============================================================
   31. VERSION DROPDOWN
   ============================================================
 *
 * A dropdown that shows version history as a timeline.
 * Trigger button matches standard toolbar style (translucent white).
 * Each item shows version number, timestamp, optional summary,
 * and diff stats. A left-side timeline with colored dots shows
 * the version path.
 */

/* Version trigger matches standard toolbar button style —
   translucent white, not orange. Brand font for the label. */
.fc-version-trigger {
  display: inline-flex;
  align-items: center;
  gap: var(--fc-space-1);
  padding: 5px 8px;
  font-family: var(--fc-font-brand);
  font-size: var(--fc-text-xs);
  font-weight: 600;
  background: rgba(255, 255, 255, 0.7);
  color: var(--fc-gray-700);
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: var(--fc-radius-md);
  cursor: pointer;
  transition: all 0.12s ease;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

.fc-version-trigger:hover {
  background: rgba(255, 255, 255, 0.9);
  border-color: rgba(0, 0, 0, 0.2);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.12);
}

.fc-version-trigger i {
  font-size: 10px;
  margin-left: var(--fc-space-1);
}

.fc-version-panel {
  display: none;
  position: absolute;
  top: calc(100% + var(--fc-space-1));
  left: 0;
  min-width: 320px;
  max-height: 400px;
  overflow-y: auto;
  background: var(--fc-white);
  border-radius: var(--fc-radius-md);
  box-shadow: var(--fc-shadow-xl);
  padding: var(--fc-space-3) var(--fc-space-3) var(--fc-space-3) var(--fc-space-6);
  z-index: var(--fc-z-dropdown);
  font-family: var(--fc-font-body);
  font-size: var(--fc-text-sm);
}

.fc-version-panel.open {
  display: block;
}

/* Timeline rail on the left */
.fc-version-timeline {
  position: relative;
  border-left: 2px solid var(--fc-gray-200);
  margin-left: 4px;
}

/* Individual version entry */
.fc-version-item {
  position: relative;
  padding: var(--fc-space-2) var(--fc-space-3);
  margin-bottom: var(--fc-space-1);
  border-radius: var(--fc-radius-sm);
  cursor: pointer;
  transition: background-color var(--fc-ease-fast);
}

.fc-version-item:hover {
  background: var(--fc-gray-50);
}

.fc-version-item.current {
  font-weight: 600;
  color: var(--fc-info);
}

/* Timeline dot */
.fc-version-node {
  position: absolute;
  left: -22px;
  top: 12px;
  width: 10px;
  height: 10px;
  border-radius: var(--fc-radius-full);
  border: 2px solid var(--fc-white);
  background: var(--fc-gray-300);
}

.fc-version-node-first   { background: var(--fc-success); }
.fc-version-node-current { background: var(--fc-info); box-shadow: 0 0 0 3px rgba(25, 118, 210, 0.3); }
.fc-version-node-path    { background: var(--fc-warning); }
.fc-version-node-ref     { background: var(--fc-orange); }

/* Version header line: name + timestamp */
.fc-version-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.fc-version-name {
  font-weight: 500;
  color: var(--fc-gray-800);
}

.fc-version-item.current .fc-version-name {
  color: var(--fc-info);
}

.fc-version-time {
  font-size: var(--fc-text-xs);
  color: var(--fc-gray-500);
}

.fc-version-summary {
  font-size: var(--fc-text-xs);
  color: var(--fc-gray-600);
  font-style: italic;
  margin-top: 2px;
}

.fc-version-stats {
  font-size: var(--fc-text-xs);
  color: var(--fc-gray-500);
  margin-top: 2px;
}

.fc-version-stats i {
  margin-right: 4px;
}


/* ============================================================
   32. SWIPE BUTTON
   ============================================================
 *
 * A progressive-disclosure button: beginners click it normally;
 * power users press-and-drag to reveal 4 directional options
 * around the button. Hold on an option for 3s to swap it
 * with the main button.
 *
 * Directions: up, down, left, right — each with icon + label.
 * The main button is navy; options appear in a radial layout.
 *
 * Requires minimal JS for gesture handling (see showcase).
 */

.fc-swipe-container {
  position: relative;
  display: inline-block;
}

.fc-swipe-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--fc-space-2);
  padding: var(--fc-space-2) var(--fc-space-3);
  font-family: var(--fc-font-brand);
  font-size: var(--fc-text-sm);
  font-weight: 600;
  background: var(--fc-navy);
  color: var(--fc-white);
  border: none;
  border-radius: var(--fc-radius-sm);
  cursor: pointer;
  transition: background-color var(--fc-ease-base),
              transform var(--fc-ease-base),
              box-shadow var(--fc-ease-base);
  user-select: none;
  touch-action: none;
}

.fc-swipe-btn:hover {
  background: var(--fc-blue);
  transform: scale(1.05);
  box-shadow: var(--fc-shadow-lg);
}

/* Options: hidden by default, revealed on press-drag */
.fc-swipe-options {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 300px;
  height: 300px;
  transform: translate(-50%, -50%);
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--fc-ease-fast);
  z-index: var(--fc-z-popover);
}

.fc-swipe-options.active {
  opacity: 1;
  pointer-events: auto;
}

.fc-swipe-option {
  position: absolute;
  display: flex;
  align-items: center;
  gap: var(--fc-space-2);
  padding: var(--fc-space-2) var(--fc-space-3);
  font-family: var(--fc-font-brand);
  font-size: var(--fc-text-xs);
  font-weight: 600;
  background: var(--fc-navy);
  color: var(--fc-white);
  border: 2px solid transparent;
  border-radius: var(--fc-radius-sm);
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--fc-ease-fast);
  box-shadow: var(--fc-shadow-md);
}

.fc-swipe-option.up    { bottom: 100%; left: 50%; transform: translate(-50%, -16px); }
.fc-swipe-option.down  { top: 100%;    left: 50%; transform: translate(-50%, 16px); }
.fc-swipe-option.left  { right: 100%;  top: 50%;  transform: translate(-16px, -50%); }
.fc-swipe-option.right { left: 100%;   top: 50%;  transform: translate(16px, -50%); }

.fc-swipe-option:hover,
.fc-swipe-option.highlight {
  background: var(--fc-blue);
  border-color: var(--fc-white);
  box-shadow: var(--fc-shadow-xl);
  filter: brightness(1.2);
}

@keyframes fc-swipe-blink {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.3; }
}

.fc-swipe-option.blinking {
  animation: fc-swipe-blink 1s infinite;
}

/* Guide lines (crosshair) — shown while options visible */
.fc-swipe-guide {
  position: absolute;
  background: var(--fc-gray-400);
  opacity: 0;
  transition: opacity var(--fc-ease-fast);
}

.fc-swipe-options.active ~ .fc-swipe-guide {
  opacity: 0.3;
}

.fc-swipe-guide-h {
  width: 100%;
  height: 1px;
  top: 50%;
  left: 0;
}

.fc-swipe-guide-v {
  width: 1px;
  height: 100%;
  top: 0;
  left: 50%;
}


/* ============================================================
   33. NOTIFICATION SYSTEM
   ============================================================
 *
 * Bell icon with count badge, expandable notification panel
 * with tabs (Inbox / General / Archived), and individual
 * notification items with avatar, title, time, and message.
 * Read/unread states and slide-in animation.
 */

/* Bell button */
.fc-notif-bell {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: transparent;
  color: var(--fc-white);
  border: none;
  border-radius: var(--fc-radius-full);
  cursor: pointer;
  font-size: var(--fc-text-xl);
  transition: transform var(--fc-ease-fast);
}

.fc-notif-bell:hover {
  transform: scale(1.1);
}

/* Red count badge */
.fc-notif-count {
  position: absolute;
  top: 2px;
  right: 2px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  background: var(--fc-error);
  color: var(--fc-white);
  border-radius: var(--fc-radius-full);
  font-family: var(--fc-font-body);
  font-size: 10px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.fc-notif-count:empty,
.fc-notif-count[data-count="0"] {
  display: none;
}

@keyframes fc-bell-bounce {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.2); }
}

.fc-notif-bell.has-new {
  animation: fc-bell-bounce 1s ease infinite;
}

/* Notification panel */
.fc-notif-panel {
  position: absolute;
  top: calc(100% + var(--fc-space-3));
  right: 0;
  width: 420px;
  max-height: 80vh;
  background: var(--fc-white);
  border-radius: var(--fc-radius-lg);
  box-shadow: var(--fc-shadow-2xl);
  z-index: var(--fc-z-popover);
  overflow: hidden;
  font-family: var(--fc-font-body);
  opacity: 0;
  transform: translateY(-6px);
  transition: opacity 0.15s ease, transform 0.15s ease;
  pointer-events: none;
}

.fc-notif-panel.open {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

/* Panel header */
.fc-notif-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--fc-space-3) var(--fc-space-4);
  background: var(--fc-gray-50);
  border-bottom: 1px solid var(--fc-gray-200);
}

.fc-notif-title {
  font-family: var(--fc-font-brand);
  font-weight: 700;
  font-size: var(--fc-text-base);
  color: var(--fc-gray-900);
}

.fc-notif-mark-read {
  background: none;
  border: none;
  color: var(--fc-orange);
  cursor: pointer;
  font-size: var(--fc-text-xs);
  font-weight: 600;
  font-family: var(--fc-font-body);
}

.fc-notif-mark-read:hover {
  text-decoration: underline;
}

/* Tabs */
.fc-notif-tabs {
  display: flex;
  justify-content: space-around;
  padding: var(--fc-space-2) 0;
  background: var(--fc-gray-50);
  border-bottom: 1px solid var(--fc-gray-200);
}

.fc-notif-tab {
  padding: var(--fc-space-1) var(--fc-space-3);
  font-size: var(--fc-text-sm);
  font-weight: 600;
  color: var(--fc-gray-500);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: color var(--fc-ease-fast), border-color var(--fc-ease-fast);
  background: none;
  border-top: none;
  border-left: none;
  border-right: none;
  font-family: inherit;
}

.fc-notif-tab:hover {
  color: var(--fc-gray-700);
}

.fc-notif-tab.active {
  color: var(--fc-orange);
  border-bottom-color: var(--fc-orange);
}

.fc-notif-tab-count {
  font-size: var(--fc-text-xs);
  color: var(--fc-gray-400);
  margin-left: 4px;
}

/* Notification list */
.fc-notif-list {
  max-height: 60vh;
  overflow-y: auto;
}

/* Individual notification item */
.fc-notif-item {
  display: flex;
  align-items: center;
  gap: var(--fc-space-3);
  padding: var(--fc-space-4);
  border-bottom: 1px solid var(--fc-gray-200);
  transition: background-color var(--fc-ease-fast);
  cursor: pointer;
}

.fc-notif-item:hover {
  background: var(--fc-gray-50);
}

.fc-notif-item:last-child {
  border-bottom: none;
}

/* Unread/read states */
.fc-notif-item.unread {
  background: var(--fc-white);
}

.fc-notif-item.read {
  opacity: 0.65;
  background: var(--fc-cream-light);
}

/* Avatar placeholder (fallback for text initials) */
.fc-notif-avatar {
  width: 40px;
  height: 40px;
  border-radius: var(--fc-radius-full);
  background: var(--fc-tan-light);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: var(--fc-text-sm);
  font-weight: 600;
  color: var(--fc-brown);
}

/* fuzzy-avatar web component inside notifications — scale to 40px */
.fc-notif-item fuzzy-avatar {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  --avatar-size: 40px;
  margin-right: 12px;
}

/* Content area */
.fc-notif-content {
  flex: 1;
  min-width: 0;
}

.fc-notif-item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2px;
}

.fc-notif-sender {
  font-weight: 600;
  font-size: var(--fc-text-sm);
  color: var(--fc-gray-900);
}

.fc-notif-time {
  font-size: var(--fc-text-xs);
  color: var(--fc-gray-500);
  flex-shrink: 0;
}

.fc-notif-message {
  font-size: var(--fc-text-sm);
  color: var(--fc-gray-700);
  line-height: var(--fc-leading-normal);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fc-notif-item.unread .fc-notif-sender {
  color: var(--fc-black);
}

.fc-notif-item.unread .fc-notif-message {
  color: var(--fc-gray-800);
  font-weight: 500;
}

/* Optional notification image */
.fc-notif-image {
  width: 60px;
  height: 60px;
  border-radius: var(--fc-radius-md);
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid var(--fc-gray-200);
}

/* Empty state */
.fc-notif-empty {
  padding: var(--fc-space-10) var(--fc-space-6);
  text-align: center;
  color: var(--fc-gray-500);
  font-size: var(--fc-text-sm);
}

.fc-notif-empty i {
  font-size: var(--fc-text-3xl);
  color: var(--fc-gray-300);
  margin-bottom: var(--fc-space-3);
  display: block;
}

@media (max-width: 640px) {
  .fc-notif-panel {
    width: 90vw;
    right: 5vw;
  }
}


/* ============================================================
   34. USER PICKER
   ============================================================
 *
 * Dropdown selector for picking users. Design-system version of
 * the <fuzzy-code-user-select> web component. Trigger header
 * with chevron, expandable list of user items with name + meta.
 */

.fc-user-picker {
  position: relative;
}

.fc-user-picker-trigger {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px;
  background: var(--fc-blue);
  color: var(--fc-white);
  border: none;
  border-radius: var(--fc-radius-md);
  cursor: pointer;
  font-family: var(--fc-font-body);
  font-size: var(--fc-text-sm);
  font-weight: 600;
  width: 100%;
}

.fc-user-picker-trigger .fc-user-picker-arrow {
  display: inline-block;
  transition: transform var(--fc-ease-fast);
}

.fc-user-picker-trigger.open .fc-user-picker-arrow {
  transform: rotate(180deg);
}

.fc-user-picker-list {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  width: 100%;
  background: var(--fc-white);
  box-shadow: var(--fc-shadow-xl);
  max-height: 300px;
  overflow-y: auto;
  z-index: var(--fc-z-dropdown);
  border-radius: 0 0 var(--fc-radius-md) var(--fc-radius-md);
  list-style: none;
  margin: 0;
  padding: 0;
}

.fc-user-picker-list.open {
  display: block;
}

.fc-user-picker-item {
  display: flex;
  align-items: center;
  padding: 12px;
  border-bottom: 1px solid var(--fc-gray-200);
  cursor: pointer;
  transition: background-color var(--fc-ease-fast);
}

.fc-user-picker-item:hover {
  background: var(--fc-gray-50);
}

.fc-user-picker-item:last-child {
  border-bottom: none;
}

.fc-user-picker-info {
  flex: 1;
  margin-left: 12px;
}

.fc-user-picker-name {
  font-weight: 600;
  font-size: var(--fc-text-sm);
  color: var(--fc-gray-800);
}

.fc-user-picker-meta {
  font-size: var(--fc-text-xs);
  color: var(--fc-gray-500);
}

.fc-user-picker-username {
  display: inline-block;
  text-decoration: none;
  color: var(--fc-blue);
  background: var(--fc-info-light);
  padding: 3px 8px;
  border-radius: var(--fc-radius-sm);
  font-size: var(--fc-text-xs);
  font-family: var(--fc-font-body);
  transition: background-color var(--fc-ease-fast), color var(--fc-ease-fast);
}

.fc-user-picker-username:hover {
  background: var(--fc-blue);
  color: var(--fc-white);
}


/* ============================================================
   35. POPUP WINDOW
   ============================================================
 *
 * Modal-like popup with a title bar (including window control
 * icons for maximize / restore / close) and an iframe or
 * arbitrary content body. Based on the PopupWindow component.
 */

.fc-popup-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: var(--fc-z-modal-backdrop);
  justify-content: center;
  align-items: center;
}

.fc-popup-overlay.open {
  display: flex;
}

.fc-popup {
  background: var(--fc-white);
  border-radius: var(--fc-radius-md);
  box-shadow: var(--fc-shadow-xl);
  overflow: hidden;
  max-width: 90%;
  max-height: 90%;
  width: 800px;
  display: flex;
  flex-direction: column;
}

.fc-popup-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  background: var(--fc-gray-100);
  border-bottom: 1px solid var(--fc-gray-200);
}

.fc-popup-title {
  font-family: var(--fc-font-brand);
  font-size: var(--fc-text-lg);
  font-weight: 600;
  color: var(--fc-gray-800);
  margin: 0;
}

.fc-popup-icons {
  display: flex;
  gap: 8px;
}

.fc-popup-icon {
  cursor: pointer;
  font-size: var(--fc-text-lg);
  color: var(--fc-gray-500);
  background: none;
  border: none;
  padding: 0;
  line-height: 1;
  transition: color var(--fc-ease-fast);
}

.fc-popup-icon:hover {
  color: var(--fc-gray-800);
}

.fc-popup-body {
  flex: 1;
  overflow: auto;
  padding: 20px;
}

.fc-popup-body iframe {
  width: 100%;
  height: 100%;
  border: none;
  min-height: 400px;
}

@media (max-width: 640px) {
  .fc-popup {
    width: 95%;
    height: 85%;
    max-width: 95%;
    max-height: 85%;
  }
}


/* ============================================================
   36. CONFIRMATION DIALOG
   ============================================================
 *
 * FuzzyCode-styled confirmation / alert dialog. Replaces
 * SweetAlert2 for PII warnings, large-project confirmations,
 * save/discard prompts, publish-success with QR codes, and
 * duplicate page warnings. Includes icon variants (success,
 * warning, error, question), title, body text, action buttons,
 * optional textarea input, and a scale-in entrance animation.
 */

.fc-confirm-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(1, 23, 48, 0.6);
  z-index: var(--fc-z-modal-backdrop);
  justify-content: center;
  align-items: center;
}

.fc-confirm-backdrop.active {
  display: flex;
}

.fc-confirm {
  position: relative;
  background: var(--fc-white);
  border-radius: var(--fc-radius-xl);
  box-shadow: var(--fc-shadow-2xl);
  max-width: 480px;
  width: 90%;
  padding: 32px;
  text-align: center;
  animation: fc-scale-in 0.3s ease;
}

.fc-confirm.fc-confirm-md {
  max-width: 600px;
}

.fc-confirm.fc-confirm-wide {
  max-width: 700px;
}

.fc-confirm.fc-confirm-lg {
  max-width: 800px;
}

.fc-confirm-icon {
  width: 64px;
  height: 64px;
  border-radius: var(--fc-radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
  font-size: 28px;
}

.fc-confirm-icon.success {
  background: var(--fc-success-light);
  color: var(--fc-success);
}

.fc-confirm-icon.warning {
  background: var(--fc-warning-light);
  color: var(--fc-warning);
}

.fc-confirm-icon.error {
  background: var(--fc-error-light);
  color: var(--fc-error);
}

.fc-confirm-icon.question {
  background: var(--fc-info-light);
  color: var(--fc-info);
}

.fc-confirm-title {
  font-family: var(--fc-font-brand);
  font-size: var(--fc-text-2xl);
  font-weight: 700;
  color: var(--fc-gray-900);
  margin: 0 0 8px;
}

.fc-confirm-text {
  font-family: var(--fc-font-body);
  font-size: var(--fc-text-sm);
  color: var(--fc-gray-600);
  margin: 0 0 24px;
  line-height: var(--fc-leading-relaxed);
}

.fc-confirm-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}

.fc-confirm-input {
  display: block;
  width: 100%;
  padding: 10px 14px;
  font-family: var(--fc-font-body);
  font-size: var(--fc-text-base);
  color: var(--fc-gray-800);
  background: var(--fc-white);
  border: 1px solid var(--fc-gray-300);
  border-radius: var(--fc-radius-md);
  resize: vertical;
  min-height: 100px;
  margin-bottom: 20px;
  outline: none;
  box-sizing: border-box;
  transition: border-color var(--fc-ease-fast), box-shadow var(--fc-ease-fast);
}

.fc-confirm-input:focus {
  border-color: var(--fc-orange);
  box-shadow: 0 0 0 3px rgba(228, 140, 33, 0.15);
}

.fc-confirm-input::placeholder {
  color: var(--fc-gray-400);
}

.fc-confirm-close {
  position: absolute;
  top: 12px;
  right: 12px;
  background: none;
  border: none;
  font-size: var(--fc-text-xl);
  color: var(--fc-gray-400);
  cursor: pointer;
  padding: 4px;
  line-height: 1;
  transition: color var(--fc-ease-fast);
}

.fc-confirm-close:hover {
  color: var(--fc-gray-800);
}
