/* ============================================================
   frontend-interview.css - Симулятор Frontend-собеседования
   Video call interface (Skype/Zoom style)
   ============================================================ */

[hidden] { display: none !important; }

body {
  font-family: "Roboto", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-size: 15px;
  line-height: 1.5;
}

/* ---- Root layout ---- */
.fi-page {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
  --fi-theme-accent: #8a96a6;
  --fi-theme-accent-soft: rgba(138, 150, 166, 0.1);
  --fi-theme-accent-border: rgba(138, 150, 166, 0.24);
  --fi-theme-bg: #1f2229;
  --fi-theme-header-bg: rgba(31, 34, 41, 0.96);
  background: var(--fi-theme-bg);
  font-family: 'Roboto', sans-serif;
  transition: background 0.35s ease;
}

.fi-page[data-difficulty="easy"] {
  --fi-theme-accent: #6d9f82;
  --fi-theme-accent-soft: rgba(109, 159, 130, 0.14);
  --fi-theme-accent-border: rgba(109, 159, 130, 0.3);
  --fi-theme-bg: #1c2428;
  --fi-theme-header-bg: rgba(28, 36, 40, 0.96);
}

.fi-page[data-difficulty="medium"] {
  --fi-theme-accent: #7a9ec4;
  --fi-theme-accent-soft: rgba(122, 158, 196, 0.14);
  --fi-theme-accent-border: rgba(122, 158, 196, 0.3);
  --fi-theme-bg: #1c2230;
  --fi-theme-header-bg: rgba(28, 34, 48, 0.96);
}

.fi-page[data-difficulty="hard"] {
  --fi-theme-accent: #c17f7f;
  --fi-theme-accent-soft: rgba(193, 127, 127, 0.14);
  --fi-theme-accent-border: rgba(193, 127, 127, 0.32);
  --fi-theme-bg: #241c1f;
  --fi-theme-header-bg: rgba(36, 28, 31, 0.96);
}

.fi-page[data-difficulty="expert"] {
  --fi-theme-accent: #a86666;
  --fi-theme-accent-soft: rgba(168, 102, 102, 0.14);
  --fi-theme-accent-border: rgba(168, 102, 102, 0.32);
  --fi-theme-bg: #221819;
  --fi-theme-header-bg: rgba(34, 24, 25, 0.96);
}

/* ============================================================
   HEADER
   ============================================================ */
.fi-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 20px;
  height: 52px;
  background: var(--fi-theme-header-bg, rgba(31, 34, 41, 0.96));
  border-bottom: 1px solid var(--fi-theme-accent-border, rgba(255, 255, 255, 0.07));
  z-index: 100;
  flex-shrink: 0;
  transition: background 0.35s ease, border-color 0.35s ease;
}

.fi-header__logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.fi-header__logo-img {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  object-fit: cover;
}

.fi-header__logo-text {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 1.5px;
  color: #fff;
}

.fi-header__center {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex: 1;
  justify-content: center;
}

.fi-header__call-badge {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--fi-theme-accent-soft, rgba(138, 150, 166, 0.1));
  border: 1px solid var(--fi-theme-accent-border, rgba(138, 150, 166, 0.24));
  color: var(--fi-theme-accent, #8a96a6);
  font-size: 12px;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 8px;
  letter-spacing: 0.3px;
  overflow: visible;
  transition: background 0.35s ease, border-color 0.35s ease, color 0.35s ease;
}

.fi-header__call-label {
  line-height: 1.2;
}

/* BETA поверх скруглённого поля: справа сверху, правый край чуть выше */
.fi-header__call-beta {
  display: inline-flex;
  align-items: center;
  position: absolute;
  top: -9px;
  right: -19px;
  z-index: 2;
  margin: 0;
  padding: 1px 5px;
  border-radius: 3px;
  background: #ffc501;
  color: #111;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.04em;
  line-height: 1.25;
  transform: rotate(-12deg);
  transform-origin: center center;
  white-space: nowrap;
  pointer-events: none;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
}

.fi-header__call-dot {
  width: 7px;
  height: 7px;
  background: var(--fi-theme-accent, #8a96a6);
  border-radius: 50%;
  animation: fi-blink 4s ease-in-out infinite;
  transition: background 0.35s ease;
}

@keyframes fi-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.2; }
}

.fi-header__timer {
  font-size: 13px;
  color: rgba(255,255,255,0.55);
  font-variant-numeric: tabular-nums;
  min-width: 52px;
}

.fi-header__back-btn {
  display: flex;
  align-items: center;
  gap: 7px;
  text-decoration: none;
  color: rgba(255,255,255,0.55);
  font-size: 13px;
  font-weight: 700;
  font-family: inherit;
  padding: 7px 13px;
  border: 1px solid rgba(138, 150, 166, 0.34);
  border-radius: 10px;
  background: rgba(255,255,255,0.025);
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}

.fi-header__back-btn:hover {
  background: rgba(138, 150, 166, 0.08);
  border-color: rgba(138, 150, 166, 0.58);
  color: rgba(255,255,255,0.82);
}

.fi-header__actions {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-shrink: 0;
  margin-left: auto;
}

.fi-header__error-link {
  display: inline-flex !important;
  flex-shrink: 0;
}

/* ============================================================
   CONFIRM MODAL
   ============================================================ */
.fi-confirm {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease;
}

.fi-confirm[hidden] {
  display: none !important;
}

.fi-confirm--visible {
  opacity: 1;
  pointer-events: auto;
}

.fi-confirm__backdrop {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 50% 10%, rgba(96, 165, 250, 0.18), transparent 42%),
    rgba(6, 8, 14, 0.74);
  backdrop-filter: blur(14px);
}

.fi-confirm__dialog {
  position: relative;
  width: min(100%, 440px);
  padding: 22px;
  border-radius: 12px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.085), rgba(255, 255, 255, 0.025)),
    #191c22;
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.46), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  transform: translateY(10px) scale(0.98);
  transition: transform 0.18s ease;
}

.fi-confirm--visible .fi-confirm__dialog {
  transform: translateY(0) scale(1);
}

.fi-confirm__icon {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fecaca;
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.28);
  font-size: 18px;
  margin-bottom: 16px;
}

.fi-confirm__eyebrow {
  margin: 0 0 8px;
  color: #93c5fd;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.8px;
  text-transform: uppercase;
}

.fi-confirm__title {
  margin: 0;
  color: #fff;
  font-size: 22px;
  line-height: 1.18;
}

.fi-confirm__text {
  margin: 12px 0 0;
  color: rgba(255, 255, 255, 0.62);
  font-size: 14px;
  line-height: 1.6;
}

.fi-confirm__actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  margin-top: 22px;
}

.fi-confirm__btn {
  min-height: 40px;
  border: 0;
  border-radius: 12px;
  padding: 0 16px;
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.15s ease, opacity 0.15s ease, background 0.2s ease;
}

.fi-confirm__btn:hover {
  transform: translateY(-1px);
}

.fi-confirm__btn--ghost {
  color: rgba(255, 255, 255, 0.7);
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.fi-confirm__btn--danger {
  color: #fff;
  background: linear-gradient(135deg, #ef4444, #dc2626);
  box-shadow: 0 12px 34px rgba(239, 68, 68, 0.28);
}

/* ============================================================
   WORKSPACE: left call + right panel
   ============================================================ */
.fi-workspace {
  display: flex;
  flex: 1;
  overflow: hidden;
  min-height: 0;
}

/* ============================================================
   LEFT - VIDEO CALL
   ============================================================ */
.fi-call {
  width: 360px;
  min-width: 300px;
  max-width: 400px;
  display: flex;
  flex-direction: column;
  background: #141720;
  border-right: 1px solid rgba(255,255,255,0.07);
  flex-shrink: 0;
  overflow: hidden;
}

/* Video area with gradient */
.fi-call__video {
  flex: 0 0 220px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #1e3a5f 0%, #2d5087 35%, #6b4e8a 70%, #8b5a6b 100%);
  overflow: hidden;
}

.fi-call__video-bg-noise {
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle at 20% 80%, rgba(255,255,255,0.03) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(255,255,255,0.04) 0%, transparent 50%);
  pointer-events: none;
}

.fi-call__avatar-wrap {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.fi-call__avatar-ring {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  background: rgba(255,255,255,0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: box-shadow 0.3s;
}

.fi-call__avatar-ring--speaking {
  box-shadow:
    0 0 0 4px rgba(34, 197, 94, 0.4),
    0 0 0 8px rgba(34, 197, 94, 0.15),
    0 0 20px rgba(34, 197, 94, 0.2);
  animation: fi-speaking-ring 1.2s ease-in-out infinite;
}

@keyframes fi-speaking-ring {
  0%, 100% { box-shadow: 0 0 0 4px rgba(34,197,94,0.5), 0 0 0 8px rgba(34,197,94,0.18); }
  50% { box-shadow: 0 0 0 6px rgba(34,197,94,0.7), 0 0 0 12px rgba(34,197,94,0.25); }
}

.fi-call__avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: linear-gradient(135deg, #7c8cff, #5b6ae8);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  font-weight: 700;
  color: #fff;
  letter-spacing: 1px;
  user-select: none;
  overflow: hidden;
}

.fi-call__avatar--photo {
  background: #111827;
  padding: 0;
}

.fi-call__avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 50%;
}

.fi-call__interviewer-name {
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  text-shadow: 0 1px 4px rgba(0,0,0,0.5);
}

.fi-call__interviewer-role {
  font-size: 11px;
  color: rgba(255,255,255,0.7);
  margin-top: -8px;
}

/* Top-left name badge */
.fi-call__name-badge {
  position: absolute;
  top: 10px;
  left: 12px;
  display: flex;
  flex-direction: column;
  z-index: 3;
}

.fi-call__name-badge-text {
  font-size: 12px;
  font-weight: 600;
  color: #fff;
  text-shadow: 0 1px 4px rgba(0,0,0,0.7);
}

.fi-call__name-badge-sub {
  font-size: 10px;
  color: rgba(255,255,255,0.65);
  text-shadow: 0 1px 4px rgba(0,0,0,0.7);
}

/* Small self-view in corner */
.fi-call__selfview {
  position: absolute;
  bottom: 10px;
  right: 10px;
  width: 64px;
  height: 48px;
  background: rgba(0,0,0,0.6);
  border-radius: 8px;
  border: 2px solid rgba(255,255,255,0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 3;
}

.fi-call__selfview-inner {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0ea5e9, #06b6d4);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
}

/* Chat / dialog area */
.fi-call__chat {
  flex: 1;
  overflow-y: auto;
  padding: 14px 14px 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: #141720;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.1) transparent;
}

.fi-call__chat::-webkit-scrollbar { width: 4px; }
.fi-call__chat::-webkit-scrollbar-track { background: transparent; }
.fi-call__chat::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.12); border-radius: 4px; }

.fi-chat-msg {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  animation: fi-msg-in 0.3s ease;
}

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

.fi-chat-msg--interviewer {
  flex-direction: row;
}

.fi-chat-msg--user {
  flex-direction: row-reverse;
}

.fi-chat-msg__avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
  color: #fff;
}

.fi-chat-msg--interviewer .fi-chat-msg__avatar {
  background: linear-gradient(135deg, #3b82f6, #8b5cf6);
}

.fi-chat-msg--user .fi-chat-msg__avatar {
  background: linear-gradient(135deg, #0ea5e9, #06b6d4);
}

.fi-chat-msg__bubble {
  max-width: 85%;
  padding: 8px 11px;
  border-radius: 12px;
  font-size: 12.5px;
  line-height: 1.5;
}

.fi-chat-msg--interviewer .fi-chat-msg__bubble {
  background: rgba(59, 130, 246, 0.12);
  border: 1px solid rgba(59, 130, 246, 0.2);
  color: rgba(255,255,255,0.88);
  border-top-left-radius: 4px;
}

.fi-chat-msg--user .fi-chat-msg__bubble {
  background: rgba(14, 165, 233, 0.1);
  border: 1px solid rgba(14, 165, 233, 0.2);
  color: rgba(255,255,255,0.75);
  border-top-right-radius: 4px;
}

/* Typing indicator */
.fi-chat-typing {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.fi-chat-typing__avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, #3b82f6, #8b5cf6);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}

.fi-chat-typing__dots {
  display: flex;
  align-items: center;
  gap: 4px;
  background: rgba(59, 130, 246, 0.12);
  border: 1px solid rgba(59, 130, 246, 0.2);
  border-radius: 12px;
  border-top-left-radius: 4px;
  padding: 10px 14px;
}

.fi-chat-typing__dot {
  width: 6px;
  height: 6px;
  background: rgba(255,255,255,0.5);
  border-radius: 50%;
  animation: fi-typing 1.2s ease-in-out infinite;
}

.fi-chat-typing__dot:nth-child(2) { animation-delay: 0.2s; }
.fi-chat-typing__dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes fi-typing {
  0%, 100% { opacity: 0.3; transform: translateY(0); }
  50% { opacity: 1; transform: translateY(-3px); }
}

/* Call controls */
.fi-call__controls {
  flex-shrink: 0;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: #0f1117;
  border-top: 1px solid rgba(255,255,255,0.07);
}

.fi-ctrl-btn {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: none;
  position: relative;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  transition: transform 0.15s, opacity 0.15s, background 0.2s;
}

.fi-ctrl-btn:hover { transform: scale(1.08); }
.fi-ctrl-btn:active { transform: scale(0.95); }

.fi-ctrl-btn--mic {
  background: rgba(255,255,255,0.1);
  color: #fff;
}

.fi-ctrl-btn--cam {
  background: rgba(255,255,255,0.1);
  color: #fff;
}

.fi-ctrl-btn--off {
  background: rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.4);
}

.fi-ctrl-btn--end {
  background: #ef4444;
  color: #fff;
  width: 48px;
  height: 48px;
  font-size: 18px;
}

.fi-ctrl-btn--end:hover { background: #dc2626; }

.fi-ctrl-btn--more {
  background: rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.6);
  font-size: 14px;
}

.fi-ctrl-more {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.fi-ctrl-more__dropdown {
  position: absolute;
  bottom: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%) translateY(6px);
  width: max-content;
  max-width: min(220px, 70vw);
  padding: 4px;
  border-radius: 10px;
  background: #1a1d27;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.45);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.16s ease, transform 0.16s ease, visibility 0.16s ease;
  z-index: 20;
}

.fi-ctrl-more.is-open .fi-ctrl-more__dropdown {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}

.fi-ctrl-more__item {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: auto;
  padding: 8px 12px;
  border-radius: 8px;
  color: #f3f4f6;
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.25;
  white-space: nowrap;
  transition: background 0.15s ease;
}

.fi-ctrl-more__item:hover,
.fi-ctrl-more__item:focus-visible {
  background: rgba(255, 255, 255, 0.08);
  outline: none;
}

/* ============================================================
   RIGHT - QUESTIONS PANEL
   ============================================================ */
.fi-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
  background: #0f1117;
}

/* Panel header */
.fi-panel__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.07);
  flex-shrink: 0;
  gap: 16px;
}

.fi-panel__phase-tabs {
  display: flex;
  gap: 4px;
  background: rgba(255,255,255,0.05);
  border-radius: 10px;
  padding: 3px;
}

.fi-panel__phase-tab {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 12.5px;
  font-weight: 600;
  color: rgba(255,255,255,0.45);
  cursor: default;
  transition: background 0.2s, color 0.2s;
  white-space: nowrap;
}

.fi-panel__phase-tab--active {
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.25);
}

.fi-panel__phase-tab--done {
  color: #22c55e;
}

.fi-panel__phase-tab--done .fi-panel__tab-icon {
  color: #22c55e;
}

.fi-panel__progress {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: rgba(255,255,255,0.45);
  flex-shrink: 0;
}

.fi-panel__progress-bar {
  width: 100px;
  height: 4px;
  background: rgba(255,255,255,0.1);
  border-radius: 4px;
  overflow: hidden;
}

.fi-panel__progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #3b82f6, #8b5cf6);
  border-radius: 4px;
  transition: width 0.4s ease;
}

/* ============================================================
   THEORY PHASE - Quiz layout
   ============================================================ */
.fi-theory {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 0;
}

/* Header: label + progress */
.fi-theory__header {
  flex-shrink: 0;
  padding: 16px 20px 0;
}

.fi-theory__q-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  font-weight: 600;
  color: #60a5fa;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 12px;
}

.fi-theory__q-badge {
  background: rgba(59, 130, 246, 0.15);
  border: 1px solid rgba(59, 130, 246, 0.3);
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 10px;
}

/* Two-column quiz body */
.fi-quiz {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  overflow: hidden;
  min-height: 0;
}

/* Left column: question */
.fi-quiz__left {
  display: flex;
  flex-direction: column;
  padding: 16px 20px 16px 20px;
  border-right: 1px solid rgba(255,255,255,0.07);
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.08) transparent;
  gap: 14px;
}

.fi-quiz__left::-webkit-scrollbar { width: 4px; }
.fi-quiz__left::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 4px; }

.fi-quiz__question {
  display: flex;
  flex-direction: column;
  gap: 12px;
  font-size: 17px;
  font-weight: 600;
  color: #fff;
  line-height: 1.5;
  flex-shrink: 0;
}

.fi-quiz__question-head {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.fi-quiz__topic-badge {
  width: 40px;
  min-width: 40px;
  height: 40px;
  padding: 0;
  border-radius: 11px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.7px;
  color: #fff;
  border: 1px solid transparent;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.12);
  overflow: hidden;
}

.fi-quiz__topic-badge .fi-topic-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  margin: 0;
  line-height: 1;
}

.fi-topic-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}

.fi-topic-icon--fa {
  font-size: 18px;
  line-height: 1;
}

.fi-topic-icon--fa::before {
  display: block;
  line-height: 1;
}

.fi-topic-icon--js {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: #f7df1e;
  color: #1f2229;
  font-family: 'Roboto Condensed', 'Roboto', sans-serif;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: -0.4px;
}

.fi-topic-icon--ts {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: #3178c6;
  color: #fff;
  font-family: 'Roboto Condensed', 'Roboto', sans-serif;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: -0.3px;
}

.fi-quiz__topic-badge--javascript {
  background: linear-gradient(135deg, rgba(245, 223, 77, 0.24), rgba(245, 158, 11, 0.24));
  border-color: rgba(245, 223, 77, 0.32);
  color: #fde68a;
}

.fi-quiz__topic-badge--html {
  background: linear-gradient(135deg, rgba(249, 115, 22, 0.22), rgba(239, 68, 68, 0.2));
  border-color: rgba(249, 115, 22, 0.3);
  color: #fdba74;
}

.fi-quiz__topic-badge--css {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.24), rgba(99, 102, 241, 0.22));
  border-color: rgba(96, 165, 250, 0.32);
  color: #bfdbfe;
}

.fi-quiz__topic-badge--dom {
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.2), rgba(16, 185, 129, 0.2));
  border-color: rgba(74, 222, 128, 0.28);
  color: #bbf7d0;
}

.fi-quiz__topic-badge--web {
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.22), rgba(168, 85, 247, 0.2));
  border-color: rgba(125, 211, 252, 0.3);
  color: #bae6fd;
}

.fi-quiz__topic-badge--react {
  background: linear-gradient(135deg, rgba(34, 211, 238, 0.22), rgba(6, 182, 212, 0.18));
  border-color: rgba(103, 232, 249, 0.3);
  color: #cffafe;
}

.fi-quiz__topic-badge--angular {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.22), rgba(220, 38, 38, 0.18));
  border-color: rgba(248, 113, 113, 0.3);
  color: #fecaca;
}

.fi-quiz__topic-badge--typescript {
  background: linear-gradient(135deg, rgba(49, 120, 198, 0.24), rgba(37, 99, 235, 0.2));
  border-color: rgba(96, 165, 250, 0.32);
  color: #dbeafe;
}

.fi-quiz__topic-badge--git {
  background: linear-gradient(135deg, rgba(248, 113, 113, 0.2), rgba(239, 68, 68, 0.18));
  border-color: rgba(252, 165, 165, 0.28);
  color: #fecaca;
}

.fi-quiz__topic-badge--database {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.22), rgba(5, 150, 105, 0.18));
  border-color: rgba(52, 211, 153, 0.3);
  color: #bbf7d0;
}

.fi-quiz__topic-badge--state,
.fi-quiz__topic-badge--api,
.fi-quiz__topic-badge--nodejs,
.fi-quiz__topic-badge--security,
.fi-quiz__topic-badge--devops,
.fi-quiz__topic-badge--cicd {
  background: linear-gradient(135deg, rgba(148, 163, 184, 0.22), rgba(100, 116, 139, 0.18));
  border-color: rgba(148, 163, 184, 0.28);
  color: #e2e8f0;
}

.fi-quiz__topic-badge--hr {
  background: linear-gradient(135deg, rgba(236, 72, 153, 0.22), rgba(244, 114, 182, 0.16));
  border-color: rgba(244, 114, 182, 0.32);
  color: #fbcfe8;
}

.fi-quiz__topic-badge--generic {
  background: linear-gradient(135deg, rgba(148, 163, 184, 0.22), rgba(99, 102, 241, 0.18));
  border-color: rgba(148, 163, 184, 0.28);
  color: #e2e8f0;
}

.fi-quiz__topic-label {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: rgba(255,255,255,0.48);
}

.fi-quiz__question-body {
  font-size: 18px;
  font-weight: 700;
  line-height: 1.65;
  color: #fff;
}

.fi-quiz__question-body code {
  background: rgba(255,255,255,0.08);
  padding: 2px 6px;
  border-radius: 5px;
  font-size: 0.9em;
  color: #c4b5fd;
  font-family: 'Roboto Mono', monospace;
}

.fi-quiz__hint {
  font-size: 12px;
  color: rgba(255,255,255,0.38);
  line-height: 1.55;
  padding: 10px 12px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 8px;
  flex-shrink: 0;
}

.fi-quiz__hint i {
  color: #fbbf24;
  margin-right: 5px;
}

.fi-quiz__hint code {
  background: rgba(255,255,255,0.07);
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 11px;
  color: #a78bfa;
  font-family: 'Roboto Mono', monospace;
}

/* Explanation after answering */
.fi-quiz__explain {
  display: none;
  flex-direction: column;
  gap: 8px;
  background: rgba(34, 197, 94, 0.06);
  border: 1px solid rgba(34, 197, 94, 0.2);
  border-radius: 10px;
  padding: 12px 14px;
  animation: fi-msg-in 0.3s ease;
}

.fi-quiz__explain--visible { display: flex; }

.fi-quiz__explain--wrong {
  background: rgba(239, 68, 68, 0.06);
  border-color: rgba(239, 68, 68, 0.2);
}

.fi-quiz__explain-label {
  font-size: 11px;
  font-weight: 700;
  color: #22c55e;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  display: flex;
  align-items: center;
  gap: 5px;
}

.fi-quiz__explain--wrong .fi-quiz__explain-label { color: #f87171; }

.fi-quiz__explain-text {
  font-size: 12.5px;
  color: rgba(255,255,255,0.75);
  line-height: 1.6;
}

.fi-quiz__explain-text code {
  background: rgba(255,255,255,0.08);
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 11.5px;
  color: #a78bfa;
  font-family: 'Roboto Mono', monospace;
}

.fi-quiz__explain-text strong {
  color: rgba(255,255,255,0.9);
}

.fi-quiz__explain-summary {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(255,255,255,0.08);
  font-size: 12.5px;
  color: rgba(255,255,255,0.78);
  line-height: 1.6;
}

.fi-quiz__explain-summary p {
  margin: 0 0 6px;
}

.fi-quiz__explain-summary p:last-child {
  margin-bottom: 0;
}

.fi-quiz__strength-note {
  margin: 12px 0 0;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
}

.fi-quiz__strength-note p {
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.88);
}

.fi-quiz__strength-note--good {
  border-color: rgba(34, 197, 94, 0.28);
  background: rgba(34, 197, 94, 0.08);
}

.fi-quiz__strength-note--bad {
  border-color: rgba(248, 113, 113, 0.28);
  background: rgba(248, 113, 113, 0.08);
}

.fi-quiz__visual-col--good {
  border-color: #86efac;
  background: #f0fdf4;
}

.fi-quiz__visual-col--good .fi-quiz__visual-col-title {
  color: #15803d;
}

.fi-quiz__visual-col--bad {
  border-color: #fca5a5;
  background: #fef2f2;
}

.fi-quiz__visual-col--bad .fi-quiz__visual-col-title {
  color: #b91c1c;
}

.fi-confirm__btn--primary {
  background: #3b82f6;
  color: #fff;
}

.fi-confirm__btn--primary:hover {
  background: #2563eb;
}

.fi-quiz__hint strong,
.fi-quiz__explain-tip strong {
  color: rgba(255,255,255,0.86);
}

/* Наглядный блок «Как это выглядит» - дополняет тему, не дублирует правильный ответ */
.fi-quiz__visual {
  margin-top: 10px;
  padding: 14px;
  border-radius: 12px;
  background: #1a1d24;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.fi-quiz__visual-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.fi-quiz__visual-title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  line-height: 1.3;
  flex-shrink: 0;
}

.fi-quiz__visual-check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #3b82f6;
  color: #fff;
  font-size: 11px;
  flex-shrink: 0;
}

.fi-quiz__visual-caption {
  margin: 0;
  max-width: 55%;
  text-align: right;
  font-size: 11px;
  line-height: 1.4;
  color: rgba(255, 255, 255, 0.45);
}

.fi-quiz__visual-stage {
  background: #fff;
  border-radius: 10px;
  padding: 14px;
  color: #111;
}

.fi-quiz__visual-stack {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.fi-quiz__visual-block {
  display: block;
  width: 100%;
  padding: 12px 14px;
  border: 1px solid #d6d9e0;
  border-radius: 6px;
  background: #fff;
  color: #111;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.4;
  text-align: left;
  box-sizing: border-box;
}

.fi-quiz__visual-block--muted {
  opacity: 0.55;
  background: #f3f4f6;
}

.fi-quiz__visual-block--accent {
  border-color: #86efac;
  background: #f0fdf4;
}

.fi-quiz__visual-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  align-items: center;
  padding: 4px 2px;
}

.fi-quiz__visual-nav a,
.fi-quiz__visual-link {
  color: #1d4ed8;
  font-size: 13px;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.fi-quiz__visual-nav a:hover,
.fi-quiz__visual-nav a:focus-visible,
.fi-quiz__visual-link:hover,
.fi-quiz__visual-link:focus-visible {
  color: #1e40af;
}

.fi-quiz__visual-nav a:focus-visible,
.fi-quiz__visual-link:focus-visible {
  outline: 2px solid #93c5fd;
  outline-offset: 2px;
  border-radius: 2px;
}

.fi-quiz__visual-flex {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.fi-quiz__visual-grid {
  display: grid;
  grid-template-columns: repeat(var(--fi-grid-cols, 3), minmax(0, 1fr));
  gap: 8px;
}

.fi-quiz__visual-grid-cell {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 8px;
  border: 1px solid #d6d9e0;
  border-radius: 6px;
  background: #f8fafc;
  color: #111;
  font-size: 12px;
  font-weight: 600;
  text-align: center;
}

.fi-quiz__visual-img {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: stretch;
}

.fi-quiz__visual-img-broken {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 72px;
  border: 1px dashed #94a3b8;
  border-radius: 6px;
  background: #f1f5f9;
  color: #64748b;
  font-size: 12px;
  font-weight: 600;
}

.fi-quiz__visual-img-alt {
  margin: 0;
  padding: 12px 14px;
  border: 1px solid #86efac;
  border-radius: 6px;
  background: #f0fdf4;
  color: #14532d;
  font-size: 13px;
  font-weight: 600;
}

.fi-quiz__visual-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 8px 12px;
  border: 1px solid #d6d9e0;
  border-radius: 6px;
  background: #f8fafc;
  color: #111;
  font-size: 12px;
  font-weight: 600;
}

.fi-quiz__visual-compare {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.fi-quiz__visual-col {
  border: 1px solid #d6d9e0;
  border-radius: 6px;
  padding: 10px;
  background: #fff;
}

.fi-quiz__visual-col-title {
  margin: 0 0 8px;
  font-size: 11px;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.fi-quiz__visual-col-body {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  color: #111;
  line-height: 1.45;
  word-break: break-word;
  white-space: pre-line;
}

.fi-quiz__visual-result {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.fi-quiz__visual-result-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid #d6d9e0;
  border-radius: 6px;
  font-size: 12.5px;
}

.fi-quiz__visual-result-expr {
  font-family: 'Roboto Mono', 'Courier New', monospace;
  color: #334155;
  word-break: break-word;
}

.fi-quiz__visual-result-value {
  font-weight: 700;
  color: #15803d;
  font-family: 'Roboto Mono', 'Courier New', monospace;
  flex-shrink: 0;
}

.fi-quiz__visual-color {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.fi-quiz__visual-color-sample {
  padding: 16px;
  border-radius: 6px;
  border: 1px solid #e2e8f0;
  font-size: 18px;
  font-weight: 700;
  text-align: center;
}

.fi-quiz__visual-note {
  margin: 0;
  font-size: 12px;
  color: #475569;
  line-height: 1.45;
}

.fi-quiz__visual-flow {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.fi-quiz__visual-flow-step {
  padding: 8px 10px;
  border: 1px solid #d6d9e0;
  border-radius: 6px;
  background: #f8fafc;
  font-size: 12px;
  font-weight: 600;
  color: #111;
}

.fi-quiz__visual-flow-arrow {
  color: #94a3b8;
  font-size: 12px;
  font-weight: 700;
}

.fi-quiz__visual-code {
  margin: 0;
  padding: 0;
  font-family: 'Roboto Mono', 'Courier New', monospace;
  font-size: 12px;
  line-height: 1.6;
  color: #0f172a;
  white-space: pre-wrap;
  word-break: break-word;
}

@media (max-width: 640px) {
  .fi-quiz__visual-head {
    flex-direction: column;
    gap: 6px;
  }

  .fi-quiz__visual-caption {
    max-width: 100%;
    text-align: left;
  }

  .fi-quiz__visual-compare {
    grid-template-columns: 1fr;
  }
}

.fi-quiz__code-block {
  margin: 10px 0 0;
  padding: 12px 14px;
  border-radius: 10px;
  background:
    radial-gradient(circle at top right, rgba(99, 102, 241, 0.14), transparent 34%),
    rgba(15, 17, 23, 0.9);
  border: 1px solid rgba(255,255,255,0.08);
  overflow-x: auto;
  white-space: pre;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.04);
}

.fi-quiz__code-block code {
  display: block;
  color: #c4b5fd;
  font-family: 'Roboto Mono', 'Courier New', monospace;
  font-size: 11.5px;
  line-height: 1.65;
  background: transparent;
  padding: 0;
  border-radius: 0;
}

/* Ссылки внутри примера кода - светлые, иначе дефолтный фиолетовый почти невидим на тёмном фоне */
.fi-quiz__code-block a,
.fi-quiz__explain-text a,
.fi-quiz__explain-summary a,
.fi-quiz__explain-tip a,
.fi-quiz__hint a {
  color: #c4b5fd;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
  word-break: break-word;
}

.fi-quiz__code-block a:hover,
.fi-quiz__code-block a:focus-visible,
.fi-quiz__explain-text a:hover,
.fi-quiz__explain-text a:focus-visible,
.fi-quiz__explain-summary a:hover,
.fi-quiz__explain-summary a:focus-visible,
.fi-quiz__explain-tip a:hover,
.fi-quiz__explain-tip a:focus-visible,
.fi-quiz__hint a:hover,
.fi-quiz__hint a:focus-visible {
  color: #e9d5ff;
}

.fi-quiz__code-block a:focus-visible,
.fi-quiz__explain-text a:focus-visible,
.fi-quiz__explain-summary a:focus-visible,
.fi-quiz__explain-tip a:focus-visible,
.fi-quiz__hint a:focus-visible {
  outline: 2px solid #c4b5fd;
  outline-offset: 2px;
  border-radius: 2px;
}

/* Right column: options + actions */
.fi-quiz__right {
  display: flex;
  flex-direction: column;
  padding: 16px 20px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.08) transparent;
  gap: 10px;
}

.fi-quiz__right::-webkit-scrollbar { width: 4px; }
.fi-quiz__right::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 4px; }

.fi-quiz__options-label {
  font-size: 11px;
  font-weight: 600;
  color: rgba(255,255,255,0.35);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin-bottom: 2px;
  flex-shrink: 0;
}

/* Single option card */
.fi-quiz__option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1.5px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.03);
  cursor: pointer;
  transition: border-color 0.18s, background 0.18s, transform 0.12s;
  user-select: none;
  flex-shrink: 0;
  text-align: left;
  width: 100%;
}

.fi-quiz__option:hover:not(.fi-quiz__option--disabled) {
  border-color: rgba(99, 102, 241, 0.5);
  background: rgba(99, 102, 241, 0.07);
  transform: translateX(2px);
}

.fi-quiz__option--selected {
  border-color: #6366f1;
  background: rgba(99, 102, 241, 0.12);
}

.fi-quiz__option--correct {
  border-color: #22c55e !important;
  background: rgba(34, 197, 94, 0.1) !important;
}

.fi-quiz__option--wrong {
  border-color: #ef4444 !important;
  background: rgba(239, 68, 68, 0.08) !important;
}

.fi-quiz__option--disabled {
  cursor: default;
}

.fi-quiz__option-letter {
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  border-radius: 6px;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: rgba(255,255,255,0.5);
  transition: background 0.18s, color 0.18s, border-color 0.18s;
  margin-top: 0;
  align-self: center;
}

.fi-quiz__option--selected .fi-quiz__option-letter {
  background: #6366f1;
  border-color: #6366f1;
  color: #fff;
}

.fi-quiz__option--correct .fi-quiz__option-letter {
  background: #22c55e;
  border-color: #22c55e;
  color: #fff;
}

.fi-quiz__option--wrong .fi-quiz__option-letter {
  background: #ef4444;
  border-color: #ef4444;
  color: #fff;
}

.fi-quiz__option-text {
  font-size: 13px;
  color: rgba(255,255,255,0.7);
  line-height: 1.5;
  transition: color 0.18s;
}

.fi-quiz__option--selected .fi-quiz__option-text,
.fi-quiz__option--correct .fi-quiz__option-text {
  color: rgba(255,255,255,0.95);
}

/* Actions below options */
.fi-quiz__actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: auto;
  padding-top: 10px;
  flex-shrink: 0;
}

.fi-quiz__skip-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.1);
  background: transparent;
  color: rgba(255,255,255,0.4);
  font-size: 13px;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.fi-quiz__skip-btn:hover {
  background: rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.7);
}

.fi-quiz__next-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 22px;
  border-radius: 8px;
  border: 1px solid rgba(138, 150, 166, 0.34);
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.72);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.15s ease, opacity 0.2s ease;
  opacity: 0.4;
  pointer-events: none;
}

.fi-quiz__next-btn--active {
  opacity: 1;
  pointer-events: auto;
}

.fi-quiz__next-btn--active:hover {
  background: rgba(138, 150, 166, 0.16);
  border-color: rgba(138, 150, 166, 0.58);
  color: rgba(255, 255, 255, 0.92);
  opacity: 1;
  transform: translateY(-1px);
}

.fi-quiz__next-btn--active:active {
  transform: translateY(0);
}

.fi-quiz__next-btn--active:focus-visible {
  outline: 2px solid rgba(138, 150, 166, 0.7);
  outline-offset: 2px;
}

/* ============================================================
   VERTICAL RESIZE DIVIDER (between preview & editor)
   ============================================================ */
.fi-resize-divider {
  flex: 0 0 6px;
  height: 6px;
  min-height: 6px;
  width: 100%;
  background: rgba(255,255,255,0.07);
  cursor: row-resize;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.15s;
  position: relative;
  z-index: 10;
}

.fi-resize-divider::before {
  content: '';
  width: 32px;
  height: 2px;
  border-radius: 2px;
  background: rgba(255,255,255,0.18);
  transition: background 0.15s, width 0.15s;
}

.fi-resize-divider:hover,
.fi-resize-divider--active {
  background: rgba(59, 130, 246, 0.25);
}

.fi-resize-divider:hover::before,
.fi-resize-divider--active::before {
  background: #60a5fa;
  width: 48px;
}

/* ============================================================
   CODE EDITOR
   ============================================================ */
.fi-coding__editor-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
  border-right: 1px solid rgba(255,255,255,0.07);
}

.fi-coding__editor-highlight-wrap {
  flex: 1;
  min-height: 0;
  position: relative;
  overflow: hidden;
}

.fi-coding__editor {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 16px 18px;
  font-family: 'Roboto Mono', 'Courier New', monospace !important;
  font-size: 13px !important;
  line-height: 20px !important;
  letter-spacing: 0;
  tab-size: 2;
  white-space: pre;
  overflow: auto;
  box-sizing: border-box;
  border: none;
  outline: none;
  background: transparent;
  color: #e2e8f0;
  caret-color: #e2e8f0;
  resize: none;
  z-index: 2;
  -webkit-text-fill-color: #e2e8f0;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.1) transparent;
}

.fi-coding__editor::selection {
  background: rgba(96, 165, 250, 0.28);
  color: #f8fafc;
  -webkit-text-fill-color: #f8fafc;
}

.fi-coding__editor::-webkit-scrollbar { width: 5px; height: 5px; }
.fi-coding__editor::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 4px; }

/* ============================================================
   CODING PHASE  - split 50/50 vertically
   ============================================================ */
.fi-coding {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 0;
}

/* Top half - preview (50% by default, resizable) */
.fi-coding__preview {
  flex: 1 1 50%;
  display: flex;
  flex-direction: column;
  min-height: 60px;
  overflow: hidden;
}

.fi-coding__preview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 14px;
  background: #141720;
  border-bottom: 1px solid rgba(255,255,255,0.07);
  flex-shrink: 0;
}

.fi-coding__preview-title {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  font-weight: 600;
  color: rgba(255,255,255,0.6);
}

.fi-coding__preview-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #22c55e;
}

.fi-coding__run-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 14px;
  border-radius: 8px;
  border: none;
  background: linear-gradient(135deg, #22c55e, #16a34a);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.15s;
}

.fi-coding__run-btn:hover { opacity: 0.88; transform: translateY(-1px); }
.fi-coding__run-btn:active { transform: translateY(0); }

.fi-coding__preview-frame {
  flex: 1;
  min-height: 0;
  background: #fff;
  border: none;
  width: 100%;
  display: block;
}

/* Bottom half - editor + task (50% by default, resizable) */
.fi-coding__bottom {
  flex: 1 1 50%;
  display: flex;
  flex-direction: column;
  min-height: 60px;
  overflow: hidden;
  background: #1a1e2a;
}

.fi-coding__bottom-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 14px;
  background: #141720;
  border-bottom: 1px solid rgba(255,255,255,0.07);
  flex-shrink: 0;
  gap: 12px;
}

.fi-coding__q-info {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.fi-coding__q-num {
  font-size: 11px;
  font-weight: 700;
  color: #8b5cf6;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  white-space: nowrap;
}

.fi-coding__q-title {
  font-size: 12.5px;
  font-weight: 600;
  color: rgba(255,255,255,0.75);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fi-coding__bottom-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.fi-coding__copy-btn,
.fi-coding__clear-btn,
.fi-coding__reset-btn {
  width: 30px;
  height: 30px;
  border-radius: 6px;
  border: 1px solid rgba(255,255,255,0.1);
  background: transparent;
  color: rgba(255,255,255,0.4);
  font-size: 13px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, color 0.2s;
}

.fi-coding__copy-btn:hover,
.fi-coding__clear-btn:hover,
.fi-coding__reset-btn:hover {
  background: rgba(255,255,255,0.07);
  color: rgba(255,255,255,0.75);
}

.fi-coding__next-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: 16px;
  padding: 7px 16px;
  border-radius: 8px;
  border: 1px solid rgba(138, 150, 166, 0.34);
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.72);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.15s ease;
}

.fi-coding__next-btn:hover {
  background: rgba(138, 150, 166, 0.16);
  border-color: rgba(138, 150, 166, 0.58);
  color: rgba(255, 255, 255, 0.92);
  transform: translateY(-1px);
}

.fi-coding__next-btn:active {
  transform: translateY(0);
}

.fi-coding__next-btn:focus-visible {
  outline: 2px solid rgba(138, 150, 166, 0.7);
  outline-offset: 2px;
}

.fi-coding__bottom-body {
  flex: 1;
  display: flex;
  min-height: 0;
  overflow: hidden;
}

/* Editor */
.fi-coding__editor-tabs {
  display: flex;
  align-items: center;
  padding: 0 14px;
  height: 32px;
  background: #0f1117;
  border-bottom: 1px solid rgba(255,255,255,0.07);
  flex-shrink: 0;
}

.fi-coding__editor-tab {
  font-size: 11.5px;
  color: rgba(255,255,255,0.5);
  padding: 0 12px;
  height: 100%;
  display: flex;
  align-items: center;
  gap: 6px;
  border-bottom: 2px solid #3b82f6;
  color: #60a5fa;
}


/* Task description panel */
.fi-coding__task-panel {
  width: 280px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #141720;
}

.fi-coding__task-tabs {
  display: flex;
  padding: 0 14px;
  height: 32px;
  background: #0f1117;
  border-bottom: 1px solid rgba(255,255,255,0.07);
  align-items: center;
}

.fi-coding__task-tab {
  font-size: 11.5px;
  color: #60a5fa;
  display: flex;
  align-items: center;
  gap: 5px;
  height: 100%;
  border-bottom: 2px solid #3b82f6;
  padding: 0 8px;
}

.fi-coding__task-body {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.1) transparent;
}

.fi-coding__task-body::-webkit-scrollbar { width: 4px; }
.fi-coding__task-body::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 4px; }

.fi-task-title {
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  margin: 0 0 8px;
}

.fi-task-desc {
  font-size: 12.5px;
  color: rgba(255,255,255,0.65);
  line-height: 1.6;
  margin: 0 0 12px;
}

.fi-task-code {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 6px;
  padding: 10px 12px;
  font-family: 'Roboto Mono', 'Courier New', monospace;
  font-size: 11.5px;
  color: #a78bfa;
  line-height: 1.6;
  overflow-x: auto;
  white-space: pre;
  margin: 0 0 12px;
}

.fi-task-example {
  font-size: 11.5px;
  color: rgba(255,255,255,0.45);
  line-height: 1.6;
}

.fi-task-example strong {
  color: rgba(255,255,255,0.65);
}

/* ============================================================
   DIFFICULTY SELECTION OVERLAY
   ============================================================ */
.fi-difficulty {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: block;
  font-family: "Roboto", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  background: var(--bg-primary, #1f2229);
  overflow-y: auto;
  transition: opacity 0.5s ease, transform 0.5s ease;
  color: #e8edf3;
}

.fi-difficulty--hiding {
  opacity: 0;
  transform: scale(1.04);
  pointer-events: none;
}

.fi-difficulty__bg-decor {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.fi-difficulty__bg-decor::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.035) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: linear-gradient(to bottom, rgba(0,0,0,0.45), transparent 78%);
}

.fi-difficulty__orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.22;
}

.fi-difficulty__orb--1 {
  width: 620px;
  height: 620px;
  background: #3b82f6;
  top: -260px;
  left: -180px;
  animation: fi-orb-float 8s ease-in-out infinite;
}

.fi-difficulty__orb--2 {
  width: 560px;
  height: 560px;
  background: #8b5cf6;
  bottom: -210px;
  right: -160px;
  animation: fi-orb-float 10s ease-in-out infinite reverse;
}

.fi-difficulty__orb--3 {
  width: 420px;
  height: 420px;
  background: #22c55e;
  top: 46%;
  left: 42%;
  animation: fi-orb-float 6s ease-in-out infinite;
}

@keyframes fi-orb-float {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
  50% { transform: translate3d(24px, -18px, 0) scale(1.06); }
}

.fi-difficulty__shell {
  position: relative;
  z-index: 2;
  width: 100%;
  min-height: 100%;
  max-width: 1240px;
  margin: 0 auto;
  padding: 30px 28px 46px;
  display: flex;
  flex-direction: column;
  gap: 34px;
}

.fi-difficulty__topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.fi-difficulty__content {
  display: grid;
  grid-template-columns: minmax(360px, 0.92fr) minmax(520px, 1.08fr);
  gap: 38px;
  align-items: center;
}

.fi-difficulty__logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  opacity: 1;
  transition: transform 0.2s ease, filter 0.2s ease;
}

.fi-difficulty__logo:hover {
  transform: translateY(-1px);
  filter: drop-shadow(0 10px 24px rgba(59, 130, 246, 0.14));
}

.fi-difficulty__logo-img {
  width: 34px;
  height: 34px;
  display: block;
  flex-shrink: 0;
  border-radius: 9px;
  box-shadow: 0 12px 30px rgba(0,0,0,0.35);
}

.fi-difficulty__logo-text {
  display: inline-flex;
  align-items: center;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 2.2px;
  line-height: 1;
  color: #fff;
  text-shadow: 0 0 18px rgba(255, 255, 255, 0.08);
}

.fi-difficulty__top-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 8px;
  background: rgba(255,255,255,0.055);
  border: 1px solid rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.58);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.3px;
  backdrop-filter: blur(16px);
}

.fi-difficulty__live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 0 6px rgba(34,197,94,0.14);
  animation: fi-blink 2.6s ease-in-out infinite;
}

.fi-difficulty__hero {
  text-align: left;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 20px;
}

.fi-difficulty__badge {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 8px;
  background: rgba(38, 49, 61, 0.88);
  border: 1px solid rgba(71, 85, 105, 0.55);
  color: #9aa8ba;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  box-shadow: none;
  overflow: visible;
}

.fi-difficulty__badge-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #7f8ea3;
  animation: fi-blink 2.6s ease-in-out infinite;
  flex-shrink: 0;
}

.fi-difficulty__title {
  font-family: 'Roboto', system-ui, sans-serif;
  font-size: clamp(36px, 4.5vw, 52px);
  font-weight: 800;
  color: #fff;
  line-height: 1.18;
  margin: 0;
  letter-spacing: -0.03em;
  max-width: 620px;
}

.fi-difficulty__title-accent {
  background: linear-gradient(135deg, #fff 0%, #c5d4e8 55%, #a8b8cc 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.fi-difficulty__subtitle {
  font-size: 17px;
  color: rgba(255,255,255,0.6);
  max-width: 560px;
  line-height: 1.7;
  margin: 0;
}

.fi-difficulty__preview-card {
  width: min(100%, 500px);
  margin-top: 10px;
  padding: 18px;
  border-radius: 12px;
  background:
    linear-gradient(135deg, rgba(255,255,255,0.12), rgba(255,255,255,0.035)),
    rgba(15,17,23,0.66);
  border: 1px solid rgba(255,255,255,0.12);
  box-shadow:
    0 24px 80px rgba(0,0,0,0.35),
    inset 0 1px 0 rgba(255,255,255,0.08);
  backdrop-filter: blur(22px);
}

.fi-difficulty__preview-head {
  display: flex;
  align-items: center;
  gap: 12px;
}

.fi-difficulty__preview-avatar {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #3b82f6, #8b5cf6);
  color: #fff;
  font-size: 14px;
  font-weight: 800;
  box-shadow: 0 12px 34px rgba(59,130,246,0.28);
  overflow: hidden;
}

.fi-difficulty__preview-avatar--photo {
  background: #111827;
  padding: 0;
}

.fi-difficulty__preview-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.fi-difficulty__preview-name {
  font-size: 14px;
  font-weight: 800;
  color: #fff;
}

.fi-difficulty__preview-role {
  font-size: 12px;
  color: rgba(255,255,255,0.45);
  margin-top: 2px;
}

.fi-difficulty__preview-status {
  margin-left: auto;
  padding: 5px 10px;
  border-radius: 8px;
  background: rgba(34,197,94,0.1);
  border: 1px solid rgba(34,197,94,0.22);
  color: #22c55e;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.6px;
}

.fi-difficulty__preview-body {
  margin-top: 16px;
  padding: 16px;
  border-radius: 10px;
  background: rgba(0,0,0,0.22);
  border: 1px solid rgba(255,255,255,0.07);
}

.fi-difficulty__preview-body p {
  margin: 12px 0 0;
  color: rgba(255,255,255,0.72);
  font-size: 13px;
  line-height: 1.6;
}

.fi-difficulty__wave {
  display: flex;
  align-items: center;
  gap: 5px;
  height: 28px;
}

.fi-difficulty__wave span {
  width: 5px;
  border-radius: 8px;
  background: linear-gradient(180deg, #60a5fa, #8b5cf6);
  animation: fi-wave 1s ease-in-out infinite;
}

.fi-difficulty__wave span:nth-child(1) { height: 10px; animation-delay: 0s; }
.fi-difficulty__wave span:nth-child(2) { height: 22px; animation-delay: 0.08s; }
.fi-difficulty__wave span:nth-child(3) { height: 14px; animation-delay: 0.16s; }
.fi-difficulty__wave span:nth-child(4) { height: 26px; animation-delay: 0.24s; }
.fi-difficulty__wave span:nth-child(5) { height: 12px; animation-delay: 0.32s; }

@keyframes fi-wave {
  0%, 100% { transform: scaleY(0.7); opacity: 0.62; }
  50% { transform: scaleY(1.18); opacity: 1; }
}

.fi-difficulty__steps {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  width: min(100%, 560px);
}

.fi-difficulty__step {
  padding: 12px 10px;
  border-radius: 8px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.52);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.35;
}

.fi-difficulty__step span {
  display: block;
  color: #60a5fa;
  font-size: 10px;
  letter-spacing: 0.8px;
  margin-bottom: 3px;
}

.fi-difficulty__selector {
  padding: 22px;
  border-radius: 12px;
  background:
    linear-gradient(135deg, rgba(255,255,255,0.105), rgba(255,255,255,0.035)),
    rgba(12,16,27,0.72);
  border: 1px solid rgba(255,255,255,0.12);
  box-shadow:
    0 34px 100px rgba(0,0,0,0.42),
    inset 0 1px 0 rgba(255,255,255,0.08);
  backdrop-filter: blur(24px);
}

.fi-difficulty__selector-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.fi-difficulty__eyebrow {
  display: block;
  color: #60a5fa;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1.3px;
  text-transform: uppercase;
  margin-bottom: 6px;
}

.fi-difficulty__selector-title {
  margin: 0;
  font-family: 'Roboto', system-ui, sans-serif;
  color: #fff;
  font-size: 28px;
  font-weight: 900;
  letter-spacing: -0.8px;
}

.fi-difficulty__selector-note {
  flex-shrink: 0;
  padding: 6px 12px;
  border-radius: 8px;
  background: rgba(255,197,1,0.1);
  border: 1px solid rgba(255,197,1,0.25);
  color: #ffc501;
  font-size: 11px;
  font-weight: 800;
}

/* Cards grid */
.fi-difficulty__cards {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  width: 100%;
  position: relative;
  z-index: 2;
}

.fi-diff-card {
  position: relative;
  display: grid;
  grid-template-columns: auto auto 1fr auto;
  align-items: center;
  gap: 14px;
  min-height: 126px;
  padding: 18px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.1);
  background:
    linear-gradient(135deg, rgba(255,255,255,0.07), rgba(255,255,255,0.025)),
    rgba(255,255,255,0.035);
  cursor: pointer;
  text-align: left;
  transition: border-color 0.25s, background 0.25s, transform 0.2s, box-shadow 0.25s;
  overflow: hidden;
  color: inherit;
  font-family: 'Roboto', sans-serif;
}

.fi-diff-card:hover {
  transform: translateY(-4px) scale(1.01);
}

.fi-diff-card__glow {
  position: absolute;
  inset: 0;
  opacity: 0;
  border-radius: inherit;
  transition: opacity 0.3s;
  pointer-events: none;
}

.fi-diff-card:hover .fi-diff-card__glow { opacity: 1; }

/* Easy */
.fi-diff-card--easy { --card-color: #22c55e; border-color: rgba(34, 197, 94, 0.22); }
.fi-diff-card--easy:hover { border-color: rgba(34, 197, 94, 0.65); background: rgba(34, 197, 94, 0.07); box-shadow: 0 18px 54px rgba(34, 197, 94, 0.18); }
.fi-diff-card--easy .fi-diff-card__glow { background: radial-gradient(ellipse at 6% 50%, rgba(34,197,94,0.18), transparent 66%); }
.fi-diff-card--easy .fi-diff-card__icon-wrap { background: rgba(34, 197, 94, 0.12); border-color: rgba(34, 197, 94, 0.3); }
.fi-diff-card--easy .fi-diff-card__icon { color: #22c55e; }
.fi-diff-card--easy .fi-diff-card__kicker,
.fi-diff-card--easy .fi-diff-card__index,
.fi-diff-card--easy .fi-diff-card__cta { color: #22c55e; }

/* Medium */
.fi-diff-card--medium { --card-color: #3b82f6; border-color: rgba(59, 130, 246, 0.22); }
.fi-diff-card--medium:hover { border-color: rgba(59, 130, 246, 0.65); background: rgba(59, 130, 246, 0.07); box-shadow: 0 18px 54px rgba(59, 130, 246, 0.18); }
.fi-diff-card--medium .fi-diff-card__glow { background: radial-gradient(ellipse at 6% 50%, rgba(59,130,246,0.18), transparent 66%); }
.fi-diff-card--medium .fi-diff-card__icon-wrap { background: rgba(59, 130, 246, 0.12); border-color: rgba(59, 130, 246, 0.3); }
.fi-diff-card--medium .fi-diff-card__icon { color: #3b82f6; }
.fi-diff-card--medium .fi-diff-card__kicker,
.fi-diff-card--medium .fi-diff-card__index,
.fi-diff-card--medium .fi-diff-card__cta { color: #3b82f6; }

/* Hard */
.fi-diff-card--hard { --card-color: #f59e0b; border-color: rgba(245, 158, 11, 0.22); }
.fi-diff-card--hard:hover { border-color: rgba(245, 158, 11, 0.65); background: rgba(245, 158, 11, 0.07); box-shadow: 0 18px 54px rgba(245, 158, 11, 0.18); }
.fi-diff-card--hard .fi-diff-card__glow { background: radial-gradient(ellipse at 6% 50%, rgba(245,158,11,0.18), transparent 66%); }
.fi-diff-card--hard .fi-diff-card__icon-wrap { background: rgba(245, 158, 11, 0.12); border-color: rgba(245, 158, 11, 0.3); }
.fi-diff-card--hard .fi-diff-card__icon { color: #f59e0b; }
.fi-diff-card--hard .fi-diff-card__kicker,
.fi-diff-card--hard .fi-diff-card__index,
.fi-diff-card--hard .fi-diff-card__cta { color: #f59e0b; }

/* Expert */
.fi-diff-card--expert { --card-color: #ef4444; border-color: rgba(239, 68, 68, 0.22); }
.fi-diff-card--expert:hover { border-color: rgba(239, 68, 68, 0.65); background: rgba(239, 68, 68, 0.07); box-shadow: 0 18px 54px rgba(239, 68, 68, 0.18); }
.fi-diff-card--expert .fi-diff-card__glow { background: radial-gradient(ellipse at 6% 50%, rgba(239,68,68,0.18), transparent 66%); }
.fi-diff-card--expert .fi-diff-card__icon-wrap { background: rgba(239, 68, 68, 0.12); border-color: rgba(239, 68, 68, 0.3); }
.fi-diff-card--expert .fi-diff-card__icon { color: #ef4444; }
.fi-diff-card--expert .fi-diff-card__kicker,
.fi-diff-card--expert .fi-diff-card__index,
.fi-diff-card--expert .fi-diff-card__cta { color: #ef4444; }

.fi-diff-card__index {
  position: relative;
  z-index: 1;
  width: 36px;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 1px;
  opacity: 0.85;
}

.fi-diff-card__icon-wrap {
  position: relative;
  z-index: 1;
  flex-shrink: 0;
  width: 56px;
  height: 56px;
  border-radius: 10px;
  border: 1px solid;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.08);
}

.fi-diff-card__icon {
  font-size: 21px;
}

.fi-diff-card__body {
  position: relative;
  z-index: 1;
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.fi-diff-card__kicker {
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 1.1px;
}

.fi-diff-card__name {
  font-size: 22px;
  font-weight: 900;
  color: #fff;
  line-height: 1.08;
  letter-spacing: -0.4px;
}

.fi-diff-card__desc {
  font-size: 13px;
  color: rgba(255,255,255,0.58);
  line-height: 1.45;
}

.fi-diff-card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 5px;
}

.fi-diff-card__meta span {
  padding: 5px 9px;
  border-radius: 8px;
  background: rgba(255,255,255,0.055);
  border: 1px solid rgba(255,255,255,0.08);
  font-size: 10.5px;
  font-weight: 700;
  color: rgba(255,255,255,0.48);
  display: flex;
  align-items: center;
  gap: 4px;
}

.fi-diff-card__meta i { font-size: 10px; }

.fi-diff-card__levelbar {
  height: 4px;
  width: 100%;
  max-width: 260px;
  margin-top: 8px;
  border-radius: 8px;
  background: rgba(255,255,255,0.08);
  overflow: hidden;
}

.fi-diff-card__levelbar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--card-color), rgba(255,255,255,0.75));
}

.fi-diff-card__cta {
  position: relative;
  z-index: 1;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 8px;
  background: rgba(255,255,255,0.055);
  border: 1px solid rgba(255,255,255,0.1);
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
  opacity: 0.8;
  transition: background 0.2s, transform 0.2s, opacity 0.2s;
}

.fi-diff-card:hover .fi-diff-card__cta {
  opacity: 1;
  background: rgba(255,255,255,0.1);
  transform: translateX(3px);
}

/* Difficulty badge in header */
.fi-header__difficulty-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 10px;
  background: var(--fi-theme-accent-soft, rgba(255, 255, 255, 0.07));
  color: var(--fi-theme-accent, var(--diff-color, rgba(255, 255, 255, 0.5)));
  border: 1px solid var(--fi-theme-accent-border, var(--diff-color, rgba(255, 255, 255, 0.1)));
  transition: background 0.35s ease, border-color 0.35s ease, color 0.35s ease;
}

/* Theory question level badge */
.fi-theory__q-level {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  background: rgba(139,92,246,0.15);
  border: 1px solid rgba(139,92,246,0.3);
  color: #a78bfa;
  padding: 2px 7px;
  border-radius: 8px;
}

/* Explain tip */
.fi-quiz__explain-tip {
  font-size: 12px;
  color: rgba(255,255,255,0.5);
  line-height: 1.5;
  padding-top: 6px;
  border-top: 1px solid rgba(255,255,255,0.06);
  margin-top: 4px;
}

/* ============================================================
   FINISH SCREEN - двух-колончатый layout
   ============================================================ */
.fi-finish {
  flex: 1;
  overflow-y: auto;
  font-family: 'Roboto', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  -webkit-font-smoothing: antialiased;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.1) transparent;
}

.fi-finish::-webkit-scrollbar { width: 4px; }
.fi-finish::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 4px; }

.fi-finish__layout {
  display: flex;
  min-height: 100%;
  animation: fi-finish-in 0.5s ease;
}

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

/* LEFT - Мария */
.fi-finish__interviewer {
  width: 280px;
  min-width: 240px;
  flex-shrink: 0;
  background: linear-gradient(180deg, #141720 0%, #0f1117 100%);
  border-right: 1px solid rgba(255,255,255,0.07);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 32px 20px 28px;
  gap: 20px;
}

.fi-finish__int-video {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.fi-finish__int-avatar-ring {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background: rgba(255,255,255,0.07);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: box-shadow 0.4s;
}

.fi-finish__int-avatar-ring--speaking {
  animation: fi-speaking-ring 1.2s ease-in-out infinite;
  box-shadow:
    0 0 0 4px rgba(34, 197, 94, 0.5),
    0 0 0 8px rgba(34, 197, 94, 0.2),
    0 0 28px rgba(34, 197, 94, 0.3);
}

.fi-finish__int-avatar {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  background: linear-gradient(135deg, #3b82f6, #8b5cf6);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  font-weight: 700;
  color: #fff;
  letter-spacing: 1px;
  overflow: hidden;
}

.fi-finish__int-avatar--photo {
  background: #111827;
  padding: 0;
}

.fi-finish__int-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 50%;
}

.fi-finish__int-name {
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  text-align: center;
}

.fi-finish__int-role {
  font-size: 11px;
  color: rgba(255,255,255,0.5);
  text-align: center;
  margin-top: -6px;
}

/* Вердикт */
.fi-finish__verdict {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  animation: fi-pop-in 0.5s ease 0.3s both;
}

@keyframes fi-pop-in {
  from { transform: scale(0.6); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.fi-finish__verdict-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
}

.fi-finish__verdict-icon--hired {
  background: rgba(34, 197, 94, 0.15);
  border: 2px solid rgba(34, 197, 94, 0.5);
  color: #22c55e;
  box-shadow: 0 0 24px rgba(34, 197, 94, 0.2);
}

.fi-finish__verdict-icon--rejected {
  background: rgba(239, 68, 68, 0.12);
  border: 2px solid rgba(239, 68, 68, 0.4);
  color: #ef4444;
}

.fi-finish__verdict-text {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 2px;
  text-transform: uppercase;
}

.fi-finish__verdict-text--hired { color: #22c55e; }
.fi-finish__verdict-text--rejected { color: #ef4444; }

/* Зарплата */
.fi-finish__salary-block {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 12px;
  padding: 14px 18px;
  text-align: center;
  width: 100%;
  animation: fi-pop-in 0.5s ease 0.5s both;
}

.fi-finish__salary-label {
  font-size: 10px;
  color: rgba(255,255,255,0.4);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 6px;
}

.fi-finish__salary-value {
  font-size: 22px;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(135deg, #22c55e, #16a34a);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.fi-finish__salary-value--retry {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.fi-finish__salary-level {
  font-size: 11px;
  color: rgba(255,255,255,0.45);
  margin-top: 4px;
}

/* Круговой score ring */
.fi-finish__score-ring-wrap {
  position: relative;
  width: 120px;
  height: 120px;
  margin-top: 4px;
}

.fi-finish__score-ring {
  width: 120px;
  height: 120px;
  transform: rotate(-90deg);
}

.fi-finish__score-ring-bg {
  fill: none;
  stroke: rgba(255,255,255,0.07);
  stroke-width: 8;
}

.fi-finish__score-ring-fill {
  fill: none;
  stroke: #22c55e;
  stroke-width: 8;
  stroke-linecap: round;
  transition: stroke-dashoffset 1.2s ease;
}

.fi-finish__score-ring-label {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
}

.fi-finish__score-pct {
  font-size: 22px;
  font-weight: 800;
  color: #fff;
}

.fi-finish__score-sub {
  font-size: 9px;
  color: rgba(255,255,255,0.4);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* RIGHT - Отчёт */
.fi-finish__report {
  flex: 1;
  min-width: 0;
  padding: 28px 28px 32px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  overflow-y: auto;
}

.fi-finish__report-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.fi-finish__report-title {
  font-family: 'Roboto', system-ui, sans-serif;
  font-size: 22px;
  font-weight: 700;
  color: #fff;
  line-height: 1.35;
  letter-spacing: -0.3px;
}

.fi-finish__report-level {
  flex-shrink: 0;
}

.fi-finish__level-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 700;
  border: 1px solid var(--diff-color, rgba(255,255,255,0.2));
  color: var(--diff-color, rgba(255,255,255,0.6));
  background: color-mix(in srgb, var(--diff-color, rgba(255,255,255,0.1)) 12%, transparent);
}

/* Диалог Алексея */
.fi-finish__alexey-bubble {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: rgba(59, 130, 246, 0.07);
  border: 1px solid rgba(59, 130, 246, 0.2);
  border-radius: 8px;
  padding: 16px;
  animation: fi-msg-in 0.4s ease 0.4s both;
}

.fi-finish__bubble-avatar {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #3b82f6, #8b5cf6);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  overflow: hidden;
}

.fi-finish__bubble-avatar--photo {
  background: #111827;
  padding: 0;
}

.fi-finish__bubble-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.fi-finish__bubble-text {
  font-size: 14px;
  color: rgba(255,255,255,0.85);
  line-height: 1.7;
  letter-spacing: 0.01em;
}

.fi-finish__bubble-text strong {
  color: #fff;
}

/* Статистика - сетка */
.fi-finish__stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.fi-finish__block-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.fi-finish__block-stat {
  padding: 14px 16px;
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255,255,255,0.055), rgba(255,255,255,0.03)),
    rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
}

.fi-finish__block-kicker {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: rgba(255,255,255,0.46);
}

.fi-finish__block-value {
  margin-top: 8px;
  font-size: 22px;
  font-weight: 900;
  color: #fff;
  letter-spacing: -0.6px;
}

.fi-finish__block-meta {
  margin-top: 6px;
  font-size: 12px;
  line-height: 1.55;
  color: rgba(255,255,255,0.52);
}

.fi-finish__stat-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  padding: 12px 14px;
}

.fi-finish__stat-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
}

.fi-finish__stat-icon--correct { background: rgba(34,197,94,0.12); color: #22c55e; border: 1px solid rgba(34,197,94,0.25); }
.fi-finish__stat-icon--time    { background: rgba(59,130,246,0.12); color: #60a5fa; border: 1px solid rgba(59,130,246,0.25); }
.fi-finish__stat-icon--level   { background: rgba(139,92,246,0.12); color: #a78bfa; border: 1px solid rgba(139,92,246,0.25); }
.fi-finish__stat-icon--code    { background: rgba(245,158,11,0.12); color: #fbbf24; border: 1px solid rgba(245,158,11,0.25); }

.fi-finish__stat-body {
  min-width: 0;
}

.fi-finish__stat-val {
  font-size: 16px;
  font-weight: 700;
  color: #fff;
}

.fi-finish__stat-lbl {
  font-size: 11px;
  color: rgba(255,255,255,0.4);
  margin-top: 2px;
}

/* Рекомендации */
.fi-finish__recs {
  background: rgba(251, 191, 36, 0.06);
  border: 1px solid rgba(251, 191, 36, 0.18);
  border-radius: 12px;
  padding: 14px 16px;
}

.fi-finish__recs-title {
  font-size: 12px;
  font-weight: 700;
  color: #fbbf24;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 7px;
}

.fi-finish__recs-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.fi-finish__rec-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 13px;
  color: rgba(255,255,255,0.7);
  line-height: 1.5;
}

.fi-finish__rec-item i {
  color: #fbbf24;
  font-size: 12px;
  margin-top: 2px;
  flex-shrink: 0;
}

.fi-finish__recs-congrats {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13.5px;
  color: rgba(255,255,255,0.7);
}

.fi-finish__recs-congrats i {
  color: #fbbf24;
  font-size: 18px;
  flex-shrink: 0;
}

/* Кнопки */
.fi-finish__actions {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: auto;
}

.fi-finish__home-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 11px 24px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.05);
  color: rgba(255,255,255,0.65);
  font-size: 13.5px;
  font-weight: 600;
  font-family: 'Roboto', sans-serif;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, transform 0.15s;
}

.fi-finish__home-btn i {
  flex-shrink: 0;
  font-size: 14px;
  line-height: 1;
}

.fi-finish__home-btn--repeat {
  justify-content: center;
  border-color: rgba(99, 102, 241, 0.35);
  background: rgba(99, 102, 241, 0.12);
  color: #c7d2fe;
}

.fi-finish__home-btn--repeat:hover {
  background: rgba(99, 102, 241, 0.2);
  color: #fff;
}

.fi-finish__restart-hint {
  flex: 1 1 220px;
  margin: 0;
  font-size: 13px;
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.55);
}

.fi-finish__restart-hint strong {
  color: rgba(255, 255, 255, 0.82);
  font-weight: 700;
}

.fi-finish__restart-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 11px 24px;
  border-radius: 10px;
  border: none;
  background: linear-gradient(135deg, #3b82f6, #8b5cf6);
  color: #fff;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.15s;
  font-family: 'Roboto', sans-serif;
}

.fi-finish__restart-btn:hover { opacity: 0.9; transform: translateY(-1px); }

.fi-finish__home-btn:hover { background: rgba(255,255,255,0.1); color: #fff; transform: translateY(-1px); }

/* ============================================================
   ADAPTIVE BADGE
   ============================================================ */
.fi-header__adaptive-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.2px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.05);
  color: rgba(255,255,255,0.65);
  transition: background 0.3s, border-color 0.3s, color 0.3s;
}

.fi-header__adaptive-badge--up {
  border-color: rgba(34,197,94,0.35);
  background: rgba(34,197,94,0.1);
  color: #22c55e;
}

.fi-header__adaptive-badge--down {
  border-color: rgba(239,68,68,0.35);
  background: rgba(239,68,68,0.1);
  color: #f87171;
}

/* ============================================================
   HR PHASE
   ============================================================ */
.fi-hr {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  padding: 20px 24px 24px;
  min-height: 0;
}

.fi-hr .fi-quiz {
  flex: 1;
  min-height: 0;
}

.fi-hr__header {
  margin-bottom: 16px;
}

.fi-hr__badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 10px;
  background: rgba(236, 72, 153, 0.12);
  border: 1px solid rgba(236, 72, 153, 0.3);
  color: #f472b6;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  margin-bottom: 10px;
}

.fi-hr__title {
  font-size: 18px;
  font-weight: 700;
  color: #fff;
  margin: 0 0 6px;
}

.fi-hr__subtitle {
  font-size: 13px;
  color: rgba(255,255,255,0.5);
  margin: 0;
  line-height: 1.5;
}

.fi-theory__q-badge--hr {
  background: rgba(236, 72, 153, 0.15);
  border-color: rgba(236, 72, 153, 0.35);
  color: #f472b6;
}

/* ============================================================
   CODING TESTS
   ============================================================ */
.fi-coding__test-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 8px;
  border: 1px solid rgba(139, 92, 246, 0.4);
  background: rgba(139, 92, 246, 0.12);
  color: #a78bfa;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
  font-family: 'Roboto', sans-serif;
}

.fi-coding__test-btn:hover {
  background: rgba(139, 92, 246, 0.22);
  border-color: rgba(139, 92, 246, 0.6);
}

.fi-coding__test-btn--passed {
  border-color: rgba(34,197,94,0.45);
  background: rgba(34,197,94,0.12);
  color: #22c55e;
}

.fi-coding__preview-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.fi-coding__test-results {
  padding: 10px 14px;
  border-top: 1px solid rgba(255,255,255,0.07);
  background: rgba(0,0,0,0.2);
  max-height: 140px;
  overflow-y: auto;
  font-size: 12px;
}

.fi-coding__test-results:empty { display: none; }

.fi-coding__test-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 5px 0;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  color: rgba(255,255,255,0.7);
  line-height: 1.4;
}

.fi-coding__test-item:last-child { border-bottom: none; }

.fi-coding__test-item--pass i { color: #22c55e; }
.fi-coding__test-item--fail i { color: #ef4444; }

/* ============================================================
   FINISH - WEAK TOPICS DETAIL
   ============================================================ */
.fi-finish__weak-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.fi-finish__weak-item {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px 16px;
  border-radius: 12px;
  background: rgba(239,68,68,0.06);
  border: 1px solid rgba(239,68,68,0.15);
  font-size: 12.5px;
  color: rgba(255,255,255,0.75);
  line-height: 1.5;
}

.fi-finish__weak-item-head {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.fi-finish__weak-tag {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 8px;
  background: rgba(239,68,68,0.14);
  color: #fca5a5;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.4px;
  text-transform: uppercase;
}

.fi-finish__weak-phase {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 8px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.55);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}

.fi-finish__weak-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 7px;
  margin-left: 8px;
  border-radius: 8px;
  background: rgba(239,68,68,0.16);
  border: 1px solid rgba(239,68,68,0.24);
  color: #fca5a5;
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
}

.fi-finish__weak-q {
  margin: 0;
  color: rgba(255,255,255,0.92);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.55;
}

.fi-finish__weak-row {
  display: grid;
  grid-template-columns: minmax(92px, 110px) 1fr;
  gap: 8px 12px;
  align-items: start;
}

.fi-finish__weak-label {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: rgba(255,255,255,0.42);
  padding-top: 2px;
}

.fi-finish__weak-value {
  font-size: 12.5px;
  color: rgba(255,255,255,0.82);
  line-height: 1.55;
}

.fi-finish__weak-value--wrong {
  color: #fca5a5;
  font-weight: 600;
}

.fi-finish__weak-answer {
  font-size: 11.5px;
  color: rgba(255,255,255,0.45);
}

.fi-finish__weak-detail {
  margin-top: 4px;
}

.fi-finish__score-pct {
  font-family: 'Roboto', system-ui, sans-serif;
  font-weight: 900;
  letter-spacing: -1px;
}

.fi-finish__verdict-text {
  font-family: 'Roboto', system-ui, sans-serif;
  letter-spacing: 2px;
}

/* ============================================================
   REDESIGN OVERRIDES - difficulty + coding layout
   ============================================================ */
.fi-difficulty {
  display: block;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  min-height: 100vh;
  min-height: 100dvh;
  background:
    radial-gradient(circle at 12% 18%, rgba(59, 130, 246, 0.12), transparent 32%),
    radial-gradient(circle at 88% 82%, rgba(148, 163, 184, 0.1), transparent 34%),
    linear-gradient(135deg, #202733 0%, #1f2937 48%, #172033 100%) !important;
  transition: opacity 0.35s ease;
}

.fi-difficulty--hiding {
  opacity: 0;
  pointer-events: none;
  transform: none;
}

.fi-difficulty__shell {
  max-width: 1180px;
  min-height: auto;
  margin: 0 auto;
  padding: 28px 24px 40px;
  gap: 28px;
}

.fi-difficulty__top-note {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary, #8a96a6);
  letter-spacing: 0.2px;
}

.fi-difficulty__content {
  grid-template-columns: minmax(280px, 0.92fr) minmax(420px, 1.08fr);
  column-gap: 40px;
  row-gap: 36px;
  align-items: center;
  width: 100%;
}

.fi-difficulty__badge {
  position: relative;
  background: rgba(38, 49, 61, 0.88);
  border: 1px solid rgba(71, 85, 105, 0.55);
  color: #9aa8ba;
  box-shadow: none;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: none;
  gap: 10px;
  padding: 8px 12px 8px 14px;
  border-radius: 8px;
  align-items: center;
  overflow: visible;
}

.fi-difficulty__badge-dot {
  width: 8px;
  height: 8px;
  background: #7f8ea3;
  box-shadow: none;
}

.fi-difficulty__badge-label {
  color: inherit;
  line-height: 1.3;
}

.fi-difficulty__badge-beta {
  display: inline-flex;
  align-items: center;
  position: absolute;
  top: -7px;
  right: -8px;
  z-index: 2;
  margin: 0;
  padding: 1px 5px;
  border-radius: 3px;
  background: #ffc501;
  color: #111;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.04em;
  line-height: 1.25;
  transform: rotate(-12deg);
  transform-origin: center center;
  white-space: nowrap;
  pointer-events: none;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
}

.fi-difficulty__title {
  font-family: "Roboto", system-ui, sans-serif;
  font-size: clamp(32px, 4vw, 48px);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.18;
  margin: 0;
  color: #fff;
  max-width: 18ch;
}

.fi-difficulty__title-accent {
  background: linear-gradient(90deg, #fff 18%, #c5d4e8 72%, #a8b8cc 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.fi-difficulty__preview-card {
  width: 100%;
  max-width: none;
  align-self: stretch;
  box-sizing: border-box;
  margin-top: 8px;
  margin-bottom: 4px;
  padding: 16px 18px;
  border-radius: 8px;
  background: rgba(38, 49, 61, 0.92);
  border: 1px solid rgba(71, 85, 105, 0.55);
  box-shadow: none;
  backdrop-filter: none;
}

.fi-difficulty__preview-head {
  flex-wrap: wrap;
  gap: 10px;
}

.fi-difficulty__preview-avatar {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: linear-gradient(145deg, #3b82f6, #6366f1);
  font-size: 13px;
  box-shadow: none;
  overflow: hidden;
}

.fi-difficulty__preview-avatar--photo {
  background: #111827;
  padding: 0;
}

.fi-difficulty__preview-status {
  background: rgba(34, 197, 94, 0.12);
  border-color: rgba(34, 197, 94, 0.28);
  color: #4ade80;
  font-size: 10px;
  font-weight: 700;
  text-transform: none;
  letter-spacing: 0;
}

.fi-difficulty__preview-name {
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  line-height: 1.35;
  letter-spacing: 0;
}

.fi-difficulty__preview-role {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.5);
  margin-top: 3px;
  line-height: 1.4;
}

.fi-difficulty__preview-quote {
  margin: 14px 0 0;
  padding-top: 14px;
  border-top: 1px solid var(--border-color, #2d3848);
  color: #b8c5d3;
  font-size: 15px;
  line-height: 1.65;
  font-weight: 400;
  letter-spacing: 0.01em;
}

.fi-difficulty__steps-bar {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px 16px;
  flex-wrap: wrap;
  width: 100%;
  align-self: stretch;
  margin-top: 8px;
}

.fi-difficulty__steps {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  flex: 1 1 auto;
  min-width: 0;
  list-style: none;
  margin: 0;
  padding: 0;
}

.fi-difficulty__step {
  padding: 8px 14px;
  border-radius: 8px;
  background: rgba(38, 49, 61, 0.88);
  border: 1px solid rgba(71, 85, 105, 0.55);
  color: #7f8ea3;
  font-size: 12px;
  font-weight: 600;
}

.fi-difficulty__step--active {
  border-color: rgba(147, 197, 253, 0.52);
  color: #bfdbfe;
  background: rgba(59, 130, 246, 0.12);
}

.fi-difficulty__exit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  align-self: flex-end;
  /* margin-left: auto; */
  /* margin-right: auto; */
  min-height: 37px;
  padding: 0 18px;
  border: none;
  border-radius: 8px;
  background: #4b62d8;
  box-shadow: none;
  color: #ffffff;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  transition:
    transform 0.2s ease,
    background-color 0.2s ease,
    color 0.2s ease;
}

.fi-difficulty__exit:hover,
.fi-difficulty__exit:focus-visible {
  transform: translateY(-1px);
  background: #5d73e3;
  color: #ffffff;
  outline: none;
}

.fi-difficulty__selector {
  padding: 22px 24px;
  border-radius: 10px;
  background: rgba(38, 49, 61, 0.94);
  border: 1px solid rgba(71, 85, 105, 0.6);
  box-shadow: 0 0 0 0 transparent;
  backdrop-filter: none;
  align-self: stretch;
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  margin-left: 0;
}

.fi-difficulty__hero {
  gap: 22px;
  width: 100%;
  min-width: 0;
  align-self: center;
  align-items: flex-start;
  justify-content: center;
}

.fi-difficulty__selector-head {
  margin-bottom: 4px;
  align-items: center;
}

.fi-difficulty__selector-title {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.3;
  color: #fff;
}

.fi-difficulty__selector-note {
  background: rgba(38, 49, 61, 0.88);
  border: 1px solid rgba(71, 85, 105, 0.55);
  color: #9aa8ba;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.fi-diff-card {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: auto;
  padding: 16px 18px;
  border-radius: 12px;
  background: #202a36;
  border: 1px solid rgba(71, 85, 105, 0.6);
  transform: none;
  cursor: pointer;
  text-align: left;
  color: inherit;
  font: inherit;
  width: 100%;
  appearance: none;
}

.fi-diff-card:hover {
  transform: none;
  border-color: var(--card-color, rgba(255, 255, 255, 0.2));
  background: #243141;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.fi-diff-card__accent {
  width: 4px;
  align-self: stretch;
  border-radius: 4px;
  background: var(--card-color, #3b82f6);
  flex-shrink: 0;
}

.fi-diff-card--easy { --card-color: #6d9f82; }
.fi-diff-card--medium { --card-color: #7a9ec4; }
.fi-diff-card--hard { --card-color: #c17f7f; }
.fi-diff-card--expert { --card-color: #a86666; }

.fi-diff-card__main {
  flex: 1;
  min-width: 0;
}

.fi-diff-card__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 4px;
}

.fi-diff-card__level {
  font-family: "Roboto", system-ui, sans-serif;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--card-color);
}

.fi-diff-card__salary {
  font-size: 13px;
  font-weight: 600;
  color: var(--card-color);
  opacity: 0.92;
  white-space: nowrap;
  letter-spacing: 0;
}

.fi-diff-card__name {
  font-family: "Roboto", system-ui, sans-serif;
  font-size: 1.35rem;
  font-weight: 800;
  color: #fff;
  line-height: 1.3;
  letter-spacing: -0.01em;
  margin-bottom: 4px;
}

.fi-diff-card__desc {
  margin: 0 0 10px;
  font-size: 14px;
  font-weight: 400;
  color: #a8b4c2;
  line-height: 1.55;
  letter-spacing: 0.01em;
}

.fi-diff-card__meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.fi-diff-card__meta span {
  padding: 4px 9px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color, #2d3848);
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted, #5c6875);
  line-height: 1.35;
  letter-spacing: 0;
}

.fi-diff-card__go {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color, #2d3848);
  color: var(--card-color);
  flex-shrink: 0;
  transition: background 0.2s, border-color 0.2s;
}

.fi-diff-card:hover .fi-diff-card__go {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--card-color);
}

/* Coding: editor сверху, превью + задание снизу */
.fi-coding__workspace {
  flex: 1 1 62%;
  display: flex;
  flex-direction: column;
  min-height: 120px;
  overflow: hidden;
  background: var(--bg-card, #252931);
}

.fi-coding__workspace-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 14px;
  background: var(--sidebar-bg, #191c22);
  border-bottom: 1px solid var(--border-color, #2d3848);
  flex-shrink: 0;
}

.fi-coding__workspace-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.fi-coding__error-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 30px;
  padding: 0 12px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.03);
  color: rgba(255, 255, 255, 0.42);
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}

.fi-coding__error-link i {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.fi-coding__error-link:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.16);
  color: rgba(255, 255, 255, 0.62);
  transform: none;
}

.fi-coding__solution-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  padding: 0 12px;
  border-radius: 8px;
  border: 1px solid rgba(34, 197, 94, 0.35);
  background: rgba(34, 197, 94, 0.1);
  color: #4ade80;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}

.fi-coding__solution-btn:hover {
  background: rgba(34, 197, 94, 0.16);
  border-color: rgba(34, 197, 94, 0.5);
}

.fi-coding__solution-btn:focus-visible {
  outline: 2px solid rgba(34, 197, 94, 0.5);
  outline-offset: 2px;
}

.fi-coding__workspace .fi-coding__editor-wrap {
  flex: 1;
  border-right: none;
}

.fi-coding__dock {
  flex: 0 0 38%;
  min-height: 140px;
  display: flex;
  flex-direction: row;
  overflow: hidden;
  background: var(--sidebar-bg, #191c22);
  border-top: 1px solid var(--border-color, #2d3848);
}

.fi-coding__dock .fi-coding__preview {
  flex: 1 1 55%;
  min-width: 0;
  min-height: 0;
  border-right: 1px solid var(--border-color, #2d3848);
}

.fi-coding__dock .fi-coding__task-panel {
  flex: 1 1 45%;
  width: auto;
  min-width: 0;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.018), transparent 42%),
    #252931;
}

.fi-coding__preview-header {
  background: var(--sidebar-bg, #191c22);
  border-bottom: 1px solid var(--border-color, #2d3848);
}

.fi-coding__preview-frame {
  background: #252931;
  color-scheme: dark;
}

.fi-coding__editor-tabs,
.fi-coding__task-tabs {
  background: var(--sidebar-bg, #191c22);
  border-bottom: 1px solid var(--border-color, #2d3848);
}

.fi-coding__editor-highlight-wrap {
  position: relative;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  background:
    radial-gradient(circle at 0 0, rgba(59, 130, 246, 0.08), transparent 30%),
    linear-gradient(180deg, #252931 0%, #22262e 100%);
  --fi-editor-padding-y: 16px;
  --fi-editor-padding-x: 18px;
  --fi-editor-font-size: 13px;
  --fi-editor-line-height: 20px;
}

.fi-coding__monaco {
  position: absolute;
  inset: 0;
  z-index: 3;
}

.fi-coding__editor-highlight-wrap--monaco {
  background: #1e1e1e;
}

.fi-coding__editor-highlight-wrap--monaco .fi-coding__editor-highlight,
.fi-coding__editor-highlight-wrap--monaco .fi-coding__editor {
  display: none;
}

.fi-coding__editor-highlight {
  position: absolute;
  inset: 0;
  z-index: 1;
  margin: 0;
  padding: var(--fi-editor-padding-y) var(--fi-editor-padding-x);
  overflow: auto;
  border: 0;
  background: transparent !important;
  color: #d4d4d8;
  font-family: "Roboto Mono", "Consolas", "Monaco", monospace;
  font-size: var(--fi-editor-font-size);
  line-height: var(--fi-editor-line-height);
  letter-spacing: 0;
  white-space: pre;
  pointer-events: none;
}

.fi-coding__editor-highlight code {
  display: block;
  min-height: 100%;
  background: transparent !important;
  color: inherit;
  font: inherit;
  text-shadow: none;
}

.fi-coding__editor {
  position: relative;
  z-index: 2;
  padding: var(--fi-editor-padding-y) var(--fi-editor-padding-x) !important;
  font-size: var(--fi-editor-font-size) !important;
  line-height: var(--fi-editor-line-height) !important;
  letter-spacing: 0 !important;
  font-variant-ligatures: none;
  font-feature-settings: "liga" 0, "calt" 0;
  background: transparent !important;
  color: transparent !important;
  -webkit-text-fill-color: transparent;
  text-shadow: none;
}

.fi-coding__editor {
  caret-color: var(--accent-orange, #ffc501);
  overflow: auto;
  resize: none;
}

.fi-coding__editor::selection {
  background: rgba(99, 102, 241, 0.35);
  color: transparent;
  -webkit-text-fill-color: transparent;
  text-shadow: none;
}

.fi-coding__editor::-moz-selection {
  background: rgba(99, 102, 241, 0.35);
  color: transparent;
  text-shadow: none;
}

.fi-coding__task-body {
  background:
    radial-gradient(circle at 100% 0, rgba(255, 197, 1, 0.055), transparent 34%),
    linear-gradient(180deg, #252931 0%, #23272f 100%);
}

.fi-coding__test-results {
  background: #1f2229;
  border-top: 1px solid var(--border-color, #2d3848);
}

/* ============================================================
   RESPONSIVE - единая система брейкпоинтов
   1100 → 1024 → 768 → 640 → 480 → 380
   ============================================================ */

/* ---- 1100px: узкий десктоп / планшет landscape - одна колонка ---- */
@media (max-width: 1100px) {
  .fi-difficulty__shell {
    max-width: 760px;
    padding: 24px 20px 36px;
    gap: 24px;
  }

  .fi-difficulty__content {
    grid-template-columns: 1fr;
    column-gap: 0;
    row-gap: 24px;
    width: 100%;
    max-width: min(100%, 720px);
    margin-inline: auto;
    justify-items: stretch;
  }

  .fi-difficulty__hero {
    align-items: stretch;
    text-align: left;
    width: 100%;
  }

  .fi-difficulty__title {
    max-width: none;
    font-size: clamp(30px, 5vw, 42px);
  }

  .fi-difficulty__preview-card {
    width: 100%;
    max-width: none;
    margin-inline: 0;
  }

  .fi-difficulty__steps-bar {
    width: 100%;
  }

  .fi-difficulty__selector {
    margin-inline: 0;
    max-width: none;
    width: 100%;
    align-self: stretch;
  }

  .fi-finish__report {
    padding: 24px 20px 32px;
  }
}

/* ---- 1024px: планшет - колонка workspace, компактный звонок ---- */
@media (max-width: 1024px) {
  .fi-page {
    min-height: 100dvh;
    height: 100dvh;
    overflow: hidden;
  }

  .fi-page .fi-panel {
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
  }

  .fi-page .fi-theory,
  .fi-page .fi-hr {
    flex: none;
    overflow: visible;
    min-height: auto;
  }

  .fi-page .fi-quiz {
    flex: none;
    display: flex;
    flex-direction: column;
    overflow: visible;
    min-height: auto;
  }

  .fi-page .fi-quiz__left,
  .fi-page .fi-quiz__right {
    overflow: visible;
    max-height: none;
    min-height: auto;
  }

  .fi-page .fi-finish {
    flex: none;
    min-height: auto;
    overflow: visible;
  }

  .fi-header {
    height: auto;
    min-height: 52px;
    flex-wrap: wrap;
    padding: 10px 14px;
    gap: 10px;
  }

  .fi-header__center {
    order: 3;
    flex: 1 0 100%;
    justify-content: flex-start;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 2px;
  }

  .fi-header__center::-webkit-scrollbar {
    display: none;
  }

  .fi-header__actions {
    gap: 10px;
    margin-left: auto;
  }

  .fi-workspace {
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
  }

  .fi-call {
    width: 100%;
    min-width: 0;
    max-width: none;
    flex: 0 0 auto;
    max-height: min(38vh, 280px);
    flex-direction: row;
    border-right: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  }

  .fi-call__video {
    flex: 0 0 clamp(120px, 28vw, 160px);
    width: clamp(120px, 28vw, 160px);
    height: auto;
    align-self: stretch;
  }

  .fi-call__avatar-wrap {
    gap: 6px;
  }

  .fi-call__avatar-ring {
    width: 64px;
    height: 64px;
  }

  .fi-call__avatar {
    width: 56px;
    height: 56px;
    font-size: 18px;
  }

  .fi-call__interviewer-name {
    font-size: 12px;
  }

  .fi-call__interviewer-role {
    font-size: 10px;
    margin-top: -4px;
  }

  .fi-call__selfview {
    width: 48px;
    height: 36px;
    bottom: 8px;
    right: 8px;
  }

  .fi-call__selfview-inner {
    width: 28px;
    height: 28px;
    font-size: 10px;
  }

  .fi-call__chat {
    flex: 1;
    min-width: 0;
    min-height: 0;
    padding: 10px 12px;
  }

  .fi-call__controls {
    flex-direction: column;
    width: 52px;
    justify-content: center;
    border-top: none;
    border-left: 1px solid rgba(255, 255, 255, 0.07);
    padding: 8px 6px;
    gap: 6px;
  }

  .fi-ctrl-btn {
    width: 36px;
    height: 36px;
    font-size: 14px;
  }

  .fi-ctrl-btn--end {
    width: 40px;
    height: 40px;
  }

  .fi-panel {
    flex: 1;
    min-height: 0;
  }

  .fi-quiz {
    grid-template-columns: 1fr;
    grid-template-rows: none;
  }

  .fi-quiz__left {
    border-right: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
    padding: 14px 16px;
  }

  .fi-quiz__right {
    padding: 14px 16px 16px;
  }

  .fi-coding__dock {
    flex-direction: column;
    flex: 0 0 auto;
    min-height: 220px;
    max-height: 42vh;
  }

  .fi-coding__dock .fi-coding__preview {
    flex: 0 0 160px;
    border-right: none;
    border-bottom: 1px solid var(--border-color, #2d3848);
  }

  .fi-coding__dock .fi-coding__task-panel {
    flex: 1;
    min-height: 120px;
  }

  .fi-finish__layout {
    flex-direction: column;
  }

  .fi-finish__interviewer {
    width: 100%;
    min-width: 0;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    padding: 20px 16px;
    gap: 16px;
    border-right: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  }

  .fi-finish__int-video {
    flex-direction: row;
    align-items: center;
    gap: 12px;
  }

  .fi-finish__int-avatar-ring {
    width: 72px;
    height: 72px;
  }

  .fi-finish__int-avatar {
    width: 64px;
    height: 64px;
    font-size: 20px;
  }

  .fi-finish__score-ring-wrap,
  .fi-finish__score-ring {
    width: 88px;
    height: 88px;
  }

  .fi-finish__score-pct {
    font-size: 17px;
  }

  .fi-finish__stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .fi-finish__block-stats {
    grid-template-columns: 1fr;
  }
}

/* ---- 768px: планшет portrait / большой телефон ---- */
@media (max-width: 768px) {
  body {
    overflow-x: hidden;
  }

  .fi-difficulty {
    display: block;
    overflow-y: auto;
    padding: 12px;
  }

  .fi-difficulty__shell {
    padding: 20px 16px 28px;
    gap: 22px;
  }

  .fi-difficulty__topbar {
    flex-wrap: wrap;
    gap: 10px;
  }

  .fi-difficulty__top-note {
    width: 100%;
    text-align: left;
    font-size: 11px;
  }

  .fi-difficulty__title {
    font-size: clamp(28px, 7vw, 38px);
    letter-spacing: -0.03em;
    line-height: 1.2;
  }

  .fi-difficulty__preview-card {
    display: block;
    width: 100%;
    max-width: none;
    margin-inline: 0;
    padding: 14px 16px;
  }

  .fi-difficulty__selector {
    width: 100%;
    max-width: none;
    margin-inline: 0;
  }

  .fi-difficulty__preview-quote {
    font-size: 14px;
    line-height: 1.6;
  }

  .fi-difficulty__steps-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  .fi-difficulty__steps {
    gap: 6px;
    width: 100%;
  }

  .fi-difficulty__exit {
    align-self: flex-start;
    width: auto;
    min-width: 132px;
    min-height: 40px;
    margin-left: 0;
    margin-right: auto;
  }

  .fi-difficulty__selector {
    padding: 16px;
    border-radius: 8px;
  }

  .fi-difficulty__selector-title {
    font-size: 18px;
  }

  .fi-diff-card {
    padding: 12px 14px;
  }

  .fi-diff-card__row {
    flex-wrap: wrap;
    gap: 4px 8px;
  }

  .fi-diff-card__salary {
    white-space: normal;
    text-align: right;
  }

  .fi-diff-card__meta {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }

  .fi-diff-card__meta span {
    width: 100%;
  }

  .fi-header__logo-text {
    display: none;
  }

  .fi-header__call-badge {
    font-size: 11px;
    padding: 4px 10px;
    white-space: nowrap;
  }

  .fi-header__difficulty-badge,
  .fi-header__timer {
    flex-shrink: 0;
    font-size: 11px;
  }

  .fi-panel__head {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    padding: 10px 14px;
  }

  .fi-panel__phase-tabs {
    width: 100%;
    justify-content: stretch;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .fi-panel__phase-tabs::-webkit-scrollbar {
    display: none;
  }

  .fi-panel__phase-tab {
    flex: 1 1 auto;
    justify-content: center;
    padding: 8px 10px;
    font-size: 12px;
  }

  .fi-panel__progress {
    width: 100%;
    justify-content: space-between;
  }

  .fi-panel__progress-bar {
    flex: 1;
    max-width: none;
    width: auto;
  }

  .fi-theory__header {
    padding: 12px 14px 0;
  }

  .fi-quiz__question-body {
    font-size: 16px;
  }

  .fi-quiz__actions {
    flex-direction: column-reverse;
    align-items: stretch;
  }

  .fi-quiz__skip-btn,
  .fi-quiz__next-btn {
    width: 100%;
    justify-content: center;
  }

  .fi-hr {
    padding: 14px 14px 16px;
  }

  .fi-hr__title {
    font-size: 16px;
  }

  .fi-coding__workspace {
    min-height: 280px;
    flex: 1 1 55%;
  }

  .fi-coding__workspace-header {
    flex-wrap: wrap;
    gap: 8px;
    padding: 8px 12px;
  }

  .fi-coding__q-info {
    flex: 1 1 100%;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }

  .fi-coding__q-title {
    font-size: 13px;
    line-height: 1.4;
  }

  .fi-coding__workspace-actions {
    width: 100%;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 6px;
  }

  .fi-coding__preview-header {
    flex-wrap: wrap;
    gap: 8px;
    padding: 8px 12px;
  }

  .fi-coding__preview-title {
    font-size: 11px;
  }

  .fi-coding__preview-actions {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
  }

  .fi-coding__run-btn,
  .fi-coding__test-btn,
  .fi-coding__solution-btn {
    flex: 1 1 auto;
    min-height: 34px;
    justify-content: center;
  }

  .fi-finish__stats-grid,
  .fi-finish__block-stats {
    grid-template-columns: 1fr;
  }

  .fi-finish__report {
    padding: 20px 14px 28px;
  }

  .fi-confirm__dialog {
    padding: 18px;
    border-radius: 10px;
  }

  .fi-confirm__actions {
    flex-direction: column-reverse;
    gap: 8px;
  }

  .fi-confirm__btn {
    width: 100%;
    justify-content: center;
  }
}

/* ---- 640px: телефон ---- */
@media (max-width: 640px) {
  .fi-difficulty__hero {
    gap: 16px;
  }

  .fi-difficulty__badge {
    font-size: 10px;
    padding: 6px 12px;
  }

  .fi-difficulty__preview-head {
    flex-wrap: wrap;
    gap: 10px;
  }

  .fi-difficulty__preview-status {
    margin-left: 0;
  }

  .fi-difficulty__step {
    font-size: 11px;
    padding: 7px 12px;
  }

  .fi-diff-card__name {
    font-size: 1.15rem;
    line-height: 1.3;
  }

  .fi-diff-card__desc {
    font-size: 13px;
    line-height: 1.5;
  }

  .fi-diff-card__go {
    width: 32px;
    height: 32px;
    border-radius: 8px;
  }

  .fi-call {
    max-height: min(36vh, 240px);
  }

  .fi-call__video {
    flex: 0 0 108px;
    width: 108px;
  }

  .fi-call__name-badge {
    display: none;
  }

  .fi-call__avatar-ring {
    width: 52px;
    height: 52px;
  }

  .fi-call__avatar {
    width: 46px;
    height: 46px;
    font-size: 15px;
  }

  .fi-call__interviewer-name,
  .fi-call__interviewer-role {
    display: none;
  }

  .fi-chat-msg__bubble {
    font-size: 12px;
    max-width: 92%;
  }

  .fi-header__error-link {
    font-size: 11px;
    padding: 0 8px;
    height: 32px;
  }

  .fi-header__back-btn {
    padding: 7px 10px;
    font-size: 12px;
  }

  .fi-coding__dock {
    max-height: 38vh;
    min-height: 200px;
  }

  .fi-coding__dock .fi-coding__preview {
    flex: 0 0 140px;
  }

  .fi-coding__editor-highlight-wrap {
    --fi-editor-padding-y: 14px;
    --fi-editor-padding-x: 14px;
    --fi-editor-font-size: 12.5px;
    --fi-editor-line-height: 19px;
  }

  .fi-finish__interviewer {
    padding: 16px 12px;
  }

  .fi-finish__salary-value {
    font-size: 19px;
  }
}

/* ---- 480px: узкий телефон ---- */
@media (max-width: 480px) {
  .fi-difficulty {
    padding: 8px;
  }

  .fi-difficulty__shell {
    padding: 16px 12px 24px;
    gap: 18px;
  }

  .fi-difficulty__logo-text {
    font-size: 12px;
    letter-spacing: 1.4px;
  }

  .fi-difficulty__title {
    font-size: clamp(26px, 9vw, 34px);
    line-height: 1.2;
    letter-spacing: -0.03em;
  }

  .fi-difficulty__preview-card {
    display: none;
  }

  .fi-difficulty__selector {
    padding: 14px;
  }

  .fi-difficulty__selector-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .fi-diff-card {
    gap: 10px;
    padding: 12px;
  }

  .fi-diff-card__desc {
    font-size: 11px;
    margin-bottom: 6px;
  }

  .fi-diff-card__meta span {
    font-size: 9.5px;
    padding: 3px 7px;
  }

  .fi-header {
    padding: 8px 10px;
  }

  .fi-header__call-badge {
    max-width: 132px;
    overflow: visible;
  }

  .fi-header__call-label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .fi-header__error-link span,
  .fi-header__back-btn span {
    display: none;
  }

  .fi-header__error-link,
  .fi-header__back-btn {
    min-width: 36px;
    padding-inline: 10px;
    justify-content: center;
  }

  .fi-panel__phase-tab .fi-panel__tab-icon {
    margin: 0;
  }

  .fi-panel__phase-tab {
    gap: 5px;
    padding: 7px 8px;
    font-size: 11px;
  }

  .fi-quiz__left,
  .fi-quiz__right {
    padding: 12px;
  }

  .fi-quiz__topic-badge {
    width: 36px;
    min-width: 36px;
    height: 36px;
  }

  .fi-quiz__option {
    padding: 10px 12px;
    gap: 10px;
  }

  .fi-quiz__option-text {
    font-size: 12.5px;
  }

  .fi-coding__copy-btn,
  .fi-coding__clear-btn,
  .fi-coding__reset-btn {
    min-width: 36px;
    min-height: 36px;
  }

  .fi-coding__workspace-actions .fi-coding__next-btn {
    width: 100%;
    justify-content: center;
    margin-left: 0;
    margin-top: 8px;
  }

  .fi-finish__verdict-text {
    font-size: 11px;
    letter-spacing: 1.2px;
  }

  .fi-finish__actions {
    flex-direction: column;
    align-items: stretch;
  }

  .fi-finish__actions .fi-quiz__next-btn,
  .fi-finish__actions button,
  .fi-finish__actions a {
    width: 100%;
    justify-content: center;
  }
}

/* ---- 380px: очень узкий экран ---- */
@media (max-width: 380px) {
  .fi-difficulty__top-note {
    display: none;
  }

  .fi-diff-card__go {
    display: none;
  }

  .fi-diff-card__salary {
    font-size: 10px;
  }

  .fi-header__timer {
    display: none;
  }

  .fi-header__difficulty-badge {
    max-width: 72px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .fi-call {
    max-height: 200px;
  }

  .fi-call__video {
    flex: 0 0 96px;
    width: 96px;
  }

  .fi-call__controls {
    width: 46px;
    padding: 6px 4px;
  }

  .fi-ctrl-btn {
    width: 32px;
    height: 32px;
    font-size: 12px;
  }

  .fi-ctrl-btn--end {
    width: 34px;
    height: 34px;
  }

  .fi-coding__editor-highlight-wrap {
    --fi-editor-padding-y: 12px;
    --fi-editor-padding-x: 12px;
    --fi-editor-font-size: 12px;
    --fi-editor-line-height: 18px;
  }

  .fi-coding__preview-title {
    display: none;
  }

  .fi-coding__run-btn,
  .fi-coding__test-btn {
    font-size: 11px;
    padding: 6px 10px;
  }
}

/* Skip link: visually hidden until keyboard focus (WCAG 2.4.1) */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100002;
  padding: 0.75rem 1rem;
  background: var(--bg-secondary, #1f2229);
  color: var(--text-primary, #fff);
  text-decoration: none;
  border-radius: 0 0 8px 8px;
  font-weight: 600;
}
.skip-link:focus,
.skip-link:focus-visible {
  left: 1rem;
  outline: 2px solid var(--accent-orange, #6c7cff);
  outline-offset: 2px;
}

.fi-difficulty-page .fi-difficulty {
  position: relative;
  z-index: 1;
}

