@charset "UTF-8";

/* IEGrinds learner design — Task 5.7
   Cards only for self-contained objects. Green is brand/action, not wallpaper. */

:root{
  --ieg-bg: #f3f2eb;
  --ieg-surface: #ffffff;
  --ieg-surface-soft: #f7f6f1;
  --ieg-header: #046146;
  --ieg-header-hover: #057a58;
  --ieg-header-text: #ffffff;
  --ieg-header-muted: rgba(255, 255, 255, 0.72);
  --ieg-header-2: #0f1b16;

  --ieg-green: #15964a;
  --ieg-green-hover: #0f843f;

  --ieg-text: #1a1f24;
  --ieg-text-secondary: #3a4148;
  --ieg-text-muted: #5c6570;
  --ieg-text-inv: #f6f4ee;

  --ieg-primary: #157a32;
  --ieg-primary-hover: #0f5c26;
  --ieg-primary-soft: #e8f4ea;
  --ieg-brand: var(--ieg-primary);

  --ieg-success: #157a32;
  --ieg-success-soft: #e8f4ea;
  --ieg-warning: #8a6d00;
  --ieg-warning-soft: #f8f1d6;
  --ieg-danger: #9b2c1f;
  --ieg-danger-soft: #f8ece9;
  --ieg-info: #2a3d5c;
  --ieg-info-soft: #eef1f6;

  --ieg-border: #e6e2d8;
  --ieg-border-strong: #d4cfc4;

  --ieg-radius-sm: 8px;
  --ieg-radius-md: 12px;
  --ieg-radius-lg: 16px;
  --ieg-radius: var(--ieg-radius-md);
  --ieg-radius-pill: 999px;

  --ieg-shadow-sm: 0 1px 2px rgba(26, 31, 36, .04);
  --ieg-shadow-md: 0 8px 24px rgba(26, 31, 36, .06);
  --ieg-shadow: var(--ieg-shadow-sm);

  --ieg-space-1: 4px;
  --ieg-space-2: 8px;
  --ieg-space-3: 12px;
  --ieg-space-4: 16px;
  --ieg-space-5: 24px;
  --ieg-space-6: 32px;

  --ieg-text-xs: .8125rem;
  --ieg-text-sm: .875rem;
  --ieg-text-md: 1rem;
  --ieg-text-lg: 1.125rem;
  --ieg-text-xl: 1.75rem;
  --ieg-text-2xl: 2rem;
  --ieg-lh: 1.6;
  --ieg-lh-tight: 1.2;
  --ieg-btn-h: 42px;
  --ieg-input-h: 42px;
  --ieg-content: 76rem;
  --ieg-read: 48rem;
  --ieg-qwork: 57.5rem;
  --ieg-focus: 0 0 0 3px rgba(21, 122, 50, .28);
  --ieg-ease: 180ms ease;
}

body{
  background: var(--ieg-bg) !important;
  color: var(--ieg-text);
}
body::before{ opacity: 0; pointer-events: none; }

/* ========== Header ========== */
body > header{
  background: var(--ieg-header) !important;
  backdrop-filter: none !important;
}
#header{ min-height: 3.75rem; max-width: var(--ieg-content); }
.header-row{
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
}
#logo, #logo span{ color: #fff !important; }
.learn-context{ display: flex; flex-wrap: wrap; gap: 6px; }
nav #top-nav{
  display: flex;
  align-items: center;
  gap: 2px;
  list-style: none;
}
nav #top-nav li a{
  color: #dce6df !important;
  text-transform: none;
  letter-spacing: 0;
  font-weight: 650;
  padding: 8px 11px;
  border-radius: 8px;
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  transition: background var(--ieg-ease), color var(--ieg-ease);
}
nav #top-nav li a:hover{ background: rgba(255,255,255,.08); color: #fff !important; }
nav #top-nav li a.active{
  background: transparent;
  color: #fff !important;
  box-shadow: inset 0 -2px 0 #3dba5f;
  font-weight: 800;
}
.ieg-head-utils{
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}
.ieg-iconbtn{
  width: 36px; height: 36px;
  border: 0; background: rgba(255,255,255,.08);
  color: #fff; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: background var(--ieg-ease);
}
.ieg-iconbtn:hover{ background: rgba(255,255,255,.16); }
.ieg-iconbtn:focus-visible{
  outline: 2px solid #fff;
  outline-offset: 2px;
}
.ieg-prof{
  display: flex;
  align-items: center;
  gap: 10px;
}
.ieg-prof__link{
  display: flex; align-items: center; gap: 8px;
  color: #fff; text-decoration: none;
  min-height: 36px; padding: 2px 4px;
  border-radius: 8px;
}
.ieg-prof__link:hover{ color: #fff; background: rgba(255,255,255,.08); }
.ieg-prof__link:focus-visible{
  outline: 2px solid #fff;
  outline-offset: 2px;
}
.ieg-avatar{
  width: 32px; height: 32px; border-radius: 50%;
  background: #2f6f45; color: #fff; font-weight: 800;
  display: grid; place-items: center; font-size: 12px;
  flex: 0 0 auto;
  overflow: hidden;
}
.ieg-avatar img{
  width: 100%; height: 100%; object-fit: cover; display: block;
  border-radius: 50%;
}
.ieg-avatar--lg{
  width: 72px; height: 72px; font-size: 1.35rem; background: #1f4d38;
}
.ieg-prof__name{ font-weight: 700; max-width: 8rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ieg-prof__sep{
  width: 1px; height: 18px;
  background: rgba(255,255,255,.28);
  flex: 0 0 auto;
}
#profile .ieg-prof .logmeout{
  display: inline-flex !important;
  width: 36px; height: 36px;
  margin: 0; padding: 0;
  background: rgba(255,255,255,.08) !important;
  box-shadow: none;
  border-radius: 50%;
}
#profile .ieg-prof .logmeout:hover{ background: rgba(255,255,255,.16) !important; }
#profile .points-chip, #top-nav-desktop{ display: none !important; }

/* ========== Shell ========== */
#wrapper{
  max-width: var(--ieg-content);
  background: transparent;
}
#wrapper > section, .layout-content, #content-wrap{
  background: transparent !important;
  border-radius: 0;
}
.ieg-page{ width: 100%; max-width: var(--ieg-content); margin: 0 auto; padding: 20px 0 48px; }
.ieg-read{ max-width: var(--ieg-read); margin: 0 auto; }
.ieg-qwork, .tp-app{ max-width: var(--ieg-qwork); margin: 0 auto; }
.layout-sidebar, #wrapper > aside{ display: none !important; }
.nt_index, .tp-toolbar, .tools-head{ display: none !important; }

/* ========== Shared forms → see forms.css (IEGrinds form system) ========== */

/* ========== Typography ========== */
.ieg-kicker{
  margin: 0 0 6px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--ieg-text-muted);
}
.ieg-display{ margin: 0 0 22px; }
.ieg-display h1{
  margin: 0;
  font-size: clamp(1.7rem, 2.4vw, 2.05rem);
  font-weight: 800;
  letter-spacing: -.03em;
  line-height: var(--ieg-lh-tight);
  color: var(--ieg-text);
  text-align: left;
}
.ieg-section, .ieg-subhead{
  margin: 28px 0 12px;
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--ieg-text-muted);
  text-align: left;
}
.ieg-meta{
  margin: 6px 0 0;
  font-size: var(--ieg-text-sm);
  font-weight: 650;
  color: var(--ieg-text-secondary);
}
.ieg-lead{
  margin: 8px 0 0;
  color: var(--ieg-text-secondary);
  max-width: 40rem;
  line-height: 1.55;
  font-size: 1.02rem;
}
.ieg-ph{
  display: flex; align-items: flex-start; gap: 14px;
  margin: 0 0 20px;
}
.ieg-ph__icon{
  width: 40px; height: 40px; border-radius: 12px;
  background: var(--ieg-primary-soft); color: var(--ieg-primary);
  display: grid; place-items: center; font-size: 1rem; flex: 0 0 auto;
}
.ieg-ph__text h1{
  margin: 0; font-size: var(--ieg-text-xl); font-weight: 800;
  color: var(--ieg-text); text-align: left; letter-spacing: -.02em;
}
.ieg-ph__text p{ margin: 4px 0 0; color: var(--ieg-text-secondary); }

/* ========== Buttons ========== */
.btn{
  height: var(--ieg-btn-h); min-height: var(--ieg-btn-h);
  padding: 0 16px; border-radius: 10px;
  font-weight: 750; font-size: var(--ieg-text-sm);
  background: var(--ieg-surface); color: var(--ieg-text) !important;
  border: 1px solid var(--ieg-border-strong); box-shadow: none;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  transition: background var(--ieg-ease), border-color var(--ieg-ease), transform var(--ieg-ease);
}
.btn:hover{ background: var(--ieg-surface-soft); transform: none; filter: none; }
.btn:active{ transform: translateY(1px); }
.btn:focus-visible{ outline: none; box-shadow: var(--ieg-focus); }
.btn-green, .btn-primary{
  background: var(--ieg-primary); border-color: var(--ieg-primary); color: #fff !important;
}
.btn-green:hover, .btn-primary:hover{ background: var(--ieg-primary-hover); color: #fff !important; }
.btn-ghost{ background: transparent; }
.btn-danger, .btn-red{ background: var(--ieg-danger-soft); color: var(--ieg-danger) !important; border-color: #f0c8c2; }
.btn-text, .ieg-link{
  background: transparent; border-color: transparent; color: var(--ieg-primary) !important;
  height: auto; min-height: 36px; padding: 0; font-weight: 750;
}
.ieg-link{ display: inline-flex; align-items: center; }
.btn.is-loading,
.ieg-btn.is-loading,
.mx-finish-bar.is-loading,
.mx-tool-btn.is-loading,
.mx-nav-btn.is-loading,
button.is-loading,
a.btn.is-loading,
a.ieg-btn.is-loading{
  position: relative;
  pointer-events: none;
  color: transparent !important;
  -webkit-text-fill-color: transparent;
}
.btn.is-loading > *,
.ieg-btn.is-loading > *,
.mx-finish-bar.is-loading > *,
.mx-tool-btn.is-loading > *,
.mx-nav-btn.is-loading > *,
button.is-loading > *,
a.btn.is-loading > *,
a.ieg-btn.is-loading > *{
  visibility: hidden;
}
.btn.is-loading::after,
.ieg-btn.is-loading::after,
.mx-finish-bar.is-loading::after,
.mx-tool-btn.is-loading::after,
.mx-nav-btn.is-loading::after,
button.is-loading::after,
a.btn.is-loading::after,
a.ieg-btn.is-loading::after{
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 16px;
  height: 16px;
  margin: -8px 0 0 -8px;
  box-sizing: border-box;
  border: 2px solid rgba(13, 126, 60, .22);
  border-top-color: #0d7e3c;
  border-radius: 50%;
  animation: ieg-spin .7s linear infinite;
}
.btn-green.is-loading::after,
.btn-primary.is-loading::after,
.ieg-btn-primary.is-loading::after{
  border-color: rgba(255,255,255,.35);
  border-top-color: #fff;
}
@keyframes ieg-spin{ to{ transform: rotate(360deg); } }
.ieg-actions{ display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }

/* ========== Forms ========== */
.ieg-search, .nt-searchform, .signup-form input, .signup-form select,
.mx-custom input, .mx-custom select, .ieg-input{
  min-height: var(--ieg-input-h);
  border: 1px solid var(--ieg-border);
  border-radius: 10px;
  padding: 0 12px; background: #fff; font-size: 16px; color: var(--ieg-text);
}
.ieg-search{ display: flex; gap: 8px; flex: 1; min-width: 180px; background: #fff; align-items: center; }
.ieg-search input{ flex: 1; border: 0; min-height: 40px; box-shadow: none; }
.ieg-toolbar{
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
  margin: 8px 0 20px; padding: 8px; background: var(--ieg-surface-soft); border-radius: 14px;
}
.ieg-field, .signup-form label, .mx-custom label{
  display: flex; flex-direction: column; gap: 6px; font-weight: 700; font-size: var(--ieg-text-sm);
}
input:focus, select:focus, textarea:focus{ outline: none; box-shadow: var(--ieg-focus); border-color: var(--ieg-primary); }
.ieg-pass{ position: relative; }
.ieg-pass input{ padding-right: 48px; width: 100%; }
.ieg-pass-toggle{ position: absolute; right: 6px; top: 50%; transform: translateY(-50%); border: 0; background: none; cursor: pointer; }

/* ========== Shared objects ========== */
.ieg-card{
  background: var(--ieg-surface);
  border: 0;
  border-radius: var(--ieg-radius-lg);
  box-shadow: var(--ieg-shadow-sm);
}
header.ieg-card__head, .ieg-card__head{
  background: transparent; position: static; backdrop-filter: none;
  padding: 14px 16px 0; font-weight: 800; color: var(--ieg-text); text-align: left;
}
.ieg-card__body{ padding: 14px 16px 16px; }
.ieg-stats{ display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 12px; margin: 0 0 8px; }
.ieg-stat{
  display: flex; gap: 12px; align-items: flex-start;
  background: var(--ieg-surface-soft); border: 0;
  border-radius: 12px; padding: 12px 14px;
}
.ieg-stat__ico{
  width: 36px; height: 36px; border-radius: 10px;
  background: var(--ieg-primary-soft); color: var(--ieg-primary);
  display: grid; place-items: center;
}
.ieg-stat__k{ display: block; color: var(--ieg-text-muted); font-size: 12px; font-weight: 700; }
.ieg-stat__v{ display: block; color: var(--ieg-text); font-size: 1.35rem; line-height: 1.1; }
.ieg-stat__m{ display: block; color: var(--ieg-text-muted); font-size: 12px; margin-top: 2px; }
.ieg-figures{
  display: flex; flex-wrap: wrap; gap: 28px;
  margin: 0 0 18px; padding-bottom: 4px;
}
.ieg-figures span{ display: block; font-size: 1.45rem; font-weight: 800; letter-spacing: -.02em; color: var(--ieg-text); }
.ieg-figures em{ display: block; font-style: normal; font-size: 12px; font-weight: 700; color: var(--ieg-text-muted); margin-top: 2px; }
.ieg-progress{ display: flex; flex-direction: column; gap: 6px; }
.ieg-progress__track{ display: block; height: 6px; border-radius: 999px; background: #e6e2d8; overflow: hidden; }
.ieg-progress__bar{ display: block; height: 100%; background: var(--ieg-primary); transition: width var(--ieg-ease); }
.ieg-badge{
  display: inline-flex; align-items: center; padding: 2px 8px;
  border-radius: 999px; font-size: 12px; font-weight: 750;
}
.ieg-badge--trade{ background: rgba(255,255,255,.12); color: #e8f3ec; }
.ieg-badge--phase{ background: rgba(255,214,102,.16); color: #f3e3a6; }
.ieg-badge--ok, .ieg-badge--completed{ background: var(--ieg-success-soft); color: var(--ieg-success); }
.ieg-badge--progress{ background: var(--ieg-warning-soft); color: var(--ieg-warning); }
.ieg-badge--weak, .ieg-badge--review{ background: var(--ieg-danger-soft); color: var(--ieg-danger); }
.ieg-chips{ display: flex; flex-wrap: wrap; gap: 6px; }
.ieg-chip{
  min-height: 34px; padding: 6px 12px; border-radius: 999px;
  border: 0; background: #fff; color: var(--ieg-text);
  font-weight: 700; font-size: 13px;
  transition: background var(--ieg-ease), color var(--ieg-ease);
}
.ieg-chip.is-on{ background: var(--ieg-primary); color: #fff; }
.ieg-choices{ display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 16px; }
.ieg-choice{
  min-height: 42px; padding: 8px 14px; border-radius: 10px;
  border: 1px solid var(--ieg-border); background: #fff; font-weight: 700; cursor: pointer;
  transition: border-color var(--ieg-ease), background var(--ieg-ease);
}
.ieg-choice.is-on{ border-color: var(--ieg-primary); background: var(--ieg-primary-soft); }
.ieg-empty{
  padding: 28px 24px;
  border: 1px solid var(--ieg-border);
  border-radius: 14px;
  background: var(--ieg-surface);
  box-shadow: var(--ieg-shadow-sm, 0 2px 8px rgba(16, 40, 28, 0.05));
}
.ieg-empty h3{
  margin: 0 0 8px;
  color: var(--ieg-text);
  text-align: left;
  font-size: var(--ieg-text-xl);
  font-weight: 800;
  letter-spacing: -.02em;
  line-height: 1.2;
}
.ieg-empty p{
  margin: 0;
  color: var(--ieg-text-secondary);
  font-size: 1rem;
  line-height: 1.5;
}
.ieg-empty .btn{ margin-top: 14px; }
.ieg-banner{ padding: 10px 0; font-weight: 700; color: var(--ieg-primary); }
.ieg-toast-host{ position: fixed; right: 12px; bottom: 16px; z-index: 80; display: flex; flex-direction: column; gap: 8px; }
.ieg-toast{
  min-width: 200px; padding: 12px 14px; border-radius: 12px;
  background: var(--ieg-header); color: #fff; font-weight: 650;
  animation: ieg-toast-in 180ms ease;
}
.ieg-toast.is-error{ background: var(--ieg-danger); }
@keyframes ieg-toast-in{ from{ opacity: 0; transform: translateY(6px); } to{ opacity: 1; transform: none; } }

/* ========== Home (legacy continue panels shared with Training) ========== */
.hm-continue, .tp-continue{
  display: block; margin: 8px 0 20px; padding: 18px 0 8px;
  color: inherit; text-decoration: none;
  border-top: 2px solid var(--ieg-primary);
}
.hm-continue:hover, .tp-continue:hover{ color: inherit; }
.hm-continue h2, .tp-continue h2, .mx-panel h2{
  margin: 0; font-size: 1.45rem; letter-spacing: -.02em; color: var(--ieg-text); text-align: left;
}
.hm-continue .btn, .tp-continue .btn{ margin-top: 14px; width: auto; }
.hm-continue.is-other, .tp-continue.is-other{ border-top-color: #c9b27a; }

/* ========== Notes hub ========== */
.nt-topics{
  display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 18px 22px;
}
.nt-topic{
  display: flex; flex-direction: column; gap: 8px;
  padding: 4px 0 12px;
  background: transparent; border: 0;
  color: var(--ieg-text); text-decoration: none;
  min-height: 0;
  box-shadow: none;
  transition: transform var(--ieg-ease);
}
.nt-topic:hover{ color: var(--ieg-text); transform: translateY(-1px); }
.nt-topic__top{ display: flex; gap: 10px; align-items: flex-start; }
.nt-topic__ico{
  width: 34px; height: 34px; border-radius: 10px;
  background: var(--ieg-surface-soft); color: var(--ieg-text-secondary);
  display: grid; place-items: center; flex: 0 0 auto;
}
.nt-topic[data-tone="a"] .nt-topic__ico{ background: #e8f0ea; color: #1f4d38; }
.nt-topic[data-tone="b"] .nt-topic__ico{ background: #eef1f6; color: #2a3d5c; }
.nt-topic[data-tone="c"] .nt-topic__ico{ background: #f4efe4; color: #5a4630; }
.nt-topic[data-tone="d"] .nt-topic__ico{ background: #f1ece8; color: #4a3830; }
.nt-topic[data-tone="e"] .nt-topic__ico{ background: #e9eef2; color: #31424f; }
.nt-topic strong{ display: block; font-size: 1.05rem; line-height: 1.3; letter-spacing: -.01em; }
.nt-topic__n{ margin: 0; font-size: 13px; font-weight: 700; color: var(--ieg-text-secondary); }
.nt-topic__go{ font-weight: 750; color: var(--ieg-primary); font-size: 13px; margin-top: 2px; }
.nt-empty-phase{ max-width: 36rem; }
.nt-row{
  display: grid; grid-template-columns: 40px 1fr auto; gap: 12px;
  padding: 14px 0; box-shadow: inset 0 -1px 0 #eeeae2; color: inherit; text-decoration: none;
  align-items: start;
}
.nt-row:hover{ color: inherit; }
.nt-num{ font-weight: 800; color: var(--ieg-text-muted); }
.nt-row strong{ display: block; }
.nt-ex{ color: var(--ieg-text-secondary); font-size: 14px; }
.nt-read{ max-width: var(--ieg-read); padding: 8px 4px 40px; }
.nt-read h1{ font-size: 1.7rem; line-height: 1.25; margin: 8px 0 12px; color: var(--ieg-text); letter-spacing: -.02em; }
.nt-article{ font-size: 1.0625rem; line-height: 1.7; }
.nt-article h2, .nt-article h3{ color: var(--ieg-text); font-weight: 800; text-align: left; }
.nt-article table{ display: block; max-width: 100%; overflow-x: auto; }
.nt-article img{ max-width: 100%; height: auto; border-radius: 10px; }
.nt-callout, .nt-important, .nt-warning, .nt-example, .nt-formula, .nt-tip, .nt-key{
  margin: 14px 0; padding: 12px 14px; border-radius: 12px; border-left: 4px solid var(--ieg-primary); background: var(--ieg-primary-soft);
}
.nt-warning{ border-left-color: var(--ieg-danger); background: var(--ieg-danger-soft); }
.nt-crumb{ color: var(--ieg-text-muted); font-size: 13px; }
.nt-practice{ margin-top: 28px; padding: 16px 0; }

/* ========== Training question ========== */
.tp-qhead{
  display: flex; justify-content: space-between; align-items: flex-end; gap: 16px;
  margin-bottom: 10px;
}
.tp-qhead h1{ margin: 0; font-size: 1.35rem; letter-spacing: -.02em; text-align: left; }
.tp-qcount{ font-weight: 800; color: var(--ieg-text-secondary); margin: 0; }
.tp-stem{
  font-size: clamp(1.35rem, 2vw, 1.6rem);
  font-weight: 750;
  line-height: 1.4;
  letter-spacing: -.02em;
  color: var(--ieg-text);
  margin: 4px 0 18px;
}
.tp-options{ display: flex; flex-direction: column; gap: 8px; }
.tp-opt, .mx-opt{
  min-height: 56px; border-radius: 12px;
  border: 0; padding: 12px 14px;
  display: flex; align-items: center; gap: 12px;
  background: #fff;
  cursor: pointer;
  transition: background var(--ieg-ease), box-shadow var(--ieg-ease);
}
.tp-opt:hover, .mx-opt:hover{ background: #faf8f3; }
.tp-opt:has(input:checked), .mx-opt:has(input:checked){
  background: var(--ieg-primary-soft);
  box-shadow: inset 0 0 0 2px var(--ieg-primary);
}
.tp-opt__key{
  width: 28px; flex: 0 0 28px;
  font-weight: 800; color: var(--ieg-text-muted);
}
.tp-opt__text{ flex: 1; font-weight: 650; font-size: 1.02rem; }
.tp-qfoot{
  display: flex; justify-content: space-between; align-items: center;
  gap: 12px; margin-top: 20px; flex-wrap: wrap;
}
.tp-hint{ margin-top: 12px; padding: 12px 0; color: var(--ieg-text-secondary); }
.tp-hint.hidden, .hidden{ display: none !important; }
.tp-fb{ border-radius: 12px; padding: 14px 0; margin-top: 16px; }
.tp-fb.is-ok, .tp-fb.is-bad{ background: transparent; border: 0; color: var(--ieg-text); }
.tp-bar{ display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 8px; font-weight: 750; }
.tp-loading, .mx-loading{ padding: 24px; color: var(--ieg-text-muted); }
/* Legacy plain loading text — prefer .ieg-skeleton */
.tp-modes--primary{ }
.tp-mode, .mx-mode{
  border: 0; background: transparent; padding: 12px 0;
}

/* ========== Mock hub ========== */
.mx-panel{
  display: block; padding: 16px 0 20px;
  color: inherit; text-decoration: none;
  box-shadow: inset 0 1px 0 var(--ieg-border);
}
.mx-panel:hover{ color: inherit; }
.mx-panel--full{ border: 0; box-shadow: none; padding-top: 4px; }
.mx-panel--quiet{ display: flex; justify-content: space-between; align-items: baseline; gap: 16px; }
.mx-inline{ display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 8px; }
.mx-inline .ieg-input{ min-width: 14rem; }
.mx-histhead{ display: flex; justify-content: space-between; align-items: baseline; }
.mx-htable{ display: flex; flex-direction: column; }
.mx-hrow{
  display: grid; grid-template-columns: 4.5rem 1fr 4rem 4rem 3rem;
  gap: 10px; align-items: center;
  padding: 10px 0; color: inherit; text-decoration: none; font-weight: 650;
  box-shadow: inset 0 -1px 0 var(--ieg-border);
  transition: background var(--ieg-ease);
}
.mx-hrow:hover{ color: inherit; background: rgba(255,255,255,.45); }
.mx-hrow--head{
  font-size: 11px; letter-spacing: .06em; text-transform: uppercase;
  color: var(--ieg-text-muted); font-weight: 800; box-shadow: inset 0 -1px 0 var(--ieg-border-strong);
}
.mx-hrow .is-pass{ color: var(--ieg-success); }
.mx-hrow .is-fail{ color: var(--ieg-danger); }
.mx-banner{
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  margin-top: 28px; padding: 14px 0; color: inherit; text-decoration: none;
  box-shadow: inset 0 1px 0 var(--ieg-border);
}
.mx-banner em{ display: block; font-style: normal; color: var(--ieg-text-muted); font-weight: 500; }
.mx-banner:hover{ color: inherit; }
.mx-timer{
  background: var(--ieg-surface-soft); color: var(--ieg-text);
  font-weight: 800; padding: 8px 12px; border-radius: 10px;
}
.mx-timer.is-urgent{ background: var(--ieg-danger-soft); color: var(--ieg-danger); }
.mx-nav__i{ min-width: 40px; min-height: 40px; border-radius: 10px; border: 0; background: #fff; font-weight: 750; }
.mx-nav__i.is-on{ outline: 2px solid var(--ieg-primary); }
.mx-nav__i.is-done{ box-shadow: inset 0 -3px 0 var(--ieg-primary); }
.mx-nav__i.is-flag{ outline: 1px dashed var(--ieg-warning); }
.mx-nav__i.is-flag::after{ content: "⚑"; margin-left: 2px; }
.mx-pf{ font-size: 1.75rem; font-weight: 800; margin: 0; }
.mx-pf.is-pass{ color: var(--ieg-success); }
.mx-pf.is-merit{ color: #0b6b8a; }
.mx-pf.is-distinction{ color: #6f56c4; }
.mx-pf.is-fail{ color: var(--ieg-danger); }
.mx-scoreline{ font-size: 1.5rem; font-weight: 800; }
.mx-bar{ display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 10px 0 14px; font-weight: 700; }
.mx-finish-wrap{ text-align: center; margin-top: 16px; }
.mx-modal{
  position: fixed; inset: 0; background: rgba(20, 18, 12, .4); z-index: 70;
  display: grid; place-items: center; padding: 16px;
}
.mx-modal__box{
  background: #fff; border-radius: var(--ieg-radius-lg); padding: 20px;
  max-width: 28rem; width: 100%; box-shadow: var(--ieg-shadow-md);
}

/* ========== Profile ========== */
.profile.ieg-page{
  display: block;
  justify-content: unset;
  padding: 20px 0 48px;
  max-width: var(--ieg-content);
}
.profile .profile-name{ font-size: 1.8rem; }
.pf-hero{ display: flex; align-items: center; gap: 18px; margin: 8px 0 22px; flex-wrap: wrap; }
.pf-avatar img, .pf-avatar .ieg-avatar{ width: 72px; height: 72px; border-radius: 50%; object-fit: cover; }
.pf-hero h1{ margin: 0 0 4px; font-size: 1.8rem; letter-spacing: -.03em; text-align: left; }
.pf-tabs{ display: flex; gap: 18px; margin: 0 0 22px; box-shadow: inset 0 -1px 0 var(--ieg-border); }
.pf-tabs button{
  background: none; border: 0; padding: 10px 0; font-weight: 750; color: var(--ieg-text-muted); cursor: pointer;
  box-shadow: inset 0 -2px 0 transparent;
}
.pf-tabs button.is-on{ color: var(--ieg-text); box-shadow: inset 0 -2px 0 var(--ieg-primary); }
.pf-dl{ display: grid; gap: 12px; max-width: 40rem; margin: 0 0 16px; }
.pf-dl div{ display: grid; grid-template-columns: 8rem 1fr; gap: 16px; align-items: baseline; }
.pf-dl dt{ color: var(--ieg-text-muted); font-size: 13px; font-weight: 700; }
.pf-dl dd{ margin: 0; font-weight: 700; }
.pf-stats{
  display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 16px;
  max-width: 40rem;
}
.pf-stats strong{ display: block; font-size: 1.6rem; letter-spacing: -.03em; }
.pf-stats em{ font-style: normal; color: var(--ieg-text-muted); font-size: 12px; font-weight: 700; }

/* ========== Drawer ========== */
.ieg-drawer-back{
  position: fixed; inset: 0; background: rgba(20,18,12,.35); z-index: 50;
  opacity: 0; pointer-events: none; transition: opacity var(--ieg-ease);
}
.ieg-drawer-back.is-on{ opacity: 1; pointer-events: auto; }
.ieg-drawer{
  position: fixed; top: 0; right: 0; height: 100dvh; width: min(360px, 92vw);
  background: #fff; z-index: 51; transform: translateX(100%);
  transition: transform var(--ieg-ease); box-shadow: var(--ieg-shadow-md);
  display: flex; flex-direction: column;
}
.ieg-drawer.is-on{ transform: none; }
.ieg-drawer__h{
  display: flex; justify-content: space-between; align-items: center;
  padding: 16px; font-weight: 800;
}
.ieg-drawer__b{ overflow: auto; padding: 8px 10px 20px; }
.ieg-drawer a{
  display: flex; justify-content: space-between; gap: 8px;
  padding: 12px 10px; border-radius: 10px; color: var(--ieg-text); font-weight: 650;
}
.ieg-drawer a.is-on, .ieg-drawer a:hover{ background: var(--ieg-surface-soft); }

/* ========== Forum / leftover surfaces ========== */
.cf h1, .cf-titles h1{ font-size: var(--ieg-text-xl) !important; color: var(--ieg-text) !important; text-align: left; }
.cf-btn-green{ background: var(--ieg-primary) !important; }
.cf{ max-width: var(--ieg-content); }
.cf-card{ background: transparent; border: 0; padding: 14px 0; margin: 0; box-shadow: inset 0 -1px 0 var(--ieg-border); }
.cf-card h3{ margin: 4px 0 6px; font-size: 1.05rem; }
.cf-preview{ color: var(--ieg-text-secondary); }
.cf-grid{ display: grid; grid-template-columns: minmax(0,1fr) 280px; gap: 16px; }
.auth-left{ background: linear-gradient(160deg, #0f5c26, #053b2a); }
.auth-left h2, .auth-left p{ color: #f7faf8; }
.auth-primary{
  background: var(--ieg-primary); color: #fff; border: 0; min-height: 44px;
  border-radius: 12px; font-weight: 750; cursor: pointer;
}
.auth-overlay.is-page .auth-close{ display: none; }
.auth-overlay.is-page{ position: static; background: transparent; display: block; }
.page-404{ padding: 40px 8px; }
.tl-tool form, .tl-tool .calc, .tl-tool .ieg-card{ max-width: 32rem; margin-left: auto; margin-right: auto; }
#top-nav-toggle{
  width: 40px; height: 40px; display: none; align-items: center; justify-content: center;
  color: #fff; font-size: 1.25rem; cursor: pointer;
}
.ieg-search i{ color: var(--ieg-text-muted); }
.ieg-cat{
  display: flex; justify-content: space-between; gap: 12px; align-items: center;
  padding: 12px 0; color: inherit; text-decoration: none;
  box-shadow: inset 0 -1px 0 var(--ieg-border);
}
.sr-only{ position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip:rect(0,0,0,0); border:0; }
.cx-form{ max-width: 40rem; }

/* ========== Footer — compact, beats styles.css ========== */
#footer{
  background: var(--ieg-header) !important;
  padding: 0 !important;
  border-top: 0 !important;
  overflow: visible !important;
  margin-top: auto;
}
#footer::before{ display: none !important; }
#footer .footer-inner,
#footer .ieg-foot{
  display: flex !important;
  flex-direction: column;
  gap: 8px;
  padding: 14px 0 16px !important;
  grid-template-columns: unset !important;
  position: relative;
}
.ieg-foot__row{
  display: flex; justify-content: space-between; align-items: center;
  gap: 16px; flex-wrap: wrap;
}
.ieg-foot__brand{ color: #fff !important; font-weight: 800; min-height: auto !important; }
.ieg-foot__nav{ display: flex; flex-wrap: wrap; gap: 6px 16px; }
#footer a{
  color: rgba(255,255,255,.72);
  min-height: auto !important;
  font-size: 13px;
}
#footer a:hover{ color: #fff; }
.ieg-foot__legal{ color: rgba(255,255,255,.5); font-size: 12px; }
.ieg-foot__legal span{ display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
#footer .copyright{ margin: 0; color: rgba(255,255,255,.5); font-size: 12px; }
body.ieg-exam #footer,
body.ieg-focus #footer,
.ieg-exam footer,
.ieg-focus footer{ display: none !important; }
body.ieg-auth header nav, body.ieg-auth .learn-context, body.ieg-auth footer{ display: none !important; }

/* ========== Responsive ========== */
@media (max-width: 1100px){
  .nt-topics{ grid-template-columns: repeat(2, minmax(0,1fr)); }
}
@media (max-width: 1024px){
  #top-nav-toggle{ display: inline-flex; }
  .header-row{ flex-wrap: wrap; }
  .learn-context{ width: 100%; order: 3; }
  nav #top-nav{
    background: var(--ieg-header-2); padding: 10px; gap: 4px;
    max-height: calc(100dvh - 3.5rem); overflow: auto;
  }
  nav #top-nav li a{ width: 100%; }
  nav #top-nav li a.active{ background: var(--ieg-primary); box-shadow: none; }
}
@media (max-width: 900px){
  .cf-grid{ grid-template-columns: 1fr; }
}
@media (max-width: 768px){
  .ieg-stats, .nt-topics, .tp-modes, .mx-modes, .mx-stats, .tp-stats, .pf-stats{ grid-template-columns: 1fr 1fr; }
  .nt-row{ grid-template-columns: 32px 1fr; }
  .nt-row .nt-go{ grid-column: 2; }
  .ieg-prof__name{ display: none; }
  .nt-read{ padding-left: 4px; padding-right: 4px; }
  .pf-dl div{ grid-template-columns: 1fr; gap: 2px; }
  .mx-hrow{ grid-template-columns: 3.5rem 1fr 3rem 3rem; }
  .mx-hrow span:last-child{ display: none; }
  .ieg-drawer{
    top: auto; height: min(86dvh, 640px); width: 100%;
    border-radius: 16px 16px 0 0; transform: translateY(100%);
  }
  .ieg-drawer.is-on{ transform: none; }
  .tp-qfoot{ flex-direction: column; align-items: stretch; }
  .tp-stem{ font-size: 1.25rem; }
}
@media (max-width: 520px){
  .ieg-stats, .nt-topics, .pf-stats{ grid-template-columns: 1fr; }
  .pf-tabs{ overflow: auto; }
  #footer .ieg-foot__row{ flex-direction: column; align-items: flex-start; }
}
@media (max-width: 430px){
  #logo{ font-size: 16px; }
}

/* ========== Notes master visual — scoped, do not leak ========== */
body.nt-ref{
  --ieg-surface: #FFFFFF;
  --ieg-surface-soft: #EAF7EF;
  --ieg-surface-muted: #EEF2F0;
  /* Do not override --ieg-header here — navbar must match Training/Home/Mock. */
  --ieg-primary: #119447;
  --ieg-primary-hover: #0D7E3C;
  --ieg-primary-dark: #0D7E3C;
  --ieg-primary-soft: #EAF7EF;
  --ieg-text: #17221C;
  --ieg-text-strong: #17221C;
  --ieg-text-secondary: #5F6D65;
  --ieg-text-muted: #7B8780;
  --ieg-border: #DDE6E1;
  --ieg-border-strong: #DDE6E1;
  --ieg-success: #20A85A;
  --ieg-success-soft: #EAF8F0;
  --ieg-warning: #B88917;
  --ieg-warning-soft: #FFF5D8;
  --ieg-info: #2D79C7;
  --ieg-info-soft: #EAF3FB;
  --ieg-danger: #D95656;
  --ieg-danger-soft: #FDEEEE;
  --ieg-icon-blue: #2C7AC9;
  --ieg-icon-red: #E85A5A;
  --ieg-icon-yellow: #E8B52A;
  --ieg-icon-green: #28A65A;
  --ieg-icon-teal: #2BA6A1;
  --ieg-icon-purple: #7A63D2;
  --ieg-icon-brown: #9B7A53;
  --ieg-shadow-sm: 0 2px 8px rgba(16, 40, 28, 0.05);
  --ieg-shadow-md: 0 8px 24px rgba(16, 40, 28, 0.07);
  --ieg-shadow-lg: 0 14px 34px rgba(16, 40, 28, 0.10);
  --ieg-radius-sm: 10px;
  --ieg-radius-md: 14px;
  --ieg-radius-lg: 18px;
  --ieg-radius-xl: 22px;
  --ieg-focus: 0 0 0 3px rgba(17, 148, 71, .10);
  --ieg-input-h: 40px;
  --ieg-btn-h: 38px;
  color: var(--ieg-text);
}
body.nt-ref #wrapper{
  width: 100%;
  max-width: var(--ieg-content);
  margin: 0 auto;
  padding: 0;
  gap: 0;
  display: block;
}

/* Shared header/footer sizes come from global kit rules (same as Contact).
   Do not re-size logo/nav/badges/icons under body.nt-ref. */

/* Hero */
body.nt-ref .nt-hero{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  background: #FFFFFF;
  border-radius: 16px;
  box-shadow: 0 6px 20px rgba(20, 48, 33, 0.06);
  padding: 22px 24px;
  min-height: 118px;
  height: auto;
  box-sizing: border-box;
  margin: 0 0 10px;
}
body.nt-ref .nt-hero__text{
  display: flex;
  align-items: center;
  gap: 14px;
}
body.nt-ref .nt-hero__mark{
  width: 48px;
  height: 48px;
  border-radius: 10px;
  background: #EAF4FF;
  color: #2878C7;
  display: grid;
  place-items: center;
  font-size: 22px;
  flex: 0 0 auto;
}
body.nt-ref .nt-hero h1{
  margin: 0;
  font-size: 38px;
  line-height: 1.08;
  font-weight: 800;
  color: #111921;
  text-align: left;
  letter-spacing: -1.35px;
  font-family: inherit;
}
body.nt-ref .nt-hero p{
  margin: 5px 0 0;
  font-size: 14px;
  line-height: 1.4;
  color: var(--ieg-text-secondary);
  max-width: 36rem;
}
body.nt-ref .nt-hero__art{
  position: relative;
  width: 190px;
  height: 82px;
  flex: 0 0 190px;
  border-radius: 12px;
  border: 1px solid #DDE6E1;
  background: linear-gradient(135deg, #EDF9F3 0%, #DDF3E7 100%);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 10px 12px 10px 64px;
  color: #0C6B36;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.35;
  overflow: hidden;
}
body.nt-ref .nt-hero__art span{ display: block; }
body.nt-ref .nt-hero__art::before{
  content: "";
  position: absolute;
  left: 12px;
  top: 13px;
  width: 40px;
  height: 54px;
  background:
    linear-gradient(225deg, #149447 0 11px, transparent 11px) top right / 16px 16px no-repeat,
    #fff;
  border: 1px solid #D6EADF;
  border-radius: 6px;
  box-shadow: 3px 3px 0 rgba(20,148,71,.14);
}
body.nt-ref .nt-hero__art::after{
  content: "";
  position: absolute;
  left: 19px;
  top: 25px;
  width: 26px;
  height: 2px;
  background: #C5E4D2;
  box-shadow: 0 7px 0 #C5E4D2, 0 14px 0 #C5E4D2;
  border-radius: 1px;
}

/* Stats */
body.nt-ref .nt-stats{
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin: 0 0 12px;
}
body.nt-ref .nt-stat{
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: #FFFFFF;
  border-radius: 13px;
  box-shadow: 0 2px 8px rgba(20, 48, 33, 0.045);
  border: 1px solid #DDE6E1;
  padding: 16px 18px;
  height: 92px;
  box-sizing: border-box;
}
body.nt-ref .nt-stat .ieg-kicker{
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .045em;
  text-transform: uppercase;
  color: var(--ieg-text-secondary);
  margin: 0;
}
body.nt-ref .nt-stat strong{
  display: block;
  font-size: 22px;
  font-weight: 750;
  line-height: 1.1;
  color: var(--ieg-text);
  margin: 2px 0 0;
}
body.nt-ref .nt-stat__m{
  margin: 5px 0 0;
  font-size: 13px;
  font-weight: 500;
  color: var(--ieg-text-secondary);
}
body.nt-ref .nt-stat .nt-topic__prog{ margin-top: 6px; min-width: 120px; }
body.nt-ref .nt-stat .nt-topic__prog .ieg-progress__track{ min-width: 120px; height: 6px; background: #E3EBE7; }
body.nt-ref .nt-stat[data-stat="phase"] .nt-ico{ background: #EAF3FB; color: #2C7AC9; }
body.nt-ref .nt-stat[data-stat="done"] .nt-ico{ background: #EAF8F0; color: #149447; }
body.nt-ref .nt-stat[data-stat="saved"] .nt-ico{ background: #FFF1DE; color: #A5661A; }

/* Toolbar */
body.nt-ref .nt-toolbar{
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 8px;
  background: #FFFFFF;
  border: 1px solid #DDE6E1;
  border-radius: 13px;
  box-shadow: 0 2px 8px rgba(20, 48, 33, 0.04);
  padding: 7px 8px;
  height: 54px;
  min-height: 54px;
  box-sizing: border-box;
  margin: 0 0 15px;
  line-height: 1;
}
body.nt-ref .nt-toolbar .ieg-search{
  flex: 1 1 auto;
  min-width: 220px;
  position: relative;
  display: block;
  height: 40px;
  min-height: 40px;
  margin: 0;
  border: 1px solid var(--ieg-border-strong);
  border-radius: 9px;
  background: #FFFFFF;
  padding: 0;
  overflow: hidden;
}
body.nt-ref .nt-toolbar .ieg-search i{
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--ieg-text-muted);
  pointer-events: none;
}
body.nt-ref .nt-toolbar .ieg-search input{
  display: block;
  width: 100%;
  height: 40px;
  min-height: 40px;
  padding: 0 14px 0 40px;
  font-size: 14px;
  background: transparent;
  border: 0;
  box-shadow: none;
}
body.nt-ref .nt-toolbar .ieg-search:focus-within{
  border-color: var(--ieg-primary);
  box-shadow: 0 0 0 3px rgba(17,148,71,.10);
}
body.nt-ref .nt-toolbar .nt-cat{
  height: 40px;
  min-height: 40px;
  min-width: 155px;
  max-width: 155px;
  width: 155px;
  flex: 0 0 155px;
  padding: 0 32px 0 12px;
  border: 1px solid var(--ieg-border-strong);
  border-radius: 9px;
  background: #FFFFFF;
  font-size: 13px;
}
body.nt-ref .nt-toolbar .ieg-chips{
  display: flex;
  flex: 0 0 auto;
  flex-wrap: nowrap;
  gap: 8px;
}
body.nt-ref .nt-toolbar .ieg-chip{
  height: 36px;
  min-height: 36px;
  padding: 0 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 650;
  background: #EFF3F1;
  color: #39443D;
  border: none;
  white-space: nowrap;
}
body.nt-ref .nt-toolbar .ieg-chip:hover{ background: #E6ECE8; color: #39443D; }
body.nt-ref .nt-toolbar .ieg-chip.is-on,
body.nt-ref .nt-toolbar .ieg-chip.is-on:hover{
  background: #119447;
  color: #FFFFFF;
}
body.nt-ref .nt-topics-btn{
  height: 40px;
  min-height: 40px;
  padding: 0 12px;
  border-radius: 9px;
  border: 1px solid var(--ieg-border-strong);
  background: #FFFFFF;
  font-size: 13px;
  font-weight: 650;
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
  color: var(--ieg-text-strong) !important;
}
body.nt-ref .nt-topics-btn:hover{ background: #F7FAF8; }

/* Learning topics header */
body.nt-ref .nt-head{
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  flex-wrap: nowrap;
  margin: 0 0 10px;
  padding: 0;
}
body.nt-ref .nt-head h2{
  margin: 0;
  font-size: 20px;
  font-weight: 750;
  color: var(--ieg-text);
  text-transform: none;
  letter-spacing: -.015em;
}
body.nt-ref .nt-head p{
  margin: 2px 0 0;
  font-size: 13px;
  color: var(--ieg-text-secondary);
}
body.nt-ref .nt-head__tools{ display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
body.nt-ref .nt-head__tools label{
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--ieg-text-secondary);
}
body.nt-ref .nt-head__tools .ieg-input{
  height: 36px;
  min-height: 36px;
  width: auto;
  max-width: 11.5rem;
  border-radius: 9px;
  border: 1px solid var(--ieg-border-strong);
  background: #FFFFFF;
  font-size: 13px;
}
body.nt-ref .nt-view{ display: flex; gap: 6px; }
body.nt-ref .nt-view button{
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: 1px solid var(--ieg-border);
  background: #FFFFFF;
  color: var(--ieg-text-secondary);
  cursor: pointer;
}
body.nt-ref .nt-view button.is-on{
  background: var(--ieg-primary);
  border-color: var(--ieg-primary);
  color: #FFFFFF;
}

/* Topic grid */
body.nt-ref .nt-hub .nt-topics{
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
body.nt-ref .nt-hub .nt-topic{
  display: flex;
  flex-direction: column;
  background: #FFFFFF;
  border: 1px solid #DDE6E1;
  border-radius: 13px;
  box-shadow: 0 3px 10px rgba(20, 48, 33, 0.055);
  padding: 14px 15px;
  min-height: 154px;
  color: var(--ieg-text);
  text-decoration: none;
  gap: 0;
  transition: border-color .16s ease, box-shadow .16s ease;
}
body.nt-ref .nt-hub .nt-topic:hover{
  color: var(--ieg-text);
  transform: none;
  box-shadow: 0 3px 10px rgba(20, 48, 33, 0.08);
  border-color: #DDE6E1;
}
body.nt-ref .nt-topic__top,
body.nt-ref .nt-hub .nt-topic .card-header{
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 0 0 9px;
}
body.nt-ref .nt-hub .nt-topic strong{
  flex: 1;
  min-width: 0;
  font-size: 16px;
  font-weight: 720;
  line-height: 1.22;
  color: var(--ieg-text);
}
body.nt-ref .nt-hub .ieg-badge{
  margin-left: auto;
  height: 22px;
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  font-weight: 700;
  padding: 0 8px;
  border-radius: 999px;
  white-space: nowrap;
  background: #EEF2F0;
  color: #647069;
  flex: 0 0 auto;
}
body.nt-ref .nt-hub .ieg-badge--progress{ background: #FFF2DD; color: #B96B0A; }
body.nt-ref .nt-hub .ieg-badge--completed{ background: #EAF7EF; color: #0D7E3C; }
body.nt-ref .nt-hub .nt-topic__n,
body.nt-ref .nt-hub .nt-topic .card-count{
  display: block;
  margin: 0 0 10px;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.3;
  color: #5F6D65;
}
body.nt-ref .nt-topic__prog,
body.nt-ref .nt-hub .nt-topic .card-progress{
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 10px;
}
body.nt-ref .nt-topic__prog .ieg-progress__track{
  flex: 1;
  height: 6px;
  border-radius: 999px;
  background: #E3EBE7;
}
body.nt-ref .nt-topic__prog .ieg-progress__bar{
  background: #119447;
  border-radius: 999px;
}
body.nt-ref .nt-topic__prog em{
  font-style: normal;
  font-size: 12px;
  font-weight: 700;
  color: #5F6D65;
  min-width: 2rem;
  text-align: right;
}
body.nt-ref .nt-hub .nt-topic .btn,
body.nt-ref .nt-hub .nt-topic .card-action{
  width: 100%;
  height: 38px;
  min-height: 38px;
  margin-top: auto;
  padding: 0;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  background: #FFFFFF;
  color: var(--ieg-text) !important;
  border: 1px solid #DDE6E1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
body.nt-ref .nt-hub .nt-topic .btn:hover{ background: #F8FAF9; }
body.nt-ref .nt-hub .nt-topic .btn-green{
  background: #119447;
  color: #FFFFFF !important;
  border: none;
}
body.nt-ref .nt-hub .nt-topic .btn-green:hover{ background: #0D7E3C; color: #FFFFFF !important; }
body.nt-ref .nt-hub .nt-topic .btn-review{
  background: #EAF7EF;
  color: #0D7E3C !important;
  border: 1px solid #DDE6E1;
}

/* List mode — same tokens, compact rows */
body.nt-ref .nt-hub .nt-topics.is-list{ grid-template-columns: 1fr; }
body.nt-ref .nt-hub .nt-topics.is-list .nt-topic{
  min-height: 64px;
  flex-direction: row;
  align-items: center;
  gap: 14px;
  padding: 10px 14px;
  border-radius: 12px;
}
body.nt-ref .nt-hub .nt-topics.is-list .nt-topic__top,
body.nt-ref .nt-hub .nt-topics.is-list .card-header{ flex: 1; min-width: 0; margin: 0; }
body.nt-ref .nt-hub .nt-topics.is-list .nt-topic__n,
body.nt-ref .nt-hub .nt-topics.is-list .card-count{ margin: 0; }
body.nt-ref .nt-hub .nt-topics.is-list .nt-topic__prog,
body.nt-ref .nt-hub .nt-topics.is-list .card-progress{ margin: 0; width: 8rem; flex: 0 0 8rem; }
body.nt-ref .nt-hub .nt-topics.is-list .nt-topic .btn,
body.nt-ref .nt-hub .nt-topics.is-list .nt-topic .card-action{
  width: auto;
  min-width: 9.5rem;
  margin-top: 0;
}

/* Icons */
body.nt-ref .nt-ico{
  width: 42px;
  height: 42px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  background: var(--ieg-surface-muted);
  color: var(--ieg-text-secondary);
  font-size: 18px;
}
body.nt-ref .nt-ico[data-accent="magnet"]{ background: #FDEBEC; color: #D94B4B; }
body.nt-ref .nt-ico[data-accent="coil"]{ background: #FFF0DF; color: #B66A15; }
body.nt-ref .nt-ico[data-accent="wave"]{ background: #E9F2FC; color: #2C7AC9; }
body.nt-ref .nt-ico[data-accent="cap"]{ background: #E8F7F5; color: #278D88; }
body.nt-ref .nt-ico[data-accent="leaf"]{ background: #EAF8EE; color: #219653; }
body.nt-ref .nt-ico[data-accent="board"]{ background: #F1ECE6; color: #8B6C49; }
body.nt-ref .nt-ico[data-accent="cable"]{ background: #EAF0F5; color: #4B6E89; }
body.nt-ref .nt-ico[data-accent="conduit"]{ background: #F1ECE7; color: #7F6D5D; }
body.nt-ref .nt-ico[data-accent="lamp"]{ background: #FFF6D8; color: #B68C00; }
body.nt-ref .nt-ico[data-accent="build"]{ background: #EEEAFB; color: #6F56C4; }
body.nt-ref .nt-ico[data-accent="motor"]{ background: #EDF0F3; color: #536271; }
body.nt-ref .nt-ico[data-accent="book"]{ background: #EAF3FB; color: #2C7AC9; }
body.nt-ref .nt-empty{
  background: #FFFFFF;
  border: 1px solid var(--ieg-border);
  border-radius: 16px;
  box-shadow: var(--ieg-shadow-sm);
  padding: 28px 22px;
}

/* Drawer */
body.nt-ref .ieg-drawer-back{
  inset: 64px 0 0 0;
  background: rgba(17,28,22,.18);
  z-index: 1000;
}
body.nt-ref .ieg-drawer{
  position: fixed;
  top: 64px;
  right: 0;
  bottom: 0;
  height: auto;
  width: 360px;
  background: #FFFFFF;
  border-left: 1px solid #DDE6E1;
  box-shadow: -10px 0 30px rgba(22, 45, 34, 0.08);
  padding: 0;
  z-index: 1001;
}
body.nt-ref .ieg-drawer__h{
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 56px;
  margin: 0;
  padding: 0 16px;
  font-size: 18px;
  font-weight: 750;
  color: var(--ieg-text);
  border-bottom: 1px solid #DDE6E1;
}
body.nt-ref .ieg-drawer__h .ieg-iconbtn{
  width: 36px;
  height: 36px;
  background: transparent !important;
  color: var(--ieg-text-secondary) !important;
}
body.nt-ref .ieg-drawer__b{ padding: 0; }
body.nt-ref .ieg-drawer a{
  border-radius: 0;
  padding: 0;
}
body.nt-ref .nt-draw__row{
  display: flex !important;
  align-items: center;
  gap: 12px;
  min-height: 56px;
  height: 56px;
  padding: 0 16px;
  border-radius: 0;
  border-bottom: 1px solid #DDE6E1;
  font-size: 14px;
  font-weight: 600;
  color: var(--ieg-text);
}
body.nt-ref .nt-draw__row em{
  margin-left: auto;
  font-style: normal;
  font-size: 12px;
  font-weight: 700;
  color: var(--ieg-text-secondary);
}
body.nt-ref .nt-draw__row:hover{ background: #F6F9F7; }
body.nt-ref .nt-draw__row.is-on{ background: #EAF7EF; }
/* Notes drawer width is handled by .notes-page, not #wrapper. */

/* Footer — compact, Notes only */
body.nt-ref #footer{
  background: #063F2B !important;
  color: #D8E6DE;
  min-height: 72px;
}
body.nt-ref #footer .ieg-foot{ padding: 16px 24px !important; gap: 6px; }
body.nt-ref #footer a,
body.nt-ref #footer .copyright,
body.nt-ref .ieg-foot__legal{ color: #D8E6DE; }

@media (min-width: 769px){
  body.nt-ref.ieg-drawer-open .ieg-drawer-back{
    display: none;
    pointer-events: none;
    opacity: 0;
  }
}
@media (max-width: 1100px){
  body.nt-ref .nt-hub.ieg-page{ padding-left: 20px; padding-right: 20px; }
  body.nt-ref .nt-hub .nt-topics{ grid-template-columns: repeat(2, minmax(0, 1fr)); }
  body.nt-ref .nt-toolbar{ flex-wrap: wrap; height: auto; }
  body.nt-ref .nt-toolbar .ieg-search{ flex: 1 1 100%; min-width: 0; }
  body.nt-ref .nt-head{ flex-wrap: wrap; }
}
@media (max-width: 900px){
  body.nt-ref .nt-hero__art{ display: none; }
}
@media (max-width: 1024px){
  body.nt-ref .learn-context{ display: none; }
  body.nt-ref .header-row{ flex-wrap: nowrap; position: relative; }
  body.nt-ref .ieg-prof__name{ display: none; }
  body.nt-ref nav #top-nav{
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    background: var(--ieg-header-deep);
    padding: 10px;
    z-index: 40;
    width: 100%;
  }
  body.nt-ref nav #top-nav.show{ display: flex; }
}
@media (max-width: 768px){
  body.nt-ref .nt-hub.ieg-page{ padding-left: 16px; padding-right: 16px; }
  body.nt-ref .nt-hero{
    padding: 16px;
    min-height: 0;
    margin: 0 0 10px;
  }
  body.nt-ref .nt-hero h1{ font-size: 31px; }
  body.nt-ref .nt-stats{ grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  body.nt-ref .nt-stat{ padding: 12px; height: auto; min-height: 0; gap: 8px; }
  body.nt-ref .nt-stat strong{ font-size: 18px; }
  body.nt-ref .nt-toolbar{
    display: flex;
    flex-wrap: wrap;
    height: auto;
    gap: 8px;
  }
  body.nt-ref .nt-toolbar .ieg-search,
  body.nt-ref .nt-toolbar .nt-cat{
    min-width: 0;
    width: 100%;
    max-width: none;
    flex: none;
  }
  body.nt-ref .nt-toolbar .ieg-chips{
    display: flex;
    gap: 8px;
    overflow-x: auto;
  }
  body.nt-ref .nt-hub .nt-topics,
  body.nt-ref .nt-hub .nt-topics.is-list{ grid-template-columns: 1fr; }
  body.nt-ref .nt-hub .nt-topic{ min-height: 0; }
  body.nt-ref .nt-hub .nt-topics.is-list .nt-topic{
    flex-direction: column;
    align-items: stretch;
    height: auto;
  }
  body.nt-ref.ieg-drawer-open #wrapper{
    width: 100%;
    max-width: none;
  }
  body.nt-ref .ieg-drawer-back{ inset: 0; }
  body.nt-ref .ieg-drawer{
    width: 100%;
    max-width: 420px;
    top: auto;
    bottom: 0;
    height: min(78dvh, 640px);
    border-left: 0;
    border-top: 1px solid #DDE6E1;
    border-radius: 16px 16px 0 0;
    transform: translateY(100%);
  }
  body.nt-ref .ieg-drawer.is-on{ transform: none; }
}
