:root {
  --cream: #FAF7F2;
  --cream-2: #F4EFE6;
  --surface: #FFFFFF;
  --ink: #1A2E26;
  --ink-soft: #5A6B63;
  --forest: #1F4D3F;
  --forest-deep: #143329;
  --caramel: #C4956C;
  --border: #E5DFD5;
  --border-strong: #D4CCBC;
  --success: #4A7C59;
  --error: #B85450;
  --shadow: 0 1px 2px rgba(20, 51, 41, 0.04), 0 8px 24px rgba(20, 51, 41, 0.06);
  --shadow-lg: 0 4px 12px rgba(20, 51, 41, 0.08), 0 24px 48px rgba(20, 51, 41, 0.10);
}

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

body {
  font-family: 'Manrope', sans-serif;
  background: var(--cream);
  color: var(--ink);
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  background-image:
    radial-gradient(circle at 12% 18%, rgba(31, 77, 63, 0.04) 0%, transparent 40%),
    radial-gradient(circle at 88% 78%, rgba(196, 149, 108, 0.05) 0%, transparent 45%);
}

/* ========== VUE PATIENT (publique) ========== */

.patient-view {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 24px 80px;
  position: relative;
  gap: 40px;
}

.settings-trigger {
  position: fixed;
  top: 20px;
  right: 20px;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink-soft);
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: all 0.2s;
  z-index: 5;
  box-shadow: var(--shadow);
}
.settings-trigger:hover {
  color: var(--forest);
  border-color: var(--border-strong);
  transform: rotate(45deg);
}

.patient-brand {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}
.brand-mark {
  width: 42px; height: 42px;
  border-radius: 12px;
  display: block;
  object-fit: contain;
}
.brand-mark.big {
  width: 72px; height: 72px;
  border-radius: 18px;
}
.patient-brand h1 {
  font-family: 'Fraunces', serif;
  font-size: 32px;
  font-weight: 500;
  letter-spacing: -0.01em;
}
.patient-tagline {
  font-size: 14px;
  color: var(--ink-soft);
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-weight: 500;
}

.patient-qr-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 36px 40px;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 480px;
  width: 100%;
}

.qr-frame {
  background: white;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 20px;
  position: relative;
}
.qr-frame.big { padding: 24px; }
.qr-frame::before, .qr-frame::after {
  content: '';
  position: absolute;
  width: 18px; height: 18px;
  border: 2px solid var(--forest);
}
.qr-frame::before {
  top: -2px; left: -2px;
  border-right: none; border-bottom: none;
  border-top-left-radius: 8px;
}
.qr-frame::after {
  bottom: -2px; right: -2px;
  border-left: none; border-top: none;
  border-bottom-right-radius: 8px;
}
#qrcode canvas, #qrcode img { display: block; }

.patient-instruction {
  margin-top: 22px;
  font-size: 15px;
  color: var(--ink-soft);
  text-align: center;
}

.patient-divider {
  display: flex;
  align-items: center;
  width: 100%;
  margin: 18px 0 14px;
  color: var(--ink-soft);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
.patient-divider::before, .patient-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}
.patient-divider span { padding: 0 12px; }

.url-display {
  width: 100%;
  padding: 12px;
  background: var(--cream-2);
  border-radius: 10px;
  font-size: 12px;
  font-family: monospace;
  color: var(--ink-soft);
  word-break: break-all;
  text-align: center;
  margin-bottom: 12px;
}
.patient-url { font-size: 11px; }

.copy-btn { padding: 8px 14px; font-size: 13px; }

.patient-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
}

.patient-status {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 100px;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-soft);
}
.status-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--ink-soft);
  box-shadow: 0 0 0 0 rgba(74, 124, 89, 0.4);
}
.status-dot.ready {
  background: var(--success);
  animation: pulse 2s infinite;
}
.status-dot.connected {
  background: var(--caramel);
  animation: pulse 1.4s infinite;
}
.status-dot.error { background: var(--error); }
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(74, 124, 89, 0.5); }
  70% { box-shadow: 0 0 0 8px rgba(74, 124, 89, 0); }
  100% { box-shadow: 0 0 0 0 rgba(74, 124, 89, 0); }
}

@media (max-width: 600px) {
  .patient-view { padding: 32px 16px 60px; gap: 28px; }
  .patient-brand h1 { font-size: 24px; }
  .patient-qr-wrap { padding: 24px 20px; }
  .settings-trigger { top: 12px; right: 12px; }
}

/* ========== SETTINGS OVERLAY ========== */

.settings-overlay {
  position: fixed;
  inset: 0;
  background: rgba(20, 51, 41, 0.45);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 24px;
  animation: fadeIn 0.18s ease;
}
.settings-overlay[hidden] { display: none; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.settings-modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  width: 100%;
  max-width: 920px;
  height: min(720px, calc(100vh - 48px));
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
  animation: slideUp 0.22s ease;
  overflow: hidden;
}
@keyframes slideUp {
  from { opacity: 0; transform: translateY(12px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.settings-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
}
.settings-header h2 {
  font-family: 'Fraunces', serif;
  font-size: 20px;
  font-weight: 500;
  letter-spacing: -0.01em;
}

.settings-gate {
  flex: 1;
  min-height: 0;
  padding: 48px 32px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
/* L'attribut [hidden] doit l'emporter sur display:flex (sinon le gate
   et le content restent affichés ensemble après auth). */
.settings-gate[hidden],
.settings-content[hidden] { display: none; }
.gate-icon {
  width: 64px; height: 64px;
  border-radius: 50%;
  background: var(--cream-2);
  color: var(--forest);
  display: grid; place-items: center;
  margin-bottom: 18px;
}
.settings-gate h3 {
  font-family: 'Fraunces', serif;
  font-size: 22px;
  font-weight: 500;
  margin-bottom: 6px;
}
.settings-gate > p {
  color: var(--ink-soft);
  font-size: 14px;
  margin-bottom: 24px;
}
.gate-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  max-width: 320px;
}
.gate-error {
  margin-top: 14px;
  font-size: 13px;
  color: var(--error);
  font-weight: 500;
}
.gate-form .config-input { text-align: center; font-size: 15px; padding: 12px 14px; }
.gate-form .btn { justify-content: center; }

/* ========== LOGIN OVERLAY (auth serveur) ========== */
/* Plein écran, opaque : bloque l'app entière tant que pas authentifié.
   Distinct du settings-overlay (qui est le gate UX patient-facing). */
.login-overlay {
  position: fixed;
  inset: 0;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 24px;
}
.login-overlay[hidden] { display: none; }
.login-modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  width: 100%;
  max-width: 420px;
  padding: 40px 32px 32px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  box-shadow: var(--shadow-lg);
}
.login-icon {
  width: 64px; height: 64px;
  border-radius: 50%;
  background: var(--cream-2);
  color: var(--forest);
  display: grid; place-items: center;
  margin-bottom: 18px;
}
.login-modal h2 {
  font-family: 'Fraunces', serif;
  font-size: 22px;
  font-weight: 500;
  margin-bottom: 6px;
}
.login-help {
  color: var(--ink-soft);
  font-size: 14px;
  margin-bottom: 22px;
}
.login-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  max-width: 320px;
}
.login-form .config-input { text-align: center; font-size: 15px; padding: 12px 14px; }
.login-form .btn { justify-content: center; }
.login-error {
  margin-top: 14px;
  font-size: 13px;
  color: var(--error);
  font-weight: 500;
}

.settings-section-divider {
  height: 1px;
  background: var(--border);
  margin: 28px 0 20px;
}
.settings-subtitle {
  font-family: 'Fraunces', serif;
  font-size: 16px;
  font-weight: 500;
  margin-bottom: 6px;
}

/* Layout sidebar + content. flex:1 + min-height:0 = condition pour que
   les enfants scrollables (.settings-nav, .settings-panes) respectent
   bien la hauteur max du modal au lieu de pousser le footer hors de
   l'écran sur petites fenêtres. */
.settings-content {
  display: flex;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.settings-nav {
  width: 200px;
  flex-shrink: 0;
  border-right: 1px solid var(--border);
  background: var(--cream);
  padding: 14px 10px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.settings-tab {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border: 1px solid transparent;
  background: transparent;
  border-radius: 10px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-soft);
  cursor: pointer;
  text-align: left;
  transition: background 0.15s, color 0.15s;
}
.settings-tab svg { flex-shrink: 0; opacity: 0.85; }
.settings-tab > span:not(.tab-badge) { flex: 1; min-width: 0; }
.settings-tab:hover { background: var(--cream-2); color: var(--ink); }
.settings-tab.is-active {
  background: var(--surface);
  color: var(--forest-deep);
  border-color: var(--border);
  box-shadow: var(--shadow);
}
.settings-tab.is-active svg { opacity: 1; color: var(--forest); }

.tab-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 100px;
  background: var(--forest);
  color: var(--cream);
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
}

.settings-panes {
  flex: 1;
  min-width: 0;
  min-height: 0;
  overflow-y: auto;
  padding: 24px 28px 28px;
}

.settings-pane[hidden] { display: none; }
.settings-pane {
  animation: paneFade 0.18s ease;
}
@keyframes paneFade {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

.settings-section-title {
  font-family: 'Fraunces', serif;
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 4px;
  letter-spacing: -0.01em;
}
.settings-help {
  font-size: 13px;
  color: var(--ink-soft);
  margin-bottom: 14px;
}

.settings-actions-row {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 14px;
  flex-wrap: wrap;
}

.turn-details { margin-top: 12px; }
.turn-details summary {
  cursor: pointer;
  font-size: 12px;
  color: var(--ink-soft);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 6px 0;
}

/* ========== Inputs / boutons partagés ========== */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  border: none;
  border-radius: 10px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}
.btn-primary {
  background: var(--forest);
  color: var(--cream);
}
.btn-primary:hover { background: var(--forest-deep); transform: translateY(-1px); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.btn-ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--border-strong);
}
.btn-ghost:hover { background: var(--cream-2); }

.config-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 10px;
}
.config-row label {
  font-size: 12px;
  color: var(--ink-soft);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.config-input {
  padding: 10px 12px;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  font-family: inherit;
  font-size: 13px;
  background: var(--surface);
}
.config-input:focus { outline: 2px solid var(--forest); outline-offset: -1px; }

.code-display {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  background: var(--cream-2);
  border-radius: 100px;
  font-family: monospace;
  font-size: 14px;
  font-weight: 600;
  color: var(--forest);
}

.folder-display {
  margin-top: 12px;
  padding: 10px 14px;
  background: var(--cream-2);
  border-radius: 10px;
  font-size: 13px;
  font-family: 'Manrope', monospace;
  color: var(--forest);
  display: none;
}
.folder-display.shown { display: block; }

.icon-btn {
  width: 36px; height: 36px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  border-radius: 10px;
  cursor: pointer;
  display: grid; place-items: center;
  color: var(--ink-soft);
  transition: all 0.15s;
  flex-shrink: 0;
}
.icon-btn:hover { background: var(--cream-2); color: var(--ink); }
.icon-btn.spinning svg { animation: rotate 1s linear; }
@keyframes rotate { to { transform: rotate(360deg); } }

.card-header-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 6px;
}

/* ========== Hygiène ========== */

.hygiene-summary {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 12px;
  margin: 18px 0;
}
.stat-tile {
  padding: 16px 14px;
  background: var(--cream-2);
  border-radius: 14px;
  border: 1px solid var(--border);
  text-align: center;
  transition: all 0.2s;
}
.stat-tile.warning {
  background: rgba(184, 84, 80, 0.06);
  border-color: rgba(184, 84, 80, 0.3);
}
.stat-tile.warning.zero {
  background: rgba(74, 124, 89, 0.05);
  border-color: rgba(74, 124, 89, 0.2);
}
.stat-num {
  font-family: 'Fraunces', serif;
  font-size: 28px;
  font-weight: 500;
  color: var(--ink);
  line-height: 1;
  letter-spacing: -0.02em;
}
.stat-tile.warning .stat-num { color: var(--error); }
.stat-tile.warning.zero .stat-num { color: var(--success); }
.stat-label {
  font-size: 11px;
  color: var(--ink-soft);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 600;
  margin-top: 6px;
}

.cleanup-bar {
  display: none;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: rgba(184, 84, 80, 0.08);
  border: 1px solid rgba(184, 84, 80, 0.3);
  border-radius: 12px;
  margin-bottom: 18px;
}
.cleanup-bar.shown { display: flex; }
.cleanup-bar-text {
  flex: 1;
  font-size: 13px;
  color: var(--error);
  font-weight: 500;
}
.cleanup-bar button {
  padding: 8px 14px;
  background: var(--error);
  color: white;
  border: none;
  border-radius: 8px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  flex-shrink: 0;
}
.cleanup-bar button:hover { background: #9F4844; }

.hygiene-list { display: flex; flex-direction: column; gap: 8px; }

.hygiene-empty {
  padding: 36px 20px;
  text-align: center;
  color: var(--ink-soft);
  font-size: 13px;
  font-style: italic;
  background: var(--cream-2);
  border-radius: 12px;
}

.hygiene-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--cream-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  transition: all 0.15s;
}
.hygiene-item.stale {
  background: rgba(184, 84, 80, 0.05);
  border-color: rgba(184, 84, 80, 0.25);
}
.hygiene-status-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--success);
  flex-shrink: 0;
  box-shadow: 0 0 0 3px rgba(74, 124, 89, 0.15);
}
.hygiene-item.stale .hygiene-status-dot {
  background: var(--error);
  box-shadow: 0 0 0 3px rgba(184, 84, 80, 0.18);
  animation: stalePulse 2.5s infinite;
}
@keyframes stalePulse {
  0%, 100% { box-shadow: 0 0 0 3px rgba(184, 84, 80, 0.18); }
  50% { box-shadow: 0 0 0 6px rgba(184, 84, 80, 0.05); }
}

.hygiene-info { flex: 1; min-width: 0; }
.hygiene-name {
  font-weight: 600;
  font-size: 13px;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.hygiene-meta {
  font-size: 12px;
  color: var(--ink-soft);
  margin-top: 2px;
  display: flex;
  gap: 8px;
  align-items: center;
}
.stale-tag {
  display: inline-block;
  background: var(--error);
  color: white;
  padding: 2px 8px;
  border-radius: 100px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.hygiene-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}
.hygiene-btn {
  width: 32px; height: 32px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  border-radius: 8px;
  cursor: pointer;
  display: grid; place-items: center;
  color: var(--ink-soft);
  transition: all 0.15s;
}
.hygiene-btn:hover { background: var(--cream-2); color: var(--ink); }
.hygiene-btn.danger:hover { background: var(--error); color: white; border-color: var(--error); }

.hygiene-disabled {
  padding: 20px;
  text-align: center;
  color: var(--ink-soft);
  font-size: 13px;
  background: var(--cream-2);
  border-radius: 12px;
}

/* ========== Journal ========== */

.log-empty {
  padding: 40px 20px;
  text-align: center;
  color: var(--ink-soft);
  font-size: 14px;
  font-style: italic;
}
.log-list { display: flex; flex-direction: column; gap: 10px; }
.log-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: var(--cream-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  animation: slideIn 0.4s ease;
}
@keyframes slideIn {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}
.log-icon {
  width: 38px; height: 38px;
  background: var(--surface);
  border-radius: 10px;
  display: grid; place-items: center;
  flex-shrink: 0;
  color: var(--forest);
}
.log-info { flex: 1; min-width: 0; }
.log-name {
  font-weight: 600;
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.log-meta {
  font-size: 12px;
  color: var(--ink-soft);
  margin-top: 2px;
}
.log-status {
  font-size: 11px;
  padding: 4px 10px;
  border-radius: 100px;
  background: rgba(74, 124, 89, 0.1);
  color: var(--success);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.progress {
  height: 4px;
  background: var(--border);
  border-radius: 100px;
  overflow: hidden;
  margin-top: 6px;
}
.progress-bar {
  height: 100%;
  background: var(--forest);
  transition: width 0.2s;
}

/* ========== Toasts / warnings ========== */

#toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 1000;
}
.toast {
  background: var(--ink);
  color: var(--cream);
  padding: 14px 20px;
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  font-size: 14px;
  font-weight: 500;
  animation: toastIn 0.3s ease;
  max-width: 360px;
}
.toast.success { background: var(--success); }
.toast.error { background: var(--error); }
@keyframes toastIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

.browser-warning {
  background: rgba(184, 84, 80, 0.08);
  border: 1px solid rgba(184, 84, 80, 0.25);
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 16px;
  font-size: 13px;
  color: var(--error);
}

/* ========== Settings : layout responsive ========== */

/* Sur petits écrans, la sidebar passe au-dessus en barre d'onglets
   horizontale qui scroll. Plus besoin de scroller la modal entière —
   chaque pane gère son propre overflow. */
@media (max-width: 720px) {
  .settings-overlay { padding: 0; }
  .settings-modal {
    max-width: 100%;
    height: 100vh;
    max-height: 100vh;
    border-radius: 0;
    border: none;
  }
  .settings-content { flex-direction: column; }
  .settings-nav {
    width: 100%;
    flex-direction: row;
    overflow-x: auto;
    overflow-y: hidden;
    border-right: none;
    border-bottom: 1px solid var(--border);
    padding: 10px 14px;
    gap: 6px;
    scrollbar-width: thin;
  }
  .settings-tab {
    flex-shrink: 0;
    width: auto;
    padding: 8px 14px;
    white-space: nowrap;
  }
  .settings-tab > span:not(.tab-badge) { flex: 0 1 auto; }
  .settings-panes { padding: 20px 18px 24px; }
}

/* ========== Multi-room additions ========== */

.restore-banner {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 12px 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 14px;
  box-shadow: var(--shadow);
}
/* Override display:flex so [hidden] cache vraiment le banner. */
.restore-banner[hidden] { display: none; }
.restore-banner strong { color: var(--forest-deep); font-weight: 600; }
.restore-banner-icon {
  width: 36px; height: 36px;
  border-radius: 10px;
  background: var(--cream-2);
  color: var(--forest);
  display: grid; place-items: center;
  flex-shrink: 0;
}
.restore-banner-text { flex: 1; min-width: 0; color: var(--ink); }
.restore-banner .btn { padding: 8px 16px; font-size: 13px; }

@media (max-width: 600px) {
  .restore-banner { padding: 10px 14px; gap: 10px; font-size: 13px; }
  .restore-banner-icon { width: 32px; height: 32px; }
}

.folder-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.nfc-tag-urls {
  font-family: 'JetBrains Mono', 'Menlo', monospace;
  font-size: 12px;
  background: var(--cream-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 10px;
  word-break: break-all;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

#sessionsList {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.session-item {
  display: grid;
  grid-template-columns: auto auto auto 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  font-size: 13px;
}
.session-item.status-connected,
.session-item.status-transferring {
  border-color: rgba(31, 77, 63, 0.35);
  background: rgba(31, 77, 63, 0.04);
}
.session-item.status-done { opacity: 0.6; }
.session-item.status-failed { border-color: rgba(184, 84, 80, 0.35); background: rgba(184, 84, 80, 0.04); }

.session-code {
  font-family: 'JetBrains Mono', 'Menlo', monospace;
  font-size: 12px;
  font-weight: 600;
  color: var(--forest-deep);
}
.session-status {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--cream-2);
  color: var(--ink-soft);
}
.session-progress { font-size: 12px; color: var(--ink-soft); }
.session-patient { font-size: 12px; font-weight: 600; color: var(--ink); }
.session-abort {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 6px;
  width: 24px;
  height: 24px;
  font-size: 12px;
  color: var(--ink-soft);
  cursor: pointer;
  line-height: 1;
}
.session-abort:hover { color: var(--error); border-color: rgba(184, 84, 80, 0.35); }

.log-code {
  display: inline-block;
  font-family: 'JetBrains Mono', 'Menlo', monospace;
  font-size: 10px;
  padding: 1px 6px;
  margin-right: 6px;
  border-radius: 4px;
  background: var(--cream-2);
  color: var(--ink-soft);
}
