:root {
  color-scheme: dark;
  font-family: Inter, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(circle at 20% 10%, #23304a, #0b1020 55%);
  color: #eef2ff;
}

main {
  width: min(860px, calc(100% - 32px));
  margin: 32px auto;
  display: grid;
  gap: 20px;
}

.panel {
  background: rgba(17, 24, 39, .92);
  border: 1px solid #334155;
  border-radius: 24px;
  padding: 32px;
  box-shadow: 0 25px 80px #0008;
}

h1, h2 { margin: 0; }
h1 { font-size: clamp(28px, 5vw, 42px); }
h2 { font-size: 24px; }
.lead, .history-heading p { color: #aab6cd; }
.lead { margin: 8px 0 24px; }
.history-heading p { margin: 6px 0 0; }

.drop {
  min-height: 220px;
  border: 2px dashed #64748b;
  border-radius: 18px;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 24px;
  cursor: pointer;
  transition: .2s;
  background: #0f172a99;
}

.drop:hover, .drop.active {
  border-color: #60a5fa;
  background: #172554;
}

.drop strong { display: block; font-size: 20px; margin-bottom: 8px; }
input { display: none; }

button {
  width: 100%;
  margin-top: 16px;
  padding: 14px 18px;
  border: 0;
  border-radius: 12px;
  background: #3b82f6;
  color: white;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

button:disabled { opacity: .5; cursor: wait; }

.result {
  margin-top: 22px;
  display: none;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.result.show { display: grid; }

.card {
  background: #111827;
  border: 1px solid #374151;
  border-radius: 14px;
  padding: 16px;
}

.card span {
  display: block;
  color: #94a3b8;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.card b {
  display: block;
  margin-top: 7px;
  font-size: 23px;
  overflow-wrap: anywhere;
}

.status { grid-column: 1 / -1; color: #cbd5e1; }
.error { color: #fca5a5; }
.api-link { margin: 20px 0 0; }
a { color: #93c5fd; }

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

.history-actions { display: flex; gap: 8px; }
.history-actions button { width: auto; white-space: nowrap; margin: 0; padding: 10px 13px; }
.secondary { background: #334155; }
.danger { color: #fecaca; }
.empty-history { color: #94a3b8; margin-bottom: 0; }
.history-list { list-style: none; padding: 0; margin: 20px 0 0; display: grid; gap: 10px; }

.history-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  padding: 14px 16px;
  border: 1px solid #334155;
  border-radius: 14px;
  background: #0f172a;
}

.history-value small { display: block; color: #94a3b8; margin-bottom: 4px; }
.history-value strong { overflow-wrap: anywhere; }
.history-time { color: #94a3b8; font-size: 13px; text-align: right; }

@media (max-width: 650px) {
  main { width: min(100% - 20px, 860px); margin: 10px auto; }
  .panel { padding: 22px; border-radius: 18px; }
  .result { grid-template-columns: 1fr; }
  .status { grid-column: auto; }
  .history-heading { display: grid; }
  .history-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .history-actions button { width: 100%; }
  .history-item { grid-template-columns: 1fr 1fr; }
  .history-time { grid-column: 1 / -1; text-align: left; }
}

