* { margin:0; padding:0; box-sizing:border-box; }
:root {
  /* Original warm color palette */
  --bg: #F9F7F3;
  --bg-warm: #F3EDE5;
  --surface: #FFFFFF;
  --surface-hover: #F5F1EB;
  --border: #E8E0D4;
  --border-light: #F0EBE3;
  --text: #2D2B28;
  --text-secondary: #6B6560;
  --text-muted: #9C958D;
  --accent: #D97757;
  --accent-light: #F4E8E2;
  --accent-hover: #C4603F;
  --green: #2E7D5B;
  --green-light: #E3F2EB;
  --green-bg: #D5EDDF;
  --yellow: #B8860B;
  --yellow-light: #FFF8E7;
  --yellow-bg: #FDF0D0;
  --red: #C0392B;
  --red-light: #FDEDEC;
  --red-bg: #F9DCDA;
  --red-dark: #922B21;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.04);
  --shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.06), 0 1px 3px rgba(0,0,0,0.04);
  --shadow-lg: 0 8px 30px rgba(0,0,0,0.08);
  --radius: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  --font-serif: 'Playfair Display', Georgia, 'Times New Roman', serif;
}
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
.app { max-width: 980px; margin: 0 auto; padding: 24px; }
.app.wide { max-width: 1300px; }
.app.fullwidth { max-width: none; margin: 0; padding: 0; }
.screen { display: none; }
.screen.active { display: block; }

/* 2-COLUMN INTERVIEW LAYOUT: main left + sidebar right */
.interview-layout {
  display: grid;
  grid-template-columns: 240px 1fr 280px;
  gap: 16px;
  align-items: start;
}
.interview-left-sidebar {
  position: sticky;
  top: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.interview-sidebar {
  position: sticky;
  top: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.interview-main {
  min-width: 0;
}

/* DOCTOR BAR (compact top bar in main panel) */
.doctor-bar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 10px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  margin-bottom: 12px;
  font-size: 12px;
  box-shadow: var(--shadow-sm);
}
.doctor-bar .db-name { font-weight: 600; color: var(--text); }
.doctor-bar .db-sep { color: var(--border); }
.doctor-bar .db-detail { color: var(--text-secondary); }

/* INTERVIEW HISTORY (Claude Code style) */
.interview-history {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.interview-history h3 {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  font-weight: 600;
  color: var(--text-muted);
  padding: 14px 16px 10px;
  border-bottom: 1px solid var(--border-light);
}
.history-list { max-height: 400px; overflow-y: auto; }
.history-list::-webkit-scrollbar { width: 3px; }
.history-list::-webkit-scrollbar-thumb { background: var(--text-light); border-radius: 3px; }
.history-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-light);
  cursor: pointer;
  transition: background 0.15s;
  font-size: 12px;
}
.history-item:last-child { border-bottom: none; }
.history-item:hover { background: var(--surface-hover); }
.history-item .hi-icon {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
  margin-top: 1px;
}
.history-item .hi-icon.level-I { background: var(--green-light); color: var(--green); }
.history-item .hi-icon.level-II { background: var(--yellow-light); color: var(--yellow); }
.history-item .hi-icon.level-III { background: var(--red-light); color: var(--red); }
.history-item .hi-icon.level-none { background: var(--bg-warm); color: var(--text-muted); }
.history-item .hi-body { flex: 1; min-width: 0; }
.history-item .hi-title {
  font-weight: 500;
  color: var(--text);
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.history-item .hi-meta { color: var(--text-muted); font-size: 11px; }
.history-item .hi-status {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  padding: 2px 6px;
  border-radius: 4px;
  flex-shrink: 0;
  margin-top: 2px;
}
.history-item .hi-status.completed { background: var(--green-light); color: var(--green); }
.history-item .hi-status.in_progress { background: var(--yellow-light); color: var(--yellow); }
.history-item .hi-status.aborted { background: var(--bg-warm); color: var(--text-muted); }
.history-empty {
  padding: 20px 16px;
  text-align: center;
  color: var(--text-muted);
  font-size: 12px;
  font-style: italic;
}

/* CLAUDE-STYLE CHAT INTERFACE */
.chat-container {
  height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  scroll-behavior: smooth;
}

.chat-messages::-webkit-scrollbar {
  width: 6px;
}

.chat-messages::-webkit-scrollbar-track {
  background: transparent;
}

.chat-messages::-webkit-scrollbar-thumb {
  background: var(--text-light);
  border-radius: 3px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* CLAUDE-STYLE MESSAGE BUBBLES */
.message-bubble {
  max-width: 85%;
  margin-bottom: 16px;
  animation: messageSlide 0.3s ease-out;
}

@keyframes messageSlide {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.message-bubble.user {
  margin-left: auto;
  margin-right: 0;
}

.message-bubble.assistant {
  margin-left: 0;
  margin-right: auto;
}

.message-content-new {
  padding: 16px 20px;
  border-radius: 18px;
  font-size: 15px;
  line-height: 1.5;
  word-wrap: break-word;
}

.user .message-content-new {
  background: var(--text);
  color: white;
  border-bottom-right-radius: 4px;
}

.assistant .message-content-new {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-bottom-left-radius: 4px;
  box-shadow: var(--shadow-sm);
}

.system .message-content-new {
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  text-align: center;
  font-size: 14px;
  margin: 8px auto;
  max-width: 70%;
}

.message-meta-new {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
  padding: 0 4px;
}

.user .message-meta-new {
  text-align: right;
}

.assistant .message-meta-new {
  text-align: left;
}

/* CLAUDE-STYLE INPUT AREA */
.chat-input-container {
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 16px 20px;
  box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.03);
}

.chat-input-wrapper {
  max-width: 1000px;
  margin: 0 auto;
  position: relative;
}

.chat-input-field {
  width: 100%;
  min-height: 50px;
  max-height: 200px;
  padding: 14px 50px 14px 16px;
  border: 1.5px solid var(--border);
  border-radius: 24px;
  font-size: 16px;
  font-family: var(--font);
  line-height: 1.4;
  resize: none;
  outline: none;
  background: var(--surface);
  transition: all 0.2s ease;
  color: var(--text);
}

.chat-input-field:focus {
  border-color: var(--accent);
  background: var(--surface);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.chat-input-field::placeholder {
  color: var(--text-light);
}

.chat-send-button {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  background: var(--accent);
  border: none;
  border-radius: 18px;
  color: white;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.chat-send-button:hover {
  background: var(--accent-hover);
  transform: translateY(-50%) scale(1.05);
}

.chat-send-button:disabled {
  background: var(--text-light);
  cursor: not-allowed;
  transform: translateY(-50%);
}

/* MEDICAL ENHANCEMENTS */
.medical-header {
  font-weight: 600;
  font-size: 16px;
  color: var(--text);
  margin: 16px 0 8px 0;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--border);
}

.medical-code {
  display: inline-block;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-hover) 100%);
  color: white;
  padding: 2px 8px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 12px;
  font-family: 'SF Mono', 'Monaco', 'Inconsolata', monospace;
  margin: 0 2px;
}

.medical-standard {
  display: inline-block;
  background: linear-gradient(135deg, #34c759 0%, #30d158 100%);
  color: white;
  padding: 2px 8px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 12px;
  margin: 0 2px;
}

.reference-code {
  display: inline-block;
  background: linear-gradient(135deg, #ff9500 0%, #ff6b35 100%);
  color: white;
  padding: 2px 8px;
  border-radius: 8px;
  font-weight: 500;
  font-size: 11px;
  font-family: 'SF Mono', 'Monaco', 'Inconsolata', monospace;
  margin: 0 2px;
}

.medical-bullet {
  margin: 6px 0;
  padding-left: 16px;
  position: relative;
  line-height: 1.5;
}

.medical-bullet::before {
  content: '';
  position: absolute;
  left: 0;
  top: 10px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}

.medical-numbered {
  margin: 8px 0;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  line-height: 1.5;
}

.medical-numbered .number {
  background: var(--surface);
  color: var(--accent);
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 6px;
  font-size: 12px;
  min-width: 24px;
  text-align: center;
}

.medical-emphasis {
  color: var(--text);
  font-weight: 600;
  background: rgba(0, 122, 255, 0.1);
  padding: 1px 4px;
  border-radius: 4px;
}

.medical-table-container {
  margin: 16px 0;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
  background: white;
}

.medical-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.medical-table th {
  background: linear-gradient(135deg, var(--surface) 0%, var(--border) 100%);
  color: var(--text);
  font-weight: 600;
  padding: 12px 16px;
  text-align: left;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.medical-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--surface);
  color: var(--text);
  line-height: 1.5;
}

.medical-table tr:last-child td {
  border-bottom: none;
}

.medical-table tr:hover {
  background: rgba(0, 122, 255, 0.05);
}

/* CHAT CONSULTATION STYLES */
.chat-message {
  margin-bottom: 16px;
  display: flex;
  flex-direction: column;
}

.chat-message.user-message {
  align-items: flex-end;
}

.chat-message.ai-message {
  align-items: flex-start;
}

.chat-message.system-message {
  align-items: center;
}

.message-content {
  max-width: 80%;
  padding: 12px 16px;
  border-radius: var(--radius);
  font-size: 14px;
  line-height: 1.5;
}

.user-message .message-content {
  background: linear-gradient(135deg, #2E7D5B 0%, var(--accent) 100%);
  color: white;
  border-bottom-right-radius: 6px;
  box-shadow: 0 2px 8px rgba(46, 125, 91, 0.3);
}

.ai-message .message-content {
  background: linear-gradient(135deg, #F9F7F3 0%, #FFFFFF 100%);
  color: var(--text);
  border: 2px solid #E8E0D4;
  border-left: 4px solid #2E7D5B;
  border-bottom-left-radius: 6px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.system-message .message-content {
  background: var(--bg-warm);
  color: var(--text-secondary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  max-width: 100%;
  text-align: center;
  font-size: 13px;
}

.message-meta {
  font-size: 11px;
  color: var(--text-muted);
  margin: 4px 12px 0;
}

.user-message .message-meta {
  text-align: right;
}

.ai-message .message-meta {
  text-align: left;
}

/* HEADER */
header {
  text-align: center;
  padding: 32px 0 24px;
  margin-bottom: 24px;
}
header h1 {
  font-family: var(--font-serif);
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -0.5px;
  color: var(--text);
}
header h1 span { color: var(--accent); }
header p {
  color: var(--text-muted);
  margin-top: 6px;
  font-size: 14px;
  font-weight: 400;
  letter-spacing: 0.2px;
}
.header-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  margin-bottom: 8px;
}
.header-bar .user-info { font-size: 13px; color: var(--text-secondary); }
.header-bar .user-info b { color: var(--text); font-weight: 600; }

/* FORMS */
.form-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 36px;
  max-width: 440px;
  margin: 40px auto;
  box-shadow: var(--shadow-md);
}
.form-card h2 {
  margin-bottom: 28px;
  font-family: var(--font-serif);
  font-size: 22px;
  font-weight: 600;
  color: var(--text);
}
.form-group { margin-bottom: 18px; }
.form-group label {
  display: block;
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 6px;
  font-weight: 500;
}
.form-group input, .form-group select {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  padding: 11px 16px;
  font-size: 14px;
  font-family: var(--font);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.form-group input:focus, .form-group select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-light);
}
.form-group input::placeholder { color: var(--text-muted); }
.form-error { color: var(--red); font-size: 13px; margin-top: 6px; display: none; font-weight: 500; }

/* STATUS BAR */
.status-bar {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 12px 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 16px;
  font-size: 13px;
  flex-wrap: wrap;
  box-shadow: var(--shadow-sm);
}
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--text-muted); flex-shrink: 0; }
.status-dot.active { background: var(--green); }
.status-dot.recording { background: var(--red); animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 0%,100% { opacity:1; } 50% { opacity:0.3; } }
.status-bar .phase {
  background: var(--bg-warm);
  padding: 4px 12px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-secondary);
}
.status-bar .spacer { flex: 1; }
.risk-badge {
  padding: 4px 12px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.risk-badge.brak { background: var(--bg-warm); color: var(--text-muted); }
.risk-badge.niska { background: var(--green-light); color: var(--green); }
.risk-badge.srednia { background: var(--yellow-light); color: var(--yellow); }
.risk-badge.wysoka { background: var(--red-light); color: var(--red); }
.risk-badge.krytyczna { background: var(--red); color: #fff; }
.patient-tag {
  background: var(--green-light);
  border: 1px solid var(--green-bg);
  padding: 4px 12px;
  border-radius: 8px;
  font-size: 12px;
  color: var(--green);
  font-weight: 500;
}

/* RECORDING INDICATOR */
.rec-indicator {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 18px;
  background: var(--red-light);
  border: 1px solid var(--red-bg);
  border-radius: var(--radius);
  margin-bottom: 14px;
  font-size: 13px;
  color: var(--red);
  font-weight: 500;
}
.rec-indicator .rec-dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--red);
  animation: pulse 1.2s ease-in-out infinite;
}
.rec-indicator .rec-time {
  margin-left: auto;
  font-family: 'SF Mono', 'Fira Code', monospace;
  color: var(--red-dark);
  font-size: 13px;
}

/* LIVE TRANSCRIPT */
.live-transcript {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 14px;
  min-height: 64px;
  max-height: 130px;
  overflow-y: auto;
  box-shadow: var(--shadow-sm);
}
.live-transcript .lt-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--text-muted);
  margin-bottom: 8px;
  font-weight: 600;
}
.live-transcript .lt-text {
  font-size: 15px;
  line-height: 1.6;
  color: var(--text);
  min-height: 22px;
}
.live-transcript .lt-text.empty { color: var(--text-muted); font-style: italic; }

/* SPEAKER TOGGLE */
.speaker-toggle {
  display: flex;
  gap: 0;
  margin-bottom: 14px;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}
.speaker-btn {
  flex: 1;
  padding: 12px;
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  background: var(--surface);
  color: var(--text-muted);
  border: none;
  transition: all 0.2s;
  font-family: var(--font);
}
.speaker-btn:hover { background: var(--surface-hover); }
.speaker-btn.active-doctor { background: var(--accent-light); color: var(--accent); }
.speaker-btn.active-patient { background: var(--green-light); color: var(--green); }

/* QUESTION PANEL */
.question-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius);
  padding: 24px 28px;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
}
.question-panel .label {
  font-size: 11px;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 1.2px;
  font-weight: 600;
  margin-bottom: 10px;
}
.question-panel .question-text {
  font-family: var(--font-serif);
  font-size: 20px;
  font-weight: 600;
  line-height: 1.45;
  color: var(--text);
}

/* CHAT LOG */
.chat-log {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 16px;
  max-height: 360px;
  overflow-y: auto;
  padding-right: 4px;
}
.chat-log::-webkit-scrollbar { width: 4px; }
.chat-log::-webkit-scrollbar-track { background: transparent; }
.chat-log::-webkit-scrollbar-thumb { background: var(--text-light); border-radius: 4px; }
.msg {
  padding: 14px 18px;
  border-radius: var(--radius);
  max-width: 85%;
  font-size: 14px;
  line-height: 1.6;
}
.msg .msg-label {
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}
.msg.system {
  background: var(--surface);
  border: 1px solid var(--border);
  align-self: flex-start;
  box-shadow: var(--shadow-sm);
}
.msg.system .msg-label { color: var(--accent); }
.msg.doctor {
  background: var(--accent-light);
  border: 1px solid var(--border-light);
  align-self: flex-start;
}
.msg.doctor .msg-label { color: var(--accent); }
.msg.patient {
  background: var(--green-light);
  border: 1px solid var(--green-bg);
  align-self: flex-end;
}
.msg.patient .msg-label { color: var(--green); }
.msg.analysis {
  background: var(--bg-warm);
  border-left: 3px solid var(--accent);
  align-self: flex-start;
  font-size: 13px;
  color: var(--text-secondary);
  max-width: 100%;
}
.msg.flag {
  padding: 10px 16px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 600;
  max-width: 100%;
}
.msg.flag.niska { background: var(--green-light); border: 1px solid var(--green-bg); color: var(--green); }
.msg.flag.srednia { background: var(--yellow-light); border: 1px solid var(--yellow-bg); color: var(--yellow); }
.msg.flag.wysoka { background: var(--red-light); border: 1px solid var(--red-bg); color: var(--red); }
.msg.flag.krytyczna { background: var(--red); border: 1px solid var(--red-dark); color: #fff; }

/* TRIAGE DECISION */
.triage-decision {
  border-radius: var(--radius-xl);
  padding: 28px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-md);
}
.triage-decision.POZIOM_I {
  background: linear-gradient(135deg, #E3F2EB 0%, #D5EDDF 100%);
  border: 2px solid var(--green);
}
.triage-decision.POZIOM_II {
  background: linear-gradient(135deg, #FFF8E7 0%, #FDF0D0 100%);
  border: 2px solid var(--yellow);
}
.triage-decision.POZIOM_III {
  background: linear-gradient(135deg, #FDEDEC 0%, #F9DCDA 100%);
  border: 2px solid var(--red);
}
.triage-decision h2 {
  font-family: var(--font-serif);
  font-size: 24px;
  margin-bottom: 20px;
  color: var(--text);
}
.triage-decision .field { margin-bottom: 14px; }
.triage-decision .field-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  margin-bottom: 3px;
  font-weight: 600;
}
.triage-decision .field-value { font-size: 14px; line-height: 1.6; color: var(--text); }

/* BUTTONS */
.btn {
  padding: 10px 20px;
  border: none;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  font-family: var(--font);
}
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; box-shadow: none; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-end {
  background: var(--surface);
  color: var(--text-secondary);
  border: 1px solid var(--border);
}
.btn-end:hover { background: var(--surface-hover); border-color: var(--accent); color: var(--text); }
.btn-start {
  background: var(--accent);
  color: #fff;
  font-size: 16px;
  padding: 16px 32px;
  border-radius: var(--radius);
}
.btn-start:hover { background: var(--accent-hover); }
.btn-outline {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-secondary);
}
.btn-outline:hover { border-color: var(--accent); color: var(--accent); }
.btn-block { width: 100%; justify-content: center; }
.btn-submit-answer {
  background: var(--accent);
  color: #fff;
  font-size: 15px;
  padding: 14px 28px;
  width: 100%;
  justify-content: center;
  border-radius: var(--radius);
}
.btn-submit-answer:hover { background: var(--accent-hover); }
.btn-submit-answer:disabled { background: var(--bg-warm); color: var(--text-muted); }

/* ID METHOD CARDS */
.id-methods { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 28px 0; }
.id-method {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
  box-shadow: var(--shadow-sm);
}
.id-method:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}
.id-method .icon { font-size: 28px; margin-bottom: 10px; }
.id-method h3 { font-size: 14px; margin-bottom: 4px; font-weight: 600; color: var(--text); }
.id-method p { font-size: 12px; color: var(--text-muted); }

/* HISTORY */
.history-card {
  background: var(--bg);
  border: 1px solid var(--border-light);
  border-radius: 10px;
  padding: 14px 18px;
  margin-bottom: 8px;
}
.history-card .meta { font-size: 12px; color: var(--text-muted); margin-bottom: 4px; }
.history-card .detail { font-size: 14px; color: var(--text); }

/* BOTTOM BAR */
.bottom-bar { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.bottom-bar .btn { font-size: 12px; padding: 8px 14px; }

/* LOADING */
.loading { display: flex; align-items: center; gap: 10px; padding: 14px; color: var(--text-secondary); font-size: 13px; }
.spinner {
  width: 18px; height: 18px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* REFERRAL */
.referral-card {
  background: var(--surface);
  border: 1px solid var(--accent);
  border-radius: var(--radius-xl);
  padding: 28px;
  margin-top: 16px;
  box-shadow: var(--shadow);
}
.referral-card h3 {
  font-family: var(--font-serif);
  color: var(--accent);
  margin-bottom: 20px;
  font-size: 18px;
}
.referral-card .field { margin-bottom: 12px; }
.referral-card .field-label { font-size: 11px; text-transform: uppercase; letter-spacing: 1px; color: var(--text-muted); margin-bottom: 3px; font-weight: 600; }
.referral-card .field-value { font-size: 14px; color: var(--text); }

/* INPUT AREA */
.input-area { display: flex; gap: 8px; align-items: flex-end; margin-top: 10px; }
.input-area textarea {
  flex: 1;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  padding: 12px 16px;
  font-size: 14px;
  font-family: var(--font);
  resize: none;
  min-height: 48px;
  max-height: 120px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.input-area textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-light); }
.input-area textarea::placeholder { color: var(--text-muted); }

/* SIDE PANELS (sidebar mode) */
.side-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
  font-size: 13px;
  box-shadow: var(--shadow-sm);
}
.side-panel h3 {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  margin-bottom: 12px;
  font-weight: 600;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-light);
}
.side-panel.patient-panel { border-top: 3px solid var(--green); }
.side-panel.patient-panel h3 { color: var(--green); }
.side-panel .info-row {
  display: flex;
  flex-direction: column;
  padding: 5px 0;
  border-bottom: 1px solid var(--border-light);
}
.side-panel .info-row:last-child { border-bottom: none; }
.side-panel .info-label { color: var(--text-muted); font-size: 10px; text-transform: uppercase; letter-spacing: 0.5px; }
.side-panel .info-value { color: var(--text); font-weight: 500; font-size: 13px; margin-top: 1px; }
.side-panel .no-patient { color: var(--text-muted); font-style: italic; padding: 8px 0; font-size: 12px; line-height: 1.5; }

/* SPECIALIST NOTES */
.specialist-notes {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 24px;
  margin-top: 16px;
  box-shadow: var(--shadow);
}
.specialist-notes h3 {
  font-family: var(--font-serif);
  font-size: 16px;
  color: var(--text);
  margin-bottom: 14px;
}
.specialist-notes textarea {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  padding: 14px;
  font-size: 14px;
  font-family: var(--font);
  resize: vertical;
  min-height: 110px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.specialist-notes textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-light); }
.specialist-notes .notes-status { font-size: 12px; color: var(--text-muted); margin-top: 8px; font-weight: 500; }
.specialist-notes .notes-status.saved { color: var(--green); }

/* MODAL */
.modal-overlay {
  display:none;
  position:fixed;
  inset:0;
  background:rgba(45,43,40,0.5);
  backdrop-filter: blur(4px);
  z-index:100;
  overflow-y:auto;
}
.modal-content {
  max-width:700px;
  margin:50px auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 28px;
  box-shadow: var(--shadow-lg);
}

/* DASHBOARD 3-COLUMN LAYOUT */
.dashboard-layout {
  display: grid;
  grid-template-columns: 260px 1fr 260px;
  gap: 20px;
  align-items: start;
}
.dash-sidebar {
  position: sticky;
  top: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.dash-center {
  min-width: 0;
}

/* DIVIDER */
.divider {
  height: 1px;
  background: var(--border);
  margin: 20px 0;
}

@media (max-width: 1100px) {
  .dashboard-layout { grid-template-columns: 220px 1fr 220px; gap: 14px; }
  .interview-layout { grid-template-columns: 200px 1fr 240px; gap: 12px; }
}
@media (max-width: 900px) {
  .dashboard-layout { grid-template-columns: 1fr; }
  .dash-sidebar { position: static; }
  .interview-layout { grid-template-columns: 1fr; }
  .interview-left-sidebar { position: static; }
  .interview-sidebar { position: static; }
  .app.wide { max-width: 980px; }
}
@media (max-width: 768px) {
  .app { padding: 14px; }
  .question-panel .question-text { font-size: 17px; }
  .chat-log { max-height: 260px; }
}
