:root {
  color-scheme: light;
  --bg: #f6f7f2;
  --surface: #ffffff;
  --surface-2: #eef3ee;
  --ink: #17221d;
  --muted: #65716a;
  --line: #dfe5dc;
  --brand: #126c54;
  --brand-dark: #0e463a;
  --blue: #2563a9;
  --orange: #df7b39;
  --red: #c54837;
  --gold: #b4822e;
  --shadow: 0 14px 40px rgba(27, 41, 34, 0.12);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
  font-size: 16px;
  letter-spacing: 0;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  background:
    linear-gradient(180deg, rgba(246, 247, 242, 0.98), rgba(235, 239, 232, 0.98)),
    #f6f7f2;
  color: var(--ink);
}

button,
input,
textarea,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  position: relative;
  min-height: 100dvh;
  max-width: 460px;
  margin: 0 auto;
  background: var(--bg);
  border-left: 1px solid rgba(18, 108, 84, 0.12);
  border-right: 1px solid rgba(18, 108, 84, 0.12);
}

.desktop-only,
.nav-brand {
  display: none;
}

.screen {
  min-height: 100dvh;
  padding: 14px 14px 94px;
}

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

.topbar h1 {
  margin: 0;
  font-size: 22px;
  line-height: 1.15;
  font-weight: 800;
}

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

.avatar {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  border-radius: 8px;
  background: var(--brand-dark);
  color: #fff;
  font-weight: 800;
}

.topbar-logout {
  flex: 0 0 auto;
  height: 36px;
  padding: 0 12px;
  border: 1px solid rgba(197, 72, 55, 0.25);
  border-radius: 8px;
  background: #fff7f5;
  color: var(--red);
  font-size: 13px;
  font-weight: 800;
}

.topbar-logout:hover {
  border-color: rgba(197, 72, 55, 0.45);
  background: #fff1ee;
}

.board {
  position: relative;
  overflow: hidden;
  min-height: 180px;
  border-radius: 8px;
  background: #e9eee6;
  box-shadow: var(--shadow);
}

.board img {
  display: block;
  width: 100%;
  height: 188px;
  object-fit: cover;
}

.board-panel {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 12px;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 10px;
  padding: 12px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(10px);
}

.board-panel strong {
  display: block;
  font-size: 17px;
}

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

.score-pill {
  min-width: 68px;
  padding: 8px 9px;
  border-radius: 8px;
  background: var(--brand-dark);
  color: #fff;
  text-align: center;
}

.score-pill b {
  display: block;
  font-size: 20px;
  line-height: 1;
}

.score-pill small {
  font-size: 11px;
  color: #dce8df;
}

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

.metric {
  min-height: 72px;
  padding: 10px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.metric b {
  display: block;
  font-size: 21px;
  line-height: 1.05;
}

.metric span {
  display: block;
  margin-top: 7px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.2;
}

.section {
  margin-top: 18px;
}

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

.section-head h2 {
  margin: 0;
  font-size: 17px;
  line-height: 1.2;
}

.section-head small {
  color: var(--muted);
}

.toolbar {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  margin-bottom: 10px;
}

.searchbox {
  width: 100%;
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  outline: none;
}

.searchbox:focus,
.field input:focus,
.field textarea:focus,
.field select:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(18, 108, 84, 0.12);
}

.global-search-panel {
  margin-top: 0;
}

.global-search-tip,
.global-search-count {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.global-search-results {
  display: grid;
  gap: 7px;
}

.global-search-result {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  padding: 10px 11px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--ink);
  text-align: left;
}

.global-search-result:hover {
  border-color: var(--brand);
}

.global-search-result span {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.global-search-result strong,
.global-search-result small {
  overflow-wrap: anywhere;
}

.global-search-result small {
  color: var(--muted);
}

.global-search-result b {
  flex: 0 0 auto;
  color: var(--brand-dark);
  font-size: 12px;
}

.lead-duplicate-hint {
  grid-column: 1 / -1;
  padding: 10px 11px;
  border: 1px dashed var(--line);
  border-radius: 7px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.lead-duplicate-hint.is-warning {
  display: grid;
  gap: 7px;
  border-style: solid;
  border-color: #e8ba72;
  background: #fff8ec;
  color: #7b5119;
}

.lead-duplicate-hint button {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--brand-dark);
  font-weight: 800;
  text-align: left;
}

.filters,
.quick-row,
.action-row {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: none;
}

.filters::-webkit-scrollbar,
.quick-row::-webkit-scrollbar,
.action-row::-webkit-scrollbar {
  display: none;
}

.home-filter-panel {
  display: grid;
  gap: 10px;
  margin: 0 0 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.home-filter-panel > * {
  min-width: 0;
}

.filter-panel-head,
.filter-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.filter-panel-head {
  justify-content: space-between;
  width: 100%;
}

.filter-panel-head strong {
  font-size: 15px;
}

.filter-panel-head .ghost-btn {
  flex: 0 0 auto;
}

.filter-row {
  align-items: flex-start;
}

.filter-label {
  flex: 0 0 38px;
  padding-top: 9px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.filter-row .filters {
  flex: 1;
  min-width: 0;
}

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

.filter-select-field {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.filter-select-field select {
  width: 100%;
  min-height: 40px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--ink);
}

.location-apply-btn {
  width: 100%;
}

.segmented {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 8px 0 12px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.segmented .seg-btn {
  width: 100%;
}

.chip,
.seg-btn,
.ghost-btn,
.primary-btn,
.danger-btn,
.icon-btn {
  min-height: 38px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
}

.chip,
.seg-btn {
  flex: 0 0 auto;
  padding: 0 12px;
  font-size: 13px;
  white-space: nowrap;
}

.chip.is-active,
.seg-btn.is-active {
  border-color: var(--brand);
  background: #e4f1eb;
  color: var(--brand-dark);
  font-weight: 700;
}

.primary-btn,
.ghost-btn,
.danger-btn,
.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 13px;
  font-weight: 700;
  text-decoration: none;
}

.primary-btn {
  border-color: var(--brand);
  background: var(--brand);
  color: #fff;
}

.ghost-btn {
  background: #fff;
}

.danger-btn {
  border-color: rgba(197, 72, 55, 0.26);
  background: #fff4f2;
  color: var(--red);
}

.icon-btn {
  width: 42px;
  padding: 0;
}

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

.customer-card {
  width: 100%;
  min-height: 136px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  text-align: left;
  box-shadow: 0 4px 18px rgba(28, 37, 33, 0.05);
}

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

.card-name {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.card-name strong {
  font-size: 17px;
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 8px;
  background: #edf0eb;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.badge.hot {
  background: #fff0e8;
  color: #b5531e;
}

.badge.orange {
  background: #fff0e8;
  color: #b5531e;
}

.badge.green {
  background: #e4f1eb;
  color: var(--brand-dark);
}

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

.badge.red {
  background: #fff0ee;
  color: var(--red);
}

.badge.good {
  background: #e4f1eb;
  color: var(--brand-dark);
}

.badge.warn {
  background: #fff6e3;
  color: #956411;
}

.badge.bad {
  background: #fff0ee;
  color: var(--red);
}

.score {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  border-radius: 8px;
  background: #f4f0e8;
  color: #7b5620;
  font-size: 17px;
  font-weight: 800;
}

.card-line {
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

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

.mini-tag {
  padding: 5px 8px;
  border-radius: 8px;
  background: #f1f4ef;
  color: #4f5d55;
  font-size: 12px;
}

.next-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 11px;
  padding-top: 10px;
  border-top: 1px solid #edf0eb;
  color: var(--muted);
  font-size: 12px;
}

.next-row strong {
  color: var(--ink);
  font-size: 13px;
}

.empty {
  min-height: 180px;
  display: grid;
  place-items: center;
  padding: 22px;
  border: 1px dashed #cbd5ca;
  border-radius: 8px;
  color: var(--muted);
  text-align: center;
}

.empty.compact {
  min-height: 104px;
}

.customer-table {
  display: none;
}

.eyebrow {
  display: inline-flex;
  width: fit-content;
  min-height: 24px;
  align-items: center;
  padding: 0 8px;
  border-radius: 8px;
  background: #e4f1eb;
  color: var(--brand-dark);
  font-size: 12px;
  font-weight: 800;
}

.desktop-dashboard {
  margin-top: 12px;
}

.desktop-hero,
.guide-hero {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 6px 22px rgba(28, 37, 33, 0.06);
}

.desktop-hero h2,
.guide-hero h2 {
  margin: 8px 0 0;
  font-size: 22px;
  line-height: 1.25;
}

.desktop-hero p,
.guide-hero p {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.5;
}

.desktop-hero-actions,
.guide-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.desktop-grid,
.guide-grid,
.role-guide-grid,
.feature-list,
.device-grid {
  display: grid;
  gap: 10px;
}

.desktop-panel,
.guide-step,
.role-guide,
.feature-item {
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.guide-step {
  display: grid;
  gap: 7px;
}

.guide-step > span {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--brand-dark);
  color: #fff;
  font-weight: 800;
}

.guide-step strong,
.role-guide strong,
.feature-item strong {
  font-size: 15px;
}

.guide-step p,
.feature-item p,
.daily-routine p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.role-guide {
  display: grid;
  gap: 8px;
}

.role-guide > span {
  color: var(--muted);
  font-size: 13px;
}

.feature-item {
  display: grid;
  gap: 6px;
}

.daily-routine {
  display: grid;
  gap: 10px;
}

.priority-card {
  width: 100%;
  min-height: 170px;
  display: grid;
  gap: 8px;
  padding: 13px;
  border: 1px solid rgba(18, 108, 84, 0.18);
  border-radius: 8px;
  background: #f3f8f2;
  color: var(--ink);
  text-align: left;
}

.priority-card strong {
  font-size: 18px;
}

.priority-card span,
.priority-card p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

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

.training-flow span {
  min-height: 38px;
  display: grid;
  place-items: center;
  padding: 0 8px;
  border-radius: 8px;
  background: #f6f8f4;
  color: var(--brand-dark);
  font-size: 13px;
  font-weight: 800;
}

.detail-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.detail-title {
  flex: 1;
  min-width: 0;
}

.detail-title h1 {
  margin: 0;
  font-size: 22px;
}

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

.info-band {
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  margin-bottom: 10px;
}

.access-stack {
  display: grid;
  gap: 10px;
}

.access-item {
  display: grid;
  gap: 4px;
  padding: 10px 0;
  border-bottom: 1px solid #edf0eb;
}

.access-item:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.access-item span {
  color: var(--muted);
  font-size: 12px;
}

.access-item strong {
  font-size: 13px;
  line-height: 1.45;
  word-break: break-all;
}

.access-actions {
  margin-top: 12px;
}

.account-share-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.account-share {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  text-align: left;
}

.account-share.is-inactive {
  background: #fff4f2;
  border-color: rgba(197, 72, 55, 0.22);
}

.account-share > span {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.account-share strong {
  display: block;
  font-size: 14px;
}

.account-share small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.field-tip {
  margin: -1px 0 2px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.relationship-line {
  color: var(--muted);
  font-size: 12px;
}

.relationship-panel .field-tip {
  margin-top: 10px;
}

.transfer-mode-tabs {
  margin-top: 10px;
}

.checkbox-grid {
  display: grid;
  gap: 8px;
}

.checkbox-item {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 42px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font-size: 13px;
}

.checkbox-item input {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--brand);
  flex: 0 0 auto;
}

.permission-grid {
  display: grid;
  gap: 8px;
}

.check-card {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.check-card input {
  width: 18px;
  height: 18px;
  margin: 2px 0 0;
  accent-color: var(--brand);
  flex: 0 0 auto;
}

.check-card span {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.check-card strong {
  font-size: 13px;
}

.check-card small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.transfer-log-list {
  display: grid;
  gap: 8px;
}

.transfer-log-item,
.transfer-summary {
  display: grid;
  gap: 5px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.transfer-summary {
  margin-bottom: 10px;
  background: #f6f8f4;
}

.transfer-log-item span,
.transfer-summary span {
  color: var(--muted);
  font-size: 12px;
}

.transfer-log-item strong,
.transfer-summary strong {
  font-size: 14px;
}

.transfer-log-item p {
  margin: 0;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.45;
}

.transfer-log-item small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

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

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

.audit-stat {
  display: grid;
  gap: 4px;
  min-height: 72px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.audit-stat span {
  color: var(--muted);
  font-size: 12px;
}

.audit-stat strong {
  font-size: 22px;
}

.audit-alert-list,
.audit-log-list,
.audit-user-rank {
  display: grid;
  gap: 8px;
}

.audit-user-rank {
  display: flex;
  flex-wrap: wrap;
}

.audit-alert {
  padding: 10px;
  border: 1px solid #ffd5c8;
  border-radius: 8px;
  background: #fff5f1;
  color: #9f2d14;
  font-size: 13px;
  line-height: 1.45;
}

.audit-log-item {
  display: grid;
  gap: 5px;
  padding: 10px;
  border: 1px solid var(--line);
  border-left: 4px solid #a9b7aa;
  border-radius: 8px;
  background: #fff;
}

.audit-log-item.risk-red {
  border-left-color: var(--red);
}

.audit-log-item.risk-warn {
  border-left-color: #d7951f;
}

.audit-log-item.risk-good {
  border-left-color: var(--green);
}

.audit-log-item span,
.audit-log-item small {
  color: var(--muted);
  font-size: 12px;
}

.audit-log-item strong {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 14px;
}

.audit-log-item em {
  flex: 0 0 auto;
  padding: 2px 7px;
  border-radius: 999px;
  background: #f3f0ea;
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
}

.audit-log-item p {
  margin: 0;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.45;
}

.protection-warning-band {
  display: grid;
  gap: 10px;
}

.protection-line {
  color: #8b4e0d;
}

.protection-panel {
  display: grid;
  gap: 10px;
}

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

.team-card {
  display: grid;
  gap: 3px;
  min-height: 90px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.team-card strong {
  font-size: 14px;
}

.team-card span,
.team-card small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.team-card b {
  font-size: 20px;
  line-height: 1;
}

.login-shell {
  display: grid;
  gap: 14px;
  min-height: calc(100dvh - 120px);
  align-content: start;
}

.login-band {
  display: grid;
  gap: 12px;
}

.login-form {
  display: grid;
  gap: 10px;
}

.login-error {
  margin: 0;
  color: var(--red);
  font-size: 13px;
}

.login-tip {
  display: grid;
  gap: 4px;
  padding-top: 8px;
  border-top: 1px solid #edf0eb;
}

.login-tip span {
  color: var(--muted);
  font-size: 12px;
}

.login-tip strong {
  font-size: 13px;
  word-break: break-all;
}

.info-band h2 {
  margin: 0 0 10px;
  font-size: 16px;
}

.next-action-band {
  border-color: rgba(18, 108, 84, 0.2);
  background: #f3f8f2;
}

.next-action-band.warn {
  border-color: rgba(180, 130, 46, 0.26);
  background: #fff8ec;
}

.next-action-band.bad {
  border-color: rgba(197, 72, 55, 0.3);
  background: #fff3ef;
}

.action-focus {
  display: grid;
  gap: 6px;
}

.action-focus span {
  width: fit-content;
  padding: 4px 8px;
  border-radius: 8px;
  background: rgba(18, 108, 84, 0.1);
  color: var(--brand-dark);
  font-size: 12px;
  font-weight: 800;
}

.next-action-band.warn .action-focus span {
  background: rgba(180, 130, 46, 0.14);
  color: #956411;
}

.next-action-band.bad .action-focus span {
  background: rgba(197, 72, 55, 0.12);
  color: var(--red);
}

.action-focus strong {
  font-size: 15px;
  line-height: 1.45;
}

.action-focus p,
.missing-fields p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.missing-fields {
  display: grid;
  gap: 5px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(23, 34, 29, 0.09);
}

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

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

.info-item {
  min-width: 0;
}

.info-item.full {
  grid-column: 1 / -1;
}

.info-item span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.info-item strong {
  display: block;
  margin-top: 4px;
  font-size: 14px;
  line-height: 1.3;
  word-break: break-word;
}

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

.price-cell {
  min-height: 64px;
  padding: 9px 7px;
  border-radius: 8px;
  background: #f6f8f4;
}

.price-cell span {
  display: block;
  color: var(--muted);
  font-size: 11px;
}

.price-cell strong {
  display: block;
  margin-top: 5px;
  font-size: 15px;
}

.risk-list {
  display: grid;
  gap: 8px;
}

.risk-item {
  display: grid;
  gap: 4px;
  min-height: 74px;
  padding: 10px;
  border-radius: 8px;
  background: #fff8ec;
  border: 1px solid rgba(180, 130, 46, 0.22);
}

.risk-item.is-hard {
  background: #fff2ef;
  border-color: rgba(197, 72, 55, 0.28);
}

.risk-item span {
  width: fit-content;
  padding: 3px 7px;
  border-radius: 8px;
  background: rgba(180, 130, 46, 0.13);
  color: #956411;
  font-size: 11px;
  font-weight: 800;
}

.risk-item.is-hard span {
  background: rgba(197, 72, 55, 0.12);
  color: var(--red);
}

.risk-item strong {
  font-size: 14px;
}

.risk-item p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

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

.quote-cell {
  min-height: 66px;
  padding: 9px;
  border-radius: 8px;
  background: #f6f8f4;
}

.quote-cell span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.quote-cell strong {
  display: block;
  margin-top: 5px;
  font-size: 18px;
  line-height: 1.15;
}

.quote-mini {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.quote-mini span {
  padding: 5px 8px;
  border-radius: 8px;
  background: #edf0eb;
  color: var(--muted);
  font-size: 12px;
}

.quote-decision {
  display: grid;
  gap: 6px;
  margin-bottom: 12px;
  padding: 11px;
  border-radius: 8px;
  background: #fff6e3;
}

.quote-decision.good {
  background: #e4f1eb;
}

.quote-decision.bad {
  background: #fff0ee;
}

.quote-decision span {
  width: fit-content;
  padding: 4px 8px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.64);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.quote-decision strong {
  font-size: 14px;
  line-height: 1.4;
}

.quote-preview {
  margin: 12px 0 0;
}

.source-review {
  display: grid;
  gap: 12px;
}

.source-rows,
.source-video-list {
  display: grid;
  gap: 8px;
}

.source-row {
  display: grid;
  grid-template-columns: 56px 42px 72px 54px 42px;
  align-items: center;
  gap: 6px;
  min-height: 42px;
  padding: 8px;
  border-radius: 8px;
  background: #f6f8f4;
  color: var(--muted);
  font-size: 12px;
}

.source-row strong {
  color: var(--ink);
  font-size: 14px;
}

.source-row b {
  color: var(--brand-dark);
  text-align: right;
}

.source-video {
  padding: 10px;
  border-radius: 8px;
  background: #f4f7fb;
}

.source-video span {
  color: var(--blue);
  font-size: 12px;
  font-weight: 800;
}

.source-video strong {
  display: block;
  margin-top: 4px;
  font-size: 14px;
  line-height: 1.35;
}

.source-video p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.timeline {
  display: grid;
  gap: 10px;
}

.timeline-item {
  padding-left: 12px;
  border-left: 3px solid var(--brand);
}

.timeline-item strong {
  display: block;
  font-size: 14px;
}

.timeline-item p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.ai-box {
  padding: 12px;
  border-radius: 8px;
  background: #132f2a;
  color: #f7fbf5;
}

.ai-box p {
  margin: 8px 0 0;
  color: #dbe9e2;
  font-size: 13px;
  line-height: 1.5;
}

.ai-query {
  display: grid;
  gap: 8px;
}

.ai-query textarea {
  width: 100%;
  min-height: 86px;
  resize: vertical;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  outline: none;
}

.extract-actions,
.extract-save-row {
  display: grid;
  grid-template-columns: 1fr 0.65fr 0.55fr;
  gap: 8px;
}

.extract-save-row {
  grid-template-columns: 1fr 0.72fr;
  margin-top: 12px;
}

.extract-form-grid {
  margin-top: 12px;
}

.qa-inline {
  margin-top: 12px;
}

.qa-score {
  display: inline-grid;
  place-items: center;
  min-width: 58px;
  min-height: 34px;
  padding: 0 9px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 800;
}

.qa-score.good {
  background: #e4f1eb;
  color: var(--brand-dark);
}

.qa-score.warn {
  background: #fff6e3;
  color: #956411;
}

.qa-score.bad {
  background: #fff0ee;
  color: var(--red);
}

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

.qa-row {
  min-height: 54px;
  padding: 9px;
  border-radius: 8px;
  background: #f6f8f4;
}

.qa-row.is-missing {
  background: #fff6f3;
}

.qa-row span,
.qa-script span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.qa-row strong,
.qa-script strong {
  display: block;
  margin-top: 5px;
  font-size: 13px;
  line-height: 1.35;
}

.qa-list {
  display: grid;
  gap: 7px;
  margin-top: 12px;
}

.qa-list > strong {
  font-size: 14px;
}

.qa-list p {
  margin: 0;
  padding: 9px;
  border-radius: 8px;
  background: #f6f8f4;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.qa-list p span {
  display: block;
  margin-bottom: 3px;
  color: var(--ink);
  font-weight: 800;
}

.qa-script {
  margin-top: 12px;
  padding: 10px;
  border-radius: 8px;
  background: #edf4f8;
}

.full-btn {
  width: 100%;
  margin-top: 12px;
}

.mini-tag.red-soft {
  background: #fff0ee;
  color: var(--red);
}

.mini-tag.warn-soft {
  background: #fff6e3;
  color: #956411;
}

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

.qa-supervisor-card {
  width: 100%;
  min-height: 128px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  text-align: left;
  box-shadow: 0 4px 18px rgba(28, 37, 33, 0.05);
}

.ai-result {
  margin-top: 12px;
}

.role-list {
  display: grid;
  gap: 8px;
}

.role-btn {
  width: 100%;
  min-height: 54px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  text-align: left;
}

.role-btn.is-active {
  border-color: var(--brand);
  background: #e4f1eb;
}

.funnel {
  display: grid;
  gap: 8px;
}

.funnel-row {
  display: grid;
  grid-template-columns: 76px 1fr 36px;
  align-items: center;
  gap: 9px;
  color: var(--muted);
  font-size: 13px;
}

.bar {
  height: 10px;
  overflow: hidden;
  border-radius: 8px;
  background: #edf0eb;
}

.bar span {
  display: block;
  height: 100%;
  border-radius: 8px;
  background: var(--brand);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: flex;
  align-items: end;
  justify-content: center;
  padding: 0;
  background: rgba(12, 18, 15, 0.38);
}

.modal {
  width: min(460px, 100%);
  max-height: 88dvh;
  overflow-y: auto;
  padding: 14px;
  border-radius: 8px 8px 0 0;
  background: var(--bg);
  box-shadow: 0 -16px 36px rgba(0, 0, 0, 0.18);
}

.modal-head {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 10px;
  background: var(--bg);
}

.modal-head h2 {
  margin: 0;
  font-size: 18px;
}

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

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

.field.full {
  grid-column: 1 / -1;
}

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

.field input,
.field textarea,
.field select {
  width: 100%;
  min-height: 42px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  outline: none;
}

.field textarea {
  min-height: 92px;
  resize: vertical;
}

.field .check-card input[type="checkbox"] {
  width: 18px;
  min-width: 18px;
  height: 18px;
  min-height: 18px;
  padding: 0;
  margin-top: 2px;
}

.modal-section-title {
  display: block;
  margin-top: 4px;
  padding: 8px 10px;
  border-radius: 8px;
  background: #eef3ee;
  color: var(--brand-dark);
  font-size: 13px;
}

.modal-actions {
  position: sticky;
  bottom: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 14px -14px -14px;
  padding: 12px 14px calc(12px + env(safe-area-inset-bottom));
  background: var(--bg);
  border-top: 1px solid var(--line);
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 92px;
  z-index: 60;
  transform: translateX(-50%);
  max-width: min(360px, calc(100vw - 32px));
  padding: 10px 14px;
  border-radius: 8px;
  background: #17221d;
  color: #fff;
  font-size: 14px;
  box-shadow: var(--shadow);
}

.bottom-nav {
  position: fixed;
  left: 50%;
  bottom: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  width: min(460px, 100%);
  min-height: 72px;
  transform: translateX(-50%);
  padding: 8px 8px calc(8px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(14px);
}

.nav-btn {
  display: grid;
  place-items: center;
  gap: 4px;
  min-height: 54px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
}

.nav-btn.is-active {
  background: #e4f1eb;
  color: var(--brand-dark);
  font-weight: 800;
}

.nav-icon {
  display: block;
  width: 18px;
  height: 18px;
  border-radius: 5px;
  border: 2px solid currentColor;
}

.nav-btn[data-view="home"] .nav-icon {
  border-radius: 4px 4px 7px 7px;
}

.nav-btn[data-view="leads"] .nav-icon {
  border-radius: 50%;
}

.nav-btn[data-view="customers"] .nav-icon {
  position: relative;
}

.nav-btn[data-view="customers"] .nav-icon::after {
  content: "";
  position: absolute;
  left: 3px;
  right: 3px;
  top: 7px;
  border-top: 2px solid currentColor;
}

.nav-btn[data-view="ai"] .nav-icon {
  transform: rotate(45deg);
}

.nav-btn[data-view="mine"] .nav-icon {
  border-radius: 50% 50% 7px 7px;
}

.nav-btn[data-view="guide"] .nav-icon {
  border-radius: 3px;
  border-left-width: 5px;
}

.nav-context-return {
  display: none;
}

.qa-detail-record {
  display: grid;
  gap: 14px;
}

.qa-detail-record .section-head {
  margin-bottom: 0;
}

.qa-facts,
.qa-detail-block {
  display: grid;
  gap: 10px;
}

.qa-facts-grid {
  margin-top: 0;
}

.qa-findings {
  display: grid;
  gap: 10px;
}

.qa-finding {
  border: 1px solid var(--line);
  border-left: 4px solid var(--gold);
  border-radius: 7px;
  padding: 12px;
  background: #fff;
}

.qa-finding.is-confirmed {
  border-left-color: var(--brand);
}

.qa-finding.is-historical {
  border-left-color: var(--blue);
}

.qa-finding.is-missing {
  border-left-color: var(--orange);
  background: #fffaf5;
}

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

.qa-finding-head strong {
  font-size: 15px;
}

.qa-finding-head span,
.qa-finding small {
  color: var(--muted);
  font-size: 12px;
}

.qa-finding p {
  margin: 8px 0 6px;
  line-height: 1.65;
}

.qa-follow-question {
  display: grid;
  gap: 3px;
  margin-top: 10px;
  padding-top: 9px;
  border-top: 1px dashed var(--line);
}

.qa-follow-question span {
  color: var(--orange);
  font-size: 12px;
  font-weight: 800;
}

.qa-follow-question strong {
  font-size: 13px;
  line-height: 1.55;
}

.qa-transcript-detail {
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.qa-transcript-detail summary {
  cursor: pointer;
  color: var(--brand-dark);
  font-weight: 800;
}

.qa-transcript-detail p {
  margin: 10px 0 0;
  white-space: pre-wrap;
  line-height: 1.7;
  color: var(--muted);
}

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

.attachment-upload-grid,
.attachment-link-row {
  display: grid;
  gap: 10px;
}

.attachment-selection {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.attachment-link-row {
  grid-template-columns: minmax(0, 1fr);
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.attachment-list {
  display: grid;
  gap: 9px;
}

.attachment-item {
  display: flex;
  gap: 11px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
}

.attachment-item img,
.attachment-icon {
  width: 52px;
  height: 52px;
  flex: 0 0 52px;
  border-radius: 6px;
}

.attachment-item img {
  width: 76px;
  height: 76px;
  object-fit: cover;
  display: block;
  border: 1px solid var(--line);
}

.attachment-item:has(img) {
  align-items: flex-start;
}

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

.ai-assistance-head {
  margin-top: 22px;
  padding: 14px 0 4px;
  border-top: 2px solid var(--brand-dark);
}

.ai-assistance-head span {
  color: var(--brand-dark);
  font-size: 12px;
  font-weight: 800;
}

.ai-assistance-head h2 {
  margin: 5px 0 0;
  font-size: 16px;
  line-height: 1.45;
}

.attachment-icon {
  display: grid;
  place-items: center;
  background: #e8f0ec;
  color: var(--brand-dark);
  font-size: 12px;
  font-weight: 800;
}

.attachment-copy {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.attachment-copy a {
  color: var(--brand-dark);
  font-weight: 800;
  overflow-wrap: anywhere;
}

.attachment-copy p,
.attachment-copy small {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.attachment-copy small {
  font-size: 12px;
}

@media (min-width: 960px) {
  .attachment-link-row {
    grid-template-columns: minmax(120px, 0.75fr) minmax(0, 1.4fr) auto;
    align-items: end;
  }

  .detail-facts-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
  }

  .detail-facts-grid .attachments-panel,
  .detail-facts-grid .protection-panel {
    grid-column: span 2;
  }
}

@media (min-width: 740px) {
  body {
    padding: 18px 0;
  }

  .app-shell {
    min-height: calc(100dvh - 36px);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow);
  }

  .screen {
    min-height: calc(100dvh - 36px);
  }
}

@media (min-width: 960px) {
  body {
    padding: 0;
    background: #eef3ee;
  }

  .app-shell {
    width: 100%;
    max-width: none;
    min-height: 100dvh;
    display: grid;
    grid-template-columns: 238px minmax(0, 1fr);
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .screen {
    grid-column: 2;
    grid-row: 1;
    width: min(100%, 1440px);
    min-height: 100dvh;
    margin: 0 auto;
    padding: 24px;
  }

  .bottom-nav {
    position: sticky;
    top: 0;
    left: auto;
    bottom: auto;
    grid-column: 1;
    grid-row: 1;
    width: 100%;
    min-height: 100dvh;
    height: 100dvh;
    transform: none;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
    padding: 20px 14px;
    border-top: 0;
    border-right: 1px solid var(--line);
    background: #fff;
    box-shadow: 10px 0 28px rgba(27, 41, 34, 0.05);
  }

  .nav-brand {
    display: grid;
    gap: 4px;
    margin-bottom: 12px;
    padding: 4px 8px 14px;
    border-bottom: 1px solid var(--line);
  }

  .nav-brand strong {
    font-size: 17px;
  }

  .nav-brand span {
    color: var(--muted);
    font-size: 12px;
  }

  .nav-context-return {
    display: flex;
    align-items: center;
    gap: 9px;
    min-height: 44px;
    margin: 0 0 8px;
    padding: 0 12px;
    border: 1px solid rgba(18, 108, 84, 0.18);
    border-radius: 8px;
    background: #e4f1eb;
    color: var(--brand-dark);
    font-size: 13px;
    font-weight: 800;
    text-align: left;
  }

  .nav-context-return:hover {
    border-color: rgba(18, 108, 84, 0.36);
    background: #d9ece3;
  }

  .nav-context-return-icon {
    font-size: 18px;
    line-height: 1;
  }

  .nav-btn {
    display: flex;
    justify-content: flex-start;
    gap: 11px;
    min-height: 48px;
    padding: 0 12px;
    font-size: 14px;
  }

  .nav-icon {
    width: 17px;
    height: 17px;
  }

  .desktop-only {
    display: block;
  }

  .mobile-dashboard,
  .mobile-list {
    display: none;
  }

  .topbar {
    margin-bottom: 16px;
  }

  .topbar h1 {
    font-size: 28px;
  }

  .toolbar {
    grid-template-columns: minmax(360px, 1fr) auto;
  }

  .filters {
    flex-wrap: wrap;
    overflow: visible;
  }

  .desktop-dashboard.desktop-only {
    display: block;
  }

  .desktop-hero,
  .guide-hero {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    padding: 18px;
  }

  .desktop-hero h2,
  .guide-hero h2 {
    font-size: 26px;
  }

  .desktop-hero-actions,
  .guide-actions {
    justify-content: flex-end;
  }

  .desktop-metrics {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 10px;
    margin: 14px 0;
  }

  .desktop-grid {
    grid-template-columns: minmax(0, 1.65fr) minmax(300px, 0.75fr);
    align-items: start;
    gap: 14px;
  }

  .desktop-panel-main {
    grid-row: span 3;
  }

  .customer-table.desktop-only {
    display: grid;
    gap: 8px;
  }

  .customer-row {
    width: 100%;
    min-height: 74px;
    display: grid;
    grid-template-columns: 1fr 0.92fr 1.12fr 1.08fr 1.42fr 1.18fr 1.16fr 0.82fr 60px;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    color: var(--ink);
    text-align: left;
  }

  .customer-row-head {
    min-height: 38px;
    background: #eef3ee;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
  }

  .customer-row-head span:nth-child(2),
  .customer-row > span:nth-child(2) {
    min-width: 0;
  }

  .customer-row > span {
    min-width: 0;
    display: grid;
    gap: 4px;
  }

  .customer-row strong {
    overflow: hidden;
    font-size: 14px;
    line-height: 1.25;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .customer-row small {
    overflow: hidden;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.25;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .row-score {
    min-height: 42px;
    place-items: center;
    border-radius: 8px;
    background: #f4f0e8;
    color: #7b5620;
    font-size: 17px;
    font-weight: 800;
  }

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

  .team-grid,
  .qa-coverage,
  .guide-grid,
  .feature-list {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

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

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

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

  .detail-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 390px;
    align-items: start;
    gap: 16px;
  }

  .detail-main .section:first-child,
  .detail-side .section:first-child {
    margin-top: 0;
  }

  .detail-side {
    position: sticky;
    top: 20px;
  }

.detail-actions {
  flex-wrap: wrap;
  overflow: visible;
  margin-bottom: 16px;
}

.favorite-mark {
  color: #9b6500;
  font-size: 12px;
  font-weight: 700;
}

.ghost-btn.is-favorited {
  border-color: #d2a23e;
  background: #fff8e8;
  color: #8b5900;
}

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

  .detail-side .price-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .source-review {
    grid-template-columns: minmax(0, 1fr) minmax(300px, 0.85fr);
  }

  .source-row {
    grid-template-columns: 0.8fr 0.65fr 1fr 0.8fr 0.55fr;
  }

  .extract-actions {
    grid-template-columns: 1fr 0.3fr 0.3fr;
  }

  .extract-save-row {
    grid-template-columns: 1fr 0.3fr;
  }

  .modal-backdrop {
    align-items: center;
    padding: 24px;
  }

  .modal {
    width: min(960px, calc(100vw - 64px));
    max-height: calc(100dvh - 48px);
    border-radius: 8px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.24);
  }

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

@media (max-width: 370px) {
  .metric-grid,
  .price-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .form-grid,
  .info-grid,
  .qa-coverage {
    grid-template-columns: 1fr;
  }

  .board-panel {
    align-items: start;
    flex-direction: column;
  }

  .extract-actions,
  .extract-save-row {
    grid-template-columns: 1fr;
  }

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