:root {
  color-scheme: light;
  --ink: #171912;
  --muted: #70746b;
  --line: #dedfd8;
  --paper: #f3f4ee;
  --card: #ffffff;
  --accent: #dfff52;
  --accent-deep: #b9e326;
  --danger: #bf3b32;
  --shadow: 0 22px 60px rgba(28, 31, 20, .08);
  --radius: 24px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: var(--paper);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
.hidden { display: none !important; }

.login-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.08fr .92fr;
  background: #fbfcf7;
}
.login-art {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: clamp(36px, 7vw, 96px);
  color: #f8f9f1;
  background: var(--ink);
}
.login-art::before {
  content: "";
  position: absolute;
  width: 340px;
  height: 340px;
  right: 12%;
  top: 14%;
  border-radius: 42% 58% 51% 49%;
  background: var(--accent);
  transform: rotate(-12deg);
  box-shadow: 0 0 100px rgba(223, 255, 82, .2);
}
.login-art::after {
  content: "";
  position: absolute;
  width: 210px;
  height: 210px;
  right: 20%;
  top: 23%;
  border: 2px solid rgba(23, 25, 18, .85);
  border-radius: 50%;
}
.orbit { position: absolute; border: 1px solid rgba(255,255,255,.16); border-radius: 50%; }
.orbit-one { width: 500px; height: 500px; right: -70px; top: 0; }
.orbit-two { width: 620px; height: 220px; right: -110px; top: 180px; transform: rotate(-30deg); }
.login-mark {
  position: absolute;
  z-index: 2;
  right: calc(12% + 124px);
  top: calc(14% + 115px);
  color: var(--ink);
  font-size: 70px;
  font-weight: 900;
  line-height: 1;
}
.login-art p { position: relative; z-index: 2; margin: 0; font-size: clamp(38px, 5vw, 78px); font-weight: 800; line-height: 1.08; letter-spacing: -.06em; }
.login-card { width: min(430px, calc(100% - 64px)); align-self: center; justify-self: center; }
.eyebrow { color: #868b7e; font-size: 11px; font-weight: 800; letter-spacing: .18em; text-transform: uppercase; }
.login-card h1 { margin: 14px 0 8px; font-size: 48px; letter-spacing: -.06em; }
.login-copy { margin: 0 0 40px; color: var(--muted); }
.login-card label, .field { display: grid; gap: 9px; margin: 0 0 18px; color: #4f534a; font-size: 13px; font-weight: 700; }
.login-card input, .field input, .field select, .field textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 14px;
  outline: none;
  padding: 14px 15px;
  color: var(--ink);
  background: #fff;
  transition: border-color .2s, box-shadow .2s;
}
.field textarea { resize: vertical; min-height: 92px; }
.login-card input:focus, .field input:focus, .field select:focus, .field textarea:focus { border-color: #9aac48; box-shadow: 0 0 0 4px rgba(223,255,82,.22); }
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 44px;
  padding: 0 18px;
  border: 0;
  border-radius: 13px;
  cursor: pointer;
  text-decoration: none;
  font-size: 14px;
  font-weight: 800;
  transition: transform .18s, filter .18s, background .18s;
}
.button:hover { transform: translateY(-1px); filter: brightness(.98); }
.button:active { transform: translateY(0); }
.button.primary { background: var(--accent); color: #11130d; }
.button.dark { background: var(--ink); color: #fff; }
.button.secondary { border: 1px solid var(--line); background: #fff; color: var(--ink); }
.button.danger { background: #fff0ed; color: var(--danger); }
.button.wide { width: 100%; margin-top: 12px; min-height: 52px; }
.form-error { min-height: 20px; margin: 12px 0 0; color: var(--danger); font-size: 13px; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 220px minmax(0, 1fr); }
.sidebar {
  position: fixed;
  z-index: 20;
  inset: 0 auto 0 0;
  width: 220px;
  display: flex;
  flex-direction: column;
  padding: 30px 22px 24px;
  border-right: 1px solid var(--line);
  background: rgba(249, 250, 245, .92);
  backdrop-filter: blur(18px);
}
.brand { display: flex; align-items: center; gap: 11px; color: var(--ink); text-decoration: none; font-size: 19px; }
.brand > span { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 12px; background: var(--ink); color: var(--accent); font-size: 20px; font-weight: 900; }
.side-nav { display: grid; gap: 7px; margin-top: 54px; }
.nav-button { border: 0; background: transparent; cursor: pointer; }
.side-nav .nav-button { display: flex; align-items: center; gap: 13px; width: 100%; padding: 12px 13px; border-radius: 13px; color: #686c63; text-align: left; font-weight: 700; }
.side-nav .nav-button i { display: grid; place-items: center; width: 27px; height: 27px; font-style: normal; font-size: 18px; }
.side-nav .nav-button.active { background: var(--ink); color: #fff; }
.side-nav .nav-button.active i { color: var(--accent); }
.side-quote { margin-top: auto; padding: 18px; border-radius: 18px; background: #e8ebdf; }
.side-quote b { font-size: 13px; }
.side-quote p { margin: 8px 0 0; color: #6b6f65; font-size: 12px; line-height: 1.6; }

.main-content { grid-column: 2; width: 100%; max-width: 1360px; margin: 0 auto; padding: 34px clamp(24px, 4vw, 64px) 80px; }
.topbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 30px; }
.date-line { margin: 0 0 5px; color: var(--muted); font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.topbar h1 { margin: 0; font-size: clamp(26px, 3vw, 38px); line-height: 1; letter-spacing: -.045em; }
.top-actions { display: flex; align-items: center; gap: 10px; }
.icon-button, .close-button { display: grid; place-items: center; border: 1px solid var(--line); background: #fff; cursor: pointer; }
.icon-button { width: 44px; height: 44px; border-radius: 13px; font-size: 23px; }
.page { display: none; animation: page-in .28s ease both; }
.page.active { display: block; }
@keyframes page-in { from { opacity: 0; transform: translateY(5px); } }

.summary-grid { display: grid; grid-template-columns: minmax(0, 1.9fr) minmax(250px, .8fr); gap: 18px; }
.summary-card, .insight-card, .chart-card, .settings-card { border: 1px solid rgba(20,22,16,.06); border-radius: var(--radius); box-shadow: var(--shadow); }
.summary-main { min-height: 285px; padding: clamp(23px, 3vw, 34px); color: #fff; background: var(--ink); }
.summary-head { display: flex; align-items: center; justify-content: space-between; color: #a9aea1; font-size: 13px; }
.live-dot { display: flex; align-items: center; gap: 7px; }
.live-dot::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 5px rgba(223,255,82,.09); }
.big-money { display: flex; align-items: flex-start; gap: 8px; margin: 35px 0 38px; font-variant-numeric: tabular-nums; }
.big-money small { color: var(--accent); font-size: 22px; font-weight: 800; padding-top: 8px; }
.big-money strong { font-size: clamp(46px, 7vw, 76px); line-height: .9; letter-spacing: -.06em; }
.summary-foot { display: grid; grid-template-columns: repeat(3, 1fr); padding-top: 22px; border-top: 1px solid rgba(255,255,255,.12); }
.summary-foot > div { display: grid; gap: 6px; padding-right: 16px; }
.summary-foot > div + div { padding-left: 20px; border-left: 1px solid rgba(255,255,255,.12); }
.summary-foot span { color: #979c90; font-size: 11px; }
.summary-foot b { font-size: 16px; font-variant-numeric: tabular-nums; }
.insight-card { position: relative; overflow: hidden; min-height: 285px; padding: 26px; background: var(--accent); }
.insight-card::after { content: ""; position: absolute; width: 170px; height: 170px; border: 1px solid rgba(23,25,18,.17); border-radius: 50%; right: -55px; bottom: -50px; }
.insight-label { display: inline-flex; padding: 7px 10px; border-radius: 99px; background: rgba(23,25,18,.09); font-size: 11px; font-weight: 800; }
.insight-icon { margin: 34px 0 16px; font-size: 40px; font-weight: 300; }
.insight-card h3 { max-width: 250px; margin: 0 0 8px; font-size: 21px; }
.insight-card p { max-width: 250px; margin: 0; color: #464b37; font-size: 13px; line-height: 1.55; }

.search-panel { display: flex; align-items: center; gap: 10px; margin-top: 22px; padding: 9px 12px 9px 16px; border: 1px solid var(--line); border-radius: 16px; background: #fff; }
.search-panel span { font-size: 24px; color: var(--muted); }
.search-panel input { flex: 1; border: 0; outline: none; background: transparent; }
.search-panel button { border: 0; background: transparent; color: var(--muted); cursor: pointer; font-size: 12px; }
.filter-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-top: 32px; }
.status-tabs { display: flex; gap: 5px; overflow-x: auto; scrollbar-width: none; }
.status-tabs::-webkit-scrollbar, .category-strip::-webkit-scrollbar { display: none; }
.status-tab { flex: 0 0 auto; padding: 9px 13px; border: 0; border-radius: 99px; background: transparent; color: #73776e; cursor: pointer; font-size: 13px; font-weight: 750; }
.status-tab em { margin-left: 4px; font-style: normal; opacity: .6; }
.status-tab.active { background: var(--ink); color: #fff; }
.select-wrap { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; }
.select-wrap select { border: 0; outline: 0; background: transparent; color: var(--ink); font-weight: 700; }
.category-strip { display: flex; gap: 8px; overflow-x: auto; margin: 18px 0; padding-bottom: 2px; scrollbar-width: none; }
.category-chip { flex: 0 0 auto; display: flex; align-items: center; gap: 7px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 12px; background: rgba(255,255,255,.55); cursor: pointer; font-size: 12px; font-weight: 700; }
.category-chip i { width: 8px; height: 8px; border-radius: 50%; background: var(--chip-color, #777); }
.category-chip.active { border-color: var(--ink); background: #fff; box-shadow: 0 5px 20px rgba(20,22,16,.05); }

.item-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 17px; }
.item-card { overflow: hidden; border: 1px solid rgba(20,22,16,.06); border-radius: 21px; background: var(--card); box-shadow: 0 12px 36px rgba(28,31,20,.055); cursor: pointer; transition: transform .2s, box-shadow .2s; }
.item-card:hover { transform: translateY(-3px); box-shadow: 0 20px 44px rgba(28,31,20,.1); }
.item-visual { position: relative; display: grid; place-items: center; aspect-ratio: 1.56; overflow: hidden; background: color-mix(in srgb, var(--item-color) 13%, #f7f8f2); }
.item-visual::before { content: ""; position: absolute; width: 150px; height: 150px; border: 1px solid color-mix(in srgb, var(--item-color) 28%, transparent); border-radius: 50%; }
.item-visual img { position: relative; z-index: 1; width: 100%; height: 100%; object-fit: cover; }
.item-placeholder { position: relative; z-index: 1; display: grid; place-items: center; width: 82px; height: 82px; border-radius: 25px; background: rgba(255,255,255,.82); box-shadow: 0 14px 30px rgba(20,22,16,.09); color: var(--item-color); font-size: 38px; font-weight: 800; }
.status-badge { position: absolute; z-index: 2; top: 12px; left: 12px; padding: 6px 9px; border-radius: 99px; background: rgba(255,255,255,.86); backdrop-filter: blur(8px); font-size: 10px; font-weight: 800; }
.use-quick { position: absolute; z-index: 3; right: 12px; bottom: 12px; display: grid; place-items: center; width: 34px; height: 34px; border: 0; border-radius: 50%; background: var(--ink); color: var(--accent); cursor: pointer; font-size: 18px; font-weight: 900; box-shadow: 0 8px 20px rgba(20,22,16,.2); }
.item-body { padding: 17px; }
.item-title-row { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.item-title-row h3 { margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 16px; }
.item-price { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.item-meta { margin: 7px 0 14px; color: #858980; font-size: 11px; }
.cost-line { display: flex; align-items: baseline; justify-content: space-between; padding-top: 13px; border-top: 1px solid #ecece7; }
.cost-line > span { color: var(--muted); font-size: 11px; }
.cost-line b { font-size: 19px; font-variant-numeric: tabular-nums; }
.cost-line b small { color: var(--muted); font-size: 10px; font-weight: 600; }
.target-track { height: 4px; margin-top: 13px; border-radius: 99px; overflow: hidden; background: #eceee8; }
.target-track span { display: block; height: 100%; width: var(--progress); border-radius: inherit; background: var(--item-color); }
.empty-state { display: grid; place-items: center; padding: 70px 20px; text-align: center; }
.empty-shape { display: grid; place-items: center; width: 78px; height: 78px; border: 1px solid var(--line); border-radius: 26px; background: #fff; color: #777c70; font-size: 34px; box-shadow: var(--shadow); transform: rotate(-5deg); }
.empty-state h3 { margin: 24px 0 7px; font-size: 20px; }
.empty-state p { max-width: 340px; margin: 0 0 22px; color: var(--muted); font-size: 13px; line-height: 1.6; }

.stat-kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 18px; }
.stat-kpis article { display: grid; gap: 9px; padding: 21px; border: 1px solid var(--line); border-radius: 18px; background: #fff; }
.stat-kpis span, .stat-kpis small { color: var(--muted); font-size: 11px; }
.stat-kpis b { font-size: 23px; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.chart-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.chart-card { padding: 25px; background: #fff; }
.chart-wide { grid-column: 1 / -1; }
.section-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.section-heading span { color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.section-heading h2 { margin: 5px 0 0; font-size: 19px; letter-spacing: -.025em; }
.section-heading > small { color: var(--muted); font-size: 11px; }
.chart-heading { align-items: center; }
.chart-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-top: 18px; }
.segmented-control { display: inline-flex; align-items: center; gap: 3px; padding: 3px; border-radius: 11px; background: #eef0e9; }
.segmented-control button { min-height: 30px; padding: 0 10px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); cursor: pointer; font-size: 10px; font-weight: 800; white-space: nowrap; }
.segmented-control button.active { background: #fff; color: var(--ink); box-shadow: 0 3px 12px rgba(23,25,18,.09); }
.range-control button { min-width: 48px; }
.chart-focus { min-width: 132px; text-align: right; font-variant-numeric: tabular-nums; }
.chart-focus span, .chart-focus small { display: block; color: var(--muted); font-size: 9px; }
.chart-focus b { display: block; margin: 3px 0 2px; font-size: 15px; }
.chart-wrap { height: 310px; margin-top: 10px; }
.chart-wrap canvas, .donut-layout canvas { width: 100%; height: 100%; }
.interactive-chart { position: relative; }
.interactive-chart canvas { outline: none; touch-action: pan-y; cursor: crosshair; }
.interactive-chart canvas:focus-visible, .donut-layout canvas:focus-visible { border-radius: 10px; box-shadow: 0 0 0 3px rgba(185,227,38,.45); }
.chart-tooltip { position: absolute; z-index: 4; top: 12px; min-width: 112px; padding: 8px 10px; border-radius: 10px; pointer-events: none; transform: translateX(-50%); background: rgba(23,25,18,.94); color: #fff; box-shadow: 0 9px 28px rgba(20,22,16,.2); font-size: 10px; text-align: center; font-variant-numeric: tabular-nums; }
.chart-tooltip b { display: block; margin-bottom: 3px; color: var(--accent); font-size: 12px; }
.chart-tooltip small { color: #c5c9bd; }
.chart-summary { display: grid; grid-template-columns: repeat(3,1fr); gap: 8px; margin-top: 8px; }
.chart-summary div { padding: 10px 11px; border-radius: 11px; background: #f4f5f0; }
.chart-summary span { display: block; margin-bottom: 5px; color: var(--muted); font-size: 9px; }
.chart-summary b { font-size: 11px; font-variant-numeric: tabular-nums; }
.donut-layout { display: grid; grid-template-columns: 190px minmax(0, 1fr); align-items: center; gap: 18px; min-height: 260px; }
.donut-layout canvas { width: 190px; height: 190px; max-width: 100%; aspect-ratio: 1; flex: 0 0 auto; outline: none; cursor: pointer; touch-action: manipulation; }
.legend-row { width: 100%; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 8px; margin: 5px 0; padding: 7px 8px; border: 0; border-radius: 9px; background: transparent; color: inherit; cursor: pointer; font-size: 12px; text-align: left; }
.legend-row:hover, .legend-row.active { background: #f2f3ed; }
.legend-row i { width: 9px; height: 9px; border-radius: 50%; background: var(--legend-color); }
.legend-row span { color: var(--muted); }
.category-focus { min-height: 53px; display: flex; align-items: center; justify-content: space-between; gap: 15px; margin-top: 5px; padding: 11px 13px; border-radius: 12px; background: #f4f5f0; }
.category-focus div { min-width: 0; }.category-focus b { display: block; overflow: hidden; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }.category-focus small { display: block; margin-top: 4px; color: var(--muted); font-size: 9px; }.category-focus strong { font-size: 14px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.ranking-list { display: grid; gap: 9px; margin-top: 22px; }
.rank-row { display: grid; grid-template-columns: 30px minmax(0,1fr) auto; align-items: center; gap: 11px; padding: 11px 0; border-bottom: 1px solid #eeeeea; }
.rank-row > b { display: grid; place-items: center; width: 25px; height: 25px; border-radius: 8px; background: #f0f2ea; font-size: 11px; }
.rank-row div { min-width: 0; }
.rank-row h4 { margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.rank-row small { color: var(--muted); font-size: 10px; }
.rank-row strong { font-size: 13px; }

.wish-hero { display: flex; justify-content: space-between; align-items: flex-end; gap: 30px; padding: clamp(28px, 5vw, 50px); border-radius: 28px; background: var(--accent); }
.wish-hero h2 { margin: 10px 0 9px; font-size: clamp(30px, 4vw, 48px); letter-spacing: -.05em; }
.wish-hero p { max-width: 600px; margin: 0; color: #525741; font-size: 14px; line-height: 1.65; }
.wish-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 24px; }
.wish-card { position: relative; min-height: 220px; display: flex; flex-direction: column; padding: 22px; border: 1px solid var(--line); border-radius: 21px; background: #fff; }
.wish-priority { align-self: flex-start; padding: 6px 9px; border-radius: 99px; background: #eff1e9; color: #65695f; font-size: 10px; font-weight: 800; }
.wish-priority.high { background: #ffe5df; color: #a64236; }
.wish-priority.low { background: #e6edf7; color: #48627d; }
.wish-card h3 { margin: 25px 0 7px; font-size: 19px; }
.wish-card p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.55; }
.wish-card-foot { display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; margin-top: auto; padding-top: 22px; }
.wish-card-foot b { font-size: 20px; }
.wish-card-foot small { color: var(--muted); }
.card-menu { display: flex; gap: 5px; }
.mini-button, .text-button { border: 0; background: transparent; cursor: pointer; }
.mini-button { padding: 6px 8px; border-radius: 8px; color: var(--muted); font-size: 11px; }
.mini-button:hover { background: #f0f1eb; color: var(--ink); }
.text-button { color: #5c6745; font-size: 12px; font-weight: 800; }

.settings-grid { display: grid; grid-template-columns: 1.2fr .8fr; gap: 18px; }
.settings-card { padding: 25px; background: #fff; }
.settings-mobile-hero { display: none; }
.category-list { display: grid; margin-top: 20px; }
.category-row { display: grid; grid-template-columns: 38px minmax(0,1fr) auto; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid #eeeeea; }
.category-icon { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 11px; color: var(--category-color); background: color-mix(in srgb, var(--category-color) 12%, #fff); font-weight: 900; }
.category-row b { font-size: 13px; }
.category-row small { color: var(--muted); font-size: 11px; }
.setting-copy { color: var(--muted); font-size: 13px; line-height: 1.7; }
.setting-actions { display: grid; gap: 9px; margin-top: 24px; }
.setting-action { width: 100%; min-height: 58px; display: grid; grid-template-columns: 34px minmax(0,1fr) auto; gap: 11px; padding: 8px 11px; border: 1px solid var(--line); text-align: left; }
.setting-action > i { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 10px; background: #edf0e7; color: #59604f; font-style: normal; font-size: 17px; }
.setting-action > span { min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 3px; }
.setting-action b { font-size: 12px; }.setting-action small { color: var(--muted); font-size: 9px; font-weight: 600; }.setting-action em { color: #9a9e94; font-size: 20px; font-style: normal; font-weight: 400; }
.account-card { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; gap: 20px; color: #fff; background: var(--ink); }
.account-card h2 { margin: 8px 0 5px; }
.account-card p { margin: 0; color: #a8ada0; font-size: 12px; }

.bottom-nav { display: none; }

.modal { width: 100%; max-width: none; height: 100%; max-height: none; margin: 0; padding: 18px; border: 0; background: transparent; }
.modal::backdrop { background: rgba(15, 17, 12, .52); backdrop-filter: blur(7px); }
.modal[open] { display: grid; place-items: center; animation: fade .2s ease both; }
@keyframes fade { from { opacity: 0; } }
.modal-card { width: min(880px, 100%); max-height: calc(100vh - 36px); overflow-y: auto; margin: auto; padding: 28px; border: 0; border-radius: 25px; background: #fbfcf7; box-shadow: 0 30px 100px rgba(0,0,0,.25); }
.small-modal { width: min(560px, 100%); }
.tiny-modal { width: min(460px, 100%); }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 25px; }
.modal-head h2 { margin: 7px 0 0; font-size: 25px; letter-spacing: -.04em; }
.close-button { flex: 0 0 auto; width: 38px; height: 38px; border-radius: 50%; color: #777b72; font-size: 24px; }
.form-columns { display: grid; grid-template-columns: 270px minmax(0, 1fr); gap: 24px; }
.visual-picker-column { display: grid; align-content: start; gap: 14px; min-width: 0; }
.image-picker { position: relative; overflow: hidden; align-self: start; aspect-ratio: .9; border: 1px dashed #c7c9c0; border-radius: 20px; background: #eff1e9; cursor: pointer; }
.image-picker input { position: absolute; inset: 0; z-index: 3; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
#imagePreview { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 7px; text-align: center; }
#imagePreview b { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 18px; background: #fff; font-size: 25px; }
#imagePreview span { margin-top: 7px; font-size: 13px; font-weight: 800; }
#imagePreview small { color: var(--muted); font-size: 10px; }
#imagePreview img { width: 100%; height: 100%; object-fit: cover; }
.picker-divider { display: flex; align-items: center; gap: 9px; color: var(--muted); font-size: 10px; font-weight: 700; }
.picker-divider::before, .picker-divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.item-icon-tabs { display: flex; gap: 5px; overflow-x: auto; padding: 1px 1px 4px; scrollbar-width: none; }
.item-icon-tabs::-webkit-scrollbar { display: none; }
.item-icon-tabs button { flex: 0 0 auto; min-height: 30px; padding: 0 10px; border: 1px solid var(--line); border-radius: 9px; background: #fff; color: var(--muted); cursor: pointer; font-size: 10px; font-weight: 750; white-space: nowrap; }
.item-icon-tabs button.active { border-color: var(--ink); background: var(--ink); color: #fff; }
.item-icon-grid, .category-icon-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 7px; }
.item-icon-grid { max-height: 226px; overflow-y: auto; padding: 2px 4px 2px 2px; scrollbar-width: thin; }
.icon-choice {
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  min-width: 0;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #fff;
  cursor: pointer;
  font-size: 21px;
  transition: border-color .16s, background .16s, transform .16s;
}
.icon-choice:hover { transform: translateY(-1px); border-color: #9ca28f; }
.icon-choice.selected { border-color: var(--ink); background: var(--accent); box-shadow: 0 0 0 2px rgba(23,25,18,.08); }
.category-icon-grid { grid-template-columns: repeat(8, minmax(0, 1fr)); margin: -4px 0 20px; }
.category-icon-grid .icon-choice { font-size: 18px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; }
.field { min-width: 0; }
.field small.calc-hint { min-height: 14px; margin-top: -3px; color: #718334; font-size: 10px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 9px; padding-top: 19px; border-top: 1px solid var(--line); }

.detail-modal { width: min(820px, 100%); padding: 0; overflow: hidden; }
.detail-hero { position: relative; min-height: 290px; display: grid; place-items: center; overflow: hidden; background: color-mix(in srgb, var(--detail-color) 14%, #f5f6ef); }
.detail-hero img { width: 100%; height: 330px; object-fit: cover; }
.detail-hero .item-placeholder { width: 115px; height: 115px; border-radius: 35px; font-size: 50px; }
.detail-close { position: absolute; z-index: 3; top: 18px; right: 18px; }
.detail-body { padding: 28px; }
.detail-title-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; }
.detail-title-row h2 { margin: 6px 0 5px; font-size: 30px; letter-spacing: -.045em; }
.detail-title-row p { margin: 0; color: var(--muted); font-size: 12px; }
.detail-daily { text-align: right; }
.detail-daily span { display: block; color: var(--muted); font-size: 10px; }
.detail-daily b { display: block; margin-top: 5px; font-size: 28px; }
.metric-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin: 25px 0; }
.metric-grid div { padding: 15px; border-radius: 15px; background: #f0f2ea; }
.metric-grid span { display: block; margin-bottom: 7px; color: var(--muted); font-size: 10px; }
.metric-grid b { font-size: 14px; }
.progress-panel { padding: 18px; border-radius: 17px; background: var(--ink); color: #fff; }
.progress-head { display: flex; justify-content: space-between; gap: 15px; margin-bottom: 12px; font-size: 12px; }
.progress-head span { color: #a6ab9f; }
.progress-track { height: 7px; border-radius: 99px; overflow: hidden; background: rgba(255,255,255,.13); }
.progress-track i { display: block; height: 100%; width: var(--progress); border-radius: inherit; background: var(--accent); }
.expense-section { margin-top: 25px; }
.expense-section h3 { margin: 0; font-size: 15px; }
.expense-list { display: grid; margin-top: 10px; }
.expense-row { display: grid; grid-template-columns: minmax(0,1fr) auto auto; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid #e8e9e3; }
.expense-row b { font-size: 12px; }
.expense-row small { display: block; margin-top: 3px; color: var(--muted); font-size: 10px; }
.expense-row strong { font-size: 12px; }
.detail-note { margin: 22px 0 0; padding: 15px 17px; border-left: 3px solid var(--detail-color); background: #f2f3ed; color: #61665b; font-size: 12px; line-height: 1.65; }
.detail-actions { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 24px; }
.detail-actions .danger-link { margin-left: auto; color: var(--danger); }

.toast { position: fixed; z-index: 100; left: 50%; bottom: 30px; transform: translate(-50%, 25px); padding: 11px 17px; border-radius: 99px; background: var(--ink); color: #fff; box-shadow: 0 14px 40px rgba(0,0,0,.22); opacity: 0; pointer-events: none; font-size: 12px; transition: opacity .22s, transform .22s; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 1100px) {
  .item-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat-kpis { grid-template-columns: repeat(2, 1fr); }
  .wish-grid { grid-template-columns: repeat(2, 1fr); }
  .settings-grid { grid-template-columns: 1fr; }
  .account-card { grid-column: auto; }
}

@media (max-width: 760px) {
  body { background: #f6f7f2; }
  .login-shell { grid-template-columns: 1fr; background: var(--ink); }
  .login-art { min-height: 34vh; padding: 30px 25px; justify-content: flex-end; }
  .login-art::before { width: 155px; height: 155px; top: 30px; right: 24px; }
  .login-art::after { width: 96px; height: 96px; top: 60px; right: 54px; }
  .login-mark { right: 87px; top: 76px; font-size: 34px; }
  .orbit-one { width: 250px; height: 250px; right: -30px; top: 0; }
  .orbit-two { display: none; }
  .login-art p { font-size: 34px; }
  .login-card { width: 100%; align-self: stretch; padding: 35px 25px 50px; border-radius: 30px 30px 0 0; background: #fbfcf7; }
  .login-card h1 { font-size: 38px; }
  .login-copy { margin-bottom: 28px; }
  .app-shell { height: 100dvh; display: flex; flex-direction: column; overflow: hidden; }
  .sidebar { display: none; }
  .main-content { width: 100%; min-height: 0; flex: 1; overflow-x: hidden; overflow-y: auto; padding: 0 13px 24px; overscroll-behavior-y: contain; }
  .topbar { position: sticky; z-index: 15; top: 0; min-height: 76px; margin: 0 -13px 16px; padding: 15px 13px 10px; background: rgba(246,247,242,.91); backdrop-filter: blur(18px); }
  .topbar .add-item-trigger { display: none; }
  .topbar h1 { font-size: 25px; }
  .date-line { font-size: 10px; }
  .icon-button { width: 44px; height: 44px; border-radius: 14px; }
  .summary-grid { grid-template-columns: 1fr; gap: 10px; }
  .summary-main { min-height: 194px; padding: 19px; border-radius: 22px; }
  .summary-head { font-size: 11px; }
  .big-money { margin: 22px 0 23px; }
  .big-money strong { font-size: clamp(39px, 12vw, 49px); }
  .summary-foot > div { padding-right: 8px; }
  .summary-foot > div + div { padding-left: 10px; }
  .summary-foot { padding-top: 15px; }
  .summary-foot b { font-size: 13px; }
  .insight-card { min-height: 130px; padding: 18px 20px; border-radius: 22px; }
  .insight-card::after { width: 125px; height: 125px; right: -40px; bottom: -55px; }
  .insight-icon { position: absolute; right: 21px; top: 20px; margin: 0; font-size: 29px; }
  .insight-card h3 { margin: 16px 0 5px; font-size: 17px; }.insight-card p { padding-right: 35px; font-size: 10px; }
  .mobile-filter-dock { position: sticky; z-index: 12; top: 70px; margin: 13px -13px 10px; padding: 8px 13px 3px; background: linear-gradient(180deg, rgba(246,247,242,.98) 84%, rgba(246,247,242,0)); backdrop-filter: blur(15px); }
  .search-panel { min-height: 48px; margin: 0 0 9px; border-radius: 14px; box-shadow: 0 8px 24px rgba(28,31,20,.06); }
  .filter-row { align-items: center; flex-direction: row; margin-top: 0; gap: 8px; }
  .status-tabs { width: 100%; }
  .status-tab { min-height: 40px; padding: 9px 12px; }
  .select-wrap { flex: 0 0 auto; height: 40px; padding: 0 9px; border: 1px solid var(--line); border-radius: 11px; background: #fff; }
  .select-wrap > span { display: none; }
  .select-wrap select { max-width: 92px; font-size: 11px; }
  .category-strip { margin: 9px 0 4px; padding-right: 12px; }
  .category-chip { min-height: 38px; padding: 8px 12px; background: #fff; }
  .item-grid { grid-template-columns: 1fr; gap: 14px; }
  .item-card { display: grid; grid-template-columns: minmax(112px, 35%) 1fr; min-height: 148px; border-radius: 19px; box-shadow: 0 8px 25px rgba(28,31,20,.055); }
  .item-card:active { transform: scale(.985); }
  .item-visual { aspect-ratio: auto; min-height: 148px; }
  .item-placeholder { width: 62px; height: 62px; border-radius: 19px; font-size: 29px; }
  .status-badge { top: 9px; left: 9px; }
  .use-quick { right: 9px; bottom: 9px; width: 42px; height: 42px; font-size: 21px; }
  .item-body { min-width: 0; display: flex; flex-direction: column; padding: 15px 14px; }
  .item-title-row h3 { font-size: 15px; }.item-price { font-size: 10px; }
  .item-meta { overflow: hidden; margin: 7px 0 10px; text-overflow: ellipsis; white-space: nowrap; }
  .cost-line b { font-size: 17px; }
  .cost-line { margin-top: auto; }
  .stat-kpis { grid-template-columns: 1fr 1fr; gap: 9px; }
  .stat-kpis { overflow-x: auto; display: flex; margin: 0 -13px 13px; padding: 0 13px 5px; scroll-snap-type: x mandatory; scrollbar-width: none; }
  .stat-kpis::-webkit-scrollbar { display: none; }
  .stat-kpis article { min-width: 148px; flex: 0 0 43vw; padding: 16px; scroll-snap-align: start; }
  .stat-kpis b { font-size: 18px; }
  .chart-grid { grid-template-columns: 1fr; }
  .chart-wide { grid-column: auto; }
  .chart-card { padding: 18px 15px; border-radius: 20px; }
  .chart-heading { align-items: flex-start; flex-direction: column; }
  .chart-heading .metric-control { align-self: stretch; }
  .metric-control button { flex: 1; }
  .chart-toolbar { align-items: flex-end; margin-top: 13px; }
  .range-control { max-width: calc(100% - 105px); overflow-x: auto; }
  .range-control button { min-width: 45px; min-height: 34px; padding: 0 8px; }
  .chart-focus { min-width: 94px; }
  .chart-wrap { height: 226px; margin-top: 4px; }
  .chart-summary { gap: 5px; }.chart-summary div { padding: 9px 8px; }.chart-summary b { font-size: 10px; }
  .chart-tooltip { top: 6px; }
  .donut-layout { grid-template-columns: 145px minmax(0,1fr); min-height: 220px; gap: 10px; }
  .donut-layout canvas { width: 145px; height: 145px; }
  .legend-row { min-height: 38px; margin: 1px 0; padding: 6px; }
  .ranking-control button { min-height: 32px; }
  .rank-row { min-height: 51px; padding: 9px 0; }
  .wish-hero { align-items: flex-start; flex-direction: column; padding: 28px 23px; }
  .wish-hero h2 { font-size: 34px; }
  .wish-grid { grid-template-columns: 1fr; }
  .settings-mobile-hero { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; padding: 15px 16px; border-radius: 18px; background: var(--accent); }
  .settings-mobile-hero > span { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 12px; background: var(--ink); color: var(--accent); font-size: 19px; }
  .settings-mobile-hero div { display: flex; flex-direction: column; gap: 3px; }.settings-mobile-hero b { font-size: 14px; }.settings-mobile-hero small { color: #59604d; font-size: 10px; }
  .settings-grid { gap: 11px; }
  .settings-card { padding: 18px 16px; border-radius: 20px; box-shadow: 0 8px 28px rgba(28,31,20,.055); }
  .settings-card .section-heading h2 { font-size: 17px; }
  .settings-card .text-button { min-width: 66px; min-height: 40px; padding: 0 11px; border-radius: 11px; background: var(--ink); color: #fff; }
  .category-list { gap: 6px; margin: 14px -4px -3px; }
  .category-row { min-height: 58px; padding: 8px 7px; border-bottom: 0; border-radius: 13px; background: #f4f5f0; }
  .category-row .mini-button { min-width: 51px; min-height: 40px; border-radius: 10px; background: #fff; color: #8c433d; }
  .setting-copy { margin-bottom: 0; font-size: 11px; }
  .setting-actions { margin-top: 16px; }
  .setting-action { min-height: 60px; border-radius: 13px; background: #f7f8f3; }
  .account-card { align-items: stretch; flex-direction: column; padding: 20px; }
  .account-card .button { width: 100%; min-height: 48px; }
  .bottom-nav {
    position: relative;
    z-index: 30;
    flex: 0 0 calc(76px + env(safe-area-inset-bottom));
    display: grid;
    grid-template-columns: 1fr 1fr 64px 1fr 1fr;
    align-items: end;
    left: auto;
    right: auto;
    bottom: auto;
    width: 100%;
    height: calc(76px + env(safe-area-inset-bottom));
    padding: 7px 8px calc(7px + env(safe-area-inset-bottom));
    border: 1px solid rgba(20,22,16,.08);
    border-width: 1px 0 0;
    border-radius: 24px 24px 0 0;
    background: rgba(255,255,255,.94);
    box-shadow: 0 -10px 34px rgba(20,22,16,.1);
    backdrop-filter: blur(20px);
  }
  .bottom-nav .nav-button { min-width: 44px; min-height: 50px; display: grid; justify-items: center; align-content: center; gap: 3px; padding: 4px; border-radius: 13px; color: #858980; }
  .bottom-nav .nav-button i { font-style: normal; font-size: 18px; line-height: 1; }
  .bottom-nav .nav-button span { font-size: 9px; font-weight: 700; }
  .bottom-nav .nav-button.active { color: var(--ink); background: #f2f4ec; }
  .mobile-add { align-self: center; display: grid; place-items: center; width: 56px; height: 56px; margin: 0 auto 13px; border: 5px solid #f7f8f3; border-radius: 50%; background: var(--ink); color: var(--accent); box-shadow: 0 8px 22px rgba(20,22,16,.22); font-size: 26px; }
  .modal { padding: 0; place-items: end center; }
  .modal[open] { place-items: end center; }
  .modal-card { width: 100%; max-height: 94dvh; position: relative; padding: 28px 18px calc(22px + env(safe-area-inset-bottom)); border-radius: 26px 26px 0 0; overscroll-behavior: contain; }
  .modal-card::before { content: ""; width: 38px; height: 4px; position: absolute; top: 9px; left: 50%; border-radius: 4px; transform: translateX(-50%); background: #d5d7cf; }
  .modal-head { position: sticky; z-index: 3; top: -28px; margin: -4px -4px 20px; padding: 8px 4px 10px; background: #fbfcf7; }
  .modal-actions { position: sticky; z-index: 3; bottom: calc(-22px - env(safe-area-inset-bottom)); margin: 10px -18px calc(-22px - env(safe-area-inset-bottom)); padding: 13px 18px calc(14px + env(safe-area-inset-bottom)); background: rgba(251,252,247,.96); backdrop-filter: blur(14px); }
  .modal-actions .button { min-height: 48px; flex: 1; }
  .form-columns { grid-template-columns: 1fr; }
  .visual-picker-column { grid-template-columns: 135px minmax(0, 1fr); grid-template-areas: "image tabs" "image icons"; align-items: start; }
  .image-picker { grid-area: image; width: 100%; aspect-ratio: 1; }
  .picker-divider { display: none; }
  .item-icon-tabs { grid-area: tabs; }
  .item-icon-tabs button { min-height: 32px; }
  .item-icon-grid { grid-area: icons; grid-template-columns: repeat(6, minmax(0, 1fr)); max-height: 155px; }
  .category-icon-grid { grid-template-columns: repeat(8, minmax(0, 1fr)); }
  .field-row { grid-template-columns: 1fr 1fr; gap: 10px; }
  .detail-modal { border-radius: 26px 26px 0 0; }
  .detail-hero { min-height: 235px; }
  .detail-hero img { height: 250px; }
  .detail-body { padding: 22px 18px calc(22px + env(safe-area-inset-bottom)); }
  .detail-title-row h2 { font-size: 24px; }
  .detail-daily b { font-size: 21px; }
  .metric-grid { grid-template-columns: 1fr 1fr; }
  .detail-actions .danger-link { margin-left: 0; }
  .toast { bottom: calc(88px + env(safe-area-inset-bottom)); }
}

@media (max-width: 390px) {
  .summary-foot span { font-size: 9px; }
  .summary-foot b { font-size: 12px; }
  .big-money strong { font-size: 47px; }
  .field-row { grid-template-columns: 1fr; }
  .visual-picker-column { grid-template-columns: 108px minmax(0, 1fr); }
  .item-icon-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); max-height: 142px; }
  .category-icon-grid { grid-template-columns: repeat(7, minmax(0, 1fr)); }
  .donut-layout { grid-template-columns: 1fr; justify-items: center; }
  #categoryLegend { width: 100%; }
  .chart-toolbar { align-items: stretch; flex-direction: column; }
  .range-control { width: 100%; max-width: none; }.range-control button { flex: 1; min-width: 0; }
  .chart-focus { width: 100%; display: grid; grid-template-columns: auto 1fr auto; align-items: baseline; gap: 8px; text-align: left; }.chart-focus span, .chart-focus b, .chart-focus small { display: block; }
}

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