:root {
  color-scheme: light;
  --orange: #ff6a3d;
  --orange-dark: #f24d00;
  --green: #22c55e;
  --ink: #1f2937;
  --muted: #74777f;
  --line: #f4dfcf;
  --cream: #fff7ef;
  --card: #ffffff;
  --soft: #fff1e7;
  --shadow: 0 8px 24px rgba(31, 41, 55, 0.08);
  --shadow-soft: 0 2px 8px rgba(31, 41, 55, 0.06);
  --radius: 14px;
  --card-radius: 8px;
}

* {
  box-sizing: border-box;
}

html,
body,
#app {
  width: 100%;
  min-height: 100%;
  overflow-x: hidden;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 18% 8%, rgba(255, 106, 61, 0.13), transparent 28%),
    radial-gradient(circle at 84% 24%, rgba(255, 190, 120, 0.16), transparent 24%),
    linear-gradient(135deg, #fffdf9 0%, #fff3e9 46%, #fff9f2 100%);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", Arial, sans-serif;
}

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

button {
  border: 0;
  cursor: pointer;
}

.app-shell {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  min-height: 100vh;
  overflow: hidden;
  border: 1px solid #e6ddd4;
  background: #fff9f4;
}

.sidebar {
  display: grid;
  grid-template-rows: auto auto 1fr;
  gap: 22px;
  padding: 18px 10px;
  border-right: 1px solid var(--line);
  background: #fff6ee;
}

.traffic {
  display: flex;
  gap: 10px;
  padding-left: 18px;
}

.traffic span {
  width: 14px;
  height: 14px;
  border-radius: 50%;
}

.traffic span:nth-child(1) {
  background: #ff5f57;
}

.traffic span:nth-child(2) {
  background: #ffbd2e;
}

.traffic span:nth-child(3) {
  background: #28c840;
}

.profile {
  display: grid;
  justify-items: center;
  gap: 8px;
}

.profile strong {
  font-size: 12px;
  text-align: center;
  color: var(--muted);
  font-weight: 650;
}

.avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(255, 255, 255, 0.95);
  box-shadow: 0 8px 22px rgba(70, 42, 24, 0.18);
}

.icon-button,
.calendar-entry {
  display: grid;
  place-items: center;
  color: #111;
  background: transparent;
}

[data-lucide] {
  width: 22px;
  height: 22px;
  stroke-width: 2.15;
}

.nav {
  display: grid;
  align-content: start;
  gap: 10px;
  padding-top: 6px;
}

.nav button {
  display: grid;
  justify-items: center;
  gap: 6px;
  min-height: 72px;
  color: #8a9099;
  border-radius: 16px;
  background: transparent;
  font-size: 13px;
}

.nav button.active {
  color: var(--orange);
  background: #fff;
  box-shadow: var(--shadow-soft);
}

.nav button.active .nav-icon {
  color: var(--orange);
}

.nav-icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 14px;
  background: transparent;
  line-height: 1;
}

.nav button.active .nav-icon {
  background: #fff1e8;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 16px;
  min-width: 0;
  padding: 16px 18px 16px 14px;
}

.workspace.single {
  grid-template-columns: minmax(0, 1fr);
}

.chat-card,
.organizer {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(rgba(255, 255, 255, 0.78), rgba(255, 250, 245, 0.76)),
    var(--cream);
  box-shadow: var(--shadow);
}

.chat-card {
  position: relative;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  height: calc(100vh - 44px);
  overflow: hidden;
}

.chat-card::before,
.chat-feed::before {
  position: absolute;
  inset: 0;
  pointer-events: none;
  content: "";
  background-image:
    radial-gradient(ellipse at center, rgba(255, 106, 61, 0.08) 0 34%, transparent 35%),
    radial-gradient(ellipse at center, rgba(255, 106, 61, 0.05) 0 34%, transparent 35%);
  background-position:
    18% 16%,
    76% 54%;
  background-size:
    42px 64px,
    38px 58px;
  background-repeat: no-repeat;
  transform: rotate(-18deg);
}

.topbar {
  position: relative;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 253, 249, 0.9);
}

.mobile-statusbar {
  display: none;
}

.title-group h1 {
  margin: 0;
  font-size: 24px;
  letter-spacing: 0;
}

.title-group p {
  display: flex;
  gap: 8px;
  align-items: center;
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--green);
}

.top-actions {
  display: flex;
  gap: 12px;
  align-items: center;
  color: var(--ink);
}

.online-pill {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  color: var(--green);
  font-size: 14px;
  font-weight: 650;
}

.day-chip {
  display: inline-flex;
  gap: 4px;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  color: var(--ink);
  background: #fff4ea;
  font-size: 13px;
  font-weight: 650;
}

.day-chip [data-lucide] {
  width: 15px;
  height: 15px;
}

.divider {
  width: 1px;
  height: 22px;
  background: #d8c5b6;
}

.draft-title-desktop {
  display: none;
}

.draft-title-mobile {
  display: inline;
}

.chat-feed {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-height: 0;
  padding: 22px 24px 20px;
  overflow-y: auto;
}

.time-label {
  align-self: center;
  color: #7b8794;
  font-size: 13px;
}

.row {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  width: 100%;
  min-width: 0;
  max-width: 100%;
}

.row.user {
  justify-content: flex-end;
}

.bubble-avatar {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 8px 18px rgba(70, 42, 24, 0.14);
}

.bubble {
  max-width: min(640px, 74%);
  min-width: 0;
  padding: 13px 18px;
  border: 1px solid rgba(241, 222, 208, 0.82);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: 0 8px 24px rgba(65, 42, 24, 0.08);
  font-size: 17px;
  line-height: 1.65;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.row.user .bubble {
  border-color: rgba(255, 106, 61, 0.38);
  background: linear-gradient(135deg, #ffe0b8, #ffc070);
}

.sent-image {
  display: block;
  width: min(360px, 100%);
  max-height: 260px;
  object-fit: contain;
  border: 1px solid rgba(255, 106, 61, 0.55);
  border-radius: var(--radius);
}

.message-meta {
  display: block;
  margin-top: 8px;
  color: #7b8794;
  font-size: 12px;
  text-align: right;
}

.progress-card {
  width: min(520px, 78%);
  min-width: 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: 0 10px 30px rgba(65, 42, 24, 0.09);
}

.progress-title {
  margin-bottom: 14px;
  font-size: 18px;
  font-weight: 800;
}

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

.step {
  display: grid;
  gap: 8px;
  justify-items: center;
  color: #9b8c81;
  font-size: 12px;
}

.step::before {
  width: 30px;
  height: 30px;
  content: "";
  border-radius: 50%;
  background: #f0e6df;
  box-shadow: inset 0 0 0 1px #e4d3c5;
}

.step.active {
  color: var(--orange);
  font-weight: 800;
}

.step.active::before {
  background: var(--orange);
  box-shadow: 0 0 0 6px rgba(255, 106, 61, 0.12);
}

.draft-card {
  width: min(520px, 78%);
  min-width: 0;
  overflow: hidden;
  border: 1px solid rgba(255, 106, 61, 0.22);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 12px 28px rgba(65, 42, 24, 0.1);
}

.draft-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  color: var(--orange);
  border-bottom: 1px solid #f4dfcf;
  background: linear-gradient(180deg, #fff9f4 0%, #fff3e8 100%);
  font-weight: 700;
  font-size: 14px;
}

.draft-label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

.draft-top img {
  width: 18px;
  height: 18px;
  object-fit: contain;
  vertical-align: middle;
}

.ok-badge {
  display: inline-flex;
  gap: 4px;
  align-items: center;
  color: var(--orange);
  background: transparent;
  padding: 0;
  font-size: 12px;
  font-weight: 650;
  white-space: nowrap;
}

.ok-badge [data-lucide] {
  width: 14px;
  height: 14px;
}

.draft-body {
  display: flex;
  flex-direction: column;
  padding: 14px;
}

.amount-hero {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  padding: 4px 0 12px;
}

.amount-meta {
  min-width: 0;
}

.category-chip {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  color: #fff;
  border-radius: 50%;
  background: linear-gradient(180deg, #ff8a34, #ff4b19);
  font-weight: 900;
}

.amount-hero strong {
  display: block;
  color: #121820;
  font-size: 30px;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.amount-meta span {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 14px;
}

.amount-meta small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 13px;
}

.detail-link {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 2px;
  width: 100%;
  margin-top: 2px;
  padding: 6px 0 0;
  color: #9a9aa0;
  background: transparent;
  font-size: 13px;
  font-weight: 500;
}

.detail-link [data-lucide] {
  width: 16px;
  height: 16px;
}

.field-list {
  display: grid;
}

.field-row {
  display: grid;
  grid-template-columns: 84px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  min-height: 46px;
  border-bottom: 1px solid #f1e2d6;
  cursor: pointer;
}

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

.field-label {
  color: #8a9099;
  font-size: 14px;
}

.field-value {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 2px;
  min-width: 0;
}

.field-display {
  max-width: 100%;
  overflow: hidden;
  color: var(--ink);
  font-size: 14px;
  font-weight: 650;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
  pointer-events: none;
}

.field-row.is-amount .field-display {
  color: #111;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.field-prefix {
  width: 16px;
  height: 16px;
  color: var(--orange);
}

.pay-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #1677ff;
  box-shadow: inset 0 0 0 2px #fff;
}

.field-chevron {
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  color: #c4c4c8;
}

.field-row input,
.field-row select {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  min-width: 0;
  height: 100%;
  opacity: 0;
  border: 0;
  color: transparent;
  background: transparent;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}

.draft-actions {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

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

.primary,
.secondary,
.danger,
.text-btn {
  min-height: 44px;
  border-radius: 12px;
  font-weight: 800;
}

.primary {
  position: relative;
  overflow: hidden;
  color: #fff;
  background: linear-gradient(135deg, #ff7b25, #ff4b19);
  box-shadow: 0 10px 24px rgba(255, 106, 61, 0.24);
}

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

.text-btn {
  min-height: 32px;
  border: 0;
  background: transparent;
  font-size: 15px;
  font-weight: 650;
}

.text-btn.modify {
  color: #ef4444;
}

.text-btn.cancel {
  color: #9a9aa0;
}

.danger {
  color: #fff;
  background: #c2410c;
}

.composer {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 46px 46px minmax(0, 1fr) 46px 62px;
  gap: 10px;
  align-items: center;
  margin: 0 24px 20px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 34px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 8px 26px rgba(65, 42, 24, 0.1);
}

.round,
.send {
  display: grid;
  place-items: center;
  height: 46px;
  border-radius: 50%;
  font-weight: 900;
}

.round {
  color: #1f2937;
  border: 1px solid #e7d7ca;
  background: #fff;
}

.send {
  color: #fff;
  background: linear-gradient(135deg, #ff7b25, #ff4b19);
}

.file-input {
  display: none;
}

.composer textarea,
.composer input {
  min-height: 44px;
  max-height: 110px;
  padding: 12px 14px;
  resize: none;
  border: 1px solid #eadbd0;
  border-radius: 22px;
  background: #fffdf9;
  outline: none;
}

.organizer {
  display: grid;
  align-content: start;
  gap: 12px;
  height: calc(100vh - 32px);
  padding: 16px 14px;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fffaf6;
  box-shadow: var(--shadow-soft);
}

.organizer-head h2 {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  margin: 0;
  color: var(--ink);
  font-size: 20px;
}

.organizer-head h2 [data-lucide] {
  color: var(--orange);
  width: 18px;
  height: 18px;
}

.organizer-head p {
  margin: 4px 0 2px;
  color: var(--muted);
  font-size: 12px;
}

.summary-card {
  position: relative;
  overflow: hidden;
  padding: 16px;
  border: 1px solid rgba(241, 226, 214, 0.95);
  border-radius: var(--card-radius);
  background: #fff;
  box-shadow: var(--shadow-soft);
}

.summary-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.summary-title {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  min-width: 0;
}

.summary-title h3 {
  margin: 0;
  font-size: 16px;
}

.summary-icon {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  color: #fff;
  border-radius: 8px;
  background: linear-gradient(180deg, #ff8a4a, #ff6a3d);
}

.summary-icon [data-lucide] {
  width: 15px;
  height: 15px;
}

.summary-mascot {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  object-fit: cover;
  border: 1.5px solid #fff;
  box-shadow: var(--shadow-soft);
}

.count-badge {
  display: inline-grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  color: #fff;
  background: #ef4444;
  font-size: 11px;
  font-weight: 800;
}

.metric {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
}

.metric strong {
  display: block;
  margin-top: 4px;
  color: var(--ink);
  font-size: 26px;
  letter-spacing: -0.02em;
}

.metric > div > span,
.summary-card p {
  color: var(--muted);
  font-size: 13px;
}

.accent-line {
  margin: 6px 0 0 !important;
  color: var(--orange) !important;
  font-weight: 700;
}

.positive {
  margin: 6px 0 0 !important;
  color: var(--green) !important;
  font-weight: 700;
}

.soft-line {
  display: inline-flex;
  gap: 4px;
  align-items: center;
  margin: 6px 0 0 !important;
}

.soft-line [data-lucide],
.insight [data-lucide] {
  width: 14px;
  height: 14px;
  color: var(--orange);
}

.insight {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  margin: 10px 0 0;
  font-size: 12px;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}

.cat-tag {
  display: inline-flex;
  gap: 4px;
  align-items: center;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
}

.cat-tag [data-lucide] {
  width: 12px;
  height: 12px;
}

.cat-tag.dining {
  color: #c2410c;
  background: #ffedd5;
}

.cat-tag.transit {
  color: #15803d;
  background: #dcfce7;
}

.cat-tag.coffee {
  color: #1d4ed8;
  background: #dbeafe;
}

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

.pending-row {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.pending-icon {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  color: var(--orange);
  border-radius: 50%;
  background: #fff1e8;
}

.pending-icon [data-lucide] {
  width: 16px;
  height: 16px;
}

.pending-main strong,
.pending-side {
  display: grid;
  gap: 2px;
}

.pending-side {
  justify-items: end;
}

.pending-row small {
  color: var(--muted);
  font-size: 12px;
}

.summary-link {
  display: inline-flex;
  gap: 2px;
  align-items: center;
  margin-top: 10px;
  padding: 0;
  color: var(--orange);
  background: transparent;
  font-size: 13px;
  font-weight: 700;
}

.summary-link [data-lucide] {
  width: 15px;
  height: 15px;
}

.carrot-seal {
  position: absolute;
  right: 10px;
  bottom: 8px;
  width: 28px;
  height: 28px;
  opacity: 0.18;
  pointer-events: none;
}

.orange-amount {
  color: var(--orange);
  font-weight: 900;
}

.budget-bar {
  height: 8px;
  margin-top: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: #f1e7de;
}

.budget-bar i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #ff8a4a, #ff6a3d);
}

.donut {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: conic-gradient(#ff6a3d 0 48%, #22c55e 48% 72%, #3b82f6 72% 100%);
  -webkit-mask: radial-gradient(circle, transparent 0 42%, #000 43%);
  mask: radial-gradient(circle, transparent 0 42%, #000 43%);
}

.donut.thin {
  background: conic-gradient(#ff6a3d 0 58%, #efe4da 58% 100%);
}

.sparkline {
  width: 88px;
  height: 52px;
  background:
    linear-gradient(135deg, transparent 48%, rgba(255, 106, 61, 0.16) 49% 51%, transparent 52%),
    linear-gradient(165deg, transparent 47%, var(--orange) 48% 52%, transparent 53%);
  border-bottom: 1px dashed #ffd0b7;
}

.subpage,
.ledger-page,
.settings-page {
  display: flex;
  flex-direction: column;
  min-width: 0;
  height: calc(100vh - 44px);
  overflow: hidden;
  background:
    linear-gradient(180deg, #fff8f1 0%, #fffaf6 58%, #fff8f0 100%);
}

.subpage-topbar {
  position: relative;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 64px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 253, 249, 0.92);
}

.subpage-topbar .title-group {
  flex: 1;
  text-align: center;
}

.subpage-topbar .title-group h1 {
  font-size: 20px;
}

.subpage-topbar .title-group p {
  justify-content: center;
  margin-top: 2px;
  color: var(--muted);
  font-size: 13px;
}

.subpage-topbar .icon-button {
  width: 36px;
  height: 36px;
  color: #111;
  background: transparent;
}

.ghost-action {
  color: var(--orange) !important;
}

.subpage-body {
  flex: 1 1 auto;
  min-height: 0;
  padding: 18px;
  overflow: auto;
}

.page-panel {
  max-width: 860px;
  margin: 0 auto;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow);
}

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

.page-metrics > div {
  padding: 12px 10px;
  border-radius: 12px;
  background: #fff7ef;
  text-align: center;
}

.page-metrics span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.page-metrics strong {
  display: block;
  margin-top: 4px;
  font-size: 18px;
}

.section-title {
  margin: 8px 0 10px;
  color: var(--ink);
  font-size: 16px;
}

.transaction-list {
  display: grid;
}

.transaction {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 14px 0;
  border-bottom: 1px solid #f1e2d6;
}

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

.transaction.pending {
  padding: 12px 0;
}

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

.transaction-side {
  display: grid;
  justify-items: end;
  gap: 4px;
}

.link-btn {
  padding: 0;
  color: var(--orange);
  background: transparent;
  font-size: 13px;
  font-weight: 700;
}

.empty-hint {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

.report-stack {
  display: grid;
  gap: 12px;
  background: transparent;
  border: 0;
  box-shadow: none;
  padding: 0;
}

.report-stack .summary-card {
  margin: 0;
}

.settings-stack {
  display: grid;
  gap: 14px;
}

.settings-block h2 {
  margin: 0 0 8px;
  font-size: 16px;
}

.settings-block p {
  margin: 0 0 8px;
  color: var(--muted);
  line-height: 1.55;
}

.settings-block .mono {
  word-break: break-all;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
}

.settings-list {
  margin: 8px 0 0;
  padding-left: 18px;
  color: var(--muted);
  line-height: 1.7;
  font-size: 13px;
}

.settings-list code {
  color: var(--orange-dark);
  font-size: 12px;
}

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

.settings-links button {
  min-height: 40px;
  border-radius: 12px;
  color: var(--orange-dark);
  background: #fff1e7;
  font-weight: 700;
}

.mobile-tabbar {
  display: none;
}

.ledger-stack {
  display: grid;
  gap: 14px;
  background: transparent;
  border: 0;
  box-shadow: none;
  padding: 0;
}

.ledger-block {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 8px 22px rgba(93, 47, 17, 0.06);
}

.ledger-block .section-title {
  margin-top: 0;
}

.menu-layer {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: flex;
  align-items: flex-end;
  width: 375px;
  max-width: 100vw;
}

.menu-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(40, 24, 12, 0.28);
}

.menu-sheet {
  position: relative;
  z-index: 1;
  width: 100%;
  padding: 18px 16px max(18px, env(safe-area-inset-bottom));
  border-radius: 22px 22px 0 0;
  background: linear-gradient(180deg, #fffaf4 0%, #fff7ef 100%);
  box-shadow: 0 -12px 36px rgba(70, 36, 12, 0.16);
}

.menu-head {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  margin-bottom: 14px;
}

.menu-avatar {
  width: 52px;
  height: 52px;
}

.menu-head strong {
  display: block;
  font-size: 16px;
}

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

.menu-nav {
  display: grid;
  gap: 8px;
}

.menu-nav button {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  gap: 2px 10px;
  align-items: center;
  padding: 12px;
  border-radius: 14px;
  color: var(--ink);
  background: #fff;
  border: 1px solid #f1e2d6;
  text-align: left;
}

.menu-nav button span {
  font-weight: 750;
}

.menu-nav button em {
  grid-column: 2;
  color: var(--muted);
  font-style: normal;
  font-size: 12px;
}

.menu-nav [data-lucide] {
  grid-row: 1 / span 2;
  color: var(--orange);
  width: 20px;
  height: 20px;
}

.menu-stay {
  width: 100%;
  min-height: 44px;
  margin-top: 12px;
  border-radius: 12px;
  color: var(--orange-dark);
  background: #ffe8d4;
  font-weight: 750;
}

@media (min-width: 901px) {
  .menu-layer {
    width: auto;
    inset: 0;
    justify-content: flex-start;
    align-items: stretch;
  }

  .menu-sheet {
    width: 320px;
    height: 100%;
    border-radius: 0;
    padding-top: 28px;
  }
}

@media (max-width: 900px) {
  body {
    background: #fff9f4;
  }

  .app-shell {
    display: block;
    width: 375px;
    max-width: 100vw;
    border: 0;
  }

  .sidebar {
    display: none;
  }

  .workspace {
    display: block;
    padding: 0;
  }

  .organizer {
    display: none;
  }

  .chat-card {
    display: flex;
    flex-direction: column;
    width: 375px;
    max-width: 100vw;
    height: 100dvh;
    min-height: 100dvh;
    border: 0;
    border-radius: 0;
    background:
      linear-gradient(180deg, #fff8f1 0%, #fffaf6 58%, #fff8f0 100%);
    box-shadow: none;
    overflow-x: hidden;
  }

  /* 斜向胡萝卜水印：用低透明度印章拼出暖橙氛围 */
  .chat-card::before,
  .chat-feed::before {
    background-image:
      url("./assets/xiaohu-v4-carrot-stamp-crop.png"),
      url("./assets/xiaohu-v4-carrot-stamp-crop.png"),
      url("./assets/xiaohu-v4-carrot-stamp-crop.png"),
      url("./assets/xiaohu-v4-carrot-stamp-crop.png");
    background-position: 12% 14%, 78% 22%, 18% 58%, 72% 78%;
    background-size: 34px 34px, 28px 28px, 36px 36px, 30px 30px;
    background-repeat: no-repeat;
    opacity: 0.08;
    transform: rotate(-24deg) scale(1.15);
  }

  .mobile-statusbar {
    position: relative;
    z-index: 3;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 34px;
    padding: 8px 24px 0 34px;
    color: #050505;
    font-size: 14px;
    letter-spacing: 0;
    background: rgba(255, 249, 244, 0.92);
  }

  .mobile-statusbar span {
    display: inline-flex;
    gap: 3px;
    align-items: center;
  }

  .mobile-statusbar [data-lucide] {
    width: 15px;
    height: 15px;
    stroke-width: 2.5;
  }

  .topbar {
    min-height: 52px;
    padding: 4px 52px 8px;
    justify-content: center;
    border-bottom: 1px solid rgba(242, 213, 193, 0.86);
    background: rgba(255, 249, 244, 0.92);
    backdrop-filter: blur(12px);
  }

  .title-group {
    text-align: center;
  }

  .title-group h1 {
    font-size: 17px;
    font-weight: 700;
  }

  .title-group p {
    justify-content: center;
    margin-top: 1px;
    color: #16a34a;
    font-size: 11px;
  }

  .status-dot {
    width: 7px;
    height: 7px;
  }

  .top-actions {
    position: absolute;
    right: 22px;
    top: 14px;
  }

  .desktop-only {
    display: none;
  }

  .mobile-back {
    position: absolute;
    left: 12px;
    top: 8px;
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    background: transparent;
  }

  .mobile-back [data-lucide] {
    width: 24px;
    height: 24px;
    stroke-width: 2.2;
  }

  .calendar-entry {
    position: absolute;
    top: 50%;
    right: 12px;
    left: auto;
    z-index: 12;
    width: 32px;
    height: 32px;
    transform: translateY(-50%);
    background: url("./assets/xiaohu-v4-calendar-icon-crop.png") center / 24px 24px no-repeat;
  }

  .calendar-entry img {
    display: none;
  }

  .chat-feed {
    flex: 1 1 auto;
    width: 100%;
    max-width: 100vw;
    min-height: 0;
    /* 底部多留空，避免输入栏挡住草稿卡「修改/取消」 */
    padding: 16px 14px 128px;
    gap: 12px;
    overflow-x: hidden;
  }

  .chat-feed > * {
    max-width: 100%;
  }

  .time-label {
    margin: 2px 0 4px;
    font-size: 12px;
  }

  .row {
    gap: 8px;
    max-width: calc(100vw - 28px);
  }

  .row.user {
    transform: none;
    align-items: flex-start;
  }

  .bubble-avatar {
    flex: 0 0 48px;
    width: 48px;
    height: 48px;
    border: 1.5px solid rgba(255, 255, 255, 0.95);
    box-shadow: 0 4px 12px rgba(70, 42, 24, 0.12);
  }

  .user-avatar {
    flex: 0 0 40px;
    width: 40px;
    height: 40px;
  }

  .bubble {
    flex: 0 1 auto;
    max-width: 236px;
    padding: 11px 14px;
    border-color: rgba(236, 218, 207, 0.95);
    border-radius: 14px;
    font-size: 15px;
    line-height: 1.55;
    box-shadow: 0 6px 18px rgba(105, 62, 25, 0.08);
  }

  .bubble-text {
    white-space: pre-wrap;
  }

  .row.user .bubble {
    max-width: 210px;
    border-color: rgba(255, 154, 74, 0.55);
    border-radius: 14px;
    background: linear-gradient(180deg, #ffe8c8 0%, #ffd29a 100%);
  }

  .row.user .bubble-image {
    padding: 6px;
    background: linear-gradient(180deg, #ffe8c8 0%, #ffd29a 100%);
  }

  .sent-image {
    width: 178px;
    max-height: 286px;
    margin: 0;
    border: 1px solid rgba(255, 140, 70, 0.55);
    border-radius: 12px;
    background: #fff;
    object-fit: cover;
  }

  .row.user .bubble-image {
    max-width: 196px;
  }

  .message-meta {
    margin-top: 4px;
    font-size: 11px;
  }

  .progress-card,
  .draft-card {
    flex: 0 0 auto;
    width: min(268px, calc(100vw - 86px));
    max-width: min(268px, calc(100vw - 86px));
  }

  .progress-card {
    padding: 14px 14px 16px;
    border-radius: 14px;
    border: 1px solid rgba(241, 222, 208, 0.95);
    box-shadow: 0 10px 26px rgba(96, 54, 24, 0.1);
  }

  .progress-title {
    display: inline-flex;
    gap: 6px;
    align-items: center;
    margin-bottom: 14px;
    font-size: 15px;
    font-weight: 760;
  }

  .progress-title [data-lucide] {
    color: var(--orange);
    width: 18px;
    height: 18px;
  }

  .steps {
    position: relative;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 4px;
  }

  .steps::before {
    position: absolute;
    top: 15px;
    left: 28px;
    right: 28px;
    height: 2px;
    content: "";
    border-radius: 99px;
    background: #e8e2de;
  }

  .step {
    position: relative;
    z-index: 1;
    display: grid;
    gap: 6px;
    justify-items: center;
    color: #8a8d93;
    font-size: 10px;
    line-height: 1.2;
    text-align: center;
  }

  .step em {
    font-style: normal;
  }

  .step [data-lucide] {
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    padding: 7px;
    color: #a5a5a5;
    border-radius: 50%;
    background: #f4efec;
    box-shadow: inset 0 0 0 1px #e3d9d1;
  }

  .step::before {
    content: none;
  }

  .step.active {
    color: var(--orange);
    font-weight: 700;
  }

  .step.active [data-lucide] {
    color: #fff;
    background: linear-gradient(180deg, #ff8d31 0%, #ff5b10 100%);
    box-shadow: 0 0 0 5px rgba(255, 101, 20, 0.12);
  }

  .draft-card {
    border: 1px solid rgba(245, 210, 186, 0.98);
    border-radius: 14px;
    box-shadow: 0 12px 30px rgba(93, 47, 17, 0.11);
  }

  .draft-top {
    padding: 11px 12px;
    font-size: 13px;
  }

  .draft-top img {
    width: 16px;
    height: 16px;
  }

  .ok-badge {
    font-size: 11px;
  }

  .draft-body {
    padding: 12px 12px 12px;
  }

  .draft-card.is-compact .draft-body {
    padding: 14px 12px 10px;
  }

  .amount-hero {
    grid-template-columns: 52px minmax(0, 1fr);
    gap: 12px;
    padding: 2px 0 8px;
  }

  .category-chip {
    width: 52px;
    height: 52px;
    background: linear-gradient(180deg, #ff7b16 0%, #ff4e04 100%);
  }

  .category-chip [data-lucide] {
    width: 26px;
    height: 26px;
    stroke-width: 2.4;
  }

  .amount-hero strong {
    font-size: 28px;
    line-height: 1.05;
  }

  .amount-meta span,
  .amount-meta small {
    font-size: 13px;
  }

  .detail-link {
    margin-top: 4px;
    padding-top: 8px;
    border-top: 1px solid #f5ebe3;
    font-size: 12px;
  }

  .field-list {
    min-width: 0;
  }

  .field-row {
    grid-template-columns: 78px minmax(0, 1fr);
    min-height: 40px;
  }

  .field-label,
  .field-display {
    font-size: 13px;
  }

  .draft-actions {
    gap: 4px;
    margin-top: 10px;
    padding-bottom: 2px;
  }

  .primary {
    min-height: 44px;
    border-radius: 12px;
    font-size: 16px;
  }

  .text-btn {
    min-height: 30px;
    font-size: 14px;
  }

  .draft-secondary {
    padding-bottom: 2px;
  }

  .composer {
    position: fixed;
    right: auto;
    bottom: 0;
    left: 0;
    width: 375px;
    max-width: 100vw;
    grid-template-columns: 32px 32px minmax(0, 1fr) 32px 44px;
    gap: 6px;
    margin: 0;
    padding: 10px 10px max(12px, env(safe-area-inset-bottom));
    border-width: 1px 0 0;
    border-radius: 0;
    background: rgba(255, 250, 246, 0.96);
    backdrop-filter: blur(16px);
    box-shadow: 0 -8px 22px rgba(97, 48, 15, 0.07);
  }

  .composer > * {
    min-width: 0;
  }

  .round,
  .send {
    height: 34px;
  }

  .round {
    border: 0;
    background: transparent;
  }

  .round [data-lucide] {
    width: 24px;
    height: 24px;
    stroke-width: 1.9;
  }

  .send {
    width: 44px;
    height: 44px;
    align-self: center;
    background: linear-gradient(145deg, #ff8f1f 0%, #ff5a0a 55%, #ff7a18 100%);
    box-shadow: 0 8px 18px rgba(255, 96, 11, 0.3);
  }

  .send [data-lucide] {
    width: 22px;
    height: 22px;
  }

  .composer textarea,
  .composer input {
    min-height: 34px;
    min-width: 0;
    width: 100%;
    padding: 8px 12px;
    border-color: #eaded5;
    border-radius: 18px;
    font-size: 13px;
    line-height: 1.2;
    white-space: nowrap;
  }

  .subpage,
  .ledger-page,
  .settings-page {
    width: 375px;
    max-width: 100vw;
    height: 100dvh;
  }

  .subpage .mobile-statusbar {
    display: flex;
  }

  .subpage-topbar {
    min-height: 52px;
    padding: 4px 12px 8px;
    justify-content: space-between;
    background: rgba(255, 249, 244, 0.92);
  }

  .subpage-topbar .title-group h1 {
    font-size: 17px;
  }

  .subpage-topbar .title-group p {
    font-size: 11px;
  }

  .subpage-body {
    padding: 12px 12px 88px;
  }

  .page-panel {
    padding: 14px;
    border-radius: 14px;
    box-shadow: 0 8px 22px rgba(93, 47, 17, 0.08);
  }

  .page-metrics strong {
    font-size: 16px;
  }

  .settings-links {
    grid-template-columns: 1fr;
  }

  .mobile-tabbar {
    position: fixed;
    left: 0;
    bottom: 0;
    z-index: 20;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    width: 375px;
    max-width: 100vw;
    padding: 8px 6px max(10px, env(safe-area-inset-bottom));
    border-top: 1px solid rgba(242, 213, 193, 0.9);
    background: rgba(255, 250, 246, 0.96);
    backdrop-filter: blur(14px);
  }

  .mobile-tabbar button {
    display: grid;
    gap: 2px;
    justify-items: center;
    color: #8a9099;
    background: transparent;
    font-size: 11px;
  }

  .mobile-tabbar button.active {
    color: var(--orange-dark);
    font-weight: 700;
  }

  .mobile-tabbar [data-lucide] {
    width: 20px;
    height: 20px;
  }
}

@media (min-width: 901px) {
  .mobile-back,
  .calendar-entry {
    display: none;
  }

  .draft-title-mobile {
    display: none;
  }

  .draft-title-desktop {
    display: inline;
  }

  .topbar {
    justify-content: space-between;
    padding: 16px 22px;
  }

  .title-group {
    text-align: left;
  }

  .title-group p {
    display: none;
  }

  .ok-badge {
    color: #15803d;
    background: #dcfce7;
    border-radius: 999px;
    padding: 4px 9px;
  }

  .draft-card.is-expanded .draft-actions {
    grid-template-columns: 1.4fr 0.8fr 0.8fr;
    gap: 10px;
  }

  .draft-card.is-expanded .draft-secondary {
    display: contents;
  }

  .draft-card.is-expanded .text-btn {
    min-height: 44px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fff;
  }

  .draft-card.is-expanded .text-btn.modify {
    color: var(--ink);
  }

  .chat-card {
    background:
      radial-gradient(ellipse at 70% 40%, rgba(255, 184, 104, 0.08), transparent 42%),
      #fffaf6;
  }

  .user-avatar {
    display: none;
  }

  .report-stack {
    max-width: 720px;
  }
}
