:root {
  --green: #087f67;
  --ink: #153e36;
  --muted: #61756e;
  --line: #e3ebe7;
  --soft: #f3f7f5;
  --bg: #fafcfb;
  --mint: #e6f4ec;
  font-family: "DM Sans", system-ui, sans-serif;
  color: var(--ink);
  background: var(--bg);
  font-size: 16px;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
button,
input,
select,
textarea {
  font: inherit;
}
button,
a {
  touch-action: manipulation;
}
button {
  cursor: pointer;
  border: 1px solid var(--line);
  border-radius: 12px;
  min-height: 46px;
  padding: 11px 16px;
  background: white;
  color: var(--ink);
  font-weight: 600;
}
button:hover {
  background: var(--soft);
}
button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
button:focus-visible,
a:focus-visible {
  outline: 3px solid #d99c36;
  outline-offset: 3px;
}
a {
  color: var(--green);
}
h1,
h2,
h3,
p {
  margin: 0;
}
h1,
h2,
h3,
.hero-amount,
.brand {
  font-family: Manrope, system-ui, sans-serif;
}
h1 {
  font-size: 1.8rem;
  line-height: 1.25;
  letter-spacing: -0.04em;
}
h2 {
  font-size: 1.15rem;
}
h3 {
  font-size: 1rem;
}
p {
  line-height: 1.5;
}
.muted,
.meta {
  color: var(--muted);
}
.meta {
  font-size: 0.875rem;
}
.eyebrow {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  color: var(--muted);
  margin-bottom: 9px;
}
.demo-ribbon {
  background: #e7efeb;
  color: #405f54;
  text-align: center;
  padding: 5px 12px;
  font-size: 0.75rem;
}
.topbar {
  height: 88px;
  max-width: 1250px;
  margin: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  border-bottom: 1px solid var(--line);
}
.brand {
  text-decoration: none;
  display: flex;
  gap: 11px;
  align-items: center;
  color: var(--ink);
  font-weight: 800;
  font-size: 1.4rem;
}
.brand img {
  width: 46px;
  height: 46px;
  object-fit: contain;
}
.brand small {
  display: block;
  font:
    400 0.75rem "DM Sans",
    sans-serif;
  color: var(--muted);
  margin-top: 3px;
}
.profile {
  border-radius: 50%;
  width: 44px;
  height: 44px;
  padding: 0;
  background: var(--mint);
  font-size: 0.875rem;
}
.app-shell {
  display: grid;
  grid-template-columns: 205px 1fr;
  max-width: 1250px;
  margin: auto;
  min-height: calc(100vh - 116px);
}
#sidebar {
  border-right: 1px solid var(--line);
  padding: 32px 16px 20px 28px;
}
#sidebar .nav-item {
  display: flex;
  width: 100%;
  gap: 12px;
  align-items: center;
  margin-bottom: 5px;
  text-align: left;
  border: 0;
  background: none;
  font-size: 0.9rem;
}
#sidebar .nav-item.active {
  background: var(--mint);
  color: var(--green);
}
.nav-group {
  font-size: 0.75rem;
  margin: 24px 15px 10px;
  color: var(--muted);
}
#app {
  min-width: 0;
  padding: 32px 40px 60px;
  max-width: 1010px;
  width: 100%;
}
.page-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}
.page-heading .meta {
  margin-top: 8px;
}
.primary {
  background: var(--green);
  border-color: var(--green);
  color: white;
}
.primary:hover {
  background: #056a56;
}
.ghost {
  border-color: transparent;
  background: transparent;
  color: var(--green);
}
.wide {
  width: 100%;
}
.small {
  font-size: 0.875rem;
  min-height: 44px;
  padding: 9px 13px;
}
.treasury {
  background: var(--ink);
  color: #fff;
  border-radius: 24px;
  padding: 30px 32px;
  position: relative;
}
.treasury > p:first-child {
  font-weight: 500;
  font-size: 1rem;
  color: #d9eae3;
}
.hero-amount {
  font-size: 2.7rem;
  font-weight: 800;
  letter-spacing: -0.055em;
  line-height: 1.2;
  margin: 12px 0;
}
.hero-amount small {
  font:
    500 0.85rem "DM Sans",
    sans-serif;
  letter-spacing: 0;
  color: #d9eae3;
}
.subtle {
  font-size: 0.875rem;
  color: #d3e4dc;
}
.treasury .info-button {
  position: absolute;
  right: 16px;
  top: 12px;
  background: transparent;
  border: 0;
  color: white;
  border-radius: 50%;
}
.quick-actions {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin: 16px 0 24px;
}
.quick-actions button {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  min-height: 66px;
  border-radius: 16px;
  font-size: 0.9rem;
}
.quick-actions .icon {
  color: var(--green);
  width: 24px;
  height: 24px;
}
.icon {
  width: 20px;
  height: 20px;
  display: inline-block;
  vertical-align: middle;
  flex: none;
}
.secondary-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin: 26px 0;
}
.stat {
  border: 0;
  background: none;
  text-align: left;
  padding: 0;
  min-width: 0;
}
.stat:hover {
  background: none;
}
.stat p {
  color: var(--muted);
  font-size: 0.875rem;
}
.stat strong {
  display: block;
  font-size: 1.3rem;
  letter-spacing: -0.025em;
  margin-top: 6px;
}
.stat small {
  font-size: 0.75rem;
  font-weight: 400;
}
.panel {
  background: white;
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 24px;
  margin-top: 22px;
}
.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}
.section-heading .ghost {
  padding: 4px 0;
  font-size: 0.875rem;
}
.meeting-card {
  display: flex;
  gap: 18px;
  align-items: center;
}
.date-tile {
  background: var(--mint);
  color: var(--green);
  border-radius: 14px;
  min-width: 58px;
  padding: 10px 7px;
  text-align: center;
  font-size: 0.75rem;
}
.date-tile b {
  display: block;
  font-size: 1.5rem;
  line-height: 1.1;
  margin-bottom: 2px;
}
.grow {
  flex: 1;
  min-width: 0;
}
.meeting-card p {
  margin-top: 5px;
}
.meeting-link {
  margin-top: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  text-align: left;
}
.rows {
  display: flex;
  flex-direction: column;
}
.row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
  min-width: 0;
}
.row:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}
.row:first-child {
  padding-top: 0;
}
.row .amount {
  text-align: right;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  font-size: 0.95rem;
}
.row p,
.row small {
  display: block;
}
.row small {
  color: var(--muted);
  font-size: 0.8rem;
  margin-top: 5px;
}
.avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--soft);
  display: grid;
  place-items: center;
  font-size: 0.8rem;
  color: var(--green);
  flex: none;
}
.row-button {
  width: 100%;
  border: 0;
  border-radius: 0;
  background: transparent;
  text-align: left;
  font-weight: 400;
}
.positive {
  color: var(--green);
}
.empty {
  text-align: center;
  color: var(--muted);
  padding: 30px 12px;
  line-height: 1.65;
}
.chip {
  display: inline-block;
  border-radius: 7px;
  padding: 4px 7px;
  font-size: 0.75rem;
  background: var(--soft);
  color: var(--muted);
  font-weight: 500;
}
.chip.green {
  background: var(--mint);
  color: #076e58;
}
.tabs {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  margin-bottom: 20px;
  padding: 5px;
  background: var(--soft);
  border-radius: 14px;
}
.tabs button {
  flex: 1;
  border: 0;
  background: transparent;
  font-size: 0.875rem;
  min-width: 0;
  padding: 10px 8px;
}
.tabs button.active {
  background: white;
  box-shadow: 0 1px 4px #173b2d14;
}
.toolbar {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin: 18px 0;
}
.toolbar > * {
  flex: 1;
}
.info {
  border-radius: 12px;
  padding: 14px 16px;
  background: var(--soft);
  color: #49645a;
  font-size: 0.875rem;
  line-height: 1.55;
  margin: 16px 0;
}
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
}
.full {
  grid-column: 1/-1;
}
label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
}
input,
select,
textarea {
  width: 100%;
  margin-top: 7px;
  border: 1px solid #c9d8d0;
  border-radius: 10px;
  padding: 12px;
  background: white;
  color: var(--ink);
  min-height: 48px;
  min-width: 0;
  font-size: 1rem;
}
textarea {
  min-height: 80px;
  resize: vertical;
}
.form-note {
  font-size: 0.8rem;
  color: var(--muted);
  margin: 6px 0 14px;
}
.check {
  display: flex;
  gap: 10px;
  align-items: center;
}
.check input {
  width: 20px;
  min-height: 20px;
  margin: 0;
}
.error {
  color: #a52f30;
  font-size: 0.875rem;
  line-height: 1.45;
  margin: 12px 0;
}
.balance-lines {
  margin: 14px 0;
}
.balance-line {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 0;
  line-height: 1.4;
}
.balance-line strong {
  text-align: right;
  white-space: nowrap;
}
.balance-line.total {
  border-top: 1px solid var(--line);
  font-weight: 600;
  margin-top: 6px;
}
.menu-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.menu-grid button {
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
  min-height: 65px;
}
.bottomnav {
  display: none;
}
.back {
  padding-left: 0;
  margin-bottom: 14px;
}
dialog {
  border: 0;
  border-radius: 24px;
  padding: 0;
  max-width: 500px;
  width: calc(100% - 32px);
  max-height: 90dvh;
  color: var(--ink);
  box-shadow: 0 20px 80px #0b382b2e;
}
dialog::backdrop {
  background: #12352c69;
  backdrop-filter: blur(3px);
}
.dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 24px 12px;
  gap: 16px;
}
.dialog-head button {
  padding: 0;
  width: 44px;
  min-width: 44px;
  border: 0;
  background: var(--soft);
  border-radius: 50%;
}
.dialog-body {
  padding: 8px 24px 24px;
}
.dialog-body form > label {
  margin-bottom: 15px;
}
.dialog-actions {
  display: flex;
  gap: 10px;
  margin-top: 22px;
}
.dialog-actions > * {
  flex: 1;
}
.preview-summary {
  background: var(--mint);
  padding: 16px;
  border-radius: 14px;
  margin: 15px 0;
}
.preview-summary .balance-line {
  font-size: 0.9rem;
  padding: 6px 0;
}
.loan-card {
  border: 1px solid var(--line);
  background: white;
  border-radius: 16px;
  padding: 20px;
  margin: 14px 0;
}
.loan-card .section-heading {
  margin-bottom: 4px;
}
.loan-card .balance-line {
  font-size: 0.875rem;
}
.recap {
  background: white;
  border: 1px solid var(--line);
  padding: 24px;
  border-radius: 20px;
  margin-top: 18px;
}
.recap .brand {
  font-size: 1.15rem;
  margin-bottom: 22px;
}
.recap h2 {
  font-size: 1.4rem;
}
.recap-cash {
  margin: 20px 0;
  background: var(--ink);
  color: white;
  padding: 20px;
  border-radius: 14px;
}
.recap-cash strong {
  display: block;
  font-size: 1.8rem;
  margin-top: 6px;
}
.recap .balance-line {
  font-size: 0.875rem;
}
.readonly-banner {
  background: var(--mint);
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 0.875rem;
  margin-bottom: 18px;
}
.separator {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 24px 0;
}
.home-grid {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 24px;
  align-items: start;
}
.home-grid > .panel {
  margin-top: 0;
}
.tontine-selector {
  border: 0;
  background: none;
  padding: 0;
  text-align: left;
  min-height: 40px;
  color: var(--muted);
  font-size: 0.875rem;
  font-weight: 500;
}
#toast {
  position: fixed;
  bottom: 26px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--ink);
  color: white;
  border-radius: 12px;
  padding: 13px 20px;
  max-width: calc(100% - 32px);
  width: max-content;
  z-index: 5;
  box-shadow: 0 8px 26px #153e3624;
  display: none;
  font-size: 0.875rem;
}
.snapshot-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
  margin-top: 12px;
}
.snapshot-table th,
.snapshot-table td {
  text-align: left;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.snapshot-table th:not(:first-child),
.snapshot-table td:not(:first-child) {
  text-align: right;
}
.snapshot-table th {
  font-weight: 500;
  color: var(--muted);
}
@media (max-width: 950px) {
  .home-grid {
    grid-template-columns: 1fr;
  }
  #app {
    padding: 28px;
  }
  .app-shell {
    grid-template-columns: 175px 1fr;
  }
  #sidebar {
    padding-left: 12px;
  }
  .topbar {
    padding: 0 24px;
  }
  .hero-amount {
    font-size: 2.4rem;
  }
}
@media (max-width: 700px) {
  .demo-ribbon {
    font-size: 0.7rem;
    padding: 5px 8px;
  }
  .topbar {
    height: 76px;
    padding: 0 20px;
  }
  .brand {
    font-size: 1.25rem;
  }
  .brand small {
    font-size: 0.75rem;
  }
  .app-shell {
    display: block;
    min-height: 0;
  }
  #sidebar {
    display: none;
  }
  #app {
    padding: 24px 20px 110px;
  }
  h1 {
    font-size: 1.6rem;
  }
  .page-heading {
    margin-bottom: 22px;
    gap: 10px;
  }
  .page-heading > .primary {
    font-size: 0.875rem;
    padding: 10px 12px;
  }
  .treasury {
    padding: 24px;
    border-radius: 22px;
  }
  .hero-amount {
    font-size: 2.25rem;
    margin: 11px 0;
  }
  .hero-amount small {
    font-size: 0.75rem;
  }
  .subtle {
    font-size: 0.875rem;
  }
  .quick-actions {
    gap: 8px;
    margin: 12px 0 24px;
  }
  .quick-actions button {
    flex-direction: column;
    font-size: 0.8rem;
    gap: 7px;
    padding: 11px 3px;
    min-height: 80px;
    border-radius: 14px;
  }
  .quick-actions .icon {
    width: 22px;
    height: 22px;
  }
  .secondary-stats {
    gap: 18px;
    margin: 23px 0;
  }
  .stat strong {
    font-size: 1.15rem;
  }
  .stat p {
    font-size: 0.875rem;
  }
  .stat small {
    font-size: 0.75rem;
  }
  .panel {
    padding: 20px;
    border-radius: 18px;
    margin-top: 20px;
  }
  .section-heading h2 {
    font-size: 1.05rem;
  }
  .home-grid {
    gap: 20px;
  }
  .bottomnav {
    position: fixed;
    display: flex;
    bottom: 0;
    left: 0;
    right: 0;
    background: #fffffff5;
    backdrop-filter: blur(12px);
    border-top: 1px solid var(--line);
    z-index: 3;
    padding: 6px 10px max(8px, env(safe-area-inset-bottom));
    justify-content: space-around;
  }
  .bottomnav button {
    border: 0;
    background: transparent;
    padding: 7px 4px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    align-items: center;
    min-width: 65px;
    font-size: 0.75rem;
    color: var(--muted);
  }
  .bottomnav button.active {
    color: var(--green);
  }
  .bottomnav button.active .icon {
    background: var(--mint);
    outline: 6px solid var(--mint);
    border-radius: 6px;
  }
  .bottomnav .icon {
    margin: 3px 0 5px;
    width: 22px;
    height: 22px;
  }
  dialog {
    width: 100%;
    max-width: none;
    max-height: 94dvh;
    border-radius: 24px 24px 0 0;
    margin: auto 0 0;
  }
  .dialog-head {
    padding: 18px 20px 10px;
    position: sticky;
    top: 0;
    background: white;
    z-index: 1;
  }
  .dialog-body {
    padding: 8px 20px max(24px, env(safe-area-inset-bottom));
  }
  .dialog-head h2 {
    font-size: 1.2rem;
  }
  .form-grid {
    grid-template-columns: 1fr;
  }
  .full {
    grid-column: auto;
  }
  #toast {
    bottom: 95px;
  }
  .row {
    gap: 10px;
  }
  .row .amount {
    font-size: 0.875rem;
  }
  .row small {
    font-size: 0.75rem;
  }
  .menu-grid {
    gap: 10px;
  }
  .menu-grid button {
    padding: 14px;
    font-size: 0.875rem;
  }
  .recap {
    padding: 20px;
  }
  .snapshot-table {
    font-size: 0.8rem;
  }
  .snapshot-table th {
    font-size: 0.75rem;
  }
  .balance-line {
    font-size: 0.9rem;
  }
  .balance-line strong {
    white-space: normal;
  }
}
@media (max-width: 360px) {
  #app {
    padding-left: 14px;
    padding-right: 14px;
  }
  .topbar {
    padding: 0 14px;
  }
  .hero-amount {
    font-size: 2rem;
  }
  .treasury {
    padding: 20px;
  }
  .panel {
    padding: 16px;
  }
  .stat strong {
    font-size: 1.05rem;
  }
  .row .avatar {
    width: 32px;
    height: 32px;
  }
  .menu-grid {
    grid-template-columns: 1fr;
  }
  .recap {
    padding: 16px;
  }
}
.readonly #sidebar,
.readonly .bottomnav,
.readonly .profile {
  display: none;
}
.readonly .app-shell {
  display: block;
}
.readonly #app {
  max-width: 850px;
  margin: auto;
  padding-bottom: 40px;
}
.profile,
.info-button {
  min-width: 44px;
}
.row-button .grow p,
.row .grow p {
  overflow-wrap: anywhere;
}
.page-heading h1 {
  overflow-wrap: anywhere;
}
.row .amount {
  max-width: 45%;
  white-space: normal;
}
.preview-summary .balance-line strong {
  overflow-wrap: anywhere;
}
.dialog-actions {
  position: sticky;
  bottom: 0;
  background: white;
  padding-top: 10px;
  padding-bottom: 6px;
}
.count {
  font-size: 0.75rem;
  background: var(--soft);
  padding: 4px 7px;
  border-radius: 6px;
}
summary {
  cursor: pointer;
  min-height: 44px;
  padding: 12px 0;
}
.readonly-banner .ghost {
  float: right;
}
.share-anchor {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  text-decoration: none;
  border-radius: 12px;
  padding: 12px;
  font-weight: 600;
  min-height: 46px;
}
.quick-actions button,
.bottomnav button {
  font-size: 0.875rem;
}
@media (max-width: 350px) {
  .quick-actions button {
    font-size: 0.8125rem;
  }
  .bottomnav button {
    font-size: 0.8125rem;
  }
}
.monthly-interest {
  margin: 0 0 18px;
  padding: 16px;
  background: var(--mint);
  border-radius: 14px;
  display: grid;
  gap: 5px;
}
.monthly-interest > span {
  font-size: 0.875rem;
}
.monthly-interest strong {
  font-size: 1.4rem;
  color: var(--green);
  font-variant-numeric: tabular-nums;
}
.monthly-interest small {
  font-size: 0.875rem;
  color: var(--muted);
}
.member-state {
  border-bottom: 1px solid var(--line);
}
.member-state:last-child {
  border-bottom: 0;
}
.member-state summary {
  padding: 16px 0;
  list-style-position: inside;
}
.member-state summary > span:first-child {
  font-weight: 600;
}
.member-state summary > .meta {
  display: block;
  margin-top: 5px;
}
.share-tontine {
  margin-top: 0;
}
.share-tontine h2 {
  margin-bottom: 8px;
}
.readonly .page-heading {
  display: block;
}
@media print {
  .topbar,
  .demo-ribbon,
  #sidebar,
  .bottomnav,
  .page-heading,
  .toolbar,
  .no-print,
  dialog {
    display: none !important;
  }
  body,
  #app {
    background: white;
    padding: 0;
    margin: 0;
  }
  .app-shell {
    display: block;
  }
  #app {
    max-width: none;
  }
  .recap {
    border: 0;
    margin: 0;
    padding: 0;
  }
  .panel {
    break-inside: avoid;
  }
}
