:root {
  --ink: #111827;
  --muted: #667085;
  --line: #d9dee8;
  --panel: #ffffff;
  --paper: #f4f7fb;
  --blue: #1f5eff;
  --blue-dark: #143aa2;
  --green: #117a4a;
  --green-soft: #e8f7ef;
  --red: #b42318;
  --red-soft: #fff1f0;
  --amber: #a15c07;
  --amber-soft: #fff7e6;
  --slate: #1c2430;
  --shadow: 0 22px 60px rgba(28, 36, 48, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 18% 0%, rgba(31, 94, 255, 0.12), transparent 28%),
    linear-gradient(180deg, #eef3fb 0%, var(--paper) 42%, #eef2f7 100%);
  font-family: Arial, Helvetica, sans-serif;
  line-height: 1.5;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  width: min(1240px, calc(100% - 40px));
  margin: 0 auto;
  padding: 36px 0 64px;
}

.hero-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 28px;
  align-items: stretch;
  margin-bottom: 22px;
  padding: clamp(32px, 5vw, 58px);
  color: #ffffff;
  background:
    linear-gradient(120deg, rgba(17, 24, 39, 0.94), rgba(26, 53, 104, 0.9)),
    url("https://images.unsplash.com/photo-1558494949-ef010cbdcc31?auto=format&fit=crop&w=1800&q=82") center/cover;
  box-shadow: var(--shadow);
}

.eyebrow {
  margin: 0 0 12px;
  color: #9fc2ff;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.eyebrow.dark {
  color: var(--blue);
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 800px;
  margin-bottom: 18px;
  font-size: clamp(44px, 6vw, 82px);
  line-height: 0.98;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 0;
  font-size: clamp(24px, 3vw, 34px);
  line-height: 1.1;
  letter-spacing: 0;
}

h3 {
  margin-bottom: 10px;
}

.lead {
  max-width: 720px;
  margin-bottom: 0;
  color: rgba(255, 255, 255, 0.78);
  font-size: 18px;
}

.status-card {
  display: grid;
  align-content: end;
  padding: 26px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(16px);
}

.status-card.safe {
  background: rgba(17, 122, 74, 0.28);
}

.status-card.warn {
  background: rgba(180, 35, 24, 0.26);
}

.status-label {
  color: rgba(255, 255, 255, 0.7);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.status-card strong {
  display: block;
  margin: 10px 0;
  font-size: 24px;
}

.status-card p {
  margin: 0;
  color: rgba(255, 255, 255, 0.72);
}

.workspace {
  display: grid;
  grid-template-columns: 420px minmax(0, 1fr);
  gap: 22px;
}

.control-panel,
.results-panel,
.ip-info-panel,
.history-section {
  padding: 28px;
  background: var(--panel);
  border: 1px solid rgba(217, 222, 232, 0.9);
  box-shadow: 0 14px 40px rgba(28, 36, 48, 0.06);
}

.panel-heading {
  margin-bottom: 22px;
}

.input-label {
  display: block;
  margin-bottom: 8px;
  color: var(--slate);
  font-weight: 800;
}

.input-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 52px;
  gap: 10px;
}

input {
  min-height: 50px;
  width: 100%;
  padding: 0 15px;
  color: var(--ink);
  background: #fbfcff;
  border: 1px solid var(--line);
  outline: none;
}

input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 4px rgba(31, 94, 255, 0.12);
}

.icon-button {
  min-height: 50px;
  border: 0;
  color: #ffffff;
  background: var(--slate);
  font-size: 22px;
  font-weight: 800;
}

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

.action-grid {
  display: grid;
  gap: 10px;
}

.primary-button,
.secondary-button,
.danger-button {
  min-height: 50px;
  border: 0;
  padding: 0 18px;
  font-weight: 800;
}

.primary-button {
  color: #ffffff;
  background: var(--blue);
}

.primary-button:hover {
  background: var(--blue-dark);
}

.secondary-button {
  color: var(--slate);
  background: #eef2f7;
}

.secondary-button:disabled {
  cursor: not-allowed;
  color: #98a2b3;
  background: #f2f4f7;
}

.danger-button {
  color: var(--red);
  background: var(--red-soft);
}

.compact {
  min-height: 42px;
  white-space: nowrap;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 22px;
}

.summary-grid div {
  padding: 15px;
  background: #f7f9fc;
  border: 1px solid #edf1f6;
}

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

.summary-grid strong {
  font-size: 24px;
}

.result-box {
  min-height: 235px;
  display: grid;
  align-content: center;
  padding: 28px;
  border: 1px solid var(--line);
  background: #f8fafc;
}

.result-box.safe {
  border-color: rgba(17, 122, 74, 0.28);
  background: var(--green-soft);
}

.result-box.warn {
  border-color: rgba(180, 35, 24, 0.28);
  background: var(--red-soft);
}

.result-pill {
  display: inline-flex;
  width: fit-content;
  margin-bottom: 16px;
  padding: 7px 11px;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.result-pill.neutral {
  color: var(--slate);
  background: #e8edf4;
}

.result-pill.safe {
  color: var(--green);
  background: #d7f3e4;
}

.result-pill.warn {
  color: var(--red);
  background: #ffe0dd;
}

.result-box h3 {
  margin-bottom: 8px;
  font-size: 28px;
  line-height: 1.15;
}

.result-box p {
  max-width: 640px;
  margin-bottom: 0;
  color: var(--muted);
}

.ip-info-panel {
  grid-column: 1 / -1;
}

.ip-info-box {
  padding: 24px;
  border: 1px solid var(--line);
  background: #f8fafc;
}

.info-empty {
  margin: 0;
  color: var(--muted);
}

.ip-info-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  margin: 0;
  background: var(--line);
  border: 1px solid var(--line);
}

.ip-info-grid div {
  min-height: 96px;
  padding: 16px;
  background: #ffffff;
}

.ip-info-grid dt {
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.ip-info-grid dd {
  margin: 0;
  color: var(--slate);
  font-size: 16px;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.duplicate-list {
  margin-top: 22px;
}

.duplicate-list h3 {
  margin-bottom: 12px;
}

.duplicate-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}

.duplicate-row strong,
.duplicate-row span {
  display: block;
}

.duplicate-row span {
  color: var(--muted);
  font-size: 13px;
}

.history-section {
  margin-top: 22px;
}

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

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

.history-tools input {
  width: 220px;
  min-height: 42px;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
  background: #ffffff;
}

th,
td {
  padding: 15px 16px;
  text-align: left;
  border-bottom: 1px solid var(--line);
}

th {
  color: var(--muted);
  background: #f8fafc;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

td {
  color: var(--slate);
}

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

.tag {
  display: inline-flex;
  padding: 5px 8px;
  font-size: 12px;
  font-weight: 800;
}

.tag.safe {
  color: var(--green);
  background: var(--green-soft);
}

.tag.warn {
  color: var(--amber);
  background: var(--amber-soft);
}

.pagination {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 16px;
}

.page-button {
  min-width: 40px;
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid var(--line);
  color: var(--slate);
  background: #ffffff;
  font-weight: 800;
}

.page-button:hover {
  border-color: var(--blue);
  color: var(--blue);
}

.page-button.active {
  border-color: var(--blue);
  color: #ffffff;
  background: var(--blue);
}

.page-ellipsis {
  min-width: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-weight: 900;
}

@media (max-width: 960px) {
  .hero-panel,
  .workspace {
    grid-template-columns: 1fr;
  }

  .ip-info-grid {
    grid-template-columns: 1fr 1fr;
  }

  .history-header,
  .history-tools {
    align-items: stretch;
    flex-direction: column;
  }

  .history-tools input {
    width: 100%;
  }
}

@media (max-width: 560px) {
  .app-shell {
    width: min(100% - 24px, 1240px);
    padding-top: 18px;
  }

  h1 {
    font-size: 40px;
  }

  .hero-panel,
  .control-panel,
  .results-panel,
  .history-section {
    padding: 22px;
  }

  .summary-grid {
    grid-template-columns: 1fr;
  }

  .ip-info-grid {
    grid-template-columns: 1fr;
  }
}
