/* ============================================================================
   FCM Design System — v1
   Extracted from FCM Document Format + FCM Platform Architecture + CrossHub IA
   ---------------------------------------------------------------------------
   The palette, and nothing else:
     Ink     — every letter and outline (deep chocolate/aubergine)
     Paper   — the page (warm cream)
     Action  — the ONE pink button per screen we want the reader to press
     Attention — butter yellow, only ever a status (waiting / needs / attention)
     Good    — green, only ever a status (met / done / on target)

   The type scale, and nothing else:
     Title    Schibsted Grotesk 800 · 34px
     Headline Schibsted Grotesk 800 · 22px
     Body     Schibsted Grotesk 500 · 15px / 1.6
     Label    SCHIBSTED GROTESK 800 · 11px UPPERCASE

   Gingham appears on the cover and nowhere else.
   ============================================================================ */

@import url('https://fonts.googleapis.com/css2?family=Schibsted+Grotesk:wght@400;500;600;700;800&display=swap');

:root {
  /* Palette */
  --ink:        #2A1A1D;   /* chocolate-aubergine, every letter and outline */
  --ink-soft:   #5B4548;   /* secondary text */
  --ink-faint:  #94818A;   /* tertiary text / labels on paper */
  --paper:      #FBF4E4;   /* warm cream page background */
  --paper-2:    #F5EBD1;   /* slightly deeper cream for section breaks */
  --card:       #FFFFFF;   /* card/panel surface */
  --line:       #E7DBC4;   /* hairlines on paper */
  --line-soft:  #EFE6D0;

  /* Brand: the ORIGINAL Four Cross Media logo colours (sampled from the official
     logo artwork, 2026-10-03). Pink = the logo; yellow = the logo's gingham. */
  --brand-pink:   #DB7491;  /* exact logo pink */
  --brand-yellow: #FFE16C;  /* gingham, where the stripes cross */
  --brand-yellow-2: #FFEDA6;/* gingham, single stripe */

  --action:     #DB7491;   /* logo pink — one per screen, the thing we want done */
  --action-ink: #FFFFFF;   /* text on action */
  --action-hover:#C9607F;  /* pressed / hover fill */
  --action-text:#B5476A;   /* the same pink, deepened so small pink TEXT stays readable */
  --action-soft:#F8DDE5;   /* hover fill / subtle tint */

  --attention:  #FFE16C;   /* logo-gingham yellow — status only */
  --attention-soft: #FFEDA6;
  --attention-pale: #FFF6D2;
  --attention-ink:  #6B4D08;

  --good:       #3E7A5A;   /* green — status only */
  --good-soft:  #DDEBD9;

  --danger:     #B2374A;   /* rare, for destructive/overdue */

  /* Gingham (hero cover use only) — the logo's yellow gingham. Two crossing
     stripes of --gingham-stripe over white give exactly #FFEDA6 (one stripe)
     and #FFE16C (where they cross), matching the official artwork. */
  --gingham-a:  #FFE16C;
  --gingham-b:  #FFFFFF;
  --gingham-stripe: rgba(255, 201, 0, .34);
  --gingham-size: 48px;

  /* Radius */
  --r-sm: 8px;
  --r-md: 14px;
  --r-lg: 20px;
  --r-xl: 28px;
  --r-pill: 999px;

  /* Shadow */
  --shadow-1: 0 1px 2px rgba(42,26,29,.06), 0 2px 6px rgba(42,26,29,.04);
  --shadow-2: 0 4px 12px rgba(42,26,29,.08), 0 12px 40px rgba(42,26,29,.06);

  /* Type */
  --font: 'Schibsted Grotesk', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
}

/* Reset (light) ------------------------------------------------------------- */
*,*::before,*::after{ box-sizing: border-box; }
html,body{ margin:0; padding:0; background: var(--paper); color: var(--ink); }
body{ font-family: var(--font); font-weight: 500; font-size: 15px; line-height: 1.6; -webkit-font-smoothing: antialiased; }
img{ max-width:100%; display:block; }
a{ color: inherit; text-decoration: none; }
button{ font-family: inherit; }
input,textarea,select{ font-family: inherit; color: inherit; }
kbd{ font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .82em; padding: 2px 6px; border-radius: 6px; border: 1px solid var(--line); background: var(--paper-2); }

/* Type scale --------------------------------------------------------------- */
.fcm-title    { font-weight: 800; font-size: 34px; line-height: 1.1;  letter-spacing: -0.01em; margin: 0; color: var(--ink); }
.fcm-headline { font-weight: 800; font-size: 22px; line-height: 1.2;  letter-spacing: -0.005em; margin: 0; color: var(--ink); }
.fcm-body     { font-weight: 500; font-size: 15px; line-height: 1.6;  margin: 0; color: var(--ink); }
.fcm-body-soft{ font-weight: 500; font-size: 15px; line-height: 1.6;  margin: 0; color: var(--ink-soft); }
.fcm-label    { font-weight: 800; font-size: 11px; line-height: 1;    text-transform: uppercase; letter-spacing: .08em; color: var(--ink-faint); margin: 0; }
.fcm-huge     { font-weight: 800; font-size: 56px; line-height: 1;    letter-spacing: -0.02em; margin: 0; color: var(--ink); }

/* Cards -------------------------------------------------------------------- */
.fcm-card       { background: var(--card); border: 1px solid var(--line-soft); border-radius: var(--r-lg); padding: 20px; }
.fcm-card-ink   { background: var(--ink);  color: #F7EBEF; border-radius: var(--r-lg); padding: 20px; }
.fcm-card-attn  { background: var(--attention-pale); border: 1px solid var(--attention-soft); border-radius: var(--r-lg); padding: 20px; }
.fcm-card-attn .fcm-label { color: var(--attention-ink); }
.fcm-card-action{ background: var(--action-soft); border-radius: var(--r-lg); padding: 20px; }

.fcm-card-ink .fcm-label { color: var(--attention); }
.fcm-card-ink .fcm-body-soft { color: rgba(247,235,239,.72); }

/* Buttons ------------------------------------------------------------------ */
.fcm-btn {
  display: inline-flex; align-items: center; gap: 8px;
  height: 44px; padding: 0 22px;
  font-weight: 700; font-size: 14px; letter-spacing: -0.005em;
  border-radius: var(--r-pill); border: 1px solid transparent;
  cursor: pointer; transition: transform .05s ease, background .15s ease, border-color .15s ease;
}
.fcm-btn:active { transform: translateY(1px); }

.fcm-btn-action { background: var(--action); color: var(--action-ink); }
.fcm-btn-action:hover { background: var(--action-hover); }

.fcm-btn-ghost { background: transparent; color: var(--ink); border-color: var(--ink); }
.fcm-btn-ghost:hover { background: var(--ink); color: #FFF; }

.fcm-btn-white { background: #FFF; color: var(--ink); border-color: var(--line); }
.fcm-btn-white:hover { background: var(--paper-2); }

.fcm-btn-sm { height: 36px; padding: 0 16px; font-size: 13px; }

/* Chips / pills / badges --------------------------------------------------- */
.fcm-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: var(--r-pill);
  background: var(--paper-2); border: 1px solid var(--line);
  font-size: 12px; font-weight: 600; color: var(--ink);
}
.fcm-chip-good      { background: var(--good-soft); border-color: transparent; color: var(--good); }
.fcm-chip-attention { background: var(--attention-soft); border-color: transparent; color: var(--attention-ink); }
.fcm-chip-action    { background: var(--action-soft); border-color: transparent; color: var(--action-text); }
.fcm-chip-ink       { background: var(--ink); border-color: var(--ink); color: #F7EBEF; }

.fcm-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; }
.fcm-dot-good { background: var(--good); }
.fcm-dot-attn { background: var(--attention); }
.fcm-dot-act  { background: var(--action); }
.fcm-dot-ink  { background: var(--ink); }

/* Layout ------------------------------------------------------------------- */
.fcm-app { display: grid; grid-template-columns: 260px 1fr; min-height: 100vh; }
.fcm-side { border-right: 1px solid var(--line); padding: 20px 16px; background: var(--paper); position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.fcm-main { padding: 32px 40px 80px; max-width: 1400px; }
@media (max-width: 900px) {
  .fcm-app { grid-template-columns: 1fr; }
  .fcm-side { position: static; height: auto; border-right: none; border-bottom: 1px solid var(--line); }
  .fcm-main { padding: 24px 20px 60px; }
}

/* Sidebar nav -------------------------------------------------------------- */
.fcm-brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 22px; }
.fcm-brand-mark { width: 28px; height: 28px; background: url(/brand/fcm-mark-pink.png) center / contain no-repeat; position: relative; }

.fcm-nav { list-style: none; padding: 0; margin: 0 0 20px; }
.fcm-nav li a {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 12px; border-radius: var(--r-md);
  color: var(--ink); font-weight: 600; font-size: 15px;
  transition: background .15s ease;
}
.fcm-nav li a:hover { background: var(--paper-2); }
.fcm-nav li a.active { background: var(--ink); color: #F7EBEF; }
.fcm-nav li a.active .fcm-nav-count { background: var(--attention); color: var(--ink); border-color: transparent; }
.fcm-nav-count {
  font-size: 11px; font-weight: 800; padding: 2px 8px; border-radius: var(--r-pill);
  background: var(--paper-2); border: 1px solid var(--line); color: var(--ink);
}

.fcm-side-label { font-weight: 800; font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-faint); padding: 12px 12px 8px; }

.fcm-pinned { list-style: none; padding: 0; margin: 0 0 16px; }
.fcm-pinned li { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: var(--r-md); font-weight: 500; font-size: 14px; }
.fcm-pinned li:hover { background: var(--paper-2); cursor: pointer; }

.fcm-side-note {
  margin: 12px 0; padding: 12px; border-radius: var(--r-md);
  background: var(--good-soft); font-size: 12px; line-height: 1.5; color: #2C5A44;
}
.fcm-side-note strong { display: block; margin-bottom: 4px; }

.fcm-search {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 12px; margin: 8px 0 16px;
  background: var(--card); border: 1px solid var(--line-soft); border-radius: var(--r-md);
  color: var(--ink-faint); font-size: 13px; cursor: pointer;
}
.fcm-search:hover { border-color: var(--line); }

.fcm-viewing {
  padding: 12px; margin-top: auto; border-top: 1px solid var(--line);
}
.fcm-viewing-role { display: flex; align-items: center; justify-content: space-between; padding: 8px 4px; }
.fcm-viewing-role strong { font-size: 14px; }
.fcm-viewing-role button { background: transparent; border: 1px solid var(--line); border-radius: var(--r-pill); padding: 4px 12px; font-size: 12px; font-weight: 600; cursor: pointer; }
.fcm-viewing-user { display: flex; align-items: center; gap: 10px; margin-top: 8px; }
.fcm-avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--ink); color: #F7EBEF; display: grid; place-items: center; font-weight: 800; font-size: 12px; }
.fcm-viewing-user small { font-size: 12px; color: var(--ink-faint); display: block; }

/* Utility ------------------------------------------------------------------ */
.stack   { display: grid; gap: var(--gap, 16px); }
.stack-4 { gap: 4px; } .stack-8 { gap: 8px; } .stack-12 { gap: 12px; } .stack-16 { gap: 16px; } .stack-20 { gap: 20px; } .stack-24 { gap: 24px; } .stack-32 { gap: 32px; }
.row     { display: flex; align-items: center; gap: var(--gap, 12px); }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: var(--gap, 12px); }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--gap, 16px); }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--gap, 16px); }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--gap, 16px); }
@media (max-width: 900px) { .grid-2,.grid-3,.grid-4 { grid-template-columns: 1fr; } }
.spacer { flex: 1; }
.hide-sm { display: initial; }
@media (max-width: 700px) { .hide-sm { display: none; } }

/* Gingham cover pattern (rare — hero only) --------------------------------- */
.fcm-gingham {
  background-color: #FFFFFF;
  background-image:
    linear-gradient(90deg, var(--gingham-stripe) 50%, transparent 50%),
    linear-gradient(var(--gingham-stripe) 50%, transparent 50%);
  background-size: var(--gingham-size) var(--gingham-size);
}

/* ============================================================================
   Extended patterns — added for composer / analytics / mobile app / marketing
   ============================================================================ */

/* Browser chrome ---------------------------------------------------------- */
.fcm-browser {
  background: var(--ink); border-radius: var(--r-lg); padding: 6px;
  box-shadow: var(--shadow-2);
}
.fcm-browser-bar {
  display: flex; align-items: center; gap: 8px; padding: 8px 12px;
  color: rgba(247,235,239,.5); font-size: 12px;
}
.fcm-browser-bar .dot { width: 10px; height: 10px; border-radius: 50%; background: rgba(255,255,255,.15); }
.fcm-browser-bar .url { margin-left: 12px; }
.fcm-browser-body { background: var(--paper); border-radius: 10px; overflow: hidden; }

/* Phone frame ------------------------------------------------------------- */
.fcm-phone {
  width: 380px; margin: 0 auto; background: var(--ink); border-radius: 46px;
  padding: 12px; box-shadow: var(--shadow-2); position: relative;
}
.fcm-phone-screen {
  background: var(--paper); border-radius: 36px; overflow: hidden; position: relative;
  min-height: 720px; display: flex; flex-direction: column;
}
.fcm-phone-status {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 24px 6px; font-weight: 700; font-size: 15px;
}
.fcm-phone-notch {
  position: absolute; left: 50%; top: 14px; transform: translateX(-50%);
  width: 110px; height: 30px; background: #000; border-radius: 20px; z-index: 2;
}
.fcm-phone-body { flex: 1; overflow-y: auto; padding: 0 20px 20px; }
.fcm-phone-nav {
  border-top: 1px solid var(--line); padding: 10px 8px 20px;
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px;
}
.fcm-phone-nav a { text-align: center; color: var(--ink-faint); font-size: 11px; font-weight: 600; padding: 4px; position: relative; }
.fcm-phone-nav a.active { color: var(--action-text); }
.fcm-phone-nav a .icon { display: block; margin: 0 auto 2px; width: 22px; height: 22px; }
.fcm-phone-nav a .badge { position: absolute; top: -2px; right: 26%; background: var(--action); color: #fff; font-size: 9px; font-weight: 800; padding: 2px 5px; border-radius: 999px; }

/* Chart bars (analytics) -------------------------------------------------- */
.chart-bars { display: grid; grid-template-columns: repeat(auto-fit, minmax(50px, 1fr)); align-items: end; gap: 12px; height: 180px; padding: 12px 0; }
.chart-bar { display: flex; flex-direction: column; justify-content: end; gap: 2px; }
.chart-bar .bar-a { background: var(--attention); border-radius: 4px 4px 0 0; }
.chart-bar .bar-b { background: var(--action); border-radius: 4px 4px 0 0; }
.chart-bar .bar-label { text-align: center; font-size: 11px; font-weight: 600; color: var(--ink-faint); margin-top: 4px; }

/* Horizontal bar ---------------------------------------------------------- */
.hbar { display: grid; grid-template-columns: 100px 1fr 50px; align-items: center; gap: 10px; margin: 8px 0; font-size: 13px; }
.hbar .hbar-track { height: 10px; border-radius: var(--r-pill); background: var(--line-soft); overflow: hidden; }
.hbar .hbar-fill { height: 100%; background: var(--action); border-radius: var(--r-pill); }
.hbar .hbar-fill.good { background: var(--good); }
.hbar .hbar-fill.attn { background: var(--attention); }
.hbar .hbar-value { text-align: right; font-weight: 700; }

/* Gingham checkered hero -------------------------------------------------- */
.fcm-hero-gingham {
  background-color: #FFFFFF;
  background-image:
    linear-gradient(90deg, var(--gingham-stripe) 50%, transparent 50%),
    linear-gradient(var(--gingham-stripe) 50%, transparent 50%);
  background-size: 64px 64px;
  padding: 60px 40px;
}

/* Placeholder creative tile ---------------------------------------------- */
.fcm-creative {
  aspect-ratio: 1; border-radius: var(--r-md);
  background:
    linear-gradient(135deg, var(--attention-soft) 0%, var(--action-soft) 100%);
  display: grid; place-items: center;
  font-size: 10px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-faint);
}
.fcm-creative.gingham {
  background-color: #FFFFFF;
  background-image:
    linear-gradient(90deg, var(--gingham-stripe) 50%, transparent 50%),
    linear-gradient(var(--gingham-stripe) 50%, transparent 50%);
  background-size: 40px 40px;
}

/* Approval chain steps --------------------------------------------------- */
.chain { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.chain li { display: grid; grid-template-columns: 20px 1fr; gap: 10px; align-items: center; font-size: 14px; }
.chain .pip { width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--ink-faint); }
.chain .pip.done { background: var(--good); border-color: var(--good); position: relative; }
.chain .pip.done::after { content:'✓'; position: absolute; inset: -2px; color: #fff; font-size: 10px; display: grid; place-items: center; font-weight: 800; }
.chain .pip.current { background: var(--action); border-color: var(--action); }
.chain .step-label { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-faint); font-weight: 800; }
.chain .step-name { font-weight: 700; }
.chain li.current .step-name { color: var(--action-text); }

/* Tab strip -------------------------------------------------------------- */
.fcm-tabs { display: inline-flex; padding: 4px; background: var(--paper-2); border-radius: var(--r-pill); }
.fcm-tabs button { border: 0; background: transparent; padding: 6px 14px; border-radius: var(--r-pill); font-weight: 700; font-size: 13px; cursor: pointer; color: var(--ink-soft); }
.fcm-tabs button.active { background: var(--ink); color: #F7EBEF; }

/* Input pill ------------------------------------------------------------- */
.fcm-input {
  width: 100%; padding: 12px 16px;
  background: var(--card); border: 1px solid var(--line-soft); border-radius: var(--r-md);
  font-family: var(--font); font-size: 15px; color: var(--ink);
}
.fcm-input:focus { outline: 2px solid var(--action); outline-offset: 2px; }
.fcm-textarea { min-height: 120px; resize: vertical; }

/* Calendar lanes --------------------------------------------------------- */
.cal-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.cal-day { border: 1px solid var(--line-soft); border-radius: var(--r-md); padding: 12px; min-height: 240px; background: var(--card); }
.cal-day-head { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; font-weight: 800; color: var(--ink-faint); margin-bottom: 4px; }
.cal-day-num { font-weight: 800; font-size: 18px; margin-bottom: 10px; }
.cal-post { padding: 8px 10px; border-radius: 8px; font-size: 12px; margin-bottom: 6px; border-left: 3px solid transparent; background: var(--paper-2); }
.cal-post.approved { border-left-color: var(--good); background: var(--good-soft); }
.cal-post.waiting  { border-left-color: var(--action); background: var(--action-soft); }
.cal-post.draft    { border-left-color: var(--attention); background: var(--attention-pale); }
.cal-post-time { font-size: 10px; font-weight: 800; color: var(--ink-faint); text-transform: uppercase; letter-spacing: .06em; }
.cal-post-body { font-weight: 700; }

/* Inbox thread items ----------------------------------------------------- */
.thread { display: grid; grid-template-columns: 40px 1fr auto; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--line-soft); cursor: pointer; }
.thread:hover { background: var(--paper-2); }
.thread.active { background: var(--attention-pale); }
.thread-avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--action-soft); display: grid; place-items: center; font-weight: 800; color: var(--action-text); font-size: 13px; }
.thread-name { font-weight: 700; font-size: 14px; }
.thread-preview { font-size: 12px; color: var(--ink-soft); margin-top: 2px; }
.thread-badge { font-size: 10px; font-weight: 800; padding: 3px 8px; border-radius: var(--r-pill); text-transform: uppercase; letter-spacing: .06em; }

/* ============================================================================
   CrossHub app components (ch- prefix) — v1
   Used by crosshub.html, composer.html, approvals.html, schedule.html (team, with
   ch-shell.js) and portal-approval.html (public). Every class below starts with ch-.
   Rules of the palette still hold: magenta (--action) = the ONE primary button per
   screen; butter (--attention) and green (--good) are statuses only; gingham only on
   hero moments (.ch-hero).
   ============================================================================ */

/* Page base on data-ch pages (auth-gate skips crosshub.css there) ------------- */
html[data-ch] body { background: var(--paper); color: var(--ink); font-family: var(--font); margin: 0; }
html.ch-noscroll, html.ch-nav-locked { overflow: hidden; }
/* ch-shell shows the person + Sign out, so the floating auth-gate account chip is hidden */
html[data-ch-shell] #fcmChip { display: none !important; }
/* auth-gate UI keeps its own styles; only align its fonts with this page */
html[data-ch] #fcmGate .gbrand, html[data-ch] #fcmGate .cc h1 { font-family: var(--font); font-weight: 800; }
html[data-ch] #fcmGate .gleft span[style*="Fredoka"] { font-family: var(--font) !important; }
html[data-ch] #fcmCmdkOv { font-family: var(--font); }

.ch-ic { flex: none; display: inline-block; vertical-align: middle; }
:where(.ch-app, .ch-modal-wrap, .ch-drawer-wrap, .ch-portal) :focus-visible { outline: 2px solid var(--action); outline-offset: 2px; }

/* Shell --------------------------------------------------------------------- */
.ch-app { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100vh; min-height: 100dvh; overflow-x: clip; }
.ch-topbar { display: none; }
.ch-side {
  position: sticky; top: 0; height: 100vh; height: 100dvh; overflow-y: auto; overscroll-behavior: contain;
  display: flex; flex-direction: column; gap: 2px;
  padding: 20px 14px 14px; background: var(--paper); border-right: 1px solid var(--line);
}
.ch-side-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 2px 6px 20px; }
.ch-side .ch-side-close { display: none; }
.ch-brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; min-width: 0; }
/* The CrossHub logo image (public/brand/crosshub-logo-sm.png, 420x301; product branding). */
.ch-brand:has(.ch-brand-logo) { flex-direction: column; align-items: flex-start; gap: 2px; }
.ch-brand-logo { display: block; width: 96px; max-width: 100%; height: auto; }
.ch-brand--sm .ch-brand-logo { width: 64px; }
.ch-brand:has(.ch-brand-logo) .ch-brand-hub { margin-top: 0; padding-left: 2px; }
.ch-brand--sm:has(.ch-brand-logo) .ch-brand-hub { display: none; }
.ch-brand-mark { width: 30px; height: 30px; flex: none; background: url(/brand/fcm-mark-pink.png) center / contain no-repeat; }
.ch-brand-text { display: flex; flex-direction: column; line-height: 1; }
.ch-brand-four { font-weight: 800; font-size: 15px; letter-spacing: .02em; }
.ch-brand-hub  { font-weight: 800; font-size: 9.5px; letter-spacing: .16em; text-transform: uppercase; color: var(--ink-faint); margin-top: 3px; }
.ch-brand--sm .ch-brand-mark { width: 26px; height: 26px; border-radius: 6px; }

.ch-nav { display: flex; flex-direction: column; gap: 2px; }
.ch-nav-item {
  display: flex; align-items: center; gap: 12px; width: 100%; min-height: 44px; padding: 0 12px;
  border: 0; border-radius: var(--r-md); background: transparent; color: var(--ink);
  font: 600 15px/1.2 var(--font); text-align: left; text-decoration: none; cursor: pointer;
  transition: background .15s ease, color .15s ease;
}
.ch-nav-item:hover { background: var(--paper-2); }
.ch-nav-item.is-active { background: var(--ink); color: #F7EBEF; }
.ch-nav-item .ch-ic { opacity: .85; }
.ch-nav-item[hidden] { display: none; }
.ch-nav-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ch-nav-badge { min-width: 22px; height: 22px; padding: 0 7px; border-radius: var(--r-pill); background: var(--attention); color: var(--ink); font: 800 11px/22px var(--font); text-align: center; }
.ch-nav-badge[hidden] { display: none; }
.ch-nav--quiet .ch-nav-item { min-height: 40px; font-size: 14px; color: var(--ink-soft); }
.ch-nav--quiet .ch-nav-item:hover { color: var(--ink); }
.ch-kbd { font: 700 11px/1 ui-monospace, SFMono-Regular, Menlo, monospace; padding: 3px 6px; border-radius: 6px; border: 1px solid var(--line); background: var(--card); color: var(--ink-faint); }
@media (hover: none) { .ch-kbd { display: none; } }
.ch-side-div { height: 1px; background: var(--line); margin: 12px 6px; flex: none; }
.ch-side-spacer { flex: 1; min-height: 16px; }
.ch-side-user { display: flex; align-items: center; gap: 10px; padding: 12px 8px 8px; border-top: 1px solid var(--line); }
.ch-avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--ink); color: #F7EBEF; display: grid; place-items: center; font: 800 13px/1 var(--font); flex: none; text-transform: uppercase; overflow: hidden; }
.ch-avatar img { width: 100%; height: 100%; object-fit: cover; }
.ch-avatar--sm { width: 28px; height: 28px; font-size: 11px; }
.ch-user-meta { min-width: 0; }
.ch-user-name { font: 700 14px/1.25 var(--font); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ch-user-level { font-size: 12px; line-height: 1.3; color: var(--ink-faint); }
.ch-signout { min-height: 40px; font-size: 14px; color: var(--ink-soft); }
.ch-scrim { display: none; }
.ch-main { min-width: 0; width: 100%; max-width: 1360px; padding: 32px 40px 80px; outline: none; }
.ch-skip { position: absolute; left: -9999px; top: 8px; z-index: 4000; background: var(--ink); color: #FFF; padding: 10px 14px; border-radius: 10px; font-weight: 700; }
.ch-skip:focus { left: 8px; }

@media (max-width: 900px) {
  .ch-app { display: block; }
  .ch-topbar {
    display: flex; align-items: center; gap: 8px; position: sticky; top: 0; z-index: 800;
    min-height: 56px; padding: env(safe-area-inset-top) 12px 0 6px;
    background: rgba(251,244,228,.95); border-bottom: 1px solid var(--line);
    -webkit-backdrop-filter: saturate(1.2) blur(8px); backdrop-filter: saturate(1.2) blur(8px);
  }
  .ch-topbar .ch-brand-text { display: none; }
  .ch-topbar-title { font: 800 16px/1.2 var(--font); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .ch-menu-btn { position: relative; }
  .ch-menu-dot { position: absolute; top: 7px; right: 7px; width: 9px; height: 9px; border-radius: 50%; background: var(--attention); box-shadow: 0 0 0 2px var(--paper); }
  .ch-menu-dot[hidden] { display: none; }
  .ch-side {
    position: fixed; z-index: 900; top: 0; left: 0; bottom: 0; width: min(84vw, 320px); height: auto;
    padding-top: calc(16px + env(safe-area-inset-top)); padding-bottom: calc(14px + env(safe-area-inset-bottom));
    border-right: 1px solid var(--line); box-shadow: var(--shadow-2);
    transform: translateX(-104%); visibility: hidden; transition: transform .22s ease, visibility 0s linear .22s;
  }
  .ch-app.is-nav-open .ch-side { transform: none; visibility: visible; transition: transform .22s ease; }
  .ch-side .ch-side-close { display: inline-grid; }
  .ch-scrim { display: block; position: fixed; inset: 0; z-index: 890; background: rgba(42,26,29,.4); opacity: 0; pointer-events: none; transition: opacity .2s ease; }
  .ch-app.is-nav-open .ch-scrim { opacity: 1; pointer-events: auto; }
  .ch-main { max-width: none; padding: 20px 16px 96px; }
}

/* Type + page header -------------------------------------------------------- */
.ch-page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px 20px; margin-bottom: 24px; }
.ch-page-head > :first-child { min-width: 0; flex: 1 1 320px; }
.ch-eyebrow { font: 800 11px/1.2 var(--font); text-transform: uppercase; letter-spacing: .1em; color: var(--action-text); margin: 0 0 8px; }
.ch-page-title { font: 800 32px/1.1 var(--font); letter-spacing: -.01em; margin: 0; color: var(--ink); overflow-wrap: anywhere; }
.ch-page-sub { margin: 8px 0 0; color: var(--ink-soft); font-size: 15px; line-height: 1.55; max-width: 66ch; }
.ch-page-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.ch-h2 { font: 800 20px/1.25 var(--font); margin: 0; letter-spacing: -.005em; }
.ch-h3 { font: 800 16px/1.3 var(--font); margin: 0; }
.ch-label { font: 800 11px/1.2 var(--font); text-transform: uppercase; letter-spacing: .08em; color: var(--ink-faint); margin: 0; }
.ch-section { margin-top: 28px; }
.ch-section-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 12px; margin-bottom: 12px; }
@media (max-width: 900px) { .ch-page-title { font-size: 26px; } .ch-page-head { margin-bottom: 18px; } }

/* Buttons ------------------------------------------------------------------- */
.ch-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 20px; max-width: 100%;
  border: 1px solid var(--line); border-radius: var(--r-pill); background: var(--card); color: var(--ink);
  font: 700 14px/1.15 var(--font); letter-spacing: -.005em; text-decoration: none; white-space: nowrap; cursor: pointer;
  -webkit-tap-highlight-color: transparent; transition: background .15s ease, border-color .15s ease, color .15s ease, transform .05s ease;
}
.ch-btn:hover { background: var(--paper-2); border-color: var(--ink-faint); }
.ch-btn:active { transform: translateY(1px); }
.ch-btn:disabled, .ch-btn.is-disabled { opacity: .5; cursor: not-allowed; transform: none; }
.ch-btn--primary { background: var(--action); border-color: var(--action); color: var(--action-ink); }
.ch-btn--primary:hover { background: var(--action-hover); border-color: var(--action-hover); }
.ch-btn--ink { background: var(--ink); border-color: var(--ink); color: #F7EBEF; }
.ch-btn--ink:hover { background: #3D2A2E; border-color: #3D2A2E; }
.ch-btn--ghost { background: transparent; border-color: var(--ink); }
.ch-btn--ghost:hover { background: var(--ink); color: #FFF; }
.ch-btn--text { background: transparent; border-color: transparent; padding: 0 10px; color: var(--ink-soft); }
.ch-btn--text:hover { background: var(--paper-2); border-color: transparent; color: var(--ink); }
.ch-btn--danger { background: var(--card); border-color: var(--danger); color: var(--danger); }
.ch-btn--danger:hover { background: var(--danger); border-color: var(--danger); color: #FFF; }
.ch-btn--sm { min-height: 36px; padding: 0 14px; font-size: 13px; }
.ch-btn--lg { min-height: 52px; padding: 0 26px; font-size: 15px; }
.ch-btn--block { width: 100%; }
.ch-btn .ch-ic { width: 18px; height: 18px; }
.ch-btn.is-busy { pointer-events: none; opacity: .85; }
.ch-btn.is-busy::before { content: ''; width: 14px; height: 14px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: chSpin .7s linear infinite; flex: none; }
.ch-iconbtn {
  width: 40px; height: 40px; flex: none; display: inline-grid; place-items: center;
  border: 1px solid transparent; border-radius: 12px; background: transparent; color: var(--ink); cursor: pointer;
}
.ch-iconbtn:hover { background: var(--paper-2); }
.ch-iconbtn--line { border-color: var(--line); background: var(--card); }
.ch-link { color: var(--action-text); font-weight: 700; text-decoration: underline; text-underline-offset: 2px; background: none; border: 0; padding: 0; font: inherit; cursor: pointer; }
.ch-spin { display: inline-block; width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--line); border-top-color: var(--action); animation: chSpin .7s linear infinite; vertical-align: -3px; }
@keyframes chSpin { to { transform: rotate(360deg); } }

/* Status chips + counts ------------------------------------------------------ */
.ch-chip {
  display: inline-flex; align-items: center; gap: 6px; max-width: 100%;
  padding: 3px 10px 3px 8px; border-radius: var(--r-pill); border: 1px solid transparent;
  font: 700 12px/1.5 var(--font); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ch-chip-dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex: none; }
.ch-chip--neutral   { background: var(--paper-2); border-color: var(--line); color: var(--ink-soft); }
.ch-chip--attention { background: var(--attention-soft); color: var(--attention-ink); }
.ch-chip--attention .ch-chip-dot { background: #D9A915; }
.ch-chip--good      { background: var(--good-soft); color: var(--good); }
.ch-chip--action    { background: var(--action-soft); color: var(--action-text); }
.ch-chip--danger    { background: #F8DDE1; color: var(--danger); }
.ch-chip--ink       { background: var(--ink); color: #F7EBEF; }
.ch-count { display: inline-block; min-width: 20px; height: 20px; padding: 0 6px; border-radius: var(--r-pill); background: var(--paper-2); border: 1px solid var(--line); color: var(--ink); font: 800 11px/18px var(--font); text-align: center; }
.ch-count--attention { background: var(--attention); border-color: transparent; }
.ch-count--good { background: var(--good-soft); border-color: transparent; color: var(--good); }
.ch-net-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; flex: none; }
.ch-net-dot--facebook { background: #1877F2; }
.ch-net-dot--instagram { background: linear-gradient(45deg, #F58529, #DD2A7B, #8134AF); }
.ch-net-dot--linkedin { background: #0A66C2; }
.ch-net-dot--youtube { background: #FF0000; }
.ch-net-dot--gmb { background: #4285F4; }
.ch-net-dot--pinterest { background: #E60023; }
/* A cancelled post: greyed out wherever it is listed (it never goes out). */
.is-cancelled { opacity: .58; filter: grayscale(.85); }
.is-cancelled:hover, .is-cancelled:focus-visible { opacity: .85; }
.ch-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12px; color: var(--ink-soft); }
.ch-legend span { display: inline-flex; align-items: center; gap: 6px; }
.ch-legend i { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.ch-legend .is-good { background: var(--good); } .ch-legend .is-attention { background: var(--attention); }
.ch-legend .is-action { background: var(--action); } .ch-legend .is-danger { background: var(--danger); } .ch-legend .is-neutral { background: var(--ink-faint); }

/* Cards, KPIs, layout --------------------------------------------------------- */
.ch-card { background: var(--card); border: 1px solid var(--line-soft); border-radius: var(--r-lg); padding: 20px; min-width: 0; }
.ch-card--flush { padding: 0; overflow: hidden; }
.ch-card--ink { background: var(--ink); border-color: var(--ink); color: #F7EBEF; }
.ch-card--ink .ch-label { color: var(--attention); }
.ch-card--attention { background: var(--attention-pale); border-color: var(--attention-soft); }
.ch-card--good { background: var(--good-soft); border-color: transparent; }
.ch-card--action { background: var(--action-soft); border-color: transparent; }
.ch-card-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; margin-bottom: 14px; }
.ch-card-title { font: 800 17px/1.25 var(--font); margin: 0; }
.ch-card-foot { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line-soft); }
a.ch-card { display: block; color: inherit; text-decoration: none; transition: border-color .15s ease, box-shadow .15s ease; }
a.ch-card:hover { border-color: var(--line); box-shadow: var(--shadow-1); }
.ch-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; }
.ch-kpi { display: block; background: var(--card); border: 1px solid var(--line-soft); border-radius: var(--r-lg); padding: 16px 18px; color: inherit; text-decoration: none; min-width: 0; }
.ch-kpi--attention { background: var(--attention-pale); border-color: var(--attention-soft); }
.ch-kpi--good { background: var(--good-soft); border-color: transparent; }
.ch-kpi--action { background: var(--action-soft); border-color: transparent; }
a.ch-kpi:hover { box-shadow: var(--shadow-1); }
.ch-kpi-num { font: 800 40px/1 var(--font); letter-spacing: -.02em; margin-top: 8px; }
.ch-kpi-sub { font-size: 13px; color: var(--ink-soft); margin-top: 6px; line-height: 1.45; }
.ch-grid { display: grid; gap: var(--gap, 16px); }
.ch-grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.ch-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.ch-grid--cards { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.ch-split { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 20px; align-items: start; }
.ch-split--wide-aside { grid-template-columns: minmax(0, 1fr) 400px; }
@media (max-width: 1100px) { .ch-split, .ch-split--wide-aside { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 760px) { .ch-grid--2, .ch-grid--3 { grid-template-columns: minmax(0, 1fr); } }
.ch-row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--gap, 10px); }
.ch-row--nowrap { flex-wrap: nowrap; }
.ch-row--between { justify-content: space-between; }
.ch-stack { display: flex; flex-direction: column; gap: var(--gap, 12px); }
.ch-grow { flex: 1; min-width: 0; }
.ch-muted { color: var(--ink-soft); }
.ch-faint { color: var(--ink-faint); }
.ch-small { font-size: 13px; line-height: 1.5; }
.ch-tiny { font-size: 12px; line-height: 1.45; }
.ch-strong { font-weight: 800; }
.ch-truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.ch-pre { white-space: pre-wrap; overflow-wrap: anywhere; }
.ch-divider { height: 1px; background: var(--line-soft); border: 0; margin: 16px 0; }
.ch-sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.ch-only-mobile { display: none !important; }
@media (max-width: 900px) { .ch-hide-mobile { display: none !important; } .ch-only-mobile { display: revert !important; } }
.ch-hero {
  border-radius: var(--r-xl); padding: 28px; position: relative; overflow: hidden;
  background-color: #FFFFFF;
  background-image:
    linear-gradient(90deg, var(--gingham-stripe) 50%, transparent 50%),
    linear-gradient(var(--gingham-stripe) 50%, transparent 50%);
  background-size: var(--gingham-size) var(--gingham-size);
}

/* Notes / banners ------------------------------------------------------------- */
.ch-note { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--r-md); background: var(--attention-pale); border: 1px solid var(--attention-soft); color: var(--ink); font-size: 14px; line-height: 1.5; }
.ch-note > .ch-ic { margin-top: 1px; }
.ch-note--neutral { background: var(--paper-2); border-color: var(--line); }
.ch-note--good { background: var(--good-soft); border-color: transparent; color: #2C5A44; }
.ch-note--action { background: var(--action-soft); border-color: transparent; color: #6E2238; }
.ch-note--danger { background: #F8DDE1; border-color: transparent; color: #7A1F2E; }

/* Tabs / filters --------------------------------------------------------------- */
.ch-tabs { display: flex; gap: 4px; padding: 4px; background: var(--paper-2); border-radius: var(--r-pill); max-width: 100%; overflow-x: auto; scrollbar-width: none; width: max-content; }
.ch-tabs::-webkit-scrollbar { display: none; }
.ch-tab { flex: none; display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 14px; border: 0; border-radius: var(--r-pill); background: transparent; color: var(--ink-soft); font: 700 13px/1 var(--font); white-space: nowrap; cursor: pointer; }
.ch-tab:hover { color: var(--ink); }
.ch-tab.is-on, .ch-tab[aria-selected="true"], .ch-tab[aria-pressed="true"] { background: var(--ink); color: #F7EBEF; }
.ch-tab.is-on .ch-count, .ch-tab[aria-selected="true"] .ch-count { background: var(--attention); border-color: transparent; color: var(--ink); }

/* Board ------------------------------------------------------------------------ */
.ch-board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(270px, 1fr); gap: 14px; align-items: start; overflow-x: auto; padding-bottom: 8px; scroll-snap-type: x proximity; -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain; }
.ch-col { min-width: 0; display: flex; flex-direction: column; gap: 10px; padding: 12px; background: var(--paper-2); border: 1px solid var(--line-soft); border-radius: var(--r-lg); scroll-snap-align: start; }
.ch-col--attention { background: var(--attention-pale); border-color: var(--attention-soft); }
.ch-col--good { background: #EEF5EC; border-color: var(--good-soft); }
.ch-col--action { background: #FBEEF1; border-color: var(--action-soft); }
.ch-col-head { display: flex; align-items: center; gap: 8px; padding: 2px 4px; }
.ch-col-title { font: 800 14px/1.25 var(--font); margin: 0; min-width: 0; }
.ch-col-head .ch-count { margin-left: auto; }
.ch-col-hint { font-size: 12px; line-height: 1.45; color: var(--ink-faint); padding: 0 4px; margin: -4px 0 0; }
.ch-col-body { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.ch-col-empty { padding: 16px 10px; border: 1.5px dashed var(--line); border-radius: var(--r-md); font-size: 13px; color: var(--ink-faint); text-align: center; }
@media (max-width: 900px) {
  .ch-board { grid-auto-columns: 86%; margin: 0 -16px; padding: 0 16px 8px; scroll-padding: 0 16px; }
}

/* Post card ---------------------------------------------------------------------- */
.ch-post { position: relative; min-width: 0; display: flex; flex-direction: column; background: var(--card); border: 1px solid var(--line-soft); border-radius: var(--r-md); overflow: hidden; box-shadow: var(--shadow-1); transition: border-color .15s ease, box-shadow .15s ease; }
.ch-post:hover { border-color: var(--line); }
.ch-post.is-selected { border-color: var(--action); box-shadow: 0 0 0 2px var(--action-soft); }
button.ch-post, a.ch-post { text-align: left; font: inherit; color: inherit; text-decoration: none; cursor: pointer; padding: 0; width: 100%; }
.ch-post-thumb { position: relative; aspect-ratio: 4 / 3; background: var(--paper-2); overflow: hidden; flex: none; }
.ch-post-thumb img, .ch-post-thumb video { width: 100%; height: 100%; object-fit: cover; display: block; }
.ch-post-thumb--empty { display: grid; place-items: center; color: var(--ink-faint); background: linear-gradient(135deg, var(--paper-2), #F9EFE0); }
.ch-post-thumb--empty .ch-ic { width: 28px; height: 28px; }
.ch-post-type { position: absolute; left: 8px; top: 8px; padding: 5px 8px; border-radius: var(--r-pill); background: rgba(42,26,29,.8); color: #FFF; font: 800 10px/1 var(--font); letter-spacing: .06em; text-transform: uppercase; }
.ch-post-count { position: absolute; right: 8px; top: 8px; padding: 5px 8px; border-radius: var(--r-pill); background: rgba(255,255,255,.92); color: var(--ink); font: 800 10px/1 var(--font); }
.ch-post-pick { position: absolute; right: 8px; bottom: 8px; width: 28px; height: 28px; border-radius: 8px; background: rgba(255,255,255,.95); display: grid; place-items: center; box-shadow: var(--shadow-1); }
.ch-post-body { display: flex; flex-direction: column; gap: 6px; padding: 12px 14px 14px; min-width: 0; }
.ch-post-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-width: 0; }
.ch-post-client { font: 800 13px/1.3 var(--font); color: var(--ink); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ch-post-caption { margin: 0; font-size: 13px; line-height: 1.45; color: var(--ink-soft); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.ch-post-caption:empty::before { content: 'No caption yet'; color: var(--ink-faint); font-style: italic; }
.ch-post-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; font-size: 12px; color: var(--ink-faint); }
.ch-post-meta > span { display: inline-flex; align-items: center; gap: 4px; }
.ch-post-meta .ch-ic { width: 14px; height: 14px; }
.ch-post-note { margin: 2px 0 0; padding: 8px 10px; border-radius: 10px; background: var(--action-soft); color: #6E2238; font-size: 12px; line-height: 1.45; overflow-wrap: anywhere; }
.ch-post-note--attention { background: var(--attention-pale); color: var(--attention-ink); }
.ch-post-note--danger { background: #F8DDE1; color: #7A1F2E; }
.ch-post-note--good { background: var(--good-soft); color: #2C5A44; }
.ch-post-actions { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 14px 14px; }
.ch-post-actions .ch-btn { flex: 1 1 auto; }
.ch-post--row { flex-direction: row; align-items: stretch; }
.ch-post--row .ch-post-thumb { width: 96px; aspect-ratio: auto; min-height: 96px; }
.ch-post--row .ch-post-body { flex: 1; }
input[type="checkbox"].ch-check, input[type="radio"].ch-check { width: 20px; height: 20px; margin: 0; accent-color: var(--action); cursor: pointer; flex: none; }

/* Lists ------------------------------------------------------------------------- */
.ch-list { display: flex; flex-direction: column; }
.ch-list-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 12px 16px; border-top: 1px solid var(--line-soft); }
.ch-list-row:first-child { border-top: 0; }
a.ch-list-row, button.ch-list-row { color: inherit; text-decoration: none; background: none; border-left: 0; border-right: 0; border-bottom: 0; width: 100%; text-align: left; font: inherit; cursor: pointer; }
a.ch-list-row:hover, button.ch-list-row:hover { background: var(--paper); }
.ch-kv { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 8px 16px; margin: 0; font-size: 14px; }
.ch-kv dt { color: var(--ink-faint); font-weight: 700; }
.ch-kv dd { margin: 0; overflow-wrap: anywhere; }

/* Notes thread (internal review / client comments) ------------------------------ */
.ch-notes { display: flex; flex-direction: column; gap: 10px; }
.ch-notes-item { padding: 10px 12px; border-radius: 12px; background: var(--paper-2); }
.ch-notes-item--change { background: var(--action-soft); }
.ch-notes-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; margin-bottom: 2px; }
.ch-notes-who { font: 800 12px/1.3 var(--font); }
.ch-notes-when { font-size: 11px; color: var(--ink-faint); }
.ch-notes-text { margin: 0; font-size: 14px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }

/* Steps ("where it is") ---------------------------------------------------------- */
.ch-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.ch-step { display: grid; grid-template-columns: 18px minmax(0, 1fr); gap: 10px; align-items: start; font-size: 14px; }
.ch-step-pip { width: 14px; height: 14px; margin-top: 3px; border-radius: 50%; border: 2px solid var(--ink-faint); background: var(--card); }
.ch-step.is-done .ch-step-pip { background: var(--good); border-color: var(--good); }
.ch-step.is-current .ch-step-pip { background: var(--attention); border-color: var(--attention-ink); }
.ch-step.is-problem .ch-step-pip { background: var(--action); border-color: var(--action); }
.ch-step-label { font: 800 11px/1.25 var(--font); text-transform: uppercase; letter-spacing: .08em; color: var(--ink-faint); }
.ch-step-name { font-weight: 700; line-height: 1.35; }
.ch-step:not(.is-done):not(.is-current):not(.is-problem) .ch-step-name { color: var(--ink-faint); }
.ch-steps--row { flex-direction: row; flex-wrap: wrap; gap: 8px 20px; }

/* Form fields ------------------------------------------------------------------- */
.ch-form { display: flex; flex-direction: column; gap: 18px; }
.ch-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; margin: 0; padding: 0; border: 0; }
.ch-field-label { font: 800 11px/1.25 var(--font); text-transform: uppercase; letter-spacing: .08em; color: var(--ink-soft); padding: 0; }
.ch-field-label .ch-faint { text-transform: none; letter-spacing: 0; font-weight: 600; }
.ch-field-hint { font-size: 12px; line-height: 1.45; color: var(--ink-faint); margin: 0; }
.ch-field-error { font-size: 12px; line-height: 1.45; color: var(--danger); font-weight: 700; margin: 0; }
.ch-field-error[hidden], .ch-field-hint[hidden] { display: none; }
.ch-field-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 560px) { .ch-field-row { grid-template-columns: minmax(0, 1fr); } }
.ch-input, .ch-textarea, .ch-select {
  width: 100%; min-width: 0; min-height: 46px; padding: 11px 14px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r-md);
  font: 500 16px/1.4 var(--font); color: var(--ink); -webkit-appearance: none; appearance: none;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.ch-input::placeholder, .ch-textarea::placeholder { color: var(--ink-faint); }
.ch-input:focus, .ch-textarea:focus, .ch-select:focus { outline: none; border-color: var(--action); box-shadow: 0 0 0 3px var(--action-soft); }
.ch-input[aria-invalid="true"], .ch-textarea[aria-invalid="true"], .ch-select[aria-invalid="true"] { border-color: var(--danger); }
.ch-input:disabled, .ch-textarea:disabled, .ch-select:disabled { background: var(--paper-2); color: var(--ink-faint); }
.ch-textarea { min-height: 150px; resize: vertical; line-height: 1.55; }
.ch-select { padding-right: 40px; background-repeat: no-repeat; background-position: right 14px center; background-size: 14px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%232A1A1D' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); }
.ch-counter { font-size: 12px; color: var(--ink-faint); text-align: right; font-variant-numeric: tabular-nums; }
.ch-counter.is-over { color: var(--danger); font-weight: 800; }
.ch-seg { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 4px; max-width: 100%; background: var(--paper-2); border-radius: var(--r-pill); }
.ch-seg-btn { min-height: 38px; padding: 0 16px; border: 0; border-radius: var(--r-pill); background: transparent; color: var(--ink-soft); font: 700 14px/1 var(--font); cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.ch-seg-btn:hover { color: var(--ink); }
.ch-seg-btn.is-on, .ch-seg-btn[aria-pressed="true"], .ch-seg-btn[aria-checked="true"] { background: var(--ink); color: #F7EBEF; }
.ch-seg--block { display: flex; }
.ch-seg--block .ch-seg-btn { flex: 1; justify-content: center; }
.ch-toggles { display: flex; flex-wrap: wrap; gap: 8px; }
.ch-toggle { display: inline-flex; align-items: center; gap: 8px; min-height: 42px; padding: 0 16px; border: 1.5px solid var(--line); border-radius: var(--r-pill); background: var(--card); color: var(--ink); font: 700 14px/1 var(--font); cursor: pointer; transition: background .15s ease, border-color .15s ease, color .15s ease; }
.ch-toggle:hover { border-color: var(--ink-faint); }
.ch-toggle.is-on, .ch-toggle[aria-pressed="true"], .ch-toggle[aria-checked="true"] { background: var(--ink); border-color: var(--ink); color: #F7EBEF; }
.ch-toggle.is-on .ch-net-dot, .ch-toggle[aria-pressed="true"] .ch-net-dot { box-shadow: 0 0 0 2px #F7EBEF; }

/* Drop zone + media tiles ---------------------------------------------------------- */
.ch-drop { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 28px 16px; text-align: center; border: 2px dashed var(--line); border-radius: var(--r-lg); background: var(--paper); color: var(--ink-soft); cursor: pointer; transition: border-color .15s ease, background .15s ease; }
.ch-drop:hover, .ch-drop.is-over, .ch-drop:focus-within { border-color: var(--action); background: #FCF1F3; color: var(--ink); }
.ch-drop .ch-ic { width: 28px; height: 28px; color: var(--action-text); }
.ch-drop-title { font: 800 15px/1.3 var(--font); color: var(--ink); }
.ch-drop-hint { font-size: 12px; line-height: 1.45; color: var(--ink-faint); max-width: 40ch; }
.ch-drop input[type="file"] { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.ch-media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px; }
.ch-media-tile { position: relative; aspect-ratio: 1; border-radius: var(--r-md); overflow: hidden; background: var(--paper-2); border: 1px solid var(--line-soft); }
.ch-media-tile img, .ch-media-tile video { width: 100%; height: 100%; object-fit: cover; display: block; }
.ch-media-tile.is-error { border-color: var(--danger); }
.ch-media-tile.is-uploading::after { content: ''; position: absolute; inset: 0; background: rgba(251,244,228,.65); }
.ch-media-tile.is-uploading::before { content: ''; position: absolute; z-index: 1; left: 50%; top: 50%; width: 22px; height: 22px; margin: -11px 0 0 -11px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--action); animation: chSpin .7s linear infinite; }
.ch-media-x { position: absolute; z-index: 2; top: 6px; right: 6px; width: 30px; height: 30px; border: 0; border-radius: 50%; background: rgba(42,26,29,.82); color: #FFF; display: grid; place-items: center; cursor: pointer; }
.ch-media-x .ch-ic { width: 14px; height: 14px; }
.ch-media-n { position: absolute; z-index: 2; left: 6px; bottom: 6px; padding: 3px 7px; border-radius: var(--r-pill); background: rgba(42,26,29,.82); color: #FFF; font: 800 10px/1 var(--font); }
.ch-media-move { position: absolute; z-index: 2; bottom: 6px; right: 6px; display: flex; gap: 4px; }
.ch-media-move button { width: 26px; height: 26px; border: 0; border-radius: 50%; background: rgba(255,255,255,.92); color: var(--ink); display: grid; place-items: center; cursor: pointer; }
.ch-progress { height: 6px; border-radius: var(--r-pill); background: var(--line-soft); overflow: hidden; }
.ch-progress > span { display: block; height: 100%; width: 0; background: var(--action); border-radius: inherit; transition: width .2s ease; }

/* Phone preview frame (Instagram + Facebook) --------------------------------------- */
.ch-phone { width: 100%; max-width: 340px; margin: 0 auto; padding: 10px; border-radius: 42px; background: var(--ink); box-shadow: var(--shadow-2); }
.ch-phone-screen { position: relative; display: flex; flex-direction: column; min-height: 560px; max-height: 720px; overflow-y: auto; border-radius: 32px; background: #FFF; scrollbar-width: none; }
.ch-phone-screen::-webkit-scrollbar { display: none; }
.ch-phone-bar { display: flex; align-items: center; justify-content: space-between; padding: 12px 24px 6px; font: 700 12px/1 -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif; color: #111; }
.ch-phone-notch { width: 86px; height: 22px; border-radius: 14px; background: #000; }
.ch-ig, .ch-fb { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, system-ui, sans-serif; background: #FFF; }
.ch-ig { color: #111; }
.ch-ig-head { display: flex; align-items: center; gap: 10px; padding: 10px 12px; }
.ch-ig-avatar { width: 32px; height: 32px; flex: none; padding: 2px; border-radius: 50%; background: linear-gradient(45deg, #F58529, #DD2A7B, #8134AF); }
.ch-ig-avatar > span, .ch-ig-avatar > img { display: grid; place-items: center; width: 100%; height: 100%; border-radius: 50%; border: 2px solid #FFF; background: #FFF; object-fit: cover; font: 800 10px/1 var(--font); color: var(--action-text); }
.ch-ig-name { font-weight: 700; font-size: 13px; line-height: 1.2; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ch-ig-name small { display: block; font-weight: 400; font-size: 11px; color: #737373; }
.ch-ig-media { position: relative; aspect-ratio: 1; background: #EFEFEF; overflow: hidden; display: grid; place-items: center; color: #9A9A9A; }
.ch-ig-media img, .ch-ig-media video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.ch-ig-media--portrait { aspect-ratio: 4 / 5; }
.ch-ig-media--reel, .ch-ig-media--story { aspect-ratio: 9 / 16; }
.ch-ig-badge { position: absolute; z-index: 1; top: 10px; right: 10px; padding: 4px 8px; border-radius: var(--r-pill); background: rgba(0,0,0,.6); color: #FFF; font: 600 11px/1 -apple-system, system-ui, sans-serif; }
.ch-ig-actions { display: flex; align-items: center; gap: 14px; padding: 10px 12px 6px; color: #111; }
.ch-ig-actions .ch-ic { width: 23px; height: 23px; }
.ch-ig-actions .ch-ig-save { margin-left: auto; }
.ch-ig-caption { margin: 0; padding: 0 12px 14px; font-size: 13px; line-height: 1.4; white-space: pre-wrap; overflow-wrap: anywhere; }
.ch-ig-caption b { font-weight: 700; margin-right: 4px; }
.ch-ig-caption .ch-ig-more { color: #737373; }
.ch-ig-story-top { position: absolute; z-index: 1; left: 8px; right: 8px; top: 8px; display: flex; gap: 3px; }
.ch-ig-story-top i { flex: 1; height: 2px; border-radius: 2px; background: rgba(255,255,255,.55); }
.ch-dots { display: flex; justify-content: center; gap: 4px; padding: 6px 0 0; }
.ch-dots i { width: 6px; height: 6px; border-radius: 50%; background: #C7C7C7; }
.ch-dots i.is-on { background: #0095F6; }
.ch-fb { color: #050505; }
.ch-fb-head { display: flex; align-items: center; gap: 10px; padding: 12px; }
.ch-fb-avatar { width: 38px; height: 38px; flex: none; border-radius: 50%; background: #1877F2; color: #FFF; display: grid; place-items: center; overflow: hidden; font: 800 13px/1 var(--font); }
.ch-fb-avatar img { width: 100%; height: 100%; object-fit: cover; }
.ch-fb-name { font-weight: 700; font-size: 14px; line-height: 1.25; min-width: 0; }
.ch-fb-name small { display: block; font-weight: 400; font-size: 12px; color: #65676B; }
.ch-fb-text { margin: 0; padding: 0 12px 10px; font-size: 14px; line-height: 1.4; white-space: pre-wrap; overflow-wrap: anywhere; }
.ch-fb-media { position: relative; background: #F0F2F5; aspect-ratio: 1; overflow: hidden; display: grid; place-items: center; color: #9A9A9A; }
.ch-fb-media img, .ch-fb-media video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.ch-fb-actions { display: flex; justify-content: space-around; margin: 0 12px; padding: 6px 0 10px; border-top: 1px solid #CED0D4; color: #65676B; font: 600 13px/1 -apple-system, system-ui, sans-serif; }
.ch-fb-actions span { display: inline-flex; align-items: center; gap: 6px; padding: 8px 4px; }
.ch-fb-actions .ch-ic { width: 18px; height: 18px; }

/* Month calendar ---------------------------------------------------------------- */
.ch-cal { background: var(--card); border: 1px solid var(--line-soft); border-radius: var(--r-lg); overflow: hidden; min-width: 0; }
.ch-cal-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 12px 14px; border-bottom: 1px solid var(--line-soft); }
.ch-cal-month { font: 800 18px/1.2 var(--font); margin: 0 auto 0 4px; }
.ch-cal-head, .ch-cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.ch-cal-head { background: var(--paper); border-bottom: 1px solid var(--line-soft); }
.ch-cal-head > div { padding: 8px 10px; font: 800 11px/1 var(--font); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-faint); text-align: left; }
.ch-cal-cell { position: relative; min-width: 0; min-height: 116px; padding: 6px; display: flex; flex-direction: column; gap: 4px; background: var(--card); border-right: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft); text-align: left; font: inherit; color: inherit; }
.ch-cal-grid > .ch-cal-cell:nth-child(7n) { border-right: 0; }
.ch-cal-grid > .ch-cal-cell:nth-last-child(-n+7) { border-bottom: 0; }
button.ch-cal-cell, .ch-cal-cell[role="button"] { cursor: pointer; border-top: 0; border-left: 0; }
button.ch-cal-cell:hover, .ch-cal-cell[role="button"]:hover { background: #FFFCF5; }
.ch-cal-cell.is-out { background: var(--paper); }
.ch-cal-cell.is-out .ch-cal-date { color: var(--ink-faint); font-weight: 600; }
.ch-cal-cell.is-today .ch-cal-date { background: var(--ink); color: #F7EBEF; }
.ch-cal-cell.is-selected { box-shadow: inset 0 0 0 2px var(--action); }
.ch-cal-date { align-self: flex-start; min-width: 26px; height: 26px; padding: 0 6px; border-radius: var(--r-pill); display: grid; place-items: center; font: 800 13px/1 var(--font); color: var(--ink); }
.ch-cal-items { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.ch-cal-chip { display: flex; align-items: center; gap: 5px; width: 100%; min-width: 0; padding: 3px 7px; border: 0; border-left: 3px solid var(--ink-faint); border-radius: 7px; background: var(--paper-2); color: var(--ink); font: 700 11px/1.35 var(--font); text-align: left; cursor: pointer; overflow: hidden; }
.ch-cal-chip > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ch-cal-chip-time { flex: none; font-weight: 800; color: var(--ink-soft); }
.ch-cal-chip--neutral { background: var(--paper-2); border-left-color: var(--ink-faint); }
.ch-cal-chip--good { background: var(--good-soft); border-left-color: var(--good); }
.ch-cal-chip--attention { background: var(--attention-pale); border-left-color: var(--attention); }
.ch-cal-chip--action { background: var(--action-soft); border-left-color: var(--action); }
.ch-cal-chip--danger { background: #F8DDE1; border-left-color: var(--danger); }
.ch-cal-chip.is-live::after { content: '✓'; flex: none; margin-left: auto; color: var(--good); font-weight: 800; }
.ch-cal-more { padding: 2px 6px; border: 0; background: none; font: 700 11px/1.3 var(--font); color: var(--ink-soft); text-align: left; cursor: pointer; }
@media (max-width: 640px) {
  .ch-cal-head > div { padding: 8px 0; text-align: center; font-size: 10px; letter-spacing: .04em; }
  .ch-cal-cell { min-height: 58px; padding: 4px 2px; align-items: center; gap: 3px; }
  .ch-cal-date { align-self: center; min-width: 24px; height: 24px; font-size: 12px; }
  .ch-cal-items { flex-direction: row; flex-wrap: wrap; justify-content: center; gap: 3px; }
  .ch-cal-chip { width: 8px; height: 8px; padding: 0; border: 0; border-radius: 50%; font-size: 0; line-height: 0; flex: none; pointer-events: none; }
  .ch-cal-chip > *, .ch-cal-chip.is-live::after { display: none; }
  .ch-cal-chip--neutral { background: var(--ink-faint); } .ch-cal-chip--good { background: var(--good); }
  .ch-cal-chip--attention { background: var(--attention); } .ch-cal-chip--action { background: var(--action); } .ch-cal-chip--danger { background: var(--danger); }
  .ch-cal-more { font-size: 10px; padding: 0; }
}
.ch-agenda { display: flex; flex-direction: column; gap: 8px; }
.ch-agenda-day { font: 800 12px/1.3 var(--font); text-transform: uppercase; letter-spacing: .08em; color: var(--ink-faint); margin: 12px 0 2px; }
.ch-agenda-item { display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 10px 12px; border-radius: var(--r-md); background: var(--card); border: 1px solid var(--line-soft); color: inherit; text-decoration: none; text-align: left; font: inherit; width: 100%; cursor: pointer; }
.ch-agenda-time { font: 800 13px/1.2 var(--font); color: var(--ink-soft); }

/* Drawer -------------------------------------------------------------------------- */
.ch-drawer-wrap { position: fixed; inset: 0; z-index: 2500; background: rgba(42,26,29,.38); opacity: 0; transition: opacity .2s ease; }
.ch-drawer-wrap.is-open { opacity: 1; }
.ch-drawer { position: absolute; top: 0; right: 0; bottom: 0; width: min(520px, 100%); display: flex; flex-direction: column; background: var(--paper); box-shadow: var(--shadow-2); outline: none; transform: translateX(28px); transition: transform .22s ease; }
.ch-drawer--wide { width: min(780px, 100%); }
.ch-drawer-wrap.is-open .ch-drawer { transform: none; }
.ch-drawer-head { display: flex; align-items: flex-start; gap: 12px; padding: 16px 16px 14px 20px; background: var(--card); border-bottom: 1px solid var(--line); }
.ch-drawer-title { font: 800 20px/1.25 var(--font); margin: 4px 0 0; overflow-wrap: anywhere; }
.ch-drawer-sub { font-size: 13px; line-height: 1.45; color: var(--ink-soft); margin-top: 2px; }
.ch-drawer-sub[hidden], .ch-drawer-foot[hidden] { display: none; }
.ch-drawer-body { flex: 1; overflow-y: auto; padding: 20px; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
.ch-drawer-foot { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; padding: 14px 20px calc(14px + env(safe-area-inset-bottom)); background: var(--card); border-top: 1px solid var(--line); }
@media (max-width: 640px) {
  .ch-drawer, .ch-drawer--wide { top: auto; left: 0; width: 100%; max-height: 92vh; max-height: 92dvh; border-radius: 20px 20px 0 0; overflow: hidden; transform: translateY(28px); }
  .ch-drawer-body { padding: 16px; }
  .ch-drawer-foot { padding-left: 16px; padding-right: 16px; }
  .ch-drawer-foot > .ch-btn { flex: 1 1 auto; }
}

/* Modal --------------------------------------------------------------------------- */
.ch-modal-wrap { position: fixed; inset: 0; z-index: 3000; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(42,26,29,.45); opacity: 0; transition: opacity .18s ease; }
.ch-modal-wrap.is-open { opacity: 1; }
.ch-modal { width: 100%; max-width: 440px; max-height: calc(100vh - 32px); overflow: auto; padding: 24px; background: var(--card); border-radius: var(--r-lg); box-shadow: var(--shadow-2); outline: none; transform: translateY(8px) scale(.98); transition: transform .18s ease; }
.ch-modal-wrap.is-open .ch-modal { transform: none; }
.ch-modal-title { font: 800 19px/1.3 var(--font); margin: 0 0 6px; overflow-wrap: anywhere; }
.ch-modal-body { margin: 0 0 8px; font-size: 15px; line-height: 1.55; color: var(--ink-soft); white-space: pre-line; overflow-wrap: anywhere; }
.ch-modal .ch-field { margin-top: 12px; }
/* The dictation mic (auth-gate.js #fcmMicBtn, only where the browser can dictate) floats inside the right
   edge of a focused text field: keep the placeholder and the typed words clear of it in a confirm box. */
body:has(> #fcmMicBtn) .ch-modal :is(textarea.ch-textarea, input.ch-input:not([type]), input.ch-input[type="text"], input.ch-input[type="search"]):not([readonly]):not(:disabled) { padding-right: 44px; }
.ch-modal-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; margin-top: 20px; }
@media (max-width: 480px) {
  .ch-modal-wrap { align-items: flex-end; padding: 12px 12px calc(12px + env(safe-area-inset-bottom)); }
  .ch-modal-actions > .ch-btn { flex: 1 1 auto; }
}

/* Toast --------------------------------------------------------------------------- */
.ch-toasts { position: fixed; z-index: 3500; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom)); transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 8px; width: max-content; max-width: calc(100vw - 32px); pointer-events: none; }
.ch-toast { pointer-events: auto; display: flex; align-items: center; gap: 10px; max-width: 100%; padding: 12px 18px; border-radius: 14px; background: var(--ink); color: #F7EBEF; font: 600 14px/1.4 var(--font); box-shadow: var(--shadow-2); cursor: pointer; animation: chToastIn .22s ease both; overflow-wrap: anywhere; }
.ch-toast::before { content: ''; width: 8px; height: 8px; border-radius: 50%; flex: none; background: rgba(247,235,239,.55); }
.ch-toast--good::before { background: #9ED2B3; }
.ch-toast--attention::before { background: var(--attention); }
.ch-toast--action::before { background: #F0A3B6; }
.ch-toast--danger { background: var(--danger); color: #FFF; }
.ch-toast--danger::before { background: #FFF; }
.ch-toast.is-leaving { opacity: 0; transform: translateY(6px); transition: opacity .2s ease, transform .2s ease; }
@keyframes chToastIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* Empty state + skeleton ------------------------------------------------------------ */
.ch-empty { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 40px 20px; text-align: center; background: var(--card); border: 1.5px dashed var(--line); border-radius: var(--r-lg); }
.ch-empty-mark { width: 44px; height: 44px; margin-bottom: 8px; background: url(/brand/fcm-mark-pink.png) center / contain no-repeat; opacity: .45; }
.ch-empty-title { font: 800 17px/1.3 var(--font); color: var(--ink); }
.ch-empty-body { margin: 0; max-width: 46ch; font-size: 14px; line-height: 1.55; color: var(--ink-soft); }
.ch-empty-action { margin-top: 12px; }
.ch-skeleton { display: grid; gap: 12px; }
.ch-skeleton--board { grid-auto-flow: column; grid-auto-columns: minmax(240px, 1fr); overflow: hidden; }
.ch-skel { border-radius: var(--r-md); background: linear-gradient(90deg, var(--paper-2) 0%, #FFF9EC 50%, var(--paper-2) 100%); background-size: 200% 100%; animation: chShimmer 1.3s linear infinite; }
.ch-skel-line { height: 14px; border-radius: 7px; }
.ch-skel-card { height: 120px; }
.ch-skel-col { display: grid; gap: 10px; padding: 12px; border: 1px solid var(--line-soft); border-radius: var(--r-lg); }
@keyframes chShimmer { to { background-position: -200% 0; } }

/* Sticky action bar (composer / decision footers on phones) -------------------------- */
.ch-actionbar { position: sticky; bottom: 0; z-index: 50; display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 8px; margin-top: 20px; padding: 12px 0 calc(12px + env(safe-area-inset-bottom)); background: linear-gradient(to top, var(--paper) 72%, rgba(251,244,228,0)); }
@media (max-width: 640px) { .ch-actionbar > .ch-btn { flex: 1 1 auto; } }

/* Public portal (portal-approval.html) helpers ---------------------------------------- */
.ch-portal { min-height: 100vh; background: var(--paper); }
.ch-portal-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; max-width: 1100px; margin: 0 auto; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.ch-portal-main { max-width: 1100px; margin: 0 auto; padding: 28px 20px 80px; }
@media (max-width: 640px) { .ch-portal-bar { padding: 12px 16px; } .ch-portal-main { padding: 20px 16px 64px; } }

/* Motion -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  html[data-ch] *, html[data-ch] *::before, html[data-ch] *::after,
  .ch-app *, .ch-toast, .ch-modal-wrap, .ch-modal, .ch-drawer-wrap, .ch-drawer, .ch-skel, .ch-btn, .ch-spin, .ch-side, .ch-scrim {
    animation-duration: .01ms !important; animation-iteration-count: 1 !important;
    transition-duration: .01ms !important; transition-delay: 0s !important; scroll-behavior: auto !important;
  }
  .ch-skel { animation: none !important; }
}

/* [hidden] guard ------------------------------------------------------------------ */
/* These components set `display`, which would otherwise beat the hidden attribute, so a page that
   sets el.hidden = true on them would still show them. (0,2,0): a page rule that deliberately shows
   a hidden element with a more specific selector still wins. */
.ch-btn[hidden], .ch-iconbtn[hidden], .ch-link[hidden], .ch-chip[hidden], .ch-count[hidden], .ch-tab[hidden],
.ch-toggle[hidden], .ch-seg[hidden], .ch-seg-btn[hidden], .ch-grid[hidden], .ch-split[hidden], .ch-row[hidden],
.ch-stack[hidden], .ch-note[hidden], .ch-card-head[hidden], .ch-card-foot[hidden], .ch-kpi[hidden], .ch-post[hidden],
.ch-post-body[hidden], .ch-post-actions[hidden], .ch-list-row[hidden], .ch-steps[hidden], .ch-step[hidden],
.ch-field[hidden], .ch-field-row[hidden], .ch-drop[hidden], .ch-agenda-item[hidden], .ch-empty[hidden],
.ch-actionbar[hidden] { display: none; }

/* One navigation (ch-shell.js v2) ------------------------------------------------- */
/* The menu's own look (doors, groups, pins, rail) is injected by ch-shell.js as #chNavCSS so it also
   works on classic pages; these rules only place it inside the new-page sidebar and top bar. */
.ch-side.ch-nt-host { gap: 0; }
.ch-side .ch-nt-slot { min-width: 0; }
.ch-side .ch-nt-pslot { min-width: 0; }
.ch-topbar .ch-topbar-title { flex: 1 1 auto; }
.ch-topbar .ch-brand-logo { width: auto; height: 42px; }

/* ============================================================================
   CrossHub UI kit (Release 8)
   ---------------------------------------------------------------------------
   Reusable blocks for the Release 8 pages. Helpers live in /ch-ui.js (window.CHUI);
   the live demo and the API list are on /ui-kit.html (owner + management).
   Palette: cream page, white cards, plum ink #5B1A42, candy pink #FFC9DB / #FF8AB0,
   hot pink #FF5C8A, sunny yellow #FFD255, lavender #C7B6F5, lime #B8D94A, deep plum
   #3A1530. Text on colour meets WCAG AA: plum on every pastel, deep plum on hot pink,
   cream on deep plum. --chui-ink-soft only on cream, white and the pale tile tints.
   Name note: .ch-stack already exists above (a flex column), so the stacked wallet
   cards are .ch-wallet. Nothing above this line was changed.
   ============================================================================ */
:root {
  --chui-cream: #FFF6E6;
  --chui-card: #FFFFFF;
  --chui-plum: #5B1A42;
  --chui-plum-deep: #3A1530;
  --chui-ink-soft: #6E4A60;
  --chui-pink: #FFC9DB;
  --chui-pink-2: #FF8AB0;
  --chui-hot: #FF5C8A;
  --chui-yellow: #FFD255;
  --chui-lavender: #C7B6F5;
  --chui-lime: #B8D94A;
  --chui-blue: #BCDDF7;
  --chui-pink-tint: #FFE3EC;
  --chui-lavender-tint: #ECE5FD;
  --chui-yellow-tint: #FFF0BF;
  --chui-lime-tint: #E8F3C2;
  --chui-blue-tint: #DFEEFB;
  --chui-line: rgba(91, 26, 66, .14);
  --chui-good: #1F6B45;
  --chui-bad: #A3243F;
  --chui-nodata: #A8949F;
  --chui-serif: 'Playfair Display', 'Fraunces', Georgia, 'Times New Roman', serif;
  --chui-mono: ui-monospace, 'SF Mono', SFMono-Regular, Menlo, Consolas, monospace;
  --chui-r: 22px;
}

/* 1. Editorial index grid (.ch-index) --------------------------------------- */
.ch-index {
  --chui-cols: 5;
  display: grid; grid-template-columns: repeat(var(--chui-cols), minmax(0, 1fr));
  margin: 0; padding: 0; list-style: none; min-width: 0;
  border-top: 1px solid var(--chui-plum); border-left: 1px solid var(--chui-plum);
  background-color: var(--chui-cream); color: var(--chui-plum);
  background-image: linear-gradient(rgba(91, 26, 66, .045) 1px, transparent 1px), linear-gradient(90deg, rgba(91, 26, 66, .045) 1px, transparent 1px);
  background-size: 22px 22px;
}
@media (max-width: 1280px) { .ch-index { --chui-cols: 4; } }
@media (max-width: 1024px) { .ch-index { --chui-cols: 3; } }
@media (max-width: 720px)  { .ch-index { --chui-cols: 2; } }
@media (max-width: 460px)  { .ch-index { --chui-cols: 1; } }
.ch-index-item { display: flex; min-width: 0; margin: 0; border-right: 1px solid var(--chui-plum); border-bottom: 1px solid var(--chui-plum); }
.ch-index-cell {
  position: relative; flex: 1 1 auto; display: flex; flex-direction: column; gap: 8px; min-width: 0; min-height: 212px;
  padding: 16px 18px; border: 0; background: transparent; color: inherit; font: inherit; text-align: left; text-decoration: none;
  transition: background-color .15s ease, opacity .15s ease;
}
a.ch-index-cell, button.ch-index-cell { cursor: pointer; }
a.ch-index-cell:hover, button.ch-index-cell:hover { background-color: rgba(255, 201, 219, .42); }
.ch-index-cell:focus-visible { outline: 3px solid var(--chui-plum-deep); outline-offset: -6px; background-color: rgba(255, 201, 219, .42); }
.ch-index-meta { margin: 0; font: 500 12px/1.4 var(--chui-mono); letter-spacing: .02em; color: var(--chui-ink-soft); }
.ch-index-title { display: block; margin: 10px 0 0; font: 500 clamp(22px, 2.1vw, 30px)/1.12 var(--chui-serif); letter-spacing: -.01em; color: var(--chui-plum); overflow-wrap: anywhere; font-variant-numeric: lining-nums; }
.ch-index-sub { margin: 0; font-size: 13px; line-height: 1.45; color: var(--chui-ink-soft); }
.ch-index-go { margin-top: auto; padding-top: 8px; display: inline-flex; align-items: center; gap: 6px; font: 600 12px/1 var(--chui-mono); letter-spacing: .02em; color: var(--chui-plum); }
.ch-index-go [aria-hidden] { display: inline-block; transition: transform .15s ease; }
.ch-index-cell:hover .ch-index-go [aria-hidden], .ch-index-cell:focus-visible .ch-index-go [aria-hidden] { transform: translate(2px, -2px); }
.ch-index-badge { position: absolute; bottom: 14px; right: 14px; max-width: calc(100% - 120px); padding: 3px 10px; border-radius: var(--r-pill); background: var(--chui-yellow); color: var(--chui-plum); font: 700 11.5px/1.4 var(--font); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ch-index-badge--pink { background: var(--chui-pink-2); }
.ch-index-badge--lime { background: var(--chui-lime); }
.ch-index-badge--lavender { background: var(--chui-lavender); }
.ch-index-badge--hot { background: var(--chui-hot); color: var(--chui-plum-deep); }
.ch-index-badge--plain { background: #FFF; border: 1px solid var(--chui-line); }
.ch-index-ring { position: absolute; top: 10px; right: 10px; width: 46px; height: 46px; }
.ch-index-cell:has(.ch-index-ring) .ch-index-meta { padding-right: 52px; }
.ch-index-item.is-dim .ch-index-cell { opacity: .3; }
.ch-index-item.is-dim .ch-index-cell:hover, .ch-index-item.is-dim .ch-index-cell:focus-visible { opacity: .7; }
.ch-index-item--filler { background: var(--chui-plum-deep); }
.ch-index-item--filler .ch-index-cell { color: #FFF6E6; }
.ch-index-item--filler .ch-index-meta { color: var(--chui-pink); }
.ch-index-item--filler .ch-index-title { color: #FFF6E6; }
.ch-index-item--filler .ch-index-sub { color: #F3D6E3; }
.ch-index-item--filler .ch-index-go { color: var(--chui-yellow); }
.ch-index-item--filler a.ch-index-cell:hover, .ch-index-item--filler button.ch-index-cell:hover { background-color: rgba(255, 255, 255, .07); }
.ch-index-item--filler .ch-index-cell:focus-visible { outline-color: var(--chui-pink); background-color: rgba(255, 255, 255, .07); }
.ch-index--compact .ch-index-cell { min-height: 150px; }
@media (max-width: 720px) { .ch-index-cell { min-height: 160px; padding: 14px 14px; } .ch-index-title { font-size: 22px; } }
@media (max-width: 460px) { .ch-index-cell { min-height: 0; padding: 16px; } .ch-index-title { margin-top: 6px; } .ch-index-go { padding-top: 12px; } }

/* 2. Friendly greeting (.ch-greet) ------------------------------------------- */
.ch-greet { display: flex; flex-direction: column; gap: 12px; margin: 0 0 24px; color: var(--chui-plum); min-width: 0; }
.ch-greet-title { margin: 0; max-width: 22ch; font: 800 clamp(30px, 4.4vw, 52px)/1.06 var(--font); letter-spacing: -.025em; color: var(--chui-plum); overflow-wrap: anywhere; }
.ch-greet-name { background: linear-gradient(transparent 64%, var(--chui-pink) 64%); padding: 0 .04em; -webkit-box-decoration-break: clone; box-decoration-break: clone; }
.ch-greet-avatar { display: inline-grid; place-items: center; font-size: .38em; width: 2.4em; height: 2.4em; margin: 0 .1em 0 .3em; vertical-align: .05em; border-radius: 50%; overflow: hidden; background: var(--chui-pink-2); color: var(--chui-plum-deep); font-weight: 800; letter-spacing: 0; box-shadow: 0 0 0 3px #FFF; }
.ch-greet-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ch-greet-avatar--yellow { background: var(--chui-yellow); } .ch-greet-avatar--lavender { background: var(--chui-lavender); } .ch-greet-avatar--lime { background: var(--chui-lime); }
.ch-greet-sub { margin: 0; max-width: 62ch; font-size: 16px; line-height: 1.5; color: var(--chui-ink-soft); }
.ch-greet-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 0; padding: 0; list-style: none; }
.ch-greet-chip { display: inline-flex; align-items: center; gap: 8px; min-height: 36px; padding: 4px 14px 4px 5px; border-radius: var(--r-pill); background: #FFF; border: 1px solid var(--chui-line); color: var(--chui-plum); font: 600 13px/1.2 var(--font); text-decoration: none; }
a.ch-greet-chip:hover { border-color: var(--chui-plum); }
a.ch-greet-chip:focus-visible { outline: 2px solid var(--chui-plum-deep); outline-offset: 2px; }
.ch-greet-chip b { display: inline-grid; place-items: center; min-width: 26px; height: 26px; padding: 0 8px; border-radius: var(--r-pill); background: var(--chui-pink); font-weight: 800; font-variant-numeric: tabular-nums; }
.ch-greet-chip--yellow b { background: var(--chui-yellow); } .ch-greet-chip--lime b { background: var(--chui-lime); }
.ch-greet-chip--lavender b { background: var(--chui-lavender); } .ch-greet-chip--hot b { background: var(--chui-hot); color: var(--chui-plum-deep); }
.ch-greet-chip--blue b { background: var(--chui-blue); }

/* 3. At-a-glance tiles (.ch-tile) + tiny charts ------------------------------- */
.ch-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 14px; min-width: 0; }
.ch-tile { position: relative; display: flex; flex-direction: column; gap: 12px; min-width: 0; padding: 18px; border-radius: var(--chui-r); background: var(--chui-pink-tint); color: var(--chui-plum); text-decoration: none; overflow: hidden; }
a.ch-tile { transition: box-shadow .15s ease, transform .15s ease; }
a.ch-tile:hover { box-shadow: inset 0 0 0 2px var(--chui-plum); }
a.ch-tile:focus-visible { outline: 3px solid var(--chui-plum-deep); outline-offset: 3px; }
.ch-tile--wide { grid-column: span 2; }
@media (max-width: 520px) { .ch-tile--wide { grid-column: auto; } }
.ch-tile-head { display: flex; align-items: center; gap: 12px; min-width: 0; }
.ch-tile-ic { flex: none; width: 42px; height: 42px; border-radius: 50%; background: #FFF; display: grid; place-items: center; color: var(--chui-plum); }
.ch-tile-ic .ch-ic { width: 20px; height: 20px; }
.ch-tile-text { min-width: 0; }
.ch-tile-value { display: block; font: 800 27px/1.05 var(--font); letter-spacing: -.02em; overflow-wrap: anywhere; }
.ch-tile-value small { margin-left: 3px; font-size: 14px; font-weight: 700; letter-spacing: 0; color: var(--chui-ink-soft); }
.ch-tile-label { display: block; margin-top: 3px; font: 600 13px/1.3 var(--font); color: var(--chui-ink-soft); }
.ch-tile-delta { align-self: flex-start; display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: var(--r-pill); background: rgba(255, 255, 255, .8); font: 800 12px/1.4 var(--font); color: var(--chui-plum); font-variant-numeric: tabular-nums; }
.ch-tile-delta.is-good { color: var(--chui-good); }
.ch-tile-delta.is-bad { color: var(--chui-bad); }
.ch-tile-delta small { font-weight: 600; color: var(--chui-ink-soft); }
.ch-tile-chart { margin-top: auto; min-width: 0; height: 56px; color: var(--chui-plum); }
.ch-tile-chart svg { display: block; overflow: visible; }
.ch-tile--pink { background: var(--chui-pink-tint); }
.ch-tile--lavender { background: var(--chui-lavender-tint); }
.ch-tile--yellow { background: var(--chui-yellow-tint); }
.ch-tile--lime { background: var(--chui-lime-tint); }
.ch-tile--blue { background: var(--chui-blue-tint); }
.ch-tile--white { background: #FFF; border: 1px solid var(--chui-line); }
.ch-tile--plum { background: var(--chui-plum-deep); color: #FFF6E6; }
.ch-tile--plum .ch-tile-label, .ch-tile--plum .ch-tile-value small, .ch-tile--plum .ch-tile-delta small { color: #F3D6E3; }
.ch-tile--plum .ch-tile-ic { color: var(--chui-plum-deep); }
.ch-tile--plum .ch-tile-chart { color: var(--chui-pink); }
.ch-chart-line { fill: none; stroke: currentColor; stroke-width: 2.25; stroke-linecap: round; stroke-linejoin: round; }
.ch-chart-area { fill: currentColor; fill-opacity: .13; stroke: none; }
.ch-chart-dot { fill: #FFF; stroke: currentColor; stroke-width: 2.25; }
.ch-chart-bar { fill: currentColor; fill-opacity: .2; }
.ch-chart-bar.is-hi { fill: var(--chui-plum-deep); fill-opacity: 1; }
.ch-tile .ch-chart-bar { fill: #FFF; fill-opacity: .9; }
.ch-tile .ch-chart-bar.is-hi { fill: var(--chui-plum-deep); fill-opacity: 1; }
.ch-tile--white .ch-chart-bar { fill: currentColor; fill-opacity: .16; }
.ch-tile--plum .ch-chart-bar { fill: #FFF; fill-opacity: .22; }
.ch-tile--plum .ch-chart-bar.is-hi { fill: var(--chui-yellow); }
.ch-chart-lbl { fill: currentColor; font: 600 10px/1 var(--font); }
.ch-chart-empty { display: block; font-size: 12px; line-height: 1.4; color: var(--chui-ink-soft); }

/* 4. Segmented ring score (.ch-ring) ------------------------------------------ */
.ch-ring { display: grid; grid-template-columns: minmax(0, 260px) minmax(0, 1fr); gap: 20px 32px; align-items: center; min-width: 0; color: var(--chui-plum); }
.ch-ring--solo { grid-template-columns: minmax(0, 260px); justify-content: center; }
.ch-ring-fig { position: relative; width: 100%; max-width: 260px; aspect-ratio: 1; margin: 0 auto; }
.ch-ring-fig > svg { display: block; width: 100%; height: 100%; overflow: visible; }
.ch-ring-center { position: absolute; inset: 24%; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; pointer-events: none; }
.ch-ring-num { font: 800 clamp(44px, 6.4vw, 64px)/1 var(--font); letter-spacing: -.04em; color: var(--chui-plum-deep); }
.ch-ring-of { margin-top: 2px; font: 700 13px/1.2 var(--font); color: var(--chui-ink-soft); }
.ch-ring-cap { margin-top: 4px; font: 600 12.5px/1.3 var(--font); color: var(--chui-ink-soft); }
.ch-ring-track { fill: none; stroke-linecap: round; stroke-opacity: .3; }
.ch-ring-arc { fill: none; stroke-linecap: round; }
.ch-ring-nodata { fill: none; stroke: var(--chui-nodata); stroke-linecap: butt; stroke-dasharray: 5 7; }
.ch-ring-bub { fill: #FFF; stroke-width: 2; }
.ch-ring-bub.is-nodata { stroke: var(--chui-nodata); stroke-dasharray: 3 3; }
.ch-ring-legend { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.ch-ring-row { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; gap: 6px 12px; align-items: center; }
.ch-ring-dot { grid-row: 1 / span 2; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--seg, var(--chui-pink)); color: var(--chui-plum); }
.ch-ring-dot .ch-ic { width: 17px; height: 17px; }
.ch-ring-name { font: 700 14px/1.3 var(--font); min-width: 0; }
.ch-ring-val { grid-row: 1 / span 2; grid-column: 3; font: 800 18px/1 var(--font); white-space: nowrap; }
.ch-ring-val small { font-size: 12px; font-weight: 600; color: var(--chui-ink-soft); }
.ch-ring-bar { grid-column: 2; height: 9px; border-radius: var(--r-pill); background: rgba(91, 26, 66, .09); overflow: hidden; }
.ch-ring-bar > i { display: block; height: 100%; border-radius: inherit; background: var(--seg, var(--chui-pink)); }
.ch-ring-ev { grid-column: 2 / span 2; margin: -2px 0 0; font-size: 12.5px; line-height: 1.45; color: var(--chui-ink-soft); }
.ch-ring-row.is-nodata .ch-ring-dot { background: #FFF; border: 1.5px dashed var(--chui-nodata); color: var(--chui-ink-soft); }
.ch-ring-row.is-nodata .ch-ring-val { font-size: 13px; font-weight: 700; color: var(--chui-ink-soft); }
.ch-ring-row.is-nodata .ch-ring-bar { background: repeating-linear-gradient(90deg, rgba(91, 26, 66, .12) 0 6px, transparent 6px 11px); }
@media (max-width: 680px) { .ch-ring { grid-template-columns: minmax(0, 1fr); } .ch-ring-fig { max-width: 240px; } }

/* 5. Segmented pill toggle (.ch-pill-toggle) ----------------------------------- */
.ch-pill-toggle { display: inline-flex; gap: 4px; max-width: 100%; padding: 4px; border-radius: var(--r-pill); background: #FFF; border: 1.5px solid var(--chui-plum); overflow-x: auto; scrollbar-width: none; vertical-align: middle; }
.ch-pill-toggle::-webkit-scrollbar { display: none; }
.ch-pill-toggle > button { flex: none; min-height: 36px; padding: 0 18px; border: 0; border-radius: var(--r-pill); background: transparent; color: var(--chui-plum); font: 700 14px/1 var(--font); white-space: nowrap; cursor: pointer; transition: background-color .15s ease, color .15s ease; }
.ch-pill-toggle > button:hover { background: rgba(255, 201, 219, .55); }
.ch-pill-toggle > button[aria-checked="true"], .ch-pill-toggle > button[aria-pressed="true"] { background: var(--chui-plum-deep); color: #FFF6E6; }
.ch-pill-toggle > button:focus-visible { outline: 2px solid var(--chui-plum-deep); outline-offset: 2px; }
.ch-pill-toggle--soft { background: var(--chui-lavender-tint); border-color: transparent; }
.ch-pill-toggle--sm > button { min-height: 30px; padding: 0 13px; font-size: 13px; }
.ch-pill-toggle--block { display: flex; width: 100%; }
.ch-pill-toggle--block > button { flex: 1 1 0; }

/* 6. Huge numeral panel (.ch-bignum) -------------------------------------------- */
.ch-bignum { position: relative; display: flex; flex-direction: column; gap: 6px; min-width: 0; padding: 22px 24px 24px; border-radius: 26px; background: var(--chui-yellow); color: var(--chui-plum); overflow: hidden; }
.ch-bignum-cap { margin: 0; font: 700 14px/1.3 var(--font); }
.ch-bignum-num { margin: 0; font: 800 clamp(52px, 8vw, 104px)/.95 var(--font); letter-spacing: -.045em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ch-bignum-num small { margin: 0 .12em 0 .02em; font-size: .42em; letter-spacing: -.01em; }
.ch-bignum-sub { margin: 4px 0 0; font: 600 14px/1.45 var(--font); }
.ch-bignum--pink { background: var(--chui-pink-2); }
.ch-bignum--candy { background: var(--chui-pink); }
.ch-bignum--lavender { background: var(--chui-lavender); }
.ch-bignum--lime { background: var(--chui-lime); }
.ch-bignum--hot { background: var(--chui-hot); color: var(--chui-plum-deep); }
.ch-bignum--plum { background: var(--chui-plum-deep); color: #FFF6E6; }
.ch-bignum--plum .ch-bignum-cap, .ch-bignum--plum .ch-bignum-sub { color: #F3D6E3; }
@media (max-width: 480px) { .ch-bignum { padding: 18px 18px 20px; } .ch-bignum-num { font-size: clamp(46px, 15vw, 64px); } }

/* 7. Squircle action tiles (.ch-squircle) ---------------------------------------- */
.ch-squircles { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 12px; margin: 0; padding: 0; list-style: none; min-width: 0; }
.ch-squircles > li { display: flex; min-width: 0; }
@media (max-width: 760px) { .ch-squircles { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; } }
@media (max-width: 480px) { .ch-squircles { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.ch-squircle { flex: 1 1 auto; display: flex; flex-direction: column; justify-content: space-between; gap: 8px; min-width: 0; aspect-ratio: 1; padding: 14px; border: 0; border-radius: 24%; background: var(--chui-pink); color: var(--chui-plum-deep); font: 700 14px/1.2 var(--font); text-align: left; text-decoration: none; cursor: pointer; transition: transform .15s ease, box-shadow .15s ease; }
.ch-squircle:hover { transform: translateY(-2px); box-shadow: 0 6px 0 -2px rgba(58, 21, 48, .18); }
.ch-squircle:focus-visible { outline: 3px solid var(--chui-plum-deep); outline-offset: 3px; }
.ch-squircle-label { overflow-wrap: anywhere; }
.ch-squircle-ic { display: block; line-height: 0; }
.ch-squircle-ic .ch-ic { width: 34px; height: 34px; }
.ch-squircle--pink { background: var(--chui-pink); }
.ch-squircle--candy { background: var(--chui-pink-2); }
.ch-squircle--lavender { background: var(--chui-lavender); }
.ch-squircle--yellow { background: var(--chui-yellow); }
.ch-squircle--lime { background: var(--chui-lime); }
.ch-squircle--blue { background: var(--chui-blue); }
.ch-squircle--hot { background: var(--chui-hot); }
.ch-squircle--plum { background: var(--chui-plum-deep); color: #FFF6E6; }
@media (max-width: 480px) { .ch-squircle { padding: 11px; font-size: 12.5px; } .ch-squircle-ic .ch-ic { width: 27px; height: 27px; } }

/* 8. Stacked wallet cards (.ch-wallet) ------------------------------------------- */
.ch-wallet { --chui-peek: 14px; --chui-card-h: 116px; display: flex; flex-direction: column; min-width: 0; color: var(--chui-plum); }
.ch-wallet-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 0 12px; }
.ch-wallet-title { margin: 0; font: 800 18px/1.25 var(--font); color: var(--chui-plum); }
.ch-wallet-n { display: inline-grid; place-items: center; min-width: 26px; height: 26px; margin-left: 6px; padding: 0 8px; border-radius: var(--r-pill); background: var(--chui-plum-deep); color: #FFF6E6; font: 800 12px/1 var(--font); vertical-align: 2px; }
.ch-wallet-toggle { position: relative; flex: none; display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 14px; border-radius: var(--r-pill); border: 1.5px solid var(--chui-plum); background: #FFF; color: var(--chui-plum); font: 700 13px/1 var(--font); cursor: pointer; }
.ch-wallet-toggle input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.ch-wallet-toggle:has(input:focus-visible) { outline: 2px solid var(--chui-plum-deep); outline-offset: 2px; }
.ch-wallet-toggle .ch-wallet-when-open { display: none; }
.ch-wallet-cards { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column-reverse; }
.ch-wallet-cards > li { position: relative; z-index: calc(60 - var(--i, 0)); display: flex; min-width: 0; transition: margin .32s cubic-bezier(.2, .7, .2, 1); }
.ch-wallet-cards > li + li { margin-bottom: calc(var(--chui-peek) - var(--chui-card-h)); }
.ch-wallet-cards > li:nth-child(n+7) { display: none; }
.ch-wallet-card { flex: 1 1 auto; display: flex; flex-direction: column; gap: 4px; min-width: 0; height: var(--chui-card-h); padding: 14px 18px; border-radius: 22px; background: var(--chui-pink); color: var(--chui-plum); text-decoration: none; box-shadow: 0 -8px 18px -12px rgba(58, 21, 48, .45); overflow: hidden; }
.ch-wallet-card-top { display: flex; align-items: center; gap: 8px; font: 600 12px/1.3 var(--font); }
.ch-wallet-card-ic { flex: none; width: 26px; height: 26px; border-radius: 50%; background: rgba(255, 255, 255, .85); display: grid; place-items: center; }
.ch-wallet-card-ic .ch-ic { width: 14px; height: 14px; }
.ch-wallet-card-main { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; min-width: 0; margin-top: auto; }
.ch-wallet-card-title { min-width: 0; font: 800 18px/1.2 var(--font); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ch-wallet-card-value { flex: none; font: 800 18px/1.2 var(--font); font-variant-numeric: tabular-nums; }
.ch-wallet-card-sub { font-size: 12.5px; line-height: 1.35; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
a.ch-wallet-card:focus-visible { outline: 3px solid var(--chui-plum-deep); outline-offset: -5px; }
.ch-wallet-card--pink { background: var(--chui-pink); } .ch-wallet-card--candy { background: var(--chui-pink-2); }
.ch-wallet-card--yellow { background: var(--chui-yellow); } .ch-wallet-card--lavender { background: var(--chui-lavender); }
.ch-wallet-card--lime { background: var(--chui-lime); } .ch-wallet-card--blue { background: var(--chui-blue); }
.ch-wallet-card--hot { background: var(--chui-hot); color: var(--chui-plum-deep); }
.ch-wallet-card--plum { background: var(--chui-plum-deep); color: #FFF6E6; }
/* open: a list (ticked switch, or keyboard focus inside) */
.ch-wallet:has(.ch-wallet-toggle input:checked) .ch-wallet-when-open,
.ch-wallet:has(.ch-wallet-card:focus-visible) .ch-wallet-when-open { display: inline; }
.ch-wallet:has(.ch-wallet-toggle input:checked) .ch-wallet-when-closed,
.ch-wallet:has(.ch-wallet-card:focus-visible) .ch-wallet-when-closed { display: none; }
.ch-wallet:has(.ch-wallet-toggle input:checked) .ch-wallet-cards,
.ch-wallet:has(.ch-wallet-card:focus-visible) .ch-wallet-cards { flex-direction: column; }
.ch-wallet:has(.ch-wallet-toggle input:checked) .ch-wallet-cards > li,
.ch-wallet:has(.ch-wallet-card:focus-visible) .ch-wallet-cards > li { z-index: calc(var(--i, 0) + 1); margin-bottom: 0; }
.ch-wallet:has(.ch-wallet-toggle input:checked) .ch-wallet-cards > li + li,
.ch-wallet:has(.ch-wallet-card:focus-visible) .ch-wallet-cards > li + li { margin-top: -18px; }
.ch-wallet:has(.ch-wallet-toggle input:checked) .ch-wallet-cards > li:nth-child(n+7),
.ch-wallet:has(.ch-wallet-card:focus-visible) .ch-wallet-cards > li:nth-child(n+7) { display: flex; }
.ch-wallet:has(.ch-wallet-toggle input:checked) .ch-wallet-card,
.ch-wallet:has(.ch-wallet-card:focus-visible) .ch-wallet-card { height: auto; min-height: var(--chui-card-h); padding: 18px 18px 28px; }

/* 9. Week grid + mini month (.ch-week, .ch-mini) ---------------------------------- */
.ch-week { display: grid; grid-template-columns: 252px minmax(0, 1fr); gap: 14px; align-items: start; min-width: 0; padding: 14px; border-radius: 28px; background: var(--chui-lavender-tint); color: var(--chui-plum); }
.ch-week--nomini { grid-template-columns: minmax(0, 1fr); }
.ch-week-grid { min-width: 0; padding: 12px 12px 14px; border-radius: 22px; background: #FFF; }
.ch-week-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; padding: 2px 4px 12px; }
.ch-week-range { margin: 0; font: 800 16px/1.25 var(--font); color: var(--chui-plum); }
.ch-week-cols { display: grid; grid-template-columns: repeat(var(--chui-days, 7), minmax(0, 1fr)); min-width: 0; }
.ch-week--timed .ch-week-cols { grid-template-columns: 52px repeat(var(--chui-days, 7), minmax(0, 1fr)); }
.ch-week-col { display: flex; flex-direction: column; min-width: 0; border-left: 1px solid rgba(91, 26, 66, .09); }
.ch-week-col:first-child { border-left: 0; }
.ch-week-col.is-today { background: rgba(199, 182, 245, .2); border-radius: 14px; }
.ch-week-dh { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 6px 2px 10px; text-align: center; }
.ch-week-dname { font: 700 11px/1 var(--font); letter-spacing: .06em; text-transform: uppercase; color: var(--chui-ink-soft); }
.ch-week-dnum { display: inline-grid; place-items: center; min-width: 34px; height: 30px; padding: 0 8px; border-radius: var(--r-pill); font: 800 18px/1 var(--font); color: var(--chui-plum); font-variant-numeric: tabular-nums; }
.ch-week-col.is-today .ch-week-dnum { background: var(--chui-plum-deep); color: #FFF6E6; }
.ch-week-allday { display: flex; flex-direction: column; gap: 4px; min-height: var(--chui-allday-h, 0); padding: 0 3px 6px; }
.ch-week-allday .ch-week-ev { min-height: 34px; }
.ch-week-allday .ch-week-ev-title { display: block; white-space: nowrap; text-overflow: ellipsis; }
.ch-week-day { position: relative; display: flex; flex-direction: column; gap: 6px; min-width: 0; min-height: 200px; padding: 4px; }
.ch-week--timed .ch-week-day { display: block; height: var(--chui-day-h, 480px); min-height: 0; padding: 0; background-image: linear-gradient(rgba(91, 26, 66, .08) 1px, transparent 1px); background-size: 100% var(--chui-hour-h, 44px); }
.ch-week-times { position: relative; border-left: 0; }
.ch-week-times .ch-week-day { background-image: none; }
.ch-week-tlabel { position: absolute; left: 0; right: 6px; margin-top: 4px; font: 600 10.5px/1 var(--font); color: var(--chui-ink-soft); text-align: right; white-space: nowrap; }
.ch-week-ev { position: relative; display: flex; flex-direction: column; gap: 2px; min-width: 0; padding: 5px 8px 6px; border-radius: 12px; background: var(--chui-lime); color: var(--chui-plum-deep); font: 700 12px/1.3 var(--font); text-decoration: none; overflow: hidden; }
.ch-week-ev > * { flex: none; min-width: 0; }
.ch-week--timed .ch-week-day .ch-week-ev { position: absolute; left: 3px; right: 3px; z-index: 1; }
.ch-week--timed .ch-week-day .ch-week-ev:hover, .ch-week--timed .ch-week-day .ch-week-ev:focus-visible { z-index: 3; }
a.ch-week-ev:hover { box-shadow: inset 0 0 0 2px var(--chui-plum-deep); }
a.ch-week-ev:focus-visible { outline: 3px solid var(--chui-plum-deep); outline-offset: 1px; z-index: 2; }
.ch-week-ev-time { font: 600 11px/1.25 var(--font); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ch-week-ev-title { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.ch-week-ev-st { align-self: flex-start; margin-top: 2px; padding: 1px 7px; border-radius: var(--r-pill); background: rgba(255, 255, 255, .78); font: 700 10.5px/1.45 var(--font); white-space: nowrap; }
.ch-week-ev--lime { background: var(--chui-lime); } .ch-week-ev--lavender { background: var(--chui-lavender); }
.ch-week-ev--pink { background: var(--chui-pink); } .ch-week-ev--candy { background: var(--chui-pink-2); }
.ch-week-ev--yellow { background: var(--chui-yellow); } .ch-week-ev--blue { background: var(--chui-blue); }
.ch-week-ev--hot { background: var(--chui-hot); }
.ch-week-ev--plum { background: var(--chui-plum-deep); color: #FFF6E6; }
.ch-week-ev--plum .ch-week-ev-st { color: var(--chui-plum-deep); }
.ch-week-ev.is-faded { opacity: .55; }
.ch-week-none { display: none; margin: 0; font-size: 13px; color: var(--chui-ink-soft); }
.ch-mini { min-width: 0; padding: 14px 12px 12px; border-radius: 22px; background: var(--chui-lavender); color: var(--chui-plum); }
.ch-mini-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 0 4px 8px; font: 800 15px/1.2 var(--font); }
.ch-mini table { width: 100%; border-collapse: separate; border-spacing: 0 2px; table-layout: fixed; }
.ch-mini th { padding: 2px 0 6px; font: 700 10.5px/1 var(--font); letter-spacing: .04em; text-transform: uppercase; color: var(--chui-plum); text-align: center; }
.ch-mini td { padding: 1px 0; text-align: center; }
.ch-mini tr.is-week td { background: rgba(255, 255, 255, .5); }
.ch-mini tr.is-week td:first-child { border-radius: 999px 0 0 999px; }
.ch-mini tr.is-week td:last-child { border-radius: 0 999px 999px 0; }
.ch-mini-d { position: relative; display: inline-grid; place-items: center; width: 28px; height: 28px; border: 0; border-radius: 50%; background: transparent; color: var(--chui-plum); font: 600 12.5px/1 var(--font); font-variant-numeric: tabular-nums; padding: 0; }
button.ch-mini-d { cursor: pointer; }
button.ch-mini-d:hover { background: rgba(255, 255, 255, .7); }
button.ch-mini-d:focus-visible { outline: 2px solid var(--chui-plum-deep); outline-offset: 1px; }
.ch-mini-d.is-today { background: var(--chui-lime); font-weight: 800; }
.ch-mini-d.has-ev::after { content: ''; position: absolute; left: 50%; bottom: 2px; width: 4px; height: 4px; margin-left: -2px; border-radius: 50%; background: var(--chui-plum-deep); }
@media (max-width: 900px) { .ch-week { grid-template-columns: minmax(0, 1fr); } .ch-mini { max-width: 360px; } }
@media (max-width: 640px) {
  .ch-week { padding: 10px; border-radius: 22px; }
  .ch-week-cols, .ch-week--timed .ch-week-cols { display: flex; flex-direction: column; gap: 6px; }
  .ch-week-times { display: none; }
  .ch-week-col { display: grid; grid-template-columns: 54px minmax(0, 1fr); align-items: start; gap: 8px; padding: 6px 4px; border-left: 0; border-top: 1px solid rgba(91, 26, 66, .09); }
  .ch-week-col:first-child { border-top: 0; }
  .ch-week-col.is-today { border-radius: 14px; }
  .ch-week-dh { padding: 2px 0; }
  .ch-week-allday { grid-column: 2; min-height: 0; padding: 0; }
  .ch-week-allday:empty { display: none; }
  .ch-week-day, .ch-week--timed .ch-week-day { grid-column: 2; height: auto; min-height: 0; padding: 0; background: none; display: flex; flex-direction: column; gap: 6px; }
  .ch-week--timed .ch-week-day .ch-week-ev { position: static; min-height: 0 !important; }
  .ch-week-ev { left: auto !important; width: auto !important; }
  .ch-week-none { display: block; padding: 6px 0; }
  .ch-week-col.ch-week-times { display: none; }
}

/* 10. Assistant nudge card (.ch-assist) + its Ask CrossHub dialog ----------------- */
.ch-assist { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 8px; min-width: 0; padding: 18px 20px 20px; border-radius: 24px; background: var(--chui-pink); color: var(--chui-plum); overflow: hidden; isolation: isolate; }
.ch-assist::after { content: ''; position: absolute; z-index: -1; right: -28px; bottom: -40px; width: 160px; height: 140px; border-radius: 58% 58% 48% 48% / 66% 66% 40% 40%; background: var(--chui-pink-2); opacity: .45; transform: rotate(-14deg); pointer-events: none; }
.ch-assist-eyebrow { margin: 0; font: 700 12px/1.3 var(--font); color: var(--chui-plum); }
.ch-assist-title { margin: 0; max-width: 46ch; font: 800 18px/1.3 var(--font); color: var(--chui-plum); overflow-wrap: anywhere; }
.ch-assist-title em { font-style: normal; color: var(--chui-bad); }
.ch-assist-ev { margin: 0; max-width: 60ch; font-size: 13.5px; line-height: 1.45; color: var(--chui-plum); }
.ch-assist-go { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; margin-top: 6px; padding: 0 18px; border: 0; border-radius: var(--r-pill); background: var(--chui-plum-deep); color: #FFF6E6; font: 700 14px/1 var(--font); text-decoration: none; cursor: pointer; }
.ch-assist-go:hover { background: var(--chui-plum); }
.ch-assist-go:focus-visible { outline: 2px solid var(--chui-plum-deep); outline-offset: 3px; }
.ch-askdlg { width: min(660px, calc(100vw - 24px)); max-height: calc(100vh - 40px); padding: 0; border: 0; border-radius: 24px; background: var(--chui-cream); color: var(--chui-plum); box-shadow: 0 24px 60px rgba(58, 21, 48, .3); }
.ch-askdlg::backdrop { background: rgba(58, 21, 48, .45); }
.ch-askdlg-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 16px 4px 20px; }
.ch-askdlg-title { margin: 0; font: 800 18px/1.25 var(--font); }
.ch-askdlg-x { width: 40px; height: 40px; display: grid; place-items: center; border: 0; border-radius: 12px; background: transparent; color: var(--chui-plum); cursor: pointer; }
.ch-askdlg-x:hover { background: rgba(91, 26, 66, .08); }
.ch-askdlg-x:focus-visible { outline: 2px solid var(--chui-plum-deep); outline-offset: 1px; }
.ch-askdlg-body { padding: 6px 20px 20px; overflow: auto; max-height: calc(100vh - 120px); }

/* 11. Mascot + calm empty state (.ch-mascot, .ch-calm) ----------------------------- */
.ch-mascot { display: inline-block; width: var(--chui-mascot, 72px); height: auto; vertical-align: middle; flex: none; }
.ch-calm { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 32px 20px; text-align: center; border-radius: 24px; background: #FFF; border: 1.5px dashed rgba(91, 26, 66, .22); color: var(--chui-plum); }
.ch-calm-title { margin: 6px 0 0; font: 800 17px/1.3 var(--font); }
.ch-calm-body { margin: 0; max-width: 44ch; font-size: 14px; line-height: 1.55; color: var(--chui-ink-soft); }
.ch-calm-action { margin-top: 8px; }

/* motion + [hidden] guard for the kit ------------------------------------------------ */
@media (prefers-reduced-motion: reduce) {
  .ch-index-cell, .ch-index-go [aria-hidden], .ch-tile, .ch-pill-toggle > button, .ch-squircle, .ch-wallet-cards > li { transition: none !important; }
  .ch-squircle:hover, .ch-index-cell:hover .ch-index-go [aria-hidden] { transform: none !important; }
}
.ch-index[hidden], .ch-index-item[hidden], .ch-greet[hidden], .ch-tiles[hidden], .ch-tile[hidden], .ch-ring[hidden],
.ch-pill-toggle[hidden], .ch-bignum[hidden], .ch-squircles[hidden], .ch-squircle[hidden], .ch-wallet[hidden],
.ch-week[hidden], .ch-mini[hidden], .ch-assist[hidden], .ch-calm[hidden] { display: none; }

/* 12. Release 8 design review: small polish shared by every kit page --------------------- */
/* the greeting keeps the last word of the name, the avatar and the comma on one line */
.ch-greet-keep { white-space: nowrap; }
/* this font's fixed-width digits leave wide gaps in "₹1.5L", "0.0" and "1d 17h", so the kit's numbers use the normal ones */
.ch-greet-chip b, .ch-wallet-card-value, .ch-tile-delta, .ch-bignum-num, .ch-ring-val { font-variant-numeric: normal; }
/* a long filter row (Make and Studio stages): a calm wrap of chips on wide screens, never a two-line boxed pill */
.ch-pill-toggle--wrap { flex-wrap: wrap; gap: 6px; padding: 0; border: 0; border-radius: 0; background: transparent; overflow: visible; }
.ch-pill-toggle--wrap > button { background: #FFF; box-shadow: inset 0 0 0 1px var(--chui-line); }
.ch-pill-toggle--wrap > button:hover { background: var(--chui-pink-tint); box-shadow: inset 0 0 0 1px var(--chui-plum); }
.ch-pill-toggle--wrap > button[aria-checked="true"], .ch-pill-toggle--wrap > button[aria-pressed="true"] { background: var(--chui-plum-deep); color: #FFF6E6; box-shadow: none; }
@media (max-width: 700px) { .ch-pill-toggle--wrap { flex-wrap: nowrap; overflow-x: auto; padding: 4px 2px; } }
/* phones: every kit control is at least 44 px to tap (the look stays the same; the tap area grows) */
@media (max-width: 760px) {
  .ch-pill-toggle > button { position: relative; min-height: 40px; }
  .ch-pill-toggle--sm > button { min-height: 36px; }
  .ch-pill-toggle > button::after { content: ''; position: absolute; left: -2px; right: -2px; top: -4px; bottom: -4px; }
  .ch-greet-chip { position: relative; }
  .ch-greet-chip::after { content: ''; position: absolute; left: 0; right: 0; top: -4px; bottom: -4px; }
  .ch-wallet-toggle, .ch-assist-go, .ch-askdlg-x { min-height: 44px; }
  .ch-askdlg-x { width: 44px; }
  .ch-mini-d { width: 36px; height: 36px; font-size: 13.5px; }
  button.ch-mini-d::before { content: ''; position: absolute; inset: -4px; }
  /* the design system's small controls, on the Release 8 pages and everywhere else: 44 px on a phone */
  .ch-btn--sm, .ch-tab, .ch-seg-btn, .ch-toggle, .ch-select, select.ch-input, input.ch-input:not([type=checkbox]):not([type=radio]) { min-height: 44px; }
  .ch-iconbtn { min-width: 44px; min-height: 44px; }
}
