﻿/* -----------------------------------------------------------------------
   1. VARIABLES & RESET
   ----------------------------------------------------------------------- */
:root {
  --bg: #0f1117;
  --surface: #161b27;
  --surface-2: #1e2535;
  --surface-3: #242d40;
  --border: #253044;
  --border-2: #2e3d56;
  --text: #dde4f0;
  --text-2: #8895ad;
  --text-3: #566078;
  --brand: #3b82f6;
  --brand-hover: #2563eb;
  --brand-faint: rgba(59,130,246,0.08);
  --brand-border: rgba(59,130,246,0.25);
  --green: #10b981;
  --green-faint: rgba(16,185,129,0.08);
  --green-border: rgba(16,185,129,0.25);
  --yellow: #f59e0b;
  --yellow-faint: rgba(245,158,11,0.08);
  --yellow-border: rgba(245,158,11,0.25);
  --red: #f87171;
  --red-faint: rgba(248,113,113,0.08);
  --red-border: rgba(248,113,113,0.25);
  --orange: #f97316;
  --orange-faint: rgba(249,115,22,0.08);
  --orange-border: rgba(249,115,22,0.22);
  --font: 'Inter', system-ui, -apple-system, sans-serif;
  --font-mono: ui-monospace, 'Cascadia Code', 'Fira Code', Consolas, monospace;
  --r-sm: 4px;
  --r-md: 8px;
  --r-lg: 10px;
  --r-xl: 12px;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.3);
  --shadow: 0 2px 8px rgba(0,0,0,0.35);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.4);
  /* Legacy compat aliases used in inline JS-generated HTML */
  --surface2: #1e2535;
  --border2: #2e3d56;
  --text2: #8895ad;
  --text3: #566078;
  --acc: #3b82f6;
  --acc-border: rgba(59,130,246,0.25);
  --acc-bg: rgba(59,130,246,0.08);
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

button, .ivc-chip, .fc-option, .problem-option-btn, .problem-phase-chip {
  touch-action: manipulation;
  user-select: none;
}

body {
  font-family: var(--font);
  background: var(--bg);
  min-height: 100vh;
  color: var(--text);
  overflow-x: hidden;
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* -----------------------------------------------------------------------
   2. TYPOGRAPHY HELPERS
   ----------------------------------------------------------------------- */
.label-xs {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.4px;
  color: var(--text-3);
  text-transform: uppercase;
}
.label-sm { font-size: 12px; font-weight: 600; color: var(--text-2); }
.text-muted { color: var(--text-2); }
.text-faint { color: var(--text-3); }
.text-brand { color: var(--brand); }
.text-green { color: var(--green); }
.text-yellow { color: var(--yellow); }
.text-red { color: var(--red); }

/* -----------------------------------------------------------------------
   3. BASE LAYOUT - SCREEN CONTAINER
   ----------------------------------------------------------------------- */
.screen {
  display: none;
  min-height: 100vh;
  flex-direction: column;
  position: relative;
}
.screen.active { display: flex; animation: screenEnter 0.18s ease; }
@keyframes screenEnter { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }
@keyframes confettiFall {
  0%   { transform: translateY(0) rotate(0deg) scale(1); opacity: 1; }
  80%  { opacity: 1; }
  100% { transform: translateY(105vh) rotate(720deg) scale(0.5); opacity: 0; }
}

/* Conversation screens: fixed height so only messages area scrolls */
#chatScreen,
#flashScreen,
#problemScreen {
  min-height: unset;
  height: 100dvh;
  overflow: hidden;
}

/* -----------------------------------------------------------------------
   4. TOPBAR
   ----------------------------------------------------------------------- */
.topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 16px;
  height: 52px;
  flex-shrink: 0;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  position: sticky;
  top: 0;
  z-index: 10;
}

.tb-back {
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  color: var(--text-2);
  cursor: pointer;
  padding: 6px;
  border-radius: var(--r-md);
  transition: color 0.15s, background 0.15s;
  flex-shrink: 0;
  min-width: 44px;
  min-height: 44px;
}
.tb-back:hover { color: var(--text); background: var(--surface-2); }
.tb-back:active { color: var(--text); }

.tb-title {
  flex: 1;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tb-action {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-2);
  font-size: 12px;
  font-weight: 600;
  font-family: var(--font);
  padding: 6px 12px;
  border-radius: var(--r-lg);
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
  flex-shrink: 0;
  min-height: 32px;
}
.tb-action:hover { background: var(--surface-3); color: var(--text); border-color: var(--border-2); }
.tb-action:active { background: var(--surface-3); }
.tb-action:disabled { opacity: 0.4; cursor: not-allowed; }

/* -----------------------------------------------------------------------
   5. HOME SCREEN
   ----------------------------------------------------------------------- */
#homeScreen { background: var(--bg); }

.home-header {
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  position: sticky;
  top: 0;
  z-index: 10;
}
.home-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  height: 56px;
  max-width: 1100px;
  margin: 0 auto;
  width: 100%;
}
.home-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}
.home-brand-mark {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: var(--brand);
  border-radius: var(--r-lg);
  color: #fff;
  flex-shrink: 0;
}
.home-brand-name {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.3px;
}
.home-nav {
  display: flex;
  align-items: center;
  gap: 4px;
}
.btn-ghost {
  display: flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  color: var(--text-2);
  font-size: 13px;
  font-weight: 500;
  font-family: var(--font);
  padding: 7px 10px;
  border-radius: var(--r-lg);
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }
.btn-ghost:active { background: var(--surface-3); }
.btn-icon-label svg { flex-shrink: 0; }

.home-main {
  flex: 1;
  overflow-y: auto;
  padding: 32px 20px 48px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.home-err {
  font-size: 13px;
  color: var(--red);
  background: var(--red-faint);
  border: 1px solid var(--red-border);
  border-radius: var(--r-xl);
  padding: 12px 16px;
  display: none;
  animation: fadeIn 0.2s ease;
}
.home-err:not(:empty) { display: block; }

.home-hero {
  text-align: center;
}
.home-hero h1 {
  font-size: 24px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.35;
  letter-spacing: -0.5px;
  margin-bottom: 10px;
}
.home-hero p {
  font-size: 14px;
  color: var(--text-2);
  line-height: 1.6;
}

.home-section { display: flex; flex-direction: column; gap: 10px; }
.home-section-label { color: var(--text-3); padding-left: 2px; }

/* Mode cards */
.mode-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.mode-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: 20px 20px 20px 24px;
  cursor: pointer;
  text-align: left;
  font-family: var(--font);
  transition: all 0.2s;
  width: 100%;
}
.mode-card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 12px;
  bottom: 12px;
  width: 3px;
  border-radius: 2px;
  background: var(--border-2);
}
@media (hover: hover) {
  .mode-card:hover {
    background: var(--surface-2);
    border-color: var(--border-2);
    box-shadow: var(--shadow);
    transform: translateY(-1px);
  }
}
.mode-card:active { transform: translateY(0); box-shadow: none; }

.mode-card-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  background: var(--brand-faint);
  border: 1px solid var(--brand-border);
  border-radius: var(--r-xl);
  color: var(--brand);
  flex-shrink: 0;
}
.mode-card-body { flex: 1; min-width: 0; }
.mode-card-body h3 {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
  letter-spacing: -0.1px;
}
.mode-card-body p {
  font-size: 12px;
  color: var(--text-2);
  line-height: 1.5;
  margin: 0;
}
.mode-card-arrow {
  color: var(--text-3);
  flex-shrink: 0;
  transition: transform 0.15s;
}
@media (hover: hover) {
  .mode-card:hover .mode-card-arrow {
    color: var(--text-2);
    transform: translateX(2px);
  }
}

/* Mode-card color variants */
.mode-card.mode-chat .mode-card-icon { background: var(--brand-faint); border-color: var(--brand-border); color: var(--brand); }
.mode-card.mode-chat::before { background: var(--brand); }
.mode-card.mode-chat:hover { border-color: var(--brand-border); background: var(--brand-faint); }
.mode-card.mode-chat:hover .mode-card-body h3 { color: var(--brand); }

.mode-card.mode-flash .mode-card-icon { background: var(--green-faint); border-color: var(--green-border); color: var(--green); }
.mode-card.mode-flash::before { background: var(--green); }
.mode-card.mode-flash:hover { border-color: var(--green-border); background: var(--green-faint); }
.mode-card.mode-flash:hover .mode-card-body h3 { color: var(--green); }

.mode-card.mode-problem .mode-card-icon { background: var(--orange-faint); border-color: var(--orange-border); color: var(--orange); }
.mode-card.mode-problem::before { background: var(--orange); }
.mode-card.mode-problem:hover { border-color: var(--orange-border); background: var(--orange-faint); }
.mode-card.mode-problem:hover .mode-card-body h3 { color: var(--orange); }

.mode-card.mode-jobfit .mode-card-icon { background: var(--yellow-faint); border-color: var(--yellow-border); color: var(--yellow); }
.mode-card.mode-jobfit::before { background: var(--yellow); }
.mode-card.mode-jobfit:hover { border-color: var(--yellow-border); background: var(--yellow-faint); }
.mode-card.mode-jobfit:hover .mode-card-body h3 { color: var(--yellow); }

/* Ferramentas de carreira (compact links, home) */
.tool-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
@media (max-width: 480px) {
  .tool-row { grid-template-columns: repeat(2, 1fr); }
}
.tool-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 14px;
  cursor: pointer;
  font-family: var(--font);
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  text-align: left;
  transition: all 0.15s;
}
@media (hover: hover) {
  .tool-card:hover { background: var(--surface-2); border-color: var(--border-2); box-shadow: var(--shadow); transform: translateY(-1px); }
}
.tool-card:active { transform: translateY(0); box-shadow: none; }
.tool-card-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: var(--surface-3);
  border-radius: var(--r-md);
  color: var(--text-2);
}

/* Menu do usuário (avatar + popover ancorado) */
.user-menu { position: relative; }
.user-menu-avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--brand-faint);
  border: 1px solid var(--brand-border);
  color: var(--brand);
  font-size: 10px;
  font-weight: 700;
  flex-shrink: 0;
}
.user-menu-panel {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 220px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-md);
  padding: 6px;
  z-index: 20;
}
.user-menu-panel.open { display: block; animation: fadeIn 0.15s ease; }
.user-menu-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px 10px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 6px;
}
.user-menu-header .user-menu-avatar { width: 28px; height: 28px; font-size: 11px; }
.user-menu-email { font-size: 12px; color: var(--text-2); word-break: break-all; }
.user-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  background: none;
  border: none;
  padding: 9px 10px;
  border-radius: var(--r-md);
  font-family: var(--font);
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}
.user-menu-item:hover { background: var(--surface-3); }
.user-menu-item-val { margin-left: auto; color: var(--text-3); font-size: 12px; }
.user-menu-item.danger { color: var(--red); }
.user-menu-item.danger:hover { background: var(--red-faint); }

.home-quote-wrap { text-align: center; padding-top: 8px; }
.home-quote {
  font-size: 12px;
  color: var(--text-3);
  font-style: italic;
  line-height: 1.7;
}

/* -----------------------------------------------------------------------
   6. CONTEXT SCREEN
   ----------------------------------------------------------------------- */
#contextScreen { background: var(--bg); }
.context-body {
  overflow-y: auto;
  flex: 1;
  padding: 20px 20px 60px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.ctx-field { display: flex; flex-direction: column; gap: 8px; }

.ctx-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-2);
  text-transform: uppercase;
  letter-spacing: 0.6px;
}
.ctx-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.ctx-suggestions-toggle {
  display: flex;
  align-items: center;
  gap: 4px;
  background: none;
  border: none;
  color: var(--text-3);
  font-size: 12px;
  font-weight: 600;
  font-family: var(--font);
  cursor: pointer;
  padding: 2px 0;
  transition: color 0.15s;
}
.ctx-suggestions-toggle:hover { color: var(--text-2); }

/* Suggestions panels */
.ctx-suggestions {
  display: none;
  flex-wrap: wrap;
  gap: 6px;
  padding-top: 4px;
  animation: fadeIn 0.15s ease;
}
.ctx-suggestions.open { display: flex; }

.ctx-track-header {
  width: 100%;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.4px;
  color: var(--text-3);
  padding: 8px 2px 2px;
  pointer-events: none;
  user-select: none;
  text-transform: uppercase;
}
.ctx-track-header:first-child { padding-top: 2px; }

/* Chips */
.ctx-role-chip,
.ctx-company-chip,
.ctx-focus-chip {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-2);
  font-size: 12px;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: var(--r-lg);
  cursor: pointer;
  font-family: var(--font);
  transition: all 0.15s;
  user-select: none;
}
.ctx-role-chip:hover,
.ctx-company-chip:hover,
.ctx-focus-chip:hover {
  background: var(--surface-2);
  border-color: var(--border-2);
  color: var(--text);
}
.ctx-role-chip:active,
.ctx-company-chip:active,
.ctx-focus-chip:active {
  transform: scale(0.97);
}
.ctx-role-chip.selected,
.ctx-company-chip.selected,
.ctx-focus-chip.selected {
  background: var(--brand-faint);
  border-color: var(--brand-border);
  color: var(--brand);
}

/* Error messages */
.ctx-error-msg {
  font-size: 12px;
  color: var(--red);
  margin-top: -2px;
  animation: fadeIn 0.2s ease;
}

/* Level selector */
.ctx-levels {
  display: flex;
  gap: 6px;
}
.ctx-level {
  flex: 1;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-2);
  font-size: 11px;
  font-weight: 600;
  padding: 10px 6px;
  border-radius: var(--r-lg);
  cursor: pointer;
  text-align: center;
  transition: all 0.15s;
  user-select: none;
  line-height: 1.3;
  font-family: var(--font);
}
.ctx-level:hover {
  background: var(--surface-2);
  border-color: var(--border-2);
  color: var(--text);
}
.ctx-level .lv-icon {
  display: block;
  font-size: 13px;
  margin-bottom: 3px;
}
.ctx-level .lv-desc {
  display: block;
  font-size: 10px;
  font-weight: 400;
  margin-top: 3px;
  color: var(--text-3);
  line-height: 1.3;
}
.ctx-level.selected {
  background: var(--brand-faint);
  border-color: var(--brand-border);
  color: var(--brand);
}
.ctx-level.selected .lv-desc { color: rgba(59,130,246,0.7); }

/* Action buttons */
.ctx-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 4px;
}
.ctx-btn {
  border: none;
  border-radius: var(--r-xl);
  padding: 14px 18px;
  font-size: 14px;
  font-weight: 600;
  font-family: var(--font);
  cursor: pointer;
  transition: all 0.15s;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
}
.ctx-btn:active { transform: scale(0.98); }
.ctx-btn.primary {
  background: var(--brand);
  color: #fff;
  box-shadow: 0 2px 8px rgba(59,130,246,0.3);
}
.ctx-btn.primary:hover { background: var(--brand-hover); }
.ctx-btn.secondary {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-2);
}
.ctx-btn.secondary:hover {
  background: var(--surface-2);
  border-color: var(--border-2);
  color: var(--text);
}

/* Divider */
.ctx-divider {
  display: flex;
  align-items: center;
  gap: 10px;
}
.ctx-divider span {
  font-size: 11px;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  font-weight: 700;
  white-space: nowrap;
}
.ctx-divider::before,
.ctx-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* Recent sessions */
.ctx-recent-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.ctx-recent-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: 12px 14px;
  transition: all 0.15s;
  display: flex;
  align-items: center;
  gap: 10px;
}
.ctx-recent-item:hover {
  background: var(--surface-2);
  border-color: var(--border-2);
}
.ctx-recent-info {
  flex: 1;
  cursor: pointer;
  min-width: 0;
}
.ctx-recent-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ctx-recent-sub {
  font-size: 12px;
  color: var(--text-3);
  line-height: 1.4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ctx-recent-del {
  flex-shrink: 0;
  background: var(--red-faint);
  border: 1px solid var(--red-border);
  color: rgba(248,113,113,0.7);
  cursor: pointer;
  padding: 7px;
  border-radius: var(--r-md);
  transition: all 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.ctx-recent-del svg { width: 14px; height: 14px; }
.ctx-recent-del:hover {
  background: rgba(248,113,113,0.15);
  color: var(--red);
}
.ctx-recent-del:active {
  background: rgba(248,113,113,0.2);
}

/* -----------------------------------------------------------------------
   7. SHARED: CHAT META TAGS & TYPING INDICATOR
   ----------------------------------------------------------------------- */
.chat-meta {
  display: flex;
  gap: 6px;
  padding: 10px 16px 0;
  flex-shrink: 0;
  flex-wrap: wrap;
}
.chat-tag {
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 20px;
  background: var(--brand-faint);
  color: var(--brand);
  border: 1px solid var(--brand-border);
  letter-spacing: 0.1px;
}
.chat-tag.neutral {
  background: var(--surface-2);
  color: var(--text-2);
  border: 1px solid var(--border);
}
#flashScreen .chat-meta .chat-tag:not(.neutral) {
  background: var(--green-faint); color: var(--green); border-color: var(--green-border);
}
#problemScreen .chat-meta .chat-tag:not(.neutral) {
  background: var(--orange-faint); color: var(--orange); border-color: var(--orange-border);
}

/* Typing indicator */
.typing {
  align-self: flex-start;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-sm) var(--r-xl) var(--r-xl) var(--r-xl);
  padding: 12px 16px;
}
.dots {
  display: flex;
  gap: 5px;
}
.dots span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-3);
  animation: dotPulse 1.4s infinite;
}
.dots span:nth-child(2) { animation-delay: 0.2s; }
.dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes dotPulse {
  0%, 60%, 100% { opacity: 0.3; transform: scale(1); }
  30% { opacity: 1; transform: scale(1.2); }
}

/* -----------------------------------------------------------------------
   8. CHAT SCREEN MESSAGES
   ----------------------------------------------------------------------- */
#chatScreen { background: var(--bg); }

.msgs {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  scroll-behavior: smooth;
}

.msg {
  max-width: 86%;
  padding: 11px 14px;
  border-radius: var(--r-xl);
  font-size: 13px;
  line-height: 1.65;
  animation: msgIn 0.2s ease;
}
@keyframes msgIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.msg-ai {
  align-self: flex-start;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-sm) var(--r-xl) var(--r-xl) var(--r-xl);
}
.msg-user {
  align-self: flex-end;
  background: var(--brand-faint);
  border: 1px solid var(--brand-border);
  border-radius: var(--r-xl) var(--r-sm) var(--r-xl) var(--r-xl);
}

.msg-sender {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-3);
  margin-bottom: 5px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.msg-ai .msg-sender { color: var(--text-3); }
.msg-user .msg-sender { color: var(--brand); }

.msg-feedback {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 20px;
  margin-left: 6px;
}
.msg-feedback.ok {
  background: var(--green-faint);
  color: var(--green);
  border: 1px solid var(--green-border);
}
.msg-feedback.partial {
  background: var(--yellow-faint);
  color: var(--yellow);
  border: 1px solid var(--yellow-border);
}
.msg-feedback.wrong {
  background: var(--red-faint);
  color: var(--red);
  border: 1px solid var(--red-border);
}

/* Streaming cursor */
.msg-streaming .msg-body::after {
  content: 'â–Œ';
  color: var(--brand);
  animation: blink 0.8s step-end infinite;
}
@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

/* Markdown content inside messages */
.msg-body { word-break: break-word; }
.msg-body code {
  background: rgba(0,0,0,0.3);
  border: 1px solid var(--border-2);
  border-radius: var(--r-sm);
  padding: 1px 5px;
  font-family: var(--font-mono);
  font-size: 12px;
}
.msg-body pre {
  background: rgba(0,0,0,0.35);
  border: 1px solid var(--border-2);
  border-radius: var(--r-lg);
  padding: 12px 14px;
  margin: 8px 0;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.6;
}
.msg-body pre code { background: none; border: none; padding: 0; }
.msg-body ul { margin: 6px 0; padding-left: 18px; }
.msg-body li { margin: 2px 0; line-height: 1.5; }
.msg-body em { font-style: italic; color: var(--text-2); }
.msg-body strong { font-weight: 700; color: var(--text); }

/* Chat bar */
.chat-bar {
  padding: 10px 14px 20px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 8px;
  align-items: flex-end;
  flex-shrink: 0;
  background: var(--bg);
}
.chat-input {
  flex: 1;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  color: var(--text);
  font-size: 16px;
  font-family: var(--font);
  padding: 10px 14px;
  outline: none;
  resize: none;
  min-height: 44px;
  max-height: 100px;
  line-height: 1.5;
  transition: border-color 0.15s, background 0.15s;
}
.chat-input:focus {
  border-color: var(--brand);
  background: var(--surface-2);
}
.chat-input::placeholder { color: var(--text-3); }

.chat-send {
  width: 44px;
  height: 44px;
  border: none;
  border-radius: var(--r-xl);
  cursor: pointer;
  flex-shrink: 0;
  background: var(--brand);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
  box-shadow: 0 2px 6px rgba(59,130,246,0.3);
}
.chat-send:hover { background: var(--brand-hover); }
.chat-send:active { transform: scale(0.93); box-shadow: none; }
#problemScreen .chat-send { background: var(--orange); box-shadow: 0 2px 6px rgba(249,115,22,0.3); }
#problemScreen .chat-send:hover { background: #ea6c0a; }
#problemScreen .ctx-btn.primary { background: var(--orange); box-shadow: 0 2px 8px rgba(249,115,22,0.3); }
#problemScreen .ctx-btn.primary:hover { background: #ea6c0a; }

/* -------------------------------------------------------------------------
   PER-SCREEN COLOR THEMING
   ------------------------------------------------------------------------- */

/* ── Entrevista (azul) ── */
#chatScreen .topbar,
#chatConfigScreen .topbar { border-bottom-color: rgba(59,130,246,0.35); }

/* ── Flashcards (verde) ── */
#flashScreen .topbar,
#flashConfigScreen .topbar { border-bottom-color: rgba(16,185,129,0.35); }

#flashConfigScreen .ctx-btn.primary {
  background: var(--green);
  box-shadow: 0 2px 8px rgba(16,185,129,0.3);
}
#flashConfigScreen .ctx-btn.primary:hover { background: #0da271; }

#flashScreen .fmt-btn.active {
  background: var(--green);
  color: #fff;
  box-shadow: 0 1px 4px rgba(16,185,129,0.3);
}
#flashScreen .fc-reveal {
  background: var(--green-faint);
  color: var(--green);
  border-color: var(--green-border);
}
#flashScreen .fc-reveal:hover { background: rgba(16,185,129,0.14); }
#flashScreen .fc-continue-btn {
  background: var(--green-faint);
  color: var(--green);
  border-color: var(--green-border);
}
#flashScreen .fc-continue-btn:hover { background: rgba(16,185,129,0.14); }
#flashScreen .fc-area-tag { color: var(--green); }

/* ── Simulador (laranja) ── */
#problemScreen .topbar { border-bottom-color: rgba(249,115,22,0.35); }

#problemScreen .chat-input:focus { border-color: var(--orange); }

#problemScreen .problem-hint-btn {
  background: var(--orange-faint);
  border-color: var(--orange-border);
  color: var(--orange);
}
#problemScreen .problem-hint-btn:hover {
  background: rgba(249,115,22,0.14);
  border-color: var(--orange);
}
#problemScreen .problem-hint-btn:disabled { opacity: 0.35; background: var(--surface-2); border-color: var(--border); color: var(--text-2); }

#problemScreen .msg-user {
  background: var(--orange-faint);
  border-color: var(--orange-border);
}
#problemScreen .msg-user .msg-sender { color: var(--orange); }

/* ── Chips de seleção por tela ── */
#chatConfigScreen .ivc-chip.selected {
  background: var(--brand-faint); border-color: var(--brand-border); color: var(--brand);
}
#flashConfigScreen .ivc-chip.selected {
  background: var(--green-faint); border-color: var(--green-border); color: var(--green);
}
/* ambos os tipos de flashcard usam verde */
#flashConfigScreen #flashTypeChips .ivc-chip[data-val="tecnico"].selected,
#flashConfigScreen #flashTypeChips .ivc-chip[data-val="cases"].selected {
  background: var(--green-faint); border-color: var(--green-border); color: var(--green);
}

/* ── Problem: chips de fase e tentativas ── */
#problemScreen .problem-phase-chip.selected {
  background: var(--orange-faint);
  border-color: var(--orange-border);
  color: var(--orange);
}

/* ── Flash: botão final "Novo round" ── */
#flashScreen .final-btn { background: var(--green); box-shadow: 0 2px 8px rgba(16,185,129,0.3); }
#flashScreen .final-btn:hover { background: #0da271; }

/* ── Telas de relatório ── */
#chatReportScreen .topbar { border-bottom-color: rgba(59,130,246,0.35); }
#problemReportScreen .topbar { border-bottom-color: rgba(249,115,22,0.35); }

/* ── Tela de contexto (cor dinâmica por modo) ── */
/* flash */
.ctx-flash .topbar { border-bottom-color: rgba(16,185,129,0.35); }
.ctx-flash .ctx-level.selected { background: var(--green-faint); border-color: var(--green-border); color: var(--green); }
.ctx-flash .ctx-level.selected .lv-desc { color: rgba(16,185,129,0.7); }
.ctx-flash .ctx-input:focus { border-color: var(--green); }
.ctx-flash .ctx-btn.primary { background: var(--green); box-shadow: 0 2px 8px rgba(16,185,129,0.3); }
.ctx-flash .ctx-btn.primary:hover { background: #0da271; }

/* problem */
.ctx-problem .topbar { border-bottom-color: rgba(249,115,22,0.35); }
.ctx-problem .ctx-level.selected { background: var(--orange-faint); border-color: var(--orange-border); color: var(--orange); }
.ctx-problem .ctx-level.selected .lv-desc { color: rgba(249,115,22,0.7); }
.ctx-problem .ctx-input:focus { border-color: var(--orange); }
.ctx-problem .ctx-btn.primary { background: var(--orange); box-shadow: 0 2px 8px rgba(249,115,22,0.3); }
.ctx-problem .ctx-btn.primary:hover { background: #ea6c0a; }

/* chat — reforça azul explicitamente */
.ctx-chat .topbar { border-bottom-color: rgba(59,130,246,0.35); }
.chat-send:disabled { opacity: 0.35; cursor: not-allowed; box-shadow: none; transform: none; }

/* Ended state */
.chat-ended {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 2px;
  gap: 10px;
}
.chat-ended span { font-size: 13px; color: var(--text-3); }
.chat-ended-btn {
  background: var(--brand);
  color: #fff;
  border: none;
  border-radius: var(--r-xl);
  padding: 9px 18px;
  font-size: 13px;
  font-weight: 600;
  font-family: var(--font);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s;
  display: flex;
  align-items: center;
  gap: 6px;
}
.chat-ended-btn:hover { background: var(--brand-hover); }
.chat-ended-btn:active { opacity: 0.85; }
.chat-ended-btn.secondary { background: var(--surface); color: var(--text-2); border: 1px solid var(--border); }
.chat-ended-btn.secondary:hover { background: var(--surface-2); color: var(--text); }

/* Suggest button */
.suggest-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-2);
  border-radius: var(--r-lg);
  padding: 7px 12px;
  font-size: 12px;
  font-weight: 600;
  font-family: var(--font);
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: all 0.15s;
}
.suggest-btn:hover { background: var(--surface-3); border-color: var(--border-2); color: var(--text); }
.suggest-btn:active { background: var(--surface-3); }
.suggest-btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* -----------------------------------------------------------------------
   9. FLASH SCREEN
   ----------------------------------------------------------------------- */
#flashScreen { background: var(--bg); }
.flash-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 14px 16px 32px;
}

.flash-mode-toggle {
  display: flex;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: 3px;
  margin-bottom: 12px;
  gap: 3px;
}
.fmt-btn {
  flex: 1;
  padding: 8px;
  border: none;
  border-radius: var(--r-lg);
  font-size: 12px;
  font-weight: 600;
  font-family: var(--font);
  cursor: pointer;
  background: none;
  color: var(--text-3);
  transition: all 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.fmt-btn:hover { color: var(--text-2); }
.fmt-btn.active {
  background: var(--brand);
  color: #fff;
  box-shadow: 0 1px 4px rgba(59,130,246,0.3);
}

.flash-prog {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: 10px 14px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.fp-bar {
  flex: 1;
  height: 4px;
  background: var(--surface-3);
  border-radius: 2px;
  overflow: hidden;
}
.fp-fill {
  height: 100%;
  border-radius: 2px;
  background: var(--brand);
  transition: width 0.5s ease;
}
#flashScreen .fp-fill { background: var(--green); }
#problemScreen .fp-fill { background: var(--orange); }
.fp-lbl {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-3);
  white-space: nowrap;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}
.fp-txt {
  font-size: 12px;
  color: var(--text-2);
  white-space: nowrap;
  font-weight: 600;
}

.flash-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 28px 20px;
  text-align: center;
  margin-bottom: 12px;
  min-height: 220px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  transition: border-color 0.25s, background 0.25s;
  box-shadow: var(--shadow);
  animation: cardIn 0.25s ease;
}
@keyframes cardIn {
  from { opacity: 0; transform: scale(0.97); }
  to { opacity: 1; transform: scale(1); }
}
.flash-card.correct {
  border-color: var(--green-border);
  background: var(--green-faint);
}
.flash-card.wrong {
  border-color: var(--red-border);
  background: var(--red-faint);
}

.fc-area-tag {
  font-size: 11px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--brand);
  opacity: 0.8;
}
.fc-question {
  font-size: 17px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.6;
  font-family: var(--font);
}

.fc-reveal {
  background: var(--brand-faint);
  color: var(--brand);
  border: 1px solid var(--brand-border);
  border-radius: var(--r-xl);
  padding: 10px 24px;
  font-size: 13px;
  font-weight: 600;
  font-family: var(--font);
  cursor: pointer;
  transition: all 0.15s;
  display: flex;
  align-items: center;
  gap: 6px;
}
.fc-reveal:hover { background: rgba(59,130,246,0.14); }
.fc-reveal:active { transform: scale(0.97); }

.fc-answer { display: none; width: 100%; }
.fc-answer.show {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  animation: fadeIn 0.2s ease;
}
.fc-translation {
  font-size: 15px;
  color: var(--text);
  line-height: 1.6;
  text-align: left;
  width: 100%;
}
.fc-example {
  font-size: 13.5px;
  color: var(--text-2);
  font-style: italic;
  line-height: 1.55;
  border-top: 1px solid var(--border);
  padding-top: 10px;
  width: 100%;
  text-align: left;
}

/* Dots de progresso */
.fc-dots-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 12px 0 20px;
}
.fc-dots {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: center;
}
.fc-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--surface-3);
  transition: background 0.25s;
}
.fc-dot.current { background: var(--brand); }
.fc-dot.knew    { background: var(--green); }
.fc-dot.partial { background: var(--yellow); }
.fc-dot.forgot  { background: var(--red); }
.fc-counter {
  font-size: 12px;
  color: var(--text-3);
  font-weight: 600;
  letter-spacing: 0.04em;
}

/* 3 botões horizontais de resposta — modo livre */
.fc-btns-v {
  display: flex;
  flex-direction: row;
  gap: 8px;
  width: 100%;
}
.fc-knew, .fc-partial, .fc-forgot {
  flex: 1;
  border: none;
  border-radius: var(--r-xl);
  padding: 12px 8px;
  font-size: 14px;
  font-weight: 600;
  font-family: var(--font);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 52px;
  transition: background 0.15s;
  touch-action: manipulation;
  user-select: none;
}
.fc-knew    { background: var(--green-faint);  color: var(--green);  border: 1px solid var(--green-border); }
.fc-partial { background: var(--yellow-faint); color: var(--yellow); border: 1px solid var(--yellow-border); }
.fc-forgot  { background: var(--red-faint);    color: var(--red);    border: 1px solid var(--red-border); }
@media (hover: hover) {
  .fc-knew:hover    { background: rgba(16,185,129,0.14); }
  .fc-partial:hover { background: rgba(245,158,11,0.14); }
  .fc-forgot:hover  { background: rgba(248,113,113,0.14); }
}
.fc-knew:active, .fc-partial:active, .fc-forgot:active { opacity: 0.8; }

/* Multiple choice options */
.fc-options {
  display: flex;
  flex-direction: column;
  gap: 7px;
  width: 100%;
}
.fc-option {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: 13px 14px;
  font-size: 15px;
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
  text-align: left;
  font-family: var(--font);
  transition: all 0.15s;
  line-height: 1.5;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
}
@media (hover: hover) {
  .fc-option:hover:not(:disabled) {
    background: var(--surface-3);
    border-color: var(--border-2);
  }
}
.fc-option:active { transform: scale(0.98); }
.fc-option.correct {
  background: var(--green-faint);
  border-color: var(--green-border);
  color: var(--green);
}
.fc-option.wrong {
  background: var(--red-faint);
  border-color: var(--red-border);
  color: var(--red);
}
.fc-option.partial {
  background: var(--yellow-faint);
  border-color: var(--yellow-border);
  color: var(--yellow);
}
.fc-option-letter {
  width: 24px;
  height: 24px;
  border-radius: var(--r-md);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  background: var(--surface-3);
  border: 1px solid var(--border);
  transition: all 0.15s;
}
.fc-option.correct .fc-option-letter {
  background: var(--green-faint);
  border-color: var(--green-border);
  color: var(--green);
}
.fc-option.wrong .fc-option-letter {
  background: var(--red-faint);
  border-color: var(--red-border);
  color: var(--red);
}
.fc-option.partial .fc-option-letter {
  background: var(--yellow-faint);
  border-color: var(--yellow-border);
  color: var(--yellow);
}

.fc-quiz-feedback {
  font-size: 15px;
  font-weight: 700;
  padding: 11px 14px;
  border-radius: var(--r-xl);
  text-align: left;
  width: 100%;
  animation: fadeIn 0.2s ease;
}
.fc-quiz-feedback.ok {
  background: var(--green-faint);
  color: var(--green);
  border: 1px solid var(--green-border);
}
.fc-quiz-feedback.err {
  background: var(--red-faint);
  color: var(--red);
  border: 1px solid var(--red-border);
}
.fc-explanation {
  font-size: 14px;
  font-weight: 400;
  color: var(--text-2);
  margin-top: 7px;
  line-height: 1.55;
}
.fc-continue-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--red-faint);
  border: 1px solid var(--red-border);
  color: var(--red);
  border-radius: var(--r-md);
  padding: 7px 16px;
  font-size: 13.5px;
  font-weight: 700;
  font-family: var(--font);
  cursor: pointer;
  margin-top: 9px;
  transition: all 0.15s;
}
.fc-continue-btn.ok {
  background: var(--green-faint);
  border-color: var(--green-border);
  color: var(--green);
}
.fc-continue-btn:active { transform: scale(0.97); }


.fc-quiz-feedback.partial { background: var(--yellow-faint); border: 1px solid var(--yellow-border); color: var(--yellow); }

/* Flash final */
.flash-final {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 32px 20px;
  text-align: center;
  box-shadow: var(--shadow-md);
  animation: cardIn 0.3s ease;
}
.flash-final .medal { font-size: 3rem; margin-bottom: 10px; }
.flash-final h2 {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 6px;
  letter-spacing: -0.3px;
}
.flash-final .pct {
  font-size: 40px;
  font-weight: 800;
  margin: 10px 0;
  color: var(--brand);
  letter-spacing: -1px;
}
.flash-final p { font-size: 13px; color: var(--text-2); margin-bottom: 4px; }
.final-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--brand);
  color: #fff;
  border: none;
  border-radius: var(--r-xl);
  padding: 12px 28px;
  font-size: 13px;
  font-weight: 700;
  font-family: var(--font);
  cursor: pointer;
  margin-top: 14px;
  transition: all 0.15s;
}
.final-btn:hover { background: var(--brand-hover); }
.final-btn:active { transform: scale(0.97); }

/* -----------------------------------------------------------------------
   10. PROBLEM / LAB SCREEN
   ----------------------------------------------------------------------- */
#problemScreen { background: var(--bg); }

.problem-type-wrap { padding: 10px 16px 4px; flex-shrink: 0; }
.problem-type-selector { display: flex; gap: 6px; }
.problem-type-chip {
  flex: 1;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-2);
  font-size: 12px;
  font-weight: 600;
  padding: 10px 8px;
  border-radius: var(--r-lg);
  cursor: pointer;
  text-align: center;
  transition: all 0.15s;
  user-select: none;
  font-family: var(--font);
  letter-spacing: -0.1px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 40px;
}
.problem-type-chip:hover {
  background: var(--surface-2);
  border-color: var(--border-2);
  color: var(--text);
}
.problem-type-chip.selected {
  background: var(--brand-faint);
  border-color: var(--brand-border);
  color: var(--brand);
}
.problem-type-chip:active { transform: scale(0.97); }

.problem-phase-wrap { padding: 8px 16px 4px; flex-shrink: 0; }
.problem-phase-selector { display: flex; gap: 6px; }
.problem-phase-chip {
  flex: 1;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-2);
  font-size: 11px;
  font-weight: 600;
  padding: 9px 6px;
  border-radius: var(--r-lg);
  cursor: pointer;
  text-align: center;
  transition: all 0.15s;
  user-select: none;
  line-height: 1.3;
  font-family: var(--font);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 38px;
}
.problem-phase-chip:hover {
  background: var(--surface-2);
  border-color: var(--border-2);
  color: var(--text);
}
.problem-phase-chip.selected {
  background: var(--brand-faint);
  border-color: var(--brand-border);
  color: var(--brand);
}
.problem-phase-chip:active { transform: scale(0.97); }

/* Session progress bar (interview + problem simulator) */
.session-prog {
  margin-bottom: 0;
  border-radius: 0;
  border-left: none;
  border-right: none;
  border-top: none;
  flex-shrink: 0;
}
.problem-progress-track {
  flex: 1;
  height: 5px;
  background: var(--surface-3);
  border-radius: 3px;
  overflow: hidden;
}
.problem-progress-fill {
  height: 100%;
  width: 0%;
  border-radius: 3px;
  background: var(--red);
  transition: width 0.6s ease, background 0.6s ease;
}
.problem-progress-fill.medium { background: var(--yellow); }
.problem-progress-fill.high { background: var(--green); }
.problem-progress-pct {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-3);
  width: 30px;
  text-align: right;
  flex-shrink: 0;
}

.problem-type-prompt {
  padding: 40px 20px;
  text-align: center;
  color: var(--text-3);
  font-size: 13px;
  line-height: 1.7;
}

/* Options */
.problem-options {
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 0 16px;
  margin-top: 4px;
}
.problem-option-btn {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: 11px 14px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-2);
  cursor: pointer;
  text-align: left;
  font-family: var(--font);
  transition: all 0.15s;
  line-height: 1.4;
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  animation: fadeIn 0.2s ease;
  min-height: 44px;
}
@media (hover: hover) {
  .problem-option-btn:hover:not(:disabled) {
    background: var(--surface-2);
    border-color: var(--border-2);
    color: var(--text);
  }
}
.problem-option-btn:active:not(:disabled) { transform: scale(0.99); }
.problem-option-btn.selected {
  background: var(--brand-faint);
  border-color: var(--brand-border);
  color: var(--brand);
}
.problem-option-btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }
.problem-option-letter {
  width: 24px;
  height: 24px;
  border-radius: var(--r-md);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  background: var(--surface-3);
  border: 1px solid var(--border);
  transition: all 0.15s;
}
.problem-option-btn.selected .problem-option-letter {
  background: var(--brand-faint);
  border-color: var(--brand-border);
  color: var(--brand);
}

/* Hint button */
.problem-hint-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-2);
  border-radius: var(--r-xl);
  padding: 0 12px;
  height: 44px;
  font-size: 12px;
  font-weight: 600;
  font-family: var(--font);
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: all 0.15s;
}
.problem-hint-btn:hover {
  background: var(--surface-3);
  border-color: var(--border-2);
  color: var(--text);
}
.problem-hint-btn:active { transform: scale(0.97); }
.problem-hint-btn:disabled { opacity: 0.35; cursor: not-allowed; transform: none; }

/* Dossier loading */
.problem-dossier-loading {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 16px;
  color: var(--text-3);
  font-size: 13px;
}

/* Lab code panel (for desktop 2-col layout) */
.lab-code-panel-wrap {
  flex: 1;
  min-height: 0;
  display: flex;
  overflow: hidden;
}
#labCodePanel {
  display: none;
}

/* -----------------------------------------------------------------------
   11. DASHBOARD
   ----------------------------------------------------------------------- */
#dashScreen { background: var(--bg); }
.dash-scroll {
  overflow-y: auto;
  flex: 1;
  padding: 16px 20px 40px;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.dash-streak {
  background: var(--yellow-faint);
  border: 1px solid var(--yellow-border);
  border-radius: var(--r-xl);
  padding: 14px 16px;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 14px;
}
.dash-streak-fire {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--yellow);
  flex-shrink: 0;
}
.dash-streak-count {
  font-size: 14px;
  font-weight: 700;
  color: var(--yellow);
  margin-bottom: 1px;
}
.dash-streak-label {
  font-size: 12px;
  color: var(--text-3);
  line-height: 1.4;
}

.dash-track-header {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: var(--text-3);
  padding: 18px 0 6px;
  border-top: 1px solid var(--border);
  margin-top: 6px;
}
.dash-track-header:first-child { border-top: none; margin-top: 0; padding-top: 8px; }

.dash-area-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 0 12px;
}
.dash-area-icon { font-size: 20px; }
.dash-area-name { font-size: 14px; font-weight: 700; letter-spacing: -0.2px; }

.dash-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 10px;
}
.dash-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: 14px;
}
.dash-card-val {
  font-size: 26px;
  font-weight: 800;
  margin-bottom: 3px;
  color: var(--brand);
  letter-spacing: -0.5px;
}
.dash-card-val.green { color: var(--green); }
.dash-card-lbl {
  font-size: 11px;
  color: var(--text-3);
  font-weight: 500;
}

.dash-bar-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: 16px;
  margin-bottom: 14px;
}
.dash-bar-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-2);
  margin-bottom: 14px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.dash-bars { display: flex; flex-direction: column; gap: 11px; }
.db-row { display: flex; align-items: center; gap: 10px; }
.db-label {
  font-size: 12px;
  color: var(--text-2);
  width: 84px;
  flex-shrink: 0;
  font-weight: 500;
}
.db-track {
  flex: 1;
  height: 5px;
  background: var(--surface-3);
  border-radius: 3px;
  overflow: hidden;
}
.db-fill {
  height: 100%;
  border-radius: 3px;
  background: var(--brand);
  transition: width 0.7s ease;
}
.db-pct {
  font-size: 11px;
  color: var(--text-3);
  width: 36px;
  text-align: right;
  flex-shrink: 0;
  font-weight: 600;
}
.dash-empty {
  padding: 12px 0 24px;
  color: var(--text-3);
  font-size: 13px;
}

/* -----------------------------------------------------------------------
   12. SETTINGS
   ----------------------------------------------------------------------- */
#settingsScreen { background: var(--bg); }
.settings-scroll {
  overflow-y: auto;
  flex: 1;
  padding: 20px 20px 56px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.settings-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.settings-card-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}
.settings-card-desc {
  font-size: 12px;
  color: var(--text-2);
  line-height: 1.6;
}
.settings-input {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 11px 14px;
  color: var(--text);
  font-size: 13px;
  font-family: var(--font-mono);
  outline: none;
  transition: border-color 0.15s, background 0.15s;
  width: 100%;
}
.settings-input:focus {
  border-color: var(--brand);
  background: var(--surface-3);
}
.settings-input::placeholder { color: var(--text-3); }
.settings-status {
  font-size: 12px;
  min-height: 1em;
  color: var(--text-3);
}
.settings-status.ok { color: var(--green); }
.settings-status.err { color: var(--red); }
.settings-btn-row { display: flex; gap: 8px; }
.settings-btn {
  flex: 1;
  border: 1px solid transparent;
  border-radius: var(--r-lg);
  padding: 10px 12px;
  font-size: 12px;
  font-weight: 700;
  font-family: var(--font);
  cursor: pointer;
  transition: all 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 40px;
}
.settings-btn.primary {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}
.settings-btn.primary:hover { background: var(--brand-hover); border-color: var(--brand-hover); }
.settings-btn.secondary {
  background: var(--surface-2);
  border-color: var(--border);
  color: var(--text-2);
}
.settings-btn.secondary:hover {
  background: var(--surface-3);
  border-color: var(--border-2);
  color: var(--text);
}
.settings-btn.danger-full {
  width: 100%;
  background: var(--red-faint);
  border-color: var(--red-border);
  color: var(--red);
  flex: none;
}
.settings-btn.danger-full:hover { background: rgba(248,113,113,0.14); }
.settings-btn:active { transform: scale(0.97); }
.settings-btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.settings-remove-link {
  background: none;
  border: none;
  color: var(--red);
  font-size: 12px;
  font-weight: 600;
  font-family: var(--font);
  cursor: pointer;
  text-align: center;
  padding: 2px;
  transition: opacity 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
}
.settings-remove-link:active { opacity: 0.6; }
.settings-note {
  font-size: 11px;
  color: var(--text-3);
  line-height: 1.5;
  display: flex;
  align-items: flex-start;
  gap: 5px;
}
.settings-steps {
  padding-left: 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.settings-steps li {
  font-size: 13px;
  color: var(--text-2);
  line-height: 1.5;
}
.settings-danger { border-color: var(--red-border); }
.settings-danger .settings-card-title { color: var(--yellow); }

/* -----------------------------------------------------------------------
   12b. PROFILE (Etapa 3) — list items, skill chips, add/edit sheet
   ----------------------------------------------------------------------- */
.profile-list { display: flex; flex-direction: column; gap: 10px; }
.profile-list-empty { font-size: 12px; color: var(--text-3); padding: 4px 0; }
.profile-list-item {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 12px 14px;
  display: flex;
  justify-content: space-between;
  gap: 10px;
}
.profile-list-item-main { min-width: 0; }
.profile-list-item-title { font-size: 13px; font-weight: 700; color: var(--text); }
.profile-list-item-sub { font-size: 12px; color: var(--text-2); margin-top: 2px; }
.profile-list-item-period { font-size: 11px; color: var(--text-3); margin-top: 4px; }
.profile-list-item-actions { display: flex; gap: 4px; flex-shrink: 0; }
.profile-list-item-actions button {
  background: none;
  border: none;
  color: var(--text-3);
  cursor: pointer;
  padding: 4px;
  border-radius: var(--r-md);
  display: flex;
}
.profile-list-item-actions button:hover { color: var(--text); background: var(--surface-3); }
.profile-list-item-actions button.danger:hover { color: var(--red); }

.profile-skills-wrap { display: flex; flex-wrap: wrap; gap: 8px; }
.profile-skill-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--brand-faint);
  border: 1px solid var(--brand-border);
  color: var(--brand);
  border-radius: 20px;
  padding: 5px 6px 5px 12px;
  font-size: 12px;
  font-weight: 600;
}
.profile-skill-chip button {
  background: none;
  border: none;
  color: inherit;
  opacity: 0.7;
  cursor: pointer;
  display: flex;
  padding: 2px;
}
.profile-skill-chip button:hover { opacity: 1; }
.profile-skill-add-row { display: flex; gap: 8px; }
.profile-skill-add-row .ctx-input { flex: 1; }

.profile-sheet-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 1000;
  display: flex;
  align-items: flex-end;
  animation: fadeIn 0.15s ease;
}
.profile-sheet-box {
  width: 100%;
  max-width: 520px;
  max-height: 88vh;
  overflow-y: auto;
  margin: 0 auto;
  background: var(--surface);
  border: 1px solid var(--border-2);
  border-radius: 16px 16px 0 0;
  padding: 20px 20px calc(20px + env(safe-area-inset-bottom, 0px));
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.profile-sheet-title { font-size: 14px; font-weight: 700; color: var(--text); }
.profile-sheet-field label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-2);
  margin-bottom: 6px;
}
.profile-sheet-row { display: flex; gap: 10px; }
.profile-sheet-row .profile-sheet-field { flex: 1; }
.profile-sheet-check { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text-2); }

/* -----------------------------------------------------------------------
   13. SHARED COMPONENTS: MODALS, VERDICT BADGES, OVERLAYS
   ----------------------------------------------------------------------- */

/* Hint / suggest overlay */
.hint-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 1000;
  display: flex;
  align-items: flex-end;
  animation: fadeIn 0.15s ease;
}
.hint-overlay-box {
  width: 100%;
  max-width: 520px;
  margin: 0 auto;
  background: var(--surface);
  border: 1px solid var(--border-2);
  border-radius: 16px 16px 0 0;
  padding: 24px 20px 32px;
}
.hint-overlay-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--brand);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 7px;
}
.hint-overlay-body {
  font-size: 13px;
  color: var(--text-2);
  line-height: 1.65;
  margin-bottom: 20px;
}
.hint-overlay-btn {
  width: 100%;
  padding: 12px;
  background: var(--brand-faint);
  border: 1px solid var(--brand-border);
  color: var(--brand);
  border-radius: var(--r-xl);
  font-size: 13px;
  font-weight: 700;
  font-family: var(--font);
  cursor: pointer;
  transition: background 0.15s;
}
.hint-overlay-btn:hover { background: rgba(59,130,246,0.14); }
.hint-overlay-btn:active { background: rgba(59,130,246,0.18); }

/* Verdict badges */
.verdict-badge {
  font-size: 12px;
  font-weight: 700;
  padding: 5px 12px;
  border-radius: 20px;
  white-space: nowrap;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 5px;
}
.verdict-badge.verdict-yes {
  background: var(--green-faint);
  border: 1px solid var(--green-border);
  color: var(--green);
}
.verdict-badge.verdict-partial {
  background: var(--yellow-faint);
  border: 1px solid var(--yellow-border);
  color: var(--yellow);
}
.verdict-badge.verdict-no {
  background: var(--red-faint);
  border: 1px solid var(--red-border);
  color: var(--red);
}

/* -----------------------------------------------------------------------
   14. DESKTOP RESPONSIVE (>= 1024px)
   ----------------------------------------------------------------------- */
@media (min-width: 1024px) {
  /* Home */
  .home-main {
    max-width: 1100px;
    margin: 0 auto;
    width: 100%;
    padding: 60px 40px 80px;
    gap: 40px;
  }
  .home-hero h1 { font-size: 34px; }
  .home-hero p { font-size: 16px; }
  .mode-grid {
    flex-direction: row;
    align-items: stretch;
  }
  .mode-card {
    flex: 1;
    flex-direction: column;
    align-items: flex-start;
    padding: 28px 24px;
    gap: 14px;
  }
  .mode-card-arrow { margin-top: auto; align-self: flex-end; }

  /* Context screen */
  .context-body {
    max-width: 680px;
    margin: 0 auto;
    width: 100%;
    padding: 28px 0 60px;
  }

  /* Chat screen */
  #chatScreen { max-width: 860px; margin: 0 auto; width: 100%; }

  /* Flash screen */
  #flashScreen { max-width: 640px; margin: 0 auto; width: 100%; }

  /* Settings screen */
  .settings-scroll {
    max-width: 640px;
    margin: 0 auto;
    width: 100%;
  }

  /* profileAnalysisScreen/jobFitScreen use .report-scroll as their direct
     scroll container (unlike #chatReportScreen, which constrains the outer
     screen instead — a bare `.report-scroll` rule here would also catch
     #reportContent inside it and shrink it below the intended 860px). */
  #profileAnalysisScreen .report-scroll,
  #jobFitScreen .report-scroll {
    max-width: 640px;
    margin: 0 auto;
    width: 100%;
  }

  /* Dashboard */
  .dash-scroll {
    max-width: 1100px;
    margin: 0 auto;
    width: 100%;
  }
  .dash-cards { grid-template-columns: repeat(4, 1fr); }

  /* Problem screen  --  lab mode 2-col */
  #labCodePanel {
    display: flex;
    flex-direction: column;
    flex: 1;
    border-right: 1px solid var(--border);
    overflow: auto;
    padding: 16px;
    background: var(--surface);
    font-family: var(--font-mono);
    font-size: 13px;
    min-width: 0;
  }
  .lab-code-panel-wrap {
    display: flex;
  }
  .lab-code-panel-wrap > #problemMsgs {
    flex: 1;
    min-width: 0;
  }
  /* Center problem screen wrapper */
  #problemScreen { max-width: 1200px; margin: 0 auto; width: 100%; }
}

/* -----------------------------------------------------------------------
   15. TABLET RESPONSIVE (>= 768px)
   ----------------------------------------------------------------------- */
@media (min-width: 768px) {
  /* Context: wider chip areas */
  .context-body { padding: 24px 32px 60px; }
  .ctx-levels { gap: 8px; }

  /* Dashboard cards 2-col already default */
  .dash-scroll { padding: 20px 32px 48px; }

  /* Settings */
  .settings-scroll { padding: 24px 32px 60px; }

  /* Home */
  .home-main { padding: 48px 32px 64px; }
  .home-hero h1 { font-size: 28px; }

  /* Hint overlay: bottom sheet at center on tablet */
  .hint-overlay-box { border-radius: 16px; margin-bottom: 32px; }
}

/* -----------------------------------------------------------------------
   16. UTILITY + ACCESSIBILITY
   ----------------------------------------------------------------------- */
.ctx-input {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: 11px 14px;
  color: var(--text);
  font-size: 16px;
  font-family: var(--font);
  outline: none;
  transition: border-color 0.15s, background 0.15s;
  width: 100%;
}
.ctx-input:focus { border-color: var(--brand); background: var(--surface-2); }
.ctx-input::placeholder { color: var(--text-3); }
textarea.ctx-input { resize: none; min-height: 120px; line-height: 1.6; }
#resumeScreen textarea.ctx-input,
#profileScreen textarea.ctx-input { min-height: 70px; padding-bottom: 18px; }
.ctx-input-error { border-color: var(--red) !important; background: var(--red-faint) !important; }

/* Custom textarea resize handle — the native browser grip is tiny and
   can't be enlarged via CSS, so we draw our own icon with a real,
   matching click/drag hit area (wired up in js/app.js). */
.ta-resize-wrap { position: relative; }
.ta-resize-handle {
  position: absolute;
  right: 2px;
  bottom: 2px;
  width: 18px;
  height: 18px;
  cursor: ns-resize;
  touch-action: none;
  opacity: 0.55;
  background-image: linear-gradient(135deg,
    transparent 0 42%, var(--text-2) 42% 48%, transparent 48% 58%,
    var(--text-2) 58% 64%, transparent 64% 74%,
    var(--text-2) 74% 80%, transparent 80% 100%);
  background-size: 100% 100%;
}
.ta-resize-handle:hover, .ta-resize-handle:active { opacity: 1; }

/* Clear button */
.ctx-clear-row { text-align: right; margin-bottom: -4px; }
.ctx-clear-btn {
  background: none;
  border: none;
  color: var(--text-3);
  font-size: 12px;
  font-family: var(--font);
  cursor: pointer;
  padding: 4px 8px;
  border-radius: var(--r-md);
  transition: color 0.15s;
}
.ctx-clear-btn:hover { color: var(--text-2); }

/* Tags */
.ctx-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.ctx-tag {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-2);
  font-size: 13px;
  font-weight: 500;
  padding: 7px 14px;
  border-radius: var(--r-xl);
  cursor: pointer;
  transition: all 0.15s;
  user-select: none;
}
.ctx-tag.selected {
  background: var(--brand-faint);
  border-color: var(--brand-border);
  color: var(--brand);
}

/* Focus visible ring */
:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

/* Home button in topbar */
.tb-home {
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  color: var(--text-2);
  cursor: pointer;
  padding: 6px;
  border-radius: var(--r-md);
  transition: color 0.15s, background 0.15s;
  flex-shrink: 0;
  min-width: 44px;
  min-height: 44px;
}
.tb-home:hover { color: var(--text); background: var(--surface-2); }
.tb-home:active { color: var(--text); }

/* Resume session banner */
.resume-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--brand-faint);
  border: 1px solid var(--brand-border);
  border-radius: var(--r-xl);
  padding: 12px 16px;
  animation: fadeIn 0.2s ease;
}
.resume-bar-text {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  flex: 1;
  min-width: 0;
  line-height: 1.4;
}
.resume-bar-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}
.resume-bar-btn {
  padding: 7px 14px;
  border-radius: var(--r-lg);
  font-size: 12px;
  font-weight: 700;
  font-family: var(--font);
  cursor: pointer;
  transition: all 0.15s;
  border: 1px solid transparent;
  white-space: nowrap;
}
.resume-bar-btn.primary {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
}
.resume-bar-btn.primary:hover { background: var(--brand-hover); }
.resume-bar-btn:not(.primary) {
  background: transparent;
  color: var(--text-2);
  border-color: var(--border);
}
.resume-bar-btn:not(.primary):hover { background: var(--surface-2); color: var(--text); }
.resume-bar-btn:active { transform: scale(0.97); }

/* Safe-area for mobile chat bar */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
  .chat-bar { padding-bottom: calc(20px + env(safe-area-inset-bottom)); }
}

/* -----------------------------------------------------------------------
   19. INTERVIEW V2 - CONFIG, PROGRESS, FEEDBACK, REPORT
   ----------------------------------------------------------------------- */

/* Config screen chips */
.ivc-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.ivc-chip {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-2);
  font-size: 13px;
  font-weight: 500;
  font-family: var(--font);
  padding: 8px 16px;
  border-radius: var(--r-xl);
  cursor: pointer;
  transition: all 0.15s;
  user-select: none;
}
.ivc-chip.selected {
  background: var(--brand-faint);
  border-color: var(--brand-border);
  color: var(--brand);
  font-weight: 700;
}
.ivc-chip:hover:not(.selected) { background: var(--surface-2); border-color: var(--border-2); }
#flashTypeChips .ivc-chip[data-val="tecnico"].selected,
#flashTypeChips .ivc-chip[data-val="cases"].selected { background: var(--green-faint); border-color: var(--green-border); color: var(--green); }
.flash-type-desc {
  margin-top: 8px;
  font-size: 12px;
  color: var(--text-3);
  line-height: 1.5;
}

/* Mode toggle */
.ivc-mode-toggle { display: flex; gap: 8px; }
.ivc-mode-btn {
  flex: 1;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: 14px 16px;
  color: var(--text-2);
  font-family: var(--font);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: all 0.15s;
}
.ivc-mode-btn svg { margin-bottom: 6px; }
.ivc-mode-btn.selected {
  background: var(--brand-faint);
  border-color: var(--brand-border);
  color: var(--brand);
}
.ivc-mode-desc {
  font-size: 11px;
  font-weight: 400;
  color: var(--text-3);
  display: block;
  line-height: 1.4;
}
.ivc-mode-btn.selected .ivc-mode-desc { color: rgba(59,130,246,0.6); }


/* Timer in topbar */
.chat-timer {
  font-size: 12px;
  font-weight: 700;
  font-family: var(--font-mono);
  color: var(--text-3);
  min-width: 40px;
  text-align: right;
}
.chat-timer.warn { color: var(--yellow); }

/* Train mode feedback panel */
.train-feedback {
  margin: 0 12px 12px;
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  background: var(--surface);
  overflow: hidden;
  animation: fadeIn 0.2s ease;
}
.train-feedback-header {
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--border);
}
.train-feedback-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 20px;
  white-space: nowrap;
}
.train-feedback-badge.ok { background: var(--green-faint); color: var(--green); border: 1px solid var(--green-border); }
.train-feedback-badge.partial { background: var(--yellow-faint); color: var(--yellow); border: 1px solid var(--yellow-border); }
.train-feedback-badge.weak { background: var(--red-faint); color: var(--red); border: 1px solid var(--red-border); }
.train-feedback-score {
  font-size: 11px;
  color: var(--text-3);
  margin-left: auto;
  font-weight: 600;
}
.train-feedback-body { padding: 12px 14px; display: flex; flex-direction: column; gap: 10px; }
.train-fb-section { font-size: 12px; line-height: 1.55; }
.train-fb-section strong {
  display: block;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-3);
  font-weight: 700;
  margin-bottom: 4px;
}
.train-fb-section p { color: var(--text-2); margin: 0; }
.train-fb-ref {
  background: var(--surface-2);
  border-left: 2px solid var(--brand);
  padding: 10px 12px;
  border-radius: 0 var(--r-md) var(--r-md) 0;
  font-size: 12px;
  color: var(--text-2);
  line-height: 1.55;
}

/* Competency tag in chat */
.chat-comp-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 600;
  color: var(--brand);
  background: var(--brand-faint);
  border: 1px solid var(--brand-border);
  border-radius: 20px;
  padding: 3px 10px;
}

/* â”€â”€â”€ REPORT SCREEN â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
#chatReportScreen { background: var(--bg); }
.report-scroll {
  overflow-y: auto;
  flex: 1;
  padding: 0 0 60px;
}

.report-hero {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 24px 20px 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.report-score-row {
  display: flex;
  align-items: center;
  gap: 20px;
}
.report-score-circle {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.report-score-circle.green { background: var(--green-faint); border: 2px solid var(--green-border); }
.report-score-circle.brand { background: var(--brand-faint); border: 2px solid var(--brand-border); }
.report-score-circle.yellow { background: var(--yellow-faint); border: 2px solid var(--yellow-border); }
.report-score-circle.red { background: var(--red-faint); border: 2px solid var(--red-border); }
.report-score-num {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -1px;
  line-height: 1;
}
.report-score-circle.green .report-score-num { color: var(--green); }
.report-score-circle.brand .report-score-num { color: var(--brand); }
.report-score-circle.yellow .report-score-num { color: var(--yellow); }
.report-score-circle.red .report-score-num { color: var(--red); }
.report-score-denom { font-size: 11px; color: var(--text-3); font-weight: 500; }
.report-meta { display: flex; flex-direction: column; gap: 4px; }
.report-readiness {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.2px;
}
.report-readiness.green { color: var(--green); }
.report-readiness.brand { color: var(--brand); }
.report-readiness.yellow { color: var(--yellow); }
.report-readiness.red { color: var(--red); }
.report-meta-sub { font-size: 12px; color: var(--text-3); line-height: 1.5; }
.report-disclaimer {
  font-size: 11px;
  color: var(--text-3);
  line-height: 1.5;
  padding: 8px 12px;
  background: var(--surface-2);
  border-radius: var(--r-md);
  border: 1px solid var(--border);
}

.report-alert {
  font-size: 12px;
  line-height: 1.5;
  padding: 10px 12px;
  border-radius: var(--r-md);
  border: 1px solid;
  margin-bottom: 8px;
}
.report-alert.danger { background: var(--red-faint); border-color: var(--red-border); color: var(--red); }

/* Resume builder (Etapa 6) — ATS-friendly print document, deliberately
   NOT themed with the app's dark CSS vars: it previews and prints as an
   actual white-page resume regardless of the viewer's theme. */
.resume-print-doc {
  background: #ffffff;
  color: #1a1a1a;
  max-width: 720px;
  margin: 24px auto 48px;
  padding: 40px 48px;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 13px;
  line-height: 1.5;
  border-radius: 4px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.35);
}
.resume-print-doc h1 { font-size: 22px; margin-bottom: 2px; color: #1a1a1a; }
.resume-print-doc .resume-contact { font-size: 12px; color: #444; margin-bottom: 16px; }
.resume-print-doc h2 {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid #ccc;
  padding-bottom: 4px;
  margin: 18px 0 8px;
  color: #1a1a1a;
}
.resume-print-doc .resume-summary { color: #222; }
.resume-print-doc .resume-exp-item { margin-bottom: 14px; }
.resume-print-doc .resume-exp-header { display: flex; justify-content: space-between; gap: 12px; font-weight: 700; color: #1a1a1a; }
.resume-print-doc .resume-exp-sub { font-size: 12px; color: #555; margin-bottom: 4px; }
.resume-print-doc ul { margin: 0; padding-left: 18px; }
.resume-print-doc li { margin-bottom: 3px; color: #222; }
.resume-print-doc .resume-skills { display: flex; flex-wrap: wrap; gap: 6px; }
.resume-print-doc .resume-skill-tag { background: #f0f0f0; border-radius: 4px; padding: 2px 8px; font-size: 12px; color: #333; }

@media print {
  .no-print { display: none !important; }
  body { background: #fff !important; }
  .resume-print-doc { box-shadow: none; margin: 0; max-width: 100%; }
}

.report-section {
  padding: 0 16px;
  margin-top: 20px;
}
.report-section-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text-3);
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 12px;
}

/* Competency bars */
.report-comp-list { display: flex; flex-direction: column; gap: 10px; }
.report-comp-row { display: flex; flex-direction: column; gap: 4px; }
.report-comp-header { display: flex; align-items: center; justify-content: space-between; }
.report-comp-name { font-size: 13px; font-weight: 600; color: var(--text); }
.report-comp-score { font-size: 12px; font-weight: 700; }
.report-comp-track {
  height: 6px;
  background: var(--surface-3);
  border-radius: 3px;
  overflow: hidden;
}
.report-comp-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.6s ease;
}
.report-comp-fill.green { background: var(--green); }
.report-comp-fill.brand { background: var(--brand); }
.report-comp-fill.yellow { background: var(--yellow); }
.report-comp-fill.red { background: var(--red); }
.report-comp-criteria { font-size: 11px; color: var(--text-3); margin-top: 2px; }

/* Tags list */
.report-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.report-tag {
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 20px;
  font-weight: 500;
}
.report-tag.strong { background: var(--green-faint); color: var(--green); border: 1px solid var(--green-border); }
.report-tag.weak { background: var(--red-faint); color: var(--red); border: 1px solid var(--red-border); }
.report-tag.neutral { background: var(--surface-2); color: var(--text-2); border: 1px solid var(--border); }

/* Question history */
.report-q-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  overflow: hidden;
  margin-bottom: 8px;
}
.report-q-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  cursor: pointer;
  user-select: none;
}
.report-q-header:hover { background: var(--surface-2); }
.report-q-num {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-3);
  flex-shrink: 0;
  width: 24px;
}
.report-q-text { font-size: 13px; color: var(--text); flex: 1; line-height: 1.4; }
.report-q-score {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 20px;
  flex-shrink: 0;
}
.report-q-score.ok { background: var(--green-faint); color: var(--green); }
.report-q-score.partial { background: var(--yellow-faint); color: var(--yellow); }
.report-q-score.weak { background: var(--red-faint); color: var(--red); }
.report-q-body { padding: 0 14px 14px; display: none; border-top: 1px solid var(--border); }
.report-q-body.open { display: block; }
.report-q-field { margin-top: 10px; }
.report-q-field-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-3);
  margin-bottom: 4px;
}
.report-q-field-value {
  font-size: 12px;
  color: var(--text-2);
  line-height: 1.55;
  background: var(--surface-2);
  border-radius: var(--r-md);
  padding: 8px 10px;
}
.report-q-field-value.ref { border-left: 2px solid var(--brand); }

/* Study plan */
.report-study-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: 14px;
  margin-bottom: 8px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
.report-study-priority {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  padding: 2px 7px;
  border-radius: 20px;
  flex-shrink: 0;
  margin-top: 1px;
}
.report-study-priority.alta { background: var(--red-faint); color: var(--red); border: 1px solid var(--red-border); }
.report-study-priority.media { background: var(--yellow-faint); color: var(--yellow); border: 1px solid var(--yellow-border); }
.report-study-priority.baixa { background: var(--surface-3); color: var(--text-3); border: 1px solid var(--border); }
.report-study-body { flex: 1; }
.report-study-topic { font-size: 13px; font-weight: 700; color: var(--text); margin-bottom: 6px; }
.report-study-score { font-size: 11px; font-weight: 500; color: var(--text-3); margin-left: 4px; }
.report-study-action { font-size: 12px; color: var(--text-2); line-height: 1.5; }
.report-study-lacunas { margin: 0 0 6px; padding-left: 16px; }
.report-study-lacunas li { font-size: 12px; color: var(--text-2); line-height: 1.6; }
.report-study-ref { font-size: 11px; color: var(--text-3); line-height: 1.5; margin-top: 6px; padding: 8px; background: var(--surface-2); border-radius: var(--r); border-left: 2px solid var(--brand); }
.report-study-ref-label { font-weight: 700; color: var(--brand); margin-right: 4px; }

/* Report action buttons */
.report-actions {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.report-action-btn {
  width: 100%;
  padding: 13px;
  border-radius: var(--r-xl);
  font-size: 13px;
  font-weight: 700;
  font-family: var(--font);
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.report-action-btn.primary { background: var(--brand); color: #fff; border-color: var(--brand); }
.report-action-btn.primary:hover { background: var(--brand-hover); }
.report-action-btn.secondary { background: var(--surface); color: var(--text-2); border-color: var(--border); }
.report-action-btn.secondary:hover { background: var(--surface-2); border-color: var(--border-2); color: var(--text); }

/* Desktop report */
@media (min-width: 768px) {
  .report-hero { padding: 28px 32px 24px; }
  .report-section { padding: 0 24px; }
  .report-actions { padding: 20px 24px; flex-direction: row; }
  .report-action-btn { flex: 1; }
}
@media (min-width: 1024px) {
  #chatReportScreen { max-width: 860px; margin: 0 auto; width: 100%; }
  #chatConfigScreen .context-body { max-width: 640px; margin: 0 auto; }
}

/* -----------------------------------------------------------------------
   20. PROBLEM SIMULATOR V2
   ----------------------------------------------------------------------- */

/* Mode toggle */
.prob-mode-wrap {
  display: flex;
  gap: 6px;
  padding: 6px 16px 0;
}
.prob-mode-btn {
  flex: 1;
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--surface);
  color: var(--text-2);
  font-size: 12px;
  font-weight: 500;
  font-family: var(--font);
  cursor: pointer;
  transition: all .15s;
}
.prob-mode-btn.selected {
  border-color: var(--brand);
  color: var(--brand);
  background: color-mix(in srgb, var(--brand) 10%, transparent);
}
.prob-mode-desc {
  padding: 4px 16px 0;
  font-size: 11px;
  color: var(--text-3);
  min-height: 16px;
}

/* Guided decision feedback panel */
.pgf {
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  margin: 0 12px 8px;
  padding: 10px 12px;
  background: var(--surface);
  animation: fadeIn .2s ease;
}
.pgf-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 5px;
}
.pgf-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 4px;
}
.pgf-correct { background: color-mix(in srgb, var(--green) 15%, transparent); color: var(--green); }
.pgf-partial { background: color-mix(in srgb, #f59e0b 15%, transparent); color: #f59e0b; }
.pgf-wrong   { background: color-mix(in srgb, var(--red) 15%, transparent); color: var(--red); }
.pgf-impact  { font-size: 11px; font-weight: 600; color: var(--text-2); margin-left: auto; }
.pgf-concept { font-size: 12px; color: var(--text-2); margin-bottom: 3px; }
.pgf-evidence { font-size: 12px; color: var(--text-3); font-style: italic; }

/* Problem Report screen */
#problemReportScreen .report-scroll {
  flex: 1;
  overflow-y: auto;
  min-height: 0;
}
.prob-report-hero {
  text-align: center;
  padding: 24px 20px 18px;
  border-bottom: 1px solid var(--border);
}
.prob-report-score-circle {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  border: 4px solid;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 10px;
  font-size: 26px;
  font-weight: 700;
}
.prob-report-verdict { font-size: 14px; font-weight: 600; margin-bottom: 3px; }
.prob-report-type { font-size: 12px; color: var(--text-3); }
.prob-report-section {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}
.prob-report-section-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-2);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 10px;
}

/* Decision log */
.prob-decision-item {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}
.prob-decision-item:last-child { border-bottom: none; }
.prob-dec-badge {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
}
.prob-dec-correct { background: color-mix(in srgb, var(--green) 18%, transparent); color: var(--green); }
.prob-dec-partial { background: color-mix(in srgb, #f59e0b 18%, transparent); color: #f59e0b; }
.prob-dec-wrong   { background: color-mix(in srgb, var(--red) 18%, transparent); color: var(--red); }
.prob-dec-concept { font-size: 12px; color: var(--text); font-weight: 500; }
.prob-dec-evidence { font-size: 11px; color: var(--text-3); margin-top: 2px; }

/* Study plan */
.prob-study-item {
  padding: 7px 0;
  border-bottom: 1px solid var(--border);
}
.prob-study-item:last-child { border-bottom: none; }
.prob-study-header {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: space-between;
}
.prob-study-concept { font-size: 13px; font-weight: 500; color: var(--text); }
.prob-study-priority {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 20px;
  flex-shrink: 0;
}
.prob-study-priority.alta { background: var(--red-faint, color-mix(in srgb, var(--red) 12%, transparent)); color: var(--red); border: 1px solid color-mix(in srgb, var(--red) 25%, transparent); }
.prob-study-priority.media { background: color-mix(in srgb, #f59e0b 12%, transparent); color: #f59e0b; border: 1px solid color-mix(in srgb, #f59e0b 25%, transparent); }

/* Report action buttons */
.prob-report-actions {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.prob-report-action-btn {
  width: 100%;
  padding: 12px;
  border-radius: var(--r-xl);
  font-size: 13px;
  font-weight: 700;
  font-family: var(--font);
  cursor: pointer;
  border: 1px solid transparent;
  transition: all .15s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.prob-report-action-btn.primary { background: var(--brand); color: #fff; border-color: var(--brand); }
.prob-report-action-btn.primary:hover { background: var(--brand-hover, #2563eb); }
.prob-report-action-btn.secondary { background: var(--surface); color: var(--text-2); border-color: var(--border); }
.prob-report-action-btn.secondary:hover { background: var(--surface-2); color: var(--text); }

@media (min-width: 768px) {
  .prob-mode-wrap { padding: 8px 24px 0; max-width: 360px; }
  .prob-mode-desc { padding: 4px 24px 0; }
  .prob-report-actions { flex-direction: row; padding: 20px 24px; }
  .prob-report-action-btn { flex: 1; }
  .prob-report-section { padding: 14px 24px; }
  .prob-report-hero { padding: 28px 32px 20px; }
  #problemReportScreen { max-width: 720px; margin: 0 auto; width: 100%; }
}

/* â”€â”€â”€ 17. SCROLLBAR â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
::-webkit-scrollbar { width: 3px; height: 3px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-2); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-3); }

/* -----------------------------------------------------------------------
   18. ANIMATIONS (with prefers-reduced-motion)
   ----------------------------------------------------------------------- */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ── CTA principal da home ── */
.btn-cta-primary {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 15px 24px;
  background: var(--brand);
  color: #fff;
  border: none;
  border-radius: var(--r-xl);
  font-size: 15px;
  font-weight: 700;
  font-family: var(--font);
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 4px 14px rgba(59,130,246,0.35);
}
.btn-cta-primary:hover { background: var(--brand-hover); box-shadow: 0 6px 20px rgba(59,130,246,0.45); }
.btn-cta-primary:active { transform: scale(0.98); box-shadow: none; }

/* ── Advanced config collapsible ── */
.ivc-advanced { border: 1px solid var(--border); border-radius: var(--r-xl); overflow: hidden; margin-top: 8px; }
.ivc-advanced-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
  cursor: pointer;
  user-select: none;
  list-style: none;
}
.ivc-advanced-toggle::-webkit-details-marker { display: none; }
.ivc-advanced-toggle::after { content: '\25B8'; font-size: 12px; transition: transform 0.2s; }
details.ivc-advanced[open] .ivc-advanced-toggle::after { transform: rotate(90deg); }
.ivc-advanced-body { padding: 0 0 16px; display: flex; flex-direction: column; gap: 20px; }
.ivc-advanced-body .ctx-field { padding: 0 16px; }

/* ── Settings collapsible ── */
.settings-details { border: none; margin-top: 8px; }
.settings-details-toggle {
  font-size: 12px;
  font-weight: 600;
  color: var(--brand);
  cursor: pointer;
  user-select: none;
  list-style: none;
  padding: 4px 0;
  display: inline-flex;
}
.settings-details-toggle::-webkit-details-marker { display: none; }

/* ── Dashboard empty state ── */
.dash-empty {
  padding: 56px 20px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.dash-empty-icon { font-size: 2.5rem; margin-bottom: 6px; }
.dash-empty-title { font-size: 15px; font-weight: 700; color: var(--text); }
.dash-empty-sub { font-size: 13px; color: var(--text-2); line-height: 1.6; max-width: 280px; }

/* ── Mobile nav: ícone + rótulo empilhado (em vez de esconder o texto) ──
   Antes o rótulo sumia inteiro no mobile, deixando 6 ícones sem
   diferenciação clara do que cada um faz. */
@media (max-width: 480px) {
  /* Marca em cima, nav ocupando a largura toda embaixo — 6 itens espremidos
     ao lado da marca não cabiam com rótulo (ficavam sobrepostos). */
  .home-header-inner { height: auto; padding: 10px 8px; flex-direction: column; align-items: stretch; gap: 8px; }
  .home-brand { justify-content: center; }
  .home-nav { gap: 0; justify-content: space-between; width: 100%; }
  .btn-icon-label {
    flex-direction: column;
    gap: 2px;
    padding: 5px 2px;
    flex: 1;
  }
  .btn-icon-label .btn-text {
    display: block;
    font-size: 8.5px;
    line-height: 1.15;
    white-space: normal;
    text-align: center;
    max-width: 100%;
  }
}


/* ── File upload ── */
.file-upload-row { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.file-upload-btn {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 5px 10px; font-size: 11px; font-weight: 600; font-family: var(--font);
  color: var(--text-2); background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 8px; cursor: pointer; transition: background 0.15s;
}
.file-upload-btn:hover { background: var(--surface-3); }
.file-upload-note { font-size: 11px; color: var(--text-3); }

/* ── Problem mode toggle locked state ── */
.prob-mode-btn:disabled { opacity: 0.38; cursor: not-allowed; }
.prob-mode-btn.selected:disabled { opacity: 0.6; }

/* ── Problem start bar (Iniciar button) ── */
#problemBar:has(.ctx-btn) {
  padding: 12px 16px;
  justify-content: center;
}

/* ── Topbar título com subtítulo de contexto ── */
.tb-title-group { display: flex; flex-direction: column; align-items: center; gap: 1px; line-height: 1.2; flex: 1; min-width: 0; }
.tb-title-group .tb-title { flex: none; }
.tb-ctx { font-size: 11px; color: var(--text-3); font-weight: 500; max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── Context bar do simulador de problemas ── */
.prob-ctx-bar { padding: 12px 16px; border-bottom: 1px solid var(--border); display: flex; flex-direction: column; gap: 10px; flex-shrink: 0; max-height: 32vh; overflow-y: auto; }
.prob-ctx-role { font-size: 16px; font-weight: 700; color: var(--text); line-height: 1.3; }
.prob-ctx-meta { font-size: 12px; color: var(--text-2); margin-top: 2px; }

/* ── Chips de metadata do problema ── */
.prob-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.prob-chip { font-size: 11px; font-weight: 600; padding: 3px 10px; border-radius: var(--r-xl); background: var(--surface-2); border: 1px solid var(--border-2); color: var(--text-2); }
.prob-chip.dif { background: var(--orange-faint); border-color: var(--orange-border); color: var(--orange); }
.prob-cenario { display: flex; flex-direction: column; gap: 4px; }
.prob-cenario-label { font-size: 10px; font-weight: 700; letter-spacing: 0.08em; color: var(--orange); }
.prob-cenario p { font-size: 13px; color: var(--text-2); font-style: italic; line-height: 1.5; border-left: 2px solid var(--orange-border); padding-left: 10px; margin: 0; }

/* ── Chip de nível no flashcard ── */
.fc-nivel-chip { display: inline-block; font-size: 10px; font-weight: 600; padding: 2px 7px; border-radius: var(--r-xl); background: var(--surface-3); border: 1px solid var(--border-2); color: var(--text-2); margin-left: 8px; vertical-align: middle; letter-spacing: 0.03em; }
.fc-nivel-chip.junior, .prob-chip.junior       { background: var(--green-faint);             border-color: var(--green-border);             color: var(--green); }
.fc-nivel-chip.pleno,  .prob-chip.pleno        { background: rgba(59,130,246,0.10);           border-color: rgba(59,130,246,0.28);           color: #3b82f6; }
.fc-nivel-chip.senior, .prob-chip.senior       { background: var(--orange-faint);             border-color: var(--orange-border);            color: var(--orange); }
.fc-nivel-chip.especialista, .prob-chip.especialista { background: rgba(168,85,247,0.10);    border-color: rgba(168,85,247,0.28);           color: #a855f7; }

/* ── Tela final do flashcard ── */
.flash-final-wrap { display: flex; flex-direction: column; gap: 0; }
.flash-card-list { border-top: 1px solid var(--border); padding: 16px 0; }
.flash-card-list-hdr { font-size: 11px; font-weight: 700; letter-spacing: 0.07em; color: var(--text-3); padding: 0 16px 10px; }
.fci { padding: 12px 16px; border-bottom: 1px solid var(--border); display: flex; flex-direction: column; gap: 4px; cursor: pointer; transition: background 0.12s; }
@media (hover: hover) { .fci:hover { background: var(--surface-2); } }
.fci:last-child { border-bottom: none; }
.fci-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.fci-chips { display: flex; align-items: center; gap: 4px; }
.fci-num { font-size: 12px; font-weight: 600; color: var(--text-3); }
.fci-tema { font-size: 13px; font-weight: 700; color: #3b82f6; }
.fci-q { font-size: 12px; color: var(--text-2); line-height: 1.45; }

/* ── Resumo IA do flashcard ── */
.flash-summary { border-top: 1px solid var(--border); }
.flash-summary-loading { display: flex; align-items: center; gap: 10px; padding: 20px 16px; color: var(--text-3); font-size: 13px; }
.fsr-section { padding: 16px 16px 0; border-bottom: 1px solid var(--border); padding-bottom: 16px; }
.fsr-section:last-child { border-bottom: none; }
.fsr-title { font-size: 11px; font-weight: 700; letter-spacing: 0.07em; color: var(--text); margin-bottom: 8px; }
.fsr-text { font-size: 13px; color: var(--text-2); line-height: 1.6; margin: 0; }
.fsr-item { font-size: 13px; color: var(--text-2); padding: 3px 0; }

/* ── Overlay de revisão do card ── */
.fcr-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.72); z-index: 1000; display: flex; align-items: center; justify-content: center; padding: 16px; }
.fcr-box { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); width: 100%; max-width: 520px; max-height: 85dvh; overflow-y: auto; padding: 20px; display: flex; flex-direction: column; gap: 14px; }
.fcr-header { display: flex; align-items: center; gap: 8px; }
.fcr-label { font-size: 12px; font-weight: 600; color: var(--text-3); flex: 1; }
.fcr-close { background: none; border: none; color: var(--text-3); font-size: 18px; cursor: pointer; padding: 2px 6px; line-height: 1; touch-action: manipulation; }
.fcr-tema { font-size: 13px; font-weight: 700; color: #3b82f6; }
.fcr-question { font-size: 15px; color: var(--text); line-height: 1.55; }
.fcr-options { display: flex; flex-direction: column; gap: 8px; }
.fcr-opt { display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; border-radius: var(--r-md); font-size: 13px; line-height: 1.45; }
.fcr-opt.correct { background: var(--green-faint); border: 1px solid var(--green-border); color: var(--green); }
.fcr-opt.wrong   { background: var(--surface-2); border: 1px solid var(--border); color: var(--text-2); }
.fcr-opt-letter  { font-weight: 700; min-width: 16px; }
.fcr-answer { font-size: 13px; color: var(--text-2); line-height: 1.55; border-left: 2px solid var(--brand); padding-left: 12px; }
.fcr-answer-label { font-size: 10px; font-weight: 700; letter-spacing: 0.06em; color: var(--brand); margin-bottom: 4px; }
.fcr-example { font-size: 12px; color: var(--text-3); font-style: italic; line-height: 1.5; }

/* ── Tela de Conta: layout em duas colunas (Etapa 9 Fase B — benchmark karvi) ── */
.auth-layout {
  overflow-y: auto;
  flex: 1;
  padding: 20px 20px 56px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.auth-form-col { display: flex; flex-direction: column; gap: 12px; }
#authLoggedIn { display: flex; flex-direction: column; gap: 12px; width: 100%; }

.auth-oauth-row { display: flex; flex-direction: column; gap: 8px; }
.auth-oauth-btn {
  display: flex; align-items: center; gap: 10px;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-lg);
  padding: 10px 14px; color: var(--text); font-size: 13px; font-weight: 600; font-family: var(--font);
  cursor: pointer; transition: background 0.15s, border-color 0.15s;
}
@media (hover: hover) {
  .auth-oauth-btn:hover { background: var(--surface-3); border-color: var(--border-2); }
}
.auth-oauth-badge {
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px; border-radius: 6px;
  background: #fff; overflow: hidden; flex: none;
}
.auth-divider { display: flex; align-items: center; gap: 10px; color: var(--text-3); font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; }
.auth-divider::before, .auth-divider::after { content: ''; flex: 1; height: 1px; background: var(--border); }

.auth-legal-note { font-size: 11px; color: var(--text-3); line-height: 1.6; text-align: center; }
.auth-legal-link { color: var(--text-2); text-decoration: underline; cursor: pointer; }
@media (hover: hover) {
  .auth-legal-link:hover { color: var(--text); }
}

.auth-hero-col {
  background: linear-gradient(160deg, var(--surface-3), var(--surface-2));
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: 24px 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.auth-hero-eyebrow { font-size: 11px; font-weight: 800; letter-spacing: 0.12em; color: var(--brand); }
.auth-hero-title { font-size: 19px; font-weight: 800; color: var(--text); line-height: 1.3; }
.auth-hero-sub { font-size: 13px; color: var(--text-2); line-height: 1.6; }

@media (min-width: 768px) {
  .auth-layout { flex-direction: row; align-items: flex-start; padding: 32px; gap: 24px; }
  .auth-form-col { flex: 1; min-width: 0; max-width: 420px; }
  .auth-hero-col { flex: 1; min-width: 0; align-self: stretch; justify-content: center; padding: 32px 28px; }
  .auth-hero-title { font-size: 24px; }
}

/* ── Legenda de custo em créditos perto do botão de ação (Etapa 10) ── */
.ctx-cost-note {
  text-align: center;
  font-size: 12px;
  color: var(--text-3);
}
.ctx-cost-note strong { color: var(--text-2); font-weight: 700; }
.ctx-cost-free { color: var(--green); font-weight: 600; }

/* ── "Neblina" de vitrine — relatório de exemplo antes da 1ª análise real (Etapa 10) ── */
.report-example-ribbon {
  background: linear-gradient(90deg, var(--brand), #a855f7);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  text-align: center;
  padding: 8px 12px;
  border-radius: var(--r-lg);
  margin-bottom: 12px;
}
.report-fog-wrap { position: relative; overflow: hidden; min-height: 84px; }
.report-fog {
  filter: blur(5px);
  user-select: none;
  pointer-events: none;
}
.report-fog-cta {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 16px;
  text-align: center;
  background: color-mix(in srgb, var(--surface) 55%, transparent);
}
.report-fog-cta span {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  max-width: 260px;
}
