:root {
  --bg: #efe8dc;
  --bg-accent: #e4d8c6;
  --surface: #fffaf2;
  --ink: #1f1a14;
  --muted: #6d6256;
  --line: #d9cbb8;
  --accent: #b54712;
  --accent-strong: #8d330c;
  --accent-soft: #f4d7c3;
  --ok: #215c38;
  --ok-soft: #dcecde;
  --warn: #8a5a10;
  --warn-soft: #f6e6c2;
  --err: #9f1d22;
  --err-soft: #f8d7d6;
  --info: #1d4f73;
  --info-soft: #d7e6f2;
  --shadow: 0 18px 40px rgba(31, 26, 20, 0.1);
  --radius: 18px;
  --serif: Georgia, 'Times New Roman', ui-serif, serif;
  --sans: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI',
    sans-serif;
  --mono: 'SFMono-Regular', ui-monospace, Menlo, Consolas, monospace;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at top right, rgba(181, 71, 18, 0.08), transparent 32%),
    linear-gradient(180deg, var(--bg) 0%, #e7dece 100%);
  font-family: var(--sans);
  line-height: 1.5;
}

a {
  color: var(--accent);
}

a:hover {
  color: var(--accent-strong);
}

.page {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 32px 0 64px;
}

.topbar,
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 28px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: var(--ink);
  color: var(--surface);
  box-shadow: var(--shadow);
}

.brand-mark svg {
  width: 22px;
  height: 22px;
}

.brand-copy {
  display: flex;
  flex-direction: column;
}

.brand-kicker {
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.brand-title {
  font-family: var(--serif);
  font-size: 1.35rem;
  line-height: 1.1;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 28px;
  align-items: start;
}

.intro,
.panel,
.notice,
.stat-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.intro,
.panel,
.notice {
  padding: 28px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.intro h1,
.panel h1,
.error-title {
  margin: 0 0 12px;
  font-family: var(--serif);
  font-size: clamp(2rem, 4vw, 3.1rem);
  line-height: 1.05;
}

.lede,
.error-message {
  margin: 0 0 20px;
  color: var(--muted);
  font-size: 1.05rem;
}

.checklist {
  margin: 0;
  padding: 0;
  list-style: none;
}

.checklist li {
  position: relative;
  padding: 8px 0 8px 22px;
  color: var(--ink);
}

.checklist li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 16px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
}

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

.field {
  display: grid;
  gap: 8px;
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

label,
.legend {
  font-size: 0.92rem;
  font-weight: 650;
}

.hint {
  color: var(--muted);
  font-size: 0.86rem;
}

input[type='url'],
input[type='text'],
input[type='password'],
input[type='number'],
textarea,
select {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
  font: inherit;
}

input:focus,
textarea:focus,
select:focus {
  outline: 3px solid var(--accent-soft);
  border-color: var(--accent);
}

textarea {
  min-height: 96px;
  resize: vertical;
  font-family: var(--mono);
  font-size: 0.92rem;
}

.switch {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
}

.switch input {
  margin-top: 4px;
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}

.advanced {
  border: 1px dashed var(--line);
  border-radius: 14px;
  padding: 8px 14px 14px;
}

.advanced summary {
  cursor: pointer;
  padding: 8px 0;
  font-weight: 650;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.button,
.button-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 18px;
  border-radius: 999px;
  border: 0;
  font: inherit;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}

.button {
  background: var(--accent);
  color: #fff;
}

.button:hover {
  background: var(--accent-strong);
  color: #fff;
}

.button-secondary {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line);
}

.button-secondary:hover {
  background: var(--bg-accent);
  color: var(--ink);
}

.button[disabled] {
  opacity: 0.65;
  cursor: wait;
}

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin: 0 0 24px;
}

.stat-card {
  padding: 16px 18px;
}

.stat-card span {
  display: block;
  color: var(--muted);
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.stat-card strong {
  display: block;
  margin-top: 4px;
  font-family: var(--serif);
  font-size: 1.7rem;
}

.notice {
  margin: 0 0 20px;
}

.notice h2,
.notice h3 {
  margin: 0 0 8px;
  font-family: var(--serif);
}

.notice-info {
  background: var(--info-soft);
  border-color: #b9d0e0;
}

.notice-ok {
  background: var(--ok-soft);
  border-color: #b7d4be;
}

.notice-warn {
  background: var(--warn-soft);
  border-color: #e6cf93;
}

.table-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 12px;
}

.table-toolbar h2 {
  margin: 0;
}

.table-wrap {
  overflow: auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 920px;
}

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

th {
  position: sticky;
  top: 0;
  background: #f7f0e6;
  font-size: 0.78rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

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

td {
  word-break: break-word;
}

.error-details,
code {
  font-family: var(--mono);
}

.error-details {
  padding: 14px;
  border-radius: 12px;
  background: #fff;
  border: 1px solid var(--line);
}

.busy .page {
  pointer-events: none;
  opacity: 0.72;
}

.busy::after {
  content: 'Scanning sitemap…';
  position: fixed;
  inset: auto 24px 24px auto;
  padding: 12px 16px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--surface);
  box-shadow: var(--shadow);
  font-weight: 700;
}

@media (max-width: 840px) {
  .hero,
  .field-row,
  .topbar,
  .site-header {
    grid-template-columns: 1fr;
    display: grid;
  }
}
