:root {
  --ink: #1a1f24;
  --muted: rgba(26, 31, 36, 0.62);
  --paper: #e9ecea;
  --panel: rgba(250, 251, 250, 0.94);
  --line: rgba(26, 31, 36, 0.12);
  --accent: #1f6b58;
  --accent-soft: rgba(31, 107, 88, 0.1);
  --danger: #9b2433;
  --warn: #8a4f12;
  --ok: #1f6b58;
  --font-brand: "Source Serif 4", "Georgia", "Times New Roman", serif;
  --font-body: "Source Sans 3", "Segoe UI", "Helvetica Neue", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  height: 100%;
  max-height: 100dvh;
  overflow: hidden;
  color: var(--ink);
  font-family: var(--font-body);
  font-weight: 400;
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}

.top-cabinet-link {
  position: fixed;
  top: 1rem;
  right: 1.1rem;
  z-index: 20;
  text-decoration: none;
  color: var(--ink);
  font-weight: 600;
  font-size: 0.92rem;
  padding: 0.45rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(6px);
}

.top-cabinet-link:hover {
  border-color: rgba(31, 107, 88, 0.4);
  color: var(--accent);
}

.stage {
  position: relative;
  height: 100%;
  max-height: 100dvh;
  display: grid;
  place-content: center;
  padding: 1.25rem;
  gap: 1.4rem;
}

.atmosphere {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(900px 520px at 12% 18%, rgba(31, 107, 88, 0.14), transparent 60%),
    radial-gradient(700px 480px at 88% 78%, rgba(26, 31, 36, 0.08), transparent 55%),
    linear-gradient(145deg, #f0f3f1 0%, #e2e8e4 48%, #d5ddd8 100%);
  z-index: 0;
}

.atmosphere::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.28;
  background-image:
    linear-gradient(rgba(26, 31, 36, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(26, 31, 36, 0.045) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(circle at center, black 20%, transparent 78%);
}

.brand-block,
.entry-dialog {
  position: relative;
  z-index: 1;
}

.brand-block {
  text-align: center;
  max-width: 34rem;
  margin: 0 auto;
  animation: rise 0.7s ease both;
}

.brand {
  margin: 0 0 0.85rem;
  font-family: var(--font-brand);
  font-weight: 700;
  font-size: clamp(2.1rem, 6.5vw, 3.8rem);
  letter-spacing: -0.02em;
  line-height: 1.05;
  color: var(--ink);
}

.brand.tiny {
  font-size: 0.95rem;
  letter-spacing: 0.04em;
  margin-bottom: 0.35rem;
  font-weight: 600;
}

.brand-block h1 {
  margin: 0;
  font-family: var(--font-body);
  font-size: clamp(1.1rem, 2.4vw, 1.4rem);
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.35;
}

.lead {
  margin: 0.7rem 0 0;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.5;
}

.entry-dialog {
  width: min(520px, 100%);
  margin: 0 auto;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 1.15rem 1.2rem 1.25rem;
  background: var(--panel);
  backdrop-filter: blur(10px);
  box-shadow: 0 20px 50px rgba(26, 31, 36, 0.1);
  animation: rise 0.85s ease both;
}

.entry-dialog::backdrop {
  background: transparent;
}

.entry-dialog label {
  display: block;
  margin-bottom: 0.45rem;
  font-size: 0.8rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
}

.field-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.55rem;
}

input[type="text"] {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.85rem 0.95rem;
  font: inherit;
  font-size: 1.05rem;
  background: #fff;
  color: var(--ink);
}

input[type="text"]:focus {
  outline: 2px solid rgba(31, 107, 88, 0.35);
  border-color: rgba(31, 107, 88, 0.55);
}

button {
  font: inherit;
  cursor: pointer;
}

#run-btn,
.cta-cabinet {
  border: 0;
  border-radius: 10px;
  padding: 0.75rem 1.15rem;
  background: var(--ink);
  color: #f7faf7;
  font-weight: 600;
  transition: transform 0.15s ease, background 0.15s ease;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

#run-btn:hover,
.cta-cabinet:hover {
  background: var(--accent);
}

#run-btn:disabled {
  opacity: 0.55;
  cursor: wait;
}

.hint {
  margin: 0.7rem 0 0;
  font-size: 0.84rem;
  color: var(--muted);
}

.mode-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  margin-top: 0.85rem;
}

.mode-row .check {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.88rem;
  color: var(--muted);
  cursor: pointer;
}

.mode-row input {
  accent-color: var(--accent);
}

.doc-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin: 0.25rem 0 0.5rem;
}

.doc-btn {
  display: inline-flex;
  align-items: center;
  padding: 0.55rem 0.95rem;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
}

.doc-btn.ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line);
}

.doc-btn:hover {
  filter: brightness(1.05);
}

.subhead {
  margin: 0.85rem 0 0.35rem;
  font-size: 0.95rem;
  font-weight: 600;
}

.plain-list {
  list-style: disc;
  margin: 0.25rem 0 0.75rem 1.1rem;
  padding: 0;
  color: var(--muted);
}

.plain-list li {
  margin: 0.25rem 0;
}

.report-dialog {
  width: min(740px, calc(100vw - 1.5rem));
  max-height: min(88dvh, 920px);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0;
  background: #f8faf8;
  box-shadow: 0 28px 70px rgba(26, 31, 36, 0.2);
  overflow: hidden;
}

.report-dialog::backdrop {
  background: rgba(12, 16, 14, 0.42);
  backdrop-filter: blur(3px);
}

.report-shell {
  display: flex;
  flex-direction: column;
  max-height: min(88dvh, 920px);
  margin: 0;
}

.report-head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
  padding: 1.1rem 1.2rem;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.75);
}

.report-head h2 {
  margin: 0;
  font-family: var(--font-brand);
  font-size: 1.35rem;
  font-weight: 700;
}

.report-sub {
  margin: 0.25rem 0 0;
  color: var(--muted);
  font-size: 0.9rem;
  word-break: break-all;
}

.close-btn {
  border: 1px solid var(--line);
  background: transparent;
  border-radius: 999px;
  padding: 0.45rem 0.85rem;
  color: var(--ink);
}

.report-body,
.report-loading,
.report-error {
  padding: 1.1rem 1.2rem 1.35rem;
  overflow: auto;
}

.report-loading {
  display: grid;
  gap: 0.35rem;
  text-align: center;
  padding-block: 2.5rem;
}

.report-loading span {
  color: var(--muted);
  font-size: 0.88rem;
}

.report-error {
  color: var(--danger);
  font-size: 0.95rem;
}

.verdict-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.65rem;
  margin-bottom: 1.2rem;
}

.verdict-row > div {
  padding: 0.75rem 0.8rem;
  border-radius: 10px;
  background: var(--accent-soft);
  border: 1px solid rgba(31, 107, 88, 0.16);
}

.eyebrow {
  display: block;
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.25rem;
  font-weight: 600;
}

.verdict-row strong {
  font-family: var(--font-brand);
  font-size: 1.12rem;
  font-weight: 700;
}

h3 {
  margin: 0 0 0.45rem;
  font-family: var(--font-brand);
  font-size: 1.05rem;
  font-weight: 700;
}

.section-note {
  margin: 0 0 0.65rem;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.4;
}

.crawl-chips {
  list-style: none;
  margin: 0 0 0.75rem;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.crawl-chips li {
  font-size: 0.78rem;
  padding: 0.28rem 0.55rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--muted);
}

.crawl-chips li.ok {
  border-color: rgba(31, 107, 88, 0.28);
  color: var(--ok);
  background: rgba(31, 107, 88, 0.06);
}

.crawl-chips li.bad {
  border-color: rgba(155, 36, 51, 0.28);
  color: var(--danger);
  background: rgba(155, 36, 51, 0.06);
}

section + section {
  margin-top: 1.15rem;
}

.board-list,
.issue-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.5rem;
}

.board-list li,
.issue-list li {
  padding: 0.7rem 0.8rem;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #fff;
  line-height: 1.4;
}

.board-list strong,
.issue-list strong {
  display: block;
  margin-bottom: 0.2rem;
  font-weight: 600;
}

.issue-list li.critical {
  border-color: rgba(155, 36, 51, 0.28);
  background: rgba(155, 36, 51, 0.05);
}

.issue-list li.warning {
  border-color: rgba(138, 79, 18, 0.28);
  background: rgba(138, 79, 18, 0.05);
}

.issue-list .meta {
  font-size: 0.78rem;
  color: var(--muted);
  margin-bottom: 0.25rem;
}

.idea-list {
  display: grid;
  gap: 0.45rem;
  margin: 0;
}

.idea-list div {
  display: grid;
  grid-template-columns: 7rem 1fr;
  gap: 0.6rem;
  padding: 0.45rem 0;
  border-bottom: 1px solid var(--line);
  font-size: 0.92rem;
}

.idea-list dt {
  color: var(--muted);
  margin: 0;
}

.idea-list dd {
  margin: 0;
}

.disclaimer {
  margin: 1.2rem 0 0;
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.45;
}

.hidden {
  display: none !important;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 640px) {
  .field-row {
    grid-template-columns: 1fr;
  }

  #run-btn {
    height: 48px;
  }

  .verdict-row {
    grid-template-columns: 1fr;
  }

  .idea-list div {
    grid-template-columns: 1fr;
    gap: 0.15rem;
  }

  .brand-block h1 {
    font-size: 1.12rem;
  }
}
