:root {
  color-scheme: light;
  --bg: #f7f7f4;
  --surface: #ffffff;
  --text: #20201d;
  --muted: #6c6a61;
  --line: #ddd9cf;
  --primary: #77c43a;
  --primary-dark: #4d8524;
  --primary-light: #edf8e5;
  --husband: rgb(0, 140, 180);
  --husband-light: #ebf6f9;
  --husband-badge: #d9eef4;
  --wife: rgb(214, 120, 37);
  --wife-light: #fcf4ee;
  --wife-badge: #f9ebde;
  --danger: #b42318;
  --accent: #c2410c;
}

* {
  box-sizing: border-box;
}

html.android-device {
  min-height: 100%;
  background: #fff;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
select {
  font: inherit;
}

button,
a.link-button {
  min-height: 44px;
  border: 0;
  border-radius: 8px;
  padding: 10px 14px;
  font-weight: 700;
}

.screen {
  min-height: 100vh;
  padding: 12px 14px 74px;
}

.page,
.login-panel {
  max-width: 680px;
  margin: 0 auto;
}

.page {
  position: relative;
}

.page-header h1,
.login-panel h1 {
  margin: 0 0 2px;
  font-size: 23px;
}

.ios-install-button {
  width: 100%;
  margin-top: 14px;
  border: 1px solid var(--primary);
  background: var(--primary-light);
  color: var(--primary-dark);
}

.ios-install-modal {
  margin-top: max(72px, env(safe-area-inset-top));
}

.ios-install-steps {
  display: grid;
  gap: 12px;
  margin: 14px 0 18px;
  padding-left: 24px;
}

.ios-install-steps li {
  padding-left: 4px;
  line-height: 1.5;
}

.ios-install-modal .primary {
  width: 100%;
}

body.date-picker-open {
  overflow: hidden;
}

.pull-refresh {
  position: fixed;
  top: -46px;
  left: 50%;
  z-index: 60;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  transform: translateX(-50%) translateY(0);
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.2);
  opacity: 0;
  pointer-events: none;
}

.pull-refresh span {
  color: var(--primary);
  font-size: 18px;
  font-weight: 700;
  line-height: 1;
  transition: transform 0.15s;
}

.pull-refresh.ready span {
  transform: rotate(180deg);
}

.pull-refresh.spin span {
  animation: pull-refresh-spin 0.7s linear infinite;
}

@keyframes pull-refresh-spin {
  to { transform: rotate(360deg); }
}

.page-header {
  position: relative;
  min-height: 48px;
}

.page-header.has-back {
  padding-left: 52px;
}

.compact-page .page-header {
  min-height: 42px;
}

.compact-page .panel {
  margin: 6px 0;
  padding: 10px 12px;
}

.compact-page .panel h2 {
  margin-bottom: 6px;
}

.compact-page .filters,
.compact-page .expense-list {
  gap: 6px;
}

.compact-page .settings-group {
  margin: 12px 0;
}

.compact-page .settings-group-title {
  margin-bottom: 4px;
}

.page-back {
  position: absolute;
  top: 0;
  left: 0;
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 10px;
  background: #ece9df;
  color: var(--text);
  font-size: 25px;
  font-weight: 700;
  line-height: 1;
  text-decoration: none;
}

.muted {
  margin: 0 0 8px;
  color: var(--muted);
}

.panel {
  min-width: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  margin: 8px 0;
}

.panel h2 {
  margin: 0 0 8px;
  font-size: 17px;
}

.person-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.person-button {
  height: 92px;
  background: var(--surface);
  border: 1px solid var(--line);
  font-size: 24px;
}

.pass-form {
  margin-top: 18px;
}

.field {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 3px;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.field input,
.field select {
  min-width: 0;
  max-width: 100%;
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 12px;
  background: #fff;
  color: var(--text);
  font-size: 16px;
}

.check-field {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 38px;
  margin: 4px 0 8px;
  font-weight: 700;
}

.check-field input {
  width: 22px;
  height: 22px;
}

.input-completion-checks {
  display: grid;
  gap: 6px;
}

.input-completion-checks .check-field {
  margin: 0;
}

.candidate-notice {
  margin-left: auto;
  color: var(--accent);
  font-size: 13px;
  white-space: nowrap;
}

.check-field:has(input:disabled) {
  color: var(--muted);
}

.primary,
a.primary {
  background: var(--primary);
  color: #fff;
  text-align: center;
  text-decoration: none;
}

.primary:active {
  background: var(--primary-dark);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.secondary {
  background: #ece9df;
  color: var(--text);
}

.danger {
  background: var(--danger);
  color: #fff;
}

.actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.chips {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
}

.chip {
  min-height: 38px;
  padding: 6px;
  background: var(--primary-light);
  color: var(--primary-dark);
}

.date-picker-trigger {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 12px;
  background: #fff;
  color: var(--text);
  font-size: 16px;
  text-align: center;
}

.ios-date-picker-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 12px 12px calc(12px + env(safe-area-inset-bottom));
  background: rgba(0, 0, 0, 0.38);
  overscroll-behavior: none;
}

.ios-date-picker-stack {
  width: min(100%, 640px);
  display: grid;
  gap: 10px;
}

.ios-date-picker-card,
.ios-date-picker-cancel {
  border-radius: 16px;
  background: #fff;
}

.ios-date-picker-card {
  overflow: hidden;
}

.ios-date-picker-card h2 {
  margin: 0;
  padding: 16px 16px 4px;
  color: var(--muted);
  font-size: 20px;
  font-weight: 500;
  text-align: center;
}

.ios-date-wheels {
  display: grid;
  grid-template-columns: 1.35fr 0.85fr 0.85fr;
  gap: 2px;
  padding: 2px 18px 8px;
}

.ios-date-wheel-column {
  position: relative;
  min-width: 0;
}

.ios-date-wheel-column::before {
  content: "";
  position: absolute;
  z-index: 0;
  top: 104px;
  left: 0;
  right: 0;
  height: 52px;
  border-radius: 8px;
  background: #f2f2f4;
  pointer-events: none;
}

.ios-date-wheel {
  position: relative;
  z-index: 1;
  height: 260px;
  overflow-y: auto;
  padding-block: 104px;
  scrollbar-width: none;
  scroll-snap-type: y mandatory;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  mask-image: linear-gradient(to bottom, transparent, #000 25%, #000 75%, transparent);
}

.ios-date-wheel::-webkit-scrollbar {
  display: none;
}

.ios-date-wheel-item {
  width: 100%;
  height: 52px;
  min-height: 52px;
  display: block;
  scroll-snap-align: center;
  border-radius: 0;
  padding: 0 4px;
  background: transparent;
  color: #a2a2a7;
  font-size: clamp(21px, 7vw, 30px);
  font-weight: 400;
  white-space: nowrap;
}

.ios-date-wheel-item.selected {
  color: var(--text);
}

.ios-date-picker-action,
.ios-date-picker-cancel {
  width: 100%;
  min-height: 62px;
  border-radius: 0;
  background: #fff;
  color: #087cf0;
  font-size: 21px;
  font-weight: 700;
}

.ios-date-picker-action {
  border-top: 1px solid #e4e4e6;
}

.ios-date-picker-cancel {
  border-radius: 16px;
}

.merchant-tags {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  margin: -2px 0 8px;
  padding: 2px 0;
}

.merchant-tag {
  min-width: max-content;
  min-height: 34px;
  padding: 6px 10px;
  background: var(--primary-light);
  color: var(--primary-dark);
}

.chip.selected {
  background: var(--primary);
  color: #fff;
}

.share-label {
  color: var(--text);
}

.filters {
  display: grid;
  gap: 10px;
}

.month-row {
  display: grid;
  grid-template-columns: 44px 1fr 44px;
  align-items: center;
  gap: 10px;
}

.month-label {
  text-align: center;
  font-size: 18px;
}

.icon-button {
  background: #ece9df;
}

.expense-list {
  display: grid;
  gap: 8px;
}

.subscriptions-add {
  margin-bottom: 14px;
}

.settlement-lead h2 {
  margin: 0 0 6px;
  font-size: 19px;
  line-height: 1.3;
}

.summary-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.summary-total {
  display: grid;
  gap: 3px;
  margin-bottom: 8px;
  padding: 10px 12px;
  border-radius: 8px;
  background: #fafaf7;
}

.summary-total span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.summary-total strong {
  font-size: 22px;
}

.summary-item {
  display: grid;
  gap: 3px;
  min-height: 54px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  background: #fafaf7;
}

.summary-item span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.summary-item.summary-paid-husband {
  border-color: var(--husband);
  background: var(--husband-light);
}

.summary-item.summary-paid-wife {
  border-color: var(--wife);
  background: var(--wife-light);
}

.summary-item.summary-paid-husband span,
.summary-item.summary-paid-husband strong {
  color: var(--husband);
}

.summary-item.summary-paid-wife span,
.summary-item.summary-paid-wife strong {
  color: var(--wife);
}

.summary-item.summary-settlement {
  grid-column: 1 / -1;
  justify-items: center;
  gap: 6px;
  padding: 12px;
  border-color: var(--primary);
  background: var(--primary-light);
}

.summary-item.summary-settlement.settlement-from-husband {
  border-color: var(--husband);
  background: var(--husband-light);
}

.summary-item.summary-settlement.settlement-from-wife {
  border-color: var(--wife);
  background: var(--wife-light);
}

.summary-item.summary-settlement.settlement-complete {
  border-color: var(--line);
  background: #f0f0ee;
}

.summary-item.summary-settlement .settlement-eyebrow {
  color: var(--muted);
}

.settlement-direction {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 3px;
}

.summary-item .settlement-direction span {
  color: var(--text);
  font-size: 18px;
  font-weight: 800;
}

.summary-item .settlement-direction .settlement-person {
  font-size: 23px;
}

.summary-item .settlement-person.husband {
  color: var(--husband);
}

.summary-item .settlement-person.wife {
  color: var(--wife);
}

.summary-item.summary-settlement .settlement-amount {
  color: var(--primary-dark);
  font-size: 24px;
}

.summary-item.summary-settlement.settlement-from-husband .settlement-amount {
  color: var(--husband);
}

.summary-item.summary-settlement.settlement-from-wife .settlement-amount {
  color: var(--wife);
}

.calendar-panel {
  margin-top: 4px;
  padding: 0;
  overflow: hidden;
}

.calendar-page {
  padding-top: max(2px, env(safe-area-inset-top));
}

.calendar-settled-notice {
  margin: 6px 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 12px;
  background: #f0f0ee;
  color: var(--muted);
  font-weight: 800;
  text-align: center;
}

.calendar-month-controls {
  display: grid;
  grid-template-columns: 44px 1fr 44px;
  align-items: center;
  min-height: 42px;
}

.calendar-month-label {
  text-align: center;
  font-size: 17px;
}

.calendar-arrow {
  min-height: 38px;
  padding: 0;
  background: transparent;
  color: var(--text);
  font-size: 30px;
  font-weight: 400;
}

.calendar-week,
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

.calendar-week {
  border-bottom: 1px solid var(--line);
  background: #fafaf7;
}

.calendar-week span {
  min-height: 25px;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.calendar-day {
  min-width: 0;
  min-height: 70px;
  display: grid;
  grid-template-rows: 20px 1fr;
  gap: 2px;
  align-items: start;
  border-radius: 0;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 6px 4px;
  background: #fff;
  color: var(--text);
  text-align: left;
}

.calendar-day:nth-child(7n) {
  border-right: 0;
}

.calendar-day.outside {
  background: #f0eee8;
  color: #aaa59a;
}

.calendar-day.today .calendar-date {
  width: 24px;
  border-radius: 999px;
  background: var(--primary-light);
  color: var(--primary-dark);
  text-align: center;
}

.calendar-day.selected {
  outline: 2px solid var(--primary);
  outline-offset: -2px;
  background: var(--primary-light);
}

.calendar-date {
  font-weight: 800;
  line-height: 20px;
}

.calendar-payers {
  min-width: 0;
  display: grid;
  align-self: end;
  gap: 4px;
}

.calendar-payer {
  min-width: 0;
  display: grid;
  gap: 1px;
  line-height: 1.05;
}

.calendar-payer-amount {
  overflow: hidden;
  font-size: clamp(9px, 2.9vw, 13px);
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.calendar-payer-husband {
  color: var(--husband);
}

.calendar-payer-wife {
  color: var(--wife);
}

.selected-day-panel {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.selected-day-head {
  display: grid;
  grid-template-columns: 1fr auto 44px;
  align-items: center;
  gap: 8px;
  min-height: 48px;
  color: #fff;
  font-weight: 800;
}

.calendar-weekday.weekday-0,
.calendar-day.weekday-sunday .calendar-date {
  color: #d14343;
}

.calendar-weekday.weekday-6,
.calendar-day.weekday-saturday .calendar-date {
  color: #2563b8;
}

.selected-day-head > div {
  font-size: 14px;
}

.selected-day-head > strong {
  font-size: 18px;
}

.sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: transparent;
  pointer-events: none;
}

.bottom-sheet {
  width: min(100%, 680px);
  max-height: min(38dvh, 420px);
  overflow: hidden;
  border-radius: 18px 18px 0 0;
  padding: 0 16px calc(18px + env(safe-area-inset-bottom));
  background: var(--surface);
  box-shadow: 0 -8px 28px rgba(0, 0, 0, 0.14);
  pointer-events: auto;
}

.sheet-fixed {
  flex: 0 0 auto;
  margin: 0 -16px;
  padding: 2px 8px 2px 16px;
  background: #6b6b6b;
}

.sheet-scroll {
  display: grid;
  flex: 1 1 auto;
  min-height: 0;
  gap: 12px;
  overflow-y: auto;
  padding: 12px 0 4px;
  overscroll-behavior: contain;
}

.settled-entry-disabled:disabled {
  width: 100%;
  background: #d9d8d4;
  color: var(--muted);
  opacity: 1;
}

.sheet-close {
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  background: transparent;
  color: #fff;
  border-radius: 50%;
}

.sheet-close:active {
  background: rgba(255, 255, 255, 0.16);
}

.sheet-close svg {
  display: block;
  width: 26px;
  height: 26px;
  margin: auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.payment-bars {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.bar-row {
  display: grid;
  grid-template-columns: 32px 1fr 92px;
  align-items: center;
  gap: 8px;
}

.bar-track {
  height: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: #ece9df;
}

.bar-fill {
  height: 100%;
  min-width: 2px;
}

.bar-husband {
  background: var(--primary);
}

.bar-wife {
  background: var(--accent);
}

.data-table {
  display: grid;
  border-top: 1px solid var(--line);
}

.tag-add-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 8px;
  margin-bottom: 14px;
}

.tag-add-form .field {
  margin-bottom: 0;
}

.tag-modal-close {
  margin-top: 12px;
}

.import-schedule {
  display: grid;
  gap: 10px;
  margin-bottom: 14px;
}

.import-schedule h2,
.import-schedule p {
  margin: 0;
}

.data-row {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
}

.tag-row-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.tag-order-button {
  width: 38px;
  min-height: 38px;
  padding: 0;
}

.history-list {
  display: grid;
  gap: 10px;
}

.history-head {
  display: grid;
  gap: 4px;
  width: 100%;
  min-height: 52px;
  background: #fafaf7;
  color: var(--text);
  text-align: left;
}

.settlement-detail {
  display: grid;
  gap: 10px;
  margin-top: 10px;
}

.date-heading {
  margin: 16px 0 4px;
  color: var(--muted);
  font-size: 15px;
}

.expense-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2px 12px;
  width: 100%;
  min-height: 56px;
  padding: 8px 12px 8px 9px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 5px solid var(--line);
  color: var(--text);
  text-align: left;
}

.merchant {
  grid-column: 1;
  font-weight: 800;
}

.expense-row.no-memo .merchant {
  align-self: center;
}

.expense-memo {
  grid-column: 1;
  overflow: hidden;
  color: var(--muted);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.meta {
  grid-column: 1;
  color: var(--muted);
  font-size: 13px;
}

.expense-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
}

.expense-row.payer-husband {
  border-left-color: var(--husband);
  background: var(--husband-light);
}

.expense-row.payer-wife {
  border-left-color: var(--wife);
  background: var(--wife-light);
}

.payer-badge {
  width: fit-content;
  border-radius: 999px;
  padding: 2px 7px;
  font-weight: 800;
}

.payer-badge.payer-husband {
  background: var(--husband-badge);
  color: var(--husband);
}

.payer-badge.payer-wife {
  background: var(--wife-badge);
  color: var(--wife);
}

.settlement-badge {
  width: fit-content;
  border-radius: 999px;
  padding: 2px 7px;
  font-weight: 800;
}

.settlement-badge.settled {
  background: #e5e7eb;
  color: #4b5563;
}

.settlement-badge.unsettled {
  background: #fff4d6;
  color: #a16207;
}

.amount {
  grid-column: 2;
  align-self: center;
}

.expense-row.has-secondary-line .amount {
  grid-row: 1 / span 2;
}

.empty,
.warning {
  padding: 14px;
  border-radius: 8px;
  background: #fff7ed;
  color: var(--accent);
}

.bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 12;
  padding-bottom: env(safe-area-inset-bottom);
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
}

.bottom-nav-inner {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  width: 100%;
  max-width: 680px;
  margin: 0 auto;
}

.bottom-nav a {
  position: relative;
  min-height: 58px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  color: var(--muted);
  text-decoration: none;
  font-size: 12px;
  font-weight: 800;
  text-align: center;
}

.android-device .bottom-nav {
  height: calc(58px + env(safe-area-max-inset-bottom, 0px));
  padding-bottom: env(safe-area-max-inset-bottom, 0px);
  bottom: calc(env(safe-area-inset-bottom, 0px) - env(safe-area-max-inset-bottom, 0px));
  background: #fff;
}

.android-device .screen {
  padding-bottom: calc(78px + env(safe-area-max-inset-bottom, 0px));
}

.android-device.keyboard-open .bottom-nav {
  transform: translateY(var(--keyboard-height, 0px));
  pointer-events: none;
}

.android-device.keyboard-open .expense-form {
  padding-bottom: calc(var(--keyboard-height, 0px) + 24px);
}

.android-device .expense-form .field {
  scroll-margin-top: 12px;
}

.nav-icon {
  width: 25px;
  height: 25px;
}

.nav-icon svg {
  width: 100%;
  height: 100%;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.nav-add .nav-icon {
  width: 42px;
  height: 42px;
  margin-top: -20px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  box-shadow: 0 3px 10px rgba(15, 118, 110, 0.28);
}

.nav-add .nav-icon svg {
  width: 25px;
  height: 25px;
  stroke-width: 2;
}

.nav-add .nav-label {
  margin-top: -1px;
}

.bottom-nav a.active {
  color: var(--primary);
}

.nav-notification-badge {
  position: absolute;
  top: 4px;
  left: calc(50% + 8px);
  min-width: 19px;
  height: 19px;
  display: grid;
  place-items: center;
  padding: 0 5px;
  border: 2px solid #fff;
  border-radius: 999px;
  background: var(--danger);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
}

.candidate-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 2px 0 8px;
}

.candidate-card-meta .muted {
  margin: 0;
}

.candidate-group {
  margin-top: 18px;
}

.candidate-group-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
  padding: 0 2px;
}

.candidate-group-title {
  margin: 0;
  font-size: 17px;
}

.candidate-group-husband .candidate-group-title {
  color: var(--husband);
}

.candidate-group-wife .candidate-group-title {
  color: var(--wife);
}

.candidate-group-empty {
  margin: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
  overflow: auto;
  padding: 16px;
  background: rgba(0, 0, 0, 0.38);
}

.modal {
  max-width: 680px;
  margin: 20px auto 80px;
}

.export-modal {
  margin-top: 72px;
}

.import-rule-modal {
  max-width: 760px;
}

.import-rule-modal .field input {
  font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
  font-size: 14px;
}

.commit-hash {
  color: var(--muted);
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
}

.settings-commit {
  position: absolute;
  top: 6px;
  right: 12px;
}

.settings-group {
  margin: 18px 0;
}

.settings-group-title {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
}

.settings-group .panel {
  margin: 0;
}

.menu-item {
  display: block;
  min-height: 44px;
  width: 100%;
  padding: 10px 14px;
  border: 0;
  border-radius: 0;
  background: #fff;
  color: var(--text);
  font: inherit;
  font-weight: 700;
  line-height: normal;
  text-align: left;
  text-decoration: none;
}

.menu-item-with-badges {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.candidate-count-badges {
  display: flex;
  flex: 0 0 auto;
  gap: 6px;
}

.menu-item + .menu-item {
  border-top: 1px solid var(--line);
}

.danger-text {
  color: var(--danger);
}

.monthly-share-control {
  display: grid;
  gap: 0;
}

.monthly-share-fixed {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 8px;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 14px;
  background: #f0f0ee;
  font-size: 17px;
  font-weight: 800;
  text-align: center;
}

.monthly-share-fixed .husband {
  color: var(--husband);
}

.monthly-share-fixed .wife {
  color: var(--wife);
}

.monthly-share-fixed .separator {
  color: var(--muted);
}

.monthly-share-select {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px 10px;
  background: #fff;
  color: var(--text);
  font-size: 16px;
}

/* iOS WebKit adds horizontal padding outside width: 100% for date-like inputs. */
.field input[type="date"],
.field input[type="month"] {
  padding-inline: 0;
  text-align: center;
}

.field input[type="date"],
.field input[type="month"] {
  cursor: pointer;
}

.toast {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: 78px;
  z-index: 20;
  visibility: hidden;
  opacity: 0;
  transform: translateY(calc(100% + 100px));
  transition: transform 0.18s ease, opacity 0.18s ease, visibility 0s linear 0.18s;
  border-radius: 8px;
  padding: 12px 14px;
  background: #20201d;
  color: #fff;
  pointer-events: none;
  text-align: center;
}

.toast.show {
  visibility: visible;
  opacity: 1;
  transform: translateY(0);
  transition-delay: 0s;
}

@media (min-width: 700px) {
  .actions {
    grid-template-columns: repeat(3, 1fr);
  }

  .actions:has(> :only-child) {
    grid-template-columns: minmax(0, 1fr);
  }

  .calendar-day {
    min-height: 80px;
    padding: 9px;
  }

  .bottom-nav a {
    font-size: 14px;
  }
}
