:root {
  --ink: #17231f;
  --muted: #69756f;
  --paper: #f5f4ef;
  --surface: #ffffff;
  --line: #dedfd9;
  --brand: #1f6f5c;
  --brand-dark: #173f35;
  --brand-soft: #ddefe9;
  --positive: #16745a;
  --negative: #c44f42;
  --danger: #a9342d;
  --shadow: 0 16px 40px rgba(26, 43, 36, 0.07);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--paper);
  font-synthesis: none;
}

* {
  box-sizing: border-box;
  border-radius: 0;
}
[hidden] {
  display: none !important;
}
html {
  min-height: 100%;
}
body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 90% 0, #e6f1ea 0, transparent 27rem), var(--paper);
}
a {
  color: var(--brand);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
button,
input,
select,
textarea {
  font: inherit;
}
button,
.button {
  min-height: 44px;
}
button {
  border: 0;
  cursor: pointer;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid rgba(222, 223, 217, 0.9);
  background: rgba(245, 244, 239, 0.92);
  backdrop-filter: blur(16px);
}
.header-inner {
  width: min(1180px, calc(100% - 40px));
  min-height: 60px;
  margin: auto;
  display: flex;
  align-items: center;
  gap: 20px;
}
.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--brand-dark);
  font-size: 1.08rem;
  font-weight: 800;
  text-decoration: none;
  letter-spacing: -0.02em;
}
.wordmark-mark,
.hero-mark {
  display: grid;
  place-items: center;
  color: white;
  background: var(--brand);
  font-family: Georgia, serif;
  font-style: italic;
}
.wordmark-mark {
  width: 32px;
  height: 32px;
}
.desktop-nav {
  display: flex;
  gap: 24px;
  margin-left: 20px;
}
.desktop-nav a {
  color: var(--muted);
  font-weight: 650;
  text-decoration: none;
}
.desktop-nav a:hover {
  color: var(--ink);
}
.display-currency {
  position: relative;
  display: grid;
  gap: 3px;
  margin-left: auto;
  padding-block: 6px;
}
.display-currency label {
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 700;
}
.display-currency select {
  width: 180px;
  min-height: 36px;
  padding: 5px 8px;
  font-size: 0.8rem;
}
.currency-source,
.currency-status {
  max-width: 260px;
  color: var(--muted);
  font-size: 0.65rem;
}
/* Keep nested money spans from inheriting component-level caption styles. */
.money[data-money] {
  display: inline-block;
  vertical-align: top;
  margin: 0;
  color: inherit;
  font: inherit;
  opacity: 1;
}
.money[data-money] [data-money-primary] {
  margin: 0;
  color: inherit;
  font: inherit;
  opacity: 1;
}
.money[data-money] [data-money-original] {
  display: block;
  margin-top: 3px;
  color: inherit;
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  font-size: 0.72rem;
  font-weight: 500;
  opacity: 0.8;
}
.graph-label [data-money-original] {
  font-size: 10px;
  fill: var(--muted);
}
.account-menu {
  display: flex;
  align-items: center;
  gap: 14px;
}
.account-name {
  color: var(--muted);
  font-size: 0.9rem;
}
.text-button {
  min-height: auto;
  padding: 0;
  color: var(--brand);
  background: none;
  font-weight: 700;
}

.page-shell {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  padding: 24px 0 48px;
}
.page-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  margin-bottom: 18px;
}
.page-heading h1 {
  margin: 3px 0 0;
  font-family: Georgia, serif;
  font-size: clamp(2.2rem, 6vw, 4rem);
  font-weight: 500;
  letter-spacing: -0.045em;
  line-height: 1;
}
.page-heading p {
  margin: 6px 0 0;
}
.eyebrow {
  margin: 0;
  color: var(--brand);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}
.muted {
  color: var(--muted);
}
.back-link {
  display: inline-block;
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 650;
  text-decoration: none;
}

.button,
button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 17px;
  font-weight: 750;
  text-decoration: none;
  transition:
    transform 120ms ease,
    background 120ms ease;
}
.button:hover,
button:hover {
  transform: translateY(-1px);
}
.primary {
  color: white;
  background: var(--brand);
  box-shadow: 0 7px 20px rgba(31, 111, 92, 0.18);
}
.primary:hover {
  background: var(--brand-dark);
}
.secondary {
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
}
.danger {
  color: white;
  background: var(--danger);
}
.wide {
  width: 100%;
}
.button-row,
.headline-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.headline-actions {
  justify-content: flex-end;
}

.panel,
.entity-card,
.auth-card,
.danger-panel {
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow);
}
.panel {
  padding: 16px;
}
.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}
.panel-header h2,
.panel h2,
.danger-panel h2 {
  margin: 0;
  font-size: 1.03rem;
}
.panel-caption {
  margin: -4px 0 8px;
  color: var(--muted);
  font-size: 0.8rem;
}
.panel-header .panel-caption {
  margin: 4px 0 0;
}
.panel-header a {
  font-size: 0.88rem;
  font-weight: 750;
}
.narrow {
  width: min(700px, 100%);
  margin-inline: auto;
}
.stack {
  display: grid;
  align-content: start;
  gap: 12px;
}
.dashboard-grid,
.detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(260px, 0.8fr);
  gap: 14px;
  align-items: start;
}

.balance-strip {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  margin-bottom: 16px;
  padding: 2px 2px 8px;
  scrollbar-width: thin;
}
.balance-card {
  min-width: 220px;
  padding: 12px 16px;
  color: white;
  background: var(--brand-dark);
}
.balance-card.positive {
  background: #176954;
}
.balance-card.negative {
  background: #a94339;
}
.balance-card.settled {
  color: var(--ink);
  background: var(--brand-soft);
}
.balance-card span,
.balance-card small {
  display: block;
  opacity: 0.78;
  font-size: 0.8rem;
}
.balance-card strong {
  display: block;
  margin: 5px 0 2px;
  font-family: Georgia, serif;
  font-size: 1.7rem;
  font-weight: 500;
}

.expense-list {
  margin: 0 -8px;
}
.expense-row {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 8px;
  color: var(--ink);
  text-decoration: none;
}
.expense-row + .expense-row {
  border-top: 1px solid #ecece8;
}
.expense-row:hover {
  background: #f8faf8;
}
.payment-row {
  background: #f0f7f3;
  box-shadow: inset 3px 0 0 var(--brand);
}
.payment-row:hover {
  background: #e4f0e9;
}
.expense-row.payment-row time {
  color: var(--brand-dark);
  background: var(--brand-soft);
}
.payment-kind {
  display: inline-block;
  padding: 1px 5px;
  color: var(--brand-dark);
  background: var(--brand-soft);
  font-weight: 750;
}
.expense-row time {
  display: grid;
  place-items: center;
  min-height: 46px;
  color: var(--muted);
  background: var(--paper);
  font-size: 0.68rem;
  line-height: 1;
  text-transform: uppercase;
}
.expense-row time strong {
  color: var(--ink);
  font-size: 1.05rem;
}
.expense-copy,
.expense-amount {
  min-width: 0;
}
.expense-copy strong,
.expense-copy span,
.expense-amount span,
.expense-amount strong {
  display: block;
}
.expense-copy strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.payment-row .expense-copy strong {
  white-space: normal;
  overflow-wrap: anywhere;
}
.expense-copy span,
.expense-amount span,
.expense-amount small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.78rem;
}
.expense-amount {
  text-align: right;
}
.expense-amount [data-money-primary] {
  white-space: nowrap;
}
.expense-amount small {
  display: block;
  font-size: 0.72rem;
}
.expense-amount.positive strong {
  color: var(--positive);
}
.expense-amount.negative strong {
  color: var(--negative);
}

.choice-list {
  display: grid;
}
.choice-list a {
  display: grid;
  grid-template-columns: 38px 1fr auto;
  gap: 12px;
  align-items: center;
  min-height: 44px;
  padding: 5px 2px;
  color: var(--ink);
  font-weight: 680;
  text-decoration: none;
}
.choice-list a + a {
  border-top: 1px solid #ecece8;
}
.choice-list.compact a {
  min-height: 44px;
}
.choice-copy {
  display: grid;
  gap: 1px;
  min-width: 0;
}
.choice-copy strong {
  overflow: hidden;
  font-weight: 680;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.choice-copy small {
  font-size: 0.78rem;
  font-weight: 650;
}
.choice-copy small.positive {
  color: var(--positive);
}
.choice-copy small.negative {
  color: var(--negative);
}
.choice-icon,
.entity-icon {
  display: grid;
  place-items: center;
  color: var(--brand-dark);
  background: var(--brand-soft);
  font-family: Georgia, serif;
  font-weight: 700;
}
.choice-icon {
  width: 36px;
  height: 36px;
}
.avatar {
  display: grid;
  flex: none;
  place-items: center;
  width: 38px;
  height: 38px;
  color: var(--brand-dark);
  background: #e4ece7;
  font-size: 0.75rem;
  font-weight: 800;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.entity-card {
  position: relative;
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  min-height: 104px;
  padding: 14px;
  color: var(--ink);
  text-decoration: none;
}
.entity-card:hover {
  border-color: #bdc9c3;
  transform: translateY(-2px);
}
.entity-card .avatar,
.entity-icon {
  width: 52px;
  height: 52px;
}
.entity-card h2 {
  margin: 3px 0;
  overflow: hidden;
  font-size: 1.06rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.entity-card p {
  margin: 0;
}
.entity-card p.group-balance {
  margin-top: 4px;
  font-size: 0.84rem;
  font-weight: 750;
}
.entity-card p.group-balance.positive {
  color: var(--positive);
}
.entity-card p.group-balance.negative {
  color: var(--negative);
}
.entity-card p.group-balance.settled {
  color: var(--muted);
  font-weight: 650;
}
.arrow {
  color: var(--brand);
  font-size: 1.2rem;
}

.people-list,
.split-list {
  margin: 0;
  padding: 0;
  list-style: none;
}
.people-list li,
.split-list li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 7px 0;
}
.people-list .avatar {
  align-self: flex-start;
}
.people-list li + li,
.split-list li + li {
  border-top: 1px solid #ecece8;
}
.person-copy {
  display: grid;
  flex: 1;
  gap: 1px;
  min-width: 0;
}
.debt-panel .panel-header {
  align-items: flex-start;
}
.debt-list {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) max-content;
  column-gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.debt-list li {
  display: grid;
  /* Share tracks across rows so differing amount lengths cannot shift people. */
  grid-template-columns: subgrid;
  grid-column: 1 / -1;
  align-items: center;
  gap: 12px;
  min-height: 56px;
  padding: 7px 0;
}
.debt-list li + li {
  border-top: 1px solid #ecece8;
}
.debt-party {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.debt-party > span:not(.avatar) {
  display: grid;
  min-width: 0;
}
.debt-party small {
  color: var(--muted);
  font-size: 0.7rem;
}
.debt-party strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.debt-arrow {
  color: var(--brand);
  font-size: 1.2rem;
  font-weight: 800;
}
.debt-amount {
  color: var(--negative);
  text-align: right;
  white-space: nowrap;
}
.graph-panel {
  margin-bottom: 14px;
  overflow: hidden;
}
.graph-legend {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 0.78rem;
  white-space: nowrap;
}
.graph-legend i {
  width: 28px;
  height: 2px;
  background: var(--negative);
}
.debt-graph-scroll {
  overflow-x: auto;
  border: 1px solid #e8eae5;
  background:
    radial-gradient(circle, rgba(31, 111, 92, 0.11) 1px, transparent 1px),
    #fbfcfa;
  background-size: 22px 22px;
}
.debt-graph {
  display: block;
  min-width: 100%;
  height: auto;
}
.graph-edge > path {
  fill: none;
  stroke: var(--negative);
  stroke-width: 3;
  stroke-linecap: round;
}
.graph-label-leader {
  fill: none;
  stroke: var(--muted);
  stroke-width: 1;
  stroke-dasharray: 3 3;
}
.graph-label rect {
  fill: white;
  stroke: #eadbd8;
}
.graph-label text {
  fill: var(--ink);
  font-size: 13px;
  font-weight: 750;
}
#debt-arrowhead path {
  fill: var(--negative);
}
.graph-node circle {
  fill: #e4ece7;
  stroke: white;
  stroke-width: 5;
  filter: drop-shadow(0 5px 8px rgba(23, 63, 53, 0.14));
}
.graph-node.current circle {
  fill: var(--brand);
}
.graph-initials {
  fill: var(--brand-dark);
  font-size: 15px;
  font-weight: 800;
}
.graph-node.current .graph-initials {
  fill: white;
}
.graph-name {
  fill: var(--ink);
  font-size: 14px;
  font-weight: 750;
}
.graph-you {
  fill: var(--brand);
  font-size: 11px;
  font-weight: 750;
}
.graph-routes {
  width: min(800px, 100%);
  margin-inline: auto;
}
.metadata {
  margin: 10px 0 0;
}
.metadata div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 7px 0;
  border-top: 1px solid #ecece8;
}
.metadata dt {
  color: var(--muted);
}
.metadata dd {
  margin: 0;
  font-weight: 700;
  text-align: right;
}
.headline-amount {
  text-align: right;
}
.headline-amount span,
.headline-amount strong {
  display: block;
}
.headline-amount span {
  color: var(--muted);
  font-size: 0.8rem;
}
.headline-amount strong {
  font-family: Georgia, serif;
  font-size: 2rem;
  font-weight: 500;
}
.expense-notes {
  padding: 14px;
  background: var(--paper);
  white-space: pre-wrap;
}
.notice {
  padding: 12px 14px;
  color: #665725;
  background: #fbf3d4;
  font-size: 0.86rem;
  line-height: 1.45;
}
.activity-panel {
  margin-top: 14px;
}
.comment-form {
  display: grid;
  gap: 8px;
  margin-bottom: 16px;
  padding: 12px;
  background: var(--paper);
}
.comment-form > label {
  color: #47534e;
  font-size: 0.82rem;
  font-weight: 750;
}
.comment-form > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.activity-timeline {
  border-top: 1px solid #ecece8;
}
.activity-entry {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  align-items: start;
  gap: 12px;
  padding: 10px 0;
}
.activity-entry + .activity-entry {
  border-top: 1px solid #ecece8;
}
.activity-icon {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  color: var(--brand-dark);
  background: var(--brand-soft);
  font-weight: 800;
}
.activity-copy {
  min-width: 0;
}
.activity-copy p {
  margin: 0;
  line-height: 1.5;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}
.activity-copy time,
.comment-heading time {
  color: var(--muted);
  font-size: 0.75rem;
}
.comment-heading {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 4px 12px;
  margin-bottom: 4px;
}
.audit-entry .activity-copy > time {
  display: block;
  margin-top: 3px;
}
.comment-delete {
  padding: 5px;
  color: var(--danger);
  font-size: 0.76rem;
}
.danger-panel {
  padding: 14px;
  border-color: #eccac6;
  box-shadow: none;
}
.danger-panel p {
  color: var(--muted);
}

.context-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.context-grid .panel h2 {
  margin-bottom: 10px;
}
.settlement-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  width: min(980px, 100%);
  margin-inline: auto;
}
.settlement-card {
  display: grid;
  align-content: start;
  gap: 12px;
}
.settlement-route {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 12px;
}
.settlement-route > div {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}
.settlement-route > div > span:not(.avatar) {
  min-width: 0;
}
.settlement-route small,
.settlement-route strong {
  display: block;
}
.settlement-route small {
  color: var(--muted);
  font-size: 0.72rem;
}
.settlement-route strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.settlement-arrow {
  color: var(--brand);
  font-size: 1.25rem;
  font-weight: 800;
}
.settlement-outstanding {
  margin: 0;
  padding: 12px 14px;
  color: var(--brand-dark);
  background: var(--brand-soft);
}
.optional {
  color: var(--muted);
  font-weight: 500;
}
.expense-editor,
.group-editor {
  display: grid;
  gap: 12px;
  width: min(850px, 100%);
  margin: 0 auto;
}
.management-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(280px, 0.75fr);
  gap: 14px;
  align-items: start;
}
.management-form {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}
.management-form label {
  display: grid;
  gap: 7px;
  color: #47534e;
  font-size: 0.82rem;
  font-weight: 750;
}
.management-form button {
  justify-self: start;
}
.form-note {
  margin: 12px 0;
  font-size: 0.82rem;
  line-height: 1.45;
}
.check-row {
  display: flex;
  align-items: center;
  gap: 11px;
  align-self: end;
  min-height: 46px;
  cursor: pointer;
}
.check-row input {
  width: 20px;
  min-height: 20px;
  accent-color: var(--brand);
}
.check-row span {
  display: grid;
  gap: 2px;
}
.check-row small {
  color: var(--muted);
  font-weight: 500;
}
.managed-members form {
  margin-left: auto;
}
.member-lock {
  max-width: 65px;
  text-align: right;
}
.section-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 16px 0 12px;
  color: var(--muted);
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.section-divider::before,
.section-divider::after {
  height: 1px;
  flex: 1;
  content: "";
  background: var(--line);
}
.form-section > h2 {
  margin-bottom: 12px;
}
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.form-grid label,
.payer-label {
  display: grid;
  gap: 7px;
  color: #47534e;
  font-size: 0.82rem;
  font-weight: 750;
}
.span-two {
  grid-column: 1 / -1;
}
input,
select,
textarea {
  width: 100%;
  min-height: 46px;
  border: 1px solid #cfd3cf;
  padding: 10px 12px;
  color: var(--ink);
  background: white;
}
textarea {
  resize: vertical;
}
input:focus,
select:focus,
textarea:focus,
button:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(31, 111, 92, 0.22);
  outline-offset: 2px;
  border-color: var(--brand);
}
.participant-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}
.participant {
  cursor: pointer;
}
.participant > input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}
.participant > span {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 50px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  font-weight: 680;
}
.participant > input:checked + span {
  border-color: var(--brand);
  background: #f0f8f5;
  box-shadow: inset 0 0 0 1px var(--brand);
}
.payer-label {
  margin-top: 12px;
}
.segmented {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 5px;
  padding: 5px;
  background: var(--paper);
}
.segmented input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}
.segmented span {
  display: grid;
  min-height: 40px;
  place-items: center;
  cursor: pointer;
  font-size: 0.83rem;
  font-weight: 750;
}
.payment-segmented {
  grid-template-columns: repeat(2, 1fr);
}
.segmented input:checked + span {
  color: white;
  background: var(--brand);
}
.split-fields {
  margin-top: 12px;
}
.split-fields label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  min-height: 50px;
  border-top: 1px solid #ecece8;
}
.input-suffix {
  display: flex;
  align-items: center;
  gap: 8px;
}
.input-suffix input {
  width: 115px;
  text-align: right;
}
.input-suffix small {
  width: 43px;
  color: var(--muted);
}
.split-help {
  color: var(--muted);
  font-size: 0.85rem;
}
.split-total {
  display: block;
  margin-top: 14px;
  color: var(--brand-dark);
  font-weight: 750;
}
.sticky-actions {
  position: sticky;
  bottom: 16px;
  z-index: 10;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}
.error-summary {
  padding: 17px 20px;
  border: 1px solid #e4aaa4;
  color: #72221d;
  background: #fff0ee;
}
.error-summary ul {
  margin-bottom: 0;
}

.auth-card {
  width: min(480px, 100%);
  margin: 4vh auto;
  padding: clamp(20px, 4vw, 32px);
  text-align: center;
}
.hero-mark {
  width: 72px;
  height: 72px;
  margin: 0 auto 18px;
  font-size: 2rem;
  transform: rotate(-3deg);
}
.auth-card h1 {
  margin: 9px 0 15px;
  font-family: Georgia, serif;
  font-size: clamp(2.2rem, 8vw, 3.3rem);
  font-weight: 500;
  letter-spacing: -0.04em;
  line-height: 1;
}
.auth-card > p:not(.eyebrow) {
  color: var(--muted);
  line-height: 1.6;
}
.auth-card form {
  margin-top: 18px;
}
.fine-print {
  font-size: 0.76rem;
}
.prose {
  line-height: 1.65;
}
.prose h1 {
  margin-top: 6px;
  font-family: Georgia, serif;
  font-size: 2.4rem;
  font-weight: 500;
}
.prose h2 {
  margin-top: 28px;
}
.empty-state {
  padding: 24px 14px;
  text-align: center;
}
.empty-state p {
  color: var(--muted);
}
.empty-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  margin: 0 auto 12px;
  color: var(--brand);
  background: var(--brand-soft);
  font-weight: 800;
}
.pagination {
  display: flex;
  justify-content: space-between;
  margin-top: 20px;
}
.mobile-nav {
  display: none;
}

@media (max-width: 1000px) {
  .account-name {
    display: none;
  }
  .header-inner {
    gap: 16px;
  }
  .desktop-nav {
    margin-left: 0;
    gap: 16px;
  }
}

@media (max-width: 850px) {
  .card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .dashboard-grid,
  .detail-grid,
  .management-grid {
    grid-template-columns: 1fr;
  }
  .detail-grid aside {
    order: -1;
  }
  .group-detail-grid aside {
    order: 0;
  }
}

@media (max-width: 640px) {
  body {
    background: var(--paper);
  }
  .site-header {
    position: static;
  }
  .header-inner,
  .page-shell {
    width: min(100% - 28px, 1180px);
  }
  .header-inner {
    min-height: 60px;
    gap: 10px;
  }
  .wordmark {
    font-size: 0.95rem;
    gap: 6px;
  }
  .wordmark-mark {
    width: 26px;
    height: 26px;
  }
  .display-currency select {
    width: 150px;
  }
  .currency-status {
    max-width: 150px;
  }
  .desktop-nav,
  .account-menu {
    display: none;
  }
  .page-shell {
    padding: 18px 0 calc(92px + env(safe-area-inset-bottom));
  }
  .page-heading {
    align-items: flex-start;
    margin-bottom: 16px;
    gap: 14px;
  }
  .welcome-heading {
    flex-wrap: wrap;
  }
  .page-heading h1 {
    font-size: 2.55rem;
  }
  .page-heading > .button {
    width: 48px;
    height: 48px;
    overflow: hidden;
    padding: 0;
    color: white;
    font-size: 0;
  }
  .page-heading > .button::after {
    content: "+";
    color: white;
    font-size: 1.6rem;
    line-height: 1;
  }
  .panel {
    padding: 14px;
    box-shadow: none;
  }
  .balance-card {
    min-width: 185px;
  }
  .dashboard-grid {
    gap: 12px;
  }
  .card-grid,
  .context-grid,
  .form-grid,
  .settlement-grid {
    grid-template-columns: 1fr;
  }
  .span-two {
    grid-column: auto;
  }
  .entity-card {
    min-height: 88px;
    padding: 12px;
    box-shadow: none;
  }
  .expense-row {
    grid-template-columns: 42px minmax(0, 1fr) auto;
    gap: 9px;
    padding-inline: 4px;
  }
  .payment-row {
    grid-template-columns: 42px minmax(0, 1fr);
    row-gap: 4px;
  }
  .payment-row time {
    grid-row: 1 / 3;
  }
  .payment-row .expense-amount {
    grid-column: 2;
  }
  .debt-list {
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    column-gap: 8px;
  }
  .debt-list li {
    gap: 8px;
  }
  .debt-party {
    align-items: flex-start;
    flex-direction: column;
    gap: 5px;
  }
  .debt-party .avatar {
    width: 32px;
    height: 32px;
  }
  .debt-amount {
    grid-column: 1 / -1;
    margin-top: -8px;
  }
  .debt-graph-scroll {
    margin-inline: -14px;
    border-right: 0;
    border-left: 0;
    border-radius: 0;
  }
  .expense-amount strong {
    font-size: 0.88rem;
  }
  .expense-copy span {
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .participant-grid {
    grid-template-columns: 1fr;
  }
  .segmented {
    grid-template-columns: repeat(2, 1fr);
  }
  .headline-amount {
    text-align: left;
  }
  .detail-heading {
    flex-wrap: wrap;
  }
  .headline-actions {
    width: 100%;
    justify-content: stretch;
  }
  .headline-actions .button {
    flex: 1;
  }
  .comment-form > div {
    align-items: stretch;
    flex-direction: column;
  }
  .comment-form button {
    width: 100%;
  }
  .sticky-actions {
    bottom: calc(78px + env(safe-area-inset-bottom));
  }
  .sticky-actions .button,
  .sticky-actions button {
    flex: 1;
  }
  .mobile-nav {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 30;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    min-height: calc(66px + env(safe-area-inset-bottom));
    padding: 7px 8px env(safe-area-inset-bottom);
    border-top: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(18px);
  }
  .mobile-nav a {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    min-width: 0;
    color: var(--muted);
    font-size: 0.65rem;
    font-weight: 700;
    text-decoration: none;
  }
  .mobile-nav a span {
    font-size: 1.25rem;
    line-height: 1;
  }
  .mobile-nav .mobile-add span {
    display: grid;
    width: 40px;
    height: 40px;
    margin-top: -22px;
    place-items: center;
    color: white;
    background: var(--brand);
    box-shadow: 0 8px 20px rgba(31, 111, 92, 0.28);
  }
  .auth-card {
    margin: 2vh auto;
    border: 0;
    box-shadow: none;
    background: transparent;
  }
}

@media (prefers-reduced-motion: reduce) {
  button,
  .button {
    transition: none;
  }
}
