/* ============================================================
   Daneia.it – Design Refresh
   Colors & functionality unchanged; typography + spacing upgraded
   ============================================================ */

/* TOKENS ---------------------------------------------------- */
:root {
  --primary:      #1e3a8a;
  --primary-2:    #162d6b;

  --accent:       #84cc16;
  --accent-2:     #fb7185;

  --page:         #f8fafc;
  --panel:        #ffffff;
  --sidebar:      #ffffff;

  --border:       #e2e8f0;
  --border-2:     #f1f5f9;

  --text:         #334155;
  --text-strong:  #0f172a;
  --muted:        #64748b;

  --radius:    8px;
  --radius-sm: 5px;
  --radius-lg: 14px;

  --shadow-xs: 0 1px 2px rgba(0,0,0,.05);
  --shadow-sm: 0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.04);
  --shadow:    0 4px 6px -1px rgba(0,0,0,.07), 0 2px 4px -2px rgba(0,0,0,.05);
  --shadow-md: 0 10px 15px -3px rgba(0,0,0,.07), 0 4px 6px -4px rgba(0,0,0,.04);

  --font: var(--font-body);

  --topbar-h:  58px;
  --sidebar-w: 240px;
}

/* BASE ------------------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 14px;
  font-weight: 400;
  line-height: 1.6;
  color: var(--text);
  background: var(--page);
  overflow-x: hidden;
}

.bg { display: none; }

/* ============================================================
   TOPBAR
   ============================================================ */
.topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--topbar-h);
  background: #fff;
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
}

.topbar::after {
  content: "";
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--primary) 0%, var(--accent) 100%);
  opacity: .75;
}

.topbarLeft {
  display: flex;
  align-items: center;
  gap: 20px;
  min-width: 0;
}

.topBrand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--primary);
  text-decoration: none;
  transition: opacity .2s;
}
.topBrand:hover { opacity: .85; }

.topBrandText { line-height: 1.1; }

.topTitle {
  font-weight: 700;
  font-size: 15px;
  color: var(--primary);
  letter-spacing: .04em;
}

.topSub {
  font-size: 11px;
  color: var(--muted);
  letter-spacing: .01em;
}

.topNav { display: flex; }

.topNavLink {
  display: flex;
  align-items: center;
  position: relative;
  height: var(--topbar-h);
  padding: 0 16px;
  color: var(--muted);
  text-decoration: none;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  transition: color .2s;
}

.topNavLink::after {
  content: "";
  position: absolute;
  bottom: 0; left: 16px; right: 16px;
  height: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transition: transform .25s ease;
  border-radius: 2px 2px 0 0;
}

.topNavLink:hover { color: var(--primary); outline: none; }
.topNavLink:hover::after,
.topNavLink:focus::after { transform: scaleX(1); }
.topNavLink.active { color: var(--primary); }
.topNavLink.active::after { transform: scaleX(1); background: var(--accent-2); }

.topbarRight {
  display: flex;
  align-items: center;
  gap: 12px;
}

.topPill {
  color: var(--primary);
  font-size: 11.5px;
  font-weight: 700;
  padding: 5px 13px;
  border: 1px solid rgba(30,58,138,.18);
  background: rgba(30,58,138,.05);
  border-radius: 999px;
  white-space: nowrap;
  letter-spacing: .02em;
}

.topBtn {
  background: var(--primary);
  border: 1px solid var(--primary-2);
  color: #fff;
  padding: 7px 16px;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  transition: background .2s;
}
.topBtn:hover { background: var(--accent-2); border-color: var(--accent-2); }

/* Auth / Login button */
.topAuth { display: flex; align-items: center; }

.loginBtn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 16px;
  border: 1.5px solid var(--border);
  border-radius: 999px;
  background: #fff;
  color: var(--primary);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all .22s ease;
}
.loginBtn:hover {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  box-shadow: var(--shadow-sm);
}
.loginBtn:active { transform: translateY(1px); }
.loginBtn:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(30,58,138,.2); }

.loginIcon {
  width: 18px; height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(30,58,138,.1);
  flex: 0 0 auto;
  transition: background .2s;
}
.loginBtn:hover .loginIcon { background: rgba(255,255,255,.2); }

.loginIconSvg { width: 13px; height: 13px; display: block; fill: currentColor; }

/* ============================================================
   SIDEBAR
   ============================================================ */
.sidebar {
  position: fixed;
  top: var(--topbar-h); left: 0; bottom: 0;
  width: var(--sidebar-w);
  background: var(--sidebar);
  border-right: 1px solid var(--border);
  overflow-y: auto;
  overflow-x: hidden;
  padding: 8px 0 20px;
  z-index: 999;
}

.sidebarSection { padding: 6px 0; }

.sidebarLabel {
  padding: 14px 16px 5px;
  font-size: 10.5px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .09em;
  font-weight: 700;
}

.sideLink {
  display: flex;
  align-items: center;
  gap: 10px;
  position: relative;
  padding: 9px 14px;
  margin: 1px 8px;
  border: 0;
  border-radius: var(--radius);
  background: transparent;
  color: var(--muted);
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 500;
  transition: background .18s ease, color .18s ease;
}

.sideLink:hover,
.sideLink:focus {
  background: var(--border-2);
  color: var(--text-strong);
  outline: none;
}

.sideLink.active,
.sideLink.active:hover,
.sideLink.active:focus {
  background: rgba(132,204,22,.13);
  color: var(--primary);
  font-weight: 600;
}

.sideLink.active::before {
  content: "";
  position: absolute;
  left: -8px; top: 8px; bottom: 8px;
  width: 3px;
  background: var(--accent);
  border-radius: 0 3px 3px 0;
}

.sideIcon {
  width: 20px; height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: inherit;
  opacity: .65;
  transition: opacity .18s;
}
.sideLink:hover .sideIcon,
.sideLink.active .sideIcon { opacity: 1; }

.sidebarFooter {
  padding: 14px 16px;
  margin-top: 8px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 12px;
}

/* ============================================================
   MAIN AREA
   ============================================================ */
.mainArea {
  margin-left: var(--sidebar-w);
  padding-top: var(--topbar-h);
  background: var(--page);
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 980px) {
  .mainArea {
    margin-left: 0;
    padding-top: var(--topbar-h);
  }

  .sidebar {
    position: sticky;
    top: var(--topbar-h);
    left: auto; right: auto; bottom: auto;
    width: 100%;
    height: auto;
    display: flex;
    align-items: center;
    gap: 6px;
    overflow-x: auto;
    overflow-y: hidden;
    white-space: nowrap;
    padding: 8px 12px;
    border-right: none;
    border-bottom: 1px solid var(--border);
    background: rgba(255,255,255,.97);
    z-index: 998;
  }

  .sidebarSection {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0;
  }

  .sidebarLabel,
  .sidebarFooter { display: none; }

  .sideLink {
    flex: 0 0 auto;
    padding: 7px 13px;
    margin: 0;
    border: 1px solid var(--border);
    border-radius: 999px;
    font-size: 13px;
  }

  .sideLink.active { border-color: var(--accent); }
  .sideLink.active::before { display: none; }

  .topNav { display: none; }

  .dashboardRow { display: none; }

  .pageHeader { padding: 16px 16px 10px; }
  .pageHeader h1 { font-size: 20px; }
  .pageSub { font-size: 13px; margin-top: 4px; }
}

/* ============================================================
   DASHBOARD (page header + stat cards)
   ============================================================ */
.pageHeader { padding: 26px 28px 12px; }

.pageHeader h1 {
  margin: 0;
  font-size: 24px;
  font-weight: 700;
  color: var(--primary);
  line-height: 1.3;
}

.pageSub {
  margin-top: 6px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.dashboardRow {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  padding: 0 28px;
}

@media (max-width: 980px) {
  .dashboardRow { grid-template-columns: 1fr; gap: 10px; padding: 8px 16px 0; }
}

.miniCard {
  background: #fff;
  border: 1px solid var(--border);
  border-top: 3px solid var(--accent);
  border-radius: var(--radius);
  padding: 16px 18px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow .2s ease, transform .2s ease;
}
.miniCard:hover {
  box-shadow: var(--shadow);
  transform: translateY(-1px);
}

.miniTitle {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .07em;
}

.miniValue {
  margin-top: 8px;
  font-size: 28px;
  font-weight: 700;
  color: var(--text-strong);
  line-height: 1;
}

.miniSub {
  margin-top: 5px;
  font-size: 12px;
  color: var(--muted);
}

.infoAlert {
  margin: 16px 28px 0;
  padding: 12px 16px;
  border: 1px solid #bae6fd;
  background: linear-gradient(135deg, #e0f2fe 0%, #f0f9ff 100%);
  color: #0369a1;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 500;
}

/* ============================================================
   HERO BANNER
   ============================================================ */
.heroBanner {
  position: relative;
  overflow: hidden;
  background: var(--primary);
}

.heroBannerIllus {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.heroBannerIllus svg {
  width: 100%;
  height: 100%;
  display: block;
}

/* Two-column content layer */
.heroBannerContent {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  padding: 16px 32px;
  gap: 20px;
}

.heroBannerText {
  flex: 1 1 0;
  min-width: 0;
}

.heroBannerPill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 14px;
  background: rgba(132,204,22,.13);
  border: 1px solid rgba(132,204,22,.32);
  border-radius: 999px;
  color: rgba(190,242,100,.95);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .02em;
  margin-bottom: 12px;
}

.heroBannerText h1 {
  font-size: 27px;
  font-weight: 800;
  color: #ffffff;
  line-height: 1.25;
  margin: 0 0 10px;
  letter-spacing: -.01em;
}

.heroBannerText .pageSub {
  color: rgba(255,255,255,.65);
  font-size: 14.5px;
  line-height: 1.55;
  margin-top: 0;
  margin-bottom: 18px;
}

.heroCta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 22px;
  background: #84cc16;
  border: none;
  border-radius: var(--radius);
  color: #1a3a1a;
  font-size: 14px;
  font-weight: 700;
  font-family: var(--font);
  cursor: pointer;
  transition: background .2s ease, transform .15s ease, box-shadow .2s ease;
  box-shadow: 0 4px 14px rgba(132,204,22,.32);
}
.heroCta:hover {
  background: #a3e635;
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(132,204,22,.42);
}
.heroCta:active { transform: translateY(0); box-shadow: none; }
.heroCta:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(132,204,22,.4); }

.heroBannerVisual {
  flex: 0 0 340px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.heroIllustSvg {
  width: 100%;
  height: auto;
  display: block;
}

@media (max-width: 980px) {
  .heroBannerContent { padding: 12px 20px; }
  .heroBannerVisual { flex: 0 0 260px; }
  .heroBannerText h1 { font-size: 20px; }
  .heroBannerText .pageSub { font-size: 13px; }
}

@media (max-width: 700px) {
  .heroBannerContent { flex-direction: column; padding: 22px 16px 18px; gap: 0; align-items: flex-start; }
  .heroBannerVisual { display: none; }
  .heroBannerText h1 { font-size: 18px; }
  .heroBannerText .pageSub { font-size: 13px; margin-bottom: 14px; }
}

/* ============================================================
   STATS SECTION (bottom of shell)
   ============================================================ */
.statsSection {
  width: min(880px, 96vw);
}

.statsLabel {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .09em;
  margin-bottom: 10px;
}

.statsRow {
  padding: 0;
  width: 100%;
}

@media (max-width: 980px) {
  .statsSection { display: none; }
}

/* ============================================================
   APP SHELL + QUESTION CARD
   ============================================================ */
.shell {
  min-height: calc(100vh - var(--topbar-h));
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 28px 20px;
  gap: 20px;
}

.card {
  width: min(880px, 96vw);
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  overflow: hidden;
}

.header {
  display: flex;
  gap: 20px;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  background: linear-gradient(135deg, rgba(30,58,138,.025) 0%, rgba(132,204,22,.035) 100%);
  border-bottom: 1px solid var(--border-2);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo {
  width: 40px; height: 40px;
  border-radius: var(--radius);
  display: grid;
  place-items: center;
  background: var(--primary);
  color: #fff;
  font-weight: 700;
  font-size: 18px;
  letter-spacing: -.01em;
  flex-shrink: 0;
}

.logoImg {
  height: 36px;
  width: auto;
  display: block;
  border-radius: var(--radius-sm);
}

h1, h2, .blue { color: var(--primary); }

h1 {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
}

.sub {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.divider { height: 1px; background: var(--border); }

.content { padding: 24px; }
.screen.hidden { display: none; }

h2 {
  margin: 0 0 12px;
  font-size: 20px;
  font-weight: 700;
  line-height: 1.35;
  color: var(--text-strong);
}

.muted { color: var(--muted); }
.tiny { font-size: 12px; color: var(--muted); }

/* ============================================================
   START TILES
   ============================================================ */
.grid2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 16px;
}

@media (max-width: 720px) {
  .header { flex-direction: column; align-items: flex-start; }
  .grid2 { grid-template-columns: 1fr; }
}

.tile {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0 12px;
  text-align: left;
  padding: 20px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
  cursor: pointer;
  transition: border-color .22s ease, box-shadow .22s ease, transform .18s ease;
}
.tile:hover {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(132,204,22,.1), var(--shadow);
  transform: translateY(-2px);
}

.tileTitle {
  flex: 1 1 0;
  min-width: 0;
  font-weight: 700;
  font-size: 15px;
  color: var(--text-strong);
}

.tileDesc {
  flex: 0 0 100%;
  margin-top: 8px;
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.5;
}

.hint {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
  padding: 8px 14px;
  border: 1px dashed var(--border);
  border-radius: 999px;
  background: var(--border-2);
  font-size: 12.5px;
  color: var(--muted);
}

.dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--primary);
  flex-shrink: 0;
}

/* ============================================================
   QUESTION UI
   ============================================================ */
.qTop {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.pill {
  padding: 5px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #fff;
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
}
.pill.subtle { background: var(--border-2); color: var(--muted); }

.qBody {
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.label {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .06em;
}

input[type="text"],
input[type="number"],
select,
textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
  color: var(--text-strong);
  outline: none;
  font-family: var(--font);
  font-size: 14px;
  font-weight: 400;
  transition: border-color .2s ease, box-shadow .2s ease;
}

textarea { min-height: 100px; resize: vertical; }

input[type="text"]:focus,
input[type="number"]:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(132,204,22,.18);
}

.selectWrap { position: relative; width: 100%; }
.selectWrap select { padding-right: 36px; appearance: none; -webkit-appearance: none; -moz-appearance: none; }
.selectWrap::after {
  content: "▾";
  position: absolute;
  right: 12px; top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  pointer-events: none;
  font-size: 12px;
  line-height: 1;
}

select option { background: #fff; color: var(--text-strong); }
select option[value=""] { color: var(--muted); }
select option:checked { background: rgba(132,204,22,.14); color: var(--text-strong); }

/* Choice items */
.choiceGrid { display: grid; grid-template-columns: 1fr; gap: 8px; }

.choice {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 13px 16px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
  cursor: pointer;
  transition: border-color .2s ease, background .2s ease;
}
.choice:hover { background: var(--border-2); border-color: #cbd5e1; }
.choice input { margin-top: 3px; accent-color: var(--accent); }
.choice .title { font-weight: 600; font-size: 14px; color: var(--text-strong); }
.choice .desc { margin-top: 2px; color: var(--muted); font-size: 12.5px; }

/* Actions + buttons */
.actions {
  margin-top: 20px;
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.btn {
  padding: 10px 22px;
  border: 1.5px solid var(--primary-2);
  border-radius: var(--radius);
  background: var(--primary);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background .2s ease, box-shadow .2s ease, transform .15s ease, border-color .2s ease;
}
.btn:hover {
  background: var(--accent-2);
  border-color: var(--accent-2);
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; box-shadow: none; }

.btn.ghost {
  background: #fff;
  color: var(--text);
  border: 1.5px solid var(--border);
}
.btn.ghost:hover {
  background: var(--border-2);
  border-color: #cbd5e1;
  color: var(--text-strong);
  transform: none;
  box-shadow: none;
}

/* Progress */
.progressWrap {
  width: min(320px, 100%);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.progressMeta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 12px;
  color: var(--muted);
  font-weight: 500;
}

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

.miniResetBtn {
  flex: 0 0 auto;
  padding: 4px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
  transition: all .2s ease;
}
.miniResetBtn:hover { background: var(--border-2); border-color: #cbd5e1; color: var(--text); }
.miniResetBtn:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(132,204,22,.16); }

.progressBar {
  height: 6px;
  border-radius: 999px;
  background: var(--border);
  overflow: hidden;
}

.progressFill {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  border-radius: 999px;
  transition: width .4s cubic-bezier(.4,0,.2,1);
}

/* ============================================================
   RESULTS / OFFERS
   ============================================================ */
.offers {
  margin-top: 16px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
@media (max-width: 820px) { .offers { grid-template-columns: 1fr; } }

.offerCard {
  padding: 20px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
  transition: border-color .22s ease, box-shadow .22s ease, transform .2s ease;
}
.offerCard:hover {
  border-color: rgba(132,204,22,.5);
  box-shadow: 0 8px 24px rgba(132,204,22,.1), var(--shadow);
  transform: translateY(-2px);
}

.offerTop {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: flex-start;
}

.badge {
  padding: 5px 11px;
  border: 1px solid rgba(132,204,22,.4);
  border-radius: 999px;
  background: rgba(132,204,22,.14);
  color: var(--primary);
  font-size: 11.5px;
  font-weight: 700;
  white-space: nowrap;
  letter-spacing: .02em;
}

.offerName { margin: 0; font-weight: 700; font-size: 16px; color: var(--text-strong); }
.offerSub { margin: 6px 0 0; color: var(--muted); font-size: 13px; line-height: 1.45; }

.kpis {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 14px;
}

.kpi {
  padding: 10px 12px;
  border: 1px solid var(--border-2);
  border-radius: var(--radius-sm);
  background: var(--page);
}
.kpi .k {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
}
.kpi .v {
  margin-top: 4px;
  font-size: 15px;
  font-weight: 700;
  color: var(--text-strong);
}

.offerActions {
  margin-top: 16px;
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}
.offerActions .btn { padding: 8px 16px; font-size: 13px; }

.resultsMeta {
  margin-top: 12px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.65;
  box-shadow: var(--shadow-xs);
}

/* ============================================================
   FOOTER
   ============================================================ */
.footer {
  width: min(880px, 96vw);
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 0 4px;
  color: var(--muted);
  font-size: 12px;
}

.footerTop {
  display: flex;
  justify-content: space-between;
}

.storycredits {
  margin: 0;
  font-size: 11px;
  color: var(--muted);
  opacity: .75;
}
.storycredits a {
  color: inherit;
  text-decoration: none;
}
.storycredits a:hover { text-decoration: underline; }

/* ============================================================
   MOBILE SHELL
   ============================================================ */
@media (max-width: 980px) {
  .shell { padding: 16px 12px; gap: 14px; }
  .card { width: 100%; border-radius: var(--radius); }
  .header { padding: 16px; gap: 12px; }
  .content { padding: 16px; }
  .progressWrap { width: 100%; }
}

/* ============================================================
   GLOSSARY
   ============================================================ */

.glossaryItem {
  padding: 16px 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
  transition: box-shadow .2s ease;
}
.glossaryItem:hover { box-shadow: var(--shadow-sm); }

.glossaryItem h3 {
  margin: 0 0 8px;
  font-size: 15px;
  font-weight: 700;
  color: var(--primary);
}

.glossaryItem p {
  margin: 0;
  line-height: 1.65;
  color: var(--text);
  font-size: 13.5px;
}

/* ============================================================
   UTILITIES
   ============================================================ */
.hidden { display: none !important; }

.resultsError {
  margin-top: 14px;
  padding: 12px 16px;
  border: 1px solid #fecdd3;
  background: #fff1f2;
  color: #9f1239;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 500;
}

.recommendationBox {
  margin-top: 14px;
  padding: 18px 20px;
  border: 1px solid rgba(30,58,138,.15);
  border-left: 4px solid var(--primary);
  border-radius: var(--radius);
  background: rgba(30,58,138,.025);
  box-shadow: var(--shadow-xs);
}

.recommendationTitle {
  margin: 0 0 10px;
  font-size: 15px;
  font-weight: 700;
  color: var(--primary);
}

.recommendationText {
  margin: 0;
  color: var(--text);
  font-size: 14px;
  line-height: 1.65;
}

/* ============================================================
   RESPONSIVE FINE-TUNING
   ============================================================ */
@media (max-width: 700px) {
  #screenStart > h2 { display: none; }
}

@media (max-width: 720px) {
  .progressMeta { align-items: flex-start; }
  .miniResetBtn { padding: 4px 8px; font-size: 11px; }
  .loginBtn { padding: 6px 12px; font-size: 12.5px; gap: 6px; }
  .loginIcon { width: 16px; height: 16px; }
  .loginIconSvg { width: 12px; height: 12px; }
}

/* ============================================================
   LOADING STATE
   ============================================================ */
.loadingState {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 40px 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
  margin-top: 14px;
}

.loadingSpinner {
  width: 38px;
  height: 38px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-right-color: var(--accent);
  border-radius: 50%;
  animation: loaderSpin .7s linear infinite;
}

@keyframes loaderSpin {
  to { transform: rotate(360deg); }
}

.loadingDots {
  display: flex;
  gap: 5px;
}

.loadingDot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--primary);
  opacity: .25;
  animation: dotPulse 1.2s ease-in-out infinite;
}
.loadingDot:nth-child(2) { animation-delay: .2s; }
.loadingDot:nth-child(3) { animation-delay: .4s; }

@keyframes dotPulse {
  0%, 80%, 100% { opacity: .25; transform: scale(.85); }
  40%           { opacity: 1;   transform: scale(1.1);  }
}

.loadingText {
  font-size: 13.5px;
  color: var(--muted);
  font-weight: 500;
}

/* Bold text inside recommendation */
.recommendationText strong {
  font-weight: 700;
  color: var(--text-strong);
}

/* ============================================================
   SCREEN TRANSITIONS (change 3)
   ============================================================ */
@keyframes screenFadeIn {
  from { opacity: 0; transform: translateY(7px); }
  to   { opacity: 1; transform: translateY(0); }
}
.screen:not(.hidden) {
  animation: screenFadeIn .22s ease forwards;
}

/* ============================================================
   SELECTED CHOICE HIGHLIGHT (change 1)
   ============================================================ */
.choice:has(input:checked) {
  background: rgba(132,204,22,.07);
  border-color: var(--accent);
}
.choice:has(input:checked) .title {
  color: var(--primary);
}

/* ============================================================
   TILE ICONS (change 2)
   ============================================================ */
.tileIcon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px; height: 40px;
  border-radius: var(--radius);
  background: rgba(30,58,138,.08);
  color: var(--primary);
  transition: background .22s ease;
  flex-shrink: 0;
}
.tileIcon svg { width: 20px; height: 20px; display: block; }
.tile:hover .tileIcon { background: rgba(132,204,22,.18); }

/* ============================================================
   SIDEBAR COMPLETION INDICATORS (change 5)
   ============================================================ */
.sideLink.done {
  color: var(--text);
}
.sideLink.done::after {
  content: "✓";
  position: absolute;
  right: 14px;
  font-size: 11px;
  font-weight: 800;
  color: var(--accent);
  line-height: 1;
}
@media (max-width: 980px) {
  .sideLink.done::after { display: none; }
}

/* ============================================================
   SCREEN SUBTITLE (change 7)
   ============================================================ */
.screenSubtitle {
  margin: -6px 0 18px;
  font-size: 15px;
  color: var(--muted);
  line-height: 1.5;
}

/* ============================================================
   GLOSSARY GROUPS (change 8)
   ============================================================ */
.glossaryList {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.glossaryGroup {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.glossaryGroupLabel {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px; height: 30px;
  border-radius: var(--radius-sm);
  background: var(--primary);
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: .02em;
  margin-bottom: 2px;
  flex-shrink: 0;
}

/* ============================================================
   INFO ALERT IN SHELL
   ============================================================ */
.shellInfoAlert {
  width: min(880px, 96vw);
  margin: 0;
}

/* ============================================================
   COMPACT CARD HEADER (mobile)
   ============================================================ */
@media (max-width: 980px) {
  .header { padding: 12px 16px; gap: 10px; }
}

@media (max-width: 600px) {
  /* Hide brand on small screens — topbar already identifies the app */
  .header .brand { display: none; }
  .header { padding: 8px 14px; }
  .header .progressWrap { width: 100%; }
}
