:root {
  --bg: #f4f7fb;
  --panel: #ffffff;
  --panel-soft: #f8fafc;
  --text: #0f172a;
  --text-muted: #64748b;
  --line: #e2e8f0;
  --line-strong: #cbd5e1;

  --hp-blue: #0096d6;
  --hp-blue-dark: #0076a8;
  --navy-dark: #0b192c;
  --navy-sidebar: #0f1e36;
  --navy-card: #142847;

  --accent-cyan: #38bdf8;
  --accent-green: #10b981;
  --accent-amber: #f59e0b;
  --accent-red: #ef4444;

  --shadow-sm: 0 2px 8px rgba(15, 23, 42, 0.05);
  --shadow-md: 0 10px 25px -5px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 20px 40px -10px rgba(15, 23, 42, 0.12);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
}

body.dark {
  --bg: #0b1320;
  --panel: #111c2e;
  --panel-soft: #172439;
  --text: #f1f5f9;
  --text-muted: #94a3b8;
  --line: #1e2d42;
  --line-strong: #334155;
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 10px 25px -5px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 20px 40px -10px rgba(0, 0, 0, 0.4);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.5;
  overflow-x: hidden;
  transition: background-color 0.25s ease, color 0.25s ease;
}

button, input, select, textarea {
  font: inherit;
}

button {
  cursor: pointer;
  border: none;
  background: none;
}

/* App Shell Layout */
.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 280px minmax(500px, 1fr) 320px;
  transition: all 0.3s ease;
}

/* Sidebar */
.sidebar {
  background: var(--navy-sidebar);
  color: #f8fafc;
  padding: 24px 20px;
  display: flex;
  flex-direction: column;
  height: 100vh;
  position: sticky;
  top: 0;
  z-index: 40;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 22px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, #00a8ec, #006bb6);
  display: grid;
  place-items: center;
  color: white;
  box-shadow: 0 6px 18px rgba(0, 150, 214, 0.4);
}

.brand strong {
  display: block;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.brand span {
  display: block;
  color: var(--accent-cyan);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.new-chat {
  margin-top: 20px;
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.07);
  color: white;
  border-radius: var(--radius-md);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-weight: 700;
  font-size: 14px;
  transition: all 0.2s ease;
}

.new-chat:hover {
  background: rgba(0, 150, 214, 0.25);
  border-color: var(--hp-blue);
  transform: translateY(-1px);
}

.side-section {
  margin-top: 24px;
}

.side-label {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #94a3b8;
  margin-bottom: 10px;
}

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

.device {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  text-align: left;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  color: #cbd5e1;
  border: 1px solid transparent;
  transition: all 0.2s ease;
}

.device:hover {
  background: rgba(255, 255, 255, 0.06);
  color: white;
}

.device.active {
  background: linear-gradient(135deg, rgba(0, 150, 214, 0.22), rgba(0, 118, 168, 0.3));
  border-color: rgba(0, 150, 214, 0.5);
  color: white;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2);
}

.dev-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.08);
  display: grid;
  place-items: center;
  color: var(--accent-cyan);
  flex-shrink: 0;
}

.device.active .dev-icon {
  background: var(--hp-blue);
  color: white;
}

.device b {
  display: block;
  font-size: 13px;
  font-weight: 700;
}

.device small {
  display: block;
  font-size: 11px;
  color: #94a3b8;
  margin-top: 1px;
}

.model-select-wrap {
  position: relative;
}

.model-select {
  width: 100%;
  background: #172a46;
  color: #f1f5f9;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-size: 12px;
  font-weight: 600;
  outline: none;
  cursor: pointer;
}

.model-select:focus {
  border-color: var(--hp-blue);
}

.prompts-list {
  display: grid;
  gap: 6px;
}

.prompt-btn {
  width: 100%;
  text-align: left;
  background: transparent;
  color: #cbd5e1;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  line-height: 1.4;
  transition: all 0.15s ease;
}

.prompt-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: white;
}

.sidebar-footer {
  margin-top: auto;
  padding-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.kb-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: #e2e8f0;
}

.status-dot {
  width: 8px;
  height: 8px;
  background: var(--accent-green);
  border-radius: 50%;
  box-shadow: 0 0 10px var(--accent-green);
  animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.3); opacity: 0.7; }
}

.sidebar-footer small {
  display: block;
  color: #94a3b8;
  font-size: 11px;
  margin-top: 4px;
}

/* Main Panel */
.main-panel {
  padding: 28px 36px 160px;
  min-height: 100vh;
  position: relative;
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}

.topbar-title-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
}

.mobile-menu-btn, .mobile-case-toggle {
  display: none;
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text);
  place-items: center;
}

.eyebrow {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
  color: var(--hp-blue);
  margin-bottom: 4px;
}

h1 {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text);
}

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

.action-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 700;
  transition: all 0.2s ease;
}

.action-btn.primary {
  background: var(--hp-blue);
  color: white;
}

.action-btn.primary:hover {
  background: var(--hp-blue-dark);
}

.action-btn.secondary {
  background: var(--panel);
  border: 1px solid var(--line-strong);
  color: var(--text);
}

.action-btn.secondary:hover {
  background: var(--panel-soft);
  border-color: var(--hp-blue);
}

.action-btn.small {
  padding: 6px 10px;
  font-size: 11px;
}

.icon-btn {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-strong);
  background: var(--panel);
  color: var(--text);
  display: grid;
  place-items: center;
  transition: all 0.2s ease;
}

.icon-btn:hover {
  border-color: var(--hp-blue);
  color: var(--hp-blue);
}

/* Hero Card */
.hero-card {
  background: linear-gradient(135deg, var(--navy-dark) 0%, #0f2747 60%, #164070 100%);
  color: white;
  border-radius: var(--radius-lg);
  padding: 28px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--shadow-md);
  position: relative;
  overflow: hidden;
  margin-bottom: 20px;
}

.hero-copy {
  max-width: 600px;
  z-index: 2;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.badge-pulse {
  width: 6px;
  height: 6px;
  background: var(--accent-cyan);
  border-radius: 50%;
}

.hero-copy h2 {
  font-size: 23px;
  font-weight: 800;
  margin: 12px 0 8px;
  line-height: 1.3;
}

.hero-copy p {
  color: #cbd5e1;
  font-size: 13px;
  line-height: 1.5;
}

.capabilities {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 16px;
  font-size: 11px;
  font-weight: 600;
  color: var(--accent-cyan);
}

.capabilities span {
  display: flex;
  align-items: center;
  gap: 5px;
}

.device-visual {
  width: 140px;
  height: 120px;
  position: relative;
  display: grid;
  place-items: center;
}

.orb {
  width: 76px;
  height: 76px;
  border-radius: 24px;
  background: linear-gradient(135deg, #ffffff, #dbeafe);
  display: grid;
  place-items: center;
  font-size: 36px;
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.3);
  z-index: 2;
}

.signal {
  position: absolute;
  border: 1px solid rgba(56, 189, 248, 0.25);
  border-radius: 50%;
}
.s1 { width: 100px; height: 100px; }
.s2 { width: 125px; height: 125px; }
.s3 { width: 150px; height: 150px; }

/* Quick Cards Grid */
.quick-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}

.quick-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  text-align: left;
  color: var(--text);
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
}

.quick-card:hover {
  border-color: var(--hp-blue);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.quick-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: rgba(0, 150, 214, 0.1);
  color: var(--hp-blue);
  display: grid;
  place-items: center;
  font-size: 18px;
  flex-shrink: 0;
}

.quick-card div {
  flex: 1;
}

.quick-card b {
  display: block;
  font-size: 13px;
  font-weight: 700;
}

.quick-card small {
  display: block;
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 3px;
}

.quick-arrow {
  color: var(--text-muted);
  font-weight: bold;
}

/* Chat Messages Area */
.chat {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.message {
  display: flex;
  gap: 12px;
  max-width: 85%;
}

.user-message {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.message .avatar {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 12px;
  flex-shrink: 0;
}

.assistant-message .avatar {
  background: linear-gradient(135deg, var(--hp-blue), var(--hp-blue-dark));
  color: white;
  box-shadow: 0 4px 12px rgba(0, 150, 214, 0.3);
}

.user-message .avatar {
  background: var(--navy-dark);
  color: white;
}

.message-body {
  background: var(--panel);
  border: 1px solid var(--line);
  padding: 16px 20px;
  border-radius: 4px 18px 18px 18px;
  box-shadow: var(--shadow-sm);
  font-size: 14px;
  line-height: 1.6;
  color: var(--text);
  word-break: break-word;
}

.user-message .message-body {
  background: var(--navy-card);
  color: #f8fafc;
  border-color: rgba(255, 255, 255, 0.1);
  border-radius: 18px 4px 18px 18px;
}

.message-body h4 {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--text);
}

.user-message .message-body h4 {
  color: white;
}

/* Step-by-step interactive checklist inside chat */
.checklist-card {
  margin: 12px 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--panel-soft);
  padding: 12px 14px;
}

.checklist-title {
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--hp-blue);
  margin-bottom: 10px;
}

.checklist-items {
  display: grid;
  gap: 8px;
}

.checklist-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 13px;
  cursor: pointer;
  user-select: none;
  padding: 6px 8px;
  border-radius: var(--radius-sm);
  transition: background 0.15s ease;
}

.checklist-item:hover {
  background: rgba(0, 150, 214, 0.08);
}

.checklist-item input[type="checkbox"] {
  margin-top: 3px;
  accent-color: var(--hp-blue);
  width: 16px;
  height: 16px;
  cursor: pointer;
}

.checklist-item.done span {
  text-decoration: line-through;
  color: var(--text-muted);
}

/* Safety Warning inside Chat */
.chat-safety-banner {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid var(--accent-red);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  margin: 12px 0;
  color: #991b1b;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

body.dark .chat-safety-banner {
  color: #fca5a5;
  background: rgba(239, 68, 68, 0.15);
}

.chat-safety-banner svg {
  color: var(--accent-red);
  flex-shrink: 0;
  margin-top: 2px;
}

/* Source link button */
.source-link-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 14px;
  padding: 6px 12px;
  background: rgba(0, 150, 214, 0.1);
  border: 1px solid rgba(0, 150, 214, 0.3);
  color: var(--hp-blue);
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
  transition: all 0.2s ease;
}

.source-link-btn:hover {
  background: var(--hp-blue);
  color: white;
}

.result-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 14px;
}

.result-actions button {
  border: 1px solid var(--line-strong);
  background: var(--panel-soft);
  color: var(--text);
  border-radius: var(--radius-sm);
  padding: 7px 12px;
  font-size: 12px;
  font-weight: 600;
  transition: all 0.15s ease;
}

.result-actions button:hover {
  border-color: var(--hp-blue);
  color: var(--hp-blue);
}

/* Attachment previews inside chat or composer */
.media-preview-box {
  margin-top: 10px;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--line);
  max-width: 320px;
}

.media-preview-box img {
  width: 100%;
  display: block;
  cursor: pointer;
}

.media-preview-box video {
  width: 100%;
  display: block;
}

.log-preview-box {
  margin-top: 10px;
  background: #0f172a;
  color: #38bdf8;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  padding: 10px;
  border-radius: var(--radius-sm);
  max-height: 120px;
  overflow-y: auto;
  white-space: pre-wrap;
}

.audio-preview-pill {
  margin-top: 10px;
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(0, 150, 214, 0.15);
  padding: 8px 14px;
  border-radius: 999px;
  width: max-content;
}

.transcript-card {
  margin-top: 10px;
  background: rgba(15, 23, 42, 0.4);
  border: 1px solid rgba(56, 189, 248, 0.3);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.2);
}

.user-message .transcript-card {
  background: rgba(0, 0, 0, 0.25);
  border-color: rgba(255, 255, 255, 0.2);
}

.transcript-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  color: var(--accent-cyan);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 4px;
}

.transcript-text {
  font-size: 13px;
  font-style: italic;
  line-height: 1.4;
  color: #f1f5f9;
}

.attachment-pill-editable {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--panel);
  border: 1px solid var(--hp-blue);
  padding: 8px 14px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  margin-bottom: 8px;
  animation: slide-up 0.2s ease;
}

.attachment-pill-editable span {
  font-weight: 700;
  font-size: 12px;
  color: var(--hp-blue);
  white-space: nowrap;
}

.transcript-edit-input {
  flex: 1;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  font-size: 13px;
  color: var(--text);
  outline: none;
}

.transcript-edit-input:focus {
  border-color: var(--hp-blue);
}


.video-analysis-box {
  margin-top: 10px;
  background: rgba(15, 23, 42, 0.5);
  border: 1px solid rgba(56, 189, 248, 0.3);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  display: grid;
  gap: 8px;
}

.video-analysis-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 12px;
  line-height: 1.4;
  color: #f1f5f9;
}

.video-analysis-label {
  font-weight: 700;
  color: var(--accent-cyan);
  flex-shrink: 0;
}

.multimodal-breakdown-card {
  margin: 12px 0;
  background: var(--panel-soft);
  border: 1px solid var(--line);
  border-left: 4px solid var(--hp-blue);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  display: grid;
  gap: 8px;
}

.multimodal-breakdown-title {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--hp-blue);
}

.multimodal-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 13px;
  line-height: 1.4;
  color: var(--text);
}

.multimodal-row strong {
  color: var(--hp-blue);
  flex-shrink: 0;
}



/* Input Composer Area */
.composer-wrap {
  position: fixed;
  bottom: 0;
  left: 280px;
  right: 320px;
  padding: 14px 28px 18px;
  background: linear-gradient(to top, var(--bg) 80%, rgba(244, 247, 251, 0));
  z-index: 30;
}

/* Recording Visualizer Overlay */
.recording-bar {
  margin-bottom: 10px;
  background: #fef2f2;
  border: 1px solid #fca5a5;
  color: #991b1b;
  border-radius: var(--radius-md);
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  font-weight: 600;
  box-shadow: var(--shadow-sm);
  animation: slide-up 0.2s ease;
}

body.dark .recording-bar {
  background: #2a1215;
  border-color: #7f1d1d;
  color: #fca5a5;
}

.rec-dot {
  width: 10px;
  height: 10px;
  background: var(--accent-red);
  border-radius: 50%;
  animation: pulse-red 1s infinite;
}

@keyframes pulse-red {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.3; transform: scale(0.8); }
}

.sound-wave {
  display: flex;
  align-items: center;
  gap: 3px;
  height: 16px;
}

.sound-wave span {
  width: 3px;
  height: 100%;
  background: var(--accent-red);
  border-radius: 3px;
  animation: wave 1s ease-in-out infinite alternate;
}

.sound-wave span:nth-child(2) { animation-delay: 0.2s; }
.sound-wave span:nth-child(3) { animation-delay: 0.4s; }
.sound-wave span:nth-child(4) { animation-delay: 0.1s; }
.sound-wave span:nth-child(5) { animation-delay: 0.3s; }

@keyframes wave {
  0% { height: 20%; }
  100% { height: 100%; }
}

.stop-rec-btn {
  background: var(--accent-red);
  color: white;
  padding: 4px 12px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 700;
}

.attachment-preview {
  margin-bottom: 8px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.attachment-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--panel);
  border: 1px solid var(--line-strong);
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12px;
  box-shadow: var(--shadow-sm);
}

.attachment-pill button {
  color: var(--accent-red);
  font-weight: bold;
  font-size: 16px;
}

.composer {
  background: var(--panel);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-lg);
  padding: 8px 12px 8px 18px;
  display: flex;
  align-items: flex-end;
  gap: 12px;
  box-shadow: var(--shadow-lg);
  transition: border-color 0.2s ease;
}

.composer:focus-within {
  border-color: var(--hp-blue);
}

.composer textarea {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  color: var(--text);
  resize: none;
  min-height: 38px;
  max-height: 120px;
  padding: 8px 0;
  font-size: 14px;
}

.composer-tools {
  display: flex;
  align-items: center;
  gap: 6px;
}

.tool-btn {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: var(--panel-soft);
  color: var(--text);
  display: grid;
  place-items: center;
  transition: all 0.2s ease;
}

.tool-btn:hover {
  border-color: var(--hp-blue);
  color: var(--hp-blue);
}

.tool-btn.recording {
  background: rgba(239, 68, 68, 0.15);
  color: var(--accent-red);
  border-color: var(--accent-red);
}

.send-btn {
  height: 38px;
  padding: 0 16px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--hp-blue), var(--hp-blue-dark));
  color: white;
  font-weight: 700;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 4px 12px rgba(0, 150, 214, 0.3);
  transition: all 0.2s ease;
}

.send-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(0, 150, 214, 0.4);
}

.composer-note {
  font-size: 11px;
  color: var(--text-muted);
  text-align: center;
  margin-top: 8px;
}

/* Case Status Panel (Right Sidebar) */
.case-panel {
  background: var(--panel);
  border-left: 1px solid var(--line);
  padding: 24px 20px;
  height: 100vh;
  position: sticky;
  top: 0;
  overflow-y: auto;
}

.case-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.case-head h3 {
  font-size: 15px;
  font-weight: 800;
  margin-top: 2px;
}

.case-id-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--panel-soft);
  border: 1px solid var(--line);
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  font-size: 11px;
  font-family: 'JetBrains Mono', monospace;
  font-weight: 600;
  color: var(--hp-blue);
}

.case-id-badge button {
  font-size: 11px;
}

.case-block {
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
}

.case-label {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.selected-device {
  display: flex;
  align-items: center;
  gap: 12px;
}

.selected-device > span {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: rgba(0, 150, 214, 0.1);
  color: var(--hp-blue);
  display: grid;
  place-items: center;
  font-size: 20px;
}

.selected-device b {
  display: block;
  font-size: 13px;
}

.selected-device small {
  display: block;
  font-size: 11px;
  color: var(--text-muted);
}

.evidence-list {
  display: grid;
  gap: 6px;
}

.evidence-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-muted);
}

.evidence-item.active {
  color: var(--text);
  font-weight: 600;
}

.ev-check {
  color: var(--accent-green);
  font-weight: bold;
}

.ev-circle {
  color: var(--text-muted);
}

.progress {
  height: 8px;
  background: var(--panel-soft);
  border: 1px solid var(--line);
  border-radius: 999px;
  overflow: hidden;
}

.progress span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--hp-blue), var(--accent-cyan));
  border-radius: 999px;
  transition: width 0.4s ease;
}

.progress-meta {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 6px;
}

.safety-card {
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: var(--radius-md);
  padding: 12px 14px;
}

.safety-head {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--accent-amber);

}
.safety-card.danger {
  background: rgba(239, 68, 68, 0.1);
  border-color: var(--accent-red);
}
.safety-card.danger .safety-head {
  color: var(--accent-red);
}

.safety-card p {
  font-size: 11px;
  line-height: 1.4;
  color: var(--text);
}

.escalate-btn {
  width: 100%;
  padding: 10px;
  background: #0f172a;
  color: white;
  border-radius: var(--radius-md);
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s ease;
}

body.dark .escalate-btn {
  background: var(--hp-blue);
}

.escalate-btn:hover {
  background: var(--hp-blue);
}

.source-card {
  display: flex;
  align-items: center;
  gap: 10px;
}

.hp-badge {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--hp-blue);
  color: white;
  font-weight: 900;
  font-size: 13px;
  display: grid;
  place-items: center;
}

.source-card b {
  display: block;
  font-size: 12px;
}

.source-card small {
  display: block;
  font-size: 10px;
  color: var(--text-muted);
}

/* Modals */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(4px);
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 20px;
  animation: fade-in 0.2s ease;
}

@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-card {
  background: var(--panel);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 580px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.modal-head {
  padding: 20px 24px;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.modal-title {
  display: flex;
  align-items: center;
  gap: 12px;
}

.modal-title h3 {
  font-size: 16px;
  font-weight: 800;
}

.modal-title small {
  color: var(--text-muted);
  font-size: 12px;
}

.modal-close {
  font-size: 24px;
  color: var(--text-muted);
}

.modal-body {
  padding: 24px;
  display: grid;
  gap: 16px;
}

.modal-section label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 6px;
}

.summary-box {
  width: 100%;
  height: 90px;
  background: var(--panel-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 10px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--text);
  resize: none;
  margin-bottom: 8px;
}

.modal-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.modal-field label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 4px;
}

.modal-field input {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--panel-soft);
  color: var(--text);
  font-size: 13px;
}

.service-options {
  display: grid;
  gap: 8px;
}

.option-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 12px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
}

.option-card.active {
  border-color: var(--hp-blue);
  background: rgba(0, 150, 214, 0.05);
}

.option-card b {
  display: block;
  font-size: 13px;
}

.option-card small {
  display: block;
  font-size: 11px;
  color: var(--text-muted);
}

.modal-foot {
  padding: 16px 24px;
  background: var(--panel-soft);
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* Toast */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--navy-dark);
  color: white;
  padding: 12px 20px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 600;
  box-shadow: var(--shadow-lg);
  z-index: 200;
}

.image-modal-content {
  max-width: 90vw;
  max-height: 90vh;
  position: relative;
}

.image-modal-content img {
  max-width: 100%;
  max-height: 85vh;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
}

.image-modal-content .modal-close {
  position: absolute;
  top: -30px;
  right: 0;
  color: white;
}

/* Responsive Media Queries */
@media (max-width: 1200px) {
  .app-shell {
    grid-template-columns: 260px 1fr;
  }
  .case-panel {
    display: none;
    position: fixed;
    right: 0;
    top: 0;
    width: 320px;
    z-index: 90;
    box-shadow: var(--shadow-lg);
  }
  .case-panel.open {
    display: block;
  }
  .composer-wrap {
    left: 260px;
    right: 0;
  }
  .mobile-case-toggle {
    display: grid;
  }
}

@media (max-width: 860px) {
  .app-shell {
    display: block;
  }
  .sidebar {
    position: fixed;
    left: -280px;
    top: 0;
    transition: left 0.3s ease;
  }
  .sidebar.open {
    left: 0;
  }
  .mobile-menu-btn {
    display: grid;
  }
  .main-panel {
    padding: 20px 16px 170px;
  }
  .composer-wrap {
    left: 0;
    right: 0;
    padding: 12px 16px 16px;
  }
  .hero-card {
    padding: 20px;
  }
  .device-visual {
    display: none;
  }
  .modal-grid {
    grid-template-columns: 1fr;
  }
}

.composer-wrap.drag-over .composer {
  border-color: var(--hp-blue);
  box-shadow: 0 0 20px rgba(0, 150, 214, 0.4);
  background: rgba(0, 150, 214, 0.05);
}

.dropzone-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(6px);
  z-index: 500;
  display: grid;
  place-items: center;
  pointer-events: none;
  animation: fade-in 0.2s ease;
}

.dropzone-card {
  background: var(--panel);
  border: 2px dashed var(--hp-blue);
  border-radius: var(--radius-lg);
  padding: 40px 60px;
  text-align: center;
  box-shadow: var(--shadow-lg);
}

.dropzone-icon {
  font-size: 54px;
  margin-bottom: 12px;
  animation: bounce 1s infinite alternate;
}

@keyframes bounce {
  from { transform: translateY(0); }
  to { transform: translateY(-10px); }
}

.dropzone-card h3 {
  font-size: 22px;
  font-weight: 800;
  margin-bottom: 6px;
  color: var(--hp-blue);
}

.dropzone-card p {
  font-size: 14px;
  color: var(--text-muted);
}


