/* =============================================================================
   Staple Design Hub — shared app shell
   -----------------------------------------------------------------------------
   Consumed by dashboard.html, design-system.html and component-kit.html.
   Depends on design-system.css for every value; nothing here hardcodes a colour
   except the Staple logo plate and the avatar gradient (brand marks).

   The canonical shell (rail, flyout, top header, side-nav panel) was authored in
   sidebar-nav.html against Clipper nomenclature. The alias layer below maps that
   nomenclature onto the authoritative index.css names so the CSS is reused
   verbatim and still follows light / dark / high-contrast automatically.
   ============================================================================= */

:root{
  --bg:var(--background);
  --fg:var(--foreground);
  --muted-fg:var(--muted-foreground);
  --primary-fg:var(--primary-foreground);
  --border-strong:var(--input);
  --font-body:var(--font-sans);
  --focus:var(--ring);
  --nav-icon-active:var(--primary);
  --nav-item-bg-active:#e5f8fe;

  /* Clipper elevation — design-system.css ships shadows flat by design and
     documents this as the opt-in for overlays and raised cards. */
  --shadow-sm:0 1px 2px rgba(0,0,0,.06);
  --shadow-md:0 4px 12px rgba(0,0,0,.08);
  --shadow-lg:0 8px 30px rgba(0,0,0,.12);
  --shadow-xl:0 20px 60px rgba(0,0,0,.15);
}
.dark,[data-theme="dark"]{
  --shadow-sm:0 1px 2px rgba(0,0,0,.2);
  --shadow-md:0 4px 12px rgba(0,0,0,.3);
  --shadow-lg:0 8px 30px rgba(0,0,0,.4);
  --shadow-xl:0 20px 60px rgba(0,0,0,.5);
}
[data-theme="high-contrast"]{
  --shadow-sm:0 1px 2px rgba(255,255,255,.1);
  --shadow-md:0 4px 12px rgba(255,255,255,.08);
  --shadow-lg:0 8px 30px rgba(255,255,255,.06);
  --shadow-xl:0 20px 60px rgba(255,255,255,.05);
}

*{box-sizing:border-box;margin:0;padding:0}
html,body{height:100%}
body{font-family:var(--font-body);background:var(--muted);color:var(--fg);font-size:14px;-webkit-font-smoothing:antialiased;overflow:hidden}
code{font-family:var(--font-mono);font-size:.92em}

.ico{display:inline-flex;align-items:center;justify-content:center;flex-shrink:0;color:inherit}
.ico svg{width:100%;height:100%;stroke:currentColor;fill:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
.ico-xs{width:14px;height:14px}.ico-sm{width:16px;height:16px}.ico-md{width:18px;height:18px}.ico-lg{width:20px;height:20px}.ico-xl{width:24px;height:24px}

/* ═══════════════ CANONICAL SHELL ═══════════════ */
.app-shell{display:flex;height:100vh;position:relative}

/* ─── SIDEBAR RAIL ─── */
.sidebar{width:56px;background:var(--header-bg);border-right:1px solid var(--accordion-stroke);color:var(--header-icon);flex-shrink:0;display:flex;flex-direction:column;align-items:center;padding:16px 8px;position:relative;z-index:15;gap:12px}
.logo-block{width:40px;height:40px;background:#08272e;border-radius:10px;display:flex;align-items:center;justify-content:center;flex-shrink:0;overflow:hidden;cursor:pointer}
.logo-mark{width:20px;height:20px}
.sidebar-sep{width:100%;height:1px;background:var(--accordion-stroke);flex-shrink:0}
.nav-items{display:flex;flex-direction:column;gap:4px;align-items:center;width:100%}
.nav-btn{width:40px;height:40px;border:none;background:transparent;color:var(--header-icon);cursor:pointer;display:flex;align-items:center;justify-content:center;transition:all .18s;font-family:inherit;position:relative;border-radius:24px;flex-shrink:0}
.nav-btn:hover{background:var(--muted);color:var(--nav-icon-active)}
.nav-btn.active{color:var(--nav-icon-active);background:var(--nav-item-bg-active)}
.nav-btn svg{width:20px;height:20px}
.sidebar-bottom{margin-top:auto;display:flex;flex-direction:column;align-items:center;gap:4px;width:100%}
.sidebar-bottom .sidebar-sep{margin-bottom:4px}
.customer-logo{width:40px;height:40px;border-radius:10px;overflow:hidden;display:flex;align-items:center;justify-content:center;background:var(--accent);color:var(--primary);cursor:pointer}
.nav-btn .tooltip{position:absolute;left:48px;top:50%;transform:translateY(-50%);background:var(--fg);color:var(--bg);padding:5px 10px;border-radius:8px;font-size:11.5px;font-weight:500;white-space:nowrap;pointer-events:none;opacity:0;transition:opacity .15s;z-index:100}
.nav-btn .tooltip::before{content:'';position:absolute;left:-4px;top:50%;transform:translateY(-50%);border:4px solid transparent;border-right-color:var(--fg);border-left:none}
.sidebar:not(.has-flyout) .nav-btn:hover .tooltip{opacity:1}

/* ─── FLYOUT ─── */
.flyout{position:absolute;left:57px;top:0;bottom:0;width:210px;background:var(--bg);border-right:1px solid var(--border);box-shadow:4px 0 14px rgba(0,59,74,.08);padding:14px 0 0;z-index:50;display:flex;flex-direction:column;opacity:0;visibility:hidden;transform:translateX(-8px);transition:all .22s ease,width .22s ease}
.flyout.visible{opacity:1;visibility:visible;transform:translateX(0)}
.flyout.locked{position:relative;left:0;box-shadow:none;border-right:1px solid var(--border);opacity:1;visibility:visible;transform:none}
.flyout-header{padding:0 14px 10px;border-bottom:1px solid var(--border);margin-bottom:8px;display:flex;justify-content:space-between;align-items:center}
.flyout-cat-name{font-family:var(--font-body);font-size:11px;letter-spacing:.12em;text-transform:uppercase;color:var(--muted-fg);font-weight:600}
.pin-btn{width:22px;height:22px;border:none;background:transparent;color:var(--muted-fg);cursor:pointer;border-radius:8px;display:flex;align-items:center;justify-content:center;transition:all .15s}
.pin-btn:hover{background:var(--muted);color:var(--primary)}
.pin-btn.active{color:var(--info);background:var(--nav-item-bg-active)}
.pin-btn svg{width:12px;height:12px}
.flyout-items{flex:1;overflow-y:auto}
.flyout-item{display:flex;align-items:center;gap:10px;padding:7px 14px;margin:1px 6px;font-size:12.5px;color:var(--fg);cursor:pointer;border-radius:8px;transition:all .12s;text-decoration:none}
.flyout-item:hover{background:var(--muted);color:var(--primary)}
.flyout-item.active{background:var(--primary);color:var(--primary-fg)}
.flyout-item.disabled{opacity:.45;cursor:default}
.flyout-item.disabled:hover{background:transparent;color:var(--fg)}
.flyout-item svg{width:13px;height:13px;opacity:.7;flex-shrink:0}
.flyout-item.active svg{opacity:1}
.flyout-foot{margin-top:auto;padding:10px 14px;border-top:1px solid var(--border);font-size:11px;color:var(--muted-fg);display:flex;align-items:center;gap:6px}
.flyout-foot.locked-msg{color:var(--primary);font-weight:500}
.flyout-foot svg{width:11px;height:11px}

/* ─── MAIN PANEL ─── */
.main-panel{flex:1;display:flex;flex-direction:column;min-width:0;overflow:hidden;position:relative;z-index:1;isolation:isolate;transition:flex .25s ease}

/* ─── TOP HEADER ─── */
.top-header{height:64px;background:transparent;display:flex;align-items:center;padding:12px 8px;flex-shrink:0;gap:16px}
.th-left{flex:1;display:flex;align-items:center;gap:4px;min-width:0}
.th-right{display:flex;align-items:center;gap:2px;flex-shrink:0;position:relative;z-index:201}
.icon-btn{width:48px;height:48px;border-radius:9999px;border:none;background:transparent;color:var(--header-fg);cursor:pointer;display:flex;align-items:center;justify-content:center;transition:background .15s;flex-shrink:0;position:relative}
.icon-btn:hover{background:var(--muted)}
.icon-btn svg{width:20px;height:20px}
.th-title{font-family:var(--font-body);font-size:18px;font-weight:600;color:var(--header-fg);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.th-crumb{font-size:13px;color:var(--muted-fg);white-space:nowrap}
.notif-badge{position:absolute;top:6px;right:4px;min-width:18px;height:18px;background:var(--primary);color:var(--primary-fg);font-size:8px;font-weight:500;font-family:var(--font-body);border-radius:24px;display:flex;align-items:center;justify-content:center;padding:0 4px}
.header-avatar{width:32px;height:32px;border-radius:50%;background:linear-gradient(135deg,#6366f1,#a855f7);display:flex;align-items:center;justify-content:center;color:#fff;font-size:11px;font-weight:600}

/* Search box (Clipper atom) */
.search-box{display:flex;align-items:center;gap:8px;padding:0 12px;height:38px;border:1px solid var(--border-strong);border-radius:8px;background:var(--bg);width:250px;margin-right:6px}
.search-box:focus-within{border-color:var(--focus);box-shadow:var(--focus-ring)}
.search-box .ico{color:var(--muted-fg)}
.search-box input{border:0;outline:0;background:0;flex:1;min-width:0;font:400 13px var(--font-body);color:var(--fg)}
.search-box input::placeholder{color:var(--muted-fg)}
.search-kbd{font:600 10px var(--font-body);color:var(--muted-fg);border:1px solid var(--border);border-radius:4px;padding:1px 5px;flex:none}
.search-clear{display:none;width:16px;height:16px;border:0;cursor:pointer;place-items:center}
.search-box.has-value .search-clear{display:grid}
.search-box.has-value .search-kbd{display:none}

/* ─── HEADER OVERLAYS ─── */
.header-overlay{position:absolute;top:calc(100% + 4px);right:0;background:var(--bg);border:1px solid var(--border);border-radius:10px;box-shadow:var(--shadow-lg);z-index:200;opacity:0;visibility:hidden;transform:translateY(-4px);transition:all .15s ease}
.header-overlay.open{opacity:1;visibility:visible;transform:translateY(0)}
/* A CONTROL WHOSE MENU IS OPEN HAS ALREADY SAID WHAT IT DOES. The kit's tip
   shows on :focus-within, and a menu button keeps focus while its menu is
   open -- so without this the Settings tip hung over the menu it had just
   opened. Same rule the kit applies to its own popup triggers. */
.ck-tip-host:has(+ .header-overlay.open) > .ck-tip{opacity:0}
.overlay-backdrop{position:fixed;inset:0;z-index:199;display:none}
.overlay-backdrop.open{display:block}
.profile-menu{width:264px;padding:6px 0}
.profile-menu-header{display:flex;align-items:center;gap:12px;padding:12px 16px 10px}
.profile-menu-avatar{width:40px;height:40px;border-radius:50%;background:linear-gradient(135deg,#6366f1,#a855f7);display:flex;align-items:center;justify-content:center;color:#fff;font-size:14px;font-weight:600;flex-shrink:0}
.profile-menu-info{min-width:0}
.profile-menu-name{font-size:14px;font-weight:600;color:var(--fg);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.profile-menu-email{font-size:12px;color:var(--muted-fg);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.overlay-sep{height:1px;background:var(--border);margin:4px 0}
.overlay-item{display:flex;align-items:center;gap:10px;padding:10px 16px;font:400 13px/1.4 var(--font-body);color:var(--fg);cursor:pointer;transition:background .1s;border:0;background:0;width:100%;text-align:left;text-decoration:none}
.overlay-item:hover{background:var(--muted)}
.overlay-item .o-ico{width:16px;height:16px;color:var(--muted-fg);flex-shrink:0}
.overlay-item.destructive{color:var(--destructive)}
.overlay-item.destructive:hover{background:var(--destructive-bg)}
.overlay-item.destructive .o-ico{color:var(--destructive)}
.theme-switcher{display:flex;align-items:center;gap:10px;padding:8px 16px}
.theme-switcher-label{font:400 13px/1.4 var(--font-body);color:var(--fg);margin-right:auto}
.settings-menu{width:244px;padding:6px 0}

/* ─── BODY ─── */
.body-scroll{flex:1;overflow:hidden;display:flex;min-width:0;background:var(--muted);padding:0 8px 8px}

/* ─── SUB SIDEBAR (side-nav panel, canonical) ─── */
.subnav-wrap{flex-shrink:0;width:288px;padding:16px 16px 24px 8px;overflow-y:auto}
.side-nav{width:100%;background:var(--bg);border:1px solid var(--border);border-radius:14px;overflow:hidden;font-family:var(--font-body);padding:8px 0}
.side-nav-item{display:flex;align-items:center;gap:12px;padding:13px 20px;cursor:pointer;transition:all .15s;font:500 13.5px var(--font-body);color:var(--fg);border:0;background:0;width:100%;text-align:left;position:relative;text-decoration:none}
.side-nav-item:hover{background:var(--muted)}
.side-nav-item.active{background:var(--primary);color:var(--primary-fg);margin:4px 8px;width:calc(100% - 16px);border-radius:10px;padding:13px 16px}
.side-nav-item .side-nav-icon{width:20px;height:20px;display:grid;place-items:center;flex-shrink:0;color:var(--muted-fg)}
.side-nav-item .side-nav-icon .ico{width:18px;height:18px}
.side-nav-item.active .side-nav-icon{color:var(--primary-fg)}
.side-nav-item .side-nav-count{margin-left:auto;font:500 11px var(--font-body);color:var(--muted-fg);flex-shrink:0}
.side-nav-item.active .side-nav-count{color:var(--primary-fg)}
.side-nav-label{padding:10px 20px 6px;font:600 10.5px var(--font-body);letter-spacing:.1em;text-transform:uppercase;color:var(--muted-fg)}
.subnav-note{padding:14px 16px 0;font-size:11px;line-height:1.75;color:var(--muted-fg)}
.subnav-note a{color:var(--link);text-decoration:none}
.subnav-note a:hover{text-decoration:underline}

/* ─── CONTENT ─── */
.content{flex:1;min-width:0;overflow-y:auto;display:flex;flex-direction:column}
.content-inner{padding:16px 32px 64px 8px}

/* ─── HERO ─── (Clipper card geometry: --radius-md, 1px --border, --bg) */
.hero{background:var(--bg);border:1px solid var(--border);border-radius:var(--radius-md);padding:26px 28px;margin-bottom:22px;display:flex;align-items:flex-start;justify-content:space-between;gap:28px;flex-wrap:wrap}
.hero-kicker{display:inline-flex;align-items:center;gap:8px;font:600 11px var(--font-body);letter-spacing:.08em;text-transform:uppercase;color:var(--muted-fg);margin-bottom:12px}
.hero-kicker .dot{width:6px;height:6px;border-radius:50%;background:var(--success);flex:none}
.hero h1{font-family:var(--font-body);font-size:30px;font-weight:600;letter-spacing:-.4px;color:var(--fg);line-height:1.15}
.hero p{font-size:13.5px;color:var(--muted-fg);margin-top:10px;max-width:600px;line-height:1.65}
.hero-stats{display:flex;gap:10px;flex-shrink:0;flex-wrap:wrap}
.stat{background:var(--muted);border:1px solid var(--border);border-radius:var(--radius-md);padding:14px 18px;min-width:94px}
.stat-val{font-family:var(--font-body);font-size:24px;font-weight:600;color:var(--fg);line-height:1}
.stat-lbl{font-size:11px;color:var(--muted-fg);margin-top:6px;letter-spacing:.02em}

/* ─── SECTIONS + TILES ─── */
.group{margin-bottom:30px;scroll-margin-top:12px}
.group[hidden]{display:none}
.group-head{display:flex;align-items:baseline;gap:10px;padding-bottom:10px;margin-bottom:14px;border-bottom:1px solid var(--border)}
.group-head h2{font-size:12px;font-weight:600;letter-spacing:.08em;text-transform:uppercase;color:var(--muted-fg)}
.group-head .n{font:500 11px var(--font-body);color:var(--muted-fg)}
.group-head .n-note{margin-left:auto;font-size:11.5px;color:var(--muted-fg)}
.grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(310px,1fr));gap:14px}

/* Tile = Clipper Kit Card atom (.mock-card): 1px --border, --radius-md, --bg,
   13px --font-body, 600 title, 12px --muted-fg body. Scaled to a full-width
   grid cell and made interactive. */
.tile{display:flex;flex-direction:column;gap:9px;background:var(--bg);border:1px solid var(--border);border-radius:var(--radius-md);padding:18px 20px 16px;text-decoration:none;color:inherit;font:13px var(--font-body);transition:border-color .15s,box-shadow .15s,transform .15s;position:relative;min-width:0}
.tile:hover{border-color:var(--border-strong);box-shadow:var(--shadow-md);transform:translateY(-2px)}
.tile:focus-visible{outline:2px solid var(--ring);outline-offset:2px}
.tile[hidden]{display:none}
.tile-top{display:flex;align-items:center;gap:11px}
.tile-ic{width:36px;height:36px;border-radius:var(--radius-md);flex:none;display:grid;place-items:center;background:var(--accent);color:var(--primary)}
.tile-ic .ico{width:18px;height:18px}
.tile h3{font-size:14.5px;font-weight:600;color:var(--fg);line-height:1.35;flex:1;min-width:0}
.tile p{font-size:12.5px;color:var(--muted-fg);line-height:1.6;flex:1}
.tile-foot{display:flex;align-items:center;gap:10px;margin-top:2px;padding-top:10px;border-top:1px solid var(--border)}
.path{font:400 11px var(--font-body);color:var(--muted-fg);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;flex:1}
.updated{font:400 10.5px var(--font-body);color:var(--muted-fg);flex:none}

/* Live-check dot — filled by /api/links at page load. Neutral until answered. */
.live{width:7px;height:7px;border-radius: var(--radius-base, 8px);flex:none;background:var(--border-strong);transition:background .2s}
.live.up{background:var(--success)}
.live.down{background:var(--destructive)}
.live.changed{background:var(--info);box-shadow:0 0 0 3px var(--info-bg)}
.tile-foot .updated.fresh{color:var(--info)}

/* Feature tiles */
.tile.feature{background:linear-gradient(135deg,var(--accent) 0%,var(--bg) 62%);border-color:var(--border-strong)}

/* ── A retired surface — .tile.is-deprecated ──────────────────────────────
   For something still reachable but no longer to be built on. It has to read
   as "stop" at a glance in a grid of otherwise identical tiles, so the state
   is carried three ways, not one: a destructive stroke, a soft destructive
   fill, and the title in the destructive tone. Colour alone would be invisible
   to a colour-blind reader, so the tile also says DEPRECATED in words.

   The fill is --destructive-bg with --destructive-soft-foreground on it, which
   is the soft-semantic triplet (§ 5) — never the solid --destructive as text,
   which fails 4.5:1 on its own tint.

   Declared after .tile.feature so it wins the cascade; a deprecated tile drops
   the feature gradient rather than layering on top of it. */
.tile.is-deprecated{
  background:var(--destructive-bg);
  color:var(--destructive-soft-foreground);
  border-color:var(--destructive)}
.tile.is-deprecated h3{color:var(--destructive-soft-foreground)}
.tile.is-deprecated p{color:var(--destructive-soft-foreground)}
.tile.is-deprecated .tile-ic{
  background:var(--destructive);color:var(--destructive-foreground)}
.tile.is-deprecated .tile-foot{border-top-color:var(--destructive-border)}
.tile.is-deprecated .path,.tile.is-deprecated .updated{color:var(--destructive-soft-foreground)}
/* Hover must stay destructive. Falling back to the neutral tile hover would
   read as "this one is fine after all" at exactly the moment of clicking. */
.tile.is-deprecated:hover{
  border-color:var(--destructive);
  box-shadow:var(--shadow-md);
  background:var(--destructive-bg)}
.tile.is-deprecated:focus-visible{outline-color:var(--destructive)}
.tile.is-deprecated .chip{
  background:transparent;color:var(--destructive-soft-foreground);
  border-color:var(--destructive-border)}

/* The two kit states, as tags. */
.tag-current{
  color:var(--success-soft-foreground);background:var(--success-bg);
  border-color:var(--success-border)}
.tag-deprecated{
  color:var(--destructive-soft-foreground);background:var(--destructive-bg);
  border-color:var(--destructive)}
.tile.feature .tile-ic{background:var(--primary);color:var(--primary-fg)}
.tile.feature h3{font-size:16px}

/* Chip = Clipper Kit Tag atom (.mock-tag) geometry — 4px radius, --border-strong
   on --bg, 500 11px. The kit's ::after "×" is omitted: these navigate, they are
   not removable tags. */
.tile-links{display:flex;flex-wrap:wrap;gap:6px;margin-top:2px}
.chip{display:inline-flex;align-items:center;gap:4px;font:500 11px var(--font-body);padding:3px 9px;border-radius:var(--radius-sm);background:var(--bg);border:1px solid var(--border-strong);color:var(--muted-fg);text-decoration:none;cursor:pointer;transition:all .12s}
.chip:hover{background:var(--muted);color:var(--fg)}

/* Tag = Clipper Kit Badge atom (.mock-badge.sm) — 999px pill, 500 11px, 1px
   border, semantic fills mixed from the source colour exactly as the kit does. */
.tag{display:inline-flex;align-items:center;gap:4px;flex:none;font:500 11px var(--font-body);padding:2px 8px;border-radius:var(--radius-full);border:1px solid}
.tag-new{color:var(--success);background:color-mix(in srgb,var(--success) 8%,transparent);border-color:color-mix(in srgb,var(--success) 20%,transparent)}
.tag-upd{color:var(--info);background:color-mix(in srgb,var(--info) 8%,transparent);border-color:color-mix(in srgb,var(--info) 20%,transparent)}
.tag-ref{background:var(--muted);color:var(--muted-fg);border-color:var(--border)}

/* Empty = Clipper Kit Empty State atom (.mock-empty) — 1.5px dashed. */
.empty{display:none;padding:18px;text-align:center;font:12px var(--font-body);color:var(--muted-fg);background:var(--bg);border:1.5px dashed var(--border-strong);border-radius:var(--radius-md)}
.empty.show{display:block}

.page-foot{margin-top:10px;padding-top:18px;border-top:1px solid var(--border);display:flex;flex-wrap:wrap;gap:8px 18px;justify-content:space-between;font:400 11px var(--font-body);color:var(--muted-fg)}
.page-foot a{color:var(--link);text-decoration:none}
.page-foot a:hover{text-decoration:underline}

/* ─── Generic content card (used by design-system + component-kit pages) ─── */
.panel{background:var(--bg);border:1px solid var(--border);border-radius:var(--radius-md);padding:22px 24px;margin-bottom:14px}
.panel-head{display:flex;align-items:baseline;gap:10px;margin-bottom:16px}
.panel-head h3{font-size:14px;font-weight:600;color:var(--fg)}
.panel-head .sub{font-size:11.5px;color:var(--muted-fg);margin-left:auto}

@media(max-width:1100px){.hero-stats{width:100%}}
@media(max-width:900px){.subnav-wrap{width:240px}.search-box{width:170px}.search-kbd{display:none}}
@media(max-width:760px){
  .subnav-wrap{display:none}
  .content-inner{padding:16px 16px 56px}
  .search-box{display:none}
  .grid{grid-template-columns:1fr}
  .hero h1{font-size:26px}
}






:root{ --ck-icon-ring: 8px; }

/* ══════════════════════════════════════════════════════════════════════
   ICON CONTROLS — shape and tone only                            (Atom)
   ══════════════════════════════════════════════════════════════════════
   Circular on hover and selection. Tone comes from --ck-icon-hover /
   --ck-icon-hover-fg, so one shape reads grey in neutral chrome, accent
   blue in navigation, red on a destructive action.

   This block sets NO width, height or aspect-ratio, deliberately. An
   earlier version forced a 32px frame with !important and broke every
   control that sizes itself — folder-panel affordances that collapse to
   zero width at rest, the labelled Move back row, pagers, segmented
   buttons. Shape is safe to impose across a codebase; size is not. Opt
   into a standard frame with .ck-icon-btn (.sm / .lg) where you want one.
   ══════════════════════════════════════════════════════════════════════ */
/* Icon hover frame is SECONDARY BLUE, not grey. --hover-bg is the same pale
   blue as --nav-item-bg-active, which .tone-accent already used; it is now the
   default for every icon control. The glyph keeps its rest colour through the
   hover, so only the frame changes. Destructive keeps its own already-defined
   treatment (--destructive-bg frame, red glyph) further down. */
:root{ --ck-icon-hover: var(--hover-bg, #e5f8fe); --ck-icon-hover-fg: var(--icon-color, var(--primary)); }

/* The opt-in primitive — the only place a size is declared. */
.ck-icon-btn{display:inline-grid;place-items:center;flex:none;width:32px;height:32px;padding:0;
  border:0;background:0;cursor:pointer;color:var(--icon-color,var(--primary));border-radius: var(--radius-base, 8px);
  transition:background var(--duration-base,.15s),color var(--duration-base,.15s)}
/* Every library glyph, wherever it is hydrated, takes the one icon token.
   Inverted surfaces override it: .on-dark, .preview-toolbar__btn and anything
   setting --toolbar-dark-foreground keep white, and a tone class still wins. */
.ck-ico{color:var(--icon-color,var(--primary))}
.ck-ico.is-destructive{color:var(--icon-color-destructive,var(--destructive))}
.ck-icon-btn svg{width:16px;height:16px;display:block}
.ck-icon-btn.sm{width:26px;height:26px}.ck-icon-btn.sm svg{width:14px;height:14px}
.ck-icon-btn.lg{width:38px;height:38px}.ck-icon-btn.lg svg{width:18px;height:18px}
.ck-icon-btn.tone-accent{--ck-icon-hover:var(--hover-bg);--ck-icon-hover-fg:var(--primary)}
.ck-icon-btn.tone-danger{--ck-icon-hover:var(--destructive-bg);--ck-icon-hover-fg:var(--destructive)}
.ck-icon-btn.tone-primary{--ck-icon-hover:var(--primary);--ck-icon-hover-fg:var(--primary-foreground)}
.ck-icon-btn.on-dark{--ck-icon-hover:rgba(255,255,255,.14);--ck-icon-hover-fg:#fff}

/* Shape, applied across the hub. Nothing else. */
.ck-icon-btn,
.icon-btn,
.icon-btn-ghost,
.ck-row-btn,
.ck-remove,
.ck-drawer-x,
.ck-dialog-x,
.act-btn,
.de-tbl-ic,
.dialog-close,
.toast-close,
.file-search-clear,
.accordion-chevron,
.pag-btn,
.panel-close-btn,
.pin-btn,
.theme-btn,
.nav-btn,
.ci-row-menu-btn,
.copy-inline,
.doc-card__icon,
.doc-card__action-btn,
.toolbar__btn,
.preview-toolbar__btn,
.topbar__info,
.topbar__icon-btn,
.search-clear,
.ck-search-clear,
.ab-btn,
.dropzone-file-remove,
.filter-drawer-close,
.filter-input-clear,
.filter-chip-x,
.td-expand,
.dfp-copy,
.dfp-tool-btn,
.dfp-multi-remove{ border-radius: var(--radius-base, 8px) !important; }

/* Tone, only where a control had no hover of its own. */
.ck-icon-btn:hover,
.icon-btn:hover,
.icon-btn-ghost:hover,
.ck-row-btn:hover,
.act-btn:hover,
.de-tbl-ic:hover,
.accordion-chevron:hover,
.pag-btn:hover,
.pin-btn:hover,
.theme-btn:hover,
.nav-btn:hover,
.ci-row-menu-btn:hover,
.copy-inline:hover,
.doc-card__icon:hover,
.doc-card__action-btn:hover,
.toolbar__btn:hover,
.preview-toolbar__btn:hover,
.topbar__info:hover,
.topbar__icon-btn:hover,
.ab-btn:hover,
.td-expand:hover,
.dfp-copy:hover,
.dfp-tool-btn:hover{ background:var(--ck-icon-hover); color:var(--ck-icon-hover-fg); }

/* Destructive affordances. The tone variables gave them a red hover only, so
   they sat grey at rest and turned red under the cursor — a delete now reads
   destructive before you touch it. `color` here is the rest state;
   --ck-icon-hover-fg keeps it red through the hover, and --ck-icon-hover
   supplies the light red frame. The frame carries no stroke: any border a
   control brought with it is cleared on hover, so the fill is the only
   signal. Set --ck-destructive-rest to inherit if a specific control must
   stay neutral until hover. */
.act-btn.danger, .de-tbl-ic.danger, .is-destructive, .ab-error{
  color: var(--ck-destructive-rest, var(--icon-color-destructive, var(--destructive)));
  --ck-icon-hover: var(--destructive-bg); --ck-icon-hover-fg: var(--destructive); }
.ck-remove,.dropzone-file-remove,.dfp-multi-remove,.filter-chip-x{--ck-icon-hover: var(--destructive-bg); --ck-icon-hover-fg: var(--destructive)}
.act-btn.danger:hover, .de-tbl-ic.danger:hover, .is-destructive:hover, .ab-error:hover{
  border-color: transparent; }
.nav-btn{
  --ck-icon-hover: var(--hover-bg); --ck-icon-hover-fg: var(--primary); }
.ck-icon-btn.is-selected, .nav-btn.active{
  background:var(--selected-bg); color:var(--selected-fg); }
.preview-toolbar__btn{ --ck-icon-hover: rgba(255,255,255,.14); --ck-icon-hover-fg:#fff; }





/* ─── MIDDLE TRUNCATION (Utility) ───────────────────────────────────────
   A filename's tail carries the meaning — the extension, a trailing index —
   so end-truncation throws away the useful half. .ck-mid-trunc marks an
   element for ckMiddleTruncate(), which measures and inserts the ellipsis in
   the middle. The element must not also be clipping with text-overflow, or
   the two fight. */
.ck-mid-trunc{
  display:block;min-width:0;max-width:100%;
  white-space:nowrap;overflow:hidden;text-overflow:clip;
}

