:root {
  color-scheme: light;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #14282d;
  background: #f2f5f3;
  font-synthesis: none;
  --green: #11604e;
  --muted: #4e6568;
  --line: #d7e1dd;
}

* { box-sizing: border-box; }
body { margin: 0; }
button, input, select, textarea { font: inherit; }
button:not(:disabled) { cursor: pointer; }
button:disabled { opacity: .5; }
:focus-visible { outline: 3px solid #369889; outline-offset: 3px; }
[hidden] { display: none !important; }
.container { width: min(1240px, calc(100% - 64px)); margin-inline: auto; }
.page-header { background: #102e32; color: #fff; padding: 30px 0 21px; }
.header-main, .progress-row, .company-header, .save-row {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.context { margin: 0 0 8px; color: var(--green); font-size: .81rem; font-weight: 700; }
.page-header .context { color: #99d2bf; }
h1 { margin: 0; font-size: clamp(1.7rem, 3.4vw, 2.75rem); line-height: 1.12; letter-spacing: -.045em; }
.file-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.button {
  border: 1px solid transparent; border-radius: 8px; font-size: .86rem;
  font-weight: 650; min-height: 40px; padding: 9px 13px; text-align: center;
}
.button.secondary { color: #234e48; background: #fff; border-color: #b9cfca; }
.button.secondary:hover:not(:disabled) { background: #e9f3ef; }
.page-header .button.secondary { color: #edf8f4; background: #1b3d40; border-color: #517371; }
.page-header .button.secondary:hover { background: #2b5353; }
.button.primary { background: var(--green); color: #fff; }
.button.primary:hover:not(:disabled) { background: #0a4b3c; }
.progress-row {
  justify-content: flex-start; margin-top: 25px; border-top: 1px solid #3b5558;
  padding-top: 15px; color: #d5e9e2; font-size: .83rem;
}
progress { width: 128px; height: 9px; accent-color: #8bd1b7; }
#catalog-label { margin-left: auto; }
.statistics {
  list-style: none; display: flex; flex-wrap: wrap; gap: 6px 15px;
  padding: 0; margin: 9px 0 0; color: #d5e9e2; font-size: .74rem;
}
.workspace { display: grid; grid-template-columns: minmax(225px, 310px) minmax(0, 1fr); gap: 18px; margin-block: 24px; align-items: start; }
.queue, .detail { background: #fff; border: 1px solid var(--line); border-radius: 13px; min-width: 0; }
.queue-heading { padding: 18px 16px 13px; }
.queue h2 { font-size: 1.13rem; margin: 0 0 13px; }
.view-buttons { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.view-buttons .button[aria-pressed="true"] { background: #e4f2ec; border-color: #91b9ad; }
.filters { margin-top: 12px; color: #234e48; font-size: .83rem; }
.filters summary { cursor: pointer; font-weight: 650; }
.filter-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-block: 9px; }
.filter-grid label { min-width: 0; color: #253b40; font-size: .74rem; }
.filter-grid input, .filter-grid select { font-size: .75rem; padding: 6px; }
.batch-controls {
  display: flex; flex-wrap: wrap; align-items: center; gap: 7px; margin-top: 12px;
}
.batch-controls select { width: auto; margin-top: 0; padding: 7px; }
.batch-controls .button { min-height: 34px; padding: 6px 8px; }
#batch-notice:empty { display: none; }
.field-label, form label { display: block; font-size: .81rem; font-weight: 660; }
input, select, textarea {
  display: block; width: 100%; margin-top: 6px; background: #fff; border: 1px solid #b8cac5;
  border-radius: 7px; padding: 9px 10px; color: #14282d;
}
select { padding-right: 16px; }
textarea { resize: vertical; }
.company-list { list-style: none; margin: 0; padding: 0 9px 9px; max-height: 450px; overflow: auto; }
.list-navigation {
  display: flex; justify-content: space-between; align-items: center;
  border-top: 1px solid var(--line); padding: 8px 14px; font-size: .79rem; color: var(--muted);
}
.list-navigation .button { min-height: 30px; padding: 3px 8px; }
.company-item {
  border: 1px solid transparent; width: 100%; background: #fff; border-radius: 8px;
  color: #14282d; text-align: left; padding: 9px 10px; min-height: 46px;
}
.company-item:hover { background: #f2f7f4; }
.company-item[aria-current="true"] { background: #e4f2ec; border-color: #9dc8b8; }
.company-item strong, .company-item span { display: block; overflow-wrap: anywhere; }
.company-item strong { font-size: .83rem; line-height: 1.23; }
.company-item span { color: var(--muted); font-size: .73rem; margin-top: 3px; }
.empty { margin: 4px 16px 18px; color: var(--muted); font-size: .86rem; }
.detail { padding: 23px 25px 17px; }
.company-header { align-items: flex-start; }
.company-header h2 { margin: 0; line-height: 1.18; letter-spacing: -.025em; overflow-wrap: anywhere; }
.company-header .button { flex-shrink: 0; }
.company-facts {
  display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.65fr) minmax(0, 1fr);
  gap: 13px; margin: 18px 0; border-top: 1px solid var(--line); padding-top: 14px;
}
dt, .original, .profile-note, .notice, #timestamp { color: var(--muted); font-size: .79rem; }
dd { margin: 5px 0 0; font-size: .86rem; line-height: 1.42; overflow-wrap: anywhere; }
.contacts { margin: 0 0 14px; }
.text-button { color: var(--green); background: none; border: 0; padding: 2px; font-size: .75rem; text-decoration: underline; }
.phone-panel {
  display: flex; align-items: center; justify-content: space-between; gap: 15px;
  border: 1px solid #bcd9cb; background: #edf6f1; border-radius: 10px; padding: 13px 15px;
}
.phone-panel p { margin: 0; }
.phone-panel .phone { font-size: clamp(1.15rem, 2.6vw, 1.65rem); margin: 4px 0; font-weight: 710; font-variant-numeric: tabular-nums; }
.original span { color: #263c40; margin-left: 4px; overflow-wrap: anywhere; }
.phone-panel .normalization { margin-top: 5px; color: #234e48; font-size: .8rem; font-weight: 650; }
.phone-panel .button { flex-shrink: 0; }
.profile-note { margin: 8px 0 15px; line-height: 1.4; }
form { border-top: 1px solid var(--line); padding-top: 12px; }
form h3 { font-size: 1rem; margin: 0 0 11px; }
.form-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 12px; margin-bottom: 12px; }
.form-grid select, textarea { font-size: .86rem; }
.save-row { margin-top: 12px; justify-content: flex-start; }
.notice { min-height: 1.1rem; margin: 9px 0 0; }
.notice[data-error="true"] { color: #a32c23; }
dialog {
  width: min(620px, calc(100% - 32px)); border: 1px solid var(--line);
  border-radius: 13px; padding: 22px; color: #14282d; line-height: 1.45;
}
dialog::backdrop { background: rgb(16 46 50 / .56); }
dialog h2 { margin: 0; font-size: 1.2rem; }
dialog p, dialog li { font-size: .86rem; }
#import-details { max-height: 160px; overflow: auto; }

@media (max-width: 920px) {
  .container { width: calc(100% - 36px); }
  .header-main, .company-header, .phone-panel { align-items: flex-start; flex-direction: column; }
}
@media (max-width: 640px) {
  .workspace { grid-template-columns: 1fr; margin-top: 14px; }
  .company-list { max-height: 177px; overflow: auto; }
  .page-header { padding-top: 19px; }
  .progress-row { flex-wrap: wrap; gap: 8px; }
  #catalog-label { margin-left: 0; }
  .detail { padding: 16px; }
  .company-facts, .form-grid { grid-template-columns: 1fr; }
}

/* Standalone sections in the existing carrier card. */
.company-facts { grid-template-columns: 1fr; }
.detail > details { border-top: 1px solid var(--line); padding: 9px 0; }
.detail > details > summary { color: #234e48; font-size: .86rem; font-weight: 660; cursor: pointer; }
#draft-fields { border: 0; margin: 0; padding: 0; min-width: 0; }
#draft-notice, #history, #technical-fields { font-size: .85rem; }
#technical-fields dd { margin-bottom: 8px; }
#owner-login { max-width: 420px; margin: 20px 0; }
#owner-login label, #commercial-form label, #company-create label,
#contact-create label, #contact-edit label { margin-bottom: 10px; }
#pair-button { margin-bottom: 10px; }
#telegram-status { margin-bottom: 12px; }
#work-history { font-size: .85rem; }
