:root {
  --bg: #f5f6f4;
  --card: #ffffff;
  --ink: #171a19;
  --muted: #8b918e;
  --line: #ebeeeb;
  --accent: #0f9d76;
  --accent-dark: #0b7f5f;
  --soft: #e8f6f0;
  --danger: #e2574c;
  --radius: 18px;
  --shadow: 0 1px 2px rgba(23, 26, 25, 0.04), 0 8px 24px rgba(23, 26, 25, 0.04);
}

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

html,
body {
  margin: 0;
  padding: 0;
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  font-variant-numeric: tabular-nums;
}

body.locked {
  overflow: hidden;
}

#app {
  max-width: 520px;
  margin: 0 auto;
  padding: 8px 16px 96px;
  min-height: 100vh;
}

h1,
h2,
h3,
p,
ul,
ol {
  margin: 0;
}

ul,
ol {
  padding: 0;
  list-style: none;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}

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

a {
  color: inherit;
  text-decoration: none;
}

/* ---------- 通用 ---------- */
.page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 2px 8px;
}

.brand {
  font-size: 19px;
  font-weight: 650;
  letter-spacing: 0.2px;
  display: flex;
  align-items: center;
  gap: 7px;
}

.logo {
  font-size: 20px;
}

.icon-btn {
  width: 34px;
  height: 34px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-size: 20px;
  color: var(--muted);
  background: #fff;
  box-shadow: var(--shadow);
}

.muted {
  color: var(--muted);
}
.small {
  font-size: 12.5px;
  line-height: 1.5;
}
.link {
  color: var(--accent);
  font-size: 13px;
  font-weight: 600;
}
.link.danger,
.danger {
  color: var(--danger);
}
.link.strong {
  font-size: 15px;
}
.card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
  box-shadow: var(--shadow);
}
.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13.5px;
  font-weight: 600;
  color: #4a504d;
  margin-bottom: 12px;
  gap: 8px;
}
.spacer {
  height: 20px;
}
.empty {
  color: var(--muted);
  font-size: 13.5px;
  text-align: center;
  padding: 18px 0;
}

/* ---------- 月份条 ---------- */
.monthbar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding: 2px 0 10px;
  font-size: 15px;
  font-weight: 600;
}
.monthbar .icon-btn {
  background: #fff;
  font-size: 18px;
  color: #5a605d;
}

/* ---------- 概览 ---------- */
.hero {
  background: linear-gradient(155deg, #10a97f 0%, #0b8a67 100%);
  color: #fff;
  padding: 20px 18px 18px;
  box-shadow: 0 10px 26px rgba(15, 157, 118, 0.24);
}
.hero-label {
  font-size: 13px;
  opacity: 0.82;
}
.hero-amount {
  font-size: 42px;
  font-weight: 680;
  letter-spacing: -1px;
  line-height: 1.15;
  margin: 2px 0 4px;
}
.hero-amount .cny {
  font-size: 22px;
  margin-right: 3px;
  opacity: 0.9;
}
.hero-sub {
  font-size: 12.5px;
  opacity: 0.85;
}
.delta {
  display: inline-block;
  margin-top: 10px;
  font-size: 11.5px;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
}
.quick {
  display: flex;
  gap: 10px;
  margin-bottom: 12px;
}
.quick-btn {
  flex: 1;
  height: 46px;
  border-radius: 14px;
  background: #fff;
  font-size: 14px;
  font-weight: 600;
  color: #3c4340;
  box-shadow: var(--shadow);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.quick-btn.primary {
  background: #171a19;
  color: #fff;
}
.row-btns {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  flex-wrap: wrap;
}
.row-btns .quick-btn {
  height: 40px;
  flex: 1 1 30%;
  font-size: 13px;
}

/* ---------- 柱状 ---------- */
.bars {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  height: 78px;
  padding-top: 4px;
}
.bar-col {
  flex: 1;
  height: 100%;
  display: flex;
  align-items: flex-end;
}
.bar {
  width: 100%;
  border-radius: 5px;
  background: linear-gradient(180deg, #28b78c, #0f9d76);
  opacity: 0.92;
}
.bars-x {
  display: flex;
  gap: 6px;
  margin-top: 6px;
  font-size: 11px;
  color: var(--muted);
}
.bars-x span {
  flex: 1;
  text-align: center;
}

/* ---------- 账单列表 ---------- */
.tx-list {
  display: flex;
  flex-direction: column;
}
.tx {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
}
.tx:last-child {
  border-bottom: 0;
}
.tx-ico {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  background: #f3f5f3;
  display: grid;
  place-items: center;
  font-size: 17px;
  flex: none;
}
.tx-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.tx-name {
  font-size: 14.5px;
  font-weight: 550;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tx-sub {
  font-size: 11.5px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tx-amt {
  font-size: 15.5px;
  font-weight: 620;
  flex: none;
}
.tx-amt.in {
  color: var(--accent);
}
.day-group {
  margin-bottom: 10px;
}
.day-head {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--muted);
  padding: 6px 4px 2px;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  padding: 14px 16px;
}
.summary-row > div {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.summary-row .muted {
  font-size: 11.5px;
}
.summary-row b {
  font-size: 18px;
  font-weight: 640;
}
.summary-row b.in {
  color: var(--accent);
}

/* ---------- 分段 ---------- */
.seg {
  display: inline-flex;
  background: #eceeec;
  border-radius: 11px;
  padding: 3px;
  gap: 2px;
}
.seg button {
  padding: 5px 13px;
  border-radius: 9px;
  font-size: 13px;
  color: #6b716e;
  font-weight: 550;
}
.seg button.on {
  background: #fff;
  color: var(--ink);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}
.seg.small button {
  padding: 4px 12px;
  font-size: 12.5px;
}

/* ---------- 统计 ---------- */
.chart-card {
  padding: 16px 10px;
}
.chart-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.chart-legend {
  flex: 1;
  min-width: 0;
}
.donut {
  flex: none;
}
.donut-num {
  font-size: 17px;
  font-weight: 650;
  fill: var(--ink);
}
.donut-cap {
  font-size: 9px;
  fill: var(--muted);
}
.cat-list li {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 7px 0;
  font-size: 12.5px;
}
.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex: none;
}
.cat-ico {
  font-size: 13px;
}
.cat-name {
  flex: none;
  max-width: 62px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cat-bar {
  flex: 1;
  height: 5px;
  background: #f0f2f0;
  border-radius: 3px;
  overflow: hidden;
  min-width: 20px;
}
.cat-bar i {
  display: block;
  height: 100%;
  background: var(--accent);
  border-radius: 3px;
}
.cat-num {
  flex: none;
  color: #4a504d;
}
.cat-pct {
  flex: none;
  width: 34px;
  text-align: right;
  color: var(--muted);
  font-size: 11.5px;
}
.daybars {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 72px;
}
.daybars i {
  flex: 1;
  background: #cfe9df;
  border-radius: 2px;
  min-height: 2px;
}
.daybars i.zero {
  background: #f0f2f0;
}

.cal-week {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  font-size: 10.5px;
  color: var(--muted);
  text-align: center;
  margin-bottom: 4px;
}
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}
.cal-cell {
  aspect-ratio: 1;
  border-radius: 8px;
  display: grid;
  place-items: center;
  font-size: 11px;
  color: #4a504d;
}
.cal-cell.blank {
  background: transparent;
}
.cal-cell.today {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
  font-weight: 700;
}

.ai-card {
  background: linear-gradient(180deg, #ffffff, #fbfdfc);
  border: 1px solid #e3f1eb;
}
.ai-summary {
  font-size: 13.5px;
  line-height: 1.65;
  color: #39403d;
}
.tips {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.tips li {
  font-size: 13px;
  line-height: 1.55;
  padding-left: 18px;
  position: relative;
  color: #39403d;
}
.tips li::before {
  content: "→";
  position: absolute;
  left: 0;
  color: var(--accent);
}
.flags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 10px;
}
.flag {
  font-size: 11.5px;
  background: var(--soft);
  color: var(--accent-dark);
  padding: 3px 9px;
  border-radius: 999px;
}

/* ---------- 我的 ---------- */
.field {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}
.field > span {
  width: 74px;
  flex: none;
  font-size: 13px;
  color: var(--muted);
}
.field input,
.field select {
  flex: 1;
  border: 0;
  background: transparent;
  font-size: 13.5px;
  padding: 4px 0;
  min-width: 0;
  outline: none;
}
.badge {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 999px;
  background: #f0f2f0;
  color: var(--muted);
}
.badge.ok {
  background: var(--soft);
  color: var(--accent-dark);
}
.new-cat {
  display: flex;
  gap: 6px;
  margin-bottom: 10px;
}
.new-cat input {
  flex: 1;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 10px;
  font-size: 13px;
  outline: none;
  min-width: 0;
}
.new-cat select {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0 6px;
  font-size: 13px;
  background: #fff;
}
.new-cat .quick-btn {
  flex: none;
  width: 66px;
  height: auto;
  font-size: 13px;
  background: var(--soft);
  color: var(--accent-dark);
  box-shadow: none;
  border-radius: 10px;
}
.cat-manage li {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
  font-size: 13.5px;
}
.cat-manage li:last-child {
  border-bottom: 0;
}
.cat-manage .cat-name {
  flex: 1;
  max-width: none;
}
.steps {
  padding-left: 18px;
  list-style: decimal;
  font-size: 12.5px;
  color: #4a504d;
  line-height: 1.8;
}
.steps code {
  background: #f2f4f2;
  padding: 1px 5px;
  border-radius: 5px;
  font-size: 11.5px;
  word-break: break-all;
}
.file-btn {
  position: relative;
  overflow: hidden;
}

/* ---------- 对话 ---------- */
.chat-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 6px 0 90px;
}
.msg {
  display: flex;
  gap: 8px;
  align-items: flex-start;
}
.msg.me {
  justify-content: flex-end;
}
.avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--soft);
  display: grid;
  place-items: center;
  font-size: 14px;
  flex: none;
}
.bubble {
  max-width: 78%;
  padding: 10px 13px;
  border-radius: 15px;
  font-size: 14px;
  line-height: 1.6;
  background: #fff;
  box-shadow: var(--shadow);
}
.msg.me .bubble {
  background: #171a19;
  color: #fff;
}
.typing {
  color: var(--muted);
}
.chat-empty {
  padding: 24px 4px;
  color: var(--muted);
  font-size: 13px;
}
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}
.chip {
  padding: 8px 13px;
  border-radius: 14px;
  background: #fff;
  font-size: 12.5px;
  color: #4a504d;
  box-shadow: var(--shadow);
}
.chat-input {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 0;
  width: 100%;
  max-width: 520px;
  display: flex;
  gap: 8px;
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
  background: rgba(245, 246, 244, 0.92);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--line);
}
.chat-input input {
  flex: 1;
  height: 42px;
  border-radius: 13px;
  border: 1px solid var(--line);
  background: #fff;
  padding: 0 14px;
  font-size: 14px;
  outline: none;
}
.send {
  width: 62px;
  border-radius: 13px;
  background: var(--accent);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
}
.send:disabled {
  opacity: 0.4;
}

/* ---------- 底部导航 ---------- */
.tabbar {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 0;
  width: 100%;
  max-width: 520px;
  height: calc(58px + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  align-items: center;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(14px);
  border-top: 1px solid var(--line);
  z-index: 30;
}
.tabbar > button {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  font-size: 10.5px;
  color: #9aa09d;
}
.tabbar > button span {
  font-size: 19px;
  filter: grayscale(1);
  opacity: 0.55;
}
.tabbar > button.on {
  color: var(--accent);
  font-weight: 600;
}
.tabbar > button.on span {
  filter: none;
  opacity: 1;
}
.tabbar .fab {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 26px;
  line-height: 1;
  justify-self: center;
  margin-top: -18px;
  box-shadow: 0 8px 18px rgba(15, 157, 118, 0.36);
  justify-content: center;
}

/* ---------- 记账面板 ---------- */
.sheet-mask {
  position: fixed;
  inset: 0;
  background: rgba(20, 24, 22, 0.32);
  z-index: 40;
  animation: fade 0.18s ease;
}
.sheet {
  position: fixed;
  inset: 0;
  z-index: 41;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  padding: calc(6px + env(safe-area-inset-top)) 16px calc(10px + env(safe-area-inset-bottom));
  animation: slideUp 0.22s cubic-bezier(0.22, 0.9, 0.3, 1);
}
@keyframes fade {
  from {
    opacity: 0;
  }
}
@keyframes slideUp {
  from {
    transform: translateY(14px);
    opacity: 0.4;
  }
}
.sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 0 10px;
}
.sheet-head-right {
  display: flex;
  align-items: center;
  gap: 14px;
}
.smart {
  display: flex;
  gap: 8px;
  margin-bottom: 4px;
}
.smart input {
  flex: 1;
  height: 40px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #fff;
  padding: 0 12px;
  font-size: 14px;
  outline: none;
}
.smart input:focus {
  border-color: var(--accent);
}
.parse-btn {
  width: 66px;
  border-radius: 12px;
  background: var(--soft);
  color: var(--accent-dark);
  font-size: 13.5px;
  font-weight: 600;
}
.hint {
  height: 16px;
  font-size: 11.5px;
  color: var(--muted);
  padding-left: 2px;
}
.amount-line {
  text-align: right;
  font-size: 40px;
  font-weight: 680;
  letter-spacing: -1px;
  padding: 4px 4px 8px;
  line-height: 1.2;
  overflow: hidden;
}
.amount-line .cny {
  font-size: 22px;
  color: var(--muted);
  margin-right: 4px;
}
.cat-grid {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  align-content: start;
  padding: 2px 0 10px;
  -webkit-overflow-scrolling: touch;
}
.cat-cell {
  background: #fff;
  border-radius: 14px;
  padding: 10px 4px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  border: 1.5px solid transparent;
}
.cat-cell .ico {
  font-size: 21px;
  line-height: 1;
}
.cat-cell .nm {
  font-size: 11.5px;
  color: #4a504d;
}
.cat-cell.on {
  border-color: var(--accent);
  background: var(--soft);
}
.cat-cell.on .nm {
  color: var(--accent-dark);
  font-weight: 600;
}
.meta {
  display: flex;
  gap: 8px;
  padding: 6px 0;
}
.meta input {
  flex: 1;
  height: 38px;
  border-radius: 11px;
  border: 1px solid var(--line);
  background: #fff;
  padding: 0 10px;
  font-size: 13px;
  outline: none;
  min-width: 0;
}
.meta input[type="date"] {
  flex: none;
  width: 138px;
}
.keypad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  padding-top: 4px;
}
.key {
  height: 46px;
  border-radius: 12px;
  background: #fff;
  font-size: 19px;
  font-weight: 500;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}
.key:active {
  background: #eef1ee;
}

/* ---------- toast ---------- */
#toast {
  position: fixed;
  left: 50%;
  bottom: 96px;
  transform: translate(-50%, 12px);
  background: rgba(23, 26, 25, 0.9);
  color: #fff;
  font-size: 13px;
  padding: 9px 16px;
  border-radius: 12px;
  opacity: 0;
  pointer-events: none;
  transition: all 0.22s ease;
  z-index: 99;
  max-width: 80vw;
  text-align: center;
}
#toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

@media (min-width: 560px) {
  #app {
    padding-top: 20px;
  }
}

/* ---------- 修正 ---------- */
.no-tabbar .tabbar {
  display: none;
}
.no-tabbar .chat-input {
  z-index: 35;
}
.row-btns .quick-btn {
  background: #f4f6f4;
  box-shadow: none;
}
.row-btns .quick-btn.danger {
  background: #fdf1f0;
}
.ai-card .quick-btn {
  background: #f2f6f4;
  box-shadow: none;
  color: var(--accent-dark);
}
.ai-card .quick-btn.primary {
  background: #171a19;
  color: #fff;
}

.chart-row.center {
  justify-content: center;
}
.chart-legend.full {
  margin-top: 12px;
}
.chart-legend.full .cat-name {
  max-width: 74px;
}

/* ---------- 按天账单 ---------- */
.day-card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 4px 16px 2px;
  margin-bottom: 10px;
  box-shadow: var(--shadow);
}
.day-head {
  display: flex;
  align-items: baseline;
  gap: 7px;
  padding: 11px 0 7px;
  border-bottom: 1px solid var(--line);
}
.day-date {
  font-size: 14.5px;
  font-weight: 650;
  color: var(--ink);
}
.day-week {
  font-size: 11.5px;
  color: var(--muted);
}
.day-count {
  font-size: 11px;
  color: var(--muted);
  background: #f2f4f2;
  padding: 1px 6px;
  border-radius: 6px;
}
.day-sum {
  margin-left: auto;
  font-size: 13px;
  font-weight: 620;
  color: #3c4340;
}
.day-card .tx {
  padding: 10px 0;
}
.day-card .tx:last-child {
  border-bottom: 0;
}
.cal-btn {
  position: relative;
  overflow: hidden;
}
.day-picker {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  border: 0;
  padding: 0;
}
.filter-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--soft);
  color: var(--accent-dark);
  font-size: 12.5px;
  padding: 8px 12px;
  border-radius: 12px;
  margin: 0 2px 10px;
}
.filter-chip button {
  margin-left: auto;
  font-size: 12px;
  color: var(--accent-dark);
  text-decoration: underline;
}
.cal-cell {
  border: 0;
  cursor: pointer;
  font-family: inherit;
}
.cal-cell:active {
  transform: scale(0.94);
}

.monthbar {
  position: relative;
}
.monthbar .cal-btn {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
}

/* ---------- 分类详情 ---------- */
.cat-list li[data-act] {
  cursor: pointer;
}
.cat-list li[data-act]:active {
  opacity: 0.6;
}
.cat-arrow {
  color: #c3c9c6;
  font-size: 15px;
  margin-left: 2px;
}
.section-title {
  font-size: 13px;
  color: var(--muted);
  padding: 4px 6px 8px;
  font-weight: 600;
}

/* ---------- 分类下的备注排行 ---------- */
.note-list li {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 0;
  font-size: 12.5px;
}
.note-name {
  flex: none;
  max-width: 96px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.note-bar {
  flex: 1;
  height: 5px;
  background: #f0f2f0;
  border-radius: 3px;
  overflow: hidden;
  min-width: 24px;
}
.note-bar i {
  display: block;
  height: 100%;
  background: var(--accent);
  border-radius: 3px;
}
.note-count {
  flex: none;
  color: var(--muted);
  font-size: 11px;
  width: 40px;
  text-align: right;
}
.note-num {
  flex: none;
  width: 72px;
  text-align: right;
  color: #3c4340;
}

/* ---------- 分类内搜索/排序 ---------- */
.cat-tools {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 2px 2px 10px;
}
.cat-search {
  flex: 1;
  height: 36px;
  border-radius: 11px;
  border: 1px solid var(--line);
  background: #fff;
  padding: 0 12px;
  font-size: 13px;
  outline: none;
  min-width: 0;
  -webkit-appearance: none;
  appearance: none;
}
.cat-search:focus {
  border-color: var(--accent);
}
.cat-tools .seg {
  flex: none;
}

.month-label {
  position: relative;
  cursor: pointer;
}

/* ---------- 首次打开 ---------- */
.welcome {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 40px 24px calc(40px + env(safe-area-inset-bottom));
  gap: 6px;
}
.welcome-logo {
  font-size: 52px;
  line-height: 1;
  margin-bottom: 6px;
}
.welcome h1 {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: 1px;
}
.welcome-sub {
  color: var(--muted);
  font-size: 13.5px;
  margin-top: 6px;
  max-width: 300px;
  line-height: 1.7;
}
.welcome-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  max-width: 320px;
  margin-top: 28px;
}
.welcome-actions .quick-btn {
  flex: none;
  height: 50px;
  font-size: 15px;
}
.welcome-hint {
  margin-top: 18px;
  font-size: 12px;
  color: #a8aeab;
  max-width: 280px;
  line-height: 1.6;
}

/* ---------- 导入预览 ---------- */
.imp-sheet {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 42;
  background: var(--bg);
  border-radius: 22px 22px 0 0;
  max-height: 86vh;
  display: flex;
  flex-direction: column;
  animation: slideUp 0.22s cubic-bezier(0.22, 0.9, 0.3, 1);
}
.imp-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px 10px;
}
.imp-title {
  font-weight: 650;
  font-size: 15px;
}
.imp-body {
  overflow-y: auto;
  padding: 0 18px 12px;
  -webkit-overflow-scrolling: touch;
}
.imp-file {
  font-size: 12.5px;
  color: var(--muted);
  margin-bottom: 10px;
  word-break: break-all;
}
.imp-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  background: #fff;
  border-radius: 16px;
  padding: 14px 16px;
}
.imp-stats > div {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.imp-stats .muted {
  font-size: 11.5px;
}
.imp-stats b {
  font-size: 16px;
  font-weight: 640;
}
.imp-list {
  margin-top: 12px;
  background: #fff;
  border-radius: 16px;
  padding: 4px 14px;
}
.imp-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
  font-size: 12.5px;
}
.imp-list li:last-child {
  border-bottom: 0;
}
.imp-cat {
  color: var(--muted);
  flex: none;
}
.imp-note {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #4a504d;
}
.imp-list b {
  flex: none;
}
.warn-line {
  font-size: 12.5px;
  color: #8a5a00;
  background: #fff7ea;
  border-radius: 12px;
  padding: 10px 12px;
  margin-top: 10px;
  line-height: 1.6;
}
.imp-foot {
  padding: 10px 18px calc(16px + env(safe-area-inset-bottom));
}
.imp-foot .quick-btn {
  width: 100%;
  height: 48px;
}

/* ---------- 多账本 + 三页结构 ---------- */
.tabbar {
  grid-template-columns: repeat(3, 1fr);
}
.fab {
  position: fixed;
  right: 18px;
  bottom: calc(74px + env(safe-area-inset-bottom));
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 28px;
  line-height: 1;
  display: grid;
  place-items: center;
  box-shadow: 0 10px 22px rgba(15, 157, 118, 0.35);
  z-index: 25;
}
.fab:active {
  transform: scale(0.94);
}
.topbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 2px 6px;
}
.topbar .monthbar {
  flex: 1;
  justify-content: center;
  padding: 0;
}
.book-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 34px;
  padding: 0 10px;
  border-radius: 12px;
  background: #fff;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  max-width: 138px;
}
.bp-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.bp-arrow {
  color: var(--muted);
  font-size: 10px;
}
.mini-bars {
  display: flex;
  gap: 7px;
  align-items: flex-end;
  height: 40px;
  margin-top: 16px;
}
.mb-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  gap: 4px;
  height: 100%;
}
.mb-col i {
  display: block;
  width: 100%;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.45);
  min-height: 3px;
}
.mb-col span {
  font-size: 9.5px;
  color: rgba(255, 255, 255, 0.75);
}
.seg.wide {
  margin: 2px 0 10px;
}
.seg.wide button {
  flex: 1;
}
.stats-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 2px 0 10px;
}
.stats-nav .monthbar {
  flex: 1;
  justify-content: center;
  padding: 0;
}
.chat-entry {
  width: 100%;
  margin-top: 2px;
}
.card.tight {
  padding-top: 14px;
  padding-bottom: 14px;
}
.row-link {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  padding: 6px 0;
  font-size: 15px;
  color: var(--text);
}
.rl-left {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
}
.rl-right {
  color: var(--muted);
  font-size: 13px;
}
.sheet-book {
  display: flex;
  align-items: center;
  gap: 5px;
  justify-content: center;
  padding: 0 0 6px;
  font-size: 12.5px;
  color: var(--muted);
}
.sheet-book b {
  color: var(--text);
  font-weight: 600;
}
.sheet-title {
  font-size: 15px;
  font-weight: 650;
}
.books-sheet {
  inset: auto 0 0 0;
  max-height: 78vh;
  overflow-y: auto;
  border-radius: 20px 20px 0 0;
  padding: 10px 16px calc(18px + env(safe-area-inset-bottom));
  box-shadow: 0 -10px 34px rgba(0, 0, 0, 0.14);
}
.book-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 2px;
  border-bottom: 1px solid var(--line);
}
.book-list li .tick {
  margin-left: 6px;
  color: var(--accent);
  font-weight: 700;
  opacity: 0;
}
.book-list li.on .tick {
  opacity: 1;
}
.bk-count {
  margin-left: auto;
  color: var(--muted);
  font-size: 12px;
}
.new-book {
  display: flex;
  gap: 8px;
  margin-top: 14px;
}
.new-book input {
  flex: 1;
}
.book-manage li {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
  font-size: 14px;
}
.book-manage li.archived {
  opacity: 0.55;
}
.bk-actions {
  margin-left: auto;
  display: flex;
  gap: 10px;
}
.rename-input {
  flex: 1;
  max-width: 120px;
}

/* 分段控件铺满 */
.seg.wide {
  display: flex;
  width: 100%;
  margin: 2px 0 12px;
}
.seg.wide button {
  flex: 1;
  padding: 8px 0;
  font-size: 13.5px;
  white-space: nowrap;
}

/* 账本管理里的按钮 */
.book-manage > .quick-btn {
  width: 100%;
  margin-top: 10px;
  background: #f4f6f4;
  box-shadow: none;
}
.books-sheet .new-book .quick-btn {
  flex: none;
  background: #f4f6f4;
  box-shadow: none;
}

.new-book input {
  flex: 1;
  min-width: 0;
  height: 42px;
  padding: 0 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #fff;
  font-size: 14px;
}
.new-book .quick-btn {
  flex: none;
  white-space: nowrap;
  height: 42px;
  padding: 0 16px;
}

.book-manage ~ .quick-btn {
  background: #f4f6f4;
  box-shadow: none;
  margin-top: 10px;
}

/* ---------- 长按说话 ---------- */
.fab {
  touch-action: none;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}
.fab:active {
  transform: scale(0.95);
}

.voice-mask {
  position: fixed;
  inset: 0;
  z-index: 70;
  background: rgba(10, 14, 12, 0.58);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  display: grid;
  place-items: center;
}
.voice-card {
  width: min(280px, 78vw);
  padding: 28px 20px 22px;
  border-radius: 26px;
  background: rgba(255, 255, 255, 0.97);
  text-align: center;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.28);
}
.voice-card.will-cancel {
  background: rgba(255, 242, 241, 0.97);
}
.voice-mic {
  font-size: 46px;
  line-height: 1;
  animation: voicePulse 1.3s ease-in-out infinite;
}
.voice-mic.busy {
  animation: voicePulse 0.7s ease-in-out infinite;
}
.voice-time {
  margin: 10px 0 0;
  font-size: 26px;
  font-variant-numeric: tabular-nums;
  letter-spacing: 1px;
}
.voice-wave {
  display: flex;
  gap: 3px;
  justify-content: center;
  align-items: flex-end;
  height: 26px;
  margin: 8px 0 10px;
}
.voice-wave i {
  width: 3px;
  height: 8px;
  border-radius: 2px;
  background: var(--accent);
  animation: voiceWave 0.9s ease-in-out infinite;
}
.voice-wave i:nth-child(2n) {
  animation-delay: 0.15s;
}
.voice-wave i:nth-child(3n) {
  animation-delay: 0.32s;
}
.voice-wave i:nth-child(4n) {
  animation-delay: 0.48s;
}
.voice-tip {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
}
.will-cancel .voice-tip {
  color: var(--danger);
}
@keyframes voiceWave {
  0%,
  100% {
    height: 6px;
    opacity: 0.45;
  }
  50% {
    height: 24px;
    opacity: 1;
  }
}
@keyframes voicePulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.12);
  }
}

/* ---------- 记账面板重构（2026-11） ---------- */
.sheet {
  top: auto;
  max-height: 96vh;
  overflow-y: auto;
  border-radius: 22px 22px 0 0;
  box-shadow: 0 -10px 40px rgba(15, 30, 22, 0.12);
}
.sheet input,
.sheet textarea {
  font-size: 16px;
}
.amount-box {
  padding: 2px 6px 4px;
  text-align: right;
}
.amount-expr {
  min-height: 18px;
  font-size: 13px;
  color: var(--muted);
  letter-spacing: 0.02em;
}
.amount-line {
  padding: 0 4px 6px;
}
#amt {
  font-variant-numeric: tabular-nums;
}
.cat-strip {
  display: flex;
  gap: 7px;
  overflow-x: auto;
  padding: 6px 0 10px;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.cat-strip::-webkit-scrollbar {
  display: none;
}
.cat-chip {
  flex: none;
  width: 60px;
  padding: 8px 0 6px;
  border-radius: 14px;
  background: #fff;
  border: 1.5px solid transparent;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}
.cat-chip .ico {
  font-size: 19px;
  line-height: 1;
}
.cat-chip .nm {
  font-size: 11px;
  color: #4a504d;
}
.cat-chip.on {
  border-color: var(--accent);
  background: var(--soft);
}
.cat-chip.on .nm {
  color: var(--accent-dark);
  font-weight: 600;
}
.sheet-meta {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 2px 0 8px;
}
.meta-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 34px;
  padding: 0 11px;
  border-radius: 11px;
  background: #fff;
  border: 1px solid var(--line);
  font-size: 13px;
  color: var(--ink);
}
.date-chip {
  padding-right: 6px;
}
.date-chip input {
  border: 0;
  background: transparent;
  font-size: 16px;
  width: 132px;
  padding: 0;
  color: var(--ink);
  outline: none;
}
input.note-row {
  width: 100%;
  height: 38px;
  margin-bottom: 8px;
  border-radius: 11px;
  border: 1px solid var(--line);
  background: #fff;
  padding: 0 12px;
  outline: none;
}
input.note-row:focus {
  border-color: var(--accent);
}
.tag-row {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 0 0 10px;
  scrollbar-width: none;
}
.tag-row::-webkit-scrollbar {
  display: none;
}
.tag {
  flex: none;
  height: 30px;
  padding: 0 11px;
  border-radius: 15px;
  background: #fff;
  border: 1px solid var(--line);
  font-size: 12.5px;
  color: #4a504d;
}
.tag.on {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.tag-input {
  flex: none;
  width: 92px;
  height: 30px;
  border-radius: 15px;
  border: 1px dashed var(--line);
  background: transparent;
  padding: 0 10px;
  outline: none;
}
.pad {
  margin-top: auto;
}
.keyops {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
  padding-bottom: 6px;
}
.keyops .key {
  height: 38px;
  font-size: 17px;
  color: var(--accent-dark);
  background: var(--soft);
  box-shadow: none;
}
.keyops .key.eq {
  background: var(--accent);
  color: #fff;
}
.seg.small {
  padding: 2px;
}
.seg.small button {
  padding: 5px 12px;
  font-size: 13px;
}
.link.danger {
  color: #c0392b;
}
.link.strong {
  font-weight: 700;
}

/* ---------- 语音识别结果卡片 ---------- */
.vr-card {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: calc(12px + env(safe-area-inset-bottom));
  z-index: 61;
  background: #fff;
  border-radius: 20px;
  padding: 14px 16px 16px;
  box-shadow: 0 12px 40px rgba(15, 40, 30, 0.22);
  animation: slideUp 0.2s cubic-bezier(0.22, 0.9, 0.3, 1);
}
.vr-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.vr-title {
  font-size: 13px;
  color: var(--muted);
}
.vr-raw {
  font-size: 13px;
  color: #4a504d;
  margin: 6px 0 10px;
}
.vr-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.vr-amt {
  display: flex;
  align-items: baseline;
  justify-content: flex-end;
  gap: 4px;
}
.vr-amt .cny {
  font-size: 20px;
  color: var(--muted);
}
.vr-amt input {
  width: 150px;
  text-align: right;
  border: 0;
  background: transparent;
  font-size: 34px;
  font-weight: 680;
  letter-spacing: -1px;
  outline: none;
}
.vr-line {
  display: flex;
  gap: 8px;
  align-items: center;
}
.vr-note {
  flex: 1;
  height: 34px;
  border-radius: 11px;
  border: 1px solid var(--line);
  padding: 0 11px;
  font-size: 16px;
  outline: none;
  min-width: 0;
  background: #fff;
}
.vr-foot {
  display: flex;
  gap: 10px;
  margin-top: 12px;
}
.vr-foot .quick-btn {
  flex: 1;
  height: 42px;
}

.tag-manage li {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
}
.tag-manage li:last-child {
  border-bottom: 0;
}
.tag-manage .tag-name {
  font-weight: 500;
}
.tag-manage .row-acts {
  margin-left: auto;
  display: flex;
  gap: 12px;
}

/* ---------- 分析页：总览 / 支出 / 收入 ---------- */
.stats-tabs {
  margin: 12px 0 2px;
}
.tri {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.tri > div {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.tri b {
  font-size: 19px;
  font-weight: 650;
  letter-spacing: -0.01em;
}
.tri b.in {
  color: var(--accent-dark);
}
.tri b.out {
  color: #c0392b;
}
.rate-line {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
}
.rate-line b {
  font-size: 14px;
}
.rate-bar {
  flex: 1;
  height: 6px;
  border-radius: 3px;
  background: #eef1ee;
  overflow: hidden;
}
.rate-bar i {
  display: block;
  height: 100%;
  border-radius: 3px;
  background: var(--accent);
}
.dual-bars {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  height: 132px;
  padding: 6px 2px 0;
}
.db-col {
  flex: 1;
  height: 100%;
  display: flex;
  align-items: flex-end;
}
.db-pair {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 3px;
}
.db-pair i {
  width: 46%;
  min-height: 2px;
  border-radius: 4px 4px 2px 2px;
}
.db-e {
  background: var(--accent);
}
.db-i {
  background: #a9dfc9;
}

.now-btn {
  height: 30px;
  padding: 0 10px;
  border-radius: 15px;
  background: var(--soft);
  color: var(--accent-dark);
  font-size: 12.5px;
}
.cal-cell {
  position: relative;
  height: 42px;
  border-radius: 10px;
  background: #f5f6f4;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  color: #3d4340;
}
.cal-cell.blank {
  background: transparent;
}
.cal-cell.has {
  background: var(--soft);
  font-weight: 600;
}
.cal-cell.today {
  box-shadow: inset 0 0 0 1.5px var(--accent);
  color: var(--accent-dark);
  font-weight: 700;
}
.cal-cell.sel {
  background: var(--accent);
  color: #fff;
  box-shadow: none;
}
.cal-cell .cdot {
  position: absolute;
  bottom: 5px;
  left: 50%;
  width: 4px;
  height: 4px;
  margin-left: -2px;
  border-radius: 2px;
  background: var(--accent);
}
.cal-cell.sel .cdot {
  background: #fff;
}
.cal-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 10px;
}

.ai-summary {
  white-space: pre-wrap;
  line-height: 1.7;
}
.ai-summary.raw {
  max-height: 320px;
  overflow-y: auto;
}

/* ---------- 移动端输入法：小于 16px 会触发 iOS 自动放大 ---------- */
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
#app input,
#app textarea,
#app select,
#sheet-root input,
#sheet-root textarea,
#sheet-root select,
.sheet input,
.sheet textarea {
  font-size: 16px;
}

.tag-new {
  border-style: dashed;
  color: var(--accent-dark);
  background: transparent;
}
.vr-tags {
  margin: 8px 0 4px;
}

/* 分类编辑 */
.cat-acts { display: flex; gap: 12px; margin-left: auto; }
.cat-preview {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 0 18px;
}
.cat-preview-ico {
  width: 64px;
  height: 64px;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  line-height: 1;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 18px;
}
#cat-name-input {
  flex: 1;
  min-width: 0;
  height: 48px;
  padding: 0 14px;
  font-size: 19px;
  font-weight: 600;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
}
.icon-grid {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 8px;
}
.icon-cell {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 21px;
  line-height: 1;
  background: #fff;
  border: 1px solid transparent;
  border-radius: 12px;
  cursor: pointer;
  padding: 0;
}
.icon-cell.on {
  border-color: var(--accent);
  background: var(--soft);
}
.icon-custom {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
}
.icon-custom input {
  flex: 1;
  min-width: 0;
  height: 42px;
  padding: 0 12px;
  font-size: 17px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
}

/* 二级分类 */
.cat-strip.sub {
  margin-top: -6px;
  padding-bottom: 4px;
  gap: 8px;
}
.cat-strip.sub.empty { display: none; }
.sub-chip {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  font: inherit;
  font-size: 13px;
  white-space: nowrap;
  cursor: pointer;
}
.sub-chip .ico { font-size: 14px; line-height: 1; }
.sub-chip.on {
  border-color: var(--accent);
  background: var(--soft);
  color: var(--accent-dark);
  font-weight: 600;
}
.cat-manage li.cat-child {
  padding-left: 26px;
}
.cat-manage li.cat-child .tx-ico.small {
  width: 28px;
  height: 28px;
  font-size: 15px;
}
.cat-manage li.cat-child .cat-name {
  font-size: 14px;
  color: var(--ink);
}
.cat-manage .link + .link { margin-left: 2px; }

/* 子分类管理（在分类编辑面板里） */
.sub-manage {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}
.sub-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 8px;
  font-size: 14px;
  font-weight: 600;
}
.sub-list { list-style: none; margin: 0 0 12px; padding: 0; }
.sub-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
  font-size: 15px;
}
.sub-list li.muted { border-bottom: 0; justify-content: flex-start; }
.new-sub { display: flex; gap: 8px; }
.new-sub input {
  flex: 1;
  min-width: 0;
  height: 42px;
  padding: 0 12px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  font-size: 15px;
}
.new-sub .quick-btn {
  flex: none;
  white-space: nowrap;
  height: 42px;
  padding: 0 16px;
}

/* 分类编辑面板：压缩图标格，给子分类留位置 */
.icon-grid { gap: 6px; }
.icon-cell { font-size: 19px; border-radius: 10px; }
.cat-edit { padding-bottom: calc(20px + env(safe-area-inset-bottom, 0px)); }
.sub-manage { padding-bottom: 8px; }

/* 子分类管理页 */
.sub-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 14px;
  color: var(--muted);
}
.sub-banner .quick-btn { flex: none; height: 36px; padding: 0 14px; font-size: 14px; }
.sub-group .card-head { align-items: baseline; }
.sub-rows { list-style: none; margin: 0; padding: 0; }
.sub-rows li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
  font-size: 15px;
}
.sub-rows li .sub-nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sub-rows li .cat-acts { display: flex; gap: 12px; flex: none; }
.sub-rows li .rename-input { flex: 1; min-width: 0; }
.sub-rows li.sub-own { border-top-style: dashed; color: var(--muted); }
.sub-rows li.sub-own span:first-child { flex: 1; }
.card-head a.link { text-decoration: underline; }
