:root {
  --bg: #eef3f5;
  --panel: #ffffff;
  --ink: #18242b;
  --muted: #5d6f7a;
  --line: #d8e3e7;
  --brand: #007f86;
  --brand-dark: #104e57;
  --soft: #e6f5f6;
  --surface: #f8fbfc;
  --warn: #a85f00;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Segoe UI", Arial, sans-serif;
  color: var(--ink);
  background:
    linear-gradient(180deg, #f8fbfc 0, var(--bg) 280px),
    var(--bg);
}

header {
  display: grid;
  place-items: center;
  padding: 24px 28px 18px;
  color: #fff;
  background:
    linear-gradient(135deg, #15343c 0%, #18323a 48%, #0f4c55 100%);
  border-bottom: 4px solid var(--brand);
  text-align: center;
  box-shadow: 0 10px 28px rgba(12, 36, 44, .18);
}

.header-title {
  width: min(1120px, 100%);
}

h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 6px; font-size: clamp(24px, 3.2vw, 40px); line-height: 1.1; letter-spacing: 0; }
h2 { font-size: 24px; }
.header-title h2 {
  margin: 0;
  color: #d9edf0;
  font-size: clamp(18px, 1.9vw, 25px);
  font-weight: 700;
}
h3 { font-size: 17px; }

.status {
  display: none;
}

main {
  width: min(1320px, calc(100vw - 28px));
  margin: 16px auto 24px;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 12px 28px rgba(19, 43, 52, .07);
  padding: 16px;
  margin-bottom: 12px;
}

.controls {
  display: grid;
  grid-template-columns: 2fr 1fr auto;
  gap: 10px;
  align-items: end;
}

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

input, select, button {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 9px 11px;
  font: inherit;
  background: #fff;
  color: var(--ink);
  box-shadow: 0 1px 0 rgba(24, 36, 43, .03);
}

input:focus, select:focus {
  outline: 2px solid rgba(0, 124, 137, .24);
  border-color: var(--brand);
}

button {
  cursor: pointer;
  background: linear-gradient(180deg, #078c94, var(--brand));
  color: #fff;
  border-color: var(--brand);
  font-weight: 700;
}

.content {
  display: grid;
  grid-template-columns: 330px 1fr;
  gap: 12px;
  min-height: 500px;
}

.results {
  overflow: hidden;
  display: grid;
  grid-template-rows: auto 1fr;
}

.result-count {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 13px;
}

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

.result-item {
  display: block;
  width: 100%;
  min-height: 0;
  padding: 11px 12px;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: #fff;
  color: var(--ink);
  text-align: left;
  font-weight: 600;
}

.result-item:hover {
  background: #f4fafb;
}

.result-item.active {
  background: var(--soft);
  box-shadow: inset 4px 0 0 var(--brand);
}

.detail {
  min-width: 0;
}

.empty {
  display: grid;
  place-items: center;
  min-height: 140px;
  color: var(--muted);
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: var(--surface);
  text-align: center;
  padding: 24px;
}

.detail-title {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 14px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 12px;
  margin-bottom: 14px;
}

.badge {
  display: inline-block;
  padding: 5px 9px;
  border-radius: 999px;
  background: var(--soft);
  color: var(--brand-dark);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

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

.field {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: var(--surface);
}

.field span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 6px;
}

.field p {
  margin: 0;
  line-height: 1.45;
  white-space: pre-wrap;
}

.field.wide {
  grid-column: 1 / -1;
}

.notice {
  color: var(--warn);
  background: #fff8e8;
  border: 1px solid #f3d7a2;
  border-radius: 8px;
  padding: 11px;
  margin-bottom: 12px;
  font-size: 13px;
}

@media (max-width: 900px) {
  .content, .controls, .detail-grid {
    grid-template-columns: 1fr;
  }

  main { width: min(100vw - 18px, 1320px); }
}
