.install-widget {
  position: relative;
  margin-top: 20px;
}

.install-widget .install-widget-open {
  padding-right: 48px;
  border: 0;
}

.install-widget .install-widget-open::after {
  content: none;
}

.install-widget-permanent .install-widget-open {
  padding-right: 16px;
}

.install-widget .row-detail {
  white-space: normal;
  line-height: 1.45;
  color: var(--ink);
  opacity: 0.75;
}

.install-widget-close {
  position: absolute;
  right: 2px;
  top: 4px;
  color: var(--muted);
}

.install-widget-close .icon {
  width: 18px;
  height: 18px;
}

.install-page,
.login-page {
  padding: max(20px, env(safe-area-inset-top)) 20px
    max(28px, env(safe-area-inset-bottom));
  color: var(--ink);
  overflow-y: auto;
  height: 100%;
}

.install-page-nav {
  display: grid;
  grid-template-columns: 44px 1fr 44px;
  align-items: center;
  margin: 0 -8px 24px;
}

.install-page-nav span {
  text-align: center;
  font-weight: 650;
}

.install-page-nav a {
  text-decoration: none;
}

.install-app-icon {
  display: block;
  border-radius: 22px;
  margin: 0 auto 20px;
}

.install-page h1,
.login-page h1 {
  font-size: 28px;
  letter-spacing: -0.8px;
  text-align: center;
  margin: 0 0 12px;
}

.install-intro,
.login-page > p {
  font-size: 15px;
  line-height: 1.5;
  text-align: center;
  margin: 0 0 24px;
}

.install-tabs {
  margin-bottom: 24px;
}

.install-tabs button:not(.active) {
  color: var(--ink);
  opacity: 0.75;
}

.install-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  background: var(--surface);
  border-radius: 20px;
}

.install-steps li {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 18px 16px;
}

.install-steps li + li {
  border-top: 1px solid color-mix(in srgb, var(--ink) 14%, transparent);
}

.install-step-number {
  flex: 0 0 28px;
  height: 28px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 650;
}

.install-steps strong {
  display: block;
  font-size: 15px;
  line-height: 1.5;
}

.install-steps p {
  font-size: 14px;
  line-height: 1.5;
  margin: 5px 0 0;
  color: var(--ink);
  opacity: 0.8;
}

.install-steps .icon {
  width: 18px;
  height: 18px;
  vertical-align: middle;
  color: var(--accent);
}

.install-note,
.install-confirmation {
  font-size: 14px;
  line-height: 1.5;
  text-align: center;
  margin: 20px 4px;
}

.install-primary {
  display: block;
  width: 100%;
  min-height: 48px;
  border-radius: 14px;
  text-align: center;
  text-decoration: none;
  padding: 14px;
  margin: 12px 0;
  border: 0;
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 650;
}

.install-confirm,
.login-page .text-link {
  display: block;
  text-align: center;
  width: 100%;
  padding: 12px;
  text-decoration: none;
  min-height: 44px;
}

.login-page {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.login-page .login-error {
  color: var(--red);
}

.install-primary:active,
.install-widget-open:active {
  opacity: 0.8;
}

.install-page a:focus-visible,
.login-page a:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}

html,
body {
  min-height: 100%;
  overscroll-behavior-y: none;
}

body {
  margin: 0;
}

[hidden] {
  display: none !important;
}

button:disabled {
  cursor: default;
}

.icon {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
}

.tabbar-items {
  display: contents;
}

.nav-action.add-button {
  min-width: 44px;
}

.negative,
.destructive {
  color: var(--red) !important;
}

.positive {
  color: var(--green);
}

.chart-period {
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 12px;
  padding: 0;
}

.chart-top .chart-period {
  font-size: 12px;
}

.date-input-shell input {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  background: transparent;
  border: 0;
  color: inherit;
  font: inherit;
  padding: 0;
  text-align: right;
  appearance: none;
  -webkit-appearance: none;
}

.amount-label {
  display: block;
}

form {
  margin: 0;
}

.form-error {
  color: var(--red);
  white-space: pre-line;
  font-size: 13px;
  margin: 10px 4px;
}

.form-error:empty {
  display: none;
}

.hint {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.45;
  margin: 10px 4px;
}

.full {
  width: 100%;
}

.loading {
  display: flex;
  height: 100%;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 14px;
  text-align: center;
  padding: 25px;
}

.loading h1 {
  font-size: 34px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

form[data-kind] .sheet-form-content {
  padding-bottom: 4px;
}

form[data-kind] .plan-details {
  margin-bottom: 4px;
}

form[data-kind] > .sheet-footer {
  padding-top: 6px;
}

form[data-kind] > .sheet-footer .primary-button {
  height: 58px;
  border-radius: 18px;
  font-size: 17px;
  box-shadow: 0 6px 16px rgb(0 0 0 / 18%);
}

.debt-person-picker {
  position: relative;
}

.debt-person-picker .field-row {
  border-radius: 15px;
}

.debt-person-input {
  width: 65%;
  position: relative;
}

.debt-person-input input {
  width: 100%;
  background: none;
  border: 0;
  font: inherit;
  color: inherit;
  padding: 14px 0;
  text-align: right;
  min-width: 0;
}

.debt-person-current {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  font-size: 13px;
  white-space: nowrap;
}

.debt-person-options {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 4;
  background: var(--surface);
  border-radius: 15px;
  max-height: 220px;
  overflow: auto;
  box-shadow: 0 6px 20px #182a3d35;
}

.debt-person-options button {
  border: 0;
  background: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  padding: 14px;
  color: inherit;
  font: inherit;
}

.debt-person-options small {
  font-size: 13px;
}

.debt-preview {
  background: var(--accent-soft);
  padding: 12px 15px;
  margin-top: 12px;
  border-radius: 15px;
  font-size: 13px;
}

.debt-preview-row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-top: 6px;
}

.debt-preview-values {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.receipt-page {
  margin: 0;
}

:root {
  --icon-green: var(--green);
  --icon-red: var(--red);
  --icon-yellow: #a87622;
  --icon-purple: #8564a7;
}

.operation-card {
  padding: 18px;
}

.operation-card-heading {
  display: flex;
  align-items: center;
  gap: 10px;
}

.operation-card .row-icon {
  width: 36px;
  height: 36px;
  margin: 0;
  border-radius: 12px;
  background: var(--accent-soft);
  color: var(--accent);
}

.operation-card h2 {
  flex: 1;
  min-width: 0;
  margin: 0;
  font-size: 16px;
  font-weight: 650;
  letter-spacing: normal;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.operation-type {
  flex: none;
  padding: 6px 9px;
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 12px;
  white-space: nowrap;
}

.operation-type.green {
  background: rgb(54 131 91 / 18%);
  color: var(--icon-green);
}

.operation-type.red {
  background: rgb(177 60 62 / 18%);
  color: var(--icon-red);
}

.operation-card-bottom {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-top: 16px;
}

.operation-card-bottom p {
  font-size: 12px;
}

.operation-card-bottom .detail-balance {
  margin-top: 0;
  font-size: 24px;
  letter-spacing: -0.6px;
  text-align: right;
}

.account-detail-card .balance-reconcile {
  width: auto;
  flex: none;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --icon-green: #9bd8ad;
    --icon-red: #ef9a96;
    --icon-yellow: #e6c184;
    --icon-purple: #c6a9e5;
  }
}
:root[data-theme="dark"] {
  --icon-green: #9bd8ad;
  --icon-red: #ef9a96;
  --icon-yellow: #e6c184;
  --icon-purple: #c6a9e5;
}

.receipt-store {
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.receipt-tools {
  margin-top: 22px;
}

.receipt-show-button {
  border-radius: 15px;
  margin-top: 4px;
}

.receipt-show-button .row-title,
.receipt-show-button .row-detail {
  display: block;
}

.receipt-page .receipt-show-button::after {
  content: none;
  display: none;
}

.receipt-item-section + .receipt-item-section {
  margin-top: 20px;
}

.receipt-items-table .receipt-item {
  min-height: 48px;
  padding-block: 8px;
}

.receipt-items-table {
  border: 1px solid rgb(137 146 155 / 25%);
}

.receipt-item-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 0 4px 10px;
}

.receipt-item-heading h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 650;
}

.receipt-item-heading .text-link {
  flex: none;
  font-size: 13px;
  padding: 6px 0;
  white-space: nowrap;
}

.receipt-item-category {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  padding: 12px 14px;
  background: var(--bg);
  color: var(--muted);
  border-bottom: 1px solid rgb(137 146 155 / 20%);
  font-size: 14px;
}

.receipt-item-category strong:last-child {
  flex: none;
}

.receipt-items-table .receipt-item + .receipt-item-category {
  border-top: 1px solid rgb(137 146 155 / 20%);
}

.receipt-items-sheet .receipt-tools {
  margin-top: 0;
}

.receipt-items-sheet > .section-foot {
  padding: 0 4px;
  margin: 0 0 14px;
}

.receipt-items-actions {
  position: sticky;
  bottom: -20px;
  z-index: 2;
  margin: 12px -20px -20px;
  padding: 12px 20px 20px;
  border-radius: 16px 16px 0 0;
  background: var(--bg);
  box-shadow: 0 -10px 20px rgb(0 0 0 / 20%);
}

.receipt-category-totals .row {
  min-height: 49px;
}

.receipt-save-bar {
  position: sticky;
  bottom: -28px;
  padding: 12px 0 28px;
  background: var(--bg);
  margin-top: 12px;
}

.receipt-category-totals > div {
  display: flex;
  justify-content: space-between;
  padding: 12px 16px;
  font-size: 14px;
  border-bottom: 1px solid rgb(137 146 155 / 25%);
}

.receipt-category-totals > div:last-child {
  border-bottom: 0;
}

.receipt-page .check-label {
  margin-top: 12px;
}

#notice:empty {
  display: none;
}

#notice:not(:empty) {
  position: fixed;
  inset: auto auto 95px 50%;
  transform: translateX(-50%);
  margin: 0;
  padding: 10px 15px;
  background: #25313d;
  color: var(--on-dark);
  font-size: 13px;
  border: 0;
  border-radius: var(--radius-control);
  max-width: calc(100vw - 40px);
  box-shadow: 0 6px 20px #182a3d35;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 8px;
}

.notice-close {
  border: 0;
  background: none;
  color: inherit;
  padding: 0;
  width: 24px;
  height: 24px;
  flex: none;
}

.notice-close .icon {
  width: 16px;
  height: 16px;
}

.manual-item {
  margin-top: 16px;
}

.product-prices button {
  width: 100%;
  border: 0;
  background: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px;
  color: inherit;
}

.filter-form .field-group {
  margin-bottom: 14px;
}

video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}


:root[data-host="telegram"] .status-bar {
  display: none;
}

:root[data-host="browser"] .phone::before {
  display: none;
}

:root[data-host="telegram"] .phone {
  padding-top: var(--tg-content-top, 0px);
}

:root[data-host="telegram"] .tabbar {
  padding-bottom: calc(
    20px + env(safe-area-inset-bottom) + var(--tg-content-bottom, 0px)
  );
  height: auto;
  min-height: 82px;
}

@media (max-width: 750px) {
  :root,
  body {
    background: var(--bg);
  }

  .screen {
    padding-top: env(safe-area-inset-top);
  }
}
@media (display-mode: standalone) {
  :root,
  body {
    background: var(--bg);
  }
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .field-row input,
  :root:not([data-theme="light"]) .field-row select,
  :root:not([data-theme="light"]) .field-row textarea {
    color: var(--muted);
  }

  :root:not([data-theme="light"]) .row-main small {
    color: var(--muted);
  }

  :root:not([data-theme="light"]) .receipt-save-bar {
    background: var(--bg);
  }

  :root:not([data-theme="light"]) .debt-person-options {
    background: var(--surface);
  }

  :root:not([data-theme="light"]) .debt-preview {
    background: var(--accent-soft);
  }
}
:root[data-theme="dark"] .field-row input,
:root[data-theme="dark"] .field-row select,
:root[data-theme="dark"] .field-row textarea,
:root[data-theme="dark"] .row-main small {
  color: var(--muted);
}

:root[data-theme="dark"] .receipt-save-bar {
  background: var(--bg);
}

:root[data-theme="dark"] .debt-person-options {
  background: var(--surface);
}

:root[data-theme="dark"] .debt-preview {
  background: var(--accent-soft);
}

:root[data-host="telegram"] .stage {
  min-height: 100dvh;
  padding: 0;
}

:root[data-host="telegram"] .stage-note,
:root[data-host="telegram"] .stage-caption {
  display: none;
}

:root[data-host="telegram"] .phone {
  width: 100%;
  height: 100dvh;
  min-height: 0;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

:root[data-host="telegram"] .phone::before {
  display: none;
}

:root[data-host="telegram"],
:root[data-host="telegram"] body {
  background: var(--bg);
}




body.camera-screen-open {
  overflow: hidden;
}

.camera-screen {
  position: fixed;
  inset: 0;
  z-index: 100;
  overflow: hidden;
  background: #050708;
  color: var(--on-dark);
  isolation: isolate;
}

.camera-screen video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.camera-circle {
  display: grid;
  place-items: center;
  border: 1px solid rgb(255 255 255 / 22%);
  border-radius: 50%;
  background: rgb(38 38 38 / 78%);
  color: var(--on-dark);
  padding: 0;
  backdrop-filter: blur(12px);
}

.camera-close {
  position: absolute;
  z-index: 3;
  top: calc(env(safe-area-inset-top) + 18px);
  left: 18px;
  width: 48px;
  height: 48px;
}

.camera-close .icon {
  width: 28px;
  height: 28px;
}

.camera-intro {
  position: absolute;
  top: max(88px, 18%);
  left: 20px;
  right: 20px;
  z-index: 2;
  text-align: center;
  text-shadow: 0 2px 12px rgb(0 0 0 / 50%);
  transition: opacity 200ms;
}

.camera-intro h1 {
  margin: 0 0 18px;
  font-size: clamp(26px, 6.8vw, 34px);
  letter-spacing: -0.6px;
}

.camera-intro p {
  margin: 0;
  font-size: 16px;
  line-height: 1.5;
}

.camera-target {
  position: absolute;
  left: 50%;
  top: 52%;
  width: min(68vw, 36dvh, 320px);
  height: min(68vw, 36dvh, 320px);
  transform: translate(-50%, -50%);
  border-radius: 16px;
  box-shadow: 0 0 0 200vmax rgb(0 0 0 / 38%);
  z-index: 1;
  pointer-events: none;
}

.camera-target i {
  position: absolute;
  width: 28px;
  height: 28px;
  border: 4px solid var(--surface);
}

.camera-target i:nth-child(1) {
  top: 0;
  left: 0;
  border-right: 0;
  border-bottom: 0;
  border-radius: 12px 0 0 0;
}

.camera-target i:nth-child(2) {
  top: 0;
  right: 0;
  border-left: 0;
  border-bottom: 0;
  border-radius: 0 12px 0 0;
}

.camera-target i:nth-child(3) {
  bottom: 0;
  right: 0;
  border-left: 0;
  border-top: 0;
  border-radius: 0 0 12px 0;
}

.camera-target i:nth-child(4) {
  bottom: 0;
  left: 0;
  border-right: 0;
  border-top: 0;
  border-radius: 0 0 0 12px;
}

.camera-actions {
  position: absolute;
  bottom: calc(env(safe-area-inset-bottom) + 20px);
  left: 20px;
  right: 20px;
  z-index: 2;
  display: flex;
  align-items: center;
  flex-direction: column;
  gap: 18px;
  transition: opacity 200ms;
}

.camera-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
}

.camera-zoom {
  width: 48px;
  height: 48px;
  font: inherit;
  font-size: 16px;
  font-weight: 650;
}

.camera-zoom[aria-pressed="true"] {
  border-color: #85bfff;
  color: #85bfff;
}

.camera-torch {
  width: 64px;
  height: 64px;
}

.camera-torch .icon {
  width: 30px;
  height: 30px;
}

.camera-torch[aria-pressed="true"] {
  background: var(--on-dark);
  color: #111;
}

.camera-manual,
.camera-retry {
  min-height: 44px;
  border: 0;
  background: none;
  color: var(--on-dark);
  font: inherit;
  font-size: 14px;
  padding: 10px 16px;
}

.camera-retry {
  background: rgb(255 255 255 / 16%);
  border-radius: 14px;
}

.camera-status {
  position: absolute;
  bottom: calc(env(safe-area-inset-bottom) + 185px);
  left: 24px;
  right: 24px;
  margin: 0;
  text-align: center;
  z-index: 2;
  font-size: 14px;
  line-height: 1.5;
  text-shadow: 0 2px 10px #000;
}

.camera-screen.is-recognized .camera-intro,
.camera-screen.is-recognized .camera-actions,
.camera-screen.is-recognized .camera-status,
.camera-screen.has-error .camera-target {
  opacity: 0;
  pointer-events: none;
}

@media (max-height: 540px) {
  .camera-intro {
    top: calc(env(safe-area-inset-top) + 18px);
    left: 80px;
    right: 80px;
  }

  .camera-intro h1 {
    font-size: 23px;
    margin-bottom: 8px;
  }

  .camera-intro p {
    font-size: 13px;
  }

  .camera-actions {
    flex-direction: row;
    justify-content: center;
    gap: 12px;
  }

  .camera-torch {
    width: 48px;
    height: 48px;
    flex: none;
  }

  .camera-status {
    bottom: calc(env(safe-area-inset-bottom) + 86px);
  }
}
.receipt-page .receipt-bottom {
  position: static;
}

.picker-native {
  position: absolute;
  width: 1px !important;
  height: 1px;
  opacity: 0;
  pointer-events: none;
  clip-path: inset(50%);
}

.field-choice {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  min-height: 44px;
  max-width: 65%;
  border: 0;
  padding: 6px 0;
  background: none;
  color: var(--muted);
  font: inherit;
  text-align: right;
}

.field-choice > span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.field-choice small {
  font-size: 12px;
  white-space: nowrap;
}

.field-choice .chevron {
  width: 16px;
  height: 16px;
}

.picker-list {
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.category-choice-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.category-choice-list > .group {
  flex: none;
}

.category-choice-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
}

.category-choice-select {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  flex: none;
  min-height: 36px;
  padding: 6px 10px;
  border: 0;
  border-radius: 12px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 13px;
  font-weight: 600;
}

.category-choice-select .icon {
  width: 14px;
  height: 14px;
}

.category-choice-children {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 14px 14px;
}

.category-choice-branch {
  flex: none;
  width: 36px;
  text-align: center;
  color: var(--muted);
  font-size: 22px;
}

.category-choice-chips {
  display: flex;
  gap: 8px;
  min-width: 0;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
  padding: 2px;
}

.category-choice-chips::-webkit-scrollbar {
  display: none;
}

.category-choice-chip {
  flex: none;
  min-height: 36px;
  padding: 7px 12px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: var(--bg);
  color: var(--ink);
  font-size: 13px;
  font-weight: 500;
}

.category-choice-chip.selected {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
}

.calculator-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-bottom: 2px;
}

.calculator-presets p {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.calculator-presets > div {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.calculator-presets button {
  border: 0;
  border-radius: 12px;
  min-height: 44px;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-soft);
}

.calculator-presets button:disabled {
  opacity: 0.4;
  cursor: default;
}

.calculator-result {
  margin: 0;
  min-height: 28px;
  text-align: right;
  color: var(--muted);
}

.calculator-keys {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  min-height: 0;
  flex: 1;
}

.calculator-keys button {
  font: inherit;
  font-size: 22px;
  border: 0;
  border-radius: 12px;
  background: var(--surface);
  color: var(--ink);
  min-height: 48px;
  font-variant-numeric: tabular-nums;
}

.calculator-keys button.calculator-tool {
  color: var(--muted);
  font-size: 18px;
}

.calculator-keys button.calculator-operator {
  background: var(--accent-soft);
  color: var(--accent);
}

.calculator-keys button.calculator-equals {
  background: var(--accent);
  color: var(--on-accent);
}

.calculator-keys button:active,
.calculator-presets button:not(:disabled):active {
  filter: brightness(0.85);
}

.amount-entry {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
}

.amount-entry .amount-label {
  grid-area: 1 / 1;
  display: flex;
  align-items: center;
  min-width: 0;
}

.amount-entry .form-amount {
  width: 100%;
  padding-inline: 48px;
  padding-block: 0;
  margin-block: 24px;
  line-height: 1.2;
  text-align: center;
}

.amount-calculator {
  position: relative;
  grid-area: 1 / 1;
  justify-self: end;
  align-self: center;
  z-index: 1;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 12px;
  background: var(--surface);
  color: var(--accent);
}

.amount-calculator .icon {
  width: 22px;
  height: 22px;
}

.quick-categories {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 4px;
  margin: 0 0 18px;
}

.category-quick-field:not(.field-row) {
  margin: 0 0 18px;
}

.category-quick-field > .field-label-text {
  display: block;
  width: auto;
}

.category-quick-field > .field-label-text:not(.field-label) {
  margin-bottom: 12px;
}

.category-quick-field .quick-categories {
  margin: 0;
}

.quick-category {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 4px 0;
  background: none;
  border: 0;
  color: var(--muted);
  font: inherit;
  min-width: 0;
  text-align: center;
}

.quick-categories .quick-category > span:last-child {
  display: block;
  font-size: 11px;
  width: 100%;
  max-width: none;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.quick-category.active {
  color: var(--accent);
}

.quick-category.active .row-icon {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.operation-preview {
  background: var(--preview-bg, var(--accent-soft));
  border-radius: 15px;
  padding: 12px 15px;
  margin: 12px 0;
  font-size: 13px;
}

.preview-title {
  font-size: 12px;
  font-weight: 650;
  margin-bottom: 8px;
  color: var(--muted);
}

.preview-row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin: 6px 0;
}

.preview-row > span:last-child {
  text-align: right;
}

.preview-warning {
  font-size: 12px;
  color: var(--red);
  margin: 10px 0 0;
  line-height: 1.45;
}

.swap-accounts {
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
}

.swap-accounts .icon {
  width: 18px;
  height: 18px;
}

.account-month h2 {
  font-size: 18px;
  text-transform: capitalize;
}

.account-month {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.balance-reconcile {
  display: block;
  width: 100%;
  border: 0;
  padding: 0;
  background: none;
  color: inherit;
  font-family: inherit;
  cursor: pointer;
}

.large-title {
  font-size: 34px;
  font-weight: 730;
  line-height: 1.15;
  letter-spacing: -1.2px;
  margin: 12px 0 21px;
  min-height: 44px;
  display: flex;
  align-items: center;
  overflow-wrap: anywhere;
}

.nav {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 44px;
  gap: 8px;
}

.nav-title {
  text-align: center;
  font-size: 17px;
  font-weight: 650;
  line-height: 1.25;
  letter-spacing: -0.2px;
}

.subheading:not(.account-month),
.account-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 25px 3px 10px;
}

.subheading:not(.account-month) h2,
.account-section-head .account-group-title {
  margin: 0;
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 620;
  line-height: 1.4;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}

.subheading:not(.account-month) .text-link,
.account-section-head .text-link {
  flex: none;
  font-size: 12px;
  font-weight: 620;
  letter-spacing: 0.3px;
  min-height: 44px;
  margin: -12px 0;
}

.page-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 12px 0 21px;
  min-height: 44px;
}

.page-heading .large-title {
  margin: 0;
  min-width: 0;
}

.heading-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: none;
}

.heading-actions .nav-action {
  min-width: 44px;
  min-height: 44px;
  display: grid;
  place-items: center;
  padding: 0;
}

.balance-widget {
  display: block;
  width: 100%;
  border: 0;
  text-align: left;
  font: inherit;
}

.balance-widget .balance-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.balance-switch-control {
  position: absolute;
  top: 20px;
  right: 24px;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: rgb(255 255 255 / 12%);
  color: #e3effa;
}

.balance-switch-icon {
  width: 16px;
  height: 16px;
}

.balance-widget .balance-value {
  display: block;
  margin-bottom: 0;
}

.balance-options {
  display: grid;
  gap: 12px;
  background: transparent;
  box-shadow: none;
  overflow: visible;
}

.balance-options .row-detail {
  display: block;
  white-space: normal;
  line-height: 1.45;
}

.balance-options .row-title {
  display: block;
}

.balance-options .row {
  align-items: flex-start;
  padding: 16px 14px;
  border: 2px solid transparent;
  border-radius: 16px;
  gap: 12px;
}

.balance-options .row::after {
  content: none;
}

.balance-options .row[aria-pressed="true"] {
  background: var(--accent-soft);
  border-color: var(--accent);
}

.balance-option-radio {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  flex: none;
  border: 1.5px solid var(--muted);
  border-radius: 50%;
}

[aria-pressed="true"] > .balance-option-radio {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--bg);
}

.balance-option-radio .icon {
  width: 16px;
  height: 16px;
}

.balance-option-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  min-height: 24px;
}

.balance-option-heading .row-title {
  min-width: 0;
}

.balance-option-heading .row-amount {
  flex: none;
}

.account-empty-action {
  display: block;
  margin: 0 3px;
  padding: 8px 0;
  min-height: 44px;
}

.nav-title {
  min-width: 0;
}

.quick-category .row-icon {
  width: 44px;
  height: 44px;
  border-radius: 14px;
}

.quick-category .row-icon .icon {
  width: 26px;
  height: 26px;
}

.quick-category .row-icon {
  position: relative;
}

.quick-category-pin {
  position: absolute;
  top: -4px;
  right: -4px;
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border: 2px solid var(--bg);
  border-radius: 50%;
  background: var(--surface);
  color: var(--accent);
  pointer-events: none;
}

.quick-category .quick-category-pin .icon {
  width: 12px;
  height: 12px;
}

.field-choice {
  align-items: baseline;
}

.field-choice > span,
.field-choice small {
  display: block;
  margin: 0;
  line-height: 1.25;
}

.field-choice .chevron {
  align-self: center;
}

.amount-calculator {
  height: 46px;
  display: grid;
  place-items: center;
}

.field-choice small {
  font-size: inherit;
  font-weight: 400;
}

.page-heading .large-title {
  min-height: 0;
}

.field-choice {
  align-items: center;
}

.account-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  padding: 10px 20px 4px;
}

.account-create-options {
  display: grid;
  gap: 10px;
}

.pillbar[aria-label="Тип категорий"],
.category-kind-switch {
  margin-bottom: 16px;
}

.category-kind-switch label {
  position: relative;
  flex: 1;
  padding: 8px;
  border-radius: 9px;
  text-align: center;
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
}

.category-kind-switch label.active {
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 1px 4px #1c344514;
}

.category-kind-switch label:focus-within {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.category-form input[name="name"] {
  color: var(--ink);
  font-size: max(16px, 1em);
}

.category-form:has([data-action="delete-category"]) .sheet-form-content {
  padding-bottom: 4px;
}

.category-form:has([data-action="delete-category"]) .sheet-footer {
  padding-top: 4px;
}

.category-form input[name="name"]::placeholder {
  color: var(--muted);
  opacity: 0.6;
}

.category-icon-field {
  min-width: 0;
  border: 0;
  padding: 0;
  margin: 18px 0 12px;
}

.category-icon-field legend {
  margin-bottom: 10px;
  padding: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

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

.category-icon-option {
  position: relative;
  min-width: 0;
  cursor: pointer;
}

.category-icon-option input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.category-icon-option > span {
  pointer-events: none;
  display: grid;
  place-items: center;
  height: 50px;
  border: 2px solid transparent;
  border-radius: 14px;
  background: var(--surface);
  color: var(--muted);
  transition:
    background 150ms,
    color 150ms,
    border-color 150ms;
}

.category-icon-option input:checked + span {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
}

.category-icon-option input:focus-visible + span {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

.account-debts-bottom {
  margin-top: 20px;
}

.account-empty .text-link {
  border: 0;
  background: none;
  box-shadow: none;
  border-radius: 0;
  min-height: 30px;
  padding: 4px 0;
}

.account-section:has(.account-empty) .account-section-head {
  margin-top: 18px;
  margin-bottom: 8px;
}

.account-section:has(.account-empty) + .account-section .account-section-head {
  margin-top: 16px;
}

.calculator-keys {
  min-height: 272px;
  flex-shrink: 0;
}

.plans-link {
  text-align: center;
  margin-bottom: 0;
}

.screen > .primary-button[data-action="new-plan"] {
  margin-top: 14px;
}

.screen > .info-list + [data-action="edit-operation"] {
  margin-top: 14px;
}

.receipt-fetch-intro,
.receipt-fetch-status {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 12px;
  padding: 18px 12px 12px;
}

.receipt-fetch-intro .row-icon {
  width: 52px;
  height: 52px;
  border-radius: 16px;
}

.receipt-fetch-intro h3 {
  font-size: 18px;
  font-weight: 650;
  margin: 0;
}

.receipt-fetch-intro .hint,
.receipt-fetch-status .hint {
  max-width: 290px;
  margin: 0;
}

.receipt-entry-controls {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin: 8px 0;
}

.receipt-entry-controls .secondary-button {
  margin: 0;
}

.receipt-entry-controls .secondary-button .icon {
  width: 20px;
  height: 20px;
  vertical-align: middle;
  margin-right: 6px;
}

.receipt-entry-controls .field-group {
  width: 100%;
}

.receipt-camera-form:not(.receipt-fetching) .sheet-footer {
  display: none;
}

.receipt-data-form .receipt-entry-controls {
  gap: 14px;
}

.receipt-data-hint {
  margin: 0;
  padding: 0 4px;
}

.receipt-data-form .field-row input {
  font-size: 16px;
}

.receipt-qr-entry summary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  color: var(--accent);
  font-size: 14px;
  font-weight: 600;
  list-style: none;
  cursor: pointer;
}

.receipt-qr-entry summary::-webkit-details-marker {
  display: none;
}

.receipt-qr-entry summary .icon {
  width: 18px;
  height: 18px;
}

.receipt-qr-entry[open] summary {
  background: var(--accent-soft);
}

.receipt-qr-entry .section-foot {
  margin: 10px 0;
  padding: 0 4px;
}

.receipt-qr-entry .field-row {
  display: block;
  padding: 0;
  border: 0;
  background: transparent;
}

.receipt-qr-entry .field-label-text {
  display: block;
  margin-bottom: 8px;
  font-size: 13px;
  color: var(--muted);
}

.receipt-qr-entry textarea {
  width: 100%;
  min-height: 90px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  color: var(--ink);
  text-align: left;
  font: inherit;
  font-size: 16px;
  resize: vertical;
}

.receipt-data-form > .primary-button {
  margin-top: 16px;
}

.receipt-fetching .receipt-fetch-intro,
.receipt-fetching .receipt-entry-controls {
  display: none;
}

.receipt-fetch-status {
  padding: 32px 12px;
}

.receipt-fetch-status strong {
  font-size: 18px;
  font-weight: 650;
}

.receipt-fetch-spinner {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 3px solid var(--preview-bg, var(--accent-soft));
  border-top-color: var(--accent);
  animation: receipt-fetch-spin 1s linear infinite;
}

@keyframes receipt-fetch-spin {
  to {
    transform: rotate(360deg);
  }
}
@media (prefers-reduced-motion: reduce) {
  .receipt-fetch-spinner {
    animation: none;
  }
}
.balance-open {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  border: 0;
  border-radius: inherit;
  background: transparent;
  cursor: pointer;
}

.balance-caption {
  position: relative;
}

.balance-hide {
  position: absolute;
  top: 50%;
  left: calc(100% + 4px);
  z-index: 2;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  transform: translateY(-50%);
  background: transparent;
  color: inherit;
  opacity: 0.8;
  cursor: pointer;
}

.balance-hide .icon {
  width: 19px;
  height: 19px;
}

.balance-hide:hover,
.balance-hide:focus-visible {
  opacity: 1;
  background: rgb(255 255 255 / 10%);
}

.balance-open:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 3px;
}

.analytics-period {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 44px;
  gap: 6px;
  align-items: center;
  margin-bottom: 16px;
}

.analytics-period-label {
  text-align: center;
  padding: 8px 0;
}

.analytics-period-label span {
  display: block;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.4;
}

.analytics-period button:disabled {
  opacity: 0.3;
}

.analytics-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 18px;
}

.analytics-metric {
  border: 1px solid transparent;
  background: var(--surface);
  color: inherit;
  border-radius: 14px;
  padding: 13px 9px;
  text-align: left;
  min-width: 0;
}

.analytics-metric[aria-pressed="true"] {
  border-color: var(--accent);
}

.analytics-metric span,
.analytics-insights span {
  display: block;
  font-size: 12px;
  color: var(--muted);
}

.analytics-metric strong {
  display: block;
  margin-top: 7px;
  font-size: 16px;
  font-weight: 650;
  overflow-wrap: anywhere;
  font-variant-numeric: tabular-nums;
}

.analytics-comparison {
  font-size: 14px;
  margin: 12px 0 4px;
  line-height: 1.4;
}

.analytics-previous {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.5;
  margin: 0;
}

.analytics-bars {
  display: flex;
  gap: 4px;
  height: 162px;
  margin-top: 22px;
}

.analytics-bar {
  flex: 1;
  min-width: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  border: 0;
  background: none;
  color: var(--muted);
}

.analytics-bar-track {
  height: 136px;
  width: 100%;
  display: flex;
  align-items: flex-end;
  background: none;
  border: 0;
  border-radius: 5px;
  overflow: hidden;
}

.analytics-bar-track i {
  display: block;
  width: 100%;
  background: var(--accent);
  border-radius: 5px 5px 0 0;
  min-height: 0;
}

.analytics-bar-label {
  font-size: 10px;
  height: 20px;
  padding-top: 7px;
  white-space: nowrap;
}

.analytics-bar:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 5px;
}

.analytics-chart-hint {
  font-size: 11px;
  color: var(--muted);
  margin: 15px 0 0;
  line-height: 1.4;
}

.analytics-insights {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.analytics-insights > * {
  border: 0;
  background: var(--surface);
  color: inherit;
  border-radius: 14px;
  padding: 15px 13px;
  text-align: left;
  min-width: 0;
}

.analytics-insights strong {
  display: block;
  margin-top: 8px;
  font-size: 20px;
  font-weight: 650;
  overflow-wrap: anywhere;
}

.analytics-insights small {
  display: block;
  font-size: 12px;
  margin-top: 7px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
}

.analytics-category-track {
  display: block;
  height: 4px;
  background: var(--line);
  border-radius: 4px;
  overflow: hidden;
  margin-top: 9px;
}

.analytics-category-track i {
  display: block;
  height: 100%;
  background: #7298bc;
  border-radius: inherit;
}

.analytics-category-track i.over-budget {
  background: var(--red);
}

.analytics-categories .row {
  min-height: 84px;
}

.analytics-empty {
  padding: 22px 14px;
  text-align: center;
}

.analytics-empty strong {
  font-size: 15px;
  font-weight: 600;
}

.analytics-empty p {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.5;
  margin: 8px 0;
}

.analytics-empty .text-link {
  display: block;
  margin: 0 auto;
  min-height: 44px;
}

.analytics-budgets > .row {
  min-height: 68px;
  padding-block: 10px;
}

.analytics-budgets .analytics-category-track {
  margin-top: 6px;
}

.create-affordance {
  display: grid;
  place-items: center;
  flex: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
}

.create-affordance .icon {
  width: 17px;
  height: 17px;
}

.analytics-receipts-link {
  margin-top: 20px;
  border-radius: var(--radius-card);
}

@media (prefers-color-scheme: dark) {
  .analytics-metric,
  .analytics-insights > * {
    background: var(--surface);
  }

  .analytics-category-track {
    background: var(--control-bg);
  }

  .analytics-period-label span,
  .analytics-metric span,
  .analytics-insights span,
  .analytics-previous,
  .analytics-chart-hint,
  .analytics-empty p,
  .analytics-insights small {
    color: var(--muted);
  }
}
.analytics-bucket-history {
  margin-top: 16px;
}

.analytics-period-tabs {
  margin-bottom: 12px;
}

.camera-photo {
  width: 64px;
  height: 64px;
  flex: none;
}

.camera-photo .icon {
  width: 28px;
  height: 28px;
}

.camera-photo:disabled {
  opacity: 0.55;
}

.camera-screen.has-error .camera-status {
  bottom: calc(env(safe-area-inset-bottom) + 250px);
}

@media (max-height: 540px) {
  .camera-photo {
    width: 48px;
    height: 48px;
  }

  .camera-screen.has-error .camera-status {
    bottom: calc(env(safe-area-inset-bottom) + 86px);
  }
}
:root[data-host="browser"] .searchbox input,
:root[data-host="browser"] .field-row > input:not(.form-amount),
:root[data-host="browser"] .field-row > textarea,
:root[data-host="browser"] .field-row > .date-input-shell > input {
  font-size: max(16px, 1em);
}

:root[data-host="browser"] #app > .inline-picker {
  padding-top: max(14px, env(safe-area-inset-top));
}

.history-active-filters {
  flex-wrap: wrap;
  overflow: visible;
  gap: 8px;
}

.history-active-filters:empty {
  display: none;
}

.history-active-filter {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  max-width: 100%;
  min-height: 36px;
  white-space: normal;
  text-align: left;
}

.history-active-filter > span:first-child {
  overflow-wrap: anywhere;
}

.history-active-filter > span:last-child {
  font-size: 19px;
  line-height: 1;
}

.nav > .nav-title {
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history-active-filter {
  flex: 0 0 auto;
}

.hint,
.section-foot,
.analytics-period-label span,
.analytics-metric span,
.analytics-insights span,
.analytics-previous,
.analytics-chart-hint,
.analytics-insights small {
  font-size: var(--text-caption);
  color: var(--muted);
  line-height: 1.45;
}

.subheading:not(.account-month) h2,
.account-section-head .account-group-title,
.subheading:not(.account-month) .text-link,
.account-section-head .text-link,
.settings-label,
.field-label {
  font-size: var(--text-section);
  letter-spacing: 0;
  text-transform: none;
}

.tab {
  font-size: 0.75rem;
  color: var(--muted);
}

.tab.active,
.nav-action,
.back,
.icon-btn {
  color: var(--accent);
}

.pillbar button {
  min-height: var(--control-height);
  color: var(--muted);
}

.pillbar button.active {
  color: var(--ink);
  background: var(--selected-bg);
}

.balance-number {
  font-size: clamp(28px, 8vw, 37px);
  overflow-wrap: anywhere;
  letter-spacing: -1px;
}

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

.balance {
  background: var(--balance-bg);
  color: var(--balance-ink);
}

.quick-action {
  font-size: var(--text-caption);
}

.field-choice {
  max-width: 72%;
  align-items: center;
  min-width: 0;
}

.field-choice > .field-choice-value {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: var(--space-xs);
  white-space: normal;
  overflow: visible;
}

.field-choice-value > span {
  white-space: normal;
  overflow-wrap: anywhere;
  color: var(--ink);
  line-height: 1.4;
}

.field-choice-value small {
  font-size: var(--text-caption);
  color: var(--muted);
}

.install-widget:not(.install-widget-permanent) {
  margin: -5px 0 16px;
  background: var(--accent-soft);
  border-radius: var(--radius-control);
  box-shadow: none;
}

.install-widget:not(.install-widget-permanent) .install-widget-open {
  min-height: 58px;
  padding: 8px 48px 8px 12px;
  background: transparent;
  gap: 10px;
}

.install-widget:not(.install-widget-permanent) .row-icon {
  width: 30px;
  height: 30px;
  background: transparent;
}

.install-widget:not(.install-widget-permanent) .row-title {
  font-size: var(--text-section);
}

.install-widget:not(.install-widget-permanent) .row-detail {
  font-size: var(--text-caption);
  margin-top: 1px;
  color: var(--muted);
  opacity: 1;
}

.install-widget-close {
  top: 7px;
  right: 2px;
}

.account-discover {
  margin-top: 20px;
}

.account-discover .account-discover-row {
  min-height: 60px;
  padding: 10px 16px;
}

.account-discover .row-title {
  font-weight: 550;
}

.draft-banner {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-sm);
  margin: 0 0 16px;
  padding: 8px 12px;
  border-radius: var(--radius-control);
  background: var(--accent-soft);
  font-size: var(--text-section);
}

.draft-banner > span {
  flex: 1;
  min-width: 0;
}

.draft-banner .text-link {
  flex: none;
  min-height: var(--control-height);
}

.analytics-chart {
  padding: 16px;
  margin-top: 14px;
}

.analytics-total-label {
  display: block;
  font-size: var(--text-caption);
  color: var(--muted);
  margin-bottom: 5px;
}

.analytics-chart .chart-top strong {
  display: block;
}

.analytics-chart-scale {
  display: flex;
  justify-content: space-between;
  margin-top: 14px;
  color: var(--muted);
  font-size: var(--text-caption);
  gap: 12px;
}

.analytics-bars {
  height: 98px;
  margin-top: 8px;
}

.analytics-bar-track {
  height: 74px;
}

.analytics-bar-label {
  font-size: 0.75rem;
}

.analytics-chart-hint {
  margin-top: 10px;
}

.analytics-categories .row {
  min-height: 72px;
}

.analytics-summary {
  margin: 16px 0 0;
}

.analytics-metric strong {
  overflow-wrap: normal;
  font-size: 0.9375rem;
}

.history-more {
  margin: 16px 0;
  min-height: var(--control-height);
}

.notice-retry {
  border: 1px solid currentColor;
  background: transparent;
  color: inherit;
  padding: 8px;
  border-radius: 8px;
  min-height: var(--control-height);
}

.export-download {
  margin-top: 20px;
}

@media (max-width: 350px) {
  .analytics-summary {
    grid-template-columns: 1fr;
  }

  .analytics-metric {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
  }

  .analytics-metric strong {
    margin-top: 0;
  }

  .field-choice {
    max-width: 70%;
  }
}
@media (prefers-reduced-transparency: reduce) {
  .tabbar {
    backdrop-filter: none;
    background: var(--surface);
  }
}
.tag {
  background: var(--accent-soft);
  color: var(--accent);
}

.analytics-summary {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 140px), 1fr));
}

.expense-debt-details {
  margin: 14px 0;
}

.expense-debt-details > summary {
  color: var(--accent);
  cursor: pointer;
}

.expense-debt-details[open] > summary {
  margin-bottom: 12px;
}

.receipt-debt-summary {
  margin: 6px 0;
  line-height: 1.5;
}

.manual-receipt-open {
  display: block;
  margin: 14px 0;
}

.manual-item-add {
  margin: 0 0 10px;
}

.operation-advanced > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 48px;
  padding: 12px 16px;
  list-style: none;
  font-weight: 600;
}

.operation-advanced > summary::-webkit-details-marker {
  display: none;
}

.operation-advanced .advanced-chevron {
  width: 16px;
  height: 16px;
  flex: none;
}

.operation-advanced[open] > summary .advanced-chevron {
  transform: rotate(90deg);
}

.operation-advanced-content {
  padding: 0 16px 14px;
}

.operation-advanced-content .manual-receipt-open {
  margin: 0;
  min-height: 44px;
  width: 100%;
  text-align: left;
}

.operation-advanced-content .plan-details {
  margin: 4px 0 0;
}

.operation-advanced-content .plan-details > summary {
  min-height: 44px;
}

.operation-advanced-content .plan-details[open] > summary {
  margin-bottom: 10px;
}

.operation-advanced-content .plan-details .field-group {
  margin: 12px 0;
}

.manual-item-form .sheet-form-content {
  padding-top: 12px;
  padding-bottom: 16px;
}

.manual-item-form .sheet-form-content > [data-action="manual-item-delete"] {
  margin-top: 12px;
}

.manual-item-form .sheet-footer {
  padding-top: 8px;
}

.receipt-items-actions > .text-link {
  display: block;
  min-height: 40px;
  margin-top: 8px;
}

.receipt-debt-menu {
  margin: 0 0 16px;
  border-radius: 16px;
  background: var(--surface);
  overflow: hidden;
}

.receipt-debt-menu > summary {
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  cursor: pointer;
  list-style: none;
}

.receipt-debt-menu > summary::-webkit-details-marker {
  display: none;
}

.receipt-debt-chevron {
  width: 16px;
  height: 16px;
  color: var(--muted);
  flex: none;
}

.receipt-debt-menu[open] .receipt-debt-chevron {
  transform: rotate(90deg);
}

.receipt-debt-menu-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 4px 16px 16px;
}

.receipt-debt-menu-actions > button {
  margin: 0;
  min-height: 44px;
  height: auto;
  padding: 12px;
}

.receipt-debt-form .sheet-form-content {
  padding-top: 12px;
  padding-bottom: 16px;
}

.receipt-debt-people {
  margin: 12px 0;
  max-height: 240px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.receipt-debt-people[hidden] {
  display: none;
}

.receipt-debt-person {
  width: 100%;
  min-height: 56px;
}

.receipt-debt-person[aria-pressed="true"] {
  background: var(--accent-soft);
}

.receipt-debt-person-status {
  margin: 12px 0;
}

.receipt-debt-person-status:empty {
  display: none;
}

.receipt-debt-form .sheet-footer {
  padding-top: 8px;
}
