:root {
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: #0f172a;
  background-color: #f9fafb;
  --app-viewport-height: 100dvh;
}

* {
  box-sizing: border-box;
}

body, html {
  margin: 0;
  height: 100%;
  overscroll-behavior-y: none;
  overflow: hidden;
  -webkit-text-size-adjust: 100%;
}

body.pane-lock {
  overflow: hidden;
}

[hidden] {
  display: none !important;
}

.layout {
  display: grid;
  grid-template-columns: 220px 1fr 280px;
  height: var(--app-viewport-height);
  min-height: var(--app-viewport-height);
  overflow: hidden;
  overscroll-behavior: none;
}

.pane {
  border-right: 1px solid #e2e8f0;
  background-color: #fff;
  display: flex;
  flex-direction: column;
  min-height: 0;
  min-width: 0;
}

.left {
  background-color: #0f172a;
  color: #f8fafc;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.pane-header {
  padding: 1rem;
  font-weight: 600;
  border-bottom: 1px solid rgba(248, 250, 252, 0.2);
}

.pane-brand {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  min-height: 96px;
  padding: 0.9rem 1rem;
}

.pane-brand-mark {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  width: 100%;
  min-height: 70px;
  padding: 0.2rem 0.15rem;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.03);
}

.brand-logo-drawer {
  height: 56px;
  width: auto;
  max-width: 100%;
  object-fit: contain;
}

.brand-logo-drawer-dark {
  filter: none;
}

#nav-list {
  list-style: none;
  margin: 0;
  padding: 0;
  flex: 1;
  overflow-y: auto;
  min-height: 0;
}

#nav-list li {
  padding: 0.75rem 1rem;
  cursor: pointer;
}

.nav-item-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.nav-badge {
  min-width: 1.25rem;
  height: 1.25rem;
  border-radius: 999px;
  background: #f97316;
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0 0.35rem;
}

#nav-list li.active {
  background-color: rgba(148, 163, 184, 0.2);
}

.main {
  background-color: #f1f5f9;
  min-height: 0;
  overflow: hidden;
  touch-action: pan-y;
  overscroll-behavior: none;
}

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  background-color: #fff;
  border-bottom: 1px solid #e2e8f0;
}

.toolbar-center {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  min-width: 0;
}

.brand-logo {
  display: block;
  height: 24px;
  width: auto;
  object-fit: contain;
}

.brand-logo-light {
  filter: saturate(1.02);
}

.content {
  flex: 1;
  min-height: 0;
  padding: 1rem;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: contain;
}

.hint {
  color: #475569;
  font-size: 0.9rem;
}

.right.hidden {
  display: none;
}

.right {
  min-height: 0;
}

.pane-scrim {
  position: fixed;
  inset: 0;
  z-index: 8;
  border: 0;
  background: rgba(15, 23, 42, 0.28);
  opacity: 1;
  transition: opacity 0.22s ease;
}

.bottom-carrier-backdrop {
  position: fixed;
  inset: 0;
  z-index: 12;
  border: 0;
  background: rgba(15, 23, 42, 0.18);
}

.bottom-carrier {
  position: fixed;
  left: 1rem;
  right: 1rem;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 0.5rem);
  z-index: 10;
  pointer-events: none;
}

.bottom-carrier-shell {
  margin-left: auto;
  margin-right: auto;
  width: min(720px, 100%);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  overflow: visible;
  pointer-events: none;
}

.bottom-carrier-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem 1rem 0.75rem;
  border-bottom: 1px solid #e2e8f0;
  background: rgba(248, 250, 252, 0.92);
}

.bottom-carrier-kicker {
  margin: 0 0 0.2rem;
  color: #64748b;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.bottom-carrier-title {
  margin: 0;
  font-size: 1rem;
}

.bottom-carrier-close {
  border: 1px solid #cbd5e1;
  background: #fff;
  color: #0f172a;
  border-radius: 999px;
  padding: 0.45rem 0.8rem;
  cursor: pointer;
}

.bottom-panel {
  min-height: 0;
  overflow-y: auto;
}

.bottom-practice-visibility {
  padding: 0;
  pointer-events: auto;
}

.bottom-practice-visibility-card {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  border: 1px solid #dbeafe;
  background: #f8fbff;
  border-radius: 16px;
  padding: 0.85rem 0.95rem;
}

.bottom-workspace-card {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  border: 1px solid #dbeafe;
  background: #f8fbff;
  border-radius: 16px;
  padding: 0.85rem 0.95rem;
}

.bottom-workspace-shell {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0;
  border: 1px solid rgba(249, 115, 22, 0.26);
  border-radius: 22px 22px 0 0;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.99) 0%, rgba(241, 245, 249, 0.985) 100%);
  box-shadow:
    0 20px 40px rgba(15, 23, 42, 0.18),
    0 0 0 1px rgba(255, 255, 255, 0.55) inset,
    inset 0 1px 0 rgba(255, 255, 255, 0.92),
    inset 0 -10px 20px rgba(148, 163, 184, 0.08);
  overflow: hidden;
}

.bottom-workspace-shell.is-open {
  border-color: rgba(249, 115, 22, 0.42);
  box-shadow:
    0 24px 48px rgba(15, 23, 42, 0.2),
    0 0 0 1px rgba(254, 215, 170, 0.7) inset,
    0 -6px 18px rgba(251, 146, 60, 0.18),
    inset 0 2px 0 rgba(255, 247, 237, 0.9),
    inset 0 -14px 26px rgba(251, 146, 60, 0.08);
}

.bottom-workspace-shell::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 22px;
  background: linear-gradient(180deg, rgba(241, 245, 249, 0) 0%, rgba(241, 245, 249, 0.98) 70%);
  pointer-events: none;
}

.bottom-workspace-panel {
  max-height: min(48vh, 460px);
  overflow-y: auto;
  padding: 0.55rem 0.95rem 0.7rem;
  border-bottom: 1px solid rgba(249, 115, 22, 0.18);
  background:
    linear-gradient(180deg, rgba(255, 251, 235, 0.94) 0%, rgba(255, 255, 255, 0.98) 18%, rgba(248, 250, 252, 0.97) 100%);
  animation: bottom-workspace-rise 0.2s cubic-bezier(0.22, 1, 0.36, 1);
  box-shadow:
    inset 0 1px 0 rgba(255, 247, 237, 0.95),
    inset 0 -12px 18px rgba(251, 146, 60, 0.05);
}

.bottom-workspace-handle-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 0;
  padding: 0.35rem 0 0.35rem;
  cursor: ns-resize;
  touch-action: none;
  background:
    linear-gradient(180deg, rgba(255, 250, 245, 0.98) 0%, rgba(255, 252, 248, 0.94) 100%);
  border-bottom: 1px solid rgba(249, 115, 22, 0.08);
}

.bottom-workspace-handle {
  display: block;
  width: calc(100% - 1.5rem);
  height: 4px;
  border-radius: 999px 999px 0 0;
  background: linear-gradient(90deg, rgba(249, 115, 22, 0) 0%, rgba(249, 115, 22, 0.9) 18%, rgba(234, 88, 12, 0.92) 50%, rgba(249, 115, 22, 0.9) 82%, rgba(249, 115, 22, 0) 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 247, 237, 0.85),
    0 2px 8px rgba(249, 115, 22, 0.12);
}

.bottom-workspace-base {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  padding: 0.65rem 0.75rem calc(0.7rem + env(safe-area-inset-bottom, 0px));
  background:
    linear-gradient(180deg, rgba(255, 250, 245, 0.98) 0%, rgba(241, 245, 249, 0.98) 100%);
}

.bottom-workspace-inline-coach {
  margin-top: 0.65rem;
  border-top: 1px solid #dbeafe;
  padding-top: 0.65rem;
}

.bottom-workspace-inline-coach .hint {
  margin: 0;
  color: #475569;
}

.bottom-workspace-voice-panel {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.bottom-workspace-voice-timer {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 700;
  color: #9a3412;
  font-variant-numeric: tabular-nums;
  min-width: 4.5ch;
}

.bottom-workspace-voice-error {
  margin: 0;
  color: #b91c1c;
  font-size: 0.88rem;
}

.bottom-workspace-voice-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.bottom-workspace-tts-panel {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  border-top: 1px solid #dbeafe;
  padding-top: 0.65rem;
}

.bottom-workspace-tts-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  align-items: end;
}

.bottom-workspace-tts-field {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 8rem;
}

.bottom-workspace-tts-label {
  font-size: 0.78rem;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.bottom-workspace-tts-select {
  border: 1px solid #cbd5e1;
  border-radius: 0.8rem;
  background: #fff;
  color: #0f172a;
  padding: 0.42rem 0.7rem;
  font: inherit;
}

.bottom-workspace-tts-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.bottom-workspace-tts-status-stale {
  color: #9a3412;
}

.bottom-workspace-primary {
  display: flex;
  flex-direction: column;
}

.bottom-workspace-status-lines {
  display: flex;
  flex-direction: column;
  gap: 0.14rem;
}

.bottom-workspace-status-line {
  margin: 0;
  font-size: 0.83rem;
  line-height: 1.28;
  color: #334155;
}

.bottom-workspace-actions {
  display: flex;
  gap: 0.45rem;
  flex-wrap: wrap;
  justify-content: flex-start;
  padding-top: 0.1rem;
}

.bottom-workspace-toggle {
  border: 1px solid rgba(148, 163, 184, 0.32);
  background: rgba(255, 255, 255, 0.78);
  color: #1e293b;
  border-radius: 999px;
  padding: 0.38rem 0.76rem;
  font-size: 0.86rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.7) inset;
  transition:
    background 0.16s ease,
    border-color 0.16s ease,
    color 0.16s ease,
    transform 0.08s ease,
    box-shadow 0.16s ease;
}

.bottom-workspace-toggle:active {
  transform: translateY(1px);
}

.bottom-workspace-toggle.is-active,
.bottom-workspace-toggle[aria-pressed="true"] {
  border-color: rgba(251, 146, 60, 0.72);
  background: linear-gradient(180deg, #ea580c 0%, #9a3412 100%);
  color: #fff7ed;
  box-shadow:
    0 8px 16px rgba(234, 88, 12, 0.24),
    0 0 0 1px rgba(255, 237, 213, 0.24) inset;
}

.bottom-workspace-panel-status {
  margin-top: 0.75rem;
  padding: 0.62rem 0.7rem;
  border: 1px solid rgba(251, 146, 60, 0.18);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(255, 247, 237, 0.82) 0%, rgba(255, 255, 255, 0.78) 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.8),
    inset 0 -8px 16px rgba(251, 146, 60, 0.04);
}

.bottom-workspace-primary {
  border-top: 1px solid #dbeafe;
  padding-top: 0.7rem;
}

.bottom-workspace-transcript-placeholder {
  border: 1px dashed #93c5fd;
  border-radius: 12px;
  background: #eff6ff;
  padding: 0.75rem 0.85rem;
  color: #1e3a8a;
}

.bottom-workspace-plugin-output {
  border: 1px dashed #a7f3d0;
  border-radius: 12px;
  background: #f0fdf4;
  padding: 0.75rem 0.85rem;
  color: #14532d;
}

.bottom-practice-visibility-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.bottom-practice-kicker {
  margin: 0;
  color: #9a3412;
  font-size: 0.73rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.bottom-practice-state {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0.18rem 0.52rem;
  background: rgba(255, 237, 213, 0.92);
  color: #9a3412;
  font-size: 0.72rem;
  font-weight: 700;
}

.bottom-practice-signals {
  margin: 0;
  padding-left: 1rem;
  color: #334155;
}

.bottom-practice-signals li + li {
  margin-top: 0.3rem;
}

.bottom-practice-coach-title {
  margin: 0 0 0.35rem;
  color: #1e3a8a;
  font-size: 0.82rem;
  font-weight: 700;
}

@keyframes bottom-workspace-rise {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

body.bottom-workspace-resizing {
  user-select: none;
}

.drawer-utility-panels {
  padding: 0 0.75rem 0.9rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.drawer-utility-panel {
  width: 100%;
  color: #0f172a;
  background: #fff;
  border: 1px solid rgba(226, 232, 240, 0.28);
  border-radius: 14px;
  overflow: hidden;
}

.left.has-drawer-panel #nav-list {
  flex: 0 0 auto;
}

body.keyboard-open .bottom-carrier {
  pointer-events: none;
}

.feedback-entry {
  margin: 1rem;
  padding: 0.75rem;
  border: 1px solid rgba(248, 250, 252, 0.2);
  background: transparent;
  color: inherit;
  cursor: pointer;
  touch-action: manipulation;
}

.feedback-entry.bottom-trigger-active {
  background: rgba(248, 250, 252, 0.12);
  border-color: rgba(248, 250, 252, 0.42);
}

button {
  touch-action: manipulation;
}

#feedback-dialog {
  padding: 0;
}

#feedback-form {
  padding: 1.25rem 1.25rem 1.5rem;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

#quest-dialog {
  padding: 0;
}

#quest-form {
  padding: 1.25rem 1.25rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.quest-task {
  min-height: 4rem;
}

.quest-word {
  font-size: 0.9rem;
  color: #475569;
  margin-top: -0.5rem;
}

.quest-context {
  font-size: 0.85rem;
  color: #64748b;
  margin: 0;
}

.quest-history {
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 0.5rem;
  font-size: 0.85rem;
  max-height: 140px;
  overflow-y: auto;
}

.quest-history p {
  margin: 0.25rem 0;
}

.quest-answer-label,
.quest-rating-label {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.9rem;
}

.quest-answer {
  min-height: 80px;
  resize: vertical;
}

.capture-form {
  margin-top: 1rem;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.capture-form textarea {
  min-height: 120px;
}

.ticket-history {
  margin-top: 1rem;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 1rem;
}

.history-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}

.ticket-list details {
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 0.5rem;
  margin-bottom: 0.5rem;
  background: #fff;
}

.ticket-meta {
  font-size: 0.85rem;
  color: #475569;
}

.ticket-message {
  white-space: pre-wrap;
  background: #f1f5f9;
  padding: 0.5rem;
  border-radius: 4px;
}

#feedback-form textarea {
  min-height: 100px;
}

.form-actions {
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
}

.status {
  min-height: 1.5rem;
}

.linkish {
  background: none;
  border: none;
  color: #2563eb;
  cursor: pointer;
  text-align: left;
  padding: 0;
}

.group-lift-button {
  min-height: 44px;
  padding: 0.55rem 0.75rem;
  border: 1px solid #bfdbfe;
  border-radius: 10px;
  background: #eff6ff;
  color: #1d4ed8;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.group-lift-button:disabled {
  border-color: transparent;
  background: transparent;
  color: #64748b;
  cursor: default;
}

.drafts {
  margin-top: 0.5rem;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 0.5rem;
  max-height: 180px;
  overflow-y: auto;
  font-size: 0.9rem;
}

.draft {
  border-bottom: 1px solid #e2e8f0;
  padding: 0.5rem 0;
}

.draft:last-child {
  border-bottom: none;
}

.draft-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.25rem;
}

.draft-actions button {
  border: 1px solid #cbd5f5;
  background: #fff;
  border-radius: 4px;
  cursor: pointer;
  padding: 0.25rem 0.5rem;
}

.lexicon-import {
  margin-top: 1rem;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 1rem;
}

.lexicon-secondary-actions {
  margin-top: 1rem;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 1rem;
}

.lexicon-controls {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  align-items: flex-end;
}

.lexicon-import textarea {
  width: 100%;
  min-height: 120px;
  margin-top: 0.75rem;
}

.import-route-shell textarea {
  min-height: min(48vh, 420px);
}

.import-mode-switch button.active {
  background: #dbeafe;
  border-color: #93c5fd;
  color: #1d4ed8;
}

.demo-scenario-switch {
  flex-wrap: wrap;
  gap: 0.5rem;
}

.event-context-card-list {
  display: grid;
  gap: 1rem;
  margin-top: 1rem;
}

.event-context-card {
  border: 1px solid #e2e8f0;
  background: #fff;
  padding: 1rem;
}

.status.success {
  color: #047857;
}

.status.error {
  color: #b91c1c;
}

button.success {
  background: #dcfce7;
  border-color: #22c55e;
  color: #166534;
}

button.error {
  background: #fee2e2;
  border-color: #f87171;
  color: #b91c1c;
}

button.loading {
  cursor: wait;
}

.lexicon-list {
  margin-top: 1rem;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
}

.lexicon-panel-toolbar {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
  flex-wrap: wrap;
}

.lexicon-mode-switch {
  display: inline-flex;
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  padding: 0.2rem;
  background: #f8fafc;
}

.lexicon-mode-switch button {
  border: none;
  background: transparent;
  color: #475569;
  border-radius: 999px;
  padding: 0.4rem 0.85rem;
}

.lexicon-mode-switch button.active {
  background: #1d4ed8;
  color: #fff;
}

.lexicon-header-row,
.lexicon-row {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1.1fr) minmax(0, 0.85fr);
  gap: 0.75rem;
  align-items: start;
}

.lexicon-header-row {
  padding: 0.8rem 1rem 0.7rem;
  border-bottom: 1px solid #cbd5e1;
  background: #f8fafc;
  color: #334155;
  font-size: 0.86rem;
  font-weight: 700;
}

.lexicon-header-row span,
.lexicon-row span,
.lexicon-row .lexicon-cell {
  min-width: 0;
}

.lexicon-header-row .word,
.lexicon-row .word {
  font-weight: 700;
}

.weights-section {
  margin-top: 1.5rem;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 1rem;
}

.weights-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.weight-row {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.weight-row-header {
  display: flex;
  justify-content: space-between;
  font-size: 0.9rem;
  text-transform: capitalize;
}

.weight-value {
  font-weight: 600;
}

.weight-slider {
  width: 100%;
}

.lexicon-row {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #e2e8f0;
  background: transparent;
  text-align: left;
  cursor: pointer;
  line-height: 1.35;
}

.lexicon-cell {
  border: none;
  background: transparent;
  padding: 0;
  text-align: left;
  color: #334155;
  font: inherit;
  width: 100%;
  word-break: break-word;
}

.lexicon-row.focused .lexicon-cell {
  color: #1d4ed8;
}

.lexicon-row.focused .lexicon-cell:hover {
  text-decoration: underline;
}

.lexicon-row.selected {
  background: rgba(37, 99, 235, 0.1);
  box-shadow: inset 3px 0 0 #2563eb;
}

.lexicon-row:last-child {
  border-bottom: none;
}

.lexicon-empty {
  margin: 1rem;
  color: #475569;
}

.lexicon-side-detail {
  white-space: pre-wrap;
  line-height: 1.55;
  color: #334155;
}

.lexicon-meaning-primary {
  font-weight: 700;
  color: #0f172a;
}

.lexicon-sidebar-shell {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.lexicon-sidebar-head {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.lexicon-word-meta {
  margin: 0;
  color: #475569;
}

.lexicon-sidebar-section,
.lexicon-sidebar-meta,
.lexicon-sidebar-actions {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.lexicon-sidebar-section h3,
.lexicon-sidebar-actions h3 {
  margin: 0;
  font-size: 0.95rem;
  color: #0f172a;
}

.lexicon-sidebar-meta,
.lexicon-sidebar-actions {
  padding-top: 0.85rem;
  border-top: 1px solid #e2e8f0;
}

.lexicon-sidebar-meta {
  margin-top: 0.2rem;
}

.lexicon-scan-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.lexicon-scan-row {
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 0.75rem;
  background: #fff;
}

.lexicon-scan-row.focused {
  border-color: #93c5fd;
  background: #eff6ff;
}

.lexicon-scan-prompt,
.lexicon-scan-translation {
  margin: 0;
}

.lexicon-scan-prompt {
  color: #0f172a;
  font-weight: 600;
}

.lexicon-scan-translation {
  color: #475569;
  margin-top: 0.35rem;
}

.lexicon-example-list {
  margin: 0;
  padding-left: 1.2rem;
  color: #334155;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.muted {
  color: #64748b;
}

.danger {
  background: #fee2e2;
  border: 1px solid #f87171;
  color: #b91c1c;
}

.demo-card {
  margin-top: 1rem;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.demo-card input,
.demo-card select {
  width: 100%;
  margin-top: 0.25rem;
}

input,
textarea,
select {
  font: inherit;
  touch-action: manipulation;
}

@media (max-width: 768px) {
  .lexicon-panel-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .lexicon-mode-switch {
    width: fit-content;
  }

  .lexicon-header-row,
  .lexicon-row {
    grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, 0.8fr);
    gap: 0.55rem;
  }

  .lexicon-header-row {
    font-size: 0.74rem;
    padding: 0.72rem 0.75rem 0.64rem;
  }

  .lexicon-row {
    padding: 0.72rem 0.75rem;
    font-size: 0.94rem;
  }

  input,
  textarea,
  select {
    font-size: 16px;
  }
}

.left-actions {
  justify-content: flex-start;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.practice-shell {
  gap: 1rem;
}

.practice-topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.set-pill-row {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.set-pill,
.thread-open-btn {
  border: 1px solid #cbd5e1;
  background: #fff;
  border-radius: 999px;
  padding: 0.45rem 0.8rem;
  font: inherit;
  cursor: pointer;
}

.set-pill.active {
  background: #0f172a;
  color: #fff;
  border-color: #0f172a;
}

.practice-thread-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 1rem;
  background: #eff6ff;
  border-radius: 14px;
}

.thread-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.thread-status {
  border-radius: 999px;
  padding: 0.2rem 0.55rem;
  font-size: 0.75rem;
  font-weight: 700;
}

.thread-status.waiting_reply {
  background: #fef3c7;
  color: #92400e;
}

.thread-status.active {
  background: #dcfce7;
  color: #166534;
}

.thread-status.review_ready {
  background: #e0e7ff;
  color: #3730a3;
}

.thread-summary {
  margin: 0;
  max-width: 17rem;
  color: #334155;
}

.thread-unread-dot {
  display: inline-block;
  width: 0.55rem;
  height: 0.55rem;
  margin-left: 0.45rem;
  border-radius: 999px;
  background: #2563eb;
  vertical-align: middle;
}

.practice-chat {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.chat-message {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  max-width: 86%;
  padding: 0.85rem 1rem;
  border-radius: 18px;
}

.chat-message header {
  font-size: 0.8rem;
  font-weight: 700;
}

.chat-message p {
  margin: 0;
  line-height: 1.45;
}

.practice-attempt-text {
  margin: 0;
  padding: 0.55rem 0.7rem;
  border-left: 3px solid #2563eb;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.7);
  text-align: left;
  white-space: pre-wrap;
}

.chat-message time {
  font-size: 0.75rem;
  color: #64748b;
}

.message-you {
  align-self: flex-end;
  background: #dbeafe;
}

.message-peer {
  align-self: flex-start;
  background: #fff;
  border: 1px solid #e2e8f0;
}

.system-note {
  align-self: center;
  background: transparent;
  color: #475569;
  border: 1px dashed #cbd5e1;
  text-align: center;
}

.practice-actions {
  display: flex;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.practice-meta {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.practice-observability {
  padding: 0.65rem 0.8rem;
  border: 1px dashed #cbd5e1;
  border-radius: 12px;
  background: rgba(248, 250, 252, 0.88);
}

.practice-observability-title {
  margin: 0 0 0.45rem;
  color: #64748b;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.practice-observability-grid {
  display: grid;
  gap: 0.3rem 0.75rem;
  grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));
}

.practice-observability-row {
  margin: 0;
  display: flex;
  gap: 0.45rem;
  align-items: baseline;
  flex-wrap: wrap;
  color: #334155;
  font-size: 0.82rem;
}

.practice-observability-key {
  color: #64748b;
  font-weight: 700;
}

.practice-observability-value {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  word-break: break-word;
}

.thread-chip {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0.3rem 0.65rem;
  background: #e2e8f0;
  color: #334155;
  font-size: 0.82rem;
  font-weight: 600;
}

.thread-switcher {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.thread-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.thread-card {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0.85rem 0.9rem;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #fff;
  cursor: pointer;
  text-align: left;
  font: inherit;
  touch-action: manipulation;
}

.thread-card.active {
  border-color: #2563eb;
  background: #eff6ff;
}

.thread-card span,
.thread-card small {
  color: #475569;
}

.artifact-card .hint {
  white-space: pre-line;
}

.artifact-card-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.artifact-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: -0.2rem;
}

.artifact-actions .thread-open-btn {
  touch-action: manipulation;
}

.inbox-card {
  cursor: default;
}

.practice-empty {
  border: 1px dashed #cbd5e1;
  border-radius: 14px;
  padding: 1rem;
  background: #fff;
}

.thread-inline-form {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.thread-inline-form textarea {
  min-height: 96px;
  resize: vertical;
  border: 2px solid #cbd5e1;
  border-radius: 14px;
  background: #fff;
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.04);
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

.thread-inline-form textarea:focus {
  border-color: #60a5fa;
  box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.18);
  outline: none;
}

.practice-coach-region {
  display: flex;
}

.practice-coach-box {
  width: 100%;
  border: 1px solid #dbeafe;
  background: #f8fbff;
  border-radius: 12px;
  padding: 0.75rem 0.9rem;
}

.practice-coach-box.active {
  border-color: #93c5fd;
  background: #eff6ff;
}

.practice-coach-title {
  margin: 0 0 0.35rem;
  font-size: 0.82rem;
  font-weight: 700;
  color: #1e3a8a;
}

.practice-coach-list {
  margin: 0;
  padding-left: 1rem;
  color: #334155;
}

.practice-coach-list li + li {
  margin-top: 0.25rem;
}

.qr-card img {
  border: 1px solid #e2e8f0;
  border-radius: 8px;
}

.demo-checklist {
  margin: 0;
  padding-left: 1rem;
}

.match-table {
  border-collapse: collapse;
  width: 100%;
}

.match-table th,
.match-table td {
  text-align: left;
  border-bottom: 1px solid #e2e8f0;
  padding: 0.5rem;
  vertical-align: top;
}

@media (max-width: 1024px) {
  .layout {
    grid-template-columns: 1fr;
    overflow: hidden;
  }

  .pane.left {
    position: fixed;
    top: 0;
    left: 0;
    height: var(--app-viewport-height);
    width: min(320px, 85vw);
    transform: translateX(-100%);
    transition: transform 0.24s cubic-bezier(0.22, 1, 0.36, 1);
    z-index: 15;
    pointer-events: none;
    will-change: transform;
  }

  .pane.left[hidden] {
    display: none !important;
  }

  .pane.left.open {
    display: flex;
    transform: translateX(0);
    pointer-events: auto;
  }

  .pane.right {
    position: fixed;
    top: 0;
    right: 0;
    height: var(--app-viewport-height);
    width: min(360px, 90vw);
    transform: translateX(100%);
    transition: transform 0.24s cubic-bezier(0.22, 1, 0.36, 1);
    box-shadow: -6px 0 16px rgba(15, 23, 42, 0.15);
    z-index: 11;
    overflow-y: auto;
    overscroll-behavior: contain;
    pointer-events: none;
    will-change: transform;
  }

  .pane.right[hidden] {
    display: none !important;
  }

  .pane.right.open {
    display: flex;
    transform: translateX(0);
    pointer-events: auto;
  }

  .pane.left.dragging,
  .pane.right.dragging,
  .pane-scrim.dragging {
    transition: none !important;
  }

  .content {
    padding: 0.75rem;
  }

  .toolbar {
    padding: 0.5rem 0.75rem;
  }

  .bottom-carrier {
    left: 0.5rem;
    right: 0.5rem;
    bottom: 0.5rem;
  }

  .bottom-carrier-shell {
    width: 100%;
  }

  .bottom-workspace-panel {
    max-height: min(44vh, 360px);
    padding: 0.75rem 0.8rem 0.62rem;
  }

  .bottom-workspace-base {
    padding: 0.56rem 0.68rem calc(0.64rem + env(safe-area-inset-bottom, 0px));
  }

  .practice-topbar,
  .practice-thread-header {
    flex-direction: column;
  }

  .thread-summary {
    max-width: none;
  }

  .chat-message {
    max-width: 100%;
  }

  .bottom-workspace-card {
    max-height: min(56vh, 420px);
    overflow-y: auto;
  }

  .drawer-utility-panels {
    padding: 0 0.5rem 0.75rem;
  }
}

@media (max-width: 600px) {
  #nav-list li {
    padding: 0.5rem 0.75rem;
  }

  #feedback-form {
    padding: 1rem;
  }

  #quest-form {
    padding: 1rem;
  }

  .feedback-entry {
    margin: 0.5rem;
  }
}

@media (min-width: 1025px) {
  .pane.left {
    position: relative;
    transform: none !important;
    width: 220px;
  }

  .pane.right {
    position: relative;
    box-shadow: none;
    width: 280px;
    transform: none !important;
  }

  .pane-scrim {
    display: none !important;
  }

  .bottom-carrier {
    left: 240px;
    right: 296px;
  }
}
