/* Self-hosted Figtree (variable) — avoids Google Fonts RTT on first paint. */
@font-face {
  font-family: "Figtree";
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url("/assets/fonts/figtree-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Figtree";
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url("/assets/fonts/figtree-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --forest: #0b3d36;
  --forest-deep: #072924;
  --palm: #1f8a62;
  --palm-bright: #2aad78;
  --gold: #d4a017;
  --gold-soft: #f0d78a;
  --sand: #f3ebe0;
  --sand-deep: #e5d8c4;
  --ink: #14241f;
  --muted: #5a6b64;
  --line: rgba(11, 61, 54, 0.12);
  --card: rgba(255, 252, 247, 0.92);
  --danger: #b3261e;
  --ok: #1f8a62;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 1px 0 rgba(11, 61, 54, 0.04), 0 18px 40px rgba(7, 41, 36, 0.08);
  --font-display: "Figtree", sans-serif;
  --font-body: "Figtree", sans-serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--sand);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--palm); }

/* Atmospheric susu-circle field */
.atmosphere {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(ellipse 80% 55% at 10% -10%, rgba(45, 173, 120, 0.28), transparent 55%),
    radial-gradient(ellipse 70% 50% at 100% 0%, rgba(212, 160, 23, 0.18), transparent 50%),
    radial-gradient(ellipse 60% 40% at 80% 100%, rgba(11, 61, 54, 0.12), transparent 55%),
    linear-gradient(165deg, #f7f1e7 0%, #ebe3d4 45%, #e2f0e8 100%);
}
.atmosphere::before {
  content: "";
  position: absolute;
  inset: -20%;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220' viewBox='0 0 220 220'%3E%3Cg fill='none' stroke='%230b3d36' stroke-opacity='0.06'%3E%3Ccircle cx='110' cy='110' r='40'/%3E%3Ccircle cx='110' cy='110' r='70'/%3E%3Ccircle cx='110' cy='110' r='100'/%3E%3C/g%3E%3C/svg%3E");
  background-size: 220px 220px;
  animation: drift 48s linear infinite;
  opacity: 0.9;
}
@keyframes drift {
  from { transform: translate3d(0, 0, 0); }
  to { transform: translate3d(-110px, -110px, 0); }
}

.wrap {
  max-width: 760px;
  margin: 0 auto;
  padding: 0 20px;
}
main.wrap {
  padding-top: 8px;
  padding-bottom: 80px;
}
body.has-bottom-nav main.wrap {
  padding-bottom: calc(96px + env(safe-area-inset-bottom, 0px));
}

/* Shell */
.shell-top {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(14px);
  background: rgba(243, 235, 224, 0.72);
  border-bottom: 1px solid var(--line);
}
.shell-top-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 64px;
}
.brand-lockup {
  display: flex;
  align-items: center;
  text-decoration: none;
}
.brand-word {
  height: 24px;
  width: auto;
  display: block;
}

.header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  min-height: 40px;
}

/* Avatar menu */
.avatar-menu {
  position: relative;
}
.avatar-btn {
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: 50%;
  border: 2px solid rgba(11, 61, 54, 0.14);
  background: linear-gradient(145deg, var(--forest) 0%, #146b4f 100%);
  color: #f7f3ea;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(7, 41, 36, 0.16);
  transform: none;
}
.avatar-btn:hover {
  transform: none;
  filter: brightness(1.06);
  background: linear-gradient(145deg, var(--forest) 0%, #146b4f 100%);
}
.avatar-btn[aria-expanded="true"] {
  box-shadow: 0 0 0 3px rgba(31, 138, 98, 0.22);
}
.avatar-btn .avatar-img,
.avatar-btn img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.avatar-btn .avatar-fallback {
  width: 22px;
  height: 22px;
  color: #f7f3ea;
}
.avatar-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 220px;
  padding: 6px;
  border-radius: 14px;
  background: rgba(255, 252, 247, 0.98);
  border: 1px solid var(--line);
  box-shadow: 0 16px 36px rgba(7, 41, 36, 0.14);
  z-index: 40;
  animation: rise 0.2s var(--ease) both;
}
.avatar-dropdown[hidden] { display: none !important; }
.avatar-dropdown .menu-identity {
  padding: 10px 12px 8px;
}
.avatar-dropdown .menu-name {
  font-family: var(--font-display);
  font-size: 0.98rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--forest);
  line-height: 1.2;
}
.avatar-dropdown .menu-trust {
  margin-top: 2px;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--muted);
}
.avatar-editor {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.avatar-edit-btn {
  position: relative;
  width: 88px;
  height: 88px;
  padding: 0;
  border-radius: 50%;
  background: transparent;
  border: 0;
  box-shadow: none;
  transform: none;
}
.avatar-edit-btn:hover {
  transform: none;
  filter: none;
  background: transparent;
}
.avatar-edit-btn:hover .avatar-camera {
  background: var(--palm);
  color: #fff;
}
.avatar-edit-btn.uploading { opacity: 0.65; cursor: wait; }
.avatar-edit-btn .avatar-preview {
  width: 88px;
  height: 88px;
  pointer-events: none;
}
.avatar-preview {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  overflow: hidden;
  background: linear-gradient(145deg, var(--forest) 0%, #146b4f 100%);
  color: #f7f3ea;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 2px solid rgba(11, 61, 54, 0.12);
  flex-shrink: 0;
}
.avatar-preview .avatar-preview-img,
.avatar-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.avatar-preview .avatar-fallback {
  width: 34px;
  height: 34px;
}
.avatar-camera {
  position: absolute;
  right: -2px;
  bottom: -2px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #fffdf9;
  color: var(--forest);
  border: 2px solid var(--sand-deep);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 10px rgba(7, 41, 36, 0.16);
}
.avatar-camera .camera-icon {
  width: 15px;
  height: 15px;
  display: block;
}
.avatar-dropdown button.menu-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: left;
  padding: 11px 12px;
  border-radius: 10px;
  background: transparent;
  color: var(--forest);
  font-weight: 600;
  font-size: 0.92rem;
  box-shadow: none;
  transform: none;
}
.avatar-dropdown button.menu-item:hover {
  background: rgba(11, 61, 54, 0.06);
  transform: none;
}
.avatar-dropdown button.menu-item.danger {
  color: var(--danger);
}
.avatar-dropdown button.menu-item.menu-item-spread {
  justify-content: space-between;
}
.avatar-dropdown .menu-badge {
  min-width: 18px;
  height: 18px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--danger);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 800;
  line-height: 18px;
  text-align: center;
}
.avatar-dropdown .menu-sep {
  height: 1px;
  margin: 4px 8px;
  background: var(--line);
}

/* Bottom navigation */
.bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 30;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2px;
  padding: 8px 10px calc(8px + env(safe-area-inset-bottom, 0px));
  background: rgba(243, 235, 224, 0.92);
  backdrop-filter: blur(16px);
  border-top: 1px solid var(--line);
  box-shadow: 0 -8px 28px rgba(7, 41, 36, 0.06);
}
.bottom-nav.nav-cols-5 {
  grid-template-columns: repeat(5, 1fr);
}
.bottom-nav.hidden { display: none !important; }
.bottom-nav button {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 56px;
  padding: 8px 4px;
  border-radius: 14px;
  background: transparent;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  box-shadow: none;
  transform: none;
}
.bottom-nav button:hover {
  background: rgba(11, 61, 54, 0.05);
  color: var(--forest);
  transform: none;
}
.bottom-nav button.active {
  background: rgba(11, 61, 54, 0.08);
  color: var(--forest);
}
.bottom-nav .nav-icon {
  width: 22px;
  height: 22px;
  display: block;
}
.bottom-nav button.active .nav-icon {
  color: var(--palm);
}
.bottom-nav button {
  position: relative;
}
.bottom-nav .nav-badge {
  position: absolute;
  top: 4px;
  right: calc(50% - 22px);
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--danger);
  color: #fff;
  font-size: 0.62rem;
  font-weight: 800;
  line-height: 16px;
  text-align: center;
}
.list li.notif-unread {
  background: rgba(31, 138, 98, 0.06);
  margin: 0 -8px;
  padding-left: 8px;
  padding-right: 8px;
  border-radius: 10px;
}
.list li.notif-unread > div:first-child > div:first-child::before {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--palm);
  margin-right: 8px;
  vertical-align: middle;
}

.view-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.45rem;
  letter-spacing: -0.03em;
  color: var(--forest);
  margin: 18px 0 6px;
}
.view-sub {
  color: var(--muted);
  font-size: 0.9rem;
  margin: 0 0 18px;
}

/* Auth brand stage */
.auth-page {
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - 72px);
}
.auth-stage {
  display: grid;
  gap: 32px;
  padding: 36px 0 24px;
  flex: 1;
  animation: rise 0.7s var(--ease) both;
}
@media (min-width: 860px) {
  .auth-stage {
    grid-template-columns: 1fr 400px;
    align-items: center;
    gap: 48px;
    min-height: calc(100vh - 220px);
    padding-top: 48px;
  }
}

/* Control centre (admin mode of the member shell) */
.admin-section-tabs {
  display: flex;
  flex-wrap: nowrap;
  grid-template-columns: unset;
  gap: 4px;
  margin-bottom: 18px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}
.admin-section-tabs button {
  flex: 1 1 0;
  min-width: 4.8rem;
  white-space: nowrap;
  padding: 10px 8px;
  font-size: 0.88rem;
}
.admin-section > .card + .card,
.admin-section > .grid + .card,
.admin-section > .section-label + .card {
  margin-top: 0;
}
.admin-section > .section-label {
  margin-top: 22px;
  margin-bottom: 10px;
}
.admin-section > .section-label:first-child {
  margin-top: 8px;
}
.admin-kpi {
  margin: 0 0 4px;
  gap: 12px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.admin-kpi .stat {
  padding: 16px 18px;
  background: var(--card);
  box-shadow: var(--shadow);
}
.admin-kpi .value {
  font-size: 1.85rem;
  margin-top: 6px;
}
.admin-kpi .meta {
  margin: 6px 0 0;
  line-height: 1.35;
}
.admin-kpi-alert {
  border-color: rgba(212, 160, 23, 0.45);
  background:
    radial-gradient(120% 100% at 100% 0%, rgba(212, 160, 23, 0.12), transparent 55%),
    var(--card);
}
.admin-panel {
  margin-bottom: 0;
}
.admin-panel .sub {
  margin-bottom: 12px;
}
.admin-kv {
  display: flex;
  flex-direction: column;
  gap: 0;
}
.admin-kv-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
}
.admin-kv-row:first-child {
  border-top: 0;
  padding-top: 2px;
}
.admin-kv-key {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 600;
}
.admin-kv-val {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.98rem;
  color: var(--forest);
  letter-spacing: -0.02em;
  text-align: right;
}
.admin-risk-body .admin-kv {
  margin-bottom: 4px;
}
.admin-compliance-line {
  margin: 10px 0 0;
  font-size: 0.86rem;
}
.admin-list-host {
  margin-top: 8px;
}
.admin-pager {
  margin-top: 12px;
  align-items: center;
}
.admin-row-click {
  cursor: pointer;
}
.admin-row-click:hover td {
  background: rgba(11, 61, 54, 0.04);
}
.admin-user-detail {
  margin-top: 14px;
}
.admin-user-card {
  margin-top: 4px;
}
.admin-user-name {
  font-weight: 700;
}
.admin-filter-field {
  max-width: 220px;
}
.admin-count {
  margin: 0 0 10px;
}
.admin-settings-intro {
  margin: 0 0 16px;
}
.admin-settings-group {
  margin-bottom: 14px;
}
.admin-settings-group .sub {
  margin-bottom: 16px;
}
.admin-setting-field {
  margin-bottom: 16px;
  font-weight: 600;
}
.admin-setting-field:last-child {
  margin-bottom: 0;
}
.admin-setting-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 4px;
}
.admin-setting-label {
  font-weight: 700;
  color: var(--forest);
}
.admin-setting-meta {
  display: block;
  margin: 0 0 8px;
  font-weight: 500;
  line-height: 1.4;
}
.admin-settings-actions {
  margin: 4px 0 8px;
  position: sticky;
  bottom: 72px;
  padding: 10px 0 4px;
  background: linear-gradient(180deg, transparent, var(--sand) 28%);
}
.admin-settings-actions .gold {
  min-width: 140px;
}
@media (max-width: 640px) {
  .admin-kpi {
    grid-template-columns: 1fr;
  }
}
.auth-dev-note {
  font-size: 0.8rem;
  margin: 14px 0 0;
}

@media (max-width: 520px) {
  .bottom-nav button .nav-label {
    font-size: 0.62rem;
  }
}

/* Dev/local API override — compact header control */
.api-setting {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}
.api-setting input {
  width: min(220px, 42vw);
  margin: 0;
  padding: 7px 10px;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(255, 252, 247, 0.9);
  color: var(--ink);
}
.api-setting input:focus {
  outline: none;
  border-color: var(--palm);
  box-shadow: 0 0 0 3px rgba(31, 138, 98, 0.12);
}
@media (max-width: 560px) {
  .api-setting { display: none; }
}
.auth-footer {
  margin-top: auto;
  border-top: 1px solid var(--line);
  padding: 22px 0 28px;
}
.auth-footer-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 16px 24px;
  align-items: center;
  justify-content: space-between;
}
.auth-footer-legal {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  align-items: center;
  font-size: 0.86rem;
  color: var(--muted);
}
.auth-footer-legal a {
  color: var(--forest);
  font-weight: 600;
  text-decoration: none;
}
.auth-footer-legal a:hover { color: var(--palm); }
.auth-footer-social {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-left: auto;
}
.auth-social-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid rgba(11, 61, 54, 0.22);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--forest);
  text-decoration: none;
  transition: background 0.18s, border-color 0.18s;
}
.auth-social-btn svg {
  width: 15px;
  height: 15px;
}
.auth-social-btn:hover {
  background: rgba(11, 61, 54, 0.06);
  border-color: rgba(11, 61, 54, 0.4);
}
@media (max-width: 640px) {
  .auth-footer-social { margin-left: 0; }
}
.auth-hero {
  position: relative;
  padding: 4px 0 8px;
  max-width: 22rem;
}
.auth-hero .eyebrow {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--palm);
  margin: 0 0 12px;
}
.auth-hero .brand-name {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(2rem, 5vw, 2.75rem);
  line-height: 1.1;
  letter-spacing: -0.035em;
  color: var(--forest);
  margin: 0 0 14px;
  max-width: 14ch;
}
.auth-hero .lead {
  font-size: 1.05rem;
  line-height: 1.45;
  color: var(--muted);
  margin: 0;
}
.auth-card {
  width: 100%;
  max-width: 400px;
  margin: 0 auto;
  padding: 28px 24px;
}
@media (min-width: 860px) {
  .auth-card { margin: 0; }
}
.auth-card-title {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--forest);
  margin: 0 0 4px;
}
.auth-card-sub {
  color: var(--muted);
  font-size: 0.88rem;
  margin: 0 0 20px;
}

/* Segmented control — not circular blobs */
.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 4px;
  margin-bottom: 20px;
  border-radius: 12px;
  background: rgba(11, 61, 54, 0.06);
  border: 1px solid var(--line);
}
.auth-tabs button {
  border-radius: 9px;
  padding: 10px 12px;
  font-size: 0.92rem;
  font-weight: 700;
  background: transparent;
  color: var(--muted);
  border: 0;
  box-shadow: none;
  transform: none;
}
.auth-tabs button:hover {
  background: rgba(255, 255, 255, 0.55);
  transform: none;
}
.activity-tabs {
  margin: 0 0 16px;
}
.activity-tab-body { min-height: 120px; }

.auth-tabs button.active {
  background: #fff;
  color: var(--forest);
  box-shadow: 0 1px 3px rgba(11, 61, 54, 0.1);
}
/* Control centre: keep Overview | Users | Curves | Settings on one row */
.auth-tabs.admin-section-tabs {
  display: flex;
  flex-wrap: nowrap;
  grid-template-columns: unset;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}
.auth-tabs.admin-section-tabs button {
  flex: 1 1 0;
  min-width: 4.8rem;
  white-space: nowrap;
  padding: 10px 8px;
  font-size: 0.88rem;
}
.auth-card .btn-block {
  width: 100%;
  margin-top: 4px;
  border-radius: 12px;
}
.auth-card .btnrow { margin-top: 4px; }
.auth-card .btnrow button { flex: 1; border-radius: 12px; }

@keyframes rise {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

.panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) + 4px);
  box-shadow: var(--shadow);
  padding: 22px;
  backdrop-filter: blur(8px);
  animation: rise 0.75s var(--ease) 0.08s both;
}
.panel h2,
.section h2 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.2rem;
  letter-spacing: -0.02em;
  margin: 0 0 4px;
}
.panel .sub,
.section .sub {
  color: var(--muted);
  font-size: 0.9rem;
  margin: 0 0 16px;
}

/* Interactive panels (used as .card throughout app.js) */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) + 4px);
  box-shadow: var(--shadow);
  padding: 22px;
  margin-bottom: 16px;
  backdrop-filter: blur(8px);
  animation: rise 0.65s var(--ease) both;
}
.card:nth-of-type(2) { animation-delay: 0.05s; }
.card:nth-of-type(3) { animation-delay: 0.1s; }
.card:nth-of-type(4) { animation-delay: 0.15s; }
.card:nth-of-type(5) { animation-delay: 0.2s; }
.card h2 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
  margin: 0 0 4px;
}
.card .sub { color: var(--muted); font-size: 0.88rem; margin: 0 0 14px; }

/* Dashboard hero */
.home-hero {
  margin: 18px 0 22px;
  padding: 28px 24px;
  border-radius: 28px;
  background:
    radial-gradient(120% 100% at 100% 0%, rgba(212, 160, 23, 0.22), transparent 45%),
    linear-gradient(145deg, var(--forest) 0%, #0f5c4c 55%, #146b4f 100%);
  color: #f7f3ea;
  box-shadow: 0 24px 48px rgba(7, 41, 36, 0.22);
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  animation: rise 0.7s var(--ease) both;
}
.home-hero::after {
  content: "";
  position: absolute;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.12);
  right: -40px;
  top: -50px;
  pointer-events: none;
}
.home-hero-copy {
  position: relative;
  z-index: 1;
  min-width: 0;
  flex: 1;
}
.home-hero .kicker {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  opacity: 0.75;
  margin: 0 0 8px;
}
.home-hero .balance {
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 8vw, 3.4rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1;
  margin: 0;
}

/* Circular join CTA */
.join-orb {
  position: relative;
  z-index: 1;
  flex-shrink: 0;
  width: 112px;
  height: 112px;
  border-radius: 50%;
  padding: 14px;
  border: 0;
  background: linear-gradient(145deg, var(--gold) 0%, #e0b33a 100%);
  color: #3a2c00;
  box-shadow: 0 12px 28px rgba(212, 160, 23, 0.35);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  animation: join-float 3.2s var(--ease) infinite;
}
.join-orb:hover {
  filter: brightness(1.05);
  transform: scale(1.03);
}
.join-orb:active { transform: scale(0.98); }
.join-orb.in-curve {
  background: linear-gradient(145deg, var(--palm-bright) 0%, var(--palm) 100%);
  color: #06261f;
  box-shadow: 0 12px 28px rgba(31, 138, 98, 0.32);
}
.join-orb.in-curve .join-orb-ring {
  border-color: rgba(42, 173, 120, 0.5);
}
.join-orb-label {
  position: relative;
  z-index: 1;
  font-family: var(--font-display);
  font-size: 0.78rem;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.02em;
  max-width: 4.8em;
}
.join-orb-ring {
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 2px solid rgba(240, 215, 138, 0.55);
  animation: join-pulse 2.4s var(--ease) infinite;
  pointer-events: none;
}
.join-orb-ring.delay { animation-delay: 0.8s; }

.my-curve-flow .my-curve-card {
  margin: 0 0 14px;
  padding: 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(11, 61, 54, 0.03);
}
.my-curve-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}
.my-curve-head strong {
  font-size: 1.05rem;
  color: var(--forest);
}
.my-curve-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 12px;
}
.my-curve-stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.my-curve-stat .label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}
.my-curve-stat strong {
  font-size: 0.95rem;
  color: var(--forest);
  font-weight: 700;
}
@keyframes join-pulse {
  0% { transform: scale(0.92); opacity: 0.85; }
  70% { transform: scale(1.18); opacity: 0; }
  100% { transform: scale(1.18); opacity: 0; }
}
@keyframes join-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}

/* Join flow: modal (desktop) / bottom sheet (mobile) */
body.overlay-open { overflow: hidden; }
#overlay-root {
  position: fixed;
  inset: 0;
  z-index: 45;
  pointer-events: none;
}
#overlay-root:has(.sheet) { pointer-events: auto; }
.sheet-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(7, 41, 36, 0.45);
  opacity: 0;
  transition: opacity 0.25s var(--ease);
}
.sheet-backdrop.show { opacity: 1; }
.sheet {
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(440px, calc(100vw - 32px));
  max-height: min(86vh, 640px);
  display: flex;
  flex-direction: column;
  background: #fffdf9;
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: 0 28px 60px rgba(7, 41, 36, 0.28);
  transform: translate(-50%, -46%) scale(0.96);
  opacity: 0;
  transition: transform 0.28s var(--ease), opacity 0.28s var(--ease);
  overflow: hidden;
}
.sheet.show {
  transform: translate(-50%, -50%) scale(1);
  opacity: 1;
}
.sheet-handle {
  display: none;
  width: 42px;
  height: 4px;
  border-radius: 999px;
  background: rgba(11, 61, 54, 0.18);
  margin: 10px auto 0;
}
.sheet-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 18px 8px;
}
.sheet-title {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--forest);
  margin: 0;
}
.sheet-close {
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: 50%;
  background: rgba(11, 61, 54, 0.06);
  color: var(--forest);
  font-size: 1.35rem;
  line-height: 1;
  font-weight: 500;
  box-shadow: none;
  transform: none;
}
.sheet-close:hover {
  background: rgba(11, 61, 54, 0.1);
  transform: none;
}
.sheet-body {
  padding: 4px 18px 22px;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}
.join-flow .join-step-title {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--forest);
  margin: 8px 0 6px;
}
.join-flow .sub { margin-bottom: 18px; }
.join-flow .freq-chips { margin-bottom: 18px; }
.join-flow .join-summary { margin: 0 0 10px; }
.join-flow .join-nav {
  margin-top: 18px;
  align-items: stretch;
}
.join-flow .join-nav .gold,
.join-flow .join-nav .secondary { flex: 1; }
.join-flow .btn-block { width: 100%; margin-top: 8px; }

@media (max-width: 720px) {
  .sheet {
    left: 0;
    right: 0;
    top: auto;
    bottom: 0;
    width: 100%;
    max-height: min(92vh, 720px);
    border-radius: 22px 22px 0 0;
    transform: translateY(108%);
    opacity: 1;
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }
  .sheet.show {
    transform: translateY(0);
  }
  .sheet-handle { display: block; }
  .sheet-backdrop { background: rgba(7, 41, 36, 0.5); }
}

.home-hero-stack {
  flex-direction: column;
  align-items: stretch;
}
.home-hero-wallet {
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
}
.home-hero-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  position: relative;
  z-index: 1;
}
.home-hero-wallet .kicker { margin: 0; }
.home-hero-wallet .balance { margin: 0; }

.fund-card .fund-presets { margin-bottom: 12px; }
.fund-card .fund-status {
  margin-top: 10px;
  margin-bottom: 0;
  min-height: 1.2em;
}
.home-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 4px;
  position: relative;
  z-index: 1;
}
.home-actions.compact {
  margin-top: 0;
  gap: 6px;
  justify-content: flex-end;
  flex-shrink: 0;
}
.home-actions.compact button {
  padding: 6px 10px;
  font-size: 0.72rem;
  font-weight: 700;
  border-radius: 999px;
  line-height: 1.2;
}
.home-actions.compact button.gold {
  box-shadow: 0 4px 12px rgba(212, 160, 23, 0.22);
}
.home-actions button.ghost {
  background: transparent;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.35);
}
.home-actions button.ghost:hover { background: rgba(255, 255, 255, 0.08); }

.section-label {
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--forest);
  margin: 28px 0 10px;
  opacity: 0.7;
}

.grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  margin-bottom: 8px;
}
.stat {
  background: rgba(255, 252, 247, 0.65);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px;
}
.stat .stat-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.stat-share {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(11, 61, 54, 0.06);
  color: var(--forest);
  border: 1px solid var(--line);
  font-size: 0.72rem;
  font-weight: 700;
  box-shadow: none;
  transform: none;
}
.stat-share:hover {
  background: rgba(11, 61, 54, 0.1);
  transform: none;
}
.stat-share:disabled {
  opacity: 0.45;
}
.stat-share .share-icon {
  width: 14px;
  height: 14px;
  display: block;
}
.stat .label {
  color: var(--muted);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 700;
}
.stat .value {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-top: 4px;
  color: var(--forest);
}
.stat .value.sm { font-size: 1.05rem; }

label.field {
  display: block;
  margin-bottom: 12px;
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--forest);
}
label.field input,
label.field select {
  display: block;
  width: 100%;
  margin-top: 6px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-family: inherit;
  background: #fffdf9;
  color: var(--ink);
  transition: border-color 0.2s, box-shadow 0.2s;
}
label.field input:focus,
label.field select:focus {
  outline: none;
  border-color: var(--palm);
  box-shadow: 0 0 0 3px rgba(31, 138, 98, 0.15);
}
label.field.inline {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
}
label.field.inline input { margin-top: 0; }

button {
  font: inherit;
  cursor: pointer;
  border: 0;
  border-radius: 12px;
  padding: 12px 18px;
  font-weight: 700;
  background: var(--palm);
  color: #fff;
  transition: transform 0.18s var(--ease), background 0.18s, box-shadow 0.18s;
}
button:hover { background: var(--palm-bright); transform: translateY(-1px); }
button:active { transform: translateY(0); }
button.secondary {
  background: rgba(11, 61, 54, 0.06);
  color: var(--forest);
  border: 1px solid var(--line);
}
button.secondary:hover { background: rgba(11, 61, 54, 0.1); }
button.gold {
  background: linear-gradient(135deg, var(--gold) 0%, #e0b33a 100%);
  color: #3a2c00;
  box-shadow: 0 8px 20px rgba(212, 160, 23, 0.28);
  border-radius: 999px;
}
button.gold:hover { filter: brightness(1.05); }
button.mini {
  padding: 5px 10px;
  font-size: 0.72rem;
  border-radius: 8px;
  background: var(--forest);
  color: #fff;
}
button:disabled { opacity: 0.5; cursor: default; transform: none; }
.btnrow { display: flex; flex-wrap: wrap; gap: 10px; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  border: 1px solid var(--line);
  background: #fffdf9;
  border-radius: 999px;
  padding: 9px 16px;
  font-weight: 700;
  cursor: pointer;
  color: var(--forest);
  transition: transform 0.15s var(--ease), background 0.15s, color 0.15s;
}
.chip:hover { transform: translateY(-1px); }
.chip.active {
  background: var(--forest);
  color: #fff;
  border-color: var(--forest);
}

.tag {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: lowercase;
}
.tag.green { background: #d8f3e6; color: #0d5c3f; }
.tag.gold { background: #f8e9b8; color: #7a5c00; }
.tag.grey { background: #ebe6db; color: var(--muted); }
.tag.red { background: #f7dedb; color: var(--danger); }

.list { list-style: none; margin: 0; padding: 0; }
.list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}
.list li:last-child { border-bottom: 0; }
.list .meta { color: var(--muted); font-size: 0.8rem; }
.amount.pos { color: var(--ok); font-weight: 700; }
.amount.neg { color: var(--ink); font-weight: 700; }

.curve-row {
  display: grid;
  gap: 4px;
}
.curve-row .title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.02rem;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.stepper { display: flex; gap: 8px; margin-bottom: 16px; }
.stepper .dot {
  flex: 1;
  height: 5px;
  border-radius: 999px;
  background: var(--sand-deep);
}
.stepper .dot.on {
  background: linear-gradient(90deg, var(--palm), var(--gold));
}

.tabs { display: flex; gap: 8px; margin-bottom: 16px; }
.tabs button {
  background: rgba(11, 61, 54, 0.06);
  color: var(--forest);
  border: 1px solid var(--line);
}
.tabs button.active {
  background: var(--forest);
  color: #fff;
  border-color: var(--forest);
}

body.has-bottom-nav .toast { bottom: calc(88px + env(safe-area-inset-bottom, 0px)); }
.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%) translateY(8px);
  background: var(--forest-deep);
  color: #fff;
  padding: 12px 18px;
  border-radius: 999px;
  box-shadow: var(--shadow);
  font-size: 0.9rem;
  font-weight: 600;
  opacity: 0;
  transition: opacity 0.25s, transform 0.25s var(--ease);
  z-index: 50;
  max-width: 90vw;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.err { background: var(--danger); }

.muted { color: var(--muted); }
.meta {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 500;
}
.empty { color: var(--muted); font-style: italic; padding: 8px 0; }
.hidden { display: none !important; }
.right { text-align: right; }
.spread {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.join-summary {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.35rem;
  letter-spacing: -0.03em;
  color: var(--forest);
  margin: 0 0 14px;
}

.loading {
  padding: 48px 0;
  text-align: center;
  color: var(--muted);
  font-weight: 600;
  animation: rise 0.5s var(--ease) both;
}

@media (max-width: 560px) {
  .brand-word { height: 20px; }
  .home-hero { padding: 22px 18px; border-radius: 22px; }
  .join-orb { width: 96px; height: 96px; }
  .join-orb-label { font-size: 0.72rem; }
  .list li { align-items: flex-start; flex-direction: column; }
  .list .right { text-align: left; width: 100%; }
}
