/* Relationships (08): brand pack v2 applied by kind; RECIPES v1.6 (B1 card, B2 rows, B4 table, B5 form, B6 dialog, B7 side panel,
   B8 menu, B9 empty, B10 error, B12 state label, B13 notice band, B14 chips, B15 tabs, C1, C2, C10). Colour, radius, shadow and
   spacing come from the pack tokens only. Scoped to #view-contacts; classes use the rv- prefix, ids keep rl-. */
#view-contacts { padding: 0 0 var(--v3-end-space); color: var(--al-text); width: 100%; min-width: 0; max-width: 100%; }
#view-contacts * { box-sizing: border-box; }
#view-contacts a { color: var(--al-action); text-decoration: none; cursor: pointer; }
#view-contacts a:hover { text-decoration: underline; }

/* title row: heading, the register meta and the one primary at the right; five or six tabs (B15, C10) */
#view-contacts .rv-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: var(--al-gap-card); }
#view-contacts .rv-head .al-title { margin: 0; }
#view-contacts .rv-head-r { display: flex; align-items: center; gap: 16px; min-width: 0; }
#view-contacts .rv-meta span { white-space: nowrap; }
#view-contacts .rv-meta { text-align: right; font-size: var(--al-fs-label); color: var(--al-text-2); line-height: 1.5; font-variant-numeric: tabular-nums; max-width: 560px; }
#view-contacts .alf-tabs { display: flex; gap: 26px; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: thin; width: 0; min-width: 100%; margin-bottom: var(--al-gap-card); border-bottom: 1px solid var(--al-divider); }
#view-contacts .alf-tab { height: 40px; padding: 0; flex: none; border-radius: 0; background: none; color: var(--al-text-2); font-weight: 500; }
#view-contacts .alf-tab[aria-selected="true"] { background: none; box-shadow: inset 0 -2px 0 var(--al-brass); color: var(--al-action); font-weight: 700; }
#view-contacts .rv-count { margin-left: 6px; font-size: var(--al-fs-label); font-weight: 500; color: var(--al-text-2); font-variant-numeric: tabular-nums; }
#view-contacts .alf-tab[aria-selected="true"] .rv-count { color: var(--al-action); }
#view-contacts #rl-body { min-width: 0; }

/* B1 cards, B2 rows */
#view-contacts .al-region { background: var(--al-card); border: 1px solid var(--al-divider); border-radius: var(--al-r-card); box-shadow: var(--al-shadow-card); min-width: 0; margin-bottom: var(--al-gap-card); }
#view-contacts .al-region-hd { display: flex; align-items: baseline; gap: 12px; padding: var(--al-pad-card) var(--al-pad-card) var(--al-gap-title); border: 0; }
#view-contacts .al-region-hd .al-label { font-size: var(--al-fs-card); font-weight: 700; color: var(--al-text); }
#view-contacts .al-region-hd .al-meta { margin-left: auto; font-size: var(--al-fs-label); color: var(--al-text-2); font-variant-numeric: tabular-nums; }
#view-contacts .al-region-body { padding: 0 var(--al-pad-card) var(--al-pad-card); }
#view-contacts .rv-pad { padding: var(--al-pad-card); }
#view-contacts .al-flow { display: flex; flex-direction: column; }
#view-contacts .al-flow-row { position: relative; display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 10px 0; margin: 0; border: 0; background: none; box-shadow: none; }
#view-contacts .al-flow-row::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: var(--al-divider); }
#view-contacts .al-flow-row:last-child::after { display: none; }
#view-contacts .al-flow.is-compact .al-flow-row { min-height: 44px; padding: 8px 0; }
#view-contacts .al-flow-main { display: flex; flex-direction: column; gap: 3px; min-width: 0; flex: 1; }
#view-contacts .al-flow-title { font-size: var(--al-fs-ui); font-weight: 500; color: var(--al-text); line-height: 1.4; overflow-wrap: anywhere; }
#view-contacts .al-flow-meta { font-size: var(--al-fs-label); font-weight: 400; color: var(--al-text-2); line-height: 1.4; overflow-wrap: anywhere; }
#view-contacts .al-flow-aside { font-size: var(--al-fs-label); color: var(--al-text-2); white-space: nowrap; text-align: right; flex: none; font-variant-numeric: tabular-nums; }
#view-contacts [role="button"].al-flow-row { cursor: pointer; border-radius: var(--al-r-control); padding-left: 12px; padding-right: 12px; margin: 0 -12px; }
#view-contacts [role="button"].al-flow-row:hover, #view-contacts .al-flow-row[aria-selected="true"] { background: var(--al-selected); }
#view-contacts .al-flow-row[aria-selected="true"] .al-flow-title { color: var(--al-action); font-weight: 600; }
#view-contacts [role="button"]:focus-visible, #view-contacts .rv-link:focus-visible { outline: none; box-shadow: var(--al-focus); }
#view-contacts .al-absent { font-size: var(--al-fs-ui); color: var(--al-text-2); margin: 0; }
#view-contacts .al-secondary { font-size: var(--al-fs-label); color: var(--al-text-2); margin: 8px 0 0; }
#view-contacts .rv-chev { flex: none; width: 16px; text-align: center; color: var(--al-text-2); transition: transform var(--al-t-hover, .15s); }
#view-contacts .rv-chev.is-open { transform: rotate(90deg); }
#view-contacts .rv-sub { padding: 0 0 8px 16px; }
#view-contacts .rv-link { border: 0; background: none; padding: 0; margin: 0; font: 500 var(--al-fs-ui)/1.4 var(--al-font-ui); color: var(--al-action); cursor: pointer; white-space: nowrap; }
#view-contacts .rv-link:hover { text-decoration: underline; }
#view-contacts .rv-dots { flex: none; width: 32px; height: 32px; border: 0; background: none; border-radius: var(--al-r-control); color: var(--al-text-2); cursor: pointer; font-size: 18px; line-height: 1; }
#view-contacts .rv-dots:hover { background: var(--al-selected); }
#view-contacts .rv-fig { flex: none; font-size: var(--al-fs-ui); font-weight: 500; font-variant-numeric: tabular-nums; text-align: right; min-width: 64px; }
#view-contacts .rv-num { font-size: var(--al-fs-ui); font-variant-numeric: tabular-nums; color: var(--al-text-2); margin-left: 12px; flex: none; }

/* B14 lenses */
#view-contacts .rv-lenses { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 16px; }
#view-contacts .alf-filter .rv-n { margin-left: 6px; font-variant-numeric: tabular-nums; color: var(--al-text-2); }
#view-contacts .alf-filter[aria-pressed="true"] .rv-n { color: var(--al-action); }

/* search and the register (B4) */
#view-contacts .rv-tools { display: flex; align-items: center; gap: 12px; padding: var(--al-pad-card) var(--al-pad-card) 8px; }
#view-contacts .rv-search { width: 320px; max-width: 100%; height: var(--al-control-h); padding: 0 12px; border: 0; border-radius: var(--al-r-control); background: var(--al-field); box-shadow: inset 0 0 0 1px var(--al-line-control); font: 400 15px/1 var(--al-font-ui); color: var(--al-text); }
#view-contacts .rv-search:hover { box-shadow: inset 0 0 0 1px var(--al-action); }
#view-contacts .rv-search:focus { outline: none; box-shadow: var(--al-focus); }
#view-contacts .rv-search::placeholder { color: var(--al-text-2); }
#view-contacts .rv-table-wrap { padding: 0 var(--al-pad-card); overflow-x: auto; }
#view-contacts .rv-table { width: 100%; border-collapse: collapse; table-layout: fixed; }
#view-contacts .rv-table thead, #view-contacts .rv-table thead tr { background: none; }
#view-contacts .rv-table th { text-align: left; height: 44px; padding: 0 12px; font-size: var(--al-fs-label); font-weight: 600; color: var(--al-text-2); background: none; text-transform: none; letter-spacing: 0; border-bottom: 1px solid var(--al-divider); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#view-contacts .rv-table td { height: 52px; padding: 0 12px; font-size: var(--al-fs-ui); border-bottom: 1px solid var(--al-divider); vertical-align: middle; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-variant-numeric: tabular-nums; }
#view-contacts .rv-table tr:last-child td { border-bottom: 0; }
#view-contacts .rv-table th:first-child, #view-contacts .rv-table td:first-child { padding-left: 0; }
#view-contacts .rv-table th:last-child, #view-contacts .rv-table td:last-child { padding-right: 0; }
#view-contacts .rv-table .r { text-align: right; }
#view-contacts .rv-table tbody tr { cursor: pointer; }
#view-contacts .rv-table tbody tr:hover td, #view-contacts .rv-table tbody tr[aria-selected="true"] td { background: var(--al-selected); }
#view-contacts .rv-table tbody tr[aria-selected="true"] td:first-child { color: var(--al-action); font-weight: 600; }
#view-contacts .rv-table tbody tr:focus-visible { outline: none; box-shadow: inset var(--al-focus); }
#view-contacts .rv-nm { font-weight: 500; }
#view-contacts .rv-amb { margin-left: 8px; font-size: var(--al-fs-label); font-weight: 400; color: var(--al-text-2); }
#view-contacts .rv-pager { display: flex; align-items: center; justify-content: flex-end; gap: 8px; padding: 12px var(--al-pad-card) var(--al-pad-card); font-size: var(--al-fs-label); color: var(--al-text-2); }
#view-contacts .rv-pager .rv-range { margin-right: 8px; font-variant-numeric: tabular-nums; }
#view-contacts .alf-button--icon.alf-button--compact { width: 32px; padding: 0; }

/* B12 state label (attention only) and the B13 notice band */
#view-contacts .rv-flag { display: inline-flex; align-items: center; height: 24px; padding: 0 10px; border-radius: var(--al-r-chip); background: var(--al-attention-wash); color: var(--al-attention); font-size: var(--al-fs-label); font-weight: 600; }
#view-contacts .rv-band, .rv-panel .rv-band { background: none; color: var(--al-attention); padding: 0; font-size: var(--al-fs-ui); font-weight: 600; }
.rv-panel .rv-band a { color: var(--al-attention); text-decoration: underline; }
#view-contacts .cv-error, .rv-error { display: flex; align-items: center; justify-content: space-between; gap: 12px; background: var(--al-critical-wash); color: var(--al-critical); border-radius: var(--al-r-control); padding: 12px 16px; font-size: var(--al-fs-ui); }

/* the Añadir menu (B8) */
.rv-menu { position: fixed; z-index: var(--al-z-attached); min-width: 220px; padding: 6px; background: var(--al-raised); border-radius: var(--al-r-popover); box-shadow: var(--al-shadow-menu); }
.rv-menu button { display: flex; align-items: center; width: 100%; height: 40px; padding: 0 12px; border: 0; background: none; border-radius: var(--al-r-control); font: 400 var(--al-fs-ui)/1 var(--al-font-ui); color: var(--al-text); text-align: left; cursor: pointer; }
.rv-menu button.has-sep { margin-top: 6px; position: relative; }
.rv-menu button.has-sep::before { content: ""; position: absolute; left: 8px; right: 8px; top: -4px; height: 1px; background: var(--al-divider); }
.rv-menu button:hover, .rv-menu button:focus-visible { background: var(--al-selected); outline: none; }
.rv-menu .rv-menu-note { padding: 8px 12px 6px; font-size: var(--al-fs-label); color: var(--al-text-2); }

/* the selected entity: B7 over the page with the scrim; the register does not reflow (C13 precedent) */
.rv-scrim { position: fixed; top: var(--al-topbar-h); left: 0; right: 0; bottom: 0; z-index: 69; background: var(--ml-scrim, rgba(32,58,77,.32)); }
.rv-panel { position: fixed; top: var(--al-topbar-h); right: 0; bottom: 0; width: 460px; max-width: 100vw; z-index: 70; display: flex; flex-direction: column; background: var(--al-raised); box-shadow: var(--al-shadow-menu); color: var(--al-text); }
@media (min-width: 1440px) { .rv-panel { width: 520px; } }
.rv-panel-hd { flex: none; display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 56px; padding: 0 16px 0 24px; }
.rv-panel-title { font-size: var(--al-fs-card); font-weight: 600; min-width: 0; overflow-wrap: anywhere; }
.rv-panel-body { flex: 1; min-height: 0; overflow-y: auto; padding: 8px 24px 88px; }
.rv-panel a { color: var(--al-action); }
.rv-sec { margin: 0 0 24px; }
.rv-sec-t { font-size: var(--al-fs-card); font-weight: 600; margin: 0 0 8px; }
.rv-kv { display: grid; gap: 12px; margin: 0; }
.rv-kv dt { font-size: var(--al-fs-label); font-weight: 400; color: var(--al-text-2); margin: 0 0 2px; }
.rv-kv dd { font-size: var(--al-fs-ui); margin: 0; color: var(--al-text); overflow-wrap: anywhere; }
.rv-kv dd.is-absent { color: var(--al-text-2); }
.rv-panel .al-flow-row { min-height: 52px; }
.rv-panel .al-flow-row::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: var(--al-divider); }
.rv-panel .al-flow-row:last-child::after { display: none; }
.rv-panel .al-flow { display: flex; flex-direction: column; }
.rv-panel .al-flow-row { position: relative; display: flex; align-items: center; gap: 12px; padding: 8px 0; }
.rv-panel .al-flow-main { display: flex; flex-direction: column; gap: 3px; min-width: 0; flex: 1; }
.rv-panel .al-flow-title { font-size: var(--al-fs-ui); font-weight: 500; overflow-wrap: anywhere; }
.rv-panel .al-flow-meta { font-size: var(--al-fs-label); color: var(--al-text-2); overflow-wrap: anywhere; }
.rv-panel .al-flow-aside { font-size: var(--al-fs-label); color: var(--al-text-2); white-space: nowrap; }
.rv-panel .al-absent { font-size: var(--al-fs-ui); color: var(--al-text-2); margin: 0; }
.rv-panel .al-secondary { font-size: var(--al-fs-label); color: var(--al-text-2); margin: 6px 0 0; }
.rv-panel .rv-link { border: 0; background: none; padding: 0; font: 500 var(--al-fs-ui)/1.4 var(--al-font-ui); color: var(--al-action); cursor: pointer; white-space: nowrap; }
.rv-panel .rv-link:hover { text-decoration: underline; }
.rv-panel .rv-acts { display: flex; flex-wrap: wrap; gap: 8px 16px; margin-top: 8px; }
.rv-compare { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 16px; }
.rv-compare h3 { margin: 0 0 8px; font-size: var(--al-fs-ui); font-weight: 600; overflow-wrap: anywhere; }
dialog.rv-wide { width: 640px; max-width: calc(100vw - 48px); }
dialog .depth-dialog-actions .alf-button--quiet { color: var(--al-text); }

/* HR1: a destructive act is red in its menu and its confirm button is red (never the main button of a panel) */
.rv-menu button.is-danger { color: var(--al-critical); }
dialog.is-form .alf-button--danger { background: var(--al-critical); color: var(--al-text-inverse); box-shadow: none; }
dialog.is-form .alf-button--danger:hover { background: var(--al-critical); box-shadow: 0 0 0 2px var(--al-critical-wash); }

/* GB R6: the merge dialog compares two records; only differing fields carry the soft-blue plate, agreeing fields collapse to one quiet line */
.rv-cmp { display: grid; gap: 4px; margin-top: 16px; }
.rv-cmp-h, .rv-cmp-r { display: grid; grid-template-columns: 140px 1fr 1fr; gap: 12px; align-items: center; margin: 0; }
.rv-cmp-h h3 { margin: 0; font-size: var(--al-fs-ui); font-weight: 600; overflow-wrap: anywhere; }
.rv-cmp-r dt { font-size: var(--al-fs-label); color: var(--al-text-2); }
.rv-cmp-v { margin: 0; min-height: 40px; display: flex; align-items: center; padding: 0 12px; border-radius: var(--al-r-control); overflow-wrap: anywhere; font-size: var(--al-fs-ui); }
.rv-cmp-v.is-diff { background: var(--al-selected); }
.rv-cmp-v.is-absent { color: var(--al-text-2); }
.rv-cmp-same, .rv-cmp-none { margin: 8px 0 0; }

/* GB R13: the search is the last item of the chip row from 1440 px (240 to 320 px wide); below 1440 it wraps to its own row */
#view-contacts .rv-search-inline { flex: 0 1 320px; min-width: 240px; width: auto; margin-left: auto; }
@media (max-width: 1439px) { #view-contacts .rv-search-inline { flex: 1 0 100%; margin-left: 0; } }
.rv-menu .rv-menu-head { padding: 10px 12px 4px; font-size: var(--al-fs-label, 12px); font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--al-text-2); }
.rv-menu .rv-menu-head:first-child { padding-top: 4px; }

