/* BarPath — navy + brass, light and dark.
   Light is the default: students read in daylight, on phones. */

/* Fonts: the house pair, shared with the ATHE companions and the shop, so the
   whole platform reads as one publisher. Self-hosted from the companions'
   folder — no third-party request, and no second copy on disk.
   The previous Lora/Source Sans treatment is kept as styles-navy-previous.css. */
@font-face {
  font-family: "Outfit"; font-style: normal; font-weight: 500 800; font-display: swap;
  src: url("../athe-academy/shared/fonts/outfit-latin.woff2") format("woff2");
}
@font-face {
  font-family: "Jakarta"; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url("../athe-academy/shared/fonts/jakarta-latin.woff2") format("woff2");
}
@font-face {
  font-family: "Jakarta"; font-style: italic; font-weight: 400 600; font-display: swap;
  src: url("../athe-academy/shared/fonts/jakarta-italic-latin.woff2") format("woff2");
}

:root,
:root[data-theme="light"] {
  /* the house canvas, identical to the ATHE companions */
  --bg:        #f7f7f5;
  --surface:   #ffffff;
  --surface2:  #f1f1ee;
  --surface3:  #e6e7e2;
  --border:    #e4e5e0;
  --border2:   #c6c8c2;

  --ink:       #15181d;
  --ink2:      #4a4f57;
  --ink3:      #6b717a;
  --deep:      #11151b;

  /* BarPath is the law app, so it takes the ATHE Law pair: navy and gold */
  --navy:      #13294f;
  --brass:     #7d5e16;
  --brass-bg:  #fbf3e2;

  --ok:        #0f7a4a;  --ok-bg:     #dff5e8;
  --no:        #bd2a1b;  --no-bg:     #fde8e5;
  --amber:     #7d5e16;  --amber-bg:  #fbf3e2;
  --blue:      #0c4a6e;  --blue-bg:   #e0f0fa;
  --violet:    #4b2a86;  --violet-bg: #ece4fb;
  --green:     #0f7a4a;  --green-bg:  #dff5e8;
  --red:       #bd2a1b;  --red-bg:    #fde8e5;

  --shadow:    0 2px 8px rgba(17,21,27,.07);
  --shadow-sm: 0 1px 2px rgba(17,21,27,.06);
  --serif: "Outfit", system-ui, sans-serif;
  --sans:  "Jakarta", "Plus Jakarta Sans", system-ui, -apple-system, sans-serif;
  --mono:  ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

:root[data-theme="dark"] {
  --bg:        #12151a;
  --surface:   #1b1f26;
  --surface2:  #242932;
  --surface3:  #2f353f;
  --border:    #343a45;
  --border2:   #48505d;

  --ink:       #eef1f5;
  --ink2:      #bdc4cd;
  --ink3:      #8d95a0;
  --deep:      #eef1f5;

  --navy:      #a8c4ec;
  --brass:     #e0bc72;
  --brass-bg:  #3a2f13;

  --ok:        #55d68e;  --ok-bg:     #0d331f;
  --no:        #ff9c8a;  --no-bg:     #3f1a13;
  --amber:     #e0bc72;  --amber-bg:  #3a2f13;
  --blue:      #8fc2f5;  --blue-bg:   #0e2745;
  --violet:    #c4a7f5;  --violet-bg: #2a1b47;
  --green:     #55d68e;  --green-bg:  #0d331f;
  --red:       #ff9c8a;  --red-bg:    #3f1a13;

  --shadow:    0 12px 36px rgba(0,0,0,.55);
  --shadow-sm: 0 1px 2px rgba(0,0,0,.5);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg:#12151a; --surface:#1b1f26; --surface2:#242932; --surface3:#2f353f;
    --border:#343a45; --border2:#48505d;
    --ink:#eef1f5; --ink2:#bdc4cd; --ink3:#8d95a0; --deep:#eef1f5;
    --navy:#a8c4ec; --brass:#e0bc72; --brass-bg:#3a2f13;
    --ok:#55d68e; --ok-bg:#0d331f; --no:#ff9c8a; --no-bg:#3f1a13;
    --amber:#e0bc72; --amber-bg:#3a2f13; --blue:#8fc2f5; --blue-bg:#0e2745;
    --violet:#c4a7f5; --violet-bg:#2a1b47; --green:#55d68e; --green-bg:#0d331f;
    --red:#ff9c8a; --red-bg:#3f1a13;
    --shadow:0 12px 36px rgba(0,0,0,.55); --shadow-sm:0 1px 2px rgba(0,0,0,.5);
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--sans); font-size: 16px; line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  padding-bottom: calc(64px + env(safe-area-inset-bottom));
}
h1, h2, h3, h4 { font-family: var(--serif); color: var(--navy); margin: 0 0 .5rem; line-height: 1.25; }
h1 { font-size: 1.75rem; letter-spacing: -.01em; }
h2 { font-size: 1.3rem; }
h3 { font-size: 1.05rem; }
p  { margin: 0 0 .75rem; }
a  { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, textarea, select { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--brass); outline-offset: 2px; border-radius: 6px; }

/* ---------- layout ---------- */
.wrap { max-width: 720px; margin: 0 auto; padding: 0 16px; }
.view { padding: 18px 0 32px; }
.topbar {
  position: sticky; top: 0; z-index: 30;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid var(--border);
}
.topbar .wrap { display: flex; align-items: center; gap: 10px; min-height: 54px; }
.topbar .t-title { font-family: var(--serif); font-weight: 600; font-size: 1rem; flex: 1; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.iconbtn {
  background: none; border: 1px solid transparent; border-radius: 10px;
  width: 38px; height: 38px; display: grid; place-items: center;
  cursor: pointer; color: var(--ink2); font-size: 1.1rem; flex: none;
}
.iconbtn:hover { background: var(--surface2); color: var(--ink); }

.kicker { font-size: .72rem; letter-spacing: .14em; text-transform: uppercase;
  color: var(--brass); font-weight: 700; margin: 0 0 .35rem; }
.sub { color: var(--ink2); }
.muted { color: var(--ink3); font-size: .85rem; }

/* ---------- cards ---------- */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 14px; padding: 16px; margin-bottom: 12px; box-shadow: var(--shadow-sm);
}
button.card, a.card { display: block; width: 100%; text-align: left; cursor: pointer; }
button.card:hover, a.card:hover { border-color: var(--brass); text-decoration: none; }
.card-row { display: flex; align-items: center; gap: 12px; }
.card-row .grow { flex: 1; min-width: 0; }
.chev { color: var(--ink3); flex: none; }
.emoji {
  width: 46px; height: 46px; border-radius: 12px; flex: none;
  display: grid; place-items: center; font-size: 1.4rem; background: var(--surface2);
}
.accent-brass  .emoji { background: var(--brass-bg); }
.accent-blue   .emoji { background: var(--blue-bg); }
.accent-green  .emoji { background: var(--green-bg); }
.accent-violet .emoji { background: var(--violet-bg); }
.accent-amber  .emoji { background: var(--amber-bg); }
.accent-red    .emoji { background: var(--red-bg); }

/* ---------- pills / tags ---------- */
.pill {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: .72rem; font-weight: 700; letter-spacing: .03em;
  padding: 3px 9px; border-radius: 999px; background: var(--surface2); color: var(--ink2);
}
.pill.gh   { background: var(--blue-bg);   color: var(--blue); }
.pill.uk   { background: var(--violet-bg); color: var(--violet); }
.pill.ok   { background: var(--ok-bg);     color: var(--ok); }
.pill.lock { background: var(--amber-bg);  color: var(--amber); }
.pill.free { background: var(--ok-bg);     color: var(--ok); }

/* ---------- progress ---------- */
.bar { height: 8px; border-radius: 999px; background: var(--surface3); overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--brass); border-radius: 999px;
  transition: width .35s ease; }
.bar.ok > i { background: var(--ok); }

/* ---------- prose ---------- */
.prose { font-size: 1.02rem; line-height: 1.7; }
.prose p { margin: 0 0 .9rem; }
.prose strong { color: var(--navy); }
.prose ul { margin: 0 0 .9rem; padding-left: 1.25rem; }
.prose li { margin-bottom: .35rem; }
.prose li::marker { color: var(--brass); }
.prose .blockquote { font-size: .97rem; }

.blockquote, .statute {
  background: var(--surface2); border-left: 3px solid var(--brass);
  border-radius: 0 10px 10px 0; padding: 12px 14px; margin: 0 0 12px;
  font-family: var(--serif); white-space: pre-wrap;
}
.goal {
  background: var(--brass-bg); border: 1px solid color-mix(in srgb, var(--brass) 35%, transparent);
  border-radius: 12px; padding: 12px 14px; margin-bottom: 16px;
  font-family: var(--serif); color: var(--navy);
}
.section-h { display: flex; align-items: center; gap: 9px; margin: 20px 0 8px; }
.section-h .ic { font-size: 1.15rem; }
.section-h h3 { margin: 0; color: var(--brass); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--brass); color: #fff; border: 1px solid var(--brass);
  padding: 11px 16px; border-radius: 11px; font-weight: 700; cursor: pointer;
}
:root[data-theme="dark"] .btn:not(.ghost) { color: #12151a; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .btn:not(.ghost) { color: #12151a; } }
.btn:hover { filter: brightness(1.06); }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--border2); }
.btn.block { width: 100%; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

/* ---------- quiz ---------- */
.q { margin-bottom: 18px; }
.q .stem { font-weight: 600; margin-bottom: 10px; }
.opt {
  display: flex; gap: 10px; align-items: flex-start; width: 100%; text-align: left;
  background: var(--surface); border: 1.5px solid var(--border); border-radius: 11px;
  padding: 11px 13px; margin-bottom: 8px; cursor: pointer;
}
.opt:hover:not([disabled]) { border-color: var(--brass); }
.opt .mark { flex: none; font-weight: 700; width: 1.2em; color: var(--ink3); }
.opt.is-right { border-color: var(--ok); background: var(--ok-bg); }
.opt.is-wrong { border-color: var(--no); background: var(--no-bg); }
.opt.is-right .mark, .opt.is-wrong .mark { color: inherit; }
.why {
  border-radius: 10px; padding: 10px 12px; margin-top: 4px; font-size: .92rem;
  background: var(--surface2); border-left: 3px solid var(--border2);
}
.why.right { background: var(--ok-bg); border-left-color: var(--ok); }
.why.wrong { background: var(--no-bg); border-left-color: var(--no); }

/* ---------- flashcards ---------- */
.flash {
  background: var(--surface); border: 1px solid var(--border); border-radius: 16px;
  padding: 28px 20px; min-height: 190px; display: grid; place-items: center;
  text-align: center; cursor: pointer; box-shadow: var(--shadow); margin-bottom: 14px;
}
.flash .front { font-family: var(--serif); font-size: 1.2rem; color: var(--navy); }
.flash .back { color: var(--ink2); margin-top: 12px; }

/* ---------- lock ---------- */
.locked { position: relative; }
.lockwrap {
  background: var(--surface2); border: 1px dashed var(--border2);
  border-radius: 14px; padding: 20px; text-align: center;
}
.fade-out {
  -webkit-mask-image: linear-gradient(180deg, #000 30%, transparent 100%);
          mask-image: linear-gradient(180deg, #000 30%, transparent 100%);
  max-height: 260px; overflow: hidden;
}


/* ---------- the path rail ---------- */
.rail {
  display: flex; align-items: flex-start; gap: 0;
  overflow-x: auto; -webkit-overflow-scrolling: touch;
  padding: 4px 0 14px; margin-bottom: 4px;
  scrollbar-width: none;
}
.rail::-webkit-scrollbar { display: none; }
.rail-stop {
  flex: none; display: grid; justify-items: center; gap: 5px;
  width: 62px; color: var(--ink3); text-decoration: none;
}
.rail-stop:hover { text-decoration: none; }
.rail-dot {
  width: 34px; height: 34px; border-radius: 999px;
  display: grid; place-items: center;
  background: var(--surface); border: 1.5px solid var(--border2);
  font-size: .72rem; font-weight: 700; color: var(--ink2);
}
.rail-label { font-size: .64rem; font-weight: 600; text-align: center; line-height: 1.2; }
.rail-stop.done .rail-dot { background: var(--ok-bg); border-color: var(--ok); color: var(--ok); }
.rail-stop.done .rail-label { color: var(--ok); }
.rail-stop.shut .rail-dot { opacity: .5; }
.rail-stop.shut .rail-label { opacity: .6; }
.rail-stop.here .rail-dot {
  background: var(--brass); border-color: var(--brass); color: #fff;
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--brass) 22%, transparent);
}
:root[data-theme="dark"] .rail-stop.here .rail-dot { color: #12151a; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .rail-stop.here .rail-dot { color: #12151a; }
}
.rail-stop.here .rail-label { color: var(--brass); font-weight: 700; }
.rail-link {
  flex: none; height: 1.5px; width: 14px; margin-top: 17px;
  background: var(--border2); align-self: flex-start;
}

/* ---------- tab bar ---------- */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  display: grid; grid-template-columns: repeat(4, 1fr);
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: saturate(160%) blur(12px);
  border-top: 1px solid var(--border);
  padding-bottom: env(safe-area-inset-bottom);
}
.tabbar a {
  display: grid; place-items: center; gap: 2px; padding: 8px 4px 9px;
  color: var(--ink3); font-size: .68rem; font-weight: 600; letter-spacing: .02em;
}
.tabbar a:hover { text-decoration: none; }
.tabbar a .ti { font-size: 1.25rem; line-height: 1; }
.tabbar a.on { color: var(--brass); }

/* ---------- misc ---------- */
.search {
  width: 100%; background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; padding: 12px 14px; font-size: 1rem; color: var(--ink);
}
.search::placeholder { color: var(--ink3); }
.grid2 { display: grid; gap: 12px; grid-template-columns: 1fr 1fr; }
.badge-rail { display: flex; flex-wrap: wrap; gap: 8px; }
.badge-chip {
  display: inline-flex; align-items: center; gap: 6px; font-size: .8rem; font-weight: 600;
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: 999px; padding: 6px 11px;
}
.badge-chip.got { background: var(--brass-bg); border-color: var(--brass); color: var(--navy); }
.badge-chip.got .bi { filter: none; }
.badge-chip .bi { filter: grayscale(1); opacity: .45; }
.seg { display: flex; gap: 6px; overflow-x: auto; padding: 2px 0 10px; -webkit-overflow-scrolling: touch; }
.seg button {
  flex: none; background: var(--surface); border: 1px solid var(--border);
  border-radius: 999px; padding: 7px 13px; font-size: .88rem; font-weight: 600;
  color: var(--ink2); cursor: pointer;
}
.seg button.on { background: var(--brass); border-color: var(--brass); color: #fff; }
:root[data-theme="dark"] .seg button.on { color: #12151a; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .seg button.on { color: #12151a; } }
.empty { text-align: center; color: var(--ink3); padding: 32px 16px; }
.cert {
  border: 2px solid var(--brass); border-radius: 16px; padding: 26px 20px;
  text-align: center; background: var(--surface);
}
.cert .seal { font-size: 2.6rem; }
.cert .ctitle { font-family: var(--serif); font-size: 1.4rem; color: var(--navy); margin: 6px 0 2px; }
textarea.notes {
  width: 100%; min-height: 150px; background: var(--surface); color: var(--ink);
  border: 1px solid var(--border); border-radius: 12px; padding: 12px; resize: vertical;
}
.footnote { color: var(--ink3); font-size: .78rem; line-height: 1.5; margin-top: 28px; }
.reform-strip {
  background: var(--amber-bg); color: var(--amber);
  border-bottom: 1px solid color-mix(in srgb, var(--amber) 30%, transparent);
  font-size: .82rem; padding: 7px 0;
}
.reform-strip .wrap { display: flex; gap: 10px; align-items: center; }
.reform-strip button { background: none; border: 0; color: inherit; cursor: pointer; opacity: .7; font-size: 1rem; }

@media (min-width: 860px) {
  body { padding-bottom: 0; }
  .tabbar {
    position: sticky; top: 0; bottom: auto;
    grid-template-columns: repeat(4, auto); justify-content: center; gap: 4px;
    border-top: 0; border-bottom: 1px solid var(--border);
  }
  .tabbar a { grid-auto-flow: column; padding: 12px 18px; font-size: .82rem; }
  h1 { font-size: 2.1rem; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* ---------- unit switcher: Read / Cards / Quiz ---------- */
.seg {
  display: flex; gap: 6px; background: var(--surface2); border: 1px solid var(--border);
  padding: 5px; border-radius: 12px; margin: 14px 0 18px;
  position: sticky; top: 54px; z-index: 20;
}
.seg button {
  flex: 1; border: none; background: transparent; padding: 10px 6px; border-radius: 9px;
  font-family: var(--sans); font-weight: 600; font-size: .92rem; color: var(--ink2); cursor: pointer;
}
.seg button.on { background: var(--surface); color: var(--navy); box-shadow: var(--shadow-sm); }

.flip {
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  padding: 16px; margin-bottom: 10px; cursor: pointer;
}
.flip:hover { border-color: var(--brass); }
.flip .flip-q { font-family: var(--serif); color: var(--navy); font-weight: 600; font-size: 1.05rem; }
.flip .flip-a { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--border); color: var(--ink); }
.flip .hint { font-size: .72rem; color: var(--ink3); margin-top: 8px; letter-spacing: .02em; }

.score-banner {
  display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-radius: 12px;
  margin-bottom: 16px; font-weight: 600;
}
.score-banner.pass { background: var(--ok-bg); color: var(--ok); }
.score-banner.tryagain { background: var(--amber-bg); color: var(--amber); }

/* ---------- Clarity-inspired course cards ---------- */
.course-card {
  display: block; background: var(--surface); border: 1px solid var(--border);
  border-top: 3px solid var(--border2); border-radius: 14px; padding: 16px;
  margin-bottom: 12px; box-shadow: var(--shadow-sm);
}
.course-card:hover { border-color: var(--brass); text-decoration: none; }
.course-card.done  { border-top-color: var(--brass); }
.course-card.going { border-top-color: var(--blue); }
.cc-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.cc-ico { font-size: 1.5rem; }
.cc-state { font-size: .68rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--ink3); }
.course-card.done .cc-state  { color: var(--brass); }
.course-card.going .cc-state { color: var(--blue); }
.cc-title { font-family: var(--serif); font-size: 1.15rem; color: var(--navy); font-weight: 600; }
.cc-meta { color: var(--ink3); font-size: .8rem; margin-top: 8px; }

/* unit rows with a numbered/tick badge */
.unit-row .card-row { align-items: center; }
.unit-tick {
  flex: none; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center;
  background: var(--surface2); color: var(--ink2); font-weight: 700; font-size: .85rem;
  border: 1px solid var(--border);
}
.unit-tick.done { background: var(--ok-bg); color: var(--ok); border-color: var(--ok); }
.unit-tick.lock { background: transparent; border-style: dashed; }

.welcome-card { border-color: var(--brass); background: var(--brass-bg); }
:root[data-theme="dark"] .welcome-card { background: var(--surface2); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .welcome-card { background: var(--surface2); }
}

/* ---------- SVG tab icons (replace emoji) ---------- */
.tabbar .ti svg { width: 23px; height: 23px; display: block; }
.tabbar a { color: var(--ink3); }
.tabbar a.on { color: var(--brass); }

/* ---------- Platform AI (offline study assistant) ---------- */
.pai-root { position: fixed; right: 14px; bottom: calc(74px + env(safe-area-inset-bottom)); z-index: 60; }
.pai-fab {
  display: inline-flex; align-items: center; gap: 8px; padding: 11px 15px;
  border: none; border-radius: 999px; cursor: pointer;
  background: var(--brass); color: #12151a; font-weight: 700; font-family: var(--sans);
  box-shadow: 0 6px 20px rgba(0,0,0,.28);
}
.pai-fab:hover { filter: brightness(1.05); }
:root[data-theme="dark"] .pai-fab { color: #12151a; }
.pai-root.is-open .pai-fab { display: none; }

.pai-panel {
  position: fixed; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom));
  width: min(400px, calc(100vw - 24px)); height: min(560px, calc(100vh - 90px));
  display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--border); border-radius: 18px;
  box-shadow: var(--shadow); overflow: hidden;
}
.pai-head { display: flex; align-items: center; gap: 8px; padding: 14px 14px 12px;
  border-bottom: 1px solid var(--border); }
.pai-head strong { font-family: var(--serif); color: var(--navy); font-size: 1.05rem; }
.pai-head .pai-sub { color: var(--ink3); font-size: .72rem; flex: 1; min-width: 0; }
.pai-x { background: none; border: none; color: var(--ink2); font-size: 1.2rem; cursor: pointer;
  width: 30px; height: 30px; border-radius: 8px; }
.pai-x:hover { background: var(--surface2); }
.pai-chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 10px 12px 4px; }
.pai-chip { border: 1px solid var(--border); background: var(--surface2); color: var(--ink2);
  border-radius: 999px; padding: 6px 11px; font-size: .78rem; cursor: pointer; }
.pai-chip:hover { border-color: var(--brass); color: var(--ink); }
.pai-msgs { flex: 1; overflow-y: auto; padding: 10px 12px; display: flex; flex-direction: column; gap: 10px; }
.pai-msg { display: flex; }
.pai-user { justify-content: flex-end; }
.pai-bubble { max-width: 88%; padding: 10px 13px; border-radius: 14px; font-size: .92rem; line-height: 1.5; }
.pai-bot .pai-bubble { background: var(--surface2); color: var(--ink); border-bottom-left-radius: 5px; }
.pai-user .pai-bubble { background: var(--brass-bg); color: var(--ink); border-bottom-right-radius: 5px; }
.pai-bubble strong { color: var(--navy); }
.pai-srcs { margin-top: 10px; display: flex; flex-direction: column; gap: 6px; }
.pai-src { display: flex; justify-content: space-between; gap: 8px; align-items: center;
  background: var(--surface); border: 1px solid var(--border); border-radius: 9px;
  padding: 7px 10px; font-size: .82rem; color: var(--ink); font-weight: 600; }
.pai-src:hover { border-color: var(--brass); text-decoration: none; }
.pai-src span { color: var(--brass); font-size: .68rem; text-transform: uppercase; letter-spacing: .04em; font-weight: 700; }
.pai-typing { display: inline-flex; gap: 4px; }
.pai-typing span { width: 6px; height: 6px; border-radius: 50%; background: var(--ink3); animation: paiblink 1.2s infinite; }
.pai-typing span:nth-child(2) { animation-delay: .2s; }
.pai-typing span:nth-child(3) { animation-delay: .4s; }
@keyframes paiblink { 0%,60%,100% { opacity: .3; } 30% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .pai-typing span { animation: none; } }
.pai-form { display: flex; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--border); }
.pai-input { flex: 1; min-width: 0; border: 1px solid var(--border); border-radius: 12px;
  padding: 10px 12px; background: var(--surface2); color: var(--ink); font-size: .92rem; }
.pai-send { border: none; background: var(--brass); color: #12151a; font-weight: 800; font-size: 1.1rem;
  width: 42px; border-radius: 12px; cursor: pointer; }
.pai-foot { margin: 0; padding: 0 12px 10px; color: var(--ink3); font-size: .68rem; }

/* ---------- the hero on the Path view ---------- */
/* Same card the ATHE companions use: the app's own badge, the kicker and
   title, and the progress ring. Navy through to brass, taken off the gavel. */
.hero {
  position: relative; overflow: hidden;
  border-radius: 20px; padding: 26px 22px 24px; margin: 0 0 18px;
  /* literal, not var(--navy): that token flips to near-white in the dark
     theme, and the hero is a dark card with white text in both themes */
  background: linear-gradient(135deg, #0b2136 0%, #1e3d5e 55%, #b99242 100%);
  color: #fff; box-shadow: 0 10px 30px rgba(11, 33, 54, .22);
}
.hero::after {
  content: ""; position: absolute; right: -60px; top: -70px;
  width: 230px; height: 230px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, .24), transparent 66%);
}
.hero .hero-row { display: flex; align-items: center; gap: 16px; position: relative; }
.hero .hero-row .grow { flex: 1; min-width: 0; }
.hero h1 { color: inherit; font-size: 1.75rem; margin: 0 0 .3rem; position: relative; }
.hero .kicker { color: inherit; opacity: .85; }
.hero p { color: inherit; opacity: .93; margin: 0; position: relative; }
.badge-img { border-radius: 14px; flex: none; display: block; box-shadow: 0 3px 12px rgba(0, 0, 0, .3); }

.ring { display: grid; place-items: center; position: relative; flex: none; }
.ring svg { transform: rotate(-90deg); display: block; }
.ring .rbg { stroke: var(--surface3); }
.ring .rfg { stroke: var(--brass); stroke-linecap: round; transition: stroke-dashoffset .5s ease; }
.ring .rlabel { position: absolute; font-family: var(--sans); font-weight: 700; font-size: .82rem; color: var(--ink); }
.hero .ring .rbg { stroke: rgba(255, 255, 255, .3); }
.hero .ring .rfg { stroke: currentColor; }
.hero .ring .rlabel { color: inherit; }
/* The ring lands on the bright metal end of the hero gradient, where a white
   numeral measures about 2.4:1. A scrim disc behind it puts the figure back
   over 6:1 without touching the gradient. */
.hero .ring::before {
  content: ""; position: absolute; inset: -5px; border-radius: 50%;
  background: rgba(8, 20, 36, .42);
}
/* the Download button, stacked under the ring in the hero */
.hero .hero-aside { display: grid; gap: 9px; justify-items: center; flex: none; }
.dl-btn {
  font-family: var(--sans); font-size: .74rem; font-weight: 700; letter-spacing: .02em;
  display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; cursor: pointer;
  padding: 7px 13px; border-radius: 999px; color: #fff;
  background: rgba(8, 20, 36, .42); border: 1px solid rgba(255, 255, 255, .5);
}
.dl-btn:hover { background: rgba(8, 20, 36, .62); }
.dl-btn:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
/* already on the home screen — nothing left to download */
.pwa-installed [data-install] { display: none; }



/* On a narrow phone the badge, the title and the ring fight for one line.
   The progress card below already gives the figure, so the ring gives way. */
@media (max-width: 430px) {
  .hero .hero-aside .ring { display: none; }
  .hero .hero-row { flex-wrap: wrap; }
  .hero .hero-aside { width: 100%; }
  .hero .badge-img { width: 52px; height: 52px; }
  .hero h1 { font-size: 1.55rem; }
}

/* a course the free tier does not open — still browsable, clearly not yours yet */
.course-card.locked { border-top-color: var(--ink3); opacity: .72; }
.course-card.locked .cc-state { color: var(--ink3); }
.course-card.locked:hover { opacity: 1; border-color: var(--brass); }
