/* CDN admin page layout on Haze. Values come from haze/tokens.css; component styles from haze/haze.css.
   Layout follows haze-design-system/reference/cdn-dashboard.html (256px rail · main · drawer, 16px gap/inset).
   Classes prefixed cdn- are page layout; hzx- are proposed Haze extensions (see cdn-admin/HAZE-EXTENSIONS.md in the repo). */

html { background: var(--ground); }
/* Haze component classes set display; the hidden attribute must still win */
[hidden] { display: none !important; }
body { overflow: hidden; background: transparent; }
.cdn-backdrop { position: fixed; inset: 0; z-index: -1; }

/* ── Shell ── */
/* The main column runs the full viewport height so content scrolls to the screen edge; the floating
   sidebar and drawer keep their 16px inset with margins and sit above the edge blur. */
.cdn { display: grid; grid-template-columns: 256px minmax(0, 1fr); gap: var(--space-4); padding: 0 var(--space-4); height: 100vh; height: 100dvh; }
.cdn-side, .cdn > .cdn-panel { position: relative; z-index: 5; margin-block: var(--space-4); }
.cdn.is-collapsed { grid-template-columns: 72px minmax(0, 1fr); }
.cdn-main { display: flex; flex-direction: column; gap: var(--space-6); min-width: 0; min-height: 0; overflow-y: auto; padding: var(--space-6) var(--space-2) var(--space-8); scrollbar-gutter: stable; }
.cdn-skip { position: fixed; left: var(--space-4); top: -60px; z-index: 900; }
.cdn-skip:focus { top: var(--space-4); }

/* ── SideNav ── */
.cdn-side { min-height: 0; overflow: hidden; }
.cdn-side-scroll { display: flex; flex-direction: column; gap: var(--space-6); min-height: 0; overflow-y: auto; margin: 0 calc(var(--space-3) * -1); padding: 0 var(--space-3); }
.cdn-brand { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); }
.cdn-word { font-size: 24px; font-weight: 700; letter-spacing: -0.03em; white-space: nowrap; }
.cdn-word i { font-style: normal; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--lime); margin-left: 3px; box-shadow: 0 0 0 1.5px var(--ink); vertical-align: 2px; }
.cdn-foot { display: flex; flex-direction: column; gap: var(--space-4); }
.cdn-store { padding: var(--space-4); border-radius: var(--radius-md); background: var(--glass-strong); border: 1px solid var(--glass-edge); }
.cdn-user { display: flex; align-items: center; gap: var(--space-3); padding: 0 var(--space-2); }
.cdn-user > div { flex: 1; min-width: 0; }
.cdn-avatar { width: 36px; height: 36px; flex: none; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 14px; color: var(--ink); background: radial-gradient(circle at 30% 30%, var(--glow-peach), var(--glow-rose)); border: 1px solid var(--glass-edge); }
.cdn-user-name { font-size: 14px; font-weight: 600; line-height: 18px; }
.cdn-user-sub { font-size: 12px; color: var(--ink-muted); line-height: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hz-navitem .hz-icon { flex: none; }

/* Folder tree: Haze nav items with a disclosure button per level (extension: hzx-tree) */
.cdn-tree ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; margin-top: 2px; }
.cdn-tree-row { display: flex; align-items: center; gap: 2px; padding-left: calc(var(--depth, 0) * 14px); }
.cdn-tree-row .hz-navitem { flex: 1; min-width: 0; padding-left: var(--space-2); }
.cdn-tree-toggle { flex: none; width: 24px; height: 24px; display: grid; place-items: center; border: 0; padding: 0; border-radius: var(--radius-pill); background: transparent; color: var(--ink-muted); cursor: pointer; transition: transform .18s, background .18s; }
.cdn-tree-toggle:hover { background: var(--glass-strong); color: var(--ink); }
.cdn-tree-toggle[aria-expanded="true"] { transform: rotate(90deg); }
.cdn-tree-spacer { flex: none; width: 24px; }

/* Collapsed rail (72px) */
.cdn.is-collapsed .cdn-side { padding-left: var(--space-2); padding-right: var(--space-2); }
.cdn.is-collapsed .cdn-word,
.cdn.is-collapsed .hz-sidenav-title span,
.cdn.is-collapsed .hz-navitem-label,
.cdn.is-collapsed .hz-navitem-count,
.cdn.is-collapsed .cdn-store,
.cdn.is-collapsed .cdn-user > div,
.cdn.is-collapsed .cdn-avatar,
.cdn.is-collapsed .cdn-tree-toggle,
.cdn.is-collapsed .cdn-tree-spacer { display: none; }
.cdn.is-collapsed .cdn-brand,
.cdn.is-collapsed .hz-sidenav-title,
.cdn.is-collapsed .cdn-user { justify-content: center; padding: 0; }
.cdn.is-collapsed .hz-navitem { justify-content: center; padding: 0; width: 40px; margin: 0 auto; }
.cdn.is-collapsed .cdn-tree-row { padding-left: 0; }
.cdn.is-collapsed #sidebarToggle { transform: rotate(180deg); }

/* ── Top bar ── */
.cdn-bar { display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); }
.cdn-bar-left, .cdn-bar-right { display: flex; align-items: center; gap: var(--space-2); min-width: 0; }
.cdn-bar-left { flex: 1; }
.cdn-search { width: 360px; max-width: 100%; }
.cdn-search input[type=search] { -webkit-appearance: none; appearance: none; }
.cdn-menu-btn { display: none; }

/* ── Greeting + actions ── */
.cdn-hello-row { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--space-4); flex-wrap: wrap; }
.cdn-hello h1 { margin: 0; font-size: 32px; line-height: 38px; font-weight: 500; letter-spacing: -0.02em; }
.cdn-hello p { margin: 2px 0 0; font-size: 32px; line-height: 38px; font-weight: 300; letter-spacing: -0.02em; color: var(--ink-muted); }
.cdn-actions { display: flex; gap: var(--space-2); flex-wrap: wrap; }

/* ── Stat row ── */
.cdn-stats { display: grid; grid-template-columns: 1.35fr 1fr 1fr; gap: var(--space-4); }
.cdn-stats > * { min-height: 228px; }
.cdn-glow-foot { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); margin-top: var(--space-1); }
.cdn-stat-skeleton { border-radius: var(--radius-lg); background: var(--glass); border: 1px solid var(--glass-edge); }
.cdn-stats .hz-ticks { overflow: hidden; }

/* ── Files section ── */
.cdn-files { display: flex; flex-direction: column; gap: var(--space-4); min-width: 0; }
.cdn-files-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); flex-wrap: wrap; }
.cdn-files-title { display: flex; align-items: center; gap: var(--space-3); min-width: 0; }
.cdn-files-title h2 { margin: 0; font-size: 22px; line-height: 28px; font-weight: 500; letter-spacing: -0.01em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cdn-files-tools { display: flex; align-items: center; gap: var(--space-2); flex-wrap: wrap; }
.cdn-sort { min-height: 32px; border-radius: var(--radius-pill); background: var(--glass-strong); border-color: var(--glass-edge); box-shadow: var(--shadow-control); }
.cdn-sort .hz-input-el { height: 30px; padding-left: var(--space-4); font-size: 13px; font-weight: 600; }
.file-area { padding: 0; overflow: visible; outline: none; }

/* Breadcrumb (extension: hzx-breadcrumb) */
.cdn-crumbs { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); flex-wrap: wrap; }
.cdn-crumbs[hidden] { display: none; }
.cdn-crumb-trail { display: flex; align-items: center; gap: var(--space-1); flex-wrap: wrap; font-size: 13px; font-weight: 500; color: var(--ink-muted); min-width: 0; }
.cdn-crumb { border: 0; background: transparent; padding: 4px 8px; border-radius: var(--radius-pill); color: var(--ink-muted); font-size: 13px; font-weight: 500; cursor: pointer; }
.cdn-crumb:hover { background: var(--glass-strong); color: var(--ink); }
.cdn-crumb[aria-current="page"] { color: var(--ink); font-weight: 600; cursor: default; background: transparent; }
.cdn-crumbs .hz-toggle-label { font-size: 13px; color: var(--ink-muted); }

/* ── Dialog (extension: hzx-dialog) — native <dialog> on glass strong over the scrim ── */
.hzx-dialog { margin: auto; width: min(440px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); padding: var(--space-6); border: 1px solid var(--glass-edge); border-radius: var(--radius-lg); background: var(--glass-strong); color: var(--ink); box-shadow: var(--shadow-float); -webkit-backdrop-filter: blur(var(--blur-lg)) saturate(160%); backdrop-filter: blur(var(--blur-lg)) saturate(160%); }
.hzx-dialog::backdrop { background: var(--scrim); }
.hzx-dialog-title { margin: 0; font-size: 22px; line-height: 28px; font-weight: 500; letter-spacing: -0.01em; }
.hzx-dialog-msg { margin: var(--space-2) 0 0; font-size: 15px; line-height: 22px; color: var(--ink-muted); }
.hzx-dialog-msg:empty { display: none; }
.hzx-dialog-body { display: flex; flex-direction: column; gap: var(--space-4); margin-top: var(--space-5); }
.hzx-dialog-body:empty { display: none; }
.hzx-dialog-actions { display: flex; justify-content: flex-end; gap: var(--space-2); margin-top: var(--space-6); flex-wrap: wrap; }
.hzx-dialog .asset-check { display: flex; align-items: center; gap: var(--space-2); font-size: 14px; }

/* Scrim behind the off-canvas navigation on small screens */
.cdn-scrim { display: none; position: fixed; inset: 0; z-index: 60; background: var(--scrim); }
.cdn-scrim.visible { display: block; }

/* ── Responsive (first pass; the full responsive design is a later phase) ── */
@media (max-width: 1100px) {
  .cdn-stats { grid-template-columns: 1fr 1fr; }
  .cdn-stats > :first-child { grid-column: 1 / -1; }
  .cdn-stats > * { min-height: 0; }
}
@media (max-width: 960px) {
  .cdn, .cdn.is-collapsed { grid-template-columns: minmax(0, 1fr); padding: 0; }
  .cdn-side { margin: 0; position: fixed; z-index: 70; left: var(--space-3); top: var(--space-3); bottom: var(--space-3); width: min(288px, calc(100vw - 48px)); height: auto; background: var(--glass-strong); transform: translateX(calc(-100% - 24px)); transition: transform .25s cubic-bezier(.2,.7,.2,1); visibility: hidden; }
  .cdn-side.open { transform: none; visibility: visible; }
  .cdn #sidebarToggle { display: none; }
  .cdn-menu-btn { display: inline-grid; }
  .cdn-search { flex: 1; width: auto; min-width: 0; }
  .cdn-main { padding: var(--space-4) 4px var(--space-8); scrollbar-gutter: auto; overflow-x: hidden; }
  .cdn, .cdn.is-collapsed { padding-left: var(--space-2); padding-right: var(--space-2); }
  /* The collapsed rail does not apply to the off-canvas drawer */
  .cdn.is-collapsed .cdn-side { padding: var(--space-5) var(--space-3); }
  .cdn.is-collapsed .cdn-word, .cdn.is-collapsed .hz-sidenav-title span, .cdn.is-collapsed .hz-navitem-label, .cdn.is-collapsed .hz-navitem-count,
  .cdn.is-collapsed .cdn-store, .cdn.is-collapsed .cdn-user > div, .cdn.is-collapsed .cdn-avatar, .cdn.is-collapsed .cdn-tree-toggle, .cdn.is-collapsed .cdn-tree-spacer { display: revert; }
  .cdn.is-collapsed .hz-navitem { justify-content: flex-start; padding: 0 var(--space-3); width: 100%; }
  .cdn.is-collapsed .cdn-brand, .cdn.is-collapsed .cdn-user { justify-content: space-between; padding: 0 var(--space-2); }
}
@media (max-width: 640px) {
  .cdn-hello h1, .cdn-hello p { font-size: 26px; line-height: 32px; }
  .cdn-stats { grid-template-columns: 1fr; }
  .cdn-stats .hz-glowcard-value.is-xl { font-size: 72px; }
  .cdn-search input { font-size: 16px; } /* no iOS zoom on focus */
  .cdn-search .hz-kbd { display: none; }
  .cdn-actions { width: 100%; }
  .cdn-actions .hz-btn { flex: 1; }
}
/* Touch screens: every control gets at least a 44px hit area; visuals are unchanged. */
@media (pointer: coarse) {
  /* :where() keeps this at zero specificity so fixed/absolute controls (skip link, lightbox buttons) keep their position */
  :where(.hz-btn, .hz-ibtn, .hz-seg-item, .hz-pill, .hz-toggle, .hz-navitem, .cdn-crumb, .hzx-menu-item, .cdn-tree-toggle) { position: relative; }
  .hz-btn::after, .hz-ibtn::after, .hz-seg-item::after, .hz-pill::after, .hz-toggle::after, .hz-navitem::after,
  .cdn-crumb::after, .hzx-menu-item::after, .cdn-tree-toggle::after { content: ""; position: absolute; inset: min(0px, calc((100% - 44px) / 2)); }
  .hz-input, .hz-search { min-height: 44px; }
  .hz-input-el { height: 42px; }
  .hzx-checkrow { min-height: 44px; }
  .hz-slider input[type=range] { height: 44px; }
}
@media (prefers-reduced-motion: reduce) {
  .cdn-side, .cdn-tree-toggle { transition: none !important; }
}

/* ── Collection: Haze FileTile grid / FileRow list ── */
.hzx-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: var(--space-4); }
.hzx-grid[hidden], .hzx-list[hidden], .hzx-filestate[hidden] { display: none; }
.hzx-card { position: relative; min-width: 0; }
.hzx-card .hz-tile { width: 100%; height: 100%; color: inherit; }
/* Haze uses block elements in the tile; spans keep the button's content valid */
.hz-tile .hz-thumb, .hz-tile-meta, .hz-tile-name { display: block; }
.hz-thumb img { position: absolute; inset: 0; }
.hzx-thumb-chips { position: absolute; top: 16px; left: 16px; right: 52px; display: flex; flex-wrap: wrap; gap: 4px; pointer-events: none; }
.hzx-thumb-play { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--glass-strong); color: var(--ink); border: 1px solid var(--glass-edge); }
.hzx-tile-note { display: block; margin-top: 4px; font-size: 11px; font-weight: 600; color: var(--ink-muted); }
.hz-tile-sub > span:first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hz-tile-sub > span:last-child { flex: none; white-space: nowrap; }
.hz-tile.is-selected { box-shadow: 0 0 0 2px var(--ink), var(--shadow-float); }

/* Selection checkbox (extension hzx-check): Haze's lime check when on; outlined glass circle when off */
.hzx-check { position: absolute; top: 16px; right: 16px; width: 26px; height: 26px; padding: 0; border-radius: 50%; display: grid; place-items: center; cursor: pointer;
  background: var(--glass-strong); border: 1.5px solid var(--line-control); color: transparent; opacity: 0; transition: opacity .18s, background .18s; -webkit-backdrop-filter: blur(var(--blur-sm)); backdrop-filter: blur(var(--blur-sm)); }
.hzx-card:hover .hzx-check, .hzx-check:focus-visible, .hzx-card:focus-within .hzx-check, .has-selection .hzx-check, .hzx-check[aria-checked="true"] { opacity: 1; }
.hzx-check[aria-checked="true"] { background: var(--lime); border-color: var(--ink); color: var(--on-lime); }
.hzx-card.is-checked .hz-tile { background: var(--glass-strong); }
@media (pointer: coarse) { .hzx-check { opacity: 1; } .hzx-check::after { content: ""; position: absolute; inset: -9px; } }

/* List rows: select · FileRow · actions */
.hzx-list { display: grid; gap: 2px; padding: var(--space-2); }
.hzx-rowwrap { position: relative; display: grid; grid-template-columns: 32px minmax(0, 1fr) auto; align-items: center; gap: var(--space-2); min-width: 0; }
.hzx-rowwrap .hzx-check { position: static; opacity: 1; justify-self: center; }
.hzx-rowwrap .hz-row { color: inherit; grid-template-columns: 40px minmax(0, 2.4fr) minmax(0, 1fr) 80px 80px 110px; }
.hzx-rowwrap.is-checked .hz-row { background: var(--glass-strong); }
.hz-row-name { display: flex; align-items: center; gap: 6px; min-width: 0; }
.hzx-row-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; flex: 0 1 auto; }
.hz-row-name .hz-chip { flex: none; }
.hzx-row-actions { display: flex; gap: 4px; padding-right: var(--space-2); }
.hzx-danger-icon { color: var(--danger); }
.hzx-danger-icon:hover { background: var(--danger-soft); }
.hz-ibtn:disabled { opacity: .45; cursor: not-allowed; }

/* Loading, empty and error states (static: nothing pulses) */
.hzx-skel { display: flex; flex-direction: column; gap: var(--space-3); padding: var(--space-2) var(--space-2) var(--space-4); border-radius: var(--radius-lg); background: var(--glass); border: 1px solid var(--glass-edge); }
.hzx-skel-thumb { aspect-ratio: 4 / 3; border-radius: var(--radius-md); background: var(--ground-sunken); }
.hzx-skel-line { height: 10px; margin: 0 var(--space-2); border-radius: var(--radius-pill); background: var(--ground-sunken); }
.hzx-skel-line.is-short { width: 50%; }
.hzx-state { display: flex; align-items: center; gap: var(--space-4); padding: var(--space-5); }
.hzx-state > div { flex: 1; min-width: 0; }
.hzx-state-title { font-size: 15px; font-weight: 600; }
.hzx-state-hint { font-size: 13px; color: var(--ink-muted); }
.hzx-state .hz-stat-icon { color: var(--danger); border-color: var(--danger); }

/* Bulk action bar (extension hzx-bulk) */
.hzx-bulk { position: fixed; z-index: 100; left: 0; right: 0; margin: 0 auto; width: max-content; bottom: var(--space-6); display: flex; align-items: center; flex-wrap: wrap; gap: var(--space-3); max-width: calc(100vw - 32px); padding: var(--space-2) var(--space-2) var(--space-2) var(--space-5); border-radius: var(--radius-lg); }
.hzx-bulk[hidden] { display: none; }
.hzx-bulk-count { font-size: 13px; font-weight: 600; white-space: nowrap; }
.hzx-bulk-actions { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.hzx-bulk-note { flex-basis: 100%; margin: 0; padding: 0 var(--space-2) var(--space-1) 0; font-size: 12px; color: var(--ink-muted); }
.cdn-main { padding-bottom: 120px; }

/* Menu (extension hzx-menu) */
.hzx-menu { position: fixed; z-index: 200; min-width: 220px; max-width: 320px; padding: var(--space-2); border-radius: var(--radius-md); }
.hzx-menu[hidden] { display: none; }
.hzx-menu-item { display: flex; align-items: center; gap: var(--space-3); width: 100%; min-height: 36px; padding: 0 var(--space-3); border: 0; border-radius: var(--radius-pill); background: transparent; color: var(--ink); font-size: 13px; font-weight: 500; text-align: left; cursor: pointer; }
.hzx-menu-item span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hzx-menu-item:hover, .hzx-menu-item:focus-visible { background: var(--surface-hover); }
.hzx-menu-item:disabled { opacity: .45; cursor: not-allowed; background: transparent; }
.hzx-menu-item.is-danger { color: var(--danger); }
.hzx-menu-item.is-danger:hover { background: var(--danger-soft); }
.hzx-menu-label { padding: 6px var(--space-3) 2px; font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hzx-menu-sep { height: 1px; margin: 4px var(--space-2); background: var(--line); }

@media (max-width: 960px) {
  .hzx-rowwrap .hz-row { grid-template-columns: 40px minmax(0, 1fr) 80px; }
  .hzx-rowwrap .hz-row > :nth-child(3), .hzx-rowwrap .hz-row > :nth-child(5), .hzx-rowwrap .hz-row > :nth-child(6) { display: none; }
}
@media (max-width: 640px) {
  .hzx-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-3); }
  .hzx-thumb-chips { top: 12px; left: 12px; right: 44px; }
  .hzx-check { top: 12px; right: 12px; }
  .hzx-rowwrap .hz-row { grid-template-columns: 40px minmax(0, 1fr); }
  .hzx-rowwrap .hz-row > :nth-child(4) { display: none; }
  .hzx-bulk { left: var(--space-3); right: var(--space-3); bottom: var(--space-3); width: auto; max-width: none; }
  .hzx-bulk-count { flex: 1; min-width: 0; white-space: normal; }
  #bulkCancel { order: 1; }
  .hzx-bulk-actions { order: 2; flex-basis: 100%; }
  .hzx-bulk-note { order: 3; }
}
@media (prefers-reduced-motion: reduce) { .hzx-check { transition: none; } }

/* ── Details drawer (reference: cdn-dashboard.html .cdn-panel) ── */
.cdn.has-panel { grid-template-columns: 256px minmax(0, 1fr) 360px; }
.cdn.is-collapsed.has-panel { grid-template-columns: 72px minmax(0, 1fr) 360px; }
.cdn-panel { display: flex; flex-direction: column; gap: var(--space-4); padding: var(--space-5); overflow-y: auto; min-height: 0; overscroll-behavior: contain; }
.cdn-panel[hidden] { display: none; }
.cdn-panel-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); }
.cdn-panel-head h2 { margin: 0; outline: none; }
.cdn-hero { position: relative; display: flex; flex-direction: column; gap: var(--space-2); }
.cdn-hero-media { display: block; width: 100%; aspect-ratio: 2 / 1; border-radius: var(--radius-lg); border: 0; padding: 0; cursor: zoom-in; }
.cdn-hero-media img { object-fit: contain; }
.cdn-hero-media.is-video { aspect-ratio: 16 / 9; cursor: default; background: #000; }
.cdn-hero-media video { position: absolute; inset: 0; width: 100%; height: 100%; }
div.cdn-hero-media { cursor: default; }
.cdn-hero-media .hz-thumb-art .hz-icon { width: 28px; height: 28px; }
.cdn-hero-chips { position: absolute; top: 12px; left: 12px; right: 12px; display: flex; flex-wrap: wrap; gap: 6px; pointer-events: none; }
.cdn-hero-frame { position: relative; }
.cdn-hero-frame > .hz-thumb-ext { position: absolute; left: 12px; bottom: 12px; }
.cdn-hero > .hz-btn { align-self: flex-start; }
.cdn-name-row { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--space-2); }
.cdn-fname { margin: 0; font-size: 17px; line-height: 24px; font-weight: 600; word-break: break-all; }
.cdn-fpath { font-size: 12px; color: var(--ink-muted); margin-top: 2px; display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.cdn-rename { width: 100%; height: 36px; border: 1px solid var(--line-control); border-radius: var(--radius-sm); background: var(--surface); font-size: 15px; font-weight: 600; }
.cdn-meta { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-3); }
.cdn-meta-cell { padding: 10px var(--space-4); border-radius: var(--radius-md); background: var(--surface); border: 1px solid var(--line); min-width: 0; }
.cdn-meta-k { font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-muted); }
.cdn-meta-v { font-size: 20px; font-weight: 400; letter-spacing: -0.02em; line-height: 26px; display: flex; align-items: baseline; justify-content: space-between; gap: 6px; min-width: 0; }
.cdn-meta-v span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cdn-meta-v small { font-size: 12px; color: var(--ink-muted); font-weight: 500; letter-spacing: 0; flex: none; }
#detailCopy { display: flex; flex-direction: column; gap: var(--space-2); }
#detailCopy > .hz-btn { align-self: flex-start; }
.cdn-sec { display: flex; flex-direction: column; gap: var(--space-3); }
.cdn-sec[hidden] { display: none; }
.cdn-sec-title { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); }
.cdn-sec-title h3 { margin: 0; font-size: 15px; line-height: 20px; font-weight: 600; }
.cdn-sep { height: 1px; background: var(--line); margin: 0 calc(var(--space-5) * -1) var(--space-1); }
.cdn-row2 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-3); }
.cdn-row2[hidden] { display: none; }
.cdn-row3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: var(--space-3); align-items: end; }
.cdn-folder-row { display: flex; flex-direction: column; gap: var(--space-2); }
.cdn-folder-row .hz-btn[hidden] { display: none; }
.cdn-toggle-cell { min-height: 40px; display: flex; align-items: center; }
.cdn-toggle-cell .hz-toggle-row { width: 100%; }
.cdn-signed-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: var(--space-2); }
.cdn-actions-row { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.cdn-actions-row:empty { display: none; }
.cdn-panel-foot { display: flex; gap: var(--space-2); margin-top: auto; padding-top: var(--space-2); }
.cdn-panel-foot .hz-btn-danger { margin-left: auto; }
.cdn-panel-foot .hz-btn[hidden] { display: none; }
.hzx-note { display: flex; align-items: flex-start; gap: var(--space-2); font-size: 12px; line-height: 18px; color: var(--ink-muted); }
.hzx-note.is-warn { color: var(--warning); }
#assetNote { display: block; }
.hz-input-el.is-mono { font-family: var(--font-mono); font-size: 12px; }

/* Revision list (extension hzx-rev): one row per revision; the row opens it, copy is a sibling */
.hzx-revs { display: flex; flex-direction: column; gap: 2px; }
.hzx-rev { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: var(--space-2); padding-right: var(--space-2); border-radius: var(--radius-md); border: 1px solid transparent; }
.hzx-rev:hover { background: var(--surface-hover); }
.hzx-rev.is-viewing { background: var(--surface); border-color: var(--ink); }
.hzx-rev-open { display: flex; align-items: center; gap: var(--space-3); min-width: 0; padding: 6px; border: 0; background: transparent; color: inherit; text-align: left; cursor: pointer; border-radius: var(--radius-md); }
.hzx-rev-open .hz-row-thumb { width: 44px; height: 44px; flex: none; border-radius: var(--radius-xs); }
.hzx-rev-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.hzx-rev-top { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; font-size: 13px; }
.hzx-rev-sub { font-size: 12px; color: var(--ink-muted); }

/* Below 1280px the drawer is a sheet over the scrim */
.cdn-panel-scrim { z-index: 79; }
@media (max-width: 1279px) {
  .cdn.has-panel, .cdn.is-collapsed.has-panel { grid-template-columns: 256px minmax(0, 1fr); }
  .cdn.is-collapsed.has-panel { grid-template-columns: 72px minmax(0, 1fr); }
  .cdn-panel, .cdn > .cdn-panel { position: fixed; z-index: 80; margin: 0; top: var(--space-4); right: var(--space-4); bottom: var(--space-4); width: min(400px, calc(100vw - 32px)); height: auto; }
}
@media (max-width: 960px) {
  .cdn.has-panel, .cdn.is-collapsed.has-panel { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
  .cdn-panel { top: var(--space-2); right: var(--space-2); bottom: var(--space-2); left: var(--space-2); width: auto; }
  .cdn-row3 { grid-template-columns: 1fr 1fr; }
  .cdn-row3 > :last-child { grid-column: 1 / -1; }
}
.cdn-grow { flex: 1 1 auto; }

/* ── Upload sheet ── */
.hzx-uplist { display: flex; flex-direction: column; gap: var(--space-2); }
.hzx-uplist:empty { display: none; }
.hzx-up { display: flex; flex-direction: column; gap: var(--space-2); padding: var(--space-3); border-radius: var(--radius-md); background: var(--surface); border: 1px solid var(--line); }
.hzx-up-top { display: flex; align-items: center; gap: var(--space-2); min-width: 0; }
.hzx-up-name { flex: 1; min-width: 0; font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hzx-up-size { font-size: 12px; color: var(--ink-muted); font-variant-numeric: tabular-nums; flex: none; }
.hzx-up-alias { min-height: 34px; }
.hzx-up-alias .hz-input-suffix { padding: 0 0 0 var(--space-3); }
.hzx-up-alias .hz-input-el { height: 32px; }
.hzx-up .hz-meter-track { height: 6px; }
.hzx-up .hz-meter-fill { transition: width .15s; }
.hzx-up .hz-meter-fill.done { background: var(--positive); }
.hzx-up .hz-meter-fill.error { background: var(--danger); }
.hzx-up-foot { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); }
.hzx-up-status { font-size: 12px; color: var(--ink-muted); font-variant-numeric: tabular-nums; min-width: 0; }
.hzx-up-status .speed { margin-left: 4px; }
.hzx-up-msg { display: inline-flex; align-items: flex-start; gap: 6px; font-weight: 600; }
.hzx-up-msg .hz-icon { margin-top: 2px; }
.hzx-up-msg.is-ok { color: var(--positive); }
.hzx-up-msg.is-err { color: var(--danger); }
.hzx-up-summary { font-size: 12px; color: var(--ink-muted); align-self: center; }
#uploadPanel .cdn-panel-foot .hz-btn { margin-left: auto; }
#uploadDropzone { cursor: pointer; flex-direction: column; text-align: center; gap: var(--space-3); }
#mainDrop { margin-top: var(--space-2); }

/* Checkbox (extension hzx-checkbox): a native checkbox drawn on Haze tokens */
.hzx-checkrow { display: flex; align-items: center; gap: var(--space-3); min-height: 32px; font-size: 14px; font-weight: 500; cursor: pointer; }
.hzx-checkbox { position: relative; flex: none; width: 20px; height: 20px; }
.hzx-checkbox input { -webkit-appearance: none; appearance: none; position: absolute; inset: 0; margin: 0; border-radius: 6px; border: 1.5px solid var(--line-control); background: var(--surface); cursor: pointer; transition: background .15s, border-color .15s; }
.hzx-checkbox input:checked { background: var(--ink-inverse); border-color: var(--ink-inverse); }
.hzx-checkbox svg { position: absolute; inset: 2px; width: 16px; height: 16px; fill: none; stroke: var(--on-inverse); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; pointer-events: none; opacity: 0; }
.hzx-checkbox input:checked + svg { opacity: 1; }
.hzx-checkbox input:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
@media (pointer: coarse) { .hzx-checkbox::after { content: ""; position: absolute; inset: -12px; } }
.hzx-dialog .asset-check { cursor: pointer; }
.hzx-dialog .asset-check input { width: 18px; height: 18px; accent-color: var(--ink); }

/* Whole-page drop target */
.hzx-dragover { position: fixed; inset: 0; z-index: 600; display: none; place-items: center; padding: var(--space-6); background: var(--scrim); }
.hzx-dragover.visible { display: grid; }
.hzx-dragover-zone { width: min(560px, 100%); padding: var(--space-8); background: var(--glass-strong); box-shadow: var(--shadow-float); }
.hzx-dragover-zone .hz-drop-orb { width: 64px; height: 64px; }

/* Toasts (extension hzx-toast) */
.hzx-toasts { position: fixed; z-index: 700; left: 0; right: 0; top: var(--space-4); display: flex; flex-direction: column; align-items: center; gap: var(--space-2); pointer-events: none; }
.hzx-toast { display: flex; align-items: center; gap: var(--space-2); max-width: min(420px, calc(100vw - 32px)); padding: 10px var(--space-4) 10px var(--space-3); border-radius: var(--radius-pill); font-size: 13px; font-weight: 500; pointer-events: auto; animation: hzx-toast-in .25s cubic-bezier(.2,.7,.2,1); }
.hzx-toast.is-info { padding-left: var(--space-4); }
.hzx-toast.is-error { color: var(--danger); }
.hzx-toast.is-error > span { color: var(--ink); }
.hzx-toast-ok { display: grid; place-items: center; width: 22px; height: 22px; flex: none; border-radius: 50%; background: var(--lime); color: var(--on-lime); }
@keyframes hzx-toast-in { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }

/* Lightbox */
.hzx-lightbox { position: fixed; inset: 0; z-index: 500; display: none; align-items: center; justify-content: center; padding: 72px; background: var(--scrim); -webkit-backdrop-filter: blur(var(--blur-sm)); backdrop-filter: blur(var(--blur-sm)); }
.hzx-lightbox.visible { display: flex; }
.hzx-lightbox img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: var(--radius-md); box-shadow: var(--shadow-float); }
.hzx-lb-close { position: absolute; top: var(--space-4); right: var(--space-4); }
.hzx-lb-prev, .hzx-lb-next { position: absolute; top: 50%; transform: translateY(-50%); }
.hzx-lb-prev { left: var(--space-4); }
.hzx-lb-next { right: var(--space-4); }
.hzx-lb-info { position: absolute; left: 50%; bottom: var(--space-4); transform: translateX(-50%); max-width: calc(100% - 32px); padding: 8px var(--space-4); border-radius: var(--radius-pill); font-size: 13px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* File viewer */
.hzx-viewer { position: fixed; inset: 0; z-index: 510; display: none; padding: var(--space-4); background: var(--scrim); }
.hzx-viewer.visible { display: flex; }
.hzx-viewer-box { display: flex; flex-direction: column; width: 100%; min-height: 0; overflow: hidden; }
.hzx-viewer-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); padding: var(--space-3) var(--space-3) var(--space-3) var(--space-5); border-bottom: 1px solid var(--line); }
.hzx-viewer-title { margin: 0; min-width: 0; font-size: 15px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hzx-viewer-actions { display: flex; align-items: center; gap: var(--space-2); flex: none; }
.fv-content { flex: 1; min-height: 0; overflow: auto; display: flex; align-items: stretch; justify-content: center; background: var(--surface); }
.fv-content iframe { width: 100%; height: 100%; border: none; }
.fv-content video { max-width: 100%; max-height: 100%; margin: auto; background: #000; }
.fv-content img { max-width: 100%; max-height: 100%; object-fit: contain; margin: auto; }
.fv-html-frame { background: #fff; }
.fv-loading { display: flex; align-items: center; justify-content: center; flex: 1; gap: var(--space-2); color: var(--ink-muted); font-size: 14px; }
.fv-loading svg { width: 16px; height: 16px; }
.fv-code { width: 100%; overflow: auto; margin: 0; padding: var(--space-3) 0; font-family: var(--font-mono); font-size: 12px; line-height: 1.7; counter-reset: line; background: var(--surface); color: var(--ink); }
.fv-code .line { display: block; position: relative; min-height: 1.7em; padding: 0 var(--space-5) 0 64px; white-space: pre; }
.fv-code .line:hover { background: var(--surface-hover); }
.fv-code .line::before { content: counter(line); counter-increment: line; position: absolute; left: 0; width: 48px; padding-right: 12px; text-align: right; color: var(--ink-muted); border-right: 1px solid var(--line); user-select: none; }
.fv-table-wrap { width: 100%; overflow: auto; padding: var(--space-4); }
.fv-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.fv-table th { position: sticky; top: 0; padding: 10px 14px; text-align: left; background: var(--surface); color: var(--ink-muted); font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; border-bottom: 1px solid var(--line-control); }
.fv-table td { max-width: 300px; padding: 8px 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; border-bottom: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.fv-table tr:hover td { background: var(--surface-hover); }
.fv-markdown { width: 100%; max-width: 760px; margin: 0 auto; padding: var(--space-8) var(--space-6); font-size: 15px; line-height: 1.7; color: var(--ink); }
.fv-markdown h1 { font-size: 32px; line-height: 38px; font-weight: 500; letter-spacing: -0.02em; margin: var(--space-6) 0 var(--space-3); }
.fv-markdown h2 { font-size: 22px; line-height: 28px; font-weight: 500; margin: var(--space-6) 0 var(--space-2); }
.fv-markdown h3 { font-size: 17px; font-weight: 600; margin: var(--space-5) 0 var(--space-2); }
.fv-markdown h4 { font-size: 15px; font-weight: 600; margin: var(--space-4) 0 var(--space-1); }
.fv-markdown p { margin: 0 0 var(--space-3); }
.fv-markdown a { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.fv-markdown code { padding: 2px 6px; border-radius: var(--radius-xs); background: var(--ground-sunken); font-family: var(--font-mono); font-size: 12px; }
.fv-markdown pre { margin: 0 0 var(--space-4); padding: var(--space-4); overflow-x: auto; border-radius: var(--radius-sm); background: var(--ground-sunken); border: 1px solid var(--line); }
.fv-markdown pre code { padding: 0; background: none; }
.fv-markdown blockquote { margin: 0 0 var(--space-3); padding: 4px var(--space-4); border-left: 3px solid var(--line-control); color: var(--ink-muted); }
.fv-markdown ul, .fv-markdown ol { margin: 0 0 var(--space-3); padding-left: var(--space-6); }
.fv-markdown li { margin: 4px 0; }
.fv-markdown img { max-width: 100%; border-radius: var(--radius-md); }
.fv-markdown hr { border: none; border-top: 1px solid var(--line); margin: var(--space-6) 0; }

@media (max-width: 640px) {
  .hzx-toasts { left: var(--space-3); right: var(--space-3); top: var(--space-3); align-items: stretch; }
  .hzx-lightbox { padding: 64px var(--space-2) 72px; }
  .hzx-lb-prev, .hzx-lb-next { top: auto; bottom: var(--space-3); transform: none; }
  .hzx-lb-info { bottom: 76px; }
  .hzx-viewer { padding: var(--space-2); }
  .hzx-viewer-actions .hz-btn span { display: none; }
  .hzx-viewer-actions .hz-btn { width: 32px; padding: 0; }
}
@media (prefers-reduced-motion: reduce) { .hzx-toast { animation: none; } .hzx-up .hz-meter-fill { transition: none; } }

/* Chips over thumbnails sit on photos: glass lets the photo through and drops small text below
   4.5:1 (measured 3.4–4.1:1), so these chips use the opaque surface instead. */
.hzx-thumb-chips .hz-chip-glass, .hzx-thumb-chips .hz-chip-positive, .hzx-thumb-chips .hz-chip-warning,
.cdn-hero-chips .hz-chip-glass, .cdn-hero-chips .hz-chip-positive, .cdn-hero-chips .hz-chip-warning,
.hz-thumb-ext { background: var(--surface); -webkit-backdrop-filter: none; backdrop-filter: none; }
.hzx-thumb-chips .hz-chip-glass, .cdn-hero-chips .hz-chip-glass { color: var(--ink-muted); }

/* Touch screens (last, so it wins over component sizes defined above) */
@media (pointer: coarse) {
  .hzx-checkrow { min-height: 44px; }
  .cdn-sort { min-height: 44px; }
  .cdn-sort .hz-input-el { height: 42px; }
}

/* Reduced motion: nothing animates (Haze acceptance checklist), including page-level transitions */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
  .hz-ibtn-ink:hover, .hz-tile:hover, .hz-interactive:hover { transform: none; }
}

/* Narrow rows: status chips wrap under the name instead of overflowing */
.hz-row-name { flex-wrap: wrap; row-gap: 2px; }
@media (max-width: 640px) { .cdn-main { padding-bottom: 240px; } }

/* ── Pages: Overview / Files ── */
#pageNav { min-width: 0; }
.cdn-bar { flex-wrap: wrap; }
.cdn-bar-right { flex: 0 1 auto; }
.cdn-hello h1 { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cdn-status-link { display: inline-flex; align-items: center; gap: 10px; padding: 0; border: 0; background: none; font: inherit; color: inherit; letter-spacing: inherit; cursor: pointer; text-align: left; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 6px; text-decoration-color: var(--line-control); border-radius: var(--radius-xs); }
.cdn-status-link:hover { color: var(--ink); text-decoration-color: currentColor; }
.cdn-status-link .hz-icon { transition: transform .25s cubic-bezier(.2,.7,.2,1); }
.cdn-status-link:hover .hz-icon { transform: translateX(3px); }
#viewAllBtn .hz-icon { order: 2; }
@media (max-width: 640px) {
  .cdn-bar-left { flex: 1 1 auto; }
  .cdn-bar-right { order: 3; flex: 1 1 100%; }
  .cdn-bar-right .cdn-search { flex: 1; }
  .cdn-status-link .hz-icon { width: 18px; height: 18px; }
}

/* ── Scroll edges: content fades out under the top and bottom of a scroller (extension hzx-scrollfade),
   and the main column adds a progressive blur on top (hzx-edge). Both appear only while there is
   content past that edge, scaled by how far it is. ── */
.hzx-scrollfade { --ft: 0px; --fb: 0px;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 var(--ft), #000 calc(100% - var(--fb)), transparent 100%);
          mask-image: linear-gradient(to bottom, transparent 0, #000 var(--ft), #000 calc(100% - var(--fb)), transparent 100%); }
.cdn-mainwrap { position: relative; display: flex; min-width: 0; min-height: 0; }
.cdn-mainwrap > .cdn-main { flex: 1 1 auto; }
/* Edge blur spans the whole viewport width at the screen edges, under the floating panels */
.hzx-edge { position: fixed; left: 0; right: 0; z-index: 3; pointer-events: none; opacity: var(--o, 0); }
.hzx-edge.is-top { top: 0; height: 72px; }
.hzx-edge.is-bottom { bottom: 0; height: 88px; }
.hzx-edge span { position: absolute; inset: 0; }
.hzx-edge span:nth-child(1) { -webkit-backdrop-filter: blur(1px); backdrop-filter: blur(1px); }
.hzx-edge span:nth-child(2) { -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
.hzx-edge span:nth-child(3) { -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.hzx-edge span:nth-child(4) { -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); }
.hzx-edge.is-top span:nth-child(1) { -webkit-mask-image: linear-gradient(to bottom, #000 0%, #000 60%, transparent 100%); mask-image: linear-gradient(to bottom, #000 0%, #000 60%, transparent 100%); }
.hzx-edge.is-top span:nth-child(2) { -webkit-mask-image: linear-gradient(to bottom, #000 0%, #000 40%, transparent 75%); mask-image: linear-gradient(to bottom, #000 0%, #000 40%, transparent 75%); }
.hzx-edge.is-top span:nth-child(3) { -webkit-mask-image: linear-gradient(to bottom, #000 0%, #000 20%, transparent 50%); mask-image: linear-gradient(to bottom, #000 0%, #000 20%, transparent 50%); }
.hzx-edge.is-top span:nth-child(4) { -webkit-mask-image: linear-gradient(to bottom, #000 0%, transparent 30%); mask-image: linear-gradient(to bottom, #000 0%, transparent 30%); }
.hzx-edge.is-bottom span:nth-child(1) { -webkit-mask-image: linear-gradient(to top, #000 0%, #000 60%, transparent 100%); mask-image: linear-gradient(to top, #000 0%, #000 60%, transparent 100%); }
.hzx-edge.is-bottom span:nth-child(2) { -webkit-mask-image: linear-gradient(to top, #000 0%, #000 40%, transparent 75%); mask-image: linear-gradient(to top, #000 0%, #000 40%, transparent 75%); }
.hzx-edge.is-bottom span:nth-child(3) { -webkit-mask-image: linear-gradient(to top, #000 0%, #000 20%, transparent 50%); mask-image: linear-gradient(to top, #000 0%, #000 20%, transparent 50%); }
.hzx-edge.is-bottom span:nth-child(4) { -webkit-mask-image: linear-gradient(to top, #000 0%, transparent 30%); mask-image: linear-gradient(to top, #000 0%, transparent 30%); }
@media (prefers-reduced-transparency: reduce) { .hzx-edge { display: none; } }

/* ── Environment indicator (non-production only) ── */
.cdn-env[hidden] { display: none; }
.cdn-env .hz-chip { height: 26px; font-size: 12px; }
.cdn-brand { flex-wrap: wrap; row-gap: var(--space-2); }
.cdn.is-collapsed .cdn-brand .cdn-env { display: none; }
/* Phones: the bar chip keeps its icon (label for screen readers and the tooltip) so the section pills stay on one row */
@media (max-width: 640px) {
  #envChipBar .hz-chip { padding: 0 8px; }
  #envChipBar .hz-chip span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  #pageNav .hz-pills { flex-wrap: nowrap; }
}

/* Counts explained, small but readable */
.cdn-glow-note { font-size: 12px; line-height: 16px; color: var(--ink); opacity: .8; max-width: 44ch; margin-top: var(--space-2); }

/* Card metadata: Haze body-sm (13/500) instead of 12px */
.hz-tile-sub { font-size: 13px; line-height: 18px; font-weight: 500; }

/* Upload destination + project form grouping */
.cdn-dest { display: flex; flex-direction: column; align-items: flex-start; gap: var(--space-2); padding: var(--space-3) var(--space-4); border-radius: var(--radius-md); background: var(--surface); }
.cdn-dest-path { display: flex; align-items: center; gap: var(--space-2); font-size: 14px; line-height: 20px; overflow-wrap: anywhere; }
.cdn-dest-path strong { font-weight: 600; }
.cdn-dest-path.is-empty { color: var(--ink-muted); }
.cdn-dest-hint:empty { display: none; }
.cdn-dest-hint { margin-top: var(--space-2); }
.cdn-more { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); width: 100%; padding: var(--space-2) 0; border: 0; border-top: 1px solid var(--line); background: none; color: var(--ink); font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; border-radius: 0; }
.cdn-more .hz-icon, .cdn-more i { transition: transform 220ms cubic-bezier(.2,.7,.2,1); }
.cdn-more[aria-expanded="true"] .hz-icon { transform: rotate(180deg); }
.cdn-ready { color: var(--ink); font-weight: 500; }
.cdn-ready:empty { display: none; }
#approveSeg .hz-seg, #reviseSeg .hz-seg { width: 100%; }
#approveSeg .hz-seg-item, #reviseSeg .hz-seg-item { flex: 1; }
/* One environment chip at a time: the sidebar's when it's showing, the top bar's otherwise */
@media (min-width: 961px) { .cdn:not(.is-collapsed) #envChipBar { display: none; } }
.cdn-panel-foot .hzx-up-summary { white-space: nowrap; }
.cdn-panel-foot #uploadStartBtn { min-width: 0; }
.cdn-panel-foot #uploadStartBtn span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* CLI & AI agents page */
.cdn-sr { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.cdn-guide { display: flex; flex-direction: column; gap: var(--space-4); max-width: 880px; }
.cdn-guide[hidden] { display: none; }
.cdn-guide-card { padding: var(--space-6); display: flex; flex-direction: column; gap: var(--space-4); min-width: 0; scroll-margin-top: var(--space-6); }
.cdn-guide-card h2 { margin: 0; font-size: 22px; line-height: 28px; font-weight: 500; letter-spacing: -0.01em; }
.cdn-guide-card h2:focus { outline: none; }
.cdn-guide-body { display: flex; flex-direction: column; gap: var(--space-3); min-width: 0; }
.cdn-guide-body h3 { margin: var(--space-3) 0 0; font-size: 16px; line-height: 22px; font-weight: 600; }
.cdn-guide-card p, .cdn-guide-card li { margin: 0; font-size: 15px; line-height: 23px; max-width: 70ch; }
.cdn-guide-card ul, .cdn-guide-card ol { margin: 0; padding-left: 1.3em; display: flex; flex-direction: column; gap: var(--space-2); }
.cdn-guide-card :not(pre) > code { padding: 1px 6px; border-radius: 6px; background: var(--ground-sunken); font-family: var(--font-mono); font-size: 0.86em; overflow-wrap: anywhere; }
.cdn-guide-card a { color: inherit; text-underline-offset: 3px; }
.cdn-guide-muted { color: var(--ink-muted); }
.cdn-code { position: relative; display: flex; align-items: flex-start; gap: var(--space-2); padding: var(--space-3) var(--space-3) var(--space-3) var(--space-4); border-radius: var(--radius-md); background: var(--surface); min-width: 0; }
.cdn-code pre { flex: 1; min-width: 0; margin: 0; overflow-x: auto; font-family: var(--font-mono); font-size: 13px; line-height: 21px; padding: 2px 0; }
.cdn-code pre:focus-visible { outline: 2px solid var(--focus); outline-offset: 4px; border-radius: 4px; }
.cdn-code .hz-ibtn { flex: none; }
.cdn-guide-intro { gap: var(--space-3); }
.cdn-guide-target { display: flex; flex-direction: column; gap: var(--space-2); }
.cdn-guide-target.is-unverified { flex-direction: row; align-items: flex-start; gap: var(--space-2); font-size: 14px; line-height: 20px; }
.cdn-guide-target.is-unverified .hz-icon { flex: none; margin-top: 2px; }
.cdn-guide-endpoint { display: flex; align-items: center; gap: var(--space-2); flex-wrap: wrap; }
.cdn-guide-endpoint code { font-family: var(--font-mono); font-size: 14px; overflow-wrap: anywhere; }
.cdn-guide-toc { display: flex; flex-wrap: wrap; gap: var(--space-1); margin-left: calc(-1 * var(--space-2)); }
.cdn-guide-switches { display: flex; flex-wrap: wrap; gap: var(--space-3); }
.cdn-trouble { border-top: 1px solid var(--line); }
.cdn-trouble:first-of-type { border-top: 0; }
.cdn-trouble > summary { display: flex; align-items: center; gap: var(--space-2); padding: var(--space-3) 0; cursor: pointer; list-style: none; font-size: 15px; font-weight: 600; }
.cdn-trouble > summary::-webkit-details-marker { display: none; }
.cdn-trouble > summary .hz-icon { flex: none; transition: transform 220ms cubic-bezier(.2,.7,.2,1); }
.cdn-trouble[open] > summary .hz-icon { transform: rotate(90deg); }
.cdn-trouble > summary:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
.cdn-trouble > :not(summary) { margin-bottom: var(--space-3); margin-left: calc(14px + var(--space-2)); }
.cdn-dl { list-style: none; padding: 0 !important; gap: 0 !important; }
.cdn-dl-row { display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); padding: var(--space-3) 0; border-top: 1px solid var(--line); max-width: none !important; }
.cdn-dl-row:first-child { border-top: 0; }
.cdn-dl-text { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.cdn-dl-title { font-weight: 600; }
.cdn-dl-file, .cdn-dl-desc { font-size: 13px; line-height: 19px; color: var(--ink-muted); font-weight: 400; }
.cdn-dl-hash { font-family: var(--font-mono); font-size: 11px; color: var(--ink-muted); background: none !important; padding: 0 !important; }
@media (max-width: 640px) {
  .cdn-guide-card { padding: var(--space-5) var(--space-4); }
  .cdn-dl-row { flex-direction: column; align-items: flex-start; gap: var(--space-2); }
  .cdn-code pre { font-size: 12px; }
}

/* Incomplete records: a warning category, apart from valid assets */
.cdn-nav-warn .hz-navitem:not(.is-active) .hz-icon { color: var(--warning); }
.cdn-nav-warn .hz-navitem:not(.is-active) .hz-navitem-count { color: var(--warning); font-weight: 600; }
.cdn-warn-link { display: inline-flex; align-items: center; gap: var(--space-2); margin-top: var(--space-2); padding: 0; border: 0; background: none; color: var(--ink); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; text-align: left; }
.cdn-warn-link > .hz-icon:first-child { color: var(--warning); flex: none; }
.cdn-warn-link span { text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 3px; }
.cdn-warn-link:hover span { text-decoration-color: currentColor; }
.cdn-warn-link:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; border-radius: 4px; }
.cdn-codewrap { display: flex; flex-direction: column; gap: var(--space-1); min-width: 0; }
.cdn-code-tag { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; line-height: 16px; font-weight: 600; color: var(--ink-muted); }
.cdn-code-tag span { font-family: var(--font-mono); font-weight: 500; overflow-wrap: anywhere; }
.cdn-guide-h { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); flex-wrap: wrap; }
.cdn-guide-card.is-owner { border: 1px dashed var(--line-control, var(--line)); }
.cdn-dl-group { margin: var(--space-2) 0 0; font-size: 12px; line-height: 16px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-muted); }
.cdn-guide-toc .hz-btn { min-height: 32px; }
.hzx-check-spacer { width: 26px; height: 26px; justify-self: center; }
