/* Registry rows stay tables on small screens; details are opened explicitly. */
@media screen {
  html body .record-table-wrap {
    max-width: 100%;
    min-width: 0;
    overflow-x: auto;
  }
  html body table.record-table {
    display: table !important;
    width: 100%;
    min-width: var(--record-table-min, 720px) !important;
    table-layout: auto;
    border-collapse: collapse;
    border-spacing: 0;
  }
  html body table.record-table > thead { display: table-header-group !important; }
  html body table.record-table > tbody { display: table-row-group !important; }
  html body table.record-table > :is(thead, tbody) > tr {
    display: table-row !important;
    padding: 0;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    background: transparent;
  }
  html body table.record-table > :is(thead, tbody) > tr > :is(th, td) {
    display: table-cell !important;
    width: auto;
    min-width: 0;
    max-width: 320px;
    padding: 10px 12px;
    border: 0;
    border-bottom: 1px solid #dce6f2;
    border-radius: 0;
    text-align: left;
    vertical-align: top;
    font-size: 14px;
    line-height: 1.4;
    overflow-wrap: anywhere;
  }
  html body table.record-table > thead > tr > th {
    color: #607895;
    background: #f3f7fc;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .02em;
  }
  html body table.record-table > tbody > tr:hover > td { background: #f5f9ff; }
  html body table.record-table > tbody > tr > td::before { display: none !important; }
  html body table.record-table > :is(thead, tbody) > tr.record-page-hidden,
  html body table.record-table > :is(thead, tbody) > tr > :is(th, td).record-column-hidden,
  html body .portal-pagination[data-record-native][hidden] { display: none !important; }
  html body table.record-table > :is(thead, tbody) > tr[hidden],
  html body table.record-table > :is(thead, tbody) > tr > :is(th, td)[hidden] { display: none !important; }
  html body table.record-table td small { display: block; font-size: 12px; line-height: 1.4; }
  html body table.record-table td strong { font-size: inherit; }
  html body table.record-table td .status-pill { white-space: normal; }
  html body .record-title-link {
    display: inline-block;
    max-width: 100%;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: none;
    color: #1256a5;
    font: inherit;
    font-weight: 700;
    line-height: inherit;
    text-align: left;
    text-decoration: underline;
    text-decoration-color: #a7c3e4;
    text-underline-offset: 3px;
    cursor: pointer;
    box-shadow: none;
  }
  html body .record-title-link:hover { color: #073568; }
  html body .record-title-link:focus-visible { outline: 2px solid #146ac0; outline-offset: 3px; }
  html body .record-cell-line {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  html body .record-cell-line :is(p, small) { margin: 0; }
  html body .record-full-content[hidden] { display: none !important; }
  html body .company-records { --record-table-min: 1040px; }
  html body table.record-table.company-records :is(td, th):first-child { width: 72px; min-width: 72px; white-space: nowrap; }
  html body .company-records td:nth-child(2) { min-width: 210px; }
  html body table.record-table.company-records td .status-pill { white-space: nowrap; }
  html body .portal-shell .record-summary-stats { display: flex !important; flex-wrap: wrap; gap: 10px; }
  html body .record-summary-stats > .stat-card { flex: 1 1 125px; min-height: 0; padding: 14px; border-radius: 12px; }
  html body .record-summary-stats > .stat-card strong { margin: 0 0 4px; }
  html body .record-bulk-actions { margin: 0 0 18px; }
  html body .record-bulk-actions > summary { cursor: pointer; font-weight: 700; padding: 8px 0; }
  html body .record-detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
  html body .record-stack { grid-template-columns: minmax(0, 1fr); }
  html body .record-detail-section { min-width: 0; padding: 16px; border: 1px solid #dce6f2; border-radius: 12px; }
  html body .record-detail-section > :is(h2, h3) { margin: 0 0 14px; }
  html body .record-detail-section small { display: block; margin-top: 6px; }
  html body .record-detail-wide { grid-column: 1 / -1; }
  html body .record-detail-section :is(.company-admin-action, .marketplace-row-action) {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    min-width: 0;
    margin-top: 12px;
  }
  html body .record-detail-section :is(input, select, textarea) { max-width: 100%; }
  html body .record-detail-section :is(input:not([type="checkbox"]):not([type="radio"]), textarea) { width: 100%; padding: 10px; border: 1px solid #cbdced; border-radius: 10px; font: inherit; background: #fff; }
  html body .record-detail-section :is(fieldset, textarea, .company-admin-field--limit) { grid-column: 1 / -1; }
  html body .record-detail-section .company-role-picker { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  html body .record-detail-section select { width: 100%; min-height: 44px; font: inherit; padding: 8px; border: 1px solid #cbdced; border-radius: 10px; background: #fff; }
  html body .record-detail-section .dictionary-suggestion-row { grid-template-columns: minmax(0, 1fr); }
  html body .record-dialog {
    width: min(1050px, calc(100vw - 32px));
    max-width: calc(100vw - 32px);
    max-height: calc(100dvh - 32px);
    padding: 0;
    border: 1px solid #cbdced;
    border-radius: 16px;
    background: #fff;
    color: #08224a;
    box-shadow: 0 20px 70px #001b4b38;
  }
  html body .record-dialog::backdrop { background: #061d3f80; }
  html body .record-dialog-head { display: flex; align-items: start; justify-content: space-between; gap: 16px; padding: 20px; position: sticky; top: 0; background: #fff; z-index: 1; border-bottom: 1px solid #dce6f2; }
  html body .record-dialog-head h2 { margin: 0; overflow-wrap: anywhere; }
  html body .record-dialog-head button { flex-shrink: 0; }
  html body .record-dialog-body { padding: 20px; }
  html body.record-dialog-open { overflow: hidden; }
  html body .record-inline-detail > summary { cursor: pointer; color: #1256a5; }
  html body .record-inline-detail[open] .offer-card { min-width: min(500px, 65vw); }
  @media (max-width: 640px) {
    html body .record-detail-grid { grid-template-columns: minmax(0, 1fr); }
    html body .record-detail-section :is(.company-admin-action, .marketplace-row-action, .company-role-picker) { grid-template-columns: minmax(0, 1fr); }
    html body .record-dialog-head { padding: 14px; }
    html body .record-dialog-body { padding: 12px; gap: 12px; }
  }
}

@media screen {
  html body .record-table-controls { display: flex; flex-wrap: wrap; align-items: start; gap: 12px 20px; margin: 12px 0; font-size: 14px; }
  html body .record-size-label { display: flex; align-items: center; gap: 8px; white-space: nowrap; }
  html body .record-table-controls select { width: auto; min-width: 78px; padding: 8px; border: 1px solid #cbdced; border-radius: 8px; background: #fff; color: #08224a; font: inherit; }
  html body .record-columns { max-width: 100%; }
  html body .record-columns summary { cursor: pointer; padding: 8px 12px; border: 1px solid #cbdced; border-radius: 8px; background: #fff; font-weight: 600; }
  html body .record-column-choices { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); width: min(620px, 100%); gap: 10px; padding: 12px 0; }
  html body .record-column-choices label { display: flex; align-items: center; gap: 8px; color: #08224a; font-size: 13px; }
  html body .record-column-choices input[type="checkbox"] { width: 16px; height: 16px; min-height: 0; flex: 0 0 16px; margin: 0; }
  html body .record-row-count { margin-left: auto; padding: 9px 0; color: #607895; }
  html body .record-table-pagination { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 16px 0 4px; }
  html body .record-control-button { display: inline-flex; align-items: center; justify-content: center; width: auto; min-width: 36px; min-height: 36px; padding: 7px 11px; border: 1px solid #cbdced; border-radius: 8px; background: #fff; color: #1256a5; font: inherit; font-size: 13px; text-decoration: none; cursor: pointer; box-shadow: none; }
  html body .record-control-button[aria-current="page"] { color: #fff; border-color: #1256a5; background: #1256a5; }
  html body .record-control-button:disabled { opacity: .45; cursor: default; }
  html body .record-table-controls :focus-visible, html body .record-table-pagination :focus-visible { outline: 2px solid #146ac0; outline-offset: 2px; }
  @media(max-width: 640px) { html body .record-row-count { margin-left: 0; } }
}
@media print { .record-table-controls, .record-table-pagination { display: none; } }
