:root {
  --ink: #161616;
  --muted: #8b8b8b;
  --faint: #b0b0b0;
  --line: #e8e8e8;
  --line-focus: #cfcfcf;
  --chip: #f3f3f3;
  --paper: #ffffff;
  --accent: #1f9d6a;
  --accent-soft: rgba(31, 157, 106, 0.12);
  --danger: #b42318;
  --danger-soft: rgba(180, 35, 24, 0.08);
  --warn: #8a5a10;
  --warn-soft: rgba(138, 90, 16, 0.1);
  --ok: #1f9d6a;
  --ok-soft: rgba(31, 157, 106, 0.1);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 6px 20px rgba(0, 0, 0, 0.05);
  --shadow-focus: 0 1px 2px rgba(0, 0, 0, 0.05), 0 10px 28px rgba(0, 0, 0, 0.08);
  --radius-pill: 40px;
  --max: 880px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  background: #ffffff;
  color: var(--ink);
  font-family: system-ui, -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
  min-height: 100%;
  -webkit-font-smoothing: antialiased;
}

body { min-height: 100vh; }

.page {
  width: min(var(--max), calc(100% - 40px));
  margin: 0 auto;
  padding: 56px 0 80px;
  transition: padding 0.45s cubic-bezier(0.16, 1, 0.3, 1);
}

.page.has-results { padding-top: 28px; }

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 20px 6px;
  min-height: 32px;
}

.brand-mark {
  width: 36px;
  height: 36px;
  object-fit: contain;
  display: none;
  flex: 0 0 auto;
}

.brand.has-mark .brand-mark { display: block; }

.brand-select {
  appearance: none;
  -webkit-appearance: none;
  border: 0;
  background: transparent url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'><path fill='%238b8b8b' d='M0 0l5 6 5-6z'/></svg>") no-repeat right 2px center;
  padding: 0 16px 0 0;
  font: inherit;
  font-size: 15px;
  font-weight: 500;
  letter-spacing: -0.02em;
  color: var(--ink);
  cursor: pointer;
  line-height: 1.2;
  max-width: 100%;
}

.brand-select:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
  border-radius: 2px;
}

.ask-box {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  width: 100%;
  min-height: 80px;
  padding: 10px 10px 10px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  background: var(--paper);
  box-shadow: var(--shadow);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.ask-box:focus-within {
  border-color: var(--line-focus);
  box-shadow: var(--shadow-focus);
}

.attach { flex: 0 0 auto; position: relative; }

.attach input[type="file"] {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.icon-btn {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--ink);
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex: 0 0 auto;
}

.icon-btn:hover,
.icon-btn:focus-visible { background: #f5f5f5; outline: none; }

.icon-btn:focus-visible { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--ink); }

.icon-btn svg { width: 22px; height: 22px; display: block; }

.ask-fields {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  padding: 2px 4px;
}

#question {
  width: 100%;
  border: 0;
  outline: none;
  background: transparent;
  font: inherit;
  font-size: 19px;
  line-height: 1.35;
  color: var(--ink);
  padding: 6px 4px;
  resize: none;
  overflow: hidden;
  display: block;
  min-height: 28px;
  max-height: 120px;
}

#question::placeholder { color: var(--muted); }

.file-chip {
  display: none;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  width: fit-content;
  background: var(--chip);
  border-radius: 999px;
  padding: 2px 6px 2px 10px;
  font-size: 12px;
  line-height: 1.3;
  color: var(--ink);
}

.file-chip.is-visible { display: inline-flex; }

.file-chip .file-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 32ch;
}

.file-chip .clear-file {
  appearance: none;
  border: 0;
  background: transparent;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  cursor: pointer;
  color: var(--ink);
  font-size: 16px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.file-chip .clear-file:hover,
.file-chip .clear-file:focus-visible { background: #e7e7e7; outline: none; }

.ask-submit {
  background: var(--ink);
  color: #ffffff;
}

.ask-submit:hover,
.ask-submit:focus-visible { background: #2a2a2a; }

.ask-submit:focus-visible { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--ink); }

.ask-submit svg { width: 18px; height: 18px; }

.demos {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  margin: 16px 6px 0;
}

.demos-label {
  font-size: 12px;
  color: var(--faint);
  letter-spacing: 0.01em;
}

.demo-btn {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 12.5px;
  padding: 0;
  cursor: pointer;
  text-decoration: none;
  border-bottom: 1px solid #ececec;
  line-height: 1.4;
}

.demo-btn:hover,
.demo-btn:focus-visible {
  color: var(--ink);
  border-bottom-color: var(--ink);
  outline: none;
}

.results-kicker {
  font-size: 11px;
  color: var(--faint);
  letter-spacing: 0.04em;
  margin: 22px 6px 8px;
}

.results {
  margin-top: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.card {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
  padding: 20px 22px 18px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
  opacity: 0;
  transform: translateY(-22px);
}

.card.is-in {
  animation: drop 0.7s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.instant .card,
.instant .card.is-in {
  animation: none;
  opacity: 1;
  transform: none;
}

@keyframes drop {
  from { opacity: 0; transform: translateY(-22px); }
  to { opacity: 1; transform: none; }
}

.card-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.card-kicker {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.demo-tag {
  font-size: 11px;
  color: var(--faint);
  letter-spacing: 0.02em;
  flex: 1 1 auto;
  text-align: right;
  line-height: 1.35;
}

.mentality-title {
  font-size: 22px;
  font-weight: 560;
  letter-spacing: -0.03em;
  line-height: 1.25;
  margin-bottom: 14px;
}

.ontology {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.onto-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 8px;
  font-size: 13px;
  color: #444;
  line-height: 1.45;
}

.onto-label {
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 600;
  width: 9.5rem;
  flex: 0 0 auto;
}

.tag {
  display: inline-flex;
  align-items: center;
  background: var(--chip);
  border-radius: 999px;
  padding: 3px 9px;
  font-size: 12.5px;
  color: var(--ink);
}

.tag.quiet { background: transparent; padding: 0 2px; color: var(--muted); }
.sep { color: var(--faint); font-size: 12px; }

.syllogism { display: flex; flex-direction: column; gap: 0; }

.syl-row {
  display: grid;
  grid-template-columns: 7.2rem 1fr auto;
  gap: 12px 16px;
  align-items: start;
  padding: 12px 0;
  border-top: 1px solid #f2f2f2;
}

.syl-row:first-of-type { border-top: 0; padding-top: 2px; }

.syl-kind {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--muted);
  padding-top: 3px;
}

.syl-text { font-size: 15px; line-height: 1.45; color: var(--ink); }

.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 4px 9px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
  align-self: start;
}

.pill.true { color: var(--ok); background: var(--ok-soft); }
.pill.false { color: var(--danger); background: var(--danger-soft); }
.pill.unresolved { color: #666; background: #f3f3f3; }
.pill.accept { color: var(--ok); background: var(--ok-soft); }
.pill.conditional { color: var(--warn); background: var(--warn-soft); }
.pill.reject { color: var(--danger); background: var(--danger-soft); }

.cite {
  margin-top: 8px;
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.45;
}

.cite + .cite { margin-top: 2px; }

.domains { display: flex; flex-direction: column; gap: 0; }

.domain-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: baseline;
  padding: 9px 0;
  border-top: 1px solid #f2f2f2;
  font-size: 14.5px;
}

.domain-row:first-of-type { border-top: 0; padding-top: 2px; }

.domain-name { letter-spacing: -0.01em; }
.domain-name .hint {
  display: block;
  font-size: 11.5px;
  color: var(--muted);
  font-weight: 400;
  letter-spacing: 0;
  margin-top: 2px;
}

.status { font-size: 12.5px; font-weight: 600; letter-spacing: 0.02em; text-transform: lowercase; }
.status.supported { color: var(--ok); }
.status.partial { color: var(--warn); }
.status.unsupported { color: var(--danger); }
.status.missing, .status.pending { color: var(--muted); font-weight: 500; }

.verdict-hero {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 10px 18px;
  margin-bottom: 8px;
}

.verdict-word {
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.04em;
  line-height: 1.1;
}

.verdict-word.ACCEPT { color: var(--ok); }
.verdict-word.CONDITIONAL { color: var(--warn); }
.verdict-word.REJECT { color: var(--danger); }

.verdict-meta {
  font-size: 14px;
  color: #555;
}

.verdict-meta strong { font-weight: 600; color: var(--ink); }

.reason {
  margin: 10px 0 16px;
  font-size: 14.5px;
  line-height: 1.5;
  color: #333;
}

.checks {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 24px;
}

.check {
  display: grid;
  grid-template-columns: 14px 1fr;
  gap: 8px;
  align-items: baseline;
  padding: 6px 0;
  border-top: 1px solid #f4f4f4;
  font-size: 13px;
}

.checks .check:nth-child(-n+2) { border-top: 0; }

.mark { font-size: 11px; font-weight: 700; }
.mark.pass { color: var(--ok); }
.mark.fail { color: var(--danger); }

.check-name { color: #333; }

.correction {
  margin-top: 14px;
  font-size: 13px;
  color: #555;
  line-height: 1.45;
}

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

@media (max-width: 640px) {
  .page { width: calc(100% - 28px); padding-top: 28px; }
  .ask-box { min-height: 68px; padding: 7px 7px 7px 8px; border-radius: 28px; }
  #question { font-size: 16px; }
  .icon-btn { width: 44px; height: 44px; }
  .syl-row { grid-template-columns: 1fr; gap: 4px; }
  .checks { grid-template-columns: 1fr; }
  .onto-label { width: 100%; }
  .mentality-title { font-size: 20px; }
  .verdict-word { font-size: 24px; }
  .file-chip .file-name { max-width: 18ch; }
}
