/* UI refinement layer
 * Kept separate from the base application stylesheet so responsive,
 * dashboard, sidebar, history, and SKD overrides remain easy to audit.
 */
/* ============================================================
   MYPSYCH DASHBOARD REFRESH
   Loaded from styles.css because this is the active application stylesheet.
   ============================================================ */
.dashboard-focus-grid {
  display:grid;
  grid-template-columns:minmax(0,1.55fr) minmax(260px,.75fr);
  gap:14px;
  margin:18px 0 30px;
}
.dashboard-focus-card {
  position:relative;
  overflow:hidden;
  min-height:190px;
  padding:24px;
  border:1px solid var(--line);
  border-radius:16px;
  background:var(--surface);
  box-shadow:var(--shadow-sm);
}
.dashboard-focus-card h3 { margin:6px 0 8px; font-size:1.12rem; letter-spacing:-.02em; }
.dashboard-focus-card p { max-width:650px; margin:0; color:var(--muted); font-size:.78rem; line-height:1.65; }
.dashboard-focus-primary {
  display:flex;
  align-items:stretch;
  justify-content:space-between;
  gap:24px;
  background:linear-gradient(135deg,#fff 0%,#f7faff 100%);
  border-color:var(--blue-border,#d6e5fb);
}
.dashboard-focus-primary::after {
  content:"";
  position:absolute;
  width:180px;
  height:180px;
  right:-90px;
  top:-100px;
  border-radius:50%;
  background:var(--blue-light);
  opacity:.7;
}
.dashboard-focus-copy { position:relative; z-index:1; }
.dashboard-kicker {
  display:inline-block;
  color:var(--blue-dark);
  font-size:.61rem;
  font-weight:900;
  letter-spacing:.13em;
}
.dashboard-focus-actions { display:flex; flex-wrap:wrap; gap:8px; margin-top:18px; }
.dashboard-focus-metric {
  position:relative;
  z-index:1;
  align-self:stretch;
  display:flex;
  flex-direction:column;
  justify-content:center;
  min-width:170px;
  padding:16px;
  border-left:1px solid var(--line);
}
.dashboard-focus-metric span,
.dashboard-focus-metric small { color:var(--muted); font-size:.64rem; line-height:1.5; }
.dashboard-focus-metric strong { margin:4px 0; color:var(--text); font-size:1.25rem; }
.dashboard-career-card {
  display:flex;
  flex-direction:column;
  justify-content:space-between;
  background:#fbfcfe;
}
.dashboard-career-card .btn { align-self:flex-start; margin-top:18px; }

.cv-placeholder-shell { max-width:900px; margin:0 auto; }
.cv-placeholder-lead { max-width:680px; line-height:1.7; margin-bottom:24px; }
.cv-placeholder-card {
  display:flex;
  align-items:center;
  gap:18px;
  padding:28px;
  margin-bottom:18px;
  border:1px dashed var(--line-strong);
  border-radius:16px;
  background:var(--surface);
  box-shadow:var(--shadow-sm);
}
.cv-placeholder-card h3 { margin:5px 0 7px; }
.cv-placeholder-card p { margin:0; color:var(--muted); line-height:1.65; font-size:.78rem; }
.cv-placeholder-icon {
  flex:0 0 64px;
  width:64px;
  height:64px;
  display:grid;
  place-items:center;
  border-radius:14px;
  background:var(--blue-light);
  border:1px solid var(--blue-border);
  color:var(--blue-dark);
  font-size:.8rem;
  font-weight:900;
  letter-spacing:.06em;
}
.nav-cv .nav-tag-muted {
  margin-left:auto;
  font-size:.54rem;
  padding:3px 6px;
}

/* Dashboard catalog: prevent cards from becoming unreadable at narrow widths. */
.catalog-section { min-width:0; }
.test-grid.large { min-width:0; }
.app-test-item { min-width:0; }
.app-test-item .test-info { min-width:0; }
.app-test-controls { min-width:0; flex-wrap:wrap; }

/* ============================================================
   MOBILE / TOUCH RESPONSIVE
   Also catches mobile browsers using "Desktop site".
   ============================================================ */
@media (max-width: 900px), (pointer: coarse) and (max-width: 1100px) {
  .app { grid-template-columns:1fr; }

  .sidebar {
    position:fixed;
    left:0;
    top:0;
    width:min(var(--sidebar-w),86vw);
    transform:translateX(-100%);
    transition:transform .22s ease-out;
    z-index:50;
  }
  .sidebar.open { transform:translateX(0); }
  .hamburger { display:flex; }
  .topbar { padding:12px 16px; }
  .content { padding:20px 16px 32px; max-width:none; }

  .category-grid,
  .skd-grid { grid-template-columns:1fr; }

  .dashboard-focus-grid { grid-template-columns:1fr; }
  .dashboard-focus-primary { flex-direction:column; gap:18px; }
  .dashboard-focus-metric {
    min-width:0;
    padding:14px 0 0;
    border-left:0;
    border-top:1px solid var(--line);
  }

  .test-grid.large {
    grid-template-columns:1fr;
    gap:10px;
  }

  .app-test-item {
    display:grid;
    grid-template-columns:48px minmax(0,1fr);
    align-items:center;
    gap:12px;
    padding:14px;
  }
  .app-test-item .test-icon {
    width:48px;
    height:48px;
    flex-basis:48px;
  }
  .app-test-controls {
    grid-column:2;
    display:flex;
    width:100%;
    align-items:center;
    gap:8px;
  }
  .app-test-controls select { flex:1 1 auto; min-width:0; }
  .app-test-controls .btn { flex:0 0 auto; }

  .cv-placeholder-card { align-items:flex-start; }
}

@media (max-width: 560px), (pointer: coarse) and (max-width: 700px) {
  .content { padding:16px 12px 28px; }
  .hero-card { padding:20px 16px; margin-bottom:24px; }
  .hero-stats { gap:8px; }
  .hero-stat { min-width:0; padding:9px 8px; }
  .hero-stat strong { font-size:1.08rem; }
  .hero-stat span { font-size:.6rem; }

  .dashboard-focus-grid { margin:14px 0 24px; gap:10px; }
  .dashboard-focus-card { min-height:0; padding:18px; border-radius:14px; }
  .dashboard-focus-actions { display:grid; grid-template-columns:1fr; }
  .dashboard-focus-actions .btn { width:100%; }
  .dashboard-career-card .btn { width:100%; }

  .category-grid { gap:10px; }
  .category-card { padding:18px; }
  .category-card p { font-size:.8rem; }

  .catalog-section { margin-top:26px; }
  .catalog-head { margin-bottom:12px; }
  .catalog-head h2 { font-size:1.2rem; }

  .app-test-item {
    grid-template-columns:42px minmax(0,1fr);
    padding:13px;
    border-radius:14px;
  }
  .app-test-item .test-icon { width:42px; height:42px; }
  .app-test-item .test-info strong { font-size:.84rem; }
  .app-test-item .test-info small { font-size:.68rem; }
  .app-test-controls { grid-column:1 / -1; }
  .app-test-controls select,
  .app-test-controls .btn { min-height:40px; }
  .app-test-controls .btn { padding:9px 13px; }

  .cv-placeholder-card {
    flex-direction:column;
    padding:20px;
    gap:14px;
  }
}


/* ============================================================
   DASHBOARD — SUMMARY FIRST
   ============================================================ */
.dashboard-hero { margin-bottom:26px; }
.dashboard-hero-actions { display:flex; flex-wrap:wrap; gap:8px; margin-top:16px; }

.dashboard-section-head {
  display:flex;
  align-items:flex-end;
  justify-content:space-between;
  gap:16px;
  margin:8px 0 14px;
}
.dashboard-section-head h2 { margin:4px 0; font-size:1.18rem; }

.performance-grid {
  display:grid;
  grid-template-columns:1.4fr repeat(3,minmax(0,1fr));
  gap:10px;
  margin-bottom:18px;
}
.performance-card {
  min-width:0;
  padding:18px;
  border:1px solid var(--line);
  border-radius:14px;
  background:var(--surface);
  box-shadow:var(--shadow-sm);
}
.performance-card.performance-main {
  background:linear-gradient(135deg,#f7faff,#fff);
  border-color:var(--blue-border,#d6e5fb);
}
.performance-label {
  display:block;
  color:var(--soft-text);
  font-size:.59rem;
  font-weight:900;
  letter-spacing:.1em;
}
.performance-card strong {
  display:block;
  margin:8px 0 3px;
  color:var(--text);
  font-size:1.45rem;
  letter-spacing:-.03em;
}
.performance-sub {
  display:block;
  color:var(--muted);
  font-size:.68rem;
  line-height:1.45;
}
.performance-bar {
  height:5px;
  margin-top:14px;
  overflow:hidden;
  border-radius:999px;
  background:var(--soft);
}
.performance-bar span {
  display:block;
  width:0;
  height:100%;
  border-radius:inherit;
  background:var(--blue);
  transition:width .35s ease;
}

.kraepelin-highlight {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:20px;
  margin:18px 0;
  padding:22px;
  border:1px solid var(--blue-border,#d6e5fb);
  border-radius:16px;
  background:linear-gradient(135deg,var(--blue-subtle),#fff);
}
.kraepelin-highlight-copy {
  display:flex;
  align-items:center;
  gap:16px;
  min-width:0;
}
.kraepelin-highlight h2 { margin:3px 0 6px; }
.kraepelin-highlight p { max-width:620px; margin:0; color:var(--muted); font-size:.76rem; line-height:1.55; }
.kraepelin-highlight .category-meta {
  display:flex;
  gap:14px;
  margin:10px 0 0;
  padding:0;
  border:0;
}
.kraepelin-highlight > .btn { flex:0 0 auto; }

.dashboard-cta-grid {
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:10px;
  margin-top:12px;
}
.dashboard-cta {
  display:flex;
  align-items:center;
  gap:12px;
  width:100%;
  min-width:0;
  padding:15px;
  text-align:left;
  border:1px solid var(--line);
  border-radius:14px;
  background:var(--surface);
  color:var(--text);
  cursor:pointer;
  transition:border-color .15s, background .15s, transform .15s;
}
.dashboard-cta:hover {
  background:var(--soft);
  border-color:var(--blue-border,#d6e5fb);
  transform:translateY(-1px);
}
.dashboard-cta-icon {
  display:grid;
  place-items:center;
  flex:0 0 36px;
  width:36px;
  height:36px;
  border-radius:10px;
  background:var(--blue-light);
  color:var(--blue-dark);
  font-weight:900;
}
.dashboard-cta span:nth-child(2) { min-width:0; flex:1; }
.dashboard-cta strong,
.dashboard-cta small { display:block; }
.dashboard-cta strong { font-size:.78rem; }
.dashboard-cta small { margin-top:2px; color:var(--muted); font-size:.64rem; }
.dashboard-cta b { color:var(--blue); }

/* Dashboard no longer needs the old category/catalog blocks. */
#dashboardView .category-grid,
#dashboardView .catalog-section { display:none; }

@media (max-width:900px), (pointer:coarse) and (max-width:1100px) {
  .performance-grid { grid-template-columns:1fr 1fr; }
  .performance-card.performance-main { grid-column:1 / -1; }
}
@media (max-width:560px), (pointer:coarse) and (max-width:700px) {
  .dashboard-hero-actions { display:grid; grid-template-columns:1fr; }
  .dashboard-hero-actions .btn { width:100%; }
  .dashboard-section-head { margin-top:2px; }
  .performance-grid { grid-template-columns:1fr 1fr; gap:8px; }
  .performance-card { padding:14px; }
  .performance-card strong { font-size:1.15rem; }
  .performance-card.performance-main { grid-column:1 / -1; }
  .kraepelin-highlight {
    align-items:flex-start;
    flex-direction:column;
    padding:18px;
  }
  .kraepelin-highlight-copy { align-items:flex-start; }
  .kraepelin-highlight > .btn { width:100%; }
  .dashboard-cta-grid { grid-template-columns:1fr; }
}
@media (max-width:380px) {
  .performance-grid { grid-template-columns:1fr; }
  .performance-card.performance-main { grid-column:auto; }
}


/* ============================================================
   MYPSYCH — DESKTOP SIDEBAR RAIL
   Collapsed icon rail by default; expands on hover/focus.
   Mobile keeps the hamburger + slide-in sidebar interaction.
   ============================================================ */
:root {
  --sidebar-rail-w: 72px;
  --sidebar-expanded-w: 248px;
  --sidebar-bg: #132746;
  --sidebar-bg-2: #10213b;
  --sidebar-text: #d8e4f3;
  --sidebar-muted: #8394ad;
  --sidebar-active: #234a82;
  --sidebar-accent: #4d91ff;
}

@media (min-width: 901px) and (hover: hover) and (pointer: fine) {
  .app {
    grid-template-columns: var(--sidebar-rail-w) 1fr;
  }

  .sidebar {
    position: sticky;
    top: 0;
    width: var(--sidebar-rail-w);
    min-width: var(--sidebar-rail-w);
    box-sizing: border-box;
    overflow: visible;
    background: var(--sidebar-bg);
    color: var(--sidebar-text);
    border-right: 1px solid rgba(255,255,255,.06);
    box-shadow: 6px 0 24px rgba(9,24,47,.08);
    transition: width .2s ease, box-shadow .2s ease;
  }

  .sidebar:hover,
  .sidebar:focus-within {
    width: var(--sidebar-expanded-w);
    box-shadow: 14px 0 36px rgba(9,24,47,.18);
  }

  .sidebar-brand {
    height: 72px;
    box-sizing: border-box;
    padding: 14px 0;
    justify-content: center;
    border-bottom: 1px solid rgba(255,255,255,.07);
    overflow:hidden;
  }

  .brand-logo {
    width: 40px;
    height: 40px;
    flex: 0 0 40px;
    border-radius: 12px;
    background: rgba(77,145,255,.14);
    border: 1px solid rgba(77,145,255,.24);
  }

  .brand-logo-dot {
    width: 13px;
    height: 13px;
    background: var(--sidebar-accent);
    box-shadow: 0 0 0 5px rgba(77,145,255,.12);
  }

  .brand-text,
  .sidebar-label,
  .nav-item > span:not(.nav-icon),
  .sidebar-user .user-info,
  .logout-btn > span,
  .nav-tag,
  .nav-tag-muted {
    opacity: 0;
    visibility: hidden;
    transform: translateX(-8px);
    pointer-events: none;
    transition: opacity .14s ease, transform .18s ease, visibility .18s ease;
  }

  .sidebar:hover .brand-text,
  .sidebar:focus-within .brand-text,
  .sidebar:hover .sidebar-label,
  .sidebar:focus-within .sidebar-label,
  .sidebar:hover .nav-item > span:not(.nav-icon),
  .sidebar:focus-within .nav-item > span:not(.nav-icon),
  .sidebar:hover .sidebar-user .user-info,
  .sidebar:focus-within .sidebar-user .user-info,
  .sidebar:hover .logout-btn > span,
  .sidebar:focus-within .logout-btn > span,
  .sidebar:hover .nav-tag,
  .sidebar:focus-within .nav-tag,
  .sidebar:hover .nav-tag-muted,
  .sidebar:focus-within .nav-tag-muted {
    opacity: 1;
    visibility: visible;
    transform: none;
    pointer-events: auto;
  }

  .brand-text {
    min-width: 0;
    width: 170px;
    margin-left: 0;
  }
  .brand-text strong { color:#fff; }
  .brand-text small { color:var(--sidebar-muted); }

  .sidebar-nav {
    padding: 14px 12px;
  }

  .sidebar-label {
    padding: 14px 10px 8px;
    color: var(--sidebar-muted);
  }

  .nav-item {
    width: 48px;
    min-height: 46px;
    margin: 2px auto;
    padding: 10px;
    justify-content: center;
    gap: 12px;
    border-radius: 12px;
    color: var(--sidebar-text);
    background: transparent;
    font-size: .82rem;
    overflow:hidden;
    transition: width .18s ease, background .15s ease, color .15s ease, justify-content .15s ease;
  }

  .sidebar:hover .nav-item,
  .sidebar:focus-within .nav-item {
    width: 100%;
    justify-content: flex-start;
    padding: 10px 12px;
  }

  .nav-item:hover {
    background: rgba(255,255,255,.06);
    color: #fff;
  }

  .nav-item.active {
    background: var(--sidebar-active);
    color: #fff;
  }

  .nav-highlight {
    color: #b9d7ff;
  }

  .nav-item .nav-icon {
    width: 24px !important;
    height: 24px;
    flex: 0 0 24px;
    display:grid;
    place-items:center;
    color: currentColor;
    font-size: 0;
  }

  .nav-icon svg {
    width: 19px;
    height: 19px;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
  }

  .nav-item.active .nav-icon,
  .nav-highlight .nav-icon {
    color: #fff;
    background: transparent;
    border: 0;
  }

  .nav-tag,
  .nav-tag-muted {
    margin-left:auto;
    flex:0 0 auto;
    padding: 3px 7px;
    border-radius:999px;
    font-size:.5rem;
    font-weight:800;
  }

  .nav-tag {
    background:rgba(77,145,255,.16);
    color:#a9ccff;
  }

  .nav-tag-muted {
    background:rgba(255,255,255,.08);
    color:#a7b6c9;
  }

  .sidebar-footer {
    padding:12px;
    gap:8px;
    border-top:1px solid rgba(255,255,255,.07);
  }

  .sidebar-user {
    width:48px;
    min-height:48px;
    margin:0 auto;
    box-sizing:border-box;
    padding:7px;
    justify-content:center;
    background:rgba(255,255,255,.05);
    border:1px solid rgba(255,255,255,.06);
    transition:width .18s ease, background .15s ease;
    overflow:hidden;
  }

  .sidebar:hover .sidebar-user,
  .sidebar:focus-within .sidebar-user {
    width:100%;
    justify-content:flex-start;
  }

  .user-avatar {
    width:34px;
    height:34px;
    flex:0 0 34px;
    background:linear-gradient(135deg,var(--sidebar-accent),#2f7df2);
  }

  .user-info strong { color:#fff; }
  .user-info small { color:var(--sidebar-muted); }

  .logout-btn {
    width:48px;
    height:42px;
    margin:0 auto;
    padding:0;
    color:#ffb7b4;
    background:rgba(255,255,255,.05);
    border:1px solid rgba(255,255,255,.06);
    transition:width .18s ease, background .15s ease;
  }

  .sidebar:hover .logout-btn,
  .sidebar:focus-within .logout-btn {
    width:100%;
    justify-content:flex-start;
    padding:10px 12px;
  }

  .logout-btn:hover {
    background:rgba(217,83,79,.14);
  }

  .logout-btn svg {
    width:18px;
    height:18px;
    flex:0 0 18px;
    stroke:currentColor;
    stroke-width:1.8;
    stroke-linecap:round;
    stroke-linejoin:round;
  }

  .topbar {
    padding: 12px 24px;
    background: rgba(255,255,255,.94);
  }

  .content {
    max-width: 1240px;
    padding: 30px 32px 44px;
  }
}

/* Keep mobile behavior explicit: hamburger controls the full sidebar. */
@media (max-width: 900px), (hover: none) {
  .app {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: min(280px, 86vw);
    min-width: 0;
    transform: translateX(-100%);
    background: var(--surface);
    color: var(--text);
    border-right: 1px solid var(--line);
    box-shadow: 0 0 40px rgba(9,24,47,.18);
    z-index: 50;
    transition: transform .22s ease-out;
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .sidebar-brand {
    height:auto;
    padding:20px;
    border-bottom:1px solid var(--line);
    justify-content:flex-start;
  }

  .brand-text,
  .sidebar-label,
  .nav-item > span:not(.nav-icon),
  .sidebar-user .user-info,
  .logout-btn > span,
  .nav-tag,
  .nav-tag-muted {
    opacity:1;
    visibility:visible;
    transform:none;
    pointer-events:auto;
  }

  .sidebar-label { color:var(--soft-text); }
  .nav-item { width:100%; min-height:auto; justify-content:flex-start; }
  .nav-item .nav-icon { color:var(--muted); }

  .nav-icon svg {
    width:19px;
    height:19px;
    stroke:currentColor;
    stroke-width:1.8;
    stroke-linecap:round;
    stroke-linejoin:round;
  }

  .sidebar-footer { border-top:1px solid var(--line); }
  .logout-btn {
    width:100%;
    height:auto;
    background:#fff1f0;
    color:#bd3e39;
  }
}


/* ============================================================
   SIDEBAR REFINEMENT V3
   Desktop: collapsed icon rail + JS-driven hover expansion.
   Mobile: hamburger + slide-in sidebar.
   ============================================================ */
@media (min-width: 901px) and (hover: hover) and (pointer: fine) {
  .sidebar {
    overflow-x: hidden;
    overflow-y: auto;
    width: var(--sidebar-rail-w);
    min-width: var(--sidebar-rail-w);
    box-sizing: border-box;
    will-change: width;
  }

  .sidebar.is-expanded {
    width: var(--sidebar-expanded-w);
    box-shadow: 14px 0 36px rgba(9,24,47,.18);
  }

  .sidebar-nav {
    min-width: 0;
    overflow-x: hidden;
    overflow-y: auto;
  }

  /* Collapsed rail: remove labels from layout entirely. */
  .sidebar:not(.is-expanded) .brand-text,
  .sidebar:not(.is-expanded) .sidebar-label,
  .sidebar:not(.is-expanded) .nav-item > span:not(.nav-icon),
  .sidebar:not(.is-expanded) .sidebar-user .user-info,
  .sidebar:not(.is-expanded) .logout-btn > span {
    display: none;
  }

  .sidebar:not(.is-expanded) .nav-item {
    width: 48px;
    min-width: 48px;
    max-width: 48px;
    margin-left: auto;
    margin-right: auto;
    padding: 10px;
  }

  .sidebar:not(.is-expanded) .sidebar-user {
    width: 48px;
    min-width: 48px;
    max-width: 48px;
    margin-left: auto;
    margin-right: auto;
    padding: 7px;
  }

  .sidebar:not(.is-expanded) .logout-btn {
    width: 48px;
    min-width: 48px;
    max-width: 48px;
    margin-left: auto;
    margin-right: auto;
    padding: 0;
  }

  .sidebar-brand {
    height: 72px;
    box-sizing: border-box;
    padding: 14px 0;
    justify-content: center;
    border-bottom: 1px solid rgba(255,255,255,.07);
    overflow: hidden;
  }

  .brand-logo {
    width: 40px;
    height: 40px;
    flex: 0 0 40px;
    border-radius: 12px;
    background: rgba(77,145,255,.14);
    border: 1px solid rgba(77,145,255,.24);
  }

  .brand-logo-dot {
    width: 13px;
    height: 13px;
    background: var(--sidebar-accent);
    box-shadow: 0 0 0 5px rgba(77,145,255,.12);
  }

  .sidebar.is-expanded .brand-text {
    min-width: 0;
    width: 170px;
    margin-left: 0;
    opacity: 1;
    visibility: visible;
    transform: none;
  }

  .brand-text strong { color:#fff; }
  .brand-text small { color:var(--sidebar-muted); }

  .sidebar-nav {
    padding: 14px 12px;
  }

  .sidebar.is-expanded .sidebar-label {
    padding: 14px 10px 8px 48px;
    color: var(--sidebar-muted);
  }

  /* One fixed icon column + one fixed text column = perfect text alignment. */
  .nav-item {
    width: 100%;
    min-height: 46px;
    box-sizing: border-box;
    padding: 10px 12px;
    border-radius: 12px;
    margin: 2px 0;
    display: grid;
    grid-template-columns: 24px minmax(0,1fr) auto;
    align-items: center;
    column-gap: 12px;
    color: var(--sidebar-text);
    background: transparent;
    font-size: .82rem;
    overflow: hidden;
    transition: width .18s ease, background .15s ease, color .15s ease;
  }

  .nav-item:hover {
    background: rgba(255,255,255,.06);
    color: #fff;
  }

  .nav-item.active {
    background: var(--sidebar-active);
    color: #fff;
  }

  .nav-highlight { color: #b9d7ff; }

  .nav-item .nav-icon {
    width: 24px !important;
    height: 24px;
    flex: 0 0 24px;
    display: grid;
    place-items: center;
    color: currentColor;
    font-size: 0;
    background: transparent;
    border: 0;
  }

  .nav-icon svg {
    width: 19px;
    height: 19px;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
  }

  .sidebar:not(.is-expanded) .nav-item {
    display: grid;
    grid-template-columns: 24px;
    justify-items: center;
  }

  .sidebar.is-expanded .nav-item > span:nth-child(2) {
    min-width: 0;
    white-space: nowrap;
    display: block;
  }

  .nav-tag,
  .nav-tag-muted {
    justify-self: end;
    margin: 0;
    padding: 3px 7px;
    border-radius: 999px;
    font-size: .5rem;
    font-weight: 800;
  }

  .nav-tag {
    background: rgba(77,145,255,.16);
    color: #a9ccff;
  }

  .nav-tag-muted {
    background: rgba(255,255,255,.08);
    color: #a7b6c9;
  }

  .sidebar:not(.is-expanded) .nav-tag,
  .sidebar:not(.is-expanded) .nav-tag-muted {
    display: none;
  }

  .sidebar-footer {
    padding: 12px;
    gap: 8px;
    border-top: 1px solid rgba(255,255,255,.07);
  }

  .sidebar-user {
    min-height: 48px;
    box-sizing: border-box;
    padding: 7px;
    justify-content: flex-start;
    background: rgba(255,255,255,.05);
    border: 1px solid rgba(255,255,255,.06);
    overflow: hidden;
    transition: width .18s ease, background .15s ease;
  }

  .sidebar.is-expanded .sidebar-user {
    width: 100%;
  }

  .user-avatar {
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    background: linear-gradient(135deg,var(--sidebar-accent),#2f7df2);
  }

  .user-info strong { color:#fff; }
  .user-info small { color:var(--sidebar-muted); }

  .sidebar.is-expanded .sidebar-user .user-info {
    display:flex;
  }

  .logout-btn {
    height: 42px;
    padding: 0;
    color: #ffb7b4;
    background: rgba(255,255,255,.05);
    border: 1px solid rgba(255,255,255,.06);
  }

  .sidebar.is-expanded .logout-btn {
    width:100%;
    justify-content:flex-start;
    padding:10px 12px;
  }

  .logout-btn:hover { background:rgba(217,83,79,.14); }

  .logout-btn svg {
    width:18px;
    height:18px;
    flex:0 0 18px;
    stroke:currentColor;
    stroke-width:1.8;
    stroke-linecap:round;
    stroke-linejoin:round;
  }

  .cv-placeholder-shell {
    width: 100%;
    max-width: none;
    margin: 0;
  }

  .cv-placeholder-card {
    width: 100%;
    box-sizing: border-box;
  }
}

@media (max-width: 900px), (hover: none) {
  .sidebar,
  .sidebar-nav {
    overflow-x: hidden;
  }

  .cv-placeholder-shell {
    width: 100%;
    max-width: none;
    margin: 0;
  }
}


/* ============================================================
   SIDEBAR INITIAL-STATE GUARD
   Prevent legacy :hover rules from leaving the rail expanded
   after a fresh page load while its labels are hidden.
   Desktop expansion is controlled ONLY by .is-expanded.
   ============================================================ */
@media (min-width: 901px) and (hover: hover) and (pointer: fine) {
  .sidebar,
  .sidebar:hover,
  .sidebar:focus,
  .sidebar:focus-within,
  .sidebar:not(.is-expanded),
  .sidebar:hover:not(.is-expanded),
  .sidebar:focus-within:not(.is-expanded) {
    width: var(--sidebar-rail-w) !important;
    min-width: var(--sidebar-rail-w) !important;
    max-width: var(--sidebar-rail-w) !important;
  }

  .sidebar.is-expanded,
  .sidebar:hover.is-expanded,
  .sidebar:focus-within.is-expanded {
    width: var(--sidebar-expanded-w) !important;
    min-width: var(--sidebar-expanded-w) !important;
    max-width: var(--sidebar-expanded-w) !important;
  }

  .sidebar:not(.is-expanded) .brand-text,
  .sidebar:not(.is-expanded) .sidebar-label,
  .sidebar:not(.is-expanded) .nav-item > span:not(.nav-icon),
  .sidebar:not(.is-expanded) .sidebar-user .user-info,
  .sidebar:not(.is-expanded) .logout-btn > span {
    display: none !important;
  }

  .sidebar.is-expanded .brand-text,
  .sidebar.is-expanded .sidebar-label,
  .sidebar.is-expanded .nav-item > span:not(.nav-icon),
  .sidebar.is-expanded .sidebar-user .user-info,
  .sidebar.is-expanded .logout-btn > span {
    display: initial;
  }

  .sidebar.is-expanded .sidebar-label {
    display: block;
  }

  .sidebar.is-expanded .sidebar-user .user-info {
    display: flex;
  }

  .sidebar.is-expanded .nav-item {
    width: 100%;
    max-width: none;
  }

  .sidebar:not(.is-expanded) .nav-item {
    width: 48px !important;
    min-width: 48px !important;
    max-width: 48px !important;
  }

  .sidebar:not(.is-expanded) .sidebar-user,
  .sidebar:not(.is-expanded) .logout-btn {
    width: 48px !important;
    min-width: 48px !important;
    max-width: 48px !important;
  }
}


/* Dedicated general psychotest page. Dashboard stays summary-only. */
.psikotes-page-head {
  margin-bottom: 10px;
}
.psikotes-catalog-section {
  margin-top: 20px;
}
.psikotes-catalog-section .catalog-head {
  margin-bottom: 12px;
}
@media (max-width: 640px) {
  .psikotes-catalog-section {
    margin-top: 16px;
  }
}

@media (min-width: 901px) and (hover: hover) and (pointer: fine) {
  .sidebar.is-expanded .brand-text,
  .sidebar.is-expanded .sidebar-label,
  .sidebar.is-expanded .nav-item > span:not(.nav-icon),
  .sidebar.is-expanded .sidebar-user .user-info,
  .sidebar.is-expanded .logout-btn > span {
    opacity: 1 !important;
    visibility: visible !important;
    transform: none !important;
    pointer-events: auto !important;
  }
  .sidebar.is-expanded .brand-text { display: flex !important; }
  .sidebar.is-expanded .sidebar-label { display: block !important; }
  .sidebar.is-expanded .nav-item > span:nth-child(2) { display: block !important; }
  .sidebar.is-expanded .nav-tag,
  .sidebar.is-expanded .nav-tag-muted { display: inline-flex !important; }
  .sidebar.is-expanded .sidebar-user .user-info { display: flex !important; }
  .sidebar.is-expanded .logout-btn > span { display: inline !important; }
}

.psikotes-catalog-section .test-grid.large {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  align-items: stretch;
}
.psikotes-catalog-section .app-test-item {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  min-height: 250px;
  padding: 18px;
  gap: 14px;
  box-sizing: border-box;
}
.psikotes-catalog-section .app-test-item .test-icon {
  width: 52px;
  height: 52px;
  flex: 0 0 52px;
  border-radius: 13px;
}
.psikotes-catalog-section .app-test-item .test-info {
  width: 100%;
  min-width: 0;
  flex: 1 1 auto;
}
.psikotes-catalog-section .app-test-item .test-info strong {
  display: block;
  margin-bottom: 5px;
  font-size: .92rem;
}
.psikotes-catalog-section .app-test-item .test-info small {
  display: block;
  max-width: none;
  font-size: .72rem;
  line-height: 1.55;
}
.psikotes-catalog-section .app-test-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  width: 100%;
  gap: 8px;
  margin-top: auto;
}
.psikotes-catalog-section .app-test-controls select {
  width: 100%;
  min-width: 0;
  height: 40px;
  box-sizing: border-box;
}
.psikotes-catalog-section .app-test-controls .btn {
  min-height: 40px;
  white-space: nowrap;
}
@media (max-width: 1050px) {
  .psikotes-catalog-section .test-grid.large { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .psikotes-catalog-section .test-grid.large { grid-template-columns: 1fr; }
  .psikotes-catalog-section .app-test-item { min-height: 0; }
}
@media (max-width: 380px) {
  .psikotes-catalog-section .app-test-controls { grid-template-columns: 1fr; }
  .psikotes-catalog-section .app-test-controls .btn { width: 100%; }
}


/* ============================================================
   MOBILE SIDEBAR — MATCH DESKTOP RAIL VISUALS
   ============================================================ */
@media (max-width: 900px), (hover: none) {
  .sidebar {
    width: min(280px, 86vw) !important;
    max-width: min(280px, 86vw) !important;
    background: var(--sidebar-bg) !important;
    color: var(--sidebar-text) !important;
    border-right: 1px solid rgba(255,255,255,.07) !important;
    box-shadow: 12px 0 34px rgba(9,24,47,.18) !important;
  }

  .sidebar-brand {
    height: 72px !important;
    box-sizing: border-box !important;
    padding: 14px 16px !important;
    justify-content: flex-start !important;
    background: var(--sidebar-bg) !important;
    border-bottom: 1px solid rgba(255,255,255,.07) !important;
  }

  .brand-logo {
    width: 40px !important;
    height: 40px !important;
    flex: 0 0 40px !important;
    border-radius: 12px !important;
    background: rgba(77,145,255,.14) !important;
    border: 1px solid rgba(77,145,255,.24) !important;
  }

  .brand-logo-dot {
    width: 13px !important;
    height: 13px !important;
    background: var(--sidebar-accent) !important;
    box-shadow: 0 0 0 5px rgba(77,145,255,.12) !important;
  }

  .brand-text strong { color:#fff !important; }
  .brand-text small { color:var(--sidebar-muted) !important; }

  .sidebar-nav {
    padding: 14px 12px !important;
    background: var(--sidebar-bg) !important;
  }

  .sidebar-label {
    padding: 14px 12px 8px !important;
    color: var(--sidebar-muted) !important;
  }

  .nav-item {
    width: 100% !important;
    min-height: 46px !important;
    box-sizing: border-box !important;
    margin: 2px 0 !important;
    padding: 10px 12px !important;
    display: grid !important;
    grid-template-columns: 24px minmax(0,1fr) auto !important;
    align-items: center !important;
    column-gap: 12px !important;
    border-radius: 12px !important;
    color: var(--sidebar-text) !important;
    background: transparent !important;
    font-size: .82rem !important;
  }

  .nav-item:hover,
  .nav-item:active {
    background: rgba(255,255,255,.06) !important;
    color:#fff !important;
  }

  .nav-item.active {
    background: var(--sidebar-active) !important;
    color:#fff !important;
  }

  .nav-highlight { color:#b9d7ff !important; }

  .nav-item .nav-icon {
    width:24px !important;
    height:24px !important;
    flex:0 0 24px !important;
    display:grid !important;
    place-items:center !important;
    padding:0 !important;
    margin:0 !important;
    border:0 !important;
    border-radius:0 !important;
    background:transparent !important;
    color:currentColor !important;
    font-size:0 !important;
  }

  .nav-icon svg {
    width:19px !important;
    height:19px !important;
    display:block !important;
    stroke:currentColor !important;
    stroke-width:1.8 !important;
    stroke-linecap:round !important;
    stroke-linejoin:round !important;
  }

  .nav-item > span:nth-child(2) {
    min-width:0;
    display:block !important;
    color:inherit !important;
    white-space:nowrap;
  }

  .nav-tag,
  .nav-tag-muted {
    display:inline-flex !important;
    justify-self:end !important;
    margin:0 !important;
    padding:3px 7px !important;
    border-radius:999px !important;
    font-size:.5rem !important;
    font-weight:800 !important;
  }

  .nav-tag {
    background:rgba(77,145,255,.16) !important;
    color:#a9ccff !important;
  }

  .nav-tag-muted {
    background:rgba(255,255,255,.08) !important;
    color:#a7b6c9 !important;
  }

  .sidebar-footer {
    padding:12px !important;
    gap:8px !important;
    flex:0 0 auto !important;
    border-top:1px solid rgba(255,255,255,.07) !important;
    background:var(--sidebar-bg) !important;
  }

  .sidebar-user {
    width:100% !important;
    min-height:48px !important;
    height:48px !important;
    box-sizing:border-box !important;
    padding:7px !important;
    display:flex !important;
    align-items:center !important;
    gap:10px !important;
    background:rgba(255,255,255,.05) !important;
    border:1px solid rgba(255,255,255,.06) !important;
    color:var(--sidebar-text) !important;
  }

  .sidebar-user .user-info {
    display:flex !important;
    min-width:0 !important;
  }

  .user-info strong { color:#fff !important; }
  .user-info small { color:var(--sidebar-muted) !important; }

  .logout-btn {
    width:100% !important;
    min-width:0 !important;
    max-width:none !important;
    height:42px !important;
    min-height:42px !important;
    max-height:42px !important;
    box-sizing:border-box !important;
    margin:0 !important;
    padding:0 12px !important;
    display:flex !important;
    flex:0 0 42px !important;
    align-items:center !important;
    justify-content:flex-start !important;
    gap:10px !important;
    border-radius:10px !important;
    background:rgba(217,83,79,.12) !important;
    border:1px solid rgba(217,83,79,.18) !important;
    color:#ffb7b4 !important;
  }

  .logout-btn > span {
    display:inline !important;
    opacity:1 !important;
    visibility:visible !important;
    transform:none !important;
  }

  .logout-btn svg {
    width:18px !important;
    height:18px !important;
    flex:0 0 18px !important;
    display:block !important;
    stroke:currentColor !important;
    stroke-width:1.8 !important;
    stroke-linecap:round !important;
    stroke-linejoin:round !important;
  }

  .logout-btn:hover,
  .logout-btn:active {
    background:rgba(217,83,79,.18) !important;
  }
}


/* ============================================================
   HISTORY — MOBILE CARDS
   Desktop keeps the dense comparison table. Mobile gets a
   compact expandable card per test result.
   ============================================================ */
.history-mobile-list {
  display: none;
}

.history-mobile-card {
  overflow: hidden;
  margin-bottom: 10px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.history-mobile-summary {
  display: grid;
  grid-template-columns: minmax(0,1fr) auto 20px;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 15px 14px;
  color: var(--text);
  text-align: left;
}

.history-mobile-summary:hover {
  background: var(--soft);
}

.history-mobile-main {
  min-width: 0;
}

.history-mobile-main strong,
.history-mobile-main small,
.history-mobile-score strong,
.history-mobile-score small {
  display: block;
}

.history-mobile-main strong {
  margin-bottom: 3px;
  font-size: .83rem;
  line-height: 1.25;
}

.history-mobile-main small {
  color: var(--muted);
  font-size: .63rem;
  line-height: 1.45;
}

.history-mobile-score {
  text-align: right;
}

.history-mobile-score strong {
  color: var(--blue-dark);
  font-size: 1.05rem;
  line-height: 1;
}

.history-mobile-score small {
  margin-top: 3px;
  color: var(--soft-text);
  font-size: .56rem;
}

.history-mobile-chevron {
  color: var(--soft-text);
  font-size: 1.5rem;
  line-height: 1;
  transform: translateY(-1px);
  transition: transform .18s ease, color .18s ease;
}

.history-mobile-card.is-open .history-mobile-chevron {
  transform: rotate(90deg);
  color: var(--blue);
}

.history-mobile-details {
  padding: 0 14px 14px;
  border-top: 1px solid var(--line);
  background: var(--soft);
}

.history-mobile-metrics {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding-top: 12px;
}

.history-mobile-metrics > div {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
}

.history-mobile-metrics span,
.history-mobile-metrics strong {
  display: block;
}

.history-mobile-metrics span {
  margin-bottom: 3px;
  color: var(--muted);
  font-size: .58rem;
}

.history-mobile-metrics strong {
  font-size: .84rem;
}

.history-mobile-actions {
  margin-top: 10px;
}

.history-mobile-pdf {
  width: 100%;
  min-height: 40px;
}

@media (max-width: 700px), (pointer: coarse) and (max-width: 900px) {
  .history-table-wrap {
    display: none;
  }

  .history-mobile-list {
    display: block;
  }

  .history-page-head {
    align-items: flex-start;
  }

  .history-total {
    align-self: flex-start;
  }
}

@media (max-width: 380px) {
  .history-mobile-summary {
    grid-template-columns: minmax(0,1fr) auto 16px;
    gap: 8px;
    padding: 14px 12px;
  }

  .history-mobile-details {
    padding-left: 12px;
    padding-right: 12px;
  }

  .history-mobile-metrics {
    gap: 6px;
  }

  .history-mobile-metrics > div {
    padding: 9px;
  }
}


/* ============================================================
   SKD PAKET LENGKAP — DESKTOP SIDE NAVIGATION
   Desktop only. Mobile keeps the existing stacked navigator.
   ============================================================ */
@media (min-width: 901px) {
  .test-view.skd-complete-mode .test-body {
    display: grid;
    grid-template-columns: 250px minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr) auto;
    grid-template-areas:
      "navigator workspace"
      "controls workspace";
    align-items: stretch;
    gap: 10px 12px;
    min-height: 0;
    overflow: hidden;
    padding: 2px 0 8px;
  }

  .test-view.skd-complete-mode .test-question-card {
    grid-area: workspace;
    width: 100%;
    max-width: none;
    min-width: 0;
    min-height: 0;
    height: 100%;
    margin: 0;
    box-sizing: border-box;
    padding: 24px 28px;
    overflow-y: auto;
    justify-content: flex-start;
    align-items: stretch;
  }

  .test-view.skd-complete-mode .test-question-card .test-question-label,
  .test-view.skd-complete-mode .test-question-card h2,
  .test-view.skd-complete-mode .test-question-card .test-keypad-answer {
    flex: 0 0 auto;
  }

  .test-view.skd-complete-mode .test-question-card .test-question-label {
    margin-top: 2px;
    text-align: left;
    align-self: flex-start;
  }

  .test-view.skd-complete-mode .test-question-card h2 {
    text-align: left;
    margin-top: 0;
    margin-bottom: 18px;
  }

  .test-view.skd-complete-mode .test-question-card h2 {
    width: 100%;
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
  }

  /* In SKD Complete desktop the answer buttons belong inside
     the same workspace card as the question. */
  .test-view.skd-complete-mode .test-question-card .test-keypad-answer {
    display: grid;
    grid-template-columns: 1fr;
    width: 100%;
    max-width: none;
    min-width: 0;
    margin: 0;
    box-sizing: border-box;
    align-self: stretch;
  }

  .test-view.skd-complete-mode > .test-body > #keypad {
    /* The standalone keypad is hidden because answers are relocated
       into the question workspace below via layout override. */
  }

  .test-view.skd-complete-mode .test-hint {
    display: none;
  }

  .test-view.skd-complete-mode .skd-question-navigator {
    grid-area: navigator;
    width: 100%;
    max-width: none;
    min-width: 0;
    min-height: 0;
    margin: 0;
    padding: 12px;
    box-sizing: border-box;
    overflow-y: auto;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--surface);
    box-shadow: var(--shadow-sm);
    scrollbar-width: thin;
  }

  .test-view.skd-complete-mode .skd-nav-title-row {
    margin: 2px 2px 10px;
    align-items: flex-start;
    flex-direction: column;
    gap: 3px;
  }

  .test-view.skd-complete-mode .skd-nav-title-row strong {
    font-size: .76rem;
  }

  .test-view.skd-complete-mode .skd-nav-title-row span {
    font-size: .62rem;
  }

  .test-view.skd-complete-mode .skd-question-nav {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
    padding: 0;
    border: 0;
    background: transparent;
  }

  .test-view.skd-complete-mode .skd-question-number {
    min-height: 36px;
    border-radius: 9px;
    font-size: .7rem;
  }

  .test-view.skd-complete-mode .skd-controls {
    grid-area: controls;
    width: 100%;
    max-width: none;
    min-width: 0;
    margin: 0;
    padding: 10px 10px 0;
    box-sizing: border-box;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--surface);
    box-shadow: var(--shadow-sm);
  }

  .test-view.skd-complete-mode .skd-nav-buttons {
    grid-template-columns: 1fr;
    gap: 7px;
    margin-bottom: 8px;
  }

  .test-view.skd-complete-mode .skd-nav-buttons .secondary-btn,
  .test-view.skd-complete-mode .skd-finish-section-btn {
    min-height: 42px;
    width: 100%;
    font-size: .76rem;
  }

  .test-view.skd-complete-mode .skd-finish-section-btn {
    margin-bottom: 10px;
  }

  .test-view.skd-complete-mode .skd-complete-section-head {
    width: 100%;
    max-width: 940px;
  }
}

/* Narrower desktop/laptop: slightly narrower navigation rail. */
@media (min-width: 901px) and (max-width: 1180px) {
  .test-view.skd-complete-mode .test-body {
    grid-template-columns: 220px minmax(0, 1fr);
  }

  .test-view.skd-complete-mode .skd-question-nav {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}


/* ============================================================
   SKD COMPLETE — DESKTOP WORKSPACE CORRECTION
   Question + answers share one main workspace; navigation stays left.
   ============================================================ */
@media (min-width: 901px) {
  .test-view.skd-complete-mode .test-workspace {
    grid-area: workspace;
    min-width: 0;
    min-height: 0;
    height: 100%;
    display: flex;
    flex-direction: column;
    gap: 10px;
    overflow: hidden;
  }

  .test-view.skd-complete-mode .test-workspace .test-question-card {
    flex: 1 1 auto;
    min-height: 0;
    width: 100%;
    max-width: none;
    margin: 0;
    box-sizing: border-box;
    padding: 24px 28px 16px;
    overflow-y: auto;
    justify-content: flex-start;
    align-items: stretch;
  }

  .test-view.skd-complete-mode .test-workspace .test-question-card .test-question-label {
    align-self: flex-start;
    margin-top: 2px;
    text-align: left;
  }

  .test-view.skd-complete-mode .test-workspace .test-question-card h2 {
    width: 100%;
    max-width: 980px;
    margin: 0 0 14px;
    text-align: left;
    align-self: flex-start;
  }

  .test-view.skd-complete-mode .test-workspace > .test-keypad-answer {
    flex: 0 0 auto;
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 0 12px 12px;
    box-sizing: border-box;
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    align-self: stretch;
  }

  .test-view.skd-complete-mode .test-workspace > .test-keypad-answer .test-answer {
    min-height: 46px;
  }

  .test-view.skd-complete-mode > .test-body > .test-hint {
    display: none;
  }

  /* Previous temporary sibling-grid positioning no longer applies. */
  .test-view.skd-complete-mode > .test-body > #testContent,
  .test-view.skd-complete-mode > .test-body > #keypad {
    grid-area: auto;
  }
}

@media (max-width: 900px) {
  .test-workspace {
    display: contents;
  }
}


/* ============================================================
   ACCOUNT ACCESS GATE + LANDING CATEGORY ACTIONS
   ============================================================ */
.account-gate-modal {
  width: min(460px, calc(100vw - 32px));
}

.account-gate-modal .dashboard-kicker {
  display: inline-block;
  margin: 2px 0 6px;
}

.account-gate-modal h3 {
  margin: 0 0 8px;
}

.account-gate-modal > p {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
  font-size: .78rem;
}

.account-gate-benefits {
  display: grid;
  gap: 8px;
  margin: 18px 0;
}

.account-gate-benefits > div {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--soft);
}

.account-gate-benefits strong {
  color: var(--blue);
}

.account-gate-benefits span {
  color: var(--text);
  font-size: .72rem;
  line-height: 1.45;
}

.account-gate-modal .modal-actions {
  display: grid;
  grid-template-columns: 1fr 1fr 1.2fr;
  gap: 8px;
}

.lp-category-link {
  appearance: none;
  border: 0;
  font: inherit;
  cursor: pointer;
}

.lp-category-card .lp-category-link:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

@media (max-width: 560px) {
  .account-gate-modal .modal-actions {
    grid-template-columns: 1fr;
  }

  .account-gate-modal .modal-actions button {
    width: 100%;
  }
}


/* ============================================================
   CV BUILDER V1
   ============================================================ */
.cv-page-shell {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
}

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

.cv-page-head h2 {
  margin: 4px 0 7px;
}

.cv-page-head p {
  max-width: 760px;
  margin: 0;
  line-height: 1.65;
}

.cv-expiry {
  flex: 0 0 auto;
  padding: 8px 10px;
  border: 1px solid var(--blue-border, #d6e5fb);
  border-radius: 999px;
  background: var(--blue-light, #eef5ff);
  color: var(--blue-dark, #245aab);
  font-size: .62rem;
  font-weight: 800;
  white-space: nowrap;
}

.cv-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.cv-template-group,
.cv-toolbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.cv-toolbar-label {
  color: var(--soft-text);
  font-size: .62rem;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.cv-toolbar select {
  min-width: 230px;
  min-height: 40px;
  padding: 8px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: #fff;
  color: var(--text);
  font: inherit;
  font-size: .72rem;
}

.cv-workspace {
  display: grid;
  grid-template-columns: minmax(360px, .9fr) minmax(520px, 1.1fr);
  gap: 16px;
  align-items: start;
}

.cv-editor {
  min-width: 0;
}

.cv-form-section {
  margin-bottom: 12px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.cv-section-title {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin-bottom: 14px;
}

.cv-section-title > span {
  display: grid;
  place-items: center;
  flex: 0 0 28px;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--blue-light);
  color: var(--blue-dark);
  font-size: .58rem;
  font-weight: 900;
}

.cv-section-title h3 {
  margin: 0 0 3px;
  font-size: .92rem;
}

.cv-section-title p {
  margin: 0;
  color: var(--muted);
  font-size: .66rem;
  line-height: 1.5;
}

.cv-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.cv-form-grid label,
.cv-repeat-field {
  display: block;
  color: var(--text);
  font-size: .68rem;
  font-weight: 700;
}

.cv-form-grid label input,
.cv-form-grid label textarea,
.cv-repeat-field input,
.cv-repeat-field textarea,
.cv-form-section > textarea {
  width: 100%;
  box-sizing: border-box;
  margin-top: 5px;
  padding: 10px 11px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: #fff;
  color: var(--text);
  font: inherit;
  font-size: .72rem;
  line-height: 1.5;
  outline: none;
  resize: vertical;
}

.cv-form-grid label input:focus,
.cv-form-grid label textarea:focus,
.cv-repeat-field input:focus,
.cv-repeat-field textarea:focus,
.cv-form-section > textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(47,125,242,.10);
}

.cv-full,
.cv-field-full {
  grid-column: 1 / -1;
}

.field-help-inline {
  color: var(--soft-text);
  font-size: .57rem;
  font-weight: 500;
  margin-left: 3px;
}

.cv-guidance {
  margin-bottom: 9px;
  padding: 10px 11px;
  border-left: 3px solid var(--blue);
  border-radius: 8px;
  background: var(--blue-subtle, #f4f8ff);
  color: var(--muted);
  font-size: .66rem;
  line-height: 1.55;
}

.cv-inline-btn,
.cv-add-btn,
.cv-remove-btn {
  border: 0;
  background: none;
  color: var(--blue-dark);
  cursor: pointer;
  font: inherit;
  font-size: .66rem;
  font-weight: 800;
}

.cv-inline-btn,
.cv-add-btn {
  margin-top: 8px;
  padding: 4px 0;
}

.cv-add-btn:hover,
.cv-inline-btn:hover,
.cv-remove-btn:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.cv-repeat-list {
  display: grid;
  gap: 9px;
}

.cv-repeat-card {
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--soft);
}

.cv-repeat-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
  color: var(--text);
  font-size: .68rem;
}

.cv-remove-btn {
  color: #c14b46;
}

.cv-repeat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
}

.cv-repeat-empty {
  padding: 10px;
  border: 1px dashed var(--line-strong);
  border-radius: 10px;
  color: var(--muted);
  font-size: .65rem;
}

.cv-photo-row {
  display: flex;
  align-items: center;
  gap: 14px;
}

.cv-photo-preview {
  width: 88px;
  height: 117px;
  flex: 0 0 88px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px dashed var(--line-strong);
  border-radius: 10px;
  background: var(--soft);
  color: var(--soft-text);
  font-size: .58rem;
  font-weight: 800;
}

.cv-photo-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cv-photo-copy {
  min-width: 0;
}

.cv-photo-copy input[type=file] {
  max-width: 100%;
  font-size: .65rem;
}

.cv-photo-copy p {
  margin: 8px 0 0;
  max-width: 540px;
}

.cv-editor-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 4px 20px;
}

#cvSaveStatus {
  color: var(--muted);
  font-size: .64rem;
}

.cv-preview-shell {
  position: sticky;
  top: 18px;
  min-width: 0;
}

.cv-preview-head {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
  padding: 0 4px;
  color: var(--soft-text);
  font-size: .58rem;
  font-weight: 900;
  letter-spacing: .1em;
}

.cv-paper-wrap {
  min-height: 700px;
  padding: 18px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #eef1f5;
}

.cv-paper {
  width: 210mm;
  min-height: 297mm;
  max-width: none;
  box-sizing: border-box;
  margin: 0 auto;
  padding: 18mm 16mm;
  background: #fff;
  color: #15233a;
  box-shadow: 0 12px 38px rgba(17,40,72,.10);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 10.5pt;
  line-height: 1.45;
}

.cv-paper-header {
  display: flex;
  align-items: flex-start;
  gap: 15px;
  padding-bottom: 10px;
  border-bottom: 1px solid #cfd7e4;
}

.cv-paper-identity {
  min-width: 0;
  flex: 1;
}

.cv-paper-identity h1 {
  margin: 0;
  color: #15233a;
  font-size: 22pt;
  line-height: 1.08;
  letter-spacing: -.03em;
}

.cv-paper-role {
  margin: 4px 0 2px;
  color: #2f6fcb;
  font-size: 11pt;
  font-weight: 700;
}

.cv-paper-contact {
  margin: 4px 0 0;
  color: #566980;
  font-size: 8.5pt;
  line-height: 1.45;
}

.cv-paper-section {
  margin-top: 13px;
}

.cv-paper-section h2 {
  margin: 0 0 6px;
  padding-bottom: 2px;
  border-bottom: 1px solid #d7dee9;
  color: #15233a;
  font-size: 10.5pt;
  line-height: 1.2;
  letter-spacing: .03em;
  text-transform: uppercase;
}

.cv-paper-section p {
  margin: 0;
}

.cv-paper-section ul {
  margin: 4px 0 0;
  padding-left: 17px;
}

.cv-paper-section li {
  margin: 2px 0;
}

.cv-skill-line {
  line-height: 1.55;
}

.cv-entry {
  margin: 0 0 8px;
}

.cv-entry:last-child {
  margin-bottom: 0;
}

.cv-entry-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.cv-entry-head strong {
  font-size: 9.7pt;
}

.cv-entry-head span {
  flex: 0 0 auto;
  color: #68798e;
  font-size: 8pt;
}

.cv-entry-sub {
  margin-top: 1px;
  color: #4d6077;
  font-size: 8.5pt;
}

.cv-entry-link {
  color: #2f6fcb;
  font-size: 8pt;
  word-break: break-word;
}

.cv-paper-photo {
  width: 28mm;
  height: 37mm;
  flex: 0 0 28mm;
  object-fit: cover;
  border: 1px solid #d5dce6;
}

.cv-template-academic {
  font-family: Georgia, "Times New Roman", serif;
  color: #222;
}

.cv-template-academic .cv-paper-header {
  display: block;
  text-align: center;
  border-bottom: 0;
  padding-bottom: 4px;
}

.cv-template-academic .cv-paper-identity h1 {
  color: #111;
  font-size: 20pt;
  letter-spacing: 0;
}

.cv-template-academic .cv-paper-role {
  color: #333;
  font-size: 10pt;
}

.cv-template-academic .cv-paper-contact {
  color: #333;
  font-size: 8pt;
}

.cv-template-academic .cv-paper-section {
  margin-top: 11px;
}

.cv-template-academic .cv-paper-section h2 {
  border-bottom: 1px solid #111;
  color: #111;
  font-size: 9.5pt;
}

.cv-template-academic .cv-entry-head strong {
  font-size: 9.2pt;
}

.cv-template-formal-photo .cv-paper-header {
  align-items: center;
  padding-bottom: 12px;
}

.cv-template-formal-photo .cv-paper-photo {
  order: 2;
  width: 30mm;
  height: 40mm;
  margin-left: auto;
}

.cv-template-formal-photo .cv-paper-section h2 {
  color: #2a5f9e;
  border-bottom-color: #b9cae2;
}

@media (max-width: 1180px) {
  .cv-workspace {
    grid-template-columns: 1fr;
  }

  .cv-preview-shell {
    position: static;
  }

  .cv-paper-wrap {
    min-height: 0;
  }
}

@media (max-width: 700px) {
  .cv-page-head,
  .cv-toolbar,
  .cv-photo-row,
  .cv-editor-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .cv-toolbar-actions,
  .cv-template-group {
    flex-wrap: wrap;
  }

  .cv-toolbar select {
    flex: 1 1 100%;
    min-width: 0;
  }

  .cv-form-grid,
  .cv-repeat-grid {
    grid-template-columns: 1fr;
  }

  .cv-preview-shell {
    overflow: hidden;
  }

  .cv-paper-wrap {
    padding: 10px;
    overflow-x: auto;
  }

  .cv-paper {
    width: 210mm;
  }
}

@media print {
  @page {
    size: A4;
    margin: 0;
  }

  html,
  body {
    margin: 0 !important;
    padding: 0 !important;
    background: #fff !important;
  }

  body[data-view="cv"] * {
    visibility: hidden !important;
  }

  body[data-view="cv"] #cvPreview,
  body[data-view="cv"] #cvPreview * {
    visibility: visible !important;
  }

  body[data-view="cv"] #cvPreview {
    position: static !important;
    width: 210mm !important;
    min-height: 297mm !important;
    margin: 0 !important;
    box-shadow: none !important;
  }

  body[data-view="cv"] .cv-paper-wrap {
    padding: 0 !important;
    overflow: visible !important;
    border: 0 !important;
    background: #fff !important;
  }
}


/* ============================================================
   CV V1 REFINEMENT
   ============================================================ */
.cv-summary-helper {
  display: block;
  margin-bottom: 9px;
  color: var(--text);
  font-size: .68rem;
  font-weight: 700;
}

.cv-summary-helper input {
  width: 100%;
  box-sizing: border-box;
  margin-top: 5px;
  padding: 10px 11px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: #fff;
  color: var(--text);
  font: inherit;
  font-size: .72rem;
  outline: none;
}

.cv-summary-helper input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(47,125,242,.10);
}

.cv-final-label {
  display: block;
  margin-bottom: 3px;
  color: var(--text);
  font-size: .7rem;
}

.cv-editor-footer > div:first-child {
  min-width: 0;
}

.cv-final-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.cv-build-btn {
  min-width: 130px;
}

.cv-template-ats {
  font-family: Georgia, "Times New Roman", serif;
  color: #262626;
}

.cv-template-ats .cv-paper-header {
  border-bottom: 0;
  padding-bottom: 5px;
}

.cv-template-ats .cv-paper-identity h1 {
  color: #14589a;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 21pt;
  letter-spacing: .01em;
  text-transform: uppercase;
}

.cv-template-ats .cv-paper-role {
  color: #202020;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 11pt;
}

.cv-template-ats .cv-paper-contact {
  color: #4e4e4e;
  font-family: Georgia, "Times New Roman", serif;
}

.cv-template-ats .cv-paper-section {
  margin-top: 12px;
}

.cv-template-ats .cv-paper-section h2 {
  padding-bottom: 4px;
  border-bottom: 1px solid #3b7d71;
  color: #14589a;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 10pt;
  letter-spacing: .02em;
}

.cv-template-ats .cv-entry-head strong {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 9.4pt;
}

.cv-template-ats .cv-entry-sub,
.cv-template-ats .cv-paper-section li,
.cv-template-ats .cv-paper-section p {
  font-family: Georgia, "Times New Roman", serif;
}

.cv-template-ats .cv-paper-contact {
  font-size: 8.2pt;
}

.cv-template-ats .cv-entry-head span,
.cv-template-ats .cv-entry-sub {
  color: #585858;
}

.cv-preview-shell {
  min-height: 0;
}

.cv-paper-wrap {
  display: flex;
  justify-content: center;
}

.cv-paper {
  min-height: 297mm;
}

@media (max-width: 700px) {
  .cv-final-actions {
    width: 100%;
    flex-direction: column;
  }

  .cv-final-actions .btn {
    width: 100%;
  }

  .cv-page-head {
    gap: 10px;
  }

  .cv-expiry {
    align-self: flex-start;
  }
}


/* ============================================================
   CV OUTPUT REFINEMENT
   ============================================================ */
.cv-paper-section p,
.cv-paper-section li {
  text-align: justify;
  text-justify: inter-word;
}

.cv-repeat-field input[type="month"] {
  min-height: 38px;
}

.cv-repeat-field input[type="number"] {
  min-height: 38px;
}

/* Print only the A4 CV canvas. Do not rely on visibility:hidden:
   hidden layout nodes were causing blank pages before the CV. */
@media print {
  @page {
    size: A4 portrait;
    margin: 0;
  }

  html,
  body {
    width: 210mm !important;
    min-width: 210mm !important;
    margin: 0 !important;
    padding: 0 !important;
    background: #fff !important;
    overflow: visible !important;
  }

  body[data-view="cv"] > * {
    display: none !important;
  }

  body[data-view="cv"] > #cvView {
    display: block !important;
    position: static !important;
    width: 210mm !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    background: #fff !important;
  }

  body[data-view="cv"] #cvView .cv-page-shell,
  body[data-view="cv"] #cvView .cv-workspace,
  body[data-view="cv"] #cvView .cv-preview-shell,
  body[data-view="cv"] #cvView .cv-paper-wrap {
    display: block !important;
    position: static !important;
    width: 210mm !important;
    max-width: none !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: visible !important;
    border: 0 !important;
    background: #fff !important;
    box-shadow: none !important;
  }

  body[data-view="cv"] #cvView .cv-page-head,
  body[data-view="cv"] #cvView .cv-toolbar,
  body[data-view="cv"] #cvView .cv-editor,
  body[data-view="cv"] #cvView .cv-preview-head {
    display: none !important;
  }

  body[data-view="cv"] #cvView #cvPreview {
    display: block !important;
    position: static !important;
    width: 210mm !important;
    min-height: 297mm !important;
    height: auto !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 16mm 15mm !important;
    box-sizing: border-box !important;
    overflow: visible !important;
    background: #fff !important;
    box-shadow: none !important;
    break-inside: auto;
  }

  body[data-view="cv"] #cvView .cv-paper-section,
  body[data-view="cv"] #cvView .cv-entry {
    break-inside: avoid;
  }
}


/* ============================================================
   CV V1.1 — INPUT BOUNDS, AUTO FORMAT & PRINT
   ============================================================ */
.cv-auto-format-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--soft);
  color: var(--text);
  font-size: .62rem;
  font-weight: 800;
  white-space: nowrap;
}

.cv-auto-format-toggle input {
  margin: 0;
  accent-color: var(--blue);
}

.cv-rich-paragraph {
  margin: 0 0 6px;
  text-align: justify;
  text-justify: inter-word;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.cv-rich-list {
  display: grid;
  gap: 4px;
  margin: 5px 0 8px;
  padding: 0;
  text-align: left;
}

.cv-rich-list-item {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  column-gap: 3px;
  align-items: start;
  width: 100%;
  margin: 0;
}

.cv-rich-marker {
  width: 24px;
  color: inherit;
  text-align: right;
  white-space: nowrap;
}

.cv-rich-list-content {
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
  text-align: justify;
  text-justify: inter-word;
}

.cv-rich-list-content::after {
  content: '';
}

.cv-rich-unordered .cv-rich-list-item {
  grid-template-columns: 14px minmax(0, 1fr);
}

.cv-rich-unordered .cv-rich-marker {
  width: 14px;
  text-align: left;
}

.cv-paper-section li {
  text-align: left;
}


.cv-paper,
.cv-paper * {
  max-width: 100%;
  box-sizing: border-box;
}

.cv-paper .cv-entry,
.cv-paper .cv-entry-sub,
.cv-paper .cv-entry-link,
.cv-paper p,
.cv-paper li,
.cv-paper strong,
.cv-paper span {
  overflow-wrap: anywhere;
  word-break: break-word;
}

.cv-repeat-field textarea {
  min-height: 96px;
  max-height: 260px;
  overflow-y: auto;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.cv-form-section > textarea {
  min-height: 120px;
  max-height: 280px;
  overflow-y: auto;
  overflow-wrap: anywhere;
  word-break: break-word;
}

@media (max-width: 700px) {
  .cv-auto-format-toggle {
    width: 100%;
    justify-content: center;
  }
}

/* Final print override: cvView lives inside main > content, not directly under body. */
@media print {
  @page {
    size: A4 portrait;
    margin: 0;
  }

  html,
  body {
    width: 210mm !important;
    min-width: 210mm !important;
    margin: 0 !important;
    padding: 0 !important;
    background: #fff !important;
    overflow: visible !important;
  }

  body[data-view="cv"] .sidebar,
  body[data-view="cv"] .sidebar-overlay,
  body[data-view="cv"] .topbar,
  body[data-view="cv"] .cv-page-head,
  body[data-view="cv"] .cv-toolbar,
  body[data-view="cv"] .cv-editor,
  body[data-view="cv"] .cv-preview-head,
  body[data-view="cv"] .floating-widget,
  body[data-view="cv"] .toast-root {
    display: none !important;
  }

  body[data-view="cv"] .main,
  body[data-view="cv"] .content,
  body[data-view="cv"] #cvView,
  body[data-view="cv"] #cvView .cv-page-shell,
  body[data-view="cv"] #cvView .cv-workspace,
  body[data-view="cv"] #cvView .cv-preview-shell,
  body[data-view="cv"] #cvView .cv-paper-wrap {
    display: block !important;
    position: static !important;
    width: 210mm !important;
    max-width: none !important;
    min-width: 0 !important;
    min-height: 0 !important;
    height: auto !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: visible !important;
    border: 0 !important;
    background: #fff !important;
    box-shadow: none !important;
  }

  body[data-view="cv"] .content > .screen:not(#cvView) {
    display: none !important;
  }

  body[data-view="cv"] #cvView #cvPreview {
    display: block !important;
    position: static !important;
    width: 210mm !important;
    max-width: none !important;
    min-width: 0 !important;
    min-height: 0 !important;
    height: auto !important;
    margin: 0 !important;
    padding: 38px !important;
    box-sizing: border-box !important;
    overflow: visible !important;
    background: #fff !important;
    box-shadow: none !important;
  }

  body[data-view="cv"] #cvView .cv-paper-section,
  body[data-view="cv"] #cvView .cv-entry {
    break-inside: auto;
    page-break-inside: auto;
  }

  body[data-view="cv"] #cvView .cv-rich-list-item {
    break-inside: avoid;
    page-break-inside: avoid;
  }
}


/* Screen preview: fit the A4 paper into the available preview pane.
   Print mode below restores the true 210mm A4 canvas. */
@media screen {
  .cv-preview-shell {
    min-height: 0;
  }

  .cv-preview-shell .cv-paper-wrap {
    height: min(78vh, 920px);
    min-height: 420px;
    overflow-y: auto;
    overflow-x: hidden;
    align-items: flex-start;
    scrollbar-width: thin;
    scroll-behavior: smooth;
  }

  .cv-preview-shell .cv-paper {
    width: min(210mm, 100%);
    min-width: 0;
    max-width: 100%;
    min-height: 297mm;
    height: auto;
    margin: 0 auto;
    padding: clamp(18px, 3vw, 38px);
    overflow: visible;
  }

  .cv-preview-shell .cv-paper-section,
  .cv-preview-shell .cv-entry {
    break-inside: avoid;
  }

  .cv-preview-shell .cv-paper-identity h1 {
    font-size: clamp(18px, 2vw, 22pt);
  }
}


@media screen and (max-width: 1180px) {
  .cv-preview-shell .cv-paper-wrap {
    height: min(72vh, 760px);
    min-height: 360px;
  }
}

@media screen and (max-width: 700px) {
  .cv-preview-shell .cv-paper-wrap {
    height: 68vh;
    min-height: 320px;
  }

  .cv-preview-shell .cv-paper {
    min-width: 210mm;
    width: 210mm;
    max-width: none;
    min-height: 297mm;
  }
}


/* ============================================================
   CV PRINT — FINAL VISIBILITY OVERRIDE
   Must override the legacy result-print fallback in base.css.
   ============================================================ */
@media print {
  body[data-view="cv"],
  body[data-view="cv"] #cvView,
  body[data-view="cv"] #cvView * {
    visibility: visible !important;
  }

  body[data-view="cv"] .app-layout {
    display: grid !important;
    visibility: visible !important;
  }

  body[data-view="cv"] .main,
  body[data-view="cv"] .content,
  body[data-view="cv"] #cvView,
  body[data-view="cv"] #cvPreview {
    visibility: visible !important;
  }

  /* Everything outside the CV remains removed from print layout. */
  body[data-view="cv"] .sidebar,
  body[data-view="cv"] .sidebar-overlay,
  body[data-view="cv"] .topbar,
  body[data-view="cv"] .cv-page-head,
  body[data-view="cv"] .cv-toolbar,
  body[data-view="cv"] .cv-editor,
  body[data-view="cv"] .cv-preview-head {
    display: none !important;
  }
}


/* ============================================================
   CV PRINT — PAGE GUTTER / RUNNING PAGE SPACING
   Apply real @page margins so every printed A4 page gets
   the same breathing room, including page 2+.
   ============================================================ */
@media print {
  @page {
    size: A4 portrait;
    margin: 18mm 15mm 16mm 15mm;
  }

  html,
  body {
    width: auto !important;
    min-width: 0 !important;
  }

  body[data-view="cv"] .main,
  body[data-view="cv"] .content,
  body[data-view="cv"] #cvView,
  body[data-view="cv"] #cvView .cv-page-shell,
  body[data-view="cv"] #cvView .cv-workspace,
  body[data-view="cv"] #cvView .cv-preview-shell,
  body[data-view="cv"] #cvView .cv-paper-wrap {
    width: 100% !important;
    max-width: none !important;
  }

  body[data-view="cv"] #cvView #cvPreview {
    width: 100% !important;
    min-width: 0 !important;
    min-height: 0 !important;
    height: auto !important;
    margin: 0 !important;
    padding: 0 !important;
    box-sizing: border-box !important;
  }
}


/* CV ongoing-status controls + full-date fields */
.cv-ongoing-toggle {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-top: 10px;
  color: var(--text);
  font-size: .66rem;
  font-weight: 800;
  cursor: pointer;
}

.cv-ongoing-toggle input {
  width: 15px;
  height: 15px;
  margin: 0;
  accent-color: var(--blue);
}

.cv-repeat-field input[type="date"] {
  min-height: 38px;
  color-scheme: light;
}

.cv-repeat-field input[type="date"]:disabled {
  background: var(--soft);
  color: var(--soft-text);
  cursor: not-allowed;
  opacity: .75;
}

/* ============================================================
   ADMIN QUESTION BULK ACTIONS
   ============================================================ */
.admin-question-table-head { gap: 12px; align-items: center; }
.admin-question-bulk-actions { display: flex; align-items: center; justify-content: flex-end; gap: 9px; flex-wrap: wrap; }
.admin-question-select-all {
  display: inline-flex; align-items: center; gap: 7px; min-height: 34px; padding: 0 9px;
  border: 1px solid var(--line); border-radius: 8px; background: var(--soft); color: var(--text);
  font-size: .64rem; font-weight: 800; cursor: pointer; user-select: none;
}
.admin-question-select-all input, .admin-question-check { width: 15px; height: 15px; margin: 0; accent-color: var(--blue); }
.admin-question-check-col { width: 38px; text-align: center; }
@media (max-width: 700px) {
  .admin-question-table-head, .admin-question-bulk-actions { align-items: stretch; flex-direction: column; }
  .admin-question-bulk-actions > * { width: 100%; }
  .admin-question-select-all { justify-content: center; }
}
