/* Shared native components. Semi React uses the same tokens and semantic map. */
:where(.op-button,.btn,.listing-btn,.pager-btn,.procurement-toolbar button,.loop-pagination button) { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: var(--op-control); min-height: var(--op-control); padding: 0 12px; border: 1px solid transparent; border-radius: var(--op-radius); box-shadow: var(--op-shadow-none); color: var(--semi-color-text-0); background: var(--semi-color-fill-0); font-size: var(--semi-font-size-regular); font-weight: 400; line-height: 20px; white-space: nowrap; cursor: pointer; text-decoration: none; }
:where(.op-button,.btn,.listing-btn,.pager-btn):hover:not(:disabled) { background: var(--semi-color-fill-1); transform: none; box-shadow: var(--op-shadow-none); }
:where(.op-button,.btn,.listing-btn).primary { background: var(--semi-color-primary); color: var(--op-on-primary); border-color: transparent; }
:where(.op-button,.btn,.listing-btn).primary:hover:not(:disabled) { background: var(--semi-color-primary-hover); }
:where(.op-button,.btn,.listing-btn).ghost, .op-button--text { color: var(--semi-color-primary); background: transparent; border-color: transparent; }
:where(.op-button,.btn,.listing-btn).danger, .op-button--danger { color: var(--op-color-s); }
:where(.op-button,.btn,.listing-btn,.pager-btn):disabled { opacity: .45; cursor: not-allowed; }
:where(input:not([type=checkbox],[type=radio],[type=file]),select,textarea,.searchable-select__trigger) { height: var(--op-control); min-height: var(--op-control); padding: 5px 12px; border: 1px solid var(--semi-color-border); border-radius: var(--op-radius); background: var(--semi-color-fill-0); color: var(--semi-color-text-0); font-size: var(--semi-font-size-regular); line-height: 20px; box-shadow: var(--op-shadow-none); }
:where(input,textarea)::placeholder { color: var(--semi-color-text-3); }
:where(input,select,textarea):disabled { background: var(--semi-color-disabled-bg); color: var(--semi-color-disabled-text); cursor: not-allowed; }
:where(textarea) { height: auto; min-height: 80px; resize: vertical; }
:where(input,select,textarea):focus { outline: 0; border-color: var(--semi-color-focus-border); }
.searchable-select__trigger { width: 100%; }
.searchable-select__dropdown { border: 1px solid var(--semi-color-border); border-radius: var(--op-radius); background: var(--semi-color-bg-2); box-shadow: var(--op-shadow-medium); z-index: var(--op-z-popup); }
.searchable-select__option { min-height: 32px; padding: 6px 12px; }
:where(.op-card,.table-wrap,.filter-panel,.watch-filter-bar,.loop-table-wrap,.ops-card,.library-card) { background: var(--semi-color-bg-1); border: 1px solid var(--semi-color-border); border-radius: var(--op-radius); box-shadow: var(--op-shadow-none); }
:where(.filter-panel,.watch-filter-bar) { padding: 16px; margin: 0 0 16px; }
:where(.op-tag,.status-chip,.loop-tag,.company-tier,.signal-badge,.stage-tag) { display: inline-flex; align-items: center; gap: 4px; min-height: 20px; max-width: 100%; padding: 0 6px; border: 0; border-radius: var(--op-radius-sm); background: var(--op-bg-neutral); color: var(--op-color-neutral); font-size: var(--semi-font-size-small); font-weight: 400; line-height: 20px; vertical-align: middle; white-space: nowrap; }
:where(.op-tag,.company-tier,.status-chip,.signal-badge)[data-tone=s], .company-tier.tier-s, .company-tier.s, .signal-badge.bad { color: var(--op-color-s); background: var(--op-bg-s); }
:where(.op-tag,.company-tier,.status-chip,.signal-badge)[data-tone=a], .company-tier.tier-a, .company-tier.a, .signal-badge.warn, .loop-tag.pending { color: var(--op-color-a); background: var(--op-bg-a); }
:where(.op-tag,.company-tier,.status-chip,.signal-badge)[data-tone=b], .company-tier.tier-b, .company-tier.b, .status-chip.approved, .signal-badge.good { color: var(--op-color-b); background: var(--op-bg-b); }
:where(.op-tag,.status-chip)[data-tone=info], .company-tier.manual, .status-chip.review, .status-chip.progress, .signal-badge.blue { color: var(--op-color-info); background: var(--op-bg-info); }
:where(.op-tag,.status-chip)[data-tone=violet] { color: var(--op-color-violet); background: var(--op-bg-violet); }
.status-chip.stopped { color: var(--op-color-s); background: var(--op-bg-s); }
:where(table) { width: 100%; border-collapse: separate; border-spacing: 0; font-size: var(--semi-font-size-regular); font-variant-numeric: tabular-nums; }
:where(th,td) { padding: 8px 12px; text-align: left; vertical-align: middle; border-bottom: 1px solid var(--semi-color-border); font-size: var(--semi-font-size-regular); }
:where(thead th) { position: sticky; top: var(--op-header-h); z-index: var(--op-z-sticky); height: 40px; background: var(--op-table-header-bg); color: var(--semi-color-text-2); font-weight: 600; white-space: nowrap; }
:where(tbody tr) { height: 56px; background: var(--semi-color-bg-1); }
:where(tbody tr):hover { background: var(--semi-color-fill-0); }
:where(td .btn,td .listing-btn) { padding: 0 6px; color: var(--semi-color-primary); background: transparent; border-color: transparent; }
:where(td .btn,td .listing-btn).primary { color: var(--semi-color-primary); background: transparent; }
:where(.pager,.loop-pagination,.op-pagination) { display: flex; align-items: center; justify-content: flex-end; flex-wrap: nowrap; overflow-x: auto; gap: 8px; margin: 16px 0 0; padding: 0; min-height: 32px; color: var(--semi-color-text-2); font-size: var(--semi-font-size-regular); }
.op-pagination-total { margin-right: auto; }
.pager-btn[aria-current=page] { color: var(--op-color-info); background: var(--semi-color-primary-light-default); }
.pager-jump { display: inline-flex; align-items: center; gap: 8px; }
.pager-jump-label { display: inline-flex; align-items: center; gap: 6px; }
.pager-jump-input { width: 56px; text-align: center; padding: 5px; }
.pager-info { font-size: var(--semi-font-size-regular); white-space: nowrap; }
:where(.modal,.loop-dialog,.procurement-dialog,.listing-dialog,.op-modal) { background: var(--semi-color-bg-2); color: var(--semi-color-text-0); border: 0; border-radius: var(--op-radius-lg); box-shadow: var(--op-shadow-high); z-index: var(--op-z-modal); max-height: calc(100vh - 48px); }
:where(.modal-head,.loop-dialog-header,.procurement-dialog-header,.op-modal-header) { display: flex; align-items: center; justify-content: space-between; padding: 20px 24px; min-height: 64px; border-bottom: 1px solid var(--semi-color-border); }
:where(.modal-head,.loop-dialog-header,.procurement-dialog-header,.op-modal-header) h2 { margin: 0; font-size: var(--semi-font-size-header-6); line-height: 22px; font-weight: 600; }
:where(.modal-body,.loop-dialog-body,.procurement-dialog-body,.op-modal-body) { padding: 24px; }
:where(.modal-foot,.loop-dialog-footer,.procurement-dialog-footer,.op-modal-footer) { padding: 16px 24px; border-top: 1px solid var(--semi-color-border); display: flex; align-items: center; justify-content: flex-end; gap: 8px; background: var(--semi-color-bg-2); }
:where(.modal-backdrop,.loop-overlay,.drawer-backdrop) { background: var(--semi-color-overlay-bg); z-index: var(--op-z-modal); }
dialog::backdrop { background: var(--semi-color-overlay-bg); }
.op-modal { position: fixed; top: 50%; left: 50%; transform: translate(-50%,-50%); width: min(480px,calc(100vw - 32px)); }
:where(.drawer,.loop-drawer,.op-drawer) { background: var(--semi-color-bg-2); box-shadow: var(--op-shadow-high); width: min(720px,100vw); border-radius: var(--op-radius-none); z-index: var(--op-z-modal); }
.loop-dialog.loop-drawer { max-width: 720px; width: 720px; border-radius: var(--op-radius-none); }
:where(.op-banner,.loop-result,.reviewer-filter-notice) { padding: 12px 16px; color: var(--op-color-info); background: var(--op-bg-info); border: 0; border-radius: var(--op-radius); font-size: var(--semi-font-size-regular); }
:where(.empty-state,.op-empty) { padding: 40px 24px; text-align: center; color: var(--semi-color-text-2); font-size: var(--semi-font-size-regular); }
.op-empty-icon { display: block; margin: 0 auto 12px; width: 56px; height: 40px; border: 2px solid var(--semi-color-border); border-radius: var(--op-radius); position: relative; }
.op-empty-icon::after { content: ''; position: absolute; inset: 10px 12px; border-top: 2px solid var(--semi-color-border); border-bottom: 2px solid var(--semi-color-border); }
.op-skeleton { display: grid; gap: 12px; padding: 16px; background: var(--semi-color-bg-1); }
.op-skeleton-row { display: grid; grid-template-columns: 48px minmax(120px,2fr) repeat(3,minmax(48px,1fr)); align-items: center; gap: 16px; min-height: 48px; }
.op-skeleton-row span { display: block; height: 12px; border-radius: var(--op-radius-sm); background: var(--semi-color-fill-1); animation: op-pulse 1.4s ease-in-out infinite alternate; }
.op-skeleton-row span:first-child { height: 40px; }
@keyframes op-pulse { to { opacity: .45; } }
:where(.toast,.listing-toast,.op-toast) { position: fixed; top: 20px; bottom: auto; left: 50%; transform: translate(-50%,-16px); max-width: min(600px,calc(100vw - 32px)); border: 1px solid var(--semi-color-border); border-radius: var(--op-radius); background: var(--semi-color-bg-3); color: var(--semi-color-text-0); box-shadow: var(--op-shadow-medium); padding: 12px 16px; font-size: var(--semi-font-size-regular); z-index: var(--op-z-toast); }
:where(.toast,.listing-toast,.op-toast):not(.show) { opacity: 0; pointer-events: none; }
:where(.toast,.listing-toast,.op-toast).show { transform: translate(-50%,0); opacity: 1; pointer-events: auto; }
.op-toast[data-tone=error] { border-color: var(--op-color-s); }
.op-toast-close { border: 0; background: transparent; color: var(--semi-color-text-2); margin-left: 12px; cursor: pointer; }
.op-more { display: inline-block; position: relative; vertical-align: middle; }
.op-more > summary { color: var(--semi-color-primary); font-size: var(--semi-font-size-regular); list-style: none; cursor: pointer; padding: 6px; white-space: nowrap; }
.op-more > summary::-webkit-details-marker { display: none; }
.op-more-menu { display: grid; position: absolute; right: 0; top: 100%; min-width: 160px; padding: 4px; background: var(--semi-color-bg-2); border: 1px solid var(--semi-color-border); box-shadow: var(--op-shadow-medium); border-radius: var(--op-radius); z-index: var(--op-z-popup); }
.op-more-menu .btn { justify-content: flex-start; width: 100%; }
.op-more[open] { z-index: var(--op-z-popup); }
td:has(.op-more[open]) { z-index: var(--op-z-popup); }
.op-date { display: inline-flex; position: relative; min-width: 140px; }
.op-date-trigger { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; height: 32px; padding: 5px 10px; background: var(--semi-color-fill-0); color: var(--semi-color-text-0); border: 1px solid var(--semi-color-border); border-radius: var(--op-radius); cursor: pointer; font-size: var(--semi-font-size-regular); }
.op-date-trigger:disabled { opacity: .45; cursor: not-allowed; }
.op-calendar { position: fixed; margin: 0; right: auto; bottom: auto; width: min(280px, calc(100vw - 16px)); max-height: calc(100vh - 16px); overflow: auto; padding: 12px; background: var(--semi-color-bg-2); border: 1px solid var(--semi-color-border); border-radius: var(--op-radius); box-shadow: var(--op-shadow-medium); z-index: var(--op-z-toast); }
.op-calendar-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; font-size: var(--semi-font-size-regular); }
.op-calendar-jump:not([hidden]) { display: grid; grid-template-columns: 1fr 1fr auto; gap: 6px; align-items: end; padding-bottom: 8px; }
.op-calendar-jump label { display: grid; gap: 4px; min-width: 0; }
.op-calendar-jump input,.op-calendar-jump select { width: 100%; min-width: 0; }
.op-calendar-grid { display: grid; grid-template-columns: repeat(7,1fr); gap: 2px; }
.op-calendar-grid[hidden] { display: none; }
.op-calendar-grid button,.op-calendar-grid span { height: 32px; border: 0; border-radius: var(--op-radius-sm); background: transparent; color: var(--semi-color-text-0); text-align: center; font: inherit; font-size: var(--semi-font-size-regular); }
.op-calendar-grid span { color: var(--semi-color-text-2); line-height: 32px; }
.op-calendar-grid button:hover { background: var(--semi-color-fill-1); }
.op-calendar-grid button[aria-selected=true] { background: var(--semi-color-primary); color: var(--op-on-primary); }
.op-calendar-grid button:disabled { color: var(--semi-color-disabled-text); }
.op-calendar-footer { display: flex; justify-content: space-between; padding-top: 8px; border-top: 1px solid var(--semi-color-border); }
.op-date-range-error { margin: 0; color: var(--semi-color-danger); grid-column: 1 / -1; }
.op-tabs { display: flex; gap: 24px; border-bottom: 1px solid var(--semi-color-border); }
.op-tabs [aria-selected=true] { color: var(--semi-color-primary); border-bottom: 2px solid var(--semi-color-primary); }
:where(.reviewer-status,.list-link span) { color: var(--semi-color-text-1); }
:where(.benchmark-chip,.ops-skill-card b,.settings-tab.active b) { color: var(--op-color-info); }
.mini-visual,.user-avatar.profile-avatar,.avatar-option { background: var(--semi-color-fill-0); color: var(--semi-color-text-1); }
html[data-theme=dark] :where(.btn.ghost,.listing-btn.ghost) { color: var(--op-color-info); }
.profile-card,.login-context,.login-panel { background: var(--semi-color-bg-1); }
.login-feature b { color: var(--op-color-info); background: var(--semi-color-primary-light-default); }
:where(.modal,.drawer,.settings-drawer,.settings-dialog)[aria-hidden=true] { visibility: hidden; }
:where(.op-table,.rank-table,.procurement-table,.loop-table,.product-library-table,.op-opportunity-table) tr > :first-child { position: sticky; left: 0; background: var(--semi-color-bg-1); z-index: var(--op-z-content); }
:where(.op-table,.rank-table,.procurement-table,.loop-table,.product-library-table,.op-opportunity-table) tr > :last-child { position: sticky; right: 0; background: var(--semi-color-bg-1); z-index: var(--op-z-content); }
:where(.op-table,.rank-table,.procurement-table,.loop-table,.product-library-table,.op-opportunity-table) thead tr > :is(:first-child,:last-child) { z-index: var(--op-z-sticky); background: var(--op-table-header-bg); }
.op-link-btn { border: 0; background: transparent; color: var(--semi-color-primary); padding: 0; font: inherit; font-size: var(--semi-font-size-small); line-height: 20px; white-space: nowrap; cursor: pointer; }
.op-link-btn:hover { text-decoration: underline; }
.op-link-btn:focus-visible,.op-thumb-link:focus-visible { outline: 2px solid var(--semi-color-focus-border); outline-offset: 2px; border-radius: var(--op-radius-sm); }
.op-product-thumb { display: inline-flex; position: relative; flex-shrink: 0; align-items: center; justify-content: center; overflow: hidden; color: var(--semi-color-text-2); background: var(--op-table-header-bg); border: 1px solid var(--semi-color-border); border-radius: var(--op-radius); vertical-align: middle; }
.op-product-thumb--32 { width: 32px; height: 32px; }
.op-product-thumb--48 { width: 48px; height: 48px; }
.op-product-thumb--64 { width: 64px; height: 64px; }
.op-product-thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.op-thumb-link { display: inline-flex; padding: 0; border: 0; background: transparent; cursor: pointer; flex-shrink: 0; }
.op-review-tabs { display: flex; gap: 8px; margin-bottom: 16px; }
.op-review-tabs button { border: 0; background: transparent; color: var(--semi-color-text-1); padding: 4px 8px; font: inherit; cursor: pointer; }
.op-review-tabs button[aria-selected=true] { color: var(--semi-color-primary); background: var(--semi-color-primary-light-default); border-radius: var(--op-radius); }
.op-review-tabs button:focus-visible { outline: 2px solid var(--semi-color-focus-border); }
.op-reviewer-list { display: grid; }
.op-reviewer-row { display: grid; grid-template-columns: minmax(72px,1fr) minmax(80px,1fr) auto auto; gap: 8px; align-items: center; min-height: 48px; padding: 8px 0; border-bottom: 1px solid var(--semi-color-border); font-size: var(--semi-font-size-regular); }
.op-reviewer-row > small { grid-column: 1 / -1; color: var(--semi-color-text-2); }
.op-reviewer-row .reviewer-status { font-size: var(--semi-font-size-small); line-height: 20px; height: 20px; padding: 0 6px; }
.op-assign-popover { position: fixed; inset: auto; margin: 0; width: 280px; max-width: calc(100vw - 16px); padding: 0; border: 1px solid var(--semi-color-border); border-radius: var(--op-radius-lg); background: var(--semi-color-bg-2); color: var(--semi-color-text-0); box-shadow: var(--op-shadow-medium); }
.op-assign-popover::backdrop { background: transparent; }
.op-assign-popover .op-modal-body { display: grid; gap: 12px; padding: 16px; }
.op-assign-popover label { display: grid; gap: 4px; font-size: var(--semi-font-size-small); }
.op-assign-popover :is(select,.searchable-select,.searchable-select__trigger) { width: 100%; min-width: 0; }
.op-assign-popover small { color: var(--semi-color-text-2); font-size: var(--semi-font-size-small); }
.op-panel-error { margin: 0; padding: 8px 16px; color: var(--op-color-s); font-size: var(--semi-font-size-small); }
.activity-range-option[aria-pressed=true] { color: var(--op-color-info); }
.op-tag-cancelled { text-decoration: line-through; color: var(--semi-color-text-1); background: var(--semi-color-fill-0); }

/* P = page (or the existing bounded dialog) scroll. C = one bounded table viewport. */
:root { --op-header-h: var(--op-header); --op-toolbar-h: 200px; }
.op-table-scroll { overflow: visible; max-height: none; min-width: 0; max-width: 100%; }
.op-table-scroll > table { width: 100%; min-width: 0; table-layout: fixed; border-collapse: separate; border-spacing: 0; }
.op-table-scroll > table :is(th,td) { min-width: 0; overflow-wrap: anywhere; }
.op-table-scroll > table thead th { position: sticky; top: var(--op-header-h); z-index: var(--op-z-sticky); background: var(--op-table-header-bg); font-size: var(--semi-font-size-small); white-space: nowrap; }
.op-table-scroll > table tbody tr > :is(:first-child,:last-child) { position: static; }
.op-table-scroll > table thead tr > :is(:first-child,:last-child) { left: auto; right: auto; }
.op-table-scroll.op-table-scroll--contained { overflow: auto; max-height: max(160px,calc(100vh - var(--op-header-h) - var(--op-toolbar-h) - 24px)); position: relative; overscroll-behavior: contain; }
.op-table-scroll--contained > table { min-width: 1180px; }
.op-table-scroll--contained > table thead th { top: 0; }
.op-table-scroll--contained > :is(.rank-table,#watchTable[data-section=confirm_pool]) tr > :first-child { position: sticky; left: 0; background: var(--semi-color-bg-1); z-index: var(--op-z-content); }
.op-table-scroll--contained > :is(.rank-table,#watchTable[data-section=confirm_pool]) tr > :last-child { position: sticky; right: 0; background: var(--semi-color-bg-1); z-index: var(--op-z-content); }
.op-table-scroll--contained > :is(.rank-table,#watchTable[data-section=confirm_pool]) thead tr > :is(:first-child,:last-child) { z-index: calc(var(--op-z-sticky) + 1); background: var(--op-table-header-bg); }
:is(.settings-content,.modal-body,.drawer-body,.loop-dialog-body,.loop-dialog,.semi-modal-body,.semi-sidesheet-body) { --op-header-h: 0px; }
.procurement-table-wrap { overflow: visible; }
.op-table-scroll .procurement-table { min-width: 0; }
.op-table-scroll .procurement-table :is(th,td) { min-width: 0; padding: 8px; }
.op-table-scroll .procurement-row-actions { min-width: 0; }
.op-table-scroll .procurement-row-actions .btn { min-width: 0; max-width: 100%; white-space: normal; overflow-wrap: anywhere; }
.op-table-scroll .procurement-status-entry { min-width: 0; padding: 8px; }
.op-table-scroll .procurement-status-entry .status-chip { min-width: 0; max-width: 100%; white-space: normal; }
.op-table-scroll .listing-table { min-width: 0; }
.op-table-scroll .listing-table :is(th,td) { min-width: 0; padding: 8px; white-space: normal; }
.op-table-scroll .listing-table th { white-space: nowrap; }
.op-table-scroll .listing-table :is(th,td):first-child { width: 36px; }
.op-table-scroll .listing-table :is(th,td):nth-child(2) { width: 26%; }
.op-table-scroll .listing-table :is(th,td):last-child { width: 100px; }
.op-table-scroll .ops-table :is(th,td) { padding: 8px; }
.op-table-scroll .ops-table th:first-child { width: 20%; }
.op-table-scroll .ops-table--progress th:last-child { width: 40px; }
.op-table-scroll .ops-table .ops-date { white-space: normal; }
.op-table-scroll .permission-table { min-width: 0; }
.op-table-scroll .product-library-table { min-width: 0; }
.op-table-scroll .product-library-table :is(th,td) { padding: 8px; }
.op-table-scroll .product-library-table .op-table-secondary { display: none; }
.op-table-scroll .product-library-table :is(th,td):first-child:has(input) { width: 36px; }
.op-table-more { width: 88px; }
.op-table-more summary { cursor: pointer; color: var(--semi-color-primary); white-space: nowrap; }
.op-table-facts { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 8px 12px; margin: 8px; }
.op-table-facts dt { color: var(--semi-color-text-2); }
.op-table-facts dd { margin: 0; overflow-wrap: anywhere; }

.op-table-scroll .ops-rating-pills { flex-wrap: wrap; white-space: normal; }

.listing-main .listing-panel { overflow: visible; }

.op-table-scroll .ops-table--reviews th:nth-child(5) { width: 16%; }

.op-table-scroll .audit-table th:first-child { width: 32%; }

.activity-panel.people-panel { overflow: visible; }

.op-table-scroll .ops-progress { min-width: 0; }
.op-table-scroll .ops-progress-head { flex-direction: column; align-items: flex-start; gap: 2px; }
.op-table-scroll .ops-progress-head strong { white-space: nowrap; }
.op-table-scroll .ops-progress-head small { max-width: 100%; white-space: normal; }

.loop-workspace .op-table-scroll .loop-table th:first-child { width: 28%; }
.loop-workspace .op-table-scroll .loop-table th:nth-child(5) { width: 14%; }
