/* Ask Theo Shell v0.1.24 - Noted by Theo - 2026-06-05
   Mobile-first research workspace styles with keyboard-safe Ask controls, visible version badges, polished source tier labels, local Journal saves, and a desktop inspector. */

:root {
  color-scheme: light;
  --ink: #1d2530;
  --body: #374151;
  --muted: #6b7280;
  --warm-muted: #8a6f4d;
  --line: #e7e2d6;
  --soft-line: rgba(222, 214, 200, 0.82);
  --surface: #f7f4ee;
  --panel: #fffdf8;
  --panel-2: #f2efe7;
  --primary: #0f766e;
  --primary-strong: #0b5f59;
  --primary-tint: #e7f5f2;
  --teal: #0f766e;
  --blue: #2563eb;
  --amber: #b45309;
  --red: #7f1d1d;
  --review: #047857;
  --pending: #64748b;
  --shadow: 0 8px 24px rgba(40, 33, 20, 0.08);
  --shadow-soft: 0 1px 2px rgba(40, 33, 20, 0.06);
  --shadow-lift: 0 16px 40px rgba(40, 33, 20, 0.12);
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  min-height: 100%;
}

body {
  margin: 0;
  background: var(--surface);
  color: var(--ink);
  overflow: hidden;
  overflow-x: hidden;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

button,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.shell {
  display: grid;
  height: 100svh;
  min-height: 100svh;
  overflow: hidden;
}

.rail,
.inspector {
  display: none;
}

.chat {
  position: relative;
  height: 100svh;
  min-height: 100svh;
  background: var(--surface);
  overflow: hidden;
}

.view-panel {
  height: 100%;
  min-height: 0;
}

.view-panel[hidden] {
  display: none !important;
}

.ask-view {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  height: 100%;
  min-height: 0;
  padding-bottom: 62px;
}

.app-page {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 14px;
  padding: 14px 14px 76px;
  overflow-y: auto;
}

.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--soft-line);
  border-radius: 10px;
  background: var(--panel);
  box-shadow: var(--shadow-soft);
}

.page-header h2 {
  margin: 2px 0 4px;
  font-size: clamp(1.35rem, 4vw, 1.95rem);
  line-height: 1.08;
}

.page-header span,
.empty-state p,
.summary-tile p,
.settings-row p,
.note-card p {
  color: var(--muted);
  line-height: 1.45;
}

.page-grid,
.library-grid,
.tool-hub-grid,
.settings-list {
  display: grid;
  gap: 12px;
  align-content: start;
}

.empty-state,
.summary-tile,
.note-card,
.settings-row {
  display: grid;
  gap: 10px;
  padding: 16px;
  border: 1px solid var(--soft-line);
  border-radius: 10px;
  background: var(--panel);
  box-shadow: var(--shadow-soft);
  transition:
    border-color 0.15s ease,
    box-shadow 0.15s ease,
    transform 0.15s ease;
}

.empty-state strong,
.summary-tile strong,
.note-card h3,
.settings-row strong {
  margin: 0;
  font-size: 1.02rem;
  line-height: 1.2;
}

.summary-tile:hover,
.note-card:hover,
.settings-row:hover {
  border-color: rgba(15, 118, 110, 0.28);
  box-shadow: var(--shadow);
  transform: translateY(-1px);
}

.note-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.compact {
  width: auto;
  min-height: 38px;
  padding: 8px 10px;
}

.mobile-tabbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 8;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 4px;
  padding: 7px 8px calc(7px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--soft-line);
  background: rgba(255, 253, 248, 0.98);
  box-shadow: 0 -10px 28px rgba(40, 33, 20, 0.08);
}

.tab-button {
  min-width: 0;
  min-height: 44px;
  padding: 6px 4px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 750;
  overflow-wrap: anywhere;
}

.tab-button.active,
.nav-item.active {
  border-color: rgba(15, 118, 110, 0.25);
  background: var(--primary-tint);
  color: var(--primary-strong);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 50px;
  padding: 7px 10px;
  border-bottom: 1px solid var(--soft-line);
  background: rgba(255, 253, 248, 0.96);
  position: sticky;
  top: 0;
  z-index: 2;
}

.chat-title-row,
.brand-lockup {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

.chat-title-row {
  justify-content: flex-start;
  text-align: left;
}

.top-avatar {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #17202a;
  color: #fff;
  font-weight: 800;
  font-size: 0.86rem;
}

.chat-title-copy {
  display: grid;
  gap: 2px;
}

.chat-title-copy span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1;
}

.top-status {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  min-width: 0;
}

.top-status span {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 7px;
  border: 1px solid rgba(15, 118, 110, 0.16);
  border-radius: 999px;
  background: var(--primary-tint);
  color: var(--primary-strong);
  font-size: 0.68rem;
  font-weight: 750;
  line-height: 1.1;
  white-space: nowrap;
}

.top-status .version-chip,
.version-value {
  border-color: rgba(138, 111, 77, 0.22);
  background: #f6efe2;
  color: var(--warm-muted);
}

.language-switch {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
  flex: 0 0 auto;
}

.lang-toggle {
  min-width: 32px;
  min-height: 26px;
  padding: 4px 7px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 750;
  line-height: 1;
}

.lang-toggle.active {
  background: var(--primary);
  color: #fff;
}

.presence-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: #16a34a;
  box-shadow: 0 0 0 5px rgba(22, 163, 74, 0.12);
  flex: 0 0 auto;
}

.eyebrow,
.speaker,
.label {
  margin: 0;
  color: var(--muted);
  font-size: 0.75rem;
  line-height: 1.25;
}

h1,
h2 {
  margin: 0;
  font-size: 1.02rem;
  line-height: 1.15;
  letter-spacing: 0;
}

.provider-toggle,
.model-toggle,
.mode-strip {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
}

.command-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

.provider-toggle,
.model-toggle {
  flex: 0 0 auto;
  max-width: 100%;
}

.voice-pill {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  max-width: 100%;
  padding: 6px 9px;
  border: 1px solid rgba(15, 118, 110, 0.25);
  border-radius: 999px;
  background: var(--primary-tint);
  color: var(--primary-strong);
  font-size: 0.76rem;
  font-weight: 750;
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.mode-strip {
  padding-bottom: 2px;
}

.toggle,
.model-chip,
.chip,
.command-button,
.nav-item,
.starter-grid button,
.card-action,
.voice-button,
.send-button,
.icon-button {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--ink);
  min-height: 38px;
  transition:
    background 0.15s ease,
    border-color 0.15s ease,
    box-shadow 0.15s ease,
    transform 0.15s ease;
}

.toggle,
.model-chip,
.chip {
  padding: 8px 11px;
  white-space: nowrap;
  font-size: 0.88rem;
}

.command-button {
  display: grid;
  gap: 3px;
  min-height: 54px;
  padding: 8px 9px;
  text-align: left;
}

.command-button span,
.command-button small {
  min-width: 0;
  overflow-wrap: anywhere;
}

.command-button span {
  color: var(--ink);
  font-size: 0.86rem;
  font-weight: 750;
  line-height: 1.1;
}

.command-button small {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.1;
}

.command-button.primary {
  border-color: rgba(15, 118, 110, 0.32);
  background: var(--primary-tint);
}

.toggle.active,
.model-chip.active,
.chip.active,
.nav-item.active {
  border-color: rgba(15, 118, 110, 0.35);
  background: var(--primary-tint);
  color: var(--primary-strong);
}

.thread {
  min-height: 0;
  padding: 12px 10px;
  overflow-y: auto;
  background: var(--surface);
}

.message {
  display: flex;
  gap: 10px;
  margin: 0 0 14px;
}

.thread > .message.theo:first-child .avatar {
  display: none;
}

@supports (height: 100dvh) {
  .shell,
  .chat {
    height: 100dvh;
    min-height: 100dvh;
  }
}

.message.user {
  justify-content: flex-end;
}

.avatar,
.mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: var(--ink);
  color: #fff;
  font-weight: 750;
  flex: 0 0 auto;
}

.bubble {
  max-width: min(720px, 100%);
  padding: 14px 15px;
  border: 1px solid var(--soft-line);
  border-radius: 14px 14px 14px 6px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.message.user .bubble {
  border-radius: 14px 14px 6px;
  background: #dff4f1;
  border-color: rgba(15, 118, 110, 0.18);
}

.bubble p {
  margin: 7px 0 0;
  line-height: 1.44;
}

.bubble p:first-child {
  margin-top: 0;
}

.message-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
}

.source-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 10px;
}

.source-chip {
  display: grid;
  gap: 2px;
  min-height: 42px;
  max-width: 100%;
  padding: 7px 9px;
  border: 1px solid rgba(37, 99, 235, 0.2);
  border-radius: 8px;
  background: #eff6ff;
  color: var(--ink);
  text-align: left;
  box-shadow: var(--shadow-soft);
}

.source-chip span,
.source-chip strong {
  min-width: 0;
  overflow-wrap: anywhere;
  line-height: 1.1;
}

.source-chip span {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 700;
}

.source-chip strong {
  font-size: 0.78rem;
}

.source-chip.community {
  border-color: rgba(180, 83, 9, 0.28);
  background: #fff8ed;
  color: #78350f;
}

.source-chip.restricted,
.source-chip.review,
.source-chip.stale,
.source-chip.missing {
  border-color: rgba(127, 29, 29, 0.22);
  background: #fff6f5;
  color: var(--red);
}

.source-chip.coa {
  border-color: rgba(15, 118, 110, 0.24);
  background: var(--primary-tint);
}

.voice-button {
  min-height: 34px;
  padding: 7px 10px;
  background: var(--panel-2);
  color: var(--primary-strong);
  font-size: 0.84rem;
  font-weight: 750;
}

.voice-button[disabled] {
  cursor: progress;
  opacity: 0.72;
}

.notebook-actions {
  margin-top: 8px;
}

.save-button {
  min-height: 34px;
  padding: 7px 10px;
  border: 1px solid rgba(15, 118, 110, 0.22);
  border-radius: 8px;
  background: var(--primary-tint);
  color: var(--primary-strong);
  font-size: 0.84rem;
  font-weight: 750;
}

.save-button.secondary {
  border-color: rgba(100, 116, 139, 0.18);
  background: var(--panel-2);
  color: #475569;
}

.starter-grid,
.card-grid,
.notice-grid,
.followup-grid,
.followups,
.source-badges {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.starter-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.source-badges {
  grid-template-columns: 1fr;
  gap: 6px;
}

.source-badge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  max-width: 100%;
  min-height: 25px;
  padding: 4px 8px;
  border: 1px solid rgba(37, 99, 235, 0.16);
  border-radius: 999px;
  background: #f1f6ff;
  color: #1d4ed8;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.source-badge.status {
  border-color: rgba(15, 118, 110, 0.18);
  background: #eefaf7;
  color: #0b5f59;
}

.source-badge.caution {
  border-color: rgba(180, 83, 9, 0.18);
  background: #fff8eb;
  color: #92400e;
}

.starter-grid button,
.card-action {
  padding: 8px 9px;
  text-align: left;
  font-size: 0.88rem;
  font-weight: 800;
  line-height: 1.15;
}

.card-grid {
  grid-template-columns: 1fr;
}

.notice-grid {
  grid-template-columns: 1fr;
}

.followup-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.followup-grid span {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.followup-grid button {
  min-height: 34px;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--ink);
  text-align: left;
  font-size: 0.84rem;
}

.info-card {
  border: 1px solid var(--line);
  border-left: 4px solid var(--blue);
  border-radius: 10px;
  padding: 13px;
  background: var(--panel);
  box-shadow: var(--shadow-soft);
}

.info-card.t9 {
  border-left-color: var(--amber);
  background: #fff8ed;
}

.info-card.gate,
.info-card.stale {
  border-left-color: var(--amber);
  background: #fff8eb;
}

.info-card.scope,
.info-card.missing,
.info-card.withheld {
  border-left-color: var(--red);
  background: #fff6f4;
}

.info-card.coa {
  border-left-color: var(--teal);
  background: #f0fbf8;
}

.info-card.tool {
  border-left-color: var(--blue);
  background: #f0f7ff;
}

.card-kicker {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 0.75rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 7px;
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.1);
  color: #1d4ed8;
  font-weight: 700;
  line-height: 1.2;
  max-width: 100%;
  overflow-wrap: anywhere;
  text-align: right;
  white-space: normal;
}

.info-card.t9 .badge {
  background: rgba(180, 83, 9, 0.11);
  color: #92400e;
}

.info-card.gate .badge,
.info-card.stale .badge {
  background: rgba(180, 83, 9, 0.11);
  color: #92400e;
}

.info-card.scope .badge,
.info-card.missing .badge,
.info-card.withheld .badge {
  background: rgba(180, 35, 24, 0.1);
  color: var(--red);
}

.info-card h3 {
  margin: 0 0 6px;
  font-size: 1rem;
  line-height: 1.25;
  letter-spacing: 0;
}

.info-card p {
  margin: 0;
  color: var(--body);
  font-size: 0.92rem;
  line-height: 1.45;
}

.reference-drawer {
  margin-top: 10px;
  width: fit-content;
  max-width: 100%;
}

.reference-drawer summary {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 32px;
  max-width: 100%;
  padding: 6px 9px 6px 6px;
  border: 1px solid rgba(34, 158, 217, 0.22);
  border-radius: 999px;
  background: var(--primary-tint);
  color: var(--primary-strong);
  font-size: 0.78rem;
  font-weight: 750;
  line-height: 1.1;
  list-style: none;
  cursor: pointer;
  user-select: none;
}

.reference-drawer summary::-webkit-details-marker {
  display: none;
}

.reference-drawer summary:hover {
  border-color: rgba(15, 118, 110, 0.35);
  background: #dff2ee;
}

.reference-icon {
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 900;
}

.reference-count {
  display: grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--panel);
  color: var(--primary-strong);
  box-shadow: inset 0 0 0 1px rgba(15, 118, 110, 0.18);
}

.reference-panel {
  margin-top: 8px;
  width: min(620px, calc(100vw - 72px));
}

.reference-note {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.35;
}

.reference-list {
  margin-top: 0;
}

.reference-list .info-card {
  border-left-width: 1px;
  padding: 10px;
  background: rgba(255, 253, 248, 0.9);
  box-shadow: var(--shadow-soft);
}

.reference-list .info-card h3 {
  font-size: 0.88rem;
}

.reference-list .info-card p {
  color: var(--muted);
  font-size: 0.82rem;
}

.composer {
  position: relative;
  z-index: 3;
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) auto;
  gap: 7px;
  align-items: end;
  padding: 8px 10px max(8px, env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  background: rgba(255, 253, 248, 0.94);
  box-shadow: 0 -12px 32px rgba(40, 33, 20, 0.1);
  backdrop-filter: blur(14px);
}

.tool-sheet {
  position: absolute;
  right: 8px;
  bottom: calc(62px + env(safe-area-inset-bottom));
  left: 10px;
  z-index: 4;
  display: grid;
  gap: 11px;
  max-height: min(430px, calc(100dvh - 104px));
  padding: 12px;
  overflow-y: auto;
  border: 1px solid var(--soft-line);
  border-radius: 12px;
  background: rgba(255, 253, 248, 0.98);
  box-shadow: var(--shadow-lift);
}

.tool-sheet[hidden] {
  display: none;
}

.tool-sheet-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.tool-sheet-header strong {
  font-size: 0.94rem;
}

.tool-sheet-header p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 700;
}

.sheet-close {
  min-height: 30px;
  padding: 5px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel-2);
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.tool-group {
  display: grid;
  gap: 7px;
  padding-top: 2px;
}

.tool-label {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
}

.tool-advanced {
  display: grid;
  gap: 10px;
  border-top: 1px solid var(--line);
  padding-top: 4px;
}

.tool-advanced summary {
  cursor: pointer;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 750;
}

.icon-button {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border-color: rgba(15, 118, 110, 0.28);
  border-radius: 50%;
  background: var(--primary-tint);
  color: var(--primary-strong);
}

.icon-bars {
  display: grid;
  gap: 4px;
  width: 16px;
}

.icon-bars span {
  display: block;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
}

textarea {
  width: 100%;
  max-height: 96px;
  resize: none;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 9px 11px;
  line-height: 1.4;
  background: var(--panel);
}

.send-button {
  min-width: 54px;
  padding: 0 12px;
  border-color: var(--primary);
  border-radius: 14px;
  background: var(--primary);
  color: #fff;
  font-weight: 750;
}

button:hover {
  border-color: rgba(15, 118, 110, 0.28);
  box-shadow: var(--shadow-soft);
}

.send-button:hover,
.lang-toggle.active:hover {
  background: var(--primary-strong);
  border-color: var(--primary-strong);
}

button:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgba(37, 99, 235, 0.25);
  outline-offset: 2px;
}

.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;
}

@media (min-width: 860px) {
  .shell {
    grid-template-columns: 260px minmax(0, 1fr);
  }

  .rail {
    display: flex;
    flex-direction: column;
    gap: 22px;
    padding: 18px;
    border-right: 1px solid var(--line);
    background: var(--panel-2);
  }

  .chat {
    min-height: 100dvh;
  }

  .ask-view {
    padding-bottom: 0;
  }

  .app-page {
    padding: 22px 26px;
  }

  .mobile-tabbar {
    display: none;
  }

  .library-grid,
  .tool-hub-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .topbar {
    min-height: 56px;
    padding: 10px 20px;
  }

  .top-avatar {
    width: 34px;
    height: 34px;
    font-size: 0.95rem;
  }

  .nav-list {
    display: grid;
    gap: 8px;
  }

  .nav-item {
    padding: 10px 12px;
    text-align: left;
    position: relative;
  }

  .nav-item.active {
    box-shadow: inset 3px 0 0 var(--primary);
  }

  .status-panel {
    display: grid;
    gap: 12px;
    padding: 13px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--panel);
    box-shadow: var(--shadow-soft);
  }

  .thread {
    padding: 22px 26px;
  }

  .thread > .message.theo:first-child .avatar {
    display: grid;
  }

  .composer {
    padding: 11px 24px;
  }

  .tool-sheet {
    left: auto;
    right: 24px;
    bottom: 78px;
    width: min(720px, calc(100% - 48px));
    max-width: 720px;
  }

  .card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .command-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .source-badges {
    grid-template-columns: repeat(3, minmax(0, max-content));
  }
}

@media (max-width: 620px) {
  .top-status span:last-child {
    display: none;
  }

  .provider-toggle {
    width: 100%;
    padding-bottom: 2px;
  }

  .model-toggle {
    width: 100%;
    padding-bottom: 2px;
  }

  .voice-pill {
    white-space: nowrap;
  }
}

@media (min-width: 1180px) {
  .shell {
    grid-template-columns: 260px minmax(0, 1fr) 310px;
  }

  .inspector {
    display: flex;
    flex-direction: column;
    gap: 14px;
    min-height: 100dvh;
    padding: 18px;
    border-left: 1px solid var(--line);
    background: var(--panel-2);
    overflow-y: auto;
  }

  .inspector-section {
    display: grid;
    gap: 10px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--panel);
    box-shadow: var(--shadow-soft);
  }

  .inspector-heading {
    display: grid;
    gap: 3px;
  }

  .inspector-heading strong {
    font-size: 0.96rem;
    line-height: 1.2;
  }

  .tier-list {
    display: grid;
    gap: 7px;
  }

  .tier-list span {
    padding: 7px 8px;
    border: 1px solid rgba(229, 231, 235, 0.9);
    border-radius: 8px;
    background: var(--panel-2);
    color: var(--body);
    font-size: 0.8rem;
    font-weight: 700;
    line-height: 1.2;
  }

  .source-inspector-detail {
    display: grid;
    gap: 9px;
  }

  .source-detail-card {
    display: grid;
    gap: 9px;
    padding: 10px;
    border: 1px solid rgba(37, 99, 235, 0.16);
    border-radius: 10px;
    background: #eff6ff;
    box-shadow: var(--shadow-soft);
  }

  .source-detail-card h3 {
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.2;
  }

  .source-detail-card dl {
    display: grid;
    gap: 6px;
    margin: 0;
  }

  .source-detail-card dl div {
    display: grid;
    grid-template-columns: 76px minmax(0, 1fr);
    gap: 6px;
  }

  .source-detail-card dt,
  .source-detail-card dd {
    margin: 0;
    min-width: 0;
    overflow-wrap: anywhere;
    font-size: 0.76rem;
    line-height: 1.25;
  }

  .source-detail-card dt {
    color: var(--muted);
    font-weight: 750;
  }

  .source-detail-card dd {
    color: var(--ink);
    font-weight: 700;
  }

  .source-label-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
  }

  .source-label-list span {
    padding: 5px 7px;
    border: 1px solid rgba(229, 231, 235, 0.9);
    border-radius: 999px;
    background: var(--panel);
    color: var(--muted);
    font-size: 0.68rem;
    font-weight: 700;
  }

  .inspector-section p {
    margin: 0;
    color: var(--muted);
    font-size: 0.84rem;
    line-height: 1.42;
  }

  .notebook-count {
    color: var(--teal);
    font-size: 0.76rem;
    font-weight: 750;
  }

  .notebook-list {
    display: grid;
    gap: 8px;
  }

  .notebook-item {
    display: grid;
    gap: 3px;
    min-height: 44px;
    padding: 8px;
    border: 1px solid rgba(229, 231, 235, 0.95);
    border-radius: 8px;
    background: var(--panel-2);
    color: var(--ink);
    text-align: left;
  }

  .notebook-item span,
  .notebook-item small {
    min-width: 0;
    overflow-wrap: anywhere;
  }

  .notebook-item span {
    font-size: 0.82rem;
    font-weight: 750;
    line-height: 1.2;
  }

  .notebook-item small {
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 700;
  }

  .inspector-action {
    min-height: 36px;
    padding: 8px 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel-2);
    color: var(--ink);
    text-align: left;
    font-weight: 750;
  }
}
