﻿/* ===== LAYOUT.CSS ===== */

/* === Page transitions === */
@view-transition { navigation: auto; }
::view-transition-old(root) { animation: none; }
::view-transition-new(root) { animation: none; }
@keyframes vtFadeOut { to { opacity: 0; transform: translateY(-8px); } }
@keyframes vtFadeIn { from { opacity: 0; transform: translateY(8px); } }

body { animation: none; }
@keyframes pageEnter { from { opacity: 0; } to { opacity: 1; } }
body.page-exit { opacity: 0; transition: opacity 0.25s ease; }

/* === Skip link === */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 10000;
  padding: 12px 20px;
  background: var(--accent);
  color: #0a1628;
  font-weight: 800;
  font-size: 14px;
  border-radius: 0 0 8px 0;
  text-decoration: none;
}
.skip-link:focus { left: 0; }

/* ============================================================
   FLOATING HEADER (logo + progression)
   ============================================================ */
.floating-header {
  display: none;
}

.floating-progress {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}
.header-admin-wrap {
  position: relative;
  margin-left: auto;
  opacity: 0;
  transform: translateY(-4px);
  pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
}
.header-admin-wrap.is-visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
.header-admin-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 62px;
  min-height: 44px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.04);
  color: var(--text3);
  font-family: inherit;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  cursor: pointer;
  transition: border-color .2s ease, color .2s ease, background .2s ease;
}
.header-admin-link:hover {
  color: var(--text);
  border-color: rgba(94,196,212,0.28);
  background: rgba(94,196,212,0.10);
}
.admin-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px;
  border-radius: 12px;
  border: 1px solid rgba(94,196,212,0.15);
  background: rgba(10,16,28,0.92);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.42);
  min-width: 180px;
  opacity: 0;
  transform: translateY(-6px) scale(0.95);
  pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
  z-index: 20;
}
.admin-panel.is-open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}
.admin-btn {
  display: block;
  width: 100%;
  padding: 9px 14px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.04);
  color: rgba(214,225,240,0.8);
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease, color .15s ease;
}
.admin-btn:hover {
  background: rgba(94,196,212,0.1);
  border-color: rgba(94,196,212,0.25);
  color: #fff;
}
.admin-btn--danger {
  color: rgba(248,113,113,0.85);
  border-color: rgba(248,113,113,0.12);
}
.admin-btn--danger:hover {
  background: rgba(248,113,113,0.12);
  border-color: rgba(248,113,113,0.3);
  color: #f87171;
}
.admin-btn--unlock {
  color: rgba(52,211,153,0.85);
  border-color: rgba(52,211,153,0.12);
}
.admin-btn--unlock:hover {
  background: rgba(52,211,153,0.12);
  border-color: rgba(52,211,153,0.3);
  color: #34d399;
}
.floating-progress-label {
  font-size: 10px;
  font-weight: 700;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
}
.floating-progress-track {
  width: 120px;
  height: 6px;
  border-radius: 3px;
  background: var(--bg3);
  overflow: hidden;
}
.floating-progress-fill {
  height: 100%;
  border-radius: 3px;
  background: var(--gradient);
  transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}
.floating-progress-fill::after {
  content: none;
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent 20%, rgba(255,255,255,0.28) 50%, transparent 80%);
  transform: translateX(-100%);
  animation: none;
}
.floating-progress-pct {
  font-size: 11px;
  font-weight: 800;
  color: var(--accent);
  min-width: 28px;
}

/* Legacy header — hidden */
.header { display: none; }

#header-slot {
  display: none;
}

/* Row 1 : logo + XP chip + toggle */
.header-row1 {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-width: 0;
}

/* Row 2 : stats */
.header-row2 {
  display: flex;
  flex-direction: row;
  align-items: center;
}

/* Logo */
.header-logo {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 12px;
  font-family: var(--font-head);
  font-weight: 800;
  font-size: 16px;
  color: var(--text);
  text-decoration: none;
  flex: 1 1 240px;
  min-width: 0;
  max-width: 380px;
  transition: color 0.18s ease, transform 0.18s ease;
}

.header-logo:hover {
  color: var(--accent);
  opacity: 1;
  transform: translateY(-1px);
}
.header-logo-icon {
  width: 38px;
  height: 38px;
  background: url("../assets/logo.png") center / contain no-repeat;
  border-radius: 12px;
  flex-shrink: 0;
  box-shadow: 0 8px 16px rgba(0,0,0,0.18);
  position: relative;
  animation: none;
}

.header-logo-icon::before,
.header-logo-icon::after {
  content: '';
  position: absolute;
  inset: -7px;
  border-radius: 16px;
  border: 1px solid rgba(94,196,212,0.24);
  opacity: 0;
  pointer-events: none;
}

.header-logo-icon::before {
  animation: none;
}

.header-logo-icon::after {
  inset: -12px;
  border-color: rgba(131,189,69,0.18);
  animation: none;
}

.header-logo-copy {
  display: flex;
  flex-direction: column;
  min-width: 0;
  position: relative;
}

.header-logo-title {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 20px;
  line-height: 1.05;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #f7fbff;
  text-shadow: none;
  animation: none;
}

.header-logo-subtitle {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-top: 2px;
  font-size: 11px;
  line-height: 1.2;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text3);
  animation: none;
}

@keyframes neuronCorePulse {
  0%, 100% {
    box-shadow: 0 12px 28px rgba(50,93,169,0.24), 0 0 18px rgba(94,196,212,0.14);
    transform: scale(1);
  }
  50% {
    box-shadow: 0 16px 34px rgba(50,93,169,0.28), 0 0 24px rgba(94,196,212,0.22);
    transform: scale(1.03);
  }
}

@keyframes neuronRing {
  0% {
    opacity: 0;
    transform: scale(0.92);
  }
  18% {
    opacity: 0.42;
  }
  100% {
    opacity: 0;
    transform: scale(1.22);
  }
}

@keyframes neuronTextGlow {
  0%, 100% {
    color: #f7fbff;
    text-shadow: 0 2px 16px rgba(0,0,0,0.28);
  }
  50% {
    color: #ffffff;
    text-shadow: 0 0 18px rgba(94,196,212,0.18), 0 2px 18px rgba(0,0,0,0.24);
  }
}

@keyframes neuronSubtitleShift {
  0%, 100% {
    color: var(--text3);
    letter-spacing: 0.12em;
  }
  50% {
    color: #c6d7ea;
    letter-spacing: 0.16em;
  }
}

@media (prefers-reduced-motion: reduce) {
  .header-logo-icon,
  .header-logo-icon::before,
  .header-logo-icon::after,
  .header-logo-title,
  .header-logo-subtitle {
    animation: none !important;
  }
}

@media (max-width: 720px) {
  .floating-header {
    flex-wrap: wrap;
    align-items: flex-start;
    min-height: 0;
    padding: 12px 16px;
    gap: 10px;
  }

  .floating-progress {
    width: 100%;
    margin-left: 0;
  }

  .floating-progress-track {
    flex: 1;
    width: auto;
  }

  #header-slot {
    min-height: 98px;
  }
}

/* ============================================================
   XP CHIP  —  floating pill
   ============================================================ */
.hxp {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(94,196,212,0.18);
  border-radius: var(--r-md);
  padding: 5px 12px 5px 8px;
  box-shadow: 0 8px 18px rgba(0,0,0,0.16);
  cursor: default;
  transition: box-shadow 0.25s, transform 0.2s;
}
.hxp:hover {
  box-shadow: 0 8px 18px rgba(0,0,0,0.18);
  transform: translateY(-1px);
}
.hxp.xp-pulse { animation: xpPulse 0.7s ease forwards; }
@keyframes xpPulse {
  0%   { box-shadow: 0 2px 8px rgba(50,93,169,0.13), 0 0 0 0   rgba(50,93,169,0.30); }
  60%  { box-shadow: 0 2px 8px rgba(50,93,169,0.13), 0 0 0 8px rgba(50,93,169,0); }
  100% { box-shadow: 0 2px 8px rgba(50,93,169,0.13), 0 0 0 0   rgba(50,93,169,0); }
}
.hxp-star { font-size: 14px; line-height: 1; flex-shrink: 0; }
.hxp-n {
  font-family: var(--font-head);
  font-size: 14px;
  font-weight: 800;
  color: var(--accent);
  min-width: 10px;
}
.hxp-u {
  font-size: 10px;
  font-weight: 700;
  color: var(--text2);
  letter-spacing: 0.4px;
}
.hxp-div {
  width: 1px;
  height: 12px;
  background: var(--border);
  margin: 0 3px;
  flex-shrink: 0;
}
.hxp-lvl {
  font-size: 11px;
  font-weight: 600;
  color: var(--text2);
  white-space: nowrap;
}

/* ============================================================
   STATS ROW  —  row 2
   ============================================================ */
.hstat {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 0 18px;
  min-width: 100px;
  flex-shrink: 0;
}
.hstat:first-child { padding-left: 0; }
.hstat--main { min-width: 130px; }

/* Label + value in one line */
.hstat-row {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 4px;
}

.hstat-icon { font-size: 11px; line-height: 1; flex-shrink: 0; }

.hstat-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text2);
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hstat-val {
  font-size: 11px;
  font-weight: 700;
  color: var(--text2);
  white-space: nowrap;
  flex-shrink: 0;
}
.hstat--main .hstat-val {
  font-size: 12px;
  font-weight: 800;
  color: var(--accent);
}

/* Bar */
.hstat-track {
  width: 100%;
  height: 5px;
  border-radius: 3px;
  background: var(--bg3);
  overflow: hidden;
}
.hstat--main .hstat-track { height: 7px; border-radius: 4px; }

.hstat-fill {
  height: 100%;
  border-radius: 3px;
  background: var(--gradient);
  transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}
.hstat-fill::after {
  content: none;
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent 20%, rgba(255,255,255,0.28) 50%, transparent 80%);
  transform: translateX(-100%);
  animation: none;
}
@keyframes hShimmer {
  0%   { transform: translateX(-100%); }
  60%  { transform: translateX(100%); }
  100% { transform: translateX(100%); }
}

/* Category accent colors */
.hstat-fill--numerique { background: linear-gradient(90deg, #325da9, #5b8ee8); }
.hstat-fill--emploi    { background: linear-gradient(90deg, #4a9020, #83bd45); }
.hstat-fill--francais  { background: linear-gradient(90deg, #9a9400, #c5bb00); }

/* Divider between stats */
.hstat-sep {
  width: 1px;
  height: 26px;
  background: var(--border);
  flex-shrink: 0;
  align-self: center;
}

/* Mobile */
@media (max-width: 480px) {
  .header-row2 { display: none; }
  .hxp-div, .hxp-lvl { display: none; }
  .hxp { padding: 4px 10px 4px 8px; }
}

.header-right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex: 0 1 auto;
  min-width: 0;
  margin-left: auto;
}

.header-nav {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  flex: 1 1 auto;
  min-width: 0;
  max-width: min(52vw, 560px);
  padding: 3px;
  border: 1px solid rgba(94,196,212,0.12);
  border-radius: 14px;
  background: rgba(255,255,255,0.03);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.03);
}

.header-menu-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 34px;
  padding: 7px 10px;
  border-radius: 10px;
  color: var(--text);
  font-size: 12px;
  line-height: 1;
  font-weight: 700;
  white-space: nowrap;
  transition: background 0.16s ease, color 0.16s ease, transform 0.16s ease, box-shadow 0.16s ease;
}

.header-menu-link:hover,
.header-menu-link.active {
  background: rgba(94,196,212,0.10);
  color: var(--accent);
  box-shadow: none;
  opacity: 1;
  transform: translateY(-1px);
}

.btn-mode {
  padding: 7px 16px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  color: var(--text2);
  font-size: 13px;
  font-weight: 500;
  transition: all 0.2s;
}
.btn-mode:hover { background: rgba(94,196,212,0.08); color: var(--text); }

.sidebar-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text);
  font-size: 20px;
  width: 38px;
  height: 38px;
  padding: 0;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  border-radius: 6px;
}

.sidebar-toggle:hover {
  color: var(--accent);
  transform: scale(1.1);
}

.sidebar-toggle.active {
  color: var(--accent);
  background: rgba(94,196,212,0.12);
  padding: 4px;
}

.sidebar-toggle.active::after {
  content: '';
  position: absolute;
  bottom: -6px;
  left: 50%;
  transform: translateX(-50%);
  width: 4px;
  height: 4px;
  background: var(--accent);
  border-radius: 50%;
}

/* === SIDEBAR === */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: var(--sidebar-w);
  background:
    radial-gradient(circle at top left, rgba(94,196,212,0.035), transparent 28%),
    radial-gradient(circle at bottom right, rgba(131,189,69,0.025), transparent 30%),
    linear-gradient(180deg, rgba(10,17,29,0.96), rgba(14,22,37,0.94));
  border-right: 1px solid var(--border);
  box-shadow: 10px 0 24px rgba(0,0,0,0.18);
  overflow-y: auto;
  z-index: 900;
  padding: 14px 0 48px;
  transition: transform 0.3s;
}
.sidebar::after {
  content: '';
  position: absolute;
  top: 0;
  right: -1px;
  bottom: 0;
  width: 2px;
  background: linear-gradient(180deg, rgba(94,196,212,0.10), rgba(50,93,169,0.06) 50%, rgba(131,189,69,0.08));
  pointer-events: none;
}

@keyframes sidebarIn {
  from {
    opacity: 0;
    transform: translateX(-10px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.sidebar-heading {
  display: grid;
  gap: 3px;
  margin: 0 16px 16px;
  padding: 0 0 14px;
  border-bottom: 1px solid var(--border);
}

@keyframes sidebarItemIn {
  from {
    opacity: 0;
    transform: translateY(5px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.sidebar-heading strong {
  color: var(--text);
  font-size: 18px;
  line-height: 1.2;
}

.sidebar-heading span {
  color: var(--text2);
  font-size: 13px;
  line-height: 1.35;
}

.sidebar-section {
  margin-bottom: 2px;
}

.sidebar-section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  color: var(--text3);
  padding: 12px 14px;
  font-family: var(--font-head);
  cursor: default;
  list-style: none;
  -webkit-user-select: none;
  user-select: none;
  border-radius: 12px;
  margin: 0 10px;
  transition: color 0.18s ease, background 0.18s ease, transform 0.18s ease;
}

.sidebar-section-title:hover {
  background: transparent;
}

.sidebar-section-title span:first-child {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.sidebar-section-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 9px;
  background: rgba(94,196,212,0.10);
  color: var(--accent);
  text-align: center;
  font-size: 13px;
  line-height: 1;
}

.sidebar-group.active-group > .sidebar-section-title {
  color: var(--accent);
  background: transparent;
}

.sidebar-section-list {
  padding-bottom: 4px;
}

@keyframes sectionReveal {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.sidebar-activity-groups {
  padding: 0 0 4px;
}

.sidebar-activity-groups > .sidebar-section {
  margin: 0 10px 14px;
  border-left: 0;
  border-radius: 12px;
  background: transparent;
  box-shadow: none;
  transition: border-color 0.18s ease, background 0.18s ease;
}

.sidebar-activity-groups > .sidebar-group.active-group {
  background: rgba(94,196,212,0.05);
  box-shadow: inset 0 0 0 1px rgba(94,196,212,0.10);
}

.sidebar-activity-groups > .sidebar-section > .sidebar-section-title {
  padding: 12px 12px 6px;
  font-size: 10px;
}

.sidebar-activity-groups .sidebar-link {
  padding-left: 18px;
  padding-right: 12px;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  color: var(--text2);
  font-size: 14px;
  font-weight: 400;
  transition: background 0.16s ease, color 0.16s ease, transform 0.16s ease, box-shadow 0.16s ease;
  border-radius: 12px;
  position: relative;
  justify-content: space-between;
  flex-wrap: nowrap;
  margin: 4px 10px;
}

.sidebar-link span:not(.icon) {
  flex: 1;
}
.sidebar-link:hover {
  color: var(--text);
  background: rgba(94,196,212,0.08);
  opacity: 1;
  transform: translateX(3px);
  box-shadow: inset 0 0 0 1px rgba(94,196,212,0.08);
}

.sidebar-link:active {
  transform: scale(0.99);
}
.sidebar-link.active {
  color: var(--accent);
  background:
    linear-gradient(90deg, rgba(50,93,169,0.18), rgba(94,196,212,0.12)),
    rgba(19,28,45,0.95);
  font-weight: 800;
  box-shadow: inset 0 0 0 1px rgba(94,196,212,0.12);
}
.sidebar-link.active::before {
  content: '';
  position: absolute;
  left: 0; top: 8px; bottom: 8px;
  width: 3px;
  background: var(--accent);
  border-radius: 0 999px 999px 0;
}
.sidebar-link .icon { font-size: 14px; width: 18px; text-align: center; flex-shrink: 0; }

.sidebar-link[data-status="completed"]::after {
  content: '✓';
  color: var(--success);
  font-size: 13px;
  font-weight: 800;
}

.sidebar-link[data-status="in_progress"]::after {
  content: '•';
  color: var(--warning);
  font-size: 22px;
  line-height: 1;
}

body.accessible-ui .header-logo { font-size: 19px; }

body.accessible-ui .header-nav {
  padding: 3px;
}

body.accessible-ui .header-menu-link {
  min-height: 34px;
  padding: 7px 10px;
  font-size: 12px;
}

body.accessible-ui .hxp-n       { font-size: 16px; }
body.accessible-ui .hxp-lvl     { font-size: 12px; }
body.accessible-ui .hstat       { min-width: 120px; padding: 0 20px; }
body.accessible-ui .hstat:first-child { padding-left: 0; }
body.accessible-ui .hstat--main { min-width: 150px; }
body.accessible-ui .hstat-label { font-size: 11px; }
body.accessible-ui .hstat-val   { font-size: 12px; }
body.accessible-ui .hstat--main .hstat-val { font-size: 14px; }
body.accessible-ui .hstat-track { height: 7px; }
body.accessible-ui .hstat--main .hstat-track { height: 9px; }

body.accessible-ui .sidebar {
  padding-top: 18px;
}

body.accessible-ui .sidebar-section-title {
  font-size: 12px;
}

body.accessible-ui .sidebar-link {
  min-height: 48px;
  font-size: 16px;
}

body.accessible-ui .main {
  padding-top: 130px;
}

body.accessible-ui .footer {
  font-size: 14px;
}

/* === PÉDAGOGIE - MISES EN AVANT === */

.sidebar-link.next-exercise {
  background: rgba(94,196,212,0.06);
  font-weight: 500;
}

.sidebar-link.next-exercise::after {
  content: '→';
  font-size: 12px;
  color: var(--accent);
  font-weight: 700;
  margin-left: auto;
}

/* === STATUTS VISUELS === */
.sidebar-link[data-status="completed"] {
  opacity: 0.75;
}

.sidebar-link[data-status="in_progress"] {
  font-weight: 500;
}

/* === MAIN LAYOUT === */
.layout {
  padding-top: 0;
  padding-left: 0;
  min-height: 100vh;
  position: relative;
}

.main {
  width: min(100%, 860px);
  margin: 0 auto;
  padding: 40px clamp(24px, 3vw, 40px) 40px;
  animation: none;
}
@keyframes mainFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.container {
  width: 100%;
}

/* === FOOTER === */
.footer {
  display: none;
}

@media (min-width: 1200px) {
  .main {
    padding: 40px clamp(28px, 3vw, 48px) 52px;
  }
}

@media (min-width: 1366px) {
  .main {
    width: min(100%, 1400px);
    padding: 40px clamp(32px, 3.2vw, 56px) 56px;
  }

  .hstat       { min-width: 125px; padding: 0 20px; }
  .hstat--main { min-width: 155px; }
  .hstat:first-child { padding-left: 0; }

  .floating-header {
    gap: 20px;
    padding: 16px 28px;
  }

  .header-logo {
    max-width: 400px;
  }

  .header-nav {
    max-width: min(54vw, 600px);
  }
}

@media (min-width: 1440px) {
  .main {
    width: min(100%, 1600px);
    padding: 120px clamp(34px, 3.4vw, 60px) 60px;
  }

  .hstat       { min-width: 130px; padding: 0 22px; }
  .hstat--main { min-width: 160px; }
  .hstat:first-child { padding-left: 0; }
}

@media (min-width: 1920px) {
  .main {
    width: min(100%, 1800px);
    padding: 40px clamp(48px, 4vw, 80px) 80px;
  }

  .floating-header {
    gap: 24px;
    padding: 18px 32px;
    min-height: 80px;
  }

  .header-logo {
    font-size: 18px;
    max-width: 450px;
    gap: 16px;
  }

  .header-logo-icon {
    width: 44px;
    height: 44px;
  }

  .header-logo-title {
    font-size: 22px;
  }

  .header-logo-subtitle {
    font-size: 12px;
  }

  .header-nav {
    max-width: min(56vw, 700px);
    gap: 6px;
  }

  .header-menu-link {
    min-height: 38px;
    padding: 9px 14px;
    font-size: 13px;
    gap: 8px;
  }

  .hxp {
    padding: 7px 14px 7px 10px;
    gap: 7px;
  }

  .hxp-n {
    font-size: 16px;
  }

  .hxp-u {
    font-size: 11px;
  }

  .hstat       { min-width: 140px; padding: 0 26px; }
  .hstat--main { min-width: 170px; }
  .hstat-label { font-size: 11px; }
  .hstat-val   { font-size: 12px; }
  .hstat--main .hstat-val { font-size: 13px; }
  .hstat-track { height: 7px; }

  .floating-progress-track {
    width: 140px;
  }

  .sidebar {
    width: 320px;
    padding: 20px 0 56px;
  }

  .sidebar-heading {
    margin: 0 20px 20px;
    padding: 0 0 18px;
  }

  .sidebar-heading strong {
    font-size: 20px;
  }

  .sidebar-heading span {
    font-size: 14px;
  }

  .sidebar-section-title {
    padding: 14px 16px;
    font-size: 14px;
    margin: 0 12px;
  }

  .sidebar-link {
    padding: 13px 16px;
    font-size: 15px;
    margin: 6px 12px;
    gap: 12px;
  }

  .sidebar-link .icon {
    font-size: 16px;
    width: 20px;
  }

  .footer {
    padding: 28px 40px;
    gap: 20px;
    font-size: 13px;
  }
}

@media (max-width: 1280px) {
  .header-menu-link {
    padding: 7px 8px;
  }

  .header-menu-link span:last-child {
    display: none;
  }

  .header-menu-link span:first-child {
    font-size: 16px;
  }
}

/* === RESPONSIVE === */
@media (max-width: 768px) {
  :root { --sidebar-w: 0px; }

  .sidebar {
    width: min(86vw, 280px);
    transform: translateX(-100%);
    animation: none;
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .sidebar-toggle { display: block; }

  .layout { padding-left: 0; }
  .main { padding: 100px 16px 32px; }
  .footer { margin-left: 0; }

  .floating-header {
    top: 10px;
    left: 10px;
    padding: 8px 14px 8px 10px;
    gap: 10px;
  }
}

@media (max-width: 520px) {
  .floating-header {
    top: 8px;
    left: 8px;
    padding: 8px 12px 8px 8px;
  }

  .header-logo-copy {
    display: none;
  }

  .floating-progress-label {
    display: none;
  }

  .floating-progress-track {
    width: 60px;
  }

  .focus-mode-toggle {
    right: 12px;
    bottom: 12px;
  }
}
