@import './fonts/misans-latin.css';
@import './tokens.css';

/* ================================================================
   Identity Panel · 1:1 Calends Visual System
   中性、克制：浅灰侧边栏 + 白色画布，0.5px 细线代替阴影，墨黑控件；颜色只留给数据
   ================================================================ */
:root {
  --font: 'MiSans Latin', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  --font-num: 'MiSans Latin', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'PingFang SC', sans-serif;
  --mono: 'Geist Mono', ui-monospace, 'SF Mono', Menlo, monospace;
  --side-w: 260px;
  --icon-button-size: var(--ctl-h-md);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font: var(--fs-2)/1.45 var(--font);
  letter-spacing: -0.005em;
  color: var(--label);
  background: var(--bg);
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
button, input, textarea, select { font: inherit; color: inherit; letter-spacing: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
a { color: inherit; text-decoration: none; }
.i { width: 18px; height: 18px; flex-shrink: 0; display: inline-block; vertical-align: middle; }
.muted { color: var(--label-2); }
.soft { color: var(--label-3); }
.red { color: var(--red); }
.green, .gain { color: var(--gain); }
.loss { color: var(--loss); }
.num { font-variant-numeric: tabular-nums; }
.mono { font-family: var(--mono); }
.sp { flex: 1; }
.small { font-size: var(--fs-1); }
.text-ellipsis { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------------- 金额 ---------------- */
.amt {
  font-family: var(--font-num);
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  letter-spacing: -0.02em;
  white-space: nowrap;
}
.amt .cur { font-weight: 600; margin-right: 0.04em; }
.amt .dec { font-size: 0.62em; font-weight: 600; color: var(--label-2); }
.amt small { font-size: var(--fs-1); font-weight: 600; letter-spacing: 0; }

/* ---------------- 外壳与侧边栏 ---------------- */
.app { display: flex; min-height: 100dvh; }
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--side-w);
  z-index: 30;
  display: flex;
  flex-direction: column;
  padding: 10px 8px;
  background: var(--sidebar);
  border-right: 0;
  transition: transform var(--duration) var(--ease);
}
.app.collapsed { --side-w: 0px; }
.app.collapsed .sidebar { transform: translateX(-100%); }
.sb-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 2px 4px 10px 8px;
}
.sb-mark {
  height: var(--ctl-h-md);
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: var(--fs-2);
  font-weight: 600;
  letter-spacing: -0.01em;
}
.sb-mark img { width: 24px; height: 24px; border-radius: var(--radius-sm); object-fit: cover; }

.side-item {
  display: flex;
  align-items: center;
  width: 100%;
  height: 36px;
  padding: 0 10px;
  gap: 10px;
  border-radius: var(--radius-md);
  font-size: var(--fs-2);
  color: var(--label);
  font-weight: 400;
  text-align: left;
  transition: background var(--duration) var(--ease);
}
.side-item .i { width: 18px; height: 18px; color: var(--label); }
.side-item:hover { background: var(--hover); }
.side-item.active { background: var(--hover); color: var(--label); font-weight: 500; }
.side-item kbd {
  margin-left: auto;
  font: 500 var(--fs-1) var(--font);
  color: var(--label-3);
  opacity: 0;
  transition: opacity var(--duration) var(--ease);
}
.side-item:hover kbd { opacity: 1; }
.side-item .side-badge {
  margin-left: auto;
  font-size: var(--fs-1);
  font-weight: 600;
  color: var(--red);
  font-variant-numeric: tabular-nums;
}
.side-gap { height: 8px; }
.side-scroll {
  flex: 1;
  overflow-y: auto;
  margin: 0 -4px;
  padding: 0 4px;
  scrollbar-width: none;
}
.side-scroll::-webkit-scrollbar { display: none; }
.side-label {
  font-size: var(--fs-1);
  font-weight: 500;
  color: var(--label-3);
  padding: 18px 10px 6px;
}
.side-recent .side-item { height: 34px; font-size: var(--fs-2); }
.side-recent .side-item > span:first-of-type { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-recent .side-item small {
  margin-left: auto;
  font-size: var(--fs-1);
  color: var(--label-3);
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
}
.side-recent .side-item.soon small { color: var(--orange); }
.side-foot { padding-top: 6px; margin-top: 4px; }
.side-foot .side-item small {
  margin-left: auto;
  font-size: var(--fs-1);
  color: var(--label-3);
}
.side-dot {
  width: 7px;
  height: 7px;
  margin-left: auto;
  border-radius: var(--radius-pill);
  flex-shrink: 0;
  background: var(--accent);
}

/* ---------------- 主区与粘性工具栏 ---------------- */
.main {
  flex: 1;
  min-width: 0;
  max-width: calc(100% - var(--side-w));
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  margin-left: var(--side-w);
  transition: margin-left var(--duration) var(--ease);
  background: var(--bg);
}
.app.collapsed .main { max-width: 100%; }
.toolbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 12px;
  min-height: 60px;
  max-width: 100%;
  padding: 10px 32px;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(8px);
}
.toolbar::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: -12px;
  height: 12px;
  background: linear-gradient(var(--bg), transparent);
  pointer-events: none;
  opacity: 0.9;
}
.tb-title {
  display: flex;
  align-items: baseline;
  gap: 10px;
  min-width: 0;
  flex: 1 1 auto;
}
.tb-title h1 {
  margin: 0;
  font-size: var(--fs-3);
  font-weight: 600;
  letter-spacing: -0.015em;
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  flex-shrink: 0;
}
.tb-sub {
  flex: 0 1 auto;
  min-width: 0;
  font-size: var(--fs-1);
  color: var(--label-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tb-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  max-width: 100%;
  margin-left: auto;
}
.tb-search {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 0 1 168px;
  min-width: 110px;
  height: var(--ctl-h-md);
  padding: 0 10px 0 12px;
  border-radius: var(--radius-pill);
  background: var(--fill);
  color: var(--label-3);
  transition: background var(--duration) var(--ease);
}
.tb-search:focus-within {
  background: var(--card);
  outline: var(--hairline) solid var(--focus-ring);
  outline-offset: 2px;
}
.tb-search .i { width: 15px; height: 15px; flex-shrink: 0; }
.tb-search input {
  flex: 1;
  min-width: 0;
  height: 100%;
  border: 0;
  outline: 0;
  background: none;
  color: var(--label);
  font: inherit;
  font-size: var(--fs-2);
}

.page {
  width: 100%;
  padding: 20px 32px 64px;
  max-width: 1180px;
  margin: 0 auto;
}
.stack { display: flex; flex-direction: column; gap: 16px; }
.grid { display: grid; gap: 16px; }
.g-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.row { display: flex; align-items: center; gap: 8px; }
@media (max-width: 900px) { .g-2, .g-3, .g-4 { grid-template-columns: 1fr; } }

/* ---------------- 基础控件 ---------------- */
.card {
  background: var(--card);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  box-shadow: 0 0 0 var(--hairline) var(--line);
}
.card-h {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.card-h h2, .card-h h3, .sec-title {
  margin: 0;
  font-size: var(--fs-3);
  font-weight: 600;
  letter-spacing: -0.015em;
}
.sec-sub { font-size: var(--fs-1); color: var(--label-3); margin-top: 3px; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: var(--ctl-h-md);
  padding: 0 12px;
  border-radius: var(--radius-md);
  background: var(--card);
  color: var(--label);
  font-size: var(--fs-2);
  font-weight: 500;
  box-shadow: inset 0 0 0 var(--hairline) var(--line);
  white-space: nowrap;
  transition: background var(--duration) var(--ease);
}
.btn:hover { background: var(--hover); }
.btn.primary { background: var(--ink); color: var(--on-ink); box-shadow: none; }
.btn.primary:hover { background: color-mix(in srgb, var(--ink) 85%, var(--bg)); }
.btn.tinted { background: var(--fill); color: var(--label); box-shadow: none; }
.btn.plain { background: none; box-shadow: none; color: var(--label-2); padding: 0 6px; }
.btn.plain:hover { color: var(--label); background: none; }
.btn.danger { color: var(--red); box-shadow: none; }
.btn.sm { height: var(--ctl-h-sm); padding: 0 10px; font-size: var(--fs-1); }
.btn .i { width: 15px; height: 15px; }

.icon-btn {
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: var(--icon-button-size);
  height: var(--icon-button-size);
  border-radius: var(--radius-pill);
  background: none;
  color: var(--label-2);
  box-shadow: inset 0 0 0 var(--hairline) var(--line);
  transition: background var(--duration) var(--ease), color var(--duration) var(--ease);
}
.icon-btn:hover { background: var(--hover); color: var(--label); }
.icon-btn.accent { background: var(--ink); color: var(--on-ink); box-shadow: none; }
.icon-btn.sb-toggle { box-shadow: none; }
.icon-btn svg, .icon-btn .i { width: 16px; height: 16px; }

.seg {
  position: relative;
  isolation: isolate;
  display: inline-flex;
  align-items: stretch;
  height: var(--ctl-h-md);
  padding: 2px;
  border-radius: var(--radius-pill);
  background: var(--fill);
}
.seg button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 0 12px;
  border-radius: var(--radius-pill);
  font-size: var(--fs-2);
  color: var(--label-2);
  white-space: nowrap;
  transition: color var(--duration) var(--ease);
}
.seg button.on {
  background: var(--card);
  color: var(--label);
  font-weight: 500;
  box-shadow: 0 0 0 var(--hairline) var(--line);
}
.seg.sm { height: var(--ctl-h-sm); }
.seg.sm button { padding: 0 10px; font-size: var(--fs-1); }
.seg-icon { display: inline-flex; align-items: center; }
.seg-icon .i { width: 14px; height: 14px; }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  font-size: var(--fs-1);
  font-weight: 500;
  background: var(--fill);
  color: var(--label-2);
  white-space: nowrap;
}
.badge.green { background: var(--green-3); color: var(--green); }
.badge.red { background: var(--red-3); color: var(--red); }
.badge.orange, .badge.amber { background: var(--orange-3); color: var(--orange); }
.badge.blue { background: var(--accent-soft); color: var(--accent); }

.dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; flex-shrink: 0; }
.dot.on { background: var(--green-9); }
.dot.off { background: var(--gray-8); }
.dot.bad { background: var(--red-9); }
.dot.warn { background: var(--orange-9); }

.input, .select, .textarea {
  width: 100%;
  height: 36px;
  border: 0;
  border-radius: var(--radius-md);
  background: var(--bg);
  color: var(--label);
  padding: 0 12px;
  font: inherit;
  box-shadow: inset 0 0 0 var(--hairline) var(--line);
  outline: none;
}
.textarea { height: auto; padding: 10px 12px; resize: vertical; }
.input:focus, .select:focus, .textarea:focus { box-shadow: inset 0 0 0 1.5px var(--indigo-9); }
label.f { display: block; }
label.f > span { display: block; font-size: var(--fs-1); color: var(--label-2); margin-bottom: 5px; }

.flag-img { width: 16px; height: 12px; object-fit: cover; border-radius: 2px; flex-shrink: 0; vertical-align: middle; }

/* ---------------- 图标徽标 (.ico / .mmark) ---------------- */
.ico {
  width: var(--s, 36px);
  height: var(--s, 36px);
  border-radius: calc(var(--s, 36px) * 0.28);
  display: grid;
  place-items: center;
  flex-shrink: 0;
  overflow: hidden;
  background: #fff;
  box-shadow: inset 0 0 0 var(--hairline) var(--line);
}
.ico img { width: 68%; height: 68%; object-fit: contain; display: block; }
.ico.mono {
  background: var(--tint, var(--ink));
  color: #fff;
  font-weight: 700;
  font-size: calc(var(--s, 36px) * 0.44);
  box-shadow: none;
}
.av {
  width: var(--s, 30px);
  height: var(--s, 30px);
  border-radius: calc(var(--s, 30px) * 0.28);
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 700;
  font-size: calc(var(--s, 30px) * 0.36);
  flex-shrink: 0;
}

/* ---------------- MetricCards inline ---------------- */
.metric-cards { display: block; min-width: 0; width: 100%; }
.metric-grid { display: grid; grid-template-columns: repeat(var(--metric-columns, 4), minmax(0, 1fr)); gap: 12px; }
.metric-grid > div {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  padding: 14px 16px 16px;
  border-radius: var(--radius-md);
  background: var(--card);
  box-shadow: 0 0 0 var(--hairline) var(--gray-6);
}
.metric-cards.inline .metric-grid { gap: 0; }
.metric-cards.inline .metric-grid > div {
  padding: 0 16px;
  border-radius: 0;
  background: none;
  box-shadow: none;
  border-left: var(--hairline) solid var(--sep);
}
.metric-cards.inline .metric-grid > div:first-child { padding-left: 0; border-left: 0; }
.metric-top > small { color: var(--label-2); font-size: var(--fs-1); }
.metric-value {
  color: var(--label);
  font-size: var(--fs-metric);
  font-weight: 650;
  letter-spacing: -0.025em;
  font-variant-numeric: tabular-nums;
  line-height: 28px;
}
.metric-note { color: var(--label-3); font-size: var(--fs-1); }

/* ---------------- 概览：Statement + 星图 ---------------- */
.stmt {
  position: relative;
  display: grid;
  grid-template-columns: minmax(280px, 0.9fr) minmax(0, 1.4fr);
  gap: 32px;
  padding: 28px 30px 26px;
  border-radius: var(--radius-lg);
  color: var(--label);
  background: var(--card);
  box-shadow: inset 0 0 0 var(--hairline) var(--line);
}
@media (max-width: 960px) { .stmt { grid-template-columns: 1fr; padding: 22px 20px; } }
.stmt-l { display: flex; flex-direction: column; min-width: 0; }
.stmt-kicker { font-size: var(--fs-2); color: var(--label-2); }
.stmt-num { font-size: var(--fs-4); line-height: 1; margin: 12px 0; }
.stmt-num .amt { font-weight: 600; letter-spacing: -0.045em; }
.stmt-delta { font-size: var(--fs-2); color: var(--label-3); display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.stmt-delta span {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  background: var(--fill);
  color: var(--label);
}
.stmt-delta span.up { background: var(--loss-3); color: var(--loss); }
.stmt-delta span.down { background: var(--gain-3); color: var(--gain); }
.stmt-spark { width: 100%; flex: 1 1 64px; min-height: 64px; margin: 18px 0 0; color: var(--label); overflow: visible; }
.stmt-spark path:first-child { opacity: 0.5; }
.stmt-spark .ahead { color: var(--label-3); }
.stmt-axis { display: flex; justify-content: space-between; margin: 6px 0 18px; font-size: var(--fs-1); color: var(--label-3); }
.stmt-r { display: flex; flex-direction: column; min-width: 0; }
.stmt-cap { font-size: var(--fs-1); color: var(--label-3); margin-bottom: 10px; min-height: 18px; }
.stmt-cap b { color: var(--label); font-weight: 600; }
.stars { position: relative; width: 100%; margin: auto 0; max-height: 360px; }
.star {
  position: absolute;
  border: 0;
  padding: 0;
  border-radius: var(--radius-pill);
  display: grid;
  place-items: center;
  align-content: center;
  gap: 3px;
  background: var(--card-2);
  box-shadow: inset 0 0 0 var(--hairline) var(--line);
  translate: var(--push, 0 0);
  transition: background var(--duration) var(--ease), translate var(--duration) var(--ease), scale var(--duration) var(--ease);
}
.star.on {
  z-index: 2;
  scale: 1.07;
  background: var(--card);
  box-shadow: inset 0 0 0 var(--hairline) var(--label-3);
}
.star.warn-ring { box-shadow: inset 0 0 0 1.5px var(--orange-9); }
.star.bad-ring { box-shadow: inset 0 0 0 1.5px var(--red-9); }
.star .ico { box-shadow: none; }
.star.on .ico, .star.on .av { animation: star-wiggle 520ms var(--ease); }
@keyframes star-wiggle { 0%,100%{rotate:0deg} 30%{rotate:-10deg} 65%{rotate:6deg} }
.star-amt { font-size: var(--fs-1); font-weight: 600; color: var(--label-2); font-variant-numeric: tabular-nums; }

/* ---------------- 时间线 (Calends Timeline) ---------------- */
.tl {
  --tl-fg: var(--label);
  --tl-mute: var(--label-3);
  --tl-line: var(--line);
  --tl-card: var(--card);
  --tl-fill: var(--fill-2);
  position: relative;
}
.tl::before, .tl::after {
  content: '';
  position: absolute;
  top: 0; bottom: 0; width: 40px; z-index: 3; pointer-events: none;
}
.tl::before { left: 0; background: linear-gradient(90deg, var(--tl-card), transparent); }
.tl::after { right: 0; background: linear-gradient(270deg, var(--tl-card), transparent); }
.tl-scroll { overflow-x: auto; overflow-y: hidden; cursor: grab; scrollbar-width: none; }
.tl-scroll::-webkit-scrollbar { display: none; }
.tl-scroll:active { cursor: grabbing; }
.tl-track {
  position: relative;
  height: 176px;
  user-select: none;
  background:
    linear-gradient(var(--tl-line), var(--tl-line)) 0 140px / 100% 1px no-repeat,
    repeating-linear-gradient(90deg, color-mix(in srgb, var(--tl-mute) 70%, transparent) 0 1px, transparent 1px calc(var(--day) * 7)) var(--mon) 140px / 100% 7px no-repeat,
    repeating-linear-gradient(90deg, color-mix(in srgb, var(--tl-mute) 35%, transparent) 0 1px, transparent 1px var(--day)) 0 140px / 100% 4px no-repeat;
}
.tl-month { position: absolute; top: 140px; width: 1px; height: 12px; background: var(--tl-fg); opacity: 0.9; }
.tl-month span { position: absolute; top: 15px; left: 0; transform: translateX(-50%); font-size: var(--fs-1); font-weight: 600; color: var(--tl-fg); opacity: 0.75; white-space: nowrap; }
.tl-today { position: absolute; top: 4px; height: 137px; width: 0; border-left: var(--hairline) solid var(--tl-fg); opacity: 0.85; }
.tl-today span {
  position: absolute; top: 152px; left: 0; transform: translateX(-50%);
  padding: 1px 7px; border-radius: var(--radius-pill);
  background: var(--tl-fg); color: var(--tl-card);
  font-size: var(--fs-1); font-weight: 600; white-space: nowrap;
}
.tl-icon {
  position: absolute; display: grid; place-items: center;
  width: 30px; height: 30px; border-radius: var(--radius-md);
  cursor: pointer; z-index: 1;
}
.tl-icon::before {
  content: ''; position: absolute; top: 100%; left: 50%; width: 1px; height: var(--stem);
  background: var(--tl-mute); opacity: 0.35; z-index: -1;
}
.tl-icon.past { opacity: 0.5; }
.tl-icon.past:hover, .tl-icon:hover { opacity: 1; z-index: 3; }
.tl-dot {
  position: absolute; top: 137px; width: 7px; height: 7px; margin-left: -3px;
  border-radius: var(--radius-pill); background: var(--tl-card);
  box-shadow: inset 0 0 0 var(--hairline) var(--tl-fg); z-index: 2;
}
.tl-dot.past { box-shadow: inset 0 0 0 var(--hairline) var(--tl-mute); }
.tl-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 6px; }
.tl-count {
  position: absolute; right: -2px; bottom: -2px; min-width: 16px; height: 16px; padding: 0 3px;
  border-radius: var(--radius-pill); background: var(--tl-fg); color: var(--tl-card);
  box-shadow: 0 0 0 1.5px var(--tl-card); font-size: 10px; font-weight: 700; line-height: 16px; text-align: center;
}
.tl-home {
  position: absolute; top: 0; right: 0; z-index: 4; height: var(--ctl-h-md);
  padding: 0 9px; border-radius: var(--radius-pill);
  background: var(--tl-fill); color: var(--tl-mute); font-size: var(--fs-1);
}
.tl-home:hover { color: var(--tl-fg); }
.act-stream-hit { position: absolute; inset: 0; z-index: 2; cursor: pointer; }
.stmt-end-dot {
  position: absolute; width: 7px; height: 7px; border-radius: 50%;
  background: var(--label); transform: translate(-50%, -50%); pointer-events: none;
  box-shadow: 0 0 0 2px var(--card);
}
.stmt-spark-wrap { position: relative; display: flex; flex-direction: column; flex: 1 1 64px; min-height: 64px; margin: 18px 0 0; }
.stmt-spark-wrap .stmt-spark { margin: 0; }
.stmt-spark-hits { position: absolute; inset: 0; display: flex; }
.stmt-spark-hits span { flex: 1; cursor: crosshair; }

/* ---------------- Floating Calends Tooltips (.tip / .tip-table) ---------------- */
.tip {
  position: fixed;
  z-index: 1200;
  pointer-events: none;
  background: var(--card);
  color: var(--label);
  font-size: var(--fs-1);
  line-height: 1.5;
  padding: 8px 11px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg), inset 0 0 0 var(--hairline) var(--line);
  white-space: normal;
  overflow-wrap: anywhere;
  max-width: min(320px, calc(100vw - 16px));
  opacity: 0;
  transform: translateY(3px);
  transition: opacity 90ms var(--ease), transform 90ms var(--ease);
}
.tip.show { opacity: 1; transform: translateY(0); }
.tip-table {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  column-gap: 16px;
  row-gap: 3px;
}
.tip-table.with-share { grid-template-columns: max-content minmax(0, 1fr) max-content; }
.tip-table .num { text-align: right; font-variant-numeric: tabular-nums; font-family: var(--mono); overflow-wrap: anywhere; }
.tip-table b { font-weight: 600; }
.tip-table .tip-share { color: var(--label-3); }
.tip-head {
  grid-column: 1 / -1;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 4px;
  padding-bottom: 6px;
  border-bottom: var(--hairline) solid var(--sep);
}
.tip-table span:not(.num) { color: var(--label-2); display: inline-flex; align-items: center; }
.tip-table .tip-hot { color: var(--label) !important; font-weight: 600; }
.tip-table .tip-dim { opacity: 0.42; }
.tip-dot { display: inline-block; width: 8px; height: 8px; margin-right: 6px; border-radius: 50%; flex-shrink: 0; }
.act-sel-pill {
  height: var(--ctl-h-md); padding: 0 24px 0 11px; border-radius: var(--radius-pill);
  border: 0; background: var(--fill-2); color: var(--label); font: inherit; font-size: var(--fs-1);
  font-weight: 600; cursor: pointer; outline: none;
  box-shadow: inset 0 0 0 var(--hairline) var(--line);
}
.act-sel-pill:hover { background: var(--fill); }
.rp-hit { cursor: pointer; }
.rp-guide { stroke: var(--label-3); stroke-width: 1; stroke-dasharray: 3 3; opacity: 0; pointer-events: none; transition: opacity 90ms; }
.rp-hit-band:hover .rp-guide { opacity: 0.65; }
.dh-day:hover .dh-top { stroke: var(--ink); stroke-width: 1; }
.mv-wf-col { cursor: pointer; transition: opacity var(--duration) var(--ease); }
.mv-wf-col:hover { opacity: 0.86; }
.globe-row { cursor: default; border-radius: var(--radius-sm); padding: 3px 4px; margin: -3px -4px; }
.globe-row:hover { background: var(--fill-2); }

/* ---------------- Spending 柱状图 & 河流图 ---------------- */
.ov-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; flex-wrap: wrap; }
.act { position: relative; height: calc(var(--h) + 26px); margin-top: 22px; padding-left: 52px; }
.act-grid { position: absolute; left: 0; right: 0; top: 0; height: var(--h); pointer-events: none; }
.act-tick { position: absolute; left: 0; right: 0; border-top: var(--hairline) dashed var(--sep); }
.act-tick:first-child { border-top: var(--hairline) solid var(--line); }
.act-tick span {
  position: absolute; left: 0; top: -8px; font-size: var(--fs-1); color: var(--label-3);
  font-variant-numeric: tabular-nums; background: var(--card); padding-right: 6px;
}
.act-bars { position: relative; display: flex; gap: 6px; height: var(--h); align-items: flex-end; }
.act-col {
  flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end;
  align-items: center; position: relative; min-width: 0;
}
.act-stack {
  width: min(var(--bar-ratio), var(--bar-max));
  display: flex; flex-direction: column-reverse;
  border-radius: var(--bar-radius) var(--bar-radius) 0 0; overflow: hidden; min-height: 2px;
  transition: opacity var(--duration) var(--ease);
}
.act-stack i { display: block; min-height: 2px; }
.act-stack i.act-pending, .act-col.future .act-stack i {
  background: var(--unpaid-hatch) !important;
  box-shadow: var(--unpaid-border);
}
.act-stack i.act-pending:last-child, .act-col.future .act-stack i:last-child { border-radius: var(--bar-radius) var(--bar-radius) 0 0; }
.act-col.dim .act-stack { opacity: 0.35; }
.act-col.future.dim .act-stack { opacity: 0.18; }
.act-col.sel .act-stack { opacity: 1; }
.act-label {
  position: absolute; bottom: -22px; font-size: var(--fs-1); color: var(--label-3);
  white-space: nowrap; font-variant-numeric: tabular-nums;
}
.act-col.current .act-label, .act-col.sel .act-label { color: var(--label); font-weight: 600; }
.act-stream { position: absolute; inset: 0 0 auto 0; overflow: visible; }
.act-stream-future { fill: var(--card); opacity: 0.55; pointer-events: none; }
.act-stream-sel { stroke: var(--label); stroke-width: 1; stroke-dasharray: 3 3; opacity: 0.45; }

.legend-chips { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 18px; }
.lc {
  display: inline-flex; align-items: center; gap: 7px; height: var(--ctl-h-sm); padding: 0 11px;
  border-radius: var(--radius-pill); background: var(--fill-2); font-size: var(--fs-1); color: var(--label);
}
.lc b { font-weight: 600; font-variant-numeric: tabular-nums; }
.lc.off { opacity: 0.4; }
.lc-dot { width: 8px; height: 8px; border-radius: 999px; }

.sel-box {
  margin-top: 18px; padding-top: 16px; border-top: var(--hairline) solid var(--line);
  display: grid; grid-template-columns: 200px 1fr; align-items: center; gap: 20px;
}
.sel-box h4 { margin: 0; font-size: var(--fs-2); font-weight: 500; color: var(--label-2); }
.sel-box .big { font-size: var(--fs-4); margin-top: 4px; }
.sel-items { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 4px 18px; }
.sel-item { display: flex; align-items: center; gap: 9px; padding: 5px 0; font-size: var(--fs-2); text-align: left; min-width: 0; }
.sel-item .si-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sel-item b { font-weight: 600; font-variant-numeric: tabular-nums; }

/* ---------------- DueSoon / WalletBrief / Tips ---------------- */
.due-g { font-size: var(--fs-1); font-weight: 500; color: var(--label-3); padding: 12px 0 4px; }
.due-g:first-child { padding-top: 0; }
.due-row { display: flex; align-items: center; gap: 12px; padding: 8px 4px; width: 100%; text-align: left; border-radius: var(--radius-md); }
.due-row:hover { background: var(--fill-2); }
.due-row .nm { flex: 1; min-width: 0; }
.due-row .nm b { display: block; font-size: var(--fs-2); font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.due-row .nm small { font-size: var(--fs-1); color: var(--label-3); }
.due-row .am { text-align: right; }
.due-row .am b { display: block; font-size: var(--fs-2); font-variant-numeric: tabular-nums; }
.due-row .am small { font-size: var(--fs-1); color: var(--label-3); }
.pill {
  font-size: var(--fs-1); font-weight: 600; padding: 3px 9px; border-radius: var(--radius-pill);
  background: var(--fill); color: var(--label-2); white-space: nowrap; font-variant-numeric: tabular-nums;
}
.pill.hot { background: var(--orange-3); color: var(--orange); }
.pill.red { background: var(--red-3); color: var(--red); }

.wal-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: var(--hairline) solid var(--line); }
.wal-row:first-of-type { border-top: 0; padding-top: 0; }
.wal-row .nm { flex: 1; min-width: 0; }
.wal-row .nm b { display: block; font-size: var(--fs-2); font-weight: 500; }
.wal-row .nm small { font-size: var(--fs-1); color: var(--label-3); }
.wal-bar { height: 5px; border-radius: var(--radius-sm); background: var(--fill); margin-top: 6px; overflow: hidden; }
.wal-bar i { display: block; height: 100%; border-radius: var(--radius-sm); background: var(--green-9); }
.wal-bar i.low { background: var(--orange-9); }
.wal-bar i.out { background: var(--red-9); }

.tips { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
@media (max-width: 900px) { .tips { grid-template-columns: 1fr; } }
.tip-card {
  border-radius: var(--radius-lg); padding: 16px 18px;
  box-shadow: 0 0 0 var(--hairline) var(--line); background: var(--card);
  display: flex; flex-direction: column; gap: 6px; text-align: left;
}
.tip-card .k { font-size: var(--fs-1); font-weight: 600; display: flex; align-items: center; gap: 6px; color: var(--label-2); }
.tip-card .k i { width: 7px; height: 7px; border-radius: var(--radius-pill); background: var(--indigo-9); }
.tip-card.warn .k i { background: var(--orange-9); }
.tip-card.bad .k i { background: var(--red-9); }
.tip-card.good .k i { background: var(--green-9); }
.tip-card b { font-size: var(--fs-2); font-weight: 600; line-height: 1.4; }
.tip-card p { margin: 0; font-size: var(--fs-2); color: var(--label-2); line-height: 1.55; }
.tip-card .ins-subs { margin-top: auto; padding-top: 6px; display: flex; align-items: center; gap: 4px; }

/* ---------------- 多维筛选条 (.facets) ---------------- */
.facets {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 6px 10px;
  align-items: baseline;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  margin-bottom: 16px;
  padding: 10px 12px;
  border-radius: var(--radius-lg);
  background: var(--card);
  box-shadow: inset 0 0 0 var(--hairline) var(--line);
}
.facet-row { display: contents; }
.facet-label { flex-shrink: 0; min-width: 34px; font-size: var(--fs-1); color: var(--label-3); white-space: nowrap; }
.facet-opts {
  display: flex; flex-wrap: wrap; gap: 4px; min-width: 0; padding: 1px;
}
.facet {
  --facet-pill: 26px;
  position: relative;
  isolation: isolate;
  display: inline-flex; align-items: center; gap: 5px; flex-shrink: 0;
  height: var(--ctl-h-sm); padding: 0 10px; border-radius: var(--radius-pill);
  color: var(--label-2); font-size: var(--fs-2); font-weight: 500; white-space: nowrap;
}
.facet::before {
  content: ''; position: absolute; inset: calc((var(--ctl-h-sm) - var(--facet-pill)) / 2) 0; z-index: -1;
  border-radius: var(--radius-pill); background: transparent; transition: background var(--duration) var(--ease);
}
.facet:hover { color: var(--label); }
.facet:hover::before { background: var(--fill-2); }
.facet .n { font-size: var(--fs-1); font-weight: 400; color: var(--label-3); font-variant-numeric: tabular-nums; }
.facet.on { color: var(--on-ink); }
.facet.on::before { background: var(--ink); }
.facet.on .n { color: inherit; opacity: 0.7; }

/* ---------------- 订阅卡片 (.sgrid / .scard) ---------------- */
.sgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.scard {
  position: relative; overflow: hidden; isolation: isolate; text-align: left;
  display: flex; flex-direction: column; gap: 4px; padding: 16px 16px 14px;
  border-radius: var(--r); background: var(--card);
  box-shadow: 0 0 0 var(--hairline) var(--line);
}
.scard:hover { box-shadow: 0 0 0 var(--hairline) var(--label-3); }
.sc-glow {
  position: absolute; z-index: -1; inset: 0; opacity: 0.18; pointer-events: none;
  background: linear-gradient(180deg, color-mix(in srgb, var(--glow) 70%, transparent) 0%, color-mix(in srgb, var(--glow) 30%, transparent) 22%, transparent 48%);
}
.sc-top { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 10px; }
.sc-top .ico { box-shadow: none; }
.sc-name { font-size: var(--fs-2); font-weight: 600; display: flex; align-items: center; gap: 6px; }
.sc-meta { display: flex; align-items: center; gap: 6px; font-size: var(--fs-1); color: var(--label-2); margin-top: 2px; }
.sc-price { display: flex; align-items: baseline; gap: 4px; margin-top: 12px; }
.sc-price .amt { font-size: 24px; }
.sc-per { font-size: var(--fs-1); color: var(--label-3); }
.sc-foot {
  margin-top: 10px; padding-top: 10px; border-top: var(--hairline) solid var(--sep);
  display: flex; align-items: center; justify-content: space-between; font-size: var(--fs-1); color: var(--label-3);
}
.sc-foot .soon { color: var(--orange); font-weight: 500; }

/* ---------------- 表格 (.ltable) + Baserow 交互 ---------------- */
.views-bar { display: flex; align-items: center; gap: 4px; margin-bottom: 12px; flex-wrap: wrap; }
.vtab {
  height: var(--ctl-h-sm); padding: 0 11px; border-radius: var(--radius-pill);
  font-size: var(--fs-1); color: var(--label-2); display: inline-flex; align-items: center; gap: 5px;
}
.vtab:hover { background: var(--fill-2); color: var(--label); }
.vtab.on { background: var(--card); color: var(--label); font-weight: 500; box-shadow: var(--shadow); }
.vtab.add { border: 1px dashed var(--line); }

.ltable-wrap {
  border-radius: var(--r);
  background: var(--card);
  box-shadow: inset 0 0 0 var(--hairline) var(--line);
  overflow-x: auto;
}
.lt-hint {
  display: flex; align-items: center; justify-content: space-between; padding: 8px 16px;
  font-size: var(--fs-1); color: var(--label-3); border-bottom: var(--hairline) solid var(--sep);
}
table.bt { width: 100%; border-collapse: collapse; font-size: var(--fs-2); }
table.bt thead tr { height: 36px; background: var(--fill-2); border-bottom: var(--hairline) solid var(--sep); }
table.bt th { font-size: var(--fs-1); font-weight: 400; color: var(--label-3); text-align: left; padding: 0 12px; white-space: nowrap; }
table.bt tbody tr { height: var(--table-row-h); border-top: var(--hairline) solid var(--sep); cursor: pointer; }
table.bt tbody tr:first-child { border-top: 0; }
table.bt tbody tr:hover { background: var(--fill-2); }
table.bt td { padding: 6px 12px; white-space: nowrap; }
td.ed { cursor: text; }
td.ed:hover { box-shadow: inset 0 0 0 1px var(--gray-7); background: var(--bg) !important; }
td.ed .cell-in {
  width: 100%; min-width: 90px; height: 28px; border: 0; background: var(--bg); color: var(--label);
  border-radius: var(--radius-sm); padding: 0 8px; font: inherit; box-shadow: inset 0 0 0 1.5px var(--indigo-9); outline: none;
}
.trunc { max-width: 175px; overflow: hidden; text-overflow: ellipsis; display: inline-block; vertical-align: bottom; }
.rel-chip {
  display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px; border-radius: var(--radius-sm);
  background: var(--fill-2); font-size: var(--fs-1); color: var(--label);
  box-shadow: inset 0 0 0 var(--hairline) var(--line);
}
.rel-chip:hover { background: var(--hover); }
.secret { display: inline-flex; align-items: center; gap: 2px; font-family: var(--mono); font-size: var(--fs-1); }
.secret button { padding: 3px; border-radius: var(--radius-sm); color: var(--label-3); }
.secret button:hover { background: var(--hover); color: var(--label); }
.totp { font-family: var(--mono); font-size: var(--fs-2); font-variant-numeric: tabular-nums; display: inline-flex; align-items: center; gap: 6px; }
.ring { width: 14px; height: 14px; }

/* ---------------- 甘特时间轴 (.gt) ---------------- */
.gt {
  --lw: 200px;
  border-radius: var(--r); background: var(--card);
  box-shadow: inset 0 0 0 var(--hairline) var(--line); overflow: hidden;
}
.gt-head, .gt-row { display: grid; grid-template-columns: var(--lw) minmax(0, 1fr); }
.gt-head { height: 32px; border-bottom: var(--hairline) solid var(--sep); background: color-mix(in srgb, var(--fill-2) 50%, transparent); }
.gt-track { position: relative; margin-right: 16px; }
.gt-tick { position: absolute; top: 8px; transform: translateX(-50%); font-size: var(--fs-1); color: var(--label-3); white-space: nowrap; font-variant-numeric: tabular-nums; }
.gt-tick.major { color: var(--label); font-weight: 600; }
.gt-body { position: relative; padding: 4px 0 8px; }
.gt-row { height: 38px; align-items: center; cursor: pointer; }
.gt-row:hover { background: var(--fill-2); }
.gt-name { display: flex; align-items: center; gap: 8px; padding: 0 12px; min-width: 0; font-size: var(--fs-2); }
.gt-name span:first-of-type { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gt-seg {
  position: absolute; top: 9px; height: 20px; border-radius: var(--radius-pill);
  font-size: 11px; font-weight: 600; color: #fff; padding: 0 8px; line-height: 20px;
  white-space: nowrap; overflow: hidden;
}
.gt-seg.fut { background: var(--unpaid-hatch) !important; box-shadow: var(--unpaid-border); color: var(--label-3); }
.gt-today { position: absolute; top: 5px; bottom: 5px; width: 1.5px; background: var(--red-9); z-index: 3; }

/* ---------------- 钱包卡面 (.paycard & .paycard.sim) ---------------- */
.wallet-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 1080px) { .wallet-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 820px) { .wallet-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .wallet-grid { grid-template-columns: 1fr; } }
.wallet-grid > * { container-type: inline-size; }
.paycard {
  position: relative; border-radius: 16px;
  padding: clamp(12px, 5%, 16px) clamp(14px, 5.8%, 18px);
  aspect-ratio: 1.586; color: #fff; overflow: hidden;
  display: flex; flex-direction: column; justify-content: space-between;
  box-shadow: 0 10px 26px rgba(20, 30, 50, 0.16);
  cursor: pointer; isolation: isolate; text-align: left; width: 100%;
  background: var(--card-bg, linear-gradient(135deg, #3b4a57, #1d2328));
  transform: perspective(900px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)) translateY(0) scale(1);
  transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.45s cubic-bezier(0.22, 1, 0.36, 1);
  user-select: none;
}
.paycard:hover {
  transform: perspective(900px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)) translateY(-5px) scale(1.015);
  box-shadow: 0 24px 48px -12px rgba(20, 30, 50, 0.35);
  transition-duration: 0.2s;
}
.paycard::before {
  content: ''; position: absolute; inset: 0; z-index: -1;
  background: radial-gradient(400px 200px at 110% -20%, rgba(255, 255, 255, 0.3), transparent 60%);
}
.paycard::after {
  content: ''; position: absolute; inset: 0; z-index: -1; opacity: 0; transition: opacity 0.3s;
  background: radial-gradient(240px circle at var(--mx, 50%) var(--my, 50%), rgba(255, 255, 255, 0.28), transparent 60%);
}
.paycard:hover::after { opacity: 1; }
.pc-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.pc-id { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1; }
.pc-id > div { min-width: 0; flex: 1; }
.pc-name { font-size: 14.5px; font-weight: 700; letter-spacing: -0.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pc-kind { font-size: 11px; font-weight: 500; opacity: 0.85; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pc-top > :last-child { flex-shrink: 0; }
.pc-chip { display: block; width: clamp(28px, 12cqw, 36px); aspect-ratio: 4/3; filter: drop-shadow(0 1px 1.5px rgba(0,0,0,.22)); }
.pc-bal { font-size: clamp(18px, 8cqw, 24px); }
.pc-foot { display: flex; justify-content: space-between; align-items: flex-end; gap: 8px; font-size: 11px; }
.pc-foot .o { opacity: 0.82; font-size: 10.5px; }
.pc-meta { text-align: right; white-space: nowrap; }
.net-mark { height: 20px; width: auto; filter: drop-shadow(0 1px 2px rgba(0,0,0,.2)); }
.pc-mark {
  position: absolute; z-index: -1; right: -12%; bottom: -32%; width: 68%; aspect-ratio: 1; object-fit: contain;
  transform: rotate(-16deg); opacity: 0.16; pointer-events: none;
}

/* SIM 卡面（三切卡托 + 香槟金芯片） */
.paycard.sim {
  color: #1b2430;
  background: linear-gradient(155deg, #ffffff 0%, #f4f6f9 60%, #e9edf2 100%);
  box-shadow: 0 10px 30px rgba(20, 30, 50, 0.1), inset 0 0 0 1px rgba(0, 0, 0, 0.06);
}
.sim-punch { position: absolute; z-index: -1; right: 9%; top: 50%; width: 33%; aspect-ratio: 25/15; transform: translateY(-56%); }
.sim-cutouts { display: block; width: 100%; height: 100%; overflow: visible; }
.sim-slot { fill: none; stroke: rgba(65, 76, 88, 0.3); stroke-width: 1.2; vector-effect: non-scaling-stroke; }
.sim-slot.score { stroke: rgba(65, 76, 88, 0.2); stroke-width: 0.9; }
.sim-punch .pc-chip { position: absolute; left: 36%; top: 50%; width: 41%; transform: translate(-50%, -50%); }
.sim-carrier { font-size: 15.5px; font-weight: 800; letter-spacing: -0.015em; color: #0d2f80; }
.sim-name { font-size: 13.5px; font-weight: 700; line-height: 1.3; max-width: 56%; }
.sim-name small { display: flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 500; color: #5b6676; margin-top: 3px; white-space: nowrap; }
.paycard.sim .pc-foot .o { color: #5b6676; opacity: 1; }
.paycard.sim .pc-bal .amt { color: #0d2f80; font-size: clamp(16px, 6.8cqw, 21px); }

/* ---------------- 日历 (.cal-wrap) ---------------- */
.cal-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 20px; align-items: start; }
@media (max-width: 1100px) { .cal-wrap { grid-template-columns: 1fr; } }
.cal { padding: 10px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.cal-dow { font-size: var(--fs-1); font-weight: 600; color: var(--label-2); text-align: center; padding: 6px 0 4px; }
.cal-cell {
  min-height: 92px; padding: 6px; border-radius: var(--radius-md); text-align: left;
  display: flex; flex-direction: column; gap: 6px; position: relative;
  transition: background var(--duration) var(--ease);
}
.cal-cell:hover { background: var(--fill-2); }
.cal-cell::before, .cal-cell::after { content: ''; position: absolute; pointer-events: none; }
.cal-cell::before { left: -2px; right: -2px; top: -2.5px; border-top: var(--hairline) dashed color-mix(in srgb, var(--label) 11%, transparent); }
.cal-cell::after { top: -2px; bottom: -2px; left: -2.5px; border-left: var(--hairline) dashed color-mix(in srgb, var(--label) 11%, transparent); }
.cal-cell:nth-child(7n + 8)::after { display: none; }
.cal-cell.sel, .cal-cell.sel:hover { background: var(--indigo-3); }
.cal-cell.sel::before, .cal-cell.sel::after { display: none; }
.cal-cell.out > * { opacity: 0.3; }
.cal-day { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; }
.cal-day b { font-size: var(--fs-2); font-weight: 600; width: 26px; height: 26px; display: grid; place-items: center; border-radius: var(--radius-pill); font-variant-numeric: tabular-nums; }
.cal-cell.today .cal-day b { background: var(--red-9); color: #fff; }
.cal-day .sum { padding-left: 4px; font-size: var(--fs-1); font-weight: 600; color: var(--label-2); font-variant-numeric: tabular-nums; }
.cal-icons { display: flex; flex-wrap: nowrap; align-items: center; margin-top: auto; }
.cal-icons > span + span { margin-left: -8px; }
.cal-icons .ico { box-shadow: 0 0 0 1.5px var(--card); }

/* ---------------- 身份详情 / 通用子区块 ---------------- */
.idcard { display: block; padding: 18px 20px; transition: background var(--duration) var(--ease); }
.idcard:hover { background: var(--card-2); }
.idmini { display: grid; grid-template-columns: repeat(3, 1fr); margin-top: 14px; text-align: center; border-top: var(--hairline) solid var(--sep); padding-top: 12px; }
.idmini b { display: block; font-size: var(--fs-3); font-weight: 600; }
.idmini span { font-size: var(--fs-1); color: var(--label-3); }
.egress { margin-top: 12px; background: var(--bg); box-shadow: var(--shadow); border-radius: var(--radius-md); padding: 8px 10px; font-size: var(--fs-1); display: flex; align-items: center; gap: 8px; }
.item { background: var(--bg); box-shadow: var(--shadow); border-radius: var(--radius-md); padding: 14px 16px; cursor: pointer; }
.item:hover { background: var(--fill-2); }
.item + .item { margin-top: 8px; }
.item .kvs { display: grid; grid-template-columns: 1fr 1fr; gap: 5px 20px; margin-top: 10px; }
.kv { display: flex; gap: 10px; font-size: var(--fs-2); align-items: center; min-width: 0; }
.kv .k { width: 76px; flex-shrink: 0; color: var(--label-3); font-size: var(--fs-1); }
.kv .v { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.netbox { background: var(--fill-2); border-radius: var(--radius-md); padding: 10px 12px; margin-top: 10px; }
.netgrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.netgrid span { display: block; font-size: var(--fs-1); color: var(--label-3); }
.netgrid b { font-weight: 500; font-family: var(--mono); font-size: var(--fs-1); }
.subrow { display: flex; align-items: center; justify-content: space-between; background: var(--fill-2); border-radius: var(--radius-sm); padding: 7px 10px; font-size: var(--fs-1); margin-top: 6px; }
.bar { height: 5px; border-radius: var(--radius-pill); background: var(--fill); overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: var(--radius-pill); background: var(--ink); }
.hr { height: var(--hairline); background: var(--sep); margin: 14px 0; }
.ev-list .e { display: flex; gap: 10px; align-items: center; font-size: var(--fs-2); padding: 8px 0; border-bottom: var(--hairline) dashed var(--sep); }
.ev-list .e:last-child { border: 0; }

/* ---------------- 760px Sheet Modal & Quick-Peek ---------------- */
.modal-bg { position: fixed; inset: 0; background: var(--black-a5); display: none; align-items: center; justify-content: center; z-index: 50; padding: 16px; }
.modal-bg.show { display: flex; animation: fade .15s; }
.modal {
  background: var(--bg); border-radius: var(--radius-lg); width: min(760px, 100%); max-height: 88vh; overflow-y: auto;
  box-shadow: var(--shadow-lg);
}
.modal .mh { position: sticky; top: 0; background: var(--bg); display: flex; align-items: center; justify-content: space-between; padding: 14px 20px; z-index: 2; }
.modal .mh h2 { margin: 0; font-size: var(--fs-3); font-weight: 600; letter-spacing: -0.015em; }
.modal .mb { padding: 4px 20px 20px; }
.peek {
  position: fixed; right: 24px; bottom: 52px; width: 340px; background: var(--bg);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); padding: 16px; z-index: 45; display: none;
}
.peek.show { display: block; animation: fade .15s; }
.steps { display: flex; gap: 6px; margin-bottom: 16px; }
.steps div { flex: 1; height: 4px; border-radius: 9px; background: var(--fill); }
.steps div.on { background: var(--ink); }
@keyframes fade { from{opacity:0} to{opacity:1} }

.proto { position: fixed; right: 14px; bottom: 14px; background: var(--ink); color: var(--on-ink); font-size: var(--fs-1); padding: 4px 12px; border-radius: var(--radius-pill); z-index: 40; opacity: 0.85; }
.chk { flex: 1; width: 100%; min-height: 100dvh; display: flex; align-items: center; justify-content: center; background: var(--sidebar); padding: 24px; }
.chk .card { width: min(560px, 100%); padding: 28px; background: var(--bg); }
.chk .li { display: flex; align-items: center; gap: 10px; padding: 11px 0; border-bottom: var(--hairline) solid var(--sep); font-size: var(--fs-2); }
.chk .li:last-child { border: 0; }

/* ---------------- 二级可折叠侧栏与快捷入口 ---------------- */
.sb-quick {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px;
  padding: 2px 0 8px;
}
.sb-qbtn {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  padding: 7px 4px; border-radius: var(--radius-md); background: var(--card);
  box-shadow: inset 0 0 0 var(--hairline) var(--line);
  font-size: 11px; font-weight: 500; color: var(--label-2);
  transition: background var(--duration) var(--ease), color var(--duration) var(--ease);
}
.sb-qbtn:hover { background: var(--bg); color: var(--label); }
.sb-qbtn.pri { background: var(--ink); color: var(--on-ink); box-shadow: none; }
.sb-qbtn.pri:hover { opacity: 0.92; }

.sb-group { margin-top: 4px; }
.sb-gh {
  display: flex; align-items: center; gap: 6px; width: 100%;
  padding: 6px 10px 4px; border-radius: var(--radius-sm);
  font-size: 11.5px; font-weight: 600; letter-spacing: 0.02em; color: var(--label-3);
}
.sb-gh:hover { color: var(--label); background: var(--fill-2); }
.sb-gh .i { transition: transform .18s var(--ease); }
.sb-group.closed .sb-gh .i:first-child { transform: rotate(-90deg); }
.sb-group.closed .sb-sub { display: none; }
.sb-sub { display: flex; flex-direction: column; gap: 1px; }
.sb-sub .side-item { padding-left: 16px; min-height: 31px; font-size: 13.5px; }

/* ---------------- 身份大头像 + 3D 等距小图标 + 标签分类 ---------------- */
.idcard { display: block; padding: 18px 20px; transition: background var(--duration) var(--ease); position: relative; }
.id-hero { display: flex; align-items: center; gap: 14px; }
.id-av-wrap { position: relative; display: inline-block; flex-shrink: 0; width: 58px; height: 58px; vertical-align: middle; }
.id-av-ring {
  width: 100%; height: 100%; border-radius: 50%; overflow: hidden;
  display: grid; place-items: center; background: var(--fill-2);
  box-shadow: 0 0 0 calc(var(--av-size, 58px) * .043) var(--card),
    0 0 0 calc(var(--av-size, 58px) * .078) var(--ring-c, var(--green-9));
}
.id-av-ring svg { width: 100%; height: 100%; display: block; }
.id-av-flag {
  position: absolute; right: -2px; bottom: -2px;
  width: calc(var(--av-size, 58px) * .38); height: calc(var(--av-size, 58px) * .38);
  border-radius: 50%; overflow: hidden; border: max(1px, calc(var(--av-size, 58px) * .034)) solid var(--card); background: var(--bg);
  display: grid; place-items: center;
}
.id-av-flag:empty { display: none; }
.id-av-flag img { width: 100%; height: 100%; object-fit: cover; }

.tag-row { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 10px; }
.tag-pill {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px; border-radius: var(--radius-pill);
  font-size: 11px; font-weight: 500;
  background: color-mix(in srgb, var(--tc, var(--indigo-9)) 12%, transparent);
  color: var(--tc, var(--indigo-11));
}
.tag-pill i { width: 6px; height: 6px; border-radius: 50%; background: var(--tc, var(--indigo-9)); }

.id-3d-row {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px;
  margin-top: 14px; padding-top: 12px; border-top: var(--hairline) solid var(--sep);
}
.id-3d-tile {
  display: flex; align-items: center; gap: 8px; padding: 7px 9px;
  border-radius: var(--radius-md); background: var(--bg);
  box-shadow: var(--shadow); transition: transform .18s var(--ease), background .18s var(--ease);
}
.idcard:hover .id-3d-tile:hover { transform: translateY(-2px); background: var(--fill-2); }
.id-3d-ico { width: 30px; height: 30px; flex-shrink: 0; display: grid; place-items: center; }
.id-3d-tile b { display: block; font-size: 14px; font-weight: 700; line-height: 1.1; font-variant-numeric: tabular-nums; }
.id-3d-tile span { display: block; font-size: 11px; color: var(--label-3); }

/* ---------------- 紧凑 SIM 卡网格（一行 5–6 张） ---------------- */
.sim-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(172px, 1fr));
  gap: 12px;
}
.sim-mini {
  position: relative; border-radius: 14px; padding: 11px 12px 10px;
  background: linear-gradient(155deg, var(--bg) 0%, var(--card) 75%, var(--fill-2) 100%);
  box-shadow: 0 4px 14px rgba(15, 23, 42, .06), inset 0 0 0 var(--hairline) var(--line);
  clip-path: polygon(0 0, calc(100% - 14px) 0, 100% 14px, 100% 100%, 0 100%);
  display: flex; flex-direction: column; gap: 6px; cursor: pointer;
  transition: transform .18s var(--ease), box-shadow .18s var(--ease);
}
.sim-mini:hover { transform: translateY(-3px); box-shadow: 0 10px 24px rgba(15, 23, 42, .12), inset 0 0 0 var(--hairline) var(--ink); }
.sim-mini-top { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.sim-mini-chip { width: 22px; height: 17px; flex-shrink: 0; }
.sim-mini-car { font-size: 13px; font-weight: 700; letter-spacing: -0.01em; color: var(--label); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sim-mini-num { font-family: var(--mono); font-size: 11.5px; color: var(--label-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sim-mini-foot { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-top: 2px; font-size: 11px; }

/* ---------------- 设备 VPS 部署项目 & 链式代理拓扑条 ---------------- */
.vps-proj { margin-top: 10px; padding-top: 10px; border-top: var(--hairline) dashed var(--sep); display: flex; flex-direction: column; gap: 5px; }
.vps-proj-row { display: grid; grid-template-columns: minmax(0, 1fr) 56px 56px; align-items: center; gap: 8px; font-size: 11.5px; }
.vps-proj-name { display: flex; align-items: center; gap: 6px; min-width: 0; }
.vps-proj-name b { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chain-strip {
  display: flex; align-items: center; flex-wrap: wrap; gap: 6px;
  margin-top: 10px; padding: 8px 10px; border-radius: var(--radius-md); background: var(--fill-2);
  font-size: 11.5px;
}
.chain-hop { display: inline-flex; align-items: center; gap: 4px; padding: 2px 7px; border-radius: var(--radius-sm); background: var(--bg); box-shadow: inset 0 0 0 var(--hairline) var(--line); font-weight: 500; }
.chain-hop.egress { background: var(--indigo-3); color: var(--indigo-11); box-shadow: inset 0 0 0 var(--hairline) var(--indigo-7); font-family: var(--mono); }

/* ---------------- 三段式参考图风格全景拓扑 (.topo-canvas) ---------------- */
.topo-canvas {
  position: relative; border-radius: 18px; padding: 36px 32px 26px; overflow: hidden;
  background: radial-gradient(75% 90% at 50% 45%, #192136 0%, #0e1118 65%, #090b10 100%);
  color: #f3f4f6;
  box-shadow: 0 24px 60px rgba(0, 0, 0, .32), inset 0 0 0 1px rgba(255, 255, 255, .07);
}
.topo-canvas.light-surf {
  background: radial-gradient(75% 90% at 50% 45%, #f4f7fc 0%, #e9eef7 100%);
  color: #111827; box-shadow: var(--shadow), inset 0 0 0 1px var(--line);
}
.topo-grid {
  display: grid; grid-template-columns: 200px minmax(80px, 1fr) 230px minmax(80px, 1fr) 250px;
  align-items: center; gap: 8px;
}
@media (max-width: 1080px) { .topo-grid { grid-template-columns: 1fr; gap: 20px; } .topo-wire { display: none; } }
.topo-col { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px; }
.topo-squircle {
  width: 72px; height: 72px; border-radius: 20px;
  background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .12);
  display: grid; place-items: center; cursor: pointer;
  box-shadow: 0 12px 28px rgba(0, 0, 0, .35);
  transition: transform .2s var(--ease), border-color .2s;
}
.topo-squircle:hover { transform: translateY(-2px); border-color: rgba(110, 168, 255, .6); }
.topo-canvas.light-surf .topo-squircle { background: #fff; border-color: rgba(15, 23, 42, .12); box-shadow: 0 10px 24px rgba(15, 23, 42, .08); }
.topo-subtxt { font-size: 12px; opacity: .58; }

.topo-wire { display: flex; flex-direction: column; align-items: center; gap: 8px; width: 100%; position: relative; }
.topo-wire-lbl { font-size: 12px; opacity: .68; white-space: nowrap; }
.topo-wire-lbl.blue { color: #7ca7ff; opacity: .95; }
.topo-dots {
  position: relative; width: 100%; height: 3px; overflow: hidden;
  background-image: radial-gradient(circle, rgba(255, 255, 255, .42) 1.5px, transparent 1.6px);
  background-size: 14px 3px; background-repeat: repeat-x;
  animation: stream-dots 1.1s linear infinite;
}
.topo-dots::after {
  content: ''; position: absolute; top: -2px; left: -12%; width: 22px; height: 7px; border-radius: 99px;
  background: radial-gradient(circle, #ffffff 0%, rgba(255,255,255,0) 75%);
  animation: pulse-orb 2.4s cubic-bezier(.4,0,.2,1) infinite;
}
.topo-canvas.light-surf .topo-dots { background-image: radial-gradient(circle, rgba(15, 23, 42, .35) 1.5px, transparent 1.6px); }
.topo-dash-blue {
  position: relative; width: 100%; height: 4px; overflow: hidden; border-radius: 99px;
  background: repeating-linear-gradient(90deg, #5d8bff 0 12px, transparent 12px 22px);
  background-size: 22px 4px;
  filter: drop-shadow(0 0 9px rgba(93, 139, 255, .75));
  animation: beam-flow .9s linear infinite;
}
.topo-dash-blue::after {
  content: ''; position: absolute; top: -2px; left: -15%; width: 32px; height: 8px; border-radius: 99px;
  background: linear-gradient(90deg, transparent, #93c5fd, #ffffff, transparent);
  animation: pulse-orb 1.8s cubic-bezier(.4,0,.2,1) infinite;
}
@keyframes stream-dots { from { background-position: 0 0; } to { background-position: 14px 0; } }
@keyframes beam-flow { from { background-position: 0 0; } to { background-position: 22px 0; } }
@keyframes pulse-orb { 0% { left: -18%; opacity: 0; } 20% { opacity: 1; } 80% { opacity: 1; } 100% { left: 105%; opacity: 0; } }
@keyframes host-breathe {
  0%, 100% { filter: drop-shadow(0 18px 34px rgba(59, 130, 246, .28)); transform: translateY(0); }
  50% { filter: drop-shadow(0 24px 44px rgba(96, 165, 250, .48)); transform: translateY(-3px); }
}
.topo-host-svg { width: 128px; height: 102px; cursor: pointer; animation: host-breathe 3.6s ease-in-out infinite; transition: transform .22s var(--ease); }
.topo-host-svg:hover { transform: translateY(-4px) scale(1.04); animation-play-state: paused; }
.topo-pill-dot { width: 6px; height: 6px; border-radius: 50%; background: #22c55e; box-shadow: 0 0 8px #22c55e; flex-shrink: 0; }
.topo-pill.risk .topo-pill-dot { background: #ef4444; box-shadow: 0 0 8px #ef4444; }
.topo-host-ip {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px;
  background: rgba(93, 139, 255, .14); border: 1px solid rgba(93, 139, 255, .36);
  font-family: var(--mono); font-size: 11.5px; color: #93b7ff;
}
.topo-canvas.light-surf .topo-host-ip { background: var(--indigo-3); color: var(--indigo-11); border-color: var(--indigo-7); }

.topo-targets { display: flex; flex-direction: column; gap: 8px; width: 100%; }
.topo-pill {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 14px;
  border-radius: 12px; background: rgba(255, 255, 255, .05); border: 1px solid rgba(255, 255, 255, .11);
  color: inherit; font-size: 13.5px; font-weight: 500; text-align: left; cursor: pointer;
  transition: background .16s, border-color .16s, transform .16s;
}
.topo-pill:hover { background: rgba(255, 255, 255, .11); border-color: rgba(255, 255, 255, .28); transform: translateX(2px); }
.topo-pill img { background: rgba(255, 255, 255, .92); padding: 3px; width: 24px; height: 24px; border-radius: 6px; object-fit: contain; }
.topo-pill.risk { border-color: rgba(239, 68, 68, .7); background: rgba(239, 68, 68, .12); }
.topo-canvas.light-surf .topo-pill { background: #fff; border-color: rgba(15, 23, 42, .12); }
.topo-canvas.light-surf .topo-pill:hover { background: var(--fill-2); }
.topo-foot { margin-top: 26px; padding-top: 14px; border-top: 1px solid rgba(255, 255, 255, .07); font-size: 12px; opacity: .55; display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.topo-canvas.light-surf .topo-foot { border-color: var(--sep); }

/* ---------------- Calends 扩展组件（日热力图 / Karing JSON / 报表） ---------------- */
.heat-wrap { overflow-x: auto; padding: 6px 0; }
.heat-grid { display: grid; grid-template-columns: repeat(53, 11px); grid-template-rows: repeat(7, 11px); grid-auto-flow: column; gap: 3px; }
.heat-cell { width: 11px; height: 11px; border-radius: 2.5px; background: var(--fill-2); }
.heat-cell.l1 { background: var(--green-4); }
.heat-cell.l2 { background: var(--green-6); }
.heat-cell.l3 { background: var(--green-8); }
.heat-cell.l4 { background: var(--green-10); }
.code-pre {
  background: var(--fill-2); border-radius: var(--radius-md); padding: 12px 14px;
  font-family: var(--mono); font-size: 12px; line-height: 1.55; overflow-x: auto;
  box-shadow: inset 0 0 0 var(--hairline) var(--line); white-space: pre;
}
.globe-list { display: flex; flex-direction: column; gap: 10px; }
.globe-row { display: grid; grid-template-columns: 110px 1fr 72px; align-items: center; gap: 10px; font-size: 12.5px; }

/* ---------------- 真实机器拟物设备卡 (.hw-card，参考截图风格) ---------------- */
.hw-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(430px, 1fr)); gap: 18px; }
@media (max-width: 900px) { .hw-grid { grid-template-columns: 1fr; } }
.hw-card {
  background: var(--card); border-radius: var(--r); padding: 20px 22px 18px;
  box-shadow: inset 0 0 0 var(--hairline) var(--line);
  transition: background var(--duration) var(--ease); cursor: pointer;
}
.hw-card:hover { background: var(--card-2); }
.hw-stage {
  position: relative; display: grid; grid-template-columns: 1fr 205px; align-items: center;
  min-height: 208px; gap: 8px; padding: 4px 0 8px;
}
.hw-render { display: flex; align-items: center; justify-content: center; height: 186px; }
.hw-render svg { max-width: 100%; max-height: 182px; filter: drop-shadow(0 18px 26px rgba(15, 23, 42, 0.14)); transition: transform .25s var(--ease); }
.hw-card:hover .hw-render svg { transform: translateY(-3px) scale(1.02); }
.hw-float {
  background: var(--bg); border-radius: 16px; padding: 13px 14px;
  box-shadow: 0 12px 32px rgba(15, 23, 42, .08), inset 0 0 0 var(--hairline) var(--line);
  display: flex; flex-direction: column; gap: 9px; z-index: 2;
}
.dark .hw-float { box-shadow: 0 14px 34px rgba(0, 0, 0, .42), inset 0 0 0 var(--hairline) var(--line); }
.hw-stat-head { display: flex; justify-content: space-between; font-size: 12px; color: var(--label-2); margin-bottom: 4px; }
.hw-stat-head b { color: var(--label); font-weight: 600; font-variant-numeric: tabular-nums; }
.hw-stat-sub { font-size: 10.5px; color: var(--label-3); margin-top: 3px; font-variant-numeric: tabular-nums; }
.hw-bar { height: 4px; border-radius: 99px; background: var(--fill); overflow: hidden; }
.hw-bar i { display: block; height: 100%; border-radius: 99px; background: var(--ink); }
.hw-bar i.hot { background: #c2410c; }
.hw-apps { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; padding-top: 4px; }
.hw-app {
  width: 28px; height: 28px; border-radius: 8px; background: var(--fill-2);
  box-shadow: inset 0 0 0 var(--hairline) var(--line);
  display: grid; place-items: center; overflow: hidden; font-size: 11px; font-weight: 700;
}
.hw-app img { width: 18px; height: 18px; object-fit: contain; }
.hw-title-row { display: flex; align-items: center; gap: 8px; margin-top: 10px; }
.hw-title-row h3 { margin: 0; font-size: 15.5px; font-weight: 700; letter-spacing: -0.015em; }
.hw-warn { margin-top: 8px; font-size: 12px; color: #b45309; display: flex; align-items: flex-start; gap: 6px; line-height: 1.45; }
.dark .hw-warn { color: #fbbf24; }

/* ---------------- Calends 原版 PayCard 商店卡 + 余额续航 (.runway) ---------------- */
.paycard.apple {
  color: #1d1d1f;
  background: linear-gradient(155deg, #ffffff 0%, #f5f5f7 60%, #e8e8ed 100%);
  box-shadow: 0 10px 30px rgba(20, 30, 50, .1), inset 0 0 0 1px rgba(0,0,0,.06);
}
.paycard.apple .o { color: #6e6e73; opacity: 1; }
.paycard.apple .pc-apple-ico {
  width: 24px; height: 24px; object-fit: contain; flex-shrink: 0;
  filter: brightness(0) opacity(0.38);
}
.paycard.light {
  color: #1b2430;
  background: linear-gradient(155deg, #ffffff 0%, #f3f7fc 65%, #e6eef8 100%);
  box-shadow: 0 10px 30px rgba(20, 30, 50, .1), inset 0 0 0 1px rgba(0,0,0,.06);
}
.paycard.light .o { color: #5b6676; opacity: 1; }
.runway-group { background: var(--card); border-radius: var(--r); box-shadow: inset 0 0 0 var(--hairline) var(--line); overflow: hidden; }
.runway-cell { padding: 14px 18px; border-top: var(--hairline) solid var(--sep); }
.runway-cell:first-child { border-top: 0; }
.runway { display: flex; flex-direction: column; gap: 11px; }
.rw-top { display: flex; align-items: center; gap: 12px; }
.rw-bal { font-size: var(--fs-3); font-weight: 600; font-variant-numeric: tabular-nums; }
.rw-track { height: 8px; border-radius: var(--radius-sm); background: var(--fill-2); overflow: hidden; }
.rw-track span { display: block; height: 100%; border-radius: var(--radius-sm); background: var(--green-9); transition: width var(--duration) var(--ease); }
.rw-track.low span { background: var(--orange-9); }
.rw-track.out span { background: var(--red-9); }
.rw-scale { display: flex; justify-content: space-between; font-size: var(--fs-1); color: var(--label-3); }
.rw-note { font-size: var(--fs-2); color: var(--label-2); line-height: 1.55; }
.rw-note b { color: var(--label); font-weight: 600; }

/* ---------------- AI 助手 (.as，1:1 复刻 Calends Assistant 图2) ---------------- */
.as { --as-w: 760px; position: relative; display: flex; flex-direction: column; flex: 1; min-height: 0; }
.as-scroll { flex: 1; padding: 24px 28px 8px; display: flex; flex-direction: column; }
.as-col { max-width: var(--as-w); width: 100%; margin: 0 auto; display: flex; flex-direction: column; gap: 18px; flex: 1; }
.as-welcome { display: flex; flex-direction: column; align-items: center; text-align: center; margin: auto 0; padding: 4vh 0; }
.as-orb { width: 56px; height: 56px; border-radius: var(--radius-lg); padding: 10px; background: var(--card); box-shadow: inset 0 0 0 var(--hairline) var(--line); }
.as-welcome h2 { margin: 14px 0 4px; font-size: var(--fs-2); font-weight: 600; color: var(--label-2); }
.as-welcome p { margin: 0; max-width: 420px; color: var(--label-3); font-size: var(--fs-1); line-height: 1.6; }
.as-user { display: flex; flex-direction: column; align-items: flex-end; }
.as-bubble { max-width: min(80%, 560px); padding: 11px 16px; border-radius: var(--radius-lg); background: var(--fill); font-size: var(--fs-2); line-height: 1.55; }
.as-reply { font-size: var(--fs-2); line-height: 1.68; color: var(--label); background: var(--card); border-radius: var(--radius-lg); padding: 14px 18px; box-shadow: inset 0 0 0 var(--hairline) var(--line); }
.as-composer { position: sticky; bottom: 0; z-index: 4; padding: 10px 28px 14px; background: linear-gradient(180deg, transparent, var(--bg) 22%); }
.as-suggest { display: flex; gap: 8px; max-width: var(--as-w); margin: 0 auto 10px; overflow-x: auto; }
.as-suggest button {
  flex-shrink: 0; height: var(--ctl-h-md); padding: 0 14px; border-radius: var(--radius-pill);
  background: var(--card); box-shadow: inset 0 0 0 var(--hairline) var(--line); color: var(--label);
  font-size: var(--fs-2); white-space: nowrap; transition: background var(--duration) var(--ease);
}
.as-suggest button:hover { background: var(--fill-2); }
.as-input { max-width: var(--as-w); margin: 0 auto; border-radius: var(--r); background: var(--card); box-shadow: inset 0 0 0 var(--hairline) var(--line); }
.as-input:focus-within { outline: 1.5px solid var(--focus-ring); outline-offset: 2px; }
.as-input textarea { display: block; width: 100%; min-height: 52px; padding: 15px 18px 6px; border: 0; outline: 0; resize: none; background: none; color: var(--label); font: inherit; font-size: var(--fs-2); line-height: 1.5; }
.as-input textarea::placeholder { color: var(--label-3); }
.as-input-bar { display: flex; align-items: center; gap: 6px; padding: 4px 10px 10px; }
.as-model { height: var(--ctl-h-sm); padding: 0 10px; border-radius: var(--radius-pill); background: var(--fill-2); color: var(--label-2); font-size: var(--fs-1); display: inline-flex; align-items: center; }
.as-send { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--gray-6); color: #fff; margin-left: auto; transition: background var(--duration); }
.as-send.ready { background: var(--ink); color: var(--on-ink); }
.as-foot { max-width: var(--as-w); margin: 8px auto 0; color: var(--label-3); font-size: var(--fs-1); text-align: center; }

/* ---------------- Calends Detail Sheet (.dt-*，复刻图 1-7 弹窗详页) ---------------- */
.dt-sheet { background: var(--gray-2); border-radius: 20px; }
.dark .dt-sheet { background: var(--gray-1); }
.dt-head {
  position: sticky; top: 0; z-index: 4; display: flex; align-items: center; gap: 12px;
  padding: 16px 20px; background: color-mix(in srgb, var(--bg) 94%, transparent); backdrop-filter: blur(8px);
  border-bottom: var(--hairline) solid var(--sep); border-radius: 20px 20px 0 0;
}
.dt-head-info { flex: 1; min-width: 0; }
.dt-head-info h2 { margin: 0; font-size: 16px; font-weight: 700; letter-spacing: -0.015em; display: flex; align-items: center; gap: 8px; }
.dt-head-sub { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 3px; font-size: 12px; color: var(--label-2); }
.dt-acts { display: flex; align-items: center; gap: 6px; }
.dt-body { padding: 16px 20px 22px; display: flex; flex-direction: column; gap: 12px; }
.dt-panel {
  background: var(--bg); border-radius: var(--radius-lg); padding: 16px 18px;
  box-shadow: 0 0 0 var(--hairline) var(--line);
}
.dt-panel-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.dt-panel-h h3 { margin: 0; font-size: 14px; font-weight: 600; }
.dt-phase-bar {
  display: flex; align-items: center; gap: 8px; margin-top: 10px; padding: 5px 10px;
  border-radius: 8px; background: var(--indigo-3); color: var(--indigo-11); font-size: 11.5px; font-weight: 500;
}
.dt-bars { display: flex; align-items: flex-end; gap: 8px; height: 148px; padding: 14px 4px 0; position: relative; border-bottom: var(--hairline) solid var(--sep); }
.dt-bcol { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; position: relative; }
.dt-bar { width: min(72%, 22px); border-radius: 5px 5px 0 0; background: var(--ink); min-height: 6px; }
.dt-bar.fut { background: var(--unpaid-hatch); box-shadow: var(--unpaid-border); }
.dt-bref { position: absolute; left: 0; right: 0; border-top: 1px dashed var(--label-3); opacity: 0.45; pointer-events: none; }
.dt-bnow { position: absolute; top: 0; bottom: 0; border-left: 1px dashed var(--label-3); opacity: 0.65; pointer-events: none; }
.dt-bnow span { position: absolute; top: -12px; transform: translateX(-50%); font-size: 10px; color: var(--label-3); white-space: nowrap; }
.dt-baxis { display: flex; justify-content: space-between; padding-top: 6px; font-size: 11px; color: var(--label-3); font-variant-numeric: tabular-nums; }
.dt-row {
  display: flex; align-items: center; gap: 10px; padding: 10px 0;
  border-top: var(--hairline) solid var(--sep); font-size: 13px; cursor: pointer;
}
.dt-row:first-of-type { border-top: 0; padding-top: 2px; }
.dt-row:last-of-type { padding-bottom: 2px; }
.dt-row:hover { color: var(--accent); }
.dt-file-card { display: flex; align-items: center; gap: 12px; padding: 8px 10px; border-radius: 10px; background: var(--fill-2); }
.dt-file-thumb { width: 48px; height: 34px; border-radius: 6px; background: var(--bg); box-shadow: inset 0 0 0 var(--hairline) var(--line); display: grid; place-items: center; font-size: 10px; font-weight: 700; color: var(--red-9); }

/* ---------------- 日历右栏 (.cal-side) & 选定日条目 ---------------- */
.cal-side { display: flex; flex-direction: column; gap: 16px; }
.cal-mini-bars { display: flex; align-items: flex-end; gap: 8px; height: 54px; margin-top: 14px; }
.cal-mcol { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; height: 100%; justify-content: flex-end; }
.cal-mcol i { display: block; width: 14px; border-radius: 4px 4px 0 0; background: var(--ink); }
.cal-mcol.fut i { background: var(--unpaid-hatch); box-shadow: inset 0 0 0 1px var(--indigo-8); }
.cal-mcol span { font-size: 10.5px; color: var(--label-3); }
.cal-mcol.cur span { color: var(--indigo-9); font-weight: 600; }
.cal-day-badge { width: 22px; height: 22px; border-radius: 50%; background: var(--fill-2); color: var(--label-2); font-size: 11px; font-weight: 600; display: grid; place-items: center; flex-shrink: 0; }
.cal-day-badge.hot { background: var(--red-9); color: #fff; }
.cal-picked { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; margin-top: 12px; }

/* ---------------- 合租成员时间线条 (图 7 CarSheet) ---------------- */
.car-mrow {
  display: grid; grid-template-columns: 110px 84px minmax(80px, 1fr) 92px;
  align-items: center; gap: 10px; padding: 10px 0; border-top: var(--hairline) solid var(--sep); font-size: 12.5px;
}
.car-mrow:first-of-type { border-top: 0; }
.car-segtrack { display: flex; gap: 3px; height: 10px; align-items: center; }
.car-seg { flex: 1; height: 8px; border-radius: 99px; background: var(--fill); }
.car-seg.ok { background: var(--green-9); }
.car-seg.me { background: var(--gray-8); }
.car-seg.late { background: repeating-linear-gradient(45deg, var(--red-9) 0 3px, var(--red-4) 3px 6px); }
.car-seg.fut { background: repeating-linear-gradient(45deg, var(--gray-6) 0 3px, transparent 3px 6px); border: 1px solid var(--gray-6); }

/* ---------------- 1:1 Calends 合租 & 人员视图 (.car-* / .share-avatars / .people-* / .group) ---------------- */
.group { display: flex; flex-direction: column; gap: 6px; }
.group-title { font-size: var(--fs-2); color: var(--label-2); padding: 0 16px; font-weight: 500; }
.group-body { background: var(--card); border-radius: var(--radius-lg); box-shadow: 0 0 0 var(--hairline) var(--line); overflow: hidden; }
.cell {
  display: flex; align-items: center; gap: 12px; min-height: 50px; padding: 10px 16px; width: 100%;
  border: 0; background: none; text-align: left; position: relative; font-size: var(--fs-2); cursor: pointer;
}
.cell + .cell::before { content: ''; position: absolute; top: 0; left: 16px; right: 0; height: 0.5px; background: var(--sep); }
.cell.tap:hover { background: var(--fill-2); }
.cell-l { min-width: 0; flex-shrink: 1; display: flex; flex-direction: column; }
.cell-r { flex: 1; display: flex; align-items: center; justify-content: flex-end; gap: 6px; color: var(--label-2); font-variant-numeric: tabular-nums; }

.amt.car-plan-count { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; white-space: normal; }
.car-plan-count > span { white-space: nowrap; }
.car-plan-count small { margin-left: 2px; font-size: var(--fs-1); font-weight: 500; color: var(--label-2); }

.car-cols { display: grid; grid-template-columns: repeat(var(--car-columns, 3), minmax(0, 1fr)); gap: 16px; align-items: start; }
.car-col { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
@media (max-width: 1020px) { .car-cols { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 720px) { .car-cols { grid-template-columns: 1fr; } }

.car-card { gap: 12px !important; min-width: 0; max-width: 100%; cursor: pointer; transition: box-shadow var(--duration) var(--ease); }
.car-card:hover { box-shadow: 0 0 0 var(--hairline) var(--label-3); }
.car-card.stopped .car-head > :not(.ph-status),
.car-card.stopped .seats-row,
.car-card.stopped .car-book { filter: grayscale(1); opacity: 0.52; }
.car-head { display: flex; align-items: flex-start; gap: 12px; }
.car-card-identity { flex: 1; min-width: 0; }
.car-name { font-weight: 650; font-size: var(--fs-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.car-name button:hover { text-decoration: underline; text-underline-offset: 2px; }
.car-sub { font-size: var(--fs-1); white-space: pre-line; line-height: 1.4; margin-top: 2px; }
.car-seats {
  display: inline-flex; flex-shrink: 0; align-self: flex-start; align-items: center;
  height: 24px; padding: 0 10px; border-radius: var(--radius-pill);
  background: var(--fill-2); color: var(--label-2); font-size: var(--fs-1); font-weight: 500; white-space: nowrap;
}
.car-seats.full { background: var(--green-3); color: var(--green-11); font-weight: 600; }

.seats-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.share-avatars { display: flex; align-items: center; flex-wrap: nowrap; flex: 0 0 auto; min-width: 0; }
.share-avatars .seat {
  display: grid; place-items: center; width: var(--avatar-size, 22px); height: var(--avatar-size, 22px);
  border-radius: var(--radius-pill); flex-shrink: 0; position: relative;
  font-size: 11px; font-weight: 650; color: var(--label-3);
  box-shadow: 0 0 0 1.5px var(--card); background: color-mix(in srgb, var(--label) 6%, var(--card));
}
.share-avatars .seat + .seat { margin-left: calc(-1 * var(--avatar-overlap, 3px)); }
.share-avatars .seat.me { overflow: hidden; background: var(--card); }
.share-avatars .seat.me img { width: 100%; height: 100%; object-fit: cover; display: block; }
.share-avatars .seat.free { box-shadow: 0 0 0 1.5px var(--card), inset 0 0 0 var(--hairline) var(--line); }
.share-avatars button.seat { border: 0; padding: 0; cursor: pointer; }
.share-avatars button.seat:hover { z-index: 2; box-shadow: 0 0 0 1.5px var(--card), 0 0 0 calc(1.5px + var(--hairline)) var(--label-3); }

.car-toggle {
  display: inline-flex; align-items: center; gap: 4px; flex-shrink: 0;
  height: var(--ctl-h-md); padding: 0 10px; border-radius: var(--radius-pill);
  background: var(--fill-2); color: var(--label-2); font-size: var(--fs-1); cursor: pointer;
}
.car-toggle:hover { background: var(--fill); color: var(--label); }
.car-toggle .i { width: 14px; height: 14px; transition: transform var(--duration) var(--ease); }
.car-toggle.open .i { transform: rotate(180deg); }

.car-book { display: flex; flex-direction: column; gap: 8px; }
.car-book .metric-cards.inline .metric-grid > div { gap: 4px; }
.car-book .metric-cards.inline .metric-grid small { font-size: var(--fs-1); color: var(--label-3); }
.car-book .metric-cards.inline .metric-grid b { font-size: 15px; font-weight: 650; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; white-space: nowrap; }
.car-book .metric-cards.inline .metric-grid b.green, .car-book .metric-cards.inline .metric-grid b.gain { color: var(--gain); }
.car-book .metric-cards.inline .metric-grid b.warn { color: var(--orange); }
.car-book .metric-cards.inline .metric-grid b.loss { color: var(--loss); }

.car-expand { border-top: var(--hairline) solid var(--sep); padding-top: 10px; display: flex; flex-direction: column; gap: 6px; }
.member { display: flex; align-items: center; gap: 10px; padding: 7px 6px; border-radius: var(--radius-md); cursor: pointer; }
.member:hover { background: var(--fill-2); }
.member-info { flex: 1; min-width: 0; text-align: left; }
.member-dates { font-size: var(--fs-1); color: var(--label-3); margin-top: 1px; }
.member-dates .owe { color: var(--orange); }
.member-amount { text-align: right; font-variant-numeric: tabular-nums; font-size: var(--fs-1); white-space: nowrap; }
.member-amount .car-member-due { color: var(--orange); font-weight: 650; }

/* 人员颜色圆头像 (.pp-ava) & 胶囊 (.car-member-chip) */
.pp-ava {
  --pc: var(--indigo-9); display: inline-grid; place-items: center; flex-shrink: 0;
  border-radius: var(--radius-pill); font-weight: 650; line-height: 1; font-size: 11px;
  background: color-mix(in srgb, var(--pc) 16%, var(--card)); color: var(--pc); user-select: none; overflow: hidden;
}
.pp-ava.c-blue { --pc: var(--indigo-9); }
.pp-ava.c-green { --pc: var(--green-10); }
.pp-ava.c-orange { --pc: var(--orange-10); }
.pp-ava.c-pink { --pc: var(--pink-9); }
.pp-ava.c-purple { --pc: var(--purple-9); }
.pp-ava.c-teal { --pc: var(--teal-9); }
.pp-ava.c-indigo { --pc: var(--iris-9); }
.pp-ava.c-red { --pc: var(--red-9); }

.car-member-chip {
  display: inline-flex; align-items: center; gap: 8px; max-width: 100%; height: var(--ctl-h-md);
  padding: 0 12px 0 4px; border-radius: var(--radius-pill); background: var(--fill-2);
  font-size: var(--fs-2); font-weight: 500; min-width: 0; color: var(--label);
}
.car-member-chip:hover { background: var(--gray-4); }

/* 人员列表 (.people-list) */
.people-list { padding: 0; overflow: hidden; }
.people-head, .people-row {
  display: grid; grid-template-columns: minmax(200px, 1fr) 132px 168px 120px 128px;
  align-items: center; gap: 24px; padding: 8px 16px;
}
.people-head { height: 36px; background: var(--fill-2); font-size: var(--fs-1); color: var(--label-3); border-radius: var(--r) var(--r) 0 0; }
.people-head > :nth-child(n + 3), .people-owed, .people-received, .people-last { text-align: right; font-variant-numeric: tabular-nums; }
.people-head > :nth-child(n + 3) { justify-self: end; }
.lt-sort { display: inline-flex; align-items: center; gap: 4px; color: inherit; font: inherit; white-space: nowrap; }
.lt-sort:hover, .lt-sort.on { color: var(--label); }
.lt-sort .i { width: 12px; height: 12px; opacity: 0.45; }
.lt-sort.on .i { opacity: 1; }
.people-row { min-height: 56px; border-top: var(--hairline) solid var(--sep); cursor: pointer; font-size: var(--fs-2); }
.people-row:hover { background: var(--fill-2); }
.people-row:hover .people-open.car-member-chip { background: var(--gray-4); }
.people-identity, .people-plans { display: flex; align-items: center; gap: 8px; min-width: 0; }
.people-person { display: flex; align-items: center; gap: 8px; min-width: 0; }
.people-person small { font-size: var(--fs-1); }
.people-plans { gap: 6px; }
.people-owed { display: flex; justify-content: flex-end; align-items: baseline; gap: 6px; color: var(--orange); white-space: nowrap; }
.people-owed small { color: var(--label-2); font-size: var(--fs-1); }
.people-settled { color: var(--label-3); }
.people-more { color: var(--label-2); font-size: var(--fs-1); font-weight: 600; }
@media (max-width: 900px) {
  .people-head { display: none; }
  .people-row { grid-template-columns: 1fr auto; gap: 6px 12px; padding: 12px 16px; }
  .people-plans, .people-last { grid-column: 1 / -1; justify-self: start; text-align: left; }
}

/* 列表模式禁用按钮态 */
.seg button:disabled { opacity: 0.38; cursor: not-allowed; }

/* 状态胶囊 (.ph-status) */
.ph-status {
  display: inline-flex; align-items: center; gap: 6px; flex-shrink: 0; height: 24px;
  padding: 0 10px 0 8.5px; border-radius: var(--radius-pill); font-size: var(--fs-1); font-weight: 500;
  background: var(--fill-2); color: var(--label-2);
}
.ph-status i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.ph-status.owe { background: var(--orange-3); color: var(--orange); }
.ph-status.owe i { background: var(--orange-9); }
.ph-status.done { background: var(--green-3); color: var(--green); }
.ph-status.done i { background: var(--green-9); }
.ph-status.stop { background: var(--red-3); color: var(--red); }
.ph-status.stop i { background: var(--red-9); }

/* 合租列表表格 (.car-lt) */
.ltable { --cols: minmax(210px, 2fr) repeat(7, minmax(max-content, 1fr)); display: grid; grid-template-columns: var(--cols); border-radius: var(--r); background: var(--card); box-shadow: inset 0 0 0 var(--hairline) var(--line); overflow: hidden; }
.ltable .lt-row { display: grid; grid-template-columns: subgrid; grid-column: 1 / -1; align-items: center; gap: 14px; min-height: 54px; padding: 8px 16px; border-top: var(--hairline) solid var(--sep); text-align: left; font-size: var(--fs-2); }
.ltable .lt-head.table-head { height: 36px; min-height: 36px; border-top: 0; background: var(--fill-2); font-size: var(--fs-1); color: var(--label-3); }
.ltable .lt-row:not(.lt-head):hover { background: var(--fill-2); cursor: pointer; }
.lt-name { display: flex; align-items: center; gap: 10px; min-width: 0; }
.lt-title { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.lt-sub { font-size: var(--fs-1); color: var(--label-3); }
.lt-members { display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.lt-num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ---------------- 侧边栏「新建」双选项浮层 (.sb-new-wrap / .sb-pop) ---------------- */
.sb-new-wrap { position: relative; display: flex; }
.sb-new-wrap > .sb-qbtn { width: 100%; }
.sb-pop {
  position: absolute; top: calc(100% + 6px); left: 0; width: 224px; z-index: 60;
  padding: 6px; border-radius: var(--radius-lg); background: var(--bg);
  box-shadow: var(--shadow-lg), inset 0 0 0 var(--hairline) var(--line);
  display: flex; flex-direction: column; gap: 2px;
}
.sb-pop-item {
  display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: var(--radius-md);
  text-align: left; width: 100%; transition: background var(--duration) var(--ease);
}
.sb-pop-item:hover { background: var(--fill-2); }
.sb-pop-ico {
  width: 30px; height: 30px; border-radius: var(--radius-sm); background: var(--fill-2); color: var(--label);
  display: grid; place-items: center; flex-shrink: 0;
}
.sb-pop-txt b { display: block; font-size: var(--fs-2); font-weight: 600; }
.sb-pop-txt small { display: block; font-size: 11px; color: var(--label-3); margin-top: 1px; }

/* ---------------- 1:1 Calends Settings 控件 (.toggle / .picker-pill / .nav-row) ---------------- */
.set-page { max-width: 720px; width: 100%; margin: 0 auto; display: flex; flex-direction: column; gap: 26px; }
.toggle {
  --toggle-h: 22px; --toggle-travel: 16px;
  position: relative; width: calc(var(--toggle-h) + var(--toggle-travel)); height: var(--toggle-h);
  flex-shrink: 0; display: inline-block; vertical-align: middle; cursor: pointer;
}
.toggle.disabled { opacity: 0.45; cursor: not-allowed; }
.toggle i {
  position: absolute; inset: 0; border-radius: var(--radius-pill); background: var(--fill);
  transition: background var(--duration) var(--ease);
}
.toggle i::after {
  content: ''; position: absolute; top: 2px; left: 2px;
  width: calc(var(--toggle-h) - 4px); height: calc(var(--toggle-h) - 4px);
  border-radius: var(--radius-pill); background: #fff;
  transition: transform var(--duration) var(--ease);
}
.toggle.on i { background: var(--ink); }
.dark .toggle.on i { background: var(--green-9); }
.toggle.on i::after { transform: translateX(var(--toggle-travel)); }

.picker-pill {
  position: relative; display: inline-flex; align-items: center; gap: 5px;
  height: var(--ctl-h-sm); padding: 0 10px; border-radius: var(--radius-pill);
  background: var(--fill-2); color: var(--label); font-size: var(--fs-2); font-weight: 500;
  white-space: nowrap; cursor: pointer;
}
.picker-pill:hover { background: var(--fill); }
.picker-pill select {
  appearance: none; -webkit-appearance: none; border: 0; outline: 0; background: none;
  color: inherit; font: inherit; cursor: pointer; padding-right: 16px;
}
.picker-pill .p-chev { position: absolute; right: 8px; pointer-events: none; color: var(--label-3); width: 12px; height: 12px; }
.gain-sample { display: inline-flex; gap: 8px; font-variant-numeric: tabular-nums; font-size: var(--fs-2); font-weight: 600; margin-right: 4px; }

.cell-in-plain {
  border: 0; outline: 0; background: none; text-align: right; color: var(--label);
  font: inherit; min-width: 140px; flex: 1; padding: 4px 0;
}
.cell-in-plain::placeholder { color: var(--label-3); }

/* 侧边栏二级分类编辑器（可拖拽 / 上下移动 + 隐藏显示开关） */
.nav-sec-hd {
  display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 6px 16px;
  background: color-mix(in srgb, var(--fill-2) 65%, transparent);
  border-top: var(--hairline) solid var(--sep);
}
.nav-sec-hd:first-child { border-top: 0; }
.nav-sec-hd b { font-size: var(--fs-2); font-weight: 600; }
.nav-sec-item {
  display: flex; align-items: center; gap: 10px; min-height: 42px; padding: 6px 16px 6px 28px;
  border-top: var(--hairline) solid var(--sep); font-size: var(--fs-2);
  background: var(--card); transition: background var(--duration) var(--ease);
}
.nav-sec-item.dragging, .nav-sec-hd.dragging { opacity: 0.5; background: var(--fill); }
.nav-sec-item.is-hidden > .nav-row-name { color: var(--label-3); text-decoration: line-through; }
.cat-grip {
  display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: var(--radius-sm);
  color: var(--label-3); cursor: grab; flex-shrink: 0; font-size: 13px; letter-spacing: -1px;
}
.cat-grip:hover { background: var(--fill-2); color: var(--label); }
.nav-row-name { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; }
.nav-mv { display: inline-flex; align-items: center; gap: 2px; }
.nav-mv button {
  width: 24px; height: 24px; border-radius: var(--radius-sm); color: var(--label-3);
  display: grid; place-items: center; font-size: 11px;
}
.nav-mv button:hover:not(:disabled) { background: var(--fill-2); color: var(--label); }
.nav-mv button:disabled { opacity: 0.25; cursor: default; }

/* ---------------- 1:1 Calends 添加订阅表单 (.ed-*) ---------------- */
.ed { display: flex; flex-direction: column; gap: 16px; }
.ed-ai.muted {
  display: flex; align-items: center; gap: 8px; width: 100%; min-height: 36px; padding: 6px 12px;
  border-radius: var(--radius-md); background: var(--fill-2); color: var(--label-2); font-size: var(--fs-1);
}
.ed-ai.muted:hover { background: var(--fill); color: var(--label); }
.ed-id { display: flex; align-items: center; gap: 12px; padding: 2px 2px 0; }
.ed-id-ghost {
  width: 36px; height: 36px; border-radius: var(--radius-sm); flex-shrink: 0;
  background: color-mix(in srgb, var(--indigo-9) 14%, transparent);
  box-shadow: inset 0 0 0 var(--hairline) color-mix(in srgb, var(--indigo-9) 28%, transparent);
  display: grid; place-items: center; color: var(--indigo-9);
}
.ed-name { flex: 1; min-width: 0; }
.ed-name input {
  width: 100%; border: 0; outline: 0; background: none; padding: 2px 0;
  font-size: 16px; font-weight: 700; letter-spacing: -0.02em; color: var(--label);
}
.ed-name input::placeholder { color: var(--label-3); font-weight: 600; }
.ed-amount { display: inline-flex; align-items: center; gap: 8px; }
.ed-amount input {
  width: 96px; border: 0; outline: 0; background: none; text-align: right;
  font-size: 16px; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--label);
  -moz-appearance: textfield;
}
.ed-amount input::-webkit-outer-spin-button,
.ed-amount input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

/* ---------------- 身份头像替换 (.id-av-edit / .av-presets) & 通用调序条 (.sort-bar) ---------------- */
.id-av-wrap.editable { cursor: pointer; }
.id-av-edit {
  position: absolute; inset: 0; border-radius: 50%; background: var(--black-a6);
  color: #fff; display: grid; place-items: center; opacity: 0;
  transition: opacity var(--duration) var(--ease); pointer-events: none; z-index: 2;
}
.id-av-wrap.editable:hover .id-av-edit { opacity: 1; }
.id-av-ring img { width: 100%; height: 100%; object-fit: cover; display: block; border-radius: 50%; }
.av-presets { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; }
.av-preset-btn {
  display: flex; flex-direction: column; align-items: center; gap: 5px; padding: 8px 4px;
  border-radius: var(--radius-md); background: var(--fill-2); cursor: pointer;
  border: 1.5px solid transparent; transition: background var(--duration), border-color var(--duration);
}
.av-preset-btn:hover { background: var(--fill); }
.av-preset-btn.on { border-color: var(--ink); background: var(--card); }

.sort-bar {
  display: flex; align-items: center; gap: 4px; margin-bottom: 10px; padding: 4px 8px;
  border-radius: var(--radius-md); background: var(--fill-2); font-size: 11px; color: var(--label-2);
}
.sort-bar .cat-grip { width: 18px; height: 18px; font-size: 11px; }
.sort-bar .s-mv {
  display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 5px;
  border-radius: var(--radius-sm); background: var(--card); color: var(--label);
  box-shadow: inset 0 0 0 var(--hairline) var(--line); font-size: 11px; cursor: pointer;
}
.sort-bar .s-mv:hover:not(:disabled) { background: var(--hover); }
.sort-bar .s-mv:disabled { opacity: 0.35; cursor: default; }

/* ---------------- 钱包分类、App Store 徽章、Apple 礼品卡 & KYC 身份 ---------------- */
.appstore-badge {
  display: inline-grid; place-items: center; flex-shrink: 0;
  background: linear-gradient(180deg, #19a2ff 0%, #0a6ee8 100%);
  border-radius: 7px; padding: 4px;
  box-shadow: 0 2px 6px rgba(10, 110, 232, 0.25);
}
.appstore-badge img { display: block; width: 100%; height: 100%; object-fit: contain; }
.paycard.apple-gift {
  color: #f8fafc;
  background: linear-gradient(135deg, #18181b 0%, #27272a 55%, #111827 100%);
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.24), inset 0 0 0 1px rgba(255, 255, 255, 0.12);
}
.paycard.apple-gift::before {
  background: radial-gradient(240px circle at 92% 18%, rgba(56, 189, 248, 0.28), rgba(168, 85, 247, 0.18) 42%, transparent 68%);
}
.paycard.apple-gift .o { color: rgba(248, 250, 252, 0.68); opacity: 1; }
.pc-badge-pill {
  display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px;
  border-radius: var(--radius-pill); font-size: 10.5px; font-weight: 600;
  white-space: nowrap; flex-shrink: 0;
  background: rgba(255, 255, 255, 0.16); color: inherit; backdrop-filter: blur(4px);
}
.paycard.apple .pc-badge-pill,
.paycard.light .pc-badge-pill { background: rgba(0, 0, 0, 0.07); }
.paycard.apple-gift .id-chip { background: rgba(255, 255, 255, 0.14); color: #f8fafc; box-shadow: none; }
.wal-sec-hd {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  flex-wrap: wrap; margin-bottom: 10px;
}
.wal-sec-hd h3 { margin: 0; font-size: 14.5px; font-weight: 650; display: flex; align-items: center; gap: 8px; }
.kyc-doc-card {
  position: relative; display: flex; flex-direction: column; gap: 10px;
  cursor: pointer; transition: transform var(--duration) var(--ease), box-shadow var(--duration) var(--ease);
}
.kyc-doc-card:hover { transform: translateY(-2px); }
.kyc-strip {
  height: 4px; border-radius: var(--radius-pill);
  background: var(--indigo-9); opacity: 0.85; margin-bottom: 2px;
}
.kyc-strip.id_card { background: linear-gradient(90deg, #2563eb, #0ea5e9); }
.kyc-strip.passport { background: linear-gradient(90deg, #7c3aed, #db2777); }
.kyc-strip.residence { background: linear-gradient(90deg, #059669, #10b981); }
.kyc-strip.address { background: linear-gradient(90deg, #d97706, #f59e0b); }
.kyc-addr-box {
  background: var(--fill-2); border-radius: var(--radius-sm); padding: 7px 10px;
  font-size: 12px; color: var(--label-2); line-height: 1.45;
  display: flex; align-items: flex-start; gap: 8px;
}
.kyc-addr-box span { flex: 1; min-width: 0; }
.kyc-id-row {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 8px 10px; border-radius: var(--radius-md); background: var(--fill-2);
  font-size: 12px; cursor: pointer; margin-top: 8px;
}
.kyc-id-row:hover { background: var(--fill); }
.dragging-item { opacity: 0.48; outline: 1.5px dashed var(--indigo-9); }

/* ---------------- Calends 1:1 补充样式（卡面图标、搜索框、Logo上传、充值记录、12月热力图、拆分付款） ---------------- */
.pc-logo { width: 26px; height: 26px; object-fit: contain; flex-shrink: 0; filter: drop-shadow(0 1px 2px rgba(0,0,0,.18)); }
.pc-logo.bank { border-radius: 7px; background: rgba(255,255,255,.92); padding: 2px; }
.pc-logo.wide { width: 46px; height: 18px; object-position: left center; }
.pc-mark.wide { opacity: 0.08; width: 90%; right: -20%; bottom: -10%; }
.pc-ccy {
  font-size: 11px; font-weight: 700; letter-spacing: 0.04em; opacity: 0.88;
  padding: 2px 7px; border-radius: 6px; background: rgba(255, 255, 255, 0.16); white-space: nowrap;
}
.paycard.light .pc-ccy { background: rgba(0, 0, 0, 0.06); color: #1d1d1f; }
.ac-logo {
  width: 28px; height: 28px; flex-shrink: 0;
  background: linear-gradient(145deg, color-mix(in srgb, #1d1d1f 55%, #8e8e93), color-mix(in srgb, #1d1d1f 35%, #aeaeb2));
  -webkit-mask: url('brands/appstore.svg') center / contain no-repeat;
  mask: url('brands/appstore.svg') center / contain no-repeat;
  filter: drop-shadow(0 1px 0 rgba(255,255,255,.85));
}
.tb-search {
  display: flex; align-items: center; gap: 6px; flex: 0 1 190px; min-width: 120px;
  height: var(--ctl-h-sm); padding: 0 8px 0 10px; border-radius: var(--radius-pill);
  background: var(--fill); color: var(--label-3);
}
.tb-search:focus-within { background: var(--card); box-shadow: inset 0 0 0 1.5px var(--indigo-9); }
.tb-search input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; color: var(--label); font: inherit; font-size: var(--fs-1); }
.facet-clear {
  position: absolute; top: 8px; right: 10px; font-size: var(--fs-1); color: var(--label-3);
  padding: 2px 8px; border-radius: var(--radius-pill); background: var(--fill-2);
}
.facet-clear:hover { background: var(--fill); color: var(--label); }
.logo-field .cell-r { gap: 8px; flex-wrap: nowrap; }
.logo-field .cell-r > input:not([type="file"]) { flex: 1 1 0; min-width: 60px; }
.chip-btn {
  display: inline-flex; align-items: center; gap: 4px; height: 26px; padding: 0 10px;
  border-radius: var(--radius-pill); background: var(--fill); color: var(--label);
  font-size: var(--fs-1); font-weight: 500; white-space: nowrap; flex-shrink: 0; cursor: pointer;
}
.chip-btn:hover { background: var(--hover); }
.ed-suggest {
  position: relative; margin-top: 6px; padding: 6px; border-radius: var(--radius-lg);
  background: var(--card); box-shadow: var(--shadow-lg), inset 0 0 0 var(--hairline) var(--line);
}
.ed-suggest .hit {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 6px 10px;
  border-radius: var(--radius-md); text-align: left; font-size: var(--fs-2);
}
.ed-suggest .hit:hover { background: var(--fill-2); }
.topup-row { justify-content: space-between; align-items: center; }
.topup-row .cell-l { display: flex; flex-direction: column; gap: 2px; }
.topup-row .cell-l small { font-size: var(--fs-1); color: var(--label-3); }
.topup-rate { font-size: var(--fs-1); color: var(--label-2); font-variant-numeric: tabular-nums; display: inline-flex; align-items: center; gap: 6px; }
.topup-rate em { font-style: normal; padding: 1px 6px; border-radius: var(--radius-pill); font-size: 11px; font-weight: 600; }
.topup-rate em.up { background: var(--orange-3); color: var(--orange); }
.topup-rate em.down { background: var(--green-3); color: var(--green); }
.cell.pay-split { justify-content: space-between; gap: 8px; }
.cell.pay-split select { max-width: 170px; }
.cell.pay-split input { flex: 1 1 70px; min-width: 70px; text-align: right; border: 0; outline: 0; background: none; color: var(--label); font: inherit; font-variant-numeric: tabular-nums; }
.heat { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 960px) { .heat { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 580px) { .heat { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.heat-m {
  padding: 12px; border-radius: var(--radius-lg); background: var(--card);
  box-shadow: inset 0 0 0 var(--hairline) var(--line); cursor: pointer; text-align: left;
  transition: background var(--duration) var(--ease);
}
.heat-m:hover { background: var(--card-2); }
.heat-m.cur { box-shadow: inset 0 0 0 1.5px var(--ink); }
.heat-h { display: flex; justify-content: space-between; align-items: baseline; font-size: var(--fs-2); font-weight: 700; margin-bottom: 8px; }
.heat-h span { font-size: var(--fs-1); font-weight: 600; color: var(--label-2); font-variant-numeric: tabular-nums; }
.heat-g { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; }
.heat-g i { aspect-ratio: 1; border-radius: 3px; background: var(--fill-2); display: grid; place-items: center; font-style: normal; font-size: 9px; font-weight: 700; }
.heat-g i.on { background: color-mix(in srgb, var(--indigo-9) 24%, transparent); color: var(--indigo-11); }
.heat-g i.hi { background: var(--indigo-9); color: #fff; }
.car-private { filter: blur(5px); user-select: none; }
.btn.danger-outline { color: var(--red); border: 1px solid color-mix(in srgb, var(--red) 40%, transparent); background: transparent; }
.btn.danger-outline:hover { background: var(--red-3); }
.icon-btn.danger:hover { background: var(--red-3); color: var(--red); }
.icon-btn.warn:hover { background: var(--orange-3); color: var(--orange); }

/* ---------------- 1:1 Calends EmptyState Illustration & Connect AI Page (.ai-*) ---------------- */
.empty-state {
  display: grid; justify-items: center; align-content: center;
  text-align: center; gap: 10px; padding: 40px 20px;
  color: var(--label-2); font-size: var(--fs-2);
}
.empty-state p { margin: 0; max-width: 340px; line-height: 1.55; color: var(--label-2); }
.eg-wrap { display: inline-flex; align-items: center; justify-content: center; }
.eg-svg { display: block; max-width: 100%; height: auto; overflow: visible; }
.eg-shadow { fill: var(--fill-2); stroke: none; }
.eg-surface { fill: var(--card); stroke: var(--label); stroke-width: 1.9; }
.eg-surface-soft { fill: var(--card); stroke: var(--label-3); stroke-width: 1.65; }
.eg-fill-ink { fill: var(--label); stroke: none; }
.eg-stroke-ink { fill: none; stroke: var(--label); stroke-width: 1.9; }
.eg-stroke-mid { fill: none; stroke: var(--label-2); stroke-width: 1.75; }
.eg-stroke-soft { fill: none; stroke: var(--label-3); stroke-width: 1.6; }
.eg-stroke-rule { fill: none; stroke: var(--line); stroke-width: 2.2; }

.ai-page {
  display: flex; flex-direction: column; gap: 16px;
  max-width: 880px; margin: 0 auto; width: 100%;
}
.ai-status-card {
  overflow: hidden; border: var(--hairline) solid var(--line);
  border-radius: var(--radius-lg); background: var(--card);
}
.ai-status {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; padding: 16px 20px;
}
.ai-status-l { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.ai-status-l b { display: inline-flex; align-items: center; flex-wrap: wrap; gap: 8px; font-size: var(--fs-2); }
.ai-status-l small { color: var(--label-2); font-size: var(--fs-2); }
.ai-badge, .ai-skill-badge {
  display: inline-flex; align-items: center; gap: 4px;
  height: 22px; padding: 0 9px; border-radius: var(--radius-pill);
  background: var(--fill); color: var(--label-2);
  font-size: var(--fs-1); font-weight: 600;
}
.ai-endpoint {
  display: flex; align-items: center; gap: 12px; width: 100%;
  padding: 12px 20px; border: 0; border-top: var(--hairline) solid var(--sep);
  background: var(--fill-2); color: var(--label); text-align: left; cursor: pointer;
  transition: background var(--duration) var(--ease), color var(--duration) var(--ease);
}
.ai-endpoint:hover:not(:disabled) { background: var(--fill); }
.ai-endpoint:disabled { opacity: 1; color: var(--label-2); cursor: default; }
.ai-endpoint:disabled svg { visibility: hidden; }
.ai-page .ai-card { transition: opacity var(--duration) var(--ease); }
.ai-page.off .ai-card { opacity: 0.55; }
.ai-endpoint span { color: var(--label-2); font-size: var(--fs-2); white-space: nowrap; }
.ai-endpoint code {
  flex: 1; min-width: 0; overflow-wrap: anywhere;
  font: 500 var(--fs-2)/1.4 var(--mono);
}
.ai-card {
  padding: 20px; border-radius: var(--radius-lg);
  background: var(--card); box-shadow: inset 0 0 0 var(--hairline) var(--line);
}
.ai-card > header { display: block; margin-bottom: 16px; }
.ai-card h2 {
  display: inline-flex; align-items: baseline; gap: 6px;
  margin: 0; font-size: var(--fs-3); font-weight: 650; letter-spacing: -0.01em;
}
.ai-card h2 .ct { color: var(--label-2); font-size: var(--fs-2); font-weight: 500; font-variant-numeric: tabular-nums; }
.ai-skill-row {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 14px;
}
.ai-skill-text { display: flex; flex-direction: column; gap: 4px; min-width: 0; flex: 1; }
.ai-skill-text b { display: inline-flex; align-items: center; flex-wrap: wrap; gap: 7px; font-size: var(--fs-2); }
.ai-skill-text small { color: var(--label-2); font-size: var(--fs-1); line-height: 1.5; }
.ai-skill-uri { width: fit-content; color: var(--label-3); font: 500 var(--fs-1)/1.4 var(--mono); overflow-wrap: anywhere; }
.ai-skill-acts { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.ai-clients {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 8px;
}
.ai-client {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px;
  border: 0; border-radius: var(--radius-md); background: var(--fill-2);
  color: var(--label); font-size: var(--fs-2); font-weight: 550;
  text-align: left; cursor: pointer; transition: background var(--duration) var(--ease);
}
.ai-client:hover { background: var(--fill); }
.ai-client.on { background: var(--card); box-shadow: inset 0 0 0 var(--hairline) var(--label); }
.ai-client-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; line-height: 1.2; overflow-wrap: anywhere; }
.ai-client-text small { color: var(--label-2); font-weight: 400; font-size: var(--fs-1); overflow-wrap: break-word; }
.ai-logo { display: grid; place-items: center; flex-shrink: 0; color: var(--label-2); }
.ai-logo img, .ai-logo i { width: 80%; height: 80%; display: block; object-fit: contain; }
.ai-logo i { background: currentColor; mask: no-repeat center / contain; -webkit-mask: no-repeat center / contain; }
.ai-logo img.tile { border-radius: 22%; object-fit: cover; }
.ai-client .ai-logo i { color: var(--label); }
.ai-install .ai-logo { color: inherit; }
.ai-steps {
  list-style: none; counter-reset: step; margin: 20px 0 0; padding: 0;
  display: flex; flex-direction: column; gap: 14px;
}
.ai-steps li {
  counter-increment: step; position: relative; padding-left: 36px;
  display: flex; flex-direction: column; gap: 6px; font-size: var(--fs-2);
}
.ai-steps li::before {
  content: counter(step); position: absolute; left: 0; top: -1px;
  width: 22px; height: 22px; border-radius: var(--radius-pill);
  background: var(--fill); color: var(--label-2); font-size: var(--fs-1);
  font-weight: 700; display: grid; place-items: center;
}
.ai-steps li > span { color: var(--label-2); display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.ai-step-ok { color: var(--green) !important; }
.ai-step-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.btn.ai-create {
  height: auto; min-height: var(--ctl-h-md); max-width: 100%;
  padding-block: 6px; white-space: normal; text-align: left;
}
.ai-code {
  border: var(--hairline) solid var(--line); border-radius: var(--radius-md);
  background: var(--black-a12); color: var(--white-a12); overflow: hidden;
}
.ai-code-bar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 6px 8px 6px 14px; background: var(--white-a2);
  color: var(--white-a11); font: 500 var(--fs-1)/1 var(--font);
  text-transform: uppercase; letter-spacing: 0.04em;
}
.ai-copy {
  display: inline-flex; align-items: center; gap: 6px;
  height: var(--ctl-h-md); padding: 0 10px; border: 0;
  border-radius: var(--radius-pill); background: var(--white-a3);
  color: var(--white-a12); font-family: inherit; text-transform: none;
  letter-spacing: 0; cursor: pointer;
}
.ai-copy:hover { background: var(--white-a4); }
.ai-code pre {
  margin: 0; padding: 14px 16px 16px;
  font: var(--fs-1)/1.6 var(--mono); white-space: pre-wrap; overflow-wrap: anywhere;
}
.ai-install { align-self: flex-start; gap: 8px; }
.ai-empty { padding: 12px 16px; color: var(--label-2); font-size: var(--fs-2); text-align: center; }
.ai-tokens { display: flex; flex-direction: column; }
.ai-token {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr) minmax(0, 0.8fr) minmax(0, 0.9fr) minmax(110px, 0.7fr);
  align-items: center; gap: 16px; padding: 12px 0;
  border-top: var(--hairline) solid var(--sep); font-size: var(--fs-2); font-variant-numeric: tabular-nums;
}
.ai-token-head { padding: 0 0 8px; border-top: 0; color: var(--label-3); font-size: var(--fs-1); font-weight: 500; }
.ai-token-name { display: flex; align-items: center; gap: 10px; min-width: 0; }
.ai-token-name b { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.ai-token-ico {
  display: grid; flex-shrink: 0; place-items: center;
  width: 30px; height: 30px; border-radius: var(--radius-sm);
  background: var(--fill-2); color: var(--label-2);
}
.ai-token-key { overflow: hidden; color: var(--label-2); font: var(--fs-1)/1 var(--mono); white-space: nowrap; text-overflow: ellipsis; }
.ai-token-key span { color: var(--label-3); letter-spacing: 0.05em; }
.ai-token-when { color: var(--label-2); white-space: nowrap; }
.ai-token-when.never { color: var(--label-3); }
.ai-token-when small { display: none; }
.ai-token-act { display: flex; justify-content: flex-end; }
.ai-scope {
  display: inline-flex; flex-shrink: 0; align-items: center; gap: 4px;
  padding: 2px 8px; border-radius: var(--radius-pill);
  font-size: var(--fs-1); font-weight: 600; background: var(--fill); color: var(--label-2);
}
.ai-scope.write { background: var(--orange-3); color: var(--orange); }
.ai-tools-toggle {
  display: block; width: 100%; padding: 0; border: 0;
  background: none; color: inherit; text-align: left; cursor: pointer;
}
.ai-tools-toggle > .row { justify-content: space-between; width: 100%; }
.ai-tools-toggle[aria-expanded='true'] .ai-chev { transform: rotate(180deg); }
.ai-tools-title { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; min-width: 0; }
.ai-tools-legend { display: flex; gap: 18px; color: var(--label-2); font-size: var(--fs-1); }
.ai-tools-legend > span, .ai-tools h3 { display: inline-flex; align-items: center; gap: 6px; }
.ai-tools-legend > span { gap: 4px; }
.ai-tools-legend .write, .ai-tool.write .ai-tool-ico { color: var(--orange); }
.ai-tools { columns: 2; column-gap: 24px; margin-top: 18px; }
.ai-tool-group { break-inside: avoid; margin-bottom: 24px; }
.ai-tools h3 { margin: 0 0 8px 4px; color: var(--label-2); font-size: var(--fs-1); font-weight: 600; }
.ai-tools h3 small { color: var(--label-3); font-weight: 500; }
.ai-tool-list { overflow: hidden; border-radius: var(--radius-md); background: var(--fill-2); }
.ai-tool {
  display: grid; grid-template-columns: 18px minmax(0, 1fr) auto;
  align-items: center; gap: 10px; min-height: 44px; padding: 0 14px; font-size: var(--fs-2);
}
.ai-tool + .ai-tool { box-shadow: inset 0 0.5px 0 var(--sep); }
.ai-tool-ico { display: inline-flex; color: var(--label-3); }
.ai-tool b { min-width: 0; overflow: hidden; font-weight: 500; text-overflow: ellipsis; white-space: nowrap; }
.ai-tool code { color: var(--label-3); font: var(--fs-1)/1.3 var(--mono); }
.ai-fresh { display: flex; flex-direction: column; gap: 10px; }
.ai-fresh-head { display: flex; align-items: center; gap: 8px; }
.ai-warn { display: flex; align-items: center; gap: 6px; margin: 0; color: var(--orange); font-size: var(--fs-2); }
.ai-field { display: flex; flex-direction: column; gap: 6px; font-size: var(--fs-2); color: var(--label-2); }
.ai-field input {
  height: var(--ctl-h-lg); padding: 0 14px; border: 0; border-radius: var(--radius-md);
  background: var(--card); box-shadow: inset 0 0 0 var(--hairline) var(--line);
  color: var(--label); font-size: var(--fs-2);
}
.ai-field input:focus { outline: var(--hairline) solid var(--focus-ring); outline-offset: 2px; }
.ai-scopes { display: flex; flex-direction: column; gap: 8px; }
.ai-scope-card {
  display: flex; align-items: flex-start; gap: 12px; padding: 14px 16px;
  border: 0; border-radius: var(--radius-lg); background: var(--card);
  box-shadow: inset 0 0 0 var(--hairline) var(--line); color: var(--label);
  text-align: left; cursor: pointer;
}
.ai-scope-card b { display: block; font-size: var(--fs-2); }
.ai-scope-card small { display: block; margin-top: 2px; color: var(--label-2); font-size: var(--fs-2); line-height: 1.4; }
.ai-scope-card.on { box-shadow: inset 0 0 0 var(--hairline) var(--label); }
.ai-radio {
  flex-shrink: 0; width: 18px; height: 18px; margin-top: 2px;
  border-radius: var(--radius-pill); box-shadow: inset 0 0 0 var(--hairline) var(--label-3);
}
.ai-scope-card.on .ai-radio { box-shadow: inset 0 0 0 5px var(--label); }
@media (max-width: 720px) {
  .ai-tools { columns: 1; }
  .ai-tool code { display: none; }
  .ai-token { grid-template-columns: minmax(0, 1fr) auto auto; grid-template-areas: 'name name act' 'key created used'; gap: 8px 14px; padding: 14px 0; }
  .ai-token-name { grid-area: name; } .ai-token-key { grid-area: key; padding-left: 40px; }
  .ai-token-when.created { grid-area: created; } .ai-token-when.used { grid-area: used; } .ai-token-act { grid-area: act; }
  .ai-token-when { display: flex; flex-direction: column; gap: 2px; font-size: var(--fs-1); }
  .ai-token-when small { display: block; color: var(--label-3); font-size: var(--fs-1); }
}
@media (max-width: 640px) {
  .ai-clients { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ai-endpoint { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 12px; padding: 10px 16px; }
  .ai-endpoint span { grid-column: 1 / -1; font-size: var(--fs-1); }
}

/* ---------------- 1:1 Calends Currency Popover (.dp-pop / .cp-pop) ---------------- */
.dp-pop {
  position: fixed; z-index: 120; width: 300px; padding: 12px;
  border-radius: var(--radius-lg); background: var(--card);
  box-shadow: 0 18px 50px color-mix(in srgb, var(--black-a12) 18%, transparent), 0 0 0 var(--hairline) var(--line);
}
.cp-pop {
  width: 300px; height: 440px; padding: 6px;
  display: flex; flex-direction: column;
}
.cp-search {
  display: flex; align-items: center; gap: 6px; height: var(--ctl-h-md);
  margin: 2px 2px 6px; padding: 0 10px; border-radius: var(--radius-md);
  background: var(--fill-2); flex-shrink: 0;
}
.cp-search .i { width: 14px; height: 14px; color: var(--label-3); }
.cp-search input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; font-size: var(--fs-2); color: var(--label); }
.cp-list { flex: 1; overflow-y: auto; overscroll-behavior: contain; }
.cp-head {
  position: sticky; top: -1px; z-index: 1; padding: 9px 10px 4px;
  font-size: var(--fs-1); font-weight: 600; color: var(--label-3); background: var(--card);
}
.cp-opt {
  display: flex; align-items: center; gap: 10px; width: 100%; height: 36px; padding: 0 10px;
  border: 0; border-radius: var(--radius-md); background: none; text-align: left; color: var(--label); cursor: pointer;
}
.cp-opt:hover, .cp-opt.hi { background: var(--fill-2); }
.cp-opt > .i { width: 15px; height: 15px; flex-shrink: 0; color: var(--accent); }
.cp-flag {
  display: grid; place-items: center; flex-shrink: 0; width: 20px; height: 15px;
  border-radius: 0; overflow: hidden;
}
.cp-flag img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cp-flag b { font-size: var(--fs-1); font-weight: 700; color: var(--label-2); }
.cp-flag .i { width: 14px; height: 14px; color: var(--label-2); }
.cp-flag:has(.i), .cp-flag:has(b) { background: var(--fill-2); }
.cp-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: var(--fs-2); }
.cp-code { flex-shrink: 0; font-size: var(--fs-1); color: var(--label-3); font-variant-numeric: tabular-nums; letter-spacing: 0.02em; }
.cp-opt.sel .cp-name { font-weight: 600; }
.cp-empty { padding: 24px; text-align: center; font-size: var(--fs-2); color: var(--label-3); }
.side-item.open { background: var(--fill-2); }

/* ---------------- 1:1 Calends Files Center (.files-page / .file-grid / .file-card / .file-rows) ---------------- */
.file-search-inline {
  display: flex; align-items: center; gap: 6px; height: var(--ctl-h-md);
  width: 186px; padding: 0 10px; border-radius: var(--radius-pill);
  background: var(--fill-2); color: var(--label);
}
.file-search-inline input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; font-size: var(--fs-2); }
.file-search-inline .i { color: var(--label-3); }
.file-sections { display: grid; gap: 26px; }
.file-sec { display: grid; gap: 12px; min-width: 0; }
.file-sec-head { display: flex; align-items: center; gap: 8px; min-height: 30px; min-width: 0; }
.file-sec-name { font-size: var(--fs-3); font-weight: 650; }
.file-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(195px, 1fr));
  gap: 20px 18px; align-items: start; grid-auto-flow: dense;
}
.file-grid.collage { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 22px 18px; max-width: 980px; margin: 4px auto 0; }
.file-grid.collage .file-card.wide { grid-column: span 2; }
.file-grid.collage .file-card.wide .file-thumb { aspect-ratio: 4 / 3; }
@media (max-width: 1120px) { .file-grid.collage { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 780px) {
  .file-grid.collage { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .file-grid.collage .file-card.wide { grid-column: span 2; }
}
.file-grid.compact { grid-template-columns: repeat(auto-fill, minmax(142px, 1fr)); gap: 14px 12px; }
.file-grid.compact .file-card { transform: none !important; }
.file-grid.compact .file-body { padding: 5px 8px 6px; }
.file-grid.compact .file-meta > span:not(.file-item) { display: none; }
.file-card {
  position: relative; min-width: 0; border-radius: var(--radius-sm); overflow: hidden;
  background: var(--white-a12);
  box-shadow: 0 0 0 var(--hairline) var(--black-a4), 0 1px 2px var(--black-a3), 0 6px 16px var(--black-a3);
  transform: translate(var(--dx, 0), var(--dy, 0)) rotate(var(--tilt, 0deg));
  transition: transform var(--duration) var(--ease);
}
.file-card:hover { transform: none; z-index: 3; }
.file-card.on { box-shadow: 0 0 0 2px var(--accent), 0 6px 16px var(--black-a3); }
.file-hit {
  position: absolute; inset: 0; z-index: 1; border: 0; padding: 0; background: none;
  border-radius: inherit; cursor: pointer;
}
.file-thumb { aspect-ratio: 3 / 4; display: grid; place-items: center; overflow: hidden; background: #fff; }
.file-thumb svg, .file-thumb img { width: 100%; height: 100%; object-fit: cover; object-position: top center; display: block; }
.file-check-dot {
  position: absolute; z-index: 2; top: 9px; left: 9px; width: 18px; height: 18px;
  border-radius: 50%; background: color-mix(in srgb, var(--card) 92%, transparent);
  box-shadow: inset 0 0 0 1.4px var(--label-3); pointer-events: none;
}
.file-body {
  position: absolute; left: 0; right: 0; bottom: 0; display: grid; gap: 1px;
  padding: 7px 10px 8px; min-width: 0;
  background: color-mix(in srgb, var(--card) 94%, transparent);
  box-shadow: 0 calc(-1 * var(--hairline)) 0 var(--line); pointer-events: none;
}
.file-head { display: flex; align-items: center; justify-content: space-between; gap: 6px; min-width: 0; }
.file-body b, .file-row-text b {
  display: flex; align-items: center; gap: 5px; min-width: 0; font-weight: 600; line-height: 1.35; font-size: var(--fs-2);
}
.file-body b > span, .file-row-text b > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-meta {
  display: flex; align-items: center; gap: 6px; font-size: var(--fs-1);
  color: var(--label-2); font-variant-numeric: tabular-nums; min-width: 0;
}
.file-item { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--label); }
.file-meta .badge { height: 18px; padding: 0 6px; flex-shrink: 0; }
.file-rows {
  display: grid; border-radius: var(--radius-lg); background: var(--card);
  box-shadow: inset 0 0 0 var(--hairline) var(--line); overflow: hidden;
}
.file-row {
  position: relative; display: grid;
  grid-template-columns: 44px minmax(0, 1.6fr) minmax(0, 1fr) minmax(0, 1fr) 92px 44px 66px;
  align-items: center; gap: 14px; min-height: 60px; padding: 8px 14px; cursor: pointer;
}
.file-row + .file-row { box-shadow: inset 0 var(--hairline) 0 var(--line); }
.file-row:hover { background: var(--fill-2); }
.file-row.file-row-head { min-height: 0; padding: 8px 14px 6px; font-size: var(--fs-1); color: var(--label-3); cursor: default; }
.file-row.file-row-head:hover { background: none; }
.file-row-thumb { position: relative; width: 44px; height: 44px; display: grid; place-items: center; overflow: visible; }
.file-row-sheet {
  position: absolute; width: 30px; height: 36px; pointer-events: none;
  box-shadow: 0 0 0 var(--hairline) var(--black-a4), 0 1px 2px var(--black-a3);
  transition: transform var(--duration) var(--ease);
}
.file-row-sheet.s1 { z-index: 1; background: color-mix(in srgb, var(--white-a12) 92%, var(--gray-4)); transform: translate(3px, 1.5px) rotate(4deg); }
.file-row-sheet.s2 { z-index: 0; background: color-mix(in srgb, var(--white-a12) 84%, var(--gray-5)); transform: translate(-2.5px, 3px) rotate(-5deg); }
.file-row-paper {
  position: relative; z-index: 2; width: 30px; height: 36px; display: grid; place-items: center;
  background: var(--white-a12); box-shadow: 0 0 0 var(--hairline) var(--black-a4), 0 2px 6px var(--black-a3);
  overflow: hidden; transform: rotate(var(--row-tilt, -1.8deg)); transition: transform var(--duration) var(--ease);
}
.file-row:hover .file-row-paper { transform: none; }
.file-row-paper svg { width: 100%; height: 100%; }
.file-row-text { display: grid; gap: 2px; min-width: 0; }
.file-row-name, .file-row-pay { min-width: 0; font-size: var(--fs-1); color: var(--label-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-row-pay { display: flex; align-items: center; gap: 6px; }
.file-row-date, .file-row-type, .file-row-size { font-size: var(--fs-1); color: var(--label-2); font-variant-numeric: tabular-nums; }
.file-row-size { text-align: right; }

/* ---------------- Device AI App Buttons (.hw-app.clickable) ---------------- */
.hw-app.clickable {
  cursor: pointer; border: 1px solid transparent; background: var(--card);
  transition: transform var(--duration) var(--ease), border-color var(--duration) var(--ease), box-shadow var(--duration) var(--ease);
}
.hw-app.clickable:hover {
  transform: translateY(-1px); border-color: var(--ink);
  box-shadow: 0 2px 8px color-mix(in srgb, var(--black-a12) 10%, transparent);
}
.hw-app.add-app { font-weight: 700; color: var(--label-2); }
.hw-app.add-app:hover { color: var(--label); }

/* ---------------- Global Context-Aware AI Copilot (Floating FAB / Popover / Right Dock) ---------------- */
.proto { left: calc(var(--side-w) + 14px); right: auto; bottom: 14px; }
#app.collapsed .proto { left: 14px; }
#app.ai-docked .main { margin-right: 380px; }
.g-ai-fab {
  position: fixed; right: 20px; bottom: 20px; z-index: 60;
  display: inline-flex; align-items: center; gap: 9px; height: 42px; padding: 0 15px 0 10px;
  border-radius: var(--radius-pill); background: var(--ink); color: var(--on-ink);
  box-shadow: 0 8px 28px color-mix(in srgb, var(--black-a12) 22%, transparent), 0 0 0 var(--hairline) var(--line);
  font-size: var(--fs-2); font-weight: 600; cursor: pointer;
  transition: transform var(--duration) var(--ease), opacity var(--duration) var(--ease);
}
.g-ai-fab:hover { transform: translateY(-2px); }
.g-ai-fab img { width: 22px; height: 22px; border-radius: 50%; background: #fff; padding: 2px; object-fit: contain; }
.g-ai-fab .ctx-tag {
  font-size: 11px; font-weight: 500; padding: 2px 7px; border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, .16); max-width: 112px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.g-ai-panel {
  position: fixed; z-index: 65; display: flex; flex-direction: column;
  background: var(--card); color: var(--label);
  box-shadow: 0 20px 54px color-mix(in srgb, var(--black-a12) 22%, transparent), 0 0 0 var(--hairline) var(--line);
}
.g-ai-panel.float {
  right: 20px; bottom: 72px; width: min(410px, calc(100vw - 32px)); height: min(580px, calc(100dvh - 104px));
  border-radius: var(--radius-lg); overflow: hidden;
}
.g-ai-panel.dock {
  top: 0; right: 0; bottom: 0; width: 380px; border-radius: 0;
  box-shadow: calc(-1 * var(--hairline)) 0 0 var(--line), -8px 0 32px color-mix(in srgb, var(--black-a12) 8%, transparent);
}
.g-ai-hd {
  display: flex; align-items: center; gap: 8px; padding: 12px 14px;
  border-bottom: var(--hairline) solid var(--sep); background: var(--card);
}
.g-ai-hd-title { display: flex; align-items: center; gap: 7px; font-size: var(--fs-2); font-weight: 650; min-width: 0; }
.g-ai-hd-acts { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.g-ai-ctx {
  display: flex; align-items: center; gap: 6px; padding: 7px 14px;
  background: var(--fill-2); border-bottom: var(--hairline) solid var(--sep);
  font-size: var(--fs-1); color: var(--label-2);
}
.g-ai-ctx b { color: var(--label); font-weight: 600; }
.g-ai-model-row { position: relative; display: flex; align-items: center; gap: 6px; padding: 8px 14px; border-bottom: var(--hairline) solid var(--sep); }
.g-ai-model-btn {
  display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px;
  border-radius: var(--radius-pill); background: var(--fill-2); border: var(--hairline) solid var(--line);
  font-size: var(--fs-1); font-weight: 600; color: var(--label); cursor: pointer;
}
.g-ai-model-btn:hover { background: var(--fill); }
.g-ai-model-btn img { width: 14px; height: 14px; object-fit: contain; }
.g-ai-model-pop {
  position: absolute; left: 14px; top: 40px; z-index: 10; width: 230px; padding: 5px;
  border-radius: var(--radius-md); background: var(--card);
  box-shadow: 0 12px 32px color-mix(in srgb, var(--black-a12) 18%, transparent), 0 0 0 var(--hairline) var(--line);
}
.g-ai-model-opt {
  display: flex; align-items: center; gap: 8px; width: 100%; padding: 7px 9px;
  border-radius: var(--radius-sm); font-size: var(--fs-1); text-align: left; color: var(--label);
}
.g-ai-model-opt:hover, .g-ai-model-opt.on { background: var(--fill-2); }
.g-ai-model-opt img { width: 15px; height: 15px; object-fit: contain; flex-shrink: 0; }
.g-ai-model-opt small { margin-left: auto; color: var(--label-3); font-size: 11px; }
.g-ai-prompts {
  display: flex; flex-direction: column; gap: 6px; padding: 10px 14px;
  background: color-mix(in srgb, var(--fill-2) 55%, transparent); border-bottom: var(--hairline) solid var(--sep);
}
.g-ai-prompts-lbl { font-size: 11px; font-weight: 600; color: var(--label-3); display: flex; align-items: center; gap: 5px; }
.g-ai-prompt-chip {
  display: flex; align-items: center; gap: 6px; width: 100%; text-align: left;
  padding: 7px 10px; border-radius: var(--radius-md); background: var(--card);
  box-shadow: inset 0 0 0 var(--hairline) var(--line); font-size: var(--fs-1); color: var(--label);
  transition: background var(--duration) var(--ease);
}
.g-ai-prompt-chip:hover { background: var(--fill-2); }
.g-ai-msgs {
  flex: 1; overflow-y: auto; padding: 12px 14px; display: flex; flex-direction: column; gap: 10px;
}
.g-ai-msg-u {
  align-self: flex-end; max-width: 85%; padding: 8px 12px; border-radius: var(--radius-md);
  background: var(--ink); color: var(--on-ink); font-size: var(--fs-1); line-height: 1.5;
}
.g-ai-msg-b {
  align-self: flex-start; max-width: 96%; padding: 10px 12px; border-radius: var(--radius-md);
  background: var(--fill-2); font-size: var(--fs-1); line-height: 1.6; color: var(--label);
}
.g-ai-msg-b .meta { font-size: 10.5px; color: var(--label-3); margin-bottom: 4px; display: flex; align-items: center; gap: 5px; }
.g-ai-compose {
  display: flex; align-items: center; gap: 6px; padding: 10px 12px;
  border-top: var(--hairline) solid var(--sep); background: var(--card);
}
.g-ai-compose input {
  flex: 1; min-width: 0; height: 34px; padding: 0 12px; border-radius: var(--radius-pill);
  border: var(--hairline) solid var(--line); background: var(--fill-2); font-size: var(--fs-1); color: var(--label);
}
.g-ai-compose input:focus { outline: none; border-color: var(--ink); background: var(--card); }

/* ---------------- Plugins Marketplace (.plg-grid / .plg-card) ---------------- */
.plg-grid {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px;
}
@media (max-width: 1120px) { .plg-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 720px) { .plg-grid { grid-template-columns: 1fr; } }
.plg-card {
  display: flex; flex-direction: column; gap: 12px; padding: 18px;
  border-radius: var(--radius-lg); background: var(--card);
  box-shadow: inset 0 0 0 var(--hairline) var(--line);
  transition: background var(--duration) var(--ease);
}
.plg-card:hover { background: var(--card-2); }
.plg-hd { display: flex; align-items: flex-start; gap: 12px; }
.plg-ico {
  width: 38px; height: 38px; border-radius: var(--radius-md); flex-shrink: 0;
  display: grid; place-items: center; color: #fff; font-weight: 700; font-size: var(--fs-2);
}
.plg-title { min-width: 0; flex: 1; }
.plg-title b { display: block; font-size: var(--fs-2); font-weight: 650; }
.plg-title small { display: flex; align-items: center; gap: 6px; margin-top: 2px; color: var(--label-3); font-size: var(--fs-1); }
.plg-desc { margin: 0; font-size: var(--fs-1); line-height: 1.55; color: var(--label-2); min-height: 40px; }
.plg-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.plg-foot {
  margin-top: auto; padding-top: 10px; border-top: var(--hairline) solid var(--sep);
  display: flex; align-items: center; gap: 8px; font-size: var(--fs-1);
}

/* ---------------- Sidebar Top Alert Badge ---------------- */
.sb-qbtn { position: relative; }
.sb-qbadge {
  position: absolute; top: 3px; right: 4px; font-style: normal;
  min-width: 15px; height: 15px; padding: 0 4px; border-radius: 99px;
  background: var(--red-9); color: #fff; font-size: 9.5px; font-weight: 700;
  display: grid; place-items: center; line-height: 1;
}

/* ---------------- 4-Stage Identity-Centric Atlas (.topo-grid.atlas4) ---------------- */
.topo-grid.atlas4 {
  grid-template-columns: minmax(150px, 0.95fr) minmax(32px, 0.48fr) minmax(150px, 0.95fr) minmax(32px, 0.48fr) minmax(220px, 1.45fr) minmax(32px, 0.48fr) minmax(220px, 1.45fr);
  gap: 8px; align-items: center;
}
.topo-grid.atlas4 .topo-wire-lbl {
  font-size: 11px; white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis;
}
.topo-grid.atlas4 .topo-pill {
  padding: 7px 11px; gap: 7px; font-size: 12.5px; white-space: nowrap;
}
.topo-grid.atlas4 .topo-pill small {
  white-space: nowrap; flex-shrink: 0; font-size: 11.5px;
}
.topo-grid.atlas4 .topo-pill .text-ellipsis {
  min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.topo-id-orb {
  position: relative; width: 78px; height: 78px; border-radius: 50%;
  padding: 3px; cursor: pointer; background: var(--ring-c, var(--indigo-9));
  box-shadow: 0 0 28px color-mix(in srgb, var(--ring-c, #3e63dd) 45%, transparent);
  transition: transform var(--duration) var(--ease);
}
.topo-id-orb:hover { transform: scale(1.05); }
.topo-id-orb img, .topo-id-orb svg { width: 100%; height: 100%; border-radius: 50%; display: block; object-fit: cover; }
@media (max-width: 1240px) {
  .topo-grid.atlas4 { grid-template-columns: 1fr 1fr; gap: 20px; }
  .topo-grid.atlas4 .topo-wire { display: none; }
}
@media (max-width: 720px) {
  .topo-grid.atlas4 { grid-template-columns: 1fr; }
}

/* ---------------- 1:1 Calends Report CSS (.hero-card / .year-step / .dh / .treemap / .mv-wf / .insights) ---------------- */
.year-step {
  display: inline-flex; align-items: center; height: var(--ctl-h-md);
  border-radius: var(--radius-pill); background: var(--card);
  box-shadow: inset 0 0 0 var(--hairline) var(--line); overflow: hidden;
}
.year-step select {
  border: 0; background: none; color: var(--label); font: inherit; font-weight: 600;
  padding: 0 6px; height: 100%; cursor: pointer; outline: none;
}
.year-step-arrow {
  display: grid; place-items: center; width: 30px; height: 100%; padding: 0; border: 0;
  background: none; color: var(--label-3); cursor: pointer;
}
.year-step-arrow:hover { color: var(--label); background: var(--fill-2); }
.hero-card {
  display: grid; grid-template-columns: minmax(300px, 2fr) minmax(0, 3fr);
  gap: 28px; padding: 22px 24px 18px;
}
@media (max-width: 900px) { .hero-card { grid-template-columns: 1fr; gap: 18px; padding: 18px; } }
.hero-num { font-size: var(--fs-4); line-height: 1.05; margin: 10px 0; letter-spacing: -0.03em; }
.hero-delta { display: flex; align-items: center; gap: 8px; font-size: var(--fs-2); flex-wrap: wrap; color: var(--label-2); }
.hero-delta .up { color: var(--loss); font-weight: 650; }
.hero-delta .down { color: var(--gain); font-weight: 650; }
.hero-r { min-width: 0; display: flex; flex-direction: column; justify-content: flex-end; }
.rp-svg { width: 100%; display: block; overflow: visible; }
.rp-svg text { font-size: 10.5px; fill: var(--label-3); font-variant-numeric: tabular-nums; }
.cash-grid { display: flex; flex-direction: column; gap: 16px; }
.legend-inline { display: flex; align-items: center; gap: 14px; font-size: var(--fs-1); color: var(--label-2); }
.legend-inline span { display: inline-flex; align-items: center; gap: 6px; }
.legend-inline i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; }
.legend-dash { width: 14px !important; height: 0 !important; border-top: 2px dashed var(--label-2); background: none !important; }
.dh { width: 100%; overflow: hidden; }
.dh svg { display: block; width: 100%; }
.dh-label { font-size: var(--fs-1); fill: var(--label-3); }
.dh-day { --c: var(--fill-2); }
.dh-l1 { --c: color-mix(in oklab, var(--ink) 22%, var(--fill-2)); }
.dh-l2 { --c: color-mix(in oklab, var(--ink) 45%, var(--fill-2)); }
.dh-l3 { --c: color-mix(in oklab, var(--ink) 68%, var(--fill-2)); }
.dh-l4 { --c: color-mix(in oklab, var(--ink) 88%, var(--fill-2)); }
.dh-top { fill: var(--c); }
.dh-s1 { fill: color-mix(in oklab, var(--c) 80%, black); }
.dh-s2 { fill: color-mix(in oklab, var(--c) 62%, black); }
.dh-day.pending .dh-top { stroke: color-mix(in oklab, var(--c) 70%, var(--ink)); stroke-width: .7; fill-opacity: 0.45; }
.treemap { position: relative; border-radius: var(--radius-md); overflow: hidden; height: 340px; }
.tm-group { position: absolute; box-shadow: inset 0 0 0 var(--hairline) var(--card); overflow: hidden; }
.tm-head {
  position: absolute; inset: 0 0 auto; height: 22px; padding: 0 8px; border: 0;
  background: color-mix(in srgb, var(--black-a12) 16%, transparent); color: #fff;
  display: flex; align-items: center; gap: 8px; font-size: var(--fs-1); text-align: left; width: 100%; cursor: pointer;
}
.tm-head span { margin-left: auto; opacity: 0.9; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tm-cell {
  position: absolute; border: 0; padding: 4px; color: #fff; overflow: hidden;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  box-shadow: inset 0 0 0 var(--hairline) rgba(255,255,255,.18); cursor: pointer;
}
.tm-cell:hover { filter: brightness(1.08); }
.tm-cell b { font-size: var(--fs-1); font-weight: 650; text-shadow: 0 1px 2px rgba(0,0,0,.22); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.tm-cell span { font-size: 11px; opacity: .9; font-variant-numeric: tabular-nums; }
.mv-wf { position: relative; display: flex; gap: 6px; padding: 24px 0 10px; border-top: var(--hairline) solid var(--sep); margin-top: 12px; }
.mv-wf-ref { position: absolute; z-index: 0; top: calc(24px + 120px * var(--wf-ref)); left: 0; right: 0; border-top: var(--hairline) dashed var(--label-3); pointer-events: none; }
.mv-wf-col { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.mv-wf-plot { position: relative; z-index: 1; height: 120px; border-bottom: var(--hairline) solid var(--sep); }
.mv-wf-plot i { position: absolute; left: 18%; right: 18%; border-radius: var(--radius-sm) var(--radius-sm) 0 0; background: var(--ink); }
.mv-wf-col.up .mv-wf-plot i { background: var(--loss); border-radius: var(--radius-sm); }
.mv-wf-col.down .mv-wf-plot i { background: var(--gain); border-radius: var(--radius-sm); }
.mv-wf-plot b { position: absolute; left: 50%; transform: translate(-50%, -14px); font-size: 10.5px; font-weight: 600; white-space: nowrap; color: var(--label-2); }
.mv-wf-col.up b { color: var(--loss); } .mv-wf-col.down b { color: var(--gain); }
.mv-wf-col > span { font-size: var(--fs-1); color: var(--label-2); text-align: center; }
.wf-items { margin-top: 10px; border-top: var(--hairline) solid var(--sep); padding-top: 6px; }
.wf-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 6px 0; border: 0; background: none; text-align: left; font-size: var(--fs-2); cursor: pointer; }
.wf-item .wf-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wf-item em { font-style: normal; font-size: var(--fs-1); font-weight: 600; padding: 1px 6px; border-radius: var(--radius-sm); background: var(--fill-2); color: var(--label-2); }
.wf-item .wf-amount { flex-shrink: 0; white-space: nowrap; }
.insights { display: flex; flex-direction: column; }
.insight { display: flex; gap: 12px; padding: 10px 0; border-top: var(--hairline) solid var(--sep); align-items: flex-start; }
.insight:first-child { border-top: 0; padding-top: 0; }
.insight .dot { width: 8px; height: 8px; border-radius: 50%; margin-top: 6px; flex-shrink: 0; background: var(--indigo-9); }
.insight.warn .dot { background: var(--orange-9); }
.insight.good .dot { background: var(--green-9); }
.ins-t { font-size: var(--fs-2); font-weight: 600; line-height: 1.4; }
.ins-b { font-size: var(--fs-1); color: var(--label-2); margin-top: 2px; line-height: 1.5; }
.stop-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 18px; margin-top: 12px; }
@media (max-width: 720px) { .stop-list { grid-template-columns: 1fr; } }
.stop-row {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--radius-md);
  background: var(--fill-2); text-align: left; cursor: pointer; width: 100%;
}
.stop-row:hover { background: var(--fill); }

/* ---------------- TokenMate AI Market (.tm-hero / .tm-shopgrid / 9 Distinct Product Cards) ---------------- */
.tm-hero {
  border-radius: 16px; padding: 26px 28px; display: flex; align-items: center; gap: 20px;
  background: radial-gradient(90% 100% at 85% 20%, #26293a 0%, #14151a 60%, #0e0f12 100%);
  color: #f4f4f5; position: relative; overflow: hidden;
  box-shadow: 0 12px 32px rgba(0,0,0,.18);
}
.tm-eyebrow { font-size: 11px; letter-spacing: .08em; font-weight: 700; color: #a5b4fc; text-transform: uppercase; }
.tm-ht { font-size: 25px; font-weight: 700; letter-spacing: -0.02em; margin: 6px 0; }
.tm-hd { font-size: 13px; color: #a1a1aa; line-height: 1.6; max-width: 580px; }
.tm-feat { display: flex; flex-wrap: wrap; gap: 12px 18px; margin-top: 14px; font-size: 12px; color: #e4e4e7; }
.tm-feat span { display: inline-flex; align-items: center; gap: 6px; }
.tm-tiles { position: relative; width: 220px; height: 160px; flex-shrink: 0; margin-left: auto; }
@media (max-width: 960px) { .tm-tiles { display: none; } }
.tm-tile {
  position: absolute; width: 42px; height: 42px; border-radius: 12px; background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.14); display: grid; place-items: center;
  font-weight: 700; font-size: 12px; color: #fff; box-shadow: 0 8px 20px rgba(0,0,0,.35);
}
.tm-tile.big { width: 58px; height: 58px; border-radius: 16px; background: #18181c; border-color: rgba(143,155,255,.45); }
.tm-shopgrid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
@media (max-width: 1080px) { .tm-shopgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 700px) { .tm-shopgrid { grid-template-columns: 1fr; } }
.tm-card-base {
  border-radius: 14px; min-height: 220px; padding: 16px; display: flex; flex-direction: column;
  gap: 10px; position: relative; cursor: pointer; text-align: left; color: var(--label);
  transition: transform var(--duration) var(--ease), box-shadow var(--duration) var(--ease);
}
.tm-card-base:hover { transform: translateY(-2px); }
.tm-demo { font-family: var(--mono); font-size: 10px; color: #b45309; border: 1px dashed #e4c27a; border-radius: 4px; padding: 0 5px; white-space: nowrap; }
.tm-card-ai { border: 1px solid #e0e3f6; background: linear-gradient(180deg, #f7f8ff, #fff); }
.tm-card-ai:hover { box-shadow: 0 8px 24px rgba(79,95,230,.14); }
.tm-card-ai .bal { font-size: 34px; font-weight: 750; letter-spacing: -0.02em; color: #3f4bd1; line-height: 1; }
.tm-card-ai .bal small { font-size: 13px; font-weight: 500; color: var(--label-3); margin-left: 4px; }
.tm-card-ai .meter { height: 8px; border-radius: 99px; background: #e8eaf8; overflow: hidden; }
.tm-card-ai .meter i { display: block; height: 100%; width: 62%; background: linear-gradient(90deg, #7d8cff, #4f5fe6); border-radius: 99px; }
.tm-logos { display: flex; gap: 6px; }
.tm-logos span { width: 22px; height: 22px; border-radius: 6px; display: grid; place-items: center; color: #fff; font-size: 9px; font-weight: 700; }
.tm-card-vpn { border: 1px solid #cfe8dc; background: #f6fbf8; }
.tm-card-vpn:hover { box-shadow: 0 8px 24px rgba(28,143,99,.14); }
.tm-ringbox { display: flex; align-items: center; gap: 14px; }
.tm-ring {
  width: 62px; height: 62px; border-radius: 50%; flex-shrink: 0; position: relative;
  background: conic-gradient(#1c8f63 0 72%, #dceee6 72% 100%); display: grid; place-items: center;
}
.tm-ring::after { content: ""; position: absolute; inset: 7px; border-radius: 50%; background: #f6fbf8; }
.tm-ring b { position: relative; z-index: 1; font-size: 12.5px; color: #1c8f63; }
.tm-period { display: inline-flex; background: #fff; border: 1px solid #cfe8dc; border-radius: 8px; padding: 2px; gap: 2px; }
.tm-period button { padding: 2px 8px; border-radius: 6px; font-size: 11px; color: var(--label-3); }
.tm-period button.on { background: #1c8f63; color: #fff; }
.tm-protos { display: flex; gap: 5px; flex-wrap: wrap; }
.tm-protos em { font-style: normal; font-size: 10.5px; padding: 2px 7px; border-radius: 99px; background: #fff; border: 1px solid #cfe8dc; color: #1c8f63; font-family: var(--mono); }
.tm-card-claude { border: 1px solid #2a2a2f; background: linear-gradient(145deg, #141416, #1c1c20); color: #f2f2f3; overflow: hidden; }
.tm-card-claude::before { content: ""; position: absolute; right: -20px; top: -20px; width: 100px; height: 100px; border-radius: 50%; background: radial-gradient(circle, rgba(217,119,87,.35), transparent 70%); }
.tm-claude-badge { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 9px; border-radius: 99px; background: #d97757; color: #fff; font-size: 11px; font-weight: 600; width: fit-content; }
.tm-score { display: flex; gap: 10px; }
.tm-score div { flex: 1; background: rgba(255,255,255,.06); border: 1px solid #2a2a2f; border-radius: 10px; padding: 8px 10px; }
.tm-score .k { font-size: 10.5px; color: #a1a1a8; } .tm-score .v { font-size: 16px; font-weight: 700; color: #fff; margin-top: 2px; }
.tm-card-ip { border: 1px solid var(--line); background: #fff; }
.tm-card-ip:hover { box-shadow: 0 8px 24px rgba(217,119,26,.12); border-color: #f0d0a0; }
.tm-mapbg { height: 70px; border-radius: 10px; background: linear-gradient(135deg, #eef4ff, #f7f0e8); border: 1px dashed #e0d5c5; display: flex; align-items: center; justify-content: center; gap: 5px; position: relative; padding: 0 36px 0 10px; }
.tm-dice { position: absolute; right: 8px; top: 8px; width: 26px; height: 26px; border-radius: 8px; background: #fff; border: 1px solid var(--line); display: grid; place-items: center; font-size: 13px; }
.tm-ipmask { font-family: var(--mono); font-size: 12.5px; background: var(--fill-2); border-radius: 8px; padding: 6px 10px; color: var(--label-2); }
.tm-card-pc { border: 1px solid var(--line); background: #fff; padding: 0; overflow: hidden; }
.tm-card-pc .hdbar { display: flex; align-items: center; gap: 10px; padding: 12px 14px; background: #1a1a1e; color: #fff; }
.tm-card-pc .specs { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--sep); flex: 1; }
.tm-card-pc .specs div { background: #fff; padding: 9px 12px; font-size: 11.5px; }
.tm-card-pc .specs .k { color: var(--label-3); font-size: 10px; } .tm-card-pc .specs .v { font-weight: 600; margin-top: 2px; }
.tm-card-pc .foot { display: flex; align-items: center; gap: 6px; padding: 10px 14px; border-top: var(--hairline) solid var(--sep); }
.tm-card-gift { border: none; padding: 0; background: linear-gradient(135deg, #10a37f, #0b7a5f); color: #fff; overflow: hidden; }
.tm-card-gift .perforation { position: relative; height: 0; border-top: 2px dashed rgba(255,255,255,.35); margin: 4px 0; }
.tm-card-gift .perforation::before, .tm-card-gift .perforation::after { content: ""; position: absolute; width: 16px; height: 16px; border-radius: 50%; background: var(--bg); top: -9px; }
.tm-card-gift .perforation::before { left: -8px; } .tm-card-gift .perforation::after { right: -8px; }
.tm-card-gift .top { padding: 16px 16px 10px; } .tm-card-gift .bot { padding: 12px 16px 14px; margin-top: auto; }
.tm-card-ticket { border: 1.5px dashed #5ab0ff; background: linear-gradient(90deg, #f0f7ff, #fff); }
.tm-ticket-badge { position: absolute; right: 0; top: 14px; background: #2f7de1; color: #fff; font-size: 10px; font-weight: 700; padding: 3px 8px; border-radius: 4px 0 0 4px; }
.tm-card-ticket .gb { font-size: 28px; font-weight: 750; color: #2f7de1; }
.tm-card-team { border: 1px solid #e8d0da; background: linear-gradient(180deg, #fdf6f8, #fff); }
.tm-seats { display: flex; align-items: center; margin: 4px 0; }
.tm-seats .av { border: 2px solid #fff; margin-left: -8px; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; font-weight: 700; color: #fff; background: #1e293b; }
.tm-seats .av:first-child { margin-left: 0; }
.tm-seats .more { width: 30px; height: 30px; border-radius: 50%; background: #a0607a; color: #fff; display: grid; place-items: center; font-size: 11px; font-weight: 700; margin-left: -8px; border: 2px solid #fff; }
.tm-card-team .pool { background: #f8eef2; border-radius: 10px; padding: 8px 12px; font-size: 12px; }
.tm-card-addon { border: 1px solid var(--line); background: #fffef8; }
.tm-attach { display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 10px; border-radius: 99px; background: #fff7e0; border: 1px solid #e9d090; color: #b88412; font-size: 11.5px; font-weight: 600; width: fit-content; }
.tm-plus-badge { position: absolute; right: 14px; top: 14px; width: 34px; height: 34px; border-radius: 50%; background: linear-gradient(135deg, #e9b949, #b88412); color: #fff; display: grid; place-items: center; font-size: 18px; font-weight: 700; }
.tm-bars { display: flex; gap: 3px; width: 110px; }
.tm-bars i { flex: 1; height: 5px; border-radius: 3px; background: var(--fill); display: block; }
.tm-bars i.f { background: var(--ink); }
.dark .tm-card-ai, .dark .tm-card-vpn, .dark .tm-card-ip, .dark .tm-card-pc, .dark .tm-card-pc .specs div, .dark .tm-card-ticket, .dark .tm-card-team, .dark .tm-card-addon {
  background: var(--card); border-color: var(--line); color: var(--label);
}

/* ---------------- Reviews & Recommendations Hub (.rev-*) ---------------- */
.rev-banner {
  border-radius: 16px; padding: 20px 24px; background: var(--card);
  box-shadow: inset 0 0 0 var(--hairline) var(--line);
  display: flex; align-items: center; gap: 20px; flex-wrap: wrap;
}
.rev-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
@media (max-width: 1080px) { .rev-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 700px) { .rev-grid { grid-template-columns: 1fr; } }
.rev-card {
  display: flex; flex-direction: column; gap: 10px; padding: 18px;
  border-radius: var(--radius-lg); background: var(--card);
  box-shadow: inset 0 0 0 var(--hairline) var(--line);
  cursor: pointer; transition: background var(--duration) var(--ease), transform var(--duration) var(--ease);
}
.rev-card:hover { background: var(--card-2); transform: translateY(-2px); }
.rev-hd { display: flex; align-items: center; gap: 10px; }
.rev-score {
  margin-left: auto; display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 9px; border-radius: var(--radius-pill);
  background: color-mix(in srgb, var(--amber) 14%, transparent);
  color: var(--amber); font-size: var(--fs-1); font-weight: 700; font-variant-numeric: tabular-nums;
}
.rev-metrics {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px;
  padding: 10px 12px; border-radius: var(--radius-md); background: var(--fill-2);
}
.rev-metrics span { display: block; font-size: 11px; color: var(--label-3); }
.rev-metrics b { display: block; font-size: 13px; font-weight: 650; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rev-link-float {
  display: flex; align-items: center; gap: 10px; padding: 11px 14px;
  border-radius: var(--radius-md); background: var(--fill-2);
  border: var(--hairline) solid var(--line); cursor: pointer; text-decoration: none; color: inherit;
  transition: border-color var(--duration) var(--ease), background var(--duration) var(--ease);
}
.rev-link-float:hover { background: var(--fill); border-color: var(--ink); }
.rev-pros { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 600px) { .rev-pros { grid-template-columns: 1fr; } }
.rev-probox { padding: 12px; border-radius: var(--radius-md); background: var(--fill-2); font-size: var(--fs-1); line-height: 1.6; }
.rev-probox h4 { margin: 0 0 6px; font-size: 12px; font-weight: 700; }

/* ---------------- BYOK LLM Providers Settings (.byok-*) ---------------- */
.byok-hero {
  display: flex; align-items: center; gap: 14px; padding: 14px 16px;
  background: linear-gradient(135deg, #14151a, #1f2433); color: #f4f4f5;
  border-bottom: var(--hairline) solid var(--sep);
}
.byok-hero small { display: block; color: #a1a1aa; font-size: var(--fs-1); margin-top: 2px; }
.byok-grid {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; padding: 12px 14px;
  border-bottom: var(--hairline) solid var(--sep); background: var(--fill-2);
}
@media (max-width: 720px) { .byok-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.byok-tile {
  display: flex; align-items: center; gap: 8px; padding: 9px 10px; border-radius: var(--radius-md);
  background: var(--card); box-shadow: inset 0 0 0 var(--hairline) var(--line);
  cursor: pointer; text-align: left; font-size: var(--fs-1); font-weight: 600;
  transition: border-color var(--duration) var(--ease), background var(--duration) var(--ease);
}
.byok-tile:hover { background: var(--card-2); box-shadow: inset 0 0 0 var(--hairline) var(--ink); }
.byok-tile img { width: 18px; height: 18px; object-fit: contain; flex-shrink: 0; }
.byok-tile .dot { margin-left: auto; flex-shrink: 0; }
.byok-row {
  display: flex; align-items: center; gap: 12px; padding: 12px 16px;
  border-top: var(--hairline) solid var(--sep); cursor: pointer;
}
.byok-row:hover { background: var(--fill-2); }
.byok-row .byok-ico {
  width: 34px; height: 34px; border-radius: var(--radius-sm); background: var(--fill-2);
  display: grid; place-items: center; flex-shrink: 0; border: var(--hairline) solid var(--line);
}
.byok-row .byok-ico img { width: 20px; height: 20px; object-fit: contain; }
.byok-row .byok-info { flex: 1; min-width: 0; }
.byok-row .byok-info b { font-size: var(--fs-2); display: inline-flex; align-items: center; gap: 6px; }
.byok-row .byok-info small { display: block; color: var(--label-3); font-size: var(--fs-1); font-family: var(--mono); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.as-model-sel {
  border: 0; background: var(--fill-2); border-radius: var(--radius-pill);
  padding: 2px 10px; font-size: var(--fs-1); font-weight: 600; color: var(--label-2); cursor: pointer;
}




