/* ============================================================
   NCLEX Quiz — EHR-style clinical interface
   Adapted from MedGuard design system
   ============================================================ */
* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --bg: #e8e8e8;
  --sidebar-bg: #1b2a4a;
  --toolbar-bg: #1b2a4a;
  --card-bg: #ffffff;
  --border: #c0c0c0;
  --border-dark: #999;
  --primary: #1a5276;
  --primary-light: #2980b9;
  --text: #222;
  --text-muted: #555;
  --red: #cc0000;
  --red-bg: #ffe5e5;
  --red-border: #cc0000;
  --yellow: #996600;
  --yellow-bg: #fff8e1;
  --yellow-border: #e6a800;
  --green: #006633;
  --green-bg: #e5f5e5;
  --green-border: #339966;
  --row-alt: #f4f6f8;
  --row-hover: #e8f0f8;
}

body {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, Arial, sans-serif;
  font-size: 12px;
  background: var(--bg);
  color: var(--text);
  line-height: 1.4;
}

/* ============ APP LAYOUT ============ */
.app-layout { display: flex; flex-direction: column; height: 100vh; }

.toolbar {
  height: 36px;
  background: var(--toolbar-bg);
  color: #ccc;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
  font-size: 11px;
  flex-shrink: 0;
  border-bottom: 2px solid #0d1b2a;
}
.toolbar-left { display: flex; align-items: center; gap: 6px; }
.toolbar-logo {
  font-weight: 700;
  color: #fff;
  font-size: 16px;
  width: 22px; height: 22px;
  border: 2px solid #7fb3d3;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: #7fb3d3;
}
.toolbar-title { font-weight: 700; color: #7fb3d3; font-size: 13px; letter-spacing: 0.04em; }
.toolbar-sep { color: #555; }
.toolbar-sub { color: #888; font-size: 10px; }
.toolbar-right { display: flex; align-items: center; gap: 10px; }
.toolbar-status {
  font-size: 9px;
  padding: 1px 6px;
  background: #0d4f1c;
  color: #6fcf6f;
  border: 1px solid #2a7a2a;
  letter-spacing: 0.05em;
  font-weight: 600;
}

.app-body { display: flex; flex: 1; overflow: hidden; }

/* ============ SIDEBAR ============ */
.sidebar {
  width: 240px;
  background: #f0f0f0;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  overflow-y: auto;
}
.sidebar-header {
  padding: 6px 10px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #fff;
  background: var(--primary);
  border-bottom: 1px solid #124e66;
  position: sticky;
  top: 0;
  z-index: 1;
}
.sidebar-section {
  padding: 0;
}
.sidebar-topic {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 5px 10px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  background: #e0e0e0;
  border-bottom: 1px solid #d0d0d0;
  border-top: 1px solid #d0d0d0;
}
.sidebar-topic .topic-name { flex: 1; }
.topic-random-btn {
  background: transparent;
  border: none;
  padding: 0;
  width: 24px;
  height: 24px;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  border-radius: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: inherit;
}
.topic-random-btn:hover { background: var(--row-hover); }

.sidebar-case-card {
  padding: 6px 10px;
  border-bottom: 1px solid #d0d0d0;
  background: transparent;
}
.sidebar-case-card:hover { background: var(--row-hover); }
.case-name-row {
  font-size: 11px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}
.case-action-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.case-action-row .mastery-stars { font-size: 10px; color: var(--text-muted); white-space: nowrap; }
.case-start-btn {
  background: var(--primary);
  color: #fff;
  border: none;
  padding: 3px 12px;
  font-size: 10px;
  font-weight: 600;
  cursor: pointer;
  border-radius: 2px;
  font-family: inherit;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.case-start-btn:hover { background: #124e66; }

.sidebar-divider {
  height: 1px;
  background: var(--border);
  margin: 4px 0;
}
.sidebar-mode-btn {
  display: block;
  width: 100%;
  padding: 7px 10px;
  background: transparent;
  border: none;
  border-bottom: 1px solid #d0d0d0;
  cursor: pointer;
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  color: var(--primary);
  font-family: inherit;
}
.sidebar-mode-btn:hover { background: var(--row-hover); }

/* Mobile hamburger */
.mobile-nav { display: none; }
.hamburger {
  background: none;
  border: 1px solid #555;
  color: #ccc;
  width: 28px; height: 28px;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.hamburger:hover { background: rgba(255,255,255,0.1); }

/* ============ MAIN CONTENT ============ */
.main-content {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  background: var(--bg);
}

/* ============ DATA CARDS ============ */
.card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  margin-bottom: 10px;
}
.card-header {
  padding: 5px 10px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #fff;
  background: #5d6d7e;
  border-bottom: 1px solid var(--border);
}
.card-header.primary { background: var(--primary); }
.card-header.green { background: var(--green); }
.card-header.red { background: var(--red); }
.card-header.yellow { background: #b8860b; }
.card-body { padding: 10px; }
.card-body p { margin-bottom: 6px; }

/* ============ STATUS BAR ============ */
.status-bar {
  background: #d4e6f1;
  border-bottom: 2px solid var(--primary);
  padding: 6px 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 11px;
  margin-bottom: 10px;
}
.status-item { display: flex; align-items: center; gap: 4px; }
.status-label { font-weight: 700; color: var(--text); }
.status-value { color: var(--text-muted); }
.tier-badge {
  font-size: 9px;
  padding: 1px 6px;
  font-weight: 700;
  letter-spacing: 0.04em;
  border: 1px solid;
}
.tier-1 { background: var(--green-bg); color: var(--green); border-color: var(--green-border); }
.tier-2 { background: var(--yellow-bg); color: var(--yellow); border-color: var(--yellow-border); }
.tier-3 { background: var(--red-bg); color: var(--red); border-color: var(--red-border); }
.tier-4 { background: #e8daef; color: #6c3483; border-color: #6c3483; }

.report-status-badge {
  display: inline-block;
  padding: 2px 8px;
  font-size: 10px;
  border-radius: 3px;
  font-weight: 600;
  margin-left: 6px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.report-status-pending  { background: #fff3cd; color: #856404; }
.report-status-reviewed { background: #d4edda; color: #155724; }
.report-status-failed   { background: #f8d7da; color: #721c24; }

.report-badge {
  display: inline-block;
  background: #c33;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 8px;
  margin-left: 4px;
}

.btn-small {
  padding: 4px 10px !important;
  font-size: 10px !important;
}

/* ============ QUESTION OPTIONS ============ */
.option-list { list-style: none; }
.option-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-bottom: 1px solid #e0e0e0;
  cursor: pointer;
  font-size: 11px;
  transition: background 0.1s;
}
.option-row:hover { background: var(--row-hover); }
.option-row:nth-child(even) { background: var(--row-alt); }
.option-row:nth-child(even):hover { background: var(--row-hover); }
.option-row.selected { background: #cde4f5; border-left: 3px solid var(--primary); }
.option-row.correct { background: var(--green-bg); border-left: 3px solid var(--green); }
.option-row.incorrect { background: var(--red-bg); border-left: 3px solid var(--red); }
.option-row.missed { background: var(--yellow-bg); border-left: 3px solid var(--yellow-border); }
.option-row input[type="radio"],
.option-row input[type="checkbox"] {
  accent-color: var(--primary);
  pointer-events: none; /* row <li> is the only click target — prevents double-toggle race */
}
.option-text { flex: 1; }
.option-icon { font-size: 10px; font-weight: 700; min-width: 16px; text-align: center; }

/* ============ BUTTONS ============ */
.btn {
  padding: 6px 16px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  border: 1px solid;
  font-family: inherit;
}
.btn-primary { background: var(--primary); color: #fff; border-color: #124e66; }
.btn-primary:hover { background: #154360; }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-secondary { background: #d8d8d8; color: var(--text); border-color: var(--border); }
.btn-secondary:hover { background: #c8c8c8; }
.btn-green { background: var(--green); color: #fff; border-color: #004d26; }
.btn-green:hover { background: #005533; }
.btn-red { background: var(--red); color: #fff; border-color: #990000; }
.btn-red:hover { background: #aa0000; }
.btn-group { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }

/* ============ Q&A INPUT ============ */
.qa-section { margin-top: 8px; }
.qa-input-row { display: flex; gap: 6px; }
.qa-input {
  flex: 1;
  padding: 6px 8px;
  font-size: 11px;
  font-family: inherit;
  border: 1px solid var(--border);
  background: #fff;
}
.qa-input:focus { outline: 1px solid var(--primary); border-color: var(--primary); }
.qa-response {
  margin-top: 6px;
  padding: 6px 8px;
  font-size: 11px;
  background: var(--row-alt);
  border: 1px solid #e0e0e0;
  line-height: 1.5;
}

/* ============ FREE RESPONSE ============ */
.free-response-input {
  width: 100%;
  min-height: 80px;
  padding: 8px;
  font-size: 11px;
  font-family: inherit;
  border: 1px solid var(--border);
  resize: vertical;
}
.free-response-input:focus { outline: 1px solid var(--primary); border-color: var(--primary); }

/* ============ PROGRESS / MASTERY ============ */
.mastery-bar {
  display: inline-block;
  width: 60px;
  height: 6px;
  background: #ddd;
  border: 1px solid #bbb;
  vertical-align: middle;
}
.mastery-fill { height: 100%; background: var(--primary); }

.progress-table { width: 100%; border-collapse: collapse; font-size: 11px; }
.progress-table th {
  text-align: left;
  padding: 4px 10px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #333;
  background: #e8ecef;
  border-bottom: 2px solid var(--border);
  border-right: 1px solid #d0d0d0;
}
.progress-table th:last-child { border-right: none; }
.progress-table td {
  padding: 4px 10px;
  border-bottom: 1px solid #e0e0e0;
  border-right: 1px solid #eee;
}
.progress-table td:last-child { border-right: none; }
.progress-table tr:nth-child(even) { background: var(--row-alt); }
.progress-table tr:hover { background: var(--row-hover); }

/* ============ SPINNER ============ */
.spinner {
  width: 32px; height: 32px;
  border: 3px solid #ccc;
  border-top: 3px solid var(--primary);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  margin: 0 auto 8px;
}
@keyframes spin { to { transform: rotate(360deg); } }

.loading-card {
  text-align: center;
  padding: 2rem;
}
.loading-text {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 8px;
}

/* ============ WELCOME ============ */
.welcome { text-align: center; padding: 3rem 1rem; }
.welcome-icon {
  font-size: 32px;
  color: var(--primary);
  font-weight: 700;
  margin-bottom: 8px;
  width: 48px; height: 48px;
  border: 3px solid var(--primary);
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.welcome-title { font-size: 16px; font-weight: 600; color: var(--text); }
.welcome-sub { font-size: 11px; margin-top: 4px; color: var(--text-muted); }

/* ============ PICK GRID ============ */
.pick-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 8px;
}
.pick-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  padding: 10px;
  cursor: pointer;
  transition: background 0.1s;
}
.pick-card:hover { background: var(--row-hover); border-color: var(--primary); }
.pick-card.selected { background: #cde4f5; border-color: var(--primary); border-width: 2px; }
.pick-card.pick-card-disabled { opacity: 0.4; filter: grayscale(0.6); cursor: not-allowed; }
.pick-card.pick-card-disabled:hover { background: var(--card-bg); border-color: var(--border); }
.pick-card-title { font-size: 12px; font-weight: 600; }
.pick-card-sub { font-size: 10px; color: var(--text-muted); margin-top: 2px; }
.pick-card-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--row-alt);
  padding: 1px 6px;
  border-radius: 8px;
  margin-left: 4px;
}
.pick-card.pick-card-cram {
  border: 2px solid var(--yellow-border);
  background: var(--yellow-bg);
}
.pick-card.pick-card-cram:hover {
  background: #fff1c2;
  border-color: var(--yellow);
}
.pick-card.pick-card-cram.selected {
  background: #ffe69a;
  border-color: var(--yellow);
}
.pick-card.pick-card-cram .pick-card-title { color: var(--yellow); }
.pick-card.pick-card-cram .pick-card-sub::before {
  content: "\01F525 EXAM CRAM \00B7 ";
  font-weight: 700;
  color: var(--yellow);
}

/* ============ DASHBOARD TABS ============ */
.tab-row {
  display: flex;
  gap: 4px;
  margin-bottom: 10px;
  border-bottom: 2px solid var(--border);
}
.tab-btn {
  background: transparent;
  border: none;
  padding: 10px 16px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  min-height: 44px;
}
.tab-btn:hover { color: var(--primary); }
.tab-btn.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

/* ============ QUESTION BANK TREE ============ */
.qb-topic { margin-bottom: 12px; }
.qb-topic-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--primary);
  text-transform: uppercase;
  border-bottom: 1px solid var(--border);
  padding-bottom: 4px;
  margin-bottom: 6px;
}
.qb-case {
  border: 1px solid var(--border);
  margin-bottom: 4px;
  background: var(--card-bg);
}
.qb-case-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: var(--row-alt);
  flex-wrap: wrap;
  min-height: 44px;
}
.qb-case-toggle {
  background: transparent;
  border: none;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  color: var(--text);
  flex: 1;
  text-align: left;
  padding: 4px 0;
  min-height: 36px;
}
.qb-case-toggle:hover { color: var(--primary); }
.qb-case-count {
  font-size: 10px;
  color: var(--text-muted);
  font-weight: 600;
}
.qb-question-list { padding: 6px 10px; }
.qb-question {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 6px 0;
  border-bottom: 1px dashed var(--border);
}
.qb-question:last-child { border-bottom: none; }
.qb-question-label {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  cursor: pointer;
  font-size: 11px;
  min-height: 28px;
}
.qb-question-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin-top: 1px;
  cursor: pointer;
  flex-shrink: 0;
}
.qb-question-stem { flex: 1; line-height: 1.4; }
.qb-question-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 10px;
  color: var(--text-muted);
  margin-left: 26px;
}

/* ============ SELECT ROW (for count pickers) ============ */
.select-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin: 8px 0;
}
.select-pill {
  padding: 6px 16px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid var(--border);
  background: var(--card-bg);
  font-family: inherit;
}
.select-pill:hover { background: var(--row-hover); border-color: var(--primary); }
.select-pill.active { background: var(--primary); color: #fff; border-color: #124e66; }

/* ============ FEEDBACK SECTION ============ */
.feedback-correct { color: var(--green); font-weight: 700; }
.feedback-incorrect { color: var(--red); font-weight: 700; }
.feedback-partial { color: var(--yellow); font-weight: 700; }
.explanation { font-size: 11px; color: var(--text); margin-top: 6px; line-height: 1.5; }
.score-tag {
  display: inline-block;
  padding: 1px 6px;
  font-size: 10px;
  font-weight: 700;
  border: 1px solid;
}
.score-tag.perfect { background: var(--green-bg); color: var(--green); border-color: var(--green-border); }
.score-tag.partial { background: var(--yellow-bg); color: var(--yellow); border-color: var(--yellow-border); }
.score-tag.wrong { background: var(--red-bg); color: var(--red); border-color: var(--red-border); }

/* ============ RESULTS SUMMARY ============ */
.results-score {
  font-size: 20px;
  font-weight: 700;
  color: var(--primary);
  text-align: center;
  padding: 12px 0;
}
.results-pct {
  font-size: 14px;
  color: var(--text-muted);
}

/* ============ PIN LOGIN ============ */
.pin-container {
  display: grid;
  place-items: center;
  height: 100%;
  min-height: calc(100vh - 36px);
  background: #2c3e50;
}
.pin-card {
  background: #fff;
  padding: 2.5rem 3rem;
  width: 340px;
  text-align: center;
  border: 1px solid #999;
  box-shadow: 2px 2px 8px rgba(0,0,0,0.3);
}
.pin-logo {
  font-size: 2rem;
  font-weight: 700;
  color: var(--primary);
  width: 48px; height: 48px;
  border: 3px solid var(--primary);
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.75rem;
}
.pin-title { font-size: 1.5rem; color: var(--primary); letter-spacing: 0.05em; margin: 0; }
.pin-sub { color: var(--text-muted); font-size: 11px; margin-top: 0.25rem; }
.pin-divider { border-top: 1px solid #ddd; margin: 1.25rem 0; }
.pin-instructions { font-size: 11px; color: #666; margin-bottom: 1rem; line-height: 1.5; }
.pin-input {
  display: block;
  width: 120px;
  margin: 0 auto 1rem;
  padding: 10px;
  font-size: 24px;
  font-family: monospace;
  text-align: center;
  letter-spacing: 0.3em;
  border: 2px solid var(--border);
}
.pin-input:focus { outline: none; border-color: var(--primary); }
.pin-input-text {
  width: 100%;
  font-size: 16px;
  letter-spacing: 0;
  font-family: inherit;
  text-align: left;
}
.pin-error { color: var(--red); font-size: 11px; margin-bottom: 0.75rem; font-weight: 600; }
.pin-btn {
  width: 100%;
  padding: 10px;
  background: var(--primary);
  color: #fff;
  border: 1px solid #124e66;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  letter-spacing: 0.03em;
  font-family: inherit;
}
.pin-btn:hover { background: #154360; }
.pin-btn-row { display: flex; gap: 8px; }
.pin-btn-secondary {
  background: #d8d8d8;
  color: var(--text);
  border: 1px solid var(--border);
}
.pin-btn-secondary:hover { background: #c8c8c8; }

/* ============ LOGOUT ============ */
.logout-btn {
  background: none;
  border: 1px solid #555;
  color: #ccc;
  font-size: 9px;
  padding: 2px 8px;
  cursor: pointer;
  font-family: inherit;
  letter-spacing: 0.03em;
}
.logout-btn:hover { background: rgba(255,255,255,0.1); color: #fff; }

/* ============ MOBILE ============ */
@media (max-width: 768px) {
  body { font-size: 14px; }
  .sidebar { display: none; }
  .sidebar.mobile-open {
    display: flex;
    position: fixed;
    inset: 36px 0 0 0;
    width: 100%;
    z-index: 50;
    background: #f0f0f0;
    overflow-y: auto;
  }
  .mobile-nav { display: block; }
  .toolbar { height: 42px; }
  .main-content { padding: 8px; }
  .option-row { min-height: 44px; padding: 10px; font-size: 13px; }
  .btn { padding: 10px 16px; font-size: 13px; }
  .btn-group .btn { flex: 1; text-align: center; }
  .card-body { padding: 12px; }
  .card-header { padding: 7px 12px; font-size: 12px; }
  /* iOS zooms on focus whenever an input font-size is < 16px. Keep text inputs at 16px on mobile. */
  .qa-input { padding: 10px; font-size: 16px; }
  .free-response-input { font-size: 16px; min-height: 100px; padding: 10px; }
  .status-bar { font-size: 12px; padding: 8px 12px; }
  .pick-grid { grid-template-columns: 1fr; }
  .welcome { padding: 2rem 1rem; }

  /* Sidebar — bigger touch targets */
  .sidebar-topic { padding: 10px 14px; font-size: 12px; }
  .topic-random-btn {
    min-width: 44px;
    min-height: 44px;
    width: 44px;
    height: 44px;
    font-size: 20px;
  }
  .sidebar-mode-btn { padding: 14px 14px; font-size: 14px; min-height: 44px; }
  .sidebar-case-card { padding: 12px 14px; }
  .case-name-row { font-size: 14px; margin-bottom: 8px; }
  .case-action-row .mastery-stars { font-size: 13px; }
  .case-start-btn {
    min-height: 44px;
    min-width: 84px;
    padding: 10px 18px;
    font-size: 13px;
  }
}

/* ============ BIG ORV ============ */
#big-orv {
  position: fixed;
  bottom: 12px;
  right: 12px;
  z-index: 100;
  width: 84px;
  height: 92px;
  pointer-events: none; /* container doesn't block; only the body button does */
  font-family: inherit;
}
.orv-body {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 84px;
  height: 92px;
  background: transparent;
  border: none;
  padding: 0;
  cursor: pointer;
  pointer-events: auto;
  -webkit-tap-highlight-color: transparent;
}
.orv-svg-wrap {
  width: 100%;
  height: 100%;
  animation: orv-dance 2.4s ease-in-out infinite;
  transform-origin: 50% 90%;
  filter: drop-shadow(0 2px 3px rgba(0,0,0,0.25));
}
.orv-body:hover .orv-svg-wrap { animation-duration: 1.2s; }
.orv-body:active .orv-svg-wrap { transform: scale(0.95); }

@keyframes orv-dance {
  0%   { transform: translateY(0)    rotate(-3deg); }
  25%  { transform: translateY(-3px) rotate(2deg);  }
  50%  { transform: translateY(0)    rotate(3deg);  }
  75%  { transform: translateY(-3px) rotate(-2deg); }
  100% { transform: translateY(0)    rotate(-3deg); }
}

.orv-bubble {
  position: absolute;
  bottom: 96px;
  right: 0;
  max-width: 240px;
  min-width: 120px;
  background: #fff;
  color: var(--text);
  border: 2px solid var(--primary);
  border-radius: 6px;
  padding: 8px 12px;
  font-size: 12px;
  line-height: 1.4;
  box-shadow: 2px 2px 6px rgba(0,0,0,0.2);
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 180ms ease, transform 180ms ease;
  pointer-events: none;
  white-space: normal;
  word-wrap: break-word;
}
.orv-bubble.visible {
  opacity: 1;
  transform: translateY(0);
}
.orv-bubble::after {
  content: '';
  position: absolute;
  bottom: -8px;
  right: 30px;
  width: 0; height: 0;
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  border-top: 8px solid var(--primary);
}

@media (max-width: 768px) {
  #big-orv {
    width: 64px;
    height: 72px;
    bottom: 8px;
    right: 8px;
  }
  .orv-body { width: 64px; height: 72px; }
  .orv-bubble {
    bottom: 76px;
    max-width: 200px;
    font-size: 13px;
    padding: 8px 10px;
  }
}
