:root {
  color-scheme: light;
  --bg: #f6f3ee;
  --card: rgba(255, 255, 255, 0.82);
  --card-solid: #ffffff;
  --text: #201a17;
  --muted: #776d66;
  --line: rgba(47, 35, 28, 0.12);
  --accent: #f06f38;
  --accent-2: #222f3e;
  --good: #14804a;
  --bad: #c2412d;
  --shadow: 0 24px 80px rgba(61, 42, 25, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  min-width: 320px;
  margin: 0;
  color: var(--text);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(240, 111, 56, 0.22), transparent 36rem),
    radial-gradient(circle at top right, rgba(34, 47, 62, 0.14), transparent 34rem),
    var(--bg);
}

body:has(.login-overlay.show) .shell,
body:has(.login-overlay.show) .mobile-settings-tabs {
  filter: blur(4px);
  pointer-events: none;
  user-select: none;
}

body.viewer-mode .swipe-action {
  display: none;
}

button,
input,
select {
  font: inherit;
}

button {
  border: 0;
  border-radius: 1rem;
  padding: 0.85rem 1rem;
  color: white;
  background: var(--accent-2);
  cursor: pointer;
  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease,
    opacity 0.18s ease;
}

button:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 28px rgba(34, 47, 62, 0.18);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

input,
select {
  width: 100%;
  border: 1.5px solid rgba(240, 111, 56, 0.28);
  border-radius: 0.9rem;
  padding: 0.85rem 0.95rem;
  color: var(--text);
  background: rgba(255, 255, 255, 0.9);
  outline: none;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.55);
}

input:focus,
select:focus {
  border-color: rgba(240, 111, 56, 0.55);
  box-shadow: 0 0 0 4px rgba(240, 111, 56, 0.12);
}

input:disabled,
select:disabled {
  color: var(--muted);
  background: rgba(255, 255, 255, 0.5);
  cursor: not-allowed;
}

.shell {
  width: min(1440px, 100%);
  margin: 0 auto;
  padding: 1.25rem;
}

.login-overlay {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: none;
  place-items: center;
  padding: 1rem;
  background: rgba(32, 26, 23, 0.28);
  backdrop-filter: blur(10px);
}

.login-overlay.show {
  display: grid;
}

.login-card {
  display: grid;
  gap: 0.8rem;
  width: min(24rem, 100%);
  padding: 1.25rem;
  border: 1px solid var(--line);
  border-radius: 1.5rem;
  background: var(--card-solid);
  box-shadow: var(--shadow);
}

.logout-button {
  position: absolute;
  top: 1rem;
  right: 1rem;
  padding: 0.55rem 0.8rem;
  color: var(--accent-2);
  background: rgba(255, 255, 255, 0.82);
}

.hero {
  position: relative;
  margin: 0.35rem 0 1.5rem;
  padding: clamp(0.85rem, 3vw, 1.75rem) clamp(1.25rem, 4vw, 2.5rem) clamp(1.25rem, 4vw, 2.5rem);
  border: 1px solid var(--line);
  border-radius: 2rem;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.88), rgba(255, 255, 255, 0.64)),
    url("data:image/svg+xml,%3Csvg width='120' height='120' viewBox='0 0 120 120' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M20 70c24-42 55-42 80 0' fill='none' stroke='%23f06f38' stroke-opacity='.14' stroke-width='18' stroke-linecap='round'/%3E%3C/svg%3E");
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.eyebrow {
  margin: 0 0 0.45rem;
  color: var(--accent);
  font-size: clamp(0.95rem, 2.2vw, 1.25rem);
  font-weight: 800;
  letter-spacing: 0.02em;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0.35rem;
  color: var(--accent);
  line-height: 0.95;
  letter-spacing: -0.06em;
}

#eventMeta {
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.hero-note {
  margin-bottom: 0;
  font-weight: 600;
}

h2 {
  margin-bottom: 0.3rem;
  font-size: 1.25rem;
}

.muted,
.panel-title p,
.stat-card small {
  color: var(--muted);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: flex-end;
}

.settings-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 1rem;
  padding: 0.8rem 1rem;
  color: var(--text);
  background: rgba(255, 255, 255, 0.62);
}

.file-button {
  cursor: pointer;
}

.file-button input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.tabs {
  display: flex;
  gap: 0.6rem;
  margin-bottom: 1rem;
  padding: 0.45rem;
  border: 1px solid var(--line);
  border-radius: 1.25rem;
  background: rgba(255, 255, 255, 0.55);
  box-shadow: 0 12px 34px rgba(61, 42, 25, 0.07);
  backdrop-filter: blur(18px);
}

.tab-button {
  flex: 0 0 auto;
  padding: 0.8rem 1.15rem;
  color: var(--muted);
  background: transparent;
  box-shadow: none;
}

.tab-button:hover {
  box-shadow: none;
}

.tab-button.active {
  color: white;
  background: var(--accent-2);
  box-shadow: 0 10px 24px rgba(34, 47, 62, 0.14);
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

.settings-tabs {
  display: flex;
  gap: 0.6rem;
  margin-bottom: 1rem;
  padding: 0.35rem;
  border: 1px solid rgba(240, 111, 56, 0.18);
  border-radius: 1rem;
  background: rgba(240, 111, 56, 0.07);
}

.mobile-settings-tabs {
  display: none;
}

.settings-tab-button {
  flex: 0 0 auto;
  padding: 0.7rem 1rem;
  color: var(--muted);
  background: transparent;
  box-shadow: none;
}

.settings-back-button {
  display: none;
}

.settings-tab-button:hover {
  box-shadow: none;
}

.settings-tab-button.active {
  color: white;
  background: linear-gradient(135deg, var(--accent), #ff9d5c);
  box-shadow: 0 10px 24px rgba(240, 111, 56, 0.18);
}

.settings-tab-panel {
  display: none;
}

.settings-tab-panel.active {
  display: block;
}

.stats-grid,
.content-grid,
.bottom-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
  margin-bottom: 1rem;
}

.content-grid,
.bottom-grid {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

.stat-card,
.panel {
  border: 1px solid var(--line);
  border-radius: 1.5rem;
  background: var(--card);
  box-shadow: 0 14px 44px rgba(61, 42, 25, 0.08);
  backdrop-filter: blur(18px);
}

.stat-card {
  padding: 1.15rem;
}

.stat-card.clickable {
  cursor: pointer;
}

.stat-card.clickable:hover {
  transform: translateY(-1px);
}

.stat-card span {
  display: block;
  margin-bottom: 0.4rem;
  color: var(--muted);
  font-weight: 700;
}

.stat-card strong {
  display: block;
  margin-bottom: 0.35rem;
  font-size: clamp(1.65rem, 4vw, 2.55rem);
  letter-spacing: -0.05em;
}

.stat-card.accent {
  color: white;
  background: linear-gradient(135deg, var(--accent), #ff9d5c);
}

.stat-card.accent span,
.stat-card.accent small {
  color: rgba(255, 255, 255, 0.82);
}

.overview-debts-panel {
  margin-bottom: 1rem;
}

.panel {
  padding: 1.1rem;
}

.panel-title {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.form-grid,
.quick-form {
  display: grid;
  gap: 0.75rem;
}

.form-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.form-grid label {
  display: grid;
  gap: 0.4rem;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

.form-grid .wide {
  grid-column: span 2;
}

.quick-form {
  grid-template-columns: minmax(12rem, 1fr) 6rem 7rem auto;
  margin-bottom: 1rem;
}

.participant-form {
  grid-template-columns: minmax(12rem, 1fr) 6rem 6rem auto auto;
}

.expense-form {
  grid-template-columns: minmax(12rem, 1fr) 8rem 7rem 7rem auto;
}

.category-form {
  grid-template-columns: minmax(12rem, 1fr) auto;
}

.add-card {
  display: grid;
  gap: 0.75rem;
  margin-bottom: 1rem;
  padding: 0.7rem;
  border: 1px solid rgba(240, 111, 56, 0.22);
  border-radius: 1.15rem;
  background: rgba(255, 255, 255, 0.58);
}

.add-card-summary {
  width: 100%;
  border: 1px solid rgba(240, 111, 56, 0.34);
  border-radius: 0.95rem;
  padding: 0.9rem 1rem;
  color: var(--text);
  text-align: left;
  background: rgba(255, 255, 255, 0.92);
  font-weight: 900;
}

.add-card-body {
  display: none;
  margin-bottom: 0;
}

.add-card.open .add-card-body {
  display: grid;
}

.per-person-form {
  grid-template-columns: minmax(10rem, 1fr) 7rem 6rem 8rem auto;
}

.user-form,
.user-card {
  grid-template-columns: minmax(10rem, 1fr) minmax(8rem, 1fr) 8rem auto auto;
}

.user-card {
  display: grid;
  gap: 0.55rem;
  align-items: center;
  padding: 0.7rem;
  border: 1px solid rgba(240, 111, 56, 0.22);
  border-radius: 1rem;
  background: rgba(255, 255, 255, 0.62);
}

.list {
  display: grid;
  gap: 0.7rem;
}

.row-card {
  display: grid;
  grid-template-columns: minmax(11rem, 1fr) 5.7rem 7rem auto;
  gap: 0.55rem;
  align-items: center;
  padding: 0.65rem;
  border: 1px solid rgba(240, 111, 56, 0.18);
  border-radius: 1.1rem;
  background: rgba(255, 255, 255, 0.58);
}

.row-card.debt {
  grid-template-columns: auto minmax(10rem, 1fr) auto;
}

.status-dot {
  width: 0.85rem;
  height: 0.85rem;
  border-radius: 999px;
}

.status-dot.good {
  background: var(--good);
}

.status-dot.bad {
  background: var(--danger);
}

.row-card.expense {
  grid-template-columns: minmax(10rem, 1fr) 7rem 6.2rem 7rem 5.8rem auto;
}

.swipe-wrap {
  position: relative;
  overflow: hidden;
  border-radius: 1.15rem;
}

.swipe-action {
  position: absolute;
  top: 0;
  bottom: 0;
  z-index: 0;
  display: grid;
  place-items: center;
  width: 5rem;
  color: white;
  font-size: 1.7rem;
  font-weight: 900;
  opacity: 0;
  transition: opacity 0.12s ease;
  pointer-events: none;
}

.swipe-action-left {
  left: 0;
  background: var(--good);
}

.swipe-action-right {
  right: 0;
  background: var(--bad);
}

.swipe-wrap.swipe-right .swipe-action-left,
.swipe-wrap.swipe-left .swipe-action-right {
  opacity: 1;
}

.expense-card {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 0.75rem;
  padding: 0.7rem;
  border: 1px solid rgba(240, 111, 56, 0.22);
  border-radius: 1.15rem;
  background: rgba(255, 255, 255, 0.58);
  transition:
    transform 0.16s ease,
    background 0.16s ease,
    border-color 0.16s ease;
  touch-action: pan-y;
  user-select: none;
}

.expense-card.excluded {
  border-color: rgba(194, 65, 45, 0.42);
  background: rgba(194, 65, 45, 0.08);
}

.expense-card.excluded .expense-summary {
  border-color: rgba(194, 65, 45, 0.45);
  background: rgba(194, 65, 45, 0.12);
}

.expense-card.excluded .expense-name,
.expense-card.excluded .expense-meta {
  color: var(--bad);
  text-decoration: line-through;
  text-decoration-thickness: 2px;
}

.expense-card.paid {
  border-color: rgba(20, 128, 74, 0.42);
  background: rgba(20, 128, 74, 0.08);
}

.expense-card.paid .expense-summary {
  border-color: rgba(20, 128, 74, 0.45);
  background: rgba(20, 128, 74, 0.12);
}

.expense-card.swiping-left {
  border-color: rgba(194, 65, 45, 0.58);
  background: rgba(194, 65, 45, 0.12);
}

.expense-card.swiping-right {
  border-color: rgba(20, 128, 74, 0.58);
  background: rgba(20, 128, 74, 0.12);
}

.person-card {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 0.75rem;
  padding: 0.7rem;
  border: 1px solid rgba(240, 111, 56, 0.22);
  border-radius: 1.15rem;
  background: rgba(255, 255, 255, 0.58);
  transition:
    transform 0.16s ease,
    background 0.16s ease,
    border-color 0.16s ease;
  touch-action: pan-y;
  user-select: none;
}

.person-card.unpaid {
  border-color: rgba(194, 65, 45, 0.42);
  background: rgba(194, 65, 45, 0.08);
}

.person-card.unpaid .person-summary {
  border-color: rgba(194, 65, 45, 0.45);
  background: rgba(194, 65, 45, 0.12);
}

.person-card.paid {
  border-color: rgba(20, 128, 74, 0.42);
  background: rgba(20, 128, 74, 0.08);
}

.person-card.paid .person-summary {
  border-color: rgba(20, 128, 74, 0.45);
  background: rgba(20, 128, 74, 0.12);
}

.person-card.excluded {
  border-color: rgba(194, 65, 45, 0.42);
  background: rgba(194, 65, 45, 0.08);
}

.person-card.excluded .person-summary {
  border-color: rgba(194, 65, 45, 0.45);
  background: rgba(194, 65, 45, 0.12);
}

.person-card.excluded .person-name,
.person-card.excluded .person-meta {
  color: var(--bad);
  text-decoration: line-through;
  text-decoration-thickness: 2px;
}

.person-card.swiping-left {
  border-color: rgba(194, 65, 45, 0.58);
  background: rgba(194, 65, 45, 0.12);
}

.person-card.swiping-right {
  border-color: rgba(20, 128, 74, 0.58);
  background: rgba(20, 128, 74, 0.12);
}

.expense-summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 3.4rem;
  gap: 0.8rem;
  align-items: start;
  width: 100%;
  padding: 0.55rem 0.75rem 0.8rem 1rem;
  border: 1px solid rgba(240, 111, 56, 0.34);
  border-radius: 0.95rem;
  color: var(--text);
  text-align: left;
  background: rgba(255, 255, 255, 0.92);
}

.person-toggle,
.expense-toggle {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.25rem;
  align-items: center;
  width: 100%;
  padding: 0.35rem 0 0;
  color: var(--text);
  text-align: left;
  background: transparent;
  box-shadow: none;
}

.person-summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 4.9rem;
  gap: 0.8rem;
  align-items: start;
  padding: 0.9rem 1rem;
  border: 1px solid rgba(240, 111, 56, 0.34);
  border-radius: 0.95rem;
  background: rgba(255, 255, 255, 0.92);
}

.person-toggle:hover,
.expense-toggle:hover {
  box-shadow: none;
}

.expense-summary:hover {
  box-shadow: 0 12px 28px rgba(240, 111, 56, 0.12);
}

.person-name,
.expense-name {
  overflow: hidden;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.person-meta,
.expense-meta {
  color: var(--muted);
  font-size: 0.9rem;
}

.person-chevron,
.expense-chevron {
  justify-self: end;
  color: var(--accent);
  font-size: 0.86rem;
  font-weight: 900;
}

.paid-toggle {
  width: 2.35rem;
  height: 2.35rem;
  margin: 0;
  accent-color: var(--good);
  cursor: pointer;
}

.expense-side {
  display: grid;
  justify-items: center;
  gap: 0.25rem;
  align-self: start;
}

.person-side {
  display: grid;
  justify-items: center;
  gap: 0.25rem;
  align-self: start;
}

.person-open-button {
  padding: 0;
  color: var(--accent);
  background: transparent;
  box-shadow: none;
  font-size: 0.78rem;
  font-weight: 900;
}

.person-open-button:hover {
  box-shadow: none;
}

.expense-open-button {
  padding: 0;
  color: var(--accent);
  background: transparent;
  box-shadow: none;
  font-size: 0.82rem;
  font-weight: 900;
}

.expense-open-button:hover {
  box-shadow: none;
}

.expense-details {
  display: none;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
}

.person-details {
  display: none;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
}

.expense-card.open .expense-details {
  display: grid;
}

.person-card.open .person-details {
  display: grid;
}

.field-label {
  display: grid;
  gap: 0.4rem;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 800;
}

.check-label {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 800;
}

.check-label input {
  width: 1.1rem;
  height: 1.1rem;
  accent-color: var(--accent);
}

.expense-actions {
  display: flex;
  align-items: end;
  gap: 0.6rem;
  grid-column: 1 / -1;
  flex-wrap: wrap;
}

.expense-total {
  display: inline-flex;
  align-items: center;
  min-height: 2.65rem;
  color: var(--accent);
  font-size: 1.1rem;
  font-weight: 900;
}

.person-actions {
  display: flex;
  align-items: end;
  gap: 0.6rem;
  grid-column: 1 / -1;
  flex-wrap: wrap;
}

.checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-height: 2.55rem;
}

.checkbox-label input {
  width: auto;
}

.row-card input {
  padding: 0.67rem 0.75rem;
  border-color: rgba(240, 111, 56, 0.36);
  border-radius: 0.75rem;
  background: rgba(255, 255, 255, 0.96);
}

.expense-card select {
  padding: 0.67rem 0.75rem;
  border-color: rgba(240, 111, 56, 0.36);
  border-radius: 0.75rem;
  background: rgba(255, 255, 255, 0.96);
}

.category-chip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.75rem;
  border: 1px solid rgba(240, 111, 56, 0.22);
  border-radius: 1rem;
  background: rgba(255, 255, 255, 0.62);
  font-weight: 800;
}

.person-rule-card {
  display: grid;
  grid-template-columns: minmax(10rem, 1fr) 7rem 6rem 8rem auto auto;
  gap: 0.55rem;
  align-items: center;
  padding: 0.7rem;
  border: 1px solid rgba(240, 111, 56, 0.22);
  border-radius: 1rem;
  background: rgba(255, 255, 255, 0.62);
}

.person-rule-card input,
.person-rule-card select {
  padding: 0.67rem 0.75rem;
  border-color: rgba(240, 111, 56, 0.36);
  border-radius: 0.75rem;
  background: rgba(255, 255, 255, 0.96);
}

.bath-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(18rem, 0.6fr);
  gap: 1rem;
  margin-bottom: 1rem;
}

.bath-tabs-wrap {
  display: flex;
  gap: 0.6rem;
  margin-bottom: 1rem;
  align-items: stretch;
}

.bath-tabs {
  display: flex;
  flex: 1 1 auto;
  gap: 0.6rem;
  overflow-x: auto;
  padding: 0.35rem;
  border: 1px solid rgba(240, 111, 56, 0.18);
  border-radius: 1rem;
  background: rgba(240, 111, 56, 0.07);
}

.bath-tab-button {
  flex: 0 0 auto;
  padding: 0.7rem 1rem;
  color: var(--muted);
  background: transparent;
  box-shadow: none;
}

.bath-tab-button.active {
  color: white;
  background: linear-gradient(135deg, var(--accent), #ff9d5c);
  box-shadow: 0 10px 24px rgba(240, 111, 56, 0.18);
}

.bath-add-button {
  flex: 0 0 auto;
  border: 1px solid rgba(240, 111, 56, 0.34);
  color: white;
  background: linear-gradient(135deg, var(--accent), #ff9d5c);
  box-shadow: 0 10px 24px rgba(240, 111, 56, 0.18);
}

.bath-add-card {
  margin-top: -0.25rem;
}

.bath-add-card:not(.open) {
  display: none;
}

.rental-form {
  margin-bottom: 1rem;
}

.bath-card {
  padding: 1rem;
  border: 1px solid rgba(240, 111, 56, 0.22);
  border-radius: 1.15rem;
  background: rgba(255, 255, 255, 0.62);
}

.bath-card h3 {
  margin: 0 0 0.9rem;
}

.bath-form {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
}

.bath-form label {
  display: grid;
  gap: 0.4rem;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 800;
}

.bath-total-card strong {
  display: block;
  margin-bottom: 0.6rem;
  color: var(--accent);
  font-size: clamp(2rem, 5vw, 3.1rem);
  line-height: 1;
}

.bath-item-form {
  grid-template-columns: minmax(10rem, 1fr) 6rem 7rem auto;
}

.bath-item-card {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 0.75rem;
  padding: 0.7rem;
  border: 1px solid rgba(240, 111, 56, 0.22);
  border-radius: 1rem;
  background: rgba(255, 255, 255, 0.62);
  transition:
    transform 0.16s ease,
    background 0.16s ease,
    border-color 0.16s ease;
  touch-action: pan-y;
  user-select: none;
}

.bath-item-card input {
  padding: 0.67rem 0.75rem;
  border-color: rgba(240, 111, 56, 0.36);
  border-radius: 0.75rem;
  background: rgba(255, 255, 255, 0.96);
}

.bath-item-summary {
  display: grid;
  gap: 0.25rem;
  width: 100%;
  border: 1px solid rgba(240, 111, 56, 0.34);
  border-radius: 0.95rem;
  padding: 0.85rem 1rem;
  color: var(--text);
  text-align: left;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: none;
}

.bath-item-summary span {
  overflow: hidden;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bath-item-summary small {
  color: var(--muted);
}

.bath-item-details {
  display: none;
  grid-template-columns: minmax(10rem, 1fr) 6rem 7rem auto auto auto auto;
  gap: 0.55rem;
  align-items: center;
}

.bath-item-card.open .bath-item-details {
  display: grid;
}

.bath-item-card.excluded {
  border-color: rgba(194, 65, 45, 0.42);
  background: rgba(194, 65, 45, 0.08);
}

.bath-item-card.excluded .bath-item-summary {
  border-color: rgba(194, 65, 45, 0.45);
  background: rgba(194, 65, 45, 0.12);
}

.bath-item-card.excluded .bath-item-summary span,
.bath-item-card.excluded .bath-item-summary small {
  color: var(--bad);
  text-decoration: line-through;
  text-decoration-thickness: 2px;
}

.bath-item-card.swiping-left {
  border-color: rgba(194, 65, 45, 0.58);
  background: rgba(194, 65, 45, 0.12);
}

.bath-item-card.swiping-right {
  border-color: rgba(20, 128, 74, 0.58);
  background: rgba(20, 128, 74, 0.12);
}

.bath-rates {
  display: grid;
  overflow: hidden;
  border: 1px solid rgba(240, 111, 56, 0.18);
  border-radius: 0.9rem;
}

.bath-rate-row {
  display: grid;
  grid-template-columns: minmax(8rem, 1fr) minmax(7rem, 0.8fr) minmax(7rem, 0.8fr);
  gap: 0.5rem;
  padding: 0.7rem 0.8rem;
  border-bottom: 1px solid rgba(47, 35, 28, 0.08);
  background: rgba(255, 255, 255, 0.54);
}

.bath-rate-row:last-child {
  border-bottom: 0;
}

.bath-rate-head {
  color: white;
  background: #487f87;
  font-weight: 900;
}

.row-main {
  display: grid;
  gap: 0.2rem;
}

.row-title {
  font-weight: 800;
}

.row-sub {
  color: var(--muted);
  font-size: 0.86rem;
}

.mini-button {
  padding: 0.65rem 0.8rem;
  border-radius: 0.75rem;
}

.danger {
  color: var(--bad);
  background: rgba(194, 65, 45, 0.08);
}

.muted-button {
  color: var(--muted);
  background: rgba(34, 47, 62, 0.08);
}

.amount {
  justify-self: end;
  font-size: 1.05rem;
  font-weight: 900;
}

.amount.good {
  color: var(--good);
}

.amount.bad {
  color: var(--bad);
}

.category-list {
  display: grid;
  gap: 0.8rem;
}

.category-item {
  display: grid;
  gap: 0.45rem;
}

.category-top {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  font-weight: 800;
}

.bar {
  height: 0.75rem;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(34, 47, 62, 0.08);
}

.bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), #ffb067);
}

.toast {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  justify-content: space-between;
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 20;
  max-width: min(24rem, calc(100vw - 2rem));
  padding: 0.9rem 1rem;
  border-radius: 1rem;
  color: white;
  background: rgba(32, 26, 23, 0.92);
  box-shadow: 0 18px 50px rgba(32, 26, 23, 0.25);
  opacity: 0;
  transform: translateY(0.8rem);
  pointer-events: none;
  transition:
    opacity 0.2s ease,
    transform 0.2s ease;
}

.toast.show {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.toast-action {
  flex: 0 0 auto;
  padding: 0.55rem 0.75rem;
  border: 1px solid rgba(255, 255, 255, 0.34);
  border-radius: 0.7rem;
  color: white;
  background: var(--accent);
}

@media (max-width: 1100px) {
  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .content-grid,
  .bottom-grid,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .form-grid .wide {
    grid-column: auto;
  }
}

@media (max-width: 760px) {
  .bath-tabs-wrap {
    flex-direction: column;
  }

  .bath-add-button {
    width: 100%;
  }

  body {
    overflow-x: hidden;
  }

  .shell {
    padding: 0.75rem 0.75rem calc(6.8rem + env(safe-area-inset-bottom, 0px));
  }

  .hero {
    border-radius: 1.5rem;
  }

  .settings-actions,
  .settings-actions > * {
    width: 100%;
  }

  .settings-tabs {
    display: none;
  }

  body.settings-mode .tabs {
    display: none;
  }

  body.settings-mode .mobile-settings-tabs {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 2147483647;
    display: grid;
    grid-template-columns: 2.7rem repeat(4, minmax(0, 1fr));
    gap: 0.45rem;
    margin: 0;
    padding: 0.55rem 0.75rem calc(0.55rem + env(safe-area-inset-bottom, 0px));
    border: 1px solid rgba(240, 111, 56, 0.34);
    border-right: 0;
    border-bottom: 0;
    border-left: 0;
    border-radius: 1.25rem 1.25rem 0 0;
    background:
      linear-gradient(180deg, rgba(51, 34, 27, 0.98), rgba(31, 25, 23, 0.98)),
      var(--accent-2);
    box-shadow:
      0 -18px 45px rgba(32, 26, 23, 0.32),
      0 -1px 0 rgba(240, 111, 56, 0.34);
  }

  .settings-back-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
    border: 1px solid rgba(240, 111, 56, 0.42);
    border-radius: 0.95rem;
    padding: 0.85rem 0.5rem;
    background: rgba(240, 111, 56, 0.12);
  }

  .settings-tab-button {
    min-width: 0;
    border: 1px solid rgba(240, 111, 56, 0.42);
    border-radius: 0.95rem;
    padding: 0.85rem 0.35rem;
    color: #ffd5bd;
    background: rgba(240, 111, 56, 0.12);
    font-weight: 800;
  }

  .settings-tab-button.active {
    color: white;
    border-color: var(--accent);
    background: linear-gradient(135deg, var(--accent), #ff9d5c);
    box-shadow: 0 10px 26px rgba(240, 111, 56, 0.32);
  }

  .back-triangle {
    width: 0;
    height: 0;
    border-top: 0.48rem solid transparent;
    border-right: 0.72rem solid var(--accent);
    border-bottom: 0.48rem solid transparent;
  }

  .tabs {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 2147483647;
    gap: 0.45rem;
    margin: 0;
    padding: 0.55rem 0.75rem calc(0.55rem + env(safe-area-inset-bottom, 0px));
    border-color: rgba(240, 111, 56, 0.34);
    border-right: 0;
    border-bottom: 0;
    border-left: 0;
    border-radius: 1.25rem 1.25rem 0 0;
    overflow: visible;
    background:
      linear-gradient(180deg, rgba(51, 34, 27, 0.98), rgba(31, 25, 23, 0.98)),
      var(--accent-2);
    box-shadow:
      0 -18px 45px rgba(32, 26, 23, 0.32),
      0 -1px 0 rgba(240, 111, 56, 0.34);
    transform: translateZ(0);
    will-change: transform;
  }

  .toast {
    bottom: calc(5.8rem + env(safe-area-inset-bottom, 0px));
  }

  .tab-button {
    flex: 1 0 auto;
    min-width: 0;
    border: 1px solid rgba(240, 111, 56, 0.42);
    border-radius: 0.95rem;
    padding: 0.85rem 0.5rem;
    color: #ffd5bd;
    background: rgba(240, 111, 56, 0.12);
    font-weight: 800;
  }

  .tab-button.active {
    color: white;
    border-color: var(--accent);
    background: linear-gradient(135deg, var(--accent), #ff9d5c);
    box-shadow: 0 10px 26px rgba(240, 111, 56, 0.32);
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }

  .quick-form,
  .expense-form,
  .category-form,
  .per-person-form,
  .participant-form,
  .person-rule-card,
  .user-form,
  .user-card,
  .bath-grid,
  .bath-form,
  .bath-item-form,
  .bath-item-card,
  .bath-item-details,
  .row-card,
  .row-card.expense,
  .expense-details,
  .person-details {
    grid-template-columns: 1fr;
  }

  .row-card {
    padding: 0.85rem;
  }

  .row-card.debt {
    grid-template-columns: auto 1fr;
  }

  .amount {
    justify-self: start;
  }
}
