/* ══════════════════════════════════════════════════════════════════════════
   Kashif shared components
   Toasts, confirm/modal chrome, skeletons, command palette, focus rings.
   ══════════════════════════════════════════════════════════════════════════ */

/* ── Screen-reader only (item 70) ───────────────────────────────────────── */

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ── Skip to content (item 63) ──────────────────────────────────────────── */

/* Clipped rather than moved off-screen with a transform: a transformed link
   can fall out of the sequential focus order in Chromium, which defeats the
   whole point. Clipping keeps it reachable and reveals it on focus. */
#k-skip-link {
  position: fixed;
  top: 8px; left: 8px;
  z-index: 400;
  padding: 8px 14px;
  border-radius: 8px;
  background: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
  font-size: 13px;
  font-weight: 500;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}
#k-skip-link:focus {
  width: auto; height: auto;
  overflow: visible;
  clip: auto;
  clip-path: none;
}

/* ── Visible focus rings (item 38) ──────────────────────────────────────── */

:focus-visible {
  outline: 2px solid hsl(var(--ring));
  outline-offset: 2px;
  border-radius: 6px;
}
:focus:not(:focus-visible) { outline: none; }

/* ── Toasts (item 9, 25) ────────────────────────────────────────────────── */

#k-toasts {
  position: fixed;
  z-index: 300;
  bottom: calc(16px + env(safe-area-inset-bottom));
  right: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: min(380px, calc(100vw - 32px));
  pointer-events: none;
}

.k-toast {
  pointer-events: auto;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid hsl(var(--border));
  background: hsl(var(--card));
  color: hsl(var(--card-foreground));
  font-size: 13px;
  line-height: 1.45;
  animation: k-toast-in var(--dur-base) var(--ease-out) both;
}
.k-toast.k-out { animation: k-toast-out var(--dur-fast) var(--ease-out) both; }

.k-toast-dot {
  flex: 0 0 auto;
  width: 6px; height: 6px;
  margin-top: 6px;
  border-radius: 50%;
  background: hsl(var(--muted-foreground));
}
.k-toast-success .k-toast-dot { background: #22c55e; }
.k-toast-error   .k-toast-dot { background: #ef4444; }
.k-toast-warn    .k-toast-dot { background: #f59e0b; }

.k-toast-body { flex: 1 1 auto; min-width: 0; }
.k-toast-title { font-weight: 550; }
.k-toast-msg { color: hsl(var(--muted-foreground)); font-size: 12px; margin-top: 1px; }

.k-toast-action {
  flex: 0 0 auto;
  font-size: 12px;
  font-weight: 500;
  padding: 3px 8px;
  border-radius: 6px;
  border: 1px solid hsl(var(--border));
  background: transparent;
  color: hsl(var(--foreground));
  cursor: pointer;
}
.k-toast-action:hover { background: hsl(var(--accent)); }

.k-toast-close {
  flex: 0 0 auto;
  width: 20px; height: 20px;
  display: grid; place-items: center;
  border-radius: 5px;
  color: hsl(var(--muted-foreground));
  background: transparent;
  border: 0;
  cursor: pointer;
}
.k-toast-close:hover { background: hsl(var(--accent)); color: hsl(var(--foreground)); }

/* ── Modal / confirm chrome (items 10, 11, 26) ──────────────────────────── */

.k-backdrop {
  position: fixed;
  inset: 0;
  z-index: 250;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(0, 0, 0, .55);
  animation: k-fade-in var(--dur-fast) var(--ease-out) both;
}

.k-dialog {
  width: min(440px, 100%);
  max-height: calc(100dvh - 48px);
  overflow: auto;
  border-radius: 14px;
  border: 1px solid hsl(var(--border));
  background: hsl(var(--card));
  color: hsl(var(--card-foreground));
  padding: 18px;
  animation: k-scale-in var(--dur-base) var(--ease-out) both;
}
.k-dialog-lg { width: min(720px, 100%); }

.k-dialog-title { font-size: 15px; font-weight: 600; }
.k-dialog-msg {
  margin-top: 6px;
  font-size: 13px;
  line-height: 1.6;
  color: hsl(var(--muted-foreground));
}
.k-dialog-actions {
  margin-top: 18px;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.k-btn {
  font-size: 13px;
  font-weight: 500;
  padding: 7px 14px;
  border-radius: 8px;
  border: 1px solid hsl(var(--border));
  background: transparent;
  color: hsl(var(--foreground));
  cursor: pointer;
  transition: background-color var(--dur-fast) var(--ease-out);
}
.k-btn:hover { background: hsl(var(--accent)); }
.k-btn-primary {
  background: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
  border-color: transparent;
}
.k-btn-primary:hover { opacity: .9; background: hsl(var(--primary)); }
.k-btn-danger { background: #dc2626; color: #fff; border-color: transparent; }
.k-btn-danger:hover { opacity: .9; background: #dc2626; }

/* ── Skeletons (item 20) ────────────────────────────────────────────────── */

.k-skel {
  border-radius: 6px;
  background: hsl(var(--muted));
  background-image: linear-gradient(
    90deg,
    hsl(var(--muted)) 0%,
    hsl(var(--accent)) 50%,
    hsl(var(--muted)) 100%
  );
  background-size: 360px 100%;
  background-repeat: no-repeat;
  animation: k-shimmer 1.3s linear infinite;
}
.k-skel-text { height: 11px; margin: 7px 0; }
.k-skel-title { height: 17px; width: 42%; margin: 0 0 12px; }
.k-skel-card { height: 78px; margin-bottom: 10px; }
.k-skel-row { height: 42px; margin-bottom: 6px; }

/* ── Command palette (item 35) ──────────────────────────────────────────── */

#k-palette-backdrop {
  position: fixed;
  inset: 0;
  z-index: 280;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 12vh 16px 16px;
  background: rgba(0, 0, 0, .5);
  animation: k-fade-in var(--dur-fast) var(--ease-out) both;
}

#k-palette {
  width: min(620px, 100%);
  max-height: 64vh;
  display: flex;
  flex-direction: column;
  border-radius: 14px;
  border: 1px solid hsl(var(--border));
  background: hsl(var(--card));
  overflow: hidden;
  animation: k-scale-in var(--dur-base) var(--ease-out) both;
}

#k-palette-input {
  width: 100%;
  padding: 15px 16px;
  font-size: 14px;
  border: 0;
  border-bottom: 1px solid hsl(var(--border));
  background: transparent;
  color: hsl(var(--foreground));
  outline: none;
}
#k-palette-input::placeholder { color: hsl(var(--muted-foreground)); }

#k-palette-list { overflow-y: auto; padding: 6px; }

.k-pal-group {
  padding: 8px 10px 4px;
  font-size: 10px;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: hsl(var(--muted-foreground));
}

.k-pal-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: hsl(var(--foreground));
  font-size: 13px;
  text-align: left;
  cursor: pointer;
}
.k-pal-item[aria-selected="true"] { background: hsl(var(--accent)); }
.k-pal-item-sub {
  margin-left: auto;
  font-size: 11px;
  color: hsl(var(--muted-foreground));
}
.k-pal-empty {
  padding: 26px 16px;
  text-align: center;
  font-size: 13px;
  color: hsl(var(--muted-foreground));
}

#k-palette-foot {
  display: flex;
  gap: 14px;
  padding: 8px 14px;
  border-top: 1px solid hsl(var(--border));
  font-size: 11px;
  color: hsl(var(--muted-foreground));
}

kbd {
  font-family: inherit;
  font-size: 10px;
  padding: 1px 5px;
  border-radius: 4px;
  border: 1px solid hsl(var(--border));
  background: hsl(var(--muted));
}

/* ── Offline indicator (item 46) ────────────────────────────────────────── */

#k-offline {
  position: fixed;
  z-index: 290;
  top: calc(8px + env(safe-area-inset-top));
  left: 50%;
  transform: translateX(-50%);
  padding: 6px 14px;
  border-radius: 99px;
  border: 1px solid hsl(var(--border));
  background: hsl(var(--card));
  font-size: 12px;
  color: hsl(var(--muted-foreground));
  animation: k-toast-in var(--dur-base) var(--ease-out) both;
}

/* ── Room error boundary (item 42) ──────────────────────────────────────── */

.k-room-error {
  margin: 28px auto;
  max-width: 440px;
  padding: 20px;
  border: 1px solid hsl(var(--border));
  border-radius: 12px;
  text-align: center;
}
.k-room-error-title { font-size: 14px; font-weight: 600; }
.k-room-error-msg {
  margin: 6px 0 14px;
  font-size: 12px;
  line-height: 1.6;
  color: hsl(var(--muted-foreground));
}

/* ── Density toggle (item 50) ───────────────────────────────────────────── */

body.k-dense .prose table { font-size: .78em; }
body.k-dense .prose th { padding: 4px 8px; }
body.k-dense .prose td { padding: 3px 8px; }
body.k-dense .nav-item { padding-top: 5px; padding-bottom: 5px; }

/* ── Sticky table headers (item 51) ─────────────────────────────────────── */

.k-sticky-head thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: hsl(var(--card));
}

/* ── Sortable columns (item 52) ─────────────────────────────────────────── */

th[data-sort] { cursor: pointer; user-select: none; white-space: nowrap; }
th[data-sort]:hover { color: hsl(var(--foreground)); }

/* Caret drawn as a pseudo-element so sorting needs no injected markup. */
th[data-sort]::after {
  content: '\2195';            /* up-down arrow: sortable but unsorted */
  display: inline-block;
  margin-left: 5px;
  font-size: 9px;
  opacity: .25;
  transition: opacity var(--dur-fast) var(--ease-out);
}
th[data-sort]:hover::after { opacity: .6; }
th[data-sort].is-asc::after  { content: '\2191'; opacity: 1; }
th[data-sort].is-desc::after { content: '\2193'; opacity: 1; }

/* ── Agent room handoff card ────────────────────────────────────────────────
   Rendered when the assistant hands the user off to a room. Clickable, so it
   stays useful after the automatic switch has happened. */

.k-open-card {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  margin-top: 10px;
  padding: 11px 13px;
  text-align: left;
  border: 1px solid hsl(var(--border));
  border-radius: 10px;
  background: hsl(var(--card));
  cursor: pointer;
  transition: border-color var(--dur-fast) var(--ease-out),
              background-color var(--dur-fast) var(--ease-out);
}
.k-open-card:hover {
  border-color: hsl(var(--ring) / .5);
  background: hsl(var(--accent));
}
.k-open-icon {
  flex: none;
  width: 26px; height: 26px;
  display: grid; place-items: center;
  border-radius: 7px;
  font-size: 14px;
  background: hsl(var(--primary) / .12);
  color: hsl(var(--primary));
}
.k-open-text { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.k-open-title { font-size: 12.5px; font-weight: 500; color: hsl(var(--foreground)); }
.k-open-sub {
  font-size: 11.5px;
  color: hsl(var(--muted-foreground));
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* ── Responsive content widths (items 48, 49) ───────────────────────────────
   Brief and Ask were pinned to a fixed column that wasted roughly two thirds
   of a 1600px display. These scale with the viewport while keeping a
   comfortable reading measure for prose. */

.k-wide { max-width: 52rem; }
@media (min-width: 1280px) { .k-wide { max-width: 68rem; } }
@media (min-width: 1680px) { .k-wide { max-width: 80rem; } }

.k-measure { max-width: 48rem; }
@media (min-width: 1280px) { .k-measure { max-width: 56rem; } }
@media (min-width: 1680px) { .k-measure { max-width: 64rem; } }

/* Brief KPI strip gains columns rather than stretching each card.
   base.css already steps up to 4 at 980px. */
@media (min-width: 1360px) {
  .ops-stats { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}
@media (min-width: 1680px) {
  .ops-stats { grid-template-columns: repeat(6, minmax(0, 1fr)); }
}

/* ── Card hover lift (item 29) ──────────────────────────────────────────────
   Applied to the card classes the app already uses, so templates stay
   untouched. Borders and background only — no shadows. */

.ops-card, .ops-item, .insight-card, .j-card, .board-tile, .c-qcard, .chart-thumb {
  transition: border-color var(--dur-fast) var(--ease-out),
              background-color var(--dur-fast) var(--ease-out),
              transform var(--dur-fast) var(--ease-out);
}
.insight-card:hover, .j-card:hover, .board-tile:hover, .c-qcard:hover, .chart-thumb:hover {
  border-color: hsl(var(--ring) / .45);
  transform: translateY(-1px);
}

@media (prefers-reduced-motion: reduce) {
  .insight-card:hover, .j-card:hover, .board-tile:hover,
  .c-qcard:hover, .chart-thumb:hover { transform: none; }
}

/* ── Copy affordance (item 55) ──────────────────────────────────────────── */

.k-copy {
  border: 0;
  background: transparent;
  color: hsl(var(--muted-foreground));
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 4px;
  opacity: 0;
  transition: opacity var(--dur-fast) var(--ease-out);
}
.k-copyable:hover .k-copy, .k-copy:focus-visible { opacity: 1; }
.k-copy:hover { color: hsl(var(--foreground)); background: hsl(var(--accent)); }

/* ── Churn signal chips and playbook ────────────────────────────────────── */

.c-signals {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 12px 0 0;
}
.c-signal {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 500;
  border: 1px solid transparent;
  white-space: nowrap;
}
.c-signal.is-bad {
  color: hsl(0 72% 42%);
  background: hsl(0 72% 50% / .10);
  border-color: hsl(0 72% 50% / .28);
}
.c-signal.is-warn {
  color: hsl(35 85% 38%);
  background: hsl(35 90% 50% / .12);
  border-color: hsl(35 90% 50% / .30);
}
.c-signal.is-ok {
  color: hsl(var(--muted-foreground));
  background: hsl(var(--muted) / .6);
  border-color: hsl(var(--border));
}
.dark .c-signal.is-bad  { color: hsl(0 85% 72%); }
.dark .c-signal.is-warn { color: hsl(40 95% 66%); }

.c-playbook {
  margin-top: 12px;
  padding: 11px 13px;
  border: 1px solid hsl(var(--border));
  border-left: 3px solid hsl(var(--primary));
  border-radius: 8px;
  background: hsl(var(--card));
}
.c-playbook-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}
.c-playbook-move {
  font-size: 12.5px;
  font-weight: 600;
  color: hsl(var(--foreground));
}
.c-playbook-vendor {
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: .06em;
  padding: 2px 6px;
  border-radius: 4px;
  color: hsl(var(--muted-foreground));
  background: hsl(var(--muted) / .8);
}
.c-playbook-why {
  font-size: 11.5px;
  line-height: 1.5;
  color: hsl(var(--muted-foreground));
  margin: 0;
}

/* ── Settings ───────────────────────────────────────────────────────────────
   A rail of sections beside one content pane. Below the lg breakpoint the
   rail becomes a horizontal tab strip so the pane keeps the full width. */

.settings-shell {
  display: grid;
  gap: 2rem;
  align-items: start;
  grid-template-columns: minmax(0, 1fr);
}

@media (min-width: 1024px) {
  .settings-shell { grid-template-columns: 212px minmax(0, 1fr); gap: 2.75rem; }
}

.settings-rail {
  display: flex;
  gap: .25rem;
  overflow-x: auto;
  scrollbar-width: none;
  margin: 0 -1.5rem;
  padding: 0 1.5rem .75rem;
  border-bottom: 1px solid hsl(var(--border));
}
.settings-rail::-webkit-scrollbar { display: none; }
.settings-rail > .settings-group { display: contents; }

@media (min-width: 1024px) {
  .settings-rail {
    position: sticky; top: 0;
    flex-direction: column;
    overflow: visible;
    margin: 0; padding: 0;
    border-bottom: 0;
  }
  .settings-rail > .settings-group { display: block; }
}

.settings-tab {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: .625rem;
  width: auto;
  padding: .5rem .75rem;
  border: 0;
  border-radius: .5rem;
  background: transparent;
  color: hsl(var(--muted-foreground));
  font-size: 13px;
  text-align: left;
  cursor: pointer;
  white-space: nowrap;
  transition: background .15s ease, color .15s ease;
}
.settings-tab:hover { background: hsl(var(--accent) / .6); color: hsl(var(--foreground)); }
.settings-tab.is-on { background: hsl(var(--accent)); color: hsl(var(--foreground)); font-weight: 500; }
.settings-tab svg { width: 1rem; height: 1rem; flex: none; }
.settings-tab span { flex: 1; overflow: hidden; text-overflow: ellipsis; }
.settings-tab em {
  font-style: normal; font-size: 10px;
  font-variant-numeric: tabular-nums;
  padding: 0 .375rem; border-radius: .375rem;
  background: hsl(var(--muted-foreground) / .15);
}

@media (min-width: 1024px) { .settings-tab { width: 100%; } }

#marketing-body .settings-rail {
  margin-left: 0;
  margin-right: 0;
  padding-left: 0;
  padding-right: 0;
}

.settings-pane {
  min-width: 0;
  outline: none;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* Section heading */
.s-head h1 { font-size: 22px; font-weight: 600; letter-spacing: -.01em; margin: 0; }
.s-head p { font-size: 13px; color: hsl(var(--muted-foreground)); margin: .25rem 0 0; line-height: 1.6; max-width: 56ch; }

/* Card */
.s-card { border: 1px solid hsl(var(--border)); border-radius: 1rem; overflow: hidden; }
.s-card-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: .75rem; padding: .875rem 1rem;
  border-bottom: 1px solid hsl(var(--border));
}
.s-card-head h2 { font-size: 13px; font-weight: 600; margin: 0; }
.s-card-head p { font-size: 11.5px; color: hsl(var(--muted-foreground)); margin: .125rem 0 0; }
.s-card-body > .s-row + .s-row,
.s-card-body > .s-item + .s-item { border-top: 1px solid hsl(var(--border)); }

/* Label and control on one line, stacking when there is no room */
.s-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; padding: .875rem 1rem; flex-wrap: wrap;
}
.s-row-label { font-size: 13px; font-weight: 500; }
.s-row-hint { font-size: 11.5px; color: hsl(var(--muted-foreground)); margin-top: .125rem; line-height: 1.5; max-width: 48ch; }
.s-row-control { flex: none; }

.s-item {
  display: flex; align-items: center; justify-content: space-between;
  gap: .75rem; padding: .75rem 1rem;
}

.s-empty { padding: 2.25rem 1rem; text-align: center; }

.s-value { font-size: 13px; color: hsl(var(--muted-foreground)); }

.s-pill {
  font-size: 11px; padding: .125rem .5rem; border-radius: .375rem;
  border: 1px solid hsl(var(--border)); color: hsl(var(--muted-foreground));
  text-transform: capitalize;
}

.s-avatar {
  width: 1.75rem; height: 1.75rem; flex: none;
  display: grid; place-items: center;
  border-radius: .5rem;
  background: hsl(var(--accent));
  font-size: 11.5px; font-weight: 600;
}

/* Segmented choice */
.s-choice { display: inline-flex; gap: .25rem; padding: .1875rem; border-radius: .625rem; background: hsl(var(--muted-foreground) / .1); }
.s-choice button {
  border: 0; background: transparent; cursor: pointer;
  font-size: 12px; padding: .3125rem .75rem; border-radius: .5rem;
  color: hsl(var(--muted-foreground));
  transition: background .15s ease, color .15s ease;
}
.s-choice button:hover { color: hsl(var(--foreground)); }
.s-choice button.is-on { background: hsl(var(--background)); color: hsl(var(--foreground)); font-weight: 500; }

/* Switch */
.s-switch {
  width: 2.25rem; height: 1.25rem; padding: 0;
  border: 0; border-radius: 999px; cursor: pointer;
  background: hsl(var(--muted-foreground) / .25);
  position: relative; transition: background .18s ease;
}
.s-switch.is-on { background: hsl(var(--primary)); }
.s-switch span {
  position: absolute; top: .125rem; left: .125rem;
  width: 1rem; height: 1rem; border-radius: 999px;
  background: #fff; transition: left .18s cubic-bezier(.16, 1, .3, 1);
}
.s-switch.is-on span { left: 1rem; }

/* Buttons */
.s-btn-primary, .s-btn-danger, .s-mini {
  border-radius: .5rem; cursor: pointer; font-size: 12px;
  transition: background .15s ease, opacity .15s ease, border-color .15s ease;
  white-space: nowrap;
}
.s-btn-primary {
  border: 0; padding: .375rem .75rem;
  background: hsl(var(--primary)); color: hsl(var(--primary-foreground));
}
.s-btn-primary:hover { opacity: .9; }
.s-btn-danger {
  padding: .375rem .75rem;
  border: 1px solid hsl(var(--destructive) / .4);
  background: transparent; color: hsl(var(--destructive));
}
.s-btn-danger:hover { background: hsl(var(--destructive) / .1); }
.s-mini {
  padding: .25rem .625rem; font-size: 11px;
  border: 1px solid hsl(var(--border)); background: transparent;
  color: hsl(var(--muted-foreground));
}
.s-mini:hover { background: hsl(var(--accent)); color: hsl(var(--foreground)); }

#tickets-nav-mark { width: 14px; height: 14px; display: flex; align-items: center; }
#tickets-nav-mark svg, #tickets-nav-mark img { width: 100%; height: 100%; object-fit: contain; display: block; }
#tickets-nav-mark.is-wide { width: auto; height: 16px; }
#tickets-nav-mark.is-wide img { width: auto; height: 16px; max-width: 92px; }
body.nav-collapsed #tickets-nav-mark.is-wide { width: 22px; overflow: hidden; }
body.nav-collapsed #tickets-nav-mark.is-wide img { max-width: none; }

.desk-head { display: flex; align-items: center; gap: 14px; }
.desk-head h1 { margin: 0; font-size: 22px; font-weight: 600; letter-spacing: -.02em; }
.desk-head p { margin: 3px 0 0; font-size: 13px; line-height: 1.45; color: hsl(var(--muted-foreground)); }
.desk-logo-plate {
  display: flex; align-items: center; justify-content: center;
  height: 48px; min-width: 48px; padding: 0 10px;
  border-radius: 14px; background: #fff; border: 1px solid hsl(var(--border));
}
.desk-logo { height: 26px; width: auto; max-width: 148px; object-fit: contain; display: block; }
.desk-logo.is-mark { width: 28px; height: 28px; }
.desk-switch { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.desk-switch button {
  display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 12px;
  border-radius: 12px; border: 1px solid hsl(var(--border)); background: transparent;
  font-size: 13px; font-weight: 600; cursor: pointer; color: hsl(var(--foreground));
}
.desk-switch button.is-on { background: hsl(var(--foreground)); color: hsl(var(--background)); border-color: transparent; }
.desk-switch img { height: 16px; width: auto; max-width: 72px; object-fit: contain; }
.desk-error {
  margin-top: 16px; border-radius: 14px; padding: 12px 14px;
  border: 1px solid hsl(38 90% 50% / .35); background: hsl(38 90% 50% / .12);
  color: #92400e; font-size: 13px;
}
.desk-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 8px; margin-top: 22px; }
.desk-tile {
  border: 1px solid hsl(var(--border)); background: hsl(var(--card));
  border-radius: 16px; padding: 14px 16px; text-align: left; cursor: pointer;
  transition: border-color .15s ease, transform .15s ease;
}
.desk-tile:hover { transform: translateY(-1px); }
.desk-tile.is-on { border-color: hsl(var(--foreground)); }
.desk-tile b { display: block; font-size: 22px; font-weight: 600; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.desk-tile span { display: block; margin-top: 2px; font-size: 12px; color: hsl(var(--muted-foreground)); text-transform: capitalize; }
.desk-block { margin-top: 22px; }
.desk-block h2 { margin: 0 0 10px; font-size: 13px; font-weight: 600; color: hsl(var(--muted-foreground)); }
.desk-metrics, .desk-channels { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 8px; }
.desk-metric, .desk-channel {
  border: 1px solid hsl(var(--border)); background: hsl(var(--card));
  border-radius: 16px; padding: 12px 14px;
}
.desk-metric b, .desk-channel b { display: block; font-size: 18px; font-weight: 600; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.desk-metric span, .desk-channel-name { display: block; margin-top: 2px; font-size: 12px; color: hsl(var(--muted-foreground)); text-transform: capitalize; }
.desk-channel em, .desk-delta { display: block; margin-top: 4px; font-style: normal; font-size: 11px; color: hsl(var(--muted-foreground)); }
.desk-delta.is-up { color: #15803d; }
.desk-delta.is-down { color: #b45309; }
.desk-list { border: 1px solid hsl(var(--border)); border-radius: 16px; background: hsl(var(--card)); overflow: hidden; }
.desk-row {
  display: flex; align-items: center; gap: 12px; width: 100%;
  padding: 12px 16px; border: 0; border-bottom: 1px solid hsl(var(--border));
  background: transparent; text-align: left; cursor: pointer; color: inherit;
}
.desk-row:last-child { border-bottom: 0; }
.desk-row:hover { background: hsl(var(--accent) / .45); }
.desk-row.is-on { background: hsl(var(--accent)); }
.desk-row:disabled { cursor: default; }
.desk-subj { display: block; font-size: 14px; font-weight: 600; }
.desk-meta, .desk-when, .desk-quiet { font-size: 12px; color: hsl(var(--muted-foreground)); }
.desk-meta { display: block; margin-top: 2px; }
.desk-when { margin-left: auto; white-space: nowrap; }
.desk-empty { padding: 28px 16px; text-align: center; color: hsl(var(--muted-foreground)); font-size: 13px; }
.desk-pill {
  font-size: 11px; font-weight: 600; padding: 3px 8px; border-radius: 999px;
  background: hsl(var(--muted)); color: hsl(var(--muted-foreground));
  text-transform: capitalize; white-space: nowrap;
}
.desk-pill.is-open { background: hsl(142 70% 45% / .15); color: #15803d; }
.desk-pill.is-work { background: hsl(200 80% 45% / .15); color: #0369a1; }
.desk-pill.is-wait { background: hsl(38 90% 50% / .18); color: #b45309; }
.desk-detail { margin-top: 16px; border: 1px solid hsl(var(--border)); border-radius: 16px; background: hsl(var(--card)); overflow: hidden; }
.desk-detail-head, .desk-detail-body, .desk-detail-form { padding: 16px 18px; }
.desk-detail-head, .desk-detail-body { border-bottom: 1px solid hsl(var(--border)); }
.desk-detail-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.desk-detail h2 { margin: 8px 0 0; font-size: 16px; font-weight: 600; }
.desk-copy { margin: 12px 0 0; font-size: 14px; line-height: 1.5; white-space: pre-wrap; }
.desk-comment { border: 1px solid hsl(var(--border)); border-radius: 12px; padding: 10px 12px; }
.desk-comment + .desk-comment { margin-top: 8px; }
.desk-comment-meta { display: flex; gap: 8px; font-size: 11px; color: hsl(var(--muted-foreground)); }
.desk-comment p { margin: 6px 0 0; font-size: 14px; white-space: pre-wrap; }
.desk-note {
  width: 100%; border: 1px solid hsl(var(--border)); border-radius: 12px;
  padding: 10px 12px; background: hsl(var(--background)); color: inherit;
  font: inherit; font-size: 14px; resize: vertical;
}
.desk-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 10px; }
.desk-btn {
  height: 34px; padding: 0 12px; border-radius: 10px;
  border: 1px solid hsl(var(--border)); background: transparent;
  font-size: 13px; font-weight: 600; cursor: pointer; color: inherit;
}
.desk-btn.is-primary { background: hsl(var(--foreground)); color: hsl(var(--background)); border-color: transparent; }
.desk-close { margin-left: auto; }
.desk-select {
  height: 34px; margin-left: auto; border-radius: 10px;
  border: 1px solid hsl(var(--border)); background: hsl(var(--background));
  padding: 0 8px; font-size: 13px; color: inherit;
}
@media (max-width: 720px) {
  .desk-when { display: none; }
  .desk-select, .desk-close { margin-left: 0; }
}
