:root {
  --bg: #f5f6f8;
  --card: #ffffff;
  --ink: #16181d;
  --muted: #6b7280;
  --border: #e3e6ea;
  --accent: #2d6cdf;
  --accent-ink: #1f4fa8;
  --red: #c0392b;
  --red-bg: #fdecea;
  --green: #1e7e34;
  --green-bg: #e9f6ec;
  --grey: #5f6b7a;
  --grey-bg: #eef0f3;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.04), 0 4px 16px rgba(16, 24, 40, 0.06);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

main {
  max-width: 860px;
  margin: 0 auto;
  padding: 32px 20px 80px;
}

/* Header */
.site-header {
  margin-bottom: 22px;
}
.site-header h1 {
  font-size: 24px;
  margin: 0 0 6px;
  letter-spacing: -0.01em;
}
.sub {
  color: var(--muted);
  margin: 0;
  max-width: 62ch;
}

/* Cards */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
  margin-bottom: 16px;
}
.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.card-head h2 {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin: 0;
  font-weight: 600;
}

/* Fields */
.fields {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1 1 260px;
}
.field-label {
  font-size: 13px;
  font-weight: 500;
}
.muted {
  color: var(--muted);
  font-weight: 400;
}

input[type="url"],
input[type="password"],
textarea {
  width: 100%;
  padding: 9px 11px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font: inherit;
  color: var(--ink);
  background: #fff;
  transition: border-color 0.12s, box-shadow 0.12s;
}
input:focus,
textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(45, 108, 223, 0.15);
}
textarea {
  resize: vertical;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
}
.help {
  font-size: 13px;
  color: var(--muted);
  margin: 10px 0 0;
}
.help code {
  background: var(--grey-bg);
  padding: 1px 5px;
  border-radius: 5px;
  font-size: 12px;
}

/* Buttons */
.controls {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
  flex-wrap: wrap;
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font: inherit;
  font-weight: 500;
  padding: 9px 16px;
  border-radius: 8px;
  border: 1px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.12s, border-color 0.12s, opacity 0.12s;
}
.btn:disabled {
  opacity: 0.5;
  cursor: default;
}
.btn-primary {
  background: var(--accent);
  color: #fff;
}
.btn-primary:hover:not(:disabled) {
  background: var(--accent-ink);
}
.btn-secondary {
  background: #fff;
  color: var(--accent-ink);
  border-color: var(--border);
}
.btn-secondary:hover:not(:disabled) {
  border-color: var(--accent);
  background: #f7f9fe;
}
.btn-ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--border);
}
.btn-ghost:hover {
  background: var(--grey-bg);
}
.file-btn {
  font-weight: 500;
}
.link {
  background: none;
  border: 0;
  color: var(--accent);
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  padding: 0;
}
.link:hover {
  text-decoration: underline;
}

.status {
  min-height: 20px;
  color: var(--muted);
  margin: 2px 4px 16px;
  font-size: 14px;
}

/* Summary chips */
.summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
}
.chip::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}
.chip.protected {
  background: var(--red-bg);
  color: var(--red);
}
.chip.protected::before {
  background: var(--red);
}
.chip.not-protected {
  background: var(--green-bg);
  color: var(--green);
}
.chip.not-protected::before {
  background: var(--green);
}
.chip.unknown,
.chip.error {
  background: var(--grey-bg);
  color: var(--grey);
}
.chip.unknown::before,
.chip.error::before {
  background: var(--grey);
}

.legend {
  font-size: 13px;
  margin: 6px 2px 14px;
}

/* Results table */
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 10px;
}
table {
  width: 100%;
  border-collapse: collapse;
}
th,
td {
  text-align: left;
  padding: 10px 13px;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
  vertical-align: top;
}
th {
  background: #fafbfc;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}
tbody tr:last-child td {
  border-bottom: 0;
}
tbody tr:hover {
  background: #fafbfc;
}
td:first-child {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 13px;
}
td:last-child {
  color: var(--muted);
  font-size: 13px;
}

.badge {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}
.badge.protected {
  background: var(--red-bg);
  color: var(--red);
}
.badge.not-protected {
  background: var(--green-bg);
  color: var(--green);
}
.badge.unknown,
.badge.error {
  background: var(--grey-bg);
  color: var(--grey);
}

tr.protected td:first-child {
  box-shadow: inset 3px 0 0 var(--red);
}
tr.not-protected td:first-child {
  box-shadow: inset 3px 0 0 var(--green);
}
tr.unknown td:first-child,
tr.error td:first-child {
  box-shadow: inset 3px 0 0 var(--grey);
}

@media (max-width: 560px) {
  main {
    padding: 20px 14px 60px;
  }
  .btn {
    flex: 1 1 auto;
  }
}
