:root {
  color-scheme: light;
  --bg: #07182f;
  --surface: #fbf8ee;
  --surface-soft: #f4ecd7;
  --ink: #132033;
  --muted: #637083;
  --line: #d8cba8;
  --accent: #c9972b;
  --accent-strong: #a97915;
  --accent-ink: #07182f;
  --amber: #9a6700;
  --red: #b42318;
  --green: #1f7a55;
  --blue: #123e73;
  --shadow: 0 18px 45px rgba(2, 12, 27, 0.24);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(115deg, rgba(201, 151, 43, 0.2), transparent 38%),
    linear-gradient(180deg, #0b2445 0%, var(--bg) 56%, #061326 100%),
    var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
textarea,
select {
  font: inherit;
}

.app-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 32px 0;
}

.workspace {
  display: grid;
  gap: 18px;
}

.topbar,
.panel-heading,
.actions,
.result-meta,
.result-footer {
  display: flex;
  align-items: center;
}

.topbar {
  justify-content: space-between;
  gap: 16px;
  padding: 4px 0 8px;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: clamp(2rem, 6vw, 4.5rem);
  line-height: 0.95;
  letter-spacing: 0;
  color: #fff7dd;
  text-shadow: 0 3px 18px rgba(0, 0, 0, 0.24);
}

h2 {
  font-size: 1.05rem;
}

.panel-heading {
  justify-content: space-between;
  gap: 14px;
}

.panel-heading p,
.empty-state,
.result-reasons,
.match-detail {
  color: var(--muted);
}

.input-panel,
.results-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 18px;
}

textarea {
  width: 100%;
  min-height: 260px;
  margin-top: 16px;
  padding: 14px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  background: #fffcf4;
  line-height: 1.45;
}

textarea:focus,
select:focus,
button:focus-visible {
  outline: 3px solid rgba(201, 151, 43, 0.34);
  outline-offset: 2px;
}

.actions {
  justify-content: flex-end;
  gap: 10px;
  margin-top: 14px;
}

button,
select {
  min-height: 40px;
  border: 1px solid transparent;
  border-radius: 6px;
}

button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 14px;
  color: var(--accent-ink);
  background: var(--accent);
  font-weight: 650;
  cursor: pointer;
}

button:hover {
  background: var(--accent-strong);
}

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

button.secondary {
  color: var(--ink);
  background: var(--surface-soft);
  border-color: var(--line);
}

button.secondary:hover {
  background: #eadcb8;
}

select {
  width: 170px;
  padding: 0 34px 0 12px;
  border-color: var(--line);
  background: #fffcf4;
  color: var(--ink);
}

.status-pill {
  flex: 0 0 auto;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(251, 248, 238, 0.92);
  color: var(--blue);
  font-size: 0.9rem;
  font-weight: 600;
}

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

.summary-grid article {
  min-height: 92px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(251, 248, 238, 0.94);
}

.summary-grid span {
  display: block;
  font-size: 2rem;
  font-weight: 700;
}

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

.empty-state {
  display: grid;
  gap: 6px;
  padding: 34px 18px;
  text-align: center;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: #fffcf4;
}

.results-list {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.result-card {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-left-width: 5px;
  border-radius: 8px;
  background: #fffcf4;
}

.result-card.likely {
  border-left-color: var(--green);
}

.result-card.uncertain {
  border-left-color: var(--amber);
}

.result-card.suspicious {
  border-left-color: var(--red);
}

.result-meta {
  justify-content: space-between;
  gap: 10px;
}

.status {
  padding: 5px 9px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
}

.status.likely {
  color: var(--green);
  background: #e5f3ec;
}

.status.uncertain {
  color: var(--amber);
  background: #f8e7bd;
}

.status.suspicious {
  color: var(--red);
  background: #f9dfdc;
}

.confidence {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 600;
}

.reference-text {
  overflow-wrap: anywhere;
  line-height: 1.45;
}

.result-reasons {
  margin: 0;
  padding-left: 20px;
  line-height: 1.45;
}

.result-footer {
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding-top: 4px;
  border-top: 1px solid var(--line);
}

.match-detail {
  min-width: 220px;
  flex: 1;
}

.match-link {
  color: var(--blue);
  font-weight: 650;
  text-decoration: none;
}

.match-link:hover {
  text-decoration: underline;
}

@media (max-width: 760px) {
  .app-shell {
    width: min(100% - 20px, 1180px);
    padding: 18px 0;
  }

  .topbar,
  .panel-heading,
  .actions,
  .result-meta {
    align-items: stretch;
    flex-direction: column;
  }

  .actions button,
  select {
    width: 100%;
  }

  .summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
