:root {
  color-scheme: dark;
  --bg: #08100d;
  --surface: #101b16;
  --surface-raised: #15241d;
  --surface-soft: #1a2a22;
  --ink: #f1f7f2;
  --muted: #8ea398;
  --line: rgba(189, 222, 199, 0.13);
  --mint: #7ee2a8;
  --lime: #c9f36b;
  --amber: #f0bc6d;
  --coral: #ff826d;
  --blue: #72b7ff;
  --purple: #b39aff;
  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 16px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html {
  min-height: 100%;
  background: var(--bg);
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 15% -5%, rgba(126, 226, 168, 0.14), transparent 32rem),
    radial-gradient(circle at 100% 35%, rgba(201, 243, 107, 0.08), transparent 28rem),
    var(--bg);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "PingFang SC",
    "Microsoft YaHei UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

button,
input,
select {
  font: inherit;
}

button {
  color: inherit;
  cursor: pointer;
}

button:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 2px solid var(--mint);
  outline-offset: 2px;
}

.ambient {
  position: fixed;
  z-index: 0;
  width: 22rem;
  height: 22rem;
  border-radius: 999px;
  pointer-events: none;
  filter: blur(90px);
  opacity: 0.12;
}

.ambient-one {
  top: 15%;
  left: -14rem;
  background: var(--mint);
}

.ambient-two {
  right: -15rem;
  bottom: 10%;
  background: var(--lime);
}

.app-shell {
  position: relative;
  z-index: 1;
  width: min(100%, 520px);
  min-height: 100vh;
  margin: 0 auto;
  padding: calc(var(--safe-top) + 18px) 18px calc(112px + var(--safe-bottom));
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 58px;
  margin-bottom: 20px;
}

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

.language-button {
  min-width: 44px;
  height: 36px;
  padding: 0 10px;
  border: 1px solid rgba(126, 226, 168, 0.2);
  border-radius: 999px;
  background: rgba(126, 226, 168, 0.07);
  color: var(--mint);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 10px;
  font-weight: 700;
}

.install-banner {
  display: grid;
  grid-template-columns: 1fr 28px;
  gap: 12px;
  align-items: start;
  padding: 13px 13px 13px 15px;
  margin: 0 0 13px;
  border: 1px solid rgba(114, 183, 255, 0.2);
  border-radius: 16px;
  background: linear-gradient(130deg, rgba(114, 183, 255, 0.1), rgba(16, 27, 22, 0.88));
}

.install-banner[hidden] {
  display: none;
}

.install-banner strong {
  font-size: 10.5px;
}

.install-banner p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.55;
}

.install-banner button {
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  font-size: 18px;
}

.language-gate {
  position: fixed;
  z-index: 100;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at 20% 0%, rgba(126, 226, 168, 0.16), transparent 35rem),
    radial-gradient(circle at 100% 90%, rgba(201, 243, 107, 0.09), transparent 30rem),
    #07100c;
}

.language-gate[hidden] {
  display: none;
}

.language-gate-card {
  width: min(100%, 390px);
  padding: 29px 23px 24px;
  border: 1px solid rgba(126, 226, 168, 0.18);
  border-radius: 29px;
  background: rgba(14, 26, 20, 0.93);
  box-shadow: 0 30px 100px rgba(0, 0, 0, 0.48);
}

.language-gate-mark {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  width: 53px;
  height: 53px;
  padding: 13px;
  margin-bottom: 22px;
  border: 1px solid rgba(126, 226, 168, 0.28);
  border-radius: 17px;
  background: rgba(126, 226, 168, 0.07);
}

.language-gate-mark span {
  width: 6px;
  border-radius: 4px 4px 1px 1px;
  background: var(--mint);
}

.language-gate-mark span:nth-child(1) { height: 12px; opacity: 0.55; }
.language-gate-mark span:nth-child(2) { height: 25px; }
.language-gate-mark span:nth-child(3) { height: 18px; opacity: 0.8; }

.language-gate-card h2 {
  margin: 8px 0 10px;
  font-size: 27px;
  letter-spacing: -0.03em;
}

.language-gate-copy {
  margin: 0 0 21px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.65;
}

.language-options {
  display: grid;
  gap: 9px;
}

.language-options button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 66px;
  padding: 0 17px;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: var(--surface-raised);
  text-align: left;
}

.language-options button:hover {
  border-color: rgba(126, 226, 168, 0.38);
  background: rgba(126, 226, 168, 0.08);
}

.language-options strong {
  font-size: 15px;
}

.language-options span {
  color: var(--muted);
  font-size: 9.5px;
}

.language-gate-card > small {
  display: block;
  margin-top: 18px;
  color: #63786b;
  font-size: 8.5px;
  line-height: 1.6;
  text-align: center;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand h1 {
  margin: 1px 0 0;
  font-size: 25px;
  line-height: 1;
  letter-spacing: 0.04em;
}

.brand-mark {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  width: 39px;
  height: 39px;
  padding: 9px;
  border: 1px solid rgba(126, 226, 168, 0.35);
  border-radius: 13px;
  background: linear-gradient(150deg, rgba(126, 226, 168, 0.22), rgba(126, 226, 168, 0.03));
  box-shadow: inset 0 0 20px rgba(126, 226, 168, 0.08);
}

.brand-mark span {
  width: 5px;
  border-radius: 3px 3px 1px 1px;
  background: var(--mint);
}

.brand-mark span:nth-child(1) { height: 10px; opacity: 0.55; }
.brand-mark span:nth-child(2) { height: 19px; }
.brand-mark span:nth-child(3) { height: 14px; opacity: 0.8; }

.eyebrow {
  margin: 0;
  color: var(--muted);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.15em;
}

.round-button,
.icon-button {
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  background: rgba(21, 36, 29, 0.78);
  color: var(--muted);
}

.round-button {
  width: 36px;
  height: 36px;
  border-radius: 999px;
  font-weight: 700;
}

.icon-button {
  width: 34px;
  height: 34px;
  border-radius: 12px;
  font-size: 22px;
  line-height: 1;
}

.view {
  display: none;
  animation: view-in 260ms ease both;
}

.view.active {
  display: block;
}

@keyframes view-in {
  from { opacity: 0; transform: translateY(7px); }
  to { opacity: 1; transform: translateY(0); }
}

.month-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.month-picker {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.month-picker span {
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.09em;
}

.month-value-wrap {
  position: relative;
  display: block;
  min-width: 154px;
  text-align: center;
}

.month-value-wrap strong {
  display: block;
  min-height: 22px;
  color: var(--ink);
  font-size: 15px;
}

.month-picker input {
  position: absolute;
  inset: 0;
  width: 154px;
  border: 0;
  background: transparent;
  opacity: 0;
}

.hero-card {
  position: relative;
  overflow: hidden;
  min-height: 230px;
  padding: 22px;
  border: 1px solid rgba(126, 226, 168, 0.23);
  border-radius: var(--radius-xl);
  background:
    linear-gradient(145deg, rgba(23, 46, 35, 0.96), rgba(11, 22, 17, 0.98)),
    var(--surface);
  box-shadow: 0 20px 65px rgba(0, 0, 0, 0.25), inset 0 1px rgba(255, 255, 255, 0.04);
}

.hero-glow {
  position: absolute;
  right: -65px;
  top: -80px;
  width: 230px;
  height: 230px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(201, 243, 107, 0.24), transparent 68%);
  filter: blur(5px);
}

.hero-topline,
.hero-foot {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #c0d1c6;
  font-size: 12px;
}

.live-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 9px;
  border: 1px solid rgba(126, 226, 168, 0.2);
  border-radius: 999px;
  color: var(--mint);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.09em;
}

.live-pill i {
  width: 5px;
  height: 5px;
  border-radius: 99px;
  background: var(--mint);
  box-shadow: 0 0 10px var(--mint);
}

.hero-amount {
  position: relative;
  display: flex;
  align-items: baseline;
  gap: 7px;
  margin: 28px 0 20px;
}

.hero-amount small {
  color: var(--mint);
  font-size: 21px;
  font-weight: 600;
}

.hero-amount strong {
  font-size: clamp(48px, 13vw, 66px);
  font-weight: 650;
  line-height: 0.95;
  letter-spacing: -0.055em;
}

.hero-foot {
  color: var(--muted);
  font-size: 10px;
}

.sparkline {
  position: absolute;
  right: 18px;
  bottom: 10px;
  width: 47%;
  height: 48px;
  opacity: 0.75;
}

.metric-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 11px 0;
}

.metric-card {
  min-height: 120px;
  padding: 17px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: rgba(16, 27, 22, 0.86);
}

.metric-card strong {
  display: block;
  margin: 15px 0 5px;
  font-size: 23px;
  letter-spacing: -0.02em;
}

.metric-card small {
  color: var(--muted);
  font-size: 10px;
}

.metric-label {
  color: #b8c9bf;
  font-size: 11px;
}

.impulse-card strong {
  color: var(--lime);
}

.panel {
  margin-top: 11px;
  padding: 19px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: rgba(16, 27, 22, 0.86);
}

.panel-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.panel-heading h2,
.view-heading h2,
.sheet-heading h2 {
  margin: 4px 0 0;
  font-size: 19px;
  letter-spacing: -0.02em;
}

.muted-caption,
.soft-badge {
  color: var(--muted);
  font-size: 9px;
}

.soft-badge {
  padding: 6px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  white-space: nowrap;
}

.category-breakdown {
  display: grid;
  gap: 13px;
}

.category-line {
  display: grid;
  grid-template-columns: 66px 1fr 58px;
  align-items: center;
  gap: 10px;
}

.category-name {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 11px;
}

.category-dot {
  width: 7px;
  height: 7px;
  border-radius: 99px;
}

.category-track {
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
}

.category-fill {
  height: 100%;
  border-radius: inherit;
  transform-origin: left;
  animation: grow-bar 500ms cubic-bezier(.2,.8,.2,1) both;
}

@keyframes grow-bar {
  from { transform: scaleX(0); }
}

.category-value {
  color: var(--muted);
  font-size: 10px;
  text-align: right;
}

.budget-total {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 17px;
  margin-bottom: 13px;
  border-radius: var(--radius-md);
  background: linear-gradient(110deg, rgba(126, 226, 168, 0.13), rgba(201, 243, 107, 0.04));
}

.budget-total span { color: #bdcfc3; font-size: 11px; }
.budget-total strong { color: var(--lime); font-size: 27px; }

.budget-rows {
  display: grid;
  gap: 10px;
}

.budget-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 2px;
  color: #c2d0c7;
  font-size: 11px;
}

.budget-row strong {
  color: var(--ink);
  font-size: 12px;
}

.advice-list {
  display: grid;
  gap: 9px;
  margin-top: 16px;
}

.advice {
  position: relative;
  padding: 11px 12px 11px 31px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.035);
  color: #aebfb5;
  font-size: 10.5px;
  line-height: 1.55;
}

.advice::before {
  content: "↗";
  position: absolute;
  left: 11px;
  top: 10px;
  color: var(--mint);
}

.text-button {
  border: 0;
  background: transparent;
  color: var(--mint);
  font-size: 10px;
  font-weight: 650;
}

.transaction-list {
  display: grid;
  gap: 2px;
}

.transaction-row {
  display: grid;
  grid-template-columns: 39px 1fr auto 26px;
  align-items: center;
  gap: 10px;
  padding: 11px 0;
  border-bottom: 1px solid rgba(189, 222, 199, 0.08);
}

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

.transaction-icon {
  display: grid;
  place-items: center;
  width: 39px;
  height: 39px;
  border-radius: 13px;
  background: rgba(126, 226, 168, 0.1);
  font-size: 17px;
}

.transaction-main strong {
  display: block;
  overflow: hidden;
  max-width: 195px;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
  font-weight: 600;
}

.transaction-main small,
.transaction-amount small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 9px;
}

.transaction-amount {
  text-align: right;
  font-size: 12px;
  font-weight: 650;
}

.delete-transaction {
  width: 26px;
  height: 26px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: #61746a;
  font-size: 16px;
}

.empty-state {
  padding: 28px 10px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.65;
  text-align: center;
}

.view-heading {
  margin: 7px 2px 20px;
}

.view-heading > p:last-child {
  margin: 9px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.6;
}

.chart-wrap {
  width: 100%;
  overflow: hidden;
}

.chart-wrap svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}

.chart-grid {
  stroke: rgba(189, 222, 199, 0.08);
  stroke-width: 1;
}

.chart-label {
  fill: #758b7e;
  font-size: 8px;
  font-family: -apple-system, BlinkMacSystemFont, sans-serif;
}

.chart-bar {
  fill: var(--mint);
  opacity: 0.84;
}

.chart-bar.current {
  fill: var(--lime);
  opacity: 1;
}

.chart-value {
  fill: #d9e7dd;
  font-size: 8px;
  font-weight: 600;
}

.comparison-card {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  overflow: hidden;
  margin-top: 11px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--line);
}

.comparison-card div {
  padding: 17px 12px;
  background: var(--surface);
}

.comparison-card span {
  display: block;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 9px;
}

.comparison-card strong {
  font-size: 14px;
  font-weight: 650;
}

.signal-list {
  display: grid;
  gap: 13px;
}

.signal-row {
  display: grid;
  grid-template-columns: 91px 1fr 32px;
  align-items: center;
  gap: 10px;
  color: #b5c6bc;
  font-size: 10px;
}

.signal-track {
  height: 5px;
  overflow: hidden;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.06);
}

.signal-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--mint), var(--lime));
}

.signal-row strong {
  color: var(--ink);
  font-size: 10px;
  text-align: right;
}

.small-note {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 9.5px;
  line-height: 1.6;
}

.limit-card {
  display: grid;
  grid-template-columns: 43px 1fr;
  gap: 14px;
  padding: 19px;
  margin-bottom: 11px;
  border: 1px solid rgba(240, 188, 109, 0.22);
  border-radius: var(--radius-lg);
  background: linear-gradient(130deg, rgba(240, 188, 109, 0.1), rgba(16, 27, 22, 0.94));
}

.limit-icon {
  display: grid;
  place-items: center;
  width: 43px;
  height: 43px;
  border-radius: 14px;
  background: rgba(240, 188, 109, 0.12);
  color: var(--amber);
  font-size: 10px;
  font-weight: 800;
}

.limit-card h3 {
  margin: 1px 0 7px;
  font-size: 13px;
}

.limit-card p {
  margin: 0;
  color: #9eb0a5;
  font-size: 10px;
  line-height: 1.65;
}

.drop-zone {
  display: grid;
  place-items: center;
  min-height: 175px;
  padding: 22px;
  border: 1px dashed rgba(126, 226, 168, 0.33);
  border-radius: var(--radius-md);
  background: rgba(126, 226, 168, 0.035);
  text-align: center;
}

.drop-zone input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.upload-symbol {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  margin-bottom: 10px;
  border-radius: 16px;
  background: rgba(126, 226, 168, 0.11);
  color: var(--mint);
  font-size: 25px;
}

.drop-zone strong {
  font-size: 12px;
}

.drop-zone small {
  margin-top: 6px;
  color: var(--muted);
  font-size: 9.5px;
}

.image-ocr-panel {
  position: relative;
  overflow: hidden;
  border-color: rgba(114, 183, 255, 0.2);
}

.image-ocr-panel::before {
  content: "";
  position: absolute;
  top: -120px;
  right: -110px;
  width: 260px;
  height: 260px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(114, 183, 255, 0.13), transparent 68%);
  pointer-events: none;
}

.ocr-intro {
  margin: -4px 0 15px;
}

.image-drop-zone {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 165px;
  padding: 20px;
  border: 1px dashed rgba(114, 183, 255, 0.38);
  border-radius: var(--radius-md);
  background:
    linear-gradient(rgba(114, 183, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(114, 183, 255, 0.035) 1px, transparent 1px),
    rgba(12, 25, 31, 0.7);
  background-size: 18px 18px;
  text-align: center;
}

.image-drop-zone input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.image-upload-icon {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  margin-bottom: 10px;
  border: 1px solid rgba(114, 183, 255, 0.22);
  border-radius: 17px;
  background: rgba(114, 183, 255, 0.09);
  color: var(--blue);
  font-size: 24px;
}

.image-drop-zone strong {
  font-size: 12px;
}

.image-drop-zone small {
  margin-top: 6px;
  color: var(--muted);
  font-size: 9.5px;
}

.receipt-preview {
  overflow: hidden;
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: #050908;
}

.receipt-preview[hidden],
.ocr-review[hidden],
.ocr-progress[hidden] {
  display: none;
}

.receipt-preview img {
  display: block;
  width: 100%;
  max-height: 330px;
  object-fit: contain;
}

.receipt-preview-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 9.5px;
}

.receipt-preview-meta span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ocr-start-button {
  width: 100%;
  margin-top: 12px;
}

.ocr-start-button:disabled {
  cursor: not-allowed;
  opacity: 0.38;
}

.ocr-progress {
  margin-top: 14px;
  padding: 13px;
  border-radius: 13px;
  background: rgba(114, 183, 255, 0.06);
}

.ocr-error-detail {
  padding: 13px;
  margin-top: 12px;
  border: 1px solid rgba(255, 130, 109, 0.25);
  border-radius: 13px;
  background: rgba(255, 130, 109, 0.07);
}

.ocr-error-detail[hidden] {
  display: none;
}

.ocr-error-detail strong {
  color: var(--coral);
  font-size: 10.5px;
}

.ocr-error-detail p {
  margin: 6px 0 10px;
  color: #c6a8a1;
  font-size: 9px;
  line-height: 1.55;
  word-break: break-word;
}

.ocr-error-detail .secondary-button {
  width: 100%;
}

.ocr-progress-head {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
  color: #b7c9d3;
  font-size: 9.5px;
}

.ocr-progress-head strong {
  color: var(--blue);
}

.ocr-progress-track {
  height: 5px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
}

.ocr-progress-track i {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--blue), var(--mint));
  transition: width 220ms ease;
}

.ocr-review {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.ocr-review-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 13px;
}

.ocr-review-heading h3 {
  margin: 4px 0 0;
  font-size: 16px;
}

.raw-ocr {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 9.5px;
}

.raw-ocr summary {
  cursor: pointer;
}

.raw-ocr textarea {
  width: 100%;
  min-height: 120px;
  padding: 11px;
  margin-top: 9px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #09110d;
  color: #9db0a4;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 9px;
  line-height: 1.55;
}

.ocr-transaction-editor {
  display: grid;
  gap: 9px;
}

.ocr-edit-card {
  display: grid;
  gap: 9px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.025);
}

.ocr-edit-card.unchecked {
  opacity: 0.48;
}

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

.ocr-edit-check {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 9.5px;
}

.ocr-edit-check input {
  width: 17px;
  height: 17px;
  accent-color: var(--mint);
}

.ocr-edit-amount {
  width: 122px !important;
  min-height: 39px !important;
  text-align: right;
}

.ocr-edit-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 8px;
}

.ocr-edit-card input,
.ocr-edit-card select {
  width: 100%;
  min-height: 40px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface-raised);
  color: var(--ink);
  font-size: 10px;
}

.ocr-edit-card label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 8.5px;
}

.ocr-empty-result {
  padding: 18px 10px;
  border-radius: 13px;
  background: rgba(240, 188, 109, 0.06);
  color: #c5b28f;
  font-size: 10px;
  line-height: 1.65;
  text-align: center;
}

.ocr-save-note {
  margin: 11px 0 0;
  color: var(--muted);
  font-size: 8.8px;
  line-height: 1.55;
}

.import-result {
  padding: 12px;
  margin-top: 12px;
  border-radius: 12px;
  background: rgba(126, 226, 168, 0.08);
  color: #b9d5c4;
  font-size: 10px;
  line-height: 1.55;
}

.import-result.error {
  background: rgba(255, 130, 109, 0.08);
  color: #e1b4aa;
}

.import-help {
  margin-top: 14px;
  color: var(--muted);
  font-size: 10px;
}

.import-help summary {
  cursor: pointer;
  color: #b9c9c0;
}

.import-help p {
  margin: 10px 0 0;
  line-height: 1.6;
}

.button-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
  margin-top: 16px;
}

.secondary-button,
.danger-button {
  min-height: 43px;
  border-radius: 13px;
  font-size: 10.5px;
}

.secondary-button {
  border: 1px solid var(--line);
  background: var(--surface-soft);
  color: #c8d6cd;
}

.danger-button {
  grid-column: 1 / -1;
  border: 1px solid rgba(255, 130, 109, 0.2);
  background: rgba(255, 130, 109, 0.06);
  color: var(--coral);
}

.floating-add {
  position: fixed;
  z-index: 20;
  right: max(22px, calc((100vw - 520px) / 2 + 22px));
  bottom: calc(87px + var(--safe-bottom));
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 49px;
  padding: 0 17px 0 14px;
  border: 1px solid rgba(201, 243, 107, 0.42);
  border-radius: 999px;
  background: linear-gradient(135deg, var(--lime), #9cdd82);
  color: #112016;
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.34), 0 0 24px rgba(201, 243, 107, 0.14);
}

.floating-add span {
  font-size: 23px;
  line-height: 1;
}

.floating-add em {
  font-size: 11px;
  font-style: normal;
  font-weight: 700;
}

.tabbar {
  position: fixed;
  z-index: 18;
  right: 18px;
  bottom: calc(13px + var(--safe-bottom));
  left: 18px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  width: min(calc(100% - 36px), 484px);
  min-height: 62px;
  margin: 0 auto;
  padding: 7px;
  border: 1px solid rgba(189, 222, 199, 0.14);
  border-radius: 22px;
  background: rgba(14, 25, 20, 0.93);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.42);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
}

.tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  border: 0;
  border-radius: 16px;
  background: transparent;
  color: #6f8377;
  font-size: 9px;
}

.tab.active {
  background: rgba(126, 226, 168, 0.1);
  color: var(--mint);
}

.tab-icon {
  font-size: 18px;
  line-height: 1;
}

.sheet-backdrop {
  position: fixed;
  z-index: 40;
  inset: 0;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 18px 0 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
}

.sheet-backdrop[hidden] {
  display: none;
}

.bottom-sheet {
  width: min(100%, 520px);
  max-height: 91vh;
  overflow-y: auto;
  padding: 9px 19px calc(25px + var(--safe-bottom));
  border: 1px solid var(--line);
  border-bottom: 0;
  border-radius: 28px 28px 0 0;
  background: #111d17;
  box-shadow: 0 -24px 80px rgba(0, 0, 0, 0.42);
  animation: sheet-up 280ms cubic-bezier(.2,.8,.2,1) both;
}

@keyframes sheet-up {
  from { transform: translateY(100%); }
}

.sheet-handle {
  width: 39px;
  height: 4px;
  margin: 1px auto 17px;
  border-radius: 99px;
  background: #31463a;
}

.sheet-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 23px;
}

.sheet-heading .icon-button {
  font-size: 21px;
}

#entryForm {
  display: grid;
  gap: 16px;
}

#entryForm label {
  display: grid;
  gap: 8px;
  color: #92a69a;
  font-size: 10px;
}

#entryForm input,
#entryForm select {
  width: 100%;
  min-height: 47px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--surface-raised);
  color: var(--ink);
}

.amount-field > div {
  display: flex;
  align-items: baseline;
  padding: 2px 14px;
  border: 1px solid rgba(126, 226, 168, 0.22);
  border-radius: 18px;
  background: rgba(126, 226, 168, 0.055);
}

.amount-field small {
  color: var(--mint);
  font-size: 21px;
}

.amount-field input {
  min-height: 66px !important;
  padding: 0 9px !important;
  border: 0 !important;
  background: transparent !important;
  font-size: 39px;
  font-weight: 650;
  letter-spacing: -0.04em;
}

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

.auto-category {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 2px;
  color: var(--muted);
  font-size: 10px;
}

.auto-category strong {
  color: var(--mint);
  font-size: 10px;
}

.primary-button {
  min-height: 51px;
  border: 0;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--lime), #9dde83);
  color: #102016;
  font-size: 12px;
  font-weight: 750;
}

.toast {
  position: fixed;
  z-index: 60;
  left: 50%;
  bottom: calc(94px + var(--safe-bottom));
  max-width: min(84vw, 370px);
  padding: 10px 15px;
  border: 1px solid rgba(126, 226, 168, 0.22);
  border-radius: 999px;
  background: rgba(20, 36, 28, 0.97);
  color: #d8e8de;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
  font-size: 10.5px;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 10px);
  transition: 220ms ease;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

@media (min-width: 700px) {
  .app-shell {
    margin-top: 28px;
    border: 1px solid rgba(189, 222, 199, 0.09);
    border-radius: 36px;
    background: rgba(6, 13, 10, 0.62);
    box-shadow: 0 32px 100px rgba(0, 0, 0, 0.32);
  }

  .tabbar {
    bottom: 30px;
  }

  .floating-add {
    bottom: 106px;
  }
}

@media (max-width: 360px) {
  .app-shell { padding-left: 13px; padding-right: 13px; }
  .hero-card { padding: 18px; }
  .hero-amount strong { font-size: 45px; }
  .form-grid { grid-template-columns: 1fr; }
  .transaction-main strong { max-width: 145px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
