:root {
  --ink: #191615;
  --muted: #6d6864;
  --line: #e6e0dc;
  --paper: #fffdfb;
  --surface: #ffffff;
  --rose: #b9545d;
  --rose-dark: #88353e;
  --sage: #6e8376;
  --blue: #506f8e;
  --gold: #b2894c;
  --black: #111111;
  --soft-rose: #f7e8e9;
  --soft-sage: #eaf0ec;
  --soft-blue: #e9f0f6;
  --soft-gold: #f6efe3;
  --shadow: 0 18px 46px rgba(29, 24, 20, 0.08);
  font-family: "Microsoft YaHei", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  display: grid;
  grid-template-columns: 264px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 16px 12px;
  border-right: 1px solid var(--line);
  background: #fffaf8;
  overflow-y: auto;
}

.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 6px 6px 14px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  background: var(--black);
  color: #fff;
  font-weight: 800;
  letter-spacing: 0;
}

.brand-name {
  font-size: 20px;
  font-weight: 800;
}

.brand-sub {
  margin-top: 3px;
  color: var(--muted);
  font-size: 13px;
}

.nav-group {
  margin: 10px 0 14px;
  padding: 6px;
  border-left: 3px solid transparent;
  border-radius: 8px;
  background: transparent;
}

.nav-group:not(.collapsed) {
  border-left-color: #c96a72;
  background: rgba(255, 255, 255, 0.76);
}

.nav-group.active-group {
  border-left-color: var(--rose-dark);
  background: #f7e8e9;
}

.nav-toggle {
  width: 100%;
  min-height: 38px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #4b4540;
  font-size: 14px;
  font-weight: 900;
  text-align: left;
}

.nav-toggle:hover {
  background: #fff;
  color: var(--ink);
}

.nav-group:not(.collapsed) .nav-toggle,
.nav-group.active-group .nav-toggle {
  color: var(--rose-dark);
}

.nav-group.collapsed .nav-toggle {
  color: #6d6864;
}

.nav-count {
  min-width: 24px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: #fff;
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
}

.nav-group.active-group .nav-count {
  background: var(--rose-dark);
  border-color: var(--rose-dark);
  color: #fff;
}

.toc {
  display: grid;
  gap: 4px;
  max-height: 280px;
  overflow-y: auto;
  margin: 2px 0 0 8px;
  padding-left: 10px;
  border-left: 1px solid #eadbd8;
}

.toc a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 32px;
  color: var(--ink);
  text-decoration: none;
  padding: 7px 9px 7px 11px;
  border-radius: 6px;
  font-size: 13px;
}

.toc a:hover {
  background: #fff;
  color: var(--rose-dark);
}

.toc a.active {
  background: var(--rose-dark);
  color: #fff;
}

.nav-pill {
  min-width: 18px;
  height: 18px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: #fff;
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 11px;
  line-height: 1;
}

.main {
  padding: 18px 24px 42px;
  min-width: 0;
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: flex-start;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.eyebrow {
  margin: 0 0 8px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--rose-dark);
  font-weight: 800;
}

h1,
h2,
h3,
p {
  letter-spacing: 0;
}

h1 {
  margin: 0;
  font-size: 36px;
  line-height: 1.2;
}

h2 {
  margin: 0;
  font-size: 22px;
}

h3 {
  margin: 0;
  font-size: 16px;
}

.page-intro {
  max-width: 760px;
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.7;
}

.top-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
  align-items: center;
}

.user-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 12px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--muted);
  font-size: 13px;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--sage);
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid var(--black);
  border-radius: 6px;
  background: var(--black);
  color: #fff;
  text-decoration: none;
  font-size: 13px;
  font-weight: 700;
}

.button.secondary {
  background: #fff;
  color: var(--ink);
  border-color: var(--line);
}

.button.rose {
  background: var(--rose-dark);
  border-color: var(--rose-dark);
}

.button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.content {
  display: grid;
  gap: 14px;
  padding-top: 14px;
}

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

.metric-card,
.panel,
.module-card,
.status-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.metric-card {
  min-height: 98px;
  padding: 14px;
}

.metric-label {
  color: var(--muted);
  font-size: 13px;
}

.metric-value {
  margin-top: 12px;
  font-size: 26px;
  font-weight: 800;
}

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

.panel {
  padding: 14px;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 10px;
}

.panel-title {
  display: grid;
  gap: 5px;
}

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

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.field {
  display: grid;
  gap: 5px;
}

.field label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.input,
.select {
  height: 40px;
  min-width: 180px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  outline: none;
}

.overview-filter-panel {
  display: grid;
  gap: 12px;
}

.overview-filter-grid {
  display: grid;
  grid-template-columns: minmax(180px, 0.75fr) minmax(220px, 1fr) minmax(360px, 1.35fr);
  gap: 12px;
  align-items: end;
}

.field > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.slicer-row,
.segmented-control {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.slicer-chip,
.segment {
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
}

.slicer-chip.active,
.segment.active {
  border-color: var(--rose-dark);
  background: var(--rose-dark);
  color: #fff;
}

.trend-panel {
  display: grid;
  gap: 12px;
}

.trend-chart {
  height: 260px;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(34px, 1fr);
  gap: 8px;
  align-items: end;
  overflow-x: auto;
  padding: 12px 8px 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.trend-point {
  min-width: 34px;
  height: 100%;
  display: grid;
  grid-template-rows: 1fr auto;
  gap: 8px;
  align-items: end;
  text-align: center;
}

.trend-bar {
  width: 100%;
  min-height: 8px;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 5px;
  border-radius: 6px 6px 2px 2px;
  background: linear-gradient(180deg, var(--rose), var(--blue));
  color: #fff;
  font-size: 11px;
  font-weight: 800;
}

.trend-point:nth-child(3n) .trend-bar {
  background: linear-gradient(180deg, var(--sage), var(--gold));
}

.trend-point em {
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
  white-space: nowrap;
}
.return-reason-panel { display: grid; gap: 12px; }
.return-reason-chart { display: grid; gap: 12px; padding: 14px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.return-reason-row { display: grid; grid-template-columns: minmax(220px, 0.9fr) minmax(240px, 2fr) 112px; gap: 12px; align-items: center; min-height: 28px; }
.return-reason-label, .return-reason-value { font-size: 12px; font-weight: 800; }
.return-reason-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.return-reason-track { height: 16px; overflow: hidden; border-radius: 4px; background: var(--soft-blue); }
.return-reason-fill { height: 100%; min-width: 6px; border-radius: 4px; background: var(--blue); }
.return-reason-row:nth-child(3n) .return-reason-fill { background: var(--sage); }
.return-reason-row:nth-child(3n + 2) .return-reason-fill { background: var(--rose-dark); }
.return-reason-value { color: var(--ink); text-align: right; white-space: nowrap; }
.return-reason-value span { margin-left: 4px; color: var(--muted); font-weight: 600; }
@media (max-width: 760px) { .return-reason-row { grid-template-columns: minmax(150px, 1fr) 82px; gap: 8px; } .return-reason-track { grid-column: 1 / -1; grid-row: 2; } .return-reason-value { grid-column: 2; grid-row: 1; } }
.grid-2 {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(320px, 0.75fr);
  gap: 16px;
}

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

.module-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.module-card {
  min-height: 112px;
  padding: 16px;
  display: grid;
  gap: 12px;
  align-content: start;
}

.module-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.module-card p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  background: var(--soft-sage);
  color: var(--sage);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.badge.rose {
  background: var(--soft-rose);
  color: var(--rose-dark);
}

.badge.blue {
  background: var(--soft-blue);
  color: var(--blue);
}

.badge.gold {
  background: var(--soft-gold);
  color: var(--gold);
}

.pipeline {
  display: grid;
  grid-template-columns: repeat(7, minmax(110px, 1fr));
  gap: 10px;
}

.pipeline-step {
  min-height: 76px;
  padding: 12px;
  border: 1px solid var(--line);
  background: #fbf8f6;
  border-radius: 8px;
}

.pipeline-step strong {
  display: block;
  margin-bottom: 8px;
  font-size: 14px;
}

.pipeline-step span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.data-table th,
.data-table td {
  padding: 12px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  font-size: 13px;
  word-break: break-word;
}

.data-table th {
  color: var(--muted);
  background: #fbf8f6;
  font-weight: 800;
}

.data-table tr:last-child td {
  border-bottom: 0;
}


.loading-panel {
  min-height: 180px;
  display: grid;
  place-items: center;
  gap: 10px;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  text-align: center;
  box-shadow: var(--shadow);
}

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

.loading-line {
  width: min(420px, 100%);
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--soft-rose);
}

.loading-line::after {
  content: "";
  display: block;
  width: 38%;
  height: 100%;
  border-radius: inherit;
  background: var(--rose-dark);
  animation: loading-slide 1.1s ease-in-out infinite;
}

@keyframes loading-slide {
  0% { transform: translateX(-110%); }
  100% { transform: translateX(270%); }
}

.tool-strip {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}

.tool-strip h2 {
  margin-top: 10px;
}

.tool-strip p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.tool-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.embed-shell {
  min-height: calc(100vh - 238px);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
  box-shadow: var(--shadow);
}

.tool-frame {
  width: 100%;
  height: calc(100vh - 238px);
  min-height: 680px;
  display: block;
  border: 0;
  background: #fff;
}

.embed-fallback {
  min-height: 520px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 10px;
  padding: 28px;
  text-align: center;
}

.embed-fallback p {
  max-width: 560px;
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.empty-state {
  min-height: 128px;
  display: grid;
  place-items: center;
  padding: 18px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: #fff;
  text-align: center;
}

.empty-state strong {
  display: block;
  margin-bottom: 8px;
}

.empty-state p {
  max-width: 520px;
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
  font-size: 13px;
}

.chart-shell {
  height: 220px;
  display: grid;
  grid-template-columns: 52px repeat(6, 1fr);
  gap: 10px;
  align-items: end;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.axis-labels {
  display: grid;
  gap: 24px;
  align-self: stretch;
  color: var(--muted);
  font-size: 12px;
}

.bar {
  min-height: 32px;
  border-radius: 6px 6px 0 0;
  background: linear-gradient(180deg, var(--rose), var(--blue));
}

.bar:nth-child(3n) {
  background: linear-gradient(180deg, var(--sage), var(--gold));
}

.login-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(320px, 0.9fr) minmax(360px, 1.1fr);
  background: var(--paper);
}

.login-visual {
  padding: 42px;
  display: grid;
  align-content: space-between;
  background: #111;
  color: #fff;
}

.login-visual h1 {
  max-width: 560px;
  font-size: 52px;
  line-height: 1.08;
}

.login-visual p {
  max-width: 560px;
  color: rgba(255, 255, 255, 0.74);
  line-height: 1.8;
}

.login-card {
  width: min(520px, calc(100% - 48px));
  justify-self: center;
  align-self: center;
  padding: 26px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}


.auth-heading {
  display: grid;
  gap: 8px;
  margin-bottom: 18px;
}

.auth-heading h2 {
  font-size: 26px;
}

.auth-heading p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.auth-switch {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.auth-switch a {
  color: var(--rose-dark);
  font-weight: 800;
  text-decoration: none;
}
.sso-panel {
  display: grid;
  gap: 8px;
  margin: 0 0 16px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
}

.sso-panel .button {
  width: 100%;
}

.sso-panel p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
  text-align: center;
}
.tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 18px;
}

.tab {
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--muted);
  font-weight: 800;
}

.tab.active {
  background: var(--black);
  border-color: var(--black);
  color: #fff;
}

.form {
  display: grid;
  gap: 14px;
}

.form .input {
  width: 100%;
}

.notice {
  padding: 12px 14px;
  border-radius: 6px;
  background: var(--soft-blue);
  color: var(--blue);
  font-size: 13px;
  line-height: 1.6;
}

.notice.error {
  background: var(--soft-rose);
  color: var(--rose-dark);
}

.permission-grid {
  overflow-x: auto;
}

.matrix-cell {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}

.checkbox {
  width: 16px;
  height: 16px;
  accent-color: var(--rose-dark);
}

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

.status-card {
  min-height: 88px;
  padding: 16px;
}

.status-card strong {
  display: block;
  margin-bottom: 10px;
}

.status-card p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.locked {
  opacity: 0.52;
}

.footer-note {
  padding-top: 6px;
  color: var(--muted);
  font-size: 12px;
}

@media (max-width: 1120px) {
  .metric-grid,
  .module-grid,
  .grid-3,
  .status-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .pipeline {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 820px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
  }

  .main {
    padding: 22px 18px 48px;
  }

  .topbar,
  .tool-strip {
    display: grid;
  }

  .top-actions {
    justify-content: flex-start;
  }

  .metric-grid,
  .module-grid,
  .grid-3,
  .status-row,
  .pipeline,
  .overview-filter-grid,
  .dictionary-search-form,
  .login-page {
    grid-template-columns: 1fr;
  }

  .tool-actions {
    justify-content: flex-start;
  }

  .embed-shell,
  .tool-frame {
    min-height: 560px;
    height: 560px;
  }

  .login-visual {
    min-height: 360px;
  }
}


.nav-group.active-group.collapsed {
  background: transparent;
  border-left-color: #d9b2ad;
}

.nav-group.active-group:not(.collapsed) {
  background: #f7e8e9;
}

.floating-embed-shell {
  position: relative;
}

.floating-open {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 5;
  background: rgba(255, 255, 255, 0.94);
  border-color: rgba(25, 22, 21, 0.16);
  box-shadow: 0 10px 24px rgba(29, 24, 20, 0.14);
  backdrop-filter: blur(8px);
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
}

.table-wrap .data-table {
  min-width: 920px;
}

.dictionary-search-panel {
  display: grid;
  gap: 14px;
}

.dictionary-search-form {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(160px, 220px) auto;
  gap: 10px;
}

.dictionary-search-input {
  width: 100%;
}

.dictionary-source-note {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.dictionary-recent-panel {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbf8f6;
}

.dictionary-recent-panel p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.recent-query-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.recent-query {
  min-height: 34px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
}

.recent-query:hover {
  border-color: var(--rose-dark);
  color: var(--rose-dark);
}

.dictionary-result-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 12px;
}

.dictionary-result-head strong {
  color: var(--ink);
  font-size: 13px;
}
.dictionary-panel {
  display: grid;
  gap: 14px;
}

.source-card {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbf8f6;
}

.source-card strong {
  font-size: 15px;
}

.source-card p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.dictionary-list {
  display: grid;
  gap: 10px;
}

.dictionary-item {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.dictionary-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
}

.dictionary-head h3 {
  margin-top: 8px;
}

.dictionary-owner {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.dictionary-item p {
  margin: 0;
  color: var(--ink);
  line-height: 1.7;
}

.dictionary-item dl {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
}

.dictionary-item dl div {
  min-width: 0;
  padding: 10px;
  border-radius: 8px;
  background: #fbf8f6;
}

.dictionary-item dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.dictionary-item dd {
  margin: 6px 0 0;
  font-size: 13px;
  line-height: 1.6;
  word-break: break-word;
}

@media (max-width: 760px) {
  .dictionary-item dl {
    grid-template-columns: 1fr;
  }

  .floating-open {
    top: 8px;
    right: 8px;
  }
}

.toc[hidden] {
  display: none !important;
}


.task-notification-control {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.task-notification-state {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.task-notification-state.on { color: #147a55; border-color: #9dd7be; background: #eefaf4; }
.task-notification-state.off { color: #a34a4a; border-color: #e6b3b3; background: #fff4f4; }
.task-notification-state.unknown { color: var(--muted); background: #f6f7f9; }
.task-overview-panel {
  display: grid;
  gap: 12px;
}

.task-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.task-card {
  min-width: 0;
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.task-card.is-active {
  border-color: #d9cac5;
}

.task-card-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.task-card-header h3 {
  margin-top: 8px;
}

.task-card-header p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 12px;
  word-break: break-word;
}

.task-type {
  flex: 0 0 auto;
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.task-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
}

.task-detail-grid div {
  min-width: 0;
  padding: 9px;
  border-radius: 6px;
  background: #fbf8f6;
}

.task-detail-grid dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.task-detail-grid dd {
  margin: 5px 0 0;
  font-size: 12px;
  line-height: 1.55;
  word-break: break-word;
}

.task-actions {
  min-height: 38px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.task-options-wrap {
  position: relative;
}

.task-options-toggle {
  min-height: 38px;
}

.task-options-menu {
  position: absolute;
  z-index: 20;
  top: calc(100% + 8px);
  right: 0;
  width: 240px;
  max-width: calc(100vw - 48px);
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 14px 30px rgba(40, 31, 28, .14);
}

.task-option-item {
  width: 100%;
  display: grid;
  gap: 3px;
  padding: 9px 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.task-option-item:hover:not(:disabled),
.task-option-item:focus-visible {
  outline: none;
  background: #fbf8f6;
}

.task-option-item:disabled {
  color: #a9a0a0;
  cursor: not-allowed;
}

.task-option-item span {
  font-size: 12px;
  font-weight: 800;
}

.task-option-item small {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.task-options-divider {
  height: 1px;
  margin: 5px 4px;
  background: var(--line);
}

.task-options-empty {
  padding: 9px 10px;
  color: var(--muted);
  font-size: 12px;
}

.task-switch {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px 0 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.task-switch::before {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: currentColor;
}

.task-switch.on {
  border-color: #cad8ce;
  background: var(--soft-sage);
  color: var(--sage);
}

.task-switch.off {
  border-color: #eadbd8;
  background: var(--soft-rose);
  color: var(--rose-dark);
}

.task-command {
  min-height: 38px;
}

.task-action-hint {
  color: var(--muted);
  font-size: 12px;
}

.task-qa {
  display: grid;
  gap: 10px;
  margin: 0 0 14px;
  padding: 0 0 14px;
  border-bottom: 1px solid var(--line);
}

.task-qa-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
}

.task-qa-head h3 {
  margin: 0;
  font-size: 15px;
}

.task-qa-head span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.task-qa-log {
  min-height: 118px;
  max-height: 220px;
  display: grid;
  align-content: start;
  gap: 8px;
  overflow: auto;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbf8f6;
}

.task-qa-message {
  max-width: 92%;
  display: grid;
  gap: 8px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font-size: 12px;
  line-height: 1.6;
  word-break: break-word;
}

.task-qa-message.user {
  justify-self: end;
  border-color: #d9cac5;
  background: var(--soft-rose);
}

.task-qa-message.assistant {
  justify-self: start;
}

.task-qa-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.task-qa-form .input {
  min-width: 0;
}

.task-qa-action {
  justify-self: start;
}

@media (max-width: 960px) {
  .task-grid,
  .task-detail-grid {
    grid-template-columns: 1fr;
  }
}
.task-management-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(340px, 0.65fr);
  gap: 14px;
  align-items: start;
}


.task-filter-bar {
  display: grid;
  grid-template-columns: minmax(220px, 1.2fr) repeat(3, minmax(130px, 0.65fr)) auto;
  gap: 10px;
  align-items: end;
  padding: 0 0 12px;
  border-bottom: 1px solid var(--line);
}

.task-filter-bar .field {
  min-width: 0;
  gap: 6px;
}

.task-filter-bar .button {
  min-height: 40px;
}

.task-list-meta {
  padding: 10px 12px 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}
.task-list-panel,
.task-detail-panel {
  min-width: 0;
}

.task-detail-panel {
  position: sticky;
  top: 18px;
}

.task-list-head,
.task-list-row {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) 116px 112px 86px minmax(190px, 0.75fr);
  gap: 10px;
  align-items: center;
}

.task-list-head {
  padding: 8px 12px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.task-list {
  display: grid;
}

.task-list-row {
  width: 100%;
  min-height: 86px;
  padding: 10px 12px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  text-align: left;
}

.task-list-row:hover,
.task-list-row[aria-pressed="true"] {
  background: #fbf8f6;
}

.task-list-row[aria-pressed="true"] {
  box-shadow: inset 3px 0 0 var(--rose-dark);
}

.task-row-main {
  min-width: 0;
  display: grid;
  gap: 5px;
}

.task-row-title {
  font-size: 14px;
  font-weight: 900;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.task-row-desc {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.task-row-type,
.task-row-state,
.task-row-time {
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}


.task-row-status {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.task-row-status small,
.task-row-type small,
.task-row-time span {
  min-width: 0;
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.task-row-type small {
  margin-top: 4px;
  white-space: normal;
  line-height: 1.35;
}


.task-row-state {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.task-row-state::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: currentColor;
}

.task-row-state.on {
  color: var(--sage);
}

.task-row-state.off {
  color: var(--rose-dark);
}

.task-detail-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 12px;
}

.task-detail-head h2 {
  margin-top: 8px;
  font-size: 20px;
}

.task-detail-head p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 12px;
  word-break: break-word;
}

@media (max-width: 1180px) {
  .task-management-layout {
    grid-template-columns: 1fr;
  }

  .task-detail-panel {
    position: static;
  }
}

@media (max-width: 860px) {
  .task-filter-bar {
    grid-template-columns: 1fr;
  }

  .task-list-head {
    display: none;
  }

  .task-list-row {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
  }

  .task-row-main,
  .task-row-status,
  .task-row-time {
    grid-column: 1 / -1;
  }

  .task-row-type {
    grid-column: 1;
  }
}
.task-row-name {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.task-row-purpose {
  white-space: normal;
  line-height: 1.35;
}

.task-history-panel {
  margin-top: 14px;
}

.task-history-filter-bar {
  display: grid;
  grid-template-columns: minmax(220px, 1.2fr) minmax(130px, 0.45fr) minmax(180px, 0.8fr) auto;
  gap: 10px;
  align-items: end;
  padding: 0 0 12px;
  border-bottom: 1px solid var(--line);
}

.task-history-filter-bar .field {
  min-width: 0;
  gap: 6px;
}

.task-history-meta {
  padding: 10px 12px 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.task-history-head,
.task-history-row summary {
  display: grid;
  grid-template-columns: minmax(180px, 0.75fr) minmax(260px, 1fr) 110px 82px minmax(120px, 0.45fr);
  gap: 10px;
  align-items: center;
}

.task-history-head {
  padding: 8px 12px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.task-history-list {
  display: grid;
}

.task-history-row {
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.task-history-row summary {
  min-height: 58px;
  padding: 10px 12px;
  cursor: pointer;
  list-style: none;
}

.task-history-row summary::-webkit-details-marker {
  display: none;
}

.task-history-row[open] summary,
.task-history-row summary:hover {
  background: #fbf8f6;
}

.task-history-time,
.task-history-row summary > span:last-child {
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.task-history-task {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.task-history-task strong,
.task-history-task small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.task-history-task strong {
  font-size: 13px;
  font-weight: 900;
}

.task-history-task small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.task-history-detail-body {
  display: grid;
  gap: 10px;
  padding: 0 12px 12px;
}

.task-history-detail-body dl {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
}

.task-history-detail-body dl div,
.task-history-message,
.task-history-error-block,
.task-history-output-block {
  min-width: 0;
  padding: 9px;
  border-radius: 6px;
  background: #fbf8f6;
}

.task-history-detail-body dt,
.task-history-message strong,
.task-history-error-block strong,
.task-history-output-block strong {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.task-history-detail-body dd,
.task-history-message p {
  margin: 5px 0 0;
  font-size: 12px;
  line-height: 1.55;
  word-break: break-word;
}

.task-history-error-block {
  border: 1px solid #eadbd8;
  background: var(--soft-rose);
}

.task-history-error-block pre,
.task-history-output-block pre {
  max-height: 220px;
  margin: 8px 0 0;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 11px;
  line-height: 1.55;
}

.task-detail-history {
  display: grid;
  gap: 10px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.task-section-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
}

.task-section-head h3 {
  margin: 0;
  font-size: 15px;
}

.task-section-head span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.task-history-row.compact summary {
  grid-template-columns: minmax(120px, 0.75fr) minmax(180px, 1fr) 72px 68px minmax(86px, 0.45fr);
  gap: 8px;
}

.task-history-row.compact .task-history-detail-body dl {
  grid-template-columns: 1fr;
}

@media (max-width: 860px) {
  .task-history-filter-bar,
  .task-history-detail-body dl {
    grid-template-columns: 1fr;
  }

  .task-history-head {
    display: none;
  }

  .task-history-row summary,
  .task-history-row.compact summary {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .task-history-time,
  .task-history-task,
  .task-history-row summary > span:last-child {
    grid-column: 1 / -1;
  }
}

.admin-create-form {
  display: grid;
  grid-template-columns: repeat(5, minmax(140px, 1fr)) auto;
  gap: 10px;
  align-items: end;
}

.admin-create-form .input,
.admin-create-form .select {
  min-width: 0;
  width: 100%;
}

.compact-member-list {
  display: grid;
  gap: 10px;
}

.member-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
}

.member-card.expanded {
  border-color: #d7b9b2;
  box-shadow: 0 12px 30px rgba(29, 24, 20, 0.07);
}

.member-header {
  width: 100%;
  min-height: 62px;
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  padding: 12px 14px;
  border: 0;
  background: #fff;
  color: inherit;
  text-align: left;
}

.member-card.expanded .member-header {
  background: #fbf4f2;
}

.member-meta {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.member-meta strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 15px;
}

.member-meta span {
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.member-brief {
  display: inline-flex;
  flex-shrink: 0;
  gap: 10px;
  align-items: center;
}

.member-chevron {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 16px;
  line-height: 1;
}

.permission-editor {
  padding: 12px 14px 16px;
  border-top: 1px solid var(--line);
  background: #fffdfb;
}

.permission-editor-bar {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 12px;
}

.role-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.permission-matrix {
  display: grid;
  gap: 12px;
}

.permission-matrix.full-access {
  opacity: 0.86;
}

.permission-group {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.permission-group-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  background: #f6efe3;
}

.permission-group-head strong {
  display: block;
  font-size: 15px;
}

.permission-group-head span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.group-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 12px;
}

.permission-group-body {
  display: grid;
}

.permission-row {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 84px 84px;
  gap: 12px;
  align-items: center;
  padding: 11px 14px;
  border-top: 1px solid #f1ece8;
}

.permission-row:first-child {
  border-top: 0;
}

.perm-module {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.perm-module strong {
  font-size: 14px;
}

.perm-module span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.textarea {
  width: 100%;
  min-height: 190px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  line-height: 1.6;
  resize: vertical;
  outline: none;
}

.textarea:focus,
.input:focus,
.select:focus {
  border-color: var(--rose-dark);
  box-shadow: 0 0 0 3px rgba(136, 53, 62, 0.1);
}


@media (max-width: 1180px) {
  .admin-create-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .admin-create-form .button {
    grid-column: 1 / -1;
  }
}

@media (max-width: 760px) {
  .admin-create-form,
  .permission-row {
    grid-template-columns: 1fr;
  }

  .member-header,
  .permission-editor-bar,
  .permission-group-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .member-brief,
  .group-actions {
    justify-content: flex-start;
  }

  .member-meta span {
    white-space: normal;
  }
}
.inquiry-filter-panel {
  display: grid;
  gap: 12px;
}

.inquiry-filter-grid {
  display: grid;
  grid-template-columns: minmax(120px, 0.6fr) repeat(2, minmax(150px, 0.75fr)) minmax(180px, 1fr) minmax(150px, 0.8fr) minmax(220px, 1.2fr);
  gap: 10px;
  align-items: end;
}

.inquiry-search-field .input {
  width: 100%;
}

.inquiry-overview-grid {
  align-items: start;
}

.insight-bar-list {
  display: grid;
  gap: 10px;
}

.insight-bar-row {
  width: 100%;
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  text-align: left;
}

.insight-bar-row:hover {
  border-color: #d9cac5;
  background: #fbf8f6;
}

.insight-bar-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.insight-bar-head strong {
  min-width: 0;
  font-size: 14px;
}

.insight-bar-head span,
.insight-bar-meta {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.insight-track {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #f1ebe8;
}

.insight-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--rose), var(--blue));
}

.score-split {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.score-tile {
  min-height: 116px;
  display: grid;
  align-content: start;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  text-align: left;
}

.score-tile:hover {
  border-color: #d9cac5;
  background: #fbf8f6;
}

.score-tile strong {
  font-size: 28px;
  line-height: 1;
}

.score-tile p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.case-tag-wrap {
  display: grid;
  gap: 10px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.case-tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.case-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
}

.case-tag:hover {
  border-color: var(--rose-dark);
  color: var(--rose-dark);
}

.case-tag strong {
  color: var(--muted);
}

.case-library-panel {
  display: grid;
  gap: 12px;
}

.case-library {
  display: grid;
  gap: 10px;
}

.case-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 110px;
  gap: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.case-row-main {
  min-width: 0;
  display: grid;
  gap: 10px;
}

.case-row-title {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.case-row-title strong {
  font-size: 15px;
}

.case-row-title span:last-child {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.case-question,
.case-reply {
  margin: 0;
  padding: 10px;
  border-radius: 8px;
  font-size: 13px;
  line-height: 1.65;
  word-break: break-word;
}

.case-question {
  background: #fbf8f6;
  color: var(--ink);
}

.case-reply {
  border: 1px solid #e4ece6;
  background: var(--soft-sage);
  color: #34473b;
}

.case-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.case-tags span {
  min-height: 24px;
  display: inline-flex;
  align-items: center;
  padding: 0 8px;
  border-radius: 999px;
  background: #fbf8f6;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.case-score {
  display: grid;
  align-content: start;
  justify-items: end;
  gap: 8px;
  color: var(--muted);
  font-size: 11px;
  word-break: break-all;
}

.case-score strong {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border-radius: 999px;
  background: var(--black);
  color: #fff;
  font-size: 22px;
}

@media (max-width: 1180px) {
  .inquiry-filter-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .inquiry-filter-grid,
  .score-split,
  .case-row {
    grid-template-columns: 1fr;
  }

  .case-score {
    justify-items: start;
  }
}

.locale-switch {
  position: fixed;
  top: 14px;
  right: 18px;
  z-index: 20;
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid rgba(25, 22, 21, 0.14);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 10px 24px rgba(29, 24, 20, 0.12);
  backdrop-filter: blur(8px);
}

.locale-switch button {
  min-width: 52px;
  height: 30px;
  padding: 0 10px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.locale-switch button[aria-pressed="true"] {
  background: var(--black);
  color: #fff;
}

.trend-chart.line-chart {
  height: auto;
  display: block;
  overflow-x: auto;
  padding: 12px;
  align-items: initial;
}

.trend-line-wrap {
  min-height: 278px;
}

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

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

.trend-axis-line,
.trend-axis-tick {
  stroke: #b7a9a2;
  stroke-width: 1.2;
}

.trend-axis-label,
.trend-axis-title {
  fill: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.trend-axis-title {
  font-size: 10px;
}

.trend-area {
  fill: rgba(185, 84, 93, 0.12);
}

.trend-line {
  fill: none;
  stroke: var(--rose-dark);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.trend-dot {
  fill: #fff;
  stroke: var(--rose-dark);
  stroke-width: 3;
}

.trend-svg-value {
  fill: var(--ink);
  font-size: 11px;
  font-weight: 900;
}

.trend-x-labels {
  display: grid;
  gap: 6px;
  padding: 0 30px 2px 62px;
}

.trend-x-labels span {
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 760px) {
  .locale-switch {
    top: 10px;
    right: 10px;
  }
}

body[data-page="htoOrders"] {
  background: #fffdfc;
}

body[data-page="htoOrders"] .sidebar {
  background: #fff8f9;
}

body[data-page="htoOrders"] .topbar {
  border-bottom-color: #ead7dc;
}

body[data-page="htoOrders"] .topbar .eyebrow,
body[data-page="htoOrders"] .nav-group:not(.collapsed) .nav-toggle,
body[data-page="htoOrders"] .nav-group.active-group .nav-toggle {
  color: #7a2148;
}

body[data-page="htoOrders"] .nav-group:not(.collapsed),
body[data-page="htoOrders"] .nav-group.active-group {
  border-left-color: #7a2148;
  background: #fbf2f5;
}

body[data-page="htoOrders"] .button,
body[data-page="htoOrders"] .segment.active,
body[data-page="htoOrders"] .slicer-chip.active {
  background: #111;
  border-color: #111;
  color: #fff;
}

body[data-page="htoOrders"] .button.secondary {
  background: #fff;
  border-color: #e5d6da;
  color: #191615;
}

.hto-brand-strip {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  padding: 18px 20px;
  border: 1px solid #ead7dc;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 18px 42px rgba(122, 33, 72, 0.08);
}

.hto-brand-strip h2 {
  margin-top: 4px;
  font-size: 28px;
  font-family: Georgia, "Times New Roman", serif;
  color: #111;
}

.hto-brand-strip p {
  margin: 8px 0 0;
  color: #6c555d;
  font-size: 13px;
  font-weight: 800;
}

.hto-brand-palette {
  display: inline-flex;
  flex-shrink: 0;
  gap: 8px;
  align-items: center;
}

.hto-brand-palette span {
  width: 28px;
  height: 28px;
  border: 1px solid rgba(25, 22, 21, 0.12);
  border-radius: 999px;
  background: var(--swatch);
}

.hto-source-note {
  border: 1px solid #ead7dc;
  background: #fbf2f5;
  color: #7a2148;
}

.hto-metric-grid {
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

.hto-metric-card {
  min-height: 142px;
  border-color: #ead7dc;
  background: #fff;
  box-shadow: 0 16px 34px rgba(122, 33, 72, 0.07);
}

.hto-metric-card .metric-label {
  min-height: 34px;
  color: #6c555d;
  font-weight: 900;
}

.hto-metric-card .metric-value {
  color: #111;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 27px;
}

.hto-delta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.hto-delta {
  min-height: 24px;
  display: inline-flex;
  align-items: center;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 900;
}

.hto-delta.up {
  background: #edf3ef;
  color: #3f684e;
}

.hto-delta.down {
  background: #fbf2f5;
  color: #7a2148;
}

.hto-funnel {
  display: grid;
  gap: 10px;
}

.hto-funnel-step {
  display: grid;
  grid-template-columns: minmax(160px, 0.35fr) minmax(220px, 1fr) minmax(180px, 0.35fr);
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid #ead7dc;
  border-radius: 8px;
  background: #fff;
}

.hto-funnel-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.hto-funnel-head span,
.hto-column strong,
.hto-style-main strong {
  color: #111;
  font-weight: 900;
}

.hto-funnel-head strong {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 22px;
  color: #7a2148;
}

.hto-funnel-track,
.hto-style-track {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #f2e5e9;
}

.hto-funnel-track span,
.hto-style-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: #7a2148;
}

.hto-funnel-meta {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  color: #6c555d;
  font-size: 12px;
  font-weight: 800;
}

.hto-trend-toolbar .select {
  min-width: 118px;
}

.hto-line-chart .trend-line {
  stroke: #7a2148;
}

.hto-line-chart .trend-area {
  fill: rgba(122, 33, 72, 0.1);
}

.hto-line-chart .trend-dot {
  stroke: #7a2148;
}

.hto-chart-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.hto-column-chart {
  min-height: 260px;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(76px, 1fr);
  gap: 12px;
  align-items: end;
  overflow-x: auto;
  padding: 8px 4px 2px;
}

.hto-column {
  min-width: 76px;
  height: 246px;
  display: grid;
  grid-template-rows: auto 1fr auto auto;
  gap: 8px;
  text-align: center;
}

.hto-column-value {
  color: #7a2148;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.hto-column-plot {
  display: flex;
  align-items: end;
  justify-content: center;
  min-height: 128px;
}

.hto-column-plot span {
  width: min(44px, 80%);
  min-height: 8px;
  border-radius: 6px 6px 1px 1px;
  background: #7a2148;
}

.hto-column:nth-child(2n) .hto-column-plot span {
  background: #263957;
}

.hto-column:nth-child(3n) .hto-column-plot span {
  background: #9ba995;
}

.hto-column strong {
  min-height: 34px;
  overflow-wrap: anywhere;
  font-size: 12px;
  line-height: 1.35;
}

.hto-column em {
  color: #6c555d;
  font-size: 11px;
  font-style: normal;
  font-weight: 800;
}

.hto-style-list {
  display: grid;
  gap: 10px;
}

.hto-style-row {
  display: grid;
  grid-template-columns: minmax(230px, 0.38fr) minmax(220px, 1fr) minmax(100px, 0.18fr);
  gap: 14px;
  align-items: center;
  padding: 12px;
  border: 1px solid #ead7dc;
  border-radius: 8px;
  background: #fff;
}

.hto-style-main {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.hto-style-main span,
.hto-style-value span {
  color: #6c555d;
  font-size: 12px;
  line-height: 1.45;
}

.hto-style-value {
  display: grid;
  justify-items: end;
  gap: 4px;
}

.hto-style-value strong {
  color: #7a2148;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 22px;
}

.hto-pie-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.hto-pie-wrap {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  gap: 18px;
  align-items: center;
}

.hto-pie {
  position: relative;
  width: 178px;
  aspect-ratio: 1;
  border-radius: 50%;
  border: 12px solid #fff;
  box-shadow: 0 14px 30px rgba(122, 33, 72, 0.12);
}

.hto-pie-center {
  position: absolute;
  inset: 50% auto auto 50%;
  display: grid;
  width: 92px;
  height: 92px;
  transform: translate(-50%, -50%);
  align-content: center;
  justify-items: center;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 10px rgba(25, 22, 21, 0.08);
}

.hto-pie-center strong {
  color: #191615;
  font-size: 22px;
  line-height: 1;
}

.hto-pie-center span {
  margin-top: 5px;
  color: #6c555d;
  font-size: 11px;
  font-weight: 800;
}

.hto-pie-legend {
  display: grid;
  gap: 10px;
}

.hto-pie-legend div {
  display: grid;
  grid-template-columns: 12px minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.hto-pie-legend span {
  width: 10px;
  height: 10px;
  border-radius: 999px;
}

.hto-pie-legend strong {
  min-width: 0;
  overflow: hidden;
  color: #111;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hto-pie-legend em {
  color: #6c555d;
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
  white-space: nowrap;
}

.hto-detail-panel {
  display: grid;
  gap: 14px;
}

.hto-table-section {
  display: grid;
  gap: 10px;
  padding-top: 12px;
  border-top: 1px solid #ead7dc;
}

.hto-table-section:first-of-type {
  border-top: 0;
  padding-top: 0;
}

.hto-table-section h3 {
  font-size: 15px;
  color: #7a2148;
}

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

.hto-contract-grid div {
  min-width: 0;
  display: grid;
  gap: 6px;
  padding: 12px;
  border: 1px solid #ead7dc;
  border-radius: 8px;
  background: #fff;
}

.hto-contract-grid span {
  color: #6c555d;
  font-size: 12px;
  font-weight: 800;
}

.hto-contract-grid strong {
  overflow-wrap: anywhere;
  color: #111;
  font-size: 13px;
}

.hto-field-cloud {
  margin-top: 12px;
}

body[data-page="htoOrders"] .panel,
body[data-page="htoOrders"] .metric-card,
body[data-page="htoOrders"] .status-card,
body[data-page="htoOrders"] .source-card {
  border-color: #ead7dc;
}

body[data-page="htoOrders"] .panel-title h2 {
  color: #111;
}

body[data-page="htoOrders"] .data-table th {
  background: #fbf2f5;
  color: #7a2148;
}

@media (max-width: 1280px) {
  .hto-metric-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 960px) {
  .hto-metric-grid,
  .hto-chart-grid,
  .hto-pie-grid,
  .hto-contract-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .hto-funnel-step,
  .hto-style-row,
  .hto-pie-wrap {
    grid-template-columns: 1fr;
  }

  .hto-funnel-meta,
  .hto-style-value {
    justify-content: flex-start;
    justify-items: start;
  }
}

@media (max-width: 680px) {
  .hto-brand-strip {
    display: grid;
  }

  .hto-brand-strip h2 {
    font-size: 22px;
  }

  .hto-metric-grid,
  .hto-chart-grid,
  .hto-pie-grid,
  .hto-contract-grid {
    grid-template-columns: 1fr;
  }

  .hto-column-chart {
    grid-auto-columns: minmax(88px, 1fr);
  }
}

.hto-filter-panel {
  box-shadow: 0 16px 34px rgba(122, 33, 72, 0.06);
}

.hto-filter-grid {
  display: grid;
  grid-template-columns: minmax(280px, 1.35fr) repeat(2, minmax(130px, 0.55fr)) minmax(160px, 0.7fr);
  gap: 12px;
  align-items: end;
}

.hto-preset-field .slicer-row {
  gap: 7px;
}

body[data-page="htoOrders"] .slicer-chip {
  min-height: 36px;
  border-color: #ead7dc;
  color: #7a2148;
}

body[data-page="htoOrders"] .slicer-chip.active {
  background: #7a2148;
  border-color: #7a2148;
}


.trend-dot.extreme {
  fill: #7a2148;
  stroke: #fff;
  stroke-width: 2;
}

.trend-extreme-label {
  fill: #7a2148;
  font-size: 11px;
  font-weight: 900;
}

.hto-tabs {
  display: inline-flex;
  width: fit-content;
  gap: 4px;
  padding: 4px;
  border: 1px solid #ead7dc;
  border-radius: 8px;
  background: #fbf2f5;
}

.hto-tab {
  min-height: 36px;
  padding: 0 14px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #7a2148;
  font-size: 13px;
  font-weight: 900;
}

.hto-tab.active {
  background: #111;
  color: #fff;
}

.hto-tab-panel {
  min-width: 0;
}

body[data-page="htoOrders"] .content {
  gap: 12px;
}

body[data-page="htoOrders"] .panel {
  padding: 13px;
}

body[data-page="htoOrders"] .panel-header {
  margin-bottom: 9px;
}

@media (max-width: 1180px) {
  .hto-filter-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .hto-preset-field {
    grid-column: 1 / -1;
  }
}

@media (max-width: 680px) {
  .hto-filter-grid {
    grid-template-columns: 1fr;
  }

  .hto-preset-field {
    grid-column: auto;
  }

  .hto-tabs {
    width: 100%;
  }

  .hto-tab {
    flex: 1;
  }
}

.flow-brand-strip {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 18px;
  padding: 24px 26px;
  background: #f2eee9;
  border-left: 4px solid #88353e;
}
.flow-brand-strip h2 { margin: 6px 0 8px; font-size: 2rem; }
.flow-brand-strip p { margin: 0; color: #625b57; }
.flow-metric-grid { margin-bottom: 18px; }
.flow-primary-grid { align-items: stretch; margin-bottom: 18px; }
.flow-funnel { display: grid; gap: 15px; padding: 8px 0; }
.flow-funnel-step { display: grid; gap: 6px; }
.flow-funnel-head, .flow-funnel-meta { display: flex; justify-content: space-between; gap: 12px; }
.flow-funnel-head strong { color: #88353e; }
.flow-funnel-track, .flow-comparison-track { height: 10px; overflow: hidden; background: #e9e3dd; border-radius: 2px; }
.flow-funnel-track span, .flow-comparison-track span { display: block; height: 100%; background: #88353e; border-radius: inherit; }
.flow-funnel-meta { color: #887d76; font-size: .78rem; }
.flow-source { display: grid; gap: 12px; min-height: 170px; align-content: center; color: #746a64; }
.flow-source strong { color: #26211f; font-size: 1rem; overflow-wrap: anywhere; }
.flow-filter-panel { margin: 18px 0; border: 1px solid #d7cec7; }
.flow-filter-grid { display: grid; grid-template-columns: minmax(220px, 1.5fr) repeat(2, minmax(150px, 1fr)); gap: 14px; }
.flow-line-chart { overflow-x: auto; }
.flow-comparison { display: grid; gap: 14px; }
.flow-comparison-row { display: grid; grid-template-columns: minmax(180px, 1.25fr) minmax(180px, 2fr) minmax(90px, .6fr); gap: 14px; align-items: center; }
.flow-comparison-label { display: grid; gap: 3px; min-width: 0; }
.flow-comparison-label strong, .flow-comparison-label span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.flow-comparison-label span { color: #887d76; font-size: .78rem; }
.flow-comparison-value { text-align: right; color: #88353e; }
.flow-message-panel { margin-top: 18px; }
@media (max-width: 760px) {
  .flow-brand-strip { align-items: flex-start; flex-direction: column; padding: 20px; }
  .flow-filter-grid { grid-template-columns: 1fr; }
  .flow-comparison-row { grid-template-columns: 1fr auto; }
  .flow-comparison-track { grid-column: 1 / -1; grid-row: 2; }
  .flow-comparison-value { grid-column: 2; grid-row: 1; }
}

.inline-flow-analytics { margin: 18px 0; }
.flow-inline-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 16px; padding: 20px 22px; background: #f2eee9; border-left: 4px solid #88353e; }
.flow-inline-heading h2 { margin: 6px 0 8px; }
.flow-inline-heading p { margin: 0; color: #625b57; }
.inline-flow-analytics h3 { margin: 0; font-size: 1.05rem; }
@media (max-width: 760px) { .flow-inline-heading { align-items: flex-start; flex-direction: column; } }

.hto-filter-header { min-height: 0; margin-bottom: 0; }
.hto-filter-header .button { margin-left: auto; }

/* Customer inquiry dashboard layout */
body[data-page="customerInquiryInsights"] .metric-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

body[data-page="customerInquiryInsights"] .inquiry-filter-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

body[data-page="customerInquiryInsights"] .inquiry-overview-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

body[data-page="customerInquiryInsights"] .inquiry-overview-grid > .panel,
body[data-page="customerInquiryInsights"] .case-library-panel {
  min-width: 0;
}

body[data-page="customerInquiryInsights"] .case-row {
  grid-template-columns: minmax(0, 1fr) 160px;
}

body[data-page="customerInquiryInsights"] .case-score {
  min-width: 0;
}

@media (max-width: 1180px) {
  body[data-page="customerInquiryInsights"] .metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body[data-page="customerInquiryInsights"] .inquiry-filter-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 960px) {
  body[data-page="customerInquiryInsights"] .inquiry-overview-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  body[data-page="customerInquiryInsights"] .metric-grid,
  body[data-page="customerInquiryInsights"] .inquiry-filter-grid {
    grid-template-columns: 1fr;
  }

  body[data-page="customerInquiryInsights"] .case-row {
    grid-template-columns: 1fr;
  }

  body[data-page="customerInquiryInsights"] .case-score {
    justify-items: start;
    text-align: left;
  }
}
/* Customer inquiry density and text wrapping fixes */
body[data-page="customerInquiryInsights"] .metric-card,
body[data-page="customerInquiryInsights"] .panel,
body[data-page="customerInquiryInsights"] .status-card {
  min-width: 0;
  box-sizing: border-box;
}

body[data-page="customerInquiryInsights"] .metric-value {
  min-width: 0;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

body[data-page="customerInquiryInsights"] .panel-header {
  flex-wrap: wrap;
}

body[data-page="customerInquiryInsights"] .panel-title {
  min-width: 0;
  flex: 1 1 280px;
}

body[data-page="customerInquiryInsights"] .inquiry-filter-grid .field {
  min-width: 0;
}

body[data-page="customerInquiryInsights"] .inquiry-filter-grid .input,
body[data-page="customerInquiryInsights"] .inquiry-filter-grid .select {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

body[data-page="customerInquiryInsights"] .insight-bars {
  display: grid;
  gap: 10px;
  min-width: 0;
}

body[data-page="customerInquiryInsights"] .insight-bar-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

body[data-page="customerInquiryInsights"] .insight-bar-label strong,
body[data-page="customerInquiryInsights"] .insight-bar-label span {
  min-width: 0;
  overflow-wrap: anywhere;
}

body[data-page="customerInquiryInsights"] .insight-bar-label span {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

body[data-page="customerInquiryInsights"] .case-tag-cloud {
  display: grid;
  gap: 8px;
  min-width: 0;
}

body[data-page="customerInquiryInsights"] .case-tag {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  justify-content: space-between;
}

body[data-page="customerInquiryInsights"] .case-tag span {
  min-width: 0;
  overflow-wrap: anywhere;
}

@media (max-width: 1440px) {
  body[data-page="customerInquiryInsights"] .metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 1120px) {
  body[data-page="customerInquiryInsights"] .inquiry-overview-grid {
    grid-template-columns: 1fr;
  }
}
/* Customer inquiry compact density */
body[data-page="customerInquiryInsights"] .main {
  padding: 14px 20px 28px;
}

body[data-page="customerInquiryInsights"] .topbar {
  padding-bottom: 10px;
}

body[data-page="customerInquiryInsights"] .content {
  gap: 10px;
  padding-top: 10px;
}

body[data-page="customerInquiryInsights"] .metric-grid {
  gap: 10px;
}

body[data-page="customerInquiryInsights"] .metric-card {
  min-height: 82px;
  padding: 11px 12px;
}

body[data-page="customerInquiryInsights"] .metric-value {
  margin-top: 8px;
  font-size: 23px;
}

body[data-page="customerInquiryInsights"] .metric-note {
  margin-top: 5px;
}

body[data-page="customerInquiryInsights"] .panel {
  padding: 12px;
}

body[data-page="customerInquiryInsights"] .panel-header {
  gap: 10px;
  margin-bottom: 8px;
}

body[data-page="customerInquiryInsights"] .panel-title {
  gap: 3px;
}

body[data-page="customerInquiryInsights"] .panel-title p {
  font-size: 12px;
}

body[data-page="customerInquiryInsights"] .inquiry-filter-panel {
  gap: 8px;
}

body[data-page="customerInquiryInsights"] .inquiry-filter-grid {
  gap: 8px;
}

body[data-page="customerInquiryInsights"] .inquiry-overview-grid {
  gap: 12px;
}

body[data-page="customerInquiryInsights"] .insight-bars {
  gap: 7px;
}

body[data-page="customerInquiryInsights"] .insight-bar-row {
  gap: 6px;
  padding: 8px;
}

body[data-page="customerInquiryInsights"] .case-tag-cloud {
  gap: 6px;
}

body[data-page="customerInquiryInsights"] .case-tag {
  min-height: 30px;
}

body[data-page="customerInquiryInsights"] .case-library-panel {
  gap: 8px;
}

body[data-page="customerInquiryInsights"] .case-library {
  gap: 8px;
}

body[data-page="customerInquiryInsights"] .case-row {
  gap: 10px;
  padding: 10px;
}

body[data-page="customerInquiryInsights"] .case-row-main {
  gap: 7px;
}

body[data-page="customerInquiryInsights"] .case-question {
  padding: 8px 10px;
}

body[data-page="customerInquiryInsights"] .footer-note {
  padding-top: 2px;
}
/* Customer inquiry tightened layout override */
body[data-page='customerInquiryInsights'] .main {
  padding: 10px 16px 22px;
}

body[data-page='customerInquiryInsights'] .topbar {
  gap: 16px;
  padding-bottom: 8px;
}

body[data-page='customerInquiryInsights'] h1 {
  font-size: 30px;
}

body[data-page='customerInquiryInsights'] .page-intro {
  max-width: 680px;
  margin-top: 6px;
  line-height: 1.5;
}

body[data-page='customerInquiryInsights'] .top-actions {
  gap: 8px;
}

body[data-page='customerInquiryInsights'] .user-chip {
  height: 36px;
}

body[data-page='customerInquiryInsights'] .content {
  gap: 8px;
  padding-top: 8px;
}

body[data-page='customerInquiryInsights'] .metric-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

body[data-page='customerInquiryInsights'] .metric-card {
  min-height: 74px;
  padding: 10px 11px;
}

body[data-page='customerInquiryInsights'] .metric-value {
  margin-top: 6px;
  font-size: 22px;
}

body[data-page='customerInquiryInsights'] .metric-note {
  margin-top: 3px;
  line-height: 1.35;
}

body[data-page='customerInquiryInsights'] .panel {
  padding: 10px;
}

body[data-page='customerInquiryInsights'] .panel-header {
  gap: 8px;
  margin-bottom: 6px;
}

body[data-page='customerInquiryInsights'] .panel-title p {
  line-height: 1.45;
}

body[data-page='customerInquiryInsights'] .inquiry-filter-panel,
body[data-page='customerInquiryInsights'] .case-library-panel {
  gap: 6px;
}

body[data-page='customerInquiryInsights'] .inquiry-filter-grid,
body[data-page='customerInquiryInsights'] .case-library,
body[data-page='customerInquiryInsights'] .insight-bars {
  gap: 6px;
}

body[data-page='customerInquiryInsights'] .inquiry-overview-grid {
  gap: 10px;
}

body[data-page='customerInquiryInsights'] .insight-bar-row {
  gap: 5px;
  padding: 7px;
}

body[data-page='customerInquiryInsights'] .case-tag-cloud {
  gap: 5px;
}

body[data-page='customerInquiryInsights'] .case-tag {
  min-height: 28px;
}

body[data-page='customerInquiryInsights'] .case-row {
  gap: 8px;
  padding: 8px;
}

body[data-page='customerInquiryInsights'] .case-row-main {
  gap: 6px;
}

body[data-page='customerInquiryInsights'] .case-question {
  padding: 7px 8px;
}

@media (max-width: 900px) {
  body[data-page='customerInquiryInsights'] .metric-grid,
  body[data-page='customerInquiryInsights'] .inquiry-filter-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  body[data-page='customerInquiryInsights'] .metric-grid,
  body[data-page='customerInquiryInsights'] .inquiry-filter-grid,
  body[data-page='customerInquiryInsights'] .inquiry-overview-grid {
    grid-template-columns: 1fr;
  }
}

/* Customer inquiry overview column override */
body[data-page='customerInquiryInsights'] .inquiry-overview-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

@media (max-width: 980px) {
  body[data-page='customerInquiryInsights'] .inquiry-overview-grid {
    grid-template-columns: 1fr;
  }
}

.hto-launch-funnel-grid,
.hto-after-sales-summary,
.hto-exception-grid {
  display: grid;
  gap: 12px;
}

.hto-launch-funnel-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.hto-funnel-block {
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  background: var(--paper);
}

.hto-funnel-block h3 {
  margin: 0 0 12px;
  font-size: 16px;
}

.hto-after-sales-summary {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 16px;
}

.hto-after-sales-summary > div,
.hto-exception-grid > div {
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px solid var(--line);
  background: var(--paper);
}

.hto-after-sales-summary span,
.hto-exception-grid span {
  color: var(--muted);
  font-size: 12px;
}

.hto-after-sales-summary strong,
.hto-exception-grid strong {
  font-size: 22px;
}

.hto-exception-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.hto-exception-note {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 12px;
}

@media (max-width: 760px) {
  .hto-launch-funnel-grid,
  .hto-after-sales-summary,
  .hto-exception-grid {
    grid-template-columns: 1fr;
  }
}

.hto-funnel-period {
  margin: -8px 0 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.hto-source-caption {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 12px;
}

/* Size inquiry insights v2 */
body[data-page="customerInquiryInsights"] { background: #f4f7fb; color: #172236; }
body[data-page="customerInquiryInsights"] .main { max-width: 1540px; padding: 22px 28px 48px; }
body[data-page="customerInquiryInsights"] .inquiry-hero { display:flex; justify-content:space-between; gap:28px; align-items:flex-end; padding:8px 0 22px; border-bottom:1px solid #dce3ee; }
body[data-page="customerInquiryInsights"] .inquiry-hero h1 { margin:7px 0 6px; font-size:34px; letter-spacing:0; }
body[data-page="customerInquiryInsights"] .inquiry-hero p { margin:0; color:#637086; max-width:680px; }
body[data-page="customerInquiryInsights"] .eyebrow { color:#536f9f; font-size:11px; font-weight:800; letter-spacing:.12em; text-transform:uppercase; }
body[data-page="customerInquiryInsights"] .hero-status { width:280px; border-left:3px solid #2c78d4; padding:10px 0 10px 14px; }
body[data-page="customerInquiryInsights"] .hero-status strong, body[data-page="customerInquiryInsights"] .hero-status small { display:block; }
body[data-page="customerInquiryInsights"] .hero-status small { margin-top:6px; color:#6c788c; line-height:1.45; }
body[data-page="customerInquiryInsights"] .status-dot { display:inline-block; width:8px; height:8px; border-radius:50%; background:#2c78d4; margin-right:7px; }
body[data-page="customerInquiryInsights"] .inquiry-filter-panel { margin:18px 0 12px; padding:14px 16px; border:1px solid #dfe6f0; border-radius:8px; background:#fff; }
body[data-page="customerInquiryInsights"] .filter-row { display:grid; grid-template-columns:repeat(5,minmax(120px,1fr)) auto; gap:12px; align-items:end; }
body[data-page="customerInquiryInsights"] .filter-actions { display:flex; gap:8px; }
body[data-page="customerInquiryInsights"] .inquiry-metric-grid { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:10px; margin:12px 0 18px; }
body[data-page="customerInquiryInsights"] .inquiry-metric { min-height:90px; padding:13px 15px; background:#fff; border:1px solid #dfe6f0; border-radius:8px; }
body[data-page="customerInquiryInsights"] .inquiry-metric span, body[data-page="customerInquiryInsights"] .inquiry-metric small { display:block; color:#6b778a; }
body[data-page="customerInquiryInsights"] .inquiry-metric strong { display:block; margin:7px 0 3px; color:#15243c; font-size:25px; }
body[data-page="customerInquiryInsights"] .inquiry-tabs { display:flex; gap:3px; overflow:auto; margin:8px 0 18px; border-bottom:1px solid #dce3ee; }
body[data-page="customerInquiryInsights"] .inquiry-tabs button { flex:0 0 auto; border:0; border-bottom:3px solid transparent; background:transparent; padding:11px 15px; color:#66738a; font-size:12px; font-weight:800; cursor:pointer; }
body[data-page="customerInquiryInsights"] .inquiry-tabs button.active { color:#1e5da8; border-bottom-color:#2c78d4; background:#eef5ff; }
body[data-page="customerInquiryInsights"] .inquiry-tab-panel { display:none; }
body[data-page="customerInquiryInsights"] .inquiry-tab-panel.active { display:block; }
body[data-page="customerInquiryInsights"] .section-heading { display:flex; justify-content:space-between; gap:24px; align-items:end; margin:6px 0 13px; }
body[data-page="customerInquiryInsights"] .section-heading h2 { margin:5px 0 0; font-size:22px; }
body[data-page="customerInquiryInsights"] .section-heading p { max-width:550px; margin:0; color:#66738a; font-size:12px; line-height:1.5; text-align:right; }
body[data-page="customerInquiryInsights"] .overview-grid, body[data-page="customerInquiryInsights"] .cross-grid { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1.2fr); gap:13px; margin-bottom:13px; }
body[data-page="customerInquiryInsights"] .secondary-grid { grid-template-columns:minmax(0,1fr) minmax(0,1fr); }
body[data-page="customerInquiryInsights"] .data-panel { background:#fff; border:1px solid #dfe6f0; border-radius:8px; padding:16px; }
body[data-page="customerInquiryInsights"] .data-panel-head { display:flex; justify-content:space-between; gap:10px; align-items:baseline; margin-bottom:13px; }
body[data-page="customerInquiryInsights"] .data-panel-head h3 { margin:0; font-size:15px; }
body[data-page="customerInquiryInsights"] .data-panel-head span { color:#8792a3; font-size:11px; }
body[data-page="customerInquiryInsights"] .inquiry-bar { margin:11px 0; }
body[data-page="customerInquiryInsights"] .inquiry-bar > div { display:flex; justify-content:space-between; gap:10px; font-size:12px; }
body[data-page="customerInquiryInsights"] .inquiry-bar strong { color:#2e5e97; font-size:11px; }
body[data-page="customerInquiryInsights"] .inquiry-bar i { display:block; height:6px; margin-top:6px; background:#edf1f6; border-radius:4px; overflow:hidden; }
body[data-page="customerInquiryInsights"] .inquiry-bar b { display:block; height:100%; background:#4d8bd8; border-radius:4px; }
body[data-page="customerInquiryInsights"] .profile-row { padding:10px 0; border-bottom:1px solid #edf0f5; }
body[data-page="customerInquiryInsights"] .profile-row:last-child { border-bottom:0; }
body[data-page="customerInquiryInsights"] .profile-row-head { display:flex; align-items:center; gap:8px; font-size:12px; }
body[data-page="customerInquiryInsights"] .profile-row-head em { margin-left:auto; color:#66738a; font-style:normal; font-size:11px; }
body[data-page="customerInquiryInsights"] .rank { display:inline-grid; place-items:center; width:22px; height:22px; border-radius:50%; background:#e8f1fc; color:#2e6bab; font-weight:800; }
body[data-page="customerInquiryInsights"] .mini-bars { display:grid; grid-template-columns:1fr; gap:5px; margin:8px 0 0 30px; }
body[data-page="customerInquiryInsights"] .mini-bars div, body[data-page="customerInquiryInsights"] .detail-line { display:grid; grid-template-columns:1fr auto 45px; gap:8px; align-items:center; color:#526178; font-size:11px; }
body[data-page="customerInquiryInsights"] .mini-bars b, body[data-page="customerInquiryInsights"] .detail-line b { color:#243e62; }
body[data-page="customerInquiryInsights"] .mini-bars small, body[data-page="customerInquiryInsights"] .detail-line small { text-align:right; color:#8994a6; }
body[data-page="customerInquiryInsights"] .journey-steps { display:grid; grid-template-columns:1fr auto 1fr auto 1fr; gap:8px; align-items:center; }
body[data-page="customerInquiryInsights"] .journey-steps div { padding:12px; background:#f5f8fc; border-left:3px solid #4d8bd8; }
body[data-page="customerInquiryInsights"] .journey-steps b, body[data-page="customerInquiryInsights"] .journey-steps strong, body[data-page="customerInquiryInsights"] .journey-steps small { display:block; }
body[data-page="customerInquiryInsights"] .journey-steps b { color:#4d72a3; font-size:10px; text-transform:uppercase; }
body[data-page="customerInquiryInsights"] .journey-steps strong { margin:5px 0; font-size:13px; }
body[data-page="customerInquiryInsights"] .journey-steps small { color:#718098; font-size:11px; line-height:1.4; }
body[data-page="customerInquiryInsights"] .journey-steps i { color:#9ba8ba; font-style:normal; }
body[data-page="customerInquiryInsights"] .muted { color:#7a8799; font-size:12px; line-height:1.5; }
body[data-page="customerInquiryInsights"] .profile-detail-list { display:grid; gap:12px; }
body[data-page="customerInquiryInsights"] .profile-detail { padding:16px; background:#fff; border:1px solid #dfe6f0; border-radius:8px; }
body[data-page="customerInquiryInsights"] .profile-detail-title { display:flex; justify-content:space-between; gap:12px; align-items:flex-start; border-bottom:1px solid #edf0f5; padding-bottom:11px; }
body[data-page="customerInquiryInsights"] .profile-detail-title h3 { margin:4px 0 0; font-size:17px; }
body[data-page="customerInquiryInsights"] .profile-detail-title > strong { text-align:right; color:#234a7a; font-size:21px; }
body[data-page="customerInquiryInsights"] .profile-detail-title > strong small { display:block; color:#758197; font-size:10px; font-weight:500; }
body[data-page="customerInquiryInsights"] .profile-detail-grid { display:grid; grid-template-columns:1.1fr 1fr 1fr; gap:18px; padding-top:13px; }
body[data-page="customerInquiryInsights"] .profile-detail-grid h4 { margin:0 0 9px; color:#4e6079; font-size:11px; text-transform:uppercase; letter-spacing:.06em; }
body[data-page="customerInquiryInsights"] .detail-line { padding:5px 0; border-bottom:1px solid #f0f2f6; }
body[data-page="customerInquiryInsights"] .tag-list { display:flex; flex-wrap:wrap; gap:6px; align-content:flex-start; }
body[data-page="customerInquiryInsights"] .tag-list span { display:inline-flex; gap:7px; align-items:center; padding:6px 8px; border:1px solid #dfe7f2; background:#f8fbff; color:#4b5e78; font-size:11px; }
body[data-page="customerInquiryInsights"] .tag-list b { color:#2f68a8; }
body[data-page="customerInquiryInsights"] .voc-panel { margin-top:13px; }
body[data-page="customerInquiryInsights"] .voc-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:9px; }
body[data-page="customerInquiryInsights"] blockquote { margin:0; padding:12px; background:#f7f9fc; border-left:3px solid #91add2; }
body[data-page="customerInquiryInsights"] blockquote p { margin:0; color:#394b65; font-size:12px; line-height:1.55; }
body[data-page="customerInquiryInsights"] blockquote footer { margin-top:8px; color:#8490a2; font-size:10px; }
body[data-page="customerInquiryInsights"] .cross-highlight { display:flex; flex-direction:column; justify-content:center; background:#183452; color:#fff; border-color:#183452; }
body[data-page="customerInquiryInsights"] .cross-highlight .eyebrow, body[data-page="customerInquiryInsights"] .cross-highlight small { color:#b5cae6; }
body[data-page="customerInquiryInsights"] .cross-highlight strong { margin:12px 0 2px; font-size:42px; }
body[data-page="customerInquiryInsights"] .cross-highlight p { color:#d8e3f1; font-size:12px; line-height:1.55; }
body[data-page="customerInquiryInsights"] .advice-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:10px; }
body[data-page="customerInquiryInsights"] .advice-grid div { padding:12px; background:#f6f8fb; border-top:3px solid #7797bf; }
body[data-page="customerInquiryInsights"] .advice-grid b, body[data-page="customerInquiryInsights"] .advice-grid span { display:block; }
body[data-page="customerInquiryInsights"] .advice-grid b { font-size:12px; color:#29496f; }
body[data-page="customerInquiryInsights"] .advice-grid span { margin-top:6px; color:#6d7b90; font-size:11px; line-height:1.5; }
body[data-page="customerInquiryInsights"] .return-empty { min-height:240px; display:flex; flex-direction:column; align-items:flex-start; justify-content:center; }
body[data-page="customerInquiryInsights"] .return-empty h3 { margin:8px 0 5px; font-size:18px; }
body[data-page="customerInquiryInsights"] .return-empty p { max-width:760px; color:#64728a; font-size:12px; line-height:1.65; }
body[data-page="customerInquiryInsights"] .return-empty-icon { display:grid; place-items:center; width:36px; height:36px; border-radius:50%; background:#e7f0fb; color:#3172b9; font-weight:800; }
body[data-page="customerInquiryInsights"] .source-chip-row { display:flex; flex-wrap:wrap; gap:7px; margin-top:12px; }
body[data-page="customerInquiryInsights"] .source-chip { display:inline-block; padding:5px 8px; background:#eef3f9; border:1px solid #dae3ef; color:#596b84; font-family:ui-monospace,Consolas,monospace; font-size:10px; }
body[data-page="customerInquiryInsights"] .fit-rule-grid { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:12px; margin-bottom:13px; }
body[data-page="customerInquiryInsights"] .fit-rule { min-height:180px; padding:16px; background:#fff; border:1px solid #dfe6f0; border-top:4px solid #6b87ad; border-radius:8px; }
body[data-page="customerInquiryInsights"] .fit-rule.accent { border-top-color:#df8c43; }
body[data-page="customerInquiryInsights"] .fit-rule span { color:#6780a1; font-size:10px; font-weight:800; letter-spacing:.1em; }
body[data-page="customerInquiryInsights"] .fit-rule h3 { margin:13px 0 8px; font-size:16px; }
body[data-page="customerInquiryInsights"] .fit-rule p { margin:0; color:#67758a; font-size:12px; line-height:1.6; }
body[data-page="customerInquiryInsights"] .insight-card-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; margin-bottom:13px; }
body[data-page="customerInquiryInsights"] .insight-card-grid article { padding:17px; background:#fff; border:1px solid #dfe6f0; border-radius:8px; }
body[data-page="customerInquiryInsights"] .insight-card-grid h3 { margin:10px 0 8px; font-size:16px; }
body[data-page="customerInquiryInsights"] .insight-card-grid p { margin:0; color:#5e6c81; font-size:12px; line-height:1.6; }
body[data-page="customerInquiryInsights"] .insight-card-grid footer { margin-top:13px; padding-top:10px; border-top:1px solid #edf0f5; color:#6b7a90; font-size:11px; line-height:1.45; }
body[data-page="customerInquiryInsights"] .signal { display:inline-block; padding:4px 7px; font-size:9px; font-weight:800; letter-spacing:.08em; }
body[data-page="customerInquiryInsights"] .signal.strong { color:#236b56; background:#e8f5ef; }
body[data-page="customerInquiryInsights"] .signal.medium { color:#9b6a22; background:#fff5dd; }
body[data-page="customerInquiryInsights"] .signal.pending { color:#6a6f83; background:#eef0f4; }
body[data-page="customerInquiryInsights"] .source-panel { margin-top:13px; }
@media (max-width: 1050px) { body[data-page="customerInquiryInsights"] .filter-row { grid-template-columns:repeat(3,minmax(0,1fr)); } body[data-page="customerInquiryInsights"] .filter-actions { grid-column:span 3; } body[data-page="customerInquiryInsights"] .fit-rule-grid { grid-template-columns:repeat(2,minmax(0,1fr)); } body[data-page="customerInquiryInsights"] .profile-detail-grid { grid-template-columns:1fr 1fr; } }
@media (max-width: 760px) { body[data-page="customerInquiryInsights"] .main { padding:14px 14px 32px; } body[data-page="customerInquiryInsights"] .inquiry-hero { display:block; } body[data-page="customerInquiryInsights"] .hero-status { width:auto; margin-top:16px; } body[data-page="customerInquiryInsights"] .inquiry-metric-grid, body[data-page="customerInquiryInsights"] .overview-grid, body[data-page="customerInquiryInsights"] .secondary-grid, body[data-page="customerInquiryInsights"] .cross-grid, body[data-page="customerInquiryInsights"] .insight-card-grid { grid-template-columns:1fr; } body[data-page="customerInquiryInsights"] .filter-row { grid-template-columns:1fr 1fr; } body[data-page="customerInquiryInsights"] .filter-actions { grid-column:span 2; } body[data-page="customerInquiryInsights"] .section-heading { display:block; } body[data-page="customerInquiryInsights"] .section-heading p { margin-top:8px; text-align:left; } body[data-page="customerInquiryInsights"] .profile-detail-grid, body[data-page="customerInquiryInsights"] .voc-grid, body[data-page="customerInquiryInsights"] .fit-rule-grid, body[data-page="customerInquiryInsights"] .advice-grid { grid-template-columns:1fr; } body[data-page="customerInquiryInsights"] .journey-steps { grid-template-columns:1fr; } body[data-page="customerInquiryInsights"] .journey-steps i { display:none; } }

/* Customer service operations dashboard */
.service-hero {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: end;
  padding: 8px 2px 2px;
}

.service-hero h1 {
  margin: 0;
  font-size: 30px;
}

.service-hero p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.service-data-status {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 245px;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
}

.service-data-status strong,
.service-data-status small {
  display: block;
}

.service-data-status strong {
  font-size: 13px;
}

.service-data-status small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.service-filter-panel {
  padding: 14px;
}

.service-filter-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(130px, 1fr)) auto;
  gap: 10px;
  align-items: end;
}

.service-filter-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.service-filter-actions .button {
  min-height: 38px;
  padding: 0 11px;
  white-space: nowrap;
}

.service-kpi-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.service-kpi-card {
  position: relative;
  min-height: 122px;
  padding: 15px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-top: 3px solid #20211f;
  border-radius: 7px;
  background: #fff;
  box-shadow: 0 12px 28px rgba(29, 24, 20, 0.055);
}

.service-kpi-card.rose { border-top-color: var(--rose); }
.service-kpi-card.teal { border-top-color: #3f7d78; }
.service-kpi-card.gold { border-top-color: var(--gold); }
.service-kpi-card.muted-card { border-top-color: #b9b5b0; background: #faf8f6; }

.service-kpi-card > span,
.service-kpi-card small {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.service-kpi-card > strong {
  display: block;
  margin: 13px 0 7px;
  font-size: 28px;
  line-height: 1;
  letter-spacing: 0;
}

.service-main-grid,
.service-lower-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(310px, 0.85fr);
  gap: 14px;
}

.service-main-grid > *,
.service-lower-grid > * {
  min-width: 0;
}

.service-trend-panel,
.service-channel-panel,
.service-sla-panel,
.service-agent-panel {
  min-width: 0;
}

.service-panel-tag {
  color: var(--muted);
  font-size: 12px;
}

.service-trend-svg {
  display: block;
  width: 100%;
  min-width: 700px;
  min-height: 238px;
  margin-top: 8px;
  overflow: visible;
}

.service-chart-scroll {
  overflow-x: auto;
  scrollbar-width: thin;
}

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

.service-grid text,
.service-axis-label {
  fill: #847d77;
  font-family: "Microsoft YaHei", Arial, sans-serif;
  font-size: 11px;
}

.service-data-label {
  fill: #5d292b;
  stroke: #fff;
  stroke-width: 3px;
  paint-order: stroke fill;
  font-family: "Microsoft YaHei", Arial, sans-serif;
  font-size: 10px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.service-trend-line {
  fill: none;
  stroke: var(--rose-dark);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.service-trend-svg circle {
  fill: #fff;
  stroke: var(--rose-dark);
  stroke-width: 2;
}

.service-chart-empty {
  display: grid;
  min-height: 220px;
  place-items: center;
  color: var(--muted);
  font-size: 13px;
}

.service-bars {
  display: grid;
  gap: 13px;
  padding-top: 6px;
}

.service-bar-row {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) auto;
  gap: 9px;
  align-items: center;
}

.service-rank {
  display: inline-grid;
  width: 20px;
  height: 20px;
  place-items: center;
  border-radius: 50%;
  background: #f1ece8;
  color: #756e68;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.service-bar-label {
  min-width: 0;
}

.service-bar-label strong {
  display: block;
  overflow: hidden;
  color: var(--ink);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.service-bar-label > div {
  height: 6px;
  margin-top: 7px;
  overflow: hidden;
  border-radius: 4px;
  background: #eee9e5;
}

.service-bar-label i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: #556f7d;
}

.service-bar-value {
  color: #48433f;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.service-table td small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}

.service-agent-table th:not(:first-child),
.service-agent-table td:not(:first-child),
.service-table th:not(:first-child),
.service-table td:not(:first-child) {
  text-align: right;
}

.service-definition-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
}

.service-definition-grid article {
  min-height: 124px;
  padding: 15px;
  border-right: 1px solid var(--line);
}

.service-definition-grid article:last-child {
  border-right: 0;
}

.service-definition-grid span {
  color: var(--rose-dark);
  font-size: 12px;
  font-weight: 800;
}

.service-definition-grid p {
  margin: 9px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
}

@media (max-width: 1120px) {
  .service-filter-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .service-filter-actions { justify-content: flex-start; }
  .service-kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  .service-hero { display: block; }
  .service-data-status { width: 100%; margin-top: 14px; }
  .service-filter-grid,
  .service-main-grid,
  .service-lower-grid,
  .service-kpi-grid,
  .service-definition-grid { grid-template-columns: 1fr; }
  .service-definition-grid article { border-right: 0; border-bottom: 1px solid var(--line); }
  .service-definition-grid article:last-child { border-bottom: 0; }
  .service-filter-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    min-width: 0;
  }
  .service-filter-actions .button { width: 100%; min-width: 0; padding-inline: 6px; }
  .service-agent-table { min-width: 720px; }
  .service-table { min-width: 610px; }
}

/* Standalone customer service dashboard */
.service-standalone {
  min-height: 100vh;
  background: #f5f2ef;
}

.service-standalone-header {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 20px;
  align-items: center;
  min-height: 68px;
  padding: 0 28px;
  background: #171918;
  color: #fff;
}

.service-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  text-decoration: none;
}

.service-brand span {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  background: #fff;
  color: #171918;
  font-size: 12px;
  font-weight: 900;
}

.service-brand strong {
  font-size: 15px;
}

.service-standalone-header > div:nth-child(2) b,
.service-standalone-header > div:nth-child(2) small {
  display: block;
}

.service-standalone-header > div:nth-child(2) b {
  font-size: 14px;
}

.service-standalone-header > div:nth-child(2) small {
  margin-top: 3px;
  color: #aeb3b0;
  font-size: 11px;
}

.service-header-meta {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #d7dbd8;
  font-size: 12px;
}

.service-header-meta .status-dot {
  background: #82ad86;
}

.service-standalone-main {
  width: min(1500px, 100%);
  margin: 0 auto;
  padding: 24px 28px 42px;
}

.service-standalone-main > * + * {
  margin-top: 14px;
}

.service-standalone-title {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: end;
  padding: 4px 2px 7px;
}

.service-standalone-title h1 {
  margin: 0;
  font-size: 30px;
}

.service-standalone-title p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.service-standalone-title > span {
  color: var(--muted);
  font-size: 13px;
}

.service-loading {
  display: grid;
  min-height: 100vh;
  place-items: center;
  color: #6d6864;
  font-size: 14px;
}

.service-loading.error {
  color: var(--rose-dark);
}

@media (max-width: 760px) {
  .service-standalone-header { grid-template-columns: auto 1fr; min-height: 60px; padding: 0 16px; }
  .service-header-meta { display: none; }
  .service-standalone-main { padding: 18px 14px 32px; }
  .service-standalone-title { display: block; }
  .service-standalone-title > span { display: block; margin-top: 10px; }
}

/* Customer service dashboard controls and operations layout */
.service-agent-filter { grid-column: 1 / -1; margin: 2px 0 0; padding: 13px 14px 12px; border: 1px solid #e4ebf3; border-radius: 6px; background: #fbfcfe; }
.service-agent-filter legend { padding: 0 5px; color: #526984; font-size: 11px; font-weight: 800; }
.service-agent-checks { display: flex; flex-wrap: wrap; gap: 7px 16px; }
.service-agent-check { display: inline-flex; align-items: center; gap: 6px; color: #263c59; font-size: 11px; cursor: pointer; }
.service-agent-check input { width: 14px; height: 14px; accent-color: #2c78d4; }
.service-preset-row { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; margin-top: 11px; padding-top: 10px; border-top: 1px solid #e8eef4; }
.service-preset-row .select { min-width: 170px; }
.service-preset-row .input { width: min(220px, 100%); }
.service-trend-top { margin-top: 16px; }
.service-workspace-grid { display: grid; grid-template-columns: minmax(280px, .78fr) minmax(0, 1.65fr); gap: 16px; margin-top: 16px; }
.service-overview-panel .service-kpi-grid { margin: 0; }
.service-kpi-grid-compact { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.service-kpi-grid-compact .service-kpi-card strong { font-size: 21px; }
.service-agent-table small { display: block; margin-top: 3px; color: #8290a2; font-size: 10px; }
.service-secondary-grid { display: grid; grid-template-columns: minmax(280px, .8fr) minmax(0, 1.2fr); gap: 16px; margin-top: 16px; }
.service-status-panel { min-height: 170px; }

.service-status-stack { display: grid; gap: 14px; }
.service-status-stack > .service-status-panel,
.service-status-stack > .service-warning-panel { min-width: 0; }
.service-warning-cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.service-warning-card { padding: 12px; border: 1px solid #e7edf2; border-radius: 10px; background: #fbfcfd; }
.service-warning-card span, .service-warning-card small { display: block; color: #6b7a8e; font-size: 11px; }
.service-warning-card strong { display: block; margin: 5px 0; color: #26364a; font-size: 24px; }
.service-warning-card.has-violations { border-color: #efc6c8; background: #fff8f8; }
.service-warning-card.has-violations strong { color: #c63e48; }
.service-export-controls { display: flex; align-items: center; gap: 8px; margin-top: 14px; }
.service-export-controls label { color: #6b7a8e; font-size: 11px; }
.service-export-controls .select { min-width: 92px; }
.service-export-message, .service-quality-note { margin: 8px 0 0; color: #6b7a8e; font-size: 11px; }
.service-agent-unreceived { background: #fffaf0; }
.service-status-unavailable { display: grid; gap: 7px; padding: 15px; border: 1px solid #eadfbe; border-radius: 5px; background: #fffaf0; color: #7a6327; font-size: 11px; line-height: 1.55; }
.service-status-unavailable strong { color: #73591b; font-size: 13px; }
.service-status-summary { margin-bottom: 11px; color: #6b7a8e; font-size: 11px; }
.service-status-summary b { color: #14815e; font-size: 22px; }
.service-status-list { display: grid; gap: 7px; }
.service-status-row { display: grid; grid-template-columns: 10px 1fr auto; align-items: center; gap: 7px; padding: 8px 10px; border: 1px solid #e6edf3; border-radius: 4px; color: #5f7188; font-size: 11px; }
.service-status-row strong { color: #263c59; }
.service-status-dot { width: 8px; height: 8px; border-radius: 50%; background: #9aa7b5; }
.service-status-dot.idle { background: #1a9a6b; }
.service-status-dot.busy { background: #e09a31; }
.service-status-dot.offline { background: #a7b0bb; }
.service-status-dot.unknown { background: #c6a15b; }
.service-status-alert { margin-bottom: 10px; padding: 10px 12px; border-left: 3px solid #d74a52; background: #fff0f1; color: #a53e45; font-size: 12px; font-weight: 800; }
.service-definition-copy { color: #6d7e92; font-size: 11px; line-height: 1.65; }
.service-definition-copy p { margin: 0 0 9px; }
.service-definition-copy p:last-child { margin-bottom: 0; }
@media (max-width: 1000px) {
  .service-workspace-grid, .service-secondary-grid { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .service-kpi-grid-compact { grid-template-columns: 1fr 1fr; }
  .service-preset-row { align-items: stretch; }
  .service-preset-row .select, .service-preset-row .input, .service-preset-row .button { width: 100%; }
}
@media (max-width: 520px) {
  .service-kpi-grid-compact { grid-template-columns: 1fr; }
}

/* Customer service dashboard hierarchy */
.service-top-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(300px, .8fr);
  gap: 16px;
  margin-top: 16px;
  align-items: stretch;
}

.service-top-grid > .panel {
  margin-top: 0;
}

.service-top-grid .service-trend-panel {
  height: 100%;
}

.service-slice-groups {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.service-slice-group {
  min-width: 0;
  margin: 0;
  padding: 12px 13px 10px;
  border: 1px solid #e4ebf3;
  border-radius: 6px;
  background: #fbfcfe;
}

.service-slice-group legend {
  padding: 0 5px;
  color: #526984;
  font-size: 11px;
  font-weight: 800;
}

.service-slice-options {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.service-slice-option {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 28px;
  padding: 4px 8px;
  border: 1px solid #dfe7ef;
  border-radius: 4px;
  background: #fff;
  color: #334b66;
  font-size: 11px;
  cursor: pointer;
}

.service-slice-option input {
  width: 13px;
  height: 13px;
  accent-color: #2c78d4;
}

.service-slice-actions {
  margin-top: 9px;
}

.service-slice-actions .button {
  min-height: 28px;
  padding: 4px 10px;
  font-size: 11px;
}

.service-core-panel,
.service-agent-panel {
  margin-top: 16px;
}

.service-core-table {
  width: 100%;
  border-collapse: collapse;
}

.service-core-table th,
.service-core-table td {
  padding: 12px 14px;
  border-bottom: 1px solid #e8edf2;
  vertical-align: middle;
}

.service-core-table tr:last-child th,
.service-core-table tr:last-child td {
  border-bottom: 0;
}

.service-core-table th {
  width: 28%;
  color: #344b65;
  font-size: 12px;
  font-weight: 800;
  text-align: left;
}

.service-core-table td {
  color: #172d47;
}

.service-core-table td strong {
  display: inline-block;
  min-width: 92px;
  font-size: 19px;
  font-weight: 850;
}

.service-core-table td small {
  color: #8290a2;
  font-size: 10px;
}

.service-bottom-grid {
  display: grid;
  grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr);
  gap: 16px;
  margin-top: 16px;
}

.service-bottom-grid > .service-definition-panel {
  grid-column: 1 / -1;
}

.service-status-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 13px;
}

.service-status-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #65758a;
  font-size: 11px;
  font-weight: 700;
}

.service-status-legend-item .service-status-dot {
  display: inline-block;
}

@media (max-width: 1000px) {
  .service-top-grid,
  .service-bottom-grid {
    grid-template-columns: 1fr;
  }

  .service-bottom-grid > .service-definition-panel {
    grid-column: auto;
  }
}

@media (max-width: 760px) {
  .service-slice-groups {
    grid-template-columns: 1fr;
  }

  .service-core-table th,
  .service-core-table td {
    padding: 10px 9px;
  }

  .service-core-table td strong {
    display: block;
  }

  .service-core-table td small {
    display: block;
    margin-top: 3px;
  }
}
/* Refined customer service controls and agent summary table */
.service-slice-group legend {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.service-slice-group legend .button {
  min-height: 26px;
  padding: 3px 9px;
  font-size: 11px;
  line-height: 1;
}

.service-agent-summary {
  background: #f5f8fc;
}

.service-agent-summary td {
  color: #203a58;
  font-weight: 800;
}

.service-agent-summary td:first-child small {
  display: block;
  margin-top: 3px;
  color: #7890a8;
  font-size: 10px;
  font-weight: 600;
}

.service-agent-table {
  min-width: 980px;
}

@media (max-width: 760px) {
  .service-agent-table {
    min-width: 980px;
  }
}
.service-status-panel.service-status-critical {
  border-color: #e8a3a8;
  animation: service-status-flash-red 1.4s ease-in-out infinite;
}

.service-status-panel.service-status-ok {
  border-color: #9ed7bd;
  animation: service-status-flash-green 1.8s ease-in-out infinite;
}

.service-status-counts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.service-status-count {
  padding: 8px 10px;
  border: 1px solid #e6edf3;
  border-radius: 4px;
  background: #fff;
}

.service-status-count span {
  display: block;
  color: #6b7a8e;
  font-size: 10px;
}

.service-status-count b {
  display: block;
  margin-top: 3px;
  font-size: 21px;
}

.service-status-count.idle b,
.service-status-ok {
  color: #14815e;
}

.service-status-count.busy b {
  color: #c4771b;
}

.service-status-count.offline b {
  color: #788697;
}

.service-status-history {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid #eef2f5;
}

.service-status-history .table-wrap {
  max-height: 184px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.service-status-history-title {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
  color: #6b7a8e;
  font-size: 10px;
}

.service-status-history-title strong {
  color: #26364a;
  font-size: 12px;
}

.service-status-history table {
  width: 100%;
  border-collapse: collapse;
  font-size: 10px;
}

.service-status-history th,
.service-status-history td {
  padding: 6px 4px;
  border-bottom: 1px solid #eef2f5;
  text-align: left;
}

.service-status-history thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #fff;
}

.service-history-badge {
  font-weight: 800;
}

.service-history-badge.yes {
  color: #c63e48;
}

.service-history-badge.no {
  color: #14815e;
}

@keyframes service-status-flash-red {
  0%, 100% { box-shadow: 0 0 0 rgba(198, 62, 72, 0); }
  50% { box-shadow: 0 0 0 4px rgba(198, 62, 72, .18); }
}

@keyframes service-status-flash-green {
  0%, 100% { box-shadow: 0 0 0 rgba(20, 129, 94, 0); }
  50% { box-shadow: 0 0 0 4px rgba(20, 129, 94, .16); }
}

@media (prefers-reduced-motion: reduce) {
  .service-status-panel.service-status-critical,
  .service-status-panel.service-status-ok {
    animation: none;
  }
}

@media (max-width: 760px) {
  .service-warning-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .service-export-controls { flex-wrap: wrap; }
}
/* Latest-date control for the standalone customer-service dashboard. */
.service-latest-toggle { display: flex; align-items: center; gap: 6px; font-size: 12px; white-space: nowrap; }
