:root {
  --navy-950: #0b1221;
  --navy-900: #111a2e;
  --navy-800: #18243d;
  --ink: #172033;
  --muted: #748097;
  --line: #e5e9f0;
  --surface: #ffffff;
  --canvas: #f4f6fa;
  --emerald: #18a779;
  --emerald-soft: #e7f7f1;
  --orange: #ee8d42;
  --orange-soft: #fff3e8;
  --coral: #ea665f;
  --coral-soft: #fff0ee;
  --violet: #7067d9;
  --violet-soft: #f0effd;
  --blue: #3677e8;
  --blue-soft: #eaf1ff;
  --shadow: 0 18px 45px rgba(26, 39, 65, .08);
  --shadow-soft: 0 8px 28px rgba(26, 39, 65, .07);
  --radius-xl: 24px;
  --radius-lg: 18px;
  --radius-md: 14px;
  --sidebar-width: 248px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--ink);
  background: var(--canvas);
  font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* 整体显示比例：全站等比放大（等于浏览器 115% 缩放），字号偏小时只调这一行。
   注意：zoom 不影响 vh/vw 单位，改此值后需同步更新 .contract-picker / .contract-picker-list / dialog 里的 / 1.15。 */
body { zoom: 1.15; }

button, input { font: inherit; }
button { color: inherit; }
a { color: inherit; text-decoration: none; }

.app-shell { min-height: 100vh; }

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sidebar-width);
  padding: 28px 20px 22px;
  background:
    radial-gradient(circle at 15% 0%, rgba(112, 103, 217, .22), transparent 32%),
    linear-gradient(180deg, var(--navy-900), var(--navy-950));
  color: #fff;
  display: flex;
  flex-direction: column;
  z-index: 30;
}

.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand strong { display: block; font-size: 17px; letter-spacing: .02em; }
.brand small { display: block; margin-top: 2px; color: rgba(255,255,255,.46); font-size: 10px; letter-spacing: .14em; text-transform: uppercase; }
.brand-mark { width: 38px; height: 38px; position: relative; display: inline-flex; align-items: center; justify-content: center; border-radius: 12px; background: rgba(255,255,255,.08); overflow: hidden; }
.brand-mark span { position: absolute; width: 17px; height: 7px; border: 2px solid #9f97ff; border-radius: 5px; transform: rotate(-32deg); }
.brand-mark span:nth-child(1) { top: 9px; left: 8px; }
.brand-mark span:nth-child(2) { top: 16px; left: 11px; border-color: #54d6ae; }
.brand-mark span:nth-child(3) { top: 23px; left: 14px; border-color: #f2ad6d; }

.nav-list { display: grid; gap: 8px; margin-top: 44px; }
.nav-item {
  width: 100%;
  border: 0;
  border-radius: 13px;
  padding: 12px 13px;
  display: grid;
  grid-template-columns: 24px 1fr auto;
  align-items: center;
  gap: 10px;
  background: transparent;
  color: rgba(255,255,255,.62);
  cursor: pointer;
  text-align: left;
  transition: .2s ease;
}
.nav-item:hover { color: #fff; background: rgba(255,255,255,.055); }
.nav-item.is-active { color: #fff; background: rgba(255,255,255,.11); box-shadow: inset 3px 0 0 #67d6b3; }
.nav-icon { font-size: 18px; opacity: .9; }
.nav-count { min-width: 24px; padding: 3px 7px; border-radius: 99px; color: #c9c5ff; background: rgba(112,103,217,.18); font-size: 11px; text-align: center; }
.nav-count-alert { color: #ffb7ad; background: rgba(234,102,95,.17); }

.sidebar-note { margin-top: auto; border: 1px solid rgba(255,255,255,.08); border-radius: 15px; padding: 14px; display: grid; grid-template-columns: 8px 1fr; gap: 10px; background: rgba(255,255,255,.045); }
.sidebar-note p { margin: 0; color: rgba(255,255,255,.58); font-size: 11px; line-height: 1.65; }
.sidebar-note strong { color: rgba(255,255,255,.88); font-size: 12px; }
.pulse-dot { width: 8px; height: 8px; margin-top: 4px; border-radius: 50%; background: #54d6ae; box-shadow: 0 0 0 5px rgba(84,214,174,.12); }
.sidebar-footer { display: flex; justify-content: space-between; align-items: center; margin-top: 18px; color: rgba(255,255,255,.42); font-size: 10px; }
.sidebar-footer strong { color: rgba(255,255,255,.72); font-weight: 600; }

.mobile-header { display: none; }
.bottom-nav { display: none; }

.main-content { margin-left: var(--sidebar-width); padding: 38px clamp(28px, 4vw, 60px) 64px; min-height: 100vh; }
.view { display: none; animation: fadeUp .35s ease; }
.view.is-active { display: block; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 24px; }
.page-heading h1 { margin: 4px 0 8px; font-size: clamp(28px, 3.2vw, 42px); line-height: 1.14; letter-spacing: -.035em; }
.page-lead { max-width: 640px; margin: 0; color: var(--muted); font-size: 14px; line-height: 1.75; }
.eyebrow, .panel-kicker { margin: 0; color: var(--violet); font-size: 10px; font-weight: 800; letter-spacing: .18em; }
.compact-heading { align-items: center; }
.compact-heading h1 { font-size: 32px; }
.heading-actions { display: flex; gap: 10px; align-items: center; }

.search-box { height: 44px; min-width: 280px; padding: 0 14px; border: 1px solid var(--line); border-radius: 14px; display: flex; align-items: center; gap: 9px; color: #9aa3b4; background: rgba(255,255,255,.86); box-shadow: 0 5px 20px rgba(26,39,65,.03); }
.search-box input { width: 100%; border: 0; outline: 0; color: var(--ink); background: transparent; font-size: 13px; }
.search-box input::placeholder { color: #abb3c1; }
.secondary-button { height: 44px; padding: 0 16px; border: 1px solid var(--line); border-radius: 14px; background: #fff; cursor: pointer; font-size: 12px; font-weight: 700; box-shadow: var(--shadow-soft); }
.secondary-button:hover { transform: translateY(-1px); }

.data-banner { margin: 20px 0 20px; padding: 13px 16px; display: flex; justify-content: space-between; gap: 18px; align-items: center; border: 1px solid #dfe3fb; border-radius: 15px; background: linear-gradient(110deg, #f6f5ff, #fff); }
.data-banner > div { display: flex; align-items: flex-start; gap: 12px; }
.banner-icon { flex: 0 0 24px; width: 24px; height: 24px; display: grid; place-items: center; border-radius: 50%; color: #fff; background: var(--violet); font-size: 12px; font-weight: 800; }
.data-banner p { margin: 0; color: #69738a; font-size: 11px; line-height: 1.55; }
.data-banner p strong { color: #3f4861; }
.data-banner button { border: 0; background: transparent; color: var(--violet); font-size: 11px; font-weight: 800; white-space: nowrap; cursor: pointer; }

.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 16px; margin-bottom: 18px; }
.metric-card { position: relative; overflow: hidden; min-height: 142px; padding: 20px; border: 1px solid rgba(226,230,238,.85); border-radius: var(--radius-lg); background: rgba(255,255,255,.92); box-shadow: var(--shadow-soft); }
.metric-card::after { content: ""; position: absolute; width: 90px; height: 90px; right: -28px; bottom: -38px; border-radius: 50%; background: var(--tint, var(--violet-soft)); opacity: .75; }
.metric-label { display: flex; justify-content: space-between; align-items: center; color: var(--muted); font-size: 11px; font-weight: 700; }
.metric-icon { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 10px; color: var(--accent, var(--violet)); background: var(--tint, var(--violet-soft)); font-size: 13px; }
.metric-value { display: block; margin-top: 16px; font-size: clamp(23px, 2.2vw, 31px); letter-spacing: -.04em; }
.metric-foot { display: flex; align-items: center; gap: 7px; margin-top: 8px; color: #9099aa; font-size: 10px; }
.metric-foot .metric-accent { color: var(--accent, var(--violet)); font-weight: 800; }

.overview-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(320px, .65fr); gap: 18px; margin-bottom: 18px; }
.panel { border: 1px solid rgba(226,230,238,.9); border-radius: var(--radius-xl); background: rgba(255,255,255,.94); box-shadow: var(--shadow); }
.focus-panel, .progress-panel, .contract-spotlight { padding: 22px; }
.panel-heading { display: flex; justify-content: space-between; align-items: center; gap: 14px; margin-bottom: 18px; }
.panel-heading h2 { margin: 5px 0 0; font-size: 17px; letter-spacing: -.02em; }
.text-button { border: 0; background: transparent; color: var(--muted); font-size: 11px; font-weight: 700; cursor: pointer; }
.text-button span { color: var(--violet); margin-left: 4px; }
.status-chip { padding: 6px 9px; border-radius: 99px; font-size: 9px; font-weight: 800; letter-spacing: .02em; }
.status-chip.neutral { color: #737d90; background: #f1f3f7; }

.attention-list { display: grid; gap: 8px; }
.attention-item { width: 100%; padding: 12px; border: 1px solid transparent; border-radius: 13px; display: grid; grid-template-columns: 34px 1fr auto; align-items: center; gap: 11px; text-align: left; background: #f8f9fb; cursor: pointer; transition: .18s ease; }
.attention-item:hover { border-color: #dedbf9; background: #fbfaff; transform: translateX(2px); }
.attention-rank { width: 36px; min-height: 32px; padding: 5px 3px; display: grid; place-items: center; border-radius: 10px; color: var(--violet); background: var(--violet-soft); font-size: 8px; line-height: 1.1; font-weight: 900; text-align: center; }
.attention-copy strong { display: block; max-width: 410px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.attention-copy span { display: block; margin-top: 4px; color: var(--muted); font-size: 10px; }
.attention-amount { text-align: right; }
.attention-amount strong { display: block; font-size: 12px; }
.attention-amount span { display: block; max-width: 175px; margin-top: 4px; color: var(--orange); font-size: 9px; line-height: 1.35; font-weight: 800; }
.due-tone.overdue { color: var(--coral); }
.due-tone.soon { color: var(--orange); }
.due-tone.scheduled, .due-tone.done { color: var(--emerald); }
.due-tone.review { color: var(--violet); }

.donut-wrap { min-height: 178px; display: flex; align-items: center; justify-content: center; gap: 28px; }
.donut { width: 132px; height: 132px; flex: 0 0 auto; padding: 12px; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(var(--emerald) 0deg, var(--emerald) var(--donut-angle, 0deg), #eef1f5 var(--donut-angle, 0deg)); }
.donut::before { content: ""; grid-area: 1/1; width: 100%; height: 100%; border-radius: 50%; background: #fff; }
.donut > div { position: relative; grid-area: 1/1; text-align: center; }
.donut strong { display: block; font-size: 25px; letter-spacing: -.04em; }
.donut span { display: block; margin-top: 2px; color: var(--muted); font-size: 9px; }
.legend-stack { display: grid; gap: 13px; }
.legend-row { display: grid; grid-template-columns: 8px 1fr auto; align-items: center; gap: 8px; min-width: 136px; color: var(--muted); font-size: 10px; }
.legend-row i { width: 7px; height: 7px; border-radius: 50%; }
.legend-row strong { color: var(--ink); font-size: 11px; }
.mini-stat-row { margin-top: 10px; padding-top: 14px; border-top: 1px solid var(--line); display: grid; grid-template-columns: repeat(2,1fr); }
.mini-stat { padding: 0 8px; }
.mini-stat + .mini-stat { border-left: 1px solid var(--line); padding-left: 18px; }
.mini-stat span { color: var(--muted); font-size: 9px; }
.mini-stat strong { display: block; margin-top: 4px; font-size: 14px; }

.contract-spotlight { min-height: 260px; }
.segmented-control { padding: 3px; border-radius: 11px; display: flex; background: #f0f2f6; }
.segmented-control button { padding: 7px 12px; border: 0; border-radius: 9px; background: transparent; color: var(--muted); font-size: 10px; font-weight: 800; cursor: pointer; }
.segmented-control button.is-active { background: #fff; color: var(--ink); box-shadow: 0 4px 12px rgba(31,43,65,.07); }
.contract-card-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 12px; }
.contract-card { padding: 15px; border: 1px solid var(--line); border-radius: 15px; background: #fff; cursor: pointer; transition: .2s ease; }
.contract-card:hover { border-color: #cbc7f3; box-shadow: 0 10px 25px rgba(50,57,85,.08); transform: translateY(-2px); }
.contract-card-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.contract-card h3 { margin: 0; font-size: 12px; line-height: 1.4; }
.contract-card p { margin: 4px 0 0; color: var(--muted); font-size: 9px; }
.contract-date-row { margin-top: 13px; padding: 10px 0; display: grid; grid-template-columns: .75fr 1.25fr; gap: 10px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.contract-date-row span { min-width: 0; }
.contract-date-row small { display: block; color: #9aa3b4; font-size: 8px; }
.contract-date-row b { display: block; margin-top: 3px; overflow: hidden; color: var(--ink); font-size: 9px; font-weight: 800; text-overflow: ellipsis; white-space: nowrap; }
.contract-date-row b.review { color: var(--violet); }
.contract-date-row b.overdue { color: var(--coral); }
.contract-date-row b.soon { color: var(--orange); }
.contract-date-row b.scheduled, .contract-date-row b.done { color: var(--emerald); }
.direction-tag { padding: 5px 7px; border-radius: 8px; color: var(--blue); background: var(--blue-soft); font-size: 9px; font-weight: 800; white-space: nowrap; }
.direction-tag.payable { color: var(--orange); background: var(--orange-soft); }
.contract-progress { height: 6px; margin: 14px 0 8px; border-radius: 99px; overflow: hidden; background: #edf0f4; }
.contract-progress span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--violet), #9a8ff2); }
.contract-card-foot { display: flex; justify-content: space-between; color: var(--muted); font-size: 9px; }
.contract-card-foot strong { color: var(--ink); font-size: 10px; }

.relationship-layout { display: grid; grid-template-columns: 250px minmax(0,1fr); gap: 16px; align-items: start; }
.contract-picker { position: sticky; top: 20px; max-height: calc(100vh / 1.15 - 40px); overflow: hidden; }
.picker-tabs { padding: 8px; display: grid; grid-template-columns: 1fr 1fr; gap: 5px; border-bottom: 1px solid var(--line); }
.picker-tabs button { padding: 9px; border: 0; border-radius: 10px; background: transparent; color: var(--muted); font-size: 10px; font-weight: 800; cursor: pointer; }
.picker-tabs button.is-active { color: var(--ink); background: #f1f2f7; }
.contract-picker-list { max-height: calc(100vh / 1.15 - 110px); overflow: auto; padding: 8px; scrollbar-width: thin; }
.picker-item { width: 100%; margin: 0 0 5px; padding: 12px; border: 1px solid transparent; border-radius: 12px; background: transparent; text-align: left; cursor: pointer; }
.picker-item:hover { background: #f8f9fb; }
.picker-item.is-active { border-color: #dedbf9; background: #f7f6ff; }
.picker-item strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; }
.picker-item span { display: flex; justify-content: space-between; gap: 8px; margin-top: 6px; color: var(--muted); font-size: 9px; }
.picker-item span b { max-width: 135px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.picker-item em { color: var(--orange); font-style: normal; font-weight: 800; }

.relationship-panel { overflow: hidden; }
.relationship-header { padding: 22px 24px 18px; border-bottom: 1px solid var(--line); background: linear-gradient(135deg, #fff, #fafaff); }
.relationship-title-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 18px; }
.relationship-title-row h2 { margin: 0; font-size: 19px; letter-spacing: -.025em; }
.relationship-title-row p { margin: 5px 0 0; color: var(--muted); font-size: 10px; }
.source-link { padding: 9px 11px; border: 1px solid #dedbf9; border-radius: 10px; color: var(--violet); background: #fff; font-size: 9px; font-weight: 800; }
.relationship-stats { margin-top: 17px; display: grid; grid-template-columns: repeat(4,1fr); gap: 10px; }
.relationship-stat { padding: 10px 12px; border-radius: 12px; background: #f5f6f9; }
.relationship-stat span { display: block; color: var(--muted); font-size: 8px; }
.relationship-stat strong { display: block; margin-top: 4px; font-size: 12px; }
.contract-timebar { margin-top: 13px; padding: 13px; display: grid; grid-template-columns: minmax(0,1fr) 24px minmax(0,1.25fr) 24px minmax(0,1fr); gap: 8px; align-items: stretch; border: 1px solid #e6e3fa; border-radius: 15px; background: linear-gradient(110deg, #f8f7ff, #fff); }
.time-card { position: relative; min-width: 0; padding: 9px 10px; border-radius: 11px; background: rgba(255,255,255,.72); }
.time-card.emphasis { border: 1px solid #ded9ff; background: #fff; box-shadow: 0 7px 18px rgba(86,74,175,.08); }
.time-card > span { display: block; color: var(--muted); font-size: 8px; font-weight: 700; }
.time-card > strong { display: block; margin-top: 5px; overflow: hidden; font-size: 11px; line-height: 1.35; text-overflow: ellipsis; white-space: nowrap; }
.time-card > small { display: block; margin-top: 4px; color: #8b95a7; font-size: 8px; line-height: 1.35; }
.time-arrow { display: grid; place-items: center; color: #b2addf; font-size: 15px; }
.time-status { position: absolute; top: 7px; right: 7px; padding: 3px 5px; border-radius: 6px; color: var(--violet); background: var(--violet-soft); font-size: 7px; font-style: normal; font-weight: 900; }
.time-status.done, .time-status.scheduled { color: var(--emerald); background: var(--emerald-soft); }
.time-status.soon { color: var(--orange); background: var(--orange-soft); }
.time-status.overdue { color: var(--coral); background: var(--coral-soft); }
.relationship-note { margin: 12px 0 0; padding: 9px 11px; border-radius: 10px; color: #7c5d42; background: var(--orange-soft); font-size: 9px; line-height: 1.55; }
.graph-legend { padding: 10px 24px; display: flex; gap: 18px; align-items: center; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 9px; }
.legend-dot { display: inline-block; width: 7px; height: 7px; margin-right: 5px; border-radius: 50%; }
.legend-dot.invoiced { background: var(--emerald); }
.legend-dot.unbilled { background: var(--orange); }
.legend-dot.scheduled { background: var(--blue); }
.legend-dot.review { background: var(--violet); }

.desktop-graph { position: relative; min-height: 540px; overflow: auto; background: #f8f9fb; }
.graph-canvas { position: relative; min-width: 1120px; }
.graph-lines { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; }
.graph-lines path { fill: none; stroke: #d9dde6; stroke-width: 1.5; }
.graph-lines path.active { stroke: rgba(24,167,121,.45); }
.graph-node { position: absolute; z-index: 2; border: 1px solid var(--line); border-radius: 14px; background: #fff; box-shadow: 0 9px 24px rgba(31,43,65,.07); }
.root-node { width: 175px; padding: 15px; border-color: #d9d5fb; background: linear-gradient(145deg, #fff, #f7f6ff); }
.root-node .node-eyebrow { color: var(--violet); }
.project-node { width: 220px; min-height: 68px; padding: 12px 13px; cursor: pointer; transition: .18s ease; }
.project-node:hover { transform: translateY(-2px); box-shadow: 0 14px 28px rgba(31,43,65,.1); }
.project-node.is-invoiced { border-left: 4px solid var(--emerald); background: linear-gradient(90deg, var(--emerald-soft), #fff 28%); }
.project-node.is-unbilled { border-left: 4px solid var(--orange); background: linear-gradient(90deg, var(--orange-soft), #fff 28%); }
.project-node.is-review { border-left: 4px solid var(--violet); background: linear-gradient(90deg, var(--violet-soft), #fff 28%); }
.invoice-node, .collection-node, .settlement-node { width: 175px; min-height: 72px; padding: 13px; }
.invoice-node { border-color: #cfe8de; }
.collection-node { border-color: #cfdbf7; background: linear-gradient(145deg, #fff, #f4f7ff); }
.collection-node.is-review { border-color: #dcd7fa; background: linear-gradient(145deg, #fff, #f7f5ff); }
.collection-node.is-overdue { border-color: #f1c6c2; background: linear-gradient(145deg, #fff, #fff5f4); }
.collection-node.is-done, .collection-node.is-scheduled { border-color: #cfe8de; background: linear-gradient(145deg, #fff, #f1fbf7); }
.settlement-node { border-color: #d8e3fa; }
.settlement-node.is-empty { border-style: dashed; background: #fafbfc; }
.node-eyebrow { display: block; margin-bottom: 6px; color: var(--muted); font-size: 8px; font-weight: 900; letter-spacing: .12em; text-transform: uppercase; }
.graph-node strong { display: block; font-size: 11px; line-height: 1.45; }
.graph-node p { margin: 4px 0 0; color: var(--muted); font-size: 9px; line-height: 1.45; }
.node-date { margin-top: 7px; padding: 5px 7px; border-radius: 7px; color: #645aa9; background: var(--violet-soft); font-size: 8px; font-weight: 800; }
.node-amount { margin-top: 7px; display: flex; justify-content: space-between; gap: 8px; color: var(--muted); font-size: 8px; }
.node-amount b { color: var(--ink); font-size: 10px; }
.node-status { display: inline-flex; align-items: center; gap: 4px; margin-top: 7px; padding: 4px 6px; border-radius: 7px; color: var(--emerald); background: var(--emerald-soft); font-size: 8px; font-weight: 800; }
.node-status.unbilled { color: var(--orange); background: var(--orange-soft); }
.node-status.review { color: var(--violet); background: var(--violet-soft); }

.mobile-flow { display: none; }
.mobile-section { padding: 16px; border-bottom: 1px solid var(--line); }
.mobile-section:last-child { border-bottom: 0; }
.mobile-section-title { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.mobile-section-title h3 { margin: 0; font-size: 12px; }
.mobile-section-title span { color: var(--muted); font-size: 9px; }
.mobile-project-list { display: grid; gap: 8px; }
.mobile-project { padding: 12px; border-radius: 12px; border: 1px solid var(--line); background: #fff; }
.mobile-project.is-invoiced { border-left: 4px solid var(--emerald); }
.mobile-project.is-unbilled { border-left: 4px solid var(--orange); }
.mobile-project.is-review { border-left: 4px solid var(--violet); }
.mobile-project-head { display: flex; justify-content: space-between; gap: 12px; }
.mobile-project strong { font-size: 11px; line-height: 1.45; }
.mobile-project em { color: var(--ink); font-size: 10px; font-style: normal; font-weight: 800; white-space: nowrap; }
.mobile-project p { margin: 5px 0 0; color: var(--muted); font-size: 9px; }
.mobile-date-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 8px; }
.mobile-date-grid > div { min-width: 0; padding: 11px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.mobile-date-grid > div.emphasis { border-color: #ded9ff; background: #f8f7ff; }
.mobile-date-grid span { display: block; color: var(--muted); font-size: 8px; }
.mobile-date-grid strong { display: block; margin-top: 4px; font-size: 10px; line-height: 1.4; }
.mobile-date-grid small { display: block; margin-top: 4px; color: var(--muted); font-size: 8px; line-height: 1.4; }
.mobile-timeline { display: grid; gap: 0; }
.timeline-item { position: relative; margin-left: 8px; padding: 0 0 18px 22px; border-left: 1px solid #dfe3eb; }
.timeline-item:last-child { border-left-color: transparent; }
.timeline-item::before { content: ""; position: absolute; left: -5px; top: 3px; width: 9px; height: 9px; border: 2px solid #fff; border-radius: 50%; background: var(--emerald); box-shadow: 0 0 0 2px rgba(24,167,121,.18); }
.timeline-item.review::before { background: var(--violet); box-shadow: 0 0 0 2px rgba(112,103,217,.18); }
.timeline-item strong { display: block; font-size: 10px; }
.timeline-item p { margin: 4px 0 0; color: var(--muted); font-size: 9px; }

.review-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 15px; }
.review-summary { margin-bottom: 16px; }
.review-summary-card { padding: 20px; border-radius: var(--radius-lg); color: #fff; background: linear-gradient(120deg, var(--navy-900), #263553); box-shadow: var(--shadow); }
.review-summary-card span { color: rgba(255,255,255,.62); font-size: 10px; font-weight: 800; letter-spacing: .08em; }
.review-summary-card strong { display: block; margin-top: 6px; font-size: 26px; }
.review-summary-card p { margin: 5px 0 0; color: rgba(255,255,255,.58); font-size: 10px; }
.review-card { padding: 20px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: #fff; box-shadow: var(--shadow-soft); }
.review-card-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.review-type { padding: 5px 8px; border-radius: 8px; color: var(--orange); background: var(--orange-soft); font-size: 9px; font-weight: 900; }
.review-type.danger { color: var(--coral); background: var(--coral-soft); }
.review-card h3 { margin: 14px 0 7px; font-size: 15px; }
.review-card p { margin: 0; min-height: 44px; color: var(--muted); font-size: 11px; line-height: 1.7; }
.review-card-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--line); }
.review-card-foot strong { font-size: 13px; }
.review-card-foot button { border: 0; background: transparent; color: var(--violet); font-size: 10px; font-weight: 900; cursor: pointer; }

dialog { width: min(520px, calc(100vw / 1.15 - 28px)); border: 0; border-radius: 22px; padding: 0; color: var(--ink); box-shadow: 0 30px 80px rgba(11,18,33,.28); }
dialog::backdrop { background: rgba(11,18,33,.55); backdrop-filter: blur(3px); }
.dialog-heading { padding: 20px 22px 16px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.dialog-heading h2 { margin: 5px 0 0; font-size: 18px; }
.dialog-content { padding: 18px 22px 22px; }
.dialog-content h2 { margin: 0 0 12px; }
.dialog-content p { color: var(--muted); font-size: 12px; line-height: 1.75; }
.dialog-content ul { padding-left: 18px; color: var(--muted); font-size: 11px; line-height: 1.8; }
.dialog-close { float: right; width: 32px; height: 32px; border: 0; border-radius: 10px; background: #f1f3f6; cursor: pointer; }
.rule-card { padding: 12px 13px; border: 1px solid var(--line); border-radius: 12px; background: #fafbfc; }
.rule-card + .rule-card { margin-top: 8px; }
.rule-card strong { font-size: 11px; }
.rule-card p { margin: 4px 0 0; font-size: 10px; }
.dialog-note { margin: 14px 0 0 !important; padding: 10px 11px; border-radius: 10px; color: #6d628b !important; background: var(--violet-soft); font-size: 9px !important; }
.empty-state { padding: 24px; color: var(--muted); font-size: 11px; text-align: center; }

@media (max-width: 1180px) {
  :root { --sidebar-width: 220px; }
  .metric-grid { grid-template-columns: repeat(2,1fr); }
  .overview-grid { grid-template-columns: 1fr; }
  .contract-card-grid { grid-template-columns: repeat(2,1fr); }
  .relationship-layout { grid-template-columns: 240px minmax(0,1fr); }
}

@media (max-width: 820px) {
  body { background: #f6f7fa; }
  .sidebar { transform: translateX(-100%); width: min(82vw, 290px); transition: transform .25s ease; box-shadow: 24px 0 60px rgba(11,18,33,.24); }
  .sidebar.is-open { transform: translateX(0); }
  .mobile-header { position: sticky; top: 0; height: 64px; padding: 0 16px; display: flex; justify-content: space-between; align-items: center; color: #fff; background: rgba(17,26,46,.96); backdrop-filter: blur(12px); z-index: 25; }
  .bottom-nav { position: fixed; left: 12px; right: 12px; bottom: calc(10px + env(safe-area-inset-bottom)); height: 58px; padding: 5px; display: grid; grid-template-columns: repeat(3,1fr); border: 1px solid rgba(255,255,255,.08); border-radius: 17px; background: rgba(17,26,46,.94); backdrop-filter: blur(14px); box-shadow: 0 18px 45px rgba(11,18,33,.25); z-index: 24; }
  .bottom-nav button { border: 0; border-radius: 12px; display: grid; place-items: center; gap: 1px; color: rgba(255,255,255,.52); background: transparent; font-size: 9px; }
  .bottom-nav button span { font-size: 14px; line-height: 1; }
  .bottom-nav button.is-active { color: #fff; background: rgba(255,255,255,.1); }
  .brand-mobile .brand-mark { width: 34px; height: 34px; }
  .brand-mobile strong { font-size: 14px; }
  .icon-button { width: 38px; height: 38px; border: 0; border-radius: 11px; display: grid; place-content: center; gap: 4px; background: rgba(255,255,255,.08); }
  .icon-button span { width: 16px; height: 1.5px; background: #fff; }
  .main-content { margin-left: 0; padding: 24px 16px calc(96px + env(safe-area-inset-bottom)); }
  .page-heading, .compact-heading { display: block; margin-bottom: 18px; }
  .page-heading h1 { font-size: 29px; }
  .page-lead { font-size: 12px; }
  .heading-actions { margin-top: 16px; }
  .search-box { min-width: 0; flex: 1; }
  .data-banner { align-items: flex-start; }
  .data-banner button { display: none; }
  .metric-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
  .metric-card { min-height: 120px; padding: 15px; }
  .metric-value { font-size: 22px; }
  .metric-icon { width: 27px; height: 27px; }
  .overview-grid { display: block; }
  .focus-panel, .progress-panel, .contract-spotlight { padding: 16px; }
  .progress-panel { margin-top: 14px; }
  .donut-wrap { justify-content: flex-start; gap: 18px; }
  .donut { width: 116px; height: 116px; }
  .contract-card-grid { grid-template-columns: 1fr; }
  .relationship-layout { display: block; }
  .contract-picker { position: static; max-height: none; margin-bottom: 12px; }
  .contract-picker-list { display: flex; max-height: none; overflow-x: auto; padding: 8px; scroll-snap-type: x mandatory; }
  .picker-item { flex: 0 0 240px; scroll-snap-align: start; }
  .relationship-header { padding: 17px; }
  .relationship-title-row { display: block; }
  .source-link { display: inline-block; margin-top: 12px; }
  .relationship-stats { grid-template-columns: repeat(2,1fr); }
  .relationship-header .contract-timebar { display: none; }
  .graph-legend { padding: 10px 16px; overflow-x: auto; white-space: nowrap; }
  .desktop-graph { display: none; }
  .mobile-flow { display: block; background: #f8f9fb; }
  .review-grid { grid-template-columns: 1fr; }
}

@media (max-width: 500px) {
  .heading-actions { display: grid; grid-template-columns: 1fr auto; }
  .secondary-button { padding-inline: 12px; }
  .metric-card { min-height: 112px; }
  .metric-label { align-items: flex-start; }
  .metric-label > span:first-child { max-width: 90px; line-height: 1.35; }
  .metric-value { font-size: 20px; }
  .attention-item { grid-template-columns: 30px 1fr; }
  .attention-rank { width: 29px; height: 29px; }
  .attention-amount { grid-column: 2; text-align: left; display: flex; gap: 7px; align-items: center; }
  .attention-copy strong { max-width: 215px; }
  .mobile-date-grid { grid-template-columns: 1fr; }
  .panel-heading { align-items: flex-start; }
  .segmented-control button { padding: 6px 8px; }
}

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