:root {
  --bg: #1a1a1a;
  --bg2: #1f1f1e;
  --surface: #262626;
  --surface2: #303030;
  --border: #333333;
  --text: #ededed;
  --muted: #9ca3af;
  --subtle: #6b7280;
  --brand: #e56a4a;
  --brand2: #f4b59c;
  --ok: #22c55e;
  --warn: #fbbf24;
  --danger: #ef4444;
}

* { box-sizing: border-box; }
html, body { min-height: 100%; color-scheme: dark; }
body {
  margin: 0;
  background:
    radial-gradient(900px 460px at 8% -10%, rgba(229, 106, 74, 0.16), transparent 60%),
    radial-gradient(700px 420px at 95% 0%, rgba(229, 106, 74, 0.08), transparent 60%),
    var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .55; }

.loading {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  background: rgba(26, 26, 26, .96);
}
.loading[hidden] { display: none; }
.loading-card {
  display: flex;
  gap: 14px;
  align-items: center;
  width: min(360px, calc(100vw - 48px));
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  padding: 20px;
  box-shadow: 0 24px 90px -38px rgba(0, 0, 0, .85);
}
.loading-card strong, .loading-card span { display: block; }
.loading-card span { margin-top: 4px; color: var(--muted); font-size: 13px; }

.brand-mark, .app-icon, .sidebar-brand span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--brand), #b9563f);
  color: #fff;
  box-shadow: 0 14px 36px -18px rgba(229, 106, 74, .75);
}
.brand-mark { width: 44px; height: 44px; border-radius: 12px; font-size: 24px; }

.app {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  min-height: 100vh;
}
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  border-right: 1px solid rgba(51, 51, 51, .92);
  background: rgba(31, 31, 30, .78);
  padding: 18px 12px;
}
.sidebar-brand { margin-bottom: 8px; }
.sidebar-brand span { width: 42px; height: 42px; border-radius: 12px; font-size: 23px; }
.nav, .icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
}
.nav:hover, .nav.active, .icon-btn:hover {
  border-color: rgba(229, 106, 74, .38);
  background: rgba(229, 106, 74, .12);
  color: var(--brand2);
}
.icon-btn.danger { color: var(--danger); }
.icon-btn.danger:hover { border-color: rgba(239, 68, 68, .38); background: rgba(239, 68, 68, .12); color: #fecaca; }

.workspace { width: min(100%, 1440px); margin: 0 auto; padding: 28px 28px 56px; }
.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 24px;
}
.title-row { display: flex; align-items: center; gap: 13px; }
.app-icon { width: 40px; height: 40px; border-radius: 11px; font-size: 22px; }
h1 { margin: 0; font-size: 24px; letter-spacing: 0; }
p { margin: 4px 0 0; color: var(--muted); font-size: 13px; }
.statusbar { display: flex; align-items: center; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }
.metric, .version-pill {
  min-width: 0;
  border: 1px solid rgba(51, 51, 51, .9);
  border-radius: 10px;
  background: rgba(38, 38, 38, .86);
  color: var(--text);
  padding: 9px 11px;
}
.metric span, .metric strong { display: block; text-align: left; }
.metric span { color: var(--muted); font-size: 11px; line-height: 1; }
.metric strong {
  max-width: 168px;
  margin-top: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
}
.metric.ok strong { color: var(--ok); }
.metric.warn strong { color: var(--warn); }
.metric.danger strong { color: var(--danger); }
.version-pill {
  border-color: rgba(229, 106, 74, .4);
  background: rgba(229, 106, 74, .14);
  color: var(--brand2);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-weight: 700;
}

.view { display: none; }
.view.active { display: block; }
.view > .grid + .panel,
.view > .grid + .grid,
.view > .panel + .panel,
.view > .panel + .grid,
.view > .grid + form,
.view > form + form { margin-top: 18px; }
.grid { display: grid; gap: 18px; }
.grid.two { grid-template-columns: minmax(0, 1.35fr) minmax(310px, .65fr); }
.settings-license-grid { align-items: start; }
.panel {
  border: 1px solid rgba(51, 51, 51, .95);
  border-radius: 8px;
  background: rgba(38, 38, 38, .9);
  padding: 18px;
  box-shadow: 0 18px 80px -54px rgba(0, 0, 0, .9);
}
.panel.wide { min-width: 0; }
.panel-title {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  margin-bottom: 14px;
  color: #f7f4f0;
  font-size: 15px;
  font-weight: 760;
}
.panel-title > span { color: var(--brand); }
.panel-title > button,
.panel-title > select,
.panel-title > div { margin-left: auto; }
.panel-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.novnc-panel {
  height: calc(100vh - 132px);
  min-height: 620px;
  padding: 12px;
}
.novnc-panel .panel-title { margin-bottom: 10px; }
.novnc-controls {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 10px;
}
.novnc-controls .btn-primary,
.novnc-controls .btn-secondary {
  width: 100%;
  min-height: 38px;
  margin-top: 0;
  font-size: 14px;
  font-weight: 760;
}
.btn-secondary.danger {
  border-color: rgba(239, 68, 68, .48);
  background: rgba(239, 68, 68, .12);
  color: #fecaca;
}
.novnc-panel #novncStatus {
  margin-bottom: 10px;
}
.novnc-frame {
  display: block;
  width: 100%;
  height: calc(100% - 134px);
  min-height: 488px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #050505;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}
.metric-grid div, .update-box {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(26, 26, 26, .46);
  padding: 12px;
}
.metric-grid span { color: var(--muted); font-size: 12px; }
.metric-grid strong { display: block; margin-top: 5px; font-size: 24px; }
.progress { overflow: hidden; height: 6px; margin-top: 18px; border-radius: 999px; background: var(--border); }
.progress span { display: block; width: 0%; height: 100%; background: var(--brand); transition: width 160ms ease; }
.quick-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.plans-grid, .service-grid, .announcement-list { display: grid; gap: 10px; }
.plans-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-bottom: 14px; }
.icon-card {
  display: grid;
  align-content: start;
  gap: 7px;
  min-width: 0;
  min-height: 128px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(26, 26, 26, .4);
  color: var(--text);
  padding: 13px;
  text-align: left;
}
.icon-card b {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: rgba(229, 106, 74, .14);
  color: var(--brand2);
  font-size: 19px;
}
.icon-card strong {
  display: block;
  color: var(--text);
  font-size: 13px;
  line-height: 1.25;
}
.icon-card span { display: block; margin-top: 0; color: var(--muted); font-size: 12px; line-height: 1.35; }
.plan-card {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(26, 26, 26, .42);
  color: var(--text);
  padding: 12px;
  text-align: left;
}
.plan-card.active { border-color: rgba(229, 106, 74, .54); background: rgba(229, 106, 74, .12); }
.plan-card strong, .plan-card span { display: block; }
.plan-card span { margin-top: 5px; color: var(--muted); font-size: 12px; }
.payment-detail {
  display: grid;
  gap: 10px;
  margin-bottom: 14px;
}
.qr-box {
  display: grid;
  place-items: center;
  min-height: 118px;
  border: 1px solid rgba(229, 106, 74, .32);
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(229,106,74,.18) 12px, transparent 1px) 0 0 / 22px 22px,
    linear-gradient(rgba(229,106,74,.14) 12px, transparent 1px) 0 0 / 22px 22px,
    rgba(26, 26, 26, .42);
  color: var(--brand2);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-weight: 800;
}
.qr-box img {
  width: min(220px, 100%);
  height: auto;
  border-radius: 6px;
  image-rendering: crisp-edges;
}
.service-card, .announcement-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(26, 26, 26, .42);
  padding: 12px;
}
.service-card b {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 8px;
  background: rgba(229, 106, 74, .14);
  color: var(--brand2);
}
.service-card strong, .service-card span, .announcement-row strong, .announcement-row span { display: block; }
.service-card span, .announcement-row span { margin-top: 5px; color: var(--muted); font-size: 12px; }
.announcement-row { grid-template-columns: 1fr; }
.announcement-row.warn { border-color: rgba(251, 191, 36, .28); }
.announcement-row[data-unread="false"] { opacity: .72; }
.help-steps { display: grid; gap: 10px; }
.help-steps div {
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 10px;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(26, 26, 26, .42);
  padding: 10px;
}
.help-steps b {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: rgba(229, 106, 74, .14);
  color: var(--brand2);
}
.help-steps span { color: var(--muted); font-size: 13px; }
.log-modal-card { width: min(920px, calc(100vw - 36px)); }
.persisted-log { display: grid; gap: 12px; max-height: min(70vh, 680px); overflow: auto; }
.persisted-log-group {
  display: grid;
  gap: 8px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(26, 26, 26, .42);
  padding: 10px;
}
.persisted-log-group > strong { color: var(--brand2); font-size: 12px; }
.persisted-log-lines { display: grid; gap: 5px; }
.persisted-log-lines code {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
}

.field { display: grid; gap: 7px; margin-bottom: 12px; }
.field span, .toggle span { color: var(--muted); font-size: 12px; font-weight: 650; }
input, select, textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(26, 26, 26, .58);
  color: var(--text);
  outline: none;
  padding: 11px 12px;
}
.mini-select {
  width: auto;
  min-width: 116px;
  min-height: 34px;
  padding: 6px 9px;
  font-size: 12px;
}
textarea { min-height: 178px; resize: vertical; line-height: 1.45; }
input:focus, select:focus, textarea:focus { border-color: rgba(229, 106, 74, .58); box-shadow: 0 0 0 3px rgba(229, 106, 74, .1); }
.row { display: flex; align-items: flex-end; gap: 10px; }
.grow { flex: 1; }
.row > .field { margin-bottom: 0; }
.toggle {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 11px 0;
}
.toggle input { width: 16px; height: 16px; accent-color: var(--brand); }
.tool-row {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: -4px 0 12px;
}
.tool-row .icon-btn { width: 34px; height: 34px; }
.btn-primary, .btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  border-radius: 8px;
  border: 1px solid rgba(229, 106, 74, .52);
  padding: 0 14px;
  color: #fff;
}
.btn-primary { width: 100%; margin-top: 12px; background: var(--brand); font-size: 19px; }
.btn-secondary { background: rgba(229, 106, 74, .12); color: var(--brand2); }
.row-action {
  flex: 0 0 auto;
  min-width: 76px;
  min-height: 42px;
  margin-top: 0;
  margin-bottom: 0;
}
.notice {
  border: 1px solid rgba(251, 191, 36, .32);
  border-radius: 8px;
  background: rgba(251, 191, 36, .08);
  color: #fde68a;
  padding: 10px 12px;
  margin-bottom: 12px;
  font-size: 13px;
}
.notice.ok {
  border-color: rgba(34, 197, 94, .36);
  background: rgba(34, 197, 94, .1);
  color: #86efac;
}
.notice.warn {
  border-color: rgba(251, 191, 36, .32);
  background: rgba(251, 191, 36, .08);
  color: #fde68a;
}

.log {
  height: 240px;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(10, 10, 10, .4);
  padding: 10px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
}
.log-line { display: flex; gap: 8px; padding: 4px 0; color: var(--muted); }
.log-line b { color: var(--brand2); min-width: 54px; }
.sessions-list, .files-list, .workspace-list, .workspace-project-list, .media-list { display: grid; gap: 9px; }
.workspace-project-panel { margin-bottom: 18px; }
.workspace-project-toolbar {
  display: grid;
  grid-template-columns: minmax(220px, .9fr) minmax(260px, 1.1fr);
  gap: 10px;
  align-items: end;
  margin-bottom: 12px;
}
.workspace-project-toolbar .field {
  min-width: 0;
  margin-bottom: 0;
}
.workspace-toolbar {
  display: grid;
  grid-template-columns: minmax(220px, 1.4fr) minmax(150px, .75fr) minmax(150px, .75fr) minmax(140px, .7fr) minmax(110px, .45fr) auto;
  gap: 10px;
  align-items: end;
  margin-bottom: 12px;
}
.workspace-toolbar .field {
  min-width: 0;
  margin-bottom: 0;
}
.workspace-toolbar .btn-secondary {
  min-height: 42px;
  padding: 0 12px;
}
.workspace-topic-tabs {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  margin: 0 0 12px;
  padding-bottom: 2px;
  overflow-x: auto;
}
.topic-tab {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  flex: 0 0 auto;
  min-height: 36px;
  max-width: 210px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(26, 26, 26, .42);
  color: var(--muted);
  padding: 0 11px;
  font-size: 12px;
  font-weight: 760;
}
.topic-tab span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.topic-tab b {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  min-height: 22px;
  border-radius: 999px;
  background: rgba(229, 106, 74, .14);
  color: var(--brand2);
  padding: 0 7px;
  font-size: 11px;
}
.topic-tab:hover,
.topic-tab.active {
  border-color: rgba(229, 106, 74, .44);
  background: rgba(229, 106, 74, .12);
  color: var(--brand2);
}
.workspace-pagination {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 12px;
}
.workspace-pagination span {
  min-width: 92px;
  text-align: center;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}
.workspace-pagination .btn-secondary {
  width: auto;
  min-height: 34px;
  padding: 0 12px;
  font-size: 12px;
}
.media-library-grid { margin-top: 18px; align-items: start; }
.media-novnc-panel { margin-top: 18px; }
.media-summary { margin-bottom: 12px; }
.media-row,
.media-session-card {
  display: grid;
  gap: 10px;
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(26, 26, 26, .42);
  padding: 11px;
}
.media-row-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}
.media-row-head strong,
.media-row-head span,
.media-row small {
  display: block;
  min-width: 0;
}
.media-row-head strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
}
.media-row-head span,
.media-row small {
  margin-top: 5px;
  overflow-wrap: anywhere;
  color: var(--muted);
  font-size: 12px;
}
.media-row audio,
.media-row video,
.session-audio-row audio {
  width: 100%;
  min-height: 36px;
}
.media-row video,
.media-preview-image {
  display: block;
  max-height: 360px;
  border: 1px solid rgba(229, 106, 74, .18);
  border-radius: 8px;
  background: rgba(10, 10, 10, .32);
  object-fit: contain;
}
.media-preview-image {
  width: min(520px, 100%);
}
.media-row-head .btn-secondary {
  width: auto;
  min-height: 34px;
  padding: 0 10px;
  font-size: 12px;
}
.media-source-link {
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 0;
  overflow: hidden;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
}
.media-source-link:hover { color: var(--brand2); }
.asr-summary {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  margin-bottom: 12px;
}
.asr-jobs-list {
  display: grid;
  gap: 10px;
}
.asr-job-row {
  display: grid;
  gap: 10px;
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(26, 26, 26, .42);
  padding: 12px;
}
.asr-job-row.running {
  border-color: rgba(251, 191, 36, .36);
}
.asr-job-row.done {
  border-color: rgba(34, 197, 94, .28);
}
.asr-job-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}
.asr-job-head strong,
.asr-job-head span {
  display: block;
  min-width: 0;
}
.asr-job-head strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
}
.asr-job-head span {
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
}
.asr-job-actions {
  display: inline-flex;
  gap: 5px;
  align-items: center;
}
.asr-job-actions .icon-btn {
  width: 34px;
  height: 34px;
  font-size: 12px;
}
.asr-progress {
  height: 5px;
  margin-top: 0;
}
.asr-job-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}
.asr-job-metrics span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 28px;
  border: 1px solid rgba(229, 106, 74, .18);
  border-radius: 999px;
  background: rgba(229, 106, 74, .08);
  color: var(--muted);
  padding: 0 9px;
  font-size: 12px;
}
.asr-job-metrics b {
  color: var(--text);
}
.asr-job-command,
.asr-event-lines {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(10, 10, 10, .28);
  padding: 9px;
  overflow-wrap: anywhere;
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
  line-height: 1.45;
}
.asr-event-lines {
  display: grid;
  gap: 5px;
  max-height: 190px;
  overflow: auto;
}
.asr-event-lines code,
.asr-empty-line {
  color: var(--muted);
  white-space: pre-wrap;
}
.frame-thumb-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
  gap: 8px;
}
.frame-thumb {
  display: grid;
  grid-template-rows: auto 28px;
  gap: 0;
  min-width: 0;
  overflow: hidden;
  border: 1px solid rgba(229, 106, 74, .22);
  border-radius: 8px;
  background: rgba(26, 26, 26, .36);
  color: var(--muted);
  padding: 0;
  text-align: left;
}
.frame-thumb img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  background: rgba(10, 10, 10, .4);
}
.frame-thumb span {
  display: block;
  overflow: hidden;
  padding: 7px 8px;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11px;
}
.session-audio-list {
  display: grid;
  gap: 8px;
}
.session-audio-row {
  display: grid;
  gap: 6px;
}
.session-audio-row span {
  overflow: hidden;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
}
.session-row, .file-row {
  display: grid;
  gap: 10px;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(26, 26, 26, .42);
  padding: 11px;
}
.session-row { grid-template-columns: 1fr auto auto auto; }
.file-row { grid-template-columns: minmax(0, 1fr) auto auto auto auto; }
.session-row strong { display: block; font-size: 13px; }
.session-row span, .file-row span { color: var(--muted); font-size: 12px; }
.file-row strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.file-row small { display: block; margin-top: 4px; color: var(--subtle); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pill { border-radius: 999px; background: rgba(229, 106, 74, .14); color: var(--brand2); padding: 5px 9px; font-size: 12px; }
.file-drive-btn {
  min-height: 30px;
  border: 1px solid rgba(117, 169, 255, .35);
  border-radius: 8px;
  background: rgba(117, 169, 255, .1);
  color: #cfe1ff;
  padding: 0 10px;
  font-size: 12px;
  white-space: nowrap;
}
.file-drive-btn:disabled {
  opacity: .42;
  cursor: not-allowed;
}
.session-actions { display: inline-flex; align-items: center; gap: 4px; }
.session-actions .icon-btn { width: 32px; height: 32px; }
.workspace-project-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(26, 26, 26, .42);
  padding: 12px;
}
.workspace-project-card.active {
  border-color: rgba(117, 169, 255, .48);
  background: rgba(117, 169, 255, .1);
}
.workspace-project-main {
  display: grid;
  gap: 7px;
  min-width: 0;
}
.workspace-project-main > strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text);
  font-size: 14px;
}
.workspace-project-main > span {
  display: -webkit-box;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.38;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}
.workspace-project-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}
.workspace-project-actions .btn-primary {
  min-height: 34px;
  padding: 0 12px;
  font-size: 12px;
}
.workspace-card {
  display: grid;
  grid-template-columns: 116px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(26, 26, 26, .42);
  padding: 12px;
}
.workspace-thumb {
  display: grid;
  place-items: center;
  width: 116px;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border: 1px solid rgba(229, 106, 74, .22);
  border-radius: 8px;
  background: rgba(229, 106, 74, .1);
  color: var(--brand2);
  font-size: 28px;
  font-weight: 800;
}
.workspace-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.workspace-body {
  min-width: 0;
  display: grid;
  gap: 7px;
}
.workspace-body > strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text);
  font-size: 14px;
}
.workspace-body > span {
  display: -webkit-box;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.38;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}
.workspace-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
}
.workspace-meta .pill {
  max-width: 190px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.workspace-keywords {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--subtle);
  font-size: 11px;
}
.workspace-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
  max-width: 260px;
}
.workspace-actions .btn-secondary {
  min-height: 34px;
  padding: 0 10px;
  font-size: 12px;
}

.channel-health-result {
  display: grid;
  gap: 12px;
  margin-top: 12px;
}
.channel-health-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(26, 26, 26, .42);
  padding: 12px;
}
.channel-health-head strong,
.channel-health-head span {
  display: block;
}
.channel-health-head > div {
  min-width: 0;
}
.channel-health-head > div > strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 15px;
}
.channel-health-head > div > span {
  margin-top: 4px;
  overflow-wrap: anywhere;
  color: var(--muted);
  font-size: 12px;
}
.channel-metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}
.channel-metric,
.channel-verdict,
.channel-video-row {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(26, 26, 26, .42);
  padding: 11px;
}
.channel-metric {
  min-height: 76px;
}
.channel-metric span,
.channel-video-row span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}
.channel-metric strong {
  display: block;
  margin-top: 7px;
  overflow-wrap: anywhere;
  color: var(--text);
  font-size: 16px;
}
.channel-verdict strong {
  display: block;
  margin-bottom: 6px;
}
.channel-verdict p {
  margin: 0 0 7px;
  color: var(--muted);
  font-size: 13px;
}
.channel-verdict p:last-child {
  margin-bottom: 0;
}
.channel-video-list {
  display: grid;
  gap: 8px;
}
.channel-video-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}
.channel-video-row strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
}
.channel-video-row span {
  margin-top: 5px;
}
.channel-video-row .btn-secondary {
  width: auto;
  min-height: 32px;
  padding: 0 10px;
  font-size: 12px;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
}
.modal[hidden] { display: none; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, .58); }
.modal-card {
  position: relative;
  width: min(620px, calc(100vw - 36px));
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #232323;
  padding: 18px;
  box-shadow: 0 30px 100px -40px rgba(0, 0, 0, .9);
}
.modal-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}
.modal-head strong, .modal-head span { display: block; }
.modal-head span { margin-top: 4px; color: var(--muted); font-size: 13px; }
.info-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 0 0 14px; }
.license-info-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.info-grid div { border: 1px solid var(--border); border-radius: 8px; background: rgba(26, 26, 26, .42); padding: 10px; }
dt { color: var(--muted); font-size: 11px; }
dd { margin: 5px 0 0; overflow-wrap: anywhere; font-size: 13px; }
.update-box { display: grid; gap: 7px; margin-bottom: 14px; }
.update-box strong { color: var(--warn); }
.update-box span { color: var(--muted); font-size: 12px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; }
.modal-actions .btn-primary,
.modal-actions .btn-secondary { width: auto; margin-top: 0; }

html[data-theme="apple-glass-pastel"] {
  --bg: #f6f7fb;
  --bg2: #eef0f7;
  --surface: rgba(255, 255, 255, .65);
  --surface2: rgba(255, 255, 255, .78);
  --border: #e5e7eb;
  --text: #111827;
  --muted: #6b7280;
  --subtle: #9ca3af;
  --brand: #2563eb;
  --brand2: #1e3a8a;
  --ok: #198754;
  --warn: #d97706;
  --danger: #dc3545;
  color-scheme: light;
}
html[data-theme="apple-glass-pastel"] body {
  background:
    radial-gradient(60% 50% at 85% 5%, rgba(255, 200, 220, .55), transparent 60%),
    radial-gradient(55% 50% at 5% 25%, rgba(180, 215, 255, .55), transparent 65%),
    radial-gradient(55% 50% at 95% 95%, rgba(200, 230, 255, .5), transparent 60%),
    radial-gradient(70% 60% at 0% 100%, rgba(230, 215, 255, .5), transparent 65%),
    linear-gradient(180deg, #f6f7fb 0%, #eef0f7 100%);
  background-attachment: fixed;
  color: var(--text);
  color-scheme: light;
}
html[data-theme="apple-glass-pastel"] .loading {
  background:
    radial-gradient(60% 50% at 85% 5%, rgba(255, 200, 220, .5), transparent 60%),
    radial-gradient(55% 50% at 5% 25%, rgba(180, 215, 255, .5), transparent 65%),
    linear-gradient(180deg, rgba(246, 247, 251, .96), rgba(238, 240, 247, .96));
}
html[data-theme="apple-glass-pastel"] .loading-card,
html[data-theme="apple-glass-pastel"] .sidebar,
html[data-theme="apple-glass-pastel"] .panel,
html[data-theme="apple-glass-pastel"] .metric,
html[data-theme="apple-glass-pastel"] .version-pill,
html[data-theme="apple-glass-pastel"] .modal-card,
html[data-theme="apple-glass-pastel"] .metric-grid div,
html[data-theme="apple-glass-pastel"] .update-box,
html[data-theme="apple-glass-pastel"] .icon-card,
html[data-theme="apple-glass-pastel"] .plan-card,
html[data-theme="apple-glass-pastel"] .service-card,
html[data-theme="apple-glass-pastel"] .announcement-row,
html[data-theme="apple-glass-pastel"] .help-steps div,
html[data-theme="apple-glass-pastel"] .persisted-log-group,
html[data-theme="apple-glass-pastel"] .session-row,
html[data-theme="apple-glass-pastel"] .file-row,
html[data-theme="apple-glass-pastel"] .media-row,
html[data-theme="apple-glass-pastel"] .media-session-card,
html[data-theme="apple-glass-pastel"] .asr-job-row,
html[data-theme="apple-glass-pastel"] .asr-job-command,
html[data-theme="apple-glass-pastel"] .asr-event-lines,
html[data-theme="apple-glass-pastel"] .frame-thumb,
html[data-theme="apple-glass-pastel"] .workspace-project-card,
html[data-theme="apple-glass-pastel"] .workspace-card,
html[data-theme="apple-glass-pastel"] .channel-health-head,
html[data-theme="apple-glass-pastel"] .channel-metric,
html[data-theme="apple-glass-pastel"] .channel-verdict,
html[data-theme="apple-glass-pastel"] .channel-video-row,
html[data-theme="apple-glass-pastel"] .topic-tab,
html[data-theme="apple-glass-pastel"] .info-grid div {
  border-color: rgba(255, 255, 255, .55);
  background: rgba(255, 255, 255, .65);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  box-shadow: 0 2px 8px rgba(0, 0, 0, .04);
}
html[data-theme="apple-glass-pastel"] .panel,
html[data-theme="apple-glass-pastel"] .modal-card {
  border-radius: 24px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, .06);
}
html[data-theme="apple-glass-pastel"] .sidebar {
  border-right-color: rgba(229, 231, 235, .82);
}
html[data-theme="apple-glass-pastel"] h1 {
  background: linear-gradient(to right, #0f172a 0%, #2563eb 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}
html[data-theme="apple-glass-pastel"] .brand-mark,
html[data-theme="apple-glass-pastel"] .app-icon,
html[data-theme="apple-glass-pastel"] .sidebar-brand span {
  background: linear-gradient(135deg, #2563eb, #1e3a8a);
  box-shadow: 0 4px 16px rgba(37, 99, 235, .12), 0 1px 2px rgba(0, 0, 0, .04);
}
html[data-theme="apple-glass-pastel"] .panel-title {
  color: #0f172a;
}
html[data-theme="apple-glass-pastel"] .panel-title > span,
html[data-theme="apple-glass-pastel"] .log-line b,
html[data-theme="apple-glass-pastel"] .icon-card b,
html[data-theme="apple-glass-pastel"] .service-card b,
html[data-theme="apple-glass-pastel"] .help-steps b,
html[data-theme="apple-glass-pastel"] .version-pill,
html[data-theme="apple-glass-pastel"] .btn-secondary {
  color: var(--brand);
}
html[data-theme="apple-glass-pastel"] input,
html[data-theme="apple-glass-pastel"] select,
html[data-theme="apple-glass-pastel"] textarea,
html[data-theme="apple-glass-pastel"] .log {
  border-color: rgba(229, 231, 235, .9);
  background: rgba(255, 255, 255, .72);
  color: var(--text);
}
html[data-theme="apple-glass-pastel"] input:focus,
html[data-theme="apple-glass-pastel"] select:focus,
html[data-theme="apple-glass-pastel"] textarea:focus {
  border-color: rgba(37, 99, 235, .58);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .12);
}
html[data-theme="apple-glass-pastel"] .btn-primary {
  border-color: rgba(37, 99, 235, .7);
  background: #2563eb;
  box-shadow: 0 4px 16px rgba(37, 99, 235, .12), 0 1px 2px rgba(0, 0, 0, .04);
}
html[data-theme="apple-glass-pastel"] .btn-secondary,
html[data-theme="apple-glass-pastel"] .nav:hover,
html[data-theme="apple-glass-pastel"] .nav.active,
html[data-theme="apple-glass-pastel"] .icon-btn:hover,
html[data-theme="apple-glass-pastel"] .topic-tab:hover,
html[data-theme="apple-glass-pastel"] .topic-tab.active,
html[data-theme="apple-glass-pastel"] .pill {
  border-color: rgba(37, 99, 235, .22);
  background: #eff6ff;
}
html[data-theme="apple-glass-pastel"] .icon-card b,
html[data-theme="apple-glass-pastel"] .service-card b,
html[data-theme="apple-glass-pastel"] .help-steps b,
html[data-theme="apple-glass-pastel"] .workspace-thumb,
html[data-theme="apple-glass-pastel"] .topic-tab b,
html[data-theme="apple-glass-pastel"] .pill {
  background: #dbeafe;
}
html[data-theme="apple-glass-pastel"] .workspace-thumb {
  border-color: rgba(37, 99, 235, .18);
  color: var(--brand);
}
html[data-theme="apple-glass-pastel"] .notice {
  border-color: rgba(245, 158, 11, .24);
  background: #fff7ed;
  color: #92400e;
}
html[data-theme="apple-glass-pastel"] .notice.ok {
  border-color: rgba(34, 197, 94, .24);
  background: #ecfdf5;
  color: #047857;
}
html[data-theme="apple-glass-pastel"] .notice.warn {
  border-color: rgba(245, 158, 11, .24);
  background: #fff7ed;
  color: #92400e;
}
html[data-theme="apple-glass-pastel"] .progress {
  background: #e5e7eb;
}
html[data-theme="apple-glass-pastel"] .progress span {
  background: #2563eb;
}
html[data-theme="apple-glass-pastel"] .qr-box {
  border-color: rgba(37, 99, 235, .24);
  background:
    linear-gradient(90deg, rgba(37,99,235,.1) 12px, transparent 1px) 0 0 / 22px 22px,
    linear-gradient(rgba(37,99,235,.08) 12px, transparent 1px) 0 0 / 22px 22px,
    rgba(255, 255, 255, .62);
  color: var(--brand);
}
html[data-theme="apple-glass-pastel"] .modal-backdrop {
  background: rgba(15, 23, 42, .28);
  backdrop-filter: blur(10px);
}

@media (max-width: 980px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: static; width: 100%; height: auto; flex-direction: row; justify-content: center; border-right: 0; border-bottom: 1px solid var(--border); }
  .topbar, .row { flex-direction: column; align-items: stretch; }
  .grid.two, .metric-grid, .quick-actions, .info-grid { grid-template-columns: 1fr; }
  .service-card { grid-template-columns: 1fr; }
  .channel-metric-grid { grid-template-columns: 1fr 1fr; }
  .workspace-project-toolbar,
  .workspace-toolbar { grid-template-columns: 1fr; }
  .workspace-project-card,
  .workspace-card { grid-template-columns: 1fr; align-items: stretch; }
  .workspace-thumb { width: min(280px, 100%); }
  .workspace-project-actions,
  .workspace-actions { justify-content: flex-start; max-width: none; }
  .workspace-pagination { justify-content: flex-start; }
  .file-row { grid-template-columns: minmax(0, 1fr) auto; }
  .channel-video-row { grid-template-columns: 1fr; }
  .asr-summary { grid-template-columns: 1fr; }
  .asr-job-head { grid-template-columns: 1fr; }
  .asr-job-actions { justify-content: flex-start; }
  .file-drive-btn { justify-self: start; }
  .novnc-panel {
    height: calc(100vh - 190px);
    min-height: 520px;
  }
  .novnc-frame { min-height: 460px; }
}

@media (min-width: 981px) and (max-width: 1160px) {
  .topbar { flex-direction: column; align-items: stretch; }
  .statusbar { justify-content: flex-start; }
  #dashboard > .grid.two { grid-template-columns: 1fr; }
  .workspace-toolbar { grid-template-columns: minmax(220px, 1fr) repeat(2, minmax(140px, .7fr)); }
}
