:root {
  --primary: #004784;
  --sidebar: #071829;
  --bg: #f7f9fb;
  --card: #fff;
  --text: #20242a;
  --muted: #707780;
  --border: rgba(18, 31, 46, .1);
  --green: #07864a;
  --red: #c81e38;
  --sky: #087ab7;
  --violet: #7650d4;
  --orange: #d97706;
  --savings-blue: #77b7d0;
  --radius: 10px;
  font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 18% 10%, rgba(0, 71, 132, .18), transparent 30%),
    radial-gradient(circle at 90% 70%, rgba(8, 122, 183, .14), transparent 32%),
    linear-gradient(135deg, #eef3f8, #ffffff 46%, #edf5fb);
  color: var(--text);
}

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

button, a {
  -webkit-tap-highlight-color: transparent;
}

.preview-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(260px, 360px) minmax(390px, 1fr);
  gap: 34px;
  align-items: center;
  justify-items: center;
  padding: 34px;
}

.preview-info {
  width: 100%;
  max-width: 360px;
  display: grid;
  gap: 20px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--primary);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.preview-info h1 {
  margin: 0;
  font-size: 36px;
  line-height: 1.05;
}

.preview-info p {
  color: var(--muted);
  line-height: 1.7;
}

.preview-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.soft-button, .soft-link {
  border: 1px solid var(--border);
  background: #fff;
  color: var(--primary);
  border-radius: 10px;
  padding: 10px 13px;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(9, 28, 55, .06);
}

.note {
  border: 1px solid rgba(0, 71, 132, .16);
  background: rgba(255, 255, 255, .72);
  border-radius: 14px;
  padding: 14px;
  display: grid;
  gap: 8px;
  color: var(--muted);
  line-height: 1.55;
}

.note strong { color: var(--text); }

.phone-wrap {
  width: 100%;
  display: grid;
  place-items: center;
}

.phone {
  position: relative;
  width: min(430px, 92vw);
  aspect-ratio: 390 / 844;
  border-radius: 54px;
  padding: 13px;
  background: linear-gradient(145deg, #1a1d23, #050608);
  box-shadow: 0 34px 80px rgba(8, 28, 54, .32), inset 0 0 0 2px rgba(255,255,255,.06);
}

.phone-speaker {
  position: absolute;
  top: 21px;
  left: 50%;
  width: 92px;
  height: 25px;
  transform: translateX(-50%);
  border-radius: 0 0 18px 18px;
  background: #050608;
  z-index: 8;
}

.ios-app {
  position: relative;
  height: 100%;
  overflow: hidden;
  border-radius: 42px;
  background: var(--bg);
  isolation: isolate;
}

.statusbar {
  height: 38px;
  padding: 13px 28px 0;
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  font-weight: 700;
  background: rgba(255,255,255,.96);
}

.status-icons {
  font-size: 11px;
}

.topbar {
  position: relative;
  z-index: 3;
  height: 54px;
  padding: 0 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid var(--border);
  background: rgba(255,255,255,.96);
}

.topbar strong {
  margin-left: auto;
  font-size: 14px;
  max-width: 42%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hint {
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  cursor: pointer;
}

.icon-button {
  width: 34px;
  height: 34px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: #fff;
  display: grid;
  place-content: center;
  gap: 4px;
  cursor: pointer;
}

.icon-button span {
  display: block;
  width: 15px;
  height: 2px;
  border-radius: 99px;
  background: var(--muted);
}

.screen {
  position: relative;
  z-index: 1;
  height: calc(100% - 92px);
  overflow-y: auto;
  overflow-x: hidden;
  padding: 18px 16px 28px;
}

.page-watermark {
  position: absolute;
  inset: 92px 0 0;
  z-index: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-template-rows: repeat(6, minmax(0, 1fr));
  place-items: center;
  overflow: hidden;
  pointer-events: none;
  user-select: none;
}

.page-watermark span {
  width: 120px;
  color: rgba(112, 119, 128, .085);
  font-size: 13px;
  font-weight: 600;
  text-align: center;
  white-space: nowrap;
  transform: rotate(-45deg);
}

.screen::-webkit-scrollbar { width: 0; }

.drawer-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.22);
  opacity: 0;
  pointer-events: none;
  transition: opacity .22s ease;
  z-index: 4;
}

.drawer {
  position: absolute;
  inset: 0 auto 0 0;
  width: 82%;
  max-width: 320px;
  transform: translateX(-102%);
  transition: transform .24s ease;
  background: var(--sidebar);
  color: #fff;
  z-index: 5;
  display: flex;
  flex-direction: column;
}

.drawer.open {
  transform: translateX(0);
}

.drawer-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.drawer-head {
  height: 68px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 14px;
  font-weight: 700;
}

.close-button {
  border: 0;
  color: rgba(255,255,255,.82);
  background: rgba(255,255,255,.07);
  width: 34px;
  height: 34px;
  border-radius: 9px;
  cursor: pointer;
}

.drawer-body {
  position: relative;
  flex: 1;
  overflow: auto;
  padding: 8px 10px;
}

.drawer-body::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle, rgba(255,255,255,.07) 1px, transparent 1px);
  background-size: 22px 22px;
  opacity: .7;
  pointer-events: none;
}

.menu-group {
  position: relative;
  margin-bottom: 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255,255,255,.06);
}

.group-title {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  font-weight: 800;
  font-size: 14px;
}

.menu-item {
  width: 100%;
  border: 0;
  border-left: 2px solid currentColor;
  background: transparent;
  color: rgba(255,255,255,.62);
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: left;
  padding: 10px 10px 10px 16px;
  border-radius: 8px;
  cursor: pointer;
}

.menu-item.active {
  background: currentColor;
  color: var(--item-color);
}

.menu-item.active span,
.menu-item.active b {
  color: var(--item-color);
}

.menu-item.active {
  background-color: color-mix(in srgb, var(--item-color) 16%, transparent);
}

.menu-item b {
  width: 18px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 18px;
}

.menu-item b .ui-icon {
  width: 17px;
  height: 17px;
  stroke-width: 2.1;
}

.drawer-foot {
  padding: 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(255,255,255,.04);
}

.avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #c2e6ea;
  color: var(--primary);
  display: grid;
  place-items: center;
  font-weight: 800;
}

.user-meta {
  min-width: 0;
  flex: 1;
  display: grid;
  gap: 3px;
  font-size: 13px;
}

.user-name-button {
  min-width: 0;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 8px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #fff;
  text-align: left;
  cursor: pointer;
}

.user-name-button:hover,
.user-name-button:focus-visible {
  background: rgba(255,255,255,.08);
  outline: none;
}

.user-name-button strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-name-button .ui-icon {
  width: 14px;
  height: 14px;
  flex: 0 0 14px;
  color: rgba(255,255,255,.62);
}

.user-name-editor-backdrop {
  place-items: center;
  z-index: 7;
}

.user-name-editor-modal {
  width: min(310px, calc(100% - 12px));
}

.user-name-editor-form {
  display: grid;
  gap: 12px;
}

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

.page-heading-line {
  display: flex;
  align-items: baseline;
  gap: 7px;
}

.page-heading-line h2 {
  white-space: nowrap;
}

.page-heading-line small {
  color: #9aa4b2;
  font-size: 11px;
  font-weight: 400;
  white-space: nowrap;
}

.page-head-products {
  flex-wrap: nowrap;
  gap: 6px;
}

.page-head-products > div:first-child {
  flex: 1 1 auto;
  max-width: none;
}

.page-head-products .actions {
  min-width: 0;
  flex: 0 0 auto;
  display: flex;
  justify-content: end;
  gap: 6px;
}

.page-head-products p {
  white-space: nowrap;
}

.page-head-products .icon-label-button {
  min-width: 0;
  justify-content: center;
  padding: 9px 11px;
  min-height: 34px;
  font-size: inherit;
}

.page-head-products .icon-label-button .ui-icon {
  width: 15px;
  height: 15px;
}

.product-list-heading {
  justify-content: flex-start;
}

.product-list-heading small {
  color: #9aa4b2;
  font-size: 11px;
  font-weight: 400;
}

.page {
  display: grid;
  gap: 16px;
}

.page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.page-head-compact {
  align-items: center;
  gap: 10px;
}

.page-head > div:first-child {
  min-width: 0;
}

.page-head h2 {
  margin: 0;
  font-size: 23px;
  line-height: 1.12;
  overflow: hidden;
  text-overflow: ellipsis;
}

.page-head p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 8px;
}

.ui-icon {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.primary, .outline, .ghost {
  border-radius: 9px;
  padding: 9px 11px;
  min-height: 34px;
  cursor: pointer;
}

.icon-only {
  position: relative;
  width: 34px;
  height: 34px;
  min-height: 34px;
  padding: 0;
  display: grid;
  place-items: center;
}

.outline.icon-only.active {
  border-color: var(--primary);
  color: var(--primary);
  background: rgba(0, 71, 132, .07);
}

.primary.icon-only .ui-icon {
  stroke-width: 2.4;
}

.icon-badge {
  position: absolute;
  top: -6px;
  right: -5px;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: var(--orange);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  border: 1px solid #fff;
}

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

.outline {
  border: 1px solid var(--border);
  color: var(--text);
  background: #fff;
}

.ghost {
  border: 0;
  background: transparent;
  color: var(--muted);
}

.pills {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 1px;
  scrollbar-width: none;
}

.pills::-webkit-scrollbar {
  display: none;
}

.pill {
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, .78);
  color: var(--muted);
  border-radius: 999px;
  padding: 6px 10px;
  white-space: nowrap;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: color .2s ease, background-color .2s ease, border-color .2s ease, transform .2s ease;
}

.pill.active {
  border-color: var(--primary);
  background: var(--primary);
  color: #fff;
}

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

.card {
  border: 1px solid var(--border);
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: 0 8px 22px rgba(12, 30, 54, .04);
}

.metric {
  container-type: inline-size;
  min-height: 116px;
  padding: 14px;
  display: grid;
  align-content: space-between;
  gap: 9px;
  background: rgba(0, 71, 132, .045);
  border-color: rgba(0, 71, 132, .2);
}

.metric-title {
  font-size: 13px;
  font-weight: 700;
}

.metric-value {
  color: var(--primary);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  display: flex;
  align-items: baseline;
  gap: 4px;
  min-width: 0;
  line-height: 1.05;
}

.metric-number {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: clamp(17px, 14cqw, 23px);
}

.metric-value small {
  font-size: clamp(10px, 6cqw, 12px);
  color: var(--muted);
  font-weight: 500;
  flex: 0 0 auto;
}

.metric-details {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.metric-detail {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  color: var(--muted);
  font-size: clamp(9px, 6cqw, 11px);
  line-height: 1.12;
  min-width: 0;
}

.metric-detail > span,
.metric-detail b {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.metric-detail b {
  display: inline-flex;
  align-items: baseline;
  justify-content: flex-end;
  gap: 2px;
  font-variant-numeric: tabular-nums;
  font-size: clamp(9px, 6.5cqw, 11px);
}

.transaction-total-metric .transaction-type-detail .metric-detail-value {
  font-size: clamp(12px, 8.5cqw, 14px);
}

.cashflow-summary-metric .metric-detail b {
  font-size: clamp(12px, 8.5cqw, 14px);
}

.metric-detail b small {
  color: var(--muted);
  font-size: .9em;
  font-weight: 500;
}

.frequency-metric {
  align-content: stretch;
  gap: 8px;
}

.frequency-item {
  display: grid;
  grid-template-columns: minmax(78px, 1.35fr) minmax(0, .9fr);
  align-items: baseline;
  gap: 8px;
  min-width: 0;
}

.frequency-item .frequency-label,
.frequency-item b {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1.15;
}

.frequency-item .frequency-label {
  font-size: clamp(10px, 7.2cqw, 13px);
}

.frequency-item .frequency-label {
  color: var(--text);
  font-weight: 700;
}

.frequency-item b {
  display: inline-flex;
  align-items: baseline;
  gap: 3px;
  justify-self: end;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  font-size: clamp(15px, 12cqw, 21px);
  line-height: 1.05;
}

.frequency-item b small {
  color: var(--muted);
  font-size: .56em;
  font-weight: 500;
}

.savings-rate-metric {
  align-content: start;
  gap: 9px;
}

.profit-metric {
  align-content: start;
}

.savings-rate-metric .metric-value {
  justify-self: start;
  align-self: start;
}

.savings-rate-metric .metric-number {
  font-size: clamp(17px, 14cqw, 23px);
}

.mini-button {
  min-height: 28px;
  padding: 5px 9px;
  border-radius: 7px;
  font-size: 11px;
  white-space: nowrap;
}

.panel {
  padding: 14px;
  display: grid;
  gap: 12px;
}

.filter-panel {
  border-color: rgba(0, 71, 132, .18);
  background: rgba(255, 255, 255, .88);
}

.filter-modal-backdrop {
  position: absolute;
  inset: 0;
  z-index: 6;
  display: grid;
  align-items: end;
  padding: 14px;
  background: rgba(7, 24, 41, .28);
}

.filter-modal {
  max-height: calc(100% - 18px);
  overflow: auto;
  gap: 14px;
  background: rgba(255, 255, 255, .96);
  box-shadow: 0 22px 56px rgba(7, 24, 41, .22);
}

.cashflow-filter-backdrop {
  place-items: center;
}

.dashboard-filter-backdrop {
  place-items: center;
}

.cashflow-filter-modal {
  width: min(328px, calc(100% - 4px));
  max-height: calc(100% - 28px);
  overflow: visible;
}

.dashboard-filter-modal {
  width: min(328px, calc(100% - 4px));
  max-height: calc(100% - 28px);
  overflow: visible;
}

.cashflow-filter-modal select,
.cashflow-filter-modal input,
.cashflow-filter-modal .date-picker-trigger {
  font-size: 12px;
}

.dashboard-filter-modal input,
.dashboard-filter-modal .date-picker-trigger {
  color: var(--muted);
  font-size: 12px;
}

.filter-select-combo .filter-combo-display {
  cursor: pointer;
}

.filter-modal-actions {
  display: inline-flex;
  gap: 7px;
  flex: 0 0 auto;
}

.filter-form-grid {
  grid-template-columns: 1fr;
}

.panel-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 15px;
  font-weight: 800;
}

.chart-title > span,
.chart-title-label {
  flex: 0 0 auto;
}

.chart-title-label {
  display: inline-flex;
  align-items: baseline;
  gap: 0;
  min-width: 0;
}

.panel-title.chart-title {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.chart-title-label small {
  margin-left: 6px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
  white-space: nowrap;
}

.trend-range-toggle {
  cursor: pointer;
  user-select: none;
}

.trend-range-toggle:focus-visible {
  outline: 2px solid rgba(0, 71, 132, .22);
  outline-offset: 2px;
  border-radius: 5px;
}

.panel-title .chart-tabs {
  flex: 0 1 auto;
  justify-content: flex-end;
  min-width: 0;
  padding-bottom: 0;
}

.panel-title .title-tabs {
  gap: 6px;
  justify-content: flex-end;
  scrollbar-width: none;
}

.panel-title .title-tabs::-webkit-scrollbar {
  display: none;
}

.panel-title.chart-title .title-tabs .chart-tab {
  padding: 5px 11px;
  font-size: 11px;
}

.panel-title.chart-title .title-tabs {
  flex: 1 1 auto;
  min-width: 0;
  margin-left: auto;
  overflow-x: auto;
}

.chart-tabs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.chart-tab {
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, .78);
  color: var(--muted);
  border-radius: 999px;
  padding: 6px 10px;
  white-space: nowrap;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: color .2s ease, background-color .2s ease, border-color .2s ease, transform .2s ease;
}

.chart-tab.active {
  border-color: var(--primary);
  background: var(--primary);
  color: #fff;
}

.title-tabs .chart-tab,
.sub-tabs .chart-tab {
  padding: 5px 9px;
}

.sub-tabs {
  margin-top: -4px;
}

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

.chart-legend-row .chart-legend {
  flex: 1 1 auto;
  min-width: 0;
}

.legend-tabs {
  flex: 0 0 auto;
  justify-content: flex-end;
  margin-left: auto;
  padding-bottom: 0;
}

.chart-legend-row .sub-tabs {
  justify-content: flex-end;
  margin-left: auto;
}

.legend-tabs .chart-tab {
  padding: 4px 8px;
}

.chart-scroll {
  overflow-x: auto;
  overflow-y: hidden;
  padding: 4px 0 10px;
  scrollbar-width: thin;
  scrollbar-color: rgba(0, 71, 132, .35) rgba(0, 0, 0, .06);
  animation: chart-pane-enter .26s cubic-bezier(.2, .7, .3, 1) both;
}

.chart-scroll.short-range-scroll {
  overflow-x: hidden;
}

.chart-legend-row {
  animation: chart-controls-enter .2s ease both;
}

.chart-scroll::-webkit-scrollbar {
  height: 8px;
}

.chart-scroll::-webkit-scrollbar-track {
  border-radius: 999px;
  background: rgba(0, 0, 0, .06);
}

.chart-scroll::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(0, 71, 132, .35);
}

.timeline-chart {
  position: relative;
  width: var(--chart-width);
  min-width: 100%;
  display: flex;
  gap: 6px;
  align-items: stretch;
  padding: 8px 4px 0;
}

.timeline-chart.short-range {
  display: grid;
  grid-template-columns: repeat(var(--point-count), minmax(0, 1fr));
  gap: var(--point-gap);
}

.timeline-chart.short-range .timeline-point {
  width: 100%;
  min-width: 0;
  flex: none;
}

.timeline-average-line {
  position: absolute;
  left: 4px;
  right: 4px;
  z-index: 2;
  height: 0;
  border-top: 1px dashed rgba(112, 119, 128, .58);
  pointer-events: none;
}

.highlight-average-line,
.savings-average-line {
  border-top-color: var(--average-line-color, rgba(0, 71, 132, .86));
  border-top-width: 1.5px;
}

.timeline-average-line span {
  position: absolute;
  left: 3px;
  top: var(--average-label-top, 4px);
  color: #7f8996;
  font-size: 9px;
  font-weight: 600;
  white-space: nowrap;
}

.highlight-average-line span,
.savings-average-line span {
  color: var(--average-label-color, var(--primary));
  font-weight: 800;
  background: rgba(255, 255, 255, .82);
  padding: 1px 3px;
  border-radius: 4px;
}

.timeline-point {
  width: 52px;
  flex: 0 0 52px;
  display: grid;
  grid-template-rows: 180px 20px;
  justify-items: center;
  gap: 5px;
}

.signed-plot {
  position: relative;
  width: 100%;
  height: 180px;
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(0, 71, 132, .04), rgba(200, 30, 56, .03));
}

.chart-y-grid {
  position: absolute;
  inset: 0 0 28px;
  z-index: 0;
  background: transparent;
  pointer-events: none;
}

.signed-plot .chart-y-grid {
  inset: 0;
}

.chart-baseline {
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 1px;
  z-index: 1;
  background: transparent;
}

.glass-bar {
  position: absolute;
  left: 50%;
  width: var(--bar-width, 36px);
  min-height: 6px;
  transform: translateX(-50%);
  border-radius: 7px 7px 4px 4px;
  border: 1px solid rgba(255, 255, 255, .52);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.55), 0 8px 18px rgba(9, 28, 55, .08);
  backdrop-filter: blur(9px);
}

.positive-bar {
  background: linear-gradient(180deg, rgba(0, 71, 132, .72), rgba(0, 71, 132, .26));
}

.savings-bar {
  background: linear-gradient(180deg, rgba(119, 183, 208, .72), rgba(119, 183, 208, .26));
}

.count-bar {
  background: linear-gradient(180deg, rgba(217, 119, 6, .74), rgba(217, 119, 6, .26));
}

.average-bar {
  background: linear-gradient(180deg, rgba(118, 80, 212, .74), rgba(118, 80, 212, .24));
}

.negative-bar {
  background: linear-gradient(180deg, rgba(200, 30, 56, .22), rgba(200, 30, 56, .64));
  border-radius: 4px 4px 7px 7px;
}

.chart-data-label,
.balance-label {
  position: absolute;
  left: 50%;
  z-index: 3;
  transform: translateX(-50%);
  padding: 2px 4px;
  border-radius: 5px;
  background: rgba(255, 255, 255, .74);
  color: var(--text);
  font-size: 9px;
  font-weight: 800;
  line-height: 1.15;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  box-shadow: 0 4px 10px rgba(12, 30, 54, .06);
}

.signed-chart .chart-data-label {
  padding: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.positive-only-chart .signed-plot {
  background: linear-gradient(180deg, rgba(0, 71, 132, .05), rgba(18, 31, 46, .025));
}

.positive-only-chart .chart-y-grid {
  inset: 0 0 22px;
}

.combo-chart .chart-data-label,
.combo-chart .balance-label,
.change-label {
  padding: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.axis-label {
  color: var(--muted);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--muted);
  font-size: 11px;
}

.chart-legend span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.chart-legend i {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: var(--legend-color);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--legend-color) 12%, transparent);
}

.combo-chart {
  position: relative;
  width: var(--chart-width);
  min-width: 100%;
  height: var(--chart-height);
  border-radius: 10px;
  background:
    linear-gradient(180deg, rgba(7, 134, 74, .045), transparent 52%, rgba(200, 30, 56, .04)),
    repeating-linear-gradient(to right, transparent 0 calc(var(--x-grid-step) - 1px), rgba(18, 31, 46, .055) calc(var(--x-grid-step) - 1px) var(--x-grid-step));
}

.adaptive-combo-chart {
  background:
    linear-gradient(180deg, rgba(7, 134, 74, .048), transparent 52%, rgba(200, 30, 56, .045)),
    repeating-linear-gradient(to right, transparent 0 calc(var(--x-grid-step) - 1px), rgba(18, 31, 46, .055) calc(var(--x-grid-step) - 1px) var(--x-grid-step));
}

.combo-baseline {
  top: 112px;
}

.combo-point {
  position: absolute;
  top: 0;
  width: 60px;
  height: 250px;
}

.income-bar {
  background: linear-gradient(180deg, rgba(7, 134, 74, .76), rgba(7, 134, 74, .26));
}

.expense-bar {
  background: linear-gradient(180deg, rgba(200, 30, 56, .22), rgba(200, 30, 56, .72));
  border-radius: 4px 4px 7px 7px;
}

.income-label { color: var(--green); }
.expense-label { color: var(--red); }

.balance-label {
  color: var(--primary);
  background: rgba(255, 255, 255, .82);
}

.combo-month {
  position: absolute;
  left: 50%;
  bottom: 4px;
  transform: translateX(-50%);
}

.balance-svg {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
}

.balance-svg path,
.balance-svg polyline {
  fill: none;
  stroke: rgba(0, 71, 132, .62);
  stroke-width: 2.3;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 4px 8px rgba(0, 71, 132, .14));
}

.balance-svg circle {
  fill: rgba(255, 255, 255, .88);
  stroke: var(--primary);
  stroke-width: 1.8;
}

.change-chart {
  position: relative;
  width: var(--chart-width);
  min-width: 100%;
  height: var(--chart-height);
  border-radius: 10px;
  background:
    linear-gradient(180deg, rgba(7, 134, 74, .045), transparent 52%, rgba(200, 30, 56, .04)),
    repeating-linear-gradient(to right, transparent 0 calc(var(--x-grid-step) - 1px), rgba(18, 31, 46, .052) calc(var(--x-grid-step) - 1px) var(--x-grid-step));
}

.change-baseline {
  top: 126px;
}

.change-month {
  position: absolute;
  bottom: 5px;
  transform: translateX(-50%);
}

.change-label {
  position: absolute;
  z-index: 3;
  transform: translateX(-50%);
  text-align: center;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.change-label strong {
  display: block;
  font-size: 9px;
  line-height: 1;
}

.change-label span {
  font-size: 8px;
  color: var(--muted);
  line-height: 1.05;
}

.change-svg {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
}

.change-svg path,
.change-svg polyline {
  fill: none;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: .72;
  filter: drop-shadow(0 4px 8px rgba(12, 30, 54, .12));
}

.change-svg circle {
  fill: rgba(255, 255, 255, .9);
  stroke-width: 1.8;
}

.change-svg .income-line { stroke: var(--green); }
.change-svg .expense-line { stroke: var(--red); }
.change-svg .balance-line { stroke: var(--primary); }

.ranking-title {
  align-items: baseline;
}

.ranking-title .chart-tabs {
  flex: 0 0 auto;
  justify-content: flex-end;
  padding-bottom: 0;
}

.composition-tabs .chart-tab {
  padding: 5px 11px;
  font-size: 11px;
}

.cashflow-ranking-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

.cashflow-ranking-group {
  display: grid;
  gap: 8px;
}

.ranking-bars {
  display: grid;
  gap: 8px;
}

.ranking-row {
  display: grid;
  gap: 4px;
}

.ranking-row-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  font-size: 11px;
  color: var(--text);
}

.ranking-row-head span {
  min-width: 0;
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ranking-row-head strong {
  flex: 0 0 auto;
  color: var(--ranking-color);
  font-size: 11px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.cashflow-composition-list .ranking-row-head strong {
  font-size: 10.5px;
}

.ranking-track {
  position: relative;
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: color-mix(in srgb, var(--ranking-color) 10%, transparent);
}

.ranking-track i {
  position: absolute;
  inset: 0 auto 0 0;
  border-radius: inherit;
  background: linear-gradient(90deg, color-mix(in srgb, var(--ranking-color) 78%, transparent), color-mix(in srgb, var(--ranking-color) 26%, transparent));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.46);
}

.compact-empty {
  min-height: 34px;
  padding: 8px;
  font-size: 11px;
}

.list {
  display: grid;
}

.detail-title-group {
  min-width: 0;
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
}

.detail-title-group small {
  color: #9aa4b2;
  font-size: 11px;
  font-weight: 400;
  white-space: nowrap;
}

.detail-panel-title {
  flex-wrap: nowrap;
  gap: 4px;
}

.detail-panel-title .detail-title-group {
  flex: 1 1 auto;
  gap: 3px;
  min-width: 96px;
  overflow: hidden;
}

.detail-panel-title .detail-title-group > span {
  flex: 0 0 auto;
  font-size: 15px;
  white-space: nowrap;
}

.detail-panel-title .detail-title-group small {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 11px;
}

.detail-select-all {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 2px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
}

.detail-select-all input {
  width: 15px;
  height: 15px;
  margin: 0;
  accent-color: var(--primary);
}

.detail-panel-title .mini-button {
  flex: 0 1 auto;
  min-height: 25px;
  padding: 4px 4px;
  border-radius: 7px;
  font-size: 11.5px;
  line-height: 1;
}

.detail-panel-title .detail-delete-button {
  min-width: 0;
}

.detail-panel-title .detail-delete-button .ui-icon {
  display: none;
}

.detail-panel-title .detail-delete-button span,
.detail-panel-title .detail-export-button {
  white-space: nowrap;
}

.detail-batch-toolbar {
  min-height: 30px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 3px 0 7px;
  border-bottom: 1px solid var(--border);
}

.detail-batch-toolbar label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 11px;
  cursor: pointer;
}

.detail-batch-toolbar input,
.detail-row-checkbox {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--primary);
}

.detail-delete-button,
.record-delete-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  color: var(--red);
}

.detail-delete-button .ui-icon,
.record-delete-button .ui-icon {
  width: 14px;
  height: 14px;
}

.detail-delete-button:disabled {
  opacity: .42;
  cursor: not-allowed;
}

.detail-delete-button.confirm-delete,
.record-delete-button.confirm-delete {
  border-color: var(--red);
  background: var(--red);
  color: #fff;
}

.row {
  padding: 12px 0;
  display: grid;
  gap: 9px;
  border-bottom: 1px solid var(--border);
}

.detail-selectable-row {
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: start;
  gap: 8px;
}

.detail-row-checkbox {
  margin-top: 5px;
  cursor: pointer;
}

.detail-row-button {
  min-width: 0;
  width: 100%;
  padding: 4px 6px;
  margin: -4px -6px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
  transition: background .15s ease;
}

.detail-row-button:hover,
.detail-row-button:focus-visible {
  background: rgba(0, 71, 132, .045);
  outline: none;
}

.editable-row {
  cursor: pointer;
  border-radius: 8px;
  margin-inline: -8px;
  padding-left: 8px;
  padding-right: 8px;
  transition: background .15s ease;
}

.editable-row:hover,
.editable-row:focus-visible {
  background: rgba(0, 71, 132, .045);
  outline: none;
}

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

.row-main {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.row-title {
  font-size: 14px;
  font-weight: 800;
}

.title-with-badges {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

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

.row-sub {
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.row-right {
  margin-left: auto;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.row-right strong {
  display: block;
  font-size: 15px;
  line-height: 1.15;
}

.row-holding-shares,
.row-price,
.row-settlement-profit {
  font-size: 10px;
}

.row-settlement-profit {
  font-weight: 700;
  white-space: nowrap;
}

.row-holding-shares {
  font-weight: 700;
}

.badges {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 6px;
}

.icon-label-button {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.inline-badges {
  display: inline-flex;
  margin-top: 0;
  vertical-align: middle;
}

.badge {
  display: inline-flex;
  align-items: center;
  border-radius: 5px;
  padding: 3px 6px;
  font-size: 10px;
  font-weight: 800;
  color: var(--badge-color);
  background: color-mix(in srgb, var(--badge-color) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--badge-color) 24%, transparent);
}

.amounts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  font-size: 11px;
}

.amounts.two-cols {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.amounts label {
  display: block;
  color: var(--muted);
  margin-bottom: 3px;
}

.num {
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.positive { color: var(--green); }
.negative { color: var(--red); }
.neutral { color: var(--muted); }

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

.debit-panel {
  border-color: rgba(7, 134, 74, .24);
  background: rgba(7, 134, 74, .055);
}

.credit-panel {
  border-color: rgba(217,119,6,.28);
  background: rgba(217,119,6,.05);
}

.reference-card {
  display: grid;
  gap: 8px;
  padding: 10px;
  border-radius: 8px;
  background: rgba(255, 255, 255, .72);
  border: 1px solid rgba(217,119,6,.18);
}

.entry-mode-button.active {
  border-color: var(--primary);
  background: var(--primary);
  color: #fff;
}

.entry-panel-title {
  justify-content: flex-start;
}

.entry-panel-title > span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.entry-panel-title .badge {
  font-size: 12px;
  padding: 3px 7px;
}

.debit-entry-title > span {
  color: var(--green);
}

.credit-entry-title > span {
  color: #d97706;
}

.product-search-control {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.product-combo-control {
  position: relative;
}

.product-combo-control > input[role="combobox"] {
  padding-right: 42px;
}

.product-picker-shell {
  position: relative;
}

.product-dropdown-toggle {
  position: absolute;
  top: 1px;
  right: 1px;
  bottom: 1px;
  width: 40px;
  min-height: 0;
  border: 0;
  border-left: 1px solid var(--border);
  border-radius: 0 7px 7px 0;
  background: #fff;
  color: var(--muted);
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
}

.select-caret {
  width: 7px;
  height: 7px;
  display: inline-block;
  flex: 0 0 auto;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg) translate(-1px, -1px);
  transform-origin: center;
  color: var(--muted);
}

.product-match-list {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 35;
  display: grid;
  gap: 4px;
  max-height: min(380px, 54vh);
  overflow-y: auto;
  padding: 8px;
  border-radius: 10px;
  background: rgba(255, 255, 255, .98);
  border: 1px solid rgba(0, 71, 132, .14);
  box-shadow: 0 14px 34px rgba(15, 23, 42, .16);
}

.product-match-list[hidden] {
  display: none;
}

.product-result-section {
  display: grid;
  gap: 3px;
}

.product-result-section + .product-result-section {
  margin-top: 5px;
  padding-top: 7px;
  border-top: 1px solid var(--border);
}

.product-result-heading {
  padding: 3px 5px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.product-result-heading.online {
  color: #075fca;
}

.product-result-heading.fund {
  color: var(--green);
}

.product-result-row {
  width: 100%;
  display: grid;
  gap: 5px;
  padding: 8px 7px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.product-result-row:hover,
.product-result-row:focus-visible {
  background: rgba(0, 71, 132, .065);
  outline: none;
}

.product-result-title {
  min-width: 0;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 7px;
}

.product-result-title strong {
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: 12px;
  font-weight: 650;
  line-height: 1.3;
}

.product-code-chip,
.product-type-chip {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 2px 6px;
  border: 1px solid rgba(37, 99, 235, .22);
  border-radius: 5px;
  background: rgba(37, 99, 235, .055);
  color: #075fca;
  font-size: 10px;
  line-height: 1;
  white-space: nowrap;
}

.product-type-chip {
  border-radius: 999px;
  background: transparent;
}

.product-result-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-left: 2px;
  color: var(--muted);
  font-size: 10px;
}

.product-result-meta b {
  color: #1267df;
  font-weight: 600;
}

.product-search-loading,
.product-result-empty {
  padding: 12px 7px;
  color: var(--muted);
  font-size: 11px;
  text-align: center;
}

.product-search-loading span {
  width: 10px;
  height: 10px;
  display: inline-block;
  margin-right: 6px;
  border: 1.5px solid rgba(0, 71, 132, .2);
  border-top-color: var(--primary);
  border-radius: 50%;
  vertical-align: -1px;
  animation: product-search-spin .7s linear infinite;
}

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

.new-product-option {
  display: grid;
  gap: 2px;
  margin-top: 5px;
  padding-top: 7px;
  border-top: 1px solid var(--border);
}

.new-product-title {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 7px;
  color: #d56a00;
  font-size: 11px;
  font-weight: 700;
}

.new-product-title span,
.add-product-icon {
  width: 17px;
  height: 17px;
  display: inline-grid;
  place-items: center;
  border: 1px solid currentColor;
  border-radius: 50%;
  line-height: 1;
}

.new-product-option button {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 7px;
  border: 0;
  background: transparent;
  color: #bd5d00;
  font-size: 11px;
  line-height: 1.4;
  text-align: left;
  cursor: pointer;
}

.add-product-icon {
  flex: 0 0 17px;
  color: var(--muted);
}

.required-mark {
  margin-left: 2px;
  color: #dc2626;
  font-size: 14px;
  font-weight: 800;
}

.date-picker-trigger {
  width: 100%;
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(255, 255, 255, .82);
  color: var(--text);
  padding: 0 12px;
  font-size: 14px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.date-picker-popover[hidden] {
  display: none;
}

.date-picker-popover {
  position: absolute;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: center;
  overflow: hidden;
  padding: 14px 10px;
}

.date-picker-scrim {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, .26);
}

.date-picker-panel {
  position: relative;
  z-index: 1;
  width: min(328px, calc(100% - 20px));
  max-height: min(calc(100% - 28px), 430px);
  display: grid;
  gap: 8px;
  padding: 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, .96);
  border: 1px solid rgba(0, 71, 132, .12);
  box-shadow: 0 24px 70px rgba(15, 23, 42, .22);
}

.date-picker-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 14px;
  font-weight: 800;
}

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

.date-picker-actions button {
  width: 100%;
}

.date-wheel {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.date-wheel.month-wheel {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.date-wheel-control {
  min-width: 0;
  display: grid;
  grid-template-rows: auto 26px 126px 26px;
  gap: 3px;
}

.date-step-button {
  width: 100%;
  min-height: 26px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.date-step-button:hover,
.date-step-button:focus-visible {
  background: rgba(0, 71, 132, .06);
  color: var(--primary);
  outline: none;
}

.date-step-button .ui-icon {
  width: 14px;
  height: 14px;
}

.date-wheel-column-wrap {
  position: relative;
  height: 126px;
  overflow: hidden;
  border-top: 1px solid rgba(18, 31, 46, .05);
  border-bottom: 1px solid rgba(18, 31, 46, .05);
}

.date-wheel-column-wrap::after {
  content: "";
  position: absolute;
  z-index: 0;
  top: 50%;
  left: 2px;
  right: 2px;
  height: 34px;
  transform: translateY(-50%);
  border-radius: 7px;
  background: rgba(7, 134, 74, .12);
  border: 1px solid rgba(7, 134, 74, .1);
  pointer-events: none;
}

.date-wheel-column {
  position: relative;
  z-index: 1;
  height: 126px;
  overflow-y: auto;
  display: block;
  padding: 46px 2px;
  scroll-snap-type: y mandatory;
  scroll-padding-block: 46px;
  scrollbar-width: none;
}

.date-wheel-column::-webkit-scrollbar {
  width: 0;
  height: 0;
}

.date-wheel-column-title {
  padding: 1px 0 2px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-align: center;
}

.date-wheel-option {
  width: 100%;
  height: 34px;
  display: block;
  padding: 0;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  scroll-snap-align: center;
}

.date-wheel-option.selected {
  color: var(--green);
  font-weight: 800;
}

.date-picker-done {
  width: 100%;
}

.currency-rate-row {
  display: grid;
  grid-template-columns: minmax(70px, .42fr) minmax(0, 1.58fr);
  align-items: end;
  gap: 8px;
}

.currency-selector-stack {
  min-width: 0;
  display: grid;
  grid-template-rows: auto 36px;
  gap: 6px;
}

.currency-rate-field {
  grid-column: 1 / -1;
}

.debit-share-currency-row {
  align-items: stretch;
}

.debit-share-currency-row .currency-rate-field {
  grid-column: auto;
}

.debit-share-currency-row .currency-rate-row {
  grid-template-columns: minmax(82px, .95fr) minmax(0, 1.05fr);
  gap: 4px;
}

.debit-share-currency-row .exchange-rate-status {
  padding: 5px;
  line-height: 1.2;
}

.field-label-row {
  min-height: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.field-label-note {
  margin-left: 3px;
  color: #9aa0a8;
  font-size: 7.5px;
  font-weight: 400;
  white-space: nowrap;
}

.quote-refresh-button {
  width: 24px;
  height: 22px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid rgba(0, 71, 132, .14);
  border-radius: 6px;
  background: rgba(255, 255, 255, .72);
  color: var(--primary);
  cursor: pointer;
}

.quote-refresh-button .ui-icon {
  width: 13px;
  height: 13px;
}

.exchange-rate-status {
  margin-top: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow: visible;
  color: var(--green);
  font-weight: 400;
  padding: 6px 7px;
  border-radius: 8px;
  background: rgba(7, 134, 74, .11);
  border: 1px solid rgba(7, 134, 74, .18);
  height: 36px;
  min-height: 36px;
  max-height: none;
  white-space: normal;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.exchange-rate-values {
  font-size: 9px;
  line-height: 1.25;
}


.lookup-status:empty {
  display: none;
}

.entry-actions {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(82px, .75fr);
  gap: 10px;
}

.cashflow-entry-title {
  justify-content: flex-start;
  transition: color .2s ease;
}

.cashflow-entry-title.income {
  color: var(--green);
}

.cashflow-entry-title.expense {
  color: var(--red);
}

.cashflow-entry-form .field input,
.cashflow-entry-form .field select,
.cashflow-entry-form .field textarea,
.cashflow-entry-form .date-picker-trigger {
  color: var(--muted);
  font-size: 12px;
}

.cashflow-entry-form .field input:not([type="hidden"]),
.cashflow-entry-form .field select,
.cashflow-entry-form .date-picker-trigger {
  min-height: 36px;
  height: 36px;
}

.cashflow-detail-field,
.cashflow-sign-help {
  grid-column: 1 / -1;
}

.cashflow-sign-help {
  margin-top: -5px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.45;
}

.cashflow-entry-form input[readonly] {
  background: rgba(15, 23, 42, .035);
  font-variant-numeric: tabular-nums;
}

.cashflow-entry-form input::placeholder,
.cashflow-entry-form textarea::placeholder {
  color: #9aa4b2;
  opacity: 1;
}

.note-tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.note-tag {
  border: 1px solid rgba(0, 71, 132, .16);
  background: rgba(255, 255, 255, .72);
  color: var(--muted);
  border-radius: 999px;
  min-height: 28px;
  padding: 5px 9px;
  font-size: 11px;
}

.note-tag.active {
  border-color: rgba(7, 134, 74, .34);
  color: var(--green);
  background: rgba(7, 134, 74, .1);
}

.product-index-fields {
  align-items: start;
}

.product-index-list {
  gap: 0;
}

.product-index-row {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  column-gap: 12px;
}

.product-index-main {
  min-width: 0;
  text-align: left;
}

.product-meta-grid {
  margin-top: 8px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px 10px;
}

.product-meta-item {
  min-width: 0;
  text-align: left;
}

.product-meta-item span {
  color: var(--product-meta-color, #9aa4b2);
  font-size: 11px;
  font-weight: 400;
  overflow-wrap: anywhere;
}

.product-editor-backdrop {
  place-items: center;
  z-index: 8;
}

.record-editor-backdrop {
  place-items: center;
  z-index: 9;
}

.delete-confirm-backdrop {
  place-items: center;
  z-index: 30;
}

.delete-confirm-modal {
  width: min(300px, calc(100% - 18px));
  gap: 12px;
}

.delete-confirm-message {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.delete-confirm-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}

.delete-confirm-actions button {
  min-height: 36px;
  width: 100%;
  justify-content: center;
}

.danger-confirm-button {
  border-color: var(--red);
  background: var(--red);
  color: #fff;
}

.danger-confirm-button .ui-icon {
  width: 14px;
  height: 14px;
}

.record-editor-modal {
  width: min(340px, calc(100% - 4px));
  max-height: calc(100% - 28px);
}

.record-editor-form {
  display: grid;
  gap: 10px;
}

.record-editor-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.record-editor-full {
  grid-column: 1 / -1;
}

.record-editor-modal .field input,
.record-editor-modal .field select,
.record-editor-modal .field textarea,
.record-editor-modal .date-picker-trigger {
  color: var(--muted);
  font-size: 12px;
}

.record-editor-modal .field input:not([type="hidden"]),
.record-editor-modal .field select,
.record-editor-modal .date-picker-trigger {
  min-height: 36px;
  height: 36px;
}

.record-editor-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
  align-items: center;
  padding-top: 2px;
}

.record-editor-actions button {
  width: 100%;
  min-height: 34px;
  padding: 7px 10px;
  white-space: nowrap;
}

.product-editor-modal {
  width: min(328px, calc(100% - 4px));
  max-height: calc(100% - 28px);
  overflow: visible;
}

.product-editor-modal form,
.product-editor-modal .field,
.product-editor-search-panel,
.product-editor-search-results,
.product-editor-combo {
  min-width: 0;
  max-width: 100%;
}

.product-editor-modal .field input,
.product-editor-modal .field select {
  min-width: 0;
  max-width: 100%;
  color: #9aa4b2;
  font-size: 12px;
}

.product-editor-combo {
  position: relative;
  display: grid;
  overflow: visible;
  z-index: 1;
}

.product-editor-combo:has(.product-editor-combo-menu:not([hidden])) {
  z-index: 12;
}

.product-editor-combo-control {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 34px;
}

.product-editor-combo-control input {
  border-radius: 8px 0 0 8px;
}

.product-editor-combo-control input[readonly] {
  cursor: pointer;
}

.product-editor-combo-toggle {
  min-width: 34px;
  min-height: 36px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid var(--border);
  border-left: 0;
  border-radius: 0 8px 8px 0;
  background: #fff;
  color: var(--muted);
  cursor: pointer;
}

.product-editor-combo-menu[hidden] {
  display: none;
}

.product-editor-combo-menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  z-index: 20;
  width: 100%;
  max-height: 132px;
  overflow-y: auto;
  overflow-x: hidden;
  display: grid;
  padding: 4px;
  border: 1px solid rgba(0, 71, 132, .12);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 8px 18px rgba(15, 23, 42, .08);
}

.product-editor-combo-menu.open-up {
  top: auto;
  bottom: calc(100% + 4px);
}

.product-editor-combo-menu button {
  min-width: 0;
  width: 100%;
  padding: 7px 8px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  text-align: left;
  overflow-wrap: anywhere;
  cursor: pointer;
}

.product-editor-combo-menu button:hover,
.product-editor-combo-menu button:focus-visible {
  background: rgba(0, 71, 132, .06);
  color: var(--primary);
  outline: none;
}

.product-editor-actions {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.product-editor-actions button {
  width: 100%;
}

.product-editor-modal input::placeholder {
  color: #aab3bf;
  opacity: 1;
}

.product-editor-search-panel {
  display: grid;
  gap: 5px;
  padding: 7px;
  border: 1px solid rgba(0, 71, 132, .12);
  border-radius: 8px;
  background: rgba(255, 255, 255, .78);
}

.product-editor-search-panel[hidden] {
  display: none;
}

.product-editor-search-status {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.35;
}

.product-editor-search-results {
  max-height: 190px;
  overflow-y: auto;
  overflow-x: hidden;
  display: grid;
  gap: 3px;
}

.product-row-actions {
  display: grid;
  gap: 8px;
  justify-items: end;
}

.product-action-button {
  width: 32px;
  height: 32px;
  border-color: rgba(0, 71, 132, .18);
  background: rgba(255,255,255,.72);
  color: var(--primary);
  border-radius: 9px;
}

.product-action-button.danger {
  border-color: rgba(200, 30, 56, .18);
  color: var(--red);
}

.new-product-panel,
.api-lookup {
  display: grid;
  gap: 10px;
  padding: 10px;
  border: 1px solid rgba(0, 71, 132, .16);
  border-radius: 8px;
  background: rgba(0, 71, 132, .035);
}

.api-lookup {
  background: rgba(7, 134, 74, .04);
  border-color: rgba(7, 134, 74, .18);
}

.small-title {
  font-size: 13px;
}

.lookup-status {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

.batch-import-note {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.batch-import-header-card {
  gap: 8px;
}

.batch-import-headers {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 14px;
  row-gap: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.batch-header-item {
  min-width: 0;
  display: grid;
  gap: 2px;
  align-content: start;
  padding: 7px 0;
  border-bottom: 1px solid var(--border);
}

.batch-header-item span {
  color: var(--text);
  font-size: 10px;
}

.batch-import-headers code {
  color: var(--muted);
  font-size: 9px;
  white-space: normal;
  overflow-wrap: anywhere;
}

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

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

.field input,
.field select,
.field textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  min-height: 36px;
  padding: 8px 9px;
  color: var(--text);
}

.debit-panel .field input,
.debit-panel .field select,
.debit-panel .field textarea,
.debit-panel .date-picker-trigger,
.credit-panel .field input,
.credit-panel .field select,
.credit-panel .field textarea,
.credit-panel .date-picker-trigger {
  color: var(--muted);
  font-size: 12px;
}

.debit-panel .field input:not([type="hidden"]),
.debit-panel .field select,
.debit-panel .date-picker-trigger,
.credit-panel .field input:not([type="hidden"]),
.credit-panel .field select,
.credit-panel .date-picker-trigger {
  height: 36px;
  min-height: 36px;
}

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

.transaction-type-select {
  height: 36px;
  min-height: 36px;
  padding-top: 0;
  padding-bottom: 0;
  font-weight: 400;
}

.field .transaction-type-select.type-subscribe {
  color: #2563eb;
  border-color: rgba(37, 99, 235, .24);
  background-color: rgba(37, 99, 235, .055);
}

.field .transaction-type-select.type-purchase {
  color: #07864a;
  border-color: rgba(7, 134, 74, .24);
  background-color: rgba(7, 134, 74, .055);
}

.field .transaction-type-select.type-convert {
  color: #7c3aed;
  border-color: rgba(124, 58, 237, .22);
  background-color: rgba(124, 58, 237, .055);
}

.field .transaction-type-select.type-redeem-partial {
  color: #d97706;
  border-color: rgba(217, 119, 6, .25);
  background-color: rgba(217, 119, 6, .06);
}

.field .transaction-type-select.type-redeem-full {
  color: #c81e38;
  border-color: rgba(200, 30, 56, .24);
  background-color: rgba(200, 30, 56, .055);
}

.transaction-type-option.type-subscribe { color: #2563eb; }
.transaction-type-option.type-purchase { color: #07864a; }
.transaction-type-option.type-convert { color: #7c3aed; }
.transaction-type-option.type-redeem-partial { color: #d97706; }
.transaction-type-option.type-redeem-full { color: #c81e38; }

.transaction-type-option {
  font-weight: 400;
}

.filter-modal .filter-form-grid {
  grid-template-columns: 1fr;
}

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

.segment {
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 9px;
  padding: 10px;
  cursor: pointer;
  color: var(--muted);
}

.segment.active.income {
  border-color: var(--green);
  background: rgba(7, 134, 74, .11);
  color: var(--green);
}

.segment.active.expense {
  border-color: var(--red);
  background: rgba(200, 30, 56, .1);
  color: var(--red);
}

.empty {
  padding: 34px 12px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}

.toast {
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 20px;
  z-index: 8;
  background: rgba(17, 24, 39, .92);
  color: #fff;
  padding: 11px 13px;
  border-radius: 12px;
  font-size: 13px;
  transform: translateY(20px);
  opacity: 0;
  pointer-events: none;
  transition: .2s ease;
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

.back-to-top {
  position: sticky;
  left: 100%;
  bottom: 10px;
  z-index: 3;
  width: 38px;
  height: 38px;
  margin: -54px 2px 0 auto;
  border: 1px solid rgba(0, 71, 132, .18);
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, .9);
  color: var(--primary);
  box-shadow: 0 10px 24px rgba(9, 28, 55, .14);
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: .18s ease;
  cursor: pointer;
}

.back-to-top.show {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

@keyframes chart-pane-enter {
  from {
    opacity: .18;
    transform: translateY(5px);
    filter: blur(1px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0);
  }
}

@keyframes chart-controls-enter {
  from { opacity: .35; }
  to { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .chart-scroll,
  .chart-legend-row {
    animation: none;
  }

  .chart-tab {
    transition: none;
  }
}

@media (max-width: 850px) {
  .preview-shell {
    grid-template-columns: 1fr;
    padding: 18px;
  }
  .preview-info {
    max-width: 430px;
  }
  .preview-info h1 {
    font-size: 28px;
  }
}

/* Standalone Web App shell */
body.web-app-body {
  width: 100vw;
  min-height: 100vh;
  min-height: 100dvh;
  overflow: hidden;
  background: linear-gradient(135deg, #eef3f8 0%, #ffffff 46%, #edf5fb 100%);
}

.web-app-shell {
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  min-height: 0;
}

.ios-app.web-app {
  width: 100%;
  height: 100%;
  min-height: 0;
  border-radius: 0;
  box-shadow: none;
  background: var(--bg);
}

.ios-app.web-app .topbar {
  height: 56px;
  padding: 0 clamp(16px, 3vw, 34px);
}

.ios-app.web-app .topbar strong {
  max-width: 48%;
  font-size: 15px;
}

.ios-app.web-app .page-watermark {
  inset: 56px 0 0;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  grid-template-rows: repeat(8, minmax(0, 1fr));
}

.ios-app.web-app .screen {
  height: calc(100vh - 56px);
  height: calc(100dvh - 56px);
  padding: 22px clamp(16px, 3.6vw, 42px) 44px;
}

.ios-app.web-app .page {
  width: min(100%, 1120px);
  margin: 0 auto;
}

.ios-app.web-app .drawer {
  width: min(320px, 84vw);
}

@media (max-width: 720px) {
  .ios-app.web-app .topbar {
    padding: 0 14px;
  }

  .ios-app.web-app .topbar strong {
    max-width: 44%;
    font-size: 14px;
  }

  .ios-app.web-app .page-watermark {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-template-rows: repeat(6, minmax(0, 1fr));
  }

  .ios-app.web-app .screen {
    padding: 18px 14px 34px;
  }

  .ios-app.web-app .page {
    width: 100%;
  }
}

/* Manus-inspired production refinement */
body.web-app-body {
  background: #fff;
}

.ios-app.web-app {
  background: #fff;
}

.ios-app.web-app .card {
  border-color: rgba(148, 163, 184, .22);
  border-radius: 12px;
  box-shadow: 0 12px 28px rgba(15, 23, 42, .045);
}

.ios-app.web-app .metric {
  background: linear-gradient(135deg, rgba(248, 252, 255, .98), rgba(241, 247, 253, .94));
  border-color: rgba(86, 133, 176, .42);
  box-shadow: 0 10px 24px rgba(15, 50, 86, .055);
}

.ios-app.web-app .panel {
  background: rgba(255, 255, 255, .98);
  box-shadow: 0 16px 36px rgba(15, 23, 42, .055);
}

.ios-app.web-app .pill,
.ios-app.web-app .chart-tab,
.ios-app.web-app .outline,
.ios-app.web-app .ghost,
.ios-app.web-app .primary {
  border-radius: 999px;
}

.ios-app.web-app .primary {
  background: #004784;
  border-color: #004784;
}

.ios-app.web-app .outline,
.ios-app.web-app .ghost {
  background: #fff;
  border-color: rgba(148, 163, 184, .26);
}

.ios-app.web-app .page-head h2 {
  color: #071829;
}

@media (min-width: 920px) {
  body.web-app-body {
    background: #fff;
  }

  .ios-app.web-app .topbar {
    display: none;
  }

  .ios-app.web-app .drawer {
    inset: 0 auto 0 0;
    width: 262px;
    max-width: 262px;
    transform: none;
    background:
      radial-gradient(circle at 82% 15%, rgba(0, 194, 168, .09), transparent 28%),
      linear-gradient(155deg, rgba(8, 160, 138, .06), transparent 34%),
      #06121a;
    border-right: 1px solid rgba(255, 255, 255, .06);
    box-shadow: none;
  }

  .ios-app.web-app .drawer::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
      radial-gradient(circle, rgba(255, 255, 255, .07) 1px, transparent 1px),
      linear-gradient(135deg, transparent 0 68%, rgba(255, 255, 255, .035) 68.2%, transparent 68.6%);
    background-size: 22px 22px, 180px 180px;
    opacity: .72;
    pointer-events: none;
  }

  .ios-app.web-app .drawer-backdrop {
    display: none;
  }

  .ios-app.web-app .drawer-head {
    position: relative;
    z-index: 1;
    height: 68px;
    padding: 0 22px;
    gap: 10px;
    color: #fff;
    font-size: 18px;
    letter-spacing: 0;
  }

  .ios-app.web-app .drawer-head::before {
    content: "‹";
    color: rgba(255, 255, 255, .62);
    font-size: 22px;
    line-height: 1;
  }

  .ios-app.web-app .close-button {
    display: none;
  }

  .ios-app.web-app .drawer-body {
    position: relative;
    z-index: 1;
    padding: 4px 8px 16px;
  }

  .ios-app.web-app .drawer-body::before {
    display: none;
  }

  .ios-app.web-app .menu-group {
    margin: 0 0 16px;
    padding: 0 0 6px;
    border-bottom: 0;
  }

  .ios-app.web-app .group-title {
    padding: 10px 8px;
    font-size: 17px;
    font-weight: 800;
  }

  .ios-app.web-app .group-title::before {
    content: "";
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: currentColor;
    box-shadow: 0 0 18px currentColor;
  }

  .ios-app.web-app .menu-item {
    min-height: 40px;
    padding: 9px 12px 9px 30px;
    border-left: 3px solid transparent;
    border-radius: 0 8px 8px 0;
    color: rgba(226, 232, 240, .62);
    background: transparent;
    font-size: 14px;
  }

  .ios-app.web-app .menu-item:hover {
    color: rgba(255, 255, 255, .88);
    background: rgba(255, 255, 255, .035);
  }

  .ios-app.web-app .menu-item.active {
    color: var(--item-color);
    border-left-color: var(--item-color);
    background: color-mix(in srgb, var(--item-color) 15%, transparent);
  }

  .ios-app.web-app .menu-item b .ui-icon {
    width: 16px;
    height: 16px;
    stroke-width: 2;
  }

  .ios-app.web-app .drawer-foot {
    position: relative;
    z-index: 1;
    margin: 10px 10px 14px;
    padding: 12px;
    border: 1px solid rgba(255, 255, 255, .08);
    border-radius: 12px;
    background: rgba(255, 255, 255, .045);
  }

  .ios-app.web-app .avatar {
    background: rgba(0, 194, 168, .18);
    color: #34d399;
  }

  .ios-app.web-app .screen {
    height: 100vh;
    height: 100dvh;
    margin-left: 262px;
    padding: 24px clamp(24px, 3vw, 42px) 54px;
    background: #fff;
  }

  .ios-app.web-app .page {
    width: min(100%, 1160px);
    margin: 0 auto;
    gap: 22px;
  }

  .ios-app.web-app .page-watermark {
    inset: 0 0 0 262px;
    opacity: .62;
  }

  .ios-app.web-app .page-head {
    min-height: 46px;
    align-items: center;
  }

  .ios-app.web-app .page-head h2 {
    font-size: 28px;
    line-height: 1.08;
  }

  .ios-app.web-app .actions {
    align-items: center;
  }

  .ios-app.web-app .grid {
    gap: 14px;
  }

  .ios-app.web-app .metric {
    min-height: 112px;
    padding: 24px 16px 16px;
  }

  .ios-app.web-app .metric-title {
    font-size: 16px;
  }

  .ios-app.web-app .panel-title {
    font-size: 17px;
  }

  .ios-app.web-app .chart-frame,
  .ios-app.web-app .chart-scroll,
  .ios-app.web-app .timeline-chart {
    border-radius: 10px;
  }
}
