:root {
  color-scheme: light;
  --ink: #111827;
  --muted: #6b7280;
  --line: #e5e7eb;
  --soft: #f9fafb;
  --accent: #111827;
  --blue: #2563eb;
  --green: #15803d;
  --red: #b91c1c;
  --warning: #a96508;
  --radius: 14px;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: #fff;
  font-size: 15px;
  line-height: 1.6;
}

button,
input,
select,
textarea {
  font: inherit;
}

button,
select {
  cursor: pointer;
}

a {
  color: inherit;
}

.container {
  width: min(1120px, calc(100% - 40px));
  margin-inline: auto;
}

/* Shared brand header */

.site-header {
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.header-inner {
  width: min(1120px, calc(100% - 40px));
  min-height: 72px;
  margin: auto;
  display: flex;
  align-items: center;
  gap: 30px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-weight: 750;
  letter-spacing: -.02em;
  white-space: nowrap;
}

.brand-logo {
  display: block;
  width: 190px;
  max-width: 100%;
  height: auto;
}

.top-nav {
  display: flex;
  align-items: center;
  gap: 24px;
  margin-left: auto;
}

.top-nav a,
.site-footer a {
  color: #4b5563;
  text-decoration: none;
  font-size: 14px;
}

.top-nav a:hover,
.site-footer a:hover {
  color: #111827;
}

/* Product introduction */

.page-intro {
  padding: 56px 0 28px;
}

.eyebrow {
  margin: 0 0 10px;
  color: #6b7280;
  font-size: 11px;
  font-weight: 750;
  letter-spacing: .13em;
}

.page-intro h1 {
  margin: 0;
  font-size: clamp(32px, 5vw, 46px);
  line-height: 1.15;
  letter-spacing: -.045em;
}

.intro-copy {
  max-width: 760px;
  margin: 16px 0 18px;
  color: #4b5563;
  font-size: 17px;
}

.trust-points {
  display: flex;
  gap: 22px;
  flex-wrap: wrap;
  color: #4b5563;
  font-size: 13px;
}

.trust-points i {
  margin-right: 5px;
  color: var(--green);
  font-style: normal;
  font-weight: 800;
}

/* Main tool area */

.tool-section {
  padding-bottom: 34px;
}

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

.input-panel {
  box-shadow: 0 2px 8px rgba(17, 24, 39, .025);
}

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

.section-heading h2,
.content-section h2 {
  margin: 0;
  font-size: 19px;
  line-height: 1.3;
  letter-spacing: -.02em;
}

.section-heading p:not(.eyebrow) {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

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

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

.label-row label {
  font-size: 14px;
  font-weight: 700;
}

.limit-label {
  color: var(--muted);
  font-size: 12px;
}

#robotsInput,
#cleanedOutput {
  display: block;
  width: 100%;
  min-height: 270px;
  padding: 14px;
  resize: vertical;
  border: 1px solid #d1d5db;
  border-radius: 9px;
  background: #fff;
  color: #111827;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
  line-height: 1.6;
  tab-size: 2;
}

#robotsInput:focus,
#cleanedOutput:focus {
  outline: 2px solid #bfdbfe;
  border-color: #60a5fa;
}

#cleanedOutput {
  min-height: 180px;
  margin-top: 10px;
  background: #f9fafb;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.input-meta {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}

.input-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 10px 16px;
  border: 1px solid transparent;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 650;
  text-decoration: none;
  transition: background .15s, border-color .15s, opacity .15s;
}

.button:disabled {
  opacity: .42;
  cursor: not-allowed;
}

.button-primary {
  background: #111827;
  color: #fff;
}

.button-primary:hover:not(:disabled) {
  background: #293548;
}

.button-secondary {
  border-color: #d1d5db;
  background: #fff;
  color: #111827;
}

.button-secondary:hover:not(:disabled),
.button-quiet:hover:not(:disabled) {
  background: #f3f4f6;
}

.button-quiet {
  border-color: var(--line);
  background: transparent;
  color: #4b5563;
}

.upload-button {
  cursor: pointer;
}

.status-message {
  min-height: 20px;
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.privacy-note {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin: 16px 0 30px;
  padding: 14px 16px;
  border: 1px solid #dcfce7;
  border-radius: 11px;
  background: #f0fdf4;
}

.privacy-icon {
  font-size: 17px;
}

.privacy-note p {
  margin: 0;
  color: #365744;
  font-size: 13px;
}

.privacy-note strong {
  color: #14532d;
}

/* Analysis report */

.results-section {
  margin-top: 30px;
}

.results-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
}

.results-header h2 {
  margin: 0;
  font-size: 25px;
  line-height: 1.3;
  letter-spacing: -.03em;
}

.results-header > div > p:last-child {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.overall-status {
  display: inline-flex;
  align-items: center;
  padding: 6px 11px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--soft);
  color: #4b5563;
  font-size: 12px;
  font-weight: 650;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.summary-card {
  min-width: 0;
  padding: 17px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #fff;
}

.summary-label {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.summary-card strong {
  display: block;
  margin-top: 5px;
  font-size: 27px;
  line-height: 1.25;
  font-weight: 750;
  font-variant-numeric: tabular-nums;
}

.result-panel,
.issues-panel,
.cleaned-panel {
  margin-top: 16px;
}

.result-panel-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.result-panel-heading h3 {
  margin: 0;
  font-size: 17px;
  line-height: 1.35;
}

.result-panel-heading p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
}

/* Directive table */

.table-wrap {
  width: 100%;
  overflow-x: auto;
}

.directives-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

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

.directives-table th {
  background: #f9fafb;
  color: #536174;
  font-size: 12px;
  font-weight: 750;
}

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

.directive-type {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 6px;
  background: #eef2ff;
  color: #344fc0;
  font-size: 11px;
  font-weight: 750;
}

.directives-table code,
.rule-code,
.group-agent {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  overflow-wrap: anywhere;
}

/* User-agent groups */

.groups-list {
  display: grid;
  gap: 12px;
}

.group-item {
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fbfcfe;
}

.group-agent {
  margin-bottom: 9px;
  color: #304bb9;
  font-size: 13px;
  font-weight: 750;
}

.group-rules {
  display: grid;
  gap: 6px;
}

.group-rule {
  display: flex;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 13px;
}

.group-rule .rule-name {
  min-width: 82px;
  color: var(--muted);
  font-weight: 650;
}

/* Sitemap and issues */

.sitemap-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 20px;
  overflow-wrap: anywhere;
  font-size: 13px;
}

.issues-list {
  display: grid;
  gap: 10px;
}

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

.issue-item.error {
  border-left: 4px solid #b91c1c;
}

.issue-item.warning {
  border-left: 4px solid #d99a32;
}

.issue-item.info {
  border-left: 4px solid #2563eb;
}

.issue-content {
  min-width: 0;
  flex: 1;
}

.issue-title {
  margin: 0 0 3px;
  font-size: 13px;
  font-weight: 750;
}

.issue-description {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.issue-location {
  margin-top: 4px;
  color: #7b8493;
  font-size: 11px;
}

.issue-level {
  flex: 0 0 auto;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.issue-item.error .issue-level {
  color: var(--red);
}

.issue-item.warning .issue-level {
  color: var(--warning);
}

.issue-item.info .issue-level {
  color: var(--blue);
}

.empty-state,
.groups-list > p,
.sitemap-list > p,
.issues-list > p {
  padding: 18px;
  border: 1px dashed #d6dce6;
  border-radius: 9px;
  color: var(--muted);
  text-align: center;
  font-size: 13px;
}

/* Cleaned content and report actions */

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

/* Instructions and FAQ */

.content-section {
  padding: 10px 0 60px;
}

.content-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 46px;
  padding: 30px 0;
  border-top: 1px solid var(--line);
}

.content-grid h2 {
  margin-bottom: 12px;
}

.content-grid p,
.content-grid li,
.faq-section p {
  color: #4b5563;
  font-size: 14px;
}

.content-grid ol,
.content-grid ul {
  padding-left: 20px;
}

.content-grid li {
  padding: 4px 0;
}

.secondary-content {
  border-top: 0;
  padding-top: 8px;
}

.faq-section {
  max-width: 860px;
  padding-top: 22px;
}

.faq-section h2 {
  margin-bottom: 12px;
}

.faq-section details {
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
}

.faq-section summary {
  cursor: pointer;
  font-size: 14px;
  font-weight: 650;
}

.faq-section p {
  margin: 8px 0 2px;
}

/* Footer */

.site-footer {
  padding: 24px 0;
  border-top: 1px solid var(--line);
  background: #fff;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: center;
  color: #9ca3af;
  font-size: 12px;
}

.footer-inner p {
  margin: 0;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
}

.site-footer a {
  font-size: 12px;
}

/* Toast and hidden elements */

.toast {
  position: fixed;
  bottom: 22px;
  left: 50%;
  z-index: 20;
  max-width: min(90vw, 520px);
  padding: 10px 15px;
  border-radius: 9px;
  background: #111827;
  color: #fff;
  font-size: 13px;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 14px);
  transition: opacity .2s, transform .2s;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

[hidden] {
  display: none !important;
}

/* Responsive layout */

@media (max-width: 800px) {
  .header-inner {
    padding: 12px 0;
    min-height: 0;
    flex-wrap: wrap;
    gap: 10px 18px;
  }

  .top-nav {
    order: 3;
    width: 100%;
    margin: 0;
    gap: 18px;
  }

  .page-intro {
    padding: 40px 0 24px;
  }

  .intro-copy {
    font-size: 15px;
  }

  .trust-points {
    gap: 8px 16px;
  }

  .panel {
    padding: 16px;
  }

  .content-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .results-header {
    align-items: flex-start;
  }
}

@media (max-width: 520px) {
  .container,
  .header-inner {
    width: calc(100% - 28px);
  }

  .brand-logo {
    width: 155px;
  }

  .top-nav a {
    font-size: 12px;
  }

  .page-intro h1 {
    font-size: 34px;
  }

  #robotsInput {
    min-height: 230px;
  }

  .input-actions .button {
    flex: 1 1 auto;
  }

  .summary-card {
    padding: 13px;
  }

  .summary-card strong {
    font-size: 23px;
  }

  .results-header h2 {
    font-size: 22px;
  }

  .result-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .result-actions .button {
    width: 100%;
  }

  .footer-inner {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }

  .footer-links {
    gap: 12px 18px;
  }
}
