/* ══════════════════════════════════════════════════════════════════════════
   Lenovo Diagnostic Assistant · Realtime Voice — Clean Refined Light
   ══════════════════════════════════════════════════════════════════════════ */

/* ── Reset & Custom Properties ────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  /* Palette — refined light */
  --bg:            #eeecea;
  --bg-warm:       #e8e6e2;
  --surface:       #ffffff;
  --surface-hover: #fafaf8;
  --border:        #dddbd7;
  --border-light:  #e8e6e2;
  --chat-bg:       #f8f7f5;

  --text:          #1a1a1a;
  --text-secondary:#5c5c5c;
  --text-muted:    #999894;

  --accent:        #1a1a1a;
  --accent-warm:   #8b7355;

  --user-bubble:   #1a1a1a;
  --user-text:     #ffffff;
  --assistant-bg:  #ffffff;

  --danger:        #c53030;
  --success:       #2f855a;
  --info:          #5c5c5c;

  --radius:        12px;
  --radius-sm:     8px;
  --radius-xs:     4px;

  --font-display:  'Instrument Serif', 'Georgia', serif;
  --font-body:     'DM Sans', 'Helvetica Neue', sans-serif;
  --font-mono:     'IBM Plex Mono', 'Menlo', monospace;

  --header-h:      60px;
  --input-h:       72px;
}

html, body {
  height: 100%;
  font-family: var(--font-body);
  font-weight: 400;
  background: var(--bg);
  color: var(--text);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ── Ambient background (disabled for light theme) ────────────────────────── */

.bg-grain,
.bg-aurora {
  display: none;
}

/* ── App shell ────────────────────────────────────────────────────────────── */

#app {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  height: 100dvh;
  max-width: 760px;
  margin: 0 auto;
}

/* ── Header ───────────────────────────────────────────────────────────────── */

#header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  height: var(--header-h);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-mark {
  position: relative;
  width: 22px;
  height: 22px;
}

.brand-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1.5px solid var(--text);
  opacity: 0.25;
}

.brand-ring.ring-2 {
  inset: 4px;
  border-color: var(--accent-warm);
  opacity: 0.35;
}

/* No spinning animation for the refined theme */
@keyframes brand-spin {
  to { transform: rotate(360deg); }
}

#header h1 {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 400;
  letter-spacing: -0.02em;
  color: var(--text);
}

/* ── Hide tool calls (server-controlled) ──────────────────────────────── */

#messages.hide-tool-calls .function-call,
#messages.hide-tool-calls .capture-indicator {
  display: none;
}

#status {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  font-weight: 400;
  color: var(--text-muted);
  letter-spacing: 0.02em;
}

#status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--danger);
  transition: background 0.4s ease;
}

#status-dot.connected {
  background: var(--success);
}

/* ── Messages ─────────────────────────────────────────────────────────────── */

#messages {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 32px 24px 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  scroll-behavior: smooth;
  background: var(--chat-bg);
}

#messages::-webkit-scrollbar { width: 3px; }
#messages::-webkit-scrollbar-track { background: transparent; }
#messages::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }
#messages::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ── Welcome state ────────────────────────────────────────────────────────── */

.welcome-hint {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
  gap: 12px;
  padding-bottom: 48px;
  animation: welcome-in 0.8s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes welcome-in {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

.welcome-orb {
  position: relative;
  width: 48px;
  height: 48px;
  margin-bottom: 4px;
}

.orb-core {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1.5px solid var(--border);
}

.orb-glow,
.orb-ring {
  display: none;
}

.welcome-title {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 400;
  color: var(--text);
  letter-spacing: -0.01em;
}

.welcome-sub {
  font-size: 13.5px;
  color: var(--text-muted);
  text-align: center;
  line-height: 1.5;
  font-weight: 400;
}

.welcome-hint.hidden { display: none; }

/* ── Message bubbles ──────────────────────────────────────────────────────── */

.message {
  max-width: 75%;
  padding: 12px 16px;
  border-radius: var(--radius);
  font-size: 14.5px;
  line-height: 1.65;
  word-wrap: break-word;
  animation: msg-in 0.3s cubic-bezier(0.16, 1, 0.3, 1) both;
  position: relative;
}

@keyframes msg-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.message.user {
  align-self: flex-end;
  background: var(--user-bubble);
  color: var(--user-text);
  border-bottom-right-radius: var(--radius-xs);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

.message.assistant {
  align-self: flex-start;
  background: var(--assistant-bg);
  border: 1px solid var(--border);
  border-bottom-left-radius: var(--radius-xs);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.message .label {
  font-family: var(--font-body);
  font-size: 10px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 4px;
  color: var(--text-muted);
}

.message.user .label { color: rgba(255, 255, 255, 0.45); }

/* Streaming cursor */
.message.assistant.streaming .body::after {
  content: '';
  display: inline-block;
  width: 2px;
  height: 15px;
  margin-left: 2px;
  background: var(--text);
  vertical-align: text-bottom;
  animation: cursor-blink 1s step-end infinite;
}

@keyframes cursor-blink {
  50% { opacity: 0; }
}

/* ── Markdown body styles ─────────────────────────────────────────────────── */

.markdown-body {
  line-height: 1.7;
}

.markdown-body > *:first-child { margin-top: 0; }
.markdown-body > *:last-child  { margin-bottom: 0; }

.markdown-body p {
  margin: 0.45em 0;
}

.markdown-body h1, .markdown-body h2, .markdown-body h3,
.markdown-body h4, .markdown-body h5, .markdown-body h6 {
  margin: 0.9em 0 0.35em;
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 1.3;
  letter-spacing: -0.01em;
}
.markdown-body h1 { font-size: 1.35em; }
.markdown-body h2 { font-size: 1.2em; }
.markdown-body h3 { font-size: 1.08em; }

.markdown-body ul, .markdown-body ol {
  margin: 0.4em 0;
  padding-left: 1.4em;
}
.markdown-body li { margin: 0.15em 0; }
.markdown-body li > p { margin: 0.15em 0; }

.markdown-body blockquote {
  margin: 0.5em 0;
  padding: 0.3em 0.85em;
  border-left: 2px solid var(--border);
  color: var(--text-secondary);
}

.markdown-body code {
  font-family: var(--font-mono);
  font-size: 0.87em;
  padding: 0.15em 0.4em;
  background: var(--bg-warm);
  border-radius: 3px;
  color: var(--text);
}

.markdown-body pre {
  margin: 0.55em 0;
  padding: 0.75em 1em;
  background: #fafaf8;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow-x: auto;
}

.markdown-body pre code {
  padding: 0;
  background: none;
  font-size: 0.84em;
  line-height: 1.6;
}

.message.user .markdown-body code {
  background: rgba(255, 255, 255, 0.12);
  color: var(--user-text);
}
.message.user .markdown-body pre {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.12);
}
.message.user .markdown-body blockquote {
  border-left-color: rgba(255, 255, 255, 0.25);
  color: rgba(255, 255, 255, 0.7);
}

.markdown-body table {
  width: 100%;
  margin: 0.5em 0;
  border-collapse: collapse;
  font-size: 0.9em;
}
.markdown-body th, .markdown-body td {
  padding: 0.4em 0.6em;
  border: 1px solid var(--border);
  text-align: left;
}
.markdown-body th {
  background: var(--bg-warm);
  font-weight: 500;
}

.markdown-body hr {
  margin: 0.9em 0;
  border: none;
  border-top: 1px solid var(--border);
}

.markdown-body a {
  color: var(--text);
  text-decoration: underline;
  text-decoration-color: var(--text-muted);
  text-underline-offset: 2px;
  transition: text-decoration-color 0.2s;
}
.markdown-body a:hover {
  text-decoration-color: var(--text);
}
.message.user .markdown-body a {
  color: var(--user-text);
  text-decoration-color: rgba(255, 255, 255, 0.4);
}

.markdown-body strong { font-weight: 600; }
.markdown-body em { font-style: italic; }

.markdown-body img {
  max-width: 100%;
  border-radius: var(--radius-xs);
}

/* ── Function call card ───────────────────────────────────────────────────── */

.function-call {
  align-self: center;
  max-width: 88%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 16px;
  font-size: 13px;
  color: var(--text-secondary);
  animation: msg-in 0.3s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.function-call .fn-name {
  color: var(--text);
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 13px;
}

.function-call .fn-args {
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 11.5px;
}

.function-call .fn-result {
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px solid var(--border-light);
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--success);
  white-space: pre-wrap;
}

/* ── Camera preview ───────────────────────────────────────────────────────────── */

#camera-container {
  position: fixed;
  bottom: 100px;
  right: 24px;
  z-index: 100;
  width: 200px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 6px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.12), 0 1px 4px rgba(0,0,0,0.08);
  animation: msg-in 0.3s cubic-bezier(0.16, 1, 0.3, 1) both;
  cursor: move;
  user-select: none;
}

#camera-container.hidden {
  display: none;
}

.camera-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
  padding: 0 2px;
}

.camera-label {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-secondary);
}

#camera-close-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border: none;
  background: var(--bg-warm);
  border-radius: 50%;
  color: var(--text-secondary);
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

#camera-close-btn:hover {
  background: var(--border);
  color: var(--text);
}

#camera-preview {
  width: 100%;
  border-radius: var(--radius-sm);
  object-fit: cover;
  background: #000;
  display: block;
}

/* ── Desktop sharing preview ──────────────────────────────────────────────── */

#desktop-container {
  position: fixed;
  bottom: 100px;
  right: 240px;
  z-index: 100;
  width: 260px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 6px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.12), 0 1px 4px rgba(0,0,0,0.08);
  animation: msg-in 0.3s cubic-bezier(0.16, 1, 0.3, 1) both;
  cursor: move;
  user-select: none;
}

#desktop-container.hidden {
  display: none;
}

#desktop-close-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border: none;
  background: var(--bg-warm);
  border-radius: 50%;
  color: var(--text-secondary);
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

#desktop-close-btn:hover {
  background: var(--border);
  color: var(--text);
}

#desktop-preview {
  width: 100%;
  border-radius: var(--radius-sm);
  object-fit: contain;
  background: #000;
  display: block;
}

.captured-image {
  max-width: 100%;
  max-height: 300px;
  border-radius: var(--radius-sm);
  object-fit: contain;
}

/* ── Capture Status Panel ─────────────────────────────────────────────────── */

#capture-status {
  position: fixed;
  bottom: 100px;
  left: 24px;
  z-index: 100;
  width: 220px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.10), 0 1px 4px rgba(0,0,0,0.06);
  animation: msg-in 0.35s cubic-bezier(0.16, 1, 0.3, 1) both;
}

#capture-status.hidden {
  display: none;
}

.capture-status-header {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
  padding: 0 2px;
}

.capture-status-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  flex: 1;
}

.capture-count {
  font-size: 10px;
  font-weight: 600;
  color: var(--user-text);
  background: var(--accent);
  border-radius: 10px;
  padding: 1px 7px;
  line-height: 1.4;
}

.capture-count.hidden {
  display: none;
}

#capture-status-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border: none;
  background: var(--bg-warm);
  border-radius: 50%;
  color: var(--text-secondary);
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

#capture-status-close:hover {
  background: var(--border);
  color: var(--text);
}

#capture-status-body {
  position: relative;
}

#capture-status-img {
  width: 100%;
  max-height: 140px;
  object-fit: contain;
  border-radius: var(--radius-sm);
  background: var(--bg-warm);
  display: block;
}

.capture-status-text {
  font-size: 11px;
  color: var(--text-muted);
  text-align: center;
  margin-top: 5px;
  font-weight: 500;
}

/* Compact capture indicator in chat */
.capture-indicator {
  align-self: center;
  max-width: 88%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 14px;
  font-size: 12.5px;
  color: var(--text-secondary);
  animation: msg-in 0.3s cubic-bezier(0.16, 1, 0.3, 1) both;
  display: flex;
  align-items: center;
  gap: 6px;
}

.capture-indicator .ci-icon {
  font-size: 14px;
  flex-shrink: 0;
}

.capture-indicator .ci-text {
  font-family: var(--font-body);
}

/* ── Voice Visualizer ─────────────────────────────────────────────────────── */

#voice-viz {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 14px 0 6px;
  flex-shrink: 0;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

#voice-viz.hidden {
  display: none;
}

#viz-canvas {
  width: 120px;
  height: 56px;
  border-radius: var(--radius-sm);
}

.viz-label {
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  animation: viz-pulse 2s ease-in-out infinite;
}

@keyframes viz-pulse {
  0%, 100% { opacity: 0.5; }
  50%      { opacity: 1; }
}

/* ── Input bar ────────────────────────────────────────────────────────────── */

#input-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 24px;
  height: var(--input-h);
  background: var(--surface);
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

.input-wrapper {
  flex: 1;
  position: relative;
}

#text-input {
  width: 100%;
  padding: 11px 16px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 24px;
  color: var(--text);
  font-size: 14px;
  font-family: var(--font-body);
  font-weight: 400;
  outline: none;
  transition: border-color 0.25s, box-shadow 0.25s;
}

#text-input::placeholder {
  color: var(--text-muted);
  font-weight: 400;
}

#text-input:focus {
  border-color: #bbb8b0;
  box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.03);
}

#text-input:disabled { opacity: 0.35; }

/* Buttons */
#input-bar button {
  width: 42px;
  height: 42px;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
}

#input-bar button:disabled { opacity: 0.25; cursor: not-allowed; }
#input-bar button:active:not(:disabled) { transform: scale(0.93); }

#send-btn {
  background: var(--text);
  color: #fff;
}

#send-btn:hover:not(:disabled) {
  background: #333;
}

#mic-btn,
#desktop-btn,
#camera-btn {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border);
}

#mic-btn:hover:not(:disabled),
#desktop-btn:hover:not(:disabled),
#camera-btn:hover:not(:disabled) {
  background: var(--bg-warm);
  color: var(--text);
  border-color: #ccc9c1;
}

/* Active state for desktop share */
#desktop-btn.active {
  background: #2563eb;
  color: #fff;
  border-color: transparent;
  animation: btn-active-pulse 2s ease-in-out infinite;
}

/* Active state for camera */
#camera-btn.active {
  background: var(--accent-warm);
  color: #fff;
  border-color: transparent;
  animation: btn-active-pulse 2s ease-in-out infinite;
}

@keyframes btn-active-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(37, 99, 235, 0.15); }
  50%      { box-shadow: 0 0 0 5px rgba(37, 99, 235, 0); }
}

/* Mic pulse ring (appears when recording) */
.mic-pulse {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s;
}

/* Recording state */
#mic-btn.recording {
  background: var(--danger);
  color: #fff;
  border-color: transparent;
  animation: mic-recording-pulse 2s ease-in-out infinite;
}

#mic-btn.recording .mic-pulse {
  opacity: 1;
  animation: mic-ring-expand 2s ease-out infinite;
}

@keyframes mic-recording-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(197, 48, 48, 0.2); }
  50%      { box-shadow: 0 0 0 5px rgba(197, 48, 48, 0); }
}

@keyframes mic-ring-expand {
  0%   { transform: scale(0.85); opacity: 0.4; box-shadow: 0 0 0 0 rgba(197, 48, 48, 0.2); }
  100% { transform: scale(1.5); opacity: 0; box-shadow: 0 0 0 10px rgba(197, 48, 48, 0); }
}

/* ── Toast notifications ──────────────────────────────────────────────────── */

#toast-container {
  position: fixed;
  top: 72px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
  max-width: 380px;
  width: 90%;
}

.toast {
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  animation: toast-in 0.35s cubic-bezier(0.16, 1, 0.3, 1), toast-out 0.35s ease 2.6s forwards;
  pointer-events: auto;
  text-align: center;
  border: 1px solid var(--border);
}

.toast.error   { background: #fef2f2; color: var(--danger); border-color: #fecaca; }
.toast.info    { background: var(--surface); color: var(--text-secondary); }
.toast.success { background: #f0fdf4; color: var(--success); border-color: #bbf7d0; }

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

@keyframes toast-out {
  from { opacity: 1; }
  to   { opacity: 0; transform: translateY(-6px); pointer-events: none; }
}

/* ── Responsive ───────────────────────────────────────────────────────────── */

@media (max-width: 600px) {
  :root {
    --header-h: 52px;
    --input-h: 66px;
  }

  #header { padding: 0 16px; }
  #messages { padding: 20px 16px 14px; }
  #input-bar { padding: 10px 16px; gap: 8px; }

  .message { max-width: 88%; font-size: 14px; }
  #header h1 { font-size: 20px; }

  .welcome-orb { width: 40px; height: 40px; }
}

/* ── Selection ────────────────────────────────────────────────────────────── */

::selection {
  background: rgba(26, 26, 26, 0.12);
  color: var(--text);
}

/* ── Camera Source Modal ──────────────────────────────────────────────────── */

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 300;
  background: rgba(26, 26, 26, 0.35);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: modal-bg-in 0.25s ease both;
}

.modal-overlay.hidden {
  display: none;
}

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

.modal-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 28px 32px 32px;
  width: 90%;
  max-width: 400px;
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.15), 0 2px 8px rgba(0, 0, 0, 0.08);
  animation: modal-card-in 0.3s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes modal-card-in {
  from { opacity: 0; transform: translateY(12px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}

.modal-title {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 400;
  color: var(--text);
}

.modal-close-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border: none;
  background: var(--bg-warm);
  border-radius: 50%;
  color: var(--text-secondary);
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.modal-close-btn:hover {
  background: var(--border);
  color: var(--text);
}

.modal-description {
  font-size: 13.5px;
  color: var(--text-muted);
  margin-bottom: 20px;
}

.modal-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.modal-option {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 14px 16px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  text-align: left;
  transition: all 0.2s ease;
  position: relative;
}

.modal-option:hover {
  background: var(--surface-hover);
  border-color: #ccc9c1;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.modal-option:active {
  transform: scale(0.98);
}

.modal-option-icon {
  font-size: 28px;
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-light);
}

.modal-option-label {
  font-size: 14.5px;
  font-weight: 500;
  color: var(--text);
  display: block;
}

.modal-option-sub {
  font-size: 12px;
  color: var(--text-muted);
  display: block;
  margin-top: 1px;
}

/* QR Code Section */

#qr-section {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--border-light);
}

#qr-section.hidden {
  display: none;
}

.qr-instructions {
  text-align: center;
  margin-bottom: 16px;
}

.qr-instructions p {
  font-size: 13.5px;
  color: var(--text-secondary);
  line-height: 1.5;
}

.qr-hint {
  font-size: 11.5px !important;
  color: var(--text-muted) !important;
  margin-top: 2px;
}

#qr-container {
  display: flex;
  justify-content: center;
  padding: 16px;
  background: #fff;
  border-radius: var(--radius);
  border: 1px solid var(--border-light);
  margin-bottom: 14px;
}

#qr-container img,
#qr-container canvas {
  width: 180px;
  height: 180px;
}

.qr-waiting {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 12.5px;
  color: var(--text-muted);
  font-weight: 500;
}

.qr-waiting-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-warm);
  animation: qr-dot-pulse 1.5s ease-in-out infinite;
}

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

/* Phone camera connected indicator in camera preview */
.camera-label .phone-badge {
  font-size: 10px;
  background: var(--success);
  color: #fff;
  padding: 1px 6px;
  border-radius: 8px;
  margin-left: 6px;
  font-weight: 600;
}

/* Phone frame image in camera preview */
#phone-frame-img {
  width: 100%;
  border-radius: var(--radius-sm);
  object-fit: cover;
  background: #000;
  display: block;
}
