/* Owned by AssetWorkspaceShell. Keep every legacy rule inside this boundary.
 * Native CSS nesting scopes selector lists and responsive rules automatically.
 * Shared components and /components must not depend on this stylesheet.
 */
[data-goat-workspace] {
  & {
    --ink:#182233; --muted:#687487; --line:#dfe4eb; --panel:#fff; --canvas:#f4f6f9;
    --nav:#182237; --nav-hover:#26334b; --accent:#2457d6; --accent-hover:#1d48b5;
    --soft:#edf3ff; --success:#237a57; --warning:#9b6400; --shadow:0 18px 48px rgba(20,32,55,.18);
  }
  /* Catalog/profile share a workspace; operational controls never set its visual hierarchy. */
  .detail-grid:has(.catalog-explorer),
  .detail-grid:has(.catalog-relationship-explorer) {
    grid-template-columns: minmax(0, 1fr);
  }
  .catalog-explorer-grid {
    grid-template-columns: minmax(210px, 0.55fr) minmax(0, 2fr) !important;
  }
  .table-profile {
    background: var(--panel);
    padding: 18px;
    border-radius: 8px;
    min-width: 0;
    container-type: inline-size;
  }
  .table-bronze {
    min-width: 0;
    padding: 18px;
    border-radius: 8px;
    background: var(--panel);
    container-type: inline-size;
  }
  .bronze-layout {
    display: grid;
    grid-template-columns: minmax(190px, 0.42fr) minmax(0, 1.58fr);
    gap: 20px;
    margin-top: 18px;
  }
  .bronze-history {
    min-width: 0;
  }
  .bronze-history h3 {
    margin: 0 0 10px;
  }
  .bronze-history-item {
    display: grid;
    width: 100%;
    gap: 5px;
    padding: 11px 12px;
    border: 1px solid transparent;
    border-radius: 7px;
    background: transparent;
    color: var(--ink);
    text-align: left;
  }
  .bronze-history-item:hover,
  .bronze-history-item.selected {
    border-color: #c8d7f6;
    background: var(--soft);
  }
  .bronze-history-item > div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
  }
  .bronze-history-item > span {
    color: var(--muted);
    font-size: 12px;
  }
  .bronze-evidence {
    min-width: 0;
  }
  .bronze-batch-summary {
    display: grid;
    grid-template-columns: repeat(4, minmax(105px, 1fr));
    gap: 10px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    margin-bottom: 14px;
  }
  .bronze-batch-summary > div > div {
    margin-top: 2px;
    font-variant-numeric: tabular-nums;
    font-weight: 700;
  }
  .bronze-table-scroll {
    max-height: 620px;
    min-width: 0;
    overflow: auto;
    border: 1px solid var(--line);
    border-radius: 7px;
  }
  .bronze-table-scroll table {
    width: 100%;
    min-width: max-content;
    border-collapse: collapse;
  }
  .bronze-table-scroll th,
  .bronze-table-scroll td {
    max-width: 360px;
    padding: 10px 12px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: top;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
  }
  .bronze-table-scroll th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: #f8f9fb;
    color: var(--muted);
    font-size: 12px;
  }
  .bronze-table-scroll th code {
    display: block;
    margin-top: 3px;
    font-weight: 400;
  }
  .bronze-run-notice {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    border: 1px solid #bfd0ee;
    border-radius: 7px;
    margin: 14px 0;
    background: var(--soft);
  }
  .bronze-run-notice p {
    margin: 4px 0;
  }
  .catalog-status {
    display: inline-flex;
    padding: 2px 8px;
    border-radius: 999px;
    background: #eef2f6;
    color: #4d596a;
    font-size: 11px;
    font-weight: 750;
    white-space: nowrap;
  }
  .catalog-status.complete { background: #e9f7f0; color: var(--success); }
  .catalog-status.partial { background: #fff4dc; color: #825300; }
  .catalog-status.unknown { background: #eef2f6; color: #4d596a; }
  .table-bronze .profile-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 12px;
  }
  .profile-heading,
  .profile-measurement,
  .profile-run-row,
  .profile-bar-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
  }
  .profile-heading {
    margin-bottom: 18px;
  }
  .profile-heading h2 {
    margin: 0;
  }
  .profile-measurement {
    margin: 18px 0;
  }
  .table-profile select,
  .table-profile input,
  .profile-results input {
    font: inherit;
    border: 1px solid var(--line);
    border-radius: 5px;
    background: var(--panel);
    padding: 8px 10px;
    max-width: 100%;
  }
  .profile-results {
    min-width: 0;
  }
  .profile-results > p {
    color: var(--muted);
    margin: 8px 0;
  }
  .profile-results details {
    margin: 12px 0;
  }
  .profile-results .table-scroll {
    overflow: auto;
    min-width: 0;
  }
  .profile-results table {
    width: 100%;
    min-width: 0;
    border-collapse: collapse;
  }
  .profile-results th,
  .profile-results td {
    padding: 12px 8px;
    text-align: left;
    border-bottom: 1px solid var(--line);
    vertical-align: top;
  }
  .profile-results th {
    font-size: 12px;
    color: var(--muted);
    font-weight: 600;
  }
  .profile-results small {
    display: block;
    color: var(--muted);
  }
  .profile-results td {
    font-variant-numeric: tabular-nums;
  }
  .profile-results tr.selected {
    background: var(--soft);
  }
  .profile-results td .button {
    padding: 0;
    min-height: 32px;
    white-space: normal;
    text-align: left;
  }
  .profile-results button:not(.button),
  .profile-operations button:not(.button) {
    font: inherit;
    padding: 7px 11px;
    border: 1px solid var(--line);
    border-radius: 5px;
    background: var(--panel);
    color: var(--ink);
  }
  .profile-fields-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(230px, 0.7fr);
    gap: 22px;
    margin: 16px 0;
  }
  .profile-field-inspector {
    min-width: 0;
    border-left: 1px solid var(--line);
    padding-left: 20px;
    overflow-wrap: anywhere;
  }
  .profile-field-inspector section {
    margin: 20px 0;
  }
  .profile-field-inspector h4 {
    margin: 0 0 10px;
  }
  .profile-field-inspector p {
    margin: 8px 0;
  }
  .profile-bar {
    margin: 12px 0;
  }
  .profile-bar-label {
    font-size: 12px;
    align-items: start;
    gap: 8px;
  }
  .profile-bar-label span:first-child {
    overflow-wrap: anywhere;
    min-width: 0;
    flex: 1;
  }
  .profile-bar-track {
    height: 7px;
    background: #e6ebf5;
    margin-top: 5px;
    border-radius: 2px;
  }
  .profile-bar-track > div {
    height: 7px;
    background: #6888d6;
    border-radius: 2px;
  }
  .profile-quartiles {
    height: 46px;
    position: relative;
    margin: 12px 4px;
  }
  .profile-range {
    position: absolute;
    top: 23px;
    left: 0;
    right: 0;
    height: 1px;
    background: var(--muted);
  }
  .profile-quartile-box {
    position: absolute;
    top: 11px;
    height: 24px;
    background: #dce7ff;
    border: 1px solid #7791c9;
  }
  .profile-median {
    position: absolute;
    top: 11px;
    height: 24px;
    width: 2px;
    background: var(--accent);
  }
  .profile-warning {
    padding: 12px 14px;
    border-left: 3px solid var(--warning);
    background: #fff7e8;
    font-size: 13px;
    margin: 12px 0;
  }
  .profile-empty {
    padding: 35px 10px;
  }
  .profile-empty p {
    color: var(--muted);
  }
  .profile-config {
    padding: 20px;
    border: 1px solid var(--line);
    border-radius: 8px;
    margin-top: 20px;
    background: var(--soft);
  }
  .profile-config label {
    display: block;
    margin: 15px 0;
  }
  .profile-config label select,
  .profile-config label input {
    display: block;
    margin-top: 6px;
  }
  .profile-population {
    border: 0;
    padding: 0;
    margin: 16px 0;
    min-width: 0;
  }
  .profile-population legend {
    font-weight: 600;
  }
  .profile-population label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 8px 0;
  }
  .profile-population input[type="radio"] {
    display: inline-block;
    width: auto;
    flex: none;
    margin: 0;
  }
  .profile-run-row {
    padding: 14px 0;
    border-bottom: 1px solid var(--line);
  }
  .profile-run-row details {
    width: 100%;
  }
  .profile-operations {
    padding: 15px;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
  }
  .profile-operations > summary {
    cursor: pointer;
    color: var(--muted);
  }
  .table-profile > details {
    margin-top: 24px;
  }
  .table-profile summary,
  .profile-results summary {
    cursor: pointer;
    color: var(--muted);
  }
  @media (max-width: 1250px) {
    .profile-fields-grid {
      grid-template-columns: 1fr;
    }
    .profile-field-inspector {
      border-left: 0;
      border-top: 1px solid var(--line);
      padding: 18px 0;
    }
  }
  @container (max-width:1000px) {
    .profile-fields-grid {
      grid-template-columns: 1fr;
    }
    .profile-field-inspector {
      border-left: 0;
      border-top: 1px solid var(--line);
      padding: 18px 0;
    }
  }
  @container (max-width:520px) {
    .profile-field-table thead {
      position: absolute;
      width: 1px;
      height: 1px;
      overflow: hidden;
      clip-path: inset(50%);
    }
    .profile-field-table tbody {
      display: block;
    }
    .profile-field-table tr {
      display: grid;
      grid-template-columns: 1fr 1fr;
      border-bottom: 1px solid var(--line);
    }
    .profile-field-table td {
      border: 0;
      min-width: 0;
      overflow-wrap: anywhere;
    }
    .profile-field-table td:first-child,
    .profile-field-table td:last-child {
      grid-column: 1/-1;
    }
    .profile-field-table td[data-label]::before {
      content: attr(data-label);
      display: block;
      color: var(--muted);
      font-size: 11px;
      margin-bottom: 3px;
    }
  }
  @container (max-width:850px) {
    .bronze-layout { grid-template-columns: minmax(0, 1fr); }
    .bronze-history { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 6px; }
    .bronze-history h3 { grid-column: 1/-1; }
    .bronze-batch-summary { grid-template-columns: repeat(2, minmax(105px, 1fr)); }
  }
  @container (max-width:480px) {
    .bronze-batch-summary { grid-template-columns: minmax(0, 1fr); }
    .bronze-run-notice { align-items: stretch; flex-direction: column; }
  }
  @media (max-width: 850px) {
    .catalog-explorer-grid {
      grid-template-columns: 1fr !important;
    }
    .table-profile {
      padding: 12px;
    }
    .table-bronze {
      padding: 12px;
    }
    .profile-heading {
      align-items: start;
    }
    .profile-results input {
      font-size: 16px;
    }
  }
  &, * { box-sizing:border-box; }
  & { margin:0; min-height:100%; background:var(--canvas); }
  & { color:var(--ink); font:14px/1.45 Inter,ui-sans-serif,system-ui,-apple-system,Segoe UI,sans-serif; }
  button,input,select,textarea { font:inherit; }
  button { cursor:pointer; }
  .app { position:fixed; inset:0; overflow:auto; min-height:100vh; display:grid; grid-template-columns:232px minmax(0,1fr); background:var(--canvas); }
  .sidebar { position:sticky; top:0; height:100vh; padding:22px 14px; color:#fff; background:var(--nav); }
  .brand { display:flex; align-items:center; gap:10px; padding:0 10px 22px; font-weight:760; letter-spacing:-.01em; }
  .brand-mark { width:30px; height:30px; display:grid; place-items:center; border-radius:8px; background:#82a7ff; color:#13203a; font-weight:850; }
  .nav-label { margin:18px 10px 7px; color:#96a4ba; font-size:11px; font-weight:700; letter-spacing:.09em; text-transform:uppercase; }
  .nav-item { width:100%; display:flex; align-items:center; gap:10px; padding:10px 12px; border:0; border-radius:7px; color:#d8deea; background:transparent; text-align:left; }
  .nav-item:hover { background:var(--nav-hover); }
  .nav-item.active { color:#fff; background:#31405d; font-weight:700; }
  .nav-item.provisional { color:#8794aa; cursor:default; }
  .nav-icon { width:19px; text-align:center; opacity:.85; }
  .workspace { min-width:0; }
  .topbar { height:64px; display:flex; align-items:center; justify-content:space-between; padding:0 28px; border-bottom:1px solid var(--line); background:#fff; }
  .crumbs { color:var(--muted); font-size:13px; }
  .crumbs strong { color:var(--ink); }
  .avatar { width:34px; height:34px; display:grid; place-items:center; border-radius:50%; background:#dce6ff; color:#244a9b; font-weight:750; }
  main { padding:30px; }
  .page { max-width:1480px; margin:0 auto; }
  .page-header { display:flex; align-items:flex-start; justify-content:space-between; gap:20px; margin-bottom:22px; }
  .action-row { display:flex; flex-wrap:wrap; gap:8px; }
  h1,h2,h3,p { margin-top:0; }
  h1 { margin-bottom:6px; font-size:28px; letter-spacing:-.025em; }
  h2 { margin-bottom:5px; font-size:20px; }
  h3 { margin-bottom:12px; font-size:14px; }
  .subtle { color:var(--muted); }
  .button { display:inline-flex; align-items:center; justify-content:center; gap:7px; min-height:38px; padding:8px 14px; border:1px solid var(--line); border-radius:7px; background:#fff; color:var(--ink); font-weight:680; }
  .button:hover { background:#f7f8fa; }
  .button.primary { border-color:var(--accent); background:var(--accent); color:#fff; }
  .button.primary:hover { background:var(--accent-hover); }
  .button.link { min-height:auto; padding:0; border:0; color:var(--accent); background:transparent; }
  .button.warning { color:#915500; }
  .button.danger { border-color:#a52d2d; background:#a52d2d; color:#fff; }
  .button.danger:hover { background:#842424; }
  .button:disabled { cursor:not-allowed; opacity:.48; }
  .toolbar { display:grid; grid-template-columns:minmax(260px,1fr) 190px 190px auto; gap:10px; margin-bottom:14px; }
  .control { width:100%; min-height:40px; padding:9px 11px; border:1px solid #cfd6e0; border-radius:7px; background:#fff; color:var(--ink); }
  .control:focus { outline:3px solid rgba(36,87,214,.15); border-color:var(--accent); }
  textarea.control { min-height:86px; resize:vertical; }
  .search-wrap { position:relative; }
  .search-wrap .control { padding-left:36px; }
  .search-icon { position:absolute; left:12px; top:10px; color:var(--muted); }
  .check { display:flex; align-items:center; gap:8px; padding:0 8px; color:var(--muted); white-space:nowrap; }
  .table-card { overflow:hidden; border:1px solid var(--line); border-radius:10px; background:#fff; box-shadow:0 1px 2px rgba(16,24,40,.03); }
  .table-meta { display:flex; justify-content:space-between; padding:12px 16px; border-bottom:1px solid var(--line); color:var(--muted); font-size:12px; }
  .collection-page-actions { display:flex; justify-content:flex-end; gap:8px; padding:12px 16px; border-top:1px solid var(--line); }
  .table-scroll { overflow:auto; }
  table { width:100%; min-width:1120px; border-collapse:collapse; }
  th { padding:11px 14px; color:#586579; background:#f8f9fb; border-bottom:1px solid var(--line); font-size:11px; letter-spacing:.035em; text-align:left; text-transform:uppercase; white-space:nowrap; }
  td { padding:14px; border-bottom:1px solid #edf0f4; vertical-align:top; }
  tbody tr:hover { background:#f7f9fc; }
  tbody tr:last-child td { border-bottom:0; }
  .name-button { padding:0; border:0; background:none; color:var(--accent); font-weight:720; text-align:left; }
  .description { max-width:330px; color:#505d70; }
  .status { display:inline-flex; align-items:center; gap:6px; padding:3px 8px; border-radius:999px; background:#eef2f6; color:#4d596a; font-size:12px; font-weight:700; white-space:nowrap; }
  .status::before { width:6px; height:6px; border-radius:50%; background:#8190a5; content:""; }
  .status.approved { background:#e9f7f0; color:#176644; }
  .status.approved::before { background:#2b8a62; }
  .status.change { background:#fff4dc; color:#825300; }
  .status.change::before { background:#b47700; }
  .status.inactive { background:#fff1d8; color:#855000; }
  .status.inactive::before { background:#b47700; }
  .empty { padding:56px 20px; text-align:center; color:var(--muted); }
  .overlay { position:fixed; inset:0; z-index:20; background:rgba(19,29,47,.36); }
  .crosswalk-decision-backdrop { z-index:39; }
  .decision-dialog { position:fixed; top:50%; left:50%; z-index:40; width:min(540px,calc(100vw - 28px)); max-height:calc(100vh - 36px); display:grid; grid-template-rows:auto minmax(0,1fr) auto; transform:translate(-50%,-50%); border:1px solid var(--line); border-radius:12px; background:#fff; box-shadow:var(--shadow); }
  .decision-dialog-head { display:flex; justify-content:space-between; gap:18px; padding:20px 22px; border-bottom:1px solid var(--line); }
  .decision-dialog-head h2,.decision-dialog-head p { margin:0; }
  .decision-dialog-head p { margin-top:5px; color:var(--muted); }
  .decision-dialog-body { display:grid; gap:15px; overflow-y:auto; padding:20px 22px; }
  .decision-dialog-foot { display:flex; justify-content:flex-end; gap:10px; padding:14px 22px; border-top:1px solid var(--line); background:#fafbfc; }
  .drawer { position:fixed; top:0; right:0; z-index:21; width:min(570px,100vw); height:100vh; display:grid; grid-template-rows:auto 1fr auto; background:#fff; box-shadow:var(--shadow); }
  .drawer.wide { width:min(680px,100vw); }
  .drawer-head { display:flex; justify-content:space-between; gap:18px; padding:22px 24px; border-bottom:1px solid var(--line); }
  .drawer-head p { margin:0; color:var(--muted); }
  .icon-button { width:34px; height:34px; border:1px solid var(--line); border-radius:7px; background:#fff; color:#59667a; font-size:20px; }
  .drawer-body { overflow-y:auto; padding:22px 24px 34px; }
  .drawer-foot { display:flex; justify-content:flex-end; gap:10px; padding:15px 24px; border-top:1px solid var(--line); background:#fafbfc; }
  .section { padding-bottom:22px; margin-bottom:22px; border-bottom:1px solid var(--line); }
  .section:last-child { border-bottom:0; }
  .section-kicker { margin-bottom:4px; color:var(--muted); font-size:11px; font-weight:760; letter-spacing:.08em; text-transform:uppercase; }
  .field-grid { display:grid; grid-template-columns:1fr 1fr; gap:15px; }
  .field-grid.three { grid-template-columns:2fr 1fr 1.5fr; }
  .field { display:grid; gap:6px; }
  .field.full { grid-column:1/-1; }
  .field label,.field-label { font-size:12px; font-weight:720; }
  .field label>.control { display:block; margin-top:6px; font-size:14px; font-weight:400; }
  .required::after { color:#b43a3a; content:" *"; }
  .read-only { background:#f4f6f8; color:#59667a; }
  .help { color:var(--muted); font-size:12px; }
  .callout { margin:12px 0; padding:12px 14px; border:1px solid #cad6ec; border-radius:8px; background:#f5f8ff; color:#33435d; }
  .callout > :last-child { margin-bottom:0; }
  .callout.error { border-color:#e5b9b9; background:#fff4f4; color:#8d2929; }
  .callout.success { border-color:#b9dbc5; background:#f2fbf5; color:#21653a; }
  .operation-feedback { margin-bottom:14px; }
  .operation-feedback h3 { margin:0 0 6px; }
  .operation-feedback p { margin:4px 0; }
  .callout.success { border-color:#acd8c5; background:#effaf5; color:#176644; }
  .callout.warning { border-color:#e3ca91; background:#fff8e7; color:#765000; }
  .definition-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px 18px; margin:14px 0; }
  .definition-grid > div { display:grid; grid-template-columns:120px minmax(0,1fr); gap:10px; overflow-wrap:anywhere; }
  .definition-grid .term { color:var(--muted); }
  .drawer.wide.reference-set-import { width:min(1040px,100vw); grid-template-rows:auto auto minmax(0,1fr) auto; }
  .set-import-steps { display:flex; flex-wrap:wrap; gap:20px; padding:16px 24px; border-bottom:1px solid var(--line); }
  .set-import-steps .selected { font-weight:700; color:var(--brand); }
  .reference-set-import [hidden] { display:none; }
  .reference-set-import table { min-width:720px; }
  .reference-set-import td { max-width:320px; overflow-wrap:anywhere; }
  .reference-scalar { white-space:pre-wrap; overflow-wrap:anywhere; }
  .reference-set-import .field-grid { align-items:start; }
  .reference-set-import .field { align-content:start; }
  .set-steward-field { position:relative; }
  .set-steward-combo { display:flex; }
  .set-steward-combo input { flex:1; min-width:0; }
  .set-steward-options { position:absolute; top:100%; left:0; right:0; z-index:10; max-height:280px; overflow:auto; background:white; border:1px solid var(--line); box-shadow:0 6px 18px #0002; }
  .set-steward-options > button { display:block; width:100%; padding:10px 12px; border:0; background:white; text-align:left; cursor:pointer; }
  .set-steward-options > button:hover,.set-steward-options > button:focus { background:#eef4ff; }
  .column-overrides { display:grid; grid-template-columns:repeat(auto-fit,minmax(210px,1fr)); gap:12px; margin:14px 0; }
  .preview-table { max-height:420px; border:1px solid var(--line); border-radius:8px; }
  .preview-table table { width:max-content; min-width:100%; }
  .preview-table td { max-width:280px; overflow-wrap:anywhere; }
  .issue-field .control { border-color:#b83b3b; outline:3px solid rgba(184,59,59,.12); }
  .issue-cell { background:#fff0f0; box-shadow:inset 0 0 0 2px #c54646; }
  .generated-link { display:flex; flex-wrap:wrap; align-items:center; gap:10px; }
  .generation-evidence { overflow-wrap:anywhere; }
  [data-projection-state="absent_in_set"] { background:#fff8e7; color:#765000; }
  [data-projection-state="pending"],
  [data-projection-state="unmapped"] { background:#fff4f4; color:#8d2929; }
  [data-projection-state="not_applicable"],
  [data-projection-state="excluded"],
  [data-projection-state="obsolete"] { background:#f3f5f8; color:#59667a; }
  .connection { padding:17px; border:1px solid #cfd9ee; border-radius:9px; background:#f7f9ff; }
  .connection-head { display:flex; align-items:flex-start; justify-content:space-between; gap:16px; margin-bottom:16px; }
  .preview { margin-top:15px; padding:11px 12px; border:1px solid #d6dce6; border-radius:7px; background:#202b3e; color:#dce6f6; font:12px/1.55 ui-monospace,SFMono-Regular,Consolas,monospace; overflow-wrap:anywhere; }
  .preview-label { display:block; margin-bottom:5px; color:#9eabc1; font:700 10px/1.3 Inter,ui-sans-serif,system-ui; letter-spacing:.08em; text-transform:uppercase; }
  .detail-grid { display:grid; grid-template-columns:minmax(0,2fr) minmax(270px,1fr); gap:18px; }
  .detail-stack { min-width:0; display:grid; gap:18px; }
  .card { min-width:0; padding:20px; border:1px solid var(--line); border-radius:10px; background:#fff; }
  .definition-list { display:grid; grid-template-columns:175px 1fr; gap:11px 18px; margin:0; }
  .definition-list dt,.definition-term { color:var(--muted); }
  .definition-list dd,.definition-value { margin:0; font-weight:620; }
  .section-nav { display:flex; gap:4px; margin-bottom:18px; padding:5px; border:1px solid var(--line); border-radius:9px; background:#fff; overflow:auto; }
  .section-nav button { padding:8px 12px; border:0; border-radius:6px; background:transparent; color:var(--muted); font-weight:650; white-space:nowrap; }
  .section-nav button.active { background:var(--soft); color:var(--accent); }
  .connection-state { display:inline-flex; align-items:center; gap:7px; color:var(--success); font-weight:720; }
  .connection-state::before { width:8px; height:8px; border-radius:50%; background:#2f9a6e; content:""; }
  .catalog-card-head { display:flex; align-items:flex-start; justify-content:space-between; gap:18px; }
  .catalog-card-head h3 { margin-bottom:4px; font-size:18px; }
  .catalog-card-head p { margin-bottom:0; }
  .catalog-empty { margin:18px 0 0; padding:22px; border:1px dashed #cfd6e0; border-radius:8px; color:var(--muted); text-align:center; }
  .catalog-job-list { display:grid; gap:10px; margin-top:18px; }
  .catalog-job-row { display:flex; align-items:flex-start; justify-content:space-between; gap:18px; padding:15px; border:1px solid var(--line); border-radius:8px; }
  .catalog-job-main { min-width:0; }
  .catalog-job-name { display:block; margin-bottom:3px; font-weight:760; }
  .catalog-job-main .subtle { margin-bottom:9px; }
  .catalog-run-detail { margin:7px 0 0; color:var(--muted); font-size:12px; overflow-wrap:anywhere; }
  .catalog-structure-search { display:flex; gap:10px; align-items:center; margin:14px 0 8px; }
  .catalog-structure-search .control { max-width:420px; }
  .catalog-structure-table td { vertical-align:top; }
  .catalog-explorer { min-width:0; }
  .catalog-outcome-pin { padding:5px 9px; border-radius:999px; background:var(--soft); color:var(--accent); font-size:12px; font-weight:720; white-space:nowrap; }
  .catalog-explorer-grid { display:grid; grid-template-columns:minmax(280px,.85fr) minmax(0,1.65fr); gap:16px; margin-top:16px; }
  .catalog-tree-panel,.catalog-inspector { min-width:0; min-height:250px; padding:15px; border:1px solid var(--line); border-radius:8px; background:#fbfcfe; }
  .catalog-tree-item { margin-left:calc(var(--catalog-tree-depth) * 17px); }
  .catalog-tree-row { display:grid; grid-template-columns:28px minmax(0,1fr); align-items:stretch; border-radius:6px; }
  .catalog-tree-item.selected>.catalog-tree-row { background:var(--soft); }
  .catalog-tree-toggle,.catalog-tree-spacer { width:28px; min-height:38px; display:grid; place-items:center; padding:0; border:0; background:transparent; color:var(--muted); }
  .catalog-tree-select { min-width:0; display:grid; grid-template-columns:minmax(0,1fr) auto; gap:2px 10px; padding:8px; border:0; background:transparent; color:var(--ink); text-align:left; }
  .catalog-tree-select > span:first-child {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .catalog-tree-select:hover,.catalog-tree-toggle:hover { color:var(--accent); }
  .catalog-tree-item:focus-visible,.catalog-tree-select:focus-visible,.catalog-tree-toggle:focus-visible,.catalog-search-reveal:focus-visible { outline:3px solid rgba(36,87,214,.2); outline-offset:-2px; }
  .catalog-tree-kind { color:var(--muted); font-size:11px; text-transform:uppercase; }
  .catalog-tree-count { grid-column:1/-1; color:var(--muted); font-size:11px; }
  .catalog-search-results { max-height:270px; overflow:auto; padding:10px; border:1px solid var(--line); border-radius:8px; background:#fafbfc; }
  .catalog-search-result { width:100%; display:flex; align-items:center; justify-content:space-between; gap:12px; padding:4px; border:0; border-radius:6px; background:transparent; text-align:left; }
  .catalog-search-result:hover { background:var(--soft); }
  .catalog-search-reveal { min-width:0; flex:1; display:grid; grid-template-columns:minmax(0,1fr) auto; gap:2px 12px; padding:7px 6px; border:0; background:transparent; color:var(--ink); text-align:left; }
  .catalog-search-reveal:disabled { cursor:not-allowed; opacity:.58; }
  .catalog-search-result-name { font-weight:720; }
  .catalog-search-result-evidence { grid-column:1/-1; color:var(--muted); font-size:11px; }
  .catalog-search-asset { flex:0 0 auto; }
  .catalog-evidence-badge { display:inline-flex; align-items:center; width:max-content; padding:2px 6px; border:1px solid #b8c5d8; border-radius:999px; background:#f6f8fc; color:#44536a; font-size:10px; font-weight:700; }
  .catalog-evidence-badge.carried-forward { border-style:dashed; border-color:#b98a49; background:#fff8e9; color:#80551b; }
  .catalog-qualified-path,.catalog-member-path { overflow-wrap:anywhere; font-family:ui-monospace,SFMono-Regular,Consolas,monospace; font-size:12px; }
  .catalog-inspector .definition-list { grid-template-columns:120px minmax(0,1fr); }
  .catalog-native-metadata { margin-top:14px; min-width:0; }
  .catalog-native-document { margin-top:5px; padding:10px 12px; max-height:240px; overflow:auto; border:1px solid var(--line); border-radius:8px; background:var(--canvas); font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace; font-size:.82rem; line-height:1.45; white-space:pre-wrap; overflow-wrap:anywhere; }
  .catalog-member-heading { margin-top:22px; padding-top:16px; border-top:1px solid var(--line); }
  .catalog-member-table table { min-width:760px; }
  .catalog-member-table td { padding:10px; }
  .catalog-page-controls { display:flex; align-items:center; justify-content:flex-end; gap:12px; margin-top:10px; color:var(--muted); font-size:12px; }
  .catalog-view-selector { display:flex; gap:8px; margin-bottom:10px; }
  .relationship-context { display:flex; align-items:flex-start; justify-content:space-between; gap:18px; margin:16px 0 10px; }
  .relationship-context h3 { margin-bottom:4px; font-size:18px; }
  .relationship-diagram-shell { min-width:0; }
  .relationship-diagram-toolbar { display:flex; flex-wrap:wrap; align-items:center; gap:6px; margin:12px 0 6px; }
  .relationship-diagram-toolbar .button { min-width:38px; min-height:34px; padding:6px 10px; }
  .relationship-zoom { min-width:48px; color:var(--muted); font-variant-numeric:tabular-nums; text-align:center; }
  .relationship-diagram-viewport { position:relative; width:100%; height:540px; overflow:hidden; cursor:grab; touch-action:none; border:1px solid var(--line); border-radius:9px; background-color:#f8faff; background-image:radial-gradient(#d8dfeb 1px,transparent 1px); background-size:20px 20px; }
  .relationship-diagram-viewport:active { cursor:grabbing; }
  .relationship-diagram-viewport:focus-visible { outline:3px solid rgba(36,87,214,.2); outline-offset:2px; }
  .relationship-diagram-stage { position:absolute; left:0; top:0; transform-origin:0 0; transition:transform .12s ease-out; }
  .relationship-graph-node { position:absolute; z-index:5; width:200px; transform:translate(-50%,-50%); }
  .relationship-relation-card { width:100%; display:grid; gap:4px; padding:13px; border:1px solid #aebbd0; border-radius:9px; background:#fff; color:var(--ink); box-shadow:0 3px 10px rgba(32,48,74,.1); text-align:left; }
  .relationship-relation-card.center { border:2px solid var(--accent); background:#eef3ff; cursor:default; }
  .relationship-relation-name { font-weight:780; }
  .relationship-relation-card .subtle { overflow:hidden; font:10px/1.35 ui-monospace,SFMono-Regular,Consolas,monospace; text-overflow:ellipsis; white-space:nowrap; }
  .relationship-primary-key { color:#526076; font-size:11px; }
  .relationship-graph-line { position:absolute; z-index:1; height:2px; background:#5172b5; transform-origin:0 50%; pointer-events:none; }
  .relationship-graph-line::after { position:absolute; right:-1px; top:-4px; width:0; height:0; border-top:5px solid transparent; border-bottom:5px solid transparent; border-left:8px solid #5172b5; content:""; }
  .relationship-graph-line.carried-forward { height:0; border-top:2px dashed #9b6f2f; background:transparent; }
  .relationship-edge-label { position:absolute; z-index:4; max-width:180px; padding:4px 7px; border:1px solid #bcc8db; border-radius:999px; background:#fff; color:#30476f; font-size:10px; font-weight:700; overflow:hidden; text-overflow:ellipsis; transform:translate(-50%,-50%); white-space:nowrap; }
  .relationship-edge-label.carried-forward { border-style:dashed; border-color:#b98a49; background:#fff8e9; color:#80551b; }
  .relationship-self-loop { position:absolute; z-index:4; width:155px; min-height:42px; padding:5px 9px; border:2px solid #5172b5; border-radius:50%; background:#fff; color:#30476f; font-size:10px; font-weight:700; }
  .relationship-self-loop.carried-forward { border-style:dashed; border-color:#b98a49; background:#fff8e9; }
  .relationship-minimap { position:absolute; right:12px; top:12px; z-index:6; width:170px; height:100px; border:1px solid #aebbd0; border-radius:7px; background:rgba(255,255,255,.9); box-shadow:0 2px 8px rgba(32,48,74,.12); cursor:crosshair; }
  .relationship-minimap-node { position:absolute; width:7px; height:7px; border-radius:2px; background:#6d7c93; transform:translate(-50%,-50%); pointer-events:none; }
  .relationship-minimap-node.center { width:10px; height:10px; background:var(--accent); }
  .relationship-minimap-viewport { position:absolute; box-sizing:border-box; border:2px solid var(--accent); background:rgba(36,87,214,.08); pointer-events:none; }
  .relationship-edge-inspector { margin-top:12px; padding:15px; border:1px solid var(--line); border-radius:8px; background:#fbfcfe; }
  .relationship-edge-inspector .definition-list { grid-template-columns:125px minmax(0,1fr); }
  .relationship-inspector-endpoints { display:flex; flex-wrap:wrap; align-items:center; gap:8px; margin:14px 0; }
  .relationship-participant { margin:5px 0; font-family:ui-monospace,SFMono-Regular,Consolas,monospace; font-size:12px; }
  .relationship-table table { min-width:1320px; }
  .relationship-table td { padding:11px; }
  .relationship-table tr.carried-forward td { background:#fffaf0; }
  .catalog-comparison-controls { display:grid; gap:12px; margin:18px 0; padding:14px; border:1px solid var(--line); border-radius:8px; background:#fafbfc; }
  .catalog-comparison-baseline { display:grid; grid-template-columns:120px minmax(240px,1fr) auto; align-items:center; gap:10px; }
  .catalog-comparison-filter-row { display:flex; flex-wrap:wrap; align-items:center; gap:8px; }
  .catalog-comparison-filter-row>.control { width:auto; min-width:190px; }
  .catalog-comparison-filter-row>input.control { flex:1 1 330px; }
  .catalog-comparison-counts { display:grid; grid-template-columns:repeat(5,minmax(105px,1fr)); gap:8px; margin:16px 0 8px; }
  .catalog-comparison-count { display:grid; gap:2px; padding:11px 12px; border:1px solid var(--line); border-radius:8px; background:#fff; }
  .catalog-comparison-count-value { font-size:20px; font-weight:780; font-variant-numeric:tabular-nums; }
  .catalog-comparison-authority { margin:9px 0; }
  .catalog-comparison-table table { min-width:1080px; }
  .catalog-comparison-table td { padding:11px; }
  .catalog-comparison-table tr.selected td { background:var(--soft); }
  .catalog-empty-filter { padding:18px; text-align:center; }
  .catalog-finding { display:inline-flex; padding:3px 7px; border-radius:999px; background:#edf1f5; color:#4f5b6c; font-size:11px; font-weight:720; white-space:nowrap; }
  .catalog-finding.new { background:#e8f6ef; color:#176644; }
  .catalog-finding.observed-source-metadata-changed,.catalog-finding.type-changed,.catalog-finding.interpretation-changed,.catalog-finding.structure-changed { background:#fff0d2; color:#7d5100; }
  .catalog-finding.inaccessible-or-unknown,.catalog-finding.not-observed { background:#f8e9ea; color:#8a3039; }
  .catalog-comparison-inspector { margin-top:18px; padding:17px; border:1px solid #b9c8e2; border-radius:9px; background:#f8faff; scroll-margin-top:18px; }
  .catalog-comparison-inspector>.definition-list { grid-template-columns:180px minmax(0,1fr); }
  .catalog-connected-assets { display:flex; flex-wrap:wrap; align-items:center; gap:10px; margin:15px 0; }
  .catalog-comparison-sides { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; margin-top:16px; }
  .catalog-comparison-side { min-width:0; padding:14px; border:1px solid var(--line); border-radius:8px; background:#fff; }
  .catalog-comparison-side .definition-list { grid-template-columns:135px minmax(0,1fr); }
  .catalog-comparison-side .definition-value { overflow-wrap:anywhere; }
  .review-note { margin-top:14px; color:#7a8494; font-size:11px; }
  .toast { position:fixed; right:24px; bottom:24px; z-index:30; max-width:420px; padding:13px 16px; border-radius:8px; background:#173f32; color:#fff; box-shadow:var(--shadow); }
  .toast.error-toast { background:#8f2430; }
  .login-page { min-height:100vh; display:grid; place-items:center; padding:24px; background:linear-gradient(135deg,#eef3ff,#f7f9fc 55%,#edf7f3); }
  .login-card { width:min(430px,100%); display:grid; gap:16px; padding:34px; border:1px solid var(--line); border-radius:14px; background:#fff; box-shadow:var(--shadow); }
  .login-card h1,.login-card p { margin:0; }
  .login-card .brand-mark { width:42px; height:42px; display:grid; place-items:center; border-radius:10px; background:var(--accent); color:#fff; font-weight:800; }
  .error { margin:0; color:#a52d2d; font-size:13px; }
  .field-error { margin:5px 0 0; color:#a52d2d; font-size:12px; }
  @media (max-width:900px) {
    .app { position:static; grid-template-columns:1fr; }
    .sidebar { position:static; height:auto; }
    .sidebar nav { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:4px; }
    .nav-label { grid-column:1/-1; }
    .toolbar { grid-template-columns:1fr 1fr; }
    .search-wrap { grid-column:1/-1; }
    .detail-grid { grid-template-columns:1fr; }
    .catalog-explorer-grid { grid-template-columns:1fr; }
    .catalog-card-head,.catalog-job-row { align-items:stretch; flex-direction:column; }
    .relationship-context { align-items:stretch; flex-direction:column; }
    .relationship-minimap { display:none; }
    .catalog-comparison-counts { grid-template-columns:repeat(2,minmax(105px,1fr)); }
    .catalog-comparison-baseline,.catalog-comparison-sides { grid-template-columns:1fr; }
  }
  @media (prefers-reduced-motion:reduce) {
    .relationship-diagram-stage { transition:none; }
    & { scroll-behavior:auto; }
  }
  @media (max-width:680px) {
    .reference-set-import .field-grid { grid-template-columns:minmax(0,1fr); }
  }
  @media (max-width:620px) {
    main { padding:20px 14px; }
    .topbar { padding:0 16px; }
    .page-header { align-items:stretch; flex-direction:column; }
    .toolbar,.field-grid,.field-grid.three,.definition-grid { grid-template-columns:1fr; }
    .field.full { grid-column:auto; }
  }
}

/* Manual List creation: one fixed shell for definition, values, and final review. */
[data-goat-workspace] {
.drawer.reference-list-create { width:min(1040px,100vw); grid-template-rows:auto auto minmax(0,1fr) auto; }
.reference-list-create .list-create-steps { display:flex; justify-content:space-between; gap:16px; list-style:none; margin:0; padding:20px 24px; border-bottom:1px solid var(--line); background:#f7f9fc; }
.reference-list-create .list-create-steps li { display:flex; align-items:center; gap:9px; color:var(--muted); font-size:13px; font-weight:700; }
.reference-list-create .list-create-steps span { display:grid; place-items:center; flex:none; width:26px; height:26px; border-radius:50%; background:#e8edf4; }
.reference-list-create .list-create-steps [aria-current=step] { color:var(--accent); }
.reference-list-create .list-create-steps [aria-current=step] span { color:white; background:var(--accent); }
.reference-list-create .required-marker { color:#b43a3a; }
.reference-list-create .list-create-value-row { display:grid; grid-template-columns:minmax(0,1fr) 40px; gap:8px; align-items:start; margin-bottom:14px; }
.reference-list-create .list-create-value-row>.button { margin-top:23px; }
.reference-list-create .list-create-review { margin:20px 0; border:1px solid var(--line); border-radius:9px; padding:20px; }
.reference-list-create .list-create-review .card-head { display:flex; align-items:center; justify-content:space-between; gap:12px; margin-bottom:16px; }
.reference-list-create .list-create-review .card-head h3 { margin:0; }
.reference-list-create .list-create-facts { display:grid; grid-template-columns:160px minmax(0,1fr); gap:10px 18px; }
.reference-list-create .list-create-facts>div { margin:0; white-space:pre-wrap; overflow-wrap:anywhere; }
.reference-list-create table { min-width:0; width:100%; }
.reference-list-create td { white-space:pre-wrap; overflow-wrap:anywhere; }
@media(max-width:620px) {
  .reference-list-create .list-create-steps { gap:8px; padding:16px; }
  .reference-list-create .list-create-steps li { font-size:11px; gap:5px; }
  .reference-list-create .field-grid { grid-template-columns:1fr; }
  .reference-list-create .drawer-body { padding:20px 16px; }
  .reference-list-create .list-create-facts { grid-template-columns:1fr; gap:4px; }
  .reference-list-create .list-create-facts>div { margin-bottom:12px; }
  .reference-list-create .drawer-foot { flex-wrap:wrap; padding:15px 16px; }
}

  .list-steward-field { position:relative; }
  .list-steward-combo { display:flex; }
  .list-steward-combo input { flex:1; min-width:0; }
  .list-steward-options { position:absolute; top:100%; left:0; right:0; z-index:10; max-height:280px; overflow:auto; background:white; border:1px solid var(--line); box-shadow:0 6px 18px #0002; }
  .list-steward-options > button { display:block; width:100%; padding:10px 12px; border:0; background:white; text-align:left; cursor:pointer; }
  .list-steward-options > button:hover,.list-steward-options > button:focus { background:#eef4ff; }

/* Guided creation keeps the entire drawer and actions within the visual viewport. */
.drawer.reference-list-create,.drawer.reference-set-import { box-sizing:border-box; max-width:100vw; height:100dvh; max-height:100dvh; overflow:hidden; }
.reference-list-create .drawer-body,.reference-set-import .drawer-body { min-height:0; min-width:0; overflow:auto; overscroll-behavior:contain; }
.reference-list-create .drawer-foot,.reference-set-import .drawer-foot { flex-wrap:wrap; flex-shrink:0; }
.creation-methods { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:16px; margin:18px 0; }
.creation-method { display:flex; gap:10px; align-items:center; border:1px solid var(--line); border-radius:8px; padding:18px; cursor:pointer; }
.creation-method:has(input:checked) { border-color:var(--accent); background:#f3f6ff; }
.creation-facts { display:grid; grid-template-columns:170px minmax(0,1fr); gap:12px 20px; margin:20px 0; }
.creation-facts>span { color:var(--muted); }
.creation-facts>div { margin:0; white-space:pre-wrap; overflow-wrap:anywhere; }
.creation-success { padding:20px 24px; background:#e9f7f0; color:#176644; font-weight:700; }
@media(max-width:600px) {
  .creation-methods { grid-template-columns:1fr; }
  .creation-facts { grid-template-columns:1fr; gap:4px; }
  .creation-facts>div { margin-bottom:12px; }
  .reference-set-import .set-import-steps { gap:8px; padding:14px; font-size:11px; }
}
}

/* Current manual Crosswalk: bounded independent inventories and visible decision states. */
[data-goat-workspace] {
.drawer.manual-crosswalk-create { width:min(1180px,100vw); display:grid; grid-template-rows:auto auto minmax(0,1fr) auto; }
.manual-crosswalk-create .drawer-body { min-height:0; overflow:auto; }
.manual-inventories { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1fr); gap:18px; margin:16px 0; }
.manual-inventory,.manual-endpoint { min-width:0; padding:16px; border:1px solid var(--line,#d8dee8); border-radius:10px; background:#fff; }
.manual-inventory { max-height:65vh; overflow:auto; scrollbar-gutter:stable; }
.manual-inventory .control { max-width:100%; }
.manual-inventory .field { margin-bottom:12px; }
.manual-source-row { padding:14px 0; border-bottom:1px solid var(--line,#d8dee8); }
.manual-source-row[draggable=true] { cursor:grab; }
.manual-source-title,.manual-source-actions,.manual-coverage,.manual-selection-bar { display:flex; align-items:center; gap:9px; flex-wrap:wrap; }
.manual-source-title .reference-scalar { flex:1; min-width:100px; }
.manual-source-actions { margin-top:10px; }
.manual-source-actions .button { font-size:12px; }
.manual-source-actions select { width:100%; min-width:0; }
.manual-coverage { padding:12px 16px; background:#f2f5fa; border-radius:8px; margin:14px 0; }
.manual-coverage span { padding:3px 8px; background:#fff; border-radius:6px; }
.manual-status { font-size:12px; padding:3px 8px; border-radius:16px; font-weight:650; }
.manual-status.unmapped { color:#991b1b; background:#fee2e2; }
.manual-status.mapped { color:#166534; background:#dcfce7; }
.manual-status.unmappable { color:#92400e; background:#fef3c7; }
.manual-target-card { padding:14px; margin:12px 0; border:1px solid #c6d2e3; border-radius:9px; background:#f9fbff; }
.manual-target-card > b { display:block; margin-bottom:9px; }
.manual-target-card:has(button:focus-visible) { outline:2px solid #305ca8; }
.manual-chips { display:flex; flex-wrap:wrap; gap:6px; }
.manual-chip { display:inline-flex; align-items:center; max-width:100%; gap:6px; padding:4px 8px; border-radius:6px; background:#e1ebfc; }
.manual-chip button { flex-shrink:0; min-width:28px; min-height:28px; border:0; border-radius:4px; background:#fff; color:#243b64; }
.manual-crosswalk-mappings .reference-scalar { white-space:pre-wrap; overflow-wrap:anywhere; word-break:normal; }
.manual-endpoint-combo { display:flex; }
.manual-endpoint-combo input { min-width:0; flex:1; }
.manual-endpoint-combo button { min-width:36px; }
.manual-endpoint-options { max-height:260px; overflow:auto; padding:6px; border:1px solid #b7c4d9; }
.manual-endpoint-options button[role=option] { display:block; width:100%; padding:9px; text-align:left; border:0; background:#fff; }
.manual-endpoint-options button[role=option]:hover,.manual-endpoint-options button[role=option]:focus-visible { background:#e6efff; }
.manual-endpoint .field { margin-top:12px; }
.manual-crosswalk-create .list-create-steps { display:flex; flex-wrap:wrap; gap:12px 24px; list-style:none; margin:0; padding:16px 24px; border-bottom:1px solid var(--line); background:#f7f9fc; counter-reset:manual-step; }
.manual-crosswalk-create .list-create-steps li { counter-increment:manual-step; display:flex; gap:7px; align-items:center; color:var(--muted); font-size:13px; font-weight:700; }
.manual-crosswalk-create .list-create-steps li::before { content:counter(manual-step); display:grid; place-items:center; width:24px; height:24px; border-radius:50%; background:#e8edf4; }
.manual-crosswalk-create .list-create-steps [aria-current=step] { color:var(--accent); }
.manual-crosswalk-create .list-create-steps [aria-current=step]::before { color:white; background:var(--accent); }
@media(max-width:760px) { .manual-inventories { grid-template-columns:minmax(0,1fr); } .manual-inventory { max-height:55vh; } }
}
