:root {
  --bg: #f3f6f8;
  --surface: #ffffff;
  --surface-muted: #f8fafb;
  --text: #172126;
  --text-muted: #617078;
  --line: #dbe3e7;
  --brand: #0f6b5d;
  --brand-dark: #0a4f45;
  --ok: #157347;
  --warning: #9a6700;
  --error: #b42318;
  --shadow: 0 14px 40px rgba(23, 33, 38, 0.12);
  /* Detail screen text hierarchy (reuse brand accent) */
  --qrpick-accent: var(--brand);
  --detail-section-title: var(--brand);
  --detail-field-label: #315f7d;
  --detail-value: #17212b;
  --detail-muted: #617078;
  --detail-border: var(--line);
  --control-height: 38px;
  --control-radius: 8px;
  --control-font-size: 0.84rem;
  --textarea-height: 4.75rem;
  --toolbar-padding-y: 18px;
  --toolbar-padding-x: 20px;
  --toolbar-gap: 14px;
  --toolbar-head-min-height: 36px;
  --toolbar-filter-gap: 8px;
  --chrome-header-pad-bottom: 28px;
  --chrome-nav-gap: 8px;
  --chrome-kpi-stack-gap: 12px;
  --chrome-kpi-block-gap: 14px;
  --app-max-width: 1680px;
  --app-side-gutter: 24px;
  --font-sans:
    "Pretendard Variable",
    Pretendard,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    "Noto Sans KR",
    sans-serif;
  font-family: var(--font-sans);
  font-synthesis: none;
  color: var(--text);
  background: var(--bg);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--bg);
  font-family: var(--font-sans);
  font-synthesis: none;
  font-weight: 400;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

html {
  scrollbar-gutter: stable;
}

body.detail-open {
  overflow: hidden;
}

button,
input,
select,
textarea {
  font: inherit;
  font-weight: 400;
}

.app-header,
.nav-bar,
main,
.app-view,
footer {
  /* Use 100% (not 100vw) so the vertical scrollbar width is excluded and the
     page never shifts horizontally when content height changes. */
  width: min(var(--app-max-width), calc(100% - (var(--app-side-gutter) * 2)));
  margin-inline: auto;
}

@media (max-width: 600px) {
  :root {
    --app-side-gutter: 12px;
  }
}

.readonly-badge {
  display: inline-block;
  margin-left: 10px;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 0.6em;
  font-weight: 500;
  vertical-align: middle;
  background: var(--surface-muted);
  border: 1px solid var(--line);
  color: var(--text-muted);
}

.nav-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 6px 12px;
  min-height: 0;
  padding-bottom: 10px;
  margin-bottom: 0;
  border-bottom: 1px solid var(--line);
}

.main-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 2px;
  min-width: 0;
}

.main-nav-tab {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text-muted);
  padding: 6px 11px;
  border-radius: 6px 6px 0 0;
  cursor: pointer;
  font-size: var(--control-font-size);
  font-weight: 500;
  line-height: 1.3;
}

.main-nav-tab .main-nav-star {
  margin-right: 3px;
  color: #c49212;
  font-weight: 600;
}

.main-nav-tab.is-active .main-nav-star {
  color: #ffe9a8;
}

.main-nav-tab.is-active {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
}

.app-view {
  padding-top: 16px;
}

.org-search-results {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 16px;
  min-width: 0;
}

.org-search-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}

.org-search-section-heading {
  margin: 0;
  font-size: 0.95rem;
  color: var(--text-muted);
}

.org-result-card,
.contact-result-card {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 16px 18px;
  background: var(--surface);
  min-width: 0;
  overflow-wrap: anywhere;
}

.contact-result-card.is-expanded {
  border-color: var(--brand);
  background: #f7fbfa;
}

.org-result-card h3,
.contact-result-card h3 {
  margin: 0 0 6px;
  overflow-wrap: anywhere;
  font-weight: 600;
}

.org-result-card .org-result-meta,
.contact-result-meta,
.org-result-departments {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin: 0 0 10px;
  font-weight: 400;
}

.org-count-badge {
  display: inline-flex;
  align-items: center;
  padding: 1px 7px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface-muted);
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 500;
}

.related-opportunity-heading {
  margin: 8px 0 8px;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-muted);
}

.related-opportunity-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.related-opportunity-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  background: var(--surface-muted);
  min-width: 0;
}

.related-opportunity-title {
  display: block;
  width: 100%;
  max-width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--brand-dark);
  font: inherit;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  overflow-wrap: anywhere;
}

.related-opportunity-title:hover,
.related-opportunity-title:focus-visible {
  text-decoration: underline;
}

.related-opportunity-meta {
  margin: 4px 0 0;
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 400;
  overflow-wrap: anywhere;
}

.related-opportunity-inline-detail {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  min-width: 0;
}

.related-inline-pairs {
  grid-template-columns: 1fr;
}

.related-inline-section {
  margin-top: 12px;
}

.related-inline-section h4 {
  margin: 0 0 6px;
  color: var(--text-muted);
  font-size: 0.74rem;
  font-weight: 600;
}

.related-inline-section p,
.related-inline-section ul {
  margin: 0;
  line-height: 1.55;
  font-weight: 400;
  overflow-wrap: anywhere;
}

.related-inline-section ul {
  padding-left: 18px;
}

.app-header {
  padding: 28px 0 26px;
}

.header-tools {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-left: auto;
  flex-shrink: 0;
  padding-bottom: 2px;
}

.header-tool-links {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 10px;
}

.header-tool-links .header-tool-button + .header-tool-button {
  margin-left: 2px;
}

.header-tool-button {
  height: 32px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--control-radius);
  background: var(--surface);
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
}

.header-tool-button:hover,
.header-tool-button[aria-expanded="true"] {
  border-color: var(--brand);
  color: var(--brand-dark);
  background: #f0f8f6;
}

.header-popover-wrapper {
  position: relative;
}

.header-popover {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 40;
  width: min(640px, 94vw);
  max-height: 72vh;
  overflow-y: auto;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.header-popover-title {
  margin: 0 0 10px;
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 600;
}

.header-popover .ops-summary-grid {
  grid-template-columns: 1fr;
  gap: 0.6rem;
}

.kpi-grid-compact {
  grid-template-columns: minmax(5rem, 0.9fr) minmax(4.5rem, 0.75fr) minmax(7.5rem, 1.5fr);
  margin-bottom: 12px;
}

.header-popover .kpi {
  padding: 12px 10px;
}

.header-popover .kpi strong {
  overflow: visible;
  text-overflow: unset;
  white-space: normal;
  font-size: 0.95rem;
  line-height: 1.3;
  word-break: keep-all;
}

.header-popover #kpi-next-batch {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  white-space: normal;
}

.header-popover #kpi-next-batch .kpi-next-date,
.header-popover #kpi-next-batch .kpi-next-count {
  display: block;
  white-space: nowrap;
  font-size: 0.9rem;
  line-height: 1.25;
  font-weight: 600;
}

.header-popover #kpi-next-batch .kpi-next-count {
  color: var(--brand-dark);
  font-size: 0.84rem;
  font-weight: 500;
}

@media (max-width: 560px) {
  .kpi-grid-compact {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .header-popover {
    right: auto;
    left: 50%;
    width: min(92vw, 420px);
    transform: translateX(-50%);
  }
}

/* ---- 사용방법 modal ---- */

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(13, 25, 30, 0.45);
}

.modal-dialog {
  position: fixed;
  top: 50%;
  left: 50%;
  z-index: 60;
  width: min(720px, 94vw);
  max-height: 86vh;
  overflow-y: auto;
  transform: translate(-50%, -50%);
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.usage-modal.modal-dialog {
  width: min(560px, 94vw);
  max-height: 90vh;
}

.modal-backdrop[hidden],
.modal-dialog[hidden] {
  display: none !important;
}

.modal-header {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 24px 14px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.97);
}

.modal-header h2 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 700;
  line-height: 1.4;
}

.usage-modal .modal-header h2 {
  font-size: 1.28rem;
  letter-spacing: -0.02em;
}

.modal-body {
  padding: 6px 24px 24px;
  font-size: 0.88rem;
  line-height: 1.65;
}

.usage-modal-body {
  --usage-type-section: 1.12rem;
  --usage-type-subhead: 0.98rem;
  --usage-type-body: 0.9rem;
  padding: 16px 28px 28px;
}

.usage-modal-body .usage-section {
  margin-bottom: 22px;
}

.usage-modal-body .usage-section:last-of-type {
  margin-bottom: 0;
}

.usage-modal-body p,
.usage-modal-body li {
  max-width: none;
  word-break: keep-all;
  overflow-wrap: break-word;
}

.usage-modal-body .usage-subtitle {
  margin: 0 0 18px;
  padding: 12px 14px;
  border-radius: 8px;
  background: #f3f7f6;
  color: var(--text);
  font-size: var(--usage-type-body);
  font-weight: 400;
  line-height: 1.55;
}

.usage-modal-body .usage-subtitle p {
  margin: 0;
}

.usage-modal-body .usage-subtitle p + p {
  margin-top: 8px;
}

.usage-section {
  min-width: 0;
}

.usage-section--steps {
  margin-bottom: 20px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--line);
}

.usage-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px 28px;
  align-items: stretch;
}

.usage-col {
  display: flex;
  flex-direction: column;
  gap: 20px;
  min-width: 0;
  height: 100%;
}

.usage-col > .usage-section:last-child {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.usage-col > .usage-section:last-child .usage-card-list {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.usage-col > .usage-section:last-child .usage-card:last-child,
.usage-col > .usage-section:last-child .usage-caution {
  flex: 1 1 auto;
}

.usage-modal-body h3 {
  margin: 0 0 10px;
  color: var(--brand-dark);
  font-size: var(--usage-type-section);
  font-weight: 750;
  line-height: 1.4;
  letter-spacing: -0.015em;
}

.usage-card-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.usage-card {
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.usage-modal-body h4,
.usage-card h4 {
  margin: 0 0 6px;
  color: #5a6b75;
  font-size: var(--usage-type-subhead);
  font-weight: 700;
  line-height: 1.35;
}

.usage-modal-body p,
.usage-card p {
  margin: 0;
  color: var(--text);
  font-size: var(--usage-type-body);
  font-weight: 400;
  line-height: 1.75;
}

.usage-card p + p {
  margin-top: 6px;
}

.usage-modal-body ul,
.usage-modal-body ol {
  margin: 0;
  padding-left: 1.2rem;
}

.usage-modal-body li {
  margin: 0;
  color: var(--text);
  font-size: var(--usage-type-body);
  line-height: 1.55;
}

.usage-modal-body .usage-steps {
  display: grid;
  gap: 8px;
  padding-left: 1.25rem;
}

.usage-modal-body .usage-example {
  color: var(--text-muted);
  font-size: 0.86rem;
}

.usage-modal-body .usage-caution {
  display: flex;
  flex-direction: column;
  margin-top: 24px;
  padding: 14px 16px;
  border-radius: 8px;
  background: #eef5fb;
  border: 1px solid #c9dceb;
}

.usage-modal-body .usage-caution p {
  margin: 0;
  line-height: 1.75;
}

.usage-modal-body .usage-caution h3 {
  margin: 0 0 8px;
  font-size: var(--usage-type-subhead);
  color: var(--brand-dark);
}

.usage-modal-body .usage-caution p + p {
  margin-top: 6px;
}

@media (max-width: 900px) {
  .usage-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .modal-header,
  .modal-body {
    padding-inline: 18px;
  }

  .modal-dialog,
  .usage-modal.modal-dialog {
    width: min(100vw - 16px, 94vw);
    max-height: 90vh;
  }
}

h1 {
  margin: 0;
  font-size: clamp(1.6rem, 3vw, 2.3rem);
  font-weight: 700;
  line-height: 1.2;
}

.subtitle {
  margin: 8px 0 0;
  color: var(--text-muted);
  font-size: 0.86rem;
  font-weight: 400;
  line-height: 1.45;
  white-space: normal;
  overflow: visible;
  text-overflow: unset;
  max-width: none;
}

.hero-tagline {
  margin: 10px 0 0;
  color: var(--text);
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.45;
  max-width: 52rem;
}

.hero-intro {
  margin: 6px 0 0;
  color: var(--text-muted);
  font-size: 0.86rem;
  font-weight: 400;
  line-height: 1.5;
  max-width: 52rem;
}

.service-traits,
.service-purpose,
.top30-criteria-note {
  max-width: 52rem;
}

.public-source-action-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  align-items: center;
  margin: 8px 0 4px;
}

.public-source-label {
  color: var(--text-muted);
  font-size: 0.82rem;
}

.public-source-link {
  color: var(--link-color, #1d4ed8);
  text-decoration: none;
  font-weight: 500;
}

.public-source-pending {
  color: var(--text-muted);
  font-size: 0.82rem;
}

.amount-source-label {
  color: var(--text-muted);
  font-size: 0.72rem;
  line-height: 1.2;
}

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

.sources-panel {
  max-width: 1120px;
  padding: 20px 24px 24px;
}

#view-sources .workspace {
  min-height: 0;
}

.sources-toolbar-note {
  max-width: 42rem;
  line-height: 1.6;
}

.sources-state {
  margin: 0 0 12px;
  color: var(--text-muted);
  font-size: 0.86rem;
}

.sources-state.sources-error {
  color: #b45309;
}

.sources-list {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: start;
}

@media (max-width: 960px) {
  .sources-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .sources-list {
    grid-template-columns: 1fr;
  }
}

.source-catalog-card {
  display: flex;
  flex-direction: column;
  height: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 18px 20px;
  background: var(--surface);
  min-width: 0;
  box-shadow: 0 1px 0 rgba(15, 107, 93, 0.04);
}

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

.source-catalog-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.35;
}

.source-catalog-card-body {
  flex: 0 1 auto;
}

.source-catalog-scope,
.source-catalog-note {
  margin: 0 0 8px;
  color: var(--text-muted);
  font-size: 0.86rem;
  line-height: 1.5;
}

.source-catalog-note {
  margin-bottom: 0;
}

.source-catalog-footer {
  margin-top: 14px;
  padding-top: 0;
}

.source-catalog-meta {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.source-catalog-status {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 500;
  line-height: 1.4;
  color: #047857;
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
}

.source-catalog-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 500;
  text-decoration: none;
  color: var(--text);
  background: var(--surface-elevated, #fff);
}

.source-catalog-link:hover {
  border-color: var(--brand);
  color: var(--brand);
}

.usage-section-title {
  margin: 0 0 10px;
  font-size: 0.95rem;
  line-height: 1.4;
}

.past-similar-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.past-similar-item {
  display: grid;
  gap: 2px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-muted);
}

.past-similar-item.is-clickable,
.lifecycle-stage.is-clickable {
  cursor: pointer;
}

.past-similar-title {
  color: var(--brand-dark);
  font-size: 0.8rem;
  font-weight: 600;
  line-height: 1.25;
}

.past-similar-meta {
  color: var(--text-muted);
  font-size: 0.76rem;
  line-height: 1.3;
}

.past-similar-footer {
  display: flex;
  align-items: center;
  margin-top: 2px;
}

.past-similar-source-link {
  font-size: 0.76rem;
  white-space: nowrap;
}

.site-intro {
  max-width: 52rem;
}

.status-badge,
.priority-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: max-content;
  border-radius: 999px;
  font-weight: 500;
  white-space: nowrap;
}

.status-badge {
  gap: 6px;
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 500;
  line-height: 1.2;
  cursor: default;
  pointer-events: none;
  user-select: none;
}

.status-badge::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  flex: 0 0 auto;
}

.status-loading {
  color: var(--text-muted);
}

.status-ok {
  color: var(--ok);
}

.status-partial {
  color: var(--warning);
}

.status-error {
  color: var(--error);
}

.warning-banner {
  margin-bottom: 16px;
  padding: 14px 18px;
  border: 1px solid #e8bd57;
  border-radius: 8px;
  color: #704d00;
  background: #fff8df;
}

.warning-title {
  margin: 0;
  font-weight: 600;
}

.warning-banner ul {
  margin: 8px 0 0;
  padding-left: 20px;
  font-weight: 400;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(130px, 1fr));
  overflow: hidden;
  margin-bottom: var(--chrome-kpi-block-gap);
  border: 1px solid var(--line);
  border-left: 3px solid var(--brand);
  border-radius: 10px;
  background: var(--surface);
  box-shadow: 0 1px 0 rgba(15, 107, 93, 0.04);
}

.kpi-grid-top30 {
  grid-template-columns: minmax(140px, 0.45fr) minmax(160px, 1fr);
  margin-bottom: 6px;
}

.kpi-grid-top30 .kpi {
  padding: 12px 16px;
}

.kpi-grid-top30 .kpi span {
  margin-bottom: 4px;
}

.top30-meta-bar {
  margin: 0 0 8px;
  padding: 0 2px;
}

.top30-meta-line {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 8px;
  margin: 0;
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 400;
  line-height: 1.4;
}

.top30-meta-item strong {
  color: var(--brand-dark);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.top30-meta-sep {
  color: #9aabb4;
}

.top30-meta-unit {
  margin-left: 1px;
}

.kpi-ledger-block {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 0 0 8px;
}

.ledger-meta-bar {
  margin: 0;
  padding: 0 2px;
}

.ledger-meta-line {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 8px;
  margin: 0;
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 400;
  line-height: 1.4;
}

.ledger-meta-item strong {
  color: var(--brand-dark);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.ledger-meta-sep {
  color: #9aabb4;
}

.kpi-grid-ledger-stats {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  margin-bottom: 0;
}

.kpi-grid-ledger-stats .kpi {
  padding: 12px 16px;
}

.kpi-grid-ledger-stats .kpi span {
  margin-bottom: 4px;
}

.kpi-filter-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  margin: 0;
}

.kpi-filter-row-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.kpi {
  min-width: 0;
  padding: 17px 20px;
  border-right: 1px solid var(--line);
}

.kpi:last-child {
  border-right: 0;
}

.kpi span {
  display: block;
  margin-bottom: 7px;
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 500;
}

.kpi strong {
  display: block;
  overflow: hidden;
  font-size: 1.25rem;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.kpi-supporting {
  background: #fafcfd;
}

.kpi-supporting strong {
  color: #536169;
  font-size: 1.05rem;
  font-weight: 600;
}

.kpi-emphasis {
  box-shadow: inset 0 3px 0 var(--brand);
  background: #f5fbf9;
}

.kpi-emphasis strong {
  color: var(--brand-dark);
  font-size: 1.45rem;
  font-weight: 600;
}

.workspace {
  overflow: hidden;
  border: 1px solid var(--line);
  border-left: 3px solid var(--brand);
  border-radius: 10px;
  background: var(--surface);
  box-shadow: 0 1px 0 rgba(15, 107, 93, 0.04);
}

.toolbar {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: var(--toolbar-gap);
  padding: var(--toolbar-padding-y) var(--toolbar-padding-x);
  border-bottom: 1px solid #d5e5e0;
  background:
    linear-gradient(180deg, #f3f9f7 0%, #eef5f3 100%);
}

.toolbar::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--brand) 0%, #4aa090 42%, transparent 100%);
  pointer-events: none;
}

.toolbar-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 10px;
  min-height: 0;
}

.top30-pool-selector {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.top30-pool-tab {
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid #9ec4b8;
  background: #f7fbf9;
  color: #1f4f43;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
}

.top30-pool-tab:hover {
  background: #eef8f4;
}

.top30-pool-tab.is-active,
.top30-pool-tab[aria-selected="true"] {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

.top30-pool-tab:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

.toolbar-title-block {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  min-width: 0;
  flex: 1 1 auto;
  width: 100%;
}

/* Shared Top30 / All panel header: same 2-row rhythm, minimal height alignment. */
.toolbar-panel-header {
  min-block-size: 4.75rem;
}

.toolbar-title-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  width: 100%;
  min-width: 0;
  min-height: 1.75rem;
}

.toolbar-title,
.ledger-list-heading {
  margin: 0;
  color: var(--brand-dark);
  font-size: 1.12rem;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.015em;
}

.toolbar-title-actions {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 0;
  min-height: 0;
}

.toolbar-meta {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin: 0 0 0 auto;
  min-height: 0;
}

.toolbar-meta-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin: 0;
  padding: 3px 9px;
  border: 1px solid #d5e5e0;
  border-radius: 999px;
  background: #f7faf9;
  color: var(--text-muted);
  font-size: 0.84rem;
  font-weight: 500;
  line-height: 1.3;
  white-space: nowrap;
  pointer-events: none;
  cursor: default;
  user-select: text;
}

.toolbar-meta-badge--update {
  white-space: normal;
  max-width: min(100%, 22rem);
}

.toolbar-meta-badge--freshness[data-freshness="fresh"] {
  border-color: #b7d7c8;
  background: #eef8f2;
  color: var(--ok);
}

.toolbar-meta-badge--freshness[data-freshness="recent"] {
  border-color: #c5ddd2;
  background: #f3faf6;
  color: #1f6b4a;
}

.toolbar-meta-badge--freshness[data-freshness="stale"] {
  border-color: #e6d2a2;
  background: #fff8eb;
  color: var(--warning);
}

.toolbar-panel-subheader {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
  width: 100%;
  min-height: 2.4rem;
  min-block-size: 2.4rem;
}

.toolbar-title-note {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 400;
  line-height: 1.4;
}

.toolbar-title-block > .result-count,
.toolbar-panel-subheader > .result-count {
  margin: 0;
  align-self: center;
}

.toolbar-head .result-count {
  margin: 0 0 0 auto;
  align-self: center;
}

.ledger-quick-filter-group,
.quick-filter-toolbar {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  margin: 0;
  padding: 0;
  min-height: 0;
  width: auto;
  max-width: 100%;
}

.ledger-quick-filter-label {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 650;
  letter-spacing: 0.02em;
  line-height: 1.2;
  flex: 0 0 auto;
}

.ledger-quick-filter-chips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 0;
  min-height: 0;
}

.quick-filter-toolbar-sep {
  display: inline-block;
  width: 1px;
  height: 18px;
  margin: 0 2px;
  background: #c9d5d1;
  flex: 0 0 auto;
}

.quick-filter-toolbar-status {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 0;
  min-width: 0;
}

.ledger-quick-filter-status {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.84rem;
  font-weight: 400;
  line-height: 1.3;
  white-space: nowrap;
}

.ledger-quick-filter-status-current {
  color: var(--brand-dark);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.ledger-quick-filter-status-total {
  color: var(--text-muted);
  font-weight: 400;
}

.ledger-quick-filter-status-note {
  color: var(--text-muted);
  font-weight: 400;
}

button.ledger-quick-filter-chip.kpi-filter-card {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: auto;
  min-height: 38px;
  margin: 0;
  padding: 0 6px 0 12px;
  border: 1px solid #9ec4b8;
  border-radius: 999px;
  background: #f7fbf9;
  box-shadow: none;
  color: var(--brand-dark);
  font: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1.3;
  text-align: center;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

button.ledger-quick-filter-chip.kpi-filter-card .ledger-quick-filter-chip-label {
  pointer-events: none;
}

button.ledger-quick-filter-chip.kpi-filter-card .ledger-quick-filter-chip-count,
button.ledger-quick-filter-chip.kpi-filter-card strong {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.6rem;
  margin: 0;
  padding: 2px 8px;
  border-radius: 999px;
  background: #e3f1ec;
  color: var(--brand-dark);
  font-size: 0.78rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
  overflow: visible;
  text-overflow: unset;
  white-space: nowrap;
  pointer-events: none;
}

button.ledger-quick-filter-chip.kpi-filter-card:hover {
  background: #eef8f4;
  border-color: var(--brand);
  box-shadow: none;
  text-decoration: none;
}

button.ledger-quick-filter-chip.kpi-filter-card:hover .ledger-quick-filter-chip-count,
button.ledger-quick-filter-chip.kpi-filter-card:hover strong {
  background: #d5ebe3;
}

button.ledger-quick-filter-chip.kpi-filter-card:focus-visible {
  outline: 2px solid #4a90c8;
  outline-offset: 2px;
  z-index: 1;
}

button.ledger-quick-filter-chip.kpi-filter-card.is-active,
button.ledger-quick-filter-chip.kpi-filter-card[aria-pressed="true"] {
  background: var(--brand);
  border-color: var(--brand);
  box-shadow: none;
  color: #fff;
  font-weight: 600;
}

button.ledger-quick-filter-chip.kpi-filter-card.is-active .ledger-quick-filter-chip-count,
button.ledger-quick-filter-chip.kpi-filter-card[aria-pressed="true"] .ledger-quick-filter-chip-count,
button.ledger-quick-filter-chip.kpi-filter-card.is-active strong,
button.ledger-quick-filter-chip.kpi-filter-card[aria-pressed="true"] strong {
  background: rgba(255, 255, 255, 0.22);
  color: #fff;
}

.toolbar-filters {
  display: grid;
  grid-template-columns:
    minmax(240px, 1.8fr)
    repeat(auto-fit, minmax(140px, 0.85fr));
  align-items: end;
  gap: var(--toolbar-gap);
}

.toolbar-filters--dense {
  grid-template-columns:
    minmax(220px, 1.5fr)
    repeat(4, minmax(120px, 0.75fr));
}

.toolbar-filters-span {
  grid-column: 1 / -1;
}

.filter-field {
  display: grid;
  gap: var(--toolbar-filter-gap);
  min-width: 0;
}

.filter-field label {
  color: var(--brand-dark);
  font-size: 0.75rem;
  font-weight: 600;
}

.filter-field input,
.filter-field select {
  width: 100%;
  height: var(--control-height);
  min-height: var(--control-height);
  border: 1px solid #c7d2d8;
  border-radius: var(--control-radius);
  padding: 0 11px;
  color: var(--text);
  background: #fff;
  font-size: var(--control-font-size);
  font-weight: 400;
  line-height: 1.3;
  box-shadow: 0 0 0 1px rgba(15, 107, 93, 0.02);
}

.filter-field input:focus,
.filter-field select:focus,
tbody tr:focus-visible,
.detail-button:focus-visible,
.card-detail-button:focus-visible,
.detail-close:focus-visible,
.row-title-button:focus-visible,
.header-tool-button:focus-visible,
.source-links a:focus-visible {
  outline: 3px solid rgba(15, 107, 93, 0.2);
  outline-offset: 1px;
  border-color: var(--brand);
}

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

.human-auto-compare {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid color-mix(in srgb, CanvasText 12%, transparent);
  display: grid;
  gap: 0.35rem;
  font-size: 0.92rem;
}

.human-auto-compare p {
  margin: 0;
}

.ops-summary {
  margin: 0 0 1rem;
  padding: 0.9rem 1rem;
  border: 1px solid color-mix(in srgb, CanvasText 12%, transparent);
  background: color-mix(in srgb, Canvas 92%, CanvasText 8%);
}

.pilot-status-message {
  margin: 0 0 0.75rem;
  font-weight: 400;
}

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

.ops-summary-grid h2 {
  margin: 0 0 0.4rem;
  font-size: 0.92rem;
}

.ops-summary-grid ul {
  margin: 0;
  padding-left: 1.1rem;
  font-size: 0.86rem;
}

@media (max-width: 900px) {
  .ops-summary-grid {
    grid-template-columns: 1fr;
  }
}

.result-count {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.86rem;
  font-weight: 400;
  white-space: nowrap;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.86rem;
  font-weight: 400;
}

.opportunity-table,
.ledger-table {
  table-layout: fixed;
  width: 100%;
  max-width: none;
  min-width: 1100px;
}

/* External matrix col widths must sum to exactly 100% (no fixed px extras). */
.decision-matrix-table .col-star { width: 4%; }
.decision-matrix-table .col-title { width: 24%; }
.decision-matrix-table .col-org { width: 15%; }
.decision-matrix-table .col-summary { width: 22%; }
.decision-matrix-table .col-review-points { width: 10%; }
.decision-matrix-table .col-scope { width: 17%; }
.decision-matrix-table .col-budget { width: 8%; }

.decision-matrix-table .budget-header {
  text-align: right;
}

.decision-matrix-table .budget-cell {
  width: auto;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: right;
  vertical-align: top;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
  font-size: 0.82rem;
}

.decision-matrix-table .matrix-empty-cell {
  text-align: center;
  color: var(--text-muted);
  padding: 28px 12px;
}

.title-cell,
.ledger-title-cell {
  width: auto;
  min-width: 0;
  max-width: none;
  overflow: hidden;
  padding: 8px 10px;
  font-weight: 400;
  white-space: normal;
  vertical-align: top;
}

.title-cell .row-title-button {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  min-height: 0;
  max-height: 2.8em;
  padding: 0;
  overflow-wrap: break-word;
  word-break: keep-all;
}

.title-cell-sub {
  margin-top: 4px;
  color: var(--text-muted);
  font-size: 0.74rem;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.org-deadline-cell,
.summary-cell,
.scope-cell,
.review-points-cell {
  vertical-align: top;
  overflow: hidden;
  word-break: keep-all;
  overflow-wrap: break-word;
}

.decision-matrix-table .scope-cell {
  overflow: visible;
}

.org-budget-line {
  margin-top: 2px;
}

.review-point-badge-list {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
}

.review-point-badge {
  display: inline-block;
  padding: 2px 6px;
  border-radius: 4px;
  background: #eef4f8;
  color: #2a4a5e;
  font-size: 0.72rem;
  line-height: 1.25;
  white-space: nowrap;
}

.review-point-overflow {
  color: var(--text-muted);
  font-size: 0.72rem;
  line-height: 1.25;
}

.card-summary-line {
  margin: 4px 0 0;
  color: #24383f;
  font-size: 0.82rem;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}

.card-budget-line {
  margin: 2px 0 0;
  color: var(--text-muted);
  font-size: 0.78rem;
}

.card-review-points {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 6px;
}

.card-collab-line {
  margin: 6px 0 0;
  color: var(--text-muted);
  font-size: 0.8rem;
  line-height: 1.35;
}

.scope-tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
  max-height: none;
  overflow: visible;
}

.decision-matrix-table .scope-cell .scope-tag-list {
  max-height: none;
  overflow: visible;
}

.scope-tag {
  display: inline-block;
  max-width: 100%;
  padding: 2px 6px;
  border-radius: 4px;
  background: #e8f1ee;
  color: #2f5b4e;
  font-size: 0.72rem;
  line-height: 1.25;
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
  word-break: keep-all;
  overflow-wrap: break-word;
}

/* Internal-only blocks are not rendered on the public client until
   server-verified QRPick identity exists. Do not reintroduce hide-only CSS. */

.cell-clamp-1,
.cell-clamp-2,
.cell-clamp-3 {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  overflow: hidden;
  overflow-wrap: break-word;
  word-break: keep-all;
  line-height: 1.4;
}

.cell-clamp-1 { -webkit-line-clamp: 1; }
.cell-clamp-2 { -webkit-line-clamp: 2; }
.cell-clamp-3 { -webkit-line-clamp: 3; }

.cell-muted {
  color: var(--text-muted);
  font-size: 0.8rem;
}

.review-cell,
.contact-cell {
  font-size: 0.82rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.decision-matrix-table .star-cell {
  width: auto;
  padding-top: 10px;
}

.decision-matrix-table .title-cell {
  position: relative;
}

.decision-matrix-table tr.opportunity-data-row,
.decision-matrix-table tr[tabindex="0"] {
  cursor: pointer;
}

.starred-table {
  min-width: 980px;
}

.inquiries-table {
  min-width: 920px;
}

.inquiries-table .inquiry-title-cell {
  max-width: 240px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.inquiry-inbox-modal.modal-dialog {
  width: min(640px, 94vw);
}

.inquiry-inbox-fields {
  display: grid;
  gap: 12px;
  margin: 0;
}

.inquiry-inbox-fields > div {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 8px 12px;
  align-items: start;
}

.inquiry-inbox-fields dt {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 600;
}

.inquiry-inbox-fields dd {
  margin: 0;
  word-break: break-word;
}

.inquiry-inbox-message {
  white-space: pre-wrap;
}

@media (max-width: 560px) {
  .inquiry-inbox-fields > div {
    grid-template-columns: 1fr;
    gap: 4px;
  }
}

th,
td {
  padding: 12px 13px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
  font-weight: 400;
}

th {
  position: sticky;
  top: 0;
  z-index: 1;
  color: var(--brand-dark);
  background: linear-gradient(180deg, #e8f3ef 0%, #e2efe9 100%);
  border-bottom: 1px solid #b7d4cb;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

tbody tr {
  cursor: pointer;
}

tbody tr:hover,
tbody tr:focus-visible {
  background: #f1f8f6;
}

tbody tr:last-child td {
  border-bottom: 0;
}

.rank-cell,
.score-cell,
.date-cell,
.status-cell,
.budget-cell,
.top30-cell {
  white-space: nowrap;
}

.status-cell {
  width: 68px;
  color: var(--text-muted);
  font-size: 0.85rem;
  text-align: center;
}

.feature-cell {
  width: 150px;
  min-width: 110px;
  max-width: 190px;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.rank-cell {
  width: 56px;
  color: var(--text-muted);
  text-align: center;
}

.date-cell {
  color: var(--text);
}

.budget-cell {
  min-width: 140px;
  width: 145px;
  padding-right: 18px;
  text-align: right;
  font-weight: 500;
}

.decision-matrix-table .budget-cell.amount-cell {
  padding-right: 20px;
}

.decision-matrix-table .summary-cell {
  padding-left: 12px;
}

.top30-cell {
  width: 84px;
  color: var(--text-muted);
  font-size: 0.82rem;
}

/* Title sizing is controlled by .decision-matrix-table colgroup rules. */

.opportunity-data-row,
#ledger-rows tr,
#starred-rows tr {
  cursor: pointer;
}

.star-cell {
  width: 2.2rem;
  vertical-align: top;
  padding-top: 10px;
}

.row-title-button {
  display: -webkit-box;
  width: 100%;
  max-width: 100%;
  min-height: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--brand-dark);
  font: inherit;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  overflow: hidden;
  overflow-wrap: break-word;
  word-break: keep-all;
  white-space: normal;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  line-height: 1.4;
}

.row-title-button:hover,
.row-title-button:focus-visible {
  background: #f1f8f6;
}

.card-title-button {
  border: 0;
  background: transparent;
  color: var(--brand-dark);
  font: inherit;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  word-break: keep-all;
  overflow-wrap: break-word;
}

.card-title-button:hover,
.card-title-button:focus-visible {
  text-decoration: underline;
}

.opportunity-data-row.is-expanded {
  background: #f7fbfa;
}

.opportunity-detail-row td {
  padding: 12px 12px 16px;
  background: #eef3f5;
  border-bottom: 1px solid var(--line);
}

.inline-opportunity-detail {
  margin: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f5f8f9;
  box-shadow: 0 1px 0 rgba(23, 33, 38, 0.04);
  min-width: 0;
  overflow-wrap: anywhere;
}

/* ---- CRM detail card system ---- */

.dense-detail {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
}

.crm-card {
  margin: 0;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  overflow: hidden;
}

.crm-card-core {
  background: #f3faf8;
  border-color: #b7d7d0;
}

.crm-card-judgment {
  background: #fbfcfd;
}

.crm-card-contact {
  background: var(--surface);
}

.crm-card-sales {
  background: #f7faf9;
  border-color: #c5ddd7;
}

.crm-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px 0;
}

.crm-card-title {
  margin: 0;
  color: var(--text);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

/* Detail-only color + type hierarchy */
.dense-detail {
  --detail-section-title: var(--qrpick-accent);
  --detail-field-label: #315f7d;
  --detail-value: #17212b;
  --detail-muted: #5a6b75;
  --detail-border: var(--line);
  /* Section title > nested subhead > body > field label */
  --detail-type-section: 1.02rem;
  --detail-type-subhead: 0.84rem;
  --detail-type-body: 0.88rem;
  --detail-type-prose: 0.9rem;
  --detail-line-prose: 1.55;
  --detail-type-label: 0.74rem;
}

.dense-detail .crm-card {
  border-color: var(--detail-border);
}

.dense-detail .crm-card-title {
  position: relative;
  color: var(--detail-section-title);
  font-size: var(--detail-type-section);
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.015em;
  padding-left: 10px;
}

.dense-detail .crm-card-title::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.15em;
  bottom: 0.15em;
  width: 3px;
  border-radius: 2px;
  background: var(--qrpick-accent);
}

.dense-detail .dense-label,
.dense-detail .crm-field-label {
  color: var(--detail-field-label);
  font-size: var(--detail-type-label);
  font-weight: 500;
}

.dense-detail .dense-value,
.dense-detail .dense-hero-summary .dense-value,
.dense-detail .dense-field-long .dense-value,
.dense-detail .crm-control,
.dense-detail .crm-field input,
.dense-detail .crm-field select,
.dense-detail .crm-field textarea,
.dense-detail .dense-bullet-list {
  color: var(--detail-value);
  font-weight: 400;
}

.dense-detail .crm-save-status {
  color: var(--detail-muted);
}

.dense-detail .crm-save-button {
  background: var(--qrpick-accent);
}

.dense-detail .dense-badge {
  font-weight: 500;
}

.dense-detail .crm-stage-badge {
  font-weight: 500;
}

.crm-card-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 10px 14px 12px;
  min-width: 0;
}

.crm-card-content .crm-card-body,
.crm-card-judgment .crm-card-body {
  gap: 14px;
  padding: 10px 14px 16px;
}

.crm-card-content .crm-card-header,
.crm-card-judgment .crm-card-header {
  align-items: center;
  gap: 10px;
  padding: 12px 14px 0;
}

.public-inquiry-cta {
  flex: 0 0 auto;
  margin-left: auto;
  min-height: 34px;
  height: 34px;
  padding: 0 12px;
  border: 1px solid #8fbfb2;
  border-radius: var(--control-radius);
  background: #e8f5f1;
  color: var(--brand-dark);
  font-size: 0.8rem;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
}

.public-inquiry-cta:hover,
.public-inquiry-cta:focus-visible {
  border-color: var(--brand);
  background: #d9efe8;
  color: var(--brand-dark);
  outline: none;
}

.public-inquiry-cta:focus-visible {
  box-shadow: 0 0 0 2px rgba(15, 107, 93, 0.28);
}

.public-inquiry-modal.modal-dialog {
  width: min(560px, 94vw);
  max-height: 90vh;
  z-index: 70;
}

#public-inquiry-backdrop {
  z-index: 65;
}

.public-inquiry-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px 20px 18px;
}

.public-inquiry-lead {
  margin: 0;
  color: var(--text);
  font-size: 0.92rem;
  font-weight: 500;
  line-height: 1.45;
}

.public-inquiry-context {
  margin: 0;
  padding: 10px 12px;
  border: 1px solid #d7e5e1;
  border-radius: 8px;
  background: #f7fbf9;
}

.public-inquiry-context-title {
  margin: 0;
  color: var(--text);
  font-size: 0.86rem;
  font-weight: 600;
  line-height: 1.4;
}

.public-inquiry-context-org {
  margin: 4px 0 0;
  color: var(--text-muted);
  font-size: 0.8rem;
  line-height: 1.35;
}

.public-inquiry-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.public-inquiry-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.public-inquiry-field label {
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 600;
}

.public-inquiry-required {
  color: var(--brand);
  font-weight: 500;
}

.public-inquiry-optional {
  color: var(--text-muted);
  font-weight: 500;
}

.public-inquiry-areas-field {
  margin-top: 0.35rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--line);
}

.public-inquiry-areas-heading {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text);
}

.public-inquiry-areas {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  min-height: 2rem;
}

.public-inquiry-areas-empty {
  color: var(--text-muted);
  font-size: 0.875rem;
}

.public-inquiry-area-chip {
  cursor: pointer;
  min-height: 44px;
  border: 1px solid transparent;
}

.public-inquiry-area-chip.is-selected {
  border-color: var(--brand);
  box-shadow: inset 0 0 0 1px var(--brand);
  background: #ccfbf1;
}

.public-inquiry-area-chip.qrpick-service-link--review.is-selected {
  border-color: #b45309;
  box-shadow: inset 0 0 0 1px #b45309;
  background: #ffedd5;
}

.inquiry-inbox-areas-row dd {
  margin: 0;
}

.inquiry-inbox-area-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.inquiry-inbox-area-tag {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  background: #e8f5f1;
  color: #0f766e;
  font-size: 0.8rem;
  line-height: 1.2;
}

.public-inquiry-field input,
.public-inquiry-field select,
.public-inquiry-field textarea {
  width: 100%;
  min-height: var(--control-height);
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: var(--control-radius);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: var(--control-font-size);
}

.public-inquiry-field textarea {
  min-height: 4.75rem;
  resize: vertical;
}

.public-inquiry-field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.public-inquiry-hint {
  margin: -2px 0 0;
  color: var(--text-muted);
  font-size: 0.76rem;
}

.public-inquiry-honeypot {
  position: absolute;
  left: -10000px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.public-inquiry-status {
  margin: 0;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 0.84rem;
  line-height: 1.4;
}

.public-inquiry-status[data-kind="pending"] {
  background: #f3f6f8;
  color: var(--text-muted);
}

.public-inquiry-status[data-kind="success"] {
  background: #eef8f2;
  color: var(--ok);
}

.public-inquiry-status[data-kind="error"] {
  background: #fff4f2;
  color: #9b2c2c;
}

.public-inquiry-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 4px;
}

.public-inquiry-cancel,
.public-inquiry-submit {
  min-height: 36px;
  padding: 0 14px;
  border-radius: var(--control-radius);
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
}

.public-inquiry-cancel {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text-muted);
}

.public-inquiry-submit {
  border: 0;
  background: var(--brand);
  color: #fff;
}

.public-inquiry-submit:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.crm-card-judgment .qrpick-collab-body {
  padding-top: 12px;
}

/* Soft interior info groups — lighter than outer cards */
.detail-info-stack {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
}

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

.detail-info-block {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
  padding: 15px 16px;
  border-radius: 11px;
  background: #f4f7f6;
  border: 1px solid rgba(20, 60, 50, 0.06);
}

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

.detail-info-block-label {
  margin: 0;
  color: var(--brand-dark, #0a4f45);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.35;
}

.detail-info-block-content {
  margin: 0;
  width: 100%;
  max-width: none;
  color: var(--detail-value, #17212b);
  font-size: 0.9rem;
  font-weight: 400;
  line-height: 1.65;
  white-space: normal;
  word-break: keep-all;
  overflow-wrap: break-word;
  text-wrap: pretty;
}

.detail-info-block-content > .detail-copy {
  margin: 0;
  width: 100%;
  max-width: none;
  white-space: normal;
  word-break: keep-all;
  overflow-wrap: break-word;
  line-height: 1.65;
  text-wrap: pretty;
}

.detail-info-block-content > .detail-copy + .detail-copy {
  margin-top: 8px;
}

.detail-info-block--check {
  background: #fbf6ee;
  border-color: rgba(160, 120, 40, 0.12);
}

.detail-info-block--check .detail-info-block-label {
  color: #7a5a18;
}

.detail-info-block--check .detail-info-block-content,
.detail-info-block--check .detail-check-list {
  color: #4a3f2c;
}

.detail-basis-meta {
  margin: 0;
}

.detail-basis-meta--compact {
  margin: 0 0 2px;
}

.detail-basis-badge {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  padding: 3px 9px;
  border-radius: 999px;
  background: #eef3f1;
  color: #5a6b75;
  font-size: 0.72rem;
  font-weight: 500;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.detail-basis-badge--header {
  flex: 0 1 auto;
  margin-left: auto;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.detail-action-box {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 2px;
  padding: 15px 16px 15px 18px;
  border-radius: 11px;
  background: #e6f4ef;
  border: 1px solid rgba(15, 107, 93, 0.14);
  border-left: 4px solid var(--brand);
}

.detail-action-box-label {
  margin: 0;
  color: var(--brand-dark);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.detail-action-box-content {
  margin: 0;
  width: 100%;
  max-width: none;
  color: var(--detail-value, #17212b);
  font-size: 0.94rem;
  font-weight: 400;
  line-height: 1.65;
  white-space: normal;
  word-break: keep-all;
  overflow-wrap: break-word;
  text-wrap: pretty;
}

.detail-action-box-content > .detail-copy {
  margin: 0;
  width: 100%;
  max-width: none;
  white-space: normal;
  word-break: keep-all;
  overflow-wrap: break-word;
  line-height: 1.65;
  text-wrap: pretty;
}

.detail-action-box-content > .detail-copy + .detail-copy {
  margin-top: 8px;
}

.detail-chip-list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 8px;
  margin: 0;
  padding: 0;
  list-style: none;
  max-width: none;
}

.detail-capability-limited {
  min-width: 0;
}

.detail-chip-more {
  display: inline-flex;
  align-items: center;
  margin: 0;
  padding: 0;
  list-style: none;
}

.detail-expand-toggle--chip {
  min-height: 1.7rem;
  margin-top: 0;
  padding: 2px 8px;
  font-size: 0.76rem;
  line-height: 1.3;
}

.qrpick-perspective-card .detail-chip,
.detail-compact .detail-chip {
  padding: 3px 8px;
  font-size: 0.78rem;
  line-height: 1.3;
}

.qrpick-perspective-card .detail-chip-list,
.detail-compact .detail-chip-list {
  gap: 4px 6px;
}

.detail-capability-mix {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}

.detail-chip {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  padding: 5px 11px;
  border-radius: 999px;
  background: #e3f1ec;
  color: #1a4d42;
  font-size: 0.82rem;
  font-weight: 400;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.detail-check-list {
  margin: 0;
  padding-left: 18px;
  font-size: var(--detail-type-body, 0.88rem);
  font-weight: 400;
  line-height: 1.62;
  max-width: none;
}

.detail-check-list li + li {
  margin-top: 6px;
}

/* Legacy aliases kept for any residual selectors */
.detail-sub-blocks {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
}

.detail-sub-block {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
  padding: 15px 16px;
  border-radius: 11px;
  background: #f4f7f6;
  border: 1px solid rgba(20, 60, 50, 0.06);
}

.detail-sub-block-label {
  color: var(--brand-dark, #0a4f45);
  font-size: 0.78rem;
  font-weight: 600;
}

.detail-sub-block-content {
  color: var(--detail-value, #17212b);
  font-size: 0.9rem;
  font-weight: 400;
  line-height: 1.62;
}

.detail-sub-block--check {
  background: #fbf6ee;
  border-color: rgba(160, 120, 40, 0.12);
}

@media (max-width: 1100px) {
  .detail-info-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .detail-info-stack,
  .detail-info-grid {
    gap: 12px;
  }

  .detail-info-block,
  .detail-action-box {
    padding: 12px 13px;
  }

  .detail-basis-badge--header {
    white-space: normal;
  }
}

.crm-sales-header {
  padding-bottom: 0;
}

.crm-sales-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.crm-save-status {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  width: 6.5rem;
  min-width: 6.5rem;
  color: var(--text-muted);
  font-size: 0.74rem;
  font-weight: 400;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.crm-save-status.is-empty {
  color: #8a9499;
}

.crm-save-status.is-error,
.crm-loading-line.interest-error {
  color: #b13a3a;
}

.crm-save-button {
  min-width: 5.5rem;
  height: var(--control-height);
  padding: 0 12px;
  border: 0;
  border-radius: var(--control-radius);
  background: var(--brand);
  color: #fff;
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
}

.crm-save-button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.crm-loading-line {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 400;
}

.crm-sales-host {
  min-width: 0;
}

.crm-sales-form {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 10px 12px;
  align-items: start;
}

.crm-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.crm-field-label {
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 500;
  line-height: 1.2;
}

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

.crm-span-2 { grid-column: span 2; }
.crm-span-3 { grid-column: span 3; }
.crm-span-4 { grid-column: span 4; }
.crm-span-5 { grid-column: span 5; }
.crm-span-7 { grid-column: span 7; }

.crm-field-textarea {
  align-self: stretch;
}

.crm-control,
.crm-field input,
.crm-field select,
.crm-field textarea {
  width: 100%;
  min-width: 0;
  height: var(--control-height);
  padding: 0 10px;
  border: 1px solid #cfd8dc;
  border-radius: var(--control-radius);
  background: #fff;
  color: var(--text);
  font: inherit;
  font-size: 0.875rem;
  font-weight: 400;
  line-height: 1.45;
}

.crm-control.crm-textarea,
.crm-field textarea.crm-control,
.crm-field textarea,
.crm-textarea {
  box-sizing: border-box;
  height: var(--textarea-height);
  min-height: var(--textarea-height);
  max-height: none;
  padding: 8px 10px;
  resize: vertical;
  line-height: 1.45;
  font-weight: 400;
}

.crm-control::placeholder,
.crm-field input::placeholder,
.crm-field textarea::placeholder {
  color: #7a8a91;
  font-weight: 400;
  opacity: 1;
}

.crm-control:focus,
.crm-field input:focus,
.crm-field select:focus,
.crm-field textarea:focus {
  outline: 2px solid rgba(15, 107, 93, 0.22);
  border-color: var(--brand);
}

.crm-star-cell {
  align-self: stretch;
}

.crm-star-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  height: var(--control-height);
  padding: 0 10px;
  border: 1px solid #cfd8dc;
  border-radius: var(--control-radius);
  background: #fff;
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
}

.crm-star-toggle .crm-star-mark {
  font-size: 0.95rem;
  line-height: 1;
  font-weight: 400;
}

.crm-star-toggle.is-active {
  border-color: #d4a017;
  background: #fff8e6;
  color: #8a6508;
}

.crm-star-toggle:disabled {
  opacity: 0.65;
  cursor: wait;
}

.crm-stage-badge {
  display: inline-flex;
  align-items: center;
  padding: 1px 7px;
  border-radius: 999px;
  background: #e7f2ef;
  color: var(--brand-dark);
  font-size: 0.68rem;
  font-weight: 500;
  white-space: nowrap;
}

.crm-stage-badge[data-stage="WON"] {
  background: #e5f6ea;
  color: #157347;
}

.crm-stage-badge[data-stage="LOST"],
.crm-stage-badge[data-stage="ON_HOLD"] {
  background: #f1f3f4;
  color: #617078;
}

.crm-stage-badge[data-stage="PROPOSAL_SENT"],
.crm-stage-badge[data-stage="NEGOTIATING"] {
  background: #eef3ff;
  color: #3557a0;
}

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

.dense-grid-meta {
  margin-top: 0;
}

.dense-field {
  min-width: 0;
}

.dense-field.dense-span-full,
.dense-field-long {
  grid-column: 1 / -1;
}

.dense-field.dense-span-half {
  grid-column: span 1;
}

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

.dense-label {
  margin-bottom: 2px;
  color: var(--text-muted);
  font-size: var(--detail-type-label, 0.74rem);
  font-weight: 500;
  line-height: 1.25;
}

.dense-value {
  margin: 0;
  color: var(--text);
  font-size: var(--detail-type-body, 0.88rem);
  font-weight: 400;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.dense-hero-summary .dense-value,
.dense-field-long .dense-value {
  font-size: var(--detail-type-body, 0.88rem);
  line-height: 1.5;
  font-weight: 400;
}

.dense-hero-summary .dense-value {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.dense-badge {
  display: inline-flex;
  align-items: center;
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 500;
  white-space: nowrap;
}

.dense-badge-needs-check {
  background: #f7efd6;
  color: #8a6d1f;
}

.dense-badge-missing {
  background: #eceff1;
  color: #617078;
}

.dense-badge-status {
  background: #e8f1ef;
  color: var(--brand-dark);
}

.crm-collapsible {
  background: var(--surface-muted);
}

.crm-collapsible > summary,
.crm-collapsible-summary {
  cursor: pointer;
  list-style: none;
  padding: 10px 14px;
  color: var(--text);
  font-size: 0.82rem;
  font-weight: 600;
}

.crm-collapsible > summary::-webkit-details-marker {
  display: none;
}

.crm-collapsible > summary::before,
.crm-collapsible-summary::before {
  content: "▸ ";
  color: var(--brand);
}

.crm-collapsible[open] > summary::before,
.crm-collapsible[open] > .crm-collapsible-summary::before {
  content: "▾ ";
}

.crm-collapsible[open] > .crm-card-body,
.crm-collapsible-body {
  padding-top: 0;
}

/* Detail hierarchy wins over default caret ::before */
.dense-detail .crm-card-title,
.dense-detail .crm-collapsible > summary,
.dense-detail .crm-collapsible-summary {
  color: var(--detail-section-title);
  font-size: var(--detail-type-section);
  font-weight: 700;
  line-height: 1.3;
}

.dense-detail .crm-collapsible > summary::before,
.dense-detail .crm-collapsible-summary::before {
  content: "";
  display: inline-block;
  width: 3px;
  height: 0.9em;
  margin-right: 8px;
  border-radius: 2px;
  background: var(--qrpick-accent);
  color: transparent;
  vertical-align: -0.05em;
}

.dense-detail .crm-collapsible[open] > summary::before,
.dense-detail .crm-collapsible[open] > .crm-collapsible-summary::before {
  content: "";
}

.dense-detail .crm-collapsible > summary::after {
  content: "▸";
  margin-left: 6px;
  color: var(--qrpick-accent);
  font-weight: 500;
}

.dense-detail .crm-collapsible[open] > summary::after {
  content: "▾";
}

.dense-detail .dense-label,
.dense-detail .crm-field-label {
  color: var(--detail-field-label);
}

.dense-detail .dense-value,
.dense-detail .crm-control,
.dense-detail .crm-field input,
.dense-detail .crm-field select,
.dense-detail .crm-field textarea {
  color: var(--detail-value);
}

.dense-detail .dense-badge-status {
  background: #e7f1f6;
  color: var(--detail-field-label);
  border: 1px solid #c5d8e4;
}

.dense-nested-docs .document-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px 12px;
}

.dense-bullet-list {
  margin: 0;
  padding-left: 18px;
  font-size: 0.84rem;
  line-height: 1.45;
}

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

  .crm-span-2,
  .crm-span-3,
  .crm-span-4,
  .crm-span-5,
  .crm-span-7 {
    grid-column: span 1;
  }
}

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

  .dense-grid-long {
    grid-template-columns: 1fr;
  }

  .dense-nested-docs .document-list {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .dense-grid,
  .crm-sales-form {
    grid-template-columns: 1fr;
  }

  .crm-span-2,
  .crm-span-3,
  .crm-span-4,
  .crm-span-5,
  .crm-span-7 {
    grid-column: 1 / -1;
  }

  .crm-card-header,
  .crm-sales-header {
    flex-direction: column;
    flex-wrap: wrap;
    align-items: stretch;
  }

  .crm-card-content .crm-card-header,
  .crm-card-judgment .crm-card-header {
    align-items: stretch;
  }

  .crm-card-content .crm-card-title,
  .crm-card-judgment .crm-card-title {
    text-align: left;
    width: 100%;
  }

  .crm-card-judgment .public-inquiry-cta {
    align-self: flex-end;
    margin-left: 0;
    min-height: 44px;
    height: 44px;
    padding: 0 14px;
  }

  .public-inquiry-field-row {
    grid-template-columns: 1fr;
  }

  .public-inquiry-actions {
    flex-direction: column-reverse;
    align-items: stretch;
  }

  .public-inquiry-cancel,
  .public-inquiry-submit {
    width: 100%;
    min-height: 44px;
  }

  .crm-sales-header-actions {
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }

  .crm-save-status {
    white-space: normal;
  }

  .crm-save-button {
    flex: 1 1 auto;
    width: 100%;
    min-width: 0;
  }

  .crm-star-toggle {
    width: 100%;
  }

  .inline-opportunity-detail {
    padding: 10px;
  }
}

.card-header-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 8px;
  min-width: 0;
}

.card-title-button {
  flex: 1 1 auto;
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.45;
}

.ledger-title-cell {
  font-weight: 500;
}

.organization-cell {
  width: 150px;
  max-width: 170px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 500;
}

.domain-cell {
  width: 80px;
  white-space: nowrap;
}

.priority-badge,
.domain-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: max-content;
  border-radius: 999px;
  white-space: nowrap;
}

.priority-badge {
  padding: 5px 9px;
  color: #49565c;
  background: #edf1f3;
  font-size: 0.72rem;
  font-weight: 500;
}

.priority-badge[data-priority="P0_IMMEDIATE"] {
  color: #981b1b;
  background: #fee4e2;
}

.priority-badge[data-priority="P1_THIS_WEEK"] {
  color: #865100;
  background: #fff0c2;
}

.priority-badge[data-priority="P2_REVIEW"] {
  color: #185b9d;
  background: #e6f0fb;
}

.priority-badge[data-priority="P3_WATCH"] {
  color: #4c5b63;
  background: #edf1f3;
}

.priority-badge[data-priority="NO_ACTION"] {
  color: #6b7479;
  border: 1px solid #ccd4d8;
  background: #f7f8f9;
}

.domain-badge {
  padding: 4px 8px;
  border: 1px solid #d7e0e4;
  color: #4d616a;
  background: #f7fafb;
  font-size: 0.7rem;
  font-weight: 500;
}

.action-cell {
  width: 400px;
  min-width: 220px;
  max-width: 480px;
  color: #24383f;
  font-weight: 400;
}

.action-cell p {
  display: -webkit-box;
  overflow: hidden;
  margin: 0;
  line-height: 1.5;
  font-weight: 400;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.detail-button-cell {
  width: 5rem;
  min-width: 5rem;
  text-align: right;
  white-space: nowrap;
}

.detail-button,
.card-detail-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 3.75rem;
  height: var(--control-height);
  padding: 0 12px;
  border: 1px solid #b8c8ce;
  border-radius: var(--control-radius);
  color: #36515b;
  background: var(--surface);
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 500;
  white-space: nowrap;
  line-height: 1;
}

.detail-button:hover,
.card-detail-button:hover {
  border-color: var(--brand);
  color: var(--brand-dark);
  background: #f0f8f6;
}

.opportunity-cards {
  display: none;
}

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

.empty-state {
  margin: 0;
  padding: 50px 20px;
  color: var(--text-muted);
  text-align: center;
}

.detail-backdrop {
  position: fixed;
  inset: 0;
  z-index: 20;
  background: rgba(13, 25, 30, 0.38);
}

.detail-panel {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 30;
  width: min(860px, 94vw);
  height: 100dvh;
  overflow-y: auto;
  transform: translateX(102%);
  border-left: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow);
  transition: transform 160ms ease-out;
}

@media (min-width: 1100px) {
  .detail-panel {
    width: min(720px, 42vw);
  }
}

@media (max-width: 720px) {
  .detail-panel {
    width: 100vw;
    max-width: 100vw;
  }
}

.detail-panel.is-open {
  transform: translateX(0);
}

.detail-quick-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
  margin: 0 0 14px;
  max-width: 100%;
}

.detail-doc-action-bar {
  margin: 4px 0 16px;
}

.detail-quick-star {
  flex: 0 0 auto;
}

.detail-quick-star .star-button {
  width: 36px;
  height: 36px;
  min-width: 36px;
  min-height: 36px;
}

.detail-quick-link,
.detail-quick-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 1 auto;
  max-width: 100%;
  min-height: 36px;
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-muted);
  color: var(--brand-dark);
  font-size: 0.86rem;
  font-weight: 500;
  line-height: 1.3;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  word-break: keep-all;
  overflow-wrap: normal;
}

.detail-quick-link-source {
  border-color: #9ec4b6;
  background: #eef7f3;
  font-weight: 600;
}

.detail-quick-link:hover,
.detail-quick-button:hover {
  border-color: var(--brand);
  background: #fff;
}

.decision-identity-block {
  margin: 0 0 8px;
}

.dense-analysis-note,
.dense-empty-copy {
  margin: 0 0 10px;
  color: var(--text-muted);
  font-size: 0.84rem;
  font-weight: 400;
  line-height: 1.5;
}

.crm-lifecycle-host:empty {
  display: none;
}

.judgment-detail .crm-card-title {
  color: var(--brand);
}

.crm-card-review-criteria .crm-card-title,
.crm-card-review-summary .crm-card-title,
.crm-card-glance .crm-card-title,
.crm-card-checkpoint .crm-card-title {
  color: var(--brand);
}

.detail-compact .crm-card {
  margin-bottom: 0;
}

.detail-compact .crm-card-body {
  padding: 10px 12px 12px;
}

.detail-compact .crm-card-header {
  padding: 10px 12px 0;
}

.detail-compact.decision-brief .crm-card-judgment .crm-card-header {
  padding-bottom: 0;
}

.detail-compact.decision-brief .crm-card-judgment .qrpick-collab-body {
  padding-top: 12px;
}

.detail-compact .crm-collapsible > summary,
.detail-compact .crm-collapsible-summary {
  padding: 8px 12px;
}

.detail-compact .detail-quick-actions {
  margin-bottom: 10px;
}

.detail-compact .crm-sales-form {
  gap: 8px 10px;
}

.detail-compact .fit-decision-host {
  margin-top: 12px;
  padding-top: 12px;
}

/* Sales-brief detail: consistent label/value table */
.sales-brief .sales-judgment-body {
  display: block;
}

.sales-brief .sales-field-label,
.sales-brief .sales-judgment-term {
  margin: 0;
  color: #5a6b75;
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1.4;
}

.sales-brief .sales-judgment-table {
  margin: 0;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}

.sales-brief .sales-judgment-row {
  display: grid;
  grid-template-columns: 7.25rem minmax(0, 1fr);
  gap: 8px 14px;
  align-items: start;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
}

.sales-brief .sales-judgment-row:last-child {
  border-bottom: 0;
}

.sales-brief .sales-judgment-term {
  padding-top: 2px;
}

.sales-brief .sales-judgment-def {
  margin: 0;
  min-width: 0;
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 400;
  line-height: 1.5;
  overflow-wrap: break-word;
  word-break: keep-all;
}

.sales-brief .sales-judgment-list {
  margin: 0;
  padding-left: 1.15rem;
}

.sales-brief .sales-judgment-list li + li {
  margin-top: 4px;
}

.sales-brief .sales-judgment-def .detail-chip-list,
.sales-brief .sales-judgment-def .detail-capability-limited {
  margin: 0;
}

.sales-brief .sales-core-summary {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.sales-brief .sales-core-summary-copy {
  margin: 4px 0 0;
  color: var(--text);
  font-size: var(--detail-type-prose, 0.9rem);
  font-weight: 400;
  line-height: var(--detail-line-prose, 1.55);
  overflow-wrap: break-word;
  word-break: keep-all;
}

.dense-detail .sales-core-summary-copy,
.dense-detail .decision-list,
.dense-detail .decision-copy {
  color: var(--text);
  font-size: var(--detail-type-prose, 0.9rem);
  font-weight: 400;
  line-height: var(--detail-line-prose, 1.55);
  overflow-wrap: break-word;
  word-break: keep-all;
}

/* Checkpoint: title is parent; list sits nested inside a content panel */
.sales-brief .crm-card-checkpoint .crm-card-body {
  padding: 6px 12px 12px 22px;
}

.sales-brief .crm-card-checkpoint .detail-check-list {
  margin: 0;
  padding: 10px 12px 10px 1.35rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 400;
  line-height: 1.5;
  list-style-type: disc;
  list-style-position: outside;
}

.sales-brief .crm-card-checkpoint .detail-check-list li {
  padding-left: 2px;
}

.sales-brief .crm-card-checkpoint .detail-check-list li + li {
  margin-top: 6px;
}

.sales-brief .crm-card-core .dense-grid-meta {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.decision-identity-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 0 0 10px;
}

.decision-type-badge,
.decision-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 1.75rem;
  padding: 4px 10px;
  border-radius: 8px;
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
}

.decision-type-badge {
  color: #355a48;
  background: #e7f3ec;
  border: 1px solid #c4ddd0;
}

.title-with-urgent {
  display: inline;
}

.title-with-urgent-text {
  min-width: 0;
}

.card-deadline-line {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.84rem;
  line-height: 1.35;
}

.qrpick-collab-body {
  display: block;
}

.qrpick-collab-panel {
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
}

.qrpick-collab-group {
  padding: 14px 14px 12px;
}

.qrpick-collab-group + .qrpick-collab-group {
  border-top: 1px solid var(--line);
}

.qrpick-collab-group-title {
  margin: 0 0 10px;
  color: #5a6b75;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  line-height: 1.3;
}

.qrpick-collab-group-body {
  margin: 0;
  min-width: 0;
}

.qrpick-collab-group--untitled .qrpick-collab-group-title {
  display: none;
}

.qrpick-service-inline-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  max-width: 100%;
  min-width: 0;
}

.qrpick-service-review-cluster {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  max-width: 100%;
  min-width: 0;
}

.qrpick-service-review-cluster:not(.qrpick-service-review-cluster--solo) {
  margin-left: 2px;
  padding-left: 10px;
  border-left: 1px solid #c5d4cc;
}

.qrpick-service-review-label {
  flex: 0 0 auto;
  color: #6a7a72;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  line-height: 1.2;
  white-space: nowrap;
}

.qrpick-service-link-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  max-width: 100%;
  min-width: 0;
}

.qrpick-service-link-item {
  margin: 0;
  max-width: 100%;
}

.qrpick-service-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  max-width: 100%;
  min-height: 28px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid #c7ddd2;
  background: #f4faf7;
  color: var(--brand-dark);
  text-decoration: none;
  transition: background-color 0.12s ease, border-color 0.12s ease;
}

.qrpick-service-link:hover,
.qrpick-service-link:focus-visible {
  background: #e7f4ee;
  border-color: #9fc4b2;
  outline: none;
}

.qrpick-service-link--review {
  border-color: #d5ddd8;
  background: #f7f9f8;
  color: #3f5a4d;
}

.qrpick-service-link--review:hover,
.qrpick-service-link--review:focus-visible {
  background: #eef3f0;
  border-color: #b7c8bf;
  outline: none;
}

.qrpick-service-link-name {
  min-width: 0;
  font-size: 0.86rem;
  font-weight: 600;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  word-break: keep-all;
}

.qrpick-service-link-icon {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #6a8578;
  line-height: 1;
  opacity: 0.9;
}

.qrpick-service-link-icon svg {
  display: block;
  width: 12px;
  height: 12px;
}

.qrpick-service-link:hover .qrpick-service-link-icon,
.qrpick-service-link:focus-visible .qrpick-service-link-icon {
  color: var(--brand-dark);
  opacity: 1;
}

.qrpick-service-link--review .qrpick-service-link-icon {
  color: #7a8f84;
  opacity: 0.85;
}

@media (max-width: 720px) {
  .qrpick-service-inline-row,
  .qrpick-service-review-cluster,
  .qrpick-service-link-list {
    max-width: 100%;
  }

  .qrpick-service-review-cluster:not(.qrpick-service-review-cluster--solo) {
    /* Keep divider+label+chips as one wrapping unit; avoid horizontal scroll. */
    flex: 1 1 auto;
  }
}

.qrpick-collab-check-list {
  margin: 0;
  padding-left: 1.1rem;
  color: var(--text);
  font-size: 0.9rem;
  line-height: 1.45;
}

.qrpick-collab-check-list li + li {
  margin-top: 4px;
}

.decision-badge {
  color: #3d4f58;
  background: #edf1f3;
  border: 1px solid #ccd5db;
}

.decision-badge[data-decision="CONTACT_REVIEW"] {
  color: #0f5c45;
  background: #def7ee;
  border-color: #9ad9c2;
}

.decision-badge[data-decision="MORE_REVIEW"] {
  color: #7a5200;
  background: #fff3d6;
  border-color: #efd08a;
}

.decision-badge[data-decision="EXCLUDE_CANDIDATE"] {
  color: #7a2430;
  background: #fde8ea;
  border-color: #efb4bb;
}

.decision-list {
  margin: 0;
  padding-left: 1.1rem;
  color: #24383f;
}

.decision-list li + li {
  margin-top: 6px;
}

.decision-copy {
  margin: 0;
  color: #24383f;
}

/* Public detail drawer — unified section title/body alignment */
.dense-detail.decision-brief {
  --detail-section-indent: 14px;
  --detail-section-gap-title: 8px;
  --detail-section-gap-body: 10px;
}

.dense-detail.decision-brief .detail-section-title::before {
  display: none;
}

.dense-detail.decision-brief .detail-section-title {
  padding-left: 0;
}

.dense-detail.decision-brief .crm-card > .crm-card-header {
  padding: 12px 14px 0;
}

.dense-detail.decision-brief .crm-card > .detail-section-body {
  margin: var(--detail-section-gap-title) 14px 0 var(--detail-section-indent);
  padding: var(--detail-section-gap-body) 0 12px;
  border-top: 1px solid var(--line);
}

.dense-detail.decision-brief .crm-card-judgment > .detail-section-body,
.dense-detail.decision-brief .crm-card-past-similar > .detail-section-body,
.dense-detail.decision-brief .public-history-card > .detail-section-body,
.dense-detail.decision-brief .crm-card-lifecycle > .detail-section-body,
.dense-detail.decision-brief .crm-card-identity > .detail-section-body,
.dense-detail.decision-brief .crm-card-contact > .detail-section-body,
.dense-detail.decision-brief .crm-card-review-summary > .detail-section-body {
  margin-left: 0;
  margin-right: 0;
  padding: 10px 14px 12px;
  border-top: 0;
}

.dense-detail.decision-brief .detail-section-list {
  margin: 0;
  padding-left: 1.1rem;
}

.dense-detail.decision-brief .detail-section-body-text {
  margin: 0;
}

.dense-detail.decision-brief .decision-overview > .detail-section-body .sales-core-summary {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

.decision-brief .crm-card-constraint .crm-card-body,
.decision-brief .crm-card-checklist .crm-card-body {
  padding: var(--detail-section-gap-body) 0 12px;
}

.card-decision-summary,
.card-decision-scope {
  margin: 0 0 8px;
  color: #24383f;
  font-size: 0.86rem;
  line-height: 1.45;
}

.card-decision-scope {
  color: var(--text-muted);
}

.decision-brief .detail-quick-actions {
  margin-top: 4px;
}

@media (max-width: 1024px) {
  /* Keep all 7 columns; allow limited horizontal scroll instead of crushing widths. */
  .decision-matrix-table {
    min-width: 1100px;
  }

  .decision-matrix-table .col-star { width: 4%; }
  .decision-matrix-table .col-title { width: 24%; }
  .decision-matrix-table .col-org { width: 15%; }
  .decision-matrix-table .col-summary { width: 22%; }
  .decision-matrix-table .col-review-points { width: 10%; }
  .decision-matrix-table .col-scope { width: 17%; }
  .decision-matrix-table .col-budget { width: 8%; }
}

@media (max-width: 900px) {
  #view-top30 .table-wrap,
  main .table-wrap:has(.opportunity-table) {
    display: none;
  }

  .opportunity-cards {
    display: grid;
    gap: 12px;
  }

  .decision-identity-head,
  .decision-brief .sales-judgment-row,
  .decision-brief .crm-card-core .dense-grid-meta {
    display: flex;
    flex-direction: column;
    align-items: stretch;
  }

  .decision-brief .crm-card-core .dense-grid-meta {
    display: grid;
    grid-template-columns: 1fr;
  }
}

@media (max-width: 1100px) {
  .sales-brief .crm-card-core .dense-grid-meta {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .sales-brief .crm-card-core .dense-grid-meta {
    grid-template-columns: 1fr;
  }
}

/* Core meta values: one shared chip surface (no badge-only exception) */
.sales-brief .crm-card-core .dense-label {
  color: #5a6b75;
  font-weight: 600;
}

.sales-brief .crm-card-core .dense-grid-meta .dense-value {
  display: inline-block;
  max-width: 100%;
  box-sizing: border-box;
  padding: 5px 10px;
  border-radius: 8px;
  background: #e7f1f6;
  color: var(--detail-field-label, #315f7d);
  border: 1px solid #c5d8e4;
  font-size: 0.84rem;
  font-weight: 500;
  line-height: 1.4;
  overflow-wrap: anywhere;
  word-break: keep-all;
}

.sales-brief .crm-card-core .dense-grid-meta .dense-value .dense-badge {
  display: inline;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: inherit;
  font-size: inherit;
  font-weight: inherit;
  white-space: normal;
}

.sales-brief .crm-card-core .dense-field-empty .dense-value {
  background: #f2f5f7;
  color: var(--detail-muted, #5a6b75);
  border-color: #d7e0e6;
}

@media (max-width: 720px) {
  .sales-brief .sales-judgment-row {
    grid-template-columns: 1fr;
    gap: 4px;
  }
}

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

.review-summary-item {
  margin: 0;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fafcfd;
}

.review-summary-item-label {
  margin: 0 0 4px;
  color: var(--text-muted);
  font-size: var(--detail-type-label, 0.74rem);
  font-weight: 600;
  line-height: 1.3;
}

.review-summary-item-value {
  margin: 0;
  color: var(--text);
  font-size: var(--detail-type-body, 0.88rem);
  font-weight: 500;
  line-height: 1.4;
  overflow-wrap: break-word;
  word-break: keep-all;
  white-space: pre-line;
}

.glance-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.glance-item {
  margin: 0;
  padding: 0;
}

.glance-item-label {
  margin: 0 0 4px;
  color: var(--text-muted);
  font-size: var(--detail-type-label, 0.74rem);
  font-weight: 600;
}

.glance-item-value,
.glance-item-body {
  margin: 0;
  color: var(--text);
  font-size: var(--detail-type-body, 0.88rem);
  line-height: 1.45;
}

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

.qrpick-perspective-card {
  margin: 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  min-height: 0;
}

.qrpick-perspective-card-label {
  margin: 0 0 6px;
  color: var(--brand-dark);
  font-size: var(--detail-type-subhead, 0.84rem);
  font-weight: 650;
  line-height: 1.3;
}

.qrpick-perspective-card-body {
  color: var(--text);
  font-size: var(--detail-type-body, 0.88rem);
  line-height: 1.45;
}

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

.checkpoint-card {
  margin: 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fafbfc;
}

.checkpoint-card-label {
  margin: 0 0 6px;
  color: var(--text);
  font-size: var(--detail-type-subhead, 0.84rem);
  font-weight: 650;
  line-height: 1.3;
}

.checkpoint-card-body {
  font-size: var(--detail-type-body, 0.88rem);
  line-height: 1.45;
}

.detail-muted-copy {
  margin: 0;
  color: var(--text-muted);
  font-size: var(--detail-type-body, 0.88rem);
  line-height: 1.4;
}

.detail-expand-toggle {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  margin-top: 6px;
  padding: 2px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: #35506a;
  font-size: 0.8rem;
  cursor: pointer;
}

.detail-expand-toggle:hover {
  background: #f5f8fa;
}

.detail-expand-toggle:focus-visible {
  outline: 2px solid #4a90c8;
  outline-offset: 2px;
}

.detail-clamped-prose-body.is-clamped {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
}

.dense-field-empty .dense-value {
  color: var(--text-muted);
  font-weight: 400;
}

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

.review-criteria-grid--nested {
  margin-bottom: 12px;
}

.review-criteria-card {
  border: 1px solid var(--line);
  background: #fafbfc;
  padding: 12px 14px;
}

.review-criteria-card-title {
  margin: 0 0 10px;
  font-size: 0.92rem;
  font-weight: 650;
  color: var(--text);
}

.review-criteria-fields {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.review-criteria-field-label {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-bottom: 2px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--text-muted);
}

.review-criteria-field-value {
  font-size: 0.9rem;
  font-weight: 500;
  line-height: 1.45;
  color: var(--text);
}

.review-tag {
  display: inline-block;
  padding: 1px 6px;
  border: 1px solid var(--line);
  font-size: 0.66rem;
  font-weight: 600;
  line-height: 1.4;
  white-space: nowrap;
}

.review-tag-fact {
  background: #eef4f8;
  color: #245066;
}

.review-tag-rule {
  background: #f4f1ea;
  color: #5c4a32;
}

.review-tag-check {
  background: #f7eee8;
  color: #6a3f2b;
}

.review-tag-human {
  background: #eaf3ea;
  color: #2f5a36;
}

.review-criteria-disclaimer {
  margin: 10px 0 0;
  font-size: 0.76rem;
  line-height: 1.45;
  color: var(--text-muted);
}

@media (max-width: 900px) {
  .review-summary-grid,
  .qrpick-perspective-grid,
  .checkpoint-grid,
  .review-criteria-grid {
    grid-template-columns: 1fr;
  }
}

.detail-header {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 24px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.97);
}

.detail-header h2 {
  margin: 10px 0 0;
  font-size: 1.28rem;
  font-weight: 600;
  line-height: 1.45;
}

.detail-heading {
  min-width: 0;
}

.detail-badges {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
}

.detail-rank {
  color: var(--text-muted);
  font-size: 0.74rem;
  font-weight: 500;
}

.detail-organization {
  margin: 7px 0 0;
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 500;
}

.detail-close {
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--text-muted);
  background: var(--surface);
  cursor: pointer;
  font-size: 1.5rem;
  line-height: 1;
}

.detail-content {
  padding: 8px 24px 32px;
}

.detail-section {
  padding: 17px 0;
  border-bottom: 1px solid var(--line);
}

.detail-section-highlight {
  margin-top: 16px;
  padding: 18px;
  border: 1px solid #abd0c8;
  border-radius: 8px;
  background: #f0f8f6;
}

.detail-section-highlight h3 {
  color: var(--brand-dark);
}

.detail-section-highlight p {
  color: #163d36;
  font-size: 1rem;
  font-weight: 400;
}

.detail-section-target {
  padding: 15px 0;
}

.detail-section-target h3 {
  color: #41545d;
}

.detail-section-target p,
.detail-section-target li {
  color: #1f343c;
  font-weight: 400;
}

.detail-section h3 {
  margin: 0 0 7px;
  color: var(--text-muted);
  font-size: 0.76rem;
  font-weight: 600;
}

.detail-section p,
.detail-section ul {
  margin: 0;
  line-height: 1.65;
  font-weight: 400;
  overflow-wrap: anywhere;
}

.detail-section ul {
  padding-left: 20px;
}

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

.detail-pairs div {
  min-width: 0;
}

.detail-pairs dt {
  margin-bottom: 4px;
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 500;
}

.detail-pairs dd {
  margin: 0;
  line-height: 1.5;
  font-weight: 400;
  overflow-wrap: anywhere;
}

/* Slide panels: label and value on one horizontal row (space is available). */
.detail-panel .detail-pairs {
  grid-template-columns: 1fr;
  gap: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-muted);
  overflow: hidden;
}

.detail-panel .detail-pairs > div {
  display: grid;
  grid-template-columns: 7.75rem minmax(0, 1fr);
  gap: 10px 12px;
  align-items: start;
  padding: 9px 12px;
  border-bottom: 1px solid var(--line);
}

.detail-panel .detail-pairs > div:last-child {
  border-bottom: 0;
}

.detail-panel .detail-pairs dt {
  margin: 0;
  padding-top: 1px;
  color: var(--text-muted);
  font-size: 0.76rem;
  font-weight: 500;
  line-height: 1.4;
  white-space: nowrap;
}

.detail-panel .detail-pairs dd {
  margin: 0;
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 400;
  line-height: 1.45;
}

.contact-table,
.status-table {
  display: grid;
  gap: 0;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-muted);
  overflow: hidden;
}

.contact-table > div,
.status-table > div {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 10px;
  padding: 7px 12px;
  border-bottom: 1px solid var(--line);
  align-items: start;
}

.contact-table > div:last-child,
.status-table > div:last-child {
  border-bottom: 0;
}

.contact-table dt,
.status-table dt {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.74rem;
  font-weight: 500;
}

.contact-table dd,
.status-table dd {
  margin: 0;
  overflow-wrap: anywhere;
  font-size: 0.88rem;
  font-weight: 400;
  line-height: 1.35;
}

@media (max-width: 720px) {
  .contact-table > div,
  .status-table > div {
    grid-template-columns: 1fr;
    gap: 2px;
    padding: 8px 12px;
  }
}

.classification-section details {
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fafcfd;
}

.classification-section summary {
  padding: 13px 14px;
  color: #485a62;
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 600;
}

.classification-section details[open] summary {
  border-bottom: 1px solid var(--line);
}

.classification-section ul {
  margin: 0;
  padding: 13px 18px 15px 34px;
  color: var(--text-muted);
  font-size: 0.82rem;
}

.source-links,
.document-list {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

.document-item {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.document-link,
.source-links a {
  color: var(--brand-dark);
  text-decoration: none;
  font-weight: 600;
  line-height: 1.35;
}

.document-link:hover,
.source-links a:hover {
  text-decoration: underline;
}

.document-meta {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.86rem;
}

footer {
  padding: 28px 0 36px;
  color: var(--text-muted);
  font-size: 0.78rem;
  text-align: center;
}

.site-footer {
  padding: 24px var(--app-side-gutter) 28px;
}

.footer-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  max-width: 920px;
  margin: 0 auto;
}

.footer-inner--compact {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: 14px 28px;
  align-items: start;
  text-align: left;
}

.footer-brand-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.footer-brand-copy .footer-title {
  margin-bottom: 2px;
}

.footer-side .footer-nav {
  justify-content: flex-start;
  margin-bottom: 4px;
}

.footer-side .footer-text + .footer-text {
  margin-top: 4px;
}

.footer-block {
  width: 100%;
}

.footer-title {
  margin: 0 0 4px;
  color: var(--text);
  font-size: 0.86rem;
  font-weight: 600;
  line-height: 1.4;
}

.footer-text {
  margin: 0;
  line-height: 1.55;
}

.footer-text + .footer-text {
  margin-top: 2px;
}

.footer-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px 14px;
}

.footer-link,
.footer-link-button {
  color: var(--brand-dark);
  font-size: 0.8rem;
  font-weight: 600;
  line-height: 1.4;
  text-decoration: none;
}

.footer-link-button {
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.footer-link:hover,
.footer-link-button:hover {
  text-decoration: underline;
}

.footer-contact-line {
  font-size: 0.76rem;
}

.updates-modal.modal-dialog {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.updates-modal-header {
  align-items: flex-start;
}

.updates-modal-header-copy {
  flex: 1;
  min-width: 0;
}

.updates-modal-lead {
  margin: 4px 0 0;
  color: var(--text-muted);
  font-size: 0.76rem;
  font-weight: 500;
  line-height: 1.35;
}

.updates-modal-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding-top: 12px;
}

.updates-modal-body .updates-timeline {
  gap: 14px;
}

.updates-modal-body .updates-entry {
  padding: 0 0 14px;
  border-bottom: 1px solid var(--line);
}

.updates-modal-body .updates-entry:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.updates-state {
  margin: 0 0 12px;
  color: var(--text-muted);
  font-size: 0.86rem;
}

.updates-timeline {
  display: flex;
  flex-direction: column;
  gap: 18px;
  text-align: left;
}

.updates-entry {
  padding: 0 0 18px;
  border-bottom: 1px solid var(--line);
}

.updates-entry:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.updates-entry-date {
  display: block;
  margin: 0 0 4px;
  color: var(--text-muted);
  font-size: 0.76rem;
  font-weight: 500;
  line-height: 1.35;
}

.updates-entry-title {
  margin: 0 0 8px;
  color: var(--text);
  font-size: 0.94rem;
  font-weight: 600;
  line-height: 1.4;
}

.updates-entry-list {
  margin: 0;
  padding-left: 1.1rem;
  color: var(--text);
  font-size: 0.86rem;
  line-height: 1.55;
}

.updates-entry-list li + li {
  margin-top: 4px;
}

.usage-beta-intro p {
  margin: 0;
  color: var(--text);
  font-size: 0.88rem;
  line-height: 1.55;
}

.usage-beta-intro p + p {
  margin-top: 8px;
}

.usage-section-divider {
  margin: 0 0 22px;
  border: 0;
  border-top: 1px solid var(--line);
}

footer p {
  margin: 0;
  line-height: 1.55;
}

.footer-brand {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  flex: 0 0 auto;
  text-decoration: none;
}

.footer-logo {
  display: block;
  width: auto;
  height: 28px;
}

footer .footer-credit {
  margin: 0;
  max-width: 920px;
  margin-inline: auto;
  line-height: 1.6;
}

footer a {
  color: var(--brand-dark);
  font-weight: 600;
  text-decoration: none;
}

footer a:hover {
  text-decoration: underline;
}

.footer-brand:hover {
  text-decoration: none;
  opacity: 0.88;
}

@media (prefers-reduced-motion: reduce) {
  .detail-panel {
    transition: none;
  }
}

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

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

  .kpi-filter-row-cards {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .kpi {
    border-bottom: 1px solid var(--line);
  }

  .kpi:nth-child(2n) {
    border-right: 0;
  }

  .kpi:last-child {
    grid-column: 1 / -1;
    border-bottom: 0;
  }

  .kpi-grid-ledger-stats .kpi:nth-child(2n) {
    border-right: 1px solid var(--line);
  }

  .kpi-grid-ledger-stats .kpi:nth-child(3n) {
    border-right: 0;
  }

  .kpi-grid-ledger-stats .kpi:last-child {
    grid-column: auto;
  }

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

  .toolbar-filters .search-field {
    grid-column: 1 / -1;
  }

  .toolbar-filters-span {
    grid-column: 1 / -1;
  }
}

@media (max-width: 720px) {
  .table-wrap {
    display: none;
  }

  .opportunity-cards {
    display: grid;
    gap: 12px;
    padding: 12px;
  }

  .opportunity-card {
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    cursor: pointer;
  }

  .opportunity-card:hover,
  .opportunity-card:focus-visible {
    border-color: #a9cfc7;
    outline: 3px solid rgba(15, 107, 93, 0.13);
    outline-offset: 1px;
  }

  .card-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-bottom: 10px;
  }

  .opportunity-card h2 {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 600;
    line-height: 1.45;
  }

  .card-organization {
    margin: 6px 0 0;
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 500;
  }

  .card-facts {
    display: flex;
    gap: 22px;
    margin: 14px 0;
  }

  .card-facts div {
    display: flex;
    gap: 7px;
  }

  .card-facts dt {
    color: var(--text-muted);
    font-size: 0.75rem;
    font-weight: 500;
  }

  .card-facts dd {
    margin: 0;
    font-size: 0.82rem;
    font-weight: 400;
  }

  .card-action {
    padding: 12px;
    border-left: 3px solid var(--brand);
    background: #f4f9f8;
  }

  .card-action-label,
  .card-action strong {
    display: block;
    margin-bottom: 5px;
    color: var(--brand-dark);
    font-size: 0.72rem;
    font-weight: 500;
  }

  .card-action p {
    margin: 0;
    line-height: 1.5;
    font-size: 0.86rem;
    font-weight: 400;
  }

  .card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 14px;
    color: var(--text-muted);
    font-size: 0.74rem;
  }
}

@media (max-width: 560px) {
  .detail-quick-actions,
  .detail-doc-action-bar {
    gap: 8px;
  }

  .detail-quick-link,
  .detail-quick-button {
    white-space: normal;
    text-align: center;
    max-width: calc(100% - 4px);
  }
}

@media (max-width: 560px) {
  .app-header {
    padding-top: 24px;
  }

  .app-header h1 {
    align-items: flex-start;
  }

  .beta-test-badge {
    flex: 0 0 auto;
    flex-basis: auto;
    width: max-content;
    max-width: 100%;
    margin-left: 0;
    align-self: flex-start;
    white-space: nowrap;
  }

  .beta-test-badge-note {
    display: none;
  }

  .nav-bar {
    align-items: stretch;
  }

  .header-tools {
    width: auto;
    margin-left: auto;
    justify-content: flex-end;
    flex-wrap: nowrap;
    gap: 8px;
  }

  .header-tool-button {
    height: 30px;
    padding: 0 10px;
    font-size: 0.76rem;
  }

  .header-tool-links {
    gap: 4px 8px;
  }

  .hero-tagline {
    font-size: 0.94rem;
  }

  .hero-intro {
    font-size: 0.82rem;
    line-height: 1.48;
  }

  .dense-detail.decision-brief {
    --detail-section-indent: 10px;
  }

  .footer-inner--compact {
    grid-template-columns: 1fr;
    gap: 12px;
    text-align: center;
  }

  .footer-brand-row {
    justify-content: center;
  }

  .footer-side .footer-nav {
    justify-content: center;
  }

  .footer-nav {
    gap: 6px 10px;
  }

  .updates-entry-title {
    font-size: 0.9rem;
  }

  .status-badge {
    min-width: auto;
    font-size: 0.74rem;
  }

  .kpi {
    padding: 10px 12px;
  }

  .kpi-ledger-block {
    gap: 8px;
    margin-bottom: 6px;
  }

  .ledger-meta-line {
    gap: 4px 6px;
    font-size: 0.78rem;
  }

  button.kpi-filter-card {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    padding: 8px 10px;
    min-height: 40px;
  }

  button.ledger-quick-filter-chip.kpi-filter-card {
    width: auto;
    min-height: 38px;
    padding: 0 6px 0 12px;
    justify-content: center;
    gap: 8px;
    border-radius: 999px;
  }

  button.kpi-filter-card .kpi-filter-card-label {
    font-size: 0.7rem;
  }

  button.kpi-filter-card strong {
    font-size: 0.95rem;
    line-height: 1.2;
  }

  button.ledger-quick-filter-chip.kpi-filter-card .ledger-quick-filter-chip-count,
  button.ledger-quick-filter-chip.kpi-filter-card strong {
    font-size: 0.78rem;
    line-height: 1.2;
  }

  .toolbar {
    --toolbar-padding-y: 14px;
    --toolbar-padding-x: 14px;
    --toolbar-gap: 10px;
  }

  .toolbar-filters,
  .toolbar-filters--dense {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px 10px;
  }

  .toolbar-filters .search-field {
    grid-column: 1 / -1;
  }

  .toolbar-filters-span {
    grid-column: 1 / -1;
  }

  .toolbar-head .result-count {
    margin-left: 0;
    width: 100%;
    text-align: left;
  }

  .toolbar-meta,
  .toolbar-title-actions {
    margin-left: 0;
    width: 100%;
  }

  .quick-filter-toolbar {
    align-items: flex-start;
  }

  .quick-filter-toolbar-sep {
    display: none;
  }

  .quick-filter-toolbar-status {
    width: 100%;
    margin-left: 0;
  }

  .toolbar-panel-header {
    min-block-size: 0;
  }

  .detail-header,
  .detail-content {
    padding-inline: 18px;
  }

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

@media (max-width: 340px) {
  .toolbar-filters,
  .toolbar-filters--dense {
    grid-template-columns: 1fr;
  }
}

/* Star / minimal CRM (Cloudflare D1-backed opportunity_interests) */

.card-star-wrapper {
  margin-left: auto;
}

.star-button {
  padding: 2px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-muted);
  color: var(--text-muted);
  font-size: 1.05rem;
  line-height: 1.4;
  cursor: pointer;
}

.star-button.is-starred {
  border-color: #e0b23a;
  background: #fdf3d9;
  color: #a5760a;
}

.star-button:disabled {
  cursor: wait;
  opacity: 0.6;
}

.interest-status-line.interest-error {
  color: #b13a3a;
}

/* Lifecycle (사전규격 → 입찰공고 → 낙찰 → 계약) timeline */

.lifecycle-basis-note,
.lifecycle-solo-note,
.lifecycle-possible-heading {
  margin: 0 0 10px;
  color: var(--text-muted);
  font-size: 0.78rem;
}

.lifecycle-timeline {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.lifecycle-stage {
  display: grid;
  gap: 2px;
  min-width: 136px;
  flex: 1 1 148px;
  max-width: 220px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-muted);
  font-size: 0.78rem;
}

.lifecycle-stage.is-current {
  border-color: var(--brand);
  background: #eef7f4;
}

.lifecycle-stage strong,
.lifecycle-stage-label {
  color: var(--brand-dark);
  font-size: 0.8rem;
  font-weight: 600;
  line-height: 1.25;
}

.lifecycle-stage-date {
  color: var(--text);
  font-size: 0.78rem;
  line-height: 1.3;
}

.lifecycle-stage-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 2px;
}

.lifecycle-stage-notice {
  color: var(--text-muted);
  font-size: 0.76rem;
  line-height: 1.25;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

.lifecycle-stage-source-link {
  flex: 0 0 auto;
  font-size: 0.76rem;
  white-space: nowrap;
}

@media (max-width: 720px) {
  .lifecycle-stage {
    flex-basis: 100%;
    max-width: none;
  }
}

.compare-label {
  color: var(--text-muted);
  font-weight: 500;
}

.opportunity-data-row.is-expanded .row-title-button {
  display: block;
  -webkit-line-clamp: unset;
  overflow: visible;
}

.lifecycle-possible-list {
  margin: 0;
  padding-left: 18px;
  font-size: 0.82rem;
}

.lifecycle-possible-list li {
  color: #8a6d1f;
}

/* 영업 타깃 원장 (읽기 전용) */
.targets-guide {
  margin: 0 0 16px;
  padding: 16px 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
}

.targets-guide h2 {
  margin: 0 0 8px;
  font-size: 1.05rem;
  color: var(--brand-dark);
}

.targets-guide ol,
.targets-guide-notes {
  margin: 0;
  padding-left: 1.2rem;
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.55;
}

.targets-guide-notes {
  margin-top: 10px;
}

.targets-category-breakdown {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin: 0 0 14px;
  padding: 0;
  list-style: none;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.targets-table {
  min-width: 1100px;
}

.target-link-button,
.target-expand-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 0 10px;
  border-radius: var(--control-radius);
  border: 1px solid var(--line);
  background: var(--surface-muted);
  color: var(--brand-dark);
  font-size: 0.82rem;
  text-decoration: none;
  cursor: pointer;
}

.target-link-button:hover,
.target-expand-button:hover {
  border-color: var(--brand);
  color: var(--brand);
}

.targets-muted {
  color: var(--text-muted);
  font-size: 0.82rem;
}

.targets-detail-row td {
  background: var(--surface-muted);
}

.targets-detail {
  display: grid;
  gap: 6px;
  padding: 8px 4px 12px;
  font-size: 0.88rem;
}

.targets-detail p {
  margin: 0;
}

.targets-detail-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

@media (max-width: 900px) {
  .main-nav {
    flex-wrap: wrap;
  }

  .targets-table {
    min-width: 860px;
  }
}


/* QRPick user fit decision (separate from CRM sales_stage) */
.beta-test-badge {
  display: inline-flex;
  align-items: center;
  margin-left: 0.3em;
  padding: 0.08em 0.3em;
  border: 1px solid #9ec0e0;
  border-radius: 3px;
  background: #edf5fc;
  color: #2f5f8a;
  font-size: 0.37em;
  font-weight: 600;
  letter-spacing: 0.04em;
  line-height: 1.3;
  vertical-align: middle;
  white-space: nowrap;
  width: max-content;
  max-width: 100%;
}

.beta-test-badge-note {
  font-weight: 600;
}

.app-header h1 {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.55rem;
}

.kpi-footnote {
  margin: 6px 0 0;
  color: var(--text-muted, #6a7378);
  font-size: 0.72rem;
  font-weight: 400;
  line-height: 1.35;
  white-space: normal;
}

.kpi-footnote-inline {
  margin: 0 0 12px;
  padding: 0 2px;
  line-height: 1.35;
  white-space: normal;
  overflow: visible;
  text-overflow: unset;
}

.fit-exclusion-toast {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 80;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  max-width: min(420px, calc(100vw - 32px));
  margin: 0;
  padding: 12px 14px;
  border: 1px solid #c5d4e0;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 8px 24px rgba(20, 40, 60, 0.12);
  color: #243447;
}

.fit-exclusion-toast[hidden] {
  display: none !important;
}

.fit-exclusion-toast-message {
  margin: 0;
  flex: 1;
  font-size: 0.9rem;
  line-height: 1.45;
}

.fit-exclusion-toast-close {
  flex: 0 0 auto;
  margin: 0;
  padding: 2px 8px;
  border: 1px solid #c5d4e0;
  border-radius: 4px;
  background: #f7fafc;
  color: #35506a;
  font-size: 0.8rem;
  cursor: pointer;
}

.fit-exclusion-toast-close:hover {
  background: #eef4f8;
}

.fit-exclusion-toast-close:focus-visible {
  outline: 2px solid #4a90c8;
  outline-offset: 2px;
}

.interest-toast {
  position: fixed;
  left: 50%;
  bottom: 20px;
  z-index: 81;
  transform: translateX(-50%);
  max-width: min(420px, calc(100vw - 32px));
  margin: 0;
  padding: 10px 14px;
  border: 1px solid #c5d4e0;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 8px 24px rgba(20, 40, 60, 0.12);
  color: #243447;
}

.interest-toast[hidden] {
  display: none !important;
}

.interest-toast-message {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.45;
  text-align: center;
}

button.kpi-filter-card {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  margin: 0;
  padding: 10px 14px;
  text-align: left;
  font: inherit;
  color: var(--brand-dark);
  cursor: pointer;
  border: 1px solid #9ec4b8;
  border-radius: 8px;
  background: #eef8f4;
  box-shadow: none;
  transition: background-color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

button.kpi-filter-card .kpi-filter-card-label {
  display: block;
  margin: 0;
  color: var(--brand-dark);
  font-size: 0.78rem;
  font-weight: 650;
  line-height: 1.3;
}

button.kpi-filter-card strong {
  display: block;
  overflow: hidden;
  color: var(--brand-dark);
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
  text-overflow: ellipsis;
  white-space: nowrap;
}

button.kpi-filter-card:hover {
  background: #e3f4ee;
  border-color: var(--brand);
}

button.kpi-filter-card:focus-visible {
  outline: 2px solid #4a90c8;
  outline-offset: 2px;
  z-index: 1;
}

button.kpi-filter-card.is-active,
button.kpi-filter-card[aria-pressed="true"] {
  background: #d8eee6;
  border-color: var(--brand);
  box-shadow: inset 0 0 0 1px var(--brand);
}

.ledger-quick-filter-clear {
  margin: 0;
  padding: 3px 8px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 500;
  line-height: 1.3;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.ledger-quick-filter-clear:hover {
  background: transparent;
  border-color: transparent;
  color: var(--brand-dark);
}

.ledger-quick-filter-clear:focus-visible {
  outline: 2px solid #4a90c8;
  outline-offset: 2px;
}

@media (max-width: 720px) {
  .fit-exclusion-toast {
    left: 16px;
    right: 16px;
    bottom: 16px;
    max-width: none;
  }

  .beta-test-badge {
    margin-left: 0;
  }
}

.fit-decision-host {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border, #e4e4e4);
}

.fit-decision-heading-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 8px;
  margin: 0 0 10px;
}

.fit-decision-title {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.3;
}

.fit-decision-status-badge {
  display: inline-flex;
  align-items: center;
  box-sizing: border-box;
  margin: 0;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid #d0d0d0;
  background: #f7f7f7;
  color: #444;
  font-size: 0.76rem;
  font-weight: 600;
  line-height: 1.3;
  white-space: nowrap;
}

.fit-decision-status-badge.is-keep {
  border-color: #9bb8a4;
  background: #edf6f0;
  color: #2f5d45;
}

.fit-decision-status-badge.is-hold {
  border-color: #e0c48a;
  background: #fff7e8;
  color: #8a5a12;
}

.fit-decision-status-badge.is-excluded {
  border-color: #e0a0a0;
  background: #fbebeb;
  color: #8a1f1f;
}

.fit-decision-block {
  position: relative;
}

.fit-decision-feedback {
  box-sizing: border-box;
  position: absolute;
  left: 0;
  right: 0;
  top: -0.15rem;
  z-index: 2;
  min-height: 1.2rem;
  margin: 0;
  padding: 0 2px;
  font-size: 0.78rem;
  line-height: 1.25;
  pointer-events: none;
}

.fit-decision-feedback.is-empty {
  visibility: hidden;
  opacity: 0;
}

.fit-decision-feedback.is-success {
  display: none;
}

.fit-decision-feedback.is-error {
  color: #9b2c2c;
  visibility: visible;
  opacity: 1;
}

.fit-decision-controls {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  align-items: stretch;
}

.fit-decision-btn {
  position: relative;
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  width: 100%;
  min-width: 0;
  min-height: 2.1rem;
  border-radius: 6px;
  padding: 6px 4px;
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1.25;
  cursor: pointer;
  background: #fff;
  border: 1px solid #c8c8c8;
  color: #333;
  overflow: hidden;
}

.fit-decision-check {
  position: absolute;
  left: 4px;
  top: 50%;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 0.85rem;
  pointer-events: none;
  visibility: hidden;
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1;
}

.fit-decision-btn.is-selected .fit-decision-check {
  visibility: visible;
}

.fit-decision-label {
  display: block;
  min-width: 0;
  max-width: 100%;
  text-align: center;
  white-space: normal;
  overflow-wrap: break-word;
  word-break: keep-all;
}

.fit-decision-btn:hover:not(:disabled):not(.is-selected) {
  background: #f5f5f5;
}

.fit-decision-btn:disabled {
  cursor: wait;
  opacity: 0.65;
}

.fit-decision-block.is-saving .fit-decision-btn {
  opacity: 0.7;
}

.fit-decision-btn.is-selected[data-decision="KEEP"] {
  background: #e7f3ec;
  border-color: #6f9f82;
  border-width: 1px;
  color: #24553c;
  font-weight: 600;
}

.fit-decision-btn.is-selected[data-decision="HOLD"] {
  background: #fff1d6;
  border-color: #d4a017;
  border-width: 1px;
  color: #7a4e00;
  font-weight: 600;
}

.fit-decision-btn.is-selected[data-decision="USER_EXCLUDED"] {
  background: #f8eaea;
  border-color: #c45a5a;
  border-width: 1px;
  color: #8a1f1f;
  font-weight: 600;
}

.fit-exclusion-panel {
  box-sizing: border-box;
  min-height: 0;
  margin-top: 4px;
  display: grid;
  gap: 2px;
  align-content: start;
}

.fit-exclusion-panel.is-collapsed {
  display: none;
  margin-top: 0;
  min-height: 0;
}

.fit-decision-hint {
  margin: 4px 0 0;
  color: var(--text-muted, #666);
  font-size: 0.76rem;
  line-height: 1.35;
  max-width: 42rem;
}

.fit-excluded-meta {
  margin: 0;
  min-height: 0;
  font-size: 0.82rem;
  line-height: 1.3;
  color: var(--text-muted, #666);
}

.fit-decision-cancel[hidden] {
  display: none !important;
}

@media (max-width: 720px) {
  .fit-decision-controls {
    grid-template-columns: 1fr;
  }

  .fit-decision-btn {
    min-height: 2.6rem;
  }

  .fit-decision-status-badge {
    white-space: normal;
  }
}

.crm-secondary-button,
.crm-danger-button {
  border-radius: 6px;
  padding: 7px 12px;
  font-size: 0.85rem;
  cursor: pointer;
}

.crm-secondary-button {
  border: 1px solid #c8c8c8;
  background: #fff;
  color: #333;
}

.crm-danger-button {
  border: 1px solid #c45a5a;
  background: #f8eaea;
  color: #8a1f1f;
}

.fit-exclude-dialog-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(20, 20, 20, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 80;
  padding: 16px;
}

.fit-exclude-dialog {
  width: min(480px, 100%);
  background: #fff;
  border-radius: 10px;
  padding: 18px 18px 14px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.18);
}

.fit-exclude-dialog h3 {
  margin: 0 0 8px;
  font-size: 1.05rem;
}

.fit-exclude-dialog-desc {
  margin: 0 0 14px;
  color: #555;
  font-size: 0.9rem;
  line-height: 1.45;
}

.fit-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
  font-size: 0.85rem;
}

.fit-exclude-error {
  margin: 0 0 10px;
  color: #9b2c2c;
  font-size: 0.85rem;
}

.fit-exclude-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

/* Public channel: Internal CRM chrome stays hidden until /api/internal-session succeeds. */
html:not([data-crm-mode="internal"]) [data-internal-only] {
  display: none !important;
}

html:not([data-crm-mode="internal"]) .decision-matrix-table .col-title { width: 26%; }
html:not([data-crm-mode="internal"]) .decision-matrix-table .col-org { width: 16%; }
html:not([data-crm-mode="internal"]) .decision-matrix-table .col-summary { width: 21%; }
html:not([data-crm-mode="internal"]) .decision-matrix-table .col-review-points { width: 10%; }
html:not([data-crm-mode="internal"]) .decision-matrix-table .col-scope { width: 17%; }
html:not([data-crm-mode="internal"]) .decision-matrix-table .col-budget { width: 10%; }

html:not([data-crm-mode="internal"]) .card-star-wrapper,
html:not([data-crm-mode="internal"]) .detail-quick-star,
html:not([data-crm-mode="internal"]) .crm-sales-host,
html:not([data-crm-mode="internal"]) .star-cell {
  display: none !important;
}
