:root {
  --ink: #10131a;
  --muted: #666d7a;
  --line: #dfe4ea;
  --paper: #f7f8f5;
  --white: #ffffff;
  --green: #1d7f64;
  --blue: #3157d5;
  --coral: #d7694f;
  --gold: #b58b2a;
  --shadow: 0 18px 60px rgba(16, 19, 26, 0.08);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

:root[data-theme="dark"] {
  --ink: #f4f7fb;
  --muted: #a6b0bf;
  --line: #2c3442;
  --paper: #0b0f16;
  --white: #121824;
  --green: #48c69f;
  --blue: #7aa2ff;
  --coral: #f08b72;
  --gold: #d9b95a;
  --shadow: 0 22px 70px rgba(0, 0, 0, 0.34);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(135deg, rgba(49, 87, 213, 0.07), transparent 34%),
    linear-gradient(220deg, rgba(215, 105, 79, 0.08), transparent 32%),
    var(--paper);
  color: var(--ink);
}

:root[data-theme="dark"] body {
  background:
    linear-gradient(135deg, rgba(122, 162, 255, 0.12), transparent 34%),
    linear-gradient(220deg, rgba(72, 198, 159, 0.1), transparent 32%),
    var(--paper);
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px clamp(16px, 4vw, 48px);
  background: rgba(247, 248, 245, 0.86);
  border-bottom: 1px solid rgba(16, 19, 26, 0.08);
  backdrop-filter: blur(18px);
}

:root[data-theme="dark"] .topbar {
  background: rgba(11, 15, 22, 0.86);
  border-bottom-color: rgba(255, 255, 255, 0.08);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-size: 20px;
  font-weight: 760;
  letter-spacing: 0;
  text-decoration: none;
}

.topbar-left {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  min-width: 0;
}

.brand-mark {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  color: white;
  background: var(--ink);
  border-radius: 8px;
}

.topbar-right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 14px;
  min-width: 0;
}

.controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

.placeholder-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.placeholder-button {
  min-height: 34px;
  padding: 0 11px;
  color: #ffffff;
  background: #c83f35;
  border: 1px solid #c83f35;
  border-radius: 8px;
  cursor: default;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0;
}

.placeholder-button:focus-visible {
  outline: 3px solid rgba(200, 63, 53, 0.22);
  outline-offset: 2px;
}

.auth-modal[hidden] {
  display: none;
}

body.auth-open {
  overflow: hidden;
}

.auth-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 24px;
  overflow-y: auto;
  background: rgba(7, 10, 15, 0.68);
  backdrop-filter: blur(6px);
}

.auth-dialog {
  position: relative;
  width: min(400px, 100%);
  max-height: calc(100vh - 48px);
  padding: 28px;
  overflow-y: auto;
  color: var(--ink);
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.28);
  animation: auth-dialog-in 160ms ease-out;
}

:root[data-theme="dark"] .auth-dialog {
  color: var(--ink);
  background: #121824;
  border-color: #303a49;
}

.auth-close {
  position: absolute;
  top: 14px;
  right: 14px;
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  padding: 0;
  color: var(--ink);
  background: transparent;
  border: 0;
  border-radius: 6px;
  font-size: 25px;
  line-height: 1;
}

.auth-close:hover {
  background: #eef1f5;
}

:root[data-theme="dark"] .auth-close:hover {
  background: #202938;
}

.auth-close:focus-visible,
.auth-switch button:focus-visible {
  outline: 2px solid var(--coral);
  outline-offset: 2px;
}

.auth-heading {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding-right: 34px;
}

.auth-mark {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  color: #ffffff;
  background: var(--ink);
  border-radius: 8px;
  font-weight: 850;
}

:root[data-theme="dark"] .auth-mark {
  color: #10131a;
}

.auth-kicker {
  margin: 0 0 2px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.auth-dialog h2 {
  margin: 0;
  font-size: 22px;
  line-height: 1.2;
  letter-spacing: 0;
}

.auth-message {
  margin: 16px 0 0;
  padding: 10px 12px;
  color: var(--ink);
  background: rgba(215, 105, 79, 0.1);
  border-left: 3px solid var(--coral);
  border-radius: 4px;
  font-size: 13px;
  line-height: 1.5;
}

.auth-message:empty {
  display: none;
}

.auth-form {
  display: grid;
  gap: 14px;
  margin-top: 22px;
}

.auth-form[hidden],
.auth-switch[hidden],
.auth-form [hidden] {
  display: none;
}

.auth-form label {
  display: grid;
  gap: 7px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
}

.auth-form input {
  width: 100%;
  min-height: 44px;
  padding: 0 13px;
  color: var(--ink);
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 8px;
  outline: none;
  font-weight: 500;
}

:root[data-theme="dark"] .auth-form input {
  background: #0f1621;
  border-color: #303a49;
}

.auth-form input:focus {
  border-color: var(--coral);
  box-shadow: 0 0 0 3px rgba(215, 105, 79, 0.14);
}

.auth-submit {
  min-height: 44px;
  margin-top: 6px;
  color: #ffffff;
  background: #c83f35;
  border: 0;
  border-radius: 8px;
  font-weight: 800;
}

.auth-submit:hover {
  background: #ad332b;
}

:root[data-theme="dark"] .auth-submit {
  color: #170b0a;
  background: #ff786b;
}

:root[data-theme="dark"] .auth-submit:hover {
  background: #ff9186;
}

.auth-switch {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin: 22px 0 0;
  padding-top: 18px;
  color: var(--muted);
  border-top: 1px solid var(--line);
  font-size: 13px;
}

.auth-switch button {
  padding: 0;
  color: var(--coral);
  background: transparent;
  border: 0;
  font-weight: 800;
}

@keyframes auth-dialog-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .auth-dialog {
    animation: none;
  }
}

:root[data-theme="dark"] .placeholder-button {
  color: #170b0a;
  background: #ff786b;
  border-color: #ff786b;
}

.select-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  color: var(--muted);
  font-size: 13px;
}

select,
input {
  min-height: 40px;
  padding: 0 12px;
  color: var(--ink);
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 8px;
  outline: none;
}

:root[data-theme="dark"] select,
:root[data-theme="dark"] input {
  color-scheme: dark;
}

select:focus,
input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(49, 87, 213, 0.12);
}

main {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

.site-footer {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 18px 0 34px;
}

.footer-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}

.footer-link-button {
  min-height: 34px;
  padding: 0 11px;
  color: var(--muted);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
}

.footer-link-button:hover,
.footer-link-button:focus-visible {
  color: var(--ink);
  background: var(--soft);
  border-color: var(--muted);
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.info-view {
  min-height: calc(100vh - 74px);
  padding: clamp(24px, 5vw, 56px) 0 48px;
}

.info-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
}

.info-toolbar .back-button {
  flex: 0 0 auto;
  width: auto;
  min-width: 112px;
}

.info-status {
  display: grid;
  gap: 4px;
  justify-items: end;
  color: var(--muted);
  font-size: 12px;
}

.info-layout {
  display: grid;
  grid-template-columns: 210px minmax(0, 760px);
  gap: clamp(28px, 6vw, 72px);
  align-items: start;
  justify-content: center;
  padding-top: clamp(26px, 5vw, 54px);
}

.info-nav {
  position: sticky;
  top: 96px;
  display: grid;
  border-left: 1px solid var(--line);
}

.info-nav-button {
  min-height: 42px;
  padding: 0 14px;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-left: 2px solid transparent;
  text-align: left;
  font-weight: 700;
}

.info-nav-button:hover,
.info-nav-button:focus-visible {
  color: var(--ink);
  background: var(--soft);
}

.info-nav-button.active {
  color: var(--green);
  background: rgba(57, 255, 136, 0.07);
  border-left-color: var(--green);
}

.info-article {
  min-width: 0;
  outline: none;
}

.info-article:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 8px;
}

.info-article-header {
  padding-bottom: clamp(26px, 5vw, 48px);
}

.info-draft-label {
  display: inline-block;
  margin-bottom: 14px;
  color: var(--green);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.info-article h1 {
  margin: 0;
  font-size: clamp(36px, 6vw, 68px);
  line-height: 1;
}

.info-lead {
  max-width: 680px;
  margin: 20px 0 0;
  color: var(--muted);
  font-size: clamp(17px, 2vw, 21px);
  line-height: 1.65;
}

.info-section {
  padding: 28px 0;
  border-top: 1px solid var(--line);
}

.info-section h2 {
  margin: 0 0 14px;
  font-size: 20px;
}

.info-section p {
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.8;
}

.home {
  min-height: calc(100vh - 74px);
  padding: clamp(42px, 9vh, 96px) 0 32px;
}

.intro {
  max-width: 760px;
}

.eyebrow,
.section-kicker {
  margin: 0 0 10px;
  color: var(--green);
  font-size: 13px;
  font-weight: 760;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 14px;
  font-size: clamp(56px, 10vw, 118px);
  line-height: 0.92;
  letter-spacing: 0;
}

.lead {
  max-width: 620px;
  color: var(--muted);
  font-size: clamp(18px, 2.4vw, 24px);
  line-height: 1.45;
}

.mode-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: clamp(32px, 6vw, 64px);
}

.mode-card {
  min-height: 310px;
  padding: 22px;
  text-align: left;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(16, 19, 26, 0.08);
  border-radius: 8px;
  box-shadow: var(--shadow);
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    box-shadow 160ms ease;
}

:root[data-theme="dark"] .mode-card,
:root[data-theme="dark"] .person-panel,
:root[data-theme="dark"] .content-panel,
:root[data-theme="dark"] .product-card,
:root[data-theme="dark"] .receipt,
:root[data-theme="dark"] .source-row,
:root[data-theme="dark"] .compare-row {
  background: rgba(18, 24, 36, 0.88);
  border-color: rgba(255, 255, 255, 0.09);
}

.mode-card:hover {
  transform: translateY(-4px);
  border-color: rgba(16, 19, 26, 0.22);
  box-shadow: 0 24px 70px rgba(16, 19, 26, 0.12);
}

.mode-card strong {
  display: block;
  margin-top: 26px;
  font-size: 25px;
  letter-spacing: 0;
}

.mode-card small {
  display: block;
  margin-top: 10px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.45;
}

.mode-visual {
  display: grid;
  height: 132px;
  align-items: end;
  padding: 16px;
  overflow: hidden;
  background: #f0f2f5;
  border-radius: 8px;
}

:root[data-theme="dark"] .mode-visual {
  background: #171f2c;
}

.wealth-visual {
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  background: linear-gradient(135deg, #e8f4ee, #eff3ff);
}

.wealth-visual span {
  display: block;
  height: 56px;
  border-radius: 6px 6px 0 0;
  background: var(--green);
}

.wealth-visual span:nth-child(2) {
  height: 92px;
  background: var(--gold);
}

.wealth-visual span:nth-child(3) {
  height: 116px;
  background: var(--blue);
}

.earn-visual {
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  background: linear-gradient(135deg, #fff4ed, #eef8f4);
}

.earn-visual span {
  display: block;
  width: 72px;
  height: 72px;
  border: 10px solid var(--coral);
  border-radius: 50%;
}

.earn-visual span:nth-child(2) {
  width: 54px;
  height: 54px;
  border-color: var(--green);
}

.earn-visual span:nth-child(3) {
  width: 92px;
  height: 92px;
  border-color: var(--gold);
}

.compare-visual {
  grid-template-columns: 0.45fr 1fr;
  gap: 12px;
  background: linear-gradient(135deg, #eff3ff, #fff5f1);
}

.compare-visual span {
  display: block;
  border-radius: 8px;
  background: var(--blue);
}

.compare-visual span:nth-child(2) {
  background: var(--coral);
}

.notice {
  margin: 28px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.app-shell {
  display: none;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 20px;
  padding: 26px 0 44px;
}

.app-shell.active {
  display: grid;
}

.person-panel,
.content-panel {
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid rgba(16, 19, 26, 0.08);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.person-panel {
  position: sticky;
  top: 90px;
  display: flex;
  flex-direction: column;
  height: min(80vh, calc(100vh - 110px));
  min-height: 560px;
  padding: 14px;
}

.back-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  min-height: 40px;
  margin-bottom: 14px;
  padding: 0 12px;
  color: var(--ink);
  background: #f2f4f7;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 40px;
  padding: 0 12px;
  color: var(--ink);
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.sound-toggle {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 10px;
  color: var(--ink);
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 13px;
  font-weight: 760;
}

.sound-toggle[aria-pressed="true"] {
  color: var(--muted);
}

.theme-toggle span:first-child {
  font-size: 16px;
}

.sound-toggle span:first-child {
  min-width: 16px;
  font-size: 15px;
  text-align: center;
}

.back-button span:first-child {
  font-size: 24px;
  line-height: 1;
}

:root[data-theme="dark"] .back-button,
:root[data-theme="dark"] .category-tab,
:root[data-theme="dark"] .sort-option,
:root[data-theme="dark"] .category-menu-button,
:root[data-theme="dark"] .sort-icon-button,
:root[data-theme="dark"] .receipt-head button {
  background: #1a2230;
}

:root[data-theme="dark"] .category-menu {
  background: #121824;
  border-color: rgba(255, 255, 255, 0.09);
}

:root[data-theme="dark"] .person-category-button,
:root[data-theme="dark"] .person-category-menu {
  background: #121824;
  border-color: rgba(255, 255, 255, 0.09);
}

:root[data-theme="dark"] .person-category-option {
  background: #1a2230;
}

:root[data-theme="dark"] .person-category-option.active {
  color: #10131a;
  background: #f8fafc;
  border-color: #f8fafc;
}

.search-block {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}

.people-tools {
  position: relative;
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr);
  gap: 8px;
  align-items: end;
}

.person-category-picker {
  position: relative;
}

.person-category-picker summary {
  list-style: none;
}

.person-category-picker summary::-webkit-details-marker {
  display: none;
}

.person-category-button {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 16px;
  gap: 6px;
  width: 100%;
  min-height: 38px;
  padding: 0 8px 0 10px;
  align-items: center;
  color: var(--ink);
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 8px;
  text-align: left;
}

.person-category-button > span:first-child {
  color: var(--ink);
  font-size: 13px;
  line-height: 1;
}

.person-category-button strong {
  display: none;
}

.person-category-chevron {
  display: grid;
  width: 16px;
  height: 16px;
  place-items: center;
  justify-self: end;
  color: var(--muted);
  font-size: 11px;
  line-height: 1;
  transform-origin: center;
  transition: transform 160ms ease;
}

.person-category-picker[open] .person-category-chevron {
  transform: rotate(180deg);
}

.person-category-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: 6;
  display: none;
  width: min(260px, 78vw);
  padding: 8px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.person-category-menu.open {
  display: grid;
  gap: 6px;
}

.person-category-picker[open] .person-category-menu {
  display: grid;
  gap: 6px;
}

.person-category-option {
  min-height: 36px;
  padding: 0 10px;
  color: var(--muted);
  background: #f2f4f7;
  border: 1px solid var(--line);
  border-radius: 8px;
  text-align: left;
}

.person-category-option.active {
  color: white;
  background: var(--ink);
  border-color: var(--ink);
}

.placeholder-category-option {
  color: #ffffff;
  background: #c83f35;
  border-color: #c83f35;
  cursor: default;
}

:root[data-theme="dark"] .placeholder-category-option {
  color: #170b0a;
  background: #ff786b;
  border-color: #ff786b;
}

.search-block input {
  width: 100%;
}

.person-list {
  display: grid;
  align-content: start;
  gap: 10px;
  min-height: 0;
  margin-top: 14px;
  overflow-y: auto;
  padding-right: 2px;
}

.person-button {
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: 10px;
  width: 100%;
  padding: 10px;
  text-align: left;
  color: var(--ink);
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.person-button.active {
  border-color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--ink);
}

.avatar {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  color: white;
  background: var(--ink);
  border-radius: 8px;
  font-weight: 800;
}

.person-button strong {
  display: block;
  margin-bottom: 3px;
}

.person-category-button > strong {
  display: none;
}

.person-button small {
  color: var(--muted);
  line-height: 1.35;
}

.content-panel {
  min-width: 0;
  padding: clamp(16px, 3vw, 28px);
}

.selected-person {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 14px;
  align-items: center;
  margin-bottom: 18px;
}

.selected-person .avatar {
  width: 64px;
  height: 64px;
  font-size: 20px;
}

.selected-person h2 {
  margin-bottom: 4px;
  font-size: clamp(24px, 4vw, 38px);
}

.selected-person p {
  margin: 0;
  color: var(--muted);
}

.networth {
  position: relative;
  text-align: right;
  min-width: 0;
}

.networth span {
  display: block;
  color: var(--muted);
  font-size: 13px;
}

.number-guide {
  position: absolute;
  right: 0;
  bottom: calc(100% + 8px);
  z-index: 5;
  display: block;
  width: max-content;
  max-width: min(520px, 58vw);
  padding: 8px 10px;
  overflow: hidden;
  color: white;
  background: rgba(16, 19, 26, 0.92);
  border-radius: 8px;
  box-shadow: var(--shadow);
  font-size: 11px;
  line-height: 1.35;
  opacity: 0;
  pointer-events: none;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
  transform: translateY(4px);
  transition:
    opacity 140ms ease,
    transform 140ms ease;
}

.networth:hover .number-guide,
.networth:focus-within .number-guide {
  opacity: 0.92;
  transform: translateY(0);
}

.networth strong {
  font-size: clamp(22px, 3vw, 34px);
}

.live-earned {
  grid-column: 1 / -1;
  display: grid;
  gap: 4px;
  padding: 14px 16px;
  color: white;
  background: linear-gradient(135deg, var(--ink), #1f5f72);
  border-radius: 8px;
}

.live-earned span,
.live-earned small {
  color: rgba(255, 255, 255, 0.72);
  font-size: 13px;
}

.live-earned strong {
  font-size: clamp(28px, 5vw, 52px);
  line-height: 1.05;
}

.tabs {
  display: flex;
  gap: 8px;
  margin: 8px 0 22px;
  padding: 6px;
  background: #f1f3f6;
  border-radius: 8px;
}

:root[data-theme="dark"] .tabs {
  background: #171f2c;
}

.tab {
  flex: 1;
  min-height: 42px;
  padding: 0 12px;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: 6px;
}

.tab.active {
  color: var(--ink);
  background: var(--white);
  box-shadow: 0 4px 18px rgba(16, 19, 26, 0.08);
}

:root[data-theme="dark"] .tab.active {
  background: #283244;
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

.mall-head {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: start;
  margin-bottom: 18px;
}

h2 {
  margin-bottom: 0;
  font-size: clamp(26px, 4vw, 42px);
  line-height: 1.08;
  letter-spacing: 0;
}

.balance-box {
  min-width: 210px;
  padding: 14px;
  text-align: right;
  background: var(--ink);
  color: white;
  border-radius: 8px;
}

.balance-box span {
  display: block;
  color: rgba(255, 255, 255, 0.7);
  font-size: 13px;
}

.balance-box strong {
  display: block;
  margin-top: 4px;
  font-size: 24px;
}

.mall-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.category-tabs {
  position: relative;
  display: grid;
  grid-template-columns: minmax(160px, 20%) 1fr auto;
  gap: 10px;
  align-items: start;
  margin: 0 0 16px;
}

.filter-group {
  position: relative;
  display: grid;
  gap: 8px;
}

.sort-filter {
  grid-column: 3;
  justify-items: end;
}

.category-menu-button {
  display: inline-grid;
  grid-template-columns: auto auto auto;
  gap: 10px;
  align-items: center;
  min-height: 42px;
  padding: 0 14px;
  color: var(--ink);
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(16, 19, 26, 0.08);
}

.category-menu-button span:first-child {
  color: var(--muted);
}

.sort-icon-button {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  color: var(--ink);
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(16, 19, 26, 0.08);
}

.sort-icon-button span {
  font-size: 19px;
  line-height: 1;
}

.category-menu {
  display: none;
  grid-template-columns: repeat(2, minmax(110px, 1fr));
  gap: 8px;
  min-width: 280px;
  padding: 10px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.sort-menu {
  position: absolute;
  top: 50px;
  right: 0;
  z-index: 4;
}

.category-menu.open {
  display: grid;
}

.category-tab,
.sort-option {
  min-height: 38px;
  padding: 0 14px;
  color: var(--muted);
  background: #f2f4f7;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.category-tab.active,
.sort-option.active {
  color: white;
  background: var(--ink);
  border-color: var(--ink);
}

:root[data-theme="dark"] .category-tab.active,
:root[data-theme="dark"] .sort-option.active {
  color: #0b0f16;
  background: var(--ink);
}

.product-card {
  display: grid;
  gap: 12px;
  padding: 12px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.product-art {
  display: grid;
  height: 122px;
  min-height: 122px;
  place-items: center;
  overflow: hidden;
  color: white;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.15), transparent),
    var(--art-color);
  border-radius: 8px;
  font-size: 48px;
}

.product-card h3 {
  margin-bottom: 2px;
  font-size: 17px;
}

.product-card p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 14px;
}

.product-actions {
  display: grid;
  grid-template-columns: 42px 1fr 42px;
  gap: 8px;
}

.product-actions button {
  min-height: 38px;
  color: white;
  background: var(--ink);
  border: 0;
  border-radius: 8px;
  font-weight: 800;
}

.product-actions button:disabled {
  cursor: not-allowed;
  opacity: 0.38;
}

.product-actions input {
  width: 100%;
  text-align: center;
}

.receipt {
  margin-top: 18px;
  padding: 16px;
  background: var(--white);
  border: 1px dashed #b9c1cc;
  border-radius: 8px;
}

.receipt-head,
.receipt-total,
.receipt-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
}

.receipt-head h3 {
  margin-bottom: 0;
}

.receipt-head button {
  min-height: 34px;
  padding: 0 12px;
  color: var(--ink);
  background: #f2f4f7;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.receipt-list {
  display: grid;
  gap: 8px;
  min-height: 42px;
  margin: 14px 0;
  color: var(--muted);
}

.receipt-total {
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.earn-layout {
  display: grid;
  gap: 24px;
}

.metric-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.metric-strip div,
.years-box {
  padding: 16px;
  background: var(--ink);
  color: white;
  border-radius: 8px;
}

:root[data-theme="dark"] .metric-strip div,
:root[data-theme="dark"] .balance-box {
  color: #0b0f16;
  background: #f4f7fb;
}

:root[data-theme="dark"] .metric-strip span,
:root[data-theme="dark"] .balance-box span {
  color: rgba(11, 15, 22, 0.64);
}

:root[data-theme="dark"] .live-earned {
  color: #f4f7fb;
  background: linear-gradient(135deg, #101826, #0e3b46);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

:root[data-theme="dark"] .live-earned strong {
  color: #ffffff;
  text-shadow: 0 2px 18px rgba(72, 198, 159, 0.28);
}

:root[data-theme="dark"] .live-earned span,
:root[data-theme="dark"] .live-earned small {
  color: rgba(244, 247, 251, 0.78);
}

:root[data-theme="dark"] .product-actions button {
  color: #0b0f16;
  background: #f8fafc;
  border: 1px solid rgba(255, 255, 255, 0.18);
}

:root[data-theme="dark"] .product-actions button:hover:not(:disabled) {
  background: #e2e8f0;
}

:root[data-theme="dark"] .product-actions button:disabled {
  color: #64748b;
  background: #273244;
  border-color: #334155;
  opacity: 1;
}

:root[data-theme="dark"] .product-actions input {
  color: #f8fafc;
  background: #0f1724;
  border-color: #334155;
}

:root[data-theme="dark"] .number-guide {
  color: #0b0f16;
  background: rgba(244, 247, 251, 0.94);
}

.metric-strip span,
.years-box span {
  display: block;
  color: rgba(255, 255, 255, 0.7);
  font-size: 13px;
}

.metric-strip strong,
.years-box strong {
  display: block;
  margin-top: 6px;
  font-size: clamp(22px, 3vw, 34px);
}

.income-sources {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.source-row {
  display: grid;
  grid-template-columns: 1fr minmax(120px, 220px);
  gap: 14px;
  align-items: center;
  padding: 14px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.source-row p {
  margin-bottom: 0;
  color: var(--muted);
}

.bar {
  height: 10px;
  overflow: hidden;
  background: #e8ebef;
  border-radius: 999px;
}

.bar span {
  display: block;
  height: 100%;
  background: var(--green);
  border-radius: inherit;
}

.compare-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 16px;
}

.compare-form label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}

.compare-table {
  display: grid;
  gap: 10px;
}

.compare-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 10px;
  align-items: center;
  padding: 14px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.compare-row.header {
  color: var(--muted);
  background: transparent;
  border-color: transparent;
  font-size: 13px;
}

.years-box {
  margin-top: 16px;
  background: linear-gradient(135deg, var(--blue), var(--green));
}

@media (max-width: 900px) {
  .topbar {
    align-items: start;
  }

  .topbar-right {
    display: grid;
    justify-items: end;
    gap: 10px;
  }

  .mode-grid,
  .app-shell,
  .mall-grid,
  .metric-strip {
    grid-template-columns: 1fr;
  }

  .person-panel {
    position: static;
    height: auto;
    min-height: 0;
  }

  .selected-person {
    grid-template-columns: auto 1fr;
  }

  .networth {
    grid-column: 1 / -1;
    text-align: left;
  }

  .number-guide {
    right: auto;
    left: 0;
    max-width: min(100%, 88vw);
    text-align: left;
  }

  .mall-head {
    display: grid;
  }

  .balance-box {
    width: 100%;
    min-width: 0;
    text-align: left;
  }
}

@media (max-width: 620px) {
  .auth-modal {
    padding: 14px;
  }

  .auth-dialog {
    max-height: calc(100vh - 28px);
    padding: 22px 18px;
  }

  .auth-dialog h2 {
    font-size: 20px;
  }

  .topbar {
    display: grid;
  }

  .topbar-right {
    justify-items: stretch;
  }

  .top-actions,
  .footer-actions {
    justify-content: flex-start;
  }

  .controls,
  .tabs,
  .compare-form {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .select-wrap {
    display: grid;
    gap: 4px;
  }

  .theme-toggle {
    grid-column: 1 / -1;
  }

  .category-tabs,
  .filter-group,
  .category-menu-button {
    width: 100%;
  }

  .info-toolbar {
    align-items: flex-start;
  }

  .info-status {
    justify-items: end;
    text-align: right;
  }

  .info-layout {
    grid-template-columns: minmax(0, 1fr);
    gap: 28px;
  }

  .info-nav {
    position: static;
    display: flex;
    width: 100%;
    overflow-x: auto;
    border-left: 0;
    border-bottom: 1px solid var(--line);
    scrollbar-width: none;
  }

  .info-nav::-webkit-scrollbar {
    display: none;
  }

  .info-nav-button {
    flex: 0 0 auto;
    border-left: 0;
    border-bottom: 2px solid transparent;
    white-space: nowrap;
  }

  .info-nav-button.active {
    border-bottom-color: var(--green);
  }

  .info-article h1 {
    font-size: 40px;
  }

  .category-tabs {
    grid-template-columns: 1fr 42px;
  }

  .sort-filter {
    grid-column: 2;
  }

  .category-menu {
    width: min(100%, 320px);
  }

  .sort-menu {
    width: 210px;
  }

  .mode-card {
    min-height: 250px;
  }

  .source-row,
  .compare-row {
    grid-template-columns: 1fr;
  }
}

/* Market-green visual direction */
:root {
  --ink: #f4fff8;
  --muted: #8ba99a;
  --line: rgba(126, 255, 178, 0.16);
  --paper: #030806;
  --white: rgba(6, 18, 13, 0.9);
  --green: #39ff88;
  --blue: #37d8ff;
  --coral: #ff6b5f;
  --gold: #f2c94c;
  --shadow: 0 22px 74px rgba(0, 0, 0, 0.42);
}

:root[data-theme="dark"] {
  --ink: #f4fff8;
  --muted: #8ba99a;
  --line: rgba(126, 255, 178, 0.16);
  --paper: #030806;
  --white: rgba(6, 18, 13, 0.9);
  --green: #39ff88;
  --blue: #37d8ff;
  --coral: #ff6b5f;
  --gold: #f2c94c;
  --shadow: 0 22px 74px rgba(0, 0, 0, 0.42);
}

body,
:root[data-theme="dark"] body {
  position: relative;
  overflow-x: hidden;
  background:
    linear-gradient(150deg, rgba(57, 255, 136, 0.16), transparent 30%),
    linear-gradient(210deg, rgba(55, 216, 255, 0.09), transparent 28%),
    radial-gradient(circle at 50% 0%, rgba(57, 255, 136, 0.12), transparent 34%),
    #030806;
  color: var(--ink);
}

body::before {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  content: "";
  background-image:
    linear-gradient(rgba(126, 255, 178, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(126, 255, 178, 0.045) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.7), transparent 82%);
}

.coin-particles {
  position: fixed;
  inset: 0;
  z-index: 12;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.topbar,
main,
.site-footer {
  position: relative;
  z-index: 1;
}

.topbar,
:root[data-theme="dark"] .topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  flex-wrap: wrap;
  background: rgba(3, 8, 6, 0.76);
  border-bottom-color: rgba(126, 255, 178, 0.14);
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.24);
}

.topbar-right,
.controls {
  flex-wrap: wrap;
}

.topbar-right {
  max-width: min(100%, 920px);
}

.brand {
  color: #f5fff9;
}

.brand-mark,
.avatar,
.product-actions button,
.person-category-option.active,
.category-tab.active,
.sort-option.active {
  color: #03130b;
  background: linear-gradient(135deg, #39ff88, #d2ffe3);
  border-color: rgba(126, 255, 178, 0.52);
}

.brand-mark {
  box-shadow: 0 0 28px rgba(57, 255, 136, 0.34);
}

.placeholder-button,
:root[data-theme="dark"] .placeholder-button,
.auth-submit,
:root[data-theme="dark"] .auth-submit {
  color: #04150c;
  background: linear-gradient(135deg, #39ff88, #c8ffdc);
  border-color: rgba(126, 255, 178, 0.4);
}

.auth-submit:hover,
:root[data-theme="dark"] .auth-submit:hover {
  background: linear-gradient(135deg, #68ffa5, #e2ffed);
}

select,
input,
.sound-toggle,
.theme-toggle,
.back-button,
:root[data-theme="dark"] .back-button,
.person-category-button,
:root[data-theme="dark"] .person-category-button,
.category-menu-button,
.sort-icon-button,
.receipt-head button {
  color: var(--ink);
  background: rgba(4, 14, 10, 0.88);
  border-color: rgba(126, 255, 178, 0.16);
}

select:focus,
input:focus,
.auth-form input:focus {
  border-color: rgba(57, 255, 136, 0.8);
  box-shadow: 0 0 0 3px rgba(57, 255, 136, 0.16);
}

.home {
  display: none;
  min-height: calc(100vh - 74px);
  align-content: center;
}

.home.active {
  display: grid;
}

.intro {
  max-width: 820px;
}

.eyebrow,
.section-kicker {
  color: #39ff88;
  text-shadow: 0 0 22px rgba(57, 255, 136, 0.42);
}

h1 {
  max-width: 880px;
  color: #f4fff8;
  text-shadow:
    0 0 28px rgba(57, 255, 136, 0.28),
    0 18px 80px rgba(0, 0, 0, 0.56);
}

.lead {
  color: #a6c9b6;
}

.mode-card,
:root[data-theme="dark"] .mode-card,
.person-panel,
:root[data-theme="dark"] .person-panel,
.content-panel,
:root[data-theme="dark"] .content-panel,
.product-card,
:root[data-theme="dark"] .product-card,
.receipt,
:root[data-theme="dark"] .receipt,
.source-row,
:root[data-theme="dark"] .source-row,
.compare-row,
:root[data-theme="dark"] .compare-row,
.auth-dialog,
:root[data-theme="dark"] .auth-dialog {
  color: var(--ink);
  background:
    linear-gradient(145deg, rgba(20, 45, 31, 0.92), rgba(4, 13, 10, 0.88)),
    rgba(6, 18, 13, 0.9);
  border-color: rgba(126, 255, 178, 0.16);
  box-shadow:
    inset 0 1px 0 rgba(219, 255, 232, 0.06),
    0 22px 74px rgba(0, 0, 0, 0.42);
  backdrop-filter: blur(18px);
}

.mode-card,
.product-card {
  --tilt-x: 0deg;
  --tilt-y: 0deg;
  --tilt-scale: 1;
  position: relative;
  overflow: hidden;
  transform:
    perspective(900px)
    rotateX(var(--tilt-x))
    rotateY(var(--tilt-y))
    scale(var(--tilt-scale));
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    box-shadow 160ms ease,
    background 160ms ease;
  transform-style: preserve-3d;
}

.mode-card::before,
.product-card::before {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  content: "";
  background:
    radial-gradient(circle at var(--glow-x, 50%) var(--glow-y, 50%), rgba(57, 255, 136, 0.18), transparent 34%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.06), transparent 42%);
  transition: opacity 160ms ease;
}

.mode-card:hover,
.product-card:hover {
  --tilt-scale: 1.025;
  border-color: rgba(57, 255, 136, 0.48);
  box-shadow:
    inset 0 1px 0 rgba(219, 255, 232, 0.08),
    0 26px 90px rgba(0, 0, 0, 0.52),
    0 0 36px rgba(57, 255, 136, 0.12);
}

.mode-card:hover::before,
.product-card:hover::before {
  opacity: 1;
}

.mode-card > *,
.product-card > * {
  position: relative;
  z-index: 1;
}

.mode-visual,
:root[data-theme="dark"] .mode-visual,
.wealth-visual,
.earn-visual,
.compare-visual {
  background:
    linear-gradient(145deg, rgba(57, 255, 136, 0.16), rgba(55, 216, 255, 0.07)),
    rgba(2, 11, 7, 0.9);
  border: 1px solid rgba(126, 255, 178, 0.14);
}

.wealth-visual span {
  background: linear-gradient(180deg, #96ffc0, #1ed86b);
  box-shadow: 0 0 24px rgba(57, 255, 136, 0.24);
}

.wealth-visual span:nth-child(2) {
  background: linear-gradient(180deg, #f6d45d, #25d66c);
}

.wealth-visual span:nth-child(3) {
  background: linear-gradient(180deg, #78f5ff, #39ff88);
}

.earn-visual span {
  border-color: #39ff88;
  box-shadow: 0 0 26px rgba(57, 255, 136, 0.22);
}

.earn-visual span:nth-child(2) {
  border-color: #37d8ff;
}

.earn-visual span:nth-child(3) {
  border-color: #f2c94c;
}

.compare-visual span {
  background: linear-gradient(135deg, #37d8ff, #39ff88);
}

.compare-visual span:nth-child(2) {
  background: linear-gradient(135deg, #39ff88, #f2c94c);
}

.live-earned,
:root[data-theme="dark"] .live-earned,
.balance-box,
:root[data-theme="dark"] .balance-box,
.metric-strip div,
:root[data-theme="dark"] .metric-strip div,
.years-box {
  color: #f4fff8;
  background:
    linear-gradient(135deg, rgba(3, 17, 10, 0.96), rgba(0, 88, 45, 0.88)),
    #03130b;
  border: 1px solid rgba(57, 255, 136, 0.22);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
}

.live-earned strong,
:root[data-theme="dark"] .live-earned strong,
.balance-box strong,
.metric-strip strong,
.years-box strong {
  color: #ffffff;
  text-shadow: 0 0 26px rgba(57, 255, 136, 0.35);
}

.live-earned span,
.live-earned small,
.balance-box span,
:root[data-theme="dark"] .balance-box span,
.metric-strip span,
.years-box span {
  color: rgba(225, 255, 236, 0.72);
}

.tabs,
:root[data-theme="dark"] .tabs,
.bar {
  background: rgba(3, 12, 8, 0.82);
  border: 1px solid rgba(126, 255, 178, 0.1);
}

.tab.active,
:root[data-theme="dark"] .tab.active {
  color: #04150c;
  background: linear-gradient(135deg, #39ff88, #d2ffe3);
  box-shadow: 0 8px 28px rgba(57, 255, 136, 0.14);
}

.person-button {
  background: rgba(3, 12, 8, 0.66);
  border-color: rgba(126, 255, 178, 0.12);
}

.person-button.active {
  border-color: rgba(57, 255, 136, 0.72);
  box-shadow:
    inset 0 0 0 1px rgba(57, 255, 136, 0.45),
    0 0 26px rgba(57, 255, 136, 0.1);
}

.product-art {
  background:
    linear-gradient(135deg, rgba(57, 255, 136, 0.18), transparent),
    var(--art-color);
}

.receipt {
  border-style: solid;
}

.notice,
.mode-card small,
.product-card p,
.source-row p,
.person-button small,
.selected-person p,
.networth span,
.select-wrap,
.compare-form label,
.auth-kicker,
.auth-switch {
  color: var(--muted);
}

@media (prefers-reduced-motion: reduce) {
  .coin-particles {
    display: none;
  }

  .mode-card,
  .product-card {
    transform: none;
  }
}
