:root {
  color-scheme: light;
  --navy: #1f3352;
  --navy2: #2c4a73;
  --gold: #d9a441;
  --gold2: #f3dfae;
  --cream: #faf6ee;
  --card: #fff;
  --ink: #22262e;
  --muted: #6b7280;
  --green: #3f9d5a;
  --green2: #e3f3e7;
  --red: #c2574a;
  --red2: #f8e4e1;
  --blue2: #e9f1fa;
  --line: #e8e1d3;
  --surface: #fff;
  --paper: #fffdf7;
  --track: #eee7d8;
  --tagtext: #5d5340;
  --selbg: #eef3fa;
  --accent: #1f3352;
  --accent2: #2c4a73;
  --oktext: #245c35;
  --notext: #7d2f25;
  --bluetext: #1f4f7a;
  --warm: #f3ead6;
  --warmtext: #6b4e12;
  --lock: #ddd6c8;
  --locktext: #9a9284;
  --ice: #cfe3f5;
  --goldtext: #a77b25;
  --hint: #3f6b3a;
  --mgold: #fff1c2;
  --mgoldt: #8a6410;
  --msil: #eef1f4;
  --msilt: #4f5b68;
  --mbro: #f7e3d3;
  --mbrot: #8a4f24;
  --muted2: #7a7060;
  --good: #2f7d32;
  --low: #b5523f;
  --reviewbg: #f4f8fd;
  --sans: ui-rounded, "SF Pro Rounded", "Segoe UI", Roboto, system-ui, sans-serif;
  --serif: Georgia, "Times New Roman", serif;
}
* {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  -webkit-tap-highlight-color: transparent;
}
body {
  min-height: 100vh;
  display: flex;
  justify-content: center;
}
#app {
  width: 100%;
  max-width: 520px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--cream);
}
button {
  font-family: inherit;
}
h1 {
  font-size: 26px;
  margin: 0 0 6px;
}
h2 {
  font-size: 20px;
  margin: 0 0 6px;
}
h3 {
  font-size: 17px;
  margin: 0 0 4px;
}
p {
  line-height: 1.5;
  margin: 0 0 10px;
}
.top {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 14px;
  padding-top: max(10px, env(safe-area-inset-top));
  background: var(--card);
  border-bottom: 1px solid var(--line);
}
.pill {
  display: flex;
  align-items: center;
  gap: 4px;
  font-weight: 800;
  font-size: 15px;
  flex: none;
}
.pill svg {
  width: 22px;
  height: 22px;
}
.trackbtn {
  display: flex;
  align-items: center;
  gap: 5px;
  background: var(--blue2);
  color: var(--accent2);
  border: none;
  border-radius: 12px;
  padding: 7px 8px;
  font-weight: 800;
  font-size: 13px;
  cursor: pointer;
  min-width: 0;
  flex: 0 1 auto;
}
.trackbtn span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.main {
  flex: 1;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 14px;
}
.bar {
  height: 12px;
  background: var(--track);
  border-radius: 8px;
  overflow: hidden;
}
.bar > div {
  height: 100%;
  background: var(--green);
  border-radius: 8px;
  transition: width 0.5s;
}
.bar.gold > div {
  background: var(--gold);
}
.btn {
  font-weight: 800;
  font-size: 16px;
  border: none;
  border-radius: 14px;
  padding: 13px 18px;
  cursor: pointer;
  background: var(--navy);
  color: #fff;
  border-bottom: 4px solid #12213a;
}
/* pressed look stays inside the button's own area, so a click near the top edge still counts */
.btn:active {
  border-bottom-width: 2px;
  padding-bottom: 15px;
  filter: brightness(0.94);
}
.btn.small:active {
  padding-bottom: calc(8px + 2px);
}
.busy {
  opacity: 0.65;
  cursor: progress;
  pointer-events: none;
  position: relative;
}
.busy::after {
  content: "";
  display: inline-block;
  width: 0.9em;
  height: 0.9em;
  margin-left: 0.5em;
  vertical-align: -0.12em;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
body.waiting {
  cursor: progress;
}
.btn.gold {
  background: var(--gold);
  color: #3b2a08;
  border-bottom-color: #a77b25;
}
.btn.green {
  background: var(--green);
  border-bottom-color: #2a6e3e;
}
.btn.ghost {
  background: transparent;
  color: var(--accent);
  border: 2px solid var(--line);
  border-bottom: 4px solid var(--line);
}
.btn.red {
  background: var(--red);
  border-bottom-color: #8a3a30;
}
.btn.small {
  padding: 8px 12px;
  font-size: 14px;
}
.btn.full {
  width: 100%;
}
.btn:disabled {
  opacity: 0.6;
}
.link {
  background: none;
  border: none;
  color: var(--accent2);
  font-weight: 800;
  cursor: pointer;
  padding: 6px;
  font-size: 15px;
  text-decoration: underline;
}
.opt {
  display: block;
  width: 100%;
  text-align: left;
  font-size: 16px;
  font-weight: 600;
  padding: 13px 14px;
  border-radius: 14px;
  background: var(--surface);
  border: 2px solid var(--line);
  border-bottom-width: 4px;
  margin-bottom: 9px;
  cursor: pointer;
  color: var(--ink);
}
.opt.sel {
  border-color: var(--navy2);
  background: var(--selbg);
}
.opt.ok {
  border-color: var(--green);
  background: var(--green2);
}
.opt.no {
  border-color: var(--red);
  background: var(--red2);
}
.verse {
  font-family: var(--serif);
  font-size: 18px;
  line-height: 1.65;
  background: var(--paper);
  border-left: 4px solid var(--gold);
  padding: 12px 14px;
  margin: 0;
}
.quote {
  font-family: var(--serif);
  font-size: 22px;
  line-height: 1.5;
  font-style: italic;
  background: var(--paper);
  padding: 16px;
  border-radius: 14px;
  border: 1px solid var(--line);
  margin: 0;
}
.ref {
  font-size: 13px;
  color: var(--muted);
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}
.muted {
  color: var(--muted);
}
.small {
  font-size: 14px;
}
.fb {
  border-radius: 16px;
  padding: 12px 14px;
  font-weight: 700;
}
.fb.ok {
  background: var(--green2);
  color: var(--oktext);
}
.fb.no {
  background: var(--red2);
  color: var(--notext);
}
.toast {
  background: var(--blue2);
  color: var(--bluetext);
  border-radius: 14px;
  padding: 10px 12px;
  font-weight: 700;
  font-size: 14px;
}
.toast.warm {
  background: var(--warm);
  color: var(--warmtext);
}
.toast.bad {
  background: var(--red2);
  color: var(--notext);
}
.err {
  color: var(--red);
  font-size: 14px;
  font-weight: 700;
  min-height: 1px;
}
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.chip {
  font-size: 15px;
  font-weight: 700;
  padding: 9px 12px;
  border-radius: 12px;
  border: 2px solid var(--line);
  border-bottom-width: 4px;
  background: var(--surface);
  cursor: pointer;
  color: var(--ink);
}
.chip.sel {
  border-color: var(--navy2);
  background: var(--selbg);
}
textarea,
input[type="text"],
input[type="password"],
input[type="number"],
select {
  width: 100%;
  font-family: inherit;
  font-size: 16px;
  border: 2px solid var(--line);
  border-radius: 12px;
  padding: 10px;
  background: var(--surface);
  color: var(--ink);
}
textarea {
  min-height: 90px;
  resize: vertical;
}
label.f {
  display: block;
  font-weight: 700;
  font-size: 14px;
  margin: 8px 0 4px;
}
.row {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
.spread {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}
.path {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 6px 0;
}
.node {
  width: 66px;
  height: 66px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  font-weight: 800;
  cursor: pointer;
  border: none;
  border-bottom: 6px solid rgba(0, 0, 0, 0.18);
}
.node.done {
  background: var(--gold);
  color: #3b2a08;
}
.node.cur {
  background: var(--navy);
  color: #fff;
  outline: 5px solid var(--gold2);
}
.node.lock {
  background: var(--lock);
  color: var(--locktext);
  cursor: default;
}
.node svg {
  width: 28px;
  height: 28px;
}
.lbl {
  font-size: 12px;
  color: var(--muted);
  text-align: center;
  margin-top: 4px;
  font-weight: 700;
  max-width: 120px;
}
.unit-head {
  border-top: 1px solid var(--line);
  padding-top: 12px;
}
.nav {
  position: sticky;
  bottom: 0;
  display: flex;
  justify-content: space-around;
  background: var(--card);
  border-top: 1px solid var(--line);
  padding: 8px 0 max(10px, env(safe-area-inset-bottom));
}
.nav button {
  background: none;
  border: none;
  font-size: 12px;
  font-weight: 800;
  color: var(--muted);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 4px 10px;
}
.nav button.on {
  color: var(--accent);
}
.nav svg {
  width: 24px;
  height: 24px;
}
.bubble {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 10px 12px;
  font-weight: 700;
  font-size: 14px;
}
.weekdays {
  display: flex;
  justify-content: space-between;
  margin-top: 10px;
}
.wd {
  display: flex;
  flex-direction: column;
  align-items: center;
  font-size: 11px;
  color: var(--muted);
  font-weight: 800;
  gap: 3px;
}
.dot {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--track);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
}
.dot.f {
  background: var(--gold);
  color: #3b2a08;
}
.dot.z {
  background: var(--ice);
  color: var(--bluetext);
}
.dot.t {
  outline: 2px solid var(--navy2);
}
.shop {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}
.char {
  background: var(--surface);
  border: 2px solid var(--line);
  border-radius: 16px;
  padding: 10px;
  text-align: center;
}
.char.eq {
  border-color: var(--gold);
}
.char svg {
  width: 100%;
  max-width: 120px;
}
.big {
  font-size: 22px;
  font-weight: 800;
  margin: 0;
}
.tiles {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.tile {
  background: var(--surface);
  border: 3px solid var(--line);
  border-bottom-width: 6px;
  border-radius: 20px;
  padding: 6px;
  cursor: pointer;
}
.tile svg {
  width: 100%;
  display: block;
}
.tile.ok {
  border-color: var(--green);
  background: var(--green2);
}
.wig {
  animation: wig 0.4s;
}
@keyframes wig {
  25% {
    transform: rotate(-6deg);
  }
  75% {
    transform: rotate(6deg);
  }
}
.pop {
  animation: pop 0.5s;
}
@keyframes pop {
  0% {
    transform: scale(0.6);
  }
  70% {
    transform: scale(1.12);
  }
  100% {
    transform: scale(1);
  }
}
.puz {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 4px;
  max-width: 300px;
  margin: 0 auto;
}
.puz .tile {
  padding: 0;
  border-radius: 10px;
  border-width: 3px;
}
.puz .tile.pick {
  border-color: var(--gold);
}
.speak {
  width: 84px;
  height: 84px;
  border-radius: 50%;
  background: var(--gold);
  border: none;
  border-bottom: 6px solid #a77b25;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
}
.speak svg {
  width: 40px;
  height: 40px;
}
.who {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 12px;
}
.who button {
  background: var(--surface);
  border: 2px solid var(--line);
  border-bottom-width: 5px;
  border-radius: 18px;
  padding: 14px 8px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  font-weight: 800;
  font-size: 16px;
  color: var(--ink);
}
.avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  font-weight: 800;
  color: #fff;
}
.pinpad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  max-width: 280px;
  margin: 0 auto;
}
.pinpad button {
  font-size: 24px;
  font-weight: 800;
  padding: 14px 0;
  border-radius: 16px;
  border: 2px solid var(--line);
  border-bottom-width: 5px;
  background: var(--surface);
  cursor: pointer;
  color: var(--ink);
}
.pindots {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin: 10px 0;
}
.pindots span {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--track);
}
.pindots span.on {
  background: var(--navy);
}
.sheet-bg {
  position: fixed;
  inset: 0;
  background: rgba(20, 25, 35, 0.45);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  z-index: 20;
}
.sheet {
  background: var(--cream);
  width: 100%;
  max-width: 520px;
  border-radius: 22px 22px 0 0;
  padding: 18px 16px max(18px, env(safe-area-inset-bottom));
  max-height: 85vh;
  overflow: auto;
}
.trackrow {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  text-align: left;
  background: var(--surface);
  border: 2px solid var(--line);
  border-bottom-width: 4px;
  border-radius: 16px;
  padding: 12px;
  margin-bottom: 10px;
  cursor: pointer;
  color: var(--ink);
}
.trackrow.sel {
  border-color: var(--navy2);
}
.trackrow.off {
  opacity: 0.55;
  cursor: default;
}
.trackrow .ic {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--blue2);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent2);
  flex: none;
}
.trackrow .ic svg {
  width: 24px;
  height: 24px;
}
.member {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
}
.jpics {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 16px;
  white-space: normal;
}
.picadd {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  margin: 14px 0 14px;
}
.picadd .btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}
.jpic {
  position: relative;
  width: 96px;
  height: 96px;
}
.jpic-img {
  display: block;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  background: var(--surface);
  cursor: pointer;
}
.jpic-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.jpic-x {
  position: absolute;
  top: -8px;
  right: -8px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink);
  font-size: 18px;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
}
.jpic-full {
  display: block;
  max-width: 100%;
  max-height: 75vh;
  margin: 0 auto;
  border-radius: 12px;
}
.entry {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px;
  white-space: pre-wrap;
  line-height: 1.5;
}
.tag {
  display: inline-block;
  font-size: 12px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 8px;
  background: var(--track);
  color: var(--tagtext);
}
.code {
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-align: center;
  background: var(--surface);
  border: 2px dashed var(--gold);
  border-radius: 14px;
  padding: 14px;
}
.center {
  text-align: center;
}
.spacer {
  flex: 1;
}
.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}
.vn {
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 800;
  color: var(--goldtext);
  vertical-align: super;
  margin-right: 3px;
}
.pinbox {
  max-width: 220px;
  margin: 6px auto 4px;
  display: block;
  text-align: center;
  font-size: 30px;
  letter-spacing: 0.4em;
  padding: 10px;
}

/* prophet portraits: initials placeholder until the photo file loads */
.photos {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  margin: 6px 0 14px;
}
.photo {
  margin: 0;
  width: 104px;
  text-align: center;
}
.photos .photo:only-child {
  width: 150px;
}
.ph-frame {
  position: relative;
  aspect-ratio: 4/5;
  border-radius: 14px;
  overflow: hidden;
  background: linear-gradient(160deg, #e9e1cf, #cdbf9f);
  border: 2px solid var(--card);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
}
.ph-init {
  font:
    700 28px/1 Georgia,
    serif;
  color: #6b5a3a;
  letter-spacing: 1px;
}
.ph-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.25s;
}
.ph-img.loaded {
  opacity: 1;
}
.photo figcaption {
  font-size: 12.5px;
  margin-top: 5px;
  color: var(--muted);
  line-height: 1.25;
}

/* character powers */
.power-line {
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px dashed var(--line);
  font-size: 13px;
  line-height: 1.35;
}
.char .pw {
  min-height: 3.9em;
  line-height: 1.3;
  margin: 2px 0 4px;
}
.char button[disabled] {
  opacity: 0.45;
  cursor: not-allowed;
}
.hintbtn {
  align-self: flex-start;
  margin-bottom: 6px;
  border-color: var(--hint);
  color: var(--hint);
}
.levelup {
  background: var(--warm);
  border-color: var(--gold);
}
.dot.extra {
  background: #c94f3d !important;
  border-color: #c94f3d !important;
}

/* mastery, goals, dashboard */
.medal {
  display: inline-block;
  font-size: 12px;
  font-weight: 800;
  padding: 2px 9px;
  border-radius: 999px;
  vertical-align: 3px;
  border: 1.5px solid;
}
.medal.gold {
  background: var(--mgold);
  color: var(--mgoldt);
  border-color: #e0b542;
}
.medal.silver {
  background: var(--msil);
  color: var(--msilt);
  border-color: #aab4bf;
}
.medal.bronze {
  background: var(--mbro);
  color: var(--mbrot);
  border-color: #c98a5a;
}
.medal.sm {
  font-size: 11px;
  padding: 1px 7px;
  margin-right: 3px;
}
.best {
  font-size: 11.5px;
  color: var(--muted2);
  font-weight: 700;
}
.best.full {
  color: var(--good);
}
.review {
  border-color: #7fa7d6;
  background: var(--reviewbg);
}
.goal {
  padding: 10px 0;
  border-top: 1px solid var(--line);
}
.goal:first-of-type {
  border-top: none;
}
.tag.ok {
  background: var(--green2);
  color: var(--oktext);
}
.tag.gold {
  background: var(--mgold);
  color: var(--mgoldt);
}
.chips {
  gap: 6px;
  flex-wrap: wrap;
}
.chips .chip {
  padding: 6px 12px;
  font-size: 14px;
}
.xprow {
  display: grid;
  grid-template-columns: 70px 1fr 56px;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  font-size: 14px;
  font-weight: 700;
}
.xprow b {
  text-align: right;
}
table.dash {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
table.dash th,
table.dash td {
  padding: 6px 5px;
  text-align: center;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
table.dash thead th {
  font-size: 11.5px;
  color: var(--muted2);
  font-weight: 800;
}
table.dash tbody th {
  text-align: left;
}
table.dash td.good {
  color: var(--good);
  font-weight: 800;
}
table.dash td.low {
  color: var(--low);
  font-weight: 800;
}
label.opt {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  font-size: 14px;
  margin: 6px 0;
  line-height: 1.35;
}
label.opt input {
  margin-top: 3px;
}

/* prophet games */
.qimg {
  display: flex;
  justify-content: center;
  margin: 2px 0 4px;
}
.qimg img {
  width: 150px;
  aspect-ratio: 4/5;
  object-fit: cover;
  border-radius: 14px;
  border: 3px solid var(--card);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
}
.mini .photos {
  gap: 6px;
}
.mini .photo {
  width: 62px;
}
.mini .ph-init {
  font-size: 16px;
}
.mini .photo figcaption {
  font-size: 10.5px;
}

/* dark mode: follows the device unless the person picked Light or Dark (html[data-theme]) */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --navy: #2c4a73;
    --navy2: #5b86bd;
    --gold: #d9a441;
    --gold2: #4a3a1a;
    --cream: #12161c;
    --card: #1b2029;
    --ink: #e6e3dc;
    --muted: #9aa3b0;
    --green: #3f9d5a;
    --green2: #18321f;
    --red: #c2574a;
    --red2: #3b1f1b;
    --blue2: #1c2b3e;
    --line: #2f3744;
    --surface: #222833;
    --paper: #1f1d18;
    --track: #2c323d;
    --tagtext: #cdc3ad;
    --selbg: #22344c;
    --accent: #a9c8ee;
    --accent2: #8fb6e8;
    --oktext: #8fd6a3;
    --notext: #f0a99f;
    --bluetext: #a9cdf0;
    --warm: #352c17;
    --warmtext: #e8c977;
    --lock: #2b313b;
    --locktext: #6f7784;
    --ice: #23405e;
    --goldtext: #e0b45a;
    --hint: #8cc486;
    --mgold: #3b3013;
    --mgoldt: #f0c75a;
    --msil: #2a3038;
    --msilt: #c6cfd9;
    --mbro: #3a2618;
    --mbrot: #e4a87b;
    --muted2: #a49b8a;
    --good: #6fcf7f;
    --low: #f08a76;
    --reviewbg: #1a2535;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --navy: #2c4a73;
  --navy2: #5b86bd;
  --gold: #d9a441;
  --gold2: #4a3a1a;
  --cream: #12161c;
  --card: #1b2029;
  --ink: #e6e3dc;
  --muted: #9aa3b0;
  --green: #3f9d5a;
  --green2: #18321f;
  --red: #c2574a;
  --red2: #3b1f1b;
  --blue2: #1c2b3e;
  --line: #2f3744;
  --surface: #222833;
  --paper: #1f1d18;
  --track: #2c323d;
  --tagtext: #cdc3ad;
  --selbg: #22344c;
  --accent: #a9c8ee;
  --accent2: #8fb6e8;
  --oktext: #8fd6a3;
  --notext: #f0a99f;
  --bluetext: #a9cdf0;
  --warm: #352c17;
  --warmtext: #e8c977;
  --lock: #2b313b;
  --locktext: #6f7784;
  --ice: #23405e;
  --goldtext: #e0b45a;
  --hint: #8cc486;
  --mgold: #3b3013;
  --mgoldt: #f0c75a;
  --msil: #2a3038;
  --msilt: #c6cfd9;
  --mbro: #3a2618;
  --mbrot: #e4a87b;
  --muted2: #a49b8a;
  --good: #6fcf7f;
  --low: #f08a76;
  --reviewbg: #1a2535;
}
/* layout preview (body.pv): Today card, compact rows, pinned lesson bar, reading tabs, tablet split */
.pv .today {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.pv .btn.go {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 16px;
  font-size: 18px;
}
.strip {
  display: flex;
  justify-content: space-between;
  gap: 2px;
}
.sday {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  background: none;
  border: none;
  padding: 0;
  font-weight: 800;
  font-size: 11px;
  color: var(--muted);
  cursor: pointer;
}
.sday i {
  font-style: normal;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--lock);
  color: var(--locktext);
  font-size: 13px;
}
.sday i svg {
  width: 18px;
  height: 18px;
}
.sday.open i {
  background: var(--blue2);
  color: var(--accent2);
}
.sday.today i {
  background: var(--navy);
  color: #fff;
}
.sday.done i {
  background: var(--green);
  color: #fff;
}
.sday.pick i {
  box-shadow: 0 0 0 3px var(--gold);
}
.sday.lock {
  cursor: default;
}
/* Come, Follow Me lesson header: day row above the progress bar */
.top.cfmtop {
  flex-wrap: wrap;
  row-gap: 10px;
}
.ldays {
  flex: 0 0 100%;
  display: flex;
  gap: 4px;
}
.lday {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 7px 0;
  border-radius: 10px;
  border: 2px solid var(--line);
  background: var(--surface);
  color: var(--accent);
  font-weight: 800;
  font-size: 13px;
  cursor: pointer;
}
.lday svg {
  flex: none;
}
.lday.done {
  border-color: var(--green);
  color: var(--oktext);
}
.lday.today {
  border-color: var(--gold);
}
.lday.on {
  background: var(--navy);
  border-color: var(--navy);
  color: #fff;
  cursor: default;
}
.lday.lock {
  background: var(--lock);
  border-color: var(--lock);
  color: var(--locktext);
  cursor: default;
}
.lcard {
  padding: 4px 12px;
}
.lrow {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  background: none;
  border: none;
  border-bottom: 1px solid var(--line);
  padding: 10px 2px;
  text-align: left;
  color: var(--ink);
  font: inherit;
  cursor: pointer;
}
.lrow:last-child {
  border-bottom: none;
}
.lrow.lock {
  cursor: default;
  color: var(--muted);
}
.ldot {
  width: 30px;
  height: 30px;
  flex: none;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--lock);
  color: var(--locktext);
}
.ldot svg {
  width: 16px;
  height: 16px;
}
.lrow.cur .ldot {
  background: var(--navy);
  color: #fff;
}
.lrow.done .ldot {
  background: var(--green);
  color: #fff;
}
.lt {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.lt b {
  font-size: 15px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.lt small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.lr {
  flex: none;
  font-size: 12px;
  font-weight: 800;
  color: var(--muted);
}
.lhead {
  padding: 10px 2px 4px;
}
.lsub {
  padding-left: 14px;
}
.pv .actbar {
  position: sticky;
  bottom: 0;
  z-index: 4;
  margin: auto -16px -16px;
  padding: 10px 16px max(14px, env(safe-area-inset-bottom));
  background: var(--cream);
  border-top: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.pv .actbar .fb {
  margin: 0;
}
.pv .actbar .btn {
  margin-top: 0 !important;
}
.tabs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 2px;
}
.tab {
  flex: none;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--accent2);
  border-radius: 999px;
  padding: 6px 12px;
  font-weight: 800;
  font-size: 13px;
  cursor: pointer;
}
.tab.on {
  background: var(--selbg);
  border-color: var(--navy2);
}
.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  align-items: start;
}
.split .pane {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px;
}
@media (min-width: 760px) {
  body.pv.in-lesson #app {
    max-width: 980px;
  }
}
.ustrip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(64px, 1fr));
  gap: 8px;
}
.useg {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 11px;
  font-weight: 800;
  color: var(--muted);
}
.useg.now span {
  color: var(--accent2);
}
.useg.done .bar > div {
  background: var(--green);
}
.useg .medal {
  align-self: flex-start;
}
.dots {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}
.dots i {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--lock);
}
.dots i.d {
  background: var(--green);
}
.dots i.n {
  background: var(--navy);
  box-shadow: 0 0 0 2px var(--gold);
}
.dots i.q {
  border-radius: 3px;
}
.nextt {
  font-size: 18px;
  font-weight: 800;
  line-height: 1.3;
}
.today.locked {
  opacity: 0.7;
}
.useg .bar {
  height: 8px;
}
.tiles6 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}
.btile {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 5px;
  min-height: 46px;
  padding: 7px 8px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.2;
  text-align: left;
  cursor: pointer;
}
.btile .bar {
  height: 5px;
}
.btile.cur {
  border-color: var(--navy2);
  box-shadow: 0 0 0 2px var(--gold);
}
.btile.done {
  background: var(--green2);
}
.btile.off {
  background: var(--track);
  color: var(--locktext);
  border-color: transparent;
  cursor: default;
}
.today.quiet h2 {
  color: var(--muted);
}

/* desktop layout preview (body.desk): per-device opt-in, wide window + mouse only. Full-width web layout. */
.nbrand,
.ntracks {
  display: none;
}
body.tablet #app {
  max-width: none;
}
body.tablet #app > .main {
  padding: 20px 28px;
}
body.tablet .main {
  font-size: 17px;
}
body.tablet .nav button {
  font-size: 13px;
  padding: 6px 18px;
}
body.tablet .nav svg {
  width: 26px;
  height: 26px;
}
.dcols {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}
.dcol {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}
body.desk {
  display: block;
  background: var(--cream);
}
body.desk #app {
  max-width: none;
  min-height: 100vh;
}
body.desk .main {
  font-size: 17px;
}
body.desk h2 {
  font-size: 22px;
}
body.desk .card {
  border-radius: 12px;
}
body.desk .btn {
  border-radius: 10px;
}
body.desk #app.hasnav {
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
  grid-template-rows: auto 1fr;
  align-content: start;
}
body.desk #app.hasnav > .top {
  grid-column: 2;
  grid-row: 1;
}
body.desk #app.hasnav > .main {
  grid-column: 2;
  grid-row: 2;
  padding: 28px max(36px, calc((100% - 2000px) / 2)) 40px;
}
body.desk #app.hasnav > .nav {
  grid-column: 1;
  grid-row: 1/3;
  position: sticky;
  top: 0;
  align-self: start;
  height: 100vh;
  overflow-y: auto;
  flex-direction: column;
  justify-content: flex-start;
  gap: 2px;
  padding: 20px 12px;
  border-top: none;
  border-right: 1px solid var(--line);
}
body.desk .nav button {
  flex-direction: row;
  gap: 12px;
  font-size: 15px;
  padding: 10px 14px;
  border-radius: 10px;
  width: 100%;
  color: var(--muted);
}
body.desk .nav button:hover {
  background: var(--track);
}
body.desk .nav button.on,
body.desk .nlearn.on .nlearn-go {
  background: var(--blue2);
  color: var(--accent);
}
body.desk .nbrand {
  display: block;
  font-weight: 900;
  font-size: 19px;
  color: var(--accent);
  padding: 4px 14px 20px;
}
.nlearn {
  display: flex;
  align-items: center;
  gap: 2px;
}
body.desk .nav .nlearn-go {
  flex: 1;
}
body.desk .nav .nfold {
  width: 38px;
  flex: none;
  justify-content: center;
  padding: 10px 0;
}
body.desk .nav .nfold svg {
  width: 18px;
  height: 18px;
  transition: transform 0.15s;
}
body.desk .ntracks {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin: 2px 0 8px 22px;
  padding-left: 10px;
  border-left: 2px solid var(--line);
}
body.desk .nav .ntrack {
  font-size: 14px;
  padding: 8px 10px;
  gap: 10px;
}
body.desk .nav .ntrack svg {
  width: 18px;
  height: 18px;
}
body.desk .nav .ntrack small {
  margin-left: auto;
  font-size: 11px;
  color: var(--locktext);
}
body.desk .nav .ntrack.cur {
  color: var(--accent);
}
body.desk .nav .ntrack.on {
  background: var(--selbg);
  color: var(--accent);
}
body.desk .nav .ntrack.off {
  opacity: 0.5;
  cursor: default;
}
body.desk .top {
  padding: 14px max(36px, calc((100% - 2000px) / 2));
}
body.desk .tophead {
  font-size: 22px;
  font-weight: 900;
  color: var(--ink);
}
body.desk .tstats {
  display: flex;
  gap: 28px;
}
body.desk .tstats small {
  font-size: 13px;
  color: var(--muted);
  font-weight: 700;
}
.dlearn {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(320px, 0.85fr);
  grid-template-areas: "a b c";
  gap: 24px;
  align-items: start;
}
.dlearn > div {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}
.dlearn .da {
  grid-area: a;
}
.dlearn .db {
  grid-area: b;
}
.dlearn .dc {
  grid-area: c;
}
@media (max-width: 1599px) {
  .dlearn {
    grid-template-columns: minmax(0, 1.3fr) minmax(300px, 1fr);
    grid-template-areas: "a c" "b c";
    grid-template-rows: auto 1fr;
  }
}
body.tablet .dlearn {
  grid-template-columns: minmax(0, 1.3fr) minmax(300px, 1fr);
  grid-template-areas: "a c" "b c";
  grid-template-rows: auto 1fr;
}
/* lessons: sidebar stays; reading column centred at a readable width */
body.desk.in-lesson #app {
  max-width: none;
}
body.desk.in-lesson #app.hasnav > .main {
  padding: 24px max(36px, calc((100% - 1100px) / 2)) 0;
}
body.desk.in-lesson .top.cfmtop,
body.desk.in-lesson .top {
  padding-left: max(24px, calc((100% - 1100px) / 2));
  padding-right: max(24px, calc((100% - 1100px) / 2));
}
body.desk .pv .actbar {
  margin: auto 0 0;
  padding: 14px 0 20px;
}
/* Family page: one column of cards (settings-page style), centred at a readable width */
body.desk[data-view="family"] #app.hasnav > .main {
  padding-left: max(36px, calc((100% - 1000px) / 2));
  padding-right: max(36px, calc((100% - 1000px) / 2));
}
body.desk .sheet-bg {
  align-items: center;
}
body.desk .sheet {
  border-radius: 16px;
  max-width: 560px;
}
body.desk .btn:hover,
body.desk .chip:hover,
body.desk .lrow:hover {
  filter: brightness(1.06);
}
.dwide {
  width: 100%;
}
.dwide td,
.dwide th {
  white-space: nowrap;
}
.dwide td.dlast {
  white-space: normal;
  min-width: 200px;
}
.dsort {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  font-weight: 800;
  color: inherit;
  cursor: pointer;
}
.dsort.on {
  color: var(--accent);
}
.keyhint {
  align-self: flex-end;
  margin: -6px 0 -4px;
  font-size: 12.5px;
  color: var(--muted);
}
table.dash.dwide {
  font-size: 15px;
}
table.dash.dwide thead th {
  font-size: 13px;
}
table.dash.dwide th,
table.dash.dwide td {
  padding: 9px 8px;
}
table.dash tfoot tr.dtotal th,
table.dash tfoot tr.dtotal td {
  font-weight: 800;
  border-top: 2px solid var(--line);
  border-bottom: none;
}
table.dash tfoot tr.dtotal th {
  text-align: left;
}
/* parent dashboard: loading feedback when the range changes */
.loadline {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  margin: 2px 0;
  padding-top: 6px;
}
.loadline::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  border-radius: 3px;
  background: var(--track);
  overflow: hidden;
}
.loadline span {
  position: absolute;
  top: 0;
  left: 0;
  height: 3px;
  width: 35%;
  border-radius: 3px;
  background: var(--accent);
  animation: loadslide 1s ease-in-out infinite;
  z-index: 1;
}
@keyframes loadslide {
  0% {
    left: -35%;
  }
  100% {
    left: 100%;
  }
}
.isloading .card {
  opacity: 0.45;
  transition: opacity 0.15s;
  pointer-events: none;
}
