:root {
  --ink: #1c1c1e;
  --muted: #6b6b73;
  --line: #d9d9de;
  --line-soft: #ececef;
  --soft: #f3f4f6;
  --soft2: #fafafa;
  --accent: #2f6f4f;
  --accent-soft: #e9f3ee;
  --warn: #a35c00;
  --warn-soft: #fff6e8;
  --danger: #b42318;
  --danger-soft: #fff3f1;
  --note: #4b4bb7;
  --note-soft: #f2f2ff;
  --row-height: 33px;
  --head-height: 34px;
  --radius: 10px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  max-width: 100%;
  overflow-x: hidden;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background: #fff;
  font-size: 14px;
  line-height: 1.45;
}

button,
input,
select {
  font: inherit;
}

[hidden] {
  display: none !important;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 400;
  background: #fff;
  color: var(--ink);
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.skip-link:focus {
  left: 8px;
  top: 8px;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ---------- top bar ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 16px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(8px);
  flex-wrap: wrap;
}

.brand {
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
  margin-right: 2px;
}

.brand-mark {
  font-weight: 800;
  letter-spacing: 0.04em;
  font-size: 15px;
  color: var(--accent);
}

.brand-name {
  font-weight: 700;
  font-size: 15px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--soft2);
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}

.badge.shift-badge {
  border-color: #c9e2d4;
  background: var(--accent-soft);
  color: #1e5b3b;
}

.badge.scope-badge {
  border-color: #d6defc;
  background: var(--note-soft);
  color: var(--note);
}

.badge.warn {
  border-color: #f0d8b0;
  background: var(--warn-soft);
  color: var(--warn);
}

.ctrl {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
  flex-wrap: wrap;
  min-width: 0;
}

.ctrl-label {
  font-size: 11px;
  color: var(--muted);
}

select,
input[type="date"],
input[type="search"],
input[type="text"] {
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  min-height: 30px;
  min-width: 0;
}

input[type="search"] {
  width: 100%;
}

.date-sep {
  color: var(--muted);
}

.spacer {
  flex: 1;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 5px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  font-size: 12px;
  cursor: pointer;
  white-space: nowrap;
}

.btn:hover {
  border-color: #a9a9b2;
}

.btn.accent {
  border-color: var(--accent);
  color: var(--accent);
}

.btn.ghost {
  border-color: transparent;
  color: var(--muted);
}

.btn:disabled {
  opacity: 0.55;
  cursor: default;
}

/* ---------- auth banner ---------- */
.auth-banner {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: var(--danger-soft);
  border-bottom: 1px solid #f0c8c4;
  color: var(--danger);
  font-size: 13px;
  flex-wrap: wrap;
}

/* ---------- maturity ---------- */
.maturity {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  padding: 7px 16px;
  background: var(--warn-soft);
  border-bottom: 1px solid #f0e0c0;
  font-size: 12px;
  color: #7a4a00;
}

.maturity-title {
  font-weight: 700;
}

.maturity-item b {
  color: #5a3600;
}

.maturity-item.warn {
  color: var(--danger);
}

.maturity-warn {
  font-weight: 700;
}

.maturity-note {
  margin-left: auto;
  color: #8a6a3a;
}

/* ---------- layout ---------- */
.layout {
  display: flex;
  align-items: flex-start;
  min-height: calc(100vh - 120px);
}

.nav {
  width: 176px;
  flex: 0 0 176px;
  border-right: 1px solid var(--line);
  background: var(--soft2);
  padding: 10px 0 16px;
  position: sticky;
  top: 56px;
  max-height: calc(100vh - 56px);
  overflow: auto;
}

.nav-heading {
  padding: 4px 16px 6px;
  font-size: 10.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.nav-button {
  display: block;
  width: 100%;
  padding: 10px 16px;
  border: 0;
  border-left: 3px solid transparent;
  background: none;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.nav-button:hover {
  background: #f0f1f4;
}

.nav-button.active {
  background: #fff;
  border-left-color: var(--accent);
  font-weight: 700;
}

.nav-note {
  padding: 14px 16px 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
}

main {
  flex: 1;
  min-width: 0;
  padding: 14px 18px 40px;
}

#viewHead h1 {
  margin: 0 0 2px;
  font-size: 20px;
  line-height: 1.25;
}

.view-sub {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 12px;
}

.note {
  border-left: 3px solid var(--note);
  background: var(--note-soft);
  color: #3e3e8f;
  padding: 7px 11px;
  border-radius: 0 6px 6px 0;
  font-size: 12px;
  line-height: 1.55;
  margin: 0 0 10px;
}

.note.warn {
  border-left-color: var(--warn);
  background: var(--warn-soft);
  color: #7a4a00;
}

/* ---------- tabs ---------- */
.tabs {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--line);
  margin: 10px 0 12px;
}

.tab-button {
  padding: 8px 13px;
  border: 1px solid var(--line);
  border-bottom: 0;
  border-radius: 8px 8px 0 0;
  background: var(--soft);
  color: var(--ink);
  font-size: 13px;
  cursor: pointer;
  margin-bottom: -1px;
}

.tab-button:hover {
  background: #ececf0;
}

.tab-button.active {
  background: #fff;
  border-color: var(--ink);
  font-weight: 700;
}

/* ---------- panels ---------- */
.panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  margin-bottom: 14px;
  overflow: hidden;
}

.panel-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: var(--soft);
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}

.panel-title {
  margin: 0;
  font-size: 14px;
  line-height: 1.3;
}

.table-search {
  flex: 1 1 150px;
  min-width: 0;
  max-width: 260px;
}

.scope-chip {
  display: inline-block;
  max-width: 100%;
  padding: 2px 7px;
  border-radius: 999px;
  background: #eef1f6;
  color: var(--muted);
  font-size: 10.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.row-count {
  color: var(--muted);
  font-size: 11.5px;
  white-space: nowrap;
}

.chip {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 999px;
  background: #eef3ff;
  border: 1px solid #d6defc;
  color: var(--note);
  font-size: 10.5px;
  white-space: nowrap;
}

/* ---------- data table ---------- */
.table-panel {
  overflow: hidden;
}

.table-wrap {
  overflow: auto;
  overscroll-behavior: contain;
  position: relative;
}

.data-table {
  border-collapse: separate;
  border-spacing: 0;
  font-size: 12.5px;
  table-layout: fixed;
}

.data-table thead th {
  position: sticky;
  top: 0;
  z-index: 5;
  height: var(--head-height);
  padding: 0;
  background: var(--soft);
  border-bottom: 1px solid var(--line);
  text-align: left;
  font-weight: 600;
  white-space: nowrap;
}

.data-table thead th.num {
  text-align: right;
}

.sort-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  width: 100%;
  height: var(--head-height);
  padding: 0 10px;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
}

.data-table thead th.num .sort-btn {
  justify-content: flex-end;
}

.sort-btn:hover {
  background: #e9eaee;
}

.th-text {
  overflow: hidden;
  text-overflow: ellipsis;
}

.th-label {
  display: flex;
  align-items: center;
  height: var(--head-height);
  padding: 0 10px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sort-arrow {
  color: var(--accent);
  font-size: 10px;
  flex: 0 0 auto;
}

.data-table tbody td {
  height: var(--row-height);
  padding: 6px 10px;
  border-bottom: 1px solid var(--line-soft);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.data-table tbody tr {
  height: var(--row-height);
}

.data-table td.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.data-table td.pii {
  color: var(--muted);
  letter-spacing: 0.02em;
}

.data-table td.is-null,
.data-table dd.is-null {
  color: var(--muted);
  font-style: italic;
}

.frozen-head {
  background: var(--soft) !important;
  box-shadow: 1px 0 0 var(--line);
}

.frozen-cell {
  background: #fff;
  box-shadow: 1px 0 0 var(--line);
}

.data-table tbody tr.drillable {
  cursor: pointer;
}

.data-table tbody tr:hover td {
  background: #f5faf7;
}

.data-table tbody tr:hover td.frozen-cell {
  background: #f5faf7;
}

.data-table tbody tr:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

.skeleton {
  display: block;
  height: 10px;
  border-radius: 4px;
  background: linear-gradient(90deg, #ececef, #f8f8fa, #ececef);
  background-size: 200% 100%;
  animation: shimmer 1.15s infinite linear;
}

@keyframes shimmer {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

.table-message {
  text-align: center;
  color: var(--muted);
  padding: 22px 12px;
  white-space: normal;
}

.table-message.error-message {
  color: var(--danger);
}

.table-message .btn {
  margin-left: 8px;
}

.pager {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: var(--soft2);
  border-top: 1px solid var(--line);
  font-size: 12px;
  flex-wrap: wrap;
}

.page-info {
  white-space: nowrap;
}

.page-size-label,
.freeze-label {
  color: var(--muted);
  font-size: 11px;
}

.panel-notes {
  padding: 0 12px 10px;
}

.panel-notes .note {
  margin: 8px 0 0;
}

/* ---------- KPI ---------- */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.kpi-card {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px 12px;
  background: linear-gradient(180deg, #fff, #fbfbfc);
}

.kpi-label {
  color: var(--muted);
  font-size: 11.5px;
}

.kpi-value {
  margin: 3px 0 1px;
  font-size: 21px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  overflow: hidden;
  text-overflow: ellipsis;
}

.kpi-delta {
  color: var(--accent);
  font-size: 11.5px;
}

.kpi-delta.down {
  color: var(--danger);
}

.kpi-note {
  margin-top: 3px;
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.4;
}

/* ---------- split revenue toolbar / grouped rows ---------- */
.split-host {
  min-width: 0;
}

.split-toolbar {
  margin-bottom: 10px;
}

.split-toolbar-inner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  flex-wrap: wrap;
  font-size: 12px;
}

.split-title {
  font-weight: 700;
}

.alignment-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  background: #eef0f4;
  color: #555;
  font-size: 11px;
  white-space: nowrap;
}

.alignment-badge.ok {
  background: #e7f5ec;
  color: #1e6b3f;
}

.alignment-badge.warn {
  background: #fdeaea;
  color: #9b2c2c;
}

.data-table tbody tr.group-row {
  height: 24px;
}

.data-table tbody tr.group-row td.group-cell {
  height: 24px;
  padding: 4px 10px;
  background: #f7f7fa;
  color: #444;
  font-weight: 700;
  white-space: nowrap;
}

/* ---------- charts ---------- */
.chart-box {
  position: relative;
  padding: 6px 10px 10px;
}

.chart-host {
  position: relative;
  outline: none;
}

.chart-host:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 6px;
}

.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  padding: 2px 2px 8px;
  color: var(--muted);
  font-size: 12px;
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.legend-item.is-empty {
  opacity: 0.72;
}

.legend-swatch {
  width: 10px;
  height: 10px;
  border-radius: 2px;
  display: inline-block;
}

.trend-svg {
  display: block;
  width: 100%;
}

.grid-line {
  stroke: #e8e8ec;
  stroke-width: 1;
}

.axis-label {
  fill: var(--muted);
  font-size: 10px;
}

.hover-line {
  stroke: #8a8a93;
  stroke-width: 1;
  stroke-dasharray: 3 3;
}

.hover-dot {
  stroke: #fff;
  stroke-width: 1;
}

.series-line {
  stroke-width: 2;
  vector-effect: non-scaling-stroke;
}

.bar {
  opacity: 0.85;
}

.chart-tip {
  position: absolute;
  top: 8px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
  padding: 8px 10px;
  font-size: 11.5px;
  pointer-events: none;
  z-index: 10;
}

.tip-date {
  font-weight: 700;
  margin-bottom: 4px;
}

.tip-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.tip-swatch {
  width: 8px;
  height: 8px;
  border-radius: 2px;
  flex: 0 0 auto;
}

.tip-label {
  flex: 1;
  color: var(--muted);
}

.tip-value {
  font-variant-numeric: tabular-nums;
}

.chart-empty {
  padding: 42px 12px;
  text-align: center;
  color: var(--muted);
  font-size: 12px;
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- simple table ---------- */
.simple-wrap {
  max-height: 320px;
}

.simple-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}

.simple-table th,
.simple-table td {
  padding: 7px 10px;
  border-bottom: 1px solid var(--line-soft);
  text-align: left;
  white-space: nowrap;
}

.simple-table th {
  position: sticky;
  top: 0;
  background: var(--soft);
  z-index: 2;
}

.simple-table td.num,
.simple-table th.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* ---------- creative wall ---------- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 12px;
  padding: 12px;
}

.creative-card {
  display: flex;
  flex-direction: column;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: inherit;
  text-align: left;
  overflow: hidden;
  cursor: pointer;
}

.creative-card:hover {
  border-color: var(--accent);
  box-shadow: 0 4px 16px rgba(47, 111, 79, 0.12);
}

.card-media {
  position: relative;
  aspect-ratio: 1 / 1;
  background: linear-gradient(135deg, #eef4f0, #f7f7fa);
  overflow: hidden;
}

.card-media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.card-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  width: 100%;
  height: 100%;
  min-height: 90px;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
  padding: 10px;
}

.card-placeholder small {
  font-size: 10.5px;
  opacity: 0.8;
}

.card-body {
  padding: 9px 11px 11px;
}

.card-name {
  font-size: 13px;
  font-weight: 700;
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.card-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 5px 0 8px;
  color: var(--muted);
  font-size: 10.5px;
  flex-wrap: wrap;
}

.card-id {
  font-variant-numeric: tabular-nums;
}

.status-badge {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 999px;
  font-size: 10px;
  background: #eef0f4;
  color: #555;
}

.status-badge.complete {
  background: #e7f5ec;
  color: #1e6b3f;
}

.status-badge.thumbnail_only {
  background: var(--warn-soft);
  color: var(--warn);
}

.status-badge.deferred {
  background: #eef0f4;
  color: #555;
}

.status-badge.missing {
  background: #fdeaea;
  color: #9b2c2c;
}

.card-metrics {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3px 8px;
  margin: 0;
  font-size: 11px;
}

.card-metrics dt {
  color: var(--muted);
}

.card-metrics dd {
  margin: 0;
  font-variant-numeric: tabular-nums;
}

.card-loading {
  grid-column: 1 / -1;
  padding: 28px 12px;
  text-align: center;
  color: var(--muted);
  font-size: 12px;
}

.status-select {
  max-width: 140px;
}

/* ---------- drawer ---------- */
.drawer {
  width: min(920px, 94vw);
  max-height: 88vh;
  padding: 0;
  border: 0;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.drawer::backdrop {
  background: rgba(15, 18, 20, 0.45);
}

.drawer-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 13px 18px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.drawer-heading {
  min-width: 0;
  flex: 1;
}

.drawer-heading h2 {
  margin: 0;
  font-size: 16px;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.drawer-heading p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.drawer-body {
  padding: 16px 18px;
  max-height: calc(88vh - 72px);
  overflow: auto;
}

.detail-media {
  margin-bottom: 14px;
}

.detail-media img {
  display: block;
  max-width: 100%;
  max-height: 340px;
  margin: 0 auto;
  border-radius: 8px;
  background: #fafafa;
  object-fit: contain;
}

.detail-status {
  margin-top: 6px;
  text-align: center;
  color: var(--muted);
  font-size: 12px;
}

.detail-fields {
  display: grid;
  gap: 12px;
}

.detail-body > .detail-group {
  margin-bottom: 12px;
}

.detail-group {
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

.detail-group:first-child {
  border-top: 0;
  padding-top: 0;
}

.detail-group h3 {
  margin: 0 0 6px;
  font-size: 13px;
}

.detail-kv {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  gap: 4px 10px;
  margin: 0;
}

.detail-kv dt {
  color: var(--muted);
  font-size: 12px;
}

.detail-kv dd {
  margin: 0;
  font-size: 12.5px;
  word-break: break-word;
  white-space: normal;
}

.detail-kv dd.num {
  font-variant-numeric: tabular-nums;
}

.detail-kv dd.pii {
  color: var(--muted);
}

.finance-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.finance-cell {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft2);
  padding: 8px 10px;
}

.finance-label {
  display: block;
  color: var(--muted);
  font-size: 11px;
}

.finance-value {
  display: block;
  margin-top: 2px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.path-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 6px;
}

.path-list li {
  display: grid;
  grid-template-columns: 64px 120px minmax(0, 1fr);
  gap: 8px;
  border-left: 2px solid var(--accent);
  padding: 4px 0 4px 10px;
  font-size: 12.5px;
}

.path-time {
  color: var(--muted);
}

.path-channel {
  font-weight: 600;
}

.path-detail {
  word-break: break-word;
}

/* ---------- states ---------- */
.error-panel {
  padding: 14px;
  border-color: #f0c8c4;
  background: #fffafa;
}

.error-code {
  color: var(--muted);
  font-size: 12px;
}

.loading-panel {
  padding: 16px;
  color: var(--muted);
  font-size: 13px;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 20px;
  transform: translateX(-50%);
  z-index: 200;
  max-width: 92vw;
  padding: 10px 14px;
  border-radius: 8px;
  background: #1c1c1e;
  color: #fff;
  font-size: 13px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
}

.toast.error {
  background: #8f1d17;
}

.boot {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
}

.boot-card {
  width: min(430px, 92vw);
  padding: 28px 24px;
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.08);
  text-align: center;
}

.boot-card h1 {
  margin: 0 0 6px;
  font-size: 20px;
}

.boot-card p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.boot-spinner {
  width: 28px;
  height: 28px;
  margin: 0 auto 14px;
  border: 3px solid #e5e5e8;
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.boot-actions {
  margin-top: 14px;
}

.boot-detail {
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
}

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  .kpi-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .nav {
    width: 150px;
    flex-basis: 150px;
  }
}

@media (max-width: 820px) {
  .layout {
    flex-direction: column;
    align-items: stretch;
  }

  main {
    width: 100%;
  }

  .nav {
    position: static;
    width: 100%;
    flex: 0 0 auto;
    max-height: none;
    display: flex;
    align-items: center;
    gap: 2px;
    overflow-x: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    padding: 4px 8px;
  }

  .nav-heading,
  .nav-note {
    display: none;
  }

  .nav-button {
    width: auto;
    white-space: nowrap;
    border-left: 0;
    border-bottom: 3px solid transparent;
    padding: 8px 11px;
  }

  .nav-button.active {
    border-left: 0;
    border-bottom-color: var(--accent);
  }

  main {
    padding: 12px 12px 32px;
  }

  .kpi-grid {
    grid-template-columns: 1fr;
  }

  .card-grid {
    grid-template-columns: 1fr;
  }

  .topbar {
    gap: 7px;
  }

  .ctrl {
    width: 100%;
  }

  .ctrl select,
  .ctrl input[type="date"] {
    flex: 1 1 120px;
  }

  .maturity-note {
    margin-left: 0;
  }

  .scope-chip {
    max-width: 100%;
  }

  .chart-tip {
    max-width: 200px;
  }
}

@media (max-width: 560px) {
  .badge {
    font-size: 10px;
  }

  #viewHead h1 {
    font-size: 18px;
  }

  .detail-kv {
    grid-template-columns: 1fr;
  }

  .detail-kv dt {
    margin-top: 4px;
  }

  .finance-grid {
    grid-template-columns: 1fr 1fr;
  }

  .path-list li {
    grid-template-columns: 56px minmax(0, 1fr);
  }

  .path-detail {
    grid-column: 1 / -1;
  }

  .panel-head {
    gap: 6px;
  }

  .table-search {
    max-width: none;
  }
}

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