.aqua-records {
  --rec-line: #e6edf1;
  --rec-ink: var(--navy, #071d33);
  --rec-muted: #647582;
  --rec-surface: var(--tk-page, #f4f6f6);
  color: var(--rec-ink);
}
.aqua-records [hidden] { display: none !important; }
.aqua-records .rec-section {
  width: min(1100px, calc(100% - 48px));
  margin: 30px auto 70px;
  padding: clamp(18px, 2.4vw, 36px);
}
.rec-head, .rec-legal-head, .rec-actions, .rec-tools, .rec-tabs {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}
.rec-head, .rec-legal-head { justify-content: space-between; gap: 12px; }
.rec-head { padding-bottom: 17px; border-bottom: 1px solid var(--rec-line); margin-bottom: 18px; }
.rec-head h1, .rec-head h2, .rec-legal-head h2 { margin: 0; }
.rec-head h1 { font-size: clamp(22px, 2vw, 30px); }
.rec-head h2, .rec-legal-head h2 { font-size: 19px; }
.rec-actions { gap: 7px; }
.rec-tools { margin-bottom: 18px; }
.rec-search { display: block; margin: 0 0 12px; }
.rec-search input, .rec-tools input[type=search], .rec-filter select {
  min-height: 42px;
  border: 1px solid var(--rec-line);
  border-radius: 12px;
  background: white;
  padding: 9px 13px;
  font-size: 13px;
}
.rec-search input { width: 100%; }
.rec-tools input[type=search] { flex: 1 1 260px; }
.rec-filter { display: flex; gap: 7px; align-items: center; font-size: 13px; }
.rec-check { display: flex; gap: 8px; align-items: center; font-size: 13px; }
.rec-check input { accent-color: var(--pl-accent-dark, #2ea995); width: 16px; height: 16px; flex: none; }
.rec-block { margin-top: 18px; }
.rec-block .contractor-contacts-preview-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.rec-block .contractor-contacts-preview-head > span { display: flex; margin-left: auto; }
.rec-row, .rec-unit {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 13px 0;
  border-bottom: 1px solid var(--rec-line);
  overflow-wrap: anywhere;
}
.rec-row:last-child, .rec-unit:last-child { border-bottom: 0; }
.rec-row > div:first-of-type, .rec-unit > div:first-of-type { min-width: 0; flex: 1; }
.rec-row strong, .rec-row small, .rec-unit strong, .rec-unit small { display: block; }
.rec-row strong, .rec-unit strong { font-size: 14px; }
.rec-row small, .rec-unit small { color: var(--rec-muted); margin: 3px 0; font-size: 12px; }
.rec-row p, .rec-site > p { font-size: 13px; margin: 4px 0; line-height: 1.5; white-space: pre-line; }
.rec-row a, .rec-site a { color: var(--pl-accent-dark, #28796c); font-size: 12px; }
.rec-row .rec-overdue, .rec-error { color: #a9313d; }
.rec-site { padding: 8px 0 14px; border-bottom: 1px solid var(--rec-line); }
.rec-site:last-child { border-bottom: 0; }
.rec-site .rec-row { border: 0; padding-top: 5px; }
.rec-site > .rec-actions { margin-top: 9px; }
.rec-unit { padding: 9px 12px; background: var(--rec-surface); border-radius: 10px; margin-bottom: 5px; }
.rec-product img, .rec-unit img { width: 54px; height: 54px; object-fit: contain; border: 1px solid var(--rec-line); background: #fff; border-radius: 9px; }
.rec-unit img { width: 40px; height: 40px; }
.rec-prices { text-align: right; }
.rec-empty { color: var(--rec-muted); font-size: 13px; padding: 12px 0; margin: 0; }
.rec-tabs { margin-bottom: 16px; }
.rec-tabs button { white-space: nowrap; }
.aqua-records .contractor-list button > span:last-child { margin-left: auto; color: var(--pl-accent-dark, #2ea995); }
.rec-dialog {
  box-sizing: border-box;
  position: fixed;
  inset: 0;
  width: min(620px, calc(100% - 24px));
  max-height: min(90vh, 850px);
  max-height: min(90dvh, 850px);
  margin: auto;
  padding: clamp(18px, 2.4vw, 30px);
  border: 1px solid var(--rec-line);
  border-radius: 22px;
  background: white;
  color: var(--rec-ink);
  overflow: auto;
  box-shadow: 0 22px 78px #071d3330;
}
.rec-dialog::backdrop { background: #071d3360; }
.rec-dialog .rec-head > button { padding: 5px 11px; font-size: 19px; }
.rec-form-grid { display: grid; gap: 12px; grid-template-columns: repeat(2, minmax(0,1fr)); }
.rec-field { display: flex; flex-direction: column; gap: 5px; min-width: 0; color: var(--rec-ink); font-size: 12px; font-weight: 600; }
.rec-field input, .rec-field textarea, .rec-field select {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--rec-line);
  border-radius: 10px;
  background: var(--rec-surface);
  padding: 8px 11px;
  color: var(--rec-ink);
  font: inherit;
  font-weight: 400;
  font-size: 14px;
}
.rec-field input[type=file] { font-size: 12px; }
.rec-field textarea { resize: vertical; }
.rec-field :focus-visible, .rec-tools :focus-visible, .rec-search input:focus-visible { outline: 2px solid var(--pl-accent-dark, #2ea995); outline-offset: 1px; }
.rec-wide, .rec-form-grid > .rec-check { grid-column: 1 / -1; }
.rec-legal-head { padding-top: 14px; margin-top: 6px; border-top: 1px solid var(--rec-line); }
.rec-preview { width: 86px; height: 64px; object-fit: contain; border-radius: 10px; border: 1px solid var(--rec-line); }
.rec-form footer { justify-content: flex-end; margin-top: 18px; }
.rec-error, .rec-save-state { font-size: 13px; }
.rec-error:empty, .rec-save-state:empty { display: none; }
.rec-page-msg { background: #fff2f2; padding: 12px 16px; border-radius: 10px; margin: 14px; }
@media(max-width: 800px) {
  .aqua-records .contractors-page { padding: 16px 12px 50px; }
  .aqua-records .contractors-layout { grid-template-columns: minmax(0, 1fr); }
  .aqua-records .contractor-list { max-height: 240px; overflow-y: auto; padding: 2px; }
  .aqua-records .contractor-detail { min-width: 0; padding: 16px; }
  .aqua-records .rec-section { width: calc(100% - 24px); margin: 16px auto 40px; }
}
@media(max-width: 560px) {
  .rec-form-grid, .aqua-records .detail-fields { grid-template-columns: minmax(0, 1fr); }
  .aqua-records .contractor-head, .rec-row, .rec-unit { flex-wrap: wrap; }
  .rec-row > div:first-of-type, .rec-unit > div:first-of-type { flex: 1 1 55%; }
  .rec-row .rec-actions { flex-basis: 100%; }
  .rec-prices { text-align: left; }
  .rec-tabs { max-width: 100%; overflow-x: auto; }
}
