* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px 0;
  background: #f4efe6;
  color: #1c1915;
  font-family: "Segoe UI", "Helvetica Neue", sans-serif;
}

main {
  width: min(920px, calc(100% - 32px));
  text-align: center;
}

h1 {
  margin: 0 0 6px;
  font-size: 36px;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.lead, .file-note {
  margin: 0 0 16px;
  font-size: 16px;
  font-weight: 700;
}

.file-note { margin-top: 12px; }
.file-note a { color: #1b3a34; font-weight: 800; }

form { display: flex; flex-direction: column; gap: 12px; }

label {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 18px;
  font-weight: 800;
}

select, textarea {
  width: 100%;
  border: 2px solid #1c1915;
  border-radius: 12px;
  background: #fff;
  padding: 14px;
  font-size: 18px;
  font-weight: 700;
  text-align: center;
  resize: vertical;
}

select { text-align-last: center; }
textarea::placeholder { color: #a3988c; font-weight: 600; }

.actions {
  display: flex;
  gap: 10px;
  justify-content: center;
}

button, .file, a.export-link {
  border: 0;
  border-radius: 12px;
  background: #1b3a34;
  color: #fff;
  padding: 14px 18px;
  font-size: 18px;
  font-weight: 800;
  cursor: pointer;
}

.file { display: inline-flex; align-items: center; background: #8a5a12; }
a.export-link { display: inline-flex; align-items: center; text-decoration: none; background: #8a5a12; }
.file input { display: none; }
button:disabled, .file.busy { opacity: 0.6; cursor: wait; }

#result { margin-top: 18px; }

#message { margin: 0; }

#message p {
  margin: 0 0 8px;
  border-radius: 16px;
  padding: 18px 16px;
  font-size: 30px;
  font-weight: 800;
  line-height: 1.2;
  white-space: pre-line;
}

#message p.exists { background: #9f2d22; color: #fff; }
#message p.added { background: #1f6b45; color: #fff; }
#message p.invalid, #message p.mismatch { background: #8a5a12; color: #fff; }

#unique { margin-top: 14px; }
#unique[hidden] { display: none !important; }

.unique-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-bottom: 10px;
}

.unique-actions button {
  background: #fff;
  color: #1c1915;
  border: 2px solid #1c1915;
  padding: 10px 14px;
  font-size: 16px;
}

#url-table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border: 2px solid #1c1915;
  border-radius: 12px;
  overflow: hidden;
}

#url-table th,
#url-table td {
  padding: 10px 12px;
  border-bottom: 1px solid #d9d1c5;
  font-size: 16px;
  font-weight: 700;
  color: #1c1915;
  text-align: left;
  word-break: break-all;
}

#url-table th {
  font-weight: 800;
  background: #fff;
}

#url-table tr:last-child td { border-bottom: 0; }

.pager {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
  font-size: 16px;
  font-weight: 800;
}

.pager[hidden] { display: none !important; }

.pager button {
  background: #fff;
  color: #1c1915;
  border: 2px solid #1c1915;
  padding: 8px 14px;
  font-size: 16px;
}

.pager button:disabled { opacity: 0.4; cursor: default; }
