/* ============================================================================
   CARD_CMS — Karachi Metropolitan Corporation
   Global design system.

   Architecture
   ------------
   1. TOKENS      one palette, declared once. Light is the default theme;
                  `html.dark` re-declares the same names, so every rule below
                  is written once and works in both.
   2. PRIMITIVES  surfaces, navigation, buttons, forms, tables, badges, footer.
   3. THEME MAP   the page templates were authored against a dark palette and
                  carry utility classes such as `text-white` / `bg-white/[.04]`.
                  Rather than rewrite ~60 templates by hand (and drift apart
                  over time), those utilities are re-pointed at the tokens
                  above. Doubling the class name (`.text-white.text-white`)
                  lifts specificity over the utility framework regardless of
                  stylesheet order.
   4. ID CARD     the KMC card design is deliberately untouched — only the
                  physical print geometry and the QR / barcode metrics below.
   5. PRINT       true PVC CR80 output: 85.60 x 53.98 mm, front + back on one
                  sheet.
   ========================================================================== */

/* ==========================================================================
   1. TOKENS
   ========================================================================== */
:root{
  /* surfaces */
  --canvas:        #f4f6fb;
  --surface:       #ffffff;
  --surface-2:     #f8fafc;
  --surface-3:     #f1f4f9;
  --surface-sunk:  #eef2f8;
  --surface-inv:   #0d1526;
  --surface-glass: rgba(255,255,255,.82);

  /* hairlines */
  --line:          #e5eaf3;
  --line-soft:     #eef1f7;
  --line-strong:   #d5dded;

  /* ink */
  --ink:           #0d1526;
  --ink-2:         #1e293b;
  --ink-3:         #334155;
  /* both clear AA (4.5:1) on white AND on --surface-3, which is where most
     secondary text actually lands */
  --ink-muted:     #5c6a7d;
  --ink-faint:     #66748a;
  --ink-on-brand:  #ffffff;

  /* brand */
  --brand:         #6366f1;
  --brand-600:     #4f46e5;
  --brand-700:     #4338ca;
  --brand-tint:    #eef0fe;
  --brand-tint-2:  #e0e3fd;
  --violet:        #7c3aed;

  /* KMC identity — `--kmc-ink` is the shade that clears AA on white for the
     small tracked-out wordmark; `--kmc-light` stays for fills, not for text. */
  --kmc:           #2c5c27;
  --kmc-ink:       #34691f;
  --kmc-light:     #4f8f3c;

  /* semantic */
  --ok:            #059669;
  --ok-tint:       #e7f7ef;
  --warn:          #b45309;
  --warn-tint:     #fdf3e3;
  --danger:        #e11d48;
  --danger-tint:   #fdeaee;
  --info:          #2563eb;
  --info-tint:     #e8f0fe;

  /* elevation — layered and low-alpha so surfaces read as paper, not plastic */
  --sh-xs: 0 1px 2px rgba(16,24,40,.05);
  --sh-sm: 0 1px 2px rgba(16,24,40,.05), 0 1px 3px rgba(16,24,40,.05);
  --sh-md: 0 1px 2px rgba(16,24,40,.04), 0 8px 20px -10px rgba(16,24,40,.14);
  --sh-lg: 0 2px 4px rgba(16,24,40,.04), 0 18px 38px -16px rgba(16,24,40,.20);
  --sh-xl: 0 4px 8px rgba(16,24,40,.04), 0 32px 64px -28px rgba(16,24,40,.28);
  --sh-brand: 0 8px 22px -10px rgba(99,102,241,.55);

  /* motion — one curve for the whole product */
  --ease: cubic-bezier(.22,.72,.24,1);
  --ease-out: cubic-bezier(.16,1,.3,1);
  --dur: .22s;

  --radius: 14px;
  --radius-lg: 18px;

  --sidebar-w: 264px;
  --topbar-h: 68px;

  color-scheme: light;
}

html.dark{
  --canvas:        #070a12;
  --surface:       #101827;
  --surface-2:     #0d1424;
  --surface-3:     #16203a;
  --surface-sunk:  #0a0f1c;
  --surface-inv:   #f8fafc;
  --surface-glass: rgba(10,14,26,.78);

  --line:          rgba(255,255,255,.09);
  --line-soft:     rgba(255,255,255,.06);
  --line-strong:   rgba(255,255,255,.16);

  --ink:           #f8fafc;
  --ink-2:         #e2e8f0;
  --ink-3:         #cbd5e1;
  --ink-muted:     #94a3b8;
  --ink-faint:     #64748b;

  --brand-tint:    rgba(99,102,241,.16);
  --brand-tint-2:  rgba(99,102,241,.26);
  --kmc-ink:       #6ee7a8;

  --ok:            #34d399;  --ok-tint:     rgba(16,185,129,.14);
  --warn:          #fbbf24;  --warn-tint:   rgba(245,158,11,.14);
  --danger:        #fb7185;  --danger-tint: rgba(244,63,94,.14);
  --info:          #60a5fa;  --info-tint:   rgba(59,130,246,.14);

  --sh-xs: 0 1px 2px rgba(0,0,0,.4);
  --sh-sm: 0 1px 3px rgba(0,0,0,.45);
  --sh-md: 0 10px 24px -12px rgba(0,0,0,.7);
  --sh-lg: 0 20px 44px -20px rgba(0,0,0,.8);
  --sh-xl: 0 34px 70px -30px rgba(0,0,0,.9);

  color-scheme: dark;
}

/* ==========================================================================
   2. BASE
   ========================================================================== */
*{ -webkit-tap-highlight-color: transparent; }
html{ scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body{
  font-family:'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  color: var(--ink-3);
  background: var(--canvas);
  font-feature-settings:'cv02','cv03','cv04','ss01';
  letter-spacing:-.005em;
}
h1,h2,h3,h4,h5{ color: var(--ink); letter-spacing:-.021em; }
h1{ letter-spacing:-.028em; }
b,strong{ color: var(--ink-2); }
hr{ border-color: var(--line); }
::selection{ background: var(--brand-tint-2); color: var(--ink); }

/* numerals line up in every stat, table and money column */
.tabular-nums, table td, table th, .font-mono,
[class*="text-2xl"], [class*="text-3xl"], [class*="font-black"]{
  font-variant-numeric: tabular-nums;
}

/* keyboard users get a visible, on-brand focus ring everywhere */
a:focus-visible, button:focus-visible, input:focus-visible,
select:focus-visible, textarea:focus-visible, [tabindex]:focus-visible{
  outline: 2px solid var(--brand);
  outline-offset: 2px;
  border-radius: 8px;
}

@media (prefers-reduced-motion: reduce){
  *,*::before,*::after{
    animation-duration:.01ms !important; animation-iteration-count:1 !important;
    transition-duration:.01ms !important; scroll-behavior:auto !important;
  }
}

/* Scrollbar */
::-webkit-scrollbar{ width:10px; height:10px; }
::-webkit-scrollbar-track{ background: transparent; }
::-webkit-scrollbar-thumb{ background: var(--line-strong); border-radius:8px;
  border:2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover{ background: var(--ink-faint); background-clip: padding-box; }

/* ==========================================================================
   3. APP CANVAS
   ========================================================================== */
.app-bg{
  background:
    radial-gradient(1100px 560px at 88% -14%, rgba(99,102,241,.10), transparent 62%),
    radial-gradient(820px 460px at -8% 6%,  rgba(16,185,129,.07), transparent 58%),
    radial-gradient(680px 420px at 40% 108%, rgba(124,58,237,.06), transparent 60%),
    linear-gradient(180deg, #f7f8fd 0%, var(--canvas) 100%);
  background-attachment: fixed;
  min-height:100vh;
}
html.dark .app-bg{
  background:
    radial-gradient(1200px 600px at 80% -10%, rgba(99,102,241,.12), transparent 55%),
    radial-gradient(900px 500px at -5% 20%, rgba(139,92,246,.09), transparent 50%),
    linear-gradient(180deg,#070a12 0%,#080c16 100%);
}

/* ==========================================================================
   4. SURFACES
   ========================================================================== */
.panel{
  background: var(--surface);
  border:1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--sh-sm);
  backdrop-filter:none;
}
.panel-hover{
  transition: transform var(--dur) var(--ease),
              border-color var(--dur) var(--ease),
              box-shadow var(--dur) var(--ease);
  will-change: transform;
}
.panel-hover:hover{
  transform: translateY(-3px);
  border-color: var(--line-strong);
  box-shadow: var(--sh-lg);
}
.panel-hover:active{ transform: translateY(-1px); }

/* ---- App shell -----------------------------------------------------------
   One attribute drives the sidebar everywhere: html[data-sidebar="open|closed"].
   Under lg it is an off-canvas drawer with a scrim; from lg up it is in the
   flow and closing slides it out so the content reclaims the width. The state
   is set before first paint (see base.html) so nothing jumps on load. */
.app-sidebar{
  background: var(--surface);
  border-right:1px solid var(--line);
  box-shadow: var(--sh-xs);
  width: var(--sidebar-w);
  transition: transform .3s var(--ease), margin-left .3s var(--ease);
}

/* Phones + tablets: a drawer that starts BELOW the header, so the one toggle
   in the header stays visible and tappable in both states — press to open,
   press the same spot to close. */
#sidebar{
  position: fixed;
  top: var(--topbar-h); left: 0; bottom: 0;
  z-index: 35;
  height: auto;
}
html[data-sidebar="closed"] #sidebar{ transform: translateX(-100%); }
html[data-sidebar="open"]   #sidebar{ transform: none; box-shadow: var(--sh-xl); }
/* the brand row is the header's job on mobile — no need to repeat it */
#sidebar > .sidebar-brand{ display: none; }

#backdrop{ display: none; top: var(--topbar-h); }
html[data-sidebar="open"] #backdrop{ display: block; }

@media (min-width: 1024px){
  /* back into the flow. The inset values above must be cleared: a sticky box
     with left:0 would snap back over the content instead of sliding away. */
  #sidebar{
    position: sticky;
    top: 0; left: auto; right: auto; bottom: auto;
    height: 100vh;
    z-index: 10;
    transform: none !important;
    box-shadow: var(--sh-xs);
  }
  #sidebar > .sidebar-brand{ display: flex; }
  html[data-sidebar="closed"] #sidebar{ margin-left: calc(var(--sidebar-w) * -1); }
  html[data-sidebar="open"]  #sidebar{ margin-left: 0; }
  #backdrop{ display: none !important; }
  #appRoot{ overflow-x: clip; }   /* the slid-out rail must not create scroll */
}

/* the toggle itself */
.sidebar-toggle{ position: relative; }
.sidebar-toggle:hover{ background: var(--surface-3); color: var(--ink); }
.sidebar-toggle:active{ transform: scale(.94); }
.app-topbar{
  background: var(--surface-glass);
  border-bottom:1px solid var(--line);
  backdrop-filter: saturate(1.6) blur(14px);
  -webkit-backdrop-filter: saturate(1.6) blur(14px);
}
.app-shell{ display:flex; flex-direction:column; min-height:100vh; min-height:100dvh; }

/* Brand seal — dark green on light, so it needs no filtering here */
.kmc-brand-logo{
  width:100%; height:100%; object-fit:contain;
  image-rendering:-webkit-optimize-contrast;
  filter: drop-shadow(0 1px 2px rgba(16,24,40,.16));
}
html.dark .kmc-brand-logo{
  filter: brightness(2.35) saturate(1.5) contrast(1.05) drop-shadow(0 1px 2px rgba(0,0,0,.6));
}
.kmc-brand-ring{
  border:2px solid rgba(44,92,39,.22);
  background: radial-gradient(circle at 50% 38%, #ffffff, #f2f7f1);
  box-shadow: 0 1px 2px rgba(16,24,40,.05), 0 10px 24px -14px rgba(44,92,39,.55);
}
html.dark .kmc-brand-ring{
  border:2.5px solid rgba(52,211,153,.7);
  background: radial-gradient(circle at 50% 42%, rgba(20,30,48,.85), rgba(3,7,14,.9));
  box-shadow:0 0 0 1.5px rgba(255,255,255,.14) inset, 0 0 0 1px rgba(16,185,129,.35),
             0 10px 28px -10px rgba(16,185,129,.5);
}

/* ==========================================================================
   5. NAVIGATION
   ========================================================================== */
.nav-scroll-fade{
  position:absolute; left:0; right:0; bottom:100%; height:26px;
  pointer-events:none;
  background:linear-gradient(180deg, transparent, var(--surface));
}

.nav-link{
  position:relative;
  color: var(--ink-muted);
  transition: background-color .18s var(--ease), color .18s var(--ease),
              transform .18s var(--ease);
}
.nav-link:hover{
  background: var(--surface-3);
  color: var(--ink);
}
/* a hairline marker slides in on hover — quieter than a full highlight */
.nav-link::before{
  content:''; position:absolute; left:0; top:50%;
  width:3px; height:0; border-radius:0 3px 3px 0;
  background: var(--brand);
  transform: translateY(-50%);
  transition: height .22s var(--ease-out);
}
.nav-link:hover::before{ height:52%; }

.nav-active{
  background: linear-gradient(100deg, var(--brand) 0%, var(--violet) 130%);
  color:#fff;
  box-shadow: var(--sh-brand);
}
.nav-active::before{ display:none; }
.nav-active:hover{
  background: linear-gradient(100deg, var(--brand) 0%, var(--violet) 130%);
  color:#fff;
  transform: translateY(-1px);
}
.nav-link i{ transition: transform .22s var(--ease-out); }
.nav-link:hover i{ transform: scale(1.08); }

/* ==========================================================================
   6. STAT TILES
   ========================================================================== */
.tile-purple,.tile-blue,.tile-green,.tile-orange,.tile-pink,.tile-cyan{
  position:relative; overflow:hidden;
  background: var(--surface);
  border:1px solid var(--line);
  box-shadow: var(--sh-sm);
}
/* the colour lives in a soft wash + a 3px top rule, not a flat fill */
.tile-purple::after,.tile-blue::after,.tile-green::after,
.tile-orange::after,.tile-pink::after,.tile-cyan::after{
  content:''; position:absolute; inset:0; pointer-events:none;
  background: radial-gradient(120% 90% at 100% 0%, var(--tile-wash), transparent 62%);
}
.tile-purple::before,.tile-blue::before,.tile-green::before,
.tile-orange::before,.tile-pink::before,.tile-cyan::before{
  content:''; position:absolute; top:0; left:0; right:0; height:3px;
  background: linear-gradient(90deg, var(--tile-rule), transparent 92%);
}
.tile-purple{ --tile-wash: rgba(139,92,246,.13); --tile-rule:#8b5cf6; }
.tile-blue  { --tile-wash: rgba(59,130,246,.13); --tile-rule:#3b82f6; }
.tile-green { --tile-wash: rgba(16,185,129,.14); --tile-rule:#10b981; }
.tile-orange{ --tile-wash: rgba(249,115,22,.13); --tile-rule:#f97316; }
.tile-pink  { --tile-wash: rgba(236,72,153,.13); --tile-rule:#ec4899; }
.tile-cyan  { --tile-wash: rgba(6,182,212,.13);  --tile-rule:#06b6d4; }
.tile-purple > *,.tile-blue > *,.tile-green > *,
.tile-orange > *,.tile-pink > *,.tile-cyan > *{ position:relative; z-index:1; }

/* ==========================================================================
   7. BUTTONS & INTERACTIVE POLISH
   ========================================================================== */
button, a, [role="button"]{ transition:
  background-color .18s var(--ease), border-color .18s var(--ease),
  color .18s var(--ease), box-shadow .22s var(--ease),
  transform .18s var(--ease), opacity .18s var(--ease); }

/* Any gradient / solid accent button gets the same lift + sheen */
[class*="bg-gradient-to"]:is(button,a),
.bg-indigo-600:is(button,a), .bg-emerald-600:is(button,a),
.bg-emerald-500:is(button,a), .bg-rose-500:is(button,a){
  position:relative; overflow:hidden;
  box-shadow: var(--sh-sm);
}
[class*="bg-gradient-to"]:is(button,a):hover,
.bg-indigo-600:is(button,a):hover, .bg-emerald-600:is(button,a):hover,
.bg-emerald-500:is(button,a):hover, .bg-rose-500:is(button,a):hover{
  transform: translateY(-1.5px);
  box-shadow: var(--sh-md);
}
[class*="bg-gradient-to"]:is(button,a):active,
.bg-indigo-600:is(button,a):active, .bg-emerald-600:is(button,a):active{
  transform: translateY(0); box-shadow: var(--sh-xs);
}
/* light sweeps across the face on hover */
[class*="bg-gradient-to"]:is(button,a)::after{
  content:''; position:absolute; inset:0; pointer-events:none;
  background: linear-gradient(105deg, transparent 20%, rgba(255,255,255,.28) 45%, transparent 70%);
  transform: translateX(-130%);
  transition: transform .6s var(--ease-out);
}
[class*="bg-gradient-to"]:is(button,a):hover::after{ transform: translateX(130%); }

button:disabled, .disabled\:opacity-40:disabled{ transform:none !important; box-shadow:none !important; }

.shadow-glow{ box-shadow: var(--sh-brand); }

/* Locked action — stands in for a Print / Export control the user may not use.
   Reads as unavailable but stays clickable, so tapping it explains why. */
.locked-action{
  background: var(--surface-3);
  border:1px solid var(--line);
  color: var(--ink-faint);
  cursor: not-allowed;
  box-shadow:none;
}
.locked-action:hover{
  background: var(--surface-sunk);
  border-color: var(--line-strong);
  color: var(--ink-muted);
  transform:none;
}
.locked-action i{ opacity:.8; }
.locked-action--solid{ padding-top:.625rem; padding-bottom:.625rem; }

/* Quiet (panel) buttons lift too, just less */
.panel:is(button,a):hover{ transform: translateY(-1.5px); box-shadow: var(--sh-md); }

/* ==========================================================================
   8. FORM CONTROLS
   ========================================================================== */
input, select, textarea{
  transition: border-color .18s var(--ease), box-shadow .18s var(--ease),
              background-color .18s var(--ease);
}
input::placeholder, textarea::placeholder{ color: var(--ink-faint); }

select{ color-scheme: light; }
html.dark select{ color-scheme: dark; }
select option{ background: var(--surface); color: var(--ink-2); }

input[type="checkbox"], input[type="radio"]{ accent-color: var(--brand); }

/* Toggle switch */
.switch{
  width:44px; height:24px; border-radius:999px;
  background: var(--line-strong); position:relative;
  transition: background-color .25s var(--ease);
  box-shadow: inset 0 1px 2px rgba(16,24,40,.10);
}
.switch::after{
  content:''; position:absolute; top:3px; left:3px; width:18px; height:18px;
  border-radius:50%; background:#fff;
  box-shadow: 0 1px 3px rgba(16,24,40,.25);
  transition: transform .25s var(--ease-out);
}
.peer:checked ~ .switch{ background: linear-gradient(90deg, var(--brand), var(--violet)); }
.peer:checked ~ .switch::after{ transform: translateX(20px); }
.peer:focus-visible ~ .switch{ outline:2px solid var(--brand); outline-offset:2px; }

/* ==========================================================================
   9. TABLES
   ========================================================================== */
table thead th{
  color: var(--ink-muted);
  border-bottom:1px solid var(--line);
  background: var(--surface-2);
  font-weight:600;
}
table thead th a{ color:inherit; }
table thead th a:hover{ color: var(--ink); }
table tbody tr{ transition: background-color .16s var(--ease); }

/* ==========================================================================
   10. FOOTER  (present on every page)
   ========================================================================== */
.site-footer{
  margin-top:auto;
  border-top:1px solid var(--line);
  background: var(--surface-glass);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.site-footer-inner{
  max-width:1600px; margin:0 auto;
  padding:18px 16px;
  display:flex; flex-wrap:wrap; align-items:center; justify-content:center;
  gap:6px 10px;
  font-size:12.5px; line-height:1.5; text-align:center;
  color: var(--ink-muted);
}
@media (min-width:640px){ .site-footer-inner{ padding:18px 24px; } }
.site-footer-sep{ color: var(--line-strong); user-select:none; }
.site-footer b{ color: var(--ink-2); font-weight:600; }
.site-footer a{ color: var(--ink-2); font-weight:600; text-decoration:none;
  border-bottom:1px solid transparent; }
.site-footer a:hover{ color: var(--brand-600); border-bottom-color: var(--brand-tint-2); }
/* standalone (non-shell) pages centre their own footer */
.site-footer--plain{ background:transparent; border-top:0; }

/* ==========================================================================
   11. ROW ACTION MENUS  (viewport-aware — see base.html `CMSMenu`)
   ========================================================================== */
[data-rowmenu]{
  background: var(--surface);
  border:1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--sh-xl);
  transform-origin: top right;
  animation: menuIn .16s var(--ease-out) both;
  max-height: min(70vh, 460px);
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}
[data-rowmenu].is-fixed{ position: fixed !important; margin:0 !important; }
[data-rowmenu][data-placement="top"]{ transform-origin: bottom right; }
@keyframes menuIn{ from{ opacity:0; transform: translateY(-6px) scale(.97); } to{ opacity:1; transform:none; } }
[data-rowmenu][data-placement="top"]{ animation-name: menuInUp; }
@keyframes menuInUp{ from{ opacity:0; transform: translateY(6px) scale(.97); } to{ opacity:1; transform:none; } }

/* On phones the menu becomes a bottom sheet — it can never leave the screen */
@media (max-width: 639px){
  [data-rowmenu].is-sheet{
    position: fixed !important;
    left: 12px !important; right: 12px !important;
    bottom: max(12px, env(safe-area-inset-bottom)) !important;
    top: auto !important;
    width: auto !important;
    max-height: 72vh;
    border-radius: 20px;
    box-shadow: 0 -8px 40px -12px rgba(16,24,40,.35), var(--sh-xl);
    animation: sheetIn .24s var(--ease-out) both;
    padding-bottom: 10px;
  }
  @keyframes sheetIn{ from{ opacity:0; transform: translateY(18px); } to{ opacity:1; transform:none; } }
  /* grab handle */
  [data-rowmenu].is-sheet::before{
    content:''; display:block; width:38px; height:4px; border-radius:99px;
    background: var(--line-strong); margin:2px auto 10px;
  }
}
#menuScrim{
  position:fixed; inset:0; z-index:59;
  background: rgba(15,23,42,.34);
  backdrop-filter: blur(2px);
  animation: fadeIn .18s var(--ease) both;
}
@keyframes fadeIn{ from{opacity:0} to{opacity:1} }

/* ==========================================================================
   11b. EMPLOYEE CARD SHOWCASE  (dashboards)

   A presentation mock-up of the credential — deliberately separate from the
   real KMC ID card, whose print geometry is fixed in section 4.

   The face is a *printed artefact*, so it stays light in both themes; only
   the stage around it is theme-aware. It idles with a slow float and, on a
   fine pointer, tilts in 3D while the specular highlight, the foil and the
   inner layers track the pointer together (static/js/showcase-card.js).

   3D note: `.showcase-card` must NOT clip its own overflow — any value other
   than `visible` flattens `transform-style: preserve-3d` and kills the
   parallax. Decoration is clipped by `.showcase-plate` instead.
   ========================================================================== */
.showcase{ position:relative; isolation:isolate; }
.showcase-glow{
  position:absolute; inset:0; z-index:-1; pointer-events:none;
  background:
    radial-gradient(620px 320px at 50% -10%, rgba(46,130,122,.18), transparent 62%),
    radial-gradient(460px 260px at 12% 108%, rgba(16,185,129,.12), transparent 60%),
    radial-gradient(460px 260px at 88% 104%, rgba(229,185,104,.10), transparent 60%);
}

/* the stage owns the perspective so the card can rotate inside it */
.showcase-stage{
  position:relative;
  perspective:1250px;
  perspective-origin:50% 42%;
  display:flex; justify-content:center;
}

.showcase-card{
  /* written by JS each frame; the values here are also the no-JS values */
  --rx:0deg; --ry:0deg; --px:50%; --py:38%; --tilt:0;
  --tx:0px; --ty:0px; --lift:0px; --scale:1;

  position:relative;
  width:min(462px,100%);
  aspect-ratio:1.585 / 1;               /* CR80 landscape proportion */
  border-radius:19px;
  padding:clamp(15px,3.5vw,22px);
  display:grid;
  grid-template-rows:auto minmax(0,1fr) auto;
  gap:clamp(9px,2.1vw,14px);
  text-align:left;
  font-family:'Inter',system-ui,-apple-system,'Segoe UI',sans-serif;
  color:#0b1c18;
  background:linear-gradient(152deg,#ffffff 0%,#fbfdfc 42%,#eef4f1 100%);
  border:1px solid rgba(13,42,36,.13);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.9),
    0 1px 2px rgba(6,26,22,.10),
    0 18px 34px -20px rgba(6,26,22,.40),
    0 44px 74px -44px rgba(6,26,22,.55);
  transform:translate3d(var(--tx),calc(var(--ty) + var(--lift)),0)
            rotateX(var(--rx)) rotateY(var(--ry)) scale(var(--scale));
  transform-style:preserve-3d;
  transition:box-shadow .45s var(--ease-out);
  animation:showcaseFloat 8s ease-in-out infinite;
  will-change:transform;
}
.showcase-stage:hover .showcase-card{
  animation-play-state:paused;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.9),
    0 1px 2px rgba(6,26,22,.10),
    0 34px 54px -24px rgba(6,26,22,.44),
    0 78px 110px -54px rgba(6,26,22,.62);
}
@keyframes showcaseFloat{
  0%,100%{ transform:translate3d(var(--tx),calc(var(--ty) + var(--lift)),0)
                     rotateX(var(--rx)) rotateY(var(--ry)) scale(var(--scale)); }
  50%    { transform:translate3d(var(--tx),calc(var(--ty) + var(--lift) - 11px),0)
                     rotateX(var(--rx)) rotateY(var(--ry)) scale(var(--scale)); }
}

/* ---- decorative plate: the only clipping layer on the card -------------- */
.showcase-plate{
  position:absolute; inset:0; z-index:0;
  border-radius:inherit; overflow:hidden; pointer-events:none;
}
/* the printed header band, as on the physical card */
.showcase-band{
  position:absolute; top:0; left:0; right:0; height:5px;
  background:linear-gradient(90deg,var(--kmc) 0%,var(--kmc-light) 46%,var(--civic-gold) 100%);
}
/* fine security engraving — reads as texture, never as pattern */
.showcase-guilloche{
  position:absolute; inset:0; opacity:.55;
  background:
    repeating-linear-gradient(114deg, rgba(20,58,48,.05) 0 1px, transparent 1px 8px),
    repeating-linear-gradient(-114deg, rgba(20,58,48,.035) 0 1px, transparent 1px 11px);
  -webkit-mask-image:radial-gradient(120% 100% at 82% 92%, #000, transparent 72%);
          mask-image:radial-gradient(120% 100% at 82% 92%, #000, transparent 72%);
}
/* specular highlight — follows the pointer, settles back at rest */
.showcase-glare{
  position:absolute; inset:0;
  background:
    radial-gradient(58% 78% at var(--px) var(--py),
      rgba(255,255,255,.92), rgba(255,255,255,.28) 42%, transparent 68%),
    radial-gradient(90% 120% at calc(100% - var(--px)) calc(100% - var(--py)),
      rgba(11,38,32,.10), transparent 58%);
  opacity:calc(.30 + var(--tilt) * .55);
  mix-blend-mode:soft-light;
  transition:opacity .5s var(--ease-out);
}

/* ---- header ------------------------------------------------------------ */
.showcase-head{
  position:relative; z-index:2;
  display:flex; align-items:center; gap:10px;
  padding:2px 0 clamp(8px,1.8vw,11px);
  border-bottom:1px solid rgba(13,42,36,.11);
  box-shadow:0 2px 0 -1px rgba(13,42,36,.055);
  transform:translateZ(22px);
}
.showcase-seal{
  width:32px; height:32px; border-radius:50%; flex:0 0 auto;
  display:grid; place-items:center;
  background:#ffffff;
  border:1px solid rgba(44,92,39,.22);
  box-shadow:0 1px 2px rgba(13,42,36,.10), inset 0 0 0 3px #ffffff;
}
.showcase-seal img{ width:24px; height:24px; object-fit:contain; }
.showcase-org{ display:flex; flex-direction:column; gap:2px; line-height:1.12; min-width:0; }
.showcase-org b{
  font-size:10px; font-weight:800; letter-spacing:.03em; color:#0b1f1a;
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
}
.showcase-org i{
  font-style:normal; font-size:7.5px; font-weight:700; letter-spacing:.13em;
  text-transform:uppercase; color:#6d827b;
}
.showcase-chip{
  margin-left:auto; flex:0 0 auto;
  font-size:8.5px; font-weight:800; letter-spacing:.07em; white-space:nowrap;
  padding:5px 9px; border-radius:999px;
  color:var(--kmc); background:rgba(44,92,39,.09);
  border:1px solid rgba(44,92,39,.16);
}

/* ---- body -------------------------------------------------------------- */
.showcase-body{
  position:relative; z-index:2;
  display:flex; align-items:stretch; gap:clamp(9px,2.4vw,15px);
  min-width:0; min-height:0;
  transform:translateZ(34px);
}
.showcase-photo{
  flex:0 0 auto; align-self:center; width:clamp(48px,16.5%,70px);
  aspect-ratio:1/1.12; border-radius:8px;
  display:block; overflow:hidden;
  background:linear-gradient(162deg,#f2f6f4,#d3ddd8 58%,#c3d0ca);
  border:1px solid rgba(13,42,36,.16);
  box-shadow:inset 0 0 0 2px rgba(255,255,255,.6), 0 1px 3px rgba(13,42,36,.14);
}
.showcase-photo{ position:relative; }
.showcase-photo svg{ display:block; width:100%; height:100%; }
/* the clipped corner every KMC photo panel carries */
.showcase-photo::after{
  content:''; position:absolute; right:0; top:0;
  border-width:0 9px 9px 0; border-style:solid;
  border-color:transparent rgba(255,255,255,.92) transparent transparent;
}
.showcase-fields{
  flex:1 1 auto; min-width:0; margin:0;
  display:flex; flex-direction:column; justify-content:center; gap:clamp(11px,2.9vw,18px);
}
.showcase-field{ min-width:0; }
.showcase-fields dt{
  font-size:7px; font-weight:800; letter-spacing:.15em; text-transform:uppercase;
  color:#7b8f88;
}
.showcase-fields dd{
  margin:1px 0 0; font-size:10.5px; font-weight:700; letter-spacing:-.005em; color:#16302a;
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
}
.showcase-holder{
  font-size:clamp(18px,4.6vw,23px) !important; font-weight:800 !important;
  letter-spacing:-.03em; line-height:1.08; color:#081814 !important; margin-top:2px !important;
}
.showcase-row{ display:flex; gap:clamp(9px,2.6vw,16px); }
.showcase-row .showcase-field{ flex:1 1 0; }

/* the verification code, sized so a phone camera can actually resolve it */
.showcase-code{
  flex:0 0 auto; align-self:stretch;
  display:flex; flex-direction:column; align-items:center; justify-content:center; gap:5px;
}
.showcase-qr{
  width:clamp(46px,12vw,58px); aspect-ratio:1; display:block;
  padding:3px; border-radius:6px;
  background:#ffffff; border:1px solid rgba(13,42,36,.16);
  box-shadow:0 1px 3px rgba(13,42,36,.14);
}
.showcase-qr svg{ display:block; width:100%; height:100%; }
.showcase-qr path{ fill:#0a1b17; }
.showcase-code small{
  font-size:6px; font-weight:800; letter-spacing:.13em; text-transform:uppercase;
  color:#7b8f88; white-space:nowrap;
}

/* ---- footer ------------------------------------------------------------ */
.showcase-foot{
  position:relative; z-index:2;
  display:flex; align-items:flex-end; gap:clamp(10px,3vw,20px);
  padding-top:clamp(7px,1.6vw,10px);
  border-top:1px solid rgba(13,42,36,.10);
  transform:translateZ(16px);
}
.showcase-serial{ display:flex; flex-direction:column; gap:2px; min-width:0; }
.showcase-serial i{
  font-style:normal; font-size:6.5px; font-weight:800; letter-spacing:.15em;
  text-transform:uppercase; color:#839790;
}
.showcase-serial b{
  font-size:10px; font-weight:700; letter-spacing:.04em; color:#3c534c;
  font-variant-numeric:tabular-nums;
}
/* holographic foil — shifts with the pointer, like the real laminate */
/* signature rule — the last thing that makes a mock read as a credential */
.showcase-sign{
  flex:0 0 auto; margin-left:auto;
  display:flex; flex-direction:column; align-items:center; gap:4px;
}
.showcase-sign em{
  display:block; width:clamp(64px,17vw,104px); height:1px;
  background:linear-gradient(90deg,rgba(13,42,36,.10),rgba(13,42,36,.42) 22%,rgba(13,42,36,.42) 78%,rgba(13,42,36,.10));
}
.showcase-sign i{
  font-style:normal; font-size:6px; font-weight:800; letter-spacing:.14em;
  text-transform:uppercase; color:#8fa39d; white-space:nowrap;
}
.showcase-holo{
  flex:0 0 auto;
  width:clamp(34px,9vw,44px); height:clamp(15px,3.6vw,19px); border-radius:5px;
  background:linear-gradient(115deg,
    rgba(229,185,104,.85) 0%, rgba(140,214,190,.85) 26%, rgba(150,170,235,.80) 48%,
    rgba(233,160,190,.80) 70%, rgba(229,185,104,.85) 100%);
  background-size:260% 100%;
  background-position:calc(var(--px) * 1.4) 50%;
  border:1px solid rgba(255,255,255,.7);
  box-shadow:inset 0 0 6px rgba(255,255,255,.55), 0 1px 2px rgba(13,42,36,.16);
  opacity:calc(.72 + var(--tilt) * .28);
}

/* on a short card a stretched photo becomes a sliver — centre a portrait one */
@media (max-width:560px){
  .showcase-photo{ align-self:center; width:clamp(44px,16%,60px); aspect-ratio:1/1.28; }
}
@media (max-width:420px){
  .showcase-card{ border-radius:15px; padding:13px; gap:7px; }
  .showcase-head{ gap:8px; padding-bottom:7px; }
  .showcase-org b{ font-size:9px; }
  .showcase-fields{ gap:8px; }
  .showcase-holder{ font-size:17px !important; }
  .showcase-qr{ width:42px; }
  .showcase-code small{ display:none; }
  /* no room for a signature rule — the foil takes over the auto margin */
  .showcase-sign{ display:none; }
  .showcase-holo{ margin-left:auto; }
  .showcase-foot{ padding-top:7px; }
}

@media (prefers-reduced-motion:reduce){
  .showcase-card{ animation:none; transform:none !important; }
  .showcase-glare{ opacity:.3; }
  .showcase-head,.showcase-body,.showcase-foot{ transform:none; }
}
@media print{ .showcase{ display:none !important; } }

/* ==========================================================================
   12. ANIMATIONS
   ========================================================================== */
@keyframes fadeUp{ from{opacity:0; transform:translateY(12px);} to{opacity:1; transform:none;} }
.animate-fade-up{ animation: fadeUp .5s var(--ease-out) both; }
@keyframes floaty{ 0%,100%{ transform:translateY(0);} 50%{ transform:translateY(-6px);} }
.animate-floaty{ animation: floaty 4s ease-in-out infinite; }
@keyframes pulseRing{
  0%{ box-shadow:0 0 0 0 rgba(16,185,129,.45);} 70%{ box-shadow:0 0 0 9px rgba(16,185,129,0);}
  100%{ box-shadow:0 0 0 0 rgba(16,185,129,0);} }
.pulse-dot{ animation: pulseRing 2.4s infinite; }
@keyframes shimmer{ 0%{ background-position:-500px 0;} 100%{ background-position:500px 0;} }

/* content settles in on load, staggered down the page */
.stagger > *{ animation: fadeUp .5s var(--ease-out) both; }
.stagger > *:nth-child(1){ animation-delay:.02s }
.stagger > *:nth-child(2){ animation-delay:.06s }
.stagger > *:nth-child(3){ animation-delay:.10s }
.stagger > *:nth-child(4){ animation-delay:.14s }
.stagger > *:nth-child(5){ animation-delay:.18s }
.stagger > *:nth-child(6){ animation-delay:.22s }

.clamp-2{ display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; }

/* ==========================================================================
   13. THEME MAP  (light theme only)

   The page templates were authored against a dark palette and carry utility
   classes such as `text-white` and `bg-white/[.04]`. Instead of hand-editing
   ~60 templates — and letting them drift apart over time — those utilities
   are re-pointed at the tokens above for the light theme.

   Everything here is scoped to `html:not(.dark)`, so switching to dark mode
   simply stops applying the map and the original palette returns intact.
   Doubling the class name lifts specificity over the utility framework
   regardless of the order the stylesheets end up in.
   ========================================================================== */

/* --- text ---------------------------------------------------------------- */
html:not(.dark) .text-white.text-white,
html:not(.dark) .text-slate-100.text-slate-100{ color: var(--ink); }
html:not(.dark) .text-slate-200.text-slate-200{ color: var(--ink-2); }
html:not(.dark) .text-slate-300.text-slate-300{ color: var(--ink-3); }
html:not(.dark) .text-slate-400.text-slate-400{ color: var(--ink-muted); }
html:not(.dark) .text-slate-500.text-slate-500{ color: var(--ink-muted); }
html:not(.dark) .text-slate-600.text-slate-600{ color: var(--ink-faint); }
html:not(.dark) .text-white\/80.text-white\/80{ color: var(--ink-3); }
html:not(.dark) .hover\:text-white.hover\:text-white:hover{ color: var(--ink); }
html:not(.dark) .hover\:text-slate-300.hover\:text-slate-300:hover{ color: var(--ink-2); }
html:not(.dark) .placeholder-slate-500.placeholder-slate-500::placeholder{ color: var(--ink-faint); }

/* Text sitting ON a saturated fill stays white — both when the fill is on the
   element itself and when it is on an ancestor (icons inside gradient chips). */
html:not(.dark) :is(
  [class*="bg-gradient-to"], .nav-active, .card-broken-badge, .on-accent,
  .bg-indigo-600, .bg-indigo-500, .bg-emerald-600, .bg-emerald-500,
  .bg-rose-500, .bg-slate-500
) :is(.text-white, .text-slate-100, .text-slate-200),
html:not(.dark) :is(
  [class*="bg-gradient-to"], .nav-active, .card-broken-badge, .on-accent,
  .bg-indigo-600, .bg-indigo-500, .bg-emerald-600, .bg-emerald-500,
  .bg-rose-500, .bg-slate-500
):is(.text-white, .text-slate-100, .text-slate-200),
html:not(.dark) .peer-checked\:text-white.peer-checked\:text-white{ color:#fff; }

/* Same for the pale accent tints used as secondary text on those fills —
   stepping them down to a dark shade (as the rules below do everywhere else)
   would bury them in the gradient. */
html:not(.dark) :is(
  [class*="bg-gradient-to"], .nav-active, .card-broken-badge, .on-accent,
  .bg-indigo-600, .bg-indigo-500, .bg-emerald-600, .bg-emerald-500,
  .bg-rose-500, .bg-slate-500
) :is(.text-emerald-100, .text-emerald-200, .text-emerald-200\/80){ color:#d1fae5; }
html:not(.dark) :is(
  [class*="bg-gradient-to"], .nav-active, .card-broken-badge, .on-accent,
  .bg-indigo-600, .bg-indigo-500, .bg-emerald-600, .bg-emerald-500,
  .bg-rose-500, .bg-slate-500
) :is(.text-indigo-100, .text-indigo-200){ color:#e0e7ff; }
html:not(.dark) :is(
  [class*="bg-gradient-to"], .nav-active, .card-broken-badge, .on-accent,
  .bg-indigo-600, .bg-indigo-500, .bg-emerald-600, .bg-emerald-500,
  .bg-rose-500, .bg-slate-500
) :is(.text-rose-100, .text-rose-200, .text-rose-200\/80){ color:#ffe4e6; }
html:not(.dark) :is(
  [class*="bg-gradient-to"], .nav-active, .card-broken-badge, .on-accent,
  .bg-indigo-600, .bg-indigo-500, .bg-emerald-600, .bg-emerald-500,
  .bg-rose-500, .bg-slate-500
) :is(.text-amber-100, .text-amber-200){ color:#fef3c7; }
html:not(.dark) :is(
  [class*="bg-gradient-to"], .nav-active, .card-broken-badge, .on-accent,
  .bg-indigo-600, .bg-indigo-500, .bg-emerald-600, .bg-emerald-500,
  .bg-rose-500, .bg-slate-500
) :is(.text-blue-100, .text-blue-200){ color:#dbeafe; }
html:not(.dark) :is(
  [class*="bg-gradient-to"], .nav-active, .card-broken-badge, .on-accent,
  .bg-indigo-600, .bg-indigo-500, .bg-emerald-600, .bg-emerald-500,
  .bg-rose-500, .bg-slate-500
) .text-white\/80{ color:rgba(255,255,255,.82); }

/* Accent text — the dark theme's 100–300 shades are unreadable on paper, so
   each steps down to a shade that clears WCAG AA against white. */
html:not(.dark) :is(.text-indigo-100,.text-indigo-200,.text-indigo-300){ color:#4f46e5; }
html:not(.dark) .text-indigo-400{ color:#5850ec; }
html:not(.dark) .hover\:text-indigo-300:hover{ color:#4338ca; }
html:not(.dark) :is(.text-violet-300,.text-violet-400){ color:#7c3aed; }
html:not(.dark) :is(.text-emerald-100,.text-emerald-200,.text-emerald-300,
  .text-emerald-200\/80){ color:#047857; }
html:not(.dark) .text-emerald-400{ color:#047857; }
html:not(.dark) .hover\:text-emerald-300:hover{ color:#065f46; }
html:not(.dark) .group:hover .group-hover\:text-emerald-300{ color:#065f46; }
html:not(.dark) :is(.text-rose-100,.text-rose-200,.text-rose-300){ color:#be123c; }
html:not(.dark) .text-rose-400{ color:#be123c; }
html:not(.dark) :is(.text-rose-200\/80,.text-rose-300\/70,.text-rose-300\/80,
  .text-rose-400\/70){ color:#9f1239; }
html:not(.dark) :is(.text-amber-200,.text-amber-300){ color:#b45309; }
html:not(.dark) .text-amber-400{ color:#b45309; }
html:not(.dark) :is(.text-blue-200,.text-blue-300){ color:#1d4ed8; }
html:not(.dark) .text-blue-400{ color:#2563eb; }
html:not(.dark) :is(.text-cyan-300,.text-cyan-400){ color:#0e7490; }
html:not(.dark) :is(.text-pink-300,.text-pink-400){ color:#be185d; }
html:not(.dark) .text-orange-300{ color:#c2410c; }
html:not(.dark) .text-orange-400{ color:#c2410c; }

/* --- translucent-white fills become tinted paper ------------------------- */
html:not(.dark) .bg-white\/\[\.02\].bg-white\/\[\.02\],
html:not(.dark) .bg-white\/\[\.03\].bg-white\/\[\.03\]{ background-color: var(--surface-2); }
html:not(.dark) .bg-white\/\[\.04\].bg-white\/\[\.04\]{ background-color: var(--surface); }
html:not(.dark) .bg-white\/\[\.05\].bg-white\/\[\.05\],
html:not(.dark) .bg-white\/5.bg-white\/5{ background-color: var(--surface-3); }
html:not(.dark) .bg-white\/10.bg-white\/10{ background-color: var(--surface-sunk); }
html:not(.dark) .hover\:bg-white\/\[\.02\].hover\:bg-white\/\[\.02\]:hover,
html:not(.dark) .hover\:bg-white\/\[\.03\].hover\:bg-white\/\[\.03\]:hover{ background-color: var(--surface-2); }
html:not(.dark) .hover\:bg-white\/\[\.05\].hover\:bg-white\/\[\.05\]:hover,
html:not(.dark) .hover\:bg-white\/5.hover\:bg-white\/5:hover,
html:not(.dark) .hover\:bg-white\/10.hover\:bg-white\/10:hover{ background-color: var(--surface-3); }

/* sunken inputs / code boxes / legacy shell fills */
html:not(.dark) :is(.bg-slate-900,.bg-slate-900\/70,.bg-slate-900\/60,
  .bg-slate-900\/50,.bg-slate-900\/40,.bg-ink-900\/70,.bg-ink-850\/95){
  background-color: var(--surface); }
html:not(.dark) .bg-slate-800\/50{ background-color: var(--surface-2); }

/* modal / sheet scrims soften on light */
html:not(.dark) .bg-black\/60{ background-color: rgba(15,23,42,.42); }
html:not(.dark) .bg-black\/70{ background-color: rgba(15,23,42,.46); }
html:not(.dark) .bg-black\/80{ background-color: rgba(15,23,42,.55); }

/* --- hairlines ----------------------------------------------------------- */
html:not(.dark) .border-white\/5.border-white\/5{ border-color: var(--line-soft); }
html:not(.dark) .border-white\/10.border-white\/10{ border-color: var(--line); }
html:not(.dark) .border-white\/20.border-white\/20{ border-color: var(--line-strong); }
html:not(.dark) .hover\:border-white\/10.hover\:border-white\/10:hover,
html:not(.dark) .hover\:border-white\/20.hover\:border-white\/20:hover{ border-color: var(--line-strong); }
html:not(.dark) .border-ink-850.border-ink-850{ border-color: var(--surface); }
html:not(.dark) .divide-white\/5.divide-white\/5 > :not([hidden]) ~ :not([hidden]){
  border-color: var(--line-soft); }
html:not(.dark) .ring-black\/30.ring-black\/30{ --tw-ring-color: transparent; }

/* --- accent tints -------------------------------------------------------- */
html:not(.dark) :is(.bg-indigo-500\/10,.bg-indigo-500\/15,.bg-indigo-500\/20){ background-color:#eef0fe; }
html:not(.dark) :is(.bg-violet-500\/15,.bg-violet-500\/20){ background-color:#f2ecfe; }
html:not(.dark) :is(.bg-emerald-500\/10,.bg-emerald-500\/15,.bg-emerald-500\/20){ background-color:#e7f7ef; }
html:not(.dark) :is(.bg-rose-500\/10,.bg-rose-500\/15,.bg-rose-500\/20,.bg-rose-500\/25){ background-color:#fdeaee; }
html:not(.dark) :is(.bg-amber-500\/10,.bg-amber-500\/15,.bg-amber-500\/20){ background-color:#fdf3e3; }
html:not(.dark) :is(.bg-blue-500\/10,.bg-blue-500\/15,.bg-blue-500\/20){ background-color:#e8f0fe; }
html:not(.dark) :is(.bg-orange-500\/15,.bg-orange-500\/20){ background-color:#fdeee2; }
html:not(.dark) :is(.bg-pink-500\/15,.bg-pink-500\/20){ background-color:#fdebf3; }
html:not(.dark) :is(.bg-cyan-500\/15,.bg-cyan-500\/20){ background-color:#e3f6fa; }
html:not(.dark) .bg-slate-500\/15{ background-color: var(--surface-3); }

/* Tailwind's emerald-600 carries white text at only 3.8:1, and rose-500 at
   3.7:1 — one step darker clears AA while reading as the same colour. */
html:not(.dark) .bg-rose-500{ background-color:#e11d48; }
html:not(.dark) .bg-emerald-600{ background-color:#047857; }
html:not(.dark) .hover\:bg-emerald-500:hover{ background-color:#059669; }
html:not(.dark) .hover\:bg-emerald-700:hover{ background-color:#065f46; }
html:not(.dark) .bg-emerald-500{ background-color:#059669; }
html:not(.dark) .peer-checked\:bg-slate-600\/40{ background-color: var(--surface-3); }
html:not(.dark) :is(.hover\:bg-rose-500\/25,.hover\:bg-rose-500\/30):hover{ background-color:#fbd9e0; }
html:not(.dark) .hover\:bg-rose-500\/10:hover{ background-color:#fdeaee; }
html:not(.dark) .hover\:bg-indigo-500\/10:hover{ background-color:#eef0fe; }

/* --- accent borders — a thin low-contrast line reads as a smudge on white - */
html:not(.dark) :is(.border-indigo-500\/20,.border-indigo-500\/25,.border-indigo-500\/30){ border-color:#c7cbfb; }
html:not(.dark) .hover\:border-indigo-500\/40:hover{ border-color:#a5a9f7; }
html:not(.dark) :is(.border-emerald-500\/20,.border-emerald-500\/25,.border-emerald-500\/30){ border-color:#a7e3c6; }
html:not(.dark) .hover\:border-emerald-500\/40:hover{ border-color:#6ed3a6; }
html:not(.dark) :is(.border-rose-500\/20,.border-rose-500\/25,.border-rose-500\/30){ border-color:#f7c3cf; }
html:not(.dark) :is(.border-amber-500\/20,.border-amber-500\/30){ border-color:#f3d5a1; }
html:not(.dark) .hover\:border-amber-500\/40:hover{ border-color:#eab765; }
html:not(.dark) .border-blue-500\/30{ border-color:#bcd3fb; }
html:not(.dark) .hover\:border-violet-500\/40:hover{ border-color:#c0a5f7; }

/* --- the ID card keeps its own fixed palette ----------------------------- */
html:not(.dark) .kmc-card .text-slate-700.text-slate-700{ color:#334155; }
html:not(.dark) .kmc-card .text-slate-800.text-slate-800{ color:#1e293b; }
html:not(.dark) .kmc-card .text-white.text-white{ color:#fff; }
html:not(.dark) .kmc-card .bg-white.bg-white{ background-color:#fff; }

/* --- charts -------------------------------------------------------------- */
.chart-grid{ --grid-line: rgba(15,23,42,.07); }
html.dark .chart-grid{ --grid-line: rgba(255,255,255,.06); }


/* ==========================================================================
   14. KMC ID CARD  — design intentionally unchanged.
   Only the QR / barcode metrics and the print geometry below are new.
   ========================================================================== */
.kmc-card{
  /* Every colour and metric below is a design token with the original value as
     its fallback, so a card rendered without a design (or with design v1) is
     byte-for-byte the card that shipped. The Card Editor sets these per card
     from the design snapshot it was created with. */
  --kc-bg1:#ffffff; --kc-bg2:#f4f7f4; --kc-bg3:#eaf0ea;
  --kc-stripe-dark:#2c5c27; --kc-stripe-mid:#3f7a37;
  --kc-stripe-light:#8dc453; --kc-stripe-accent:#57993e;
  --kc-title:#1c4d18; --kc-name:#1c5d18; --kc-label:#12331a; --kc-value:#20303a;
  --kc-photo-border:#3f7a37; --kc-barcode:#0f2e1f; --kc-border:transparent;
  --kc-radius:16px; --kc-border-w:0px; --kc-opacity:1; --kc-stripe-opacity:1;
  --kc-photo-radius:16px; --kc-photo-border-w:4px;
  --kc-bg-opacity:.13; --kc-bg-filter:grayscale(.15) brightness(1.06);
  --kc-bg-size:cover; --kc-bg-pos:50% 50%;

  width:340px; aspect-ratio:0.62; border-radius:var(--kc-radius); position:relative;
  overflow:hidden; color:var(--kc-label); box-shadow:0 24px 48px -22px rgba(16,24,40,.42);
  background:linear-gradient(180deg,var(--kc-bg1) 0%,var(--kc-bg2) 55%,var(--kc-bg3) 100%);
  border:var(--kc-border-w) solid var(--kc-border);
  opacity:var(--kc-opacity);
  font-family:'Times New Roman',Georgia,serif;
  -webkit-print-color-adjust:exact; print-color-adjust:exact;
}
.kmc-card *{ -webkit-print-color-adjust:exact; print-color-adjust:exact; }
.kmc-bg{ position:absolute; inset:0; width:100%!important; height:100%!important;
  background-size:var(--kc-bg-size); background-position:var(--kc-bg-pos);
  background-repeat:no-repeat;
  opacity:var(--kc-bg-opacity); z-index:0; filter:var(--kc-bg-filter); pointer-events:none; }
.kmc-card::before{
  content:''; position:absolute; inset:0; z-index:1; pointer-events:none;
  background:linear-gradient(180deg, rgba(255,255,255,.34), rgba(255,255,255,.10) 42%, rgba(255,255,255,.34)); }
.kmc-watermark{ position:absolute!important; top:40%; left:50%;
  margin-left:-75px; margin-top:-75px;
  width:150px!important; height:150px!important; object-fit:contain; opacity:.06; z-index:1;
  filter:blur(.3px); pointer-events:none; }

.kmc-corner{ position:absolute; z-index:1; }
.kmc-tl{ top:0; left:0; width:52%; height:14%;
  background:linear-gradient(120deg,var(--kc-stripe-mid),var(--kc-stripe-dark));
  opacity:var(--kc-stripe-opacity);
  clip-path:polygon(0 0,100% 0,50% 62%,0 78%); }
.kmc-tl2{ top:0; left:0; width:34%; height:20%;
  background:linear-gradient(120deg,var(--kc-stripe-light),var(--kc-stripe-mid));
  opacity:calc(.55 * var(--kc-stripe-opacity));
  clip-path:polygon(0 0,72% 0,0 82%); }
.kmc-tr{ top:0; right:0; width:22%; height:11%;
  background:linear-gradient(210deg,var(--kc-stripe-mid),var(--kc-stripe-dark));
  opacity:calc(.5 * var(--kc-stripe-opacity));
  clip-path:polygon(100% 0,100% 100%,0 0); }
.kmc-bl{ bottom:0; left:0; width:46%; height:20%;
  background:linear-gradient(120deg,var(--kc-stripe-dark),var(--kc-stripe-mid));
  opacity:var(--kc-stripe-opacity);
  clip-path:polygon(0 44%,72% 100%,0 100%); }
.kmc-br{ bottom:0; right:0; width:66%; height:22%;
  background:linear-gradient(120deg,var(--kc-stripe-accent),var(--kc-stripe-dark));
  opacity:var(--kc-stripe-opacity);
  clip-path:polygon(100% 0,100% 100%,0 100%,40% 48%); }
.kmc-br2{ bottom:0; right:0; width:38%; height:32%;
  background:linear-gradient(120deg,var(--kc-stripe-light),var(--kc-stripe-mid));
  opacity:calc(.55 * var(--kc-stripe-opacity));
  clip-path:polygon(100% 26%,100% 100%,24% 100%); }
.kmc-body{ position:relative; z-index:2; padding:14px 16px; height:100%; display:flex; flex-direction:column; }
.kmc-head{ display:flex!important; flex-direction:column!important; align-items:center!important;
  gap:4px; margin-top:2px; text-align:center; }
.kmc-sub{ text-align:center; letter-spacing:.16em; font-size:11.5px;
  color:var(--kc-title); opacity:.9; font-weight:700; }

.kmc-logo{ width:70px!important; height:70px!important; object-fit:contain; flex:0 0 auto;
  image-rendering:-webkit-optimize-contrast;
  filter:drop-shadow(0 1px 1.5px rgba(0,0,0,.22)) contrast(1.05) saturate(1.05); }
.kmc-logo-lg{ width:70px!important; height:70px!important; }
.kmc-title{ color:var(--kc-title); font-weight:700; letter-spacing:.3px; }
.kmc-photo{ width:122px; height:132px; border-radius:var(--kc-photo-radius);
  border:var(--kc-photo-border-w) solid var(--kc-photo-border);
  object-fit:cover; background:#c3ccc3; box-shadow:0 6px 14px -6px rgba(0,0,0,.5); }
.kmc-field-label{ font-weight:700; color:var(--kc-label); text-decoration:underline; text-underline-offset:2px; font-size:12px; letter-spacing:.2px; }
.kmc-field-value{ color:var(--kc-value); font-size:12px; }
.kmc-name{ color:var(--kc-name); font-weight:800; font-size:22px; letter-spacing:.5px; line-height:1.1; }

.kmc-field{ transition:transform .4s cubic-bezier(.2,.8,.2,1), color .4s, letter-spacing .4s; position:relative; z-index:2; }
.card-broken-badge{ background:linear-gradient(90deg,#ef4444,#f97316); }

/* ---- QR + barcode ------------------------------------------------------
   Slightly smaller than before and held clear of the green corner geometry,
   so nothing touches or bleeds past the card edge. Encoded data unchanged. */
.kmc-barcode{
  display:block;
  width:auto; height:auto;
  max-width:100%;                    /* never wider than its padded slot */
  margin:0 auto;
}
.kmc-qr{
  display:inline-flex; align-items:center; justify-content:center;
  line-height:0;                     /* no stray descender gap under the canvas */
  box-shadow:0 1px 3px rgba(16,24,40,.16);
}
/* qrcodejs emits a <canvas> AND a hidden <img> fallback — never force the
   fallback visible, or the two sit side by side and double the QR's width. */
.kmc-qr canvas, .kmc-qr img{
  max-width:100%; height:auto;
  image-rendering: pixelated;        /* keeps modules crisp when scaled to print */
}

/* The KMC card opts out of the theme map — its palette is fixed by design.
   (Also declared inside the map itself, so it wins in either stylesheet order.) */
.kmc-card .text-slate-700.text-slate-700{ color:#334155; }
.kmc-card .text-slate-800.text-slate-800{ color:#1e293b; }
.kmc-card .text-white.text-white{ color:#fff; }
.kmc-card .bg-white.bg-white{ background-color:#fff; }

/* ==========================================================================
   15. CARD CORRUPTION MODES (Admin Panel QA tools)
   Purely presentational — the record is untouched, so Restore always returns
   the exact original design. 'scramble' is driven by static/js/cards.js.
   ========================================================================== */
.kmc-card[data-mode="flip"]{ transform:scaleY(-1); }
.kmc-card[data-mode="mirror"]{ transform:scaleX(-1); }

.kmc-card[data-mode="blank"] .kmc-field-value,
.kmc-card[data-mode="blank"] .kmc-name,
.kmc-card[data-mode="blank"] .kmc-barcode,
.kmc-card[data-mode="blank"] .kmc-qr{ visibility:hidden; }
.kmc-card[data-mode="blank"] .kmc-photo{ background:#c9d2c9; }
.kmc-card[data-mode="blank"] .kmc-photo img{ visibility:hidden; }

.kmc-card[data-mode="ghost"] .kmc-field-label,
.kmc-card[data-mode="ghost"] .kmc-field-value,
.kmc-card[data-mode="ghost"] .kmc-name,
.kmc-card[data-mode="ghost"] .kmc-title,
.kmc-card[data-mode="ghost"] p{ color:rgba(120,140,120,.16) !important; text-shadow:0 0 6px rgba(255,255,255,.5); }

.kmc-card[data-mode="overlap"] .kmc-body{ position:relative; }
.kmc-card[data-mode="overlap"] .kmc-field{ position:absolute; top:38%; left:8%; right:8%;
  margin:0 !important; opacity:.85; }
.kmc-card[data-mode="overlap"] .kmc-photo{ width:70px; height:76px; }

.kmc-card[data-mode="noise"]{ filter:contrast(1.5) saturate(1.4) hue-rotate(-12deg); }
.kmc-card[data-mode="noise"]::after{
  content:''; position:absolute; inset:0; z-index:5; pointer-events:none; mix-blend-mode:multiply;
  background:
    repeating-linear-gradient(0deg, rgba(0,0,0,.55) 0 3px, transparent 3px 7px),
    repeating-linear-gradient(90deg, rgba(255,0,80,.28) 0 2px, transparent 2px 9px),
    linear-gradient(180deg, transparent 38%, rgba(0,255,190,.35) 41%, transparent 44%);
}
.kmc-card[data-mode="noise"] .kmc-field{ transform:translateX(6px); filter:blur(.4px); }

/* ==========================================================================
   15b. KMC ID CARD — LANDSCAPE (horizontal) ORIENTATION
   ==========================================================================
   Same markup, re-flowed onto an explicit grid so a horizontal face never
   breaks: every region of the card is a named area, so nothing overflows the
   trim edge and nothing collapses on top of anything else.

   Portrait  : 340 x 548.4  px  (CR80 53.98 x 85.60 mm)
   Landscape : 540 x 340.53 px  (CR80 85.60 x 53.98 mm)

   `.kmc-stage` is the screen-only fit wrapper — it scales the whole pair down
   on narrow viewports so the card is never clipped (see card_detail.html).
   ========================================================================== */
.kmc-stage{
  width:100%; min-width:0;
  transform: scale(var(--kmc-fit, 1));
  transform-origin: top left;
  transition: transform .45s var(--ease-out);
}

/* the swap itself — a quick 3D turn of the whole pair */
.kmc-pair.is-flipping{ animation: kmcOrientFlip .6s var(--ease-out) both; }
@keyframes kmcOrientFlip{
  0%   { transform: perspective(1400px) rotateY(0deg)   scale(1);   opacity:1;   filter:blur(0); }
  42%  { transform: perspective(1400px) rotateY(-22deg) scale(.93); opacity:.25; filter:blur(2px); }
  100% { transform: perspective(1400px) rotateY(0deg)   scale(1);   opacity:1;   filter:blur(0); }
}
@media (prefers-reduced-motion: reduce){
  .kmc-pair.is-flipping{ animation:none; }
  .kmc-stage{ transition:none; }
}

/* ---- the landscape face ------------------------------------------------- */
.kmc-landscape{ flex-direction:column !important; align-items:center; gap:1.25rem !important; }

.kmc-landscape .kmc-card{
  width:540px;
  height:340.53px;
  aspect-ratio:auto;
}
.kmc-landscape .kmc-body{ padding:11px 14px; }

/* corner geometry is percentage based, but the diagonals read far too heavy
   on a wide face — trim them so they stay decorative, not intrusive */
.kmc-landscape .kmc-tl { width:30%; height:20%; }
.kmc-landscape .kmc-tl2{ width:20%; height:28%; }
.kmc-landscape .kmc-tr { width:14%; height:17%; }
.kmc-landscape .kmc-bl { width:24%; height:18%; }
.kmc-landscape .kmc-br { width:42%; height:20%; }
.kmc-landscape .kmc-br2{ width:22%; height:30%; }
.kmc-landscape .kmc-watermark{ width:120px !important; height:120px !important; top:50%;
  margin-left:-60px; margin-top:-60px; }

/* The back carries body copy along its bottom edge — on a portrait face that
   copy sits well above the wedges, but a wide face has no such room, so the
   left wedge goes and the right pair pulls back behind the QR column. */
.kmc-landscape .kmc-back .kmc-bl { display:none; }
.kmc-landscape .kmc-back .kmc-br { width:24%; height:30%; }
.kmc-landscape .kmc-back .kmc-br2{ width:16%; height:44%; }

/* ---- FRONT -------------------------------------------------------------- */
.kmc-landscape .kmc-front .kmc-body{
  display:grid;
  grid-template-columns: 134px minmax(0,1fr);
  grid-template-rows: auto auto auto auto minmax(0,1fr);
  grid-template-areas:
    "head  head"
    "sub   sub"
    "photo name"
    "photo rows"
    "code  code";
  column-gap:14px;
  row-gap:0;
}
.kmc-landscape .kmc-front .kmc-a-head{
  grid-area:head;
  flex-direction:row !important;
  justify-content:center !important;
  gap:9px; margin-top:0;
}
.kmc-landscape .kmc-front .kmc-a-head .kmc-logo{ width:42px !important; height:42px !important; }
.kmc-landscape .kmc-front .kmc-a-head .kmc-title{ font-size:13px; text-align:left; }

.kmc-landscape .kmc-front .kmc-a-sub{ grid-area:sub; margin-top:1px !important; }
.kmc-landscape .kmc-front .kmc-sub{ font-size:10px; letter-spacing:.24em; }

/* the portrait card sizes the photo by hand; here it simply fills the column
   the header and the barcode leave behind, so there is no dead space */
.kmc-landscape .kmc-front .kmc-a-photo{
  grid-area:photo; align-self:stretch; align-items:stretch;
  margin-top:9px !important; padding-bottom:4px;
}
.kmc-landscape .kmc-front .kmc-photo{
  width:122px; height:auto; min-height:0; align-self:stretch;
  border-width:3px; border-radius:12px;
}

.kmc-landscape .kmc-front .kmc-a-name{
  grid-area:name; align-self:start; margin-top:9px !important; text-align:left;
}
.kmc-landscape .kmc-front .kmc-a-name .kmc-name  { font-size:17px; }
.kmc-landscape .kmc-front .kmc-a-name .kmc-name-2{ font-size:14px; }
.kmc-landscape .kmc-front .kmc-a-name .kmc-fho   { font-size:10.5px; }

.kmc-landscape .kmc-front .kmc-a-rows{
  grid-area:rows; align-self:start; margin-top:7px !important; padding-right:2px;
}
.kmc-landscape .kmc-front .kmc-a-rows > * + *{ margin-top:5px !important; }

.kmc-landscape .kmc-front .kmc-a-code{
  grid-area:code; align-self:center;
  margin:0 !important; padding:4px 0 !important;
}

/* ---- BACK --------------------------------------------------------------- */
.kmc-landscape .kmc-back .kmc-body{
  display:grid;
  grid-template-columns: minmax(0,1fr) 116px;
  grid-template-rows: auto auto minmax(0,1fr) auto auto;
  grid-template-areas:
    "logo   logo"
    "title  title"
    "rows   qr"
    "note   qr"
    "warn   qr";
  column-gap:12px;
  row-gap:0;
}
.kmc-landscape .kmc-back .kmc-a-logo{ grid-area:logo; justify-content:center; margin-top:0 !important; }
.kmc-landscape .kmc-back .kmc-a-logo .kmc-logo-lg{ width:38px !important; height:38px !important; }

.kmc-landscape .kmc-back .kmc-a-title{ grid-area:title; margin-top:1px !important; text-align:center; }
.kmc-landscape .kmc-back .kmc-a-title .kmc-title{ font-size:13px; letter-spacing:.12em; }
/* the <br> is a portrait break — on a wide face the heading reads on one line */
.kmc-landscape .kmc-back .kmc-a-title br{ display:none; }

.kmc-landscape .kmc-back .kmc-a-rows{
  grid-area:rows; align-self:stretch;
  display:flex; flex-direction:column; justify-content:space-between;
  margin-top:6px !important; padding:2px 0 4px;
}
.kmc-landscape .kmc-back .kmc-a-rows > * + *{ margin-top:0 !important; }

.kmc-landscape .kmc-back .kmc-a-note{ grid-area:note; align-self:end; margin-top:4px !important; }
.kmc-landscape .kmc-back .kmc-a-note p{ font-size:9.5px; }

.kmc-landscape .kmc-back .kmc-a-warn{ grid-area:warn; align-self:end; margin-top:3px !important; }
.kmc-landscape .kmc-back .kmc-a-warn p{ font-size:8px; }

.kmc-landscape .kmc-back .kmc-a-qr{
  grid-area:qr; align-self:center;
  margin:0 !important; padding:0 !important; justify-content:center;
}
.kmc-landscape .kmc-back .kmc-a-qr .kmc-qr{ padding:4px !important; }
.kmc-landscape .kmc-back .kmc-a-qr .kmc-qr canvas,
.kmc-landscape .kmc-back .kmc-a-qr .kmc-qr img{ width:84px !important; height:84px !important; }
.kmc-landscape .kmc-back .kmc-a-qr .kmc-qr-url{ font-size:9px; letter-spacing:.2px; }

/* fields a hair tighter, so seven rows plus the notes always clear the trim */
.kmc-landscape .kmc-field-label{ font-size:11.5px; }
.kmc-landscape .kmc-field-value{ font-size:11.5px; }


/* ==========================================================================
   15c. ORIENTATION TOGGLE  (Vertical <-> Horizontal)
   ==========================================================================
   One button, three signals: the tile turns a quarter turn, the label slides,
   and the little track flips — so the state reads at a glance and the press
   feels like it did something.
   ========================================================================== */
.orient-btn{
  --o1:#6366f1; --o2:#22d3ee;
  position:relative; isolation:isolate;
  display:inline-flex; align-items:center; gap:.55rem;
  padding:.34rem .8rem .34rem .34rem;
  border-radius:14px; border:1px solid var(--line-strong);
  background:linear-gradient(135deg, var(--o1), var(--o2));
  color:var(--ink-2); font-size:.8125rem; font-weight:700;
  line-height:1.1; cursor:pointer; overflow:hidden;
  box-shadow: var(--sh-sm), 0 12px 26px -18px rgba(99,102,241,.95);
  transition: transform .35s var(--ease-out), box-shadow .35s var(--ease-out),
              border-color .35s var(--ease-out);
}
/* the real surface, inset by 1px so the aura below shows as a live rim */
.orient-btn::after{
  content:''; position:absolute; inset:1px; z-index:-1; border-radius:13px;
  background:linear-gradient(135deg, rgba(99,102,241,.14), rgba(34,211,238,.10)), var(--surface);
}
/* slow conic aura — hidden at rest, revealed on hover and while switching */
.orient-btn::before{
  content:''; position:absolute; inset:-150%; z-index:-2;
  background:conic-gradient(from 0deg, transparent 0 58%, var(--o1) 76%, var(--o2) 90%, transparent 100%);
  opacity:0; transition:opacity .4s var(--ease);
  animation: orientSpin 3.2s linear infinite;
}
@keyframes orientSpin{ to{ transform:rotate(1turn); } }
.orient-btn:hover{
  transform:translateY(-2px); border-color:transparent;
  box-shadow: var(--sh-md), 0 18px 36px -18px rgba(99,102,241,1);
}
.orient-btn:hover::before,
.orient-btn.is-switching::before{ opacity:.85; }
.orient-btn:active{ transform:translateY(0) scale(.96); }
.orient-btn:focus-visible{ outline:2px solid var(--brand); outline-offset:2px; }

/* light sweep across the pill */
.orient-shine{ position:absolute; inset:0; border-radius:inherit; overflow:hidden; pointer-events:none; }
.orient-shine::before{
  content:''; position:absolute; top:-20%; bottom:-20%; width:36%; left:-50%;
  transform:skewX(-18deg);
  background:linear-gradient(90deg, transparent, rgba(129,140,248,.38), transparent);
  transition:left .7s var(--ease-out);
}
html.dark .orient-shine::before{
  background:linear-gradient(90deg, transparent, rgba(255,255,255,.30), transparent);
}
.orient-btn:hover .orient-shine::before,
.orient-btn.is-switching .orient-shine::before{ left:130%; }

/* the icon tile — a quarter turn IS the state change */
.orient-ico{
  position:relative; display:grid; place-items:center;
  width:28px; height:28px; border-radius:9px; flex:0 0 auto;
  background:linear-gradient(135deg, var(--o1), var(--o2)); color:#fff;
  box-shadow:0 8px 16px -10px rgba(99,102,241,1), inset 0 1px 0 rgba(255,255,255,.4);
  transition:transform .55s cubic-bezier(.34,1.56,.64,1);
}
.orient-btn[aria-pressed="true"] .orient-ico{ transform:rotate(90deg); }

/* the label swaps by sliding, so the pill width never jumps */
.orient-txt{ display:inline-grid; overflow:hidden; min-width:66px; text-align:left; line-height:1.15; }
.orient-txt > span{
  grid-area:1/1; white-space:nowrap;
  transition:transform .42s var(--ease-out), opacity .28s var(--ease);
}
.orient-btn .orient-lb-h{ transform:translateY(115%); opacity:0; }
.orient-btn[aria-pressed="true"] .orient-lb-v{ transform:translateY(-115%); opacity:0; }
.orient-btn[aria-pressed="true"] .orient-lb-h{ transform:translateY(0);     opacity:1; }

/* miniature track/knob — the switch read */
.orient-track{
  position:relative; flex:0 0 auto; width:30px; height:16px; border-radius:999px;
  background:var(--surface-3); border:1px solid var(--line);
  box-shadow:inset 0 1px 2px rgba(16,24,40,.14);
}
.orient-knob{
  position:absolute; top:1px; left:1px; width:12px; height:12px; border-radius:50%;
  background:linear-gradient(135deg, var(--o1), var(--o2));
  box-shadow:0 2px 6px -2px rgba(99,102,241,.9);
  transition:transform .45s cubic-bezier(.34,1.56,.64,1);
}
.orient-btn[aria-pressed="true"] .orient-knob{ transform:translateX(14px); }

/* a soft halo ping on press */
.orient-ping{
  position:absolute; inset:0; border-radius:inherit; pointer-events:none;
  border:2px solid rgba(99,102,241,.7); opacity:0;
}
.orient-btn.is-switching .orient-ping{ animation: orientPing .6s var(--ease-out); }
@keyframes orientPing{
  0%  { opacity:.9; transform:scale(.9); }
  100%{ opacity:0;  transform:scale(1.06); }
}
@media (prefers-reduced-motion: reduce){
  .orient-btn, .orient-ico, .orient-knob, .orient-txt > span{ transition:none; }
  .orient-btn::before, .orient-ping{ animation:none; }
}

/* the print menu's two orientation choices */
.print-opt{
  display:flex; align-items:center; gap:.65rem; width:100%;
  padding:.55rem .6rem; border-radius:12px; text-align:left;
  color:var(--ink-2); font-size:.8125rem; font-weight:600;
  transition:background .2s var(--ease), transform .2s var(--ease);
}
.print-opt:hover{ background:var(--brand-tint); transform:translateX(2px); }
.print-opt .print-opt-ico{
  display:grid; place-items:center; width:30px; height:30px; border-radius:9px; flex:0 0 auto;
  background:linear-gradient(135deg,#6366f1,#22d3ee); color:#fff;
  box-shadow:0 6px 14px -8px rgba(99,102,241,.95);
}
.print-opt[data-orient="landscape"] .print-opt-ico{ transform:rotate(90deg); }


/* ==========================================================================
   16. PRINT — true PVC CR80
   ==========================================================================
   A CR80 card is 85.60 x 53.98 mm. This design is portrait, so each face
   prints at 53.98 mm wide x 85.60 mm tall.

   The card is authored at 340 px wide. Rather than restyle every inner
   measurement in mm (which would alter the design), the whole face is scaled
   as one unit and its layout footprint corrected with negative margins, so
   two faces sit side by side on a single sheet at exact physical size.

     --pvc-card-h : 340px / (53.98/85.60)  = the design height at CR80 ratio
     --pvc-scale  : 53.98mm / 340px        = 203.99px / 340px
   ========================================================================== */
@page{ size: A4 portrait; margin: 12mm; }

@media print{
  :root{
    --pvc-w: 53.98mm;
    --pvc-h: 85.60mm;
    --pvc-card-w: 340px;
    --pvc-card-h: 539.16px;
    --pvc-scale: 0.5999706;
  }

  html, body{ background:#fff !important; }
  html.dark{ color-scheme: light; }
  /* a 100vh floor on screen must not reserve a whole sheet on paper */
  html, body, .app-bg, .app-shell{ min-height:0 !important; height:auto !important; }

  /* app chrome never prints */
  #sidebar, #backdrop, header, .site-footer, .no-print, .print-hide,
  #cmsModal, #menuScrim, [data-rowmenu]{ display:none !important; }
  .app-bg, main{ background:#fff !important; }
  main{ padding:0 !important; margin:0 !important; }

  /* When Print is pressed on a card page, `printCard()` hoists #printArea to be
     a direct child of <body> and hides the whole app root, so exactly one thing
     is on the sheet and no ancestor's padding can push a second page. */
  body.printing-card > #appRoot{ display:none !important; }
  body.printing-card > #printArea{ display:block !important; margin:0 !important; }

  #printArea{
    padding:0 !important; border:0 !important; box-shadow:none !important;
    background:#fff !important; display:block !important;
  }

  /* front + back, side by side, one page */
  #printArea .kmc-pair{
    display:flex !important;
    flex-direction:row !important;
    flex-wrap:nowrap !important;
    align-items:flex-start !important;
    justify-content:flex-start !important;
    gap:6mm !important;
    break-inside:avoid; page-break-inside:avoid;
  }

  #printArea .kmc-card{
    /* exact CR80 proportion, then scaled to exact CR80 millimetres */
    width: var(--pvc-card-w) !important;
    height: var(--pvc-card-h) !important;
    aspect-ratio: auto !important;
    transform: scale(var(--pvc-scale));
    transform-origin: top left;
    /* transforms do not shrink the layout box — reclaim the difference so the
       two faces occupy exactly 53.98 x 85.60 mm each */
    margin: 0 calc(var(--pvc-w) - var(--pvc-card-w))
              calc(var(--pvc-h) - var(--pvc-card-h)) 0 !important;
    border-radius: 5.3px;            /* 3.18mm at the pre-scale size */
    box-shadow: none !important;
    outline: 0.5px solid #cfd8cf;    /* faint cut guide */
    outline-offset: 0;
    break-inside: avoid; page-break-inside: avoid;
    break-after: auto; page-break-after: auto;
    overflow: hidden;
  }
  #printArea .kmc-card:last-child{ margin-right:0 !important; }

  /* keep the full green geometry + building watermark on paper */
  #printArea .kmc-card, #printArea .kmc-card *{
    -webkit-print-color-adjust:exact !important; print-color-adjust:exact !important; }
  #printArea .kmc-corner{ display:block !important; }
  #printArea .kmc-bg{ display:block !important; }
  #printArea .kmc-card::before{ display:block !important; }

  /* nothing else may push a second sheet */
  .panel{ box-shadow:none !important; border:0 !important; }
}

/* ==========================================================================
   16b. PRINT — true PVC CR80, LANDSCAPE
   ==========================================================================
   The horizontal face is the same trick as the portrait one in section 16,
   with the two axes swapped. Authored at 540 px wide:

     --pvc-l-card-h : 540px * (53.98/85.60) = 340.53px   (CR80 ratio)
     --pvc-l-scale  : 85.60mm / 540px       = 323.49px / 540px

   The two faces stack down the page rather than sitting side by side —
   2 x 53.98 mm of height always fits an A4 sheet, whereas 2 x 85.60 mm of
   width only just does, and a printer's own margins could clip the second.
   ========================================================================== */
@media print{
  :root{
    --pvc-l-w: 85.60mm;
    --pvc-l-h: 53.98mm;
    --pvc-l-card-w: 540px;
    --pvc-l-card-h: 340.53px;
    --pvc-l-scale: 0.5990511;
  }

  /* the on-screen fit/flip wrappers must not follow the card onto paper */
  .kmc-stage{ transform:none !important; margin:0 !important; width:auto !important; }
  .kmc-pair.is-flipping{ animation:none !important; }

  #printArea .kmc-pair.kmc-landscape{
    display:flex !important;
    flex-direction:column !important;
    flex-wrap:nowrap !important;
    align-items:flex-start !important;
    justify-content:flex-start !important;
    gap:6mm !important;
    break-inside:avoid; page-break-inside:avoid;
  }

  #printArea .kmc-pair.kmc-landscape .kmc-card{
    width: var(--pvc-l-card-w) !important;
    height: var(--pvc-l-card-h) !important;
    aspect-ratio: auto !important;
    transform: scale(var(--pvc-l-scale));
    transform-origin: top left;
    /* transforms do not shrink the layout box — reclaim the difference so each
       face occupies exactly 85.60 x 53.98 mm */
    margin: 0 calc(var(--pvc-l-w) - var(--pvc-l-card-w))
              calc(var(--pvc-l-h) - var(--pvc-l-card-h)) 0 !important;
    border-radius: 5.3px;          /* 3.18mm at the pre-scale size */
  }
}

/* ==========================================================================
   17. DASHBOARD LAYOUT CORRUPTION (Hidden Admin Panel QA bug)
   ========================================================================== */
.dash-broken h1,
.dash-broken h3,
.dash-broken h2{ color:transparent !important; }
.dash-broken .panel{ transform:skewX(-4deg) rotate(-1.2deg); border-color:rgba(244,63,94,.4) !important; }
.dash-broken .tile-purple,
.dash-broken .tile-blue,
.dash-broken .tile-green,
.dash-broken .tile-orange,
.dash-broken .tile-pink{
  transform:translateY(26px) rotate(4deg);
  margin-left:-28px;
  box-shadow:none !important;
}
.dash-broken .grid{ align-items:flex-start; gap:2px !important; }
.dash-broken canvas{ opacity:.25; filter:grayscale(1); }

/* ========================================================================== 
   18. CIVIC WORKSPACE — 2026 dashboard and navigation shell
   ========================================================================== */
:root{
  --sidebar-w:292px;
  --topbar-h:76px;
  --civic-night:#08181a;
  --civic-night-2:#0d2527;
  --civic-mint:#b9e4d4;
  --civic-teal:#2e827a;
  --civic-gold:#e5b968;
  --civic-paper:#f4f6fb;
}

*,*::before,*::after{ box-sizing:border-box; }
html,body{ margin:0; }
body{ font-family:'Manrope',system-ui,-apple-system,'Segoe UI',sans-serif; }
a{ color:inherit; text-decoration:none; }
button,input,select,textarea{ font:inherit; }
.hidden{ display:none !important; }
#appRoot{ display:flex; min-height:100vh; min-height:100dvh; overflow-x:clip; }
.app-bg{
  background:
    radial-gradient(1100px 560px at 88% -14%, rgba(99,102,241,.10), transparent 62%),
    radial-gradient(820px 460px at -8% 6%, rgba(16,185,129,.07), transparent 58%),
    radial-gradient(680px 420px at 40% 108%, rgba(124,58,237,.06), transparent 60%),
    linear-gradient(180deg,#f7f8fd 0%,var(--canvas) 100%);
  background-size:auto;
  background-attachment:fixed;
}
html.dark .app-bg{
  background:
    linear-gradient(rgba(185,228,212,.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(185,228,212,.018) 1px, transparent 1px),
    #081011;
  background-size:36px 36px;
}

/* Navigation is a dark civic rail in both color modes. */
.app-sidebar{
  display:flex; flex-direction:column; flex-shrink:0;
  overflow:hidden;
  color:#dfeae6;
  background:
    radial-gradient(320px 220px at 18% 0%, rgba(46,130,122,.22), transparent 70%),
    var(--civic-night);
  border-right:0;
  box-shadow:12px 0 42px rgba(4,18,20,.13);
  width:var(--sidebar-w);
  transition:transform .46s var(--ease-out), margin-left .46s var(--ease-out);
}
.sidebar-brand{
  position:relative;
  min-height:142px;
  padding:25px 23px 18px;
  flex-direction:column;
  align-items:stretch;
  justify-content:space-between;
  border-bottom:1px solid rgba(255,255,255,.08);
}
.rail-toggle{
  display:none; position:absolute; top:22px; right:14px; z-index:3;
  width:34px; height:34px; place-items:center; color:#7f9f98;
  background:rgba(255,255,255,.035); border:1px solid rgba(255,255,255,.08); border-radius:50%;
}
.rail-toggle:hover{ color:#f4faf7; background:rgba(255,255,255,.08); border-color:rgba(185,228,212,.24); transform:rotate(90deg); }
.rail-toggle svg{ display:none; }
.rail-toggle::before,.rail-toggle::after{
  content:''; position:absolute; width:14px; height:1.5px; border-radius:99px; background:currentColor;
}
.rail-toggle::before{ transform:rotate(45deg); }
.rail-toggle::after{ transform:rotate(-45deg); }
.civic-brand{ display:flex; align-items:center; gap:12px; min-width:0; }
.civic-brand-mark{
  width:45px; height:45px; flex:0 0 45px; display:grid; place-items:center;
  border-radius:50%; padding:7px; background:#f2f5ed;
  border:1px solid rgba(229,185,104,.5);
  box-shadow:0 0 0 5px rgba(255,255,255,.035), 0 12px 30px rgba(0,0,0,.22);
}
.civic-brand-mark img{ width:100%; height:100%; object-fit:contain; }
.civic-brand-copy{ display:flex; flex-direction:column; min-width:0; line-height:1.18; }
.civic-brand-copy b{ color:#f5faf7; font-size:13px; font-weight:700; letter-spacing:-.02em; white-space:nowrap; }
.civic-brand-copy small{ margin-top:4px; color:#87aaa2; font-size:9px; font-weight:700; letter-spacing:.16em; text-transform:uppercase; }
.civic-edition{ color:#5f807a; font-size:8.5px; font-weight:800; letter-spacing:.19em; }

.rail-heading{ display:flex; justify-content:space-between; align-items:center; padding:18px 23px 10px; }
.rail-heading span{ color:#587973; font-size:9px; font-weight:700; letter-spacing:.14em; text-transform:uppercase; }
.rail-heading strong{ color:var(--civic-gold); font-size:9px; font-weight:700; letter-spacing:.08em; text-transform:uppercase; }

.nav-rail{ flex:1; min-height:0; padding:4px 12px 22px; scrollbar-width:thin; scrollbar-color:rgba(255,255,255,.12) transparent; }
.nav-rail .nav-link{
  width:100%; min-height:46px; display:grid; grid-template-columns:24px 34px minmax(0,1fr) auto;
  align-items:center; gap:7px; padding:5px 9px; margin:2px 0; border:1px solid transparent;
  border-radius:10px; color:#83a09a; background:transparent; text-align:left;
  transition:color .24s var(--ease), background .24s var(--ease), transform .24s var(--ease), border-color .24s var(--ease);
}
.nav-rail .nav-link::before{ display:none; }
.nav-rail .nav-link:hover{
  color:#eef8f4; background:rgba(255,255,255,.045); border-color:rgba(255,255,255,.06);
  transform:translateX(3px);
}
.nav-index{ color:#42655f; font-size:8px; font-weight:700; letter-spacing:.08em; }
.nav-icon{
  width:31px; height:31px; display:grid; place-items:center; border-radius:9px;
  color:#779892; background:rgba(255,255,255,.035); transition:inherit;
}
.nav-icon svg{ width:16px; height:16px; }
.nav-label{ min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:12.5px; font-weight:600; }
.nav-signal{
  min-width:20px; height:20px; padding:0 6px; display:grid; place-items:center;
  color:#111f1d; background:var(--civic-gold); border-radius:999px; font-size:9px; font-weight:800;
}
.nav-signal-alert{ color:white; background:#d96767; }
.nav-rail .nav-active,
.nav-rail .nav-active:hover{
  color:#09201e; background:var(--civic-mint); border-color:rgba(255,255,255,.22);
  box-shadow:0 12px 28px -16px rgba(111,211,190,.75); transform:translateX(3px);
}
.nav-rail .nav-active .nav-index{ color:#448177; }
.nav-rail .nav-active .nav-icon{ color:#123f3b; background:rgba(8,42,38,.08); }
.nav-rail .nav-link i{ transition:none; }
.nav-rail .nav-link:hover i{ transform:none; }
.nav-group-toggle .group-caret{ width:15px; height:15px; color:#53756f; transition:transform .25s var(--ease); }
.nav-children{ margin:3px 8px 8px 64px; border-left:1px solid rgba(185,228,212,.17); }
.nav-child{
  position:relative; display:flex; align-items:center; justify-content:space-between; gap:7px;
  min-height:34px; margin-left:-1px; padding:7px 4px 7px 14px; color:#6f918b;
  border-left:1px solid transparent; font-size:11.5px; font-weight:600;
}
.nav-child::before{ content:''; position:absolute; left:-3px; width:5px; height:5px; border-radius:50%; background:#3b5c57; }
.nav-child svg{ width:12px; height:12px; opacity:.45; }
.nav-child b{ min-width:18px; text-align:center; color:var(--civic-gold); font-size:9px; }
.nav-child:hover,.nav-child-active{ color:#eef8f4; border-left-color:var(--civic-mint); }
.nav-child-active::before{ background:var(--civic-mint); box-shadow:0 0 0 4px rgba(185,228,212,.08); }
.nav-restricted{ margin-top:16px; padding-top:14px; border-top:1px solid rgba(255,255,255,.07); }
.nav-restricted>span{ display:block; padding:0 10px 5px; color:#526f6a; font-size:8px; font-weight:800; letter-spacing:.16em; }
.nav-tail{ width:14px; height:14px; color:var(--civic-gold); }

.rail-account{
  position:relative; display:grid; grid-template-columns:40px minmax(0,1fr) 32px; align-items:center; gap:10px;
  margin:0 12px 14px; padding:13px 10px; border-top:1px solid rgba(255,255,255,.08);
}
.rail-avatar{ position:relative; width:38px; height:38px; }
.rail-avatar>img,.rail-avatar>span{
  width:38px; height:38px; display:grid; place-items:center; border-radius:50%; object-fit:cover;
  color:#0a2825; background:var(--civic-mint); font-size:11px; font-weight:800;
}
.rail-avatar>i{ position:absolute; right:-1px; bottom:1px; width:9px; height:9px; border-radius:50%; background:#69d096; border:2px solid var(--civic-night); }
.rail-account-copy{ display:flex; flex-direction:column; min-width:0; line-height:1.25; }
.rail-account-copy strong{ color:#e9f3ef; font-size:11.5px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.rail-account-copy span{ margin-top:3px; color:#5d7c76; font-size:9px; letter-spacing:.06em; }
.rail-logout{ width:31px; height:31px; display:grid; place-items:center; color:#668781; border-radius:50%; }
.rail-logout:hover{ color:#f2c8c8; background:rgba(217,103,103,.12); }
.rail-logout svg{ width:15px; height:15px; }

/* Header */
.app-topbar{
  position:sticky; top:0; z-index:40;
  height:var(--topbar-h); display:flex; align-items:center; gap:16px; padding:0 27px;
  background:rgba(247,247,242,.88); border-color:rgba(8,24,26,.09);
  backdrop-filter:saturate(1.25) blur(18px); -webkit-backdrop-filter:saturate(1.25) blur(18px);
}
html.dark .app-topbar{ background:rgba(8,16,17,.86); border-color:rgba(255,255,255,.08); }
.sidebar-toggle,.topbar-icon{
  width:40px; height:40px; flex:0 0 auto; display:grid; place-items:center;
  color:var(--ink-muted); background:transparent; border:1px solid var(--line); border-radius:50%;
}
.sidebar-toggle:hover,.topbar-icon:hover{ color:var(--ink); background:var(--surface); border-color:var(--line-strong); box-shadow:var(--sh-sm); }
.sidebar-toggle svg,.topbar-icon svg{ width:17px; height:17px; }
.sidebar-toggle>svg{ display:none; }
.sidebar-toggle::before,.sidebar-toggle::after{
  content:''; position:absolute; width:16px; height:1.5px; border-radius:99px; background:currentColor;
  transition:transform .28s var(--ease-out),box-shadow .28s var(--ease-out);
}
html[data-sidebar="closed"] .sidebar-toggle::before{ transform:translateY(-5px); box-shadow:0 5px 0 currentColor,0 10px 0 currentColor; }
html[data-sidebar="closed"] .sidebar-toggle::after{ opacity:0; }
html[data-sidebar="open"] .sidebar-toggle::before{ transform:rotate(45deg); box-shadow:none; }
html[data-sidebar="open"] .sidebar-toggle::after{ transform:rotate(-45deg); }
.mobile-civic-brand{ display:none; align-items:center; gap:8px; }
.mobile-civic-brand>span{ width:32px; height:32px; padding:5px; display:grid; place-items:center; border-radius:50%; background:#eef3ea; border:1px solid #d8e4d3; }
.mobile-civic-brand img{ width:100%; height:100%; object-fit:contain; }
.mobile-civic-brand b{ color:var(--ink); font-size:12px; letter-spacing:.08em; }
.topbar-context{ display:flex; flex-direction:column; min-width:0; line-height:1.2; }
.topbar-context span{ color:var(--ink-faint); font-size:8px; font-weight:800; letter-spacing:.15em; text-transform:uppercase; }
.topbar-context strong{ margin-top:4px; color:var(--ink); font-size:13px; font-weight:700; }
.topbar-status{ margin-left:auto; display:flex; align-items:center; gap:7px; color:var(--ink-muted); font-size:10px; font-weight:700; letter-spacing:.02em; }
.topbar-status i{ width:7px; height:7px; border-radius:50%; background:#44a777; box-shadow:0 0 0 5px rgba(68,167,119,.1); animation:civicPulse 2.8s ease-in-out infinite; }
.topbar-actions{ display:flex; align-items:center; gap:7px; }
.topbar-icon{ position:relative; }
.topbar-icon>span{ position:absolute; top:-3px; right:-3px; min-width:17px; height:17px; padding:0 4px; display:grid; place-items:center; color:white; background:#c95656; border:2px solid var(--surface); border-radius:999px; font-size:8px; font-weight:800; }
.topbar-user{ display:flex; align-items:center; gap:5px; height:42px; padding:3px 8px 3px 3px; border:1px solid var(--line); border-radius:999px; }
.topbar-user:hover{ background:var(--surface); border-color:var(--line-strong); box-shadow:var(--sh-sm); }
.topbar-user>img,.topbar-user>span{ width:34px; height:34px; display:grid; place-items:center; object-fit:cover; border-radius:50%; color:#0a2825; background:var(--civic-mint); font-size:10px; font-weight:800; }
.topbar-user>svg{ width:13px; height:13px; color:var(--ink-faint); }
.topbar-dropdown{ position:absolute; right:0; top:calc(100% + 10px); width:205px; padding:7px; border-radius:14px; box-shadow:var(--sh-xl); }
.topbar-dropdown a{ display:flex; align-items:center; gap:10px; padding:10px; color:var(--ink-muted); border-radius:9px; font-size:12px; font-weight:600; }
.topbar-dropdown a:hover{ color:var(--ink); background:var(--surface-3); }
.topbar-dropdown a+a{ border-top:1px solid var(--line-soft); }
.topbar-dropdown svg{ width:15px; height:15px; }
.topbar-dropdown .dropdown-signout{ color:var(--danger); }
.app-main-content{ width:100%; padding:clamp(14px,2.2vw,30px); }
.app-shell{ flex:1; min-width:0; }
#backdrop{ position:fixed; inset:var(--topbar-h) 0 0; }

@keyframes civicPulse{ 0%,100%{ opacity:1; transform:scale(1); } 50%{ opacity:.6; transform:scale(.82); } }

/* Dashboard */
.dashboard-rebuild{ width:min(1480px,100%); margin:0 auto; display:flex; flex-direction:column; gap:clamp(16px,2.2vw,28px); }
.dashboard-rebuild h1,.dashboard-rebuild h2{ margin:0; }
.dashboard-alert{
  display:flex; align-items:center; gap:13px; padding:13px 15px; color:#f3e2cf;
  background:#332b25; border:1px solid rgba(229,185,104,.24); border-radius:13px;
}
.dashboard-alert-icon{ width:34px; height:34px; display:grid; place-items:center; border-radius:50%; background:rgba(229,185,104,.12); color:var(--civic-gold); }
.dashboard-alert-icon svg{ width:16px; }
.dashboard-alert strong{ color:white; font-size:12px; }
.dashboard-alert p{ margin:2px 0 0; color:#a9998a; font-size:10px; }
.dashboard-alert>a{ margin-left:auto; display:flex; align-items:center; gap:6px; color:var(--civic-gold); font-size:11px; font-weight:700; }
.dashboard-alert>a svg{ width:13px; }

.civic-intro{
  position:relative; isolation:isolate; min-height:425px; overflow:hidden; display:grid;
  grid-template-columns:minmax(0,1fr) minmax(190px,.32fr); grid-template-rows:1fr auto;
  padding:clamp(28px,4.5vw,68px); color:#e8f1ed; background:var(--civic-night);
  border-radius:28px 28px 7px 28px; box-shadow:0 32px 80px -48px rgba(4,26,27,.72);
  animation:civicEnter .75s var(--ease-out) both;
}
.civic-intro::before{
  content:''; position:absolute; inset:0; z-index:-2; background-image:var(--signal-art);
  background-size:cover; background-position:center; opacity:.62; filter:saturate(.9) contrast(1.04);
  animation:signalDrift 18s ease-in-out infinite alternate;
}
.civic-intro::after{
  content:''; position:absolute; inset:0; z-index:-1;
  background:linear-gradient(90deg, rgba(4,18,20,.38), rgba(4,18,20,.05) 62%, rgba(4,18,20,.16));
}
.civic-intro-grid{
  position:absolute; inset:0; z-index:-1; opacity:.11; pointer-events:none;
  background:linear-gradient(90deg,transparent calc(50% - .5px),rgba(255,255,255,.38) 50%,transparent calc(50% + .5px));
}
.civic-intro-copy{ align-self:center; max-width:700px; }
.civic-kicker{ display:inline-flex; align-items:center; gap:8px; color:var(--civic-gold); font-size:9px; font-weight:800; letter-spacing:.18em; text-transform:uppercase; }
.civic-kicker svg{ width:14px; height:14px; }
.civic-intro h1{
  margin-top:17px; color:#f0f6f2; font-family:'Newsreader',Georgia,serif;
  font-size:clamp(45px,6vw,82px); font-weight:500; line-height:.9; letter-spacing:-.055em;
}
.civic-intro-copy>p{ max-width:555px; margin:24px 0 0; color:#9eb6af; font-size:clamp(12px,1.15vw,15px); line-height:1.75; }
.civic-intro-meta{ align-self:center; justify-self:end; display:flex; flex-direction:column; align-items:flex-end; gap:20px; }
.civic-date{ display:grid; grid-template-columns:auto auto; column-gap:10px; align-items:end; padding-left:20px; border-left:1px solid rgba(229,185,104,.4); }
.civic-date>span{ grid-column:1/-1; color:#718f88; font-size:8px; font-weight:800; letter-spacing:.16em; text-transform:uppercase; }
.civic-date strong{ color:#f1f5f2; font-family:'Newsreader',Georgia,serif; font-size:56px; font-weight:500; line-height:.82; }
.civic-date small{ max-width:52px; padding-bottom:2px; color:var(--civic-gold); font-size:9px; font-weight:700; line-height:1.3; text-transform:uppercase; }
.civic-session{ display:flex; align-items:center; gap:10px; }
.civic-session-dot{ width:9px; height:9px; border-radius:50%; background:#66d19a; box-shadow:0 0 0 6px rgba(102,209,154,.09); }
.civic-session>span:last-child{ display:flex; flex-direction:column; text-align:right; }
.civic-session b{ color:#dbe8e3; font-size:9px; text-transform:uppercase; letter-spacing:.08em; }
.civic-session small{ margin-top:3px; color:#688981; font-size:9px; }
.civic-intro-foot{ grid-column:1/-1; align-self:end; display:flex; gap:10px 34px; margin-top:40px; padding-top:17px; border-top:1px solid rgba(255,255,255,.11); }
.civic-intro-foot span{ display:flex; align-items:center; gap:8px; color:#6f8f88; font-size:9px; font-weight:700; letter-spacing:.05em; text-transform:uppercase; }
.civic-intro-foot svg{ width:13px; height:13px; color:#a5c7bd; }

/* ---- the card, alone and centred on the page ground -------------------- */
.identity-solo{
  display:flex; align-items:center; justify-content:center;
  padding:clamp(26px,5vw,60px) 16px;
  animation:civicEnter .75s .08s var(--ease-out) both;
}
.identity-solo .showcase-stage{ width:min(520px,100%); }
.identity-solo .showcase-card{ width:100%; }

.heroic-deck{
  display:grid; grid-template-columns:minmax(0,1.42fr) minmax(310px,.72fr); grid-template-rows:repeat(2,minmax(255px,1fr));
  gap:16px; min-height:560px; animation:civicEnter .75s .16s var(--ease-out) both;
}
.command-hero,.radar-block,.flow-block{ position:relative; isolation:isolate; overflow:hidden; }
.command-hero{
  grid-row:1/3; min-height:560px; display:flex; flex-direction:column; justify-content:space-between;
  padding:clamp(34px,5vw,72px); color:#e6f0ec; background:
    radial-gradient(580px 430px at 100% 5%,rgba(63,152,141,.22),transparent 64%),
    linear-gradient(145deg,#0b2224,#061416 78%); border-radius:28px 8px 28px 28px;
  box-shadow:0 30px 70px -45px rgba(5,30,32,.75);
}
.command-hero::before{
  content:''; position:absolute; inset:0; z-index:-2; opacity:.16;
  background:linear-gradient(rgba(185,228,212,.12) 1px,transparent 1px),linear-gradient(90deg,rgba(185,228,212,.12) 1px,transparent 1px);
  background-size:46px 46px; -webkit-mask-image:linear-gradient(105deg,#000,transparent 78%); mask-image:linear-gradient(105deg,#000,transparent 78%);
}
.command-hero::after{
  content:'KMC'; position:absolute; right:-14px; bottom:10px; z-index:-1;
  color:transparent; -webkit-text-stroke:1px rgba(185,228,212,.08);
  font-size:clamp(120px,20vw,285px); font-weight:800; line-height:.72; letter-spacing:-.1em;
}
.command-arc{
  position:absolute; top:-195px; right:-175px; z-index:-1; width:520px; height:520px;
  border:1px solid rgba(229,185,104,.18); border-radius:50%;
  box-shadow:0 0 0 54px rgba(185,228,212,.025),0 0 0 110px rgba(185,228,212,.018);
  animation:commandOrbit 26s linear infinite;
}
.command-arc::before,.command-arc::after{ content:''; position:absolute; border-radius:50%; }
.command-arc::before{ left:63px; bottom:8px; width:9px; height:9px; background:var(--civic-gold); box-shadow:0 0 24px rgba(229,185,104,.9); }
.command-arc::after{ inset:81px; border:1px dashed rgba(185,228,212,.15); }
.command-glint{ position:absolute; z-index:-1; inset:-50%; background:linear-gradient(108deg,transparent 43%,rgba(255,255,255,.055) 50%,transparent 57%); transform:translateX(-45%) rotate(2deg); animation:commandGlint 8s ease-in-out infinite; }
.command-copy{ position:relative; z-index:2; max-width:590px; }
.heroic-kicker{ display:inline-flex; align-items:center; gap:8px; color:var(--civic-gold); font-size:8.5px; font-weight:800; letter-spacing:.18em; text-transform:uppercase; }
.heroic-kicker svg{ width:14px; height:14px; }
.command-hero h2{
  margin:22px 0 0; color:#f3f7f4; font-family:'Newsreader',Georgia,serif;
  font-size:clamp(58px,7vw,94px); font-weight:500; line-height:.82; letter-spacing:-.055em;
}
.command-copy>p{ max-width:500px; margin:28px 0 0; color:#8eaaa3; font-size:12px; line-height:1.75; }
.command-launch{
  width:min(100%,300px); min-height:58px; margin-top:34px; padding:0 9px 0 21px;
  display:flex; align-items:center; justify-content:space-between; gap:15px;
  color:#0a2522; background:var(--civic-mint); border-radius:999px; font-size:10.5px; font-weight:800;
  box-shadow:0 20px 40px -22px rgba(104,211,188,.75);
}
.command-launch>b{ width:40px; height:40px; flex:0 0 40px; display:grid; place-items:center; color:#f9f7ee; background:#175f59; border-radius:50%; }
.command-launch svg{ width:15px; height:15px; }
.command-launch:hover{ padding-left:26px; background:#caeee1; transform:translateY(-3px); box-shadow:0 25px 45px -20px rgba(104,211,188,.9); }
.command-launch:hover>b{ transform:rotate(45deg); }
.command-foot{ position:relative; z-index:2; display:flex; align-items:center; justify-content:space-between; gap:20px; padding-top:21px; border-top:1px solid rgba(255,255,255,.1); color:#63857e; font-size:8px; font-weight:800; letter-spacing:.12em; text-transform:uppercase; }
.command-foot span:first-child{ display:flex; align-items:center; gap:8px; }
.command-foot i{ width:7px; height:7px; border-radius:50%; background:#69d098; box-shadow:0 0 0 5px rgba(105,208,152,.1); animation:civicPulse 2.8s ease-in-out infinite; }

.radar-block{
  min-height:255px; padding:24px; color:#18332f; background:linear-gradient(145deg,#f0d99d,#d7af5d);
  border-radius:8px 28px 8px 28px; box-shadow:0 25px 55px -38px rgba(91,67,18,.72);
}
.radar-block>header,.flow-block>header{ position:relative; z-index:5; display:flex; align-items:center; justify-content:space-between; font-size:8px; font-weight:800; letter-spacing:.16em; }
.radar-block>header svg,.flow-block>header svg{ width:15px; height:15px; }
.radar-visual{ position:absolute; right:-42px; top:-58px; width:250px; height:250px; display:grid; place-items:center; border-radius:50%; }
.radar-ring{ position:absolute; border:1px solid rgba(20,60,53,.16); border-radius:50%; }
.radar-ring-one{ width:182px; height:182px; }
.radar-ring-two{ width:118px; height:118px; border-style:dashed; animation:radarCounter 14s linear infinite; }
.radar-sweep{ position:absolute; width:210px; height:210px; border-radius:50%; background:conic-gradient(from 0deg,rgba(19,80,70,.28),transparent 23%,transparent); animation:radarSpin 4.8s linear infinite; }
.radar-sweep::after{ content:''; position:absolute; inset:50% 50% 0 50%; width:1px; background:linear-gradient(rgba(19,80,70,.5),transparent); transform-origin:top; }
.radar-core{ position:relative; z-index:3; width:52px; height:52px; display:grid; place-items:center; color:#184d46; background:rgba(255,250,228,.58); border:1px solid rgba(20,60,53,.12); border-radius:50%; box-shadow:0 12px 35px rgba(87,60,12,.12); }
.radar-core svg{ width:23px; height:23px; }
.radar-ping{ position:absolute; z-index:4; width:7px; height:7px; border-radius:50%; background:#184d46; box-shadow:0 0 0 6px rgba(24,77,70,.09); animation:radarPing 2.2s ease-in-out infinite; }
.radar-ping-one{ top:72px; left:50px; }
.radar-ping-two{ right:45px; bottom:62px; animation-delay:-1.1s; }
.radar-copy{ position:absolute; left:24px; right:120px; bottom:23px; z-index:5; display:flex; flex-direction:column; }
.radar-copy strong{ color:#153b35; font-family:'Newsreader',Georgia,serif; font-size:23px; font-weight:600; letter-spacing:-.03em; }
.radar-copy span{ max-width:175px; margin-top:5px; color:rgba(20,55,49,.68); font-size:8.5px; line-height:1.55; }

.flow-block{
  min-height:255px; padding:24px; color:#dbeae4; background:linear-gradient(145deg,#1f625d,#123f3c);
  border-radius:28px 8px 28px 8px; box-shadow:0 25px 55px -38px rgba(12,67,62,.75);
}
.flow-block>header{ color:#93c0b7; }
.flow-trace{ position:absolute; inset:0; z-index:-1; opacity:.8; }
.flow-trace svg{ position:absolute; inset:auto 0 0; width:100%; height:68%; overflow:visible; }
.flow-trace path{ fill:none; vector-effect:non-scaling-stroke; }
.flow-trace-base{ stroke:rgba(185,228,212,.1); stroke-width:1.2; }
.flow-trace-live{ stroke:var(--civic-gold); stroke-width:1.6; stroke-linecap:round; stroke-dasharray:2 12 44 18; animation:flowDash 7s linear infinite; filter:drop-shadow(0 0 5px rgba(229,185,104,.45)); }
.flow-star{ position:absolute; width:6px; height:6px; border-radius:50%; background:var(--civic-gold); box-shadow:0 0 13px rgba(229,185,104,.85); animation:radarPing 2.4s ease-in-out infinite; }
.flow-star-one{ left:31%; bottom:62%; }
.flow-star-two{ left:70%; bottom:27%; animation-delay:-.8s; }
.flow-star-three{ right:9%; bottom:57%; animation-delay:-1.6s; }
.flow-copy{ position:relative; z-index:3; margin-top:28px; }
.flow-copy h3{ margin:0; color:#edf6f2; font-family:'Newsreader',Georgia,serif; font-size:31px; font-weight:500; line-height:.93; letter-spacing:-.04em; }
.flow-copy p{ max-width:205px; margin:11px 0 0; color:#8ab0a8; font-size:8.5px; line-height:1.55; }
.flow-steps{ position:absolute; left:24px; right:24px; bottom:21px; z-index:4; display:flex; gap:15px; }
.flow-steps span{ color:#85aaa3; font-size:7.5px; font-weight:700; letter-spacing:.08em; text-transform:uppercase; }
.flow-steps b{ margin-right:4px; color:var(--civic-gold); }

.dashboard-signoff{ display:grid; grid-template-columns:1fr auto 1fr; align-items:center; padding:5px 7px 16px; color:var(--ink-faint); font-size:8px; font-weight:700; letter-spacing:.11em; text-transform:uppercase; }
.dashboard-signoff p{ margin:0; color:var(--ink-muted); font-family:'Newsreader',Georgia,serif; font-size:14px; font-weight:500; letter-spacing:.01em; text-transform:none; }
.dashboard-signoff span:last-child{ text-align:right; }

@keyframes civicEnter{ from{ opacity:0; transform:translateY(20px); clip-path:inset(0 0 16% 0 round 28px); } to{ opacity:1; transform:none; clip-path:inset(0 0 0 0 round 0); } }
@keyframes signalDrift{ from{ transform:scale(1.01) translate3d(-.3%,0,0); } to{ transform:scale(1.055) translate3d(.5%,-.8%,0); } }
@keyframes orbitSpin{ to{ transform:rotate(360deg); } }
@keyframes commandOrbit{ to{ transform:rotate(360deg); } }
@keyframes commandGlint{ 0%,22%{ transform:translateX(-45%) rotate(2deg); } 65%,100%{ transform:translateX(45%) rotate(2deg); } }
@keyframes radarSpin{ to{ transform:rotate(360deg); } }
@keyframes radarCounter{ to{ transform:rotate(-360deg); } }
@keyframes radarPing{ 0%,100%{ opacity:.42; transform:scale(.72); } 50%{ opacity:1; transform:scale(1); } }
@keyframes flowDash{ to{ stroke-dashoffset:-152; } }


@media (max-width:1100px){
  .heroic-deck{ grid-template-columns:minmax(0,1.2fr) minmax(280px,.8fr); }
  .command-hero{ padding:44px; }
}

@media (max-width:900px){
  .heroic-deck{ grid-template-columns:repeat(2,minmax(0,1fr)); grid-template-rows:auto auto; }
  .command-hero{ grid-column:1/-1; grid-row:auto; min-height:500px; }
}

@media (min-width:1024px){
  html[data-sidebar="open"] .rail-toggle{ display:grid; }
  html[data-sidebar="open"] #sidebarToggle{ display:none; }
  html[data-sidebar="closed"] #sidebarToggle{ display:grid; }
}

@media (max-width:1023px){
  #sidebar{ width:min(88vw,310px); }
  .mobile-civic-brand{ display:flex; }
  .app-topbar{ padding:0 18px; }
}

@media (max-width:700px){
  .app-main-content{ padding:12px; }
  .topbar-status{ display:none; }
  .civic-intro{
    min-height:570px; grid-template-columns:1fr; grid-template-rows:1fr auto auto;
    padding:34px 25px 25px; border-radius:22px 22px 6px 22px;
  }
  .civic-intro-grid{ display:none; }
  .civic-intro-copy{ align-self:start; padding-top:26px; }
  .civic-intro h1{ font-size:clamp(45px,15vw,66px); line-height:.92; }
  .civic-intro-copy>p{ margin-top:18px; font-size:11.5px; }
  .civic-intro-meta{ width:100%; align-self:end; justify-self:stretch; flex-direction:row; align-items:end; justify-content:space-between; }
  .civic-date strong{ font-size:47px; }
  .civic-intro-foot{ grid-column:1; display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:11px 15px; margin-top:23px; padding-bottom:3px; }
  .civic-intro-foot span{ min-width:0; font-size:7.5px; line-height:1.35; }
  .civic-intro-foot span:last-child{ grid-column:1/-1; }
  .heroic-deck{ grid-template-columns:1fr; grid-template-rows:auto; gap:12px; }
  .command-hero,.radar-block,.flow-block{ grid-column:1; grid-row:auto; }
  .command-hero{ min-height:520px; padding:38px 27px; border-radius:22px 7px 22px 22px; }
  .command-hero h2{ font-size:clamp(58px,17vw,78px); }
  .command-copy>p{ max-width:430px; }
  .radar-block{ min-height:340px; border-radius:7px 22px 7px 22px; }
  .radar-visual{ right:-12px; top:-22px; width:270px; height:270px; }
  .radar-copy{ right:150px; }
  .flow-block{ min-height:350px; border-radius:22px 7px 22px 7px; }
  .flow-copy{ margin-top:54px; }
  .flow-copy h3{ font-size:40px; }
  .flow-copy p{ max-width:240px; font-size:9.5px; }
  .dashboard-signoff{ grid-template-columns:1fr auto; gap:10px; }
  .dashboard-signoff p{ display:none; }
}

@media (max-width:500px){
  .app-topbar{ padding:0 12px; gap:9px; }
  .topbar-context{ display:none; }
  .mobile-civic-brand{ margin-right:auto; }
  .topbar-actions{ gap:4px; }
  .sidebar-toggle,.topbar-icon{ width:38px; height:38px; }
  .topbar-user>svg{ display:none; }
  .topbar-user{ width:40px; padding:2px; justify-content:center; }
  .civic-intro-meta{ gap:15px; }
  .civic-session>span:last-child{ display:flex; }
  .command-launch{ width:100%; }
  .command-foot{ align-items:flex-start; flex-direction:column; gap:10px; }
  .radar-copy{ right:112px; }
  .dashboard-alert{ align-items:flex-start; }
  .dashboard-alert>a{ font-size:0; }
  .dashboard-alert>a svg{ width:16px; }
}

@media (max-width:390px){
  .civic-intro{ min-height:535px; padding-left:20px; padding-right:20px; }
  .civic-intro h1{ font-size:44px; }
  .command-hero{ min-height:500px; padding-left:22px; padding-right:22px; }
  .command-hero h2{ font-size:55px; }
  .command-copy>p{ font-size:10.5px; }
  .radar-block,.flow-block{ padding:21px; }
  .radar-copy{ left:21px; right:105px; }
  .flow-steps{ left:21px; right:21px; gap:9px; }
  .flow-steps span{ font-size:6.8px; }
}

@media (prefers-reduced-motion:reduce){
  .civic-intro::before,.topbar-status i,.command-arc,.command-glint,
  .radar-ring-two,.radar-sweep,.radar-ping,.flow-trace-live,.flow-star,.command-foot i{ animation:none; }
}

@media print{
  .dashboard-rebuild{ display:none !important; }
}

/* ========================================================================== 
   19. ORIGINAL LIGHT SHELL + HAND-COMPOSED DASHBOARD
   Restores the initial white navigation language and replaces the generated
   dashboard artwork with a restrained, interface-native light composition.
   ========================================================================== */
:root{
  --sidebar-w:264px;
  --topbar-h:68px;
}
body{ font-family:'Inter',system-ui,-apple-system,'Segoe UI',sans-serif; }

/* Original white navigation rail. */
.app-sidebar{
  color:var(--ink-3);
  background:var(--surface);
  border-right:1px solid var(--line);
  box-shadow:var(--sh-xs);
  width:var(--sidebar-w);
  overflow:hidden;
  transition:transform .3s var(--ease),margin-left .3s var(--ease);
}
.app-sidebar>.sidebar-brand{
  position:relative; height:68px; min-height:68px; padding:0 20px;
  flex-direction:row; align-items:center; justify-content:flex-start;
  background:var(--surface); border-bottom:1px solid var(--line-soft);
}
.app-sidebar>nav{ flex:1; min-height:0; }
.app-sidebar .sidebar-brand>div:first-child{
  width:44px; height:44px; flex:0 0 44px; display:grid; place-items:center;
  padding:6px; border-radius:12px;
}
.app-sidebar .sidebar-wordmark{ min-width:0; line-height:1.2; }
.app-sidebar .sidebar-brand p{ margin:0; }
.app-sidebar .sidebar-brand p:first-child{ overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:13px; font-weight:800; }
.app-sidebar .sidebar-brand p:last-child{ margin-top:3px; font-size:9.5px; font-weight:700; }
.app-sidebar>nav{ overflow-y:auto; padding:16px 12px 24px; }
.app-sidebar>nav>p{ margin:0; padding:0 12px 6px; color:var(--ink-faint); font-size:10px; font-weight:700; letter-spacing:.14em; text-transform:uppercase; }
.app-sidebar>nav>a.nav-link,
.app-sidebar>nav>div>button.nav-link{
  width:100%; min-height:42px; display:flex; align-items:center; gap:12px;
  margin:2px 0; padding:10px 12px; border:0; border-radius:12px;
  background:transparent; font-size:14px; font-weight:500; text-align:left; cursor:pointer;
}
.app-sidebar>nav .nav-link>svg{ width:18px; height:18px; flex:0 0 18px; }
.app-sidebar>nav .nav-link>span{ min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.app-sidebar>nav .nav-link>span.ml-auto{ margin-left:auto; min-width:20px; padding:2px 6px; overflow:visible; color:#a16207; background:#fef3c7; border-radius:999px; font-size:10px; font-weight:800; text-align:center; }
.app-sidebar>nav .group-caret{ width:16px; height:16px; margin-left:auto; }
.app-sidebar>nav .group-body{ margin:4px 0 5px 16px; padding-left:12px; border-left:1px solid var(--line); }
.app-sidebar>nav .group-body .nav-link{
  min-height:36px; display:flex; align-items:center; gap:10px; padding:8px 10px;
  border-radius:9px; font-size:13px;
}
.app-sidebar>nav .group-body .nav-link>svg{ width:16px; height:16px; flex:0 0 16px; }
.app-sidebar>nav .nav-link{ color:var(--ink-muted); }
.app-sidebar>nav .nav-link:hover{ color:var(--ink); background:var(--surface-3); }
.app-sidebar>nav .nav-active,
.app-sidebar>nav .nav-active:hover{
  color:#fff; background:linear-gradient(100deg,var(--brand) 0%,var(--violet) 130%) !important;
  box-shadow:var(--sh-brand);
}
.app-sidebar>nav .nav-active>span{ color:#fff; }
.app-sidebar>nav>div[class*="pt-3"]{ margin-top:12px; padding-top:12px; border-top:1px solid var(--line-soft); }
.app-sidebar>nav>div[class*="pt-3"]>p{ margin:0; padding:0 12px 6px; color:var(--ink-faint); font-size:10px; font-weight:700; letter-spacing:.14em; text-transform:uppercase; }
.app-sidebar>nav>div[class*="pt-3"]>.nav-link{ border:1px solid var(--line); }
.app-sidebar>div:last-child{ position:relative; padding:12px; border-top:1px solid var(--line-soft); }
.app-sidebar>div:last-child>div{
  display:flex; align-items:center; gap:12px; padding:10px 12px;
  background:var(--surface-2); border:1px solid var(--line-soft); border-radius:12px;
}
.app-sidebar>div:last-child>div>div:first-child{ position:relative; flex:0 0 auto; }
.app-sidebar>div:last-child img,
.app-sidebar>div:last-child>div>div:first-child>div{
  width:36px; height:36px; display:grid; place-items:center; object-fit:cover;
  border-radius:50%; color:#fff; background:linear-gradient(135deg,#6366f1,#7c3aed); font-size:11px; font-weight:800;
}
.app-sidebar>div:last-child>div>div:first-child>span{
  position:absolute; right:-2px; bottom:-2px; width:12px; height:12px;
  background:#10b981; border:2px solid var(--surface); border-radius:50%;
}
.app-sidebar>div:last-child>div>div:last-child{ min-width:0; }
.app-sidebar>div:last-child p{ margin:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.app-sidebar>div:last-child p:first-child{ color:var(--ink) !important; font-size:13px; font-weight:600; }
.app-sidebar>div:last-child p:last-child{ margin-top:3px; color:var(--ink-muted); font-size:11px; }
.app-sidebar .sidebar-brand p.text-white{ color:var(--ink) !important; }
.app-sidebar>div:last-child p.text-white{ color:var(--ink) !important; }
.app-sidebar .nav-scroll-fade{ background:linear-gradient(180deg,transparent,var(--surface)); }

/* The old header-mounted toggle is always reachable on desktop. */
@media (min-width:1024px){
  html[data-sidebar="open"] #sidebarToggle,
  html[data-sidebar="closed"] #sidebarToggle{ display:grid !important; }
}

/* Keep the requested dashboard light even if a stale dark preference exists. */
html:not(.dark) .dashboard-rebuild{
  --surface:#fff;
  --surface-2:#f8fafc;
  --surface-3:#f1f5f9;
  --line:#e4e9f1;
  --line-soft:#eef2f7;
  --line-strong:#d4dce8;
  --ink:#0f172a;
  --ink-2:#1e293b;
  --ink-3:#334155;
  --ink-muted:#64748b;
  --ink-faint:#8491a4;
}
.dashboard-rebuild h1,.dashboard-rebuild h2,.dashboard-rebuild h3{
  font-family:'Inter',system-ui,sans-serif;
}

.civic-intro{
  min-height:360px; grid-template-columns:minmax(0,1fr) minmax(185px,.28fr);
  padding:clamp(34px,4.5vw,64px); color:#334155; background:#fff;
  border:1px solid #e3e8f0; border-radius:20px; box-shadow:0 20px 52px -38px rgba(15,23,42,.25);
}
.civic-intro::before{ display:none; }
.civic-intro::after{
  inset:0 auto auto 0; z-index:1; width:100%; height:4px;
  background:linear-gradient(90deg,#087c62 0 19%,#d6ab54 19% 27%,#e7ebf0 27% 100%);
}
.civic-intro-grid{
  inset:0 0 0 auto; width:44%; opacity:.32;
  background:
    linear-gradient(rgba(15,118,110,.055) 1px,transparent 1px),
    linear-gradient(90deg,rgba(15,118,110,.055) 1px,transparent 1px);
  background-size:30px 30px;
  -webkit-mask-image:linear-gradient(90deg,transparent,#000); mask-image:linear-gradient(90deg,transparent,#000);
}
.civic-intro-copy{ position:relative; z-index:2; max-width:720px; }
.civic-kicker{ color:#087c62; font-size:9px; letter-spacing:.16em; }
.civic-kicker svg{ color:#087c62; }
.civic-intro h1{
  margin-top:20px; color:#0f172a; font-size:clamp(48px,6vw,76px); font-weight:800;
  line-height:.95; letter-spacing:-.055em;
}
.civic-intro-copy>p{ max-width:610px; margin-top:22px; color:#64748b; font-size:13px; line-height:1.75; }
.civic-intro-meta{ position:relative; z-index:2; }
.civic-date{ border-left-color:#d7b15f; }
.civic-date>span{ color:#8794a6; }
.civic-date strong{ color:#0f172a; font-family:'Inter',sans-serif; font-size:52px; font-weight:800; letter-spacing:-.06em; }
.civic-date small{ color:#8d681f; }
.civic-session-dot{ background:#15916f; box-shadow:0 0 0 6px rgba(21,145,111,.09); }
.civic-session b{ color:#334155; }
.civic-session small{ color:#8794a6; }
.civic-intro-foot{ position:relative; z-index:2; margin-top:30px; padding-top:16px; border-top-color:#e5eaf1; }
.civic-intro-foot span{ color:#758397; }
.civic-intro-foot svg{ color:#087c62; }

/* Light, deliberately structured command blocks. */
.command-hero{
  color:#334155; background:#fff; border:1px solid #e1e7ef;
  box-shadow:0 22px 55px -40px rgba(15,23,42,.25);
}
.command-hero::before{
  opacity:1; background:
    linear-gradient(rgba(15,118,110,.045) 1px,transparent 1px),
    linear-gradient(90deg,rgba(15,118,110,.045) 1px,transparent 1px);
}
.command-hero::after{ color:#f4f7f8; -webkit-text-stroke:0; }
.command-arc{ border-color:rgba(15,118,110,.14); box-shadow:0 0 0 54px rgba(15,118,110,.018),0 0 0 110px rgba(15,118,110,.012); }
.command-arc::after{ border-color:rgba(15,118,110,.12); }
.command-glint{ opacity:.25; }
.heroic-kicker{ color:#087c62; }
.command-hero h2{ color:#0f172a; font-size:clamp(50px,6.4vw,78px); font-weight:800; line-height:.88; letter-spacing:-.055em; }
.command-copy>p{ color:#64748b; }
.command-launch{ color:#fff; background:#087c62; box-shadow:0 15px 32px -20px rgba(8,124,98,.55); }
.command-launch>b{ color:#087c62; background:#fff; }
.command-launch:hover{ color:#fff; background:#076d57; box-shadow:0 18px 36px -18px rgba(8,124,98,.58); }
.command-foot{ color:#7a8799; border-top-color:#e4e9f0; }
.command-foot i{ background:#15916f; }

.radar-block{
  color:#17453d; background:#e8f5ef; border:1px solid #d3eadf;
  box-shadow:0 20px 48px -38px rgba(15,92,75,.35);
}
.radar-ring{ border-color:rgba(14,102,85,.16); }
.radar-sweep{ background:conic-gradient(from 0deg,rgba(14,102,85,.17),transparent 23%,transparent); }
.radar-core{ background:rgba(255,255,255,.72); }
.radar-copy strong{ color:#16453d; font-family:'Inter',sans-serif; font-size:21px; font-weight:800; }
.radar-copy span{ color:#56766f; }

.flow-block{
  color:#334155; background:#eef3f7; border:1px solid #dce5ec;
  box-shadow:0 20px 48px -38px rgba(35,66,91,.32);
}
.flow-block>header{ color:#60798a; }
.flow-trace-base{ stroke:rgba(8,124,98,.10); }
.flow-trace-live{ stroke:#16846c; filter:none; }
.flow-star{ background:#c7922e; box-shadow:0 0 9px rgba(199,146,46,.42); }
.flow-copy h3{ color:#17243a; font-family:'Inter',sans-serif; font-size:29px; font-weight:800; line-height:.98; }
.flow-copy p{ color:#64748b; }
.flow-steps span{ color:#6b7d8b; }
.flow-steps b{ color:#087c62; }


@media (max-width:700px){
  .civic-intro{
    min-height:0; display:flex; flex-direction:column; padding:35px 25px 25px;
  }
  .civic-intro h1{ font-size:48px; }
  .civic-intro-grid{ display:block; width:75%; }
  .civic-intro-copy{ padding-top:0; }
  .civic-intro-meta{
    width:100%; margin-top:32px; align-self:auto; justify-self:auto;
    flex-direction:row; align-items:flex-end; justify-content:space-between;
  }
  .civic-intro-foot{ width:100%; margin-top:26px; }
  .command-hero h2{ font-size:54px; }
}

@media (max-width:390px){
  .civic-intro h1{ font-size:43px; }
  .command-hero h2{ font-size:49px; }
}

/* ========================================================================== 
   20. EDITORIAL WORKSPACE MASTHEAD + SIDEBAR-EDGE CONTROL
   ========================================================================== */

/* The navigation remains the requested original white rail in either theme. */
html:not(.dark) .app-sidebar{
  --surface:#fff;
  --surface-2:#f8fafc;
  --surface-3:#f1f5f9;
  --line:#e4e9f1;
  --line-soft:#eef2f7;
  --line-strong:#d4dce8;
  --ink:#0f172a;
  --ink-2:#1e293b;
  --ink-3:#334155;
  --ink-muted:#64748b;
  --ink-faint:#8491a4;
  color-scheme:light;
  background:#fff;
  border-right-color:#e4e9f1;
}
html:not(.dark) .app-topbar{
  --surface:#fff;
  --surface-2:#f8fafc;
  --surface-3:#f1f5f9;
  --line:#e4e9f1;
  --line-strong:#d4dce8;
  --ink:#0f172a;
  --ink-muted:#64748b;
  --ink-faint:#8491a4;
  color-scheme:light;
  color:#0f172a;
  background:rgba(255,255,255,.92);
  border-bottom-color:#e4e9f1;
}
html:not(.dark) body.dashboard-page{
  --surface:#fff;
  --surface-2:#f8fafc;
  --surface-3:#f1f5f9;
  --surface-sunk:#e9eef5;
  --line:#e4e9f1;
  --line-soft:#eef2f7;
  --line-strong:#d4dce8;
  --ink:#0f172a;
  --ink-2:#1e293b;
  --ink-3:#334155;
  --ink-muted:#64748b;
  --ink-faint:#8491a4;
  color-scheme:light;
  color:#0f172a;
  background:#f4f6fb !important;
}

/* One control, visually docked to the sidebar edge instead of the header. */
.sidebar-dock-toggle,
html[data-sidebar="open"] .sidebar-dock-toggle,
html[data-sidebar="closed"] .sidebar-dock-toggle{
  position:fixed !important;
  top:14px;
  left:calc(var(--sidebar-w) - 20px);
  z-index:80;
  display:grid !important;
  width:40px;
  height:40px;
  color:#334155;
  background:#fff;
  border:1px solid #dce3ec;
  box-shadow:0 9px 24px -12px rgba(15,23,42,.38);
  transition:left .34s var(--ease-out), color .2s ease, background .2s ease, transform .2s ease;
}
html[data-sidebar="closed"] .sidebar-dock-toggle{ left:14px; }
.sidebar-dock-toggle:hover{ color:#087c62; background:#f8fafc; }
html[data-sidebar="closed"] .app-topbar{ padding-left:72px; }

/* Top-of-dashboard composition: civic wayfinding, not a stock hero card. */
.workspace-masthead{
  position:relative;
  isolation:isolate;
  min-height:390px;
  display:grid;
  grid-template-columns:42px minmax(0,1fr) minmax(210px,255px);
  grid-template-rows:minmax(0,1fr) 58px;
  overflow:hidden;
  color:#0f172a;
  background:#fff;
  border:1px solid #dfe6ee;
  border-radius:20px 20px 6px 20px;
  box-shadow:0 28px 65px -46px rgba(15,23,42,.36);
  animation:mastheadReveal .72s var(--ease-out) both;
}
.workspace-masthead::after{
  content:'';
  position:absolute;
  top:0;
  right:255px;
  z-index:-1;
  width:38%;
  height:100%;
  opacity:.48;
  pointer-events:none;
  background:
    linear-gradient(rgba(8,124,98,.055) 1px,transparent 1px),
    linear-gradient(90deg,rgba(8,124,98,.055) 1px,transparent 1px);
  background-size:32px 32px;
  -webkit-mask-image:linear-gradient(90deg,transparent,#000 82%);
  mask-image:linear-gradient(90deg,transparent,#000 82%);
}
.masthead-ribbon{
  grid-column:1;
  grid-row:1/3;
  z-index:2;
  display:flex;
  flex-direction:column;
  align-items:center;
  padding:18px 0 15px;
  color:#fff;
  background:#087c62;
}
.masthead-ribbon b{ font-size:10px; font-weight:900; letter-spacing:.12em; }
.masthead-ribbon i{ width:1px; flex:1; margin:14px 0; background:rgba(255,255,255,.28); }
.masthead-ribbon em{
  writing-mode:vertical-rl;
  transform:rotate(180deg);
  font-style:normal;
  font-size:7px;
  font-weight:700;
  letter-spacing:.18em;
  text-transform:uppercase;
}
.masthead-core{
  grid-column:2;
  grid-row:1;
  min-width:0;
  display:flex;
  flex-direction:column;
  justify-content:space-between;
  padding:30px clamp(30px,4.1vw,62px) 32px;
}
.masthead-utility{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:20px;
  color:#7b8798;
  font-size:8px;
  font-weight:800;
  letter-spacing:.14em;
  text-transform:uppercase;
}
.masthead-secure{ display:flex; align-items:center; gap:8px; white-space:nowrap; }
.masthead-secure i{
  width:7px;
  height:7px;
  border-radius:50%;
  background:#15916f;
  box-shadow:0 0 0 5px rgba(21,145,111,.09);
  animation:civicPulse 2.8s ease-in-out infinite;
}
.masthead-copy{ max-width:720px; padding:34px 0 26px; }
.masthead-copy>p:first-child{
  margin:0 0 13px;
  color:#657286;
  font-size:11px;
}
.masthead-copy>p:first-child strong{ color:#1e293b; font-weight:800; }
.masthead-copy h1{
  margin:0;
  color:#0f172a;
  font-family:'Inter',system-ui,sans-serif;
  font-size:clamp(44px,5.4vw,72px);
  font-weight:800;
  line-height:.92;
  letter-spacing:-.058em;
}
.masthead-copy h1 span{ color:#087c62; }
.masthead-copy>p:last-child{
  max-width:540px;
  margin:20px 0 0;
  color:#64748b;
  font-size:12px;
  line-height:1.7;
}
.masthead-action-row{ display:flex; align-items:center; gap:24px; }
.masthead-action{
  min-height:44px;
  display:inline-flex;
  align-items:center;
  gap:28px;
  padding:0 8px 0 17px;
  color:#fff;
  background:#0f513f;
  border-radius:999px;
  font-size:10px;
  font-weight:800;
  box-shadow:0 15px 30px -19px rgba(15,81,63,.7);
}
.masthead-action svg{
  width:30px;
  height:30px;
  padding:8px;
  color:#0f513f;
  background:#fff;
  border-radius:50%;
  transition:transform .25s var(--ease-out);
}
.masthead-action:hover{ color:#fff; background:#087c62; transform:translateY(-2px); }
.masthead-action:hover svg{ transform:rotate(45deg); }
.masthead-role{ display:flex; flex-direction:column; gap:3px; }
.masthead-role small{ color:#8a96a6; font-size:7px; font-weight:800; letter-spacing:.13em; text-transform:uppercase; }
.masthead-role b{ color:#334155; font-size:10px; font-weight:800; }
.masthead-date{
  grid-column:3;
  grid-row:1;
  position:relative;
  z-index:2;
  display:flex;
  flex-direction:column;
  justify-content:center;
  padding:38px;
  overflow:hidden;
  color:#153f35;
  background:linear-gradient(145deg,#f1faf7,#e2f2ec);
  border-left:1px solid #d4e7df;
}
.masthead-date::before{
  content:'';
  position:absolute;
  top:-92px;
  right:-92px;
  width:210px;
  height:210px;
  border:1px solid rgba(8,124,98,.12);
  border-radius:50%;
  box-shadow:0 0 0 34px rgba(8,124,98,.025),0 0 0 70px rgba(8,124,98,.018);
}
.masthead-date>span:first-child{ font-size:8px; font-weight:900; letter-spacing:.18em; text-transform:uppercase; }
.masthead-date>div{ display:flex; align-items:flex-end; gap:10px; margin:17px 0 12px; }
.masthead-date strong{
  color:#0f513f;
  font-size:clamp(62px,6.2vw,84px);
  font-weight:800;
  line-height:.73;
  letter-spacing:-.08em;
}
.masthead-date p{ margin:0; color:#8c6a25; font-size:9px; font-weight:800; line-height:1.35; text-transform:uppercase; }
.masthead-date>b{ color:#49675f; font-size:11px; font-weight:700; }
.masthead-date-mark{
  position:absolute;
  right:28px;
  bottom:28px;
  width:8px;
  height:8px;
  border-radius:50%;
  background:#d4a84d;
  box-shadow:0 0 0 7px rgba(212,168,77,.12);
}
.masthead-service-line{
  grid-column:2/4;
  grid-row:2;
  position:relative;
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  align-items:center;
  overflow:hidden;
  background:#f8fafc;
  border-top:1px solid #e4e9f1;
}
.masthead-service-line span{
  min-width:0;
  padding:0 26px;
  color:#66758a;
  border-right:1px solid #e4e9f1;
  font-size:8px;
  font-weight:800;
  letter-spacing:.08em;
  text-transform:uppercase;
}
.masthead-service-line span:last-child{ border-right:0; }
.masthead-service-line b{ margin-right:9px; color:#087c62; }
.masthead-service-line>i{
  position:absolute;
  left:-90px;
  bottom:0;
  z-index:2;
  width:90px;
  height:2px;
  background:linear-gradient(90deg,transparent,#d4a84d);
  animation:mastheadTrace 7s ease-in-out infinite;
}


@keyframes mastheadReveal{
  from{ opacity:0; transform:translateY(14px); clip-path:inset(0 0 12% 0 round 20px); }
  to{ opacity:1; transform:none; clip-path:inset(0 0 0 0 round 0); }
}
@keyframes mastheadTrace{
  0%,12%{ transform:translateX(0); opacity:0; }
  20%{ opacity:1; }
  78%{ opacity:1; }
  88%,100%{ transform:translateX(calc(100vw + 180px)); opacity:0; }
}

@media (max-width:900px){
  .workspace-masthead{ grid-template-columns:36px minmax(0,1fr) 190px; }
  .workspace-masthead::after{ right:190px; }
  .masthead-core{ padding-left:34px; padding-right:34px; }
  .masthead-date{ padding:28px; }
  .masthead-copy h1{ font-size:48px; }
}

@media (max-width:700px){
  .sidebar-dock-toggle,
  html[data-sidebar="closed"] .sidebar-dock-toggle{ top:14px; left:12px; }
  html[data-sidebar="open"] .sidebar-dock-toggle{ left:calc(min(88vw,310px) - 20px); }
  html[data-sidebar="closed"] .app-topbar{ padding-left:62px; }
  html[data-sidebar="open"] .app-topbar{ padding-left:18px; }

  .workspace-masthead{
    min-height:0;
    grid-template-columns:32px minmax(0,1fr);
    grid-template-rows:auto auto auto;
    border-radius:17px 17px 5px 17px;
  }
  .workspace-masthead::after{ top:0; right:0; width:72%; height:58%; }
  .masthead-ribbon{ grid-row:1/4; padding-top:15px; }
  .masthead-core{ grid-column:2; grid-row:1; padding:24px 23px 28px; }
  .masthead-utility>span:first-child{ max-width:165px; line-height:1.5; }
  .masthead-secure{ font-size:0; gap:0; }
  .masthead-copy{ padding:34px 0 29px; }
  .masthead-copy h1{ font-size:clamp(38px,11vw,49px); }
  .masthead-copy>p:last-child{ font-size:11px; }
  .masthead-action-row{ align-items:flex-start; flex-direction:column; gap:14px; }
  .masthead-date{
    grid-column:2;
    grid-row:2;
    min-height:124px;
    display:grid;
    grid-template-columns:auto minmax(0,1fr) auto;
    align-items:center;
    gap:16px;
    padding:22px 24px;
    border-top:1px solid #d4e7df;
    border-left:0;
  }
  .masthead-date>span:first-child{ align-self:start; }
  .masthead-date>div{ margin:0; }
  .masthead-date strong{ font-size:60px; }
  .masthead-date>b{ justify-self:end; }
  .masthead-date-mark{ right:20px; bottom:18px; }
  .masthead-service-line{
    grid-column:2;
    grid-row:3;
    min-height:72px;
    grid-template-columns:1fr;
    padding:10px 0;
  }
  .masthead-service-line span{ padding:5px 22px; border-right:0; }
}

@media (max-width:390px){
  .masthead-core{ padding-left:19px; padding-right:19px; }
  .masthead-copy h1{ font-size:37px; }
  .masthead-action{ width:100%; justify-content:space-between; }
  .masthead-date{ gap:10px; padding-left:18px; padding-right:18px; }
  .masthead-date strong{ font-size:54px; }
}

@media (prefers-reduced-motion:reduce){
  .workspace-masthead,.masthead-service-line>i,.masthead-secure i{ animation:none; }
}

/* ========================================================================== 
   21. WORKSPACE BRIEF, COLLAPSIBLE RAIL, AND COMPLETE DARK THEME
   ========================================================================== */

/* The control belongs to the navigation: inside the full or collapsed rail. */
.sidebar-brand-toggle,
.mobile-sidebar-toggle{
  width:36px;
  height:36px;
  flex:0 0 36px;
  display:grid;
  place-items:center;
  color:var(--ink-muted);
  background:var(--surface-2);
  border:1px solid var(--line);
  border-radius:10px;
}
.sidebar-brand-toggle{ margin-left:auto; }
.sidebar-brand-toggle:hover,
.mobile-sidebar-toggle:hover{ color:var(--ink); background:var(--surface-3); }
.mobile-sidebar-toggle{ display:none; }

@media (min-width:1024px){
  #sidebar{
    transition:width .32s var(--ease-out),margin-left .32s var(--ease-out),background .22s ease,border-color .22s ease;
  }
  html[data-sidebar="closed"] #sidebar{
    width:68px;
    margin-left:0 !important;
  }
  html[data-sidebar="closed"] #sidebar>.sidebar-brand{
    justify-content:center;
    padding:0;
  }
  html[data-sidebar="closed"] #sidebar>.sidebar-brand>div,
  html[data-sidebar="closed"] #sidebar>nav,
  html[data-sidebar="closed"] #sidebar>div:last-child{
    display:none;
  }
  html[data-sidebar="closed"] #sidebar .sidebar-brand-toggle{
    display:grid !important;
    margin:0;
  }
  html[data-sidebar="open"] #sidebar .sidebar-brand-toggle{ display:grid !important; }
  .mobile-sidebar-toggle{ display:none !important; }
  .app-topbar,
  html[data-sidebar="closed"] .app-topbar{ padding-left:27px; }
}

@media (max-width:1023px){
  #sidebar{
    top:0;
    z-index:70;
    height:100dvh;
  }
  #sidebar>.sidebar-brand{ display:flex; }
  #backdrop{ inset:0; }
  html[data-sidebar="closed"] .mobile-sidebar-toggle{ display:grid; }
  html[data-sidebar="open"] .mobile-sidebar-toggle{ display:none; }
  html[data-sidebar="closed"] .app-topbar,
  html[data-sidebar="open"] .app-topbar{ padding-left:18px; }
}

@media (max-width:500px){
  html[data-sidebar="closed"] .app-topbar,
  html[data-sidebar="open"] .app-topbar{ padding-left:12px; }
}

/* A compact working header: deliberately functional and editorial. */
.workspace-brief{
  position:relative;
  overflow:hidden;
  color:var(--ink-3);
  background:var(--surface);
  border:1px solid var(--line);
  border-radius:18px 18px 6px 18px;
  box-shadow:var(--sh-lg);
  animation:briefEnter .58s var(--ease-out) both;
}
.workspace-brief::before{
  content:'';
  position:absolute;
  top:0;
  left:0;
  width:88px;
  height:3px;
  background:#16826a;
}
.workspace-brief::after{
  content:'';
  position:absolute;
  top:0;
  left:88px;
  width:34px;
  height:3px;
  background:#c99a3c;
}
.brief-heading{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:40px;
  padding:clamp(28px,3.6vw,48px) clamp(25px,4.1vw,58px) 27px;
}
.brief-heading>div:first-child{ min-width:0; }
.brief-overline{
  display:block;
  margin-bottom:15px;
  color:var(--ink-faint);
  font-size:8px;
  font-weight:800;
  letter-spacing:.14em;
  text-transform:uppercase;
}
.brief-heading h1{
  max-width:850px;
  margin:0;
  color:var(--ink);
  font-family:'Inter',system-ui,sans-serif;
  font-size:clamp(30px,3.55vw,48px);
  font-weight:750;
  line-height:1.04;
  letter-spacing:-.045em;
}
.brief-heading>div:first-child>p{
  margin:15px 0 0;
  color:var(--ink-muted);
  font-size:12px;
  line-height:1.7;
}
.brief-status{
  flex:0 0 auto;
  min-width:150px;
  padding:5px 0 5px 23px;
  border-left:1px solid var(--line);
}
.brief-status span{ display:flex; align-items:center; gap:8px; color:var(--ink-2); font-size:10px; font-weight:800; }
.brief-status span i{
  width:7px;
  height:7px;
  border-radius:50%;
  background:var(--ok);
  box-shadow:0 0 0 5px var(--ok-tint);
  animation:civicPulse 2.8s ease-in-out infinite;
}
.brief-status small{ display:block; margin:8px 0 0 15px; color:var(--ink-faint); font-size:8px; letter-spacing:.08em; text-transform:uppercase; }
.brief-divider{ position:relative; height:1px; margin:0 clamp(25px,4.1vw,58px); background:var(--line); }
.brief-divider i{
  position:absolute;
  top:-2px;
  left:0;
  width:52px;
  height:3px;
  background:linear-gradient(90deg,#16826a,#c99a3c);
  animation:briefLine 5.5s var(--ease) infinite;
}
.brief-actions{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  padding:10px clamp(25px,4.1vw,58px) 12px;
}
.brief-actions>a{
  min-width:0;
  min-height:66px;
  display:grid;
  grid-template-columns:34px minmax(0,1fr) 18px;
  align-items:center;
  gap:12px;
  padding:8px 23px;
  color:var(--ink-muted);
  border-right:1px solid var(--line);
}
.brief-actions>a:first-child{ padding-left:0; }
.brief-actions>a:last-child{ padding-right:0; border-right:0; }
.brief-actions>a>span{
  width:32px;
  height:32px;
  display:grid;
  place-items:center;
  color:#087c62;
  background:rgba(8,124,98,.09);
  border-radius:9px;
}
.brief-actions svg{ width:14px; height:14px; }
.brief-actions>a>b{ min-width:0; color:var(--ink-2); font-size:10.5px; font-weight:750; }
.brief-actions>a>svg{ color:var(--ink-faint); transition:transform .23s var(--ease-out),color .23s ease; }
.brief-actions>a:hover>svg{ color:#16826a; transform:translateX(4px); }
.brief-actions>a:hover>b{ color:#087c62; }
.brief-foot{
  min-height:47px;
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  align-items:center;
  padding:0 clamp(25px,4.1vw,58px);
  color:var(--ink-faint);
  background:var(--surface-2);
  border-top:1px solid var(--line-soft);
}
.brief-foot span{ font-size:7.5px; font-weight:800; letter-spacing:.08em; text-transform:uppercase; }
.brief-foot b{ margin-right:8px; color:#16826a; }

@keyframes briefEnter{
  from{ opacity:0; transform:translateY(10px); }
  to{ opacity:1; transform:none; }
}
@keyframes briefLine{
  0%,14%{ transform:translateX(0); opacity:0; }
  22%,72%{ opacity:1; }
  84%,100%{ transform:translateX(min(58vw,720px)); opacity:0; }
}

/* Dark mode is complete: shell, navigation, cards, dashboard and footer. */
html.dark .app-sidebar{
  color:#cbd5e1;
  background:#0c1420;
  border-right-color:rgba(255,255,255,.08);
}
html.dark .app-sidebar>.sidebar-brand{ background:#0c1420; border-bottom-color:rgba(255,255,255,.07); }
html.dark .app-sidebar .nav-link{ color:#94a3b8; }
html.dark .app-sidebar .nav-link:hover{ color:#f8fafc; background:rgba(255,255,255,.055); }
html.dark .app-sidebar .nav-active,
html.dark .app-sidebar .nav-active:hover{ color:#fff; background:linear-gradient(100deg,#4f46e5,#7c3aed) !important; }
html.dark .app-sidebar>div:last-child>div{ background:#111b2a; border-color:rgba(255,255,255,.08); }
html.dark .app-topbar{ color:#f8fafc; background:rgba(8,13,22,.9); border-bottom-color:rgba(255,255,255,.08); }
html.dark .sidebar-brand-toggle,
html.dark .mobile-sidebar-toggle{ color:#94a3b8; background:#111b2a; border-color:rgba(255,255,255,.1); }
html.dark .sidebar-brand-toggle:hover,
html.dark .mobile-sidebar-toggle:hover{ color:#fff; background:#172235; }
html.dark .workspace-brief{ background:#101827; border-color:rgba(255,255,255,.09); }
html.dark .workspace-brief::before{ background:#34b291; }
html.dark .workspace-brief::after{ background:#d8aa50; }
html.dark .brief-actions>a>span{ color:#6ee7c0; background:rgba(52,211,153,.1); }
html.dark .brief-actions>a:hover>b{ color:#6ee7c0; }
html.dark .brief-foot{ background:#0d1424; }
html.dark .command-hero{ color:#cbd5e1; background:#101827; border-color:rgba(255,255,255,.09); box-shadow:var(--sh-lg); }
html.dark .command-hero::before{ opacity:.08; }
html.dark .command-hero::after{ color:#121c2c; }
html.dark .command-hero h2{ color:#f8fafc; }
html.dark .command-copy>p{ color:#94a3b8; }
html.dark .command-launch{ color:#ecfdf5; background:#087c62; }
html.dark .command-launch>b{ color:#0f513f; background:#d1fae5; }
html.dark .command-foot{ color:#8290a5; border-top-color:rgba(255,255,255,.09); }
html.dark .radar-block{ color:#d1fae5; background:linear-gradient(145deg,#132a27,#0e211f); border-color:rgba(110,231,192,.12); }
html.dark .radar-block::before{ opacity:.08; }
html.dark .radar-block>header{ color:#8fc7b9; }
html.dark .radar-copy strong{ color:#e3fff6; }
html.dark .radar-copy span{ color:#8fb1a9; }
html.dark .radar-ring{ border-color:rgba(110,231,192,.15); }
html.dark .radar-core{ color:#9aead3; background:#172f2b; border-color:rgba(110,231,192,.14); }
html.dark .flow-block{ color:#dbeafe; background:linear-gradient(145deg,#131d2b,#0d1522); border-color:rgba(255,255,255,.09); }
html.dark .flow-block>header{ color:#8496ad; }
html.dark .flow-copy h3{ color:#f8fafc; }
html.dark .flow-copy p{ color:#94a3b8; }
html.dark .flow-steps span{ color:#8290a5; }
html.dark .site-footer{ color:var(--ink-muted); background:rgba(8,13,22,.86); border-top-color:rgba(255,255,255,.08); }

@media (max-width:780px){
  .brief-heading{ flex-direction:column; gap:22px; }
  .brief-status{ min-width:0; padding:0; border-left:0; }
  .brief-status small{ margin-left:15px; }
  .brief-actions{ grid-template-columns:1fr; }
  .brief-actions>a,
  .brief-actions>a:first-child,
  .brief-actions>a:last-child{ padding:9px 0; border-right:0; border-bottom:1px solid var(--line); }
  .brief-actions>a:last-child{ border-bottom:0; }
}

@media (max-width:520px){
  .brief-heading{ padding:27px 22px 22px; }
  .brief-heading h1{ font-size:31px; }
  .brief-divider{ margin:0 22px; }
  .brief-actions{ padding:9px 22px 11px; }
  .brief-foot{ grid-template-columns:1fr; gap:7px; padding:13px 22px; }
}

@media (prefers-reduced-motion:reduce){
  .workspace-brief,.brief-divider i,.brief-status span i{ animation:none; }
}


/* ==========================================================================
   30. ADMIN CONFIGURATION — Card Management, Form Editor, Card Editor
   Restricted screens behind the Hidden Admin Panel. They deliberately reuse
   the tokens above rather than introducing a second visual language.
   ========================================================================== */

/* --- Card Management tiles ------------------------------------------------ */
.manage-tile{
  display:block; position:relative; padding:18px 18px 16px;
  border:1px solid var(--line); border-radius:16px; background:var(--surface-2);
  transition:border-color var(--dur) var(--ease), transform var(--dur) var(--ease),
             box-shadow var(--dur) var(--ease);
}
.manage-tile:hover{ border-color:var(--line-strong); transform:translateY(-2px);
  box-shadow:var(--sh-lg); }
.manage-tile:focus-visible{ outline:2px solid var(--brand); outline-offset:2px; }
.manage-tile-ico{ width:42px; height:42px; border-radius:12px; display:grid;
  place-items:center; }
.manage-tile-emerald{ background:rgba(16,185,129,.14); color:#059669; }
.manage-tile-violet { background:rgba(124,58,237,.14); color:#7c3aed; }
.manage-tile-amber  { background:rgba(217,119,6,.15);  color:#b45309; }
html.dark .manage-tile-emerald{ color:#34d399; }
html.dark .manage-tile-violet { color:#a78bfa; }
html.dark .manage-tile-amber  { color:#fbbf24; }
.manage-tile-go{ width:26px; height:26px; border-radius:8px;
  display:grid; place-items:center; color:var(--ink-muted);
  transition:transform var(--dur) var(--ease), color var(--dur) var(--ease); }
.manage-tile:hover .manage-tile-go{ transform:translateX(3px); color:var(--brand); }

/* --- shared admin editor chrome ------------------------------------------ */
.adm-bar{
  position:sticky; top:0; z-index:40; display:flex; flex-wrap:wrap;
  align-items:center; gap:12px; padding:14px 18px; margin-bottom:20px;
  border:1px solid var(--line); border-radius:16px;
  background:var(--surface-glass); backdrop-filter:blur(10px);
  box-shadow:var(--sh-sm);
}
html.dark .adm-bar{ background:rgba(16,24,39,.9); }
.adm-chip{
  display:inline-flex; align-items:center; gap:6px; padding:5px 10px;
  border-radius:9px; border:1px solid var(--line); background:var(--surface-3);
  font-size:11px; font-weight:700; letter-spacing:.02em; color:var(--ink-muted);
  white-space:nowrap;
}
.adm-chip-dirty{ border-color:rgba(217,119,6,.4); background:var(--warn-tint);
  color:var(--warn); }
.adm-chip-saved{ border-color:rgba(5,150,105,.35); background:var(--ok-tint);
  color:var(--ok); }
.adm-btn{
  display:inline-flex; align-items:center; justify-content:center; gap:7px;
  padding:9px 15px; border-radius:11px; border:1px solid var(--line);
  background:var(--surface-2); color:var(--ink-2);
  font-size:13px; font-weight:650; white-space:nowrap; cursor:pointer;
  transition:background var(--dur) var(--ease), border-color var(--dur) var(--ease),
             color var(--dur) var(--ease);
}
.adm-btn:hover{ border-color:var(--line-strong); background:var(--surface-3); }
.adm-btn:disabled{ opacity:.45; cursor:not-allowed; }
.adm-btn-primary{
  border-color:transparent; color:#fff;
  background:linear-gradient(90deg,var(--brand) 0%,var(--violet) 100%);
}
.adm-btn-primary:hover{ filter:brightness(1.06); border-color:transparent;
  background:linear-gradient(90deg,var(--brand) 0%,var(--violet) 100%); }
.adm-btn-danger{ border-color:rgba(225,29,72,.32); background:var(--danger-tint);
  color:var(--danger); }
.adm-btn-danger:hover{ background:rgba(225,29,72,.16); }
.adm-btn-sm{ padding:6px 10px; font-size:12px; border-radius:9px; }
.adm-btn-icon{ padding:6px; width:30px; height:30px; }

.adm-layout{ display:grid; gap:20px; grid-template-columns:minmax(0,1fr); }
@media (min-width:1180px){
  .adm-layout{ grid-template-columns:minmax(0,1fr) 400px; align-items:start; }
  .adm-side{ position:sticky; top:96px; }
}

.adm-empty{
  padding:34px 20px; text-align:center; border:1px dashed var(--line-strong);
  border-radius:14px; color:var(--ink-muted); font-size:13px;
}

/* --- form editor: sections and field rows --------------------------------- */
.fe-section{
  border:1px solid var(--line); border-radius:16px; background:var(--surface);
  box-shadow:var(--sh-sm); overflow:hidden; margin-bottom:16px;
}
.fe-section.is-drop{ border-color:var(--brand); box-shadow:0 0 0 3px var(--brand-tint); }
.fe-sec-head{
  display:flex; flex-wrap:wrap; align-items:center; gap:10px;
  padding:12px 14px; background:var(--surface-2);
  border-bottom:1px solid var(--line);
}
.fe-sec-title{
  flex:1 1 220px; min-width:0; padding:7px 10px; border-radius:10px;
  border:1px solid transparent; background:transparent;
  font-size:15px; font-weight:800; color:var(--ink); font-family:inherit;
}
.fe-sec-title:hover{ border-color:var(--line); background:var(--surface); }
.fe-sec-title:focus{ outline:none; border-color:var(--brand);
  background:var(--surface); box-shadow:0 0 0 3px var(--brand-tint); }
.fe-sec-wrap{ overflow-x:auto; }

.fe-table{ width:100%; border-collapse:collapse; min-width:560px; }
.fe-table th{
  text-align:left; padding:9px 12px; font-size:10.5px; font-weight:800;
  letter-spacing:.06em; text-transform:uppercase; color:var(--ink-faint);
  background:var(--surface-2); border-bottom:1px solid var(--line);
}
.fe-table td{ padding:9px 12px; border-bottom:1px solid var(--line-soft);
  font-size:13px; color:var(--ink-2); vertical-align:middle; }
.fe-table tr:last-child td{ border-bottom:0; }
.fe-row:hover{ background:var(--surface-2); }
.fe-row.is-dragging{ opacity:.4; }
.fe-row.is-over td{ box-shadow:inset 0 2px 0 0 var(--brand); }
.fe-row.is-inactive .fe-name{ opacity:.55; text-decoration:line-through; }
.fe-grip{ color:var(--ink-faint); cursor:grab; }
.fe-name{ font-weight:650; color:var(--ink); }
.fe-id{ display:block; font-size:11px; color:var(--ink-faint);
  font-family:ui-monospace,SFMono-Regular,Menlo,monospace; }
.fe-tag{
  display:inline-flex; align-items:center; gap:5px; padding:3px 8px;
  border-radius:7px; font-size:11px; font-weight:700; white-space:nowrap;
  background:var(--surface-3); color:var(--ink-muted); border:1px solid var(--line);
}
.fe-tag-date{ background:var(--info-tint); color:var(--info);
  border-color:rgba(37,99,235,.25); }
.fe-tag-req{ background:var(--danger-tint); color:var(--danger);
  border-color:rgba(225,29,72,.25); }
.fe-tag-sys{ background:var(--warn-tint); color:var(--warn);
  border-color:rgba(217,119,6,.28); }
.fe-ph{ color:var(--ink-muted); font-size:12.5px; }
.fe-ph-empty{ color:var(--ink-faint); font-style:italic; }
.fe-actions{ display:flex; gap:5px; justify-content:flex-end; }

/* --- live form preview ---------------------------------------------------- */
.fe-preview{
  border:1px solid var(--line); border-radius:16px; background:var(--surface);
  box-shadow:var(--sh-sm); overflow:hidden;
}
.fe-preview-body{ padding:14px; max-height:min(70vh,760px); overflow:auto; }
.fe-pv-sec{ margin-bottom:16px; }
.fe-pv-sec h4{
  font-size:12px; font-weight:800; letter-spacing:.03em; color:var(--ink);
  margin-bottom:8px; padding-bottom:6px; border-bottom:1px solid var(--line-soft);
}
.fe-pv-field{ margin-bottom:9px; }
.fe-pv-field label{
  display:block; font-size:11px; font-weight:700; color:var(--ink-muted);
  margin-bottom:4px;
}
.fe-pv-field .req{ color:var(--danger); }
.fe-pv-input{
  width:100%; padding:7px 10px; border-radius:9px; border:1px solid var(--line);
  background:var(--surface-2); font-size:12.5px; color:var(--ink-muted);
  min-height:32px; display:flex; align-items:center; gap:6px;
}
.fe-pv-input.is-empty{ color:var(--ink-faint); }

/* --- modal ---------------------------------------------------------------- */
.adm-modal{ position:fixed; inset:0; z-index:120; display:none;
  align-items:center; justify-content:center; padding:16px; }
.adm-modal.is-open{ display:flex; }
.adm-modal-veil{ position:absolute; inset:0; background:rgba(3,7,18,.62); }
.adm-modal-box{
  position:relative; width:100%; max-width:520px; max-height:90vh; overflow:auto;
  border:1px solid var(--line); border-radius:18px; background:var(--surface);
  box-shadow:0 30px 70px -24px rgba(3,7,18,.6);
}
.adm-modal-head{ display:flex; align-items:center; gap:10px; padding:16px 18px;
  border-bottom:1px solid var(--line); }
.adm-modal-body{ padding:18px; display:grid; gap:14px; }
.adm-modal-foot{ display:flex; flex-wrap:wrap; gap:9px; padding:14px 18px;
  border-top:1px solid var(--line); background:var(--surface-2); }
.adm-label{ display:block; font-size:11.5px; font-weight:750; color:var(--ink-2);
  margin-bottom:5px; }
.adm-hint{ margin-top:5px; font-size:11.5px; color:var(--ink-muted); line-height:1.5; }
.adm-input, .adm-select, .adm-textarea{
  width:100%; padding:9px 12px; border-radius:11px; border:1px solid var(--line);
  background:var(--surface-2); color:var(--ink); font-size:13.5px;
  font-family:inherit; transition:border-color var(--dur) var(--ease),
    box-shadow var(--dur) var(--ease);
}
.adm-input:focus, .adm-select:focus, .adm-textarea:focus{
  outline:none; border-color:var(--brand); background:var(--surface);
  box-shadow:0 0 0 3px var(--brand-tint);
}
.adm-input.is-invalid{ border-color:var(--danger);
  box-shadow:0 0 0 3px var(--danger-tint); }
.adm-textarea{ min-height:76px; resize:vertical; }
.adm-error{ margin-top:5px; font-size:12px; color:var(--danger); font-weight:600; }
.adm-seg{ display:flex; gap:8px; }
.adm-seg label{ flex:1; position:relative; }
.adm-seg input{ position:absolute; opacity:0; pointer-events:none; }
.adm-seg span{
  display:flex; align-items:center; justify-content:center; gap:6px;
  padding:9px 10px; border-radius:11px; border:1px solid var(--line);
  background:var(--surface-2); font-size:13px; font-weight:650;
  color:var(--ink-muted); cursor:pointer;
  transition:border-color var(--dur) var(--ease), background var(--dur) var(--ease),
             color var(--dur) var(--ease);
}
.adm-seg input:checked + span{ border-color:var(--brand);
  background:var(--brand-tint); color:var(--brand-700); }
.adm-seg input:focus-visible + span{ outline:2px solid var(--brand);
  outline-offset:2px; }
.adm-check{ display:flex; align-items:flex-start; gap:9px; cursor:pointer; }
.adm-check input{ margin-top:2px; width:16px; height:16px; accent-color:var(--brand); }

/* --- toast ---------------------------------------------------------------- */
.adm-toast{
  position:fixed; left:50%; bottom:26px; transform:translate(-50%,18px);
  z-index:200; display:flex; align-items:flex-start; gap:10px;
  max-width:min(520px,calc(100vw - 32px)); padding:12px 16px;
  border-radius:13px; border:1px solid var(--line); background:var(--surface);
  box-shadow:0 20px 45px -18px rgba(3,7,18,.55);
  font-size:13px; color:var(--ink-2); line-height:1.5;
  opacity:0; pointer-events:none;
  transition:opacity .2s var(--ease), transform .2s var(--ease);
}
.adm-toast.is-on{ opacity:1; transform:translate(-50%,0); pointer-events:auto; }
.adm-toast-ok{ border-color:rgba(5,150,105,.4); }
.adm-toast-err{ border-color:rgba(225,29,72,.4); }
.adm-toast i{ flex:0 0 auto; margin-top:1px; }
.adm-toast-ok i{ color:var(--ok); }
.adm-toast-err i{ color:var(--danger); }

/* --- version history ------------------------------------------------------ */
.adm-ver{ display:flex; flex-wrap:wrap; align-items:center; gap:10px;
  padding:10px 12px; border-bottom:1px solid var(--line-soft); font-size:12.5px; }
.adm-ver:last-child{ border-bottom:0; }
.adm-ver-num{ font-weight:800; color:var(--ink); min-width:42px; }
.adm-ver-live{ background:var(--ok-tint); color:var(--ok);
  border:1px solid rgba(5,150,105,.3); padding:2px 7px; border-radius:6px;
  font-size:10.5px; font-weight:800; text-transform:uppercase;
  letter-spacing:.04em; }

/* --- card editor ---------------------------------------------------------- */
.ce-layout{ display:grid; gap:18px; grid-template-columns:minmax(0,1fr); }
@media (min-width:1100px){
  .ce-layout{ grid-template-columns:344px minmax(0,1fr); align-items:start; }
  .ce-panel{ position:sticky; top:96px; max-height:calc(100vh - 118px);
             overflow:auto; }
}
.ce-panel{
  border:1px solid var(--line); border-radius:16px; background:var(--surface);
  box-shadow:var(--sh-sm); overflow:hidden;
}
.ce-stage{
  border:1px solid var(--line); border-radius:16px; background:var(--surface-sunk);
  padding:26px 18px; display:flex; flex-wrap:wrap; gap:26px;
  justify-content:center; align-items:flex-start; min-height:420px;
  background-image:
    linear-gradient(45deg,rgba(120,130,150,.07) 25%,transparent 25%),
    linear-gradient(-45deg,rgba(120,130,150,.07) 25%,transparent 25%),
    linear-gradient(45deg,transparent 75%,rgba(120,130,150,.07) 75%),
    linear-gradient(-45deg,transparent 75%,rgba(120,130,150,.07) 75%);
  background-size:18px 18px;
  background-position:0 0,0 9px,9px -9px,-9px 0;
  overflow:auto;
}
.ce-group{ border-bottom:1px solid var(--line); }
.ce-group:last-child{ border-bottom:0; }
.ce-group-head{
  width:100%; display:flex; align-items:center; gap:9px; padding:12px 14px;
  background:transparent; border:0; cursor:pointer; text-align:left;
  font-size:12.5px; font-weight:800; color:var(--ink); font-family:inherit;
}
.ce-group-head:hover{ background:var(--surface-2); }
.ce-group-head .chev{ margin-left:auto; transition:transform var(--dur) var(--ease); }
.ce-group.is-open .ce-group-head .chev{ transform:rotate(180deg); }
.ce-group-body{ display:none; padding:2px 14px 14px; }
.ce-group.is-open .ce-group-body{ display:block; }

.ce-ctl{ margin-bottom:12px; }
.ce-ctl:last-child{ margin-bottom:0; }
.ce-ctl-head{ display:flex; align-items:center; gap:8px; margin-bottom:5px; }
.ce-ctl-head label{ font-size:11.5px; font-weight:700; color:var(--ink-2); }
.ce-ctl-val{ margin-left:auto; font-size:11px; font-weight:700;
  color:var(--ink-muted);
  font-family:ui-monospace,SFMono-Regular,Menlo,monospace; }
.ce-range{ width:100%; accent-color:var(--brand); }
.ce-swatch{ display:flex; align-items:center; gap:9px; }
.ce-swatch input[type=color]{
  width:38px; height:32px; padding:2px; border-radius:9px;
  border:1px solid var(--line); background:var(--surface-2); cursor:pointer; }
.ce-swatch .hex{ flex:1; min-width:0; font-size:12px;
  font-family:ui-monospace,SFMono-Regular,Menlo,monospace; }
.ce-grid2{ display:grid; grid-template-columns:1fr 1fr; gap:9px; }
.ce-grid3{ display:grid; grid-template-columns:repeat(3,1fr); gap:7px; }

.ce-el{
  display:flex; align-items:center; gap:8px; width:100%; padding:8px 10px;
  border-radius:10px; border:1px solid transparent; background:transparent;
  font-size:12.5px; font-weight:600; color:var(--ink-2); cursor:pointer;
  text-align:left; font-family:inherit;
}
.ce-el:hover{ background:var(--surface-2); }
.ce-el.is-active{ border-color:var(--brand); background:var(--brand-tint);
  color:var(--brand-700); }
.ce-el-tools{ margin-left:auto; display:flex; gap:2px; color:var(--ink-faint); }
.ce-el.is-off .ce-el-label{ opacity:.5; text-decoration:line-through; }

.ce-editable [data-el]{ cursor:move; }
.ce-editable [data-el]:hover{
  outline:1px dashed rgba(99,102,241,.75); outline-offset:2px; }
.ce-editable [data-el].ce-selected{
  outline:2px solid var(--brand); outline-offset:2px; }
.ce-guide{ position:absolute; background:var(--brand); opacity:.9; z-index:59;
  pointer-events:none; }
.ce-guide-v{ width:1px; top:0; bottom:0; }
.ce-guide-h{ height:1px; left:0; right:0; }

@media print{
  .adm-bar, .ce-panel, .adm-toast, .fe-preview{ display:none !important; }
}

/* --- section icon picker (form editor) ----------------------------------- */
.fe-icons{
  display:grid; grid-template-columns:repeat(auto-fill,minmax(44px,1fr)); gap:7px;
}
.fe-icon{
  display:grid; place-items:center; height:42px; border-radius:11px;
  border:1px solid var(--line); background:var(--surface-2); cursor:pointer;
  color:var(--ink-muted);
  transition:border-color var(--dur) var(--ease), background var(--dur) var(--ease),
             color var(--dur) var(--ease);
}
.fe-icon:hover{ border-color:var(--line-strong); background:var(--surface-3);
  color:var(--ink-2); }
.fe-icon.is-on{ border-color:var(--brand); background:var(--brand-tint);
  color:var(--brand-700); }
.fe-icon:focus-visible{ outline:2px solid var(--brand); outline-offset:2px; }

/* the settings button sits with the section heading */
.fe-sec-head .fe-sec-cog{ color:var(--ink-muted); }

.fe-sec-note{
  padding:9px 14px; margin:0; font-size:12.5px; color:var(--ink-muted);
  background:var(--surface-2); border-bottom:1px solid var(--line-soft);
}
.fe-pv-empty{
  padding:10px 12px; border-radius:9px; border:1px dashed var(--line-strong);
  background:var(--surface-2); color:var(--ink-faint); font-size:12px;
}

/* The toolbar actions wrap as one group, so a narrow window never leaves the
   primary button stranded on a line of its own. */
.adm-bar-actions{
  display:flex; flex-wrap:wrap; align-items:center; gap:9px; margin-left:auto;
}
@media (max-width:720px){
  .adm-bar{ padding:12px 14px; }
  .adm-bar-actions{ width:100%; margin-left:0; }
  .adm-bar-actions .adm-btn{ flex:1 1 auto; justify-content:center; }
}

/* The heading yields space so the actions stay on the same line; auto margins
   alone let the title claim the whole row and pushed the buttons to wrap. */
.adm-bar-title{ flex:1 1 160px; min-width:0; }
.adm-bar-title h1{ white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.adm-bar-actions{ flex:0 0 auto; }

/* --- printed detail rows (design-driven) ---------------------------------
   The rows used to be fixed markup with Tailwind spacing utilities. They are
   configuration now, so their spacing, divider and label underline are tokens
   the Card Editor writes — with the original values as fallbacks, so a card on
   design v1 is unchanged. */
.kmc-rows-front > .kmc-row + .kmc-row{ margin-top:var(--kc-row-gap-front, 3px); }
.kmc-rows-back  > .kmc-row + .kmc-row{ margin-top:var(--kc-row-gap-back, 7px); }
.kmc-row{ border-bottom:var(--kc-row-divider, none); padding-bottom:1px; }
.kmc-field-label{ text-decoration:var(--kc-label-underline, underline); }
.kmc-corners{ display:contents; }
.kmc-card[data-corners="0"] .kmc-corners{ display:none; }

/* --- card editor: quick theme bar ---------------------------------------- */
.ce-quick{
  padding:12px 14px; border-bottom:1px solid var(--line);
  background:var(--surface-2);
}
.ce-quick-head{
  display:flex; align-items:center; gap:7px; margin-bottom:9px;
  font-size:11.5px; font-weight:800; letter-spacing:.03em; color:var(--ink-2);
  text-transform:uppercase;
}
.ce-quick-head i{ color:var(--ink-muted); }
.ce-quick-row{ display:grid; grid-template-columns:repeat(3,1fr); gap:7px; }
.ce-theme{
  display:flex; flex-direction:column; align-items:center; gap:5px;
  padding:8px 4px; border-radius:11px; border:1px solid var(--line);
  background:var(--surface); cursor:pointer; font-family:inherit;
  transition:border-color var(--dur) var(--ease), background var(--dur) var(--ease);
}
.ce-theme:hover{ border-color:var(--line-strong); }
.ce-theme.is-on{ border-color:var(--brand); background:var(--brand-tint); }
.ce-theme:focus-visible{ outline:2px solid var(--brand); outline-offset:2px; }
.ce-theme-dot{
  width:24px; height:24px; border-radius:50%;
  box-shadow:inset 0 0 0 1px rgba(3,7,18,.14);
}
.ce-theme-name{ font-size:10.5px; font-weight:700; color:var(--ink-muted); }
.ce-theme.is-on .ce-theme-name{ color:var(--brand-700); }

/* --- card editor: printed-row list --------------------------------------- */
.ce-row{
  display:flex; align-items:center; gap:6px; padding:5px 6px 5px 8px;
  border-radius:10px; border:1px solid transparent;
}
.ce-row:hover{ background:var(--surface-2); }
.ce-row.is-active{ border-color:var(--brand); background:var(--brand-tint); }
.ce-row-grip{
  flex:1; min-width:0; display:block; text-align:left; padding:2px 0;
  background:none; border:0; cursor:pointer; font-family:inherit;
}
.ce-row-label{
  display:block; font-size:12.5px; font-weight:650; color:var(--ink-2);
  overflow:hidden; text-overflow:ellipsis; white-space:nowrap;
}
.ce-row-id{
  display:block; font-size:10.5px; color:var(--ink-faint);
  font-family:ui-monospace,SFMono-Regular,Menlo,monospace;
  overflow:hidden; text-overflow:ellipsis; white-space:nowrap;
}
.ce-row.is-active .ce-row-label{ color:var(--brand-700); }
.ce-row.is-off .ce-row-label{ opacity:.5; text-decoration:line-through; }
.ce-row-tools{ display:flex; gap:2px; flex:0 0 auto; }

/* a printed row highlights like any other element when selected */
.ce-editable .kmc-row{ cursor:pointer; }
.ce-editable .kmc-row:hover{ outline:1px dashed rgba(99,102,241,.7); outline-offset:1px; }
.ce-editable .kmc-row.ce-selected{ outline:2px solid var(--brand); outline-offset:1px; }


/* ==========================================================================
   31. EDITOR WORKBENCH
   A shared shell for the Card Form editors and the Card Editor.

   The earlier screens were one long page: you scrolled past the controls to
   reach the thing you were editing, and every change re-rendered the lot. The
   workbench is a fixed frame instead — toolbar, a panel that scrolls on its
   own, and a canvas that scrolls on its own — so nothing you are working with
   ever leaves the screen.
   ========================================================================== */
:root{
  --wb-gap: 16px;
  --wb-side: 336px;
  --wb-radius: 16px;
  --wb-ease: cubic-bezier(.22,.72,.24,1);
  --wb-fast: .16s;
  --wb-slow: .28s;
}

.wb{ display:flex; flex-direction:column; gap:var(--wb-gap); }

/* --- toolbar -------------------------------------------------------------- */
.wb-bar{
  display:flex; flex-wrap:wrap; align-items:center; gap:10px;
  padding:11px 14px;
  border:1px solid var(--line); border-radius:var(--wb-radius);
  background:var(--surface); box-shadow:var(--sh-sm);
}
.wb-bar-title{ flex:1 1 150px; min-width:0; }
.wb-bar-title h1{
  font-size:16px; font-weight:850; line-height:1.2; color:var(--ink);
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
}
.wb-bar-title p{ font-size:12px; color:var(--ink-muted); margin-top:1px;
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.wb-bar-actions{ display:flex; flex-wrap:wrap; align-items:center; gap:8px; }
.wb-sep{ width:1px; align-self:stretch; background:var(--line); margin:2px 2px; }

/* --- body: panel + canvas ------------------------------------------------- */
.wb-body{ display:grid; gap:var(--wb-gap); grid-template-columns:minmax(0,1fr); }
@media (min-width:1100px){
  .wb-body{ grid-template-columns:var(--wb-side) minmax(0,1fr); align-items:stretch; }
  .wb-body.is-wide{ grid-template-columns:minmax(0,1fr); }
  /* the exact height is measured in JS (AdminUI.fitWorkbench) because the
     toolbar can wrap; this is the fallback before that runs. */
  .wb-body{ height:calc(100vh - 232px); min-height:460px; }
  .wb-pane, .wb-main{ height:100%; min-height:0; }
}

.wb-pane{
  display:flex; flex-direction:column; min-height:0; overflow:hidden;
  border:1px solid var(--line); border-radius:var(--wb-radius);
  background:var(--surface); box-shadow:var(--sh-sm);
}
.wb-main{
  display:flex; flex-direction:column; min-height:0; min-width:0; overflow:hidden;
  border:1px solid var(--line); border-radius:var(--wb-radius);
  background:var(--surface); box-shadow:var(--sh-sm);
}

/* --- tabs ----------------------------------------------------------------- */
.wb-tabs{
  display:flex; gap:2px; padding:6px; flex:0 0 auto;
  border-bottom:1px solid var(--line); background:var(--surface-2);
}
.wb-tab{
  flex:1; display:flex; flex-direction:column; align-items:center; gap:3px;
  padding:8px 4px 7px; border:0; border-radius:10px; cursor:pointer;
  background:transparent; color:var(--ink-muted); font-family:inherit;
  font-size:10.5px; font-weight:750; letter-spacing:.01em;
  transition:background var(--wb-fast) var(--wb-ease),
             color var(--wb-fast) var(--wb-ease);
}
.wb-tab:hover{ background:var(--surface-3); color:var(--ink-2); }
.wb-tab.is-on{ background:var(--surface); color:var(--brand-700);
  box-shadow:0 1px 2px rgba(3,7,18,.08); }
html.dark .wb-tab.is-on{ background:rgba(99,102,241,.16); color:#c7d2fe; }
.wb-tab:focus-visible{ outline:2px solid var(--brand); outline-offset:-2px; }
.wb-tab-count{
  position:absolute; top:4px; right:8px; font-size:9px; font-weight:800;
  color:var(--ink-faint);
}

.wb-panes{ flex:1 1 auto; min-height:0; overflow-y:auto; overscroll-behavior:contain; }
.wb-panes::-webkit-scrollbar{ width:10px; }
.wb-panes::-webkit-scrollbar-thumb{
  background:var(--line-strong); border-radius:9px; border:3px solid var(--surface); }
.wb-panes::-webkit-scrollbar-track{ background:transparent; }
.wb-panel{ display:none; padding:14px; }
.wb-panel.is-on{ display:block; animation:wbFade var(--wb-slow) var(--wb-ease); }
@keyframes wbFade{ from{ opacity:0; transform:translateY(4px); } to{ opacity:1; transform:none; } }
@media (prefers-reduced-motion:reduce){ .wb-panel.is-on{ animation:none; } }

.wb-block{ margin-bottom:18px; }
.wb-block:last-child{ margin-bottom:0; }
.wb-block-head{
  display:flex; align-items:center; gap:7px; margin-bottom:9px;
  font-size:10.5px; font-weight:850; letter-spacing:.06em; text-transform:uppercase;
  color:var(--ink-faint);
}
.wb-block-head i{ color:var(--ink-faint); }
.wb-block-head .wb-block-act{ margin-left:auto; }

/* --- canvas --------------------------------------------------------------- */
.wb-canvasbar{
  display:flex; flex-wrap:wrap; align-items:center; gap:8px;
  padding:9px 12px; flex:0 0 auto;
  border-bottom:1px solid var(--line); background:var(--surface-2);
}
.wb-canvas{
  flex:1 1 auto; min-height:0; overflow:auto; position:relative;
  padding:28px; display:flex; align-items:flex-start; justify-content:center;
  background-color:var(--surface-sunk);
  background-image:
    linear-gradient(45deg,rgba(120,130,150,.06) 25%,transparent 25%),
    linear-gradient(-45deg,rgba(120,130,150,.06) 25%,transparent 25%),
    linear-gradient(45deg,transparent 75%,rgba(120,130,150,.06) 75%),
    linear-gradient(-45deg,transparent 75%,rgba(120,130,150,.06) 75%);
  background-size:18px 18px;
  background-position:0 0,0 9px,9px -9px,-9px 0;
  scroll-behavior:smooth;
}
.wb-stage{
  transform:scale(var(--wb-zoom,1));
  transform-origin:top center;
  transition:transform var(--wb-slow) var(--wb-ease);
  will-change:transform;
}
.wb-stage.is-dragging{ transition:none; }
.wb-canvasfoot{
  flex:0 0 auto; padding:8px 12px; border-top:1px solid var(--line);
  background:var(--surface-2); font-size:11.5px; color:var(--ink-muted);
  display:flex; flex-wrap:wrap; align-items:center; gap:10px;
}

/* face focus */
.wb-canvas[data-face="front"] .kmc-back,
.wb-canvas[data-face="back"]  .kmc-front{ display:none; }

/* optional overlays on the card while editing */
.ce-editable .kmc-card.wb-grid::after{
  content:''; position:absolute; inset:0; z-index:40; pointer-events:none;
  background-image:
    linear-gradient(to right, rgba(99,102,241,.16) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(99,102,241,.16) 1px, transparent 1px);
  background-size:20px 20px;
}
.ce-editable .kmc-card.wb-safe::before{
  outline:1px dashed rgba(225,29,72,.55); outline-offset:-14px;
}

/* --- segmented control ---------------------------------------------------- */
.wb-seg{
  display:inline-flex; padding:3px; gap:2px; border-radius:11px;
  border:1px solid var(--line); background:var(--surface-3);
}
.wb-seg button{
  display:inline-flex; align-items:center; gap:5px; padding:5px 10px;
  border:0; border-radius:8px; background:transparent; cursor:pointer;
  font-family:inherit; font-size:12px; font-weight:650; color:var(--ink-muted);
  white-space:nowrap;
  transition:background var(--wb-fast) var(--wb-ease),
             color var(--wb-fast) var(--wb-ease);
}
.wb-seg button:hover{ color:var(--ink-2); }
.wb-seg button.is-on{ background:var(--surface); color:var(--brand-700);
  box-shadow:0 1px 2px rgba(3,7,18,.1); }
html.dark .wb-seg button.is-on{ background:rgba(99,102,241,.2); color:#c7d2fe; }
.wb-seg button:focus-visible{ outline:2px solid var(--brand); outline-offset:-1px; }

/* --- zoom ----------------------------------------------------------------- */
.wb-zoom{ display:inline-flex; align-items:center; gap:2px;
  border:1px solid var(--line); border-radius:11px; background:var(--surface-3);
  padding:3px; }
.wb-zoom button{
  width:26px; height:26px; display:grid; place-items:center; border:0;
  border-radius:8px; background:transparent; color:var(--ink-muted);
  cursor:pointer; transition:background var(--wb-fast) var(--wb-ease); }
.wb-zoom button:hover{ background:var(--surface); color:var(--ink-2); }
.wb-zoom-val{
  min-width:46px; text-align:center; font-size:11.5px; font-weight:750;
  color:var(--ink-2); font-variant-numeric:tabular-nums; cursor:pointer;
  border:0; background:transparent; font-family:inherit; padding:0 2px;
}

/* --- alignment guides ----------------------------------------------------- */
.wb-guide{
  position:absolute; z-index:70; pointer-events:none;
  background:#ec4899; box-shadow:0 0 0 .5px rgba(236,72,153,.35);
  opacity:0; transition:opacity .1s linear;
}
.wb-guide.is-on{ opacity:1; }
.wb-guide-v{ width:1px; top:0; bottom:0; }
.wb-guide-h{ height:1px; left:0; right:0; }

/* --- selection chrome on the card ----------------------------------------- */
.ce-editable [data-el]{
  transition:outline-color var(--wb-fast) var(--wb-ease);
  outline:1px dashed transparent; outline-offset:2px;
}
.ce-editable [data-el]:hover{ outline-color:rgba(99,102,241,.55); }
.ce-editable [data-el].ce-selected{
  outline:2px solid var(--brand); outline-offset:2px;
  animation:wbPop var(--wb-fast) var(--wb-ease);
}
@keyframes wbPop{ from{ outline-offset:6px; } to{ outline-offset:2px; } }
@media (prefers-reduced-motion:reduce){
  .ce-editable [data-el].ce-selected{ animation:none; }
  .wb-stage{ transition:none; }
}

/* --- inspector rows ------------------------------------------------------- */
.wb-list{ display:flex; flex-direction:column; gap:3px; }
.wb-item{
  display:flex; align-items:center; gap:8px; width:100%; padding:7px 8px;
  border-radius:10px; border:1px solid transparent; background:transparent;
  cursor:pointer; text-align:left; font-family:inherit;
  transition:background var(--wb-fast) var(--wb-ease),
             border-color var(--wb-fast) var(--wb-ease);
}
.wb-item:hover{ background:var(--surface-2); }
.wb-item.is-on{ border-color:var(--brand); background:var(--brand-tint); }
.wb-item-ico{ flex:0 0 auto; color:var(--ink-faint); }
.wb-item.is-on .wb-item-ico{ color:var(--brand-700); }
.wb-item-body{ flex:1; min-width:0; }
.wb-item-name{
  display:block; font-size:12.5px; font-weight:650; color:var(--ink-2);
  overflow:hidden; text-overflow:ellipsis; white-space:nowrap;
}
.wb-item.is-on .wb-item-name{ color:var(--brand-700); }
.wb-item-sub{
  display:block; font-size:10.5px; color:var(--ink-faint);
  font-family:ui-monospace,SFMono-Regular,Menlo,monospace;
  overflow:hidden; text-overflow:ellipsis; white-space:nowrap;
}
.wb-item.is-off .wb-item-name{ opacity:.5; text-decoration:line-through; }
.wb-item-tools{ display:flex; gap:1px; flex:0 0 auto; opacity:.55;
  transition:opacity var(--wb-fast) var(--wb-ease); }
.wb-item:hover .wb-item-tools,
.wb-item.is-on .wb-item-tools{ opacity:1; }
.wb-mini{
  width:26px; height:26px; display:grid; place-items:center; border:0;
  border-radius:7px; background:transparent; color:var(--ink-muted);
  cursor:pointer; transition:background var(--wb-fast) var(--wb-ease),
                             color var(--wb-fast) var(--wb-ease); }
.wb-mini:hover{ background:var(--surface-3); color:var(--ink); }
.wb-mini:disabled{ opacity:.3; cursor:not-allowed; }
.wb-mini-danger:hover{ background:var(--danger-tint); color:var(--danger); }

/* --- compact control rows ------------------------------------------------- */
.wb-ctl{ margin-bottom:11px; }
.wb-ctl:last-child{ margin-bottom:0; }
.wb-ctl-head{ display:flex; align-items:center; gap:8px; margin-bottom:5px; }
.wb-ctl-head label{ font-size:11.5px; font-weight:700; color:var(--ink-2); }
.wb-ctl-val{
  margin-left:auto; font-size:11px; font-weight:700; color:var(--ink-muted);
  font-variant-numeric:tabular-nums;
  font-family:ui-monospace,SFMono-Regular,Menlo,monospace;
}
.wb-range{
  width:100%; height:20px; -webkit-appearance:none; appearance:none;
  background:transparent; cursor:pointer;
}
.wb-range::-webkit-slider-runnable-track{
  height:4px; border-radius:99px; background:var(--line-strong); }
.wb-range::-webkit-slider-thumb{
  -webkit-appearance:none; width:14px; height:14px; margin-top:-5px;
  border-radius:50%; background:var(--brand); border:2px solid var(--surface);
  box-shadow:0 1px 3px rgba(3,7,18,.3);
  transition:transform var(--wb-fast) var(--wb-ease); }
.wb-range::-webkit-slider-thumb:hover{ transform:scale(1.18); }
.wb-range::-moz-range-track{ height:4px; border-radius:99px; background:var(--line-strong); }
.wb-range::-moz-range-thumb{
  width:14px; height:14px; border-radius:50%; background:var(--brand);
  border:2px solid var(--surface); box-shadow:0 1px 3px rgba(3,7,18,.3); }

.wb-swatch{ display:flex; align-items:center; gap:8px; }
.wb-swatch input[type=color]{
  width:34px; height:30px; padding:2px; border-radius:9px; cursor:pointer;
  border:1px solid var(--line); background:var(--surface-2); }
.wb-swatch .hex{
  flex:1; min-width:0; padding:6px 9px; border-radius:9px;
  border:1px solid var(--line); background:var(--surface-2); color:var(--ink);
  font-size:11.5px; font-family:ui-monospace,SFMono-Regular,Menlo,monospace; }
.wb-swatch .hex:focus{ outline:none; border-color:var(--brand);
  box-shadow:0 0 0 3px var(--brand-tint); }

.wb-grid2{ display:grid; grid-template-columns:1fr 1fr; gap:7px; }
.wb-grid3{ display:grid; grid-template-columns:repeat(3,1fr); gap:6px; }
.wb-grid4{ display:grid; grid-template-columns:repeat(4,1fr); gap:6px; }

/* --- theme swatches ------------------------------------------------------- */
.wb-theme{
  display:flex; flex-direction:column; align-items:center; gap:5px;
  padding:9px 4px; border-radius:11px; border:1px solid var(--line);
  background:var(--surface-2); cursor:pointer; font-family:inherit;
  transition:transform var(--wb-fast) var(--wb-ease),
             border-color var(--wb-fast) var(--wb-ease),
             background var(--wb-fast) var(--wb-ease);
}
.wb-theme:hover{ transform:translateY(-2px); border-color:var(--line-strong); }
.wb-theme.is-on{ border-color:var(--brand); background:var(--brand-tint); }
.wb-theme-dot{
  width:26px; height:26px; border-radius:50%;
  box-shadow:inset 0 0 0 1px rgba(3,7,18,.14); }
.wb-theme-name{ font-size:10px; font-weight:750; color:var(--ink-muted); }
.wb-theme.is-on .wb-theme-name{ color:var(--brand-700); }

/* --- empty state ---------------------------------------------------------- */
.wb-empty{
  padding:26px 16px; text-align:center; border-radius:12px;
  border:1px dashed var(--line-strong); background:var(--surface-2);
  color:var(--ink-muted); font-size:12.5px; line-height:1.6;
}
.wb-empty i{ display:block; margin:0 auto 8px; color:var(--ink-faint); }

/* --- keyboard hint chips -------------------------------------------------- */
.wb-kbd{
  display:inline-flex; align-items:center; gap:4px; padding:2px 6px;
  border-radius:6px; border:1px solid var(--line); background:var(--surface-3);
  font-size:10px; font-weight:700; color:var(--ink-muted);
  font-family:ui-monospace,SFMono-Regular,Menlo,monospace;
}

/* --- form editor: section navigator --------------------------------------- */
.wb-nav{ display:flex; flex-direction:column; gap:2px; }
.wb-nav-item{
  display:flex; align-items:center; gap:8px; padding:8px 9px; width:100%;
  border:0; border-left:2px solid transparent; border-radius:0 9px 9px 0;
  background:transparent; cursor:pointer; text-align:left; font-family:inherit;
  transition:background var(--wb-fast) var(--wb-ease),
             border-color var(--wb-fast) var(--wb-ease);
}
.wb-nav-item:hover{ background:var(--surface-2); }
.wb-nav-item.is-on{ background:var(--brand-tint); border-left-color:var(--brand); }
.wb-nav-name{
  flex:1; min-width:0; font-size:12.5px; font-weight:650; color:var(--ink-2);
  overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.wb-nav-item.is-on .wb-nav-name{ color:var(--brand-700); }
.wb-nav-count{
  font-size:10.5px; font-weight:750; color:var(--ink-faint);
  background:var(--surface-3); border-radius:99px; padding:1px 7px; }

.wb-search{ position:relative; margin-bottom:10px; }
.wb-search i{ position:absolute; left:10px; top:50%; transform:translateY(-50%);
  color:var(--ink-faint); pointer-events:none; }
.wb-search input{
  width:100%; padding:8px 30px 8px 31px; border-radius:10px;
  border:1px solid var(--line); background:var(--surface-2); color:var(--ink);
  font-size:12.5px; font-family:inherit; }
.wb-search input:focus{ outline:none; border-color:var(--brand);
  background:var(--surface); box-shadow:0 0 0 3px var(--brand-tint); }
.wb-search button{
  position:absolute; right:6px; top:50%; transform:translateY(-50%);
  width:22px; height:22px; display:grid; place-items:center; border:0;
  border-radius:6px; background:transparent; color:var(--ink-faint); cursor:pointer; }
.wb-search button:hover{ background:var(--surface-3); color:var(--ink-2); }

/* --- form editor: sections ------------------------------------------------ */
.wb-sections{ display:flex; flex-direction:column; gap:12px; }
.fe-section{
  border:1px solid var(--line); border-radius:14px; background:var(--surface);
  box-shadow:var(--sh-sm); overflow:hidden; margin-bottom:0;
  transition:box-shadow var(--wb-fast) var(--wb-ease),
             border-color var(--wb-fast) var(--wb-ease);
}
.fe-section.is-target{ border-color:var(--brand); box-shadow:0 0 0 3px var(--brand-tint); }
.fe-section.is-collapsed .fe-sec-wrap,
.fe-section.is-collapsed .fe-sec-note,
.fe-section.is-collapsed .adm-empty{ display:none; }
.fe-section.is-hit{ animation:wbFlash 1.1s var(--wb-ease); }
@keyframes wbFlash{
  0%,100%{ box-shadow:var(--sh-sm); }
  30%{ box-shadow:0 0 0 3px var(--brand-tint); }
}
.fe-row{ transition:background var(--wb-fast) var(--wb-ease); }
.fe-row.is-dim{ display:none; }
.fe-drop{
  height:2px; background:var(--brand); border-radius:2px; margin:0 12px;
  box-shadow:0 0 0 2px var(--brand-tint);
}

@media (max-width:1099px){
  .wb-pane{ max-height:none; }
  .wb-canvas{ padding:18px; min-height:380px; }
  .wb-main{ min-height:0; }
}
@media (max-width:640px){
  .wb-canvas{ padding:12px; }
  .wb-bar{ padding:10px; }
  .wb-bar-actions{ width:100%; }
  .wb-bar-actions .adm-btn{ flex:1 1 auto; justify-content:center; }
  .wb-canvasbar{ gap:6px; }
}


/* ==========================================================================
   32. KMC OFFICIAL CARD  (design layout "modern")
   A faithful build of the reference artwork. Authored at the same CR80 sizes
   as the classic card — 340 x 548.4 portrait, 540 x 340.53 landscape — so the
   print geometry in sections 16 / 16b applies unchanged.

   Every colour is a design token (--kc-*, set per card from its snapshot);
   the fallbacks here are the values sampled from the artwork.
   ========================================================================== */
.kmc-modern{
  --km-head: 'Montserrat', 'Inter', Arial, Helvetica, sans-serif;
  --km-body: 'Inter', Arial, Helvetica, sans-serif;
}
.kmc-modern .kmc-card{
  font-family:var(--km-body);
  color:var(--kc-label, #1b1b1b);
  background:#fff;
  background:linear-gradient(180deg,var(--kc-bg1,#fff) 0%,var(--kc-bg2,#fff) 55%,var(--kc-bg3,#fff) 100%);
  box-shadow:0 18px 40px -20px rgba(16,24,40,.38);
}
.kmc-modern .kmc-card::before{ display:none; }        /* no classic haze */
.kmc-modern .kmc-card[data-corners] .kmc-corners{ display:none; }

/* the building rendering, anchored to the right of the front face */
.kmc-modern .km-bg{
  background-size:auto 96%;
  background-position:100% 100%;
  background-repeat:no-repeat;
  opacity:var(--kc-bg-opacity, .62);
  filter:var(--kc-bg-filter, none);
}
.kmc-modern .km-bg-back{ background-position:30% 78%; background-size:auto 72%; }

.kmc-modern .km-body{
  position:relative; z-index:2; padding:0; height:100%;
  display:flex; flex-direction:column;
}
.km-sprite{ position:absolute; width:0; height:0; overflow:hidden; }

/* --- front: header ---------------------------------------------------------- */
.km-head{ display:flex; align-items:center; gap:10px; padding:15px 16px 0 14px; }
.km-seal{ width:60px; height:60px; object-fit:contain; flex:0 0 auto;
  filter:drop-shadow(0 1px 1px rgba(0,0,0,.12)); }
.km-org{
  font-family:var(--km-head); font-weight:800; font-size:17px; line-height:1.04;
  color:var(--kc-title, #1b5a30); letter-spacing:-.005em;
}
.km-org span{ display:block; white-space:nowrap; }

.km-rule{ position:relative; height:3px; margin-top:11px;
  background:var(--kc-stripe-accent, #0b431e); }
/* the artwork's rule breaks with a diagonal cut just before the right edge */
.km-rule i{
  position:absolute; right:8%; top:-2px; width:9px; height:7px;
  background:var(--kc-bg1, #fff); transform:skewX(-38deg);
}

/* --- front: photo + identity -------------------------------------------- */
/* Photograph, identity block and detail lines, placed by name so each
   orientation can put the lines where that shape has room: beside the
   photograph on the horizontal card, underneath it on the vertical one. */
.km-main{
  display:grid; grid-template-columns:auto minmax(0, 1fr);
  grid-template-areas:'photo info' 'photo rows';
  align-content:start; column-gap:12px; padding:12px 16px 0 16px;
}
.km-photo{ grid-area:photo; }
.kmc-modern .kmc-rows-front{ grid-area:rows; }
.kmc-modern .kmc-photo{
  width:116px; height:144px; display:block;
  border-radius:var(--kc-photo-radius, 9px);
  border:var(--kc-photo-border-w, 0) solid var(--kc-photo-border, #fff);
  object-fit:cover; background:#e6e9e6; box-shadow:none;
}
.km-photo-empty{ display:grid; place-items:center; color:#9aa79c; }
.km-photo-empty svg, .km-photo-empty i{ width:38px; height:38px; }
.km-info{ grid-area:info; min-width:0; padding-top:1px; }
.km-card-title{
  font-family:var(--km-head); font-weight:900; font-size:14.5px; line-height:1.1;
  color:var(--kc-label, #1b1b1b); letter-spacing:-.012em; white-space:nowrap;
}
.km-accent{ display:block; position:relative; width:128px; height:2px; margin:5px 0 8px;
  background:var(--kc-stripe-mid, #0b5a2b); }
.km-accent::after{ content:''; position:absolute; right:-5px; top:-2px; width:6px; height:6px;
  border-radius:50%; background:var(--kc-stripe-mid, #0b5a2b); }
.kmc-modern .km-person{
  font-family:var(--km-head); font-weight:800; font-size:16px; line-height:1.1;
  color:var(--kc-name, #1b5a30); letter-spacing:0;
}
.km-fho{ font-family:var(--km-body); font-weight:500; font-size:10.5px; line-height:1.2;
  color:var(--kc-value, #262626); margin-top:3px; letter-spacing:.01em; }

/* --- printed rows (both faces) ------------------------------------------ */
.kmc-modern .km-rows{ margin-top:9px; }
.kmc-modern .km-row{ display:flex; align-items:baseline; font-size:10.5px; line-height:1.25;
  border-bottom:var(--kc-row-divider, none); padding-bottom:0; }
.kmc-modern .kmc-rows-front > .km-row + .km-row{ margin-top:var(--kc-row-gap-front, 4px); }
.kmc-modern .kmc-rows-back  > .km-row + .km-row{ margin-top:var(--kc-row-gap-back, 7px); }
.kmc-modern .km-label{
  font-family:var(--km-head); font-weight:700; font-size:10.5px; letter-spacing:0;
  color:var(--kc-label, #1b1b1b); flex:0 0 98px;
  text-decoration:var(--kc-label-underline, none); text-underline-offset:2px;
  min-width:0; overflow:hidden; text-overflow:ellipsis;
}
.km-colon{ flex:0 0 14px; text-align:center; font-weight:700;
  color:var(--kc-label, #1b1b1b); }
.kmc-modern .km-value{ flex:1 1 auto; }
.kmc-modern .km-value{ font-family:var(--km-body); font-weight:500; font-size:10.5px;
  color:var(--kc-value, #262626); min-width:0; text-align:left; }

/* --- front: the vertical card ------------------------------------------- */
.kmc-modern:not(.kmc-landscape) .km-main{
  grid-template-areas:'photo info' 'rows rows';
  column-gap:13px; padding:13px 16px 0 16px;
}
.kmc-modern:not(.kmc-landscape) .kmc-photo{ width:138px; height:180px; }
.kmc-modern:not(.kmc-landscape) .km-info{ align-self:start; }
.kmc-modern:not(.kmc-landscape) .km-card-title{ font-size:14px; }
.kmc-modern:not(.kmc-landscape) .km-accent{ width:112px; margin:6px 0 9px; }
.kmc-modern:not(.kmc-landscape) .km-person{ font-size:17px; }
.kmc-modern:not(.kmc-landscape) .km-fho{ font-size:11px; }
/* the detail lines drop below the photograph and take the card's full width */
.kmc-modern:not(.kmc-landscape) .kmc-rows-front{ padding-top:16px; margin-bottom:2px; }
.kmc-modern:not(.kmc-landscape) .kmc-rows-front .km-row{ font-size:12px; }
.kmc-modern:not(.kmc-landscape) .kmc-rows-front .km-label{
  flex-basis:130px; font-size:12px;
}
.kmc-modern:not(.kmc-landscape) .kmc-rows-front .km-value{ font-size:12px; }
.kmc-modern:not(.kmc-landscape) .kmc-rows-front > .km-row + .km-row{
  margin-top:var(--kc-row-gap-front, 9px);
}

/* --- front: bottom strip + footer ---------------------------------------- */
.km-strip{
  margin-top:auto; border-top:1px solid #e3e7e3; padding:10px 16px 8px;
  display:flex; flex-wrap:wrap; align-items:center; gap:10px 12px;
}
.km-strip-item{ display:flex; align-items:center; gap:8px; flex:1 1 100%; min-width:0; }
.km-badge{ width:28px; height:28px; border-radius:50%; flex:0 0 auto;
  background:var(--kc-stripe-mid, #0b5a2b); display:grid; place-items:center; }
.km-badge svg{ width:16px; height:16px; fill:#fff; }
.km-strip-text{ min-width:0; display:flex; flex-direction:column; line-height:1.18; }
.km-strip-text b{ font-family:var(--km-head); font-weight:700; font-size:9.5px;
  color:var(--kc-label, #1b1b1b); text-decoration:none; letter-spacing:0; white-space:nowrap; }
.km-strip-text span{ font-family:var(--km-body); font-weight:500; font-size:9.5px;
  color:var(--kc-value, #262626); white-space:nowrap; }
.km-code{ flex:1 1 100%; display:flex; justify-content:center; padding:4px 0 2px; }
.kmc-modern .km-code .kmc-barcode{
  border:1px solid #d6d9d6; border-radius:4px; padding:3px 6px; background:#fff;
  max-width:100%; height:auto;
}
.km-footer{
  background:var(--kc-stripe-dark, #025d2d); color:#fff; text-align:center;
  font-family:var(--km-head); font-weight:700; font-size:10.5px;
  letter-spacing:.2em; padding:9px 8px 8px; white-space:nowrap; overflow:hidden;
}
.km-footer span{ display:inline-block; }

/* the vertical strip sits tighter so the card ends on the barcode */
.kmc-modern:not(.kmc-landscape) .km-strip{
  flex:1 1 auto; flex-direction:column; flex-wrap:nowrap;
  justify-content:space-between; align-items:stretch;
  padding:11px 16px 9px; gap:10px;
}
.kmc-modern:not(.kmc-landscape) .km-strip-item{ flex:0 0 auto; }
.kmc-modern:not(.kmc-landscape) .km-code{ flex:0 0 auto; padding:0; }
.kmc-modern:not(.kmc-landscape) .km-badge{ width:30px; height:30px; }
.kmc-modern:not(.kmc-landscape) .km-badge svg{ width:17px; height:17px; }
.kmc-modern:not(.kmc-landscape) .km-strip-text b,
.kmc-modern:not(.kmc-landscape) .km-strip-text span{ font-size:10.5px; }
.kmc-modern:not(.kmc-landscape) .km-code .kmc-barcode{ height:40px; }
.kmc-modern:not(.kmc-landscape) .km-footer{ padding:8px; }

/* --- back ------------------------------------------------------------------ */
.km-band{ height:13px; width:60%; flex:0 0 auto;
  background:var(--kc-stripe-dark, #025d2d); border-bottom-right-radius:8px; }
.km-cols{ display:flex; flex-direction:column; flex:1 1 auto; min-height:0;
  padding:10px 14px 6px; gap:8px; }
.km-left{ display:flex; flex-direction:column; flex:0 0 auto; }
.km-divider{ display:none; }
.km-right{ display:flex; flex-direction:column; gap:7px; min-width:0; flex:0 0 auto; }
.km-terms, .km-qr-row, .km-sign{ flex:0 0 auto; }

.km-row-icon{ align-items:center; }
.km-ico{ width:18px; height:18px; flex:0 0 auto; margin-right:9px; display:grid; place-items:center; }
.km-ico svg{ width:17px; height:17px; fill:var(--kc-stripe-mid, #0b5a2b); }
.km-rows-back{ margin-top:2px; }
.km-rows-back .km-label{ flex-basis:150px; font-size:9.6px; }
.km-rows-back .km-row + .km-row{ margin-top:var(--kc-row-gap-back, 7px); }

.km-sign{ display:flex; flex-direction:column; align-items:center; width:176px;
  margin:8px 0 0 26px; }
.kmc-modern:not(.kmc-landscape) .km-cols{ gap:0; padding:12px 15px 6px; }
.kmc-modern:not(.kmc-landscape) .km-rows-back .km-row + .km-row{
  margin-top:var(--kc-row-gap-back, 9px);
}
.kmc-modern:not(.kmc-landscape) .km-sign{ margin:12px 0 12px; width:100%; }
.kmc-modern:not(.kmc-landscape) .km-qr-row{ margin-bottom:10px; }
.kmc-modern:not(.kmc-landscape) .km-terms{ margin-bottom:10px; }
.kmc-modern:not(.kmc-landscape) .km-right{ flex:1 1 auto; justify-content:flex-end; }
.km-sig{ height:30px; width:auto; object-fit:contain; }
.km-sig-line{ display:block; width:150px; height:1px; background:#2b2b2b; margin-top:3px; }
.km-auth{ font-family:var(--km-head); font-weight:800; font-size:9.5px; letter-spacing:.02em;
  color:var(--kc-label, #1b1b1b); margin-top:4px; white-space:nowrap; }
.km-auth-org{ font-family:var(--km-body); font-weight:500; font-size:8.5px;
  color:var(--kc-value, #262626); margin-top:1px; white-space:nowrap; }

.km-qr-row{ display:flex; gap:10px; align-items:flex-start; }
.km-qrbox{ flex:0 0 auto; border:1px solid #d3d8d3; border-radius:6px; padding:5px; background:#fff; }
.kmc-modern .km-qrbox .kmc-qr{ padding:0; box-shadow:none; border-radius:0;
  display:block; width:62px; height:62px; overflow:hidden; line-height:0; }
.kmc-modern .km-qrbox .kmc-qr canvas, .kmc-modern .km-qrbox .kmc-qr img{
  display:block; width:62px; height:62px; }
.km-return{ font-family:var(--km-body); font-size:8.6px; line-height:1.32;
  color:var(--kc-value, #262626); min-width:0; }
.km-ret-intro, .km-ret-addr, .km-ret-tel{ font-weight:500; }
.kmc-modern .km-ret-org{ font-family:var(--km-head); font-weight:800; font-size:9.6px;
  line-height:1.15; color:var(--kc-title, #1b5a30); margin:2px 0 1px; letter-spacing:0; }

.km-terms{ border-radius:7px; overflow:hidden; border:1px solid #cfe0d3; }
.km-terms-head{ background:var(--kc-stripe-dark, #025d2d); color:#fff; text-align:center;
  font-family:var(--km-head); font-weight:800; font-size:9.2px; letter-spacing:.02em;
  padding:4px 6px; }
.km-terms-body{ background:var(--kc-stripe-light, #dfeee3); margin:0; padding:5px 8px 6px 17px;
  list-style:disc; font-family:var(--km-body); font-weight:500; font-size:8.2px;
  line-height:1.32; color:var(--kc-value, #262626); }
.km-terms-body li{ padding-left:1px; }
.km-code-back{ padding:2px 0 0; flex:0 0 auto; }
.kmc-modern .km-code .kmc-barcode{ height:30px; width:auto; }
.kmc-modern .km-code-back .kmc-barcode{ width:100%; height:34px; }
.kmc-modern .km-label, .km-strip-text b{ white-space:nowrap; }

/* the back's footer sits at the bottom like the front's */
.km-body-back .km-footer{ margin-top:auto; }

/* ==========================================================================
   32b. KMC OFFICIAL CARD — LANDSCAPE (the artwork's own orientation)
   Specificity: .kmc-modern.kmc-landscape beats the classic .kmc-landscape
   grid rules, which must not touch this markup.
   ========================================================================== */
.kmc-pair.kmc-modern.kmc-landscape .kmc-front .kmc-body,
.kmc-pair.kmc-modern.kmc-landscape .kmc-back  .kmc-body{
  display:flex; flex-direction:column; padding:0;
  grid-template-areas:none; grid-template-columns:none; grid-template-rows:none;
}
.kmc-modern.kmc-landscape .km-bg{ background-size:auto 100%; background-position:100% 100%; }
.kmc-modern.kmc-landscape .km-bg-back{ background-position:34% 90%; background-size:auto 88%; }

.kmc-modern.kmc-landscape .km-head{ padding:11px 16px 0 14px; gap:12px; }
.kmc-modern.kmc-landscape .km-seal{ width:60px; height:60px; }
.kmc-modern.kmc-landscape .km-org{ font-size:21px; }
.kmc-modern.kmc-landscape .km-rule{ margin-top:8px; }

.kmc-modern.kmc-landscape .km-main{ padding:11px 16px 0 18px; gap:18px; }
.kmc-modern.kmc-landscape .kmc-photo{ width:120px; height:150px; }
.kmc-modern.kmc-landscape .km-card-title{ font-size:19px; }
.kmc-modern.kmc-landscape .km-accent{ width:146px; margin:6px 0 10px; }
.kmc-modern.kmc-landscape .km-person{ font-size:19px; }
.kmc-modern.kmc-landscape .km-fho{ font-size:12px; margin-top:2px; }
.kmc-modern.kmc-landscape .km-rows{ margin-top:11px; }
.kmc-modern.kmc-landscape .km-row,
.kmc-modern.kmc-landscape .km-label,
.kmc-modern.kmc-landscape .km-value{ font-size:11.5px; }
.kmc-modern.kmc-landscape .kmc-rows-front > .km-row + .km-row{ margin-top:5px; }
.kmc-modern.kmc-landscape .km-label{ flex-basis:110px; }

.kmc-modern.kmc-landscape .km-strip{ flex-wrap:nowrap; gap:14px; padding:8px 16px 6px; }
.kmc-modern.kmc-landscape .km-strip-item{ flex:0 0 auto; }
.kmc-modern.kmc-landscape .km-code{ flex:1 1 auto; justify-content:flex-end; padding:0; }
.kmc-modern.kmc-landscape .km-footer{ font-size:10px; padding:5px 8px; }

.kmc-modern.kmc-landscape .km-band{ width:53%; height:14px; }
.kmc-modern.kmc-landscape .km-cols{ flex-direction:row; padding:10px 14px 6px; gap:0; }
.kmc-modern.kmc-landscape .km-left{ flex:0 0 53%; padding-right:6px; }
.kmc-modern.kmc-landscape .km-divider{ display:block; width:1px; align-self:stretch;
  background:#dadeda; margin:0 10px 0 2px; }
.kmc-modern.kmc-landscape .km-right{ flex:1 1 auto; justify-content:space-between; gap:6px; }
.kmc-modern.kmc-landscape .km-rows-back .km-label{ flex-basis:136px; font-size:8.8px; }
.kmc-modern.kmc-landscape .km-rows-back .km-value{ font-size:10px; white-space:nowrap; }
.kmc-modern.kmc-landscape .km-rows-back .km-colon{ flex-basis:11px; }
.kmc-modern.kmc-landscape .km-rows-back .km-ico{ margin-right:7px; }
.kmc-modern.kmc-landscape .km-rows-back .km-row + .km-row{ margin-top:9px; }
.kmc-modern.kmc-landscape .km-strip-item{ flex:0 0 auto; }
.kmc-modern.kmc-landscape .km-cols{ gap:0; }
.kmc-modern.kmc-landscape .km-left{ flex-basis:54%; }
.kmc-modern.kmc-landscape .km-rows-back .km-row,
.kmc-modern.kmc-landscape .km-rows-back .km-value{ font-size:10.5px; }
.kmc-modern.kmc-landscape .km-sign{ margin:8px 0 0 30px; width:170px; }
.kmc-modern.kmc-landscape .km-return{ font-size:8.8px; }
.kmc-modern.kmc-landscape .km-ret-org{ font-size:10px; }
.kmc-modern.kmc-landscape .km-terms-body{ font-size:8.4px; }

/* --- editor / print hooks ---------------------------------------------------- */
.kmc-modern .kmc-card[data-mode="blank"] .km-sig{ visibility:hidden; }
@media print{
  #printArea .kmc-modern .km-bg{ display:block !important; }
}


/* --- card editor: template picker + layout wrappers ------------------------ */
.ce-layout-wrap[data-inactive]{ display:none; }
.ce-tpl-swatch{ width:34px; height:22px; border-radius:6px;
  box-shadow:inset 0 0 0 1px rgba(3,7,18,.14); }
.ce-tpl-modern{ background:linear-gradient(180deg,#fff 0 60%,#025d2d 60%); }
.ce-tpl-classic{ background:linear-gradient(120deg,#8dc453,#2c5c27); }
.ce-icon-pick{ display:grid; grid-template-columns:repeat(7,1fr); gap:5px; }
.ce-icon-pick button{ height:32px; border-radius:8px; border:1px solid var(--line);
  background:var(--surface-2); display:grid; place-items:center; cursor:pointer; }
.ce-icon-pick button svg{ width:15px; height:15px; fill:var(--ink-muted); }
.ce-icon-pick button.is-on{ border-color:var(--brand); background:var(--brand-tint); }
.ce-icon-pick button.is-on svg{ fill:var(--brand-700); }

/* A photograph the browser cannot paint (a camera TIFF, an iPhone HEIC) is
   still a good upload — the server converts it. Show a placeholder rather than
   a broken thumbnail, and never treat it as a failed choice. */
.cms-nopreview img{ display:none; }
.cms-nopreview{ position:relative; }
.cms-nopreview::after{
  content:'IMG'; position:absolute; inset:0; display:grid; place-items:center;
  font-size:10px; font-weight:800; letter-spacing:.08em; color:#94a3b8;
}

/* A field the chosen organisation does not use: still readable, plainly off. */
[data-field].is-na input,
[data-field].is-na select{ opacity:.45; cursor:not-allowed; }
[data-field].is-na .org-na{ color:#94a3b8; }
/* the note carries `flex`, which beats the browser's own [hidden] rule — so
   hiding it has to be said here, or it stayed on screen beside a live field */
.org-na[hidden]{ display:none !important; }

/* ==========================================================================
   16c. PRINT — one sheet or two
   ==========================================================================
   By default both faces go on a single sheet: side by side when the card is
   vertical, stacked when it is horizontal (sections 16 and 16b). Some card
   printers want one face per sheet instead, so `printCard()` can add
   `.print-split`, which lays the pair out as plain blocks and breaks the page
   between them. Everything about the card's own size is unchanged — a face is
   still exactly CR80 either way.
   ========================================================================== */
@media print{
  body.printing-card.print-split #printArea .kmc-pair,
  body.printing-card.print-split #printArea .kmc-pair.kmc-landscape{
    display:block !important;
    gap:0 !important;
  }
  body.printing-card.print-split #printArea .kmc-card{
    display:block !important;
    break-after:page !important; page-break-after:always !important;
    break-inside:avoid; page-break-inside:avoid;
  }
  /* the last face must not push an empty sheet after it */
  body.printing-card.print-split #printArea .kmc-card:last-child{
    break-after:auto !important; page-break-after:auto !important;
  }
}

/* ==========================================================================
   THE `hidden` ATTRIBUTE ALWAYS HIDES
   ==========================================================================
   `[hidden]` and a class like `.adm-btn` both have one point of specificity,
   so whichever stylesheet comes last wins. While Tailwind was injected by a
   script at run time it landed after app.css and hiding worked; served as a
   normal stylesheet it comes first, and every element hidden through the
   attribute but styled with a display rule quietly reappeared — a delete
   button on an Add dialog, a note beside a field that does apply.

   Rather than chase each one, the attribute is made to mean what it says.
   ========================================================================== */
[hidden]{ display:none !important; }

/* ==========================================================================
   16d. PRINT — every face centred on its sheet
   ==========================================================================
   Sections 16–16c size a face to exact CR80 millimetres, but they laid the
   pair out from the top-left corner of the printable area — so a printer with
   wide hardware margins, or a card printer fed an A4 job, cut off the top of
   the card. `printCard()` (card_detail.html) now builds one `.print-sheet` per
   sheet of paper, exactly the paper's size with the @page margin at zero, and
   each sheet centres its faces both ways. Paper size, paper orientation and a
   fine offset come from the Print menu.
   ========================================================================== */
@media print{
  body.printing-card{ margin:0 !important; padding:0 !important; }
  body.printing-card > *:not(#printArea){ display:none !important; }
  body.printing-card > #printArea{
    display:block !important; width:auto !important; max-width:none !important;
    margin:0 !important; padding:0 !important; border:0 !important;
    border-radius:0 !important;
  }
  body.printing-card #printArea > #cardStage{ display:none !important; }

  body.printing-card #printArea .print-sheet{
    position:relative; box-sizing:border-box;
    width:var(--sheet-w, 210mm);
    /* half a millimetre short of the paper, so rounding never spills a blank page */
    height:calc(var(--sheet-h, 297mm) - .5mm);
    display:flex !important; align-items:center; justify-content:center;
    overflow:hidden; margin:0 !important; padding:0 !important;
    break-inside:avoid; page-break-inside:avoid;
    break-after:page; page-break-after:always;
  }
  body.printing-card #printArea .print-sheet:last-child{
    break-after:auto; page-break-after:auto; }

  body.printing-card #printArea .print-sheet > .kmc-pair,
  body.printing-card.print-split #printArea .print-sheet > .kmc-pair,
  body.printing-card.print-split #printArea .print-sheet > .kmc-pair.kmc-landscape{
    display:flex !important; flex-wrap:nowrap !important;
    align-items:center !important; justify-content:center !important;
    width:auto !important; margin:0 !important;
    transform:translate(var(--print-off-x, 0mm), var(--print-off-y, 0mm));
  }
  body.printing-card #printArea .print-sheet .kmc-card{
    flex:0 0 auto !important;
    break-after:auto !important; page-break-after:auto !important;
  }
  /* A face's footprint must be its printed size on every side. Section 16
     zeroes the last face's right margin, which did no harm while the pair hugged
     the left edge but would push a centred pair off to one side. */
  body.printing-card #printArea .print-sheet .kmc-pair:not(.kmc-landscape) .kmc-card{
    margin:0 calc(var(--pvc-w) - var(--pvc-card-w))
             calc(var(--pvc-h) - var(--pvc-card-h)) 0 !important;
  }
  body.printing-card #printArea .print-sheet .kmc-pair.kmc-landscape .kmc-card{
    margin:0 calc(var(--pvc-l-w) - var(--pvc-l-card-w))
             calc(var(--pvc-l-h) - var(--pvc-l-card-h)) 0 !important;
  }
  body.printing-card.print-no-guides #printArea .kmc-card{ outline:0 !important; }
}

/* --- Print menu: paper & position ----------------------------------------- */
.print-more{ margin:0 0 10px; border-radius:12px;
  border:1px solid rgba(148,163,184,.3); }
.print-more > summary{ list-style:none; cursor:pointer; display:flex; align-items:center;
  gap:7px; padding:8px 10px; font-size:12px; font-weight:700; }
.print-more > summary::-webkit-details-marker{ display:none; }
.print-more > summary::after{ content:''; margin-left:auto; width:7px; height:7px;
  border-right:2px solid currentColor; border-bottom:2px solid currentColor;
  transform:rotate(45deg) translateY(-2px); opacity:.55; transition:transform .2s; }
.print-more[open] > summary::after{ transform:rotate(225deg) translateY(-2px); }
.print-more-body{ padding:2px 10px 10px; display:grid; gap:9px; }
.print-field{ display:grid; gap:4px; font-size:11px; font-weight:600; }
.print-field select, .print-field input[type=number]{
  width:100%; border-radius:9px; border:1px solid rgba(148,163,184,.4);
  background:transparent; color:inherit; padding:6px 8px; font-size:12px;
  font-family:inherit; }
.print-field select option{ color:#0f172a; background:#fff; }
.print-field .wb-seg{ display:flex; }
.print-field .wb-seg button{ flex:1 1 0; justify-content:center; }
.wb-seg button:disabled{ opacity:.4; cursor:not-allowed; }
.print-grid2{ display:grid; grid-template-columns:1fr 1fr; gap:8px; }
.print-check{ display:flex; align-items:center; gap:8px; font-size:12px; cursor:pointer; }
.print-tip{ font-size:10.5px; line-height:1.45; opacity:.72; }

/* --- admin-added text on a card: one block, so alignment and wrapping work -- */
.kmc-extra-text{ display:block; width:100%; }

/* ==========================================================================
   CARD EDITOR — selection chrome (Canva-style)
   ==========================================================================
   The box, its handles and the floating toolbar live in the canvas, outside
   the card, so nothing about them can reach a saved design or a printed card.
   ========================================================================== */
.ce-selbox{ position:absolute; z-index:65; pointer-events:none;
  border:1.5px solid var(--brand, #6366f1); border-radius:3px;
  box-shadow:0 0 0 1px rgba(255,255,255,.7); }
.ce-selbox.is-locked{ border-style:dashed; }
.ce-h{ position:absolute; width:13px; height:13px; border-radius:50%;
  background:#fff; border:2px solid var(--brand, #6366f1); pointer-events:auto;
  box-shadow:0 1px 3px rgba(3,7,18,.3); touch-action:none; }
.ce-h-resize{ right:-8px; bottom:-8px; cursor:nwse-resize; }
.ce-h-rotate{ left:50%; top:-30px; margin-left:-6.5px; cursor:grab; }
.ce-h-rotate::after{ content:''; position:absolute; left:50%; top:11px; width:1.5px;
  height:17px; margin-left:-.75px; background:var(--brand, #6366f1); }
.ce-selbox.is-locked .ce-h, .ce-selbox.no-rotate .ce-h-rotate,
.ce-selbox.no-resize .ce-h-resize{ display:none; }

.ce-selbar{ position:absolute; z-index:66; display:flex; align-items:center; gap:2px;
  padding:4px; border-radius:11px; background:var(--surface, #fff);
  border:1px solid var(--line, #e2e8f0);
  box-shadow:0 10px 28px -10px rgba(3,7,18,.45); white-space:nowrap; }
.ce-selbar button{ width:30px; height:30px; display:grid; place-items:center; border:0;
  border-radius:8px; background:transparent; color:var(--ink-2, #334155); cursor:pointer; }
.ce-selbar button:hover{ background:var(--surface-3, #f1f5f9); color:var(--ink, #0f172a); }
.ce-selbar button.is-on{ background:var(--brand-tint, #eef2ff); color:var(--brand-700, #4338ca); }
.ce-selbar button.is-danger{ color:var(--danger, #e11d48); }
.ce-selbar button.is-danger:hover{ background:var(--danger-tint, #ffe4e6); }
.ce-selbar-sep{ width:1px; align-self:stretch; margin:4px 3px; background:var(--line, #e2e8f0); }
.ce-selbar-name{ font-size:11px; font-weight:750; color:var(--ink-muted, #64748b);
  padding:0 6px 0 4px; max-width:150px; overflow:hidden; text-overflow:ellipsis; }
.wb-canvas.is-dragging .ce-selbar{ display:none; }

.ce-editable [data-el].ce-editing,
.ce-editable .ce-editing{ outline:2px solid #f59e0b !important; outline-offset:2px;
  cursor:text !important; user-select:text; -webkit-user-select:text; }
.ce-editable [data-locked="1"]{ cursor:default; }
.ce-add-grid{ display:grid; grid-template-columns:repeat(3,1fr); gap:6px; margin-top:10px; }
.ce-img-slot{ display:flex; align-items:center; gap:10px; margin-bottom:10px; }
.ce-img-thumb{ width:52px; height:38px; flex:0 0 auto; border-radius:8px;
  border:1px solid var(--line, #e2e8f0); background:#fff center/contain no-repeat; }
.ce-img-slot .wb-grid3{ flex:1 1 auto; }
.ce-apply-all{ display:inline-flex; align-items:center; gap:6px; font-size:12px;
  font-weight:650; color:var(--ink-2, #334155); cursor:pointer; user-select:none; }
.ce-apply-all input{ width:15px; height:15px; accent-color:var(--brand, #6366f1); }
