/* ==========================================================================
   CIFIT · 画像详情视觉系统
   作用域：.profile-detail-shell（客商画像详情 / 机构画像详情）
   设计原则：沿用决策中心红色品牌主色，浅色档案语汇，红-金-青三色语义分工
   ========================================================================== */

/* 届别浏览与机构人员名册：沿用红色档案视觉，届别贴近内容。 */
.profile-history-panel { min-width: 0; }
.history-panel-heading, .personnel-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; padding-bottom: 18px; }
.history-panel-heading h2, .personnel-header h2 { display: flex; align-items: center; gap: 8px; color: var(--pd-ink, #1c2430); font-size: 16px; font-weight: 700; }
.history-panel-heading h2 > svg, .personnel-header h2 > svg { color: var(--pd-brand, #d81e2b); }
.history-panel-heading p, .personnel-header p { margin-top: 6px; color: var(--pd-muted, #6b7787); font-size: 12px; line-height: 1.7; }
.history-panel-count { flex: none; padding: 6px 11px; border: 1px solid var(--pd-line, #e7ebf1); border-radius: 6px; background: #fafbfc; color: var(--pd-muted, #6b7787); font-size: 12px; }
.session-switcher { display: flex; align-items: center; gap: 20px; padding: 16px 18px; margin: 0 0 20px; border: 1px solid var(--pd-line, #e7ebf1); border-radius: 8px; background: #fafbfc; }
.session-switcher__label { flex: none; color: var(--pd-muted, #6b7787); font-size: 12px; }
.session-switcher__options { display: flex; align-items: stretch; flex-wrap: wrap; min-width: 0; gap: 10px; }
.session-switcher__option, .session-switcher__single { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 42px; padding: 8px 14px; border: 1px solid #e3e7ed; border-radius: 6px; color: #465265; background: #fff; font-size: 13px; font-weight: 600; }
.session-switcher__option { cursor: pointer; transition: background-color .18s, border-color .18s, color .18s; }
.session-switcher__option:hover { border-color: var(--pd-brand, #d81e2b); color: var(--pd-brand, #d81e2b); }
.session-switcher__option[aria-pressed="true"] { border-color: var(--pd-brand, #d81e2b); color: #fff; background: var(--pd-brand, #d81e2b); box-shadow: 0 3px 8px rgb(216 30 43 / .12); }
.session-switcher__option em { padding: 1px 5px; border-radius: 3px; background: #f1f3f6; color: #7b8594; font-size: 10px; font-style: normal; font-weight: 500; }
.session-switcher__option[aria-pressed="true"] em { background: rgb(255 255 255 / .18); color: #fff; }
.session-switcher__option small, .session-switcher__single small { padding-left: 7px; border-left: 1px solid currentColor; color: inherit; font-size: 11px; font-weight: 400; }
.session-switcher__more { display: flex; min-width: 140px; }
.session-switcher__more select { width: 100%; min-height: 42px; padding: 8px 28px 8px 12px; border: 1px solid #e3e7ed; border-radius: 6px; background: #fff; color: #657084; font-size: 12px; cursor: pointer; }
.session-switcher__more.is-selected select { color: var(--pd-brand, #d81e2b); border-color: var(--pd-brand, #d81e2b); background: var(--pd-brand-soft, #fff2f1); font-weight: 600; }
.session-switcher button:focus-visible, .session-switcher select:focus-visible, .institution-personnel-panel :is(button, input, select, tr[tabindex], .personnel-table-scroll):focus-visible { outline: 2px solid var(--pd-brand, #d81e2b); outline-offset: 3px; }
.history-panel-empty, .personnel-empty { display: flex; min-height: 230px; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 32px 20px; color: #9aa4b3; text-align: center; }
.history-panel-empty strong, .personnel-empty strong { color: #5b687a; font-size: 14px; font-weight: 600; }
.history-panel-empty p, .personnel-empty p { font-size: 12px; }
.institution-personnel-panel { min-width: 0; padding: 24px; border: 1px solid var(--pd-line, #e7ebf1); border-radius: 14px; background: #fff; }
.personnel-header { border-bottom: 1px solid var(--pd-line-soft, #f1f4f8); }
.personnel-header h2 strong { margin-left: 3px; padding: 2px 7px; border-radius: 4px; background: var(--pd-brand-soft, #fff2f1); color: var(--pd-brand, #d81e2b); font-size: 12px; font-weight: 600; }
.personnel-filters { display: grid; grid-template-columns: minmax(220px, 1.8fr) minmax(130px, 1fr) minmax(130px, 1fr) auto; align-items: end; gap: 12px; padding: 20px 0; }
.personnel-filter-actions { display: flex; align-items: center; gap: 8px; }
.personnel-search-button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 38px; padding: 0 16px; border: 1px solid var(--pd-brand, #d81e2b); border-radius: 5px; background: var(--pd-brand, #d81e2b); color: #fff; font-size: 12px; white-space: nowrap; cursor: pointer; }
.personnel-search-button:hover { background: var(--pd-brand-deep, #a30f1a); border-color: var(--pd-brand-deep, #a30f1a); }
.personnel-filter { display: flex; min-width: 0; flex-direction: column; gap: 7px; font-size: 12px; }
.personnel-filter > span { color: #626f81; }
.personnel-filter input, .personnel-filter select { width: 100%; min-width: 0; height: 38px; border: 1px solid #dfe5ec; border-radius: 5px; color: #39465a; background: #fff; font: inherit; }
.personnel-filter select { padding: 0 26px 0 10px; text-overflow: ellipsis; cursor: pointer; }
.personnel-search { position: relative; }
.personnel-search > svg { position: absolute; top: 11px; left: 11px; color: #9aa4b3; pointer-events: none; }
.personnel-search input { padding: 0 10px 0 34px; }
.personnel-reset { height: 38px; padding: 0 12px; border: 1px solid #dfe5ec; border-radius: 5px; background: #fff; color: #667286; white-space: nowrap; font-size: 12px; cursor: pointer; }
.personnel-reset:hover { color: var(--pd-brand, #d81e2b); border-color: var(--pd-brand-line, #ffd9d5); background: var(--pd-brand-soft, #fff2f1); }
.personnel-results-summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 0 12px; color: #8a95a5; font-size: 11px; }
.personnel-results-summary > span:first-child { color: #566378; font-size: 12px; }
.personnel-table-scroll { width: 100%; overflow-x: auto; border: 1px solid #e7ebf1; border-radius: 7px; }
.institution-personnel-table { width: 100%; min-width: 850px; border-collapse: collapse; text-align: left; font-size: 12px; }
.institution-personnel-table th { height: 44px; padding: 12px 14px; border-bottom: 1px solid #e7ebf1; background: #f7f9fb; color: #6b7787; font-weight: 500; white-space: nowrap; }
.institution-personnel-table td { padding: 18px 14px; border-bottom: 1px solid #f0f3f7; color: #39465a; vertical-align: top; line-height: 1.7; }
.institution-personnel-table tr:last-child td { border-bottom: 0; }
.institution-personnel-table tbody tr { cursor: pointer; transition: background-color .15s; }
.institution-personnel-table tbody tr:hover { background: #fffbfa; }
.personnel-name { padding: 0; color: var(--pd-brand, #d81e2b); font-size: 13px; font-weight: 600; white-space: nowrap; cursor: pointer; }
.personnel-name:hover { text-decoration: underline; text-underline-offset: 3px; }
.personnel-position { min-width: 130px; max-width: 230px; }
.personnel-phone { display: inline-flex; align-items: center; gap: 6px; color: #465265; font-variant-numeric: tabular-nums; white-space: nowrap; }
.personnel-phone__toggle { display: inline-flex; width: 24px; height: 24px; align-items: center; justify-content: center; color: #96a1ae; cursor: pointer; }
.personnel-phone__toggle:hover { color: var(--pd-brand, #d81e2b); }
.personnel-email { display: block; max-width: 220px; margin-top: 3px; color: #8b96a5; font-size: 11px; overflow-wrap: anywhere; }
.personnel-sessions { display: flex; max-width: 180px; align-items: center; flex-wrap: wrap; gap: 5px; }
.personnel-sessions > span { padding: 2px 6px; border: 1px solid #e3e9ee; border-radius: 4px; background: #f8fafb; color: #687587; white-space: nowrap; font-size: 11px; }
.personnel-sessions > button { min-width: 26px; padding: 2px 4px; color: var(--pd-brand, #d81e2b); font-size: 11px; cursor: pointer; }
.personnel-muted { color: #9aa4b3; }
.personnel-row-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.personnel-row-actions button { color: #6b7787; font-size: 12px; white-space: nowrap; cursor: pointer; }
.personnel-row-actions button:last-child { color: var(--pd-brand, #d81e2b); }
.personnel-row-actions button:hover { text-decoration: underline; text-underline-offset: 3px; }
.personnel-pagination { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 18px; color: #8a95a5; font-size: 12px; }
.personnel-pagination > div { display: flex; align-items: center; gap: 12px; }
.personnel-pagination button { display: grid; width: 30px; height: 30px; place-items: center; border: 1px solid #e3e7ed; border-radius: 5px; color: #626f81; cursor: pointer; }
.personnel-pagination button:disabled { opacity: .4; cursor: default; }
.personnel-empty button { color: var(--pd-brand, #d81e2b); font-size: 12px; cursor: pointer; }
.personnel-history-badge { padding: 2px 5px; border: 1px solid #e3e7ed; border-radius: 4px; color: #8a95a5; font-size: 10px; }
.personnel-drawer-backdrop { position: fixed; z-index: 80; inset: 0; background: rgb(15 23 42 / .35); }
.institution-personnel-drawer { position: fixed; z-index: 81; top: 0; right: 0; display: flex; flex-direction: column; width: min(560px, 100vw); height: 100vh; height: 100dvh; background: #fff; box-shadow: -12px 0 50px rgb(15 23 42 / .12); animation: personnel-drawer-in .18s ease-out; }
.personnel-drawer-header { display: flex; align-items: center; justify-content: space-between; flex: none; padding: 24px 28px; border-bottom: 1px solid #edf0f4; }
.personnel-drawer-header > div > span { color: #8a95a5; font-size: 11px; }
.personnel-drawer-header h3 { margin-top: 5px; color: #1c2430; font-size: 22px; font-weight: 600; }
.personnel-drawer-header > button { display: grid; width: 36px; height: 36px; place-items: center; border-radius: 6px; color: #8a95a5; cursor: pointer; }
.personnel-drawer-header > button:hover { background: #f5f7fa; color: #1c2430; }
.personnel-drawer-body { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 24px 28px; }
.personnel-current-card { padding: 20px; border: 1px solid #f5dedb; border-radius: 8px; background: linear-gradient(120deg, #fff5f3, #fffdfb); }
.personnel-current-card > span { color: #7a6b69; font-size: 12px; overflow-wrap: anywhere; }
.personnel-current-card h4 { margin-top: 8px; color: #2b3644; font-size: 16px; font-weight: 600; line-height: 1.65; }
.personnel-current-card small { display: block; margin-top: 10px; color: #a18e8b; font-size: 11px; }
.personnel-drawer-section { margin-top: 26px; }
.personnel-drawer-section > h4 { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding-bottom: 12px; border-bottom: 1px solid #edf0f4; color: #2b3644; font-size: 13px; font-weight: 600; }
.personnel-drawer-section > h4 small { color: #8a95a5; font-size: 11px; font-weight: 400; }
.personnel-contact-line { display: flex; align-items: center; gap: 10px; margin-top: 14px; color: #626f81; font-size: 13px; overflow-wrap: anywhere; }
.personnel-contact-line > svg { flex: none; color: #96a1ae; }
.personnel-help { margin-top: 6px; padding-left: 26px; color: #8a95a5; font-size: 11px; }
.personnel-edition-summary > div { display: grid; grid-template-columns: 74px 1fr; gap: 12px; margin-top: 14px; font-size: 12px; }
.personnel-edition-summary dt { color: #8a95a5; }
.personnel-edition-summary .personnel-sessions { max-width: none; }
.personnel-history { padding-top: 18px; }
.personnel-history > article { position: relative; margin-left: 4px; padding: 0 0 24px 23px; border-left: 1px solid #ead8d7; }
.personnel-history > article:last-child { border-left-color: transparent; padding-bottom: 0; }
.personnel-history > article::before { position: absolute; top: 5px; left: -4px; width: 7px; height: 7px; border-radius: 50%; background: #d7b7b4; content: ""; }
.personnel-history > article:first-child::before { background: var(--pd-brand, #d81e2b); box-shadow: 0 0 0 3px #fff0ee; }
.personnel-history__edition { display: flex; align-items: center; gap: 8px; color: #9a8582; font-size: 11px; }
.personnel-history__edition em { padding: 1px 5px; border-radius: 3px; background: #fff1ee; color: #c45e58; font-size: 10px; font-style: normal; }
.personnel-history article > strong { display: block; margin-top: 6px; color: #39465a; font-size: 13px; font-weight: 600; }
.personnel-history article > p { margin-top: 5px; color: #8a95a5; font-size: 11px; line-height: 1.7; }
.personnel-history article > small { display: block; margin-top: 5px; color: #8a95a5; font-size: 11px; }
.personnel-drawer-footer { display: flex; align-items: center; justify-content: flex-end; flex: none; gap: 12px; padding: 18px 28px; border-top: 1px solid #edf0f4; }
.personnel-drawer-footer > button { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-radius: 5px; background: var(--pd-brand, #d81e2b); color: #fff; font-size: 12px; cursor: pointer; }
@keyframes personnel-drawer-in { from { transform: translateX(24px); opacity: .5; } to { transform: translateX(0); opacity: 1; } }
@media (max-width: 1200px) {
  .personnel-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .personnel-filter--search { grid-column: span 2; }
  .personnel-filter-actions { grid-column: 1 / -1; justify-content: flex-end; }
}
@media (max-width: 767px) {
  .history-panel-heading, .personnel-header { flex-wrap: wrap; gap: 10px; padding-bottom: 14px; }
  .history-panel-heading h2, .personnel-header h2 { font-size: 15px; }
  .session-switcher { align-items: flex-start; flex-direction: column; gap: 10px; padding: 12px; margin-bottom: 16px; }
  .session-switcher__options { gap: 8px; }
  .session-switcher__option { min-height: 44px; padding: 8px 10px; }
  .session-switcher__more select { min-height: 44px; }
  .institution-personnel-panel { padding: 16px; }
  .personnel-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 10px; padding: 16px 0; }
  .personnel-filter--search { grid-column: 1 / -1; }
  .personnel-filter-actions > button { flex: 1; }
  .personnel-filter input, .personnel-filter select, .personnel-reset, .personnel-search-button { height: 44px; }
  .personnel-search > svg { top: 14px; }
  .personnel-results-summary { align-items: flex-start; flex-direction: column; gap: 4px; }
  .personnel-row-actions button { min-height: 32px; }
  .personnel-phone__toggle { width: 32px; height: 32px; }
  .personnel-pagination { align-items: flex-start; flex-direction: column; }
  .personnel-drawer-header { padding: 18px 20px; }
  .personnel-drawer-body { padding: 18px 20px; }
  .personnel-drawer-footer { padding: 16px 20px; padding-bottom: max(16px, env(safe-area-inset-bottom)); }
}
@media (prefers-reduced-motion: reduce) { .institution-personnel-drawer { animation: none; } }

/* 顶部页面签条：上下各留 10px，避免标签贴住深红顶栏与内容区 */
.page-tabs-bar {
  padding-top: 10px;
  padding-bottom: 10px;
}

.profile-detail-shell {
  --pd-ink: #1c2430;
  --pd-ink-2: #2b3644;
  --pd-text: #39465a;
  --pd-muted: #6b7787;
  --pd-faint: #96a1ae;
  --pd-line: #e7ebf1;
  --pd-line-soft: #f1f4f8;
  --pd-brand: #EF2D2D;
  --pd-brand-deep: #a30f1a;
  --pd-brand-soft: #fff2f1;
  --pd-brand-line: #ffd9d5;
  --pd-teal: #0e7a72;
  --pd-teal-soft: #eafaf7;
  --pd-teal-line: #cde8e4;
  --pd-gold: #8a5a00;
  --pd-gold-soft: #fff8e8;
  --pd-gold-line: #efd9a8;
  --pd-radius: 14px;
  --pd-shadow: 0 1px 2px rgba(20, 28, 40, 0.04), 0 14px 30px -20px rgba(20, 28, 40, 0.3);
  --pd-shadow-hover: 0 1px 2px rgba(20, 28, 40, 0.05), 0 18px 34px -18px rgba(20, 28, 40, 0.34);
  font-family: "Noto Sans SC", "Source Han Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--pd-text);
  background:
    radial-gradient(1100px 320px at 18% -180px, rgba(245, 34, 45, 0.045), rgba(241, 245, 249, 0) 70%),
    radial-gradient(900px 300px at 92% -170px, rgba(216, 30, 43, 0.035), rgba(241, 245, 249, 0) 70%);
}

/* ---------------------------------------------------------------- 卡片骨架 */

.profile-hero,
.profile-detail-shell section.bg-white,
.profile-detail-shell .bg-white.p-5,
.profile-detail-shell .bg-white.p-6,
.profile-detail-shell #card-merchant-base,
.profile-detail-shell #card-merchant-history,
.profile-detail-shell #card-merchant-behaviors,
.profile-detail-shell #card-merchant-risk {
  /* border: 1px solid var(--pd-line) !important; */
  border-radius: var(--pd-radius) !important;
  /* background: #fff !important; */
  /* box-shadow: var(--pd-shadow) !important; */
  margin-bottom: 12px;
}

.profile-hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
}

/* 顶部 4px 品牌渐变描边 */
.profile-hero::before {
  position: absolute;
  z-index: 2;
  inset: 0 0 auto 0;
  height: 4px;
  content: "";
  background: linear-gradient(90deg, #a30f1a 0%, #e01f2b 54%, #f7918f 100%);
}

/* 头部卡片底色：自上而下「浅红 → 白」线性过渡，贯穿整卡高度
   注：渐变里不要用 transparent（等价透明黑，插值会发灰） */
.profile-hero::after {
  position: absolute;
  z-index: -1;
  inset: 4px 0 0 0;
  pointer-events: none;
  content: "";
  background-image: linear-gradient(
    180deg,
    #fcebeb 0%,
    #fdf1f0 20%,
    #fef6f5 40%,
    #fffaf9 62%,
    #fffdfd 82%,
    #ffffff 100%
  );
}

/* ---------------------------------------------------------------- 头部身份区 */

.profile-hero--person {
  padding: 16px 20px !important;
}

.profile-hero--institution > div:first-child {
  display: grid !important;
  grid-template-columns: auto auto minmax(0, 1fr);
  align-items: start;
  gap: 14px !important;
  padding: 16px 20px !important;
}

.profile-hero__identity {
  display: grid !important;
  grid-template-columns: auto auto minmax(0, 1fr);
  align-items: start;
  gap: 14px !important;
  padding: 0 !important;
  border: 0 !important;
}

/* 返回按钮：圆形描边按钮 */
.profile-back {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  width: 32px;
  height: 32px;
  margin-top: 2px !important;
  padding: 0 !important;
  color: #6b7787 !important;
  border: 1px solid var(--pd-line) !important;
  border-radius: 999px !important;
  background: #fff;
  box-shadow: 0 1px 2px rgba(20, 28, 40, 0.05);
  transition: color 160ms ease, border-color 160ms ease, background-color 160ms ease, transform 160ms ease;
}

.profile-back:hover {
  color: var(--pd-brand) !important;
  border-color: var(--pd-brand-line) !important;
  background: var(--pd-brand-soft) !important;
  transform: translateX(-1px);
}

.profile-back svg {
  width: 16px !important;
  height: 16px !important;
}

/* 人像 / 机构 Logo */
.profile-portrait {
  width: 82px !important;
  height: 104px !important;
  overflow: hidden;
  border: 3px solid #fff !important;
  border-radius: 13px !important;
  background: #eef1f5 !important;
  box-shadow:
    0 0 0 1px #e2e7ee,
    0 10px 22px -12px rgba(20, 28, 40, 0.4) !important;
}

.profile-logo {
  width: 80px !important;
  height: 80px !important;
  overflow: hidden;
  border: 1px solid var(--pd-line) !important;
  border-radius: 14px !important;
  background: linear-gradient(180deg, #ffffff, #fafbfd) !important;
  box-shadow:
    0 0 0 3px #fff,
    0 0 0 4px #eef1f6,
    0 10px 20px -12px rgba(20, 28, 40, 0.32) !important;
}

.profile-title {
  color: var(--pd-ink) !important;
  font-size: clamp(22px, 1.75vw, 27px) !important;
  font-weight: 700 !important;
  line-height: 1.25;
  letter-spacing: -0.015em;
}

.profile-name-tags {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  min-width: 0;
  margin-left: 4px;
}

.profile-name-tags .profile-badge {
  min-height: 24px;
  padding: 3px 9px 3px 7px;
  font-size: 11px;
}

/* 机构标题旁的类型标签 */
.profile-type-chip {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 9px;
  color: #46566a !important;
  font-size: 11.5px !important;
  font-weight: 600 !important;
  border: 1px solid var(--pd-line) !important;
  border-radius: 7px !important;
  background: linear-gradient(180deg, #ffffff, #f7f9fc) !important;
}

.profile-type-chip--gold {
  color: #8a5a00 !important;
  border-color: var(--pd-gold-line) !important;
  background: linear-gradient(180deg, #fffaee, #fff3d9) !important;
}

.profile-icon-btn {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  width: 26px;
  height: 26px;
  padding: 0 !important;
  color: #97a2af !important;
  border-radius: 7px;
  transition: color 150ms ease, background-color 150ms ease;
}

.profile-icon-btn:hover {
  color: var(--pd-brand) !important;
  background: var(--pd-brand-soft) !important;
}

/* 客商详情：所属机构跳转链接 */
.profile-org-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  max-width: 100%;
  padding: 4px 10px 4px 8px !important;
  color: var(--pd-brand-deep) !important;
  font-size: 12.5px !important;
  font-weight: 600 !important;
  text-decoration: none !important;
  border: 1px solid var(--pd-brand-line) !important;
  border-radius: 8px !important;
  background: rgba(255, 255, 255, 0.9) !important;
  box-shadow: 0 1px 2px rgba(20, 28, 40, 0.04);
  transition: border-color 150ms ease, background-color 150ms ease, color 150ms ease;
}

.profile-org-link:hover {
  color: var(--pd-brand) !important;
  border-color: #ffc2bc !important;
  background: #fff8f7 !important;
  text-decoration: none !important;
}

.profile-org-link svg {
  color: var(--pd-brand);
}

.profile-org-link__hint {
  padding-left: 7px;
  color: #98a3b0 !important;
  font-size: 10.5px !important;
  font-weight: 500 !important;
  border-left: 1px solid #eaeef4;
}

.profile-org-link:hover .profile-org-link__hint {
  color: var(--pd-brand) !important;
}

/* 机构详情：参展 / 参会届次胶囊 */
.profile-hero__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
}

.profile-meta-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 28px;
  padding: 0 11px;
  font-size: 11.5px;
  border: 1px solid var(--pd-line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  font: inherit;
}

button.profile-meta-chip:hover {
  border-color: #93c5fd;
  background: #eff6ff;
}

.profile-meta-chip__icon {
  width: 13px;
  height: 13px;
  flex: none;
  stroke-width: 2;
}

.profile-meta-chip em {
  color: var(--pd-muted);
  font-style: normal;
  font-weight: 600;
}

.profile-meta-chip b {
  color: var(--pd-ink-2);
  font-weight: 700;
  letter-spacing: 0.01em;
}

.profile-meta-chip--exhibition .profile-meta-chip__icon {
  color: var(--pd-brand);
}

.profile-meta-chip--meeting .profile-meta-chip__icon {
  color: var(--pd-teal);
}

/* ---------------------------------------------------------------- 关键信息栅格 */

.profile-facts {
  display: grid !important;
  gap: 1px !important;
  overflow: hidden;
  margin-top: 10px !important;
  padding: 0;
  border: 1px solid var(--pd-line) !important;
  border-radius: 12px;
  background: var(--pd-line);
  box-shadow: none;
}

/* 单元格统一白底、无悬停反馈，外框与内部分隔线均为 1px */
.profile-facts > div,
.profile-fact {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  min-height: 40px !important;
  padding: 8px 12px !important;
  border: 0 !important;
  background: #fff;
}

/* 机构地址独占摘要表格的最后一行 */
.profile-hero--institution .profile-facts > .profile-fact--address {
  grid-column: 1 / -1 !important;
}

/* 上市状态作为独立信息单元格，与人员规模并列展示。 */
.profile-facts > .profile-fact--listing .profile-type-chip {
  flex: none;
  height: 22px;
  padding: 0 8px;
  font-size: 11px !important;
  border-radius: 6px !important;
}

.profile-facts > div > span:first-child,
.profile-fact > span:first-child {
  flex: none;
  color: var(--pd-faint) !important;
  font-size: 11px !important;
  font-weight: 600 !important;
  letter-spacing: 0.04em;
}

.profile-facts > div > span:first-child::after,
.profile-fact > span:first-child::after {
  content: "：";
}

.profile-facts > div > span:last-child,
.profile-fact > span:last-child {
  min-width: 0;
  flex: 1;
  color: var(--pd-ink-2) !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  line-height: 1.45;
}

/* 客商：6 项 → 3 列 2 行；机构：8 项 → 4 列 2 行 */
.profile-hero--person .profile-facts {
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
}

.profile-hero--institution .profile-facts {
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  background: var(--pd-line);
}

@media (min-width: 1100px) {
  .profile-hero--institution .profile-facts {
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  }
}

/* ---------------------------------------------------------------- 标签 / 历史摘要行 */

.profile-signal-grid {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin-top: 10px;
  border-top: 1px solid rgba(216, 30, 43, 0.11);
  border-bottom: 1px solid var(--pd-line);
}

.profile-signal-grid--institution {
  display: flex;
}

.profile-signal-row {
  display: grid;
  grid-template-columns: 138px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  min-width: 0;
  width: 100%;
  font: inherit;
  min-height: 39px;
  padding: 5px 2px !important;
  border: 0 !important;
  border-bottom: 1px solid var(--pd-line-soft) !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

.profile-signal-row:last-child {
  border-bottom: 0 !important;
}

.profile-signal-card__title {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 0;
  color: #43536a !important;
  font-size: 12px !important;
  font-weight: 700 !important;
  letter-spacing: 0.02em;
}

.profile-signal-card__title svg {
  width: 14px;
  height: 14px;
  color: var(--pd-muted);
}

.profile-signal-row--tags .profile-signal-card__title svg {
  color: #c8901a;
}

.profile-signal-row--tags {
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 9px;
}

.profile-signal-row--history .profile-signal-card__title svg {
  color: var(--pd-teal);
}

.profile-signal-row--history {
  grid-template-columns: max-content minmax(0, 1fr);
}

.profile-signal-row--history .profile-signal-card__title,
.profile-signal-row--history .profile-signal-card__title > span {
  white-space: nowrap;
}

.profile-signal-card__title strong {
  margin-left: 3px;
  padding: 2px 8px;
  color: var(--pd-teal) !important;
  font-size: 11px !important;
  font-weight: 700;
  border: 1px solid var(--pd-teal-line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.85);
}

.profile-chip-list,
.profile-session-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

/* 标签胶囊 */
.profile-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 25px;
  padding: 3px 10px 3px 8px;
  font-size: 11.5px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.01em;
  border: 1px solid transparent;
  border-radius: 999px;
  box-shadow: 0 1px 2px rgba(30, 41, 56, 0.06);
}

.profile-badge__icon {
  width: 13px;
  height: 13px;
  flex: none;
  stroke-width: 2.1;
}

/* 重点标签（首位）—— 金色高亮，与“重点标签”卡片同族 */
.profile-badge--featured {
  color: #6b4300;
  border-color: #e0b35a;
  background: linear-gradient(135deg, #ffeec2, #f9d98c);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.75),
    0 3px 8px -3px rgba(154, 103, 0, 0.34);
}

.profile-badge--standard {
  color: #3b4b60;
  border-color: #e0e6ee;
  background: linear-gradient(180deg, #ffffff, #f7f9fc);
}

.profile-badge--honor {
  color: #84570a;
  border-color: var(--pd-gold-line);
  background: linear-gradient(180deg, #fffaea, #fdf0cd);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.7),
    0 2px 6px -2px rgba(154, 103, 0, 0.18);
}

.profile-badge--business {
  color: #3a5265;
  border-color: #dde5ec;
  background: linear-gradient(180deg, #ffffff, #f5f8fb);
}

/* 届次胶囊 */
.profile-session {
  display: inline-grid;
  grid-template-columns: auto auto;
  overflow: hidden;
  border: 1px solid var(--pd-teal-line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(14, 122, 114, 0.06);
}

.profile-session__edition,
.profile-session__role {
  padding: 4px 8px;
  font-size: 11px;
  line-height: 1.25;
}

.profile-session__edition {
  color: #fff;
  font-weight: 700;
  background: linear-gradient(135deg, #12867c, #0b6b64);
}

.profile-session__role {
  color: #2c5d59;
  font-weight: 600;
  background: #fbfffe;
}

.profile-latest-summary {
  color: #1f4c48 !important;
  font-size: 12.5px !important;
  font-weight: 650 !important;
  line-height: 1.6;
}

.profile-latest-meta {
  margin-top: 0;
  color: #72908c !important;
  font-size: 11.5px !important;
  line-height: 1.55;
}

.profile-latest-inline {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.profile-latest-inline .profile-latest-meta {
  overflow: hidden;
  padding-left: 10px;
  border-left: 1px solid var(--pd-line);
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ---------------------------------------------------------------- 切换条（独立分段控件） */

.profile-tabs {
  display: flex !important;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  overflow: visible;
  padding: 5px !important;
  border: 1px solid var(--pd-line) !important;
  border-radius: 12px !important;
  background: #fff !important;
  /* box-shadow: 0 1px 2px rgba(20, 28, 40, 0.045); */
  scrollbar-width: none;
}

.profile-tabs::-webkit-scrollbar {
  display: none;
}

/* 切换条与下方内容间距 12px（space-y 作用在前一个兄弟的下边距上），与上方摘要卡片保持 24px */
.profile-detail-shell .profile-tabs {
  margin-bottom: 12px !important;
}

/* fragment 渲染出来的内容（display:contents）不参与父级 space-y，需单独补卡片间距 */
.profile-detail-shell > native-fragment > * + * {
  /* margin-top: 24px !important; */
}

.profile-tabs button,
.profile-tab {
  position: relative;
  flex: none;
  cursor: pointer;
  height: 38px;
  min-height: 38px !important;
  padding: 0 16px !important;
  color: #5d6a7a !important;
  font-size: 12.5px !important;
  font-weight: 600 !important;
  white-space: nowrap;
  border: 0 !important;
  border-radius: 8px !important;
  background: transparent;
  transition: color 150ms ease, background-color 150ms ease, box-shadow 150ms ease;
}

.profile-tabs button:hover,
.profile-tab:hover {
  color: var(--pd-brand) !important;
  background: #f6f8fa !important;
}

/* 白底轨道上的选中态：浅红填充胶囊 + 红色描边 */
.profile-tabs button[aria-selected="true"],
.profile-tab[aria-selected="true"] {
  color: var(--pd-brand) !important;
  font-weight: 700 !important;
  background: #fff1f0 !important;
  box-shadow: inset 0 0 0 1px #ffccc7;
}

.profile-tabs button:focus-visible,
.profile-detail-shell button:focus-visible,
.profile-detail-shell select:focus-visible,
.profile-detail-shell textarea:focus-visible,
.profile-detail-shell a:focus-visible {
  outline: 2px solid #e01f2b !important;
  outline-offset: 2px;
}

/* ---------------------------------------------------------------- 内容卡片通用 */

/* 补齐编译产物里缺失的 Tailwind 间距工具类（styles.css 未生成 mt-5 / space-y-5，
   导致「约束与风险」页卡片与综合状态条直接相贴） */
.profile-detail-shell .mt-5 {
  margin-top: 20px !important;
}

.profile-detail-shell .space-y-5 > * + * {
  margin-top: 20px !important;
}

.profile-detail-shell h3,
.profile-detail-shell h2 {
  letter-spacing: -0.005em;
}

.profile-detail-shell .border-slate-100,
.profile-detail-shell .border-slate-50 {
  border-color: var(--pd-line-soft) !important;
}

.profile-detail-shell .border-slate-200 {
  border-color: var(--pd-line) !important;
}

/* 卡片头部：图标 + 标题 + 右侧元信息 */
.profile-base-card > div:first-child,
.profile-detail-shell section.bg-white > div:first-child {
  padding-bottom: 12px !important;
  border-bottom: 1px solid var(--pd-line-soft) !important;
}

.profile-detail-shell section.bg-white > div:first-child h2,
.profile-base-card > div:first-child h3 {
  color: var(--pd-ink) !important;
  font-size: 13.5px !important;
  font-weight: 700 !important;
}

/* ---------------------------------------------------------------- 基础信息字段表 */

.profile-base-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  column-gap: 44px;
  row-gap: 0;
}

.profile-detail-shell .grid.grid-cols-3 {
  grid-template-columns: 96px minmax(0, 1fr) !important;
  align-items: center;
  column-gap: 14px !important;
  padding: 10px 10px !important;
  border: 0 !important;
  border-bottom: 1px solid var(--pd-line-soft) !important;
  border-radius: 7px;
  transition: background-color 150ms ease;
}

.profile-detail-shell .grid.grid-cols-3 > *:first-child {
  color: var(--pd-muted) !important;
  font-size: 12px !important;
  font-weight: 500 !important;
}

.profile-detail-shell .grid.grid-cols-3 > *:nth-child(2) {
  grid-column: 2 / -1;
  color: var(--pd-ink-2);
  font-size: 12.5px;
}

.profile-detail-shell .grid.grid-cols-3:hover {
  background: #fbfcfd;
}

/* 机构基础信息：字段区域使用独立底板，避免与机构介绍混在一起。 */
.profile-detail-shell [data-profile-section="institution-base"] .institution-base-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 28px;
  margin-top: 8px;
  padding: 8px 14px;
  border: 1px solid var(--pd-line-soft);
  border-radius: 10px;
  background: #fbfcfe;
}

.profile-detail-shell [data-profile-section="institution-base"] .institution-base-grid::after {
  display: none;
}

.profile-detail-shell [data-profile-section="institution-base"] .institution-base-grid > div {
  min-width: 0;
  padding-right: 12px !important;
  padding-left: 12px !important;
}

.profile-detail-shell [data-profile-section="institution-base"] .institution-base-grid > div > div {
  min-width: 0;
  overflow-wrap: anywhere;
}

.profile-detail-shell [data-profile-section="institution-base"] .institution-intro-card {
  background: linear-gradient(135deg, #fff 0%, #fbfcff 100%) !important;
}

/* 基础信息双栏，中缝加一条渐隐分隔线 */
@media (min-width: 900px) {
  .profile-base-grid {
    position: relative;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .profile-base-grid > * {
    margin: 0 !important;
  }

  .profile-base-grid > div:nth-last-child(-n + 2) {
    border-bottom: 0 !important;
  }

  .profile-base-grid::after {
    position: absolute;
    top: 8px;
    bottom: 8px;
    left: 50%;
    width: 1px;
    content: "";
    background: linear-gradient(180deg, transparent, var(--pd-line), transparent);
  }
}

/* 机构介绍与登记字段均整幅排布，信息量大时仍保持清晰层级。 */
@media (min-width: 1024px) {
  .profile-detail-shell [data-profile-section="institution-base"] {
    grid-template-columns: minmax(0, 1fr) !important;
    row-gap: 18px;
  }

  .profile-detail-shell [data-profile-section="institution-base"] > section {
    grid-column: 1 / -1 !important;
  }

  .profile-detail-shell [data-profile-section="institution-base"] > div {
    display: block;
    order: -1;
    grid-column: 1 / -1 !important;
  }

}

@media (min-width: 1280px) {
  .profile-detail-shell [data-profile-section="institution-base"] .institution-base-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    column-gap: 32px;
  }
}

/* 机构介绍正文：引言式排版 */
.profile-detail-shell [data-profile-section="institution-base"] > div > section > div {
  border-radius: 10px;
}

.profile-detail-shell [data-profile-section="institution-base"] .bg-slate-50\/70 {
  max-width: none;
  padding: 2px 0 2px 18px !important;
  color: #3d4c5e !important;
  font-size: 12.5px !important;
  line-height: 1.95 !important;
  border: 0 !important;
  border-left: 3px solid var(--pd-brand-line) !important;
  border-radius: 0 !important;
  background: transparent !important;
}

/* ---------------------------------------------------------------- 历史任职 / 参会详情 / 行为偏好 */
.behavior-preference-panel{position:relative}.behavior-preference-header{display:flex;align-items:flex-start;justify-content:space-between;gap:16px;padding-bottom:16px;border-bottom:1px solid #e2e8f0}.behavior-preference-total{flex:none;padding:5px 10px;border-radius:999px;background:#eff6ff;color:#1d4ed8;font-size:12px;font-weight:700}.behavior-preference-grid{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:12px;margin-top:16px}.behavior-preference-card{display:flex;min-height:182px;flex-direction:column;border:1px solid #e2e8f0;border-top:3px solid #2563eb;border-radius:10px;padding:15px;background:linear-gradient(180deg,#f8fbff 0%,#fff 45%);box-shadow:0 1px 2px rgb(15 23 42/.04)}.behavior-preference-card--like{border-top-color:#ef4444}.behavior-preference-card--share{border-top-color:#8b5cf6}.behavior-preference-card--favorite{border-top-color:#f59e0b}.behavior-preference-card--negotiation{border-top-color:#0f766e}.behavior-preference-card__top{display:flex;align-items:center;justify-content:space-between;gap:8px}.behavior-preference-card__label{font-size:13px;font-weight:700;color:#334155}.behavior-preference-card__count{font-size:24px;line-height:1;color:#0f172a}.behavior-preference-card__count small{font-size:11px;font-weight:500;color:#94a3b8}.behavior-preference-card__latest{display:flex;min-width:0;flex:1;flex-direction:column;gap:5px;margin-top:16px}.behavior-preference-card__latest>span{font-size:11px;color:#94a3b8}.behavior-preference-card__latest>strong{display:-webkit-box;overflow:hidden;color:#334155;font-size:12px;line-height:1.55;-webkit-box-orient:vertical;-webkit-line-clamp:2}.behavior-preference-card__latest time{font-size:11px;color:#94a3b8}.behavior-preference-card__more{align-self:flex-start;margin-top:12px;color:#2563eb;font-size:12px;font-weight:700}.behavior-preference-card__more:hover{text-decoration:underline}.behavior-preference-card__more:focus-visible,.behavior-log-drawer button:focus-visible{outline:2px solid #2563eb;outline-offset:3px}.behavior-log-drawer__backdrop{position:fixed;inset:0;z-index:70;background:rgb(15 23 42/.36);backdrop-filter:blur(2px)}.behavior-log-drawer{position:fixed;z-index:71;top:0;right:0;display:flex;width:min(520px,100vw);height:100vh;flex-direction:column;background:#fff;box-shadow:-20px 0 60px rgb(15 23 42/.18);animation:behavior-drawer-in .2s ease-out}.behavior-log-drawer__header{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:20px 24px;border-bottom:1px solid #e2e8f0}.behavior-log-drawer__eyebrow{display:block;margin-bottom:4px;color:#64748b;font-size:11px}.behavior-log-drawer__header h3{color:#0f172a;font-size:16px;font-weight:700}.behavior-log-drawer__close{display:grid;width:36px;height:36px;place-items:center;border-radius:8px;color:#64748b}.behavior-log-drawer__close:hover{background:#f1f5f9;color:#0f172a}.behavior-log-drawer__body{flex:1;overflow-y:auto;padding:20px 24px}.behavior-log-entry{position:relative;margin-left:9px;padding:0 0 22px 24px;border-left:1px solid #cbd5e1}.behavior-log-entry:before{position:absolute;top:3px;left:-5px;width:9px;height:9px;border-radius:50%;background:#2563eb;box-shadow:0 0 0 4px #dbeafe;content:""}.behavior-log-entry__time{display:block;color:#94a3b8;font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:11px}.behavior-log-entry__action{display:block;margin-top:5px;color:#0f172a;font-size:13px}.behavior-log-entry__content{margin-top:5px;color:#475569;font-size:12px;line-height:1.65}.behavior-log-entry__channel{display:inline-flex;margin-top:8px;padding:3px 7px;border-radius:999px;background:#f1f5f9;color:#64748b;font-size:11px}.behavior-log-drawer__empty{display:grid;min-height:240px;place-items:center;color:#94a3b8;font-size:13px}@keyframes behavior-drawer-in{from{transform:translateX(24px);opacity:.4}to{transform:translateX(0);opacity:1}}@media(max-width:1100px){.behavior-preference-grid{grid-template-columns:repeat(3,minmax(0,1fr))}}@media(max-width:767px){.behavior-preference-header{align-items:stretch;flex-direction:column}.behavior-preference-total{align-self:flex-start}.behavior-preference-grid{grid-template-columns:1fr}.behavior-preference-card{min-height:150px}.behavior-log-drawer{width:100%}.behavior-log-drawer__header,.behavior-log-drawer__body{padding-right:18px;padding-left:18px}}@media(prefers-reduced-motion:reduce){.behavior-log-drawer{animation:none}}
.behavior-preference-other{display:inline-flex;margin-top:14px;align-items:center;border:1px solid #cbd5e1;border-radius:999px;padding:6px 12px;background:#f8fafc;color:#475569;font-size:12px;font-weight:700}.behavior-preference-other:hover{border-color:#93c5fd;background:#eff6ff;color:#1d4ed8}.behavior-preference-other:focus-visible{outline:2px solid #2563eb;outline-offset:3px}

/* Attachment-aligned behavior information: four-column cards and timeline drawer. */
.behavior-preference-panel{padding:20px;background:#fff}.behavior-preference-header{padding-bottom:14px}.behavior-preference-header h3{font-size:16px;color:#111827}.behavior-preference-header p{margin-top:6px;color:#475569;font-size:12px;line-height:1.6}.behavior-preference-grid{grid-template-columns:repeat(4,minmax(0,1fr));gap:16px;margin-top:18px}.behavior-preference-card{min-height:206px;border-radius:4px;border-color:#cbd5e1;border-top-width:5px;padding:18px;background:#fff;box-shadow:none;transition:border-color .18s ease,box-shadow .18s ease,transform .18s ease}.behavior-preference-card:hover{border-right-color:#94a3b8;border-bottom-color:#94a3b8;border-left-color:#94a3b8;box-shadow:0 8px 24px rgb(15 23 42/.08);transform:translateY(-1px)}.behavior-preference-card--view{border-top-color:#234ee8}.behavior-preference-card--like{border-top-color:#f5222d}.behavior-preference-card--share{border-top-color:#f5a500}.behavior-preference-card--favorite{border-top-color:#5b16d6}.behavior-preference-card--negotiation{border-top-color:#4f8f08}.behavior-preference-card__label{color:#111827;font-size:14px}.behavior-preference-card__count{font-size:18px;font-weight:500}.behavior-preference-card__latest{gap:7px;margin-top:18px}.behavior-preference-card__latest>span{color:#94a3b8;font-size:12px}.behavior-preference-card__latest>strong{color:#1f2937;font-size:13px;font-weight:500;line-height:1.65}.behavior-preference-card__latest time{margin-top:4px;color:#6b7280;font-size:12px;font-variant-numeric:tabular-nums}.behavior-preference-card__more{margin-top:15px;color:#f5222d;font-size:12px}.behavior-preference-card__more:focus-visible{outline-color:#f5222d}.behavior-log-drawer__header{padding:22px 28px}.behavior-log-drawer__eyebrow{color:#475569;font-size:12px}.behavior-log-drawer__header h3{font-size:18px}.behavior-log-drawer__body{padding:28px}.behavior-log-timeline{position:relative;padding-left:13px}.behavior-log-entry{margin-left:0;padding:0 0 34px 31px;border-left:2px solid #dbeafe}.behavior-log-entry:last-child{padding-bottom:10px;border-left-color:transparent}.behavior-log-entry:before{top:3px;left:-8px;width:14px;height:14px;border:3px solid #dbeafe;background:#3b82f6;box-shadow:none}.behavior-log-entry__time{color:#64748b;font-family:inherit;font-size:13px}.behavior-log-entry__action{margin-top:10px;color:#111827;font-size:15px}.behavior-log-entry__content{margin-top:8px;color:#334155;font-size:13px;line-height:1.7}.behavior-log-entry__channel{margin-top:10px;border:1px solid #e2e8f0;background:#f8fafc}.behavior-preference-other{border-radius:4px}
@media(max-width:1199px){.behavior-preference-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:767px){.behavior-preference-panel{padding:16px}.behavior-preference-grid{grid-template-columns:1fr;gap:12px}.behavior-preference-card{min-height:176px}.behavior-log-drawer__header,.behavior-log-drawer__body{padding-right:18px;padding-left:18px}}

/* 参会信息仅展示实际参加的活动，不再显示固定的标准活动类型说明。 */
#card-merchant-history .space-y-3 > div:first-child > div:last-child {
  display: none;
}

/* 只作用于任职卡片本身（> div.bg-white），避免把「历史任职 共 N 家机构」标题行也涂成白底 */
#card-merchant-employment > div.bg-white,
#card-merchant-history > div.border {
  border-color: var(--pd-line) !important;
  border-radius: 12px !important;
  background: #fff !important;
  box-shadow: 0 1px 2px rgba(20, 28, 40, 0.03);
  transition: box-shadow 180ms ease, border-color 180ms ease;
}

#card-merchant-employment > div.bg-white:hover,
#card-merchant-history > div.border:hover {
  border-color: #d9e2ec !important;
  box-shadow: var(--pd-shadow-hover);
}

/* 任职字段：两列紧凑排布 */
#card-merchant-employment > div > div.grid {
  gap: 0 32px !important;
}

#card-merchant-employment > div > div.grid > div {
  padding: 10px 0 !important;
}

#card-merchant-employment > div > div.grid > div > span:first-child {
  color: var(--pd-faint) !important;
  font-size: 11px !important;
  font-weight: 600;
  letter-spacing: 0.03em;
}

#card-merchant-employment > div > div.grid > div > span:last-child {
  color: var(--pd-ink-2) !important;
  font-weight: 600;
}

/* 行为轨迹时间轴：补一条贯穿的竖线 */
#card-merchant-behaviors .pl-6::before {
  content: "";
  position: absolute;
  top: 8px;
  bottom: 8px;
  left: 6px;
  width: 2px;
  border-radius: 2px;
  background: linear-gradient(180deg, #dbe2ea, #eaeff5);
}

/* 补齐红色主题：Tailwind 蓝色系中未被主题覆盖的深色档位 */
.profile-detail-shell .text-blue-800 {
  color: #a01822 !important;
}

.profile-detail-shell .text-blue-900 {
  color: #8c1019 !important;
}

.profile-detail-shell .bg-blue-100 {
  background-color: #ffe3e0 !important;
}

.profile-detail-shell .bg-blue-200 {
  background-color: #ffd0cb !important;
}

.profile-detail-shell .bg-blue-500 {
  background-color: #ee2b36 !important;
}

.profile-detail-shell .ring-blue-100 {
  --tw-ring-color: #ffe0dd !important;
}

/* 顶部筛选 / 分段选择器统一描边 */
.profile-detail-shell select {
  border-color: var(--pd-line) !important;
  border-radius: 8px !important;
  box-shadow: 0 1px 2px rgba(20, 28, 40, 0.04);
}

.profile-detail-shell select:hover {
  border-color: #c9d3df !important;
}

/* ---------------------------------------------------------------- 断点适配 */

@media (max-width: 1100px) {
  .profile-signal-grid,
  .profile-signal-grid--institution {
    display: flex;
  }
}

@media (max-width: 900px) {
  .profile-hero--person {
    padding: 18px !important;
  }

  .profile-hero--institution > div:first-child {
    padding: 18px 18px 16px !important;
  }

  .profile-hero__identity,
  .profile-hero--institution > div:first-child {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .profile-back {
    grid-column: 1 / -1;
    margin-bottom: 2px !important;
  }

  .profile-hero--person .profile-facts,
  .profile-hero--institution .profile-facts {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  .profile-detail-shell [data-profile-section="institution-base"] > section > .mt-3 {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 640px) {
  .profile-detail-shell {
    padding: 12px !important;
  }

  .profile-hero::before {
    height: 3px;
  }

  .profile-portrait {
    width: 76px !important;
    height: 96px !important;
  }

  .profile-logo {
    width: 76px !important;
    height: 76px !important;
  }

  .profile-title {
    font-size: 20px !important;
  }

  .profile-facts > div,
  .profile-fact {
    min-height: 40px !important;
    padding: 8px 10px !important;
  }

  .profile-signal-row {
    grid-template-columns: minmax(0, 1fr);
    gap: 5px;
    padding: 8px 2px !important;
  }

  .profile-latest-inline {
    align-items: flex-start;
    flex-direction: column;
    gap: 3px;
  }

  .profile-latest-inline .profile-latest-meta {
    padding-left: 0;
    border-left: 0;
  }

  .profile-tabs {
    padding: 4px !important;
  }

  .profile-tabs button,
  .profile-tab {
    height: 36px;
    min-height: 36px !important;
    padding: 0 12px !important;
    font-size: 12px !important;
  }

  .profile-detail-shell .grid.grid-cols-3 {
    grid-template-columns: 84px minmax(0, 1fr) !important;
    padding: 9px 6px !important;
  }

  .profile-org-link__hint {
    display: none;
  }

  .profile-type-chip {
    height: 22px;
    font-size: 11px !important;
  }

  .profile-hero--institution > div:first-child > .min-w-0.flex-1 { display: contents; }
  .profile-hero--institution > div:first-child > .min-w-0.flex-1 > div:first-child { align-self: center; }
  .profile-hero--institution .profile-hero__meta,
  .profile-hero--institution .profile-signal-grid,
  .profile-hero--institution .profile-facts { grid-column: 1 / -1; }
  .profile-hero--institution .profile-hero__meta { margin-top: 0; }
  .profile-hero--institution .profile-meta-chip { max-width: 100%; height: auto; min-height: 30px; padding: 5px 10px; border-radius: 6px; font-size: 11.5px; line-height: 1.7; align-items: flex-start; }
  .profile-hero--institution .profile-meta-chip__icon { margin-top: 3px; }
  .profile-hero--institution .profile-meta-chip em { flex: none; white-space: nowrap; }
  .profile-hero--institution .profile-meta-chip b { font-size: 11.5px; }
}

@media (prefers-reduced-motion: reduce) {
  .profile-detail-shell *,
  .profile-detail-shell *::before,
  .profile-detail-shell *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
/* User profile interaction / marketing workspace */
.profile-employment-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

@media (max-width: 900px) {
  .profile-employment-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

.interaction-subtabs {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.interaction-subtabs button {
  min-width: 190px;
  padding: 9px 14px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #64748b;
  text-align: left;
  cursor: pointer;
  transition: background-color .18s ease, color .18s ease, box-shadow .18s ease;
}

.interaction-subtabs button strong,
.interaction-subtabs button span {
  display: block;
}

.interaction-subtabs button strong {
  font-size: 13px;
  color: #334155;
}

.interaction-subtabs button span {
  margin-top: 2px;
  font-size: 11px;
}

.interaction-subtabs button.is-active {
  background: #eff6ff;
  color: #2563eb;
  box-shadow: inset 0 0 0 1px #bfdbfe;
}

.interaction-subtabs button.is-active strong {
  color: #1d4ed8;
}

.marketing-contact-card {
  padding: 20px;
}

.marketing-contact-card__header,
.marketing-history-header,
.marketing-modal__header,
.marketing-modal__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.marketing-contact-card__header {
  padding-bottom: 14px;
  border-bottom: 1px solid #f1f5f9;
}

.marketing-compliance-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border: 1px solid;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

.marketing-compliance-badge.is-allowed {
  color: #047857;
  border-color: #a7f3d0;
  background: #ecfdf5;
}

.marketing-compliance-badge.is-blocked {
  color: #be123c;
  border-color: #fecdd3;
  background: #fff1f2;
}

.marketing-summary-badge {
  display: inline-flex;
  align-items: center;
  padding: 6px 11px;
  border: 1px solid #bfdbfe;
  border-radius: 999px;
  background: #eff6ff;
  color: #1d4ed8;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.marketing-recipient-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  margin-top: 16px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  overflow: hidden;
  background: #f8fafc;
}

.marketing-recipient-grid > div {
  min-width: 0;
  padding: 12px 14px;
  border-right: 1px solid #e2e8f0;
}

.marketing-recipient-grid > div:last-child {
  border-right: 0;
}

.marketing-recipient-grid span,
.marketing-recipient-grid strong {
  display: block;
}

.marketing-recipient-grid span {
  color: #94a3b8;
  font-size: 11px;
}

.marketing-recipient-grid strong {
  margin-top: 4px;
  color: #1e293b;
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.marketing-risk-warning {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: 14px;
  padding: 10px 12px;
  border: 1px solid #fecdd3;
  border-radius: 7px;
  background: #fff1f2;
  color: #be123c;
  font-size: 12px;
  line-height: 1.55;
}

.marketing-channel-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.marketing-channel-card {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
  padding: 14px;
  border: 1px solid #e2e8f0;
  border-radius: 9px;
  background: #fff;
  color: #334155;
  text-align: left;
  cursor: pointer;
  transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}

.marketing-channel-card:hover:not(:disabled) {
  border-color: #93c5fd;
  box-shadow: 0 4px 12px rgba(15, 23, 42, .07);
  transform: translateY(-1px);
}

.marketing-channel-card:disabled {
  cursor: not-allowed;
  opacity: .55;
}

.marketing-channel-card__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 9px;
  color: #2563eb;
  background: #eff6ff;
}

.marketing-channel-card--emerald .marketing-channel-card__icon {
  color: #059669;
  background: #ecfdf5;
}

.marketing-channel-card--violet .marketing-channel-card__icon {
  color: #7c3aed;
  background: #f5f3ff;
}

.marketing-channel-card--amber .marketing-channel-card__icon {
  color: #d97706;
  background: #fffbeb;
}

.marketing-channel-card__content strong,
.marketing-channel-card__content small {
  display: block;
}

.marketing-channel-card__content strong {
  color: #0f172a;
  font-size: 12px;
}

.marketing-channel-card__content small {
  margin-top: 3px;
  color: #64748b;
  font-size: 10px;
  line-height: 1.4;
}

.marketing-channel-card__action {
  color: #2563eb;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

.marketing-channel-grid--statistics .marketing-channel-card {
  cursor: pointer;
  --touch-accent:#2563eb;
  --touch-soft:#f1f6ff;
  grid-template-columns:56px minmax(0,1fr) auto;
  gap:0 10px;
  padding:0;
  overflow:hidden;
  border-color:#e5eaf1;
  border-radius:10px;
  box-shadow:0 2px 4px #0f172a03;
}

.marketing-channel-grid--statistics .marketing-channel-card--amber { --touch-accent:#b77914; --touch-soft:#fff9ed; }
.marketing-channel-grid--statistics .marketing-channel-card--emerald { --touch-accent:#059669; --touch-soft:#effbf6; }
.marketing-channel-grid--statistics .marketing-channel-card--violet { --touch-accent:#7c3aed; --touch-soft:#f7f3ff; }
.marketing-channel-grid--statistics .marketing-channel-card__icon { width:40px; height:40px; margin:18px 0 18px 16px; border-radius:11px; }
.marketing-channel-grid--statistics .marketing-channel-card__content strong { font-size:13px; font-weight:600; }
.marketing-channel-grid--statistics .marketing-channel-stat__count { grid-column:3; justify-content:flex-end; min-width:0; margin-right:16px; gap:5px; }
.marketing-channel-grid--statistics .marketing-channel-stat__count strong { font-size:28px; font-weight:600; letter-spacing:-.8px; }
.marketing-channel-grid--statistics .marketing-channel-stat__count small { font-size:11px; color:#94a3b8; }

.marketing-channel-grid--statistics .marketing-channel-card:hover {
  border-color: var(--touch-accent);
  box-shadow: 0 5px 16px rgba(15, 23, 42, .06);
  transform: translateY(-2px);
}

.marketing-channel-grid--statistics .marketing-channel-card:focus-visible { outline:2px solid #ef2d2d; outline-offset:3px; }
.marketing-channel-detail-button { grid-column:1 / -1; width:100%; display:flex; align-items:center; justify-content:space-between; gap:8px; padding:9px 16px; border:0; border-top:1px solid #edf1f6; border-radius:0; background:#fafbfd; color:#64748b; font-size:12px; font-weight:500; line-height:20px; cursor:pointer; white-space:nowrap; transition:background .18s,color .18s; }
.marketing-channel-detail-button > span { display:flex; align-items:center; justify-content:center; width:22px; height:22px; border-radius:50%; background:var(--touch-soft); color:var(--touch-accent); font-size:14px; line-height:1; transition:transform .18s; }
.marketing-channel-grid--statistics .marketing-channel-card:hover .marketing-channel-detail-button { background:var(--touch-soft); color:var(--touch-accent); }
.marketing-channel-detail-button:hover > span { transform:translateX(2px); }
.marketing-channel-detail-button:focus-visible { outline:2px solid var(--touch-accent); outline-offset:-3px; background:var(--touch-soft); color:var(--touch-accent); }
.visit-drawer.touch-record-drawer { width:1120px; }
.touch-record-table-scroll { overflow-x:auto; border:1px solid #e2e8f0; border-radius:6px; }
.touch-record-table { width:100%; min-width:680px; border-collapse:collapse; text-align:left; table-layout:fixed; font-size:12px; }
.touch-record-table th,.touch-record-table td { padding:15px 16px; vertical-align:top; line-height:1.8; border-bottom:1px solid #e2e8f0; overflow-wrap:anywhere; white-space:pre-wrap; }
.touch-record-table th { background:#f8fafc; color:#64748b; font-weight:600; }
.touch-record-table td { color:#334155; }
.touch-record-table tbody tr:last-child td { border-bottom:0; }
.touch-record-table tbody tr:hover { background:#fafcff; }
.touch-record-table .touch-record-cell--time { width:170px; white-space:nowrap; font-variant-numeric:tabular-nums; }
.touch-record-table .touch-record-cell--title { width:200px; }
.touch-record-table .touch-record-cell--type { width:110px; }
.touch-record-table .touch-record-cell--template { width:170px; }
.touch-record-table--sms { min-width:780px; }
.touch-record-table--email { min-width:960px; }
.touch-record-table--email .touch-record-cell--subject { width:200px; }
.touch-record-table--email .touch-record-cell--account { width:220px; }
.touch-record-table--email .touch-record-cell--sender { width:140px; }

.marketing-channel-stat__count {
  display: inline-flex;
  align-items: baseline;
  justify-content: flex-end;
  gap: 3px;
  min-width: 62px;
  color: #0f172a;
  white-space: nowrap;
}

.marketing-channel-stat__count strong {
  font-size: 24px;
  line-height: 1;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.marketing-channel-stat__count small {
  color: #64748b;
  font-size: 11px;
}

.marketing-history-header {
  padding: 16px 18px;
  border-bottom: 1px solid #e2e8f0;
}

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

.marketing-history-table {
  width: 100%;
  min-width: 930px;
  border-collapse: collapse;
  font-size: 11px;
}

.marketing-history-table th {
  padding: 10px 14px;
  background: #f8fafc;
  color: #64748b;
  font-weight: 600;
  text-align: left;
  white-space: nowrap;
}

.marketing-history-table td {
  padding: 12px 14px;
  border-top: 1px solid #f1f5f9;
  vertical-align: middle;
}

.marketing-history-table tbody tr:hover {
  background: #f8fafc;
}

.marketing-channel-tag,
.marketing-status {
  display: inline-flex;
  align-items: center;
  padding: 3px 7px;
  border: 1px solid;
  border-radius: 5px;
  font-size: 10px;
  font-weight: 600;
  white-space: nowrap;
}

.marketing-channel-tag.is-inbox {
  color: #1d4ed8;
  border-color: #bfdbfe;
  background: #eff6ff;
}

.marketing-channel-tag.is-sms {
  color: #047857;
  border-color: #a7f3d0;
  background: #ecfdf5;
}

.marketing-channel-tag.is-email {
  color: #6d28d9;
  border-color: #ddd6fe;
  background: #f5f3ff;
}

.marketing-history-subject {
  display: block;
  max-width: 250px;
  color: #1e293b;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.marketing-status.is-success {
  color: #047857;
  border-color: #a7f3d0;
  background: #ecfdf5;
}

.marketing-status.is-pending {
  color: #b45309;
  border-color: #fde68a;
  background: #fffbeb;
}

.marketing-feedback {
  display: block;
  margin-top: 4px;
  color: #94a3b8;
  white-space: nowrap;
}

.marketing-detail-button {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: 0;
  background: transparent;
  color: #2563eb;
  font-size: 11px;
  cursor: pointer;
}

.marketing-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(15, 23, 42, .48);
  backdrop-filter: blur(2px);
}

.marketing-modal,
.marketing-detail-modal {
  width: min(760px, 100%);
  max-height: 92vh;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 24px 60px rgba(15, 23, 42, .22);
  overflow-y: auto;
}

.marketing-detail-modal {
  width: min(520px, 100%);
}

.marketing-modal__header {
  position: sticky;
  top: 0;
  z-index: 2;
  padding: 16px 20px;
  border-bottom: 1px solid #e2e8f0;
  background: #fff;
}

.marketing-modal__header h3 {
  color: #0f172a;
  font-size: 15px;
  font-weight: 700;
}

.marketing-modal__header p {
  margin-top: 3px;
  color: #64748b;
  font-size: 11px;
}

.marketing-modal__header > button {
  display: inline-flex;
  padding: 5px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: #94a3b8;
  cursor: pointer;
}

.marketing-modal__channels {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding: 14px 20px;
  border-bottom: 1px solid #f1f5f9;
  background: #f8fafc;
}

.marketing-modal__channels button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  background: #fff;
  color: #64748b;
  font-size: 12px;
  cursor: pointer;
}

.marketing-modal__channels button.is-active {
  border-color: #2563eb;
  background: #eff6ff;
  color: #1d4ed8;
  font-weight: 600;
}

.marketing-form {
  padding: 18px 20px 20px;
}

.marketing-form section + section {
  margin-top: 18px;
}

.marketing-form section > h4 {
  margin-bottom: 10px;
  padding-bottom: 7px;
  border-bottom: 1px solid #f1f5f9;
  color: #1e293b;
  font-size: 13px;
  font-weight: 700;
}

.marketing-form label {
  display: block;
  color: #475569;
  font-size: 11px;
}

.marketing-form label > span:first-child {
  display: block;
  margin-bottom: 5px;
  font-weight: 600;
}

.marketing-form input,
.marketing-form select,
.marketing-form textarea {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  outline: none;
  background: #fff;
  color: #1e293b;
  font-family: inherit;
  font-size: 12px;
  line-height: 1.55;
}

.marketing-form input:focus,
.marketing-form select:focus,
.marketing-form textarea:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, .1);
}

.marketing-form input[readonly] {
  background: #f8fafc;
  color: #64748b;
}

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

.marketing-form-grid__full {
  grid-column: 1 / -1;
}

.marketing-label-row {
  display: flex !important;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.marketing-label-row small,
.marketing-counter {
  color: #94a3b8;
  font-size: 10px;
  font-weight: 400;
}

.marketing-counter {
  margin-top: 5px;
  text-align: right;
}

.marketing-form section > label + label {
  margin-top: 12px;
}

.marketing-send-mode {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 10px 12px;
  border: 1px solid #e2e8f0;
  border-radius: 7px;
  background: #f8fafc;
}

.marketing-send-mode label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.marketing-send-mode label > span:first-child {
  display: inline;
  margin: 0;
}

.marketing-send-mode input[type="radio"] {
  width: auto;
}

.marketing-send-mode input[type="datetime-local"] {
  width: 220px;
  margin-left: auto;
  background: #fff;
}

.marketing-preview {
  margin-top: 16px;
  padding: 14px;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  background: #eff6ff;
}

.marketing-preview__title {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 10px;
  color: #1d4ed8;
  font-size: 11px;
  font-weight: 700;
}

.marketing-preview > strong {
  display: block;
  color: #0f172a;
  font-size: 13px;
}

.marketing-preview > p {
  margin-top: 7px;
  color: #334155;
  font-size: 12px;
  line-height: 1.7;
  white-space: pre-line;
}

.marketing-preview > small {
  display: block;
  margin-top: 8px;
  color: #64748b;
  font-size: 10px;
}

.marketing-success-message {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 16px;
  padding: 9px 12px;
  border: 1px solid #a7f3d0;
  border-radius: 6px;
  background: #ecfdf5;
  color: #047857;
  font-size: 12px;
  font-weight: 600;
}

.marketing-modal__footer {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid #e2e8f0;
}

.marketing-footer-compliance {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #059669;
  font-size: 10px;
}

.marketing-modal__actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.marketing-modal__actions button,
.marketing-detail-modal__footer button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
}

.marketing-modal__actions button.is-secondary {
  border: 1px solid #cbd5e1;
  background: #fff;
  color: #475569;
}

.marketing-modal__actions button.is-primary {
  border: 1px solid #2563eb;
  background: #2563eb;
  color: #fff;
}

.marketing-detail-list {
  padding: 18px 20px;
}

.marketing-detail-list > div {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid #f1f5f9;
  font-size: 12px;
}

.marketing-detail-list span {
  color: #94a3b8;
}

.marketing-detail-list strong {
  color: #334155;
  font-weight: 600;
}

.marketing-detail-modal__footer {
  display: flex;
  justify-content: flex-end;
  padding: 12px 20px 18px;
}

.marketing-detail-modal__footer button {
  border: 1px solid #2563eb;
  background: #2563eb;
  color: #fff;
}

@media (max-width: 900px) {
  .marketing-recipient-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .marketing-recipient-grid > div:nth-child(2) {
    border-right: 0;
  }

  .marketing-recipient-grid > div:nth-child(-n+2) {
    border-bottom: 1px solid #e2e8f0;
  }

  .marketing-channel-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .interaction-subtabs {
    display: grid;
    width: 100%;
    grid-template-columns: 1fr 1fr;
  }

  .interaction-subtabs button {
    min-width: 0;
    padding: 8px 10px;
    text-align: center;
  }

  .interaction-subtabs button span {
    display: none;
  }

  .marketing-contact-card {
    padding: 14px;
  }

  .marketing-contact-card__header,
  .marketing-modal__footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .marketing-recipient-grid,
  .marketing-form-grid {
    grid-template-columns: 1fr;
  }

  .marketing-recipient-grid > div {
    border-right: 0;
    border-bottom: 1px solid #e2e8f0;
  }

  .marketing-recipient-grid > div:last-child {
    border-bottom: 0;
  }

  .marketing-channel-card {
    grid-template-columns: 34px minmax(0, 1fr);
    gap: 9px;
    padding: 10px;
  }

  .marketing-channel-card__icon {
    width: 34px;
    height: 34px;
  }

  .marketing-channel-card__content small,
  .marketing-channel-card__action {
    display: none;
  }

  .marketing-channel-stat__count {
    grid-column: 2;
    justify-content: flex-start;
  }

  .marketing-channel-stat__count strong {
    font-size: 20px;
  }

  .marketing-form-grid__full {
    grid-column: auto;
  }

  .marketing-send-mode {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }

  .marketing-send-mode input[type="datetime-local"] {
    width: 100%;
    margin-left: 0;
  }

  .marketing-modal__actions {
    width: 100%;
    flex-wrap: wrap;
  }
}
.profile-tag-taxonomy {
  background: transparent;
}

.profile-tag-modules { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.profile-tag-module { overflow: hidden; border: 1px solid #dbe3ee; border-radius: 8px; background: #fff; }
.profile-tag-module__header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; border-bottom: 1px solid #e7edf4; background: #f8fafc; }
.profile-tag-module__header strong { color: #334155; font-size: 12px; font-weight: 700; }
.profile-tag-module__header span { color: #94a3b8; font-size: 10px; }
.profile-tag-module__body { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; min-height: 64px; padding: 14px 16px; }
.profile-tag-chip { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border: 1px solid #fecaca; border-radius: 6px; background: #fff1f2; color: #ef4444; font-size: 11px; font-weight: 600; }
.profile-tag-chip svg { color: #ef4444; }

.profile-tag-taxonomy__intro {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 14px;
  border-bottom: 1px solid #e7edf4;
  background: #f8fafc;
  color: #334155;
  font-size: 12px;
}

.profile-tag-taxonomy__intro > div:first-child {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.profile-tag-taxonomy__intro strong { font-weight: 700; }
.profile-tag-taxonomy__intro > div:first-child span { color: #64748b; font-size: 11px; }
.profile-tag-taxonomy__legend { display: flex; align-items: center; gap: 12px; color: #94a3b8; font-size: 10px; }
.profile-tag-taxonomy__legend span::before { content: ""; display: inline-block; width: 7px; height: 7px; margin-right: 5px; border-radius: 50%; background: #e2e8f0; }
.profile-tag-taxonomy__legend span.is-current::before { background: #2563eb; }
.profile-tag-table-wrap { overflow-x: auto; }
.profile-tag-table { width: 100%; min-width: 720px; border-collapse: collapse; color: #475569; font-size: 12px; }
.profile-tag-table th { padding: 10px 14px; border-bottom: 1px solid #dbe3ee; background: #f8fafc; color: #64748b; font-size: 11px; font-weight: 700; text-align: left; }
.profile-tag-table th:first-child { width: 150px; }
.profile-tag-table th:nth-child(2) { width: 150px; }
.profile-tag-table td { padding: 13px 14px; border-bottom: 1px solid #edf1f5; vertical-align: middle; }
.profile-tag-table tbody tr:last-child td { border-bottom: 0; }
.profile-tag-table__group { border-right: 1px solid #e2e8f0; background: #fbfdff; color: #1e3a5f; font-weight: 700; }
.profile-tag-table__group svg { display: inline-block; margin-right: 7px; color: #2563eb; vertical-align: -3px; }
.profile-tag-table__category { border-right: 1px solid #edf1f5; color: #334155; font-weight: 700; }
.profile-tag-table__tags { display: flex; flex-wrap: wrap; gap: 7px; }
.profile-tag-option { display: inline-flex; align-items: center; gap: 4px; padding: 5px 9px; border: 1px solid #dbe3ee; border-radius: 4px; background: #f8fafc; color: #94a3b8; font-size: 11px; line-height: 1; }
.profile-tag-option.is-active { border-color: #93c5fd; background: #eff6ff; color: #1d4ed8; font-weight: 700; box-shadow: inset 0 0 0 1px rgba(147, 197, 253, .18); }
.profile-operation-tags { padding-top: 2px; }
.profile-operation-tags__heading { display: flex; align-items: baseline; gap: 9px; margin-bottom: 10px; color: #334155; font-size: 12px; }
.profile-operation-tags__heading strong { font-weight: 700; }
.profile-operation-tags__heading span { color: #94a3b8; font-size: 10px; }

@media (max-width: 720px) {
  .profile-tag-modules { grid-template-columns: 1fr; }
  .profile-tag-taxonomy__intro { align-items: flex-start; flex-direction: column; }
  .profile-tag-table { min-width: 620px; }
}

/* Important guest maintenance: editable session records. */
.vip-maintenance { color: #334155; font-size: 13px; }
.vip-maintenance-heading, .vip-maintenance-card-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.vip-maintenance-heading h3 { display: flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 600; color: #0f172a; }
.vip-maintenance-heading p { margin-top: 6px; color: #64748b; font-size: 12px; }
.vip-maintenance button { cursor: pointer; font-size: 12px; }
.vip-maintenance-primary, .vip-maintenance-secondary, .vip-maintenance-delete-confirm { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 36px; padding: 8px 14px; border-radius: 5px; border: 1px solid #cbd5e1; white-space: nowrap; }
.vip-maintenance-primary { color: white; background: #EF2D2D; border-color: #EF2D2D; }
.vip-maintenance-primary:hover { background: #EF2D2D; }
.vip-maintenance-secondary { background: white; color: #475569; }
.vip-maintenance-records { display: grid; gap: 16px; }
.vip-maintenance-card { background: white; border: 1px solid #e2e8f0; border-radius: 6px; overflow: hidden; }
.vip-maintenance-card-heading { padding: 13px 20px; border-bottom: 1px solid #e2e8f0; background: #fffafa; }
.vip-maintenance-session-badge { color: #EF2D2D; font-weight: 600; font-size: 14px; }
.vip-maintenance-actions { display: flex; align-items: center; justify-content: flex-end; gap: 14px; }
.vip-maintenance-card-heading button { color: #EF2D2D; padding: 5px 3px; }
.vip-maintenance-card-heading .vip-maintenance-danger { color: #EF2D2D; }
.vip-maintenance-card-body { display: grid; grid-template-columns: 3fr 2fr; gap: 24px; padding: 20px; }
.vip-maintenance-card-body section + section { border-left: 1px solid #e2e8f0; padding-left: 24px; }
.vip-maintenance-card-body h5, .vip-maintenance-editor legend { font-size: 13px; font-weight: 600; color: #0f172a; margin-bottom: 12px; }
.vip-maintenance-field { display: grid; grid-template-columns: 70px minmax(0, 1fr); gap: 12px; padding: 7px 0; }
.vip-maintenance-field dt { color: #64748b; }
.vip-maintenance-field dd { color: #1e293b; overflow-wrap: anywhere; line-height: 1.6; }
.vip-maintenance-editor { background: white; border: 1px solid #f9b5b5; border-radius: 6px; padding: 20px; display: grid; gap: 20px; box-shadow: 0 2px 6px #0f172a08; }
.vip-maintenance-editor h4 { font-size: 14px; font-weight: 600; color: #0f172a; }
.vip-maintenance-close { padding: 6px; color: #64748b; }
.vip-maintenance-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.vip-maintenance-input { display: grid; gap: 8px; font-size: 12px; }
.vip-maintenance-input--wide { grid-column: 1 / -1; grid-row: 2; }
.vip-maintenance-session { max-width: 260px; }
.vip-maintenance-input input, .vip-maintenance-input select { width: 100%; height: 38px; border: 1px solid #cbd5e1; border-radius: 5px; padding: 8px 11px; background: white; outline: none; color: #1e293b; }
.vip-maintenance-input input:focus, .vip-maintenance-input select:focus { border-color: #EF2D2D; box-shadow: 0 0 0 2px #fde4e4; }
.vip-maintenance-empty { display: flex; align-items: center; flex-direction: column; gap: 12px; padding: 48px 20px; text-align: center; border: 1px dashed #cbd5e1; border-radius: 6px; background: white; color: #64748b; }
.vip-maintenance-delete { position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center; padding: 20px; background: #0f172a66; }
.vip-maintenance-delete-dialog { background: white; border-radius: 8px; padding: 24px; width: 420px; max-width: 100%; box-shadow: 0 20px 40px #0f172a22; }
.vip-maintenance-delete-dialog h4 { font-size: 16px; font-weight: 600; color: #0f172a; }
.vip-maintenance-delete-dialog p { margin: 16px 0 24px; line-height: 1.8; }
.vip-maintenance-delete-confirm { background: #EF2D2D; border-color: #EF2D2D; color: white; }
@media (max-width: 640px) {
  .vip-maintenance-heading { align-items: flex-start; flex-wrap: wrap; }
  .vip-maintenance-card-body, .vip-maintenance-form-grid { grid-template-columns: minmax(0, 1fr); }
  .vip-maintenance-card-body section + section { border-left: 0; border-top: 1px solid #e2e8f0; padding-left: 0; padding-top: 16px; }
  .vip-maintenance-input--wide { grid-row: auto; }
}

.vip-maintenance-add-dialog { width: min(720px, calc(100vw - 32px)); max-height: calc(100dvh - 48px); margin: auto; padding: 0; border: 0; border-radius: 8px; background: white; color: #334155; overflow-y: auto; box-shadow: 0 24px 64px #0f172a40; }
.vip-maintenance-add-dialog::backdrop { background: #0f172a80; }
.vip-maintenance-add-dialog .vip-maintenance-editor { border: 0; border-radius: 8px; padding: 24px; box-shadow: none; }
.vip-maintenance-add-dialog .vip-maintenance-editor > .vip-maintenance-heading { padding-bottom: 16px; border-bottom: 1px solid #e2e8f0; }
.vip-maintenance-add-dialog .vip-maintenance-editor > .vip-maintenance-actions { padding-top: 16px; border-top: 1px solid #e2e8f0; }
@media (max-width: 640px) {
  .vip-maintenance-add-dialog { max-height: calc(100dvh - 24px); }
  .vip-maintenance-add-dialog .vip-maintenance-editor { padding: 20px; }
}

/* Data counts stay visible on both active and inactive tabs. */
.profile-tabs .profile-tab { display: inline-flex; align-items: center; gap: 7px; }
.profile-tab-count { color: inherit; font-size: inherit; line-height: inherit; font-weight: inherit; font-variant-numeric: tabular-nums; }
.profile-tab[aria-selected="true"] .profile-tab-count { color: inherit; }
.profile-detail-shell .text-blue-600 { color: #EF2D2D !important; }

.attendance-history-heading { display: flex; align-items: center; gap: 8px; padding-bottom: 16px; border-bottom: 1px solid #e7ebf1; }
.attendance-history-heading h3 { font-size: 14px; font-weight: 700; color: #0f172a; }
.attendance-history-heading > span { font-size: 12px; color: #64748b; }
.attendance-session-picker { display: flex; align-items: flex-start; gap: 16px; padding: 14px 16px; border-radius: 6px; background: #f8fafc; border: 1px solid #e7ebf1; }
.attendance-session-picker__label { flex: none; line-height: 34px; color: #64748b; font-size: 12px; }
.attendance-session-picker__options { position: relative; display: flex; flex: 1; min-width: 0; flex-wrap: wrap; gap: 10px; max-height: 34px; overflow: hidden; }
.attendance-session-picker__options.is-expanded { max-height: none; }
.attendance-session-picker__options button { flex: none; height: 34px; padding: 0 14px; border: 1px solid #dfe5ec; border-radius: 5px; background: #fff; color: #475569; font-size: 12px; cursor: pointer; }
.attendance-session-picker__options button[aria-pressed="true"] { color: #EF2D2D; border-color: #EF2D2D; background: #fff2f2; font-weight: 600; }
.attendance-session-picker__options button:hover { border-color: #EF2D2D; color: #EF2D2D; }
.attendance-session-picker__toggle { flex: none; line-height: 34px; color: #EF2D2D; font-size: 12px; cursor: pointer; }
.attendance-certificate-badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border: 1px solid #f9b5b5; border-radius: 4px; background: #fff2f2; color: #EF2D2D; font-size: 12px; font-weight: 600; }
.attendance-identity-row { display: flex; align-items: flex-start; gap: 16px; padding: 2px 0 16px; border-bottom: 1px solid #edf1f5; }
.attendance-identity-label { flex: none; color: #64748b; font-size: 12px; line-height: 27px; }
.attendance-identity-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.attendance-identity-tag { padding: 4px 10px; border: 1px solid #f9b5b5; border-radius: 4px; background: #fff2f2; color: #EF2D2D; font-size: 12px; line-height: 18px; }
@media (max-width: 640px) { .attendance-session-picker { gap: 10px; padding: 12px; } .attendance-session-picker__options button { padding: 0 10px; } }

/* Current institution staff, with combined session history. */
.ip-personnel { padding: 24px; background: #fff; border: 1px solid #e7ebf1; border-radius: 12px; color: #64748b; font-size: 12px; }
.ip-personnel-heading { padding-bottom: 22px; border-bottom: 1px solid #edf1f5; }
.ip-personnel-heading h3 { display: flex; align-items: center; gap: 10px; color: #1e293b; font-size: 16px; font-weight: 600; }
.ip-personnel-heading svg { color: #EF2D2D; }
.ip-personnel-heading h3 span { padding: 3px 8px; background: #fff2f2; color: #EF2D2D; border-radius: 4px; font-size: 12px; }
.ip-personnel-heading p { margin-top: 8px; }
.ip-personnel-filters { display: flex; align-items: flex-end; flex-wrap: wrap; gap: 12px; margin: 22px 0; }
.ip-personnel-filters label { display: grid; gap: 9px; flex: 1; min-width: 150px; }
.ip-personnel-filters .ip-personnel-keyword { flex: 1.8; min-width: 230px; }
.ip-personnel-filters :is(input, select) { width: 100%; height: 40px; border: 1px solid #dfe5ec; border-radius: 5px; padding: 8px 12px; background: white; outline: none; color: #475569; font: inherit; }
.ip-personnel-filters :is(input, select):focus { border-color: #EF2D2D; box-shadow: 0 0 0 2px #fde4e4; }
.ip-personnel-primary, .ip-personnel-secondary { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 40px; border: 1px solid #dfe5ec; border-radius: 5px; padding: 8px 14px; white-space: nowrap; cursor: pointer; }
.ip-personnel-primary { background: #EF2D2D; border-color: #EF2D2D; color: #fff; }
.ip-personnel-secondary { color: #64748b; background: #fff; }
.ip-personnel-summary { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.ip-personnel-summary span:last-child { color: #94a3b8; }
.ip-personnel-table-wrap { overflow-x: auto; border: 1px solid #e7ebf1; border-radius: 7px; }
.ip-personnel table { width: 100%; min-width: 850px; border-collapse: collapse; text-align: left; }
.ip-personnel th { padding: 15px; font-weight: 600; color: #788596; background: #f7f9fc; white-space: nowrap; }
.ip-personnel td { padding: 20px 15px; border-top: 1px solid #edf1f5; vertical-align: top; line-height: 1.7; }
.ip-personnel td:nth-child(1) { width: 14%; }
.ip-personnel td:nth-child(2) { width: 22%; }
.ip-personnel td:nth-child(3) { width: 22%; overflow-wrap: anywhere; }
.ip-personnel-name { color: #EF2D2D; font-weight: 600; cursor: pointer; text-align: left; }
.ip-personnel-contact div + div { color: #94a3b8; margin-top: 6px; }
.ip-personnel-session-tags { display: flex; flex-wrap: wrap; gap: 5px; }
.ip-personnel-session-tags span { padding: 2px 6px; border: 1px solid #e2e8f0; background: #f8fafc; border-radius: 3px; white-space: nowrap; }
.ip-personnel-row-actions { display: flex; gap: 12px; white-space: nowrap; }
.ip-personnel-row-actions button { cursor: pointer; }
.ip-personnel-link { color: #EF2D2D; }
.ip-personnel .ip-personnel-empty { padding: 48px 20px; text-align: center; }
.ip-personnel-pagination { display: flex; justify-content: space-between; align-items: center; margin-top: 20px; color: #94a3b8; }
.ip-personnel-pagination > div { display: flex; gap: 12px; align-items: center; }
.ip-personnel-pagination button { width: 30px; height: 30px; border: 1px solid #e2e8f0; border-radius: 5px; cursor: pointer; font-size: 20px; }
.ip-personnel-pagination button:disabled { opacity: .4; cursor: default; }
.ip-personnel-dialog { width: min(580px, calc(100vw - 32px)); max-height: calc(100dvh - 40px); margin: auto; padding: 24px; border: 0; border-radius: 10px; background: white; color: #475569; overflow-y: auto; box-shadow: 0 24px 64px #0f172a40; }
.ip-personnel-dialog::backdrop { background: #0f172a80; }
.ip-personnel-dialog header { display: flex; align-items: center; justify-content: space-between; }
.ip-personnel-dialog h3 { font-size: 18px; color: #1e293b; font-weight: 600; }
.ip-personnel-dialog > p { color: #94a3b8; margin-top: 10px; }
.ip-personnel-dialog dl { display: grid; grid-template-columns: 80px minmax(0,1fr); gap: 14px; margin: 24px 0; font-size: 13px; }
.ip-personnel-dialog dt { color: #94a3b8; }
.ip-personnel-dialog dd { overflow-wrap: anywhere; }
.ip-personnel-dialog h4 { font-weight: 600; padding-bottom: 12px; border-bottom: 1px solid #edf1f5; }
.ip-personnel-dialog li { display: flex; gap: 20px; padding: 14px 0; font-size: 13px; border-bottom: 1px solid #edf1f5; }
.ip-personnel-dialog li strong { flex: none; color: #EF2D2D; }
.ip-personnel-dialog footer { display: flex; justify-content: flex-end; gap: 12px; margin-top: 24px; }
@media (max-width: 640px) { .ip-personnel { padding: 18px; } .ip-personnel-filters label, .ip-personnel-filters .ip-personnel-keyword { flex-basis: 100%; min-width: 0; } .ip-personnel-summary { flex-wrap: wrap; } }
.institution-history-panel > .attendance-session-picker { margin: 12px 0 20px; }
.institution-history-panel > .attendance-session-picker ~ .border { margin-top: 18px; }
/* User profile: visit records and maintenance drawer. */
.visit-panel { margin-top:24px; padding:22px; border:1px solid #e2e8f0; border-radius:8px; background:#fff; color:#334155; font-size:13px; }
.visit-heading,.visit-dialog-header,.visit-dialog-footer,.visit-pagination,.visit-pagination>div { display:flex; align-items:center; justify-content:space-between; gap:12px; }
.visit-heading h3 { display:flex; align-items:center; gap:8px; color:#0f172a; font-size:14px; font-weight:600; margin:0; }
.visit-heading p,.visit-dialog-header p { font-size:12px; color:#64748b; margin:5px 0 0; }
.visit-panel button,.visit-drawer button,.visit-confirm button { cursor:pointer; font:inherit; }
.visit-button { display:inline-flex; align-items:center; justify-content:center; gap:6px; padding:7px 12px; border:1px solid #cbd5e1; border-radius:5px; background:#fff; color:#475569; white-space:nowrap; font-size:12px; line-height:20px; }
.visit-button:hover { background:#f8fafc; border-color:#94a3b8; }
.visit-button--primary { background:#ef2d2d; border-color:#ef2d2d; color:#fff; }
.visit-button--primary:hover { background:#d92323; border-color:#d92323; }
.visit-button--danger { background:#dc2626; border-color:#dc2626; color:#fff; }
.visit-button--danger:hover { background:#b91c1c; border-color:#b91c1c; }
.visit-button:disabled { opacity:.45; cursor:not-allowed; }
.visit-filters { display:flex; align-items:flex-end; flex-wrap:wrap; gap:12px; margin:20px 0 16px; padding:14px; background:#f8fafc; border:1px solid #f1f5f9; border-radius:6px; }
.visit-filters label,.visit-field { display:flex; flex-direction:column; gap:7px; font-size:12px; color:#475569; min-width:0; }
.visit-filters label { min-width:160px; }
.visit-filters input,.visit-filters select,.visit-field input,.visit-field select,.visit-field textarea { box-sizing:border-box; min-height:36px; padding:7px 10px; border:1px solid #cbd5e1; border-radius:5px; color:#0f172a; background:#fff; font:inherit; width:100%; }
.visit-field textarea { resize:vertical; line-height:1.65; }
.visit-field input[readonly] { background:#f1f5f9; color:#64748b; }
.visit-field b { color:#dc2626; font-weight:400; }
.visit-field small { color:#94a3b8; font-size:11px; }
.visit-panel :focus-visible,.visit-drawer :focus-visible,.visit-confirm :focus-visible { outline:2px solid #60a5fa; outline-offset:2px; }
.visit-table-scroll { overflow-x:auto; border:1px solid #e2e8f0; border-radius:6px; }
.visit-table { width:100%; min-width:900px; border-collapse:collapse; text-align:left; font-size:12px; }
.visit-table th { background:#f8fafc; font-weight:600; color:#64748b; white-space:nowrap; }
.visit-table th,.visit-table td { padding:13px 14px; border-bottom:1px solid #f1f5f9; vertical-align:middle; }
.visit-table tr:last-child td { border-bottom:0; }
.visit-table tbody tr:hover { background:#f8fafc; }
.visit-time { white-space:nowrap; font-variant-numeric:tabular-nums; color:#64748b; }
.visit-subject,.visit-staff { display:block; max-width:230px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.visit-subject { font-weight:500; color:#0f172a; }
.visit-staff { max-width:140px; }
.visit-row-actions { display:flex; align-items:center; gap:12px; white-space:nowrap; }
.visit-link { border:0; padding:2px 0; background:transparent; color:#2563eb; }
.visit-link:hover { text-decoration:underline; }
.visit-link--danger { color:#dc2626; }
.visit-empty { display:flex; flex-direction:column; align-items:center; gap:12px; padding:40px 15px; color:#94a3b8; background:#fafcff; border:1px dashed #e2e8f0; border-radius:6px; }
.visit-empty strong { color:#64748b; font-size:13px; font-weight:500; }
.visit-empty p { font-size:12px; margin:0 0 4px; }
.visit-pagination { margin-top:16px; color:#64748b; font-size:12px; flex-wrap:wrap; }
.visit-error,.visit-notice { padding:10px 12px; border-radius:5px; margin:12px 0; font-size:12px; line-height:1.6; }
.visit-error { color:#b91c1c; background:#fef2f2; }
.visit-notice { color:#047857; background:#ecfdf5; }
.visit-drawer,.visit-confirm { padding:0; border:0; color:#334155; font-family:inherit; font-size:13px; box-shadow:0 18px 70px #0f172a40; background:#fff; }
.visit-drawer::backdrop,.visit-confirm::backdrop { background:#0f172a66; }
.visit-drawer { position:fixed; inset:0 0 0 auto; margin:0; width:680px; max-width:100vw; height:100dvh; max-height:100dvh; border-radius:0; }
.visit-dialog-content { display:flex; flex-direction:column; height:100%; margin:0; }
.visit-dialog-header { flex-shrink:0; padding:20px 24px; border-bottom:1px solid #e2e8f0; }
.visit-dialog-header h3 { color:#0f172a; font-size:17px; font-weight:600; margin:0; }
.visit-close { display:flex; align-items:center; justify-content:center; padding:6px; border:0; background:transparent; color:#64748b; border-radius:4px; }
.visit-close:hover { background:#f1f5f9; }
.visit-dialog-body { flex:1; min-height:0; overflow-y:auto; padding:24px; overscroll-behavior:contain; }
.visit-form-grid,.visit-detail { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:20px 16px; }
.visit-field--wide { grid-column:1 / -1; }
.visit-dialog-footer { flex-shrink:0; justify-content:flex-end; padding:16px 24px; border-top:1px solid #e2e8f0; background:#fff; }
.visit-detail { margin:0; }
.visit-detail dt { color:#64748b; font-size:12px; margin-bottom:7px; }
.visit-detail dd { margin:0; line-height:1.8; color:#0f172a; white-space:pre-wrap; overflow-wrap:anywhere; }
.visit-audit { padding-top:16px; border-top:1px solid #e2e8f0; color:#94a3b8; font-size:11px; line-height:1.8; }
.visit-confirm { position:fixed; inset:0; margin:auto; width:440px; max-width:calc(100vw - 32px); height:fit-content; max-height:calc(100dvh - 32px); border-radius:10px; overflow:hidden; }
.visit-confirm .visit-dialog-content { height:auto; max-height:calc(100dvh - 32px); }
.visit-confirm .visit-dialog-body { line-height:1.8; overflow-wrap:anywhere; }
@media (max-width:700px) {
  .visit-panel { padding:16px; }
  .visit-heading { align-items:flex-start; flex-wrap:wrap; }
  .visit-form-grid,.visit-detail { grid-template-columns:minmax(0,1fr); }
  .visit-dialog-body,.visit-dialog-header { padding:18px; }
  .visit-filters label { flex:1; min-width:140px; }
}
