/* P.E.M. V6 — Central de Comando: radical, guiada e orientada a ação */
:root{
  --v6-ink:#071522;
  --v6-ink2:#0d2236;
  --v6-gold:#e4bb61;
  --v6-gold2:#f2d78d;
  --v6-card:var(--card,#fff);
  --v6-line:var(--line,#d2d2d7);
  --v6-text:var(--text,#1d1d1f);
  --v6-muted:var(--muted,#6e6e73);
  --v6-ok:#39a873;
  --v6-warn:#d59c3c;
  --v6-danger:#d46060;
}
.app-header-meta{display:none!important}
.app-header{height:66px;padding-inline:14px;border-bottom:1px solid color-mix(in srgb,var(--v6-line) 82%,transparent)}
.pem-logo-app{max-width:105px!important;height:auto!important}
.app-main{max-width:1040px!important;margin:0 auto;width:100%}
.view{padding:18px 16px 110px!important}
.bottom-nav{grid-template-columns:repeat(4,1fr)!important;max-width:520px!important;left:50%!important;right:auto!important;transform:translateX(-50%);bottom:12px!important;border-radius:22px!important;border:1px solid color-mix(in srgb,var(--v6-line) 82%,transparent)!important;box-shadow:0 18px 60px rgba(2,12,22,.16)!important;padding:7px!important;background:color-mix(in srgb,var(--card) 92%,transparent)!important;backdrop-filter:blur(18px)}
.bottom-nav button{border-radius:15px!important;min-height:52px!important;font-size:10px!important}
.bottom-nav button.active{background:linear-gradient(145deg,#0a2035,#13314e)!important;color:#fff!important}
.bottom-nav button.active svg{color:var(--v6-gold2)!important}

/* Oculta a home antiga sem tocar nas demais telas do React */
.home-view.pem-v6-home>*:not(.pem-command-center){display:none!important}
.pem-command-center{display:grid;gap:16px;animation:pemV6In .2s ease-out}
@keyframes pemV6In{from{opacity:.3;transform:translateY(5px)}to{opacity:1;transform:none}}

.pem-v6-topline{display:flex;align-items:center;justify-content:space-between;gap:12px}
.pem-v6-kicker{font-size:10px;font-weight:900;letter-spacing:.18em;color:var(--v6-gold);text-transform:uppercase}
.pem-v6-topline h1{margin:4px 0 0;font-size:clamp(30px,6vw,46px);letter-spacing:-.05em;line-height:1}
.pem-v6-date{font-size:11px;color:var(--v6-muted);font-weight:700;white-space:nowrap}

.pem-v6-hero{position:relative;overflow:hidden;border-radius:28px;padding:26px;background:radial-gradient(circle at 85% 15%,rgba(228,187,97,.18),transparent 32%),linear-gradient(145deg,#06131f,#102b45);color:#fff;box-shadow:0 24px 70px rgba(4,18,32,.22)}
.pem-v6-hero:after{content:"";position:absolute;right:-60px;bottom:-120px;width:300px;height:300px;border:1px solid rgba(255,255,255,.08);border-radius:50%;box-shadow:0 0 0 35px rgba(255,255,255,.018),0 0 0 70px rgba(255,255,255,.012)}
.pem-v6-hero-grid{position:relative;z-index:1;display:grid;grid-template-columns:minmax(0,1.5fr) minmax(260px,.65fr);gap:22px;align-items:end}
.pem-v6-hero .eyebrow{display:inline-flex;align-items:center;gap:7px;font-size:10px;font-weight:900;letter-spacing:.16em;color:var(--v6-gold2);text-transform:uppercase}
.pem-v6-hero h2{font-size:clamp(28px,5vw,44px);line-height:1.02;letter-spacing:-.045em;margin:10px 0 8px;max-width:680px}
.pem-v6-hero .discipline{color:#c8d3df;font-size:12px;font-weight:750}
.pem-v6-hero .reason{margin:13px 0 0;color:#aebdcb;font-size:12px;line-height:1.5;max-width:620px}
.pem-v6-hero-actions{display:flex;gap:9px;flex-wrap:wrap;margin-top:20px}
.pem-v6-primary,.pem-v6-secondary,.pem-v6-ghost{appearance:none;border:0;cursor:pointer;font:inherit;font-weight:850;border-radius:14px;min-height:48px;padding:0 17px;display:inline-flex;align-items:center;justify-content:center;gap:8px}
.pem-v6-primary{background:linear-gradient(135deg,#f4d98f,#dbaa48);color:#06121f;box-shadow:0 10px 28px rgba(212,164,70,.2)}
.pem-v6-secondary{background:#fff;color:#0a1d30}
.pem-v6-ghost{background:rgba(255,255,255,.07);color:#e7edf4;border:1px solid rgba(255,255,255,.13)}
.pem-v6-pace{border:1px solid rgba(255,255,255,.12);border-radius:20px;padding:18px;background:rgba(2,10,17,.28);backdrop-filter:blur(8px)}
.pem-v6-pace span,.pem-v6-pace small,.pem-v6-pace strong{display:block}
.pem-v6-pace span{font-size:10px;color:#9eb0c1;font-weight:800;text-transform:uppercase;letter-spacing:.12em}
.pem-v6-pace strong{font-size:30px;color:#f6d98f;margin:6px 0 4px;letter-spacing:-.04em}
.pem-v6-pace small{font-size:11px;color:#bfccd8;line-height:1.45}

.pem-v6-metrics{display:grid;grid-template-columns:repeat(4,1fr);gap:10px}
.pem-v6-metric{background:var(--v6-card);border:1px solid var(--v6-line);border-radius:18px;padding:16px;min-width:0}
.pem-v6-metric span,.pem-v6-metric strong,.pem-v6-metric small{display:block}
.pem-v6-metric span{font-size:9px;font-weight:850;letter-spacing:.1em;color:var(--v6-muted);text-transform:uppercase}
.pem-v6-metric strong{font-size:25px;margin:7px 0 3px;letter-spacing:-.04em;color:var(--v6-text)}
.pem-v6-metric small{font-size:10px;color:var(--v6-muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}

.pem-v6-grid{display:grid;grid-template-columns:1.1fr .9fr;gap:14px}
.pem-v6-panel{background:var(--v6-card);border:1px solid var(--v6-line);border-radius:22px;padding:19px;min-width:0}
.pem-v6-panel-head{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;margin-bottom:14px}
.pem-v6-panel-head h3{font-size:18px;margin:3px 0 0;letter-spacing:-.025em}
.pem-v6-panel-head span{font-size:9px;color:var(--v6-gold);font-weight:900;letter-spacing:.12em;text-transform:uppercase}
.pem-v6-panel-head button{border:0;background:transparent;color:var(--v6-muted);font-weight:800;font-size:11px;cursor:pointer}

.pem-v6-mission{display:grid;gap:9px}
.pem-v6-task{display:grid;grid-template-columns:32px minmax(0,1fr) auto;gap:11px;align-items:center;border:1px solid color-mix(in srgb,var(--v6-line) 88%,transparent);border-radius:15px;padding:12px;background:color-mix(in srgb,var(--v6-card) 96%,var(--v6-ink) 4%)}
.pem-v6-task.done{opacity:.62}
.pem-v6-task-index{width:32px;height:32px;border-radius:11px;background:color-mix(in srgb,var(--v6-gold) 13%,var(--v6-card));color:#9a6b16;display:grid;place-items:center;font-size:11px;font-weight:900}
.pem-v6-task.done .pem-v6-task-index{background:color-mix(in srgb,var(--v6-ok) 14%,var(--v6-card));color:var(--v6-ok)}
.pem-v6-task strong,.pem-v6-task small{display:block}
.pem-v6-task strong{font-size:12px}
.pem-v6-task small{font-size:10px;color:var(--v6-muted);margin-top:3px;line-height:1.35}
.pem-v6-task button{border:0;background:transparent;color:#a97822;font-weight:850;font-size:10px;cursor:pointer;padding:7px}

.pem-v6-priority-list{display:grid;gap:9px}
.pem-v6-priority{display:grid;grid-template-columns:1fr auto;gap:10px;align-items:center;border-bottom:1px solid color-mix(in srgb,var(--v6-line) 72%,transparent);padding:10px 0}
.pem-v6-priority:last-child{border-bottom:0}
.pem-v6-priority strong,.pem-v6-priority small{display:block}
.pem-v6-priority strong{font-size:12px;line-height:1.3}
.pem-v6-priority small{font-size:10px;color:var(--v6-muted);margin-top:4px}
.pem-v6-chip{font-size:9px;font-weight:850;border-radius:999px;padding:6px 9px;white-space:nowrap;background:color-mix(in srgb,var(--v6-gold) 12%,var(--v6-card));color:#9c701f}
.pem-v6-chip.danger{background:color-mix(in srgb,var(--v6-danger) 10%,var(--v6-card));color:var(--v6-danger)}
.pem-v6-chip.ok{background:color-mix(in srgb,var(--v6-ok) 10%,var(--v6-card));color:var(--v6-ok)}

.pem-v6-search{position:relative}
.pem-v6-search input{width:100%;height:48px;border:1px solid var(--v6-line);border-radius:14px;background:var(--v6-card);color:var(--v6-text);padding:0 14px;font:inherit;font-size:12px;outline:none}
.pem-v6-search input:focus{border-color:color-mix(in srgb,var(--v6-gold) 75%,var(--v6-line));box-shadow:0 0 0 3px color-mix(in srgb,var(--v6-gold) 12%,transparent)}
.pem-v6-search-results{display:none;position:absolute;left:0;right:0;top:54px;z-index:20;background:var(--v6-card);border:1px solid var(--v6-line);border-radius:14px;box-shadow:0 16px 50px rgba(0,0,0,.16);overflow:hidden;max-height:290px;overflow-y:auto}
.pem-v6-search-results.show{display:block}
.pem-v6-search-result{width:100%;border:0;border-bottom:1px solid color-mix(in srgb,var(--v6-line) 70%,transparent);background:transparent;text-align:left;padding:11px 13px;color:var(--v6-text);cursor:pointer}
.pem-v6-search-result:last-child{border-bottom:0}
.pem-v6-search-result strong,.pem-v6-search-result small{display:block}
.pem-v6-search-result strong{font-size:11px}
.pem-v6-search-result small{font-size:9px;color:var(--v6-muted);margin-top:3px}

.pem-v6-subjects{display:grid;gap:10px}
.pem-v6-subject{display:grid;grid-template-columns:minmax(90px,140px) 1fr 34px;gap:10px;align-items:center}
.pem-v6-subject span{font-size:10px;font-weight:750;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.pem-v6-bar{height:7px;border-radius:999px;background:color-mix(in srgb,var(--v6-line) 55%,transparent);overflow:hidden}
.pem-v6-bar i{display:block;height:100%;border-radius:inherit;background:linear-gradient(90deg,#c99435,#efd181)}
.pem-v6-subject b{font-size:10px;text-align:right}

.pem-v6-week{display:grid;grid-template-columns:repeat(7,1fr);gap:7px}
.pem-v6-day{display:grid;gap:6px;justify-items:center}
.pem-v6-day i{width:100%;aspect-ratio:1;border-radius:9px;background:color-mix(in srgb,var(--v6-line) 38%,transparent);border:1px solid color-mix(in srgb,var(--v6-line) 60%,transparent)}
.pem-v6-day.active i{background:linear-gradient(145deg,#e0b55a,#f2d88f);border-color:transparent}
.pem-v6-day.today i{box-shadow:0 0 0 2px color-mix(in srgb,var(--v6-gold) 30%,transparent)}
.pem-v6-day span{font-size:8px;color:var(--v6-muted);font-weight:800}

.pem-v6-focus-fab{position:fixed;right:18px;bottom:84px;z-index:95;border:0;border-radius:999px;background:#071b2e;color:#fff;min-height:46px;padding:0 16px;box-shadow:0 15px 45px rgba(3,16,28,.28);font-weight:850;font-size:11px;display:flex;align-items:center;gap:8px;cursor:pointer}
.pem-v6-focus-fab b{color:var(--v6-gold2)}
.pem-v6-modal{position:fixed;inset:0;z-index:200;background:rgba(1,8,14,.62);backdrop-filter:blur(10px);display:none;align-items:flex-end;justify-content:center;padding:18px}
.pem-v6-modal.open{display:flex}
.pem-v6-focus-card{width:min(520px,100%);border-radius:28px;background:var(--v6-card);border:1px solid var(--v6-line);padding:24px;box-shadow:0 30px 100px rgba(0,0,0,.4)}
.pem-v6-focus-card header{display:flex;align-items:flex-start;justify-content:space-between;gap:10px}
.pem-v6-focus-card h3{font-size:22px;margin:3px 0 0}
.pem-v6-close{width:36px;height:36px;border-radius:12px;border:1px solid var(--v6-line);background:transparent;color:var(--v6-text);font-size:18px;cursor:pointer}
.pem-v6-timer{text-align:center;font-size:clamp(54px,15vw,82px);font-weight:900;letter-spacing:-.07em;margin:26px 0 20px;color:var(--v6-text)}
.pem-v6-timer-modes{display:grid;grid-template-columns:repeat(3,1fr);gap:7px}
.pem-v6-timer-modes button{height:40px;border-radius:12px;border:1px solid var(--v6-line);background:transparent;color:var(--v6-text);font-size:10px;font-weight:800;cursor:pointer}
.pem-v6-timer-modes button.active{background:#0b2137;color:#fff;border-color:#0b2137}
.pem-v6-timer-actions{display:grid;grid-template-columns:1fr 1fr;gap:9px;margin-top:10px}
.pem-v6-timer-actions button{min-height:48px;border-radius:14px;border:0;font-weight:850;cursor:pointer}
.pem-v6-timer-start{background:linear-gradient(135deg,#f3d88e,#d8a84c);color:#07131f}
.pem-v6-timer-reset{background:color-mix(in srgb,var(--v6-line) 45%,var(--v6-card));color:var(--v6-text)}
.pem-v6-focus-note{font-size:10px;color:var(--v6-muted);text-align:center;margin:12px 0 0;line-height:1.45}

/* Telas internas mais limpas */
.plan-view .view-heading,.question-bank-view .view-heading,.pem-progress-view .view-heading{margin-bottom:14px!important}
.view-heading h1{font-size:clamp(28px,6vw,40px)!important;letter-spacing:-.045em!important}
.filter-strip{overflow-x:auto;scrollbar-width:none;flex-wrap:nowrap!important}
.filter-strip::-webkit-scrollbar{display:none}
.subject-card,.bank-overview,.training-launch,.settings-section,.review-card{border-radius:18px!important}
.question-bank-view .builder-heading>span{display:none!important}
.question-bank-view .bank-multi-toggle{display:none!important}
.question-bank-view .advanced-bank-filters label.pem-secondary-filter{display:none!important}
.question-bank-view.pem-show-more-filters .advanced-bank-filters label.pem-secondary-filter{display:block!important}
.pem-more-filters{width:100%;margin:9px 0;border:1px dashed var(--v6-line);border-radius:13px;background:transparent;color:var(--v6-muted);min-height:42px;font-weight:800;cursor:pointer}
.topic-row small{display:none!important}

@media(max-width:780px){
  .app-main{max-width:100%!important}
  .view{padding-inline:12px!important}
  .pem-v6-topline{align-items:flex-end}
  .pem-v6-date{font-size:9px}
  .pem-v6-hero{padding:20px;border-radius:23px}
  .pem-v6-hero-grid{grid-template-columns:1fr}
  .pem-v6-pace{padding:14px}
  .pem-v6-metrics{grid-template-columns:1fr 1fr}
  .pem-v6-grid{grid-template-columns:1fr}
  .pem-v6-panel{padding:16px;border-radius:19px}
  .pem-v6-subject{grid-template-columns:100px 1fr 30px}
  .bottom-nav{width:calc(100% - 20px)!important;bottom:8px!important}
  .pem-v6-focus-fab{right:12px;bottom:79px;min-height:42px;padding:0 13px}
}
@media(max-width:420px){
  .pem-v6-metrics{gap:7px}
  .pem-v6-metric{padding:13px}
  .pem-v6-metric strong{font-size:21px}
  .pem-v6-task{grid-template-columns:29px 1fr;gap:9px}
  .pem-v6-task>button{grid-column:2;justify-self:start;padding:0}
  .pem-v6-hero-actions{display:grid}
  .pem-v6-primary,.pem-v6-secondary,.pem-v6-ghost{width:100%}
}

/* =========================================================
   P.E.M. V7 — MOBILE FIRST / IPHONE POLISH
   ========================================================= */

/* Chrome/header: compact brand, no banner-logo in the app header */
.pem-v7-legacy-brand{display:none!important}
.pem-logo-app{display:none!important}
.app-header-meta{display:none!important}
.app-header{
  height:auto!important;
  min-height:58px!important;
  padding:8px 14px!important;
  gap:12px!important;
  background:color-mix(in srgb,var(--bg) 94%,transparent)!important;
  border-bottom:1px solid color-mix(in srgb,var(--line) 72%,transparent)!important;
  box-shadow:0 1px 0 rgba(0,0,0,.02)!important;
}
.pem-v7-brand{
  appearance:none;border:0;background:transparent;color:var(--text);padding:0;margin:0;
  display:flex;align-items:center;gap:10px;min-width:0;text-align:left;cursor:pointer;
}
.pem-v7-brand img{
  width:40px;height:40px;object-fit:cover;border-radius:12px;display:block;
  box-shadow:0 7px 18px rgba(4,18,32,.12),inset 0 0 0 1px rgba(255,255,255,.08)
}
.pem-v7-brand span{display:flex;flex-direction:column;min-width:0;line-height:1.05}
.pem-v7-brand strong{font-size:15px;letter-spacing:.12em;font-weight:900;color:var(--text)}
.pem-v7-brand small{font-size:8px;letter-spacing:.025em;color:var(--muted);margin-top:4px;white-space:nowrap}
.avatar-button{width:36px!important;height:36px!important;flex:0 0 36px!important;border:1px solid color-mix(in srgb,var(--line) 70%,transparent)!important;box-shadow:0 6px 18px rgba(2,12,22,.08)!important}

/* Remove the old floating Focus pill. Focus now lives inside the primary study card. */
.pem-v6-focus-fab{display:none!important}

/* Tab bar: native-iOS-like, attached to bottom, four items only */
.bottom-nav{
  grid-template-columns:repeat(4,minmax(0,1fr))!important;
  width:100%!important;max-width:100%!important;
  left:0!important;right:0!important;transform:none!important;bottom:0!important;
  height:calc(56px + env(safe-area-inset-bottom))!important;
  padding:4px 8px max(4px,env(safe-area-inset-bottom))!important;
  border-radius:18px 18px 0 0!important;
  border:0!important;border-top:1px solid color-mix(in srgb,var(--line) 76%,transparent)!important;
  background:color-mix(in srgb,var(--card) 94%,transparent)!important;
  box-shadow:0 -10px 34px rgba(3,15,27,.08)!important;
  backdrop-filter:blur(22px)!important;-webkit-backdrop-filter:blur(22px)!important;
  overflow:hidden!important;
}
.bottom-nav button{
  min-height:48px!important;height:48px!important;padding:3px 2px!important;
  border-radius:12px!important;gap:2px!important;font-size:9px!important;font-weight:650!important;
  background:transparent!important;color:var(--muted)!important;position:relative!important;
}
.bottom-nav button:nth-of-type(n+5){display:none!important}
.bottom-nav button svg{width:21px!important;height:21px!important;stroke-width:1.9!important}
.bottom-nav button.active{background:transparent!important;color:var(--navy)!important;font-weight:850!important}
.bottom-nav button.active svg{color:var(--gold)!important}
.bottom-nav button.active:after{
  content:"";position:absolute;top:1px;left:50%;width:18px;height:2px;border-radius:999px;
  background:var(--gold);transform:translateX(-50%)
}
.bottom-nav b{top:0!important;left:calc(50% + 8px)!important;transform:scale(.86)}
.app-main{padding-bottom:calc(70px + env(safe-area-inset-bottom))!important}
.view{padding-bottom:calc(82px + env(safe-area-inset-bottom))!important}

/* Home density and typography */
.pem-command-center{gap:13px!important}
.pem-v6-topline{align-items:flex-end!important;gap:8px!important;padding:2px 2px 0}
.pem-v6-kicker{font-size:9px!important;letter-spacing:.15em!important}
.pem-v6-topline h1{font-size:clamp(32px,8.8vw,42px)!important;line-height:.98!important;margin-top:5px!important}
.pem-v6-date{font-size:9px!important;padding-bottom:3px!important}

.pem-v6-hero{border-radius:22px!important;padding:18px!important;box-shadow:0 16px 44px rgba(4,18,32,.16)!important}
.pem-v6-hero-grid{grid-template-columns:minmax(0,1.55fr) minmax(210px,.55fr)!important;gap:16px!important}
.pem-v6-hero .eyebrow{font-size:9px!important}
.pem-v6-hero h2{font-size:clamp(28px,5vw,40px)!important;margin:9px 0 6px!important}
.pem-v6-hero .discipline{font-size:11px!important}
.pem-v6-hero .reason{font-size:11px!important;line-height:1.45!important;margin-top:10px!important}
.pem-v6-hero-actions{gap:8px!important;margin-top:16px!important}
.pem-v6-primary,.pem-v6-secondary,.pem-v6-ghost{min-height:44px!important;border-radius:13px!important;padding:0 14px!important;font-size:11px!important}
.pem-v6-pace{border-radius:16px!important;padding:14px!important}
.pem-v6-pace strong{font-size:24px!important}
.pem-v6-pace small{font-size:10px!important}

.pem-v6-metrics{gap:8px!important}
.pem-v6-metric{border-radius:15px!important;padding:13px!important}
.pem-v6-metric strong{font-size:22px!important}
.pem-v6-metric span{font-size:8px!important}
.pem-v6-metric small{font-size:9px!important}
.pem-v6-panel{border-radius:18px!important;padding:16px!important}
.pem-v6-panel-head{margin-bottom:11px!important}
.pem-v6-panel-head h3{font-size:16px!important}
.pem-v6-task{border-radius:13px!important;padding:11px!important}

/* Focus modal compact enough for small iPhones */
.pem-v6-focus-card{width:min(92vw,420px)!important;border-radius:24px!important;padding:20px!important}
.pem-v6-focus-card h3{font-size:20px!important}
.pem-v6-timer{font-size:clamp(54px,18vw,84px)!important;margin:18px 0!important}

@media(max-width:780px){
  .app-header{min-height:56px!important;padding:7px 12px!important}
  .pem-v7-brand img{width:38px;height:38px;border-radius:11px}
  .pem-v7-brand strong{font-size:14px}
  .pem-v7-brand small{font-size:7.5px}
  .avatar-button{width:34px!important;height:34px!important;flex-basis:34px!important}
  .app-main{max-width:100%!important}
  .view{padding:14px 12px calc(76px + env(safe-area-inset-bottom))!important}
  .pem-command-center{gap:11px!important}
  .pem-v6-topline{padding:0!important}
  .pem-v6-topline h1{font-size:34px!important}
  .pem-v6-date{font-size:9px!important}
  .pem-v6-hero{padding:17px 16px!important;border-radius:21px!important}
  .pem-v6-hero-grid{grid-template-columns:1fr!important;gap:11px!important}
  .pem-v6-hero h2{font-size:30px!important;line-height:1.01!important;letter-spacing:-.035em!important}
  .pem-v6-hero .reason{font-size:11px!important;margin-top:9px!important}
  .pem-v6-hero-actions{display:grid!important;grid-template-columns:1fr 1fr!important;gap:8px!important;margin-top:14px!important}
  .pem-v6-hero-actions .pem-v6-primary:first-child{grid-column:1/-1!important}
  .pem-v6-hero-actions .pem-v6-ghost{min-width:0!important;padding:0 9px!important;font-size:10px!important;white-space:normal!important;text-align:center!important;line-height:1.15!important}
  .pem-v6-pace{padding:11px 12px!important;border-radius:14px!important;display:grid!important;grid-template-columns:auto 1fr!important;column-gap:12px!important;align-items:center!important}
  .pem-v6-pace span{grid-column:1/-1;font-size:8px!important;margin-bottom:4px}
  .pem-v6-pace strong{font-size:19px!important;margin:0!important;white-space:nowrap}
  .pem-v6-pace small{font-size:9px!important;line-height:1.3!important}
  .pem-v6-pace button{grid-column:1/-1!important;min-height:38px!important;margin-top:8px!important}
  .pem-v6-metrics{grid-template-columns:repeat(4,minmax(0,1fr))!important;gap:6px!important}
  .pem-v6-metric{padding:10px 7px!important;border-radius:13px!important;text-align:center!important}
  .pem-v6-metric span{font-size:7px!important;letter-spacing:.04em!important;white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important}
  .pem-v6-metric strong{font-size:18px!important;margin:5px 0 1px!important;white-space:nowrap!important}
  .pem-v6-metric small{font-size:7.5px!important;white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important}
  .pem-v6-grid{grid-template-columns:1fr!important;gap:10px!important}
  .pem-v6-panel{padding:14px!important;border-radius:17px!important}
  .pem-v6-panel-head h3{font-size:15px!important}
  .pem-v6-panel-head span{font-size:8px!important}
  .pem-v6-task{grid-template-columns:30px minmax(0,1fr) auto!important;padding:10px!important;gap:9px!important}
  .pem-v6-task-index{width:30px!important;height:30px!important;border-radius:10px!important}
  .pem-v6-task strong{font-size:11px!important}
  .pem-v6-task small{font-size:9px!important}
  .pem-v6-task button{font-size:9px!important;padding:5px!important}
  .pem-v6-subject{grid-template-columns:90px 1fr 30px!important}
  .bottom-nav{height:calc(54px + env(safe-area-inset-bottom))!important;padding-top:3px!important}
  .bottom-nav button{height:46px!important;min-height:46px!important;font-size:8.5px!important}
  .bottom-nav button svg{width:20px!important;height:20px!important}
}

@media(max-width:390px){
  .pem-v7-brand small{display:none}
  .pem-v7-brand{gap:8px}
  .pem-v7-brand img{width:36px;height:36px}
  .pem-v6-topline h1{font-size:31px!important}
  .pem-v6-date{font-size:8px!important}
  .pem-v6-hero h2{font-size:27px!important}
  .pem-v6-hero-actions .pem-v6-ghost{font-size:9px!important}
  .pem-v6-metric{padding-inline:5px!important}
  .pem-v6-metric strong{font-size:17px!important}
  .pem-v6-task{grid-template-columns:28px minmax(0,1fr)!important}
  .pem-v6-task>button{grid-column:2!important;justify-self:start!important;padding:1px 0!important}
}

/* =========================================================
   P.E.M. V8 PREMIUM — Progress, route, smart practice
   ========================================================= */
:root{
  --v8-navy:#071624;
  --v8-navy-2:#0d253b;
  --v8-gold:#e4b958;
  --v8-gold-soft:#f3d992;
  --v8-good:#32a876;
  --v8-warn:#d89a39;
  --v8-danger:#d15f5f;
}

/* Replace the legacy progress body entirely. */
.pem-progress-view.pem-v8-progress-shell{padding-top:16px!important}
.pem-progress-view.pem-v8-progress-shell > :not(.pem-v8-progress){display:none!important}
.pem-v8-progress{display:grid;gap:14px;width:100%;animation:pemV8Enter .18s ease-out}
@keyframes pemV8Enter{from{opacity:.25;transform:translateY(4px)}to{opacity:1;transform:none}}

.pem-v8-pagehead{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:20px;align-items:end;padding:4px 2px 8px}
.pem-v8-pagehead>div:first-child>span,.pem-v8-cardhead span,.pem-v8-mode-head span,.pem-v8-route-copy>span,.pem-v8-topic-intel>div>span{display:block;color:var(--v8-gold);font-size:9px;font-weight:900;letter-spacing:.16em;text-transform:uppercase}
.pem-v8-pagehead h1{margin:5px 0 7px!important;font-size:clamp(34px,6vw,50px)!important;line-height:.98;letter-spacing:-.055em!important}
.pem-v8-pagehead p{margin:0;max-width:720px;color:var(--muted);font-size:12px;line-height:1.55}
.pem-v8-progress-ring{--p:0;width:94px;height:94px;border-radius:50%;display:grid;place-content:center;text-align:center;position:relative;background:conic-gradient(var(--v8-gold) calc(var(--p)*1%),color-mix(in srgb,var(--line) 58%,transparent) 0);box-shadow:0 14px 34px rgba(3,17,29,.08)}
.pem-v8-progress-ring:after{content:"";position:absolute;inset:7px;border-radius:50%;background:var(--card)}
.pem-v8-progress-ring strong,.pem-v8-progress-ring small{position:relative;z-index:1;display:block}
.pem-v8-progress-ring strong{font-size:24px;letter-spacing:-.04em}
.pem-v8-progress-ring small{font-size:8px;color:var(--muted);margin-top:1px}

.pem-v8-stat-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px}
.pem-v8-stat-grid article,.pem-v8-card{border:1px solid color-mix(in srgb,var(--line) 86%,transparent);background:var(--card);border-radius:20px;box-shadow:0 10px 34px rgba(3,16,28,.035)}
.pem-v8-stat-grid article{padding:16px;display:grid;grid-template-columns:auto 1fr;column-gap:9px;align-items:center;min-width:0}
.pem-v8-stat-grid article i{grid-row:1/4;width:31px;height:31px;border-radius:10px;display:grid;place-items:center;background:color-mix(in srgb,var(--v8-gold) 11%,var(--card));color:#9b6e19;font-style:normal;font-weight:900;font-size:13px}
.pem-v8-stat-grid article span{font-size:8px;font-weight:850;color:var(--muted);text-transform:uppercase;letter-spacing:.08em;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.pem-v8-stat-grid article strong{font-size:23px;line-height:1.05;letter-spacing:-.04em;margin-top:3px}
.pem-v8-stat-grid article small{font-size:9px;color:var(--muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;margin-top:2px}

.pem-v8-diagnosis{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:18px;align-items:center;position:relative;overflow:hidden;border-radius:24px;padding:22px 24px;background:radial-gradient(circle at 92% 0,rgba(228,185,88,.19),transparent 30%),linear-gradient(135deg,#071624,#102b45);color:#fff;box-shadow:0 20px 60px rgba(3,16,28,.17)}
.pem-v8-diagnosis:after{content:"";position:absolute;right:-90px;bottom:-140px;width:260px;height:260px;border-radius:50%;border:1px solid rgba(255,255,255,.07);box-shadow:0 0 0 40px rgba(255,255,255,.015)}
.pem-v8-diagnosis>div,.pem-v8-diagnosis>button{position:relative;z-index:1}
.pem-v8-diagnosis span{font-size:9px;font-weight:900;letter-spacing:.15em;color:var(--v8-gold-soft)}
.pem-v8-diagnosis h2{font-size:23px;letter-spacing:-.035em;margin:5px 0 5px}
.pem-v8-diagnosis p{margin:0;color:#b8c6d4;font-size:11px;line-height:1.55;max-width:720px}
.pem-v8-diagnosis button,.pem-v8-primary{appearance:none;border:0;border-radius:14px;min-height:46px;padding:0 17px;background:linear-gradient(135deg,#f2d78c,#dba947);color:#07131f;font-weight:900;font-size:11px;cursor:pointer;white-space:nowrap;box-shadow:0 9px 25px rgba(219,169,71,.14)}

.pem-v8-two{display:grid;grid-template-columns:1fr 1fr;gap:12px}
.pem-v8-card{padding:18px;min-width:0}
.pem-v8-cardhead{display:flex;align-items:flex-start;justify-content:space-between;gap:14px}
.pem-v8-cardhead h2{margin:4px 0 0;font-size:18px;letter-spacing:-.028em;line-height:1.15}
.pem-v8-big{font-size:25px;letter-spacing:-.05em;white-space:nowrap;color:var(--text)}
.pem-v8-muted{margin:11px 0 0;color:var(--muted);font-size:10px;line-height:1.5}
.pem-v8-link{appearance:none;border:0;background:transparent;color:#9a6d19;font-size:10px;font-weight:900;padding:0;margin-top:12px;cursor:pointer}
.danger-text{color:var(--v8-danger)!important}

.pem-v8-bars{height:96px;display:grid;grid-template-columns:repeat(7,1fr);align-items:end;gap:7px;margin-top:12px}
.pem-v8-bars>div{height:100%;display:grid;grid-template-rows:1fr auto;gap:6px;align-items:end;justify-items:center}
.pem-v8-bars i{display:block;width:100%;max-width:27px;min-height:4px;border-radius:7px 7px 3px 3px;background:linear-gradient(180deg,#efd58d,#d6a648);box-shadow:0 5px 13px rgba(214,166,72,.14)}
.pem-v8-bars small{font-size:7px;font-weight:850;color:var(--muted)}

.pem-v8-subject-list{display:grid;gap:1px;margin-top:11px}
.pem-v8-subject-list article{display:grid;grid-template-columns:minmax(125px,1.3fr) minmax(120px,2fr) 38px 68px;gap:10px;align-items:center;padding:11px 2px;border-top:1px solid color-mix(in srgb,var(--line) 68%,transparent)}
.pem-v8-subject-list article:first-child{border-top:0}
.pem-v8-subject-main strong,.pem-v8-subject-main small{display:block}
.pem-v8-subject-main strong{font-size:11px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.pem-v8-subject-main small{font-size:8.5px;color:var(--muted);margin-top:3px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.pem-v8-subject-bar{height:7px;background:color-mix(in srgb,var(--line) 55%,transparent);border-radius:999px;overflow:hidden}
.pem-v8-subject-bar i{height:100%;display:block;background:linear-gradient(90deg,#c89537,#ecd084);border-radius:inherit}
.pem-v8-subject-list b{font-size:9px;text-align:right}
.pem-v8-subject-list em{font-style:normal;text-align:center;font-size:7.5px;font-weight:900;padding:5px 7px;border-radius:999px;background:color-mix(in srgb,var(--line) 40%,transparent);color:var(--muted)}
.pem-v8-subject-list em.ok{background:color-mix(in srgb,var(--v8-good) 11%,var(--card));color:var(--v8-good)}
.pem-v8-subject-list em.warn{background:color-mix(in srgb,var(--v8-warn) 11%,var(--card));color:var(--v8-warn)}
.pem-v8-subject-list em.danger{background:color-mix(in srgb,var(--v8-danger) 11%,var(--card));color:var(--v8-danger)}
.pem-v8-empty{font-size:10px;color:var(--muted);padding:13px 0}

.pem-v8-review-list{display:grid;gap:8px;margin-top:13px}
.pem-v8-review-list>button{width:100%;display:flex;align-items:center;justify-content:space-between;gap:12px;padding:11px 12px;border:1px solid color-mix(in srgb,var(--line) 75%,transparent);background:color-mix(in srgb,var(--card) 97%,var(--v8-navy) 3%);color:var(--text);border-radius:13px;cursor:pointer;text-align:left}
.pem-v8-review-list>button>span{display:grid;grid-template-columns:29px minmax(0,1fr);column-gap:9px;align-items:center;min-width:0}
.pem-v8-review-list b{grid-row:1/3;width:29px;height:29px;border-radius:9px;display:grid;place-items:center;background:color-mix(in srgb,var(--v8-warn) 12%,var(--card));color:#a06a14;font-size:9px}
.pem-v8-review-list strong,.pem-v8-review-list small{display:block;min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.pem-v8-review-list strong{font-size:10px}.pem-v8-review-list small{font-size:8.5px;color:var(--muted);margin-top:2px}
.pem-v8-review-list em{font-style:normal;color:#986b1c;font-size:9px;font-weight:900;white-space:nowrap}
.pem-v8-good{margin-top:13px;display:flex;gap:11px;align-items:center;padding:13px;border-radius:14px;background:color-mix(in srgb,var(--v8-good) 7%,var(--card));border:1px solid color-mix(in srgb,var(--v8-good) 18%,var(--line))}
.pem-v8-good i{width:33px;height:33px;border-radius:50%;display:grid;place-items:center;background:var(--v8-good);color:#fff;font-style:normal;font-weight:900}.pem-v8-good strong,.pem-v8-good span{display:block}.pem-v8-good strong{font-size:10px}.pem-v8-good span{font-size:9px;color:var(--muted);margin-top:3px;line-height:1.4}

/* Plan: turn the first view into an actual route. */
.pem-v8-route-strip{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:16px 17px;margin-bottom:14px;border-radius:19px;background:linear-gradient(135deg,#081827,#102b45);color:#fff;box-shadow:0 14px 42px rgba(3,16,28,.12)}
.pem-v8-route-copy h2{font-size:18px;margin:4px 0 3px;letter-spacing:-.025em}.pem-v8-route-copy p{font-size:9px;color:#aebdca;margin:0}
.pem-v8-route-actions{display:flex;gap:7px;flex-wrap:wrap;justify-content:flex-end}
.pem-v8-route-actions button{border:1px solid rgba(255,255,255,.12);background:rgba(255,255,255,.07);color:#fff;border-radius:11px;min-height:38px;padding:0 11px;font-size:9px;font-weight:850;cursor:pointer}.pem-v8-route-actions button:first-child{background:linear-gradient(135deg,#f1d58a,#d9a747);color:#07131f;border:0}.pem-v8-route-actions .attention{color:#f5d98d;border-color:rgba(228,185,88,.35)}

/* Questions: smart modes before the filter builder. */
.pem-v8-question-modes{margin-bottom:15px;padding:18px;border-radius:21px;border:1px solid var(--line);background:var(--card);box-shadow:0 12px 38px rgba(3,16,28,.04)}
.pem-v8-mode-head h2{font-size:20px;margin:4px 0 4px;letter-spacing:-.03em}.pem-v8-mode-head p{font-size:10px;line-height:1.45;color:var(--muted);margin:0;max-width:650px}
.pem-v8-mode-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px;margin-top:14px}
.pem-v8-mode-grid button{min-width:0;display:grid;grid-template-columns:32px 1fr;column-gap:9px;align-items:center;text-align:left;border:1px solid color-mix(in srgb,var(--line) 78%,transparent);background:color-mix(in srgb,var(--card) 98%,var(--v8-navy) 2%);color:var(--text);border-radius:14px;padding:10px;cursor:pointer}
.pem-v8-mode-grid button:disabled{opacity:.45;cursor:not-allowed}.pem-v8-mode-grid i{grid-row:1/3;width:32px;height:32px;border-radius:10px;background:color-mix(in srgb,var(--v8-gold) 11%,var(--card));color:#9a6a17;display:grid;place-items:center;font-style:normal;font-size:9px;font-weight:900}.pem-v8-mode-grid strong,.pem-v8-mode-grid small{display:block;min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.pem-v8-mode-grid strong{font-size:10px}.pem-v8-mode-grid small{font-size:8px;color:var(--muted);margin-top:2px}
.pem-v8-review-callout{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-top:10px;padding:10px 12px;border-radius:12px;background:color-mix(in srgb,var(--v8-warn) 8%,var(--card));border:1px solid color-mix(in srgb,var(--v8-warn) 18%,var(--line));font-size:9px}.pem-v8-review-callout button{border:0;background:transparent;color:#986718;font-size:9px;font-weight:900;cursor:pointer}

/* Topic sheet: surface useful status, hide filler, protect personal material. */
.pem-v8-topic-intel{margin:15px 0 4px;padding:14px;border-radius:16px;background:linear-gradient(135deg,#081827,#102b45);color:#fff}
.pem-v8-topic-intel>div:first-child{display:grid;grid-template-columns:1fr auto;column-gap:12px;align-items:end}.pem-v8-topic-intel>div>strong{font-size:20px;color:#f2d78d}.pem-v8-topic-intel>div>small{grid-column:1/-1;font-size:8.5px;color:#afbfcd;margin-top:3px}.pem-v8-topic-progress{height:7px;border-radius:999px;background:rgba(255,255,255,.09);overflow:hidden;margin-top:11px}.pem-v8-topic-progress i{display:block;height:100%;border-radius:inherit;background:linear-gradient(90deg,#d6a748,#f0d58b)}.pem-v8-topic-intel p{font-size:9px;color:#bdc9d4;margin:9px 0 0}.pem-v8-topic-intel button{width:100%;margin-top:10px;min-height:39px;border:0;border-radius:11px;background:rgba(255,255,255,.08);color:#fff;font-size:9px;font-weight:900;cursor:pointer}
.pem-v8-hide-processing{display:none!important}
.pem-v8-private-badge{display:inline-flex;margin-left:8px;padding:4px 6px;border-radius:999px;background:color-mix(in srgb,var(--v8-gold) 13%,var(--card));color:#956615;font-size:7px;font-weight:900;letter-spacing:.08em;vertical-align:middle}
.pem-v8-owner-material{border-color:color-mix(in srgb,var(--v8-gold) 22%,var(--line))!important}

@media(max-width:780px){
  .pem-progress-view.pem-v8-progress-shell{padding:13px 11px calc(78px + env(safe-area-inset-bottom))!important}
  .pem-v8-progress{gap:10px}
  .pem-v8-pagehead{grid-template-columns:1fr auto;gap:9px;padding:0 1px 3px}
  .pem-v8-pagehead h1{font-size:31px!important;line-height:1.01!important;margin:4px 0 5px!important}
  .pem-v8-pagehead p{font-size:9.5px;line-height:1.42;max-width:520px}
  .pem-v8-pagehead>div:first-child>span{font-size:7.5px}
  .pem-v8-progress-ring{width:68px;height:68px}.pem-v8-progress-ring:after{inset:5px}.pem-v8-progress-ring strong{font-size:18px}.pem-v8-progress-ring small{font-size:6.8px}
  .pem-v8-stat-grid{grid-template-columns:1fr 1fr;gap:7px}
  .pem-v8-stat-grid article{padding:11px;border-radius:15px;grid-template-columns:26px 1fr;column-gap:8px}.pem-v8-stat-grid article i{width:26px;height:26px;border-radius:8px;font-size:10px}.pem-v8-stat-grid article span{font-size:6.8px}.pem-v8-stat-grid article strong{font-size:18px;margin-top:2px}.pem-v8-stat-grid article small{font-size:7.3px}
  .pem-v8-diagnosis{grid-template-columns:1fr;padding:16px;border-radius:19px;gap:12px}.pem-v8-diagnosis span{font-size:7.5px}.pem-v8-diagnosis h2{font-size:18px;margin:4px 0}.pem-v8-diagnosis p{font-size:9px}.pem-v8-diagnosis button,.pem-v8-primary{width:100%;min-height:42px;font-size:9.5px;border-radius:12px}
  .pem-v8-two{grid-template-columns:1fr;gap:9px}.pem-v8-card{padding:14px;border-radius:17px}.pem-v8-cardhead h2{font-size:15px}.pem-v8-cardhead span{font-size:7px}.pem-v8-big{font-size:20px}.pem-v8-muted{font-size:8.5px;margin-top:8px}.pem-v8-link{font-size:8.5px;margin-top:9px}
  .pem-v8-bars{height:75px;gap:5px;margin-top:9px}.pem-v8-bars i{max-width:22px}.pem-v8-bars small{font-size:6.5px}
  .pem-v8-subject-list article{grid-template-columns:minmax(92px,1.2fr) minmax(70px,1fr) 31px;gap:7px;padding:9px 0}.pem-v8-subject-list article em{grid-column:1/-1;justify-self:start;padding:4px 6px}.pem-v8-subject-main strong{font-size:9.5px}.pem-v8-subject-main small{font-size:7.2px}.pem-v8-subject-list b{font-size:8px}
  .pem-v8-review-list>button{padding:9px 10px}.pem-v8-review-list strong{font-size:9px}.pem-v8-review-list small,.pem-v8-review-list em{font-size:7.5px}
  .pem-v8-route-strip{align-items:flex-start;flex-direction:column;padding:13px 14px;border-radius:16px;margin-bottom:11px}.pem-v8-route-copy h2{font-size:15px}.pem-v8-route-copy p{font-size:8px}.pem-v8-route-actions{width:100%;display:grid;grid-template-columns:repeat(3,1fr)}.pem-v8-route-actions button{padding:0 7px;font-size:8px;min-height:36px}
  .pem-v8-question-modes{padding:14px;border-radius:17px;margin-bottom:11px}.pem-v8-mode-head h2{font-size:16px}.pem-v8-mode-head p{font-size:8.5px}.pem-v8-mode-grid{grid-template-columns:1fr 1fr;gap:7px;margin-top:11px}.pem-v8-mode-grid button{padding:9px}.pem-v8-mode-grid strong{font-size:9px}.pem-v8-mode-grid small{font-size:7px}.pem-v8-mode-grid i{width:29px;height:29px}.pem-v8-review-callout{font-size:8px;align-items:flex-start}.pem-v8-review-callout button{font-size:8px;text-align:right}
  .pem-v8-topic-intel{padding:12px;border-radius:14px;margin-top:12px}.pem-v8-topic-intel>div>strong{font-size:17px}.pem-v8-topic-intel>div>small,.pem-v8-topic-intel p{font-size:7.8px}.pem-v8-topic-intel button{min-height:37px;font-size:8.5px}
}

@media(max-width:390px){
  .pem-v8-pagehead h1{font-size:29px!important}.pem-v8-progress-ring{width:62px;height:62px}.pem-v8-stat-grid article{padding:10px 9px}.pem-v8-diagnosis{padding:14px}.pem-v8-mode-grid{grid-template-columns:1fr}.pem-v8-route-actions{grid-template-columns:1fr 1fr}.pem-v8-route-actions button.attention{grid-column:1/-1}
}
