/* MOSS shared chrome - the one app bar + footer every MOSS app wears. Served from
   shared.mossfixesmoney.com and linked by each app; chrome.js injects the markup. Only the app name (and
   its colour) changes per app; the signature (logo lockup) never does. Colours that depend on the host
   app's theme use var(--x, fallback) so this renders correctly even before/without the app's own tokens. */

/* ---- Layout contract: full-height column so the footer sits at the bottom on short pages. ---------- */
body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
#moss-header {
  flex: none;
}
.moss-main {
  flex: 1 0 auto;
}
#moss-footer {
  margin-top: auto;
}

/* ---- App bar -------------------------------------------------------------------------------------- */
.appbar {
  background: linear-gradient(100deg, #15245c 0%, #1f5f86 56%, #3b2f74 100%);
  color: #fff;
}
.appbar-inner {
  max-width: min(1400px, 92vw);
  margin: 0 auto;
  padding: 12px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

/* The fixed brand lockup (M tile + MOSS + FIXES MONEY) is one SVG image, so the signature never drifts.
   Only the app name beside it changes per app. */
.appbar .brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: #fff;
}
.appbar .brandlogo {
  height: 56px;
  width: auto; /* defend the lockup against a host page's own `.brand img` rules: */
  max-width: none; /* no squish, */
  border-radius: 0; /* no ellipse (a leftover border-radius:50% rounded it into one), */
  object-fit: contain; /* and no stretch. */
  display: block;
}
.appbar .appdiv {
  width: 1px;
  height: 36px;
  background: rgba(255, 255, 255, 0.35);
  margin: 0 4px;
}
.appbar .appname {
  /* Colour is the one per-app tweak (--appname-color, default white). Font + size stay fixed so the name
     is identical everywhere, never inheriting the host page's base font. */
  color: var(--appname-color, #fff);
  font-size: 19px;
  font-weight: 500;
  font-family: Arial, Helvetica, sans-serif;
  letter-spacing: 0.2px;
}

/* ---- Right-side chrome: app launcher + profile. Settings is intentionally omitted (per app). ------- */
.appbar-chrome {
  display: flex;
  align-items: center;
  gap: 8px;
}
.appbar .iconbtn {
  width: 40px; /* match the account hub exactly, so the header never resizes between apps */
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  cursor: pointer;
  padding: 0;
}
.appbar .iconbtn:hover {
  border-color: rgba(255, 255, 255, 0.55);
  background: rgba(255, 255, 255, 0.2);
}
.appbar .iconbtn img {
  width: 22px;
  height: 22px;
  display: block;
}
.appbar .iconbtn.gear svg {
  width: 22px;
  height: 22px;
  display: block;
}
/* The launcher is a bare apps-grid; the person icon is gray when signed out (a real avatar replaces it
   once shared identity is wired). */
.appbar .iconbtn.apps {
  background: transparent;
  border-color: transparent;
}
.appbar .iconbtn.apps:hover {
  background: rgba(255, 255, 255, 0.14);
  border-color: transparent;
}
.appbar .iconbtn.person {
  color: #cbd2e0;
  text-decoration: none;
  overflow: hidden;
}
.appbar .iconbtn.person img.avatar {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}
/* Signed in, the avatar wears a thin white ring like the account hub, so it reads as a framed profile
   photo (and the same size) across every app, not a flat icon. */
.appbar .iconbtn.person:has(img.avatar) {
  border-color: transparent;
  background: transparent;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.65);
}
.appbar .iconbtn.person:has(img.avatar):hover {
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.95);
}
/* Inline person glyph (signed out it is gray; on the blue no-photo avatar it is white). */
.appbar .iconbtn.person svg {
  width: 22px;
  height: 22px;
  display: block;
}
/* Signed in, no photo: a blue default avatar that wears the same white ring as a real photo, with an
   "add a photo" camera cue. The ring makes it read as a framed profile, not a flat icon. */
.appbar .iconbtn.person.nophoto {
  position: relative;
  overflow: visible;
  color: var(--onacc, #fff);
  background: linear-gradient(
    135deg,
    var(--accent, #3b82f6),
    var(--accent2, #1e40af)
  );
  border-color: transparent;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.65);
}
.appbar .iconbtn.person.nophoto:hover {
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.95);
}
.appbar .iconbtn.person .person-cam {
  position: absolute;
  right: -3px;
  bottom: -3px;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: #fff;
  color: #1f2a52;
  display: grid;
  place-items: center;
  box-shadow: 0 0 0 1.5px rgba(8, 12, 26, 0.5);
}
.appbar .iconbtn.person .person-cam svg {
  width: 9px;
  height: 9px;
}

/* ---- App launcher: the colored tile grid (one drawer, identical on every app) --------------------- */
.launchwrap {
  position: relative;
}
.launchmenu {
  position: absolute;
  right: 0;
  top: 48px;
  width: 320px;
  background: var(--card, #141a2e);
  border: 1px solid var(--line, #2a3350);
  border-radius: 14px;
  padding: 14px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45);
  z-index: 20;
}
.launchhead {
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted, #9aa3bd);
  padding: 2px 6px 10px;
}
.launchgrid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}
.launchgrid.two {
  grid-template-columns: repeat(2, 1fr);
}
.launchdiv {
  border-bottom: 1px solid var(--line, #2a3350);
  margin: 8px 2px;
}
.launchmenu .tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  padding: 12px 6px;
  border-radius: 12px;
  text-decoration: none;
  color: var(--text, #e8eefc);
}
.launchmenu .tile:hover {
  background: var(--card2, #1b2440);
}
.launchmenu .tile .ic {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 800;
  font-size: 20px;
}
.launchmenu .tile .nm {
  font-size: 12.5px;
  font-weight: 600;
  text-align: center;
  line-height: 1.15;
}
/* The current app's name uses the theme accent, not the per-app header colour: the header colour is tuned
   for the dark app bar and can be unreadable on a light-themed drawer. The accent is theme-aware, so it
   stays legible in every theme, and the tile already has a selected background to mark "current". */
.launchmenu .tile[aria-current="page"] .nm {
  color: var(--accent, #fff);
  font-weight: 700;
}
.g-home {
  background: linear-gradient(135deg, #0e7490, #4338ca);
}
.g-quiz {
  background: linear-gradient(135deg, #22d3ee, #a855f7);
}
.g-fore {
  background: linear-gradient(135deg, #3b82f6, #1e40af);
}
.g-debt {
  background: linear-gradient(135deg, #fb923c, #f43f5e);
}
.g-subs {
  background: linear-gradient(135deg, #34d399, #14b8a6);
}

/* ---- Profile dropdown: Manage account (or avatar+Change in account) · email · sign out ------------ */
.profilewrap {
  position: relative;
}
.profilemenu {
  position: absolute;
  right: 0;
  top: 48px;
  width: 240px;
  background: var(--card, #141a2e);
  border: 1px solid var(--line, #2a3350);
  border-radius: 12px;
  padding: 8px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45);
  z-index: 20;
}
.profilemenu a,
.profilemenu .menu-item {
  display: block;
  width: 100%;
  text-align: left;
  box-sizing: border-box;
  padding: 9px 10px;
  border: none;
  border-radius: 8px;
  background: none;
  color: var(--text, #e8eefc);
  text-decoration: none;
  font-size: 14px;
  font-family: inherit;
  cursor: pointer;
}
.profilemenu a:hover,
.profilemenu .menu-item:hover {
  background: var(--card2, #1b2440);
}
.profilemenu .menu-sep {
  border-bottom: 1px solid var(--line, #2a3350);
  margin: 6px 2px;
}
.profilemenu .menu-email {
  font-size: 13px;
  color: var(--muted, #9aa3bd);
  padding: 4px 10px;
  word-break: break-all;
}
.profilemenu .menu-lbl {
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted, #9aa3bd);
  padding: 2px 10px 6px;
}
.profilemenu .av-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 10px 2px;
}
.profilemenu .av-cur {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  overflow: hidden;
  flex: none;
  display: grid;
  place-items: center;
  background: var(--card2, #1b2440);
}
.profilemenu .av-cur img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
/* The themed default-avatar face (accent circle + person + camera cue) - identical to the header's
   no-photo avatar, so the menu preview matches it instead of showing a flat dark person. */
.moss-defface {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: linear-gradient(
    135deg,
    var(--accent, #3b82f6),
    var(--accent2, #1e40af)
  );
  color: var(--onacc, #fff);
  display: grid;
  place-items: center;
}
.moss-defface > svg {
  width: 58%;
  height: 58%;
  display: block;
}
.moss-defface .person-cam {
  position: absolute;
  right: -1px;
  bottom: -1px;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: #fff;
  color: #1f2a52;
  display: grid;
  place-items: center;
  box-shadow: 0 0 0 1.5px rgba(8, 12, 26, 0.5);
}
.moss-defface .person-cam svg {
  width: 9px;
  height: 9px;
  display: block;
}
.profilemenu .av-cur:has(.moss-defface) {
  background: transparent;
  overflow: visible;
}
.profilemenu .menu-change {
  padding: 7px 12px;
  border-radius: 8px;
  border: 1px solid var(--line, #2a3350);
  background: none;
  color: var(--text, #e8eefc);
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
}
.profilemenu .menu-change:hover {
  border-color: var(--accent, #5eead4);
}

/* ---- Footer: five constant links over one contextual line (app name · © · version). --------------- */
.site-footer {
  max-width: min(1400px, 92vw);
  margin: 0 auto;
  padding: 24px 22px 40px;
  border-top: 1px solid var(--line, #2a3350);
  text-align: center;
}
.site-footer .foot-links {
  display: flex;
  gap: 18px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.site-footer .foot-links a {
  color: var(--muted, #9aa3bd);
  text-decoration: underline;
  text-underline-offset: 2px;
  font-size: 14px;
}
.site-footer .foot-links a:hover {
  color: var(--text, #e8eefc);
}
.site-footer .foot-fine {
  color: var(--muted, #9aa3bd);
  font-size: 12.5px;
  margin: 0;
}
.site-footer .foot-dot {
  margin: 0 8px;
  opacity: 0.55;
}
