:root {
  color-scheme: light;
  --bg: #f4f7fb;
  --panel: #ffffff;
  --panel-soft: #f8fafc;
  --text: #111827;
  --muted: #64748b;
  --line: #dbe3ef;
  --line-strong: #cbd5e1;
  --accent: #2563eb;
  --accent-dark: #1d4ed8;
  --accent-soft: #eaf1ff;
  --green: #059669;
  --green-soft: #e8f8f1;
  --amber: #b7791f;
  --amber-soft: #fff7e6;
  --red: #dc2626;
  --red-soft: #fff1f2;
  --shadow: 0 18px 50px rgba(15, 23, 42, 0.08);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  min-height: 100%;
}

body {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(circle at top left, rgba(37, 99, 235, 0.13), transparent 340px),
    linear-gradient(180deg, #f8fbff 0, var(--bg) 420px),
    var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

.shell {
  width: min(100%, 1480px);
  margin: 0 auto;
  padding: 28px 24px 48px;
}

.shell.wide {
  width: min(100%, 1480px);
}

.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.panel {
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(219, 227, 239, 0.9);
  border-radius: 8px;
  padding: 28px;
  box-shadow: var(--shadow);
}

.login-panel {
  width: min(100%, 430px);
}

.topbar {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 18px;
  align-items: start;
  margin-bottom: 24px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 62px;
  font-weight: 900;
  color: #0f172a;
  text-decoration: none;
}

.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font-weight: 900;
}

.nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 70px;
  padding: 12px;
  border: 1px solid rgba(219, 227, 239, 0.82);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 14px 34px rgba(15, 23, 42, 0.07);
}

.nav a,
.nav .button,
.nav-group summary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 50px;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 0 22px;
  background: transparent;
  color: #1f2937;
  font-size: 16px;
  font-weight: 850;
  line-height: 1.1;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
}

.nav > a,
.nav > .button {
  min-width: 100px;
}

.nav a:hover,
.nav .button:hover,
.nav-group summary:hover,
.nav a.active {
  border-color: rgba(37, 99, 235, 0.3);
  background: var(--accent-soft);
  color: var(--accent-dark);
}

.nav-group {
  position: relative;
  min-width: 136px;
}

.nav-group:has(summary.active) {
  min-width: 136px;
}

.nav-group:nth-of-type(4) {
  min-width: 168px;
}

.nav-group summary {
  width: 100%;
  list-style: none;
  gap: 12px;
  user-select: none;
}

.nav-group summary::-webkit-details-marker {
  display: none;
}

.nav-group summary::after {
  content: "";
  width: 7px;
  height: 7px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg) translateY(-2px);
  opacity: 0.7;
  transition: transform 140ms ease;
}

.nav-group[open] summary::after {
  transform: rotate(225deg) translateY(-1px);
}

.nav-group summary.active,
.nav-group[open] summary {
  border-color: rgba(37, 99, 235, 0.3);
  background: var(--accent-soft);
  color: var(--accent-dark);
}

.nav-menu {
  position: absolute;
  z-index: 20;
  top: calc(100% + 10px);
  left: 0;
  display: grid;
  min-width: 260px;
  gap: 0;
  overflow: hidden;
  padding: 8px 0;
  border: 1px solid rgba(219, 227, 239, 0.94);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 22px 50px rgba(15, 23, 42, 0.18);
}

.nav-menu a {
  justify-content: flex-start;
  min-height: 58px;
  border-radius: 0;
  padding: 0 22px;
  font-size: 17px;
  font-weight: 820;
}

.nav-menu a:hover,
.nav-menu a.active {
  border-color: transparent;
  background: var(--accent);
  color: #fff;
}

.nav-spacer {
  flex: 1 1 auto;
  min-width: 16px;
}

.logout-link {
  color: #7f1d1d !important;
}

.logout-link:hover {
  border-color: rgba(220, 38, 38, 0.24) !important;
  background: var(--red-soft) !important;
  color: var(--red) !important;
}

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

.eyebrow {
  margin: 0 0 7px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: clamp(30px, 4vw, 44px);
  line-height: 1.08;
}

h2 {
  margin: 0;
}

.lead {
  max-width: 980px;
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.55;
}

.guide {
  display: grid;
  gap: 14px;
  margin: 0 0 22px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, #ffffff, var(--panel-soft));
}

.guide-title {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
}

.guide h2 {
  font-size: 18px;
}

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

.guide-step {
  min-height: 92px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 13px;
  background: #fff;
}

.guide-step strong {
  display: block;
  margin-bottom: 6px;
}

.guide-step p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

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

.field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

label {
  display: grid;
  gap: 7px;
  font-weight: 800;
}

label span {
  color: var(--text);
}

.label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.label-row small,
.field-hint {
  color: var(--muted);
  font: 800 12px/1.35 system-ui, sans-serif;
}

textarea,
input {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  padding: 12px 13px;
  color: var(--text);
  font: 14px/1.45 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  background: #fff;
  transition: border-color 140ms ease, box-shadow 140ms ease, background 140ms ease;
}

input[type="file"] {
  font-family: system-ui, sans-serif;
}

textarea:focus,
input:focus {
  outline: none;
  border-color: rgba(37, 99, 235, 0.65);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.11);
}

textarea {
  min-height: 150px;
  resize: vertical;
}

.script-box {
  min-height: 220px;
  font-size: 12px;
  color: #273449;
}

.small-textarea {
  min-height: 82px;
}

.schema-textarea {
  min-height: 360px;
}

.settings {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.checkbox {
  align-content: end;
  grid-template-columns: 18px 1fr;
  align-items: center;
  min-height: 48px;
  font-weight: 750;
}

.checkbox.inline-control {
  align-content: center;
  width: fit-content;
  max-width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.checkbox input {
  width: 18px;
  height: 18px;
}

button,
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 8px;
  min-height: 44px;
  padding: 0 18px;
  background: var(--accent);
  color: #fff;
  font: 900 14px/1 system-ui, sans-serif;
  text-decoration: none;
  cursor: pointer;
  transition: background 140ms ease, border-color 140ms ease, transform 140ms ease;
}

button:hover,
.button:hover {
  background: var(--accent-dark);
}

button:active,
.button:active {
  transform: translateY(1px);
}

.button.secondary {
  border: 1px solid var(--line);
  background: #fff;
  color: #334155;
}

.button.secondary:hover {
  border-color: rgba(37, 99, 235, 0.3);
  background: var(--accent-soft);
  color: var(--accent-dark);
}

.button.danger,
button.danger {
  border: 1px solid rgba(220, 38, 38, 0.24);
  background: var(--red-soft);
  color: var(--red);
}

.button.danger:hover,
button.danger:hover {
  background: var(--red);
  color: #fff;
}

.button.compact {
  min-height: 36px;
  padding: 0 12px;
}

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

.actions.left {
  justify-content: flex-start;
}

.helper {
  display: grid;
  gap: 10px;
  margin-top: 22px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.helper h2 {
  font-size: 17px;
  line-height: 1.2;
}

.schema-item {
  display: grid;
  gap: 14px;
  margin-bottom: 18px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.schema-item h2 {
  font-size: 18px;
}

.summary {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 18px;
}

.summary span {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 12px;
  font-weight: 900;
  background: #fff;
}

.summary .pass,
.pass-text {
  color: var(--green);
}

.summary .fail,
.fail-text {
  color: var(--amber);
}

.summary .error,
.login-error,
.error-text {
  color: var(--red);
}

.human-summary {
  margin: 0 0 18px;
  border-radius: 8px;
  padding: 13px 14px;
  font-weight: 900;
}

.pass-text {
  background: var(--green-soft);
}

.fail-text {
  background: var(--amber-soft);
}

.error-text {
  background: var(--red-soft);
}

.compact-form {
  margin-bottom: 24px;
}

.phishing-form-grid {
  grid-template-columns: minmax(280px, 2fr) minmax(220px, 1fr);
}

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
  margin: 26px 0 12px;
}

.section-head h2 {
  font-size: 22px;
}

.section-head p {
  margin: 6px 0 0;
  color: var(--muted);
  font-weight: 850;
}

.phishing-table {
  min-width: 760px;
}

.inline-note {
  margin: 8px 0 0;
  padding: 8px 10px;
  border-radius: 8px;
  font-weight: 850;
}

.site-report-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
  margin: 0 0 18px;
}

.mini-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #fff;
}

.mini-panel p {
  margin: 8px 0 0;
  color: var(--muted);
  font-weight: 750;
}

.mini-panel-head {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  min-width: 1100px;
  font-size: 14px;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 11px 12px;
  text-align: left;
  vertical-align: top;
}

th {
  position: sticky;
  top: 0;
  background: #f8fafc;
  color: #334155;
  font-size: 12px;
  text-transform: uppercase;
}

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

.url {
  max-width: 300px;
  overflow-wrap: anywhere;
}

ul {
  margin: 0;
  padding-left: 18px;
}

code {
  white-space: normal;
  overflow-wrap: anywhere;
}

.diff-mark {
  border-radius: 4px;
  padding: 0 2px;
  background: #fde68a;
  color: #7a3e00;
}

.badge {
  display: inline-block;
  border-radius: 999px;
  padding: 5px 9px;
  color: #fff;
  font-size: 12px;
  font-weight: 950;
}

.badge.pass {
  background: var(--green);
}

.badge.fail,
.badge.warning {
  background: var(--amber);
}

.badge.error {
  background: var(--red);
}

.regular-row td {
  background: #f8fafc;
  color: var(--muted);
  font-size: 13px;
}

.pass-row td {
  background: #fbfffd;
}

.result-block {
  display: grid;
  gap: 16px;
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.result-block-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.result-block-header h2 {
  margin: 0 0 6px;
  font-size: 20px;
}

.button-accordion summary {
  cursor: pointer;
  font-weight: 900;
  color: var(--accent);
}

.button-link-list {
  display: grid;
  gap: 10px;
  margin-top: 10px;
  padding-left: 18px;
}

.button-link-list li {
  overflow-wrap: anywhere;
}

.button-link-list small {
  color: var(--muted);
  font-weight: 750;
}

.tiny-pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 2px 7px;
  background: var(--green-soft);
  color: var(--green);
  font-size: 11px;
  font-weight: 950;
}

.job-card {
  display: grid;
  gap: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  background: var(--panel-soft);
}

.job-card-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
}

.job-card-head code {
  display: block;
  margin-top: 5px;
}

.progress-shell {
  overflow: hidden;
  height: 14px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: #fff;
}

.progress-bar {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--green));
  transition: width 220ms ease;
}

.queue-summary-grid,
.queue-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px;
  margin: 16px 0;
}

.queue-summary-card,
.queue-lane,
.queue-status {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.queue-summary-card {
  display: grid;
  gap: 4px;
  padding: 14px;
  color: inherit;
  text-decoration: none;
}

.queue-summary-card span,
.queue-item p,
.queue-status li {
  color: var(--muted);
  font-weight: 750;
}

.queue-lane {
  padding: 16px;
}

.queue-lane h2 {
  font-size: 20px;
}

.queue-item {
  display: grid;
  gap: 10px;
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #f8fafc;
}

.queue-item.running {
  border-color: rgba(37, 99, 235, 0.28);
  background: var(--accent-soft);
}

.queue-item p,
.queue-status ul {
  margin: 0;
}

.queue-status {
  display: grid;
  gap: 8px;
  padding: 12px;
}

.queue-status ul {
  padding-left: 18px;
}

.empty-state {
  margin: 12px 0 0;
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  padding: 14px;
  color: var(--muted);
  font-weight: 800;
}

.report-block {
  display: grid;
  gap: 12px;
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.report-block h2 {
  font-size: 20px;
}

.muted-line {
  margin: 0;
  color: var(--muted);
  font-weight: 750;
}

.login-panel h1 {
  font-size: 34px;
}

.login-form {
  margin-top: 22px;
}

.login-error {
  margin: 0;
  font-weight: 900;
}

@media (max-width: 900px) {
  .topbar,
  .header {
    align-items: stretch;
    grid-template-columns: 1fr;
  }

  .nav,
  .actions {
    justify-content: flex-start;
  }

  .brand {
    min-height: 44px;
  }

  .nav-spacer {
    display: none;
  }

  .guide-grid,
  .field-grid,
  .settings {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .shell {
    padding: 16px 12px 32px;
  }

  .panel {
    padding: 18px;
  }

  .button,
  button {
    width: 100%;
  }

  .nav a,
  .nav .button,
  .nav-group,
  .nav-group summary {
    flex: 1 1 calc(50% - 8px);
    min-width: 0;
  }

  .nav-menu {
    position: static;
    grid-column: 1 / -1;
    width: 100%;
    margin-top: 6px;
    box-shadow: none;
  }
}
