:root {
  --bg: #f4f6f2;
  --surface: #ffffff;
  --surface-soft: #f8faf7;
  --ink: #17221d;
  --muted: #6e7b75;
  --line: #e3e9e4;
  --brand: #116b57;
  --brand-strong: #0b5243;
  --brand-soft: #e3f2ed;
  --lime: #b8df6a;
  --sale: #b83a3a;
  --sale-soft: #fcebed;
  --purchase: #116b57;
  --purchase-soft: #e3f2ed;
  --danger: #bd4545;
  --danger-soft: #fcebea;
  --shadow: 0 12px 34px rgba(25, 57, 46, .08);
  --radius-xl: 24px;
  --radius-lg: 18px;
  --radius-md: 14px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  font-family: "Microsoft YaHei", "PingFang SC", "Noto Sans CJK SC", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--ink);
  background: var(--bg);
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at 95% 3%, rgba(184, 223, 106, .12), transparent 20rem),
    var(--bg);
  color: var(--ink);
  -webkit-tap-highlight-color: transparent;
}

button,
input,
select,
textarea {
  color: inherit;
  font: inherit;
}

button,
select,
input[type="file"] {
  cursor: pointer;
}

button {
  border: 0;
}

button:disabled,
input:disabled,
select:disabled,
textarea:disabled {
  cursor: not-allowed;
  opacity: .58;
}

button,
a,
input,
select,
textarea {
  outline: none;
}

:focus-visible {
  outline: 3px solid rgba(17, 107, 87, .24);
  outline-offset: 2px;
}

h1,
h2,
h3,
p {
  margin: 0;
}

[hidden] {
  display: none !important;
}

.noscript {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 2rem;
  background: #fff;
}

.auth-screen {
  position: relative;
  display: grid;
  min-height: 100vh;
  min-height: 100dvh;
  place-items: center;
  overflow: hidden;
  padding: calc(2.5rem + var(--safe-top)) 1.25rem calc(2rem + var(--safe-bottom));
  background: #0d5b4a;
}

.auth-backdrop {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 82% 9%, rgba(205, 236, 137, .42) 0 3.5rem, transparent 3.6rem),
    radial-gradient(circle at -12% 88%, rgba(63, 151, 124, .5) 0 13rem, transparent 13.1rem),
    linear-gradient(145deg, rgba(3, 46, 37, .38), transparent 52%);
}

.auth-backdrop::before,
.auth-backdrop::after {
  position: absolute;
  content: "";
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 50%;
}

.auth-backdrop::before {
  top: -8rem;
  right: -10rem;
  width: 26rem;
  height: 26rem;
}

.auth-backdrop::after {
  bottom: 4rem;
  left: -5rem;
  width: 15rem;
  height: 15rem;
}

.login-shell {
  position: relative;
  z-index: 1;
  width: min(100%, 440px);
  padding: 2rem 1.5rem 1.4rem;
  border: 1px solid rgba(255, 255, 255, .38);
  border-radius: 30px;
  background: rgba(255, 255, 255, .96);
  box-shadow: 0 30px 80px rgba(2, 32, 26, .3);
}

.login-brand,
.mini-brand {
  display: grid;
  place-items: center;
  color: white;
  background: linear-gradient(145deg, #147660, #0a4c3e);
  box-shadow: 0 9px 20px rgba(17, 107, 87, .24);
  font-weight: 800;
}

.login-brand {
  width: 58px;
  height: 58px;
  margin-bottom: 1.5rem;
  border-radius: 18px 18px 18px 5px;
  font-size: 1.5rem;
}

.eyebrow {
  color: var(--brand);
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.login-shell h1 {
  margin-top: .65rem;
  font-size: clamp(1.85rem, 8vw, 2.35rem);
  line-height: 1.18;
  letter-spacing: -.04em;
}

.login-intro {
  max-width: 20rem;
  margin-top: .75rem;
  color: var(--muted);
  font-size: .92rem;
  line-height: 1.7;
}

.android-download-card {
  overflow: hidden;
  border: 1px solid rgba(17, 107, 87, .2);
  border-radius: var(--radius-lg);
  padding: .78rem;
  background: linear-gradient(135deg, #f1faf5 0%, #fbfdf8 68%, #eff7dc 100%);
  box-shadow: 0 8px 24px rgba(17, 107, 87, .08);
}

.login-download-card {
  margin-top: 1rem;
}

.android-download-main {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: .65rem;
}

.android-download-icon {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 12px;
  color: #fff;
  background: linear-gradient(145deg, #178064, var(--brand-strong));
  font-size: .78rem;
  font-weight: 850;
  box-shadow: 0 7px 16px rgba(17, 107, 87, .2);
}

.android-download-copy {
  min-width: 0;
  flex: 1 1 auto;
}

.android-download-copy h2 {
  font-size: .88rem;
  line-height: 1.35;
  letter-spacing: -.015em;
}

.android-download-copy p {
  margin-top: .18rem;
  color: var(--muted);
  font-size: .68rem;
  line-height: 1.4;
}

.android-download-button {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  border-radius: 11px;
  padding: .55rem .72rem;
  color: #fff;
  background: var(--brand);
  box-shadow: 0 7px 16px rgba(17, 107, 87, .17);
  font-size: .72rem;
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
  transition: transform .15s, box-shadow .2s;
}

.android-download-button:active {
  transform: scale(.98);
}

.android-install-help {
  margin-top: .58rem;
  border-top: 1px solid rgba(17, 107, 87, .12);
  padding-top: .55rem;
  color: #607269;
  font-size: .66rem;
  line-height: 1.55;
}

.login-download-card + .login-form {
  margin-top: 1.1rem;
}

.login-form {
  display: grid;
  gap: 1rem;
  margin-top: 1.8rem;
}

.field {
  display: grid;
  min-width: 0;
  gap: .45rem;
}

.field > span:first-child {
  color: #435049;
  font-size: .8rem;
  font-weight: 700;
}

.field b {
  color: var(--danger);
}

input,
select,
textarea {
  width: 100%;
  min-height: 48px;
  border: 1px solid #dce4de;
  border-radius: 12px;
  background: #fbfcfa;
  padding: .76rem .85rem;
  transition: border-color .2s, box-shadow .2s, background .2s;
}

input::placeholder,
textarea::placeholder {
  color: #a3aca7;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--brand);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(17, 107, 87, .08);
}

textarea {
  resize: vertical;
  line-height: 1.55;
}

.password-wrap {
  position: relative;
  display: block;
}

.password-wrap input {
  padding-right: 4rem;
}

.password-toggle {
  position: absolute;
  top: 50%;
  right: .7rem;
  transform: translateY(-50%);
}

.text-button,
.link-button {
  min-height: 40px;
  padding: .35rem .5rem;
  color: var(--brand);
  background: transparent;
  font-size: .8rem;
  font-weight: 750;
}

.primary-button,
.secondary-button,
.danger-button,
.outline-button {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  border-radius: 13px;
  padding: .75rem 1rem;
  font-weight: 800;
  transition: transform .15s, box-shadow .2s, opacity .2s;
}

.primary-button {
  color: #fff;
  background: linear-gradient(135deg, var(--brand), var(--brand-strong));
  box-shadow: 0 10px 24px rgba(17, 107, 87, .2);
}

.primary-button:active,
.secondary-button:active,
.danger-button:active,
.outline-button:active,
.quick-action:active {
  transform: scale(.98);
}

.login-button {
  justify-content: space-between;
  margin-top: .15rem;
  padding-inline: 1.15rem;
}

.login-footnote {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .45rem;
  margin-top: 1.35rem;
  color: #7c8882;
  font-size: .73rem;
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #50a95a;
  box-shadow: 0 0 0 4px rgba(80, 169, 90, .12);
}

.form-message {
  min-height: 1.15rem;
  color: var(--danger);
  font-size: .78rem;
  line-height: 1.45;
}

.form-message.success {
  color: var(--brand);
}

.form-message.centered {
  text-align: center;
}

.app-shell {
  min-height: 100vh;
  min-height: 100dvh;
}

.app-header {
  position: sticky;
  z-index: 20;
  top: 0;
  display: flex;
  width: 100%;
  height: calc(66px + var(--safe-top));
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(223, 230, 224, .82);
  padding: var(--safe-top) 1rem 0;
  background: rgba(248, 250, 247, .9);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.brand-button {
  display: flex;
  align-items: center;
  gap: .68rem;
  padding: .25rem;
  background: transparent;
  text-align: left;
}

.mini-brand {
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  border-radius: 11px 11px 11px 4px;
  font-size: .9rem;
}

.brand-button > span:last-child {
  display: grid;
  gap: .08rem;
}

.brand-button strong {
  font-size: .93rem;
  letter-spacing: .02em;
}

.brand-button small {
  color: var(--muted);
  font-size: .62rem;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: .5rem;
}

.header-download-button {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  gap: .28rem;
  border-radius: 13px;
  padding: .5rem .65rem;
  color: #fff;
  background: var(--brand);
  box-shadow: 0 6px 15px rgba(17, 107, 87, .18);
  font-size: .67rem;
  font-weight: 850;
  text-decoration: none;
  white-space: nowrap;
  transition: background .18s, transform .15s;
}

.header-download-button:hover {
  background: var(--brand-strong);
}

.header-download-button:active {
  transform: scale(.98);
}

.icon-button,
.avatar-button {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border-radius: 13px;
}

.icon-button {
  color: var(--brand);
  background: var(--brand-soft);
  font-size: 1.25rem;
  font-weight: 700;
}

.sync-button.loading span {
  animation: spin .75s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.avatar-button {
  color: #fff;
  background: linear-gradient(145deg, #d29353, #ad6531);
  font-size: .8rem;
  font-weight: 800;
}

.main-content {
  width: min(100%, 860px);
  min-height: calc(100vh - 66px);
  margin: 0 auto;
  padding: 1.25rem 1rem calc(148px + var(--safe-bottom));
}

.page {
  animation: page-in .24s ease-out;
}

@keyframes page-in {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}

.welcome-row,
.page-title-row,
.section-heading,
.chart-heading,
.dialog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.welcome-row h1,
.page-title-row h1,
.team-copy h1 {
  margin-top: .25rem;
  font-size: 1.58rem;
  line-height: 1.2;
  letter-spacing: -.035em;
}

.muted,
.page-title-row p:last-child,
.team-copy > p:last-child {
  color: var(--muted);
  font-size: .78rem;
}

.online-badge {
  display: flex;
  align-items: center;
  gap: .38rem;
  border: 1px solid #d7e7df;
  border-radius: 999px;
  padding: .4rem .62rem;
  color: #407665;
  background: #f3faf6;
  font-size: .67rem;
  white-space: nowrap;
}

.online-badge span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #5ab86a;
}

.hero-card {
  position: relative;
  overflow: hidden;
  margin-top: 1.2rem;
  border-radius: var(--radius-xl);
  padding: 1.3rem 1.25rem 1.2rem;
  color: #fff;
  background: linear-gradient(140deg, #14735e 0%, #0b5142 72%);
  box-shadow: 0 18px 38px rgba(11, 82, 67, .22);
}

.hero-card::before {
  position: absolute;
  top: -6.5rem;
  right: -5.5rem;
  width: 15rem;
  height: 15rem;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 50%;
  content: "";
}

.hero-topline {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: rgba(255, 255, 255, .76);
  font-size: .75rem;
}

.hero-pill {
  border-radius: 999px;
  padding: .34rem .58rem;
  color: #dcf4aa;
  background: rgba(255, 255, 255, .1);
  font-size: .65rem;
}

.hero-amount {
  position: relative;
  z-index: 1;
  margin-top: .7rem;
  font-family: ui-rounded, "SF Pro Rounded", "Microsoft YaHei", sans-serif;
  font-size: clamp(2.1rem, 11vw, 3.15rem);
  font-weight: 800;
  letter-spacing: -.055em;
}

.hero-metrics {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .5rem;
  margin-top: 1.25rem;
  border-top: 1px solid rgba(255, 255, 255, .15);
  padding-top: 1rem;
}

.hero-metrics div {
  display: grid;
  gap: .25rem;
}

.hero-metrics div + div {
  border-left: 1px solid rgba(255, 255, 255, .15);
  padding-left: 1rem;
}

.hero-metrics span {
  color: rgba(255, 255, 255, .65);
  font-size: .68rem;
}

.hero-metrics strong {
  font-size: 1rem;
}

.hero-decoration {
  position: absolute;
  top: 4rem;
  right: 1.2rem;
  width: 3.6rem;
  height: 3.6rem;
  border-radius: 1rem;
  background: linear-gradient(145deg, rgba(219, 246, 159, .25), rgba(255, 255, 255, .02));
  transform: rotate(22deg);
}

.quick-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .7rem;
  margin-top: .85rem;
}

.home-download-card {
  margin-top: .85rem;
}

.quick-action {
  display: flex;
  min-width: 0;
  min-height: 78px;
  align-items: center;
  gap: .7rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: .8rem;
  background: var(--surface);
  box-shadow: 0 7px 20px rgba(25, 57, 46, .045);
  text-align: left;
  transition: transform .15s, box-shadow .2s;
}

.quick-action:hover {
  box-shadow: var(--shadow);
}

.quick-icon,
.page-mark,
.upload-icon,
.security-icon {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  font-weight: 850;
}

.quick-icon {
  width: 40px;
  height: 40px;
  border-radius: 13px;
}

.quick-action.sale .quick-icon {
  color: var(--brand);
  background: var(--brand-soft);
}

.quick-action.purchase .quick-icon {
  color: var(--purchase);
  background: var(--purchase-soft);
}

.quick-action > span:last-child {
  display: grid;
  min-width: 0;
  gap: .18rem;
}

.quick-action strong {
  font-size: .88rem;
}

.quick-action small {
  overflow: hidden;
  color: var(--muted);
  font-size: .62rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.voice-draft-card {
  display: grid;
  gap: .8rem;
  margin-top: .85rem;
  border-color: #cfe2d8;
  padding: 1rem;
  background: linear-gradient(145deg, #fff, #f5fbf8);
}

.voice-draft-heading {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: .7rem;
}

.voice-draft-heading h2 {
  margin-top: .12rem;
  font-size: 1rem;
}

.voice-draft-icon {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 14px;
  color: #fff;
  background: linear-gradient(145deg, #17836a, #0b5948);
  font-size: .72rem;
  font-weight: 850;
  box-shadow: 0 8px 18px rgba(17, 107, 87, .18);
}

.voice-draft-badge {
  border-radius: 999px;
  padding: .32rem .55rem;
  color: var(--brand);
  background: var(--brand-soft);
  font-size: .62rem;
  font-weight: 800;
  white-space: nowrap;
}

.voice-draft-field textarea {
  min-height: 96px;
  background: #fff;
}

.voice-draft-help,
.voice-privacy-note {
  color: var(--muted);
  font-size: .68rem;
  line-height: 1.55;
}

.voice-draft-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .6rem;
}

.voice-draft-actions .secondary-button {
  min-height: 42px;
  padding: .55rem .8rem;
  font-size: .74rem;
}

.smart-draft-card {
  gap: 1rem;
  border-color: #bad8ca;
  box-shadow: 0 14px 36px rgba(17, 107, 87, .09);
}

.smart-draft-form {
  display: grid;
  gap: .9rem;
}

.smart-source-field textarea {
  min-height: 76px;
  color: var(--ink-soft);
  background: #f7faf8;
}

.voice-draft-badge.warning {
  color: #9d5a2f;
  background: #fff1e6;
}

.smart-draft-notices {
  display: grid;
  gap: .38rem;
  border: 1px solid #efd4b9;
  border-radius: 13px;
  padding: .7rem .75rem;
  background: #fff9f3;
}

.smart-draft-notices p {
  font-size: .69rem;
  line-height: 1.5;
}

.smart-draft-notices .missing {
  color: #a0443e;
  font-weight: 750;
}

.smart-draft-notices .warning {
  color: #805c3c;
}

.smart-draft-grid {
  align-items: end;
}

.smart-account-field {
  grid-column: 1 / -1;
}

.smart-voucher-panel,
.voice-voucher-panel {
  display: grid;
  gap: .7rem;
  border: 1px dashed #bfd2c8;
  border-radius: 15px;
  padding: .8rem;
  background: #f8fbf9;
}

.smart-voucher-heading,
.voice-voucher-panel > div:first-child {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: .7rem;
}

.smart-voucher-heading > div,
.voice-voucher-panel > div:first-child {
  display: grid;
  gap: .2rem;
}

.smart-voucher-heading strong,
.voice-voucher-panel strong {
  color: var(--ink-soft);
  font-size: .76rem;
}

.smart-voucher-heading small,
.voice-voucher-panel small,
.voice-voucher-status {
  color: var(--muted);
  font-size: .64rem;
  line-height: 1.5;
}

.smart-voucher-preview {
  display: grid;
  grid-template-columns: 62px minmax(0, 1fr);
  align-items: center;
  gap: .7rem;
  border-radius: 12px;
  padding: .55rem;
  background: #fff;
}

.smart-voucher-preview img {
  width: 62px;
  height: 62px;
  border-radius: 10px;
  object-fit: cover;
  background: #edf2ef;
}

.smart-voucher-preview span {
  display: grid;
  min-width: 0;
  gap: .2rem;
}

.smart-voucher-preview strong {
  overflow: hidden;
  color: var(--ink-soft);
  font-size: .72rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.smart-voucher-preview small {
  color: var(--muted);
  font-size: .62rem;
}

.smart-voucher-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .55rem;
}

.smart-file-button {
  position: relative;
  min-height: 42px;
  justify-content: center;
  padding: .55rem .65rem;
  font-size: .7rem;
  text-align: center;
}

.smart-file-button input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

.voice-voucher-status {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.smart-draft-message {
  margin: 0;
}

.smart-draft-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.smart-draft-actions .primary-button {
  grid-column: 1 / -1;
  min-height: 46px;
}

.content-section {
  margin-top: 1.65rem;
}

.section-heading {
  margin-bottom: .7rem;
}

.section-heading h2,
.chart-heading h2,
.form-card-title h2,
.security-card h2 {
  margin-top: .16rem;
  font-size: 1rem;
  letter-spacing: -.02em;
}

.card {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: 0 8px 25px rgba(26, 55, 46, .045);
}

.asset-summary {
  padding: 1rem;
}

.asset-total {
  display: inline-grid;
  gap: .2rem;
}

.asset-total span {
  color: var(--muted);
  font-size: .7rem;
}

.asset-total strong {
  font-size: 1.45rem;
  letter-spacing: -.04em;
}

.small-button {
  min-height: 36px;
  border-radius: 10px;
  padding: .45rem .7rem;
  color: var(--brand);
  background: var(--brand-soft);
  font-size: .72rem;
  font-weight: 800;
}

.asset-summary > .small-button {
  float: right;
}

.account-strip {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
  overflow: visible;
  margin: .9rem -.1rem -.1rem;
  padding: .1rem;
}

.account-chip {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  min-height: 58px;
  align-items: center;
  gap: .75rem;
  border-bottom: 1px solid #e4ebe6;
  padding: .7rem .25rem;
  background: transparent;
  text-align: left;
}

.account-chip:last-child {
  border-bottom: 0;
}

.account-chip-top {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: .5rem;
  min-width: 0;
  color: var(--ink);
  font-size: .78rem;
  font-weight: 750;
}

.account-type-mark {
  display: grid;
  width: 22px;
  height: 22px;
  place-items: center;
  border-radius: 7px;
  color: var(--brand);
  background: var(--brand-soft);
  font-size: .65rem;
  font-style: normal;
  font-weight: 800;
}

.account-chip strong {
  font-size: .95rem;
  white-space: nowrap;
}

.skeleton {
  overflow: hidden;
  border-radius: 12px;
  background: #eef1ee;
}

.skeleton::after {
  display: block;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .7), transparent);
  animation: shimmer 1.3s infinite;
  content: "";
  transform: translateX(-100%);
}

.account-skeleton {
  height: 79px;
}

@keyframes shimmer {
  to { transform: translateX(100%); }
}

.card-list {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
}

.transaction-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: .72rem;
  width: 100%;
  min-height: 70px;
  border-bottom: 1px solid #edf0ed;
  padding: .75rem;
  background: transparent;
  text-align: left;
  transition: background .18s, transform .15s;
}

.transaction-row:hover {
  background: #f8fbf8;
}

.transaction-row:active {
  transform: scale(.995);
}

.transaction-row:disabled {
  cursor: default;
}

.transaction-row:last-child {
  border-bottom: 0;
}

.transaction-mark {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 12px;
  font-size: .82rem;
  font-weight: 850;
}

.transaction-mark.sale {
  color: var(--sale);
  background: var(--sale-soft);
}

.transaction-mark.purchase {
  color: var(--purchase);
  background: var(--purchase-soft);
}

.transaction-copy,
.transaction-amount {
  display: grid;
  min-width: 0;
  gap: .2rem;
}

.transaction-copy strong {
  overflow: hidden;
  font-size: .92rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.transaction-copy small,
.transaction-amount small {
  color: var(--muted);
  font-size: .7rem;
}

.transaction-amount {
  justify-items: end;
}

.transaction-amount strong {
  font-size: .95rem;
}

.transaction-amount strong.sale {
  color: var(--sale);
}

.transaction-amount strong.purchase {
  color: var(--purchase);
}

.empty-state {
  display: grid;
  min-height: 150px;
  place-items: center;
  align-content: center;
  gap: .6rem;
  padding: 1.5rem;
  color: var(--muted);
  font-size: .8rem;
  text-align: center;
}

.empty-state.compact {
  min-height: 104px;
}

.empty-state > span {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 12px;
  color: var(--brand);
  background: var(--brand-soft);
  font-size: .75rem;
  font-weight: 800;
}

.page-title-row {
  align-items: flex-start;
  margin-bottom: 1.1rem;
}

.page-title-row p:last-child,
.team-copy > p:last-child {
  margin-top: .42rem;
  line-height: 1.5;
}

.page-mark {
  width: 52px;
  height: 52px;
  border-radius: 16px 16px 16px 5px;
}

.sale-mark {
  color: var(--sale);
  background: var(--sale-soft);
}

.purchase-mark {
  color: var(--purchase);
  background: var(--purchase-soft);
}

.entry-form {
  display: grid;
  gap: .8rem;
}

.form-card {
  padding: 1rem;
}

.form-card-title {
  display: flex;
  align-items: center;
  gap: .65rem;
  margin-bottom: 1rem;
}

.form-card-title.with-action {
  display: grid;
  grid-template-columns: auto 1fr auto;
}

.form-card-title p {
  margin-top: .18rem;
  color: var(--muted);
  font-size: .65rem;
}

.step-badge {
  display: grid;
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 10px;
  color: var(--brand);
  background: var(--brand-soft);
  font-size: .76rem;
  font-weight: 850;
}

.step-badge.purchase-step {
  color: var(--purchase);
  background: var(--purchase-soft);
}

.form-grid {
  display: grid;
  gap: .8rem;
}

.line-items {
  display: grid;
  gap: .75rem;
}

.line-item {
  border: 1px solid #e2e8e3;
  border-radius: 15px;
  padding: .85rem;
  background: #fafcfa;
}

.line-item-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: .7rem;
}

.item-index {
  color: var(--muted);
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .05em;
}

.remove-item {
  min-height: 32px;
  border-radius: 9px;
  padding: .3rem .5rem;
  color: var(--danger);
  background: var(--danger-soft);
  font-size: .68rem;
  font-weight: 750;
}

.item-numbers {
  display: grid;
  grid-template-columns: 1.25fr .8fr .75fr;
  gap: .55rem;
  margin-top: .65rem;
}

.item-numbers input {
  padding-inline: .6rem;
}

.item-amount {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: .5rem;
  margin-top: .65rem;
  color: var(--muted);
  font-size: .68rem;
}

.item-amount strong {
  color: var(--ink);
  font-size: .9rem;
}

.items-subtotal {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: .7rem;
  margin-top: .85rem;
  border-top: 1px dashed #dce4de;
  padding-top: .75rem;
  color: var(--muted);
  font-size: .75rem;
}

.items-subtotal strong {
  color: var(--ink);
  font-size: 1.05rem;
}

.settlement-summary {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  margin: .9rem 0;
  border-radius: 14px;
  padding: .85rem;
  color: var(--brand);
  background: var(--brand-soft);
}

.settlement-summary > span {
  font-size: .76rem;
  font-weight: 700;
}

.settlement-summary strong {
  font-size: 1.3rem;
  letter-spacing: -.03em;
}

.settlement-summary small {
  grid-column: 1 / -1;
  margin-top: .35rem;
  color: #628278;
  font-size: .63rem;
}

.settlement-summary.purchase-summary {
  color: #a45e2e;
  background: var(--purchase-soft);
}

.settlement-summary.purchase-summary small {
  color: #916d54;
}

.purchase-small {
  color: var(--purchase);
  background: var(--purchase-soft);
}

.upload-box {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: .7rem;
  margin-top: .8rem;
  border: 1px dashed #cbd7cf;
  border-radius: 14px;
  padding: .8rem;
  background: #fafcfa;
}

.upload-box input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.upload-icon {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  color: var(--brand);
  background: var(--brand-soft);
  font-size: .72rem;
}

.upload-icon.purchase-upload {
  color: var(--purchase);
  background: var(--purchase-soft);
}

.upload-box > span:nth-of-type(2) {
  display: grid;
  gap: .15rem;
}

.upload-box strong {
  font-size: .78rem;
}

.upload-box small,
.upload-status {
  color: var(--muted);
  font-size: .61rem;
}

.upload-status {
  max-width: 5.5rem;
  overflow: hidden;
  color: var(--brand);
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.submit-button {
  width: 100%;
  margin-top: .2rem;
}

.purchase-submit {
  background: linear-gradient(135deg, #c0763e, #98542b);
  box-shadow: 0 10px 24px rgba(174, 100, 48, .2);
}

.history-section {
  margin-top: 2rem;
}

.summary-title-row {
  align-items: center;
}

.outline-button {
  min-height: 42px;
  border: 1px solid #cdd9d1;
  color: var(--brand);
  background: #fff;
  font-size: .72rem;
  white-space: nowrap;
}

.period-tabs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: .32rem;
  border: 1px solid var(--line);
  border-radius: 15px;
  padding: .3rem;
  background: #fff;
}

.period-tabs button {
  min-height: 40px;
  border-radius: 11px;
  color: var(--muted);
  background: transparent;
  font-size: .78rem;
  font-weight: 750;
}

.period-tabs button[aria-selected="true"] {
  color: #fff;
  background: var(--brand);
  box-shadow: 0 5px 12px rgba(17, 107, 87, .18);
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: .7rem;
  margin-top: .8rem;
}

.stat-card {
  display: grid;
  gap: .4rem;
  min-height: 116px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 1rem;
  background: #fff;
}

.stat-card span {
  color: var(--muted);
  font-size: .72rem;
  font-weight: 700;
}

.stat-card strong {
  align-self: end;
  font-size: 1.25rem;
  letter-spacing: -.04em;
}

.stat-card small {
  color: var(--muted);
  font-size: .62rem;
}

.income-stat strong {
  color: var(--sale);
}

.expense-stat strong {
  color: var(--purchase);
}

.profit-stat {
  grid-column: 1 / -1;
  color: #fff;
  background: linear-gradient(140deg, #1a7561, #0d5244);
}

.profit-stat span,
.profit-stat small {
  color: rgba(255, 255, 255, .7);
}

.profit-stat strong {
  color: #fff;
}

.chart-card {
  margin-top: .8rem;
  padding: 1rem;
}

.chart-heading {
  align-items: flex-start;
}

.chart-heading p {
  margin-top: .25rem;
  color: var(--muted);
  font-size: .64rem;
}

.chart-legend {
  display: flex;
  align-items: center;
  gap: .35rem;
  color: var(--muted);
  font-size: .6rem;
  white-space: nowrap;
}

.income-dot,
.expense-dot {
  width: 7px;
  height: 7px;
  border-radius: 2px;
}

.income-dot {
  background: var(--sale);
}

.expense-dot {
  margin-left: .25rem;
  background: var(--purchase);
}

.bar-chart {
  display: flex;
  min-height: 210px;
  align-items: stretch;
  gap: .5rem;
  overflow-x: auto;
  margin-top: 1rem;
  border-bottom: 1px solid var(--line);
  padding: .5rem .2rem 0;
}

.chart-group {
  display: grid;
  min-width: 43px;
  flex: 1 0 43px;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: minmax(145px, 1fr) auto;
  align-items: end;
  gap: 3px;
}

.chart-bar {
  min-height: 3px;
  border-radius: 5px 5px 2px 2px;
  transition: height .35s ease-out;
}

.chart-bar.income {
  background: linear-gradient(to top, var(--sale), #d97575);
}

.chart-bar.expense {
  background: linear-gradient(to top, var(--purchase), #3fa082);
}

.chart-label {
  grid-column: 1 / -1;
  overflow: hidden;
  padding-top: .45rem;
  color: var(--muted);
  font-size: .57rem;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chart-empty {
  display: grid;
  width: 100%;
  place-items: center;
  color: var(--muted);
  font-size: .75rem;
}

.structure-content {
  display: grid;
  grid-template-columns: 118px 1fr;
  align-items: center;
  gap: 1rem;
  margin-top: 1rem;
}

.donut {
  display: grid;
  width: 112px;
  height: 112px;
  place-items: center;
  border-radius: 50%;
  background: conic-gradient(var(--sale) 0 50%, var(--purchase) 50% 100%);
}

.donut::before {
  grid-area: 1 / 1;
  width: 74px;
  height: 74px;
  border-radius: 50%;
  background: #fff;
  content: "";
}

.donut span {
  z-index: 1;
  display: grid;
  grid-area: 1 / 1;
  gap: .05rem;
  text-align: center;
}

.donut strong {
  font-size: 1rem;
}

.donut small {
  color: var(--muted);
  font-size: .55rem;
}

.structure-rows {
  display: grid;
  gap: .65rem;
}

.structure-rows > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  font-size: .7rem;
}

.structure-rows span {
  display: flex;
  align-items: center;
  gap: .4rem;
  color: var(--muted);
}

.income-swatch,
.expense-swatch {
  width: 8px;
  height: 8px;
  border-radius: 3px;
}

.income-swatch {
  background: var(--sale);
}

.expense-swatch {
  background: var(--purchase);
}

.structure-profit {
  border-top: 1px solid var(--line);
  padding-top: .65rem;
}

.structure-profit strong {
  color: var(--brand);
}

.team-hero {
  position: relative;
  display: grid;
  min-height: 178px;
  align-items: end;
  overflow: hidden;
  border-radius: var(--radius-xl);
  padding: 1.25rem;
  color: #fff;
  background: linear-gradient(140deg, #176d5b, #0b4d40);
  box-shadow: 0 15px 35px rgba(11, 82, 67, .18);
}

.team-copy {
  position: relative;
  z-index: 2;
  max-width: 72%;
}

.team-copy .eyebrow {
  color: #d9efa4;
}

.team-copy > p:last-child {
  color: rgba(255, 255, 255, .7);
}

.team-illustration {
  position: absolute;
  right: .8rem;
  bottom: .9rem;
  display: flex;
  align-items: flex-end;
}

.team-illustration span {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border: 3px solid #0e5a49;
  border-radius: 50%;
  color: var(--brand);
  background: #d7efa6;
  font-size: .72rem;
  font-weight: 850;
}

.team-illustration span + span {
  margin-left: -16px;
}

.team-illustration span:nth-child(2) {
  width: 58px;
  height: 58px;
  background: #fff;
}

.team-illustration span:nth-child(3) {
  background: #e5af78;
}

.team-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin-top: .8rem;
  padding: .9rem;
}

.team-stats div {
  display: grid;
  justify-items: center;
  gap: .25rem;
}

.team-stats div + div {
  border-left: 1px solid var(--line);
}

.team-stats span {
  color: var(--muted);
  font-size: .62rem;
}

.team-stats strong {
  color: var(--brand);
  font-size: 1.25rem;
}

.compact-button {
  min-height: 40px;
  padding: .55rem .7rem;
  font-size: .7rem;
}

.permission-note,
.role-help {
  border-radius: 12px;
  padding: .72rem .8rem;
  color: #6a776f;
  background: #eef3ef;
  font-size: .7rem;
  line-height: 1.55;
}

.member-list {
  overflow: hidden;
}

.member-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: .7rem;
  min-height: 68px;
  border-bottom: 1px solid #edf0ed;
  padding: .72rem;
}

.member-row:last-child {
  border-bottom: 0;
}

.member-avatar {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border-radius: 13px;
  color: var(--brand);
  background: var(--brand-soft);
  font-size: .76rem;
  font-weight: 850;
}

.member-copy {
  display: grid;
  min-width: 0;
  gap: .18rem;
}

.member-copy strong {
  overflow: hidden;
  font-size: .82rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.member-copy small {
  color: var(--muted);
  font-size: .62rem;
}

.role-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: .32rem .55rem;
  color: #64726a;
  background: #eef1ef;
  font-size: .6rem;
  font-weight: 800;
  white-space: nowrap;
}

.role-badge.admin {
  color: var(--brand);
  background: var(--brand-soft);
}

.role-badge.bookkeeper {
  color: #8a5700;
  background: #fff0c7;
}

.security-card {
  display: flex;
  align-items: flex-start;
  gap: .75rem;
  margin-top: .9rem;
  padding: 1rem;
}

.security-icon {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  color: var(--brand);
  background: var(--brand-soft);
  font-size: .72rem;
}

.security-card p {
  margin-top: .3rem;
  color: var(--muted);
  font-size: .68rem;
  line-height: 1.6;
}

.bottom-nav {
  position: fixed;
  z-index: 30;
  right: 0;
  bottom: 0;
  left: 0;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  height: calc(68px + var(--safe-bottom));
  align-items: start;
  border-top: 1px solid rgba(216, 224, 218, .92);
  padding: .4rem .35rem var(--safe-bottom);
  background: rgba(255, 255, 255, .94);
  box-shadow: 0 -10px 35px rgba(30, 58, 49, .07);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.voice-fab {
  position: fixed;
  z-index: 29;
  right: max(1rem, calc((100vw - 860px) / 2 + 1rem));
  bottom: calc(80px + var(--safe-bottom));
  display: flex;
  min-height: 52px;
  align-items: center;
  gap: .55rem;
  border: 1px solid rgba(255, 255, 255, .3);
  border-radius: 999px;
  padding: .55rem .9rem .55rem .72rem;
  color: #fff;
  background: linear-gradient(140deg, #168067, #0a5141);
  box-shadow: 0 14px 32px rgba(8, 69, 55, .3);
  transition: transform .16s, box-shadow .2s;
}

.voice-fab:active {
  transform: scale(.97);
}

.voice-fab strong {
  font-size: .76rem;
  white-space: nowrap;
}

.voice-fab-icon,
.voice-microphone {
  position: relative;
  display: block;
  width: 13px;
  height: 20px;
  border: 2px solid currentColor;
  border-radius: 8px;
}

.voice-fab-icon::before,
.voice-microphone::before {
  position: absolute;
  right: -6px;
  bottom: -6px;
  left: -6px;
  height: 10px;
  border: 2px solid currentColor;
  border-top: 0;
  border-radius: 0 0 12px 12px;
  content: "";
}

.voice-fab-icon::after,
.voice-microphone::after {
  position: absolute;
  bottom: -10px;
  left: 50%;
  width: 10px;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
  content: "";
  transform: translateX(-50%);
}

.voice-fab-icon {
  margin: 0 .22rem .15rem;
}

.nav-item {
  position: relative;
  display: grid;
  min-width: 0;
  min-height: 53px;
  place-items: center;
  align-content: center;
  gap: .15rem;
  border-radius: 13px;
  color: #89928d;
  background: transparent;
}

.nav-item > span {
  display: grid;
  width: 27px;
  height: 27px;
  place-items: center;
  border-radius: 9px;
  font-size: .69rem;
  font-weight: 850;
}

.nav-item strong {
  font-size: .58rem;
  font-weight: 750;
}

.nav-item.active {
  color: var(--brand);
}

.nav-item.active > span {
  background: var(--brand-soft);
}

.modal {
  width: min(calc(100% - 1.5rem), 520px);
  max-height: min(86vh, 760px);
  max-height: min(86dvh, 760px);
  overflow: hidden;
  border: 0;
  border-radius: 24px;
  padding: 0;
  background: #fff;
  box-shadow: 0 25px 90px rgba(5, 37, 30, .28);
}

.modal::backdrop {
  background: rgba(9, 32, 26, .58);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.voice-modal {
  width: min(calc(100% - 1.25rem), 480px);
}

.voice-dialog-content {
  gap: .75rem;
}

.voice-dialog-description {
  color: var(--muted);
  font-size: .76rem;
  line-height: 1.65;
}

.voice-recorder {
  position: relative;
  display: grid;
  min-height: 238px;
  place-items: center;
  align-content: center;
  gap: .9rem;
  overflow: hidden;
  border: 1px solid #d6e6de;
  border-radius: 20px;
  padding: 1rem;
  background:
    radial-gradient(circle at 50% 54%, rgba(184, 223, 106, .18), transparent 7rem),
    #f6faf7;
}

.voice-state-row {
  display: grid;
  width: 100%;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: .45rem;
}

.voice-state-row strong {
  color: #42514a;
  font-size: .77rem;
}

.voice-state-row time {
  min-width: 3.2rem;
  border-radius: 999px;
  padding: .3rem .55rem;
  color: var(--brand);
  background: #fff;
  font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
  font-size: .72rem;
  font-weight: 800;
  text-align: center;
}

.voice-state-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #8e9993;
  box-shadow: 0 0 0 4px rgba(142, 153, 147, .12);
}

.voice-recorder.recording .voice-state-dot {
  background: #d75252;
  box-shadow: 0 0 0 4px rgba(215, 82, 82, .14);
  animation: voice-pulse-dot 1.2s ease-in-out infinite;
}

.voice-recorder.processing .voice-state-dot {
  background: var(--brand);
  box-shadow: 0 0 0 4px rgba(17, 107, 87, .13);
}

.voice-record-button {
  position: relative;
  display: grid;
  width: 86px;
  height: 86px;
  place-items: center;
  border: 8px solid #e4f1eb;
  border-radius: 50%;
  color: #fff;
  background: linear-gradient(145deg, #178269, #0a5544);
  box-shadow: 0 14px 30px rgba(17, 107, 87, .24);
  transition: transform .16s, background .2s, border-color .2s;
}

.voice-record-button:active:not(:disabled) {
  transform: scale(.95);
}

.voice-record-button.recording {
  border-color: #fae0df;
  background: linear-gradient(145deg, #db5a59, #b93e3e);
  box-shadow: 0 14px 30px rgba(185, 62, 62, .24);
}

.voice-record-button.recording .voice-microphone {
  width: 23px;
  height: 23px;
  border: 0;
  border-radius: 6px;
  background: currentColor;
}

.voice-record-button.recording .voice-microphone::before,
.voice-record-button.recording .voice-microphone::after,
.voice-record-button.processing .voice-microphone::before,
.voice-record-button.processing .voice-microphone::after {
  display: none;
}

.voice-record-button.processing .voice-microphone {
  width: 26px;
  height: 26px;
  border: 3px solid rgba(255, 255, 255, .38);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .7s linear infinite;
}

.voice-recorder-help {
  color: var(--muted);
  font-size: .7rem;
  text-align: center;
}

.voice-level {
  display: flex;
  height: 18px;
  align-items: center;
  gap: 4px;
  opacity: 0;
}

.voice-level i {
  width: 3px;
  height: 5px;
  border-radius: 99px;
  background: #d05a56;
}

.voice-recorder.recording .voice-level {
  opacity: 1;
}

.voice-recorder.recording .voice-level i {
  animation: voice-level .85s ease-in-out infinite alternate;
}

.voice-recorder.recording .voice-level i:nth-child(2),
.voice-recorder.recording .voice-level i:nth-child(5) {
  animation-delay: -.4s;
}

.voice-recorder.recording .voice-level i:nth-child(3) {
  animation-delay: -.7s;
}

.voice-message {
  min-height: 0;
}

.voice-message:empty {
  display: none;
}

.voice-result-field > span:first-child {
  display: flex;
  justify-content: space-between;
  gap: .5rem;
}

.voice-result-field small {
  color: var(--muted);
  font-size: .65rem;
  font-weight: 500;
}

.voice-result-field textarea {
  min-height: 118px;
}

.voice-result-field textarea[readonly] {
  background: rgba(244, 248, 246, .92);
  color: var(--ink-soft);
  cursor: default;
}

.voice-dialog-actions {
  display: flex;
  gap: .65rem;
}

.voice-dialog-actions > * {
  min-width: 0;
  flex: 1;
}

.voice-dialog-actions .primary-button {
  flex: 1.35;
}

.voice-privacy-note {
  text-align: center;
}

@keyframes voice-pulse-dot {
  50% { box-shadow: 0 0 0 8px rgba(215, 82, 82, 0); }
}

@keyframes voice-level {
  to { height: 17px; }
}

.dialog-header {
  border-bottom: 1px solid var(--line);
  padding: 1rem 1.1rem;
}

.dialog-header h2 {
  margin-top: .15rem;
  font-size: 1.2rem;
}

.close-button {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border-radius: 12px;
  color: var(--muted);
  background: #f1f4f1;
  font-size: 1.4rem;
}

.dialog-content {
  display: grid;
  gap: .85rem;
  max-height: calc(86dvh - 72px);
  overflow-y: auto;
  padding: 1rem 1.1rem 1.2rem;
}

.dialog-list {
  display: grid;
  gap: .55rem;
}

.dialog-account {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: .65rem;
  border: 1px solid var(--line);
  border-radius: 13px;
  padding: .7rem;
}

.dialog-account.inactive {
  border-style: dashed;
  background: #f6f7f6;
  opacity: .72;
}

.dialog-account > span:first-child {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 11px;
  color: var(--brand);
  background: var(--brand-soft);
  font-size: .7rem;
  font-weight: 800;
}

.dialog-account div {
  display: grid;
  gap: .12rem;
}

.dialog-account div strong {
  font-size: .78rem;
}

.dialog-account div small {
  color: var(--muted);
  font-size: .62rem;
}

.dialog-account-balance {
  display: grid;
  justify-items: end;
  gap: .12rem;
}

.dialog-account-balance strong {
  font-size: .82rem;
}

.dialog-account-balance small {
  color: var(--muted);
  font-size: .56rem;
}

.account-manage-actions {
  display: flex;
  grid-column: 1 / -1;
  justify-content: flex-end;
  gap: .35rem;
  border-top: 1px solid var(--line);
  padding-top: .45rem;
}

.danger-text {
  color: var(--danger);
}

.inline-form-heading,
.edit-form-heading,
.edit-items-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
}

.inline-form {
  display: grid;
  gap: .75rem;
  margin-top: .25rem;
  border-top: 1px solid var(--line);
  padding-top: 1rem;
}

.inline-form h3 {
  font-size: .9rem;
}

.transaction-modal {
  width: min(calc(100% - 1rem), 620px);
}

.transaction-dialog-content {
  gap: 1rem;
}

.detail-loading {
  display: grid;
  gap: .75rem;
  padding: .6rem 0;
}

.detail-skeleton {
  width: 100%;
  height: 148px;
}

.detail-skeleton.short {
  height: 82px;
}

.detail-hero {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: .8rem;
  border-radius: 18px;
  padding: 1rem;
  color: var(--brand);
  background: var(--brand-soft);
}

.detail-hero.purchase {
  color: var(--purchase);
  background: var(--purchase-soft);
}

.detail-hero > div {
  display: grid;
  min-width: 0;
  gap: .12rem;
}

.detail-hero small {
  color: currentColor;
  font-size: .62rem;
  opacity: .72;
}

.detail-hero > div > strong {
  font-size: 1.35rem;
  letter-spacing: -.04em;
}

.detail-hero p {
  overflow: hidden;
  color: var(--ink);
  font-size: .75rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.detail-status {
  border-radius: 999px;
  padding: .36rem .56rem;
  color: currentColor;
  background: rgba(255, 255, 255, .7);
  font-size: .59rem;
  font-weight: 800;
  white-space: nowrap;
}

.detail-section {
  display: grid;
  gap: .55rem;
}

.detail-section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.detail-section-heading h3,
.edit-form-heading h3 {
  font-size: .9rem;
}

.detail-section-heading span {
  color: var(--muted);
  font-size: .62rem;
}

.detail-item-list {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-soft);
}

.detail-item-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  border-bottom: 1px solid var(--line);
  padding: .72rem;
}

.detail-item-row:last-child {
  border-bottom: 0;
}

.detail-item-row > span {
  display: grid;
  min-width: 0;
  gap: .16rem;
}

.detail-item-row strong {
  font-size: .76rem;
}

.detail-item-row > span strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.detail-item-row small {
  color: var(--muted);
  font-size: .58rem;
}

.detail-money-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: .5rem;
}

.detail-money-grid > div {
  display: grid;
  gap: .22rem;
  border-radius: 12px;
  padding: .72rem;
  background: #f3f6f3;
}

.detail-money-grid span,
.detail-meta span,
.detail-note > span {
  color: var(--muted);
  font-size: .6rem;
}

.detail-money-grid strong {
  font-size: .8rem;
}

.detail-meta {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0;
  overflow: hidden;
}

.detail-meta > div {
  display: grid;
  gap: .2rem;
  border-bottom: 1px solid var(--line);
  padding: .72rem;
}

.detail-meta > div:nth-last-child(-n+2) {
  border-bottom: 0;
}

.detail-meta > div:nth-child(even) {
  border-left: 1px solid var(--line);
}

.detail-meta strong {
  overflow: hidden;
  font-size: .7rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.detail-note {
  display: grid;
  gap: .35rem;
  border-radius: 13px;
  padding: .75rem;
  background: #faf6ee;
}

.detail-note p {
  color: #66594d;
  font-size: .7rem;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
}

.detail-voucher {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: .7rem;
  border: 1px dashed #cbd7cf;
  border-radius: 14px;
  padding: .8rem;
  background: #fafcfa;
}

.detail-voucher > div {
  display: grid;
  min-width: 0;
  gap: .15rem;
}

.detail-voucher strong {
  font-size: .75rem;
}

.detail-voucher small {
  overflow: hidden;
  color: var(--muted);
  font-size: .58rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.detail-voucher .outline-button {
  min-height: 38px;
  text-decoration: none;
}

.detail-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .55rem;
  border-top: 1px solid var(--line);
  padding-top: .9rem;
}

.detail-actions .danger-button {
  grid-column: 1 / -1;
}

.voucher-upload-button {
  position: relative;
}

.voucher-upload-button input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.detail-edit-form {
  display: grid;
  gap: .85rem;
}

.edit-form-heading {
  border-bottom: 1px solid var(--line);
  padding-bottom: .7rem;
}

.edit-items-heading strong {
  font-size: .76rem;
}

.switch-row {
  display: flex;
  min-height: 58px;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  border: 1px solid var(--line);
  border-radius: 13px;
  padding: .72rem;
  background: var(--surface-soft);
}

.switch-row > span {
  display: grid;
  gap: .15rem;
}

.switch-row strong {
  font-size: .75rem;
}

.switch-row small {
  color: var(--muted);
  font-size: .58rem;
}

.switch-row input {
  width: 46px;
  min-height: 24px;
  accent-color: var(--brand);
}

.member-row {
  width: 100%;
  background: #fff;
  text-align: left;
}

.member-row.inactive {
  opacity: .62;
}

button.member-row:hover {
  background: #f8fbf8;
}

.member-row-end {
  display: grid;
  justify-items: end;
  gap: .18rem;
}

.member-row-end > small {
  color: var(--brand);
  font-size: .56rem;
  font-weight: 700;
}

.profile-modal {
  width: min(calc(100% - 2rem), 380px);
  padding: 1.25rem;
}

.profile-card {
  display: flex;
  align-items: center;
  gap: .8rem;
  margin-bottom: 1.1rem;
}

.profile-avatar {
  display: grid;
  width: 54px;
  height: 54px;
  place-items: center;
  border-radius: 17px;
  color: #fff;
  background: linear-gradient(145deg, #d29353, #ad6531);
  font-size: 1rem;
  font-weight: 800;
}

.profile-card h2 {
  font-size: 1rem;
}

.profile-card p {
  margin: .18rem 0 .28rem;
  color: var(--muted);
  font-size: .75rem;
}

.profile-modal > button:not(.dialog-dismiss) {
  width: 100%;
  margin-top: .55rem;
}

.secondary-button {
  color: var(--brand);
  background: var(--brand-soft);
}

.danger-button {
  color: var(--danger);
  background: var(--danger-soft);
}

.dialog-dismiss {
  width: 100%;
  margin-top: .45rem;
}

.toast {
  position: fixed;
  z-index: 100;
  top: calc(76px + var(--safe-top));
  left: 50%;
  max-width: min(calc(100% - 2rem), 420px);
  pointer-events: none;
  border-radius: 12px;
  padding: .72rem 1rem;
  color: #fff;
  background: rgba(20, 43, 35, .94);
  box-shadow: 0 12px 30px rgba(6, 31, 24, .24);
  font-size: .76rem;
  opacity: 0;
  transform: translate(-50%, -12px);
  transition: opacity .2s, transform .2s;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

.toast.error {
  background: rgba(157, 54, 54, .96);
}

@media (min-width: 560px) {
  .main-content {
    padding-inline: 1.35rem;
  }

  .two-col {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .three-col {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .stat-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .profit-stat {
    grid-column: auto;
  }

  .hero-card {
    padding: 1.5rem;
  }

  .hero-metrics {
    max-width: 360px;
  }
}

@media (min-width: 900px) {
  .app-header {
    padding-inline: max(1.5rem, calc((100% - 860px) / 2));
  }

  .main-content {
    padding-top: 1.7rem;
    padding-bottom: 3rem;
  }

  .bottom-nav {
    position: sticky;
    bottom: auto;
    width: min(100% - 2rem, 560px);
    height: 68px;
    margin: 0 auto 1.25rem;
    border: 1px solid var(--line);
    border-radius: 22px;
    padding-bottom: .4rem;
    box-shadow: 0 12px 35px rgba(30, 58, 49, .1);
  }

  .voice-fab {
    right: max(1.5rem, calc((100vw - 860px) / 2));
    bottom: 1.5rem;
  }

  .page[data-page="home"] .quick-actions {
    gap: 1rem;
  }

  .form-card {
    padding: 1.25rem;
  }

  .item-numbers {
    grid-template-columns: 1.2fr 1fr 1fr;
  }
}

@media (max-width: 370px) {
  .app-header {
    padding-inline: .7rem;
  }

  .brand-button {
    gap: .5rem;
  }

  .brand-button small,
  .header-download-verb {
    display: none;
  }

  .header-actions {
    gap: .35rem;
  }

  .header-download-button {
    width: 42px;
    padding-inline: 0;
  }

  .header-download-button > span {
    display: none;
  }

  .main-content {
    padding-inline: .75rem;
  }

  .quick-action {
    gap: .48rem;
    padding: .65rem;
  }

  .quick-icon {
    width: 36px;
    height: 36px;
  }

  .android-download-card {
    padding: .7rem;
  }

  .android-download-main {
    gap: .5rem;
  }

  .android-download-icon {
    width: 34px;
    height: 34px;
  }

  .android-download-copy h2 {
    font-size: .78rem;
  }

  .android-download-button {
    min-height: 36px;
    padding-inline: .55rem;
    font-size: .68rem;
  }

  .quick-action small {
    display: none;
  }

  .voice-fab {
    width: 52px;
    justify-content: center;
    padding: .55rem;
  }

  .voice-fab strong {
    display: none;
  }

  .hero-card {
    padding-inline: 1rem;
  }

  .item-numbers {
    grid-template-columns: 1fr 1fr;
  }

  .item-numbers .field:last-child {
    grid-column: 1 / -1;
  }

  .structure-content {
    grid-template-columns: 98px 1fr;
    gap: .6rem;
  }

  .donut {
    width: 94px;
    height: 94px;
  }

  .donut::before {
    width: 62px;
    height: 62px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}

@media print {
  .app-header,
  .bottom-nav,
  .outline-button,
  .quick-actions,
  .android-download-card,
  .history-section .link-button {
    display: none !important;
  }

  .main-content {
    padding: 0;
  }

  body {
    background: #fff;
  }

  .page {
    display: none;
  }

  #page-summary {
    display: block !important;
  }
}

/*
 * Requirement 6 feature compatibility.
 * New controls deliberately reuse the original green visual language and spacing.
 */
.welcome-actions {
  display: grid;
  justify-items: end;
  gap: .4rem;
}

.home-date-picker {
  display: flex;
  min-height: 34px;
  align-items: center;
  gap: .38rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: .2rem .28rem .2rem .62rem;
  color: var(--muted);
  background: rgba(255, 255, 255, .88);
  font-size: .62rem;
  font-weight: 700;
}

.home-date-picker input {
  width: 7.8rem;
  min-width: 0;
  min-height: 28px;
  border: 0;
  border-radius: 999px;
  padding: .22rem .38rem;
  color: var(--brand-strong);
  background: var(--surface-soft);
  font-size: .65rem;
}

.summary-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: .45rem;
}

.account-chip {
  width: 100%;
  color: inherit;
  text-align: left;
  transition: border-color .18s, box-shadow .18s, transform .15s;
}

.account-chip:hover {
  border-color: #b9d6cc;
  box-shadow: 0 8px 20px rgba(17, 107, 87, .08);
}

.account-chip:active {
  transform: scale(.99);
}

.transaction-day-group + .transaction-day-group {
  border-top: 8px solid var(--bg);
}

.transaction-day-heading {
  display: grid;
  grid-template-columns: minmax(4.5rem, 1fr) repeat(3, auto);
  align-items: center;
  gap: .55rem;
  min-height: 48px;
  border-bottom: 1px solid var(--line);
  padding: .62rem .75rem;
  background: #f3f8f5;
}

.transaction-day-heading > strong {
  font-size: .86rem;
}

.transaction-day-total {
  display: grid;
  gap: .08rem;
  justify-items: end;
  color: var(--muted);
  font-size: .62rem;
}

.transaction-day-total strong {
  font-size: .76rem;
}

.transaction-day-total.income strong {
  color: var(--sale);
}

.transaction-day-total.expense strong {
  color: var(--purchase);
}

.transaction-day-total.balance strong {
  color: var(--brand-strong);
}

.transaction-day-more {
  border-top: 1px dashed var(--line);
  padding: .55rem .75rem;
  color: var(--muted);
  background: #fbfdfb;
  font-size: .6rem;
  text-align: center;
}

.custom-range-card {
  display: grid;
  gap: .75rem;
  margin-top: .8rem;
  padding: .9rem;
}

.custom-range-card > div:first-child {
  display: grid;
  gap: .18rem;
}

.custom-range-card > div:first-child strong {
  font-size: .82rem;
}

.custom-range-card > div:first-child small {
  color: var(--muted);
  font-size: .64rem;
  line-height: 1.45;
}

.account-activity-summary {
  display: grid;
  gap: .25rem;
  padding: 1rem;
  background: linear-gradient(145deg, #eef8f3, #deefe8);
}

.account-activity-summary span,
.account-activity-summary small {
  color: var(--muted);
  font-size: .65rem;
}

.account-activity-summary strong {
  color: var(--brand-strong);
  font-size: 1.65rem;
}

.account-activity-range {
  display: grid;
  gap: .65rem;
}

.account-activity-list {
  min-height: 120px;
}

.account-activity-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: .75rem;
  width: 100%;
  min-height: 64px;
  align-items: center;
  border-bottom: 1px solid var(--line);
  padding: .7rem .75rem;
  color: inherit;
  background: #fff;
  text-align: left;
}

.account-activity-row:last-child {
  border-bottom: 0;
}

.account-activity-row > span {
  display: grid;
  min-width: 0;
  gap: .18rem;
}

.account-activity-row small {
  overflow: hidden;
  color: var(--muted);
  font-size: .7rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-activity-amount {
  justify-items: end;
}

.account-activity-row > span > strong {
  font-size: .9rem;
}

.account-activity-amount strong {
  font-size: .95rem;
}

.account-activity-amount strong.income {
  color: var(--sale);
}

.account-activity-amount strong.expense {
  color: var(--purchase);
}

.petty-cash-mark {
  color: var(--brand);
  background: var(--brand-soft);
}

.petty-cash-entry-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: .75rem;
  width: 100%;
  margin-top: 1rem;
  padding: .9rem 1rem;
  align-items: center;
  color: inherit;
  text-align: left;
  transition: border-color .18s, box-shadow .18s, transform .15s;
}

.petty-cash-entry-card:hover {
  border-color: #b9d6cc;
  box-shadow: 0 10px 24px rgba(17, 107, 87, .08);
}

.petty-cash-entry-card:active {
  transform: scale(.99);
}

.petty-cash-entry-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 14px;
  color: var(--brand);
  background: var(--brand-soft);
  font-weight: 900;
}

.petty-cash-entry-copy {
  display: grid;
  min-width: 0;
  gap: .22rem;
}

.petty-cash-entry-copy strong {
  font-size: .92rem;
}

.petty-cash-entry-copy small {
  color: var(--muted);
  font-size: .64rem;
  line-height: 1.45;
}

.petty-cash-entry-arrow {
  color: var(--brand);
  font-size: .7rem;
  font-weight: 800;
  white-space: nowrap;
}

.petty-balance-card {
  display: grid;
  gap: .32rem;
  padding: 1.15rem;
  background: linear-gradient(145deg, #edf8f3, #dbeee6);
}

.petty-balance-card span,
.petty-balance-card small {
  color: var(--muted);
  font-size: .68rem;
}

.petty-balance-card strong {
  color: var(--brand-strong);
  font-size: 2rem;
  letter-spacing: -.04em;
}

.petty-balance-card strong.negative {
  color: var(--purchase);
}

.petty-ledger-scope-note {
  margin-top: .5rem;
  border-left: 3px solid #7fb8a6;
  padding: .35rem .6rem;
  color: var(--muted);
  font-size: .62rem;
  line-height: 1.55;
}

.petty-candidate-panel {
  margin-top: .8rem;
  border-color: #f0cf92;
  padding: .9rem;
  background: #fffaf0;
}

.petty-candidate-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
}

.petty-candidate-heading > div {
  display: grid;
  gap: .2rem;
}

.petty-candidate-actions {
  display: flex;
  align-items: center;
  gap: .35rem;
}

.petty-candidate-heading strong {
  color: #855d12;
  font-size: .8rem;
}

.petty-candidate-heading small {
  color: #8e7850;
  font-size: .62rem;
  line-height: 1.4;
}

.petty-candidate-list {
  display: grid;
  gap: .45rem;
  margin-top: .75rem;
}

.petty-candidate-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: .6rem;
  border: 1px solid #f1dfbb;
  border-radius: 11px;
  padding: .62rem;
  background: rgba(255, 255, 255, .76);
}

.petty-candidate-row > span {
  display: grid;
  min-width: 0;
  gap: .12rem;
}

.petty-candidate-row small {
  overflow: hidden;
  color: #8e7850;
  font-size: .58rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.petty-candidate-row > strong {
  color: var(--sale);
  font-size: .76rem;
}

.petty-period-toolbar {
  display: grid;
  gap: .7rem;
  margin-top: .8rem;
  padding: .75rem;
}

.petty-period-tabs {
  grid-template-columns: repeat(3, 1fr);
  border: 0;
  padding: 0;
}

.petty-stat-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.petty-stat-card {
  width: 100%;
  color: var(--ink);
  text-align: left;
  transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease;
}

.petty-stat-card:hover {
  border-color: #b9d6cc;
  box-shadow: 0 8px 22px rgba(17, 107, 87, .08);
}

.petty-stat-card:active {
  transform: translateY(1px);
}

.petty-refresh-button {
  justify-self: end;
}

.compact-date-field {
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
}

.compact-date-field > span {
  margin: 0;
}

.petty-entry-panel {
  overflow: hidden;
  margin-top: .8rem;
}

.petty-entry-panel > summary {
  cursor: pointer;
  padding: 1rem;
  color: var(--brand-strong);
  font-size: .8rem;
  font-weight: 800;
}

.petty-entry-form {
  display: grid;
  gap: .75rem;
  border-top: 1px solid var(--line);
  padding: 1rem;
}

.petty-entry-form-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
}

.petty-entry-form-heading strong {
  color: var(--text);
  font-size: .78rem;
}

.petty-voucher-panel {
  display: grid;
  gap: .65rem;
  border: 1px dashed #b9d6cc;
  border-radius: 14px;
  padding: .8rem;
  background: #f8fbf9;
}

.petty-voucher-panel[hidden] {
  display: none;
}

.petty-voucher-panel > div:first-child {
  display: grid;
  gap: .18rem;
}

.petty-voucher-panel > div:first-child strong {
  font-size: .75rem;
}

.petty-voucher-panel > div:first-child small,
.petty-voucher-preview small {
  color: var(--muted);
  font-size: .6rem;
  line-height: 1.45;
}

.petty-voucher-preview {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr) auto;
  align-items: center;
  gap: .6rem;
  border-radius: 11px;
  padding: .5rem;
  background: #fff;
}

.petty-voucher-preview[hidden] {
  display: none;
}

.petty-voucher-preview img {
  width: 54px;
  height: 54px;
  border-radius: 9px;
  object-fit: cover;
}

.petty-voucher-preview > span {
  display: grid;
  min-width: 0;
  gap: .12rem;
}

.petty-voucher-preview > span strong {
  overflow: hidden;
  font-size: .68rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.petty-balance-warning {
  margin: -.2rem 0 0;
  color: var(--purchase);
  font-size: .62rem;
  line-height: 1.5;
}

.petty-balance-preview {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: .65rem;
  border: 1px solid #cfe3dc;
  border-radius: 14px;
  padding: .72rem;
  background: var(--brand-soft);
}

.petty-balance-preview > span {
  display: grid;
  gap: .15rem;
}

.petty-balance-preview > span:last-child {
  justify-items: end;
}

.petty-balance-preview small {
  color: var(--muted);
  font-size: .6rem;
}

.petty-balance-preview strong {
  color: var(--brand-strong);
  font-size: .88rem;
}

.petty-balance-preview strong.negative {
  color: var(--purchase);
}

.petty-balance-preview > b {
  color: var(--brand);
  font-size: .9rem;
}

.petty-ledger-heading {
  align-items: flex-end;
}

.segmented-filter {
  display: flex;
  gap: .2rem;
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: .2rem;
  background: #fff;
}

.segmented-filter button {
  min-height: 32px;
  border-radius: 8px;
  padding: .35rem .55rem;
  color: var(--muted);
  background: transparent;
  font-size: .65rem;
  font-weight: 750;
}

.segmented-filter button.active {
  color: var(--brand-strong);
  background: var(--brand-soft);
}

.petty-entry-row {
  display: grid;
  width: 100%;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: .65rem;
  min-height: 68px;
  border-bottom: 1px solid var(--line);
  padding: .72rem;
  color: var(--ink);
  background: #fff;
  text-align: left;
  transition: background .16s ease;
}

.petty-entry-row:hover {
  background: #f8fbf9;
}

.petty-entry-row:active {
  background: var(--brand-soft);
}

.petty-entry-row:last-child {
  border-bottom: 0;
}

.petty-entry-row > span:nth-child(2),
.petty-entry-row > span:last-child {
  display: grid;
  min-width: 0;
  gap: .18rem;
}

.petty-entry-row small {
  color: var(--muted);
  font-size: .62rem;
  line-height: 1.4;
}

.petty-entry-row.voided {
  opacity: .62;
}

.petty-entry-row.voided > span:nth-child(2) > strong {
  text-decoration: line-through;
}

.petty-audit-list {
  display: grid;
}

.petty-audit-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: .65rem;
  border-bottom: 1px solid var(--line);
  padding: .7rem 0;
}

.petty-audit-row:last-child {
  border-bottom: 0;
}

.petty-audit-row > span:last-child {
  display: grid;
  gap: .15rem;
}

.petty-audit-row small {
  color: var(--muted);
  font-size: .62rem;
}

.petty-type-filter {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.petty-entry-row > span:last-child {
  justify-items: end;
}

.petty-entry-row.income > span:last-child strong {
  color: var(--sale);
}

.petty-entry-row.purchase > span:last-child strong {
  color: var(--purchase);
}

.petty-recent-section {
  padding-bottom: .4rem;
}

.petty-recent-note {
  margin: -.25rem 0 .55rem;
  color: var(--muted);
  font-size: .62rem;
  line-height: 1.5;
}

.petty-cash-detail-view {
  display: grid;
  gap: 1rem;
}

.petty-detail-audit-button {
  width: 100%;
}

.petty-detail-actions .voucher-upload-button {
  min-width: 0;
}

.petty-detail-actions .voucher-upload-button span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-sound-row {
  margin-bottom: .55rem;
  border: 1px solid var(--line);
  border-radius: 13px;
  padding: .7rem;
  background: var(--surface-soft);
}

input[type="date"] {
  min-width: 0;
}

@media (min-width: 560px) {
  .custom-range-card {
    grid-template-columns: minmax(150px, 1fr) repeat(2, minmax(135px, .8fr)) auto;
    align-items: end;
  }

  .account-activity-range {
    grid-template-columns: repeat(2, minmax(0, 1fr)) auto;
    align-items: end;
  }

  .petty-period-toolbar {
    grid-template-columns: minmax(240px, 1fr) minmax(180px, .7fr) auto;
    align-items: end;
  }
}

@media (max-width: 480px) {
  .header-download-verb,
  .header-download-button > span {
    display: none;
  }

  .header-download-button {
    width: 42px;
    padding-inline: 0;
  }

  .welcome-row {
    align-items: flex-start;
  }

  .welcome-actions {
    max-width: 8.9rem;
  }

  .home-date-picker {
    display: grid;
    width: 100%;
    gap: .12rem;
    border-radius: 14px;
    padding: .38rem .45rem;
  }

  .home-date-picker input {
    width: 100%;
  }

  .summary-title-row {
    align-items: flex-start;
  }

  .summary-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .transaction-day-heading {
    grid-template-columns: minmax(2.8rem, 1fr) repeat(3, minmax(0, auto));
    gap: .25rem;
    padding-inline: .55rem;
  }

  .transaction-day-total strong {
    font-size: .72rem;
  }
}

.stat-card[role="button"] { cursor: pointer; }
.entry-memory-options { display: grid; gap: 4px; max-height: 180px; overflow: auto; padding: 6px; background: #fff; border: 1px solid #c8ded6; border-radius: 10px; }
.entry-memory-options[hidden] { display: none; }
.entry-memory-options button { text-align: left; padding: 10px; background: #edf6f2; color: #146b57; border: 0; border-radius: 6px; white-space: pre-wrap; }
.stat-card[role="button"]:focus-visible { outline: 3px solid var(--sale); }
#voucher-viewer { width: min(96vw, 1100px); max-height: 94dvh; }
#voucher-viewer-body { overflow: auto; max-height: 75dvh; }
#voucher-viewer-body img { display: block; width: 100%; height: auto; object-fit: contain; cursor: zoom-in; }
#voucher-viewer-body img.original-size { width: auto; max-width: none; cursor: zoom-out; }
#voucher-viewer-body iframe { width: 100%; height: 70dvh; border: 0; }
#summary-detail-list > section { padding-block: 12px; border-bottom: 1px solid #d9d9d9; }

/* September 11: preserve the green interface while keeping every currency distinct. */
#voice-entry-button, #voice-draft-card, #voice-dialog { display: none !important; }
.currency-amount { display: flex; align-items: baseline; gap: .45em; line-height: 1.5; white-space: nowrap; }
.currency-amount > small { font-size: .48em; font-weight: 500; opacity: .8; }
.hero-amount .currency-amount > span { font-size: inherit; }
.hero-metrics .currency-amount, .hero-metrics .currency-amount > span { font-size: inherit; color: inherit; }
.hero-metrics .currency-amount > small { font-size: 11px; }
.asset-total .currency-amount, .asset-total .currency-amount > span { font-size: inherit; color: inherit; }
.asset-total .currency-amount > small { font-size: 12px; }
.transaction-day-total .currency-amount { justify-content: flex-end; gap: .25em; }
.transaction-day-total .currency-amount > small { font-size: 9px; }
.asset-heading-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 14px; }
.summary-currency-field { margin: 0; min-width: 130px; }
.summary-currency-field > span { font-size: 11px; }
.summary-currency-field select { min-height: 40px; }
.transfers-modal { width: min(760px, calc(100vw - 28px)); }
.transfer-help { font-size: 12px; line-height: 1.7; }
.transfer-range-form { margin-bottom: 18px; }
.transfer-row { padding: 16px 0; border-bottom: 1px solid var(--line, #e4eae6); overflow-wrap: anywhere; }
.transfer-row > div:first-child { display: grid; gap: 6px; }
.transfer-row small, .transfer-row p { color: var(--muted); font-size: 12px; }
.transfer-amounts { display: flex; flex-wrap: wrap; gap: 8px 24px; margin-top: 10px; font-size: 12px; }
.transfer-amounts strong { font-size: 15px; }
@media (max-width: 600px) {
  #today-net { font-size: clamp(26px, 7vw, 36px); }
  #asset-total { font-size: 24px; }
  .hero-metrics strong { font-size: 16px; }
  .transaction-day-heading { gap: 6px; }
  .transaction-day-total .currency-amount { flex-wrap: wrap; font-size: 11px; }
  .transaction-day-total .currency-amount > small { display: none; }
  .asset-heading-actions { gap: 10px; }
  .summary-actions { flex-wrap: wrap; align-items: flex-end; }
  .summary-currency-field { min-width: 110px; }
  .transfers-modal .form-grid { grid-template-columns: 1fr; }
  .transfers-modal .dialog-content { padding: 18px; }
}
