:root {
  --ink: #17221f;
  --ink-soft: #53635d;
  --muted: #7d8b86;
  --line: #dde4e1;
  --line-strong: #cbd5d1;
  --surface: #ffffff;
  --surface-soft: #f5f7f6;
  --canvas: #eef2f0;
  --sidebar: #132923;
  --sidebar-soft: #1c3630;
  --accent: #17845f;
  --accent-dark: #0e6247;
  --accent-soft: #e4f4ed;
  --teal: #1c7182;
  --amber: #bd7521;
  --amber-soft: #fff3df;
  --red: #bd4d49;
  --red-soft: #fceae8;
  --blue: #3769a5;
  --blue-soft: #eaf1fa;
  --shadow-sm: 0 1px 2px rgba(18, 35, 30, 0.05);
  --shadow-md: 0 12px 32px rgba(18, 35, 30, 0.09);
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 18px;
  --sidebar-width: 248px;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background: var(--canvas);
  font-synthesis: none;
}

* { box-sizing: border-box; }

html { min-width: 320px; background: var(--canvas); }

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 88% -10%, rgba(44, 139, 104, .08), transparent 28rem),
    var(--canvas);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.5;
}

button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
button { color: inherit; }
svg { display: block; }

.skip-link {
  position: fixed;
  z-index: 1000;
  left: 16px;
  top: -48px;
  padding: 9px 14px;
  border-radius: 8px;
  background: var(--ink);
  color: white;
  transition: top .2s ease;
}
.skip-link:focus { top: 12px; }

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

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 50;
  width: var(--sidebar-width);
  display: flex;
  flex-direction: column;
  padding: 22px 14px 16px;
  overflow-y: auto;
  color: #dce9e4;
  background:
    radial-gradient(circle at 20% 0, rgba(62, 149, 115, .18), transparent 14rem),
    var(--sidebar);
  border-right: 1px solid rgba(255,255,255,.05);
}

.brand { display: flex; gap: 11px; align-items: center; padding: 0 10px 20px; }
.brand-mark {
  width: 38px; height: 38px; flex: 0 0 38px; display: grid; place-items: center;
  border-radius: 11px; background: #e5f6ee; color: var(--accent-dark);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.55);
}
.brand-mark svg { width: 26px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.brand strong { display: block; color: white; font-size: 16px; letter-spacing: .02em; }
.brand small { display: block; margin-top: 1px; color: #8eaaa0; font-size: 10px; letter-spacing: .12em; text-transform: uppercase; }

.mode-card {
  display: grid; grid-template-columns: 8px 1fr auto; gap: 10px; align-items: center;
  margin: 0 2px 18px; padding: 11px 12px;
  border: 1px solid rgba(142, 209, 182, .16); border-radius: 11px;
  background: rgba(236, 255, 247, .055);
}
.mode-card b, .mode-card small { display: block; }
.mode-card b { color: #e8f5f0; font-size: 12px; }
.mode-card small { margin-top: 1px; color: #91aaa1; font-size: 10px; }
.signal-dot { width: 7px; height: 7px; border-radius: 50%; background: #65d2a5; box-shadow: 0 0 0 4px rgba(101,210,165,.1); }
.lock-icon { width: 24px; height: 24px; display: grid; place-items: center; border-radius: 6px; color: #9db3aa; background: rgba(255,255,255,.05); transform: rotate(-35deg); }

.nav-list { display: flex; flex-direction: column; gap: 3px; }
.nav-label { padding: 0 12px 7px; color: #6f8b81; font-size: 10px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.nav-label-spaced { margin-top: 17px; }
.nav-list a {
  display: grid; grid-template-columns: 22px 1fr auto; align-items: center; gap: 10px;
  min-height: 42px; padding: 8px 11px; border-radius: 9px;
  color: #aec1ba; font-weight: 550; transition: .18s ease;
}
.nav-list a:hover { color: #edf7f3; background: rgba(255,255,255,.055); }
.nav-list a.active { color: white; background: linear-gradient(90deg, rgba(42,132,98,.33), rgba(42,132,98,.16)); box-shadow: inset 3px 0 #65cba3; }
.nav-list a svg { width: 18px; height: 18px; stroke-width: 1.8; }
.nav-list a em { min-width: 20px; padding: 1px 6px; border-radius: 10px; background: rgba(255,255,255,.08); color: #a8beb5; font-size: 10px; font-style: normal; text-align: center; }
.nav-list a.active em { background: #dff6ec; color: var(--accent-dark); }

.sidebar-footer { display: flex; align-items: center; gap: 8px; margin-top: auto; padding: 18px 8px 0; border-top: 1px solid rgba(255,255,255,.08); }
.system-state { display: flex; align-items: center; gap: 9px; min-width: 0; }
.system-state b, .system-state small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.system-state b { color: #cbdad4; font-size: 11px; }
.system-state small { color: #78958a; font-size: 10px; }
.status-led { width: 7px; height: 7px; flex: 0 0 auto; border-radius: 50%; background: #d99b48; }
.status-led.ok { background: #58c899; box-shadow: 0 0 0 4px rgba(88,200,153,.1); }
.status-led.error { background: #d96963; }
.sidebar-collapse { display: none !important; margin-left: auto; color: white !important; }

.main-column { width: calc(100% - var(--sidebar-width)); min-width: 0; margin-left: var(--sidebar-width); }
.topbar {
  position: sticky; top: 0; z-index: 30;
  min-height: 76px; display: flex; align-items: center; justify-content: space-between; gap: 24px;
  padding: 12px clamp(20px, 3vw, 42px);
  border-bottom: 1px solid rgba(205,216,211,.8);
  background: rgba(247,249,248,.88); backdrop-filter: blur(14px);
}
.topbar-title { display: flex; align-items: center; gap: 12px; }
.topbar-title h1 { margin: 0; font-size: 21px; line-height: 1.2; letter-spacing: -.025em; }
.eyebrow { display: block; margin-bottom: 3px; color: var(--accent); font-size: 10px; font-weight: 750; letter-spacing: .11em; text-transform: uppercase; }
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.sync-state { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 11px; }
.sync-state > span { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.sync-state.syncing > span { animation: pulse 1s infinite; }
.user-chip { display: flex; align-items: center; gap: 9px; margin-left: 4px; padding: 0 0 0 13px; border: 0; border-left: 1px solid var(--line); background: transparent; text-align: left; cursor: pointer; }
.user-chip:hover .avatar { background: #cee3da; }
.user-chip:focus-visible { outline: 3px solid rgba(23,132,95,.18); outline-offset: 3px; border-radius: 8px; }
.user-chip.unauthorized .avatar { background: var(--amber-soft); color: var(--amber); }
.user-chip.unauthorized:hover .avatar { background: #f5e4bd; }
.avatar { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 10px; background: #dfece7; color: var(--accent-dark); font-size: 12px; font-weight: 800; }
.user-copy { min-width: 0; max-width: 150px; }
.user-copy b, .user-copy small { display: block; }
.user-copy b { overflow: hidden; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.user-copy small { overflow: hidden; color: var(--muted); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.menu-button { display: none !important; }

.main-content { padding: 28px clamp(20px, 3vw, 42px) 48px; outline: none; }
#app-content { width: 100%; max-width: 1540px; margin: 0 auto; }

.page-intro { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; margin-bottom: 22px; }
.page-intro h2 { margin: 0 0 5px; font-size: 23px; line-height: 1.28; letter-spacing: -.035em; }
.page-intro p { max-width: 690px; margin: 0; color: var(--ink-soft); }
.page-actions { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 8px; }

.button {
  min-height: 38px; display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 8px 14px; border: 1px solid transparent; border-radius: 9px;
  background: var(--accent); color: white; font-weight: 650; font-size: 12px; cursor: pointer;
  box-shadow: var(--shadow-sm); transition: .16s ease;
}
.button:hover:not(:disabled) { background: var(--accent-dark); transform: translateY(-1px); }
.button:focus-visible, .icon-button:focus-visible, .nav-list a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, .tab-button:focus-visible { outline: 3px solid rgba(23,132,95,.28); outline-offset: 2px; }
.button-secondary { border-color: var(--line-strong); background: var(--surface); color: var(--ink); }
.button-secondary:hover:not(:disabled) { border-color: #9fb4ab; background: #fbfcfb; }
.button-ghost { border-color: transparent; background: transparent; color: var(--accent-dark); box-shadow: none; }
.button-ghost:hover:not(:disabled) { background: var(--accent-soft); }
.button-danger { border-color: #e5b8b5; background: var(--surface); color: var(--red); }
.button-warning { border-color: #ebcfaa; background: var(--amber-soft); color: #8d5717; }
.button-compact { min-height: 33px; padding: 6px 11px; }
.button svg { width: 15px; height: 15px; }
.button:disabled, .button.locked { opacity: .58; cursor: not-allowed; transform: none; filter: grayscale(.15); }
.icon-button { width: 34px; height: 34px; display: inline-grid; place-items: center; padding: 0; border: 0; border-radius: 8px; background: transparent; cursor: pointer; }
.icon-button:hover { background: rgba(25,60,48,.07); }

.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.grid-wide { grid-template-columns: minmax(0, 1.6fr) minmax(300px, .8fr); }
.stack { display: flex; flex-direction: column; gap: 16px; }

.card {
  min-width: 0; border: 1px solid var(--line); border-radius: var(--radius);
  background: rgba(255,255,255,.92); box-shadow: var(--shadow-sm);
}
.card-header { min-height: 57px; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 15px 18px; border-bottom: 1px solid #e7ece9; }
.card-header h3 { margin: 0; font-size: 14px; letter-spacing: -.01em; }
.card-header p { margin: 2px 0 0; color: var(--muted); font-size: 11px; }
.card-body { padding: 18px; }
.card-footer { padding: 12px 18px; border-top: 1px solid #e7ece9; background: #fafcfb; border-radius: 0 0 var(--radius) var(--radius); }

.metric-card { position: relative; overflow: hidden; min-height: 132px; padding: 17px; }
.metric-card::after { content: ""; position: absolute; width: 80px; height: 80px; right: -24px; top: -30px; border-radius: 50%; background: var(--accent-soft); opacity: .75; }
.metric-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; position: relative; z-index: 1; }
.metric-label { color: var(--ink-soft); font-size: 11px; font-weight: 600; }
.metric-icon { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 9px; background: var(--accent-soft); color: var(--accent-dark); }
.metric-icon svg { width: 15px; height: 15px; }
.metric-value { margin-top: 15px; font-size: 28px; font-weight: 760; line-height: 1; letter-spacing: -.045em; }
.metric-bottom { display: flex; align-items: center; gap: 7px; margin-top: 11px; color: var(--muted); font-size: 10px; }
.trend { padding: 2px 5px; border-radius: 5px; color: var(--accent-dark); background: var(--accent-soft); font-weight: 750; }
.trend.down { color: #9e4b48; background: var(--red-soft); }

.notice-banner {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  margin-bottom: 18px; padding: 13px 15px; border: 1px solid #e5d3ac; border-radius: 11px;
  background: linear-gradient(90deg, #fff8e9, #fffdf8); color: #6e4b1f;
}
.notice-main { display: flex; align-items: center; gap: 11px; }
.notice-icon { width: 32px; height: 32px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 9px; background: #f5e4bd; }
.notice-banner b, .notice-banner small { display: block; }
.notice-banner b { font-size: 12px; }
.notice-banner small { margin-top: 2px; color: #8a6b42; font-size: 10px; }

.status-pill, .tag {
  display: inline-flex; align-items: center; gap: 5px; max-width: 100%;
  padding: 3px 8px; border-radius: 999px; background: #edf1ef; color: #52635d;
  font-size: 10px; font-weight: 680; line-height: 1.45; white-space: nowrap;
}
.status-pill::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; opacity: .75; }
.status-success { color: #16714f; background: #e4f5ed; }
.status-warning { color: #98601c; background: #fff1d8; }
.status-danger { color: #a04441; background: #fbe8e6; }
.status-info { color: #345f92; background: #e9f1fb; }
.status-neutral { color: #5f6c68; background: #edf1ef; }
.tag { border-radius: 6px; padding: 2px 7px; font-weight: 550; }
.tag::before { display: none; }
.tags { display: flex; flex-wrap: wrap; gap: 5px; }

.table-wrap { overflow: auto; }
table { width: 100%; border-collapse: collapse; }
th { padding: 10px 14px; border-bottom: 1px solid var(--line); background: #f8faf9; color: #74817d; font-size: 10px; font-weight: 700; letter-spacing: .04em; text-align: left; white-space: nowrap; }
td { padding: 12px 14px; border-bottom: 1px solid #e9eeeb; color: #3e4d48; font-size: 11px; vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #fbfdfc; }
.cell-title { max-width: 360px; }
.cell-title b, .cell-title small { display: block; }
.cell-title b { overflow: hidden; color: var(--ink); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.cell-title small { margin-top: 3px; overflow: hidden; color: var(--muted); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.row-actions { display: flex; align-items: center; gap: 4px; justify-content: flex-end; }
.row-actions .button { min-height: 29px; padding: 4px 9px; font-size: 10px; }
.empty-state { padding: 42px 20px; text-align: center; color: var(--muted); }
.empty-icon { width: 42px; height: 42px; display: grid; place-items: center; margin: 0 auto 10px; border-radius: 12px; background: var(--surface-soft); color: #8ca099; }
.empty-icon svg { width: 21px; height: 21px; }
.empty-state b { display: block; color: var(--ink-soft); font-size: 12px; }
.empty-state p { max-width: 360px; margin: 4px auto 0; font-size: 10px; }

.toolbar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; margin-bottom: 13px; }
.filters { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; }
.search-box { position: relative; }
.search-box svg { position: absolute; left: 10px; top: 50%; width: 14px; height: 14px; color: var(--muted); transform: translateY(-50%); pointer-events: none; }
.search-box input { width: min(250px, 55vw); padding-left: 31px; }

input, select, textarea {
  width: 100%; min-height: 38px; padding: 8px 10px;
  border: 1px solid var(--line-strong); border-radius: 8px; outline: none;
  background: white; color: var(--ink); font-size: 11px; transition: .15s ease;
}
input:hover, select:hover, textarea:hover { border-color: #a9b9b2; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(23,132,95,.1); }
textarea { min-height: 96px; line-height: 1.55; resize: vertical; }
label { display: block; }
.field-label { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; color: #3b4c46; font-size: 11px; font-weight: 650; }
.field-help { margin-top: 5px; color: var(--muted); font-size: 9px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 15px; }
.form-grid .span-2 { grid-column: 1 / -1; }
.form-section + .form-section { margin-top: 24px; padding-top: 22px; border-top: 1px solid var(--line); }
.form-section-title { margin: 0 0 13px; font-size: 12px; }
.input-prefix { position: relative; }
.input-prefix > span { position: absolute; left: 10px; top: 50%; color: var(--muted); transform: translateY(-50%); }
.input-prefix input { padding-left: 40px; }
.checkbox-line { display: flex; align-items: flex-start; gap: 9px; }
.checkbox-line input { width: 16px; min-height: 16px; height: 16px; margin-top: 2px; accent-color: var(--accent); }
.checkbox-line b, .checkbox-line small { display: block; }
.checkbox-line b { font-size: 11px; }
.checkbox-line small { color: var(--muted); font-size: 9px; }
.form-note {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  min-width: 0;
  padding: 10px 11px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface-soft);
  color: var(--ink-soft);
  font-size: 9px;
  line-height: 1.55;
  overflow-wrap: anywhere;
}
.form-note svg {
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  margin-top: 1px;
  color: var(--accent-dark);
}

.segmented { display: inline-flex; padding: 3px; border: 1px solid var(--line); border-radius: 9px; background: #f0f4f2; }
.tab-button { min-height: 30px; padding: 5px 11px; border: 0; border-radius: 6px; background: transparent; color: var(--ink-soft); font-size: 10px; font-weight: 650; cursor: pointer; }
.tab-button.active { background: white; color: var(--ink); box-shadow: var(--shadow-sm); }
.panel-tabs { display: flex; gap: 18px; padding: 0 18px; border-bottom: 1px solid var(--line); }
.panel-tabs button { padding: 14px 1px 11px; border: 0; border-bottom: 2px solid transparent; background: none; color: var(--muted); font-size: 11px; font-weight: 650; cursor: pointer; }
.panel-tabs button.active { border-color: var(--accent); color: var(--accent-dark); }

.pipeline { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.pipeline-step { position: relative; min-height: 72px; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: #fbfcfc; }
.pipeline-step::after { content: "›"; position: absolute; right: -8px; top: 24px; z-index: 2; color: #aab7b2; font-size: 18px; }
.pipeline-step:last-child::after { display: none; }
.pipeline-step b, .pipeline-step small { display: block; }
.pipeline-step b { font-size: 11px; }
.pipeline-step small { margin-top: 5px; color: var(--muted); font-size: 9px; }
.pipeline-step strong { display: inline-flex; align-items: center; justify-content: center; min-width: 23px; height: 23px; margin-bottom: 8px; border-radius: 7px; background: var(--accent-soft); color: var(--accent-dark); font-size: 10px; }

.journey-graph { display: grid; gap: 18px; }
.journey-graph-layers { display: grid; gap: 12px; }
.journey-graph-layer { position: relative; padding: 12px; border: 1px solid var(--line); border-radius: 11px; background: #f8faf9; }
.journey-graph-layer:not(:last-child)::after { content: "↓"; position: absolute; left: 50%; bottom: -19px; z-index: 2; color: #8aa49a; font-size: 16px; font-weight: 800; transform: translateX(-50%); }
.journey-graph-layer-label { display: block; margin-bottom: 8px; color: var(--muted); font-size: 9px; font-weight: 750; letter-spacing: .08em; text-transform: uppercase; }
.journey-graph-node-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 9px; }
.journey-graph-node { min-width: 0; padding: 11px 12px; border: 1px solid #d9e3df; border-radius: 9px; background: white; box-shadow: var(--shadow-sm); }
.journey-graph-node b, .journey-graph-node small, .journey-graph-node em { display: block; }
.journey-graph-node b { margin-top: 5px; font-size: 11px; }
.journey-graph-node small { margin-top: 4px; color: var(--ink-soft); font-size: 9px; overflow-wrap: anywhere; }
.journey-graph-node em { margin-top: 6px; color: var(--amber); font-size: 9px; font-style: normal; }
.journey-graph-kind { display: inline-flex; padding: 2px 6px; border-radius: 5px; background: var(--surface-soft); color: var(--muted); font-size: 8px; font-weight: 750; }
.journey-graph-node-start, .journey-graph-node-end { border-color: #afd7c7; background: #f2fbf7; }
.journey-graph-node-condition { border-color: #e5c790; background: #fffbf2; }
.journey-graph-node-action { border-color: #bdd0e7; background: #f7faff; }
.journey-graph-node.is-traced { box-shadow: 0 0 0 3px rgba(23,132,95,.16); }
.journey-graph-edge-list { display: flex; flex-wrap: wrap; gap: 6px; padding-top: 2px; }
.journey-graph-edge { display: inline-flex; align-items: center; gap: 5px; padding: 5px 7px; border: 1px solid var(--line); border-radius: 7px; background: white; color: var(--ink-soft); font-size: 9px; }
.journey-graph-edge b { color: var(--accent-dark); }
.journey-graph-edge-true b { color: var(--accent-dark); }
.journey-graph-edge-false b { color: var(--amber); }

.onboarding-card { margin-top: 16px; }
.onboarding-progress { height: 7px; overflow: hidden; margin-bottom: 15px; border-radius: 999px; background: #e8efec; }
.onboarding-progress > span { display: block; height: 100%; border-radius: inherit; background: var(--accent); transition: width .2s ease; }
.onboarding-list { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 9px; margin: 0; padding: 0; list-style: none; }
.onboarding-step { display: grid; grid-template-columns: 34px minmax(0,1fr) auto; gap: 10px; align-items: center; min-height: 78px; padding: 12px; border: 1px solid var(--line); border-radius: 11px; background: #fbfcfc; }
.onboarding-step.is-current { border-color: #78b99f; background: #f4faf7; box-shadow: inset 0 0 0 1px rgba(23,132,95,.08); }
.onboarding-step.is-complete { background: #f7fbf9; }
.onboarding-index { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 10px; background: var(--surface-soft); color: var(--accent-dark); font-size: 11px; font-weight: 800; }
.onboarding-index svg { width: 15px; height: 15px; }
.onboarding-step b, .onboarding-step small { display: block; }
.onboarding-step b { font-size: 10px; line-height: 1.35; }
.onboarding-step small { margin-top: 4px; color: var(--muted); font-size: 9px; line-height: 1.45; }
.onboarding-step .status-pill { align-self: start; }

.activity-list { display: flex; flex-direction: column; }
.activity-item { display: grid; grid-template-columns: 30px 1fr auto; gap: 10px; padding: 12px 0; border-bottom: 1px solid #e8edea; }
.activity-item:last-child { border-bottom: 0; }
.activity-dot { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 9px; background: var(--surface-soft); color: var(--accent); }
.activity-dot svg { width: 14px; height: 14px; }
.activity-item b, .activity-item small { display: block; }
.activity-item b { font-size: 10px; }
.activity-item small { margin-top: 3px; color: var(--muted); font-size: 9px; }
.activity-time { color: var(--muted); font-size: 9px; white-space: nowrap; }

.progress-row + .progress-row { margin-top: 14px; }
.progress-copy { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 6px; font-size: 10px; }
.progress-copy span:last-child { color: var(--muted); }
.progress-track { height: 6px; overflow: hidden; border-radius: 999px; background: #edf1ef; }
.progress-fill { height: 100%; border-radius: inherit; background: var(--accent); }
.progress-fill.blue { background: var(--blue); }
.progress-fill.amber { background: var(--amber); }

.chart { min-height: 230px; }
.chart svg { width: 100%; height: 220px; overflow: visible; }
.chart-grid { stroke: #e6ece9; stroke-width: 1; }
.chart-axis { fill: #87958f; font-size: 9px; }
.chart-area { fill: url(#areaGradient); }
.chart-line { fill: none; stroke: var(--accent); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.chart-point { fill: white; stroke: var(--accent); stroke-width: 2; }
.donut-wrap { display: grid; grid-template-columns: 150px 1fr; align-items: center; gap: 18px; }
.donut { position: relative; width: 138px; height: 138px; border-radius: 50%; background: conic-gradient(var(--accent) 0 58%, var(--teal) 58% 82%, #d4ddd9 82%); }
.donut::after { content: ""; position: absolute; inset: 25px; border-radius: 50%; background: white; }
.donut-label { position: absolute; inset: 0; z-index: 1; display: grid; place-content: center; text-align: center; }
.donut-label b { font-size: 22px; line-height: 1; }
.donut-label small { margin-top: 5px; color: var(--muted); font-size: 9px; }
.legend-item { display: grid; grid-template-columns: 8px 1fr auto; align-items: center; gap: 8px; padding: 6px 0; font-size: 10px; }
.legend-color { width: 7px; height: 7px; border-radius: 2px; }

.source-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px,1fr)); gap: 12px; }
.source-card { padding: 15px; }
.source-head { display: flex; justify-content: space-between; gap: 12px; }
.source-identity { display: flex; gap: 10px; min-width: 0; }
.platform-icon { width: 34px; height: 34px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 9px; background: var(--surface-soft); color: var(--accent-dark); font-size: 10px; font-weight: 800; }
.source-identity b, .source-identity small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.source-identity b { font-size: 11px; }
.source-identity small { max-width: 195px; margin-top: 3px; color: var(--muted); font-size: 9px; }
.source-meta { display: grid; grid-template-columns: repeat(3,1fr); margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.source-meta span { text-align: center; border-right: 1px solid var(--line); }
.source-meta span:last-child { border-right: 0; }
.source-meta b, .source-meta small { display: block; }
.source-meta b { font-size: 11px; }
.source-meta small { color: var(--muted); font-size: 8px; }

.content-layout { display: grid; grid-template-columns: 310px minmax(0,1fr); min-height: 600px; }
.content-list { border-right: 1px solid var(--line); background: #fafcfb; }
.content-list-head { padding: 14px; border-bottom: 1px solid var(--line); }
.content-list-items { max-height: 690px; overflow-y: auto; }
.content-list-item { width: 100%; padding: 13px 14px; border: 0; border-bottom: 1px solid #e7ece9; background: transparent; text-align: left; cursor: pointer; }
.content-list-item:hover, .content-list-item.active { background: white; }
.content-list-item.active { box-shadow: inset 3px 0 var(--accent); }
.content-list-item b { display: block; overflow: hidden; margin: 7px 0 5px; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.content-list-item small { display: flex; justify-content: space-between; color: var(--muted); font-size: 9px; }
.content-editor { min-width: 0; }
.editor-toolbar { min-height: 57px; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; padding: 12px 17px; border-bottom: 1px solid var(--line); }
.editor-body { padding: 18px; }
.editor-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; margin-bottom: 12px; }
.editor-text { min-height: 190px; padding: 15px; border: 1px solid var(--line); border-radius: 9px; background: #fcfdfd; color: #273a33; font-size: 12px; line-height: 1.75; white-space: pre-wrap; }
.compliance-box { margin-top: 16px; padding: 13px; border: 1px solid #d5e6de; border-radius: 10px; background: #f2faf6; }
.compliance-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.compliance-head b { font-size: 11px; }
.finding { display: flex; gap: 8px; margin-top: 10px; padding-top: 10px; border-top: 1px solid #dceae3; color: var(--ink-soft); font-size: 10px; }

.calendar-week { display: grid; grid-template-columns: repeat(7, minmax(120px,1fr)); min-width: 860px; }
.calendar-day { min-height: 340px; border-right: 1px solid var(--line); }
.calendar-day:last-child { border-right: 0; }
.calendar-day-head { padding: 10px 9px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 9px; text-align: center; }
.calendar-day-head b { display: block; margin-top: 3px; color: var(--ink); font-size: 15px; }
.calendar-day.today .calendar-day-head b { width: 27px; height: 27px; display: grid; place-items: center; margin: 3px auto 0; border-radius: 50%; background: var(--accent); color: white; }
.calendar-event { margin: 8px; padding: 9px; border-left: 3px solid var(--accent); border-radius: 6px; background: var(--accent-soft); font-size: 9px; }
.calendar-event.telegram { border-color: var(--teal); background: #e7f3f5; }
.calendar-event.failed { border-color: var(--red); background: var(--red-soft); }
.calendar-event time { display: block; margin-bottom: 4px; color: var(--muted); }
.calendar-event b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.lock-panel { padding: 18px; border: 1px dashed #dfbd87; border-radius: 11px; background: #fffaf0; }
.lock-panel-head { display: flex; gap: 12px; }
.lock-badge { width: 36px; height: 36px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 10px; background: #f4e2bf; color: #85571d; }
.lock-panel h4 { margin: 0 0 4px; font-size: 12px; }
.lock-panel p { margin: 0; color: #7e6645; font-size: 10px; }
.lock-steps { display: grid; grid-template-columns: repeat(3,1fr); gap: 7px; margin-top: 14px; }
.lock-step { padding: 8px; border-radius: 7px; background: rgba(255,255,255,.72); color: #8f795b; font-size: 9px; }
.lock-step::before { content: "○"; margin-right: 4px; }

.lead-board { display: grid; grid-template-columns: repeat(4,minmax(210px,1fr)); gap: 12px; overflow-x: auto; }
.lead-column { min-height: 430px; padding: 11px; border-radius: 11px; background: #e8eeeb; }
.lead-column-head { display: flex; justify-content: space-between; margin: 0 2px 10px; }
.lead-column-head b { font-size: 11px; }
.lead-column-head span { color: var(--muted); font-size: 9px; }
.lead-card { margin-bottom: 9px; padding: 12px; border: 1px solid var(--line); border-radius: 9px; background: white; box-shadow: var(--shadow-sm); }
.lead-card-head { display: flex; justify-content: space-between; gap: 8px; }
.lead-card h4 { margin: 8px 0 5px; font-size: 11px; }
.lead-card p { margin: 0; color: var(--muted); font-size: 9px; }
.lead-card-foot { display: flex; justify-content: space-between; margin-top: 11px; padding-top: 9px; border-top: 1px solid var(--line); color: var(--muted); font-size: 8px; }

.report-hero { padding: 24px; background: linear-gradient(120deg, #15362d, #1d5b47); color: white; }
.report-hero-top { display: flex; justify-content: space-between; gap: 20px; }
.report-hero h2 { margin: 7px 0 8px; color: white; font-size: 24px; }
.report-hero p { max-width: 650px; margin: 0; color: #c0d7ce; font-size: 11px; }
.report-score { width: 92px; height: 92px; flex: 0 0 auto; display: grid; place-content: center; border: 1px solid rgba(255,255,255,.18); border-radius: 50%; background: rgba(255,255,255,.07); text-align: center; }
.report-score b { font-size: 26px; line-height: 1; }
.report-score small { margin-top: 5px; color: #b7d2c8; font-size: 8px; }
.insight-list { counter-reset: insight; display: flex; flex-direction: column; gap: 10px; }
.insight-item { position: relative; padding: 13px 13px 13px 42px; border: 1px solid var(--line); border-radius: 9px; background: white; }
.insight-item::before { counter-increment: insight; content: counter(insight); position: absolute; left: 13px; top: 13px; width: 19px; height: 19px; display: grid; place-items: center; border-radius: 6px; background: var(--accent-soft); color: var(--accent-dark); font-size: 9px; font-weight: 800; }
.insight-item b { display: block; font-size: 10px; }
.insight-item p { margin: 3px 0 0; color: var(--muted); font-size: 9px; }

.audit-timeline { position: relative; }
.audit-timeline::before { content: ""; position: absolute; left: 13px; top: 10px; bottom: 10px; width: 1px; background: var(--line); }
.audit-event { position: relative; display: grid; grid-template-columns: 28px 1fr auto; gap: 11px; padding: 10px 0 15px; }
.audit-mark { z-index: 1; width: 27px; height: 27px; display: grid; place-items: center; border: 1px solid #c9d9d2; border-radius: 8px; background: white; color: var(--accent); }
.audit-mark svg { width: 13px; height: 13px; }
.audit-event b, .audit-event small { display: block; }
.audit-event b { font-size: 10px; }
.audit-event small { margin-top: 3px; color: var(--muted); font-size: 9px; }
.audit-event time { color: var(--muted); font-size: 9px; }

.market-scope-banner { background: linear-gradient(110deg, #f2faf6, #f8fbf9); }
.market-control-card { margin-bottom: 16px; }
.market-control-row { display: grid; grid-template-columns: minmax(220px, 1fr) minmax(260px, 1.4fr) auto; gap: 18px; align-items: end; }
.market-control-row label { min-width: 0; }
.market-control-row select { width: 100%; margin-top: 6px; }
.market-query-summary { min-height: 38px; display: flex; align-items: center; gap: 10px; padding-bottom: 2px; }
.market-query-summary small { color: var(--muted); font-size: 9px; line-height: 1.45; }
.market-dashboard { display: flex; flex-direction: column; gap: 16px; }
.market-kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.market-kpi { min-width: 0; display: flex; gap: 12px; align-items: center; padding: 17px; border: 1px solid var(--line); border-radius: 12px; background: white; box-shadow: var(--shadow-sm); }
.market-kpi > span { width: 38px; height: 38px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 11px; background: var(--accent-soft); color: var(--accent-dark); }
.market-kpi svg { width: 18px; height: 18px; }
.market-kpi strong, .market-kpi b, .market-kpi small { display: block; }
.market-kpi strong { overflow: hidden; color: var(--ink); font-size: 20px; line-height: 1.15; text-overflow: ellipsis; white-space: nowrap; }
.market-kpi b { margin-top: 4px; font-size: 10px; }
.market-kpi small { margin-top: 2px; color: var(--muted); font-size: 8px; }
.market-kpi .market-tone { font-size: 14px; }
.market-tone.status-success { color: var(--accent-dark); }
.market-tone.status-danger { color: var(--red); }
.market-tone.status-neutral { color: var(--muted); }
.market-main-grid { align-items: start; }
.market-metric-list { display: flex; flex-direction: column; gap: 10px; }
.market-metric { padding: 13px; border: 1px solid var(--line); border-radius: 10px; background: #fbfdfc; }
.market-metric[data-market-metric="owned"] { border-color: #b9d9cc; background: #f5fbf8; }
.market-metric-head, .market-metric-foot { display: flex; justify-content: space-between; gap: 12px; align-items: center; }
.market-metric-head b { min-width: 0; overflow: hidden; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.market-coverage-value { display: flex; align-items: baseline; gap: 8px; margin: 12px 0 7px; }
.market-coverage-value strong { font-size: 18px; }
.market-coverage-value small, .market-metric-foot { color: var(--muted); font-size: 8px; }
.market-bar { height: 6px; overflow: hidden; border-radius: 99px; background: #e4ebe7; }
.market-bar i { height: 100%; display: block; border-radius: inherit; background: linear-gradient(90deg, var(--accent), #50a780); }
.market-metric-foot { margin-top: 8px; }
.market-evidence-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.market-evidence-item { min-width: 0; padding: 14px; border: 1px solid var(--line); border-radius: 10px; background: #fcfdfd; }
.market-evidence-item .tag { margin-right: 7px; }
.market-evidence-item b { font-size: 10px; }
.market-evidence-item small { display: block; margin-top: 7px; color: var(--muted); font-size: 8px; }
.market-evidence-item p { margin: 11px 0; color: var(--ink-soft); font-size: 9px; line-height: 1.65; }
.market-evidence-actions { display: flex; justify-content: space-between; gap: 10px; align-items: center; padding-top: 9px; border-top: 1px solid var(--line); }
.market-evidence-actions span { display: flex; flex-wrap: wrap; gap: 4px; }
.market-evidence-actions em { padding: 3px 5px; border-radius: 5px; background: var(--accent-soft); color: var(--accent-dark); font-size: 7px; font-style: normal; }
.market-evidence-actions a { display: inline-flex; align-items: center; gap: 4px; flex: 0 0 auto; color: var(--accent-dark); font-size: 8px; font-weight: 700; }
.market-evidence-actions svg { width: 11px; height: 11px; }
.market-limitations { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px 22px; margin: 0; padding-left: 18px; color: var(--ink-soft); font-size: 9px; line-height: 1.55; }
.market-provenance { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px; align-items: center; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.market-provenance span { color: var(--muted); font-size: 8px; }
.market-provenance code { overflow: hidden; color: var(--ink-soft); font-size: 8px; text-overflow: ellipsis; white-space: nowrap; }
.market-empty-snapshot { margin-top: 16px; }

.inbox-scope-banner { background: linear-gradient(110deg, #f2faf6, #fbf8f0); }
.inbox-kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin: 16px 0; }
.telegram-webhook-card { margin-bottom: 16px; overflow: hidden; }
.telegram-webhook-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(300px, .85fr); gap: 16px; }
.telegram-webhook-summary { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.webhook-fact { min-width: 0; padding: 13px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-soft); }
.webhook-fact span, .webhook-fact b, .webhook-fact small { display: block; }
.webhook-fact span { color: var(--muted); font-size: 8px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.webhook-fact b { margin-top: 5px; font-size: 11px; overflow-wrap: anywhere; }
.webhook-fact small { margin-top: 4px; color: var(--muted); font-size: 8px; line-height: 1.45; overflow-wrap: anywhere; }
.telegram-webhook-contract { min-width: 0; display: flex; flex-direction: column; gap: 10px; padding: 15px; border: 1px solid var(--line); border-radius: 10px; background: linear-gradient(145deg, #f7faf9, #fbf8f1); }
.telegram-webhook-contract code { display: block; max-width: 100%; padding: 10px; border-radius: 8px; background: #142925; color: #e8f7f2; font-size: 9px; overflow-wrap: anywhere; white-space: normal; }
.telegram-webhook-contract small, .telegram-webhook-management > small { color: var(--muted); line-height: 1.5; overflow-wrap: anywhere; }
.inbox-workspace { overflow: hidden; }
.inbox-toolbar { display: flex; justify-content: space-between; gap: 12px; padding-bottom: 14px; }
.inbox-toolbar .search-box { flex: 1 1 360px; max-width: 560px; }
.inbox-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; padding-top: 14px; border-top: 1px solid var(--line); }
.inbox-list > .empty-state { grid-column: 1 / -1; }
.inbox-item { min-width: 0; display: flex; flex-direction: column; padding: 16px; border: 1px solid var(--line); border-radius: 12px; background: #fcfdfd; box-shadow: var(--shadow-sm); }
.inbox-item-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.inbox-item-head .tags { min-width: 0; }
.inbox-item-head time { flex: 0 0 auto; color: var(--muted); font-size: 8px; }
.inbox-item > p { flex: 1; min-height: 48px; margin: 16px 0; color: var(--ink-soft); font-size: 11px; line-height: 1.7; overflow-wrap: anywhere; }
.inbox-item-meta { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; padding: 11px; border-radius: 9px; background: var(--surface-soft); }
.inbox-item-meta span { min-width: 0; }
.inbox-item-meta b, .inbox-item-meta small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.inbox-item-meta b { font-size: 9px; }
.inbox-item-meta small { margin-top: 2px; color: var(--muted); font-size: 8px; }
.inbox-item footer { display: flex; justify-content: space-between; gap: 12px; align-items: center; margin-top: 13px; padding-top: 12px; border-top: 1px solid var(--line); }
.inbox-item footer > span:first-child { min-width: 0; overflow-wrap: anywhere; }
.inbox-boundary-note { margin: 12px 2px 0; }
.inbox-modal-preview { padding: 13px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface-soft); color: var(--ink-soft); font-size: 10px; line-height: 1.65; overflow-wrap: anywhere; }

.topic-safety-banner { margin-bottom: 16px; background: linear-gradient(110deg, #f2faf6, #fbf8f0); }
.topic-board { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-top: 16px; }
.topic-card { min-width: 0; display: flex; flex-direction: column; overflow: hidden; }
.topic-card-head { align-items: flex-start; }
.topic-card-head > div { min-width: 0; }
.topic-card-head h3 { margin: 9px 0 6px; overflow-wrap: anywhere; }
.topic-card-head p { color: var(--ink-soft); line-height: 1.65; overflow-wrap: anywhere; }
.topic-card-meta, .topic-evidence { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.topic-card-body { flex: 1; display: flex; flex-direction: column; gap: 13px; }
.topic-targets { display: grid; grid-template-columns: 1fr; gap: 8px; padding: 12px; border-radius: 10px; background: var(--surface-soft); }
.topic-targets span { min-width: 0; color: var(--ink-soft); font-size: 9px; line-height: 1.5; overflow-wrap: anywhere; }
.topic-targets b { display: block; margin-bottom: 2px; color: var(--muted); font-size: 8px; text-transform: uppercase; }
.topic-details { padding-top: 11px; border-top: 1px solid var(--line); }
.topic-details summary { color: var(--accent-dark); font-size: 9px; font-weight: 750; cursor: pointer; }
.topic-detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 11px; }
.topic-detail-grid b, .topic-detail-grid small { display: block; overflow-wrap: anywhere; }
.topic-detail-grid b { margin-bottom: 6px; font-size: 9px; }
.topic-detail-grid small { margin-top: 4px; color: var(--muted); font-size: 8px; line-height: 1.5; }
.topic-card-actions { align-items: center; gap: 12px; }
.topic-card-actions > span { min-width: 0; overflow-wrap: anywhere; }
.topic-card-actions .page-actions { flex: 0 0 auto; width: auto; }

.asset-scope-banner { background: linear-gradient(110deg, #f2faf6, #fbf8f0); }
.asset-kpi-grid { margin-bottom: 16px; }
.asset-library-card { overflow: hidden; }
.asset-library-layout { display: grid; grid-template-columns: 310px minmax(0, 1fr); min-height: 590px; }
.asset-list { min-width: 0; border-right: 1px solid var(--line); background: #fafcfb; }
.asset-list-items { max-height: 680px; overflow-y: auto; }
.asset-list-item { width: 100%; display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; gap: 9px; align-items: center; padding: 13px 14px; border: 0; border-bottom: 1px solid #e7ece9; background: transparent; color: var(--ink); text-align: left; cursor: pointer; }
.asset-list-item:hover, .asset-list-item.active { background: white; }
.asset-list-item.active { box-shadow: inset 3px 0 var(--accent); }
.asset-list-item > span:first-child { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 8px; background: var(--accent-soft); color: var(--accent-dark); }
.asset-list-item svg { width: 15px; height: 15px; }
.asset-list-item b, .asset-list-item small { display: block; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.asset-list-item b { font-size: 10px; }
.asset-list-item small { margin-top: 4px; color: var(--muted); font-size: 8px; }
.asset-detail { min-width: 0; padding: 20px; }
.asset-detail-head { display: flex; justify-content: space-between; gap: 18px; align-items: flex-start; padding-bottom: 17px; border-bottom: 1px solid var(--line); }
.asset-detail-head > div { min-width: 0; }
.asset-detail-head h3 { margin: 10px 0 5px; overflow-wrap: anywhere; }
.asset-detail-head p { margin: 0; color: var(--ink-soft); font-size: 10px; line-height: 1.6; overflow-wrap: anywhere; }
.asset-version-toolbar { display: flex; justify-content: space-between; gap: 16px; align-items: end; padding: 16px 0; }
.asset-version-toolbar label { min-width: 0; flex: 1; }
.asset-version-toolbar .mono { flex: 0 1 auto; padding-bottom: 9px; color: var(--muted); overflow-wrap: anywhere; }
.asset-version-grid, .asset-rights-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.asset-version-grid > div, .asset-rights-grid > div { min-width: 0; padding: 11px; border-radius: 9px; background: var(--surface-soft); }
.asset-version-grid span, .asset-rights-grid span { display: block; color: var(--muted); font-size: 8px; }
.asset-version-grid b, .asset-rights-grid b { display: block; margin-top: 4px; font-size: 9px; line-height: 1.45; overflow-wrap: anywhere; }
.asset-alt { margin-top: 13px; padding: 13px; border: 1px solid var(--line); border-radius: 9px; }
.asset-alt p { margin: 5px 0; color: var(--ink-soft); font-size: 10px; line-height: 1.6; overflow-wrap: anywhere; }
.asset-alt a { display: inline-flex; gap: 5px; align-items: center; color: var(--accent-dark); font-size: 8px; font-weight: 700; }
.asset-alt svg { width: 11px; height: 11px; }
.asset-file-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 10px; }
.asset-file-actions .button { min-height: 34px; }
.field-help { display: block; margin-top: 6px; color: var(--muted); font-size: 8px; line-height: 1.5; }
.asset-rights-panel { margin-top: 16px; overflow: hidden; border: 1px solid #d5e6de; border-radius: 11px; background: #fbfefc; }
.asset-rights-panel > header { display: flex; justify-content: space-between; gap: 14px; align-items: flex-start; padding: 14px; border-bottom: 1px solid #dceae3; background: #f2faf6; }
.asset-rights-panel h4 { margin: 0; font-size: 11px; }
.asset-rights-panel header p { margin: 4px 0 0; color: var(--muted); font-size: 8px; }
.asset-rights-grid { padding: 14px; }
.asset-rights-foot { display: flex; justify-content: space-between; gap: 12px; padding: 0 14px 14px; color: var(--muted); font-size: 8px; overflow-wrap: anywhere; }
.asset-rights-panel > footer { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 7px; padding: 12px 14px; border-top: 1px solid #dceae3; background: white; }
.empty-inline { padding: 20px 14px; color: var(--muted); font-size: 9px; text-align: center; }
.inline-inputs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.content-assets-box { background: #fbfcf8; border-color: #e4e1ca; }
.asset-manifest-line { margin: 8px 0 0; color: var(--muted); font-size: 8px; overflow-wrap: anywhere; }
.content-asset-bindings { display: grid; gap: 8px; margin-top: 11px; }
.content-asset-binding { min-width: 0; display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 11px; border-top: 1px solid #e9e5d2; }
.content-asset-binding b, .content-asset-binding small { display: block; overflow-wrap: anywhere; }
.content-asset-binding b { font-size: 9px; }
.content-asset-binding small { margin-top: 3px; color: var(--muted); font-size: 8px; line-height: 1.45; }

.loading-page { min-height: 55vh; display: grid; place-content: center; justify-items: center; color: var(--muted); }
.loading-page p { font-size: 11px; }
.spinner { width: 26px; height: 26px; border: 2px solid #cad7d1; border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; }
.skeleton { position: relative; overflow: hidden; border-radius: 6px; background: #e9eeeb; color: transparent !important; }
.skeleton::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, rgba(255,255,255,.65), transparent); transform: translateX(-100%); animation: shimmer 1.4s infinite; }

.toast-region { position: fixed; z-index: 120; right: 20px; bottom: 20px; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.toast { min-width: 270px; max-width: 360px; display: grid; grid-template-columns: 24px 1fr auto; gap: 9px; align-items: center; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: white; box-shadow: var(--shadow-md); animation: toast-in .25s ease; pointer-events: auto; }
.toast-symbol { width: 24px; height: 24px; display: grid; place-items: center; border-radius: 7px; background: var(--accent-soft); color: var(--accent-dark); }
.toast.warning .toast-symbol { background: var(--amber-soft); color: var(--amber); }
.toast.error .toast-symbol { background: var(--red-soft); color: var(--red); }
.toast b, .toast small { display: block; }
.toast b { font-size: 10px; }
.toast small { margin-top: 2px; color: var(--muted); font-size: 9px; }
.toast button { border: 0; background: none; color: var(--muted); cursor: pointer; }

.modal-root:empty { display: none; }
.modal-backdrop { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 20px; background: rgba(10,23,19,.47); backdrop-filter: blur(3px); }
.modal { width: min(600px, 100%); max-height: calc(100vh - 40px); overflow-y: auto; border-radius: 14px; background: white; box-shadow: 0 24px 80px rgba(9,29,22,.22); animation: modal-in .2s ease; }
.modal-wide { width: min(820px,100%); }
.modal-header { display: flex; justify-content: space-between; gap: 14px; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.modal-header h3 { margin: 0; font-size: 15px; }
.modal-header p { margin: 3px 0 0; color: var(--muted); font-size: 10px; }
.modal-body { padding: 20px; }
.modal-footer { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--line); background: #fafcfb; }
.auth-token-note { margin: 12px 0 0; padding: 11px 12px; border-radius: 9px; background: var(--surface-soft); color: var(--ink-soft); font-size: 10px; }
.auth-token-note b { display: block; margin-bottom: 3px; color: var(--ink); font-size: 11px; }
.auth-token-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 14px; }
.auth-token-actions small { color: var(--muted); font-size: 9px; }

.mobile-backdrop { display: none; }
.text-muted { color: var(--muted); }
.text-small { font-size: 10px; }
.text-right { text-align: right; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .9em; }
.divider { height: 1px; margin: 15px 0; background: var(--line); }
.hidden { display: none !important; }
[hidden] { display: none !important; }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 50% { opacity: .25; } }
@keyframes shimmer { to { transform: translateX(100%); } }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }
@keyframes modal-in { from { opacity: 0; transform: translateY(7px) scale(.99); } }

@media (max-width: 1180px) {
  .grid-4, .grid-5 { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .grid-wide { grid-template-columns: minmax(0, 1fr); }
  .content-layout { grid-template-columns: 270px minmax(0,1fr); }
  .lock-steps { grid-template-columns: 1fr; }
  .market-kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .inbox-kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .telegram-webhook-grid { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
  .sidebar { transform: translateX(-100%); transition: transform .23s ease; box-shadow: var(--shadow-md); }
  body.sidebar-open .sidebar { transform: translateX(0); }
  .sidebar-collapse, .menu-button { display: inline-grid !important; }
  .mobile-backdrop { position: fixed; inset: 0; z-index: 40; background: rgba(7,20,16,.38); }
  body.sidebar-open .mobile-backdrop { display: block; }
  .main-column { width: 100%; margin-left: 0; }
  .user-copy, .sync-state { display: none; }
  .content-layout { grid-template-columns: 1fr; }
  .content-list { border-right: 0; border-bottom: 1px solid var(--line); }
  .content-list-items { max-height: 250px; }
  .pipeline { grid-template-columns: 1fr 1fr; }
  .pipeline-step::after { display: none; }
  .market-control-row { grid-template-columns: 1fr 1fr; }
  .market-control-row .button { grid-column: 1 / -1; justify-self: start; }
  .inbox-list { grid-template-columns: 1fr; }
  .topic-board { grid-template-columns: 1fr; }
  .asset-library-layout { grid-template-columns: 1fr; }
  .asset-list { border-right: 0; border-bottom: 1px solid var(--line); }
  .asset-list-items { max-height: 250px; }
  .asset-version-grid, .asset-rights-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 650px) {
  .topbar { min-height: 67px; padding: 10px 14px; }
  .topbar-title h1 { font-size: 18px; }
  .topbar-actions .button { width: 34px; padding: 0; }
  .topbar-actions .button > span:last-child, #refresh-button { font-size: 0; }
  #refresh-button svg { width: 16px; }
  .user-chip { padding-left: 8px; }
  .main-content { padding: 20px 13px 40px; }
  .page-intro { flex-direction: column; margin-bottom: 17px; }
  .page-intro h2 { font-size: 20px; }
  .page-actions { width: 100%; justify-content: flex-start; }
  .page-actions .button { flex: 1; }
  .grid-2, .grid-3, .grid-4, .grid-5, .form-grid { grid-template-columns: 1fr; }
  .form-grid .span-2 { grid-column: auto; }
  .metric-card { min-height: 116px; }
  .notice-banner { align-items: flex-start; }
  .notice-banner > .status-pill { display: none; }
  .pipeline { grid-template-columns: 1fr; }
  .onboarding-list { grid-template-columns: 1fr; }
  .lead-board { grid-template-columns: 1fr; overflow-x: visible; }
  .lead-column { min-height: 0; }
  .account-table { overflow: visible; }
  .account-table table, .account-table tbody, .account-table tr, .account-table td { display: block; width: 100%; }
  .account-table thead { display: none; }
  .account-table tr { padding: 10px 14px; border-bottom: 1px solid var(--line); }
  .account-table tr:last-child { border-bottom: 0; }
  .account-table td { display: grid; grid-template-columns: 78px minmax(0,1fr); gap: 10px; align-items: center; padding: 7px 0; border: 0; }
  .account-table td::before { content: attr(data-label); color: var(--muted); font-size: 9px; font-weight: 700; }
  .account-table td:last-child { display: flex; justify-content: flex-end; }
  .account-table td:last-child::before { display: none; }
  .account-table .cell-title { max-width: none; min-width: 0; }
  .campaign-table { overflow: visible; }
  .campaign-table table, .campaign-table tbody, .campaign-table tr, .campaign-table td { display: block; width: 100%; }
  .campaign-table thead { display: none; }
  .campaign-table tr { padding: 10px 14px; border-bottom: 1px solid var(--line); }
  .campaign-table tr:last-child { border-bottom: 0; }
  .campaign-table td { display: grid; grid-template-columns: 78px minmax(0,1fr); gap: 10px; align-items: start; padding: 7px 0; border: 0; overflow-wrap: anywhere; }
  .campaign-table td::before { color: var(--muted); font-size: 9px; font-weight: 700; }
  .campaign-table td:nth-child(1)::before { content: "活动"; }
  .campaign-table td:nth-child(2)::before { content: "目标"; }
  .campaign-table td:nth-child(3)::before { content: "目标画像"; }
  .campaign-table td:nth-child(4)::before { content: "动态分群"; }
  .campaign-table td:nth-child(5)::before { content: "内容支柱"; }
  .campaign-table td:nth-child(6)::before { content: "状态"; }
  .campaign-table td:last-child { display: flex; justify-content: flex-end; }
  .campaign-table td:last-child::before { display: none; }
  .journey-definition-table, .journey-run-table { overflow: visible; }
  .journey-definition-table table, .journey-definition-table tbody, .journey-definition-table tr, .journey-definition-table td,
  .journey-run-table table, .journey-run-table tbody, .journey-run-table tr, .journey-run-table td { display: block; width: 100%; }
  .journey-definition-table thead, .journey-run-table thead { display: none; }
  .journey-definition-table tr, .journey-run-table tr { padding: 10px 14px; border-bottom: 1px solid var(--line); }
  .journey-definition-table tr:last-child, .journey-run-table tr:last-child { border-bottom: 0; }
  .journey-definition-table td, .journey-run-table td { display: grid; grid-template-columns: 88px minmax(0,1fr); gap: 10px; align-items: start; padding: 7px 0; border: 0; overflow-wrap: anywhere; }
  .journey-definition-table td::before, .journey-run-table td::before { color: var(--muted); font-size: 9px; font-weight: 700; }
  .journey-definition-table td:nth-child(1)::before { content: "名称与触发器"; }
  .journey-definition-table td:nth-child(2)::before { content: "进入条件"; }
  .journey-definition-table td:nth-child(3)::before { content: "步骤"; }
  .journey-definition-table td:nth-child(4)::before { content: "重入"; }
  .journey-definition-table td:nth-child(5)::before { content: "状态"; }
  .journey-definition-table td:nth-child(6)::before { content: "操作"; }
  .journey-run-table td:nth-child(1)::before { content: "旅程"; }
  .journey-run-table td:nth-child(2)::before { content: "计划时刻"; }
  .journey-run-table td:nth-child(3)::before { content: "受众血缘"; }
  .journey-run-table td:nth-child(4)::before { content: "扫描 / 匹配 / 进入"; }
  .journey-run-table td:nth-child(5)::before { content: "状态"; }
  .journey-definition-table .cell-title { max-width: none; min-width: 0; }
  .journey-definition-table .cell-title b, .journey-definition-table .cell-title small { overflow: visible; text-overflow: clip; white-space: normal; }
  .journey-definition-table .row-actions { justify-content: flex-start; }
  .journey-graph-node-row { grid-template-columns: 1fr; }
  .journey-graph-edge-list { display: grid; grid-template-columns: 1fr; }
  .journey-graph-edge { align-items: flex-start; overflow-wrap: anywhere; }
  .donut-wrap { grid-template-columns: 1fr; justify-items: center; }
  .donut-legend { width: 100%; }
  .report-score { width: 74px; height: 74px; }
  .report-hero { padding: 18px; }
  .source-grid { grid-template-columns: 1fr; }
  .market-control-row, .market-kpi-grid, .market-evidence-list, .market-limitations { grid-template-columns: 1fr; }
  .market-control-row .button { width: 100%; }
  .market-query-summary { align-items: flex-start; flex-direction: column; }
  .market-kpi { padding: 14px; }
  .market-evidence-actions { align-items: flex-start; flex-direction: column; }
  .market-provenance { grid-template-columns: 1fr; }
  .inbox-kpi-grid { grid-template-columns: 1fr; }
  .telegram-webhook-summary { grid-template-columns: 1fr; }
  .inbox-toolbar { align-items: stretch; flex-direction: column; }
  .inbox-toolbar .search-box { flex-basis: auto; max-width: none; }
  .inbox-toolbar .filters { width: 100%; }
  .inbox-toolbar .filters select { min-width: 0; flex: 1; }
  .inbox-item { padding: 14px; }
  .inbox-item-head, .inbox-item footer { align-items: flex-start; flex-direction: column; }
  .inbox-item-head time { margin-top: 2px; }
  .inbox-item-meta { grid-template-columns: 1fr; }
  .inbox-item-meta b, .inbox-item-meta small { white-space: normal; }
  .inbox-item footer .button { width: 100%; }
  .topic-detail-grid { grid-template-columns: 1fr; }
  .topic-card-actions { align-items: stretch; flex-direction: column; }
  .topic-card-actions .page-actions { width: 100%; }
  .topic-card-actions .page-actions .button { min-width: 0; }
  .asset-detail { padding: 14px; }
  .asset-detail-head, .asset-version-toolbar, .asset-rights-panel > header, .asset-rights-foot { align-items: flex-start; flex-direction: column; }
  .asset-detail-head .button { width: 100%; }
  .asset-version-toolbar label { width: 100%; }
  .asset-version-toolbar .mono { max-width: 100%; padding: 0; }
  .asset-version-grid, .asset-rights-grid { grid-template-columns: 1fr; }
  .asset-rights-panel > footer .button { flex: 1 1 100%; }
  .content-asset-binding { grid-template-columns: 24px minmax(0, 1fr) auto; }
  .inline-inputs { grid-template-columns: 1fr; }
  .toast-region { left: 12px; right: 12px; bottom: 12px; }
  .toast { min-width: 0; max-width: none; }
  .modal-backdrop { padding: 10px; align-items: end; }
  .modal { max-height: calc(100vh - 20px); border-radius: 14px 14px 8px 8px; }
}

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