:root {
  --bg: #f2f5f8;
  --panel: #ffffff;
  --panel-soft: #f7f9fb;
  --control: #ffffff;
  --control-strong: #f7f9fb;
  --ink: #172231;
  --muted: #68778a;
  --line: #d7e0e9;
  --line-soft: #e6ebf0;
  --hover: #eef2f6;
  --brand: #46647f;
  --brand-dark: #344d63;
  --brand-soft: #edf3f7;
  --accent: #b44d55;
  --shadow: 0 8px 24px rgba(28, 45, 64, 0.07);
  --radius: 8px;
}

* { box-sizing: border-box; }

.adsbygoogle,
iframe[src*="doubleclick"],
iframe[src*="googlesyndication"],
iframe[src*="adservice"],
iframe[src*="yandex.ru/ads"],
[id^="google_ads"],
[id^="yandex_ad"],
[class~="ad-banner"],
[class~="ads-banner"],
[class~="advertisement"],
[data-ad],
[data-ads] {
  display: none !important;
  visibility: hidden !important;
}

html {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  color-scheme: light;
}

body {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 15.5px/1.5 Inter, "SF Pro Text", ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  letter-spacing: 0;
  overflow-x: hidden;
  font-feature-settings: "cv02", "cv03", "cv04", "cv11";
}

a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--ink); text-decoration: none; }

::selection {
  background: rgba(70, 100, 127, 0.2);
  color: var(--ink);
}

* {
  scrollbar-color: #aeb9c5 var(--bg);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 3000;
  width: 100%;
  max-width: 100%;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  flex-wrap: wrap;
  gap: 18px;
  min-height: 76px;
  padding: 12px 24px;
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid var(--line);
  backdrop-filter: saturate(180%) blur(12px);
  overflow: visible;
}

.brand {
  display: flex;
  align-items: center;
  flex: 0 1 420px;
  gap: 14px;
  min-width: 0;
  color: var(--ink);
}

.brand:hover { color: var(--ink); }

.brand-mark {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  background: transparent !important;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.brand-mark img {
  display: block;
  width: 40px;
  height: 40px;
  object-fit: contain;
}

.brand strong {
  display: block;
  max-width: min(420px, 30vw);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 650;
}

.brand small {
  display: block;
  color: var(--muted);
  font-size: 13px;
}

.nav {
  display: flex;
  align-items: center;
  flex: 1 1 520px;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
  min-width: 0;
  overflow: visible;
}

.nav a,
.logout-form button {
  display: inline-flex;
  align-items: center;
  max-width: 190px;
  min-height: 38px;
  padding: 0 12px;
  border: 0;
  border-radius: var(--radius);
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  font: inherit;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav a:hover,
.logout-form button:hover {
  background: var(--hover);
  color: var(--ink);
}

.logout-form { margin: 0; }

.nav-search {
  display: flex;
  align-items: center;
  flex: 1 1 260px;
  position: relative;
  width: auto;
  min-width: 180px;
  max-width: 320px;
  height: 40px;
  margin: 0 6px 0 0;
  overflow: visible;
  background: #f7faff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.nav-search input {
  width: 100%;
  min-width: 0;
  height: 100%;
  padding: 0 12px;
  border: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  outline: none;
}

.nav-search input::placeholder {
  color: var(--muted);
}

.nav-search:focus-within {
  border-color: #cfd7e2;
  box-shadow: 0 0 0 2px rgba(21, 31, 45, 0.04);
}

.nav-search > button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 44px;
  width: 44px;
  min-width: 44px;
  height: 100%;
  padding: 0;
  border: 0;
  border-left: 1px solid var(--line);
  background: white;
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  font-weight: 650;
}

.nav-search > button svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

.nav-search > button:hover {
  background: var(--hover);
  color: var(--ink);
}

.search-form {
  position: relative;
}

.search-suggestions {
  position: absolute;
  z-index: 4000;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  display: grid;
  gap: 4px;
  max-height: min(520px, 70vh);
  overflow: auto;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.nav-search .search-suggestions {
  width: min(620px, calc(100vw - 32px));
  min-width: min(420px, calc(100vw - 32px));
  left: auto;
  right: 0;
  max-width: calc(100vw - 32px);
  grid-template-columns: 1fr;
  gap: 6px;
  padding: 10px;
}

.search-suggestions[hidden] {
  display: none;
}

.search-suggestion {
  display: grid;
  gap: 3px;
  width: 100%;
  min-width: 0;
  min-height: 58px;
  padding: 10px 12px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--ink);
  text-align: left;
  font: inherit;
  cursor: pointer;
}

.search-suggestion strong {
  display: block;
  min-width: 0;
  font-size: 14px;
  line-height: 1.25;
  white-space: normal;
  overflow-wrap: anywhere;
}

.search-suggestion span {
  display: block;
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
  white-space: normal;
}

.search-suggestion:hover,
.search-suggestion[aria-selected="true"] {
  border-color: var(--line);
  background: var(--hover);
}

.main {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 28px 24px;
  min-width: 0;
}

.messages {
  width: 100%;
  max-width: none;
  margin: 20px 0 0;
  padding: 0 24px;
}

.message {
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--brand);
  border-radius: var(--radius);
  background: white;
}

.message-success { border-left-color: #1a9b62; }
.message-warning { border-left-color: #d69900; }
.message-error { border-left-color: var(--accent); }

.search-hero,
.panel,
.auth-panel,
.house-header,
.two-column > div,
.two-column > aside,
section:not(.search-hero):not(.panel):not(.auth-panel):not(.house-header) {
  min-width: 0;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.search-hero {
  position: relative;
  padding: 32px;
  overflow: hidden;
}

.search-hero::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 4px;
  background: linear-gradient(90deg, var(--brand), #14a5ff 62%, var(--accent));
}

.search-hero h1,
.panel h1,
.auth-panel h1,
.house-header h1 {
  margin: 0 0 16px;
  font-size: 30px;
  line-height: 1.15;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.search-form {
  display: flex;
  gap: 12px;
  margin-top: 18px;
}

.search-form input {
  flex: 1;
  min-width: 0;
  min-height: 52px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfdff;
  color: var(--ink);
  font: inherit;
  font-size: 17px;
  outline: none;
}

.search-form input:focus,
.form input:focus,
.form select:focus,
.form textarea:focus {
  border-color: #cfd7e2;
  box-shadow: 0 0 0 2px rgba(21, 31, 45, 0.04);
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: white;
  color: var(--ink);
  cursor: pointer;
  font: inherit;
  font-weight: 600;
}

.button.primary {
  background: #344d63;
  color: #ffffff;
  border-color: #344d63;
}

.button:hover {
  background: var(--hover);
  color: var(--ink);
  border-color: #cfd7e2;
}

.button.primary:hover {
  background: #293f52;
  color: #ffffff;
}

.muted { color: var(--muted); }

.eyebrow {
  color: var(--brand);
  font-weight: 700;
  margin: 0 0 6px;
}

.house-unom {
  margin: -6px 0 0;
  color: var(--muted);
  font-weight: 600;
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-top: 28px;
}

.section-head h2,
section h2 {
  margin: 0 0 16px;
  font-size: 22px;
  line-height: 1.25;
}

.section-head span {
  color: var(--muted);
  white-space: nowrap;
}

.section-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.section-title-row h2 {
  margin: 0;
}

.house-list {
  display: grid;
  gap: 10px;
}

.house-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  padding: 14px 16px;
  background: white;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink);
  transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}

.house-row:hover {
  border-color: #cfd7e2;
  box-shadow: 0 8px 18px rgba(21, 31, 45, 0.05);
  transform: translateY(-1px);
}

.house-row span {
  color: var(--muted);
  white-space: nowrap;
}

.house-row.static:hover {
  border-color: var(--line);
  box-shadow: none;
  transform: none;
}

.house-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  padding: 28px;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.detail-tabs {
  position: sticky;
  top: 76px;
  z-index: 10;
  display: flex;
  gap: 8px;
  margin: 16px 0 24px;
  padding: 8px;
  overflow-x: auto;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: saturate(180%) blur(12px);
}

.detail-tabs button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  min-height: 38px;
  padding: 0 14px;
  border: 0;
  border-radius: var(--radius);
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  font: inherit;
  font-weight: 600;
  white-space: nowrap;
}

.detail-tabs button:hover,
.detail-tabs button.active {
  background: var(--hover);
  color: var(--ink);
}

.detail-tabs button.active {
  box-shadow: inset 0 0 0 1px #cfd7e2;
}

.tab-panel {
  display: none !important;
}

.tab-panel.active {
  display: block !important;
}

.tab-panel.two-column.active {
  display: grid !important;
}

.detail-section {
  scroll-margin-top: 148px;
}

.two-column {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr);
  gap: 24px;
  margin-top: 24px;
}

.two-column > div,
.two-column > aside,
section:not(.search-hero):not(.panel):not(.auth-panel):not(.house-header) {
  padding: 24px;
}

.kv {
  display: grid;
  grid-template-columns: 210px 1fr;
  gap: 9px 18px;
}

.kv dt {
  color: var(--muted);
  min-width: 0;
}

.kv dd {
  margin: 0;
  min-width: 0;
  overflow-wrap: anywhere;
}

.kv.compact { grid-template-columns: 120px 1fr; }

.characteristic-groups {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
  gap: 16px;
  margin-top: 18px;
}

.characteristic-groups-single {
  grid-template-columns: minmax(0, 1fr);
}

.characteristic-group {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfcfe;
}

.characteristic-group h3 {
  margin: 0 0 14px;
  color: var(--ink);
  font-size: 18px;
  line-height: 1.25;
}

.kv-readable {
  grid-template-columns: minmax(150px, 42%) minmax(0, 1fr);
  gap: 0;
  margin: 0;
}

.kv-readable dt,
.kv-readable dd {
  padding: 9px 0;
  border-top: 1px solid var(--line-soft);
}

.kv-readable dt:first-of-type,
.kv-readable dt:first-of-type + dd {
  border-top: 0;
}

.kv-readable dt {
  padding-right: 18px;
  color: var(--muted);
}

.kv-readable dd {
  color: var(--ink);
  font-weight: 500;
}

.document-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}

.doc-section {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  background: #fbfdff;
  min-height: 190px;
}

.doc-section h3 { margin-top: 0; }

.doc-empty {
  display: flex;
  align-items: center;
  min-height: 62px;
  margin: auto 0 0;
  padding: 12px;
  color: var(--muted);
  background: white;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
}

.doc-empty-action {
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease, color .15s ease;
}

.doc-empty-action:hover {
  background: var(--hover);
  border-color: #cfd7e2;
  color: var(--ink);
}

.doc-link {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
}

.doc-link span {
  color: var(--muted);
  white-space: nowrap;
}

.image-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
}

.image-grid figure { margin: 0; }

.image-grid img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.image-grid figcaption {
  color: var(--muted);
  font-size: 14px;
}

.note {
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.empty {
  padding: 18px;
  color: var(--muted);
  background: #fbfdff;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
}

.form p {
  display: grid;
  gap: 6px;
  margin: 0 0 16px;
}

.form-panel {
  max-width: 980px;
  margin: 32px auto;
  padding: 30px;
}

.form-heading {
  margin-bottom: 24px;
}

.form-heading h1 {
  margin: 0;
  line-height: 1.18;
}

.clean-form {
  display: grid;
  gap: 18px;
}

.form-field {
  display: grid;
  gap: 8px;
}

.form label {
  color: var(--muted);
  font-size: 14px;
}

.form input,
.form select,
.form textarea {
  width: 100%;
  min-height: 42px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfdff;
  color: var(--ink);
  font: inherit;
  outline: none;
}

.form input[type="checkbox"] {
  width: 18px;
  min-width: 18px;
  height: 18px;
  min-height: 18px;
  padding: 0;
  margin: 0;
  accent-color: #344d63;
}

.form input[type="file"] {
  display: flex;
  align-items: center;
  padding: 9px 10px;
}

.form textarea {
  min-height: 120px;
  resize: vertical;
}

.checkbox-field {
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--control);
}

.checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink) !important;
  font-weight: 600;
}

.form-field small {
  color: var(--muted);
  font-size: 13px;
}

.form-field .errorlist {
  margin: 0;
  padding-left: 18px;
  color: #b42318;
}

.ozp-import-panel {
  padding: 30px 32px;
}

.ozp-import-panel h1 {
  margin-bottom: 18px;
}

.ozp-import-panel > .muted {
  max-width: 980px;
  margin: 0 0 24px;
  line-height: 1.55;
}

.upload-form {
  display: grid;
  gap: 22px;
}

.upload-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.upload-grid.single {
  grid-template-columns: minmax(0, 720px);
}

.upload-card {
  display: grid;
  align-content: start;
  min-height: 140px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfcfe;
  gap: 12px;
}

.upload-card span {
  color: var(--ink);
  font-weight: 700;
}

.upload-card small {
  color: var(--muted);
  line-height: 1.4;
}

.upload-card input[type="file"] {
  min-height: 46px;
  padding: 10px 12px;
  background: white;
}

.form-actions {
  display: flex;
  justify-content: flex-start;
  gap: 12px;
  flex-wrap: wrap;
}

.form-actions .button {
  min-width: 230px;
}

.pdf-tools-form .upload-card {
  min-height: 116px;
}

.pdf-tools-ranges {
  min-height: auto;
}

.pdf-tools-page {
  display: grid;
  gap: 20px;
  width: min(1480px, calc(100vw - 48px));
  margin: 26px auto;
  padding: 24px;
}

.pdf-tool-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f6f8fb;
}

.pdf-tool-tabs button {
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: 7px;
  color: var(--muted);
  background: transparent;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.pdf-tool-tabs button.is-active {
  color: var(--ink);
  border-color: #c9d3df;
  background: #ffffff;
  box-shadow: 0 6px 18px rgba(30, 42, 58, 0.08);
}

.pdf-tool-panels {
  display: grid;
}

.pdf-tool-panel {
  display: none;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfcfe;
}

.pdf-tool-panel.is-active {
  display: grid;
  gap: 8px;
}

.pdf-tool-panel h2 {
  margin: 0;
  font-size: 22px;
}

.pdf-tool-panel p {
  max-width: 860px;
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.check-row {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  font-weight: 600;
}

.check-row input {
  width: 20px;
  height: 20px;
}

.pdf-tools-page .section-title-row {
  margin: 0;
  align-items: flex-start;
}

.pdf-tools-page .upload-grid {
  gap: 16px;
}

.pdf-tools-page .upload-card {
  padding: 18px 20px;
}

.pdf-tools-page .form-actions {
  padding-top: 2px;
}

.pdf-operation-fields {
  display: grid;
  gap: 16px;
}

.pdf-jobs-panel {
  gap: 16px;
}

.pdf-jobs-panel .section-title-row {
  padding: 0;
}

.pdf-jobs-panel h2 {
  margin: 0;
}

.pdf-jobs-scroll {
  max-height: min(620px, calc(100vh - 360px));
  min-height: 220px;
  overflow: auto;
  padding-right: 6px;
}

.upload-center {
  padding: 30px 32px;
}

.upload-center > .muted {
  margin: 0 0 24px;
}

.upload-type-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.upload-type-card {
  display: grid;
  min-height: 150px;
  padding: 22px;
  align-content: start;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfcfe;
  color: var(--ink);
  text-decoration: none;
}

.upload-type-card:hover {
  background: white;
  border-color: #cfd7e2;
}

.upload-type-card strong {
  font-size: 20px;
}

.upload-type-card span {
  color: var(--muted);
  line-height: 1.45;
}

.report-builder {
  display: grid;
  gap: 18px;
  padding: 24px;
}

.report-builder > .section-title-row {
  align-items: flex-start;
  margin: 0;
}

.report-builder h1,
.report-builder h2 {
  margin: 0;
}

.report-builder .muted {
  margin: 6px 0 0;
}

.report-form {
  display: grid;
  gap: 16px;
}

.report-sticky-actions {
  position: sticky;
  top: 77px;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(24, 26, 32, 0.96);
  backdrop-filter: blur(10px);
}

.report-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.report-grid {
  display: grid;
  grid-template-columns: minmax(320px, 0.9fr) minmax(420px, 1.1fr);
  gap: 16px;
}

.report-card {
  display: grid;
  align-content: start;
  gap: 16px;
  min-width: 0;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
}

.report-filter {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto auto auto;
  gap: 10px;
}

.report-filter input[type="search"] {
  width: 100%;
  min-height: 42px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--control);
  color: var(--ink);
  font: inherit;
  outline: none;
}

.report-filter input[type="search"]:focus {
  border-color: #3f4b5c;
  box-shadow: 0 0 0 2px rgba(47, 129, 247, 0.14);
}

.report-checkbox-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 10px;
  max-height: 64vh;
  overflow: auto;
  padding-right: 4px;
}

.report-checkbox-grid.compact {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.report-checkbox-grid label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-height: 38px;
  padding: 9px 11px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: var(--control);
  color: var(--ink);
}

.report-checkbox-grid label[hidden] {
  display: none;
}

.form .report-checkbox-grid input[type="checkbox"] {
  flex: 0 0 auto;
  width: 16px;
  min-height: 16px;
  height: 16px;
  margin-top: 3px;
  padding: 0;
  accent-color: #8b949e;
}

.report-checkbox-grid span {
  display: block;
  min-width: 0;
  line-height: 1.35;
}

.import-report {
  display: grid;
  gap: 12px;
}

.import-result {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfcfe;
}

.import-result.compact {
  padding: 18px 20px;
}

.import-result.has-errors {
  border-color: #e4c26a;
}

.import-result > div {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 16px;
}

.import-result > div span {
  color: var(--muted);
}

.import-result dl {
  display: grid;
  grid-template-columns: minmax(220px, 34%) 1fr;
  margin: 0;
  gap: 8px 18px;
}

.import-result dt {
  color: var(--muted);
}

.import-result dd {
  margin: 0;
}

.import-result ul {
  margin: 0;
  padding-left: 20px;
  color: #8a5a00;
}

.import-help {
  display: grid;
  gap: 8px;
  margin: 0 0 22px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-soft);
  color: var(--muted);
}

.import-help strong {
  color: var(--ink);
}

.import-help code {
  display: block;
  padding: 10px 12px;
  overflow-x: auto;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: var(--control);
  color: var(--ink);
  font: 14px/1.45 "SFMono-Regular", Consolas, monospace;
  white-space: nowrap;
}

.import-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 0 0 16px;
}

.import-summary article {
  display: grid;
  gap: 6px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
}

.import-summary span {
  color: var(--muted);
}

.import-summary strong {
  color: var(--ink);
  font-size: 28px;
  line-height: 1.1;
}

.server-archive-list {
  display: grid;
  gap: 14px;
  margin-top: 24px;
}

.server-archive-list h3 {
  margin: 0;
}

.server-import-row {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) auto;
  gap: 12px;
  align-items: center;
}

.background-job-list {
  display: grid;
  gap: 12px;
}

.background-job {
  display: grid;
  gap: 10px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
}

.background-job > div:first-child {
  display: grid;
  gap: 4px;
}

.background-job > div:first-child span,
.background-job > div:first-child small {
  color: var(--muted);
}

.background-job-progress {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-weight: 700;
}

.background-job-progress div {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #e5eaf1;
}

.background-job-progress i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: #7f8b9a;
}

.background-job-completed .background-job-progress i {
  background: #5f8f72;
}

.background-job-failed .background-job-progress i {
  background: #a45f5f;
}

.background-job-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  color: var(--muted);
}

.pdf-job-widget {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 60;
  width: min(420px, calc(100vw - 32px));
}

.pdf-job-widget-toggle {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 58px;
  padding: 10px 14px;
  border: 1px solid #c9d3df;
  border-radius: 12px;
  background: #ffffff;
  color: var(--ink);
  box-shadow: 0 16px 42px rgba(30, 42, 58, 0.18);
  cursor: pointer;
  text-align: left;
}

.pdf-job-widget-toggle span {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: #eef3f8;
  color: #334155;
  font-weight: 900;
}

.pdf-job-widget.has-active .pdf-job-widget-toggle span {
  color: #1f4d34;
  background: #dff2e7;
}

.pdf-job-widget-body {
  display: none;
  max-height: 420px;
  margin-top: 10px;
  overflow: auto;
  padding: 12px;
  border: 1px solid #c9d3df;
  border-radius: 12px;
  background: #ffffff;
  box-shadow: 0 16px 42px rgba(30, 42, 58, 0.18);
}

.pdf-job-widget.is-open .pdf-job-widget-body {
  display: block;
}

.pdf-job-widget .background-job {
  padding: 12px;
  gap: 8px;
}

.pdf-job-widget .background-job + .background-job {
  margin-top: 10px;
}

.pdf-job-widget .background-job-meta {
  font-size: 13px;
}

.pdf-job-widget .button {
  min-height: 34px;
  padding: 0 12px;
}

.background-job-head,
.background-job-stats {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.background-job-head div {
  display: grid;
  gap: 4px;
}

.background-job-head span,
.background-job-stats {
  color: var(--muted);
  font-size: 14px;
}

.background-job progress {
  width: 100%;
  height: 8px;
  accent-color: #8c939f;
}

.background-job-failed {
  border-color: #9b5b5b;
}

.background-job-completed progress {
  accent-color: #6f8f7a;
}

@media (max-width: 720px) {
  .pdf-tools-page {
    width: min(100% - 24px, 1480px);
    margin: 14px auto;
    padding: 16px;
  }

  .pdf-tool-tabs {
    gap: 6px;
  }

  .pdf-tool-tabs button {
    flex: 1 1 150px;
  }

  .server-import-row {
    grid-template-columns: 1fr;
  }

  .background-job-head,
  .background-job-stats {
    align-items: flex-start;
    flex-direction: column;
    gap: 6px;
  }
}

.ozp-workspace {
  display: grid;
  gap: 14px;
  padding: 18px 20px 20px;
}

.ozp-workspace > .section-title-row {
  align-items: flex-start;
  margin: 0;
}

.ozp-workspace > .section-title-row h1 {
  margin: 0 0 6px;
  font-size: 28px;
}

.ozp-workspace > .section-title-row .muted {
  margin: 0;
  line-height: 1.35;
}

.ozp-folder-strip {
  display: flex;
  align-items: center;
  min-height: 50px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfcfe;
}

.ozp-folder-strip span {
  display: block;
  color: var(--muted);
  font-size: 14px;
}

.ozp-folder-strip strong {
  display: block;
  color: var(--ink);
}

.ozp-package-form {
  display: grid;
  gap: 16px;
}

.ozp-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.ozp-summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.ozp-summary-grid > div {
  display: grid;
  gap: 4px;
  min-height: 78px;
  padding: 14px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfcfe;
}

.ozp-summary-grid span {
  color: var(--muted);
}

.ozp-summary-grid strong {
  color: var(--ink);
  font-size: 26px;
  line-height: 1.1;
}

.ozp-step {
  display: grid;
  gap: 14px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfcfe;
}

.ozp-step h2,
.ozp-step p {
  margin: 0;
}

.ozp-template-list,
.ozp-house-picker {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfcfe;
}

.ozp-house-actions {
  position: sticky;
  top: 88px;
  z-index: 10;
  margin: -20px -20px 16px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
  background: rgba(251, 252, 254, 0.96);
  backdrop-filter: saturate(180%) blur(10px);
}

.ozp-house-actions h2,
.ozp-house-actions p {
  margin: 0;
}

.ozp-house-actions [data-selected-houses-count] {
  display: inline-flex;
  margin-top: 8px;
}

.ozp-house-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.template-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.template-list span {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: white;
  color: var(--ink);
}

.house-checkbox-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  max-height: 560px;
  overflow: auto;
  padding: 2px 6px 2px 2px;
}

.house-checkbox-grid label {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 50px;
  padding: 11px 13px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: #ffffff;
  color: var(--ink);
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease, box-shadow .15s ease;
}

.house-checkbox-grid label:hover {
  background: var(--panel-soft);
  border-color: #c5d0db;
}

.house-checkbox-grid label:has(input:checked) {
  background: var(--brand-soft);
  border-color: #9fb2c2;
  box-shadow: inset 3px 0 0 var(--brand);
}

.form .house-checkbox-grid input[type="checkbox"] {
  flex: 0 0 auto;
  width: 18px;
  min-height: 18px;
  height: 18px;
  margin: 0;
  padding: 0;
  accent-color: var(--brand);
}

.house-checkbox-grid span {
  display: block;
  min-width: 0;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.house-picker-toolbar {
  margin-bottom: 12px;
}

.form .house-picker-toolbar input {
  width: min(100%, 520px);
  min-height: 42px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
  color: var(--ink);
  font: inherit;
  outline: none;
}

.auth-panel {
  max-width: 520px;
  margin: 40px auto;
  padding: 28px;
}

.auth-panel.wide { max-width: 760px; }

/* Light application shell */
.topbar,
.detail-tabs,
.ozp-house-actions {
  background: rgba(255, 255, 255, 0.96);
}

.nav-search,
.search-form input,
.form input,
.form select,
.form textarea,
.upload-card input[type="file"] {
  background: var(--control);
  color: var(--ink);
}

.message,
.button,
.house-row,
.doc-empty,
.template-list span,
.house-checkbox-grid label {
  background: var(--control-strong);
  color: var(--ink);
}

.button.primary {
  background: #344d63;
  color: #ffffff;
  border-color: #344d63;
}

.button.primary:hover {
  background: #293f52;
  color: #ffffff;
}

.search-hero,
.panel,
.auth-panel,
.house-header,
.two-column > div,
.two-column > aside,
section:not(.search-hero):not(.panel):not(.auth-panel):not(.house-header),
.characteristic-group,
.doc-section,
.empty,
.upload-card,
.upload-type-card,
.import-result,
.ozp-folder-strip,
.ozp-summary-grid > div,
.ozp-step,
.ozp-template-list,
.ozp-house-picker {
  background: var(--panel);
}

.nav-search > button,
.upload-type-card:hover,
.doc-empty-action:hover,
.button:hover,
.house-row:hover {
  background: var(--hover);
  color: var(--ink);
  border-color: var(--line);
}

.ozp-folder-strip,
.ozp-summary-grid > div,
.ozp-step,
.ozp-template-list,
.ozp-house-picker,
.upload-card,
.upload-type-card,
.import-result,
.house-row,
.doc-section,
.characteristic-group {
  border-color: var(--line);
}

.search-form input:focus,
.form input:focus,
.form select:focus,
.form textarea:focus,
.nav-search:focus-within {
  border-color: #9fb2c2;
  box-shadow: 0 0 0 3px rgba(70, 100, 127, 0.1);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin: 22px 0;
}

.stat-card {
  display: grid;
  gap: 8px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.stat-card span {
  color: var(--muted);
}

.stat-card strong {
  font-size: 28px;
  line-height: 1;
}

.table-scroll {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 980px;
}

.data-table th,
.data-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.data-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--surface);
  color: var(--muted);
  font-weight: 700;
}

.data-table td.ok {
  color: var(--ink);
  font-weight: 700;
}

.data-table td.empty {
  color: var(--muted);
}

.data-table td > a {
  display: block;
  color: var(--ink);
  font-weight: 700;
}

.data-table td > .muted {
  display: block;
  margin-top: 4px;
  font-size: 13px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: var(--control);
  font-weight: 700;
  white-space: nowrap;
}

.status-pill.ok {
  color: #146c43;
  border-color: #badbcc;
  background: #d1e7dd;
}

.ozp-dashboard,
.ozp-report-page {
  margin-bottom: 22px;
}

.ozp-dashboard {
  padding: 24px 28px;
}

.title-link {
  color: var(--ink);
  text-decoration: none;
}

.title-link:hover {
  text-decoration: underline;
  text-underline-offset: 4px;
}

.ozp-corner-widget {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 80;
  width: min(320px, calc(100vw - 36px));
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow);
  backdrop-filter: saturate(180%) blur(10px);
}

.ozp-widget-title {
  display: inline-flex;
  margin-bottom: 12px;
  color: var(--ink);
  font-size: 18px;
  font-weight: 750;
}

.ozp-battery {
  position: relative;
  height: 22px;
  margin-right: 10px;
  border: 1px solid #b8c4cf;
  border-radius: 6px;
  background: #eef2f6;
}

.ozp-battery::after {
  content: "";
  position: absolute;
  top: 5px;
  right: -8px;
  width: 6px;
  height: 10px;
  border-radius: 0 4px 4px 0;
  background: #b8c4cf;
}

.ozp-battery span {
  display: block;
  width: var(--ozp-progress, 0%);
  height: 100%;
  border-radius: 5px;
  background: linear-gradient(90deg, #d97b63 0%, #d9b95f 45%, #4f9f70 100%);
}

.ozp-corner-widget dl {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 12px 0 8px;
}

.ozp-corner-widget dl div {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.ozp-corner-widget dt {
  color: var(--muted);
  font-size: 12px;
}

.ozp-corner-widget dd {
  margin: 0;
  font-weight: 750;
}

.ozp-corner-widget p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.ozp-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  margin-top: 18px;
}

.ozp-summary-grid.large {
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
}

.ozp-summary-card {
  display: grid;
  gap: 8px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface) 88%, var(--bg));
}

.ozp-summary-card span {
  color: var(--muted);
}

.ozp-summary-card strong {
  font-size: 26px;
  line-height: 1;
}

.ozp-summary-card.accent {
  border-color: #9fb2c2;
  background: linear-gradient(180deg, rgba(70, 100, 127, 0.08), rgba(70, 100, 127, 0.02));
}

.ozp-problems,
.ozp-section {
  margin-top: 26px;
}

.ozp-problem-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
}

.ozp-problem-card {
  display: grid;
  gap: 12px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.ozp-problem-card div {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

.ozp-problem-card span {
  color: var(--muted);
}

.section-title-row.compact {
  margin-bottom: 12px;
}

.form-panel {
  max-width: 980px;
  margin: 0 auto;
  padding: 28px 32px;
}

.form-heading {
  margin-bottom: 22px;
}

.form-heading h1 {
  margin: 0;
}

.clean-form {
  display: grid;
  gap: 18px;
}

.form-field {
  display: grid;
  gap: 8px;
}

.form-field label {
  color: var(--muted);
  font-weight: 700;
}

.form-field input,
.form-field select,
.form-field textarea {
  width: 100%;
}

.form-field textarea {
  min-height: 160px;
  resize: vertical;
}

.checkbox-field {
  display: flex;
  align-items: center;
  gap: 12px;
}

.checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.checkbox-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
}

.form-actions {
  display: flex;
  justify-content: flex-start;
  padding-top: 6px;
}

.message-warning,
.import-result.has-errors {
  border-color: #b08800;
}

.import-result ul {
  color: #8a5a00;
}

input[type="file"]::file-selector-button {
  min-height: 32px;
  margin-right: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--control-strong);
  color: var(--ink);
  font: inherit;
  cursor: pointer;
}

input[type="file"]::file-selector-button:hover {
  background: var(--hover);
}

.panel.form-panel {
  width: min(100%, 980px);
  max-width: 980px;
  margin: 32px auto;
  padding: 32px;
}

.panel.form-panel .form-heading {
  margin: 0 0 24px;
}

.panel.form-panel .form-heading h1 {
  margin: 0;
  line-height: 1.2;
}

.form.clean-form {
  display: grid;
  gap: 18px;
}

.form.clean-form .form-field {
  display: grid;
  gap: 8px;
}

.form.clean-form textarea {
  min-height: 130px;
  max-height: 320px;
}

.form.clean-form .checkbox-field {
  display: flex;
  align-items: center;
  min-height: 48px;
  padding: 12px 14px;
}

.form.clean-form .checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink) !important;
  font-weight: 650;
}

.form.clean-form .form-actions {
  margin-top: 4px;
}

.form.clean-form .form-actions .button {
  min-width: 180px;
}

.form input[type="checkbox"] {
  width: 18px;
  min-width: 18px;
  max-width: 18px;
  height: 18px;
  min-height: 18px;
  max-height: 18px;
  padding: 0;
  flex: 0 0 18px;
}

@media (max-width: 1200px) {
  .house-checkbox-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
    padding: 14px 20px;
  }

  .detail-tabs {
    top: 116px;
  }

  .brand strong {
    max-width: calc(100vw - 100px);
    white-space: normal;
  }

  .nav {
    justify-content: flex-start;
  }

  .nav-search {
    width: 100%;
    min-width: min(420px, calc(100vw - 40px));
    max-width: 100%;
  }
}

@media (max-width: 760px) {
  .main { padding: 20px 16px; }
  .messages { padding: 0 20px; }
  .house-header,
  .search-form,
  .house-row,
  .section-title-row {
    flex-direction: column;
    align-items: stretch;
  }
  .two-column { grid-template-columns: 1fr; }
  .nav-search {
    min-width: 100%;
  }
  .detail-tabs {
    top: 0;
    margin: 12px 0 18px;
  }
  .detail-tabs button {
    min-height: 36px;
    padding: 0 12px;
  }
  .detail-section {
    scroll-margin-top: 84px;
  }
  .kv,
  .kv.compact,
  .kv-readable { grid-template-columns: 1fr; }
  .characteristic-groups {
    grid-template-columns: 1fr;
  }
  .house-checkbox-grid {
    grid-template-columns: 1fr;
  }
  .characteristic-group {
    padding: 16px;
  }
  .kv-readable dt {
    padding: 10px 0 2px;
  }
  .kv-readable dd {
    padding: 0 0 10px;
    border-top: 0;
  }
  .upload-grid,
  .upload-type-grid,
  .ozp-grid,
  .ozp-summary-grid,
  .report-grid,
  .import-result dl {
    grid-template-columns: 1fr;
  }
  .report-sticky-actions {
    top: 12px;
    align-items: stretch;
    flex-direction: column;
  }
  .report-filter {
    grid-template-columns: 1fr;
  }
  .ozp-house-actions {
    top: 12px;
    align-items: stretch;
    flex-direction: column;
  }
  .ozp-house-buttons,
  .report-actions,
  .report-actions .button,
  .ozp-house-buttons .button {
    width: 100%;
  }
  .ozp-import-panel {
    padding: 22px;
  }
  .form-actions .button {
    width: 100%;
  }
  .search-hero,
  .auth-panel,
  .house-header,
  .two-column > div,
  .two-column > aside,
  section:not(.search-hero):not(.panel):not(.auth-panel):not(.house-header) {
    padding: 20px;
  }
}
