:root {
  --purple: #6b3fa0;
  --purple-hover: #5a3488;
  --purple-soft: #f3ecfa;
  --green-bg: #e8f6ec;
  --green-text: #1f6b3a;
  --green-icon: #2e9b57;
  --ink: #1a1a1a;
  --muted: #6b7280;
  --line: #e5e7eb;
  --frame: #3a3a3a;
  --bg: #f7f7f9;
  --white: #ffffff;
  --danger: #b42318;
  --radius: 10px;
  --shadow: 0 10px 30px rgba(17, 24, 39, 0.08);
  font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: linear-gradient(180deg, #faf8fc 0%, var(--bg) 40%, #f0f2f5 100%);
  color: var(--ink);
}

body {
  min-height: 100vh;
}

.page {
  max-width: 1440px;
  margin: 0 auto;
  padding: 20px 24px 32px;
}

[hidden] {
  display: none !important;
}

.topbar {
  display: flex;
  align-items: center;
  margin-bottom: 28px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 40px;
  padding: 0 14px;
  border-radius: 10px;
  background: var(--purple);
  color: white;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.panel {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 36px 32px;
  max-width: 560px;
}

.search-panel h1 {
  margin: 0 0 8px;
  font-size: 1.75rem;
  letter-spacing: -0.02em;
}

.lede {
  margin: 0 0 28px;
  color: var(--muted);
  line-height: 1.5;
}

.lookup-form label {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 8px;
  color: #374151;
}

.input-row {
  display: flex;
  gap: 10px;
}

.input-row input {
  flex: 1;
  min-width: 0;
  border: 1px solid #cfd4dc;
  border-radius: 8px;
  padding: 12px 14px;
  font-size: 1rem;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.input-row input:focus {
  border-color: var(--purple);
  box-shadow: 0 0 0 3px rgba(107, 63, 160, 0.15);
}

.input-row button,
.btn-outline {
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 600;
}

.input-row button {
  border: none;
  border-radius: 8px;
  background: var(--purple);
  color: white;
  padding: 12px 20px;
  white-space: nowrap;
}

.input-row button:hover {
  background: var(--purple-hover);
}

.input-row button:disabled {
  opacity: 0.65;
  cursor: wait;
}

.error {
  margin: 12px 0 0;
  color: var(--danger);
  font-size: 0.92rem;
}

.result-layout {
  display: grid;
  grid-template-columns: minmax(300px, 380px) minmax(0, 1fr);
  gap: 20px;
  align-items: stretch;
  min-height: calc(100vh - 100px);
}

.result-meta {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 20px;
  align-self: start;
}

.btn-outline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--white);
  color: var(--purple);
  border: 1.5px solid var(--purple);
  border-radius: 8px;
  padding: 10px 14px;
  margin-bottom: 16px;
}

.btn-outline:hover {
  background: var(--purple-soft);
}

.success-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--green-bg);
  color: var(--green-text);
  border-radius: 8px;
  padding: 12px 14px;
  font-weight: 600;
  margin-bottom: 22px;
}

.success-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--green-icon);
  color: white;
  font-size: 0.75rem;
  flex-shrink: 0;
}

.fields {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.field label {
  display: block;
  font-size: 0.82rem;
  color: var(--muted);
  margin-bottom: 4px;
}

.field .value {
  font-size: 1.02rem;
  font-weight: 700;
  line-height: 1.35;
  word-break: break-word;
}

.result-pdf {
  min-height: 70vh;
}

.pdf-frame {
  background: var(--frame);
  border-radius: 12px;
  overflow: hidden;
  height: calc(100vh - 120px);
  min-height: 640px;
  box-shadow: var(--shadow);
}

.pdf-frame iframe {
  width: 100%;
  height: 100%;
  border: 0;
  background: #525252;
}

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

  .pdf-frame {
    height: 70vh;
    min-height: 480px;
  }

  .panel {
    padding: 28px 20px;
  }
}
