:root {
  color-scheme: light;
  --ink: #172026;
  --muted: #65717a;
  --line: #d9e1e5;
  --surface: #ffffff;
  --panel: #f5f7f8;
  --accent: #0f766e;
  --accent-dark: #115e59;
  --danger: #a63232;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  color: var(--ink);
  background: var(--panel);
}

a {
  color: var(--accent-dark);
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(280px, 360px) 1fr;
}

.search-panel {
  background: var(--surface);
  border-right: 1px solid var(--line);
  padding: 28px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  font-size: 30px;
  line-height: 1.1;
}

h2 {
  font-size: 22px;
}

h3 {
  font-size: 16px;
  margin-bottom: 10px;
}

.search-form {
  display: grid;
  gap: 16px;
  margin-top: 28px;
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

input {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px 12px;
  color: var(--ink);
  font-size: 15px;
  background: #fff;
}

select {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px 12px;
  color: var(--ink);
  font-size: 15px;
  background: #fff;
}

button {
  min-height: 42px;
  border: 0;
  border-radius: 6px;
  padding: 10px 14px;
  color: #fff;
  background: var(--accent);
  font-weight: 700;
  cursor: pointer;
}

button:disabled {
  opacity: 0.65;
  cursor: wait;
}

.results-panel {
  min-width: 0;
  padding: 28px;
}

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

.results-header p {
  margin: 6px 0 0;
  color: var(--muted);
}

.status {
  margin-bottom: 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 12px;
  background: #fff;
}

.status[data-type="error"] {
  color: var(--danger);
  border-color: #e8b8b8;
}

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

table {
  width: 100%;
  min-width: 1180px;
  border-collapse: collapse;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 12px;
  text-align: left;
  vertical-align: top;
  font-size: 13px;
}

th {
  color: var(--muted);
  background: #f9fbfb;
  font-size: 12px;
  text-transform: uppercase;
}

.empty-cell {
  color: var(--muted);
  text-align: center;
}

.score-button {
  width: 48px;
  min-height: 34px;
  padding: 6px 8px;
  background: var(--accent-dark);
}

.detail-panel {
  position: fixed;
  inset: 0 0 0 auto;
  width: min(520px, 100vw);
  overflow: auto;
  border-left: 1px solid var(--line);
  background: #fff;
  box-shadow: -12px 0 36px rgb(23 32 38 / 16%);
  padding: 24px;
}

.detail-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
}

.detail-header button {
  min-height: 36px;
  color: var(--ink);
  background: #e8eef0;
}

.detail-content {
  display: grid;
  gap: 24px;
}

.detail-content section {
  border-top: 1px solid var(--line);
  padding-top: 18px;
}

.field-list {
  display: grid;
  gap: 10px;
  margin: 0;
}

.field-list div {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 12px;
}

dt {
  color: var(--muted);
  font-weight: 700;
}

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

.score-list {
  display: grid;
  gap: 8px;
  padding-left: 18px;
}

.score-list span {
  display: block;
  color: var(--muted);
  margin-top: 3px;
}

.score-total,
.offer {
  font-weight: 700;
}

@media (max-width: 860px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .search-panel {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .search-form {
    grid-template-columns: 1fr 1fr;
  }

  .search-form button {
    grid-column: 1 / -1;
  }
}

@media (max-width: 560px) {
  .search-form,
  .field-list div {
    grid-template-columns: 1fr;
  }

  .search-panel,
  .results-panel,
  .detail-panel {
    padding: 18px;
  }
}
