:root {
  color-scheme: light;
  --ink: #18223b;
  --muted: #4b586d;
  --line: #dce3ee;
  --surface: #fff;
  --page: #f3f6fb;
  --blue: #244fc6;
  --blue-dark: #163ca7;
  --nav: #151f39;
  --radius: 14px;
  font-family: "Segoe UI", "Noto Sans", system-ui, sans-serif;
  font-size: 15px;
}
* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: var(--page); }
a { color: var(--blue-dark); text-underline-offset: .2em; }
a:hover { color: #10266e; }
:focus-visible { outline: 3px solid #6984ed; outline-offset: 3px; }
.frame { width: min(1360px, 100% - 64px); margin-inline: auto; }
.topbar { background: var(--nav); color: white; }
.topbar-inner { display: flex; align-items: center; gap: 42px; min-height: 64px; }
.session-action { margin-inline-start: auto; }
.brand { display: flex; align-items: center; gap: 10px; color: white; text-decoration: none; font-size: 18px; font-weight: 700; }
.brand:hover { color: white; }
.mark { position: relative; display: inline-block; width: 27px; height: 27px; border-radius: 8px; background: #456fee; }
.mark::before, .mark::after { content: ""; position: absolute; background: white; border-radius: 2px; }
.mark::before { width: 13px; height: 3px; top: 12px; left: 7px; }
.mark::after { width: 3px; height: 13px; top: 7px; left: 12px; }
nav { display: flex; flex-wrap: wrap; gap: 6px; }
nav a { padding: 9px 12px; color: #dce5ff; text-decoration: none; border-radius: 7px; font-weight: 600; }
nav a:hover, nav a[aria-current] { background: #2c3b62; color: white; }
main.frame { padding-block: 32px 54px; }
.skip { position: absolute; inset: 5px auto auto 5px; transform: translateY(-150%); background: white; padding: 10px; z-index: 5; }
.skip:focus { transform: translateY(0); }
.heading { display: flex; gap: 20px; align-items: end; justify-content: space-between; margin-block: 0 22px; }
h1 { font-size: clamp(2rem, 4vw, 2.75rem); line-height: 1.07; margin: 0; letter-spacing: -.045em; font-weight: 720; }
.heading p { margin: 8px 0 0; color: var(--muted); }
h2 { font-size: 1.12rem; margin: 0; }
h3 { font-size: 1rem; margin: 22px 0 8px; }
.back { display: inline-block; font-size: .92rem; margin-bottom: 15px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 2px 4px #19284507; }
.filters, .editor, .terms { padding: 20px; }
.filters, .editor, .terms, .summary, .notice { margin-bottom: 18px; }
.filter-grid, .form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr)); gap: 14px 16px; }
.form-grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 245px), 1fr)); }
label { display: grid; align-content: start; gap: 6px; color: var(--muted); font-size: .9rem; font-weight: 650; min-width: 0; }
input, select, textarea { width: 100%; min-width: 0; padding: 8px 10px; min-height: 39px; border: 1px solid #bfcade; border-radius: 7px; color: var(--ink); background: white; font: inherit; font-weight: 400; }
textarea { resize: vertical; }
button, .button { display: inline-flex; align-items: center; justify-content: center; min-height: 39px; padding: 8px 14px; border: 1px solid transparent; border-radius: 8px; font: inherit; font-weight: 650; text-decoration: none; text-align: center; cursor: pointer; }
.primary { color: white; background: var(--blue); }
.primary:hover { color: white; background: var(--blue-dark); }
.subtle { color: var(--ink); border-color: var(--line); background: white; }
.subtle:hover { background: var(--page); }
.actions { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 16px; }
fieldset { border: 0; padding: 0 0 17px; margin: 0 0 16px; border-bottom: 1px solid var(--line); min-inline-size: 0; }
legend { padding: 0; margin-bottom: 12px; font-weight: 700; }
details { margin-top: 14px; }
summary { color: var(--blue-dark); cursor: pointer; font-weight: 600; }
.notice { background: #edf2ff; border: 1px solid #cad6fb; border-radius: 9px; padding: 11px 14px; }
.notice.error { color: #851c1c; background: #fff1ef; border-color: #efc7c2; }
.notice.success { color: #154d38; background: #e8f6ee; border-color: #bddfcf; }
.summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 9px; }
.stat { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 13px; }
.stat span { color: var(--muted); font-size: .88rem; }
.stat strong { font-size: 1.25rem; }
.results { overflow: hidden; }
.results-head { display: flex; align-items: center; gap: 10px; padding: 14px 17px; }
.results-head .button { margin-left: auto; }
.count, .tag { display: inline-block; border-radius: 5px; padding: 2px 7px; font-weight: 650; font-size: .8rem; line-height: 1.5; background: #eaf0fb; color: #273c70; }
.tag.new { color: #154d38; background: #e8f6ee; }
.tag.update { color: #243d93; background: #e9efff; }
.tag.candidate { color: #744300; background: #fff0d6; }
.tag.invalid { color: #851c1c; background: #fff1ef; }
.tag.unchanged { color: #435060; background: #edf0f4; }
.table-wrap { width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; }
th, td { border-top: 1px solid var(--line); padding: 12px 16px; vertical-align: top; overflow-wrap: anywhere; }
th { color: var(--muted); background: #f7f9fd; font-size: .82rem; font-weight: 700; }
td { min-width: 110px; }
td div + div { margin-top: 4px; }
td select { width: auto; max-width: 100%; margin-top: 6px; }
td strong + .tag { margin-left: 3px; }
.row-title, .price { font-weight: 700; white-space: nowrap; }
#suppliers-table .row-title { white-space: normal; }
.price { font-variant-numeric: tabular-nums; font-size: 1rem; }
small, .table-note { display: block; color: var(--muted); line-height: 1.45; }
small { margin-top: 3px; font-size: .84rem; }
.table-note { margin: 0; padding: 0 17px 12px; font-size: .9rem; }
.empty { color: var(--muted); padding-block: 23px; }
.details-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 13px; }
dt { color: var(--muted); font-size: .9rem; }
dd { margin: 4px 0 0; }
.preserve { white-space: pre-line; }
@media (max-width: 700px) {
  .frame { width: calc(100% - 28px); }
  .topbar-inner { flex-wrap: wrap; gap: 8px 18px; padding-block: 10px; }
  nav a { padding-inline: 8px; }
  main.frame { padding-top: 24px; }
  .heading { align-items: start; flex-wrap: wrap; gap: 12px; }
  .filters, .editor, .terms { padding: 14px; }
  th, td { padding-inline: 10px; }
}
@media (max-width: 600px) {
  .filter-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #offers-table, #offers-table tbody { display: block; }
  #offers-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    clip-path: inset(50%);
    overflow: hidden;
  }
  #offers-table tbody tr {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px 10px;
    border-top: 1px solid var(--line);
    padding: 13px;
  }
  #offers-table td { display: block; min-width: 0; border: 0; padding: 0; }
  #offers-table td::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 4px;
    color: var(--muted);
    font-size: .8rem;
    font-weight: 700;
  }
  #offers-table td:last-child { grid-column: 1 / -1; }
}
@media (max-width: 340px) {
  .filter-grid { grid-template-columns: 1fr; }
}
