/* The deficiency view uses explicit conditions and readable lists, not geometry. */
.deficiency-view { margin-top: 64px; padding: clamp(24px, 4vw, 54px); border: 1px solid var(--line); border-radius: var(--radius-lg); background: rgba(255, 254, 250, .72); scroll-margin-top: 110px; }
.deficiency-view [hidden] { display: none !important; }
.deficiency-view :is(h2, h3, h4, h5, h6, p) { overflow-wrap: anywhere; }
.deficiency-view a { text-decoration: underline; text-underline-offset: 3px; text-decoration-color: #9bab99; }
.deficiency-view a:hover { text-decoration-color: currentColor; }
.deficiency-view :is(button, input, select, summary, a, textarea):focus-visible { outline: 3px solid var(--forest-2); outline-offset: 4px; }
.deficiency-view .tool-button { min-height: 44px; white-space: normal; text-align: center; }
.deficiency-view .tool-button:disabled { cursor: default; opacity: .55; }
.deficiency-heading { max-width: 940px; }
.deficiency-heading .eyebrow { margin-bottom: 12px; }
.deficiency-heading h2 { margin: 0 0 18px; font-size: clamp(29px, 3.5vw, 44px); letter-spacing: -.035em; line-height: 1.16; }
.deficiency-heading > p:last-child { margin: 0; color: var(--ink-soft); font-size: 16px; line-height: 1.75; }
.deficiency-notice { margin: 26px 0 20px; padding: 18px 22px; border-left: 4px solid var(--forest-2); border-radius: 0 12px 12px 0; background: #edf1e7; color: var(--ink-soft); font-size: 13px; }
.deficiency-notice > strong { color: var(--forest); }
.deficiency-notice p { margin: 7px 0 0; }
.deficiency-source-bar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 16px; padding: 18px 0 24px; border-bottom: 1px solid var(--line); }
.deficiency-source-bar > div { flex: 1 1 280px; min-width: 0; }
.deficiency-source-bar strong { display: block; font-size: 14px; overflow-wrap: anywhere; }
.deficiency-source-bar > div > span:last-child { color: var(--ink-soft); font-family: var(--font-mono); font-size: 11px; }
.deficiency-label { display: block; color: var(--ink-soft); font-size: 11px; font-weight: 750; letter-spacing: .03em; margin-bottom: 5px; }
.deficiency-controls { display: grid; grid-template-columns: minmax(250px, 1.6fr) minmax(180px, 1fr) minmax(160px, 1fr); gap: 16px; align-items: end; margin: 26px 0 14px; }
.deficiency-controls label { min-width: 0; font-size: 12px; font-weight: 700; }
.deficiency-controls :is(input, select) { display: block; width: 100%; min-height: 46px; margin-top: 8px; padding: 10px 12px; color: var(--ink); border: 1px solid var(--line-strong); border-radius: 10px; background: #fffefa; font-size: 14px; }
.deficiency-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.deficiency-copy-status { margin: 12px 0 0; color: var(--forest); font-size: 13px; }
.deficiency-copy-status:empty { margin: 0; }
.deficiency-count { margin: 22px 0 5px; color: var(--forest); font-family: var(--font-mono); font-size: 12px; }
.deficiency-search-note { margin: 0 0 24px; color: var(--ink-soft); font-size: 12px; }
.deficiency-empty, .deficiency-loading { padding: 26px; border: 1px dashed var(--line-strong); border-radius: 12px; background: #fffefa; }
.deficiency-scenarios { list-style: none; padding: 0; margin: 0; }
.deficiency-scenario { margin: 0; padding: 32px 0; border-top: 1px solid var(--line-strong); }
.deficiency-scenario:last-child { padding-bottom: 0; }
.deficiency-scenario-heading { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 16px; align-items: start; margin-bottom: 22px; }
.deficiency-scenario-number { display: grid; place-items: center; width: 42px; height: 42px; border: 1px solid #bdccb4; border-radius: 10px; background: #e9efdf; color: var(--forest); font-family: var(--font-mono); font-size: 14px; }
.deficiency-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 7px 15px; color: var(--ink-soft); font-size: 11px; }
.deficiency-kind { color: var(--forest); font-weight: 750; }
.deficiency-scenario-heading h3 { margin: 10px 0 0; font-size: clamp(21px, 2.5vw, 29px); letter-spacing: -.025em; line-height: 1.35; }
.deficiency-conflict-badge { padding: 4px 8px; color: #823c10; background: #ffebd9; border: 1px solid #e7aa75; border-radius: 5px; font-weight: 700; }
.deficiency-comparison { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border: 1px solid #cad1bd; border-radius: 14px; overflow: hidden; }
.deficiency-comparison > section { padding: 22px 24px; min-width: 0; }
.deficiency-normal { background: #eef3e7; }
.deficiency-change { background: #faf5e8; border-left: 1px solid #d5d6c5; }
.deficiency-view h4 { margin: 0 0 10px; color: var(--forest); font-size: 14px; }
.deficiency-prose { margin: 0 0 12px; white-space: pre-wrap; font-size: 14px; line-height: 1.75; color: var(--ink-soft); }
.deficiency-prose:last-child { margin-bottom: 0; }
.deficiency-prose-list { margin: 0; padding-left: 21px; }
.deficiency-prose-list > li + li { margin-top: 7px; }
.deficiency-scope { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; padding: 22px 0; }
.deficiency-scope h4 { font-size: 12px; }
.deficiency-scope .deficiency-prose { font-size: 13px; }
.deficiency-muted { color: var(--ink-soft); font-size: 12px; line-height: 1.65; margin: 8px 0; }
.deficiency-components { margin-bottom: 20px; padding: 13px 16px; background: #f1f0e8; border-radius: 10px; font-size: 13px; line-height: 2; }
.deficiency-entity { display: inline; padding: 0; border: 0; background: transparent; color: var(--forest); text-align: left; text-decoration: underline; text-decoration-color: #a3b5a0; text-underline-offset: 4px; font: inherit; font-weight: 700; overflow-wrap: anywhere; cursor: pointer; }
.deficiency-entity:hover { color: var(--forest-2); text-decoration-color: currentColor; }
.deficiency-separator { padding: 0 4px; color: var(--ink-faint); }
.deficiency-conflicts { margin-bottom: 22px; }
.deficiency-conflict { padding: 14px 18px; border: 1px solid #dfa475; border-left: 4px solid #d67530; border-radius: 10px; background: #fff0e0; color: #663817; font-size: 13px; }
.deficiency-conflict + .deficiency-conflict { margin-top: 10px; }
.deficiency-conflict > summary { cursor: pointer; font-weight: 750; }
.deficiency-conflict p { margin: 12px 0; white-space: pre-wrap; }
.deficiency-conflict a { text-decoration-color: #b96d38; font-weight: 650; }
.deficiency-conflict-sides { padding-left: 22px; }
.deficiency-conflict-sides > li { padding: 8px 0; }
.deficiency-conflict blockquote { margin: 10px 0; padding: 14px 16px; border-left: 3px solid #db985f; background: rgba(255, 255, 255, .6); white-space: pre-wrap; overflow-wrap: anywhere; font-size: 13px; }
.deficiency-step-heading { display: flex; align-items: baseline; flex-wrap: wrap; gap: 8px 18px; margin: 24px 0 4px; }
.deficiency-step-heading span { color: var(--ink-soft); font-size: 11px; }
.deficiency-steps { margin: 0; padding: 0; list-style: none; }
.deficiency-step { display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 12px; padding: 20px 0; border-top: 1px solid var(--line); scroll-margin-top: 100px; }
.deficiency-step-number { display: grid; place-items: center; align-self: start; min-height: 28px; border: 1px solid #cad1bd; border-radius: 50%; background: #f4f5ee; color: var(--forest); font-family: var(--font-mono); font-size: 12px; }
.deficiency-step-body { min-width: 0; }
.deficiency-step h5 { margin: 0 0 8px; font-size: 16px; line-height: 1.55; }
.deficiency-relationship { margin: 0 0 9px; font-size: 13px; line-height: 1.8; }
.deficiency-relationship > span { margin: 0 5px; color: var(--ink-soft); }
.deficiency-claim-details { margin-top: 12px; }
.deficiency-claim-details > summary, .deficiency-normal-claims > summary { width: fit-content; padding: 7px 0; color: var(--forest); font-size: 13px; font-weight: 700; cursor: pointer; }
.deficiency-detail-content { margin-top: 12px; padding: 0 22px 20px; background: #fffefa; border: 1px solid var(--line); border-radius: 12px; overflow-wrap: anywhere; }
.deficiency-detail-content > section { padding: 20px 0; }
.deficiency-detail-content > section + section { border-top: 1px solid var(--line); }
.deficiency-view h6 { margin: 0 0 12px; color: var(--forest); font-size: 13px; }
.deficiency-detail-content > section > strong { display: block; margin-bottom: 8px; font-size: 14px; }
.deficiency-facts { margin: 10px 0 16px; font-size: 12px; }
.deficiency-facts > div { display: grid; grid-template-columns: minmax(110px, 170px) minmax(0, 1fr); gap: 10px; padding: 8px 0; border-bottom: 1px solid #e9e6da; }
.deficiency-facts dt { color: var(--ink-soft); font-weight: 650; }
.deficiency-facts dd { margin: 0; overflow-wrap: anywhere; white-space: pre-wrap; }
.deficiency-facts dd .deficiency-prose { margin: 5px 0 0; font-size: 12px; }
.deficiency-participants { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; padding: 0; list-style: none; }
.deficiency-participants > li { padding: 14px; border: 1px solid #dde1d2; border-radius: 9px; background: #f3f5ed; font-size: 13px; min-width: 0; }
.deficiency-participants .deficiency-facts > div { grid-template-columns: minmax(80px, .7fr) minmax(0, 1fr); }
.deficiency-participants .deficiency-prose { font-size: 12px; }
.deficiency-evidence + .deficiency-evidence { margin-top: 24px; padding-top: 24px; border-top: 1px dashed var(--line-strong); }
.deficiency-evidence > h6 { color: var(--ink); font-size: 14px; margin-bottom: 8px; }
.deficiency-evidence-location { margin: 0 0 10px; color: var(--ink-soft); font-family: var(--font-mono); font-size: 11px; }
.deficiency-excerpt { margin: 14px 0 18px; padding: 18px; border-left: 3px solid #9eb38b; background: #f3f1e9; color: var(--ink); font-family: var(--font-sans); font-size: 13px; line-height: 1.8; white-space: pre-wrap; overflow-wrap: anywhere; }
.deficiency-evidence .deficiency-prose { font-size: 12px; }
.deficiency-provenance > summary, .deficiency-record > summary { width: fit-content; padding: 8px 0; color: var(--ink-soft); font-size: 12px; cursor: pointer; }
.deficiency-record > pre { padding: 16px; background: #f2f1e9; font-family: var(--font-mono); font-size: 11px; line-height: 1.6; white-space: pre-wrap; overflow-wrap: anywhere; }
.deficiency-relations { margin: 0; padding-left: 20px; font-size: 13px; }
.deficiency-relations > li + li { margin-top: 15px; }
.deficiency-relations p { margin: 7px 0; white-space: pre-wrap; }
.deficiency-normal-claims { padding: 12px 18px; border: 1px solid var(--line); border-radius: 12px; background: #f7f8f0; }
.deficiency-normal-claims > p { margin: 8px 0 16px; color: var(--ink-soft); font-size: 13px; }
.deficiency-scenario-footer { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 16px; margin-top: 18px; }
.deficiency-scenario-footer > span { font-size: 11px; color: var(--ink-soft); }
.deficiency-scenario-footer > .deficiency-copy-status { flex-basis: 100%; }
.deficiency-footer { margin: 30px 0 0; padding-top: 20px; border-top: 1px solid var(--line); max-width: 940px; font-size: 13px; color: var(--ink-soft); }
.deficiency-copy-dialog { width: min(800px, calc(100% - 32px)); max-height: calc(100dvh - 32px); padding: 24px; border: 1px solid var(--line); border-radius: 18px; background: #fffefa; color: var(--ink); box-shadow: var(--shadow); overflow: auto; }
.deficiency-copy-dialog::backdrop { background: rgba(20, 36, 31, .55); }
.deficiency-copy-dialog h3 { margin: 0 0 12px; font-size: 22px; }
.deficiency-copy-dialog p { color: var(--ink-soft); font-size: 14px; }
.deficiency-copy-dialog textarea { display: block; width: 100%; min-height: 220px; max-height: 50dvh; margin: 0 0 16px; padding: 14px; border: 1px solid var(--line-strong); border-radius: 8px; font-family: var(--font-mono); font-size: 12px; line-height: 1.6; resize: vertical; }

@media (max-width: 1000px) {
  .deficiency-controls { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .deficiency-search { grid-column: 1 / -1; }
  .deficiency-scope { grid-template-columns: 1fr; gap: 16px; }
  .deficiency-participants { grid-template-columns: 1fr; }
}

@media (max-width: 620px) {
  .deficiency-view { margin-top: 32px; padding: 24px 16px; scroll-margin-top: 160px; }
  .deficiency-heading h2 { font-size: 29px; }
  .deficiency-heading > p:last-child { font-size: 14px; }
  .deficiency-notice { padding: 15px; }
  .deficiency-source-bar .tool-button { width: 100%; }
  .deficiency-controls { grid-template-columns: minmax(0, 1fr); }
  .deficiency-actions > button { flex: 1 1 180px; }
  .deficiency-scenario-heading { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .deficiency-scenario-number { width: 36px; height: 32px; font-size: 12px; }
  .deficiency-comparison { grid-template-columns: minmax(0, 1fr); }
  .deficiency-comparison > section { padding: 18px; }
  .deficiency-change { border-left: 0; border-top: 1px solid #d5d6c5; }
  .deficiency-step { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .deficiency-step-number { width: 28px; }
  .deficiency-detail-content { padding: 0 12px 14px; }
  .deficiency-facts > div { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .deficiency-participants .deficiency-facts > div { grid-template-columns: minmax(0, 1fr); }
  .deficiency-conflict, .deficiency-normal-claims { padding: 12px; }
  .deficiency-excerpt { padding: 12px; }
  .deficiency-copy-dialog { padding: 20px 16px; }
}
