/* KOS Classify (/pointcloud) — full-width, dense workbench UI.
   Light-glass cards + purple accent. Every element id/class the page JS hooks
   into is preserved; this file only owns layout + styling. */
:root {
  --kc-purple: #7c3aed; --kc-purple-dark: #6d28d9; --kc-purple-soft: rgba(124, 58, 237, .10);
  --kc-teal: #0d9488; --kc-teal-soft: rgba(13, 148, 136, .10);
  --kc-ink: #1c1c28; --kc-ink-2: #4a4a5a; --kc-muted: #8a8a9a;
  --kc-line: #e9e9f1; --kc-line-2: #f0f0f6; --kc-field: #f7f7fb; --kc-card: #fff;
  --kc-bg: #f4f4f9;
  --kc-danger: #e5484d; --kc-green: #16a34a; --kc-amber: #d97706;
  --kc-radius: 14px;
  --kc-shadow: 0 1px 2px rgba(16, 16, 40, .04), 0 6px 18px rgba(16, 16, 40, .05);
  --kc-shadow-lg: 0 2px 6px rgba(16, 16, 40, .06), 0 16px 40px rgba(16, 16, 40, .09);
}

/* Dark theme — the dashboard toggles data-theme on <html> (default 'dark'), so
   the page follows the app theme instead of always rendering light-on-dark. */
:root[data-theme="dark"] {
  --kc-purple: #8b6df0; --kc-purple-dark: #7c3aed; --kc-purple-soft: rgba(124, 58, 237, .18);
  --kc-teal: #2dd4bf; --kc-teal-soft: rgba(45, 212, 191, .12);
  --kc-ink: #e8e8ed; --kc-ink-2: #b6bccb; --kc-muted: #8791a6;
  --kc-line: rgba(255, 255, 255, .09); --kc-line-2: rgba(255, 255, 255, .05);
  --kc-field: rgba(255, 255, 255, .045); --kc-card: #141a2b;
  --kc-bg: transparent;
  --kc-danger: #f4645a; --kc-green: #34d399; --kc-amber: #fbbf24;
  --kc-shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 6px 18px rgba(0, 0, 0, .35);
  --kc-shadow-lg: 0 2px 6px rgba(0, 0, 0, .4), 0 16px 40px rgba(0, 0, 0, .5);
}

/* ── Full-page ground ──────────────────────────────────────────────────────
   This page loads material-dashboard.css (light `bg-gray-100`) + this file only
   — NOT dashboard-theme.css — so the dark body ground was never painted and the
   empty area below the cards showed WHITE (with the footer stranded on it).
   Paint it here, mirroring the KOS Docs (documents.css) navy→purple gradient so
   the whole page reads as one continuous dark surface. Light theme keeps a soft
   light gradient. Only this page loads this file, so these rules are page-local. */
body.g-sidenav-show {
  background:
    linear-gradient(122deg, #eaf5f8 0%, #eef1f9 40%, #f3ecfa 72%, #faeef8 100%) fixed !important;
  min-height: 100vh;
}
:root[data-theme="dark"] body.g-sidenav-show,
[data-theme="dark"] body.bg-gray-100 {
  background:
    radial-gradient(1100px 560px at 84% -10%, rgba(124, 58, 237, .18), transparent 60%),
    linear-gradient(122deg, #0c303e 0%, #14243f 40%, #331653 72%, #55195d 100%) fixed !important;
}
/* Let the ground show through the dashboard content wrappers. */
.main-content, .container-fluid { background: transparent !important; }

/* Fill the whole content area — the app sidebar already bounds the left. */
.kc-wrap {
  width: 100%; max-width: 1760px; margin: 0 auto;
  font-family: 'DM Sans', 'Plus Jakarta Sans', system-ui, sans-serif; color: var(--kc-ink);
}
.kc-wrap * { box-sizing: border-box; }

/* ── Header hero banner + stat strip ──
   A gradient hero (mirrors the KOS Docs "My Documents" banner) so the page opens
   with the same identity as the rest of the workspace. Saturated ground → white
   text works in both light and dark themes. */
.kc-head {
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  flex-wrap: wrap; margin-bottom: 22px;
  position: relative; overflow: hidden;
  padding: 26px 30px; border-radius: 18px;
  background: linear-gradient(115deg, #3a1d78 0%, #5b21b6 42%, #4c1d95 66%, #133b57 100%);
  border: 1px solid rgba(255, 255, 255, .10);
  box-shadow: var(--kc-shadow-lg);
}
.kc-head::after {           /* soft cyan glow, top-right — same accent as the docs hero */
  content: ''; position: absolute; top: -45%; right: -4%; width: 360px; height: 360px;
  background: radial-gradient(circle, rgba(6, 182, 212, .34), transparent 62%);
  pointer-events: none;
}
.kc-head > div, .kc-head .kc-stats { position: relative; z-index: 1; }
.kc-head h1 { display: flex; align-items: center; gap: 10px; font-size: 1.6rem; font-weight: 800; margin: 0 0 6px; letter-spacing: -.01em; color: #fff; }
.kc-head h1 .material-symbols-rounded { color: #c4b5fd; font-size: 30px; }
.kc-head p { color: rgba(255, 255, 255, .82); margin: 0; font-size: .88rem; max-width: 820px; line-height: 1.55; }
.kc-stats { display: flex; gap: 10px; flex-wrap: wrap; }
.kc-stat {
  background: rgba(255, 255, 255, .10); border: 1px solid rgba(255, 255, 255, .18);
  border-radius: 12px; padding: 10px 16px; min-width: 96px;
  backdrop-filter: blur(6px); box-shadow: none; text-align: center;
}
.kc-stat .n { font-size: 1.3rem; font-weight: 800; line-height: 1; display: block; color: #fff; }
.kc-stat .l { font-size: .68rem; color: rgba(255, 255, 255, .72); text-transform: uppercase; letter-spacing: .05em; margin-top: 5px; display: block; }
.kc-stat.accent .n { color: #d6bbff; }

/* ── Tabs (segmented) ── */
.kc-tabs {
  display: inline-flex; gap: 2px; background: var(--kc-field); border: 1px solid var(--kc-line);
  border-radius: 12px; padding: 4px; margin-bottom: 22px; flex-wrap: wrap;
}
.kc-tab {
  display: inline-flex; align-items: center; gap: 7px; border: none; background: transparent;
  color: var(--kc-ink-2); font-family: inherit; font-size: .86rem; font-weight: 600;
  padding: 9px 16px; border-radius: 9px; cursor: pointer; transition: background .15s, color .15s;
}
.kc-tab .material-symbols-rounded { font-size: 19px; }
.kc-tab:hover { color: var(--kc-ink); }
.kc-tab.is-active { background: var(--kc-card); color: var(--kc-purple); box-shadow: var(--kc-shadow); }
.kc-badge { font-size: .66rem; font-weight: 800; background: var(--kc-purple-soft); color: var(--kc-purple); padding: 1px 7px; border-radius: 999px; }

/* ── Panels + layout grids ── */
.kc-panel { display: none; animation: kcfade .25s ease; }
.kc-panel.is-active { display: block; }
@keyframes kcfade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.kc-grid-2 { display: grid; grid-template-columns: 1.35fr .85fr; gap: 18px; align-items: start; }
.kc-grid-even { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; }
@media (max-width: 1100px) { .kc-grid-2, .kc-grid-even { grid-template-columns: 1fr; } }

/* ── Cards ── */
.kc-card { background: var(--kc-card); border: 1px solid var(--kc-line); border-radius: var(--kc-radius); padding: 22px; box-shadow: var(--kc-shadow); margin-bottom: 18px; }
.kc-card:hover { box-shadow: var(--kc-shadow-lg); }
/* Force the readable ink colour: material-dashboard's default dark `h3` colour
   otherwise wins on this dark page (the page doesn't load dashboard-theme.css),
   leaving these card titles nearly invisible. */
.kc-card-title { display: flex; align-items: center; gap: 8px; font-size: 1rem; font-weight: 700; margin: 0 0 6px; color: var(--kc-ink) !important; }
.kc-card-title .material-symbols-rounded { color: var(--kc-purple); font-size: 21px; }
.kc-card-sub { color: var(--kc-muted); font-size: .82rem; margin: 0 0 16px; line-height: 1.55; }
.kc-card-sub code { background: var(--kc-field); border: 1px solid var(--kc-line); border-radius: 5px; padding: 1px 5px; font-size: .78rem; color: var(--kc-purple); }
.kc-section-title { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--kc-muted); font-weight: 700; margin: 24px 0 12px; }

/* ── Dropzone ── */
.kc-dropzone {
  display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center;
  border: 2px dashed var(--kc-line); border-radius: 14px; background: var(--kc-field); color: var(--kc-muted);
  padding: 34px 24px; cursor: pointer; transition: border-color .2s, background .2s; gap: 6px;
}
.kc-dropzone:hover, .kc-dropzone.dragover { border-color: var(--kc-purple); background: var(--kc-purple-soft); }
.kc-dropzone i { font-size: 2rem; color: var(--kc-purple); margin-bottom: 6px; }
.kc-dropzone strong { color: var(--kc-ink); }
.kc-formats { font-size: .74rem; }
.kc-filename { font-size: .82rem; color: var(--kc-ink-2); margin: 10px 0; font-weight: 600; }
.kc-filename:empty { display: none; }

/* ── Fields / rows / inputs ── */
.kc-row { display: flex; gap: 12px; align-items: flex-end; }
.kc-row-wrap { flex-wrap: wrap; }
.kc-field { display: flex; flex-direction: column; gap: 6px; flex: 1; min-width: 140px; }
.kc-field > span { font-size: .74rem; font-weight: 600; color: var(--kc-ink-2); }
.kc-field select, .kc-field input, .kc-input, .kc-ds-actions select, .kc-ds-actions input {
  background: var(--kc-field); border: 1px solid var(--kc-line); color: var(--kc-ink);
  border-radius: 9px; padding: 10px 12px; font-size: .85rem; font-family: inherit; outline: none; width: 100%;
  transition: border-color .15s, box-shadow .15s;
}
.kc-field select:focus, .kc-field input:focus, .kc-input:focus { border-color: var(--kc-purple); box-shadow: 0 0 0 3px var(--kc-purple-soft); }
/* The open dropdown popup is drawn by the OS/browser: without explicit option
   colours the <option>s inherit the light select text and render nearly invisible
   on the browser's white popup. Give them a self-consistent, readable palette. */
.kc-wrap select option { background-color: #ffffff; color: #1c1c28; }
:root[data-theme="dark"] .kc-wrap select option { background-color: #1a2133; color: #e8e8ed; }

/* ── Buttons ── */
.kc-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; white-space: nowrap;
  border: 1px solid var(--kc-line); background: var(--kc-card); color: var(--kc-ink);
  border-radius: 10px; padding: 10px 18px; font-size: .85rem; font-weight: 600; font-family: inherit;
  cursor: pointer; transition: background .15s, border-color .15s, transform .12s, box-shadow .15s;
}
.kc-btn .material-symbols-rounded { font-size: 18px; }
.kc-btn:disabled { opacity: .5; cursor: not-allowed; }
.kc-btn-sm { padding: 7px 12px; font-size: .78rem; border-radius: 8px; }
.kc-btn-primary { background: var(--kc-purple); border-color: transparent; color: #fff; }
.kc-btn-primary:hover:not(:disabled) { background: var(--kc-purple-dark); transform: translateY(-1px); box-shadow: 0 8px 20px rgba(124, 58, 237, .28); }
.kc-btn-ghost:hover:not(:disabled) { border-color: var(--kc-purple); color: var(--kc-purple); }

/* ── Progress + log ── */
.kc-progress-wrap { display: none; margin-top: 18px; }
.kc-progress-wrap.active { display: block; }
.kc-progress-bar { height: 8px; background: var(--kc-line-2); border-radius: 999px; overflow: hidden; }
.kc-progress-fill { height: 100%; width: 0; background: linear-gradient(90deg, var(--kc-purple), #a855f7); transition: width .3s; }
.kc-progress-meta { display: flex; justify-content: space-between; font-size: .76rem; color: var(--kc-muted); margin-top: 7px; text-transform: capitalize; }
/* ── Engine console (terminal-style command window) ── */
.kc-console { margin-top: 14px; border: 1px solid var(--kc-line); border-radius: 12px; overflow: hidden; background: #0b0e1a; box-shadow: var(--kc-shadow); }
.kc-console-head { display: flex; align-items: center; gap: 7px; padding: 8px 12px; background: #12162a; border-bottom: 1px solid rgba(255, 255, 255, .06); }
.kc-console-head .kc-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.kc-dot.r { background: #ff5f57; } .kc-dot.y { background: #febc2e; } .kc-dot.g { background: #28c840; }
.kc-console-title { margin-left: 6px; font-size: .72rem; color: #8a93b0; font-family: ui-monospace, monospace; letter-spacing: .02em; }
.kc-log { background: #0b0e1a; color: #b9c0e0; padding: 12px 14px; min-height: 92px; max-height: 200px; overflow-y: auto; font-family: ui-monospace, 'SFMono-Regular', Consolas, monospace; font-size: .72rem; line-height: 1.6; }
.kc-log div { padding: 1px 0; white-space: pre-wrap; word-break: break-word; }
.kc-log div.err { color: #ff8a84; }
.kc-log div.ok { color: #6ee7a8; }
/* blinking cursor on the last line while a job is live */
.kc-log::after { content: '▋'; color: var(--kc-purple); animation: kc-blink 1.1s steps(1) infinite; }
@keyframes kc-blink { 50% { opacity: 0; } }

/* ── Failure panel (so an error is visible + diagnosable) ── */
.kc-error { margin-top: 16px; padding: 14px 16px; border: 1px solid rgba(229, 72, 77, .42); background: rgba(229, 72, 77, .08); border-radius: 12px; }
.kc-error[hidden] { display: none; }
.kc-error-head { display: flex; align-items: center; gap: 8px; font-weight: 700; color: var(--kc-danger); }
.kc-error-head .material-symbols-rounded { font-size: 20px; }
.kc-error-msg { margin-top: 7px; font-size: .8rem; color: var(--kc-ink); white-space: pre-wrap; word-break: break-word; font-family: ui-monospace, monospace; }
.kc-error-hint { margin-top: 8px; font-size: .74rem; color: var(--kc-muted); }

/* ── Result ── */
/* Compact result — stats on the left, a status/actions sidebar on the right. */
.kc-result { display: none; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--kc-line); }
.kc-result.active { display: grid; grid-template-columns: 1fr 190px; gap: 16px; align-items: start; }
@media (max-width: 760px) { .kc-result.active { grid-template-columns: 1fr; } }
.kc-result-main { min-width: 0; }
.kc-result-side {
  display: flex; flex-direction: column; gap: 9px; padding: 14px;
  background: var(--kc-field); border: 1px solid var(--kc-line); border-radius: 12px; position: sticky; top: 12px;
}
.kc-result-badge { display: inline-flex; align-items: center; gap: 7px; font-weight: 800; color: var(--kc-green); font-size: .95rem; }
.kc-result-badge .material-symbols-rounded { font-size: 21px; }
.kc-result-side .kc-btn { justify-content: center; width: 100%; }
.kc-result-meta { font-size: .8rem; color: var(--kc-ink-2); margin: 2px 0 4px; }
.kc-sub { font-size: .7rem; text-transform: uppercase; letter-spacing: .05em; color: var(--kc-muted); font-weight: 700; margin: 0 0 8px; }
.kc-result-main .kc-macro { margin-top: 14px; }
.kc-result-main > .kc-sub:nth-of-type(2) { margin-top: 14px; }
/* Compact stat chips (JS emits `pc-class-chip`; keep both selectors so it styles). */
.kc-class-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(124px, 1fr)); gap: 8px; }
.kc-class-chip, .pc-class-chip { background: var(--kc-field); border: 1px solid var(--kc-line); border-radius: 8px; padding: 8px 10px; }
.kc-class-chip .n, .pc-class-chip .n { font-size: .95rem; font-weight: 800; display: block; line-height: 1.15; color: var(--kc-ink); }
.kc-class-chip .l, .pc-class-chip .l { color: var(--kc-muted); font-size: .68rem; text-transform: capitalize; display: block; margin-top: 2px; }
.kc-result-actions { display: flex; gap: 10px; margin-top: 18px; flex-wrap: wrap; }

/* ── Jobs (grid) ── */
.kc-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); gap: 12px; }
#kcTrainRuns, #kcDsList { grid-template-columns: 1fr; }
.kc-job { display: flex; align-items: center; gap: 14px; background: var(--kc-card); border: 1px solid var(--kc-line); border-radius: 12px; padding: 14px 16px; box-shadow: var(--kc-shadow); }
.kc-job:hover { box-shadow: var(--kc-shadow-lg); }
.kc-job-icon { width: 40px; height: 40px; border-radius: 10px; background: var(--kc-purple-soft); color: var(--kc-purple); display: grid; place-items: center; flex-shrink: 0; }
.kc-job-main { flex: 1; min-width: 0; }
.kc-job-name { font-weight: 700; font-size: .9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kc-job-meta { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; font-size: .74rem; color: var(--kc-muted); margin-top: 4px; }
.kc-job-meta .material-symbols-rounded { font-size: 14px; vertical-align: -2px; }
.kc-job-actions { display: flex; gap: 6px; align-items: center; flex-shrink: 0; }
.kc-job-prog { font-size: .8rem; font-weight: 700; color: var(--kc-purple); }
.kc-status { font-size: .68rem; font-weight: 800; text-transform: uppercase; letter-spacing: .03em; padding: 2px 8px; border-radius: 999px; }
.kc-status-completed { background: rgba(22, 163, 74, .12); color: var(--kc-green); }
.kc-status-running { background: var(--kc-purple-soft); color: var(--kc-purple); }
.kc-status-queued { background: rgba(217, 119, 6, .12); color: var(--kc-amber); }
.kc-status-failed { background: rgba(229, 72, 77, .12); color: var(--kc-danger); }

/* ── Empty states ── */
.kc-empty { text-align: center; padding: 60px 20px; color: var(--kc-muted); grid-column: 1 / -1; }
.kc-empty .material-symbols-rounded { font-size: 48px; opacity: .4; }
.kc-empty h3 { margin: 12px 0 4px; color: var(--kc-ink); }
.kc-empty p { font-size: .85rem; }
.kc-empty-sm { color: var(--kc-muted); font-size: .82rem; padding: 14px; text-align: center; }

/* ── Models (grid) ── */
.kc-models { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }
.kc-model { background: var(--kc-card); border: 1px solid var(--kc-line); border-radius: 14px; padding: 18px; box-shadow: var(--kc-shadow); transition: box-shadow .15s, border-color .15s; }
.kc-model:hover { box-shadow: var(--kc-shadow-lg); }
.kc-model.is-active { border-color: var(--kc-purple); box-shadow: 0 0 0 1px var(--kc-purple), var(--kc-shadow); }
.kc-model-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.kc-model-head .material-symbols-rounded { color: var(--kc-purple); }
.kc-model-head strong { font-size: .92rem; }
.kc-tag { font-size: .64rem; font-weight: 800; text-transform: uppercase; letter-spacing: .03em; background: var(--kc-purple); color: #fff; padding: 2px 8px; border-radius: 999px; }
.kc-tag-engine { background: var(--kc-field); color: var(--kc-ink-2); border: 1px solid var(--kc-line); margin-left: auto; }
.kc-tag-engine.is-kos { background: var(--kc-teal-soft); color: var(--kc-teal); border-color: transparent; }
.kc-model-meta { font-size: .78rem; color: var(--kc-ink-2); line-height: 1.7; }
.kc-model-meta strong { color: var(--kc-ink); }
.kc-model-actions { display: flex; gap: 6px; margin-top: 14px; flex-wrap: wrap; align-items: center; }

/* ── Datasets + tokens rows ── */
.kc-ds-row, .kc-gw-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 12px 14px; border: 1px solid var(--kc-line); border-radius: 11px; background: var(--kc-field); margin-bottom: 8px; }
.kc-ds-info { display: flex; flex-direction: column; min-width: 150px; }
.kc-ds-info strong { font-size: .88rem; color: var(--kc-ink); }
.kc-ds-info span { font-size: .74rem; color: var(--kc-muted); }
.kc-ds-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; flex-wrap: wrap; }
.kc-ds-actions select, .kc-ds-actions input { width: auto; padding: 7px 9px; font-size: .78rem; }
.kc-ds-actions .kc-ds-epochs { width: 68px; }
.kc-gw-row .pfx { font-family: ui-monospace, monospace; font-size: .78rem; color: var(--kc-purple); }

/* ── Callout (info panel) ── */
.kc-callout { background: linear-gradient(160deg, var(--kc-purple-soft), transparent); border: 1px solid var(--kc-line); border-radius: var(--kc-radius); padding: 20px; }
.kc-callout h4 { display: flex; align-items: center; gap: 8px; font-size: .92rem; margin: 0 0 10px; color: var(--kc-ink) !important; }
.kc-callout h4 .material-symbols-rounded { color: var(--kc-purple); font-size: 20px; }
.kc-callout ul { margin: 0; padding-left: 18px; font-size: .82rem; color: var(--kc-ink-2); line-height: 1.8; }
.kc-callout ul strong { color: var(--kc-ink); }

@media (max-width: 640px) {
  .kc-row { flex-direction: column; align-items: stretch; }
  .kc-row .kc-btn { width: 100%; }
}

/* ── Batch upload (many files → many queued jobs) ── */
.pc-batch-head { font-weight: 600; margin: 4px 0 12px; color: var(--kc-text, #e8e8ed); }
.pc-batch-list { display: flex; flex-direction: column; gap: 8px; }
.pc-batch-row { display: grid; grid-template-columns: 1fr 140px 70px 52px; align-items: center; gap: 10px;
  padding: 8px 10px; border: 1px solid var(--kc-border, #2a3550); border-radius: 8px; font-size: 0.82rem; }
.pc-batch-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pc-batch-bar { height: 7px; background: rgba(255,255,255,.08); border-radius: 999px; overflow: hidden; }
.pc-batch-fill { height: 100%; width: 0; background: linear-gradient(90deg, #4ab4c2, #7c8cf7); transition: width .3s; }
.pc-batch-status { font-size: 0.74rem; color: var(--kc-text-dim, #9aa); text-transform: capitalize; }
.pc-batch-row.ok .pc-batch-status { color: #34d399; }
.pc-batch-row.failed { border-color: #e35d5d; }
.pc-batch-row.failed .pc-batch-status { color: #fca5a5; }
.pc-batch-open { font-size: 0.76rem; color: #7c8cf7; text-decoration: none; text-align: right; }
.pc-batch-open:hover { text-decoration: underline; }

/* ── Jobs: preview-card grid + detail modal (dark-aware via --kc vars) ── */
.kc-jgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; }
.kc-jcard { background: var(--kc-card); border: 1px solid var(--kc-line); border-radius: var(--kc-radius);
  overflow: hidden; box-shadow: var(--kc-shadow); display: flex; flex-direction: column; transition: box-shadow .15s, transform .15s, border-color .15s; }
.kc-jcard.clickable { cursor: pointer; }
.kc-jcard.clickable:hover { box-shadow: var(--kc-shadow-lg); transform: translateY(-2px); border-color: var(--kc-purple); }
.kc-jthumb { position: relative; aspect-ratio: 4 / 3; background: #0b0f1a; display: grid; place-items: center; overflow: hidden; }
.kc-jthumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.kc-jthumb img + .kc-jthumb-ph { display: none; }
.kc-jthumb-ph { font-size: 40px; color: rgba(255,255,255,.14); }
.kc-jthumb .kc-status { position: absolute; top: 8px; left: 8px; }
.kc-jthumb-prog { position: absolute; bottom: 8px; right: 8px; font-size: .74rem; font-weight: 700; color: #fff;
  background: rgba(0,0,0,.55); padding: 2px 8px; border-radius: 999px; }
.kc-jbody { padding: 11px 13px 13px; display: flex; flex-direction: column; gap: 6px; }
.kc-jname { font-weight: 700; font-size: .86rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kc-jmeta { font-size: .72rem; color: var(--kc-muted); }
.kc-jactions { display: flex; gap: 6px; margin-top: 4px; }
.kc-jactions .kc-btn-primary { flex: 1; justify-content: center; }

.kc-modal { position: fixed; inset: 0; z-index: 2000; display: flex; align-items: center; justify-content: center; padding: 24px; }
.kc-modal[hidden] { display: none; }
.kc-modal-back { position: absolute; inset: 0; background: rgba(4,6,12,.72); backdrop-filter: blur(2px); }
.kc-modal-card { position: relative; z-index: 1; width: min(720px, 96vw); max-height: 90vh; overflow: auto;
  background: var(--kc-card); border: 1px solid var(--kc-line); border-radius: 16px; box-shadow: var(--kc-shadow-lg);
  display: grid; grid-template-columns: 300px 1fr; }
@media (max-width: 620px) { .kc-modal-card { grid-template-columns: 1fr; } }
.kc-modal-x { position: absolute; top: 8px; right: 10px; z-index: 2; background: rgba(0,0,0,.4); border: none;
  color: #fff; width: 30px; height: 30px; border-radius: 50%; font-size: 1.3rem; line-height: 1; cursor: pointer; }
.kc-modal-thumb { background: #0b0f1a; display: grid; place-items: center; min-height: 220px; }
.kc-modal-thumb img { width: 100%; height: 100%; object-fit: cover; }
.kc-modal-thumb .material-symbols-rounded { font-size: 60px; color: rgba(255,255,255,.14); }
.kc-modal-info { padding: 20px 22px; }
.kc-modal-info h3 { margin: 0 0 10px; font-size: 1.1rem; }
.kc-modal-meta { display: flex; flex-wrap: wrap; gap: 6px 12px; font-size: .78rem; color: var(--kc-muted); margin-bottom: 14px; text-transform: capitalize; }
.kc-modal-classes { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
.kc-chip { background: var(--kc-field); border: 1px solid var(--kc-line); border-radius: 8px; padding: 4px 9px; font-size: .74rem; }
.kc-chip b { color: var(--kc-purple); }
.kc-muted-sm { font-size: .78rem; color: var(--kc-muted); }
.kc-modal-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ── Danger button + themed confirm dialog (replaces window.confirm) ── */
.kc-btn-danger { background: var(--kc-danger); color: #fff; border: 1px solid var(--kc-danger); }
.kc-btn-danger:hover { filter: brightness(1.07); box-shadow: var(--kc-shadow); }
.kc-confirm-card {
  position: relative; z-index: 1; width: min(430px, 94vw);
  background: var(--kc-card); border: 1px solid var(--kc-line);
  border-radius: 18px; box-shadow: var(--kc-shadow-lg); padding: 28px 26px 22px; text-align: center;
}
.kc-confirm-icon {
  width: 54px; height: 54px; margin: 0 auto 14px; border-radius: 50%;
  display: grid; place-items: center; background: rgba(229, 72, 77, .14); color: var(--kc-danger);
}
.kc-confirm-icon .material-symbols-rounded { font-size: 28px; }
.kc-confirm-card h3 { margin: 0 0 8px; font-size: 1.14rem; color: var(--kc-ink); }
.kc-confirm-card p { margin: 0 0 22px; font-size: .86rem; color: var(--kc-muted); line-height: 1.55; }
.kc-confirm-actions { display: flex; gap: 10px; justify-content: center; }
.kc-confirm-actions .kc-btn { min-width: 116px; justify-content: center; }

/* Small square icon action (token delete) */
.kc-icon-btn {
  width: 32px; height: 32px; border-radius: 8px; flex-shrink: 0;
  border: 1px solid var(--kc-line); background: var(--kc-field); color: var(--kc-muted);
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer; transition: all .15s;
}
.kc-icon-btn:hover { color: var(--kc-danger); border-color: var(--kc-danger); background: rgba(229, 72, 77, .10); }
.kc-icon-btn .material-symbols-rounded { font-size: 18px; }

/* ── KOS Classify footer — FIXED bottom bar (like the top navbar) ──
   Pinned to the viewport bottom; it does NOT scroll with the page. Offset from
   the left by the 320px fixed sidebar so it aligns with the content area (matches
   .main-content's margin-left). Frosted translucent bar in both themes. The page
   content gets bottom padding (.kc-wrap) so nothing hides behind it. */
.kc-footer {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 900;
  height: 52px; padding: 0 26px;
  transition: left var(--transition-smooth, .28s ease);   /* track the sidebar collapse */
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  background: rgba(255, 255, 255, .86);
  border-top: 1px solid var(--kc-line);
  backdrop-filter: blur(12px) saturate(140%); -webkit-backdrop-filter: blur(12px) saturate(140%);
  box-shadow: 0 -6px 24px rgba(16, 16, 40, .10);
}
:root[data-theme="dark"] .kc-footer {
  background: rgba(13, 18, 32, .82);
  box-shadow: 0 -6px 24px rgba(0, 0, 0, .30);
}
@media (min-width: 1200px) {
  .kc-footer { left: 320px; }                    /* clear the fixed 320px sidebar */
  body.kfsb-collapsed .kc-footer { left: 72px; } /* …and the 72px icon-rail when collapsed */
}
/* Lift the global chat launcher (fixed bottom-right, from internal-chat.css which
   loads after this file) above the fixed footer so they don't overlap. */
.ic-launcher { bottom: 78px !important; }
.ic-panel { bottom: 78px !important; }
.kc-footer-brand { display: inline-flex; align-items: center; gap: 8px; font-weight: 800; color: var(--kc-ink); font-size: .9rem; white-space: nowrap; }
.kc-footer-brand .material-symbols-rounded { color: var(--kc-purple); font-size: 20px; }
.kc-footer-links { display: flex; gap: 20px; flex-wrap: wrap; justify-content: center; }
.kc-footer-links a { color: var(--kc-muted); text-decoration: none; font-size: .82rem; font-weight: 600; cursor: pointer; transition: color .15s; }
.kc-footer-links a:hover { color: var(--kc-purple); }
.kc-footer-copy { font-size: .74rem; color: var(--kc-muted); white-space: nowrap; }
/* keep the last content clear of the fixed bar */
.kc-wrap { padding-bottom: 78px; }
@media (max-width: 720px) {
  .kc-footer { padding: 0 14px; height: 48px; }
  .kc-footer-copy { display: none; }   /* keep it a single line on small screens */
}
