:root {
  color-scheme: light;
  font-family: "Segoe UI", Tahoma, Arial, sans-serif;
  background: #eef2f5;
  color: #17212b;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
}

body::before {
  background: linear-gradient(90deg, #0c4f57, #243447 54%, #8d6b1f);
  content: "";
  display: block;
  height: 5px;
}

h1,
h2,
h3,
p {
  margin: 0;
}

.topbar {
  align-items: center;
  background: #ffffff;
  border-bottom: 1px solid #d8dee6;
  display: flex;
  gap: 24px;
  justify-content: space-between;
  padding: 22px clamp(18px, 4vw, 48px);
}

.brand {
  align-items: center;
  display: flex;
  gap: 14px;
  min-width: 0;
}

.brand-mark {
  background:
    linear-gradient(#ffffff, #ffffff) padding-box,
    linear-gradient(135deg, #0d6b74, #b08223) border-box;
  border: 3px solid transparent;
  border-radius: 8px;
  display: inline-block;
  flex: 0 0 auto;
  height: 44px;
  position: relative;
  width: 44px;
}

.brand-mark::before,
.brand-mark::after {
  background: #243447;
  content: "";
  left: 10px;
  position: absolute;
  right: 10px;
}

.brand-mark::before {
  height: 12px;
  top: 10px;
}

.brand-mark::after {
  height: 4px;
  top: 27px;
}

h1 {
  color: #17212b;
  font-size: clamp(24px, 3vw, 36px);
  font-weight: 800;
  line-height: 1.15;
}

.topbar p {
  color: #66727f;
  margin-top: 6px;
}

.key-field {
  color: #52606d;
  min-width: min(100%, 300px);
}

.layout {
  display: grid;
  gap: 22px;
  grid-template-columns: minmax(330px, 430px) minmax(0, 1fr);
  padding: 24px clamp(18px, 4vw, 48px) 40px;
}

.panel,
.search-panel,
.document-card {
  background: #ffffff;
  border: 1px solid #d9e0e7;
  border-radius: 8px;
  box-shadow: 0 14px 28px rgba(21, 34, 45, .06);
}

.panel,
.search-panel {
  padding: 20px;
}

.archive-panel {
  align-self: start;
}

.workspace {
  display: grid;
  gap: 16px;
  min-width: 0;
}

.section-heading {
  border-bottom: 1px solid #e6ebf0;
  margin-bottom: 16px;
  padding-bottom: 14px;
}

.section-heading p {
  color: #0d6b74;
  font-size: 12px;
  font-weight: 800;
  margin-bottom: 4px;
}

h2 {
  font-size: 21px;
  line-height: 1.25;
}

form,
.field-stack {
  display: grid;
  gap: 14px;
}

label {
  color: #31404f;
  display: grid;
  font-size: 13px;
  font-weight: 800;
  gap: 7px;
}

input,
select,
button {
  border-radius: 6px;
  font: inherit;
  min-height: 44px;
}

input,
select {
  background: #fbfcfd;
  border: 1px solid #c7d0d9;
  color: #17212b;
  padding: 10px 12px;
  width: 100%;
}

input:focus,
select:focus {
  border-color: #0d6b74;
  box-shadow: 0 0 0 3px rgba(13, 107, 116, .14);
  outline: none;
}

.file-drop {
  background: #f4f8fa;
  border: 1px dashed #9eb2bf;
  border-radius: 8px;
  padding: 14px;
}

.file-drop input {
  background: #ffffff;
}

fieldset {
  border: 1px solid #dce3e9;
  border-radius: 8px;
  margin: 2px 0 0;
  padding: 14px;
}

legend {
  color: #0d6b74;
  font-size: 13px;
  font-weight: 900;
  padding: 0 8px;
}

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

button,
.download {
  align-items: center;
  background: #0d6b74;
  border: 1px solid #0d6b74;
  color: #ffffff;
  cursor: pointer;
  display: inline-flex;
  font-weight: 850;
  justify-content: center;
  padding: 10px 16px;
  text-align: center;
  text-decoration: none;
  white-space: nowrap;
}

button:hover,
.download:hover {
  background: #09545b;
  border-color: #09545b;
}

.primary-action {
  min-height: 48px;
}

.search-row {
  align-items: end;
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(0, 1fr) auto;
}

.results {
  display: grid;
  gap: 14px;
}

.empty-state,
.loading-state,
.error-state {
  background: #ffffff;
  border: 1px solid #d9e0e7;
  border-radius: 8px;
  color: #52606d;
  padding: 22px;
  text-align: center;
}

.error-state {
  border-color: #d9aaa6;
  color: #8f2f25;
}

.document-card {
  padding: 18px;
}

.document-heading {
  align-items: start;
  display: flex;
  gap: 16px;
  justify-content: space-between;
}

.document-heading h3 {
  font-size: 20px;
  line-height: 1.35;
  margin-top: 8px;
  overflow-wrap: anywhere;
}

.classification-pill {
  background: #f4ecd7;
  border: 1px solid #d8bd72;
  border-radius: 999px;
  color: #614a13;
  display: inline-flex;
  font-size: 12px;
  font-weight: 900;
  padding: 5px 10px;
}

.muted,
.status {
  color: #66727f;
  font-size: 13px;
  line-height: 1.6;
}

.location-map {
  background: #f7f9fb;
  border: 1px solid #dde5ec;
  border-radius: 8px;
  display: grid;
  gap: 1px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 16px;
  overflow: hidden;
}

.location-map div {
  background: #ffffff;
  display: grid;
  gap: 6px;
  min-width: 0;
  padding: 12px;
}

.location-map span {
  color: #66727f;
  font-size: 12px;
  font-weight: 800;
}

.location-map strong {
  color: #17212b;
  font-size: 16px;
  overflow-wrap: anywhere;
}

.instructions {
  background: #eaf5f3;
  border-inline-start: 4px solid #0d6b74;
  color: #1f423f;
  line-height: 1.7;
  margin-top: 14px;
  padding: 12px 14px;
}

@media (max-width: 960px) {
  .layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 680px) {
  .topbar,
  .document-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .brand {
    align-items: flex-start;
  }

  .search-row,
  .location-grid,
  .location-map {
    grid-template-columns: 1fr;
  }

  .download {
    width: 100%;
  }
}
