:root {
  --bg: #eef2f5;
  --panel: #ffffff;
  --ink: #17212b;
  --muted: #687684;
  --line: #dfe6ec;
  --green: #16794c;
  --red: #b93d37;
  --blue: #2d6cdf;
  --amber: #a66708;
  --shadow: 0 14px 42px rgba(34, 48, 64, 0.14);
}

* {
  box-sizing: border-box;
}

html,
body,
#root {
  width: 100%;
  min-height: 100%;
  margin: 0;
  padding: 0;
  overflow-x: hidden;
  -webkit-text-size-adjust: 100%;
}

html {
  height: 100%;
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  justify-content: center;
  align-items: stretch;
  background: linear-gradient(145deg, #f4f7f9, #dfe7ee);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
}

#app {
  width: 100%;
  min-width: 0;
}

button,
input,
select,
textarea {
  font: inherit;
}

input,
textarea,
select {
  font-size: 16px;
}

button,
a,
input,
select,
textarea,
[role="button"] {
  touch-action: manipulation;
}

button {
  cursor: pointer;
}

.phone {
  width: 100%;
  max-width: none;
  height: 100vh;
  height: 100dvh;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0 auto;
  background: var(--bg);
  border: 0;
  border-radius: 0;
  overflow: hidden;
  box-shadow: none;
  display: flex;
  flex-direction: column;
  position: relative;
}

.topbar {
  min-height: 82px;
  padding: 20px 18px 12px;
  display: grid;
  grid-template-columns: 40px 1fr 40px;
  gap: 10px;
  align-items: center;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
}

.eyebrow {
  margin: 0 0 2px;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.eyebrow[hidden] {
  display: none;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: 22px;
  line-height: 1.2;
  text-align: center;
}

h2 {
  margin-bottom: 12px;
  font-size: 18px;
}

h3 {
  margin-bottom: 8px;
  font-size: 16px;
}

.screen {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 14px 14px 88px;
  padding-bottom: calc(88px + constant(safe-area-inset-bottom));
  padding-bottom: calc(88px + env(safe-area-inset-bottom));
  transform: translateY(var(--pull-offset, 0px));
  transition: transform 0.18s ease;
  will-change: transform;
}

.screen.pulling {
  transition: none;
}

.phone.book-mode .screen {
  padding-bottom: 86px;
  padding-bottom: calc(86px + constant(safe-area-inset-bottom));
  padding-bottom: calc(86px + env(safe-area-inset-bottom));
}

.phone.record-mode .screen {
  padding-bottom: 12px;
  padding-bottom: calc(12px + constant(safe-area-inset-bottom));
  padding-bottom: calc(12px + env(safe-area-inset-bottom));
}

.phone.book-mode .topbar {
  min-height: 44px;
  padding: 6px 14px 5px;
  grid-template-columns: 34px 1fr 34px;
  gap: 8px;
}

.phone.book-mode .topbar .icon-button {
  width: 34px;
  min-height: 34px;
  font-size: 20px;
  border-radius: 8px;
}

.phone.book-mode .eyebrow {
  margin-bottom: 0;
  font-size: 11px;
  line-height: 1.1;
}

.phone.book-mode h1 {
  font-size: 18px;
  line-height: 1.1;
}

.phone.record-mode .topbar {
  min-height: 48px;
  padding: 6px 14px 5px;
  grid-template-columns: 34px 1fr 34px;
  gap: 8px;
}

.phone.record-mode .topbar .icon-button {
  width: 34px;
  min-height: 34px;
  font-size: 20px;
  border-radius: 8px;
}

.phone.record-mode .eyebrow {
  margin-bottom: 0;
  font-size: 11px;
  line-height: 1.05;
}

.phone.record-mode h1 {
  font-size: 18px;
  line-height: 1.08;
}

.phone.record-mode .tabbar {
  display: none;
}

.phone.auth-mode .screen {
  display: grid;
  align-items: center;
  padding-bottom: 24px;
}

.phone.auth-mode .topbar {
  display: none;
}

.stack {
  display: grid;
  gap: 12px;
}

.auth-card {
  display: grid;
  gap: 14px;
  padding: 20px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 10px 26px rgba(39, 64, 84, 0.08);
}

.auth-card h2 {
  margin: 0 0 4px;
  font-size: 24px;
}

.auth-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  align-items: start;
}

.auth-card.compact {
  min-width: 0;
  gap: 10px;
  padding: 14px 10px;
}

.auth-card.compact h2 {
  font-size: 20px;
}

.auth-card.compact .field input {
  padding: 9px 8px;
}

.auth-register-link {
  justify-self: center;
  min-height: 0;
  border: 0;
  padding: 2px 6px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.auth-register-link:active {
  color: var(--blue);
}

.invite-link {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f6f8fa;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.45;
  word-break: break-all;
}

.invite-copy-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: stretch;
}

.invite-copy-row .secondary {
  min-width: 62px;
}

.admin-users {
  display: grid;
  gap: 10px;
}

.admin-user-row {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
}

.admin-user-row .danger {
  min-height: 32px;
  padding: 6px 10px;
}

.mini-actions {
  display: grid;
  gap: 6px;
}

.mini-actions .primary,
.mini-actions .danger {
  min-height: 30px;
  padding: 5px 10px;
}

.record-page {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.record-amount-display {
  min-height: 0;
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.record-input-amount {
  min-height: 58px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  flex-wrap: wrap;
  column-gap: 1px;
  font-size: 46px;
  line-height: 1.08;
  font-weight: 800;
  text-align: center;
  word-break: break-all;
}

.amount-char {
  position: relative;
  display: inline-block;
}

.amount-char-wan {
  padding-top: 16px;
}

.amount-wan-marker {
  position: absolute;
  left: 50%;
  top: -6px;
  transform: translateX(-50%);
  min-width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  border-radius: 2px;
  background: #8d9399;
  color: #fff;
  font-size: 13px;
  line-height: 1;
  font-weight: 700;
}

.amount-wan-marker::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -5px;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: #8d9399;
  border-bottom: 0;
}

.category-section {
  display: grid;
  gap: 0;
  padding-top: 6px;
  border-top: 1px solid var(--line);
}

.category-section p {
  margin-bottom: 0;
}

.category-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 7px;
}

.category-chip {
  height: 44px;
  min-height: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font-size: 13px;
  display: grid;
  place-items: center;
  gap: 2px;
  padding: 5px 3px;
  overflow: hidden;
}

.category-chip span {
  font-size: 18px;
  line-height: 1;
}

.category-chip b {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
  font-weight: 500;
}

.category-chip.empty-slot {
  border-style: dashed;
  background: #f8fafb;
}

.add-category-chip {
  border-style: dashed;
  color: var(--blue);
  background: #f8fbff;
}

.record-page.record-income .category-chip.active {
  border-color: var(--red);
  color: var(--red);
  background: #fff0ef;
}

.record-page.record-expense .category-chip.active {
  border-color: var(--green);
  color: var(--green);
  background: #eaf7f0;
}

.record-info-panel {
  display: grid;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.record-info-panel label {
  min-height: 82px;
  display: grid;
  grid-template-columns: 82px 1fr;
  align-items: start;
  gap: 8px;
  padding: 10px;
  background: #fff;
  border-bottom: 1px solid var(--line);
}

.record-remark-photo-row {
  min-height: 74px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 66px;
  align-items: stretch;
  gap: 8px;
  padding: 10px;
  background: #fff;
}

.record-remark-field {
  min-width: 0;
  display: grid;
  grid-template-rows: auto 1fr;
  align-content: start;
  gap: 6px;
}

.record-remark-field span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.2;
}

.record-info-panel label:last-child {
  border-bottom: 0;
}

.record-info-panel span {
  color: var(--muted);
  font-size: 13px;
}

.record-info-panel input,
.record-info-panel textarea {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
}

.record-info-panel textarea {
  min-height: 50px;
  resize: none;
}

.record-remark-field textarea {
  min-height: 44px;
  padding: 0;
  line-height: 1.45;
}

.record-photo-add {
  min-height: 66px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  position: relative;
  overflow: hidden;
  padding: 8px 4px;
  border: 1px dashed rgba(35, 182, 211, 0.58);
  border-radius: 12px;
  background: linear-gradient(180deg, #f2fcff 0%, #ffffff 100%);
  color: var(--blue);
  box-shadow: inset 0 0 0 1px rgba(35, 182, 211, 0.06);
  cursor: pointer;
}

.record-info-panel .record-photo-add {
  min-height: 66px;
  display: flex;
  grid-template-columns: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  width: 100%;
  box-sizing: border-box;
  padding: 8px 4px;
  border-bottom: 0;
}

.record-photo-add input {
  position: fixed;
  left: -9999px;
  top: -9999px;
  width: 0;
  height: 0;
  opacity: 0;
  pointer-events: none;
  appearance: none;
}

.record-photo-add b {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  position: relative;
  border-radius: 50%;
  background: linear-gradient(135deg, #24c6dc, #1c92d2);
  box-shadow: 0 8px 18px rgba(30, 156, 207, 0.22);
  color: transparent;
  font-size: 0;
  line-height: 0;
  overflow: hidden;
}

.record-photo-add b.has-count {
  color: #fff;
  font-size: 18px;
  line-height: 1;
  font-weight: 700;
}

.record-photo-add b::before,
.record-photo-add b::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 16px;
  height: 2px;
  border-radius: 999px;
  background: #fff;
  transform: translate(-50%, -50%);
}

.record-photo-add b::after {
  width: 2px;
  height: 16px;
}

.record-photo-add b.has-count::before,
.record-photo-add b.has-count::after {
  display: none;
}

.record-photo-add em {
  display: block;
  font-size: 12px;
  line-height: 1.2;
  font-style: normal;
  white-space: nowrap;
  font-weight: 600;
}

.icon-picker {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
}

.icon-option,
.icon-select {
  min-height: 38px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  font-size: 20px;
  cursor: pointer;
}

.icon-option input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.icon-option:has(input:checked),
.icon-select.active {
  border-color: var(--green);
  background: #eaf7f0;
}

.icon-option input:checked + span {
  outline: 2px solid var(--green);
  outline-offset: 4px;
  border-radius: 6px;
}

.modal-icon-picker {
  grid-template-columns: repeat(5, 1fr);
}

.category-list-title {
  display: flex;
  align-items: center;
  gap: 10px;
}

.category-list-icon {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #f1f6f9;
  font-size: 20px;
}

.category-icon {
  margin-right: 6px;
}

.category-type-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.category-type-switch button {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
  font-weight: 700;
}

.category-type-switch button.active {
  border-color: #2563eb;
  background: #2563eb;
  color: #fff;
  box-shadow: 0 8px 18px rgba(37, 99, 235, 0.18);
}

.record-page.record-income .record-input-amount {
  color: var(--red);
}

.record-page.record-expense .record-input-amount {
  color: var(--green);
}

.record-keypad-panel {
  margin-top: clamp(8px, 1.8dvh, 18px);
  display: grid;
  gap: 8px;
  padding-bottom: 0;
  border-radius: 8px;
}

.record-confirm {
  min-height: clamp(52px, 6.4dvh, 64px);
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 8px 12px;
  color: #fff;
  font-size: 18px;
  font-weight: 700;
}

.record-page.record-income .record-confirm {
  background: var(--red);
}

.record-page.record-expense .record-confirm {
  background: var(--green);
}

.row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.card,
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
}

.book-card {
  display: grid;
  gap: 0;
  padding: 0;
  overflow: hidden;
  background-position: center;
  background-size: cover;
}

.book-list-page {
  gap: 12px;
}

.new-book-entry {
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 0;
  border-radius: 4px;
  background: #fff;
  color: #173449;
  font-size: 20px;
  box-shadow: 0 8px 24px rgba(39, 64, 84, 0.08);
}

.new-book-plus {
  width: 24px;
  height: 24px;
  display: inline-block;
  position: relative;
  border-radius: 50%;
  background: #20b9dc;
  color: transparent;
  font-size: 0;
  line-height: 0;
}

.new-book-plus::before,
.new-book-plus::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 12px;
  height: 2px;
  border-radius: 999px;
  background: #fff;
  transform: translate(-50%, -50%);
}

.new-book-plus::after {
  width: 2px;
  height: 12px;
}

.book-card-main {
  min-height: 88px;
  display: grid;
  grid-template-columns: 1fr 32px;
  gap: 8px;
  align-items: start;
  padding: 14px 12px 10px;
  width: 100%;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
}

.book-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.book-title-row h3 {
  margin: 0;
  color: #163449;
  font-size: 19px;
  font-weight: 500;
}

.book-badge {
  flex: 0 0 auto;
  min-width: 26px;
  height: 18px;
  display: inline-grid;
  place-items: center;
  border-radius: 10px;
  padding: 0 7px;
  background: #e4fbfb;
  color: #36b4c8;
  font-size: 11px;
}

.book-balance-large {
  color: #737d86;
  font-size: 14px;
  line-height: 1.3;
}

.book-balance-large strong {
  color: var(--ink);
  font-size: 25px;
  font-weight: 600;
}

.book-balance-large strong.positive {
  color: var(--red);
}

.book-balance-large strong.negative {
  color: var(--green);
}

.book-money-with-wan {
  display: inline-flex;
  align-items: flex-end;
  white-space: nowrap;
}

.book-money-char {
  position: relative;
  display: inline-block;
}

.book-money-char-wan {
  padding-top: 12px;
}

.book-money-wan-marker {
  position: absolute;
  left: 50%;
  top: -5px;
  transform: translateX(-50%);
  min-width: 16px;
  height: 16px;
  display: grid;
  place-items: center;
  border-radius: 2px;
  background: #8d9399;
  color: #fff;
  font-size: 11px;
  line-height: 1;
  font-weight: 700;
}

.book-money-wan-marker::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -4px;
  transform: translateX(-50%);
  border: 4px solid transparent;
  border-top-color: #8d9399;
}

.enter-arrow {
  width: 26px;
  height: 36px;
  color: #c9d0d5;
  font-size: 34px;
  line-height: 1;
  text-align: center;
}

.book-card-footer {
  min-height: 44px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  padding: 0 12px;
  border-top: 1px solid var(--line);
}

.book-link {
  border: 0;
  background: transparent;
  color: #173449;
  padding: 6px 0;
  font-size: 15px;
}

.book-link::before {
  content: "⚙";
  margin-right: 6px;
  color: #26aeca;
}

.book-footer-members {
  justify-self: end;
  max-width: 100%;
  flex-wrap: wrap;
  justify-content: flex-end;
  padding: 4px 0 4px 7px;
}

.book-footer-actions {
  display: flex;
  align-items: center;
}

.book-footer-actions .book-link {
  min-height: 44px;
  white-space: nowrap;
}

.book-footer-actions .monthly-book-link {
  margin-left: 14px;
}

.monthly-book-link::before {
  content: "";
  display: inline-block;
  width: 12px;
  height: 12px;
  vertical-align: -1px;
  background: linear-gradient(to top, #26aeca 60%, transparent 60%) left / 3px 100% no-repeat,
    linear-gradient(to top, #26aeca 100%, transparent 100%) center / 3px 100% no-repeat,
    linear-gradient(to top, #26aeca 80%, transparent 80%) right / 3px 100% no-repeat;
}

.balance {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: 0;
}

.balance-panel {
  border: 0;
  background: linear-gradient(135deg, #1ac7de, #1687d9);
  color: #fff;
  padding: 10px 14px;
}

.balance-panel .muted {
  color: rgba(255, 255, 255, 0.78);
}

.balance-main {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: baseline;
  gap: 10px;
}

.balance-main p {
  margin-bottom: 0;
  color: rgba(255, 255, 255, 0.82);
  font-size: 13px;
}

.balance-panel .balance {
  font-size: 28px;
  grid-column: 2;
  text-align: center;
}

.balance.positive {
  color: var(--red);
}

.balance.negative {
  color: var(--green);
}

.month-summary {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.28);
}

.month-summary div {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 8px;
}

.month-summary span {
  color: rgba(255, 255, 255, 0.78);
  font-size: 12px;
}

.month-summary strong {
  font-size: 15px;
}

.month-summary .income {
  color: var(--red);
}

.month-summary .expense {
  color: var(--green);
}

.muted {
  color: var(--muted);
}

.small {
  font-size: 12px;
}

.avatar-row {
  display: flex;
  align-items: center;
}

.avatar {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border: 2px solid #fff;
  border-radius: 50%;
  margin-left: -7px;
  background: #dce8f7;
  color: #315b8b;
  font-size: 12px;
  font-weight: 700;
}

.book-card .avatar {
  width: 28px;
  height: 28px;
  margin-left: 6px;
  border: 0;
  background: #e7eef4;
  color: #315b8b;
  font-size: 12px;
}

.avatar:first-child {
  margin-left: 0;
}

.primary,
.secondary,
.danger,
.ghost,
.icon-button {
  min-height: 38px;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 8px 12px;
  background: #f8fafb;
  color: var(--ink);
}

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

.secondary {
  border-color: var(--line);
  background: #fff;
}

.danger {
  background: #fff0ef;
  color: var(--red);
  border-color: #f0b8b3;
}

.ghost {
  color: var(--blue);
  background: transparent;
}

.icon-button {
  width: 38px;
  padding: 0;
  font-size: 24px;
  display: grid;
  place-items: center;
}

.icon-button.refreshing {
  opacity: 0.72;
  animation: refresh-spin 0.75s linear infinite;
}

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

.sync-notice {
  position: fixed;
  left: 50%;
  top: calc(18px + env(safe-area-inset-top));
  z-index: 80;
  width: min(420px, calc(100vw - 28px));
  transform: translateX(-50%);
  min-height: 58px;
  padding: 18px 18px;
  border-radius: 18px;
  background: rgba(34, 48, 64, 0.92);
  color: #fff;
  font-size: 18px;
  font-weight: 700;
  text-align: center;
  box-shadow: 0 10px 24px rgba(34, 48, 64, 0.18);
  display: flex;
  align-items: center;
  justify-content: center;
}

.sync-notice.success {
  background: rgba(21, 128, 61, 0.94);
}

.sync-notice.error {
  background: rgba(196, 58, 53, 0.94);
}

.pull-refresh-indicator {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 70;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 118px;
  height: 42px;
  padding: 0 18px;
  border-radius: 999px;
  background: rgba(23, 33, 43, 0.9);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.96);
  transition: opacity 0.16s ease, transform 0.16s ease;
}

.pull-refresh-indicator.visible {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.pull-refresh-indicator.refreshing {
  background: rgba(23, 33, 43, 0.9);
}

.pull-refresh-indicator.success {
  background: rgba(21, 128, 61, 0.94);
}

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

.actions.three {
  grid-template-columns: repeat(3, 1fr);
}

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

.book-tools {
  display: flex;
  justify-content: flex-start;
  gap: 8px;
}

.search-button {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 12px;
  background: #fff;
  color: #173449;
}

.record {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto auto;
  gap: 6px;
  align-items: center;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.record-button {
  width: 100%;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.record-button:active {
  background: #f4f8fb;
}

.record.voided {
  opacity: 0.6;
}

.record-title {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.record-title strong {
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  line-height: 1.35;
  font-size: 15px;
  font-weight: 400;
}

.record-icon {
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #f1f6f9;
  font-size: 16px;
}

.record > .amount {
  grid-column: 4;
  font-size: 15px;
  white-space: nowrap;
}

.record-creator-mark {
  grid-column: 2;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #e7eef4;
  color: #315b8b;
  font-size: 13px;
  font-weight: 700;
}

.record-photo-thumb,
.record-photo-mark,
.record-photo-empty {
  grid-column: 3;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #f1f6f9;
}

.record-photo-thumb {
  object-fit: cover;
  cursor: pointer;
}

.record-photo-mark {
  display: grid;
  place-items: center;
  color: var(--blue);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.record-photo-empty {
  opacity: 0;
}

.record-detail-panel {
  display: grid;
  gap: 0;
  padding: 0;
  overflow: hidden;
}

.detail-row {
  min-height: 54px;
  display: grid;
  grid-template-columns: 86px 1fr;
  gap: 12px;
  align-items: center;
  padding: 0 14px;
  border-bottom: 1px solid var(--line);
}

.detail-row:last-child {
  border-bottom: 0;
}

.detail-row span {
  color: var(--muted);
  font-size: 13px;
}

.detail-row strong {
  justify-self: end;
  text-align: right;
}

.detail-value {
  justify-self: end;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  min-width: 0;
  text-align: right;
}

.date-edit-button {
  min-height: 30px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 10px;
  background: #fff;
  color: var(--blue);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.date-edit-form {
  display: grid;
  gap: 12px;
}

.date-edit-form label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.date-edit-form input[type="date"] {
  width: 100%;
  height: 46px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  color: var(--ink);
  font-size: 16px;
}

.record-photo-panel {
  display: grid;
  gap: 12px;
}

.record-photo-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.record-photo-panel-head span {
  color: var(--muted);
  font-size: 13px;
}

.record-photo-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.record-detail-photo {
  position: relative;
  aspect-ratio: 1;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f6fafc;
  overflow: hidden;
}

.record-detail-photo-view {
  width: 100%;
  height: 100%;
  display: block;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.record-detail-photo img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.record-photo-delete {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.84);
  border-radius: 50%;
  background: rgba(23, 33, 43, 0.68);
  color: #fff;
  font-size: 20px;
  line-height: 20px;
  font-family: Arial, sans-serif;
  cursor: pointer;
}

.record-photo-placeholder {
  grid-column: 1 / -1;
  min-height: 66px;
  display: grid;
  place-items: center;
  border: 1px dashed #aab7c4;
  border-radius: 10px;
  color: var(--muted);
  background: #fbfcfd;
}

.record-image-preview {
  width: 100%;
  max-height: 70vh;
  display: block;
  object-fit: contain;
  border-radius: 8px;
  background: #f6fafc;
}

.amount.income {
  color: var(--red);
}

.amount.expense {
  color: var(--green);
}

.amount.clear {
  color: var(--amber);
}

.date-group {
  display: grid;
  gap: 4px;
}

.date-head {
  color: var(--muted);
  font-size: 13px;
}

.date-head .income {
  color: var(--red);
  font-weight: 700;
}

.date-head .expense {
  color: var(--green);
  font-weight: 700;
}

.field {
  display: grid;
  gap: 6px;
}

.field label {
  color: var(--muted);
  font-size: 13px;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #fff;
  color: var(--ink);
}

.field textarea {
  min-height: 72px;
  resize: vertical;
}

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

.segmented button {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #fff;
}

.segmented .type-expense {
  border-color: #97d0b5;
  color: var(--green);
}

.segmented .type-income {
  border-color: #f0b8b3;
  color: var(--red);
}

.segmented .type-expense.active {
  background: var(--green);
  border-color: var(--green);
  color: #fff;
}

.segmented .type-income.active {
  background: var(--red);
  border-color: var(--red);
  color: #fff;
}

.keypad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
}

.keypad button {
  min-height: clamp(58px, 7.4dvh, 76px);
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  font-size: 22px;
  line-height: 1;
}

.record-page.record-income .keypad button {
  border-color: var(--line);
  background: #fff;
  color: var(--red);
  font-weight: 800;
  font-size: clamp(26px, 4.2dvh, 34px);
}

.record-page.record-expense .keypad button {
  border-color: var(--line);
  background: #fff;
  color: var(--green);
  font-weight: 800;
  font-size: clamp(26px, 4.2dvh, 34px);
}

.photo-box {
  min-height: 74px;
  border: 1px dashed #aab7c4;
  border-radius: 8px;
  display: grid;
  place-items: center;
  color: var(--muted);
  background: #fbfcfd;
}

.upload-button {
  min-height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--blue);
  cursor: pointer;
}

.bg-actions {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 8px;
}

.bg-actions strong {
  font-size: 15px;
  font-weight: 600;
}

.color-board {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
}

.color-swatch {
  aspect-ratio: 1.45;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.5);
  cursor: pointer;
}

.color-swatch.active {
  border-color: var(--blue);
  box-shadow: 0 0 0 2px rgba(35, 182, 211, 0.18), inset 0 0 0 2px #fff;
}

.color-swatch[style*="#0f172a"],
.color-swatch[style*="#1e293b"],
.color-swatch[style*="#14532d"],
.color-swatch[style*="#7f1d1d"] {
  border-color: rgba(23, 33, 43, 0.35);
}

.upload-button input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.bg-preview {
  min-height: 110px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background-position: center;
  background-size: cover;
}

.search-results {
  display: grid;
  gap: 8px;
}

.search-result {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #fff;
}

.search-result > div { min-width: 0; overflow-wrap: break-word; word-break: break-word; }
.search-result .archive-label { display: block; }
.search-more[hidden] { display: none; }
@media (max-width: 375px) {
  .search-result { grid-template-columns: minmax(0, 1fr); }
  .search-result > .amount { justify-self: end; }
}

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

.stats-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 14px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fff;
}

.stats-row span {
  color: var(--muted);
}

.stats-row .income {
  color: var(--red);
}

.stats-row .expense {
  color: var(--green);
}

.tabbar {
  min-height: 70px;
  padding-bottom: 0;
  padding-bottom: constant(safe-area-inset-bottom);
  padding-bottom: env(safe-area-inset-bottom);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--line);
  background: var(--panel);
  position: relative;
  flex: 0 0 auto;
}

.tabbar.hidden {
  display: none;
}

.tabbar.book-mode {
  min-height: 70px;
  border-top: 1px solid var(--line);
  box-shadow: 0 -8px 22px rgba(34, 48, 64, 0.08);
}

.tab {
  border: 0;
  background: transparent;
  color: var(--muted);
  display: grid;
  place-items: center;
  align-content: center;
  gap: 4px;
}

.tab.active {
  color: var(--green);
  font-weight: 700;
}

.tab[data-tab="record"] {
  color: #8ea0ad;
  font-size: 16px;
  transform: none;
  position: relative;
  z-index: 1;
}

.tab[data-tab="record"].active {
  color: var(--green);
}

.tab[data-tab="record"] span:not(.tab-plus) {
  display: none;
}

.tab-plus {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  position: relative;
  border-radius: 50%;
  background: #19bfdc;
  border: 4px solid #fff;
  color: #fff;
  font-size: 0;
  line-height: 1;
  font-weight: 300;
  box-shadow: 0 10px 24px rgba(25, 191, 220, 0.26);
}

.tab-plus::before,
.tab-plus::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 20px;
  height: 2px;
  border-radius: 999px;
  background: #fff;
  transform: translate(-50%, -50%);
}

.tab-plus::after {
  width: 2px;
  height: 20px;
}

.tab[data-tab="record"].active .tab-plus {
  background: #19bfdc;
}

.tabbar.book-mode .tab[data-tab="record"] {
  transform: none;
}

.tabbar.book-mode .tab-plus {
  width: 48px;
  height: 48px;
  background: #19bfdc;
  border: 4px solid #fff;
  box-shadow: 0 10px 24px rgba(25, 191, 220, 0.28);
}

.tabbar.book-mode .tab[data-tab="record"].active .tab-plus {
  background: #19bfdc;
}

.modal-mask {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(23, 33, 43, 0.44);
  z-index: 10;
}

.modal {
  width: min(390px, 100%);
  max-height: 82vh;
  overflow: auto;
  background: var(--panel);
  border-radius: 12px;
  padding: 14px;
  box-shadow: var(--shadow);
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.empty {
  padding: 28px 16px;
  text-align: center;
  color: var(--muted);
}

.notice {
  border-left: 4px solid var(--amber);
  background: #fff8ed;
}

@media (max-width: 375px) {
  .screen {
    padding-left: 10px;
    padding-right: 10px;
  }

  .topbar {
    padding-left: 12px;
    padding-right: 12px;
    grid-template-columns: 36px minmax(0, 1fr) 36px;
  }

  h1 {
    font-size: 20px;
  }

  .book-card-main {
    padding-left: 12px;
    padding-right: 12px;
  }

  .record-amount-display,
  .record-info-panel,
  .record-keypad-panel {
    gap: 8px;
  }

  .record-input-amount {
    font-size: 44px;
  }

  .category-grid {
    gap: 6px;
  }
}

@media (max-height: 760px) {
  .phone.record-mode .screen {
    padding-top: 8px;
  }

  .phone.record-mode .topbar {
    min-height: 42px;
    padding-top: 4px;
    padding-bottom: 4px;
  }

  .phone.record-mode .eyebrow {
    font-size: 10px;
  }

  .phone.record-mode h1 {
    font-size: 17px;
  }

  .record-page {
    gap: 8px;
  }

  .record-amount-display {
    gap: 8px;
    padding: 10px;
  }

  .segmented button {
    min-height: 38px;
    font-size: 15px;
  }

  .record-input-amount {
    font-size: 38px;
  }

  .category-chip {
    height: 40px;
  }

  .category-chip span {
    font-size: 16px;
  }

  .category-chip b {
    font-size: 11px;
  }

  .record-remark-photo-row {
    min-height: 66px;
    padding: 8px;
    grid-template-columns: minmax(0, 1fr) 58px;
  }

  .record-info-panel textarea,
  .record-remark-field textarea {
    min-height: 38px;
  }

  .record-info-panel .record-photo-add,
  .record-photo-add {
    min-height: 58px;
  }

  .record-photo-add b {
    width: 28px;
    height: 28px;
  }

  .record-photo-add em {
    font-size: 11px;
  }

  .keypad button {
    min-height: 50px;
  }

  .record-confirm {
    min-height: 48px;
  }
}

@media (max-height: 680px) {
  .category-section {
    gap: 0;
  }

  .category-grid {
    gap: 5px;
  }

  .category-chip {
    height: 36px;
  }

  .record-remark-photo-row {
    min-height: 60px;
  }

  .record-info-panel textarea,
  .record-remark-field textarea {
    min-height: 32px;
  }

  .keypad {
    gap: 5px;
  }

  .keypad button {
    min-height: 44px;
  }

  .record-confirm {
    min-height: 42px;
  }
}

@media (min-width: 431px) and (max-width: 599px) {
  .phone {
    max-width: none;
  }
}

@media (min-width: 600px) {
  body {
    align-items: center;
    padding: 16px;
  }

  .phone {
    max-width: 480px;
    height: calc(100vh - 32px);
    height: calc(100dvh - 32px);
    min-height: 0;
    border: 1px solid rgba(23, 33, 43, 0.12);
    border-radius: 24px;
    box-shadow: var(--shadow);
  }
}

.phone.monthly-mode .topbar {
  min-height: 58px;
  padding-top: 7px;
  padding-bottom: 7px;
  grid-template-columns: 36px minmax(0, 1fr) 36px;
}

.phone.monthly-mode .topbar h1 { font-size: 20px; }
.phone.monthly-mode .eyebrow { overflow-wrap: anywhere; }
.phone.monthly-mode .screen { background: var(--panel); padding-top: 0; }

.monthly-page { width: 100%; min-width: 0; letter-spacing: 0; }
.analysis-loading { padding: 30px 0; text-align: center; color: var(--muted); }
.analysis-modes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); margin: 12px 0; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.analysis-modes button { min-height: 42px; padding: 8px 4px; border: 0; border-radius: 0; background: #f6f8fa; color: var(--ink); font-size: 14px; }
.analysis-modes button[aria-pressed="true"] { background: #087f91; color: white; font-weight: 600; }
.analysis-filters { display: flex; flex-wrap: wrap; align-items: center; }
.analysis-filters label { display: flex; align-items: center; margin: 0 12px 6px 0; color: var(--muted); font-size: 12px; }
.analysis-filters select { width: auto; min-height: 40px; margin-left: 6px; padding: 4px 6px; border: 1px solid var(--line); border-radius: 4px; background: white; color: var(--ink); font-size: 16px; }
.analysis-check input { width: 18px; height: 18px; margin-right: 5px; }
.analysis-scope { margin: 2px 0 8px; color: var(--muted); font-size: 12px; }
.analysis-focus { padding: 12px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.analysis-focus > span { font-size: 13px; }
.analysis-values { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: 8px; }
.analysis-values > div { min-width: 0; padding-right: 8px; }
.analysis-values span { display: block; font-size: 12px; color: var(--muted); }
.analysis-values strong { display: block; font-size: 22px; line-height: 1.5; font-weight: 600; }
.analysis-metrics { display: flex; }
.analysis-metrics button { min-width: 50px; min-height: 40px; padding: 4px 8px; background: transparent; border: 0; border-radius: 0; border-bottom: 2px solid transparent; color: var(--muted); font-size: 13px; }
.analysis-metrics button[aria-pressed="true"] { color: var(--ink); border-color: #087f91; font-weight: 600; }
.analysis-trend .monthly-plot { overflow-x: auto; height: 238px; -webkit-overflow-scrolling: touch; }
.analysis-trend .monthly-plot svg { max-width: none; }
[data-analysis-chart] { cursor: pointer; touch-action: manipulation; }
.analysis-table .analysis-label-col { width: 23%; }
.analysis-table th, .analysis-table td { padding-top: 9px; padding-bottom: 9px; }
.analysis-table button { display: block; min-height: 38px; width: 100%; padding: 0; border: 0; background: transparent; color: var(--ink); font-size: 13px; text-align: left; }
.analysis-table th small { display: block; font-size: 10px; line-height: 1.5; color: var(--muted); font-weight: 400; }
.analysis-delta, .analysis-rate { display: block; font-size: 11px; line-height: 1.5; color: var(--muted); overflow-wrap: anywhere; }
.analysis-delta { margin-top: 3px; }
.analysis-page button:focus-visible, .analysis-page select:focus-visible { outline: 2px solid #087f91; outline-offset: -2px; }
.monthly-income { color: var(--red); }
.monthly-expense { color: var(--green); }
.monthly-number { font-variant-numeric: tabular-nums; overflow-wrap: anywhere; word-break: break-word; }
.monthly-yearbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.monthly-yearbar label { display: flex; align-items: center; color: var(--muted); font-size: 12px; }
.monthly-yearbar select {
  width: auto;
  min-height: 40px;
  margin-left: 8px;
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--panel);
  color: var(--ink);
  font-size: 16px;
}
.monthly-yearbar > span { color: var(--muted); font-size: 12px; }
.monthly-totals { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 14px 0; }
.monthly-totals > div { min-width: 0; }
.monthly-totals > div:first-child { padding-right: 10px; }
.monthly-totals > div:last-child { padding-left: 10px; border-left: 1px solid var(--line); }
.monthly-totals span { display: block; margin-bottom: 5px; color: var(--muted); font-size: 12px; }
.monthly-totals strong { display: block; font-size: 22px; line-height: 1.4; font-weight: 600; }
.monthly-trend { padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.monthly-section-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; padding: 6px 0; }
.monthly-section-head h2 { font-size: 14px; margin: 0; line-height: 1.5; font-weight: 600; }
.monthly-section-head > span { color: var(--muted); font-size: 11px; }
.monthly-legend, .monthly-legend span { display: flex; align-items: center; }
.monthly-legend { color: var(--muted); font-size: 12px; }
.monthly-legend span + span { margin-left: 12px; }
.monthly-legend i { width: 8px; height: 8px; display: block; margin-right: 5px; }
.monthly-income-mark { background: var(--red); border-radius: 1px; }
.monthly-expense-mark { background: var(--green); }
.monthly-plot { width: 100%; height: 200px; }
.monthly-plot svg { display: block; width: 100%; height: 200px; }
.monthly-plot text { font-family: inherit; font-size: 11px; fill: var(--muted); pointer-events: none; }
.monthly-plot .monthly-chart-selected { fill: #087f91; font-weight: 700; }
.monthly-income-bar { fill: var(--red); }
.monthly-expense-bar { fill: var(--green); }
.monthly-chart-hit { cursor: pointer; touch-action: manipulation; }
.monthly-table-wrap { padding-top: 6px; }
.monthly-table { width: 100%; table-layout: fixed; border-collapse: collapse; }
.monthly-month-col { width: 19%; }
.monthly-table th, .monthly-table td {
  padding: 4px 5px;
  text-align: right;
  vertical-align: middle;
  border-bottom: 1px solid var(--line);
}
.monthly-table th:first-child { text-align: left; font-size: 13px; font-weight: 500; padding-left: 3px; }
.monthly-table thead th { font-size: 12px; font-weight: 400; color: var(--muted); padding-top: 7px; padding-bottom: 8px; }
.monthly-table td strong { display: block; font-weight: 500; font-size: 14px; line-height: 1.35; }
.monthly-change { display: block; font-size: 11px; line-height: 1.35; color: var(--muted); margin-top: 2px; overflow-wrap: anywhere; }
.monthly-month-button { display: block; width: 100%; min-height: 40px; padding: 0; background: transparent; border: 0; color: var(--ink); text-align: left; white-space: nowrap; }
.monthly-month-button small { display: block; font-size: 11px; color: #087f91; font-weight: 400; }
.monthly-month-button:focus-visible, .monthly-yearbar select:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.monthly-data-row td { cursor: pointer; touch-action: manipulation; }
.monthly-selected, .monthly-detail { background: #eaf8fa; }
.monthly-table .monthly-detail td { padding: 8px; text-align: left; }
.monthly-detail td > div { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; font-size: 12px; }
.monthly-detail .monthly-number { font-size: 14px; max-width: 100%; }
.monthly-unavailable { color: var(--muted); }
.monthly-table .monthly-unavailable th { height: 44px; }
.monthly-table .monthly-unavailable td { text-align: center; font-size: 12px; }
.monthly-table tfoot { background: var(--bg); }
.monthly-table tfoot td, .monthly-table tfoot th { padding-top: 12px; padding-bottom: 12px; border-bottom: 0; }
.monthly-scope { margin: 10px 0 0; color: var(--muted); font-size: 12px; line-height: 1.65; }
.monthly-warning { color: var(--amber); font-size: 12px; line-height: 1.65; margin: 8px 0 0; }

.history-entry { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; border-bottom: 1px solid var(--line); }
.history-entry > span { font-size: 11px; color: var(--muted); }
.history-link { background: none; border: 0; color: #087f91; padding: 8px 4px; min-height: 40px; font-size: 13px; }
.history-page, .history-list { min-width: 0; }
.history-record { display: block; width: 100%; text-align: left; background: none; padding: 12px 0; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; }
.history-record-meta { display: block; color: var(--muted); font-size: 12px; line-height: 1.5; overflow-wrap: anywhere; }
.history-record-body { display: flex; flex-wrap: wrap; align-items: start; justify-content: space-between; padding-top: 6px; }
.history-record-body > span { flex: 1 1 150px; min-width: 0; padding-right: 10px; font-size: 14px; color: var(--ink); overflow-wrap: anywhere; white-space: pre-wrap; }
.history-record-body > strong { font-size: 15px; font-weight: 500; max-width: 100%; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.history-adjustment { color: var(--muted); }
.archive-record-copy { min-width: 0; display: block; }
.archive-record-copy strong { overflow-wrap: anywhere; }
.archive-label { display: block; margin-top: 2px; color: var(--muted); font-size: 11px; font-weight: 400; line-height: 1.3; }
.archived-record .history-adjustment { color: var(--muted); }
.history-more { width: 100%; min-height: 44px; margin-top: 12px; }
.history-detail { margin: 0; }
.history-detail > div { padding: 8px 0; border-bottom: 1px solid var(--line); }
.history-detail dt { font-size: 12px; color: var(--muted); }
.history-detail dd { margin: 4px 0 0; font-size: 15px; overflow-wrap: anywhere; white-space: pre-wrap; }

@media (max-width: 360px) {
  .book-footer-actions .monthly-book-link { margin-left: 10px; }
  .book-footer-actions .book-link { font-size: 14px; }
  .phone.monthly-mode .screen { padding-left: 10px; padding-right: 10px; }
  .monthly-totals strong { font-size: 20px; }
  .monthly-table th, .monthly-table td { padding-right: 3px; padding-left: 3px; }
}

@supports not (height: 100dvh) {
  body,
  .phone {
    min-height: 100vh;
    height: 100vh;
  }

  @media (min-width: 600px) {
    .phone {
      height: calc(100vh - 32px);
      min-height: 0;
    }
  }
}
