:root {
  color-scheme: dark;
  --bg: #070604;
  --bg-soft: #100d09;
  --panel: rgba(13, 11, 8, 0.88);
  --panel-strong: rgba(6, 5, 4, 0.94);
  --ink: #f4ead6;
  --muted: #bcae94;
  --dim: #806f59;
  --gold: #c79a52;
  --gold-bright: #f1cf87;
  --line: rgba(212, 164, 89, 0.34);
  --red: #a9352f;
  --red-hot: #e05243;
  --teal: #67d5c3;
  --green: #8ed17d;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.55);
  --radius: 8px;
  font-family: Georgia, "Times New Roman", serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 20% 12%, rgba(199, 154, 82, 0.16), transparent 28rem),
    radial-gradient(circle at 84% 18%, rgba(169, 53, 47, 0.13), transparent 24rem),
    linear-gradient(180deg, rgba(7, 6, 4, 0.84), rgba(7, 6, 4, 0.98)),
    url("assets/per-chaos-poster.png") center top / cover fixed;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  content: "";
  background:
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.018) 1px, transparent 1px);
  background-size: 100% 4px, 4px 100%;
  mix-blend-mode: screen;
  opacity: 0.32;
}

button,
textarea {
  font: inherit;
}

button {
  color: inherit;
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

body.notice-open {
  overflow: hidden;
}

.entry-notice[hidden] {
  display: none;
}

.entry-notice {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: clamp(0.75rem, 3vw, 2rem);
  background:
    radial-gradient(circle at 50% 10%, rgba(199, 154, 82, 0.2), transparent 24rem),
    radial-gradient(circle at 72% 70%, rgba(169, 53, 47, 0.16), transparent 22rem),
    rgba(2, 2, 1, 0.86);
  backdrop-filter: blur(10px);
}

.notice-frame {
  position: relative;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  width: min(920px, 100%);
  max-height: min(92vh, 980px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.76);
  background:
    linear-gradient(180deg, rgba(241, 207, 135, 0.08), transparent 12rem),
    rgba(8, 6, 4, 0.98);
  overflow: hidden;
}

.notice-frame::before {
  position: absolute;
  inset: 12px;
  pointer-events: none;
  content: "";
  border: 1px solid rgba(241, 207, 135, 0.16);
  border-radius: 4px;
}

.notice-scroll {
  position: relative;
  overflow: auto;
  padding: clamp(1.2rem, 4vw, 2.25rem);
  scrollbar-color: var(--gold) rgba(0, 0, 0, 0.3);
}

.notice-scroll:focus {
  outline: none;
}

.notice-icons {
  display: flex;
  justify-content: center;
  gap: clamp(0.7rem, 2vw, 1rem);
  margin-bottom: 1rem;
}

.notice-icon {
  display: grid;
  width: clamp(58px, 9vw, 76px);
  aspect-ratio: 1;
  place-items: center;
  border: 1px solid rgba(199, 154, 82, 0.48);
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 35%, rgba(241, 207, 135, 0.16), transparent 58%),
    rgba(0, 0, 0, 0.32);
}

.notice-icon svg {
  width: 70%;
  height: 70%;
  fill: none;
  stroke: var(--gold-bright);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.8;
  filter: drop-shadow(0 0 10px rgba(199, 154, 82, 0.18));
}

.notice-icon .red-line {
  stroke: var(--red-hot);
}

.notice-icon .red-fill {
  fill: var(--red-hot);
  stroke: var(--red-hot);
}

.notice-overline,
.notice-motto {
  color: var(--gold-bright);
  font-family: "Trebuchet MS", Arial, sans-serif;
  letter-spacing: 0.16em;
  text-align: center;
  text-transform: uppercase;
}

.notice-overline {
  margin: 0 0 0.6rem;
  font-size: 0.72rem;
}

.notice-motto {
  margin: 0 0 1.4rem;
  color: var(--red-hot);
  font-size: 0.8rem;
  font-style: italic;
}

.notice-scroll h1 {
  margin-bottom: 0.35rem;
  font-size: clamp(2.2rem, 7vw, 5.4rem);
  text-align: center;
}

.notice-scroll h2 {
  margin: 1.35rem 0 0.55rem;
  color: var(--gold-bright);
  font-size: clamp(1.25rem, 3vw, 1.75rem);
  font-weight: 500;
}

.notice-scroll p,
.notice-scroll li {
  color: #eadcc2;
  font-size: clamp(0.98rem, 1.7vw, 1.08rem);
  line-height: 1.58;
}

.notice-scroll p {
  margin-bottom: 0.75rem;
}

.notice-scroll ul {
  display: grid;
  gap: 0.35rem;
  margin: 0.55rem 0 0.95rem;
  padding: 0;
  list-style: none;
}

.notice-scroll li {
  position: relative;
  padding-left: 1.05rem;
}

.notice-scroll li::before {
  position: absolute;
  left: 0;
  color: var(--red-hot);
  content: "◇";
}

.notice-closing {
  margin-top: 1.4rem;
  color: var(--gold-bright) !important;
  font-size: clamp(1.12rem, 2vw, 1.32rem) !important;
  font-style: italic;
  text-align: center;
}

.notice-actions {
  position: relative;
  display: flex;
  gap: 0.75rem;
  padding: 1rem clamp(1rem, 3vw, 1.4rem);
  border-top: 1px solid rgba(199, 154, 82, 0.26);
  background: rgba(4, 3, 2, 0.96);
}

.notice-actions .primary-action,
.notice-actions .ghost-action {
  flex: 1 1 0;
}

.notice-exit {
  min-height: 46px;
  flex-basis: 260px;
  color: #f0c5ba;
  border-color: rgba(169, 53, 47, 0.55);
  background: rgba(57, 13, 10, 0.35);
}

.notice-open .stage-shell {
  filter: blur(5px) brightness(0.62);
  pointer-events: none;
  user-select: none;
}

.stage-shell {
  min-height: 100vh;
  border: 1px solid rgba(241, 207, 135, 0.28);
  background:
    linear-gradient(90deg, rgba(0, 0, 0, 0.82), transparent 24%, transparent 76%, rgba(0, 0, 0, 0.78)),
    rgba(5, 4, 3, 0.28);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 72px;
  padding: 1rem clamp(1rem, 3vw, 3rem);
  border-bottom: 1px solid var(--line);
  background: rgba(7, 6, 4, 0.88);
  backdrop-filter: blur(16px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.85rem;
  min-width: 0;
  letter-spacing: 0;
}

.brand-mark {
  display: grid;
  flex: 0 0 42px;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid var(--gold);
  color: var(--gold-bright);
  background: rgba(7, 6, 4, 0.92);
  overflow: hidden;
}

.brand-mark img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-size: clamp(1rem, 2vw, 1.2rem);
  text-transform: uppercase;
}

.brand small,
.topnav {
  color: var(--muted);
  font-family: "Trebuchet MS", Arial, sans-serif;
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.topnav {
  display: flex;
  gap: clamp(0.8rem, 3vw, 2.2rem);
}

.topnav a {
  padding: 0.45rem 0;
  border-bottom: 1px solid transparent;
}

.topnav a:hover,
.topnav a:focus-visible {
  border-color: var(--gold);
  color: var(--ink);
  outline: none;
}

.workbench {
  display: grid;
  gap: clamp(1.5rem, 3vw, 2.4rem);
  min-height: calc(100vh - 72px);
  padding: clamp(1.5rem, 4vw, 4rem);
  align-content: start;
}

.hero-copy {
  max-width: 1120px;
  margin: 0 auto;
  text-align: center;
}

.overline,
.panel-kicker {
  margin: 0 0 0.55rem;
  color: var(--gold-bright);
  font-family: "Trebuchet MS", Arial, sans-serif;
  font-size: 0.78rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0.4rem;
  font-size: clamp(2.55rem, 8vw, 7rem);
  font-weight: 500;
  line-height: 0.92;
  text-transform: uppercase;
  text-shadow: 0 0 24px rgba(0, 0, 0, 0.75);
}

.tagline {
  margin-bottom: 0;
  color: #ead8b6;
  font-size: clamp(1.05rem, 2vw, 1.45rem);
}

.console-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(1.2rem, 2.5vw, 1.8rem);
  width: min(880px, 100%);
  margin: 0 auto;
}

.input-panel,
.results-panel,
.source-card,
.method-steps article {
  position: relative;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  background:
    linear-gradient(180deg, rgba(241, 207, 135, 0.07), transparent 10rem),
    var(--panel);
}

.input-panel,
.results-panel {
  min-height: auto;
  padding: clamp(1rem, 2vw, 1.35rem);
}

.input-panel::before,
.results-panel::before,
.source-card::before,
.method-steps article::before {
  position: absolute;
  inset: 10px;
  pointer-events: none;
  content: "";
  border: 1px solid rgba(241, 207, 135, 0.12);
  border-radius: 4px;
}

.panel-head {
  position: relative;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.panel-head h2 {
  margin-bottom: 0;
  font-size: clamp(1.45rem, 3vw, 2rem);
  font-weight: 500;
}

.signal,
.verdict-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-height: 32px;
  padding: 0.35rem 0.7rem;
  border: 1px solid rgba(169, 53, 47, 0.55);
  color: #f5c3b7;
  background: rgba(57, 13, 10, 0.55);
  font-family: "Trebuchet MS", Arial, sans-serif;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  white-space: nowrap;
}

.signal span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--red-hot);
  box-shadow: 0 0 14px rgba(224, 82, 67, 0.8);
}

.results-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: flex-end;
}

.pdf-action {
  flex: 0 0 auto;
  min-height: 32px;
  padding: 0.35rem 0.7rem;
  border-color: rgba(241, 207, 135, 0.46);
  color: var(--gold-bright);
  background: rgba(7, 6, 4, 0.72);
  white-space: nowrap;
}

.pdf-action:disabled {
  cursor: not-allowed;
  border-color: rgba(128, 111, 89, 0.24);
  color: rgba(188, 174, 148, 0.44);
  background: rgba(7, 6, 4, 0.38);
}

.mode-row,
.sample-row,
.control-strip {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.mode-row {
  margin-bottom: 1rem;
}

.mode-button,
.sample-row button,
.ghost-action {
  min-height: 38px;
  border: 1px solid rgba(199, 154, 82, 0.3);
  border-radius: 4px;
  color: var(--muted);
  background: rgba(7, 6, 4, 0.62);
  font-family: "Trebuchet MS", Arial, sans-serif;
  font-size: 0.76rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.mode-button {
  flex: 1;
  min-width: 96px;
  padding: 0.5rem 0.65rem;
}

.mode-button.is-active {
  border-color: var(--gold);
  color: var(--ink);
  background: rgba(199, 154, 82, 0.16);
}

.field-label {
  position: relative;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.55rem;
  color: var(--gold-bright);
  font-family: "Trebuchet MS", Arial, sans-serif;
  font-size: 0.74rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.char-counter {
  color: var(--dim);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  font-variant-numeric: tabular-nums;
}

.char-counter.is-limit {
  color: var(--red-hot);
}

.summary-error {
  color: var(--red-hot);
}

.alastorian {
  margin: 0 0 1rem;
  padding: 0.9rem 1.1rem;
  border-left: 3px solid var(--gold);
  background: rgba(199, 154, 82, 0.07);
  color: var(--gold-bright);
  font-size: 1.02rem;
  font-style: italic;
  line-height: 1.5;
}

.claim-risk .confidence {
  margin-left: 0.4rem;
  font-size: 0.66rem;
  font-style: normal;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.confidence.conf-alta { color: var(--green); }
.confidence.conf-mitjana { color: var(--gold-bright); }
.confidence.conf-baixa { color: var(--red-hot); }

.mode-banner {
  display: block;
  margin-bottom: 0.7rem;
  padding: 0.55rem 0.75rem;
  border-radius: var(--radius);
  border: 1px solid var(--line);
}

.mode-banner.is-verified {
  border-color: rgba(103, 213, 195, 0.4);
  background: rgba(103, 213, 195, 0.06);
}

.mode-banner.is-unverified {
  border-color: rgba(224, 82, 67, 0.45);
  background: rgba(169, 53, 47, 0.1);
}

.mode-banner .mode-name {
  display: block;
  font-family: "Trebuchet MS", Arial, sans-serif;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold-bright);
}

.mode-banner .mode-desc {
  display: block;
  margin-top: 0.15rem;
  font-size: 0.86rem;
  color: var(--muted);
}

.report-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  align-items: center;
  margin-top: 0.7rem;
  padding-top: 0.5rem;
  border-top: 1px solid rgba(199, 154, 82, 0.2);
  font-family: "Trebuchet MS", Arial, sans-serif;
  font-size: 0.68rem;
  color: var(--dim);
}

.report-meta .meta-disclaimer {
  flex-basis: 100%;
  color: var(--muted);
  font-style: italic;
}

.report-meta .report-bug {
  color: var(--gold);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.source-passage {
  display: block;
  margin-top: 0.2rem;
  padding-left: 0.6rem;
  border-left: 2px solid rgba(199, 154, 82, 0.4);
  color: var(--ink);
  font-size: 0.85rem;
  font-style: italic;
}

.source-consulted {
  margin-left: 0.4rem;
  color: var(--dim);
  font-size: 0.7rem;
}

.source-lang {
  color: var(--teal);
  font-size: 0.72rem;
}

.evidence-list {
  margin: 0.3rem 0 0;
  padding-left: 1.1rem;
  line-height: 1.5;
}

.evidence-list li {
  margin-bottom: 0.3rem;
}

.evidence-empty {
  margin: 0.3rem 0 0;
  color: var(--dim);
}

.ref {
  color: var(--teal);
  font-size: 0.62rem;
}

.rationale {
  margin-top: 0.9rem;
}

.rationale p {
  margin: 0.3rem 0 0;
  color: var(--muted);
}

.contradiction-box {
  margin-top: 0.9rem;
  padding: 0.7rem 0.9rem;
  border: 1px dashed rgba(224, 82, 67, 0.45);
  border-radius: var(--radius);
  background: rgba(169, 53, 47, 0.08);
}

.contradiction-box h4 {
  margin: 0 0 0.3rem;
  color: var(--red-hot);
}

.contradiction-status {
  margin: 0 0 0.4rem;
  color: var(--muted);
  font-size: 0.85rem;
}

.contradiction-box ul {
  margin: 0;
  padding-left: 1.1rem;
}

.source-item {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
  line-height: 1.45;
}

.source-item .source-ref {
  color: var(--teal);
  font-size: 0.72rem;
  padding-top: 0.15rem;
}

.source-item a {
  color: var(--gold-bright);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.source-item strong {
  color: var(--gold);
  margin-right: 0.35rem;
}

.source-snippet {
  display: block;
  margin-top: 0.15rem;
  color: var(--dim);
  font-size: 0.82rem;
}

textarea {
  position: relative;
  display: block;
  width: 100%;
  min-height: 238px;
  resize: vertical;
  padding: 1rem;
  border: 1px solid rgba(199, 154, 82, 0.38);
  border-radius: var(--radius);
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.035), transparent),
    rgba(5, 4, 3, 0.84);
  font-size: 1rem;
  line-height: 1.55;
  outline: none;
}

textarea:focus {
  border-color: var(--gold-bright);
  box-shadow: 0 0 0 3px rgba(199, 154, 82, 0.16);
}

.control-strip {
  margin-top: 1rem;
}

.primary-action,
.ghost-action,
.sample-row button {
  border-radius: 4px;
}

.primary-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  min-height: 46px;
  flex: 1 1 230px;
  padding: 0.78rem 1rem;
  border: 1px solid var(--gold-bright);
  color: #190f08;
  background: linear-gradient(180deg, var(--gold-bright), var(--gold));
  font-family: "Trebuchet MS", Arial, sans-serif;
  font-size: 0.84rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.primary-action:hover,
.primary-action:focus-visible {
  filter: brightness(1.08);
  outline: none;
}

.ghost-action {
  flex: 0 0 108px;
  padding: 0.72rem 0.95rem;
}

.sample-row {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(199, 154, 82, 0.18);
}

.sample-row button {
  flex: 1;
  min-width: 130px;
  padding: 0.62rem 0.75rem;
}

.sample-row button:hover,
.ghost-action:hover,
.mode-button:hover {
  border-color: var(--gold);
  color: var(--ink);
}

.limit-warning {
  position: relative;
  margin-top: 1rem;
  padding: 0.8rem 0.95rem;
  border: 1px solid rgba(224, 82, 67, 0.42);
  border-left: 3px solid var(--red-hot);
  border-radius: var(--radius);
  background:
    linear-gradient(90deg, rgba(169, 53, 47, 0.16), rgba(7, 6, 4, 0.72)),
    rgba(8, 6, 4, 0.72);
}

.limit-warning strong {
  display: block;
  margin-bottom: 0.28rem;
  color: var(--gold-bright);
  font-family: "Trebuchet MS", Arial, sans-serif;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.limit-warning p {
  margin: 0;
  color: #f0c5ba;
  font-size: 0.9rem;
  line-height: 1.5;
}

.altcha-panel {
  display: grid;
  gap: 0.55rem;
  margin-top: 1rem;
  padding: 0.85rem 0.95rem;
  border: 1px solid rgba(199, 154, 82, 0.28);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(199, 154, 82, 0.08), transparent),
    rgba(7, 6, 4, 0.66);
}

.altcha-panel[hidden],
.owner-status[hidden] {
  display: none;
}

.altcha-panel p,
.quota-status,
.owner-status {
  margin: 0;
  color: var(--muted);
  font-family: "Trebuchet MS", Arial, sans-serif;
  font-size: 0.78rem;
  line-height: 1.45;
}

.altcha-panel altcha-widget {
  --altcha-color-base: rgba(5, 4, 3, 0.82);
  --altcha-color-base-content: var(--ink);
  --altcha-color-border: rgba(199, 154, 82, 0.42);
  --altcha-color-border-focus: var(--gold-bright);
  --altcha-color-neutral: rgba(199, 154, 82, 0.36);
  --altcha-color-neutral-content: var(--ink);
  --altcha-color-primary: var(--gold);
  --altcha-color-primary-content: #170f08;
  --altcha-color-success: #5b7f50;
  --altcha-color-success-content: #fff4da;
  --altcha-border-radius: 4px;
  --altcha-max-width: 100%;
  max-width: 100%;
}

.quota-status {
  color: var(--gold-bright);
}

.owner-status {
  margin-top: 0.8rem;
  padding: 0.7rem 0.85rem;
  border: 1px solid rgba(103, 213, 195, 0.34);
  border-radius: var(--radius);
  color: #d8f5ee;
  background: rgba(7, 38, 36, 0.28);
}

.score-board {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.65rem;
  margin-bottom: 1rem;
}

.score-board div {
  min-height: 84px;
  padding: 0.75rem;
  border: 1px solid rgba(199, 154, 82, 0.22);
  border-radius: 4px;
  background: rgba(5, 4, 3, 0.5);
}

.score-value,
.score-label {
  display: block;
}

.score-value {
  color: var(--gold-bright);
  font-size: clamp(1.65rem, 4vw, 2.35rem);
  line-height: 1;
}

.score-label {
  margin-top: 0.35rem;
  color: var(--muted);
  font-family: "Trebuchet MS", Arial, sans-serif;
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.summary-box {
  position: relative;
  margin-bottom: 1rem;
  padding: 1rem;
  border: 1px solid rgba(103, 213, 195, 0.28);
  border-radius: var(--radius);
  color: #dff6ef;
  background: rgba(7, 38, 36, 0.35);
  line-height: 1.5;
}

.process-lines {
  display: grid;
  gap: 0.45rem;
}

.process-lines span {
  display: block;
  color: #dff6ef;
}

.trap-map {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.55rem;
  margin-bottom: 1rem;
}

.trap-item,
.trap-empty {
  min-height: 64px;
  padding: 0.7rem;
  border: 1px solid rgba(169, 53, 47, 0.3);
  border-radius: 4px;
  background: rgba(57, 13, 10, 0.36);
}

.trap-item strong,
.trap-item span {
  display: block;
}

.trap-item strong {
  color: var(--red-hot);
  font-size: 1.35rem;
  line-height: 1;
}

.trap-item span,
.trap-empty {
  color: #f0c5ba;
  font-family: "Trebuchet MS", Arial, sans-serif;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.trap-empty {
  display: grid;
  grid-column: 1 / -1;
  place-items: center;
  border-color: rgba(103, 213, 195, 0.28);
  color: #d8f5ee;
  background: rgba(7, 38, 36, 0.28);
  text-align: center;
}

.owner-access-strip {
  display: flex;
  justify-content: flex-end;
  padding-top: 0.85rem;
}

.owner-access-link {
  border: 0;
  color: var(--dim);
  background: transparent;
  font-family: "Trebuchet MS", Arial, sans-serif;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.owner-access-link:hover,
.owner-access-link:focus-visible {
  color: var(--gold-bright);
  outline: none;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.owner-dialog {
  width: min(460px, calc(100vw - 2rem));
  border: 1px solid rgba(199, 154, 82, 0.42);
  border-radius: var(--radius);
  color: var(--ink);
  background: rgba(9, 7, 5, 0.98);
  box-shadow: var(--shadow);
}

.owner-dialog::backdrop {
  background: rgba(2, 2, 1, 0.72);
  backdrop-filter: blur(8px);
}

.owner-dialog-card {
  display: grid;
  gap: 0.85rem;
  margin: 0;
  padding: 1.1rem;
}

.owner-dialog-head h2 {
  margin: 0.1rem 0 0;
  color: var(--gold-bright);
  font-size: 1.65rem;
  font-weight: 500;
}

.owner-dialog-copy,
.owner-dialog-message {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.5;
}

.owner-password {
  width: 100%;
  padding: 0.72rem 0.82rem;
  border: 1px solid rgba(199, 154, 82, 0.38);
  border-radius: 4px;
  color: var(--ink);
  background: rgba(5, 4, 3, 0.84);
}

.owner-password:focus {
  border-color: var(--gold-bright);
  outline: none;
  box-shadow: 0 0 0 3px rgba(199, 154, 82, 0.16);
}

.owner-dialog-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.owner-dialog-actions .primary-action,
.owner-dialog-actions .ghost-action {
  flex: 1 1 130px;
}

.claims-list {
  position: relative;
  display: grid;
  gap: 0.8rem;
}

.claim-card {
  padding: 1rem;
  border: 1px solid rgba(199, 154, 82, 0.22);
  border-left: 4px solid var(--gold);
  border-radius: var(--radius);
  background: rgba(5, 4, 3, 0.58);
}

.claim-card.high {
  border-left-color: var(--red-hot);
}

.claim-card.medium {
  border-left-color: var(--gold-bright);
}

.claim-card.low {
  border-left-color: var(--teal);
}

.claim-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  margin-bottom: 0.65rem;
}

.claim-index {
  color: var(--gold-bright);
  font-family: "Trebuchet MS", Arial, sans-serif;
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.claim-risk {
  padding: 0.22rem 0.5rem;
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: var(--muted);
  font-family: "Trebuchet MS", Arial, sans-serif;
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  white-space: nowrap;
}

.claim-text {
  margin-bottom: 0.85rem;
  color: #fff7e8;
  font-size: 1.02rem;
  line-height: 1.45;
}

.chip-row,
.source-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.mini-label {
  margin: 0.75rem 0 0.38rem;
  color: var(--gold-bright);
  font-family: "Trebuchet MS", Arial, sans-serif;
  font-size: 0.66rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.chip,
.source-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0.28rem 0.55rem;
  border: 1px solid rgba(199, 154, 82, 0.25);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(0, 0, 0, 0.24);
  font-family: "Trebuchet MS", Arial, sans-serif;
  font-size: 0.72rem;
}

.chip.alert {
  border-color: rgba(224, 82, 67, 0.45);
  color: #ffc3ba;
}

.source-chips {
  margin-top: 0.75rem;
}

.source-pill {
  flex-direction: column;
  align-items: flex-start;
  color: #d8f5ee;
  border-color: rgba(103, 213, 195, 0.26);
  gap: 0.12rem;
}

.source-pill strong {
  color: var(--teal);
  font-size: 0.63rem;
  font-weight: 400;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

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

.evidence-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
  margin-top: 0.95rem;
}

.evidence-grid div,
.query-box,
.missing-box {
  border: 1px solid rgba(199, 154, 82, 0.18);
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.24);
}

.evidence-grid div {
  padding: 0.75rem;
}

.evidence-grid h4,
.query-box h4,
.missing-box h4 {
  margin: 0 0 0.42rem;
  color: var(--gold-bright);
  font-family: "Trebuchet MS", Arial, sans-serif;
  font-size: 0.68rem;
  font-weight: 400;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.evidence-grid p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.45;
}

.query-box,
.missing-box {
  margin-top: 0.75rem;
  padding: 0.75rem;
}

.query-box ul,
.missing-box ul {
  display: grid;
  gap: 0.45rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.query-box li {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 0.55rem;
  align-items: start;
}

.query-box span {
  color: var(--muted);
  font-family: "Trebuchet MS", Arial, sans-serif;
  font-size: 0.72rem;
  text-transform: uppercase;
}

.query-box code {
  overflow-wrap: anywhere;
  color: #f8ead0;
  font-family: Consolas, "Courier New", monospace;
  font-size: 0.78rem;
}

.missing-box li {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.38;
}

.missing-box li::before {
  color: var(--red-hot);
  content: "◇ ";
}

.method-band,
.sources-band {
  padding: clamp(1.5rem, 4vw, 4rem);
}

.method-band {
  border-top: 1px solid rgba(199, 154, 82, 0.18);
  background:
    linear-gradient(180deg, rgba(7, 6, 4, 0.76), rgba(7, 6, 4, 0.96)),
    url("assets/teatre-campanya.png") center / cover;
}

.section-title {
  width: min(1120px, 100%);
  margin: 0 auto 1.2rem;
}

.section-title h2 {
  margin-bottom: 0;
  font-size: clamp(1.7rem, 4vw, 3rem);
  font-weight: 500;
}

.method-steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  width: min(1120px, 100%);
  margin: 0 auto;
}

.method-steps article {
  min-height: 190px;
  padding: 1.2rem;
}

.method-steps span {
  color: var(--red-hot);
  font-family: "Trebuchet MS", Arial, sans-serif;
  font-size: 0.8rem;
  letter-spacing: 0.15em;
}

.method-steps h3 {
  margin: 0.55rem 0;
  color: var(--gold-bright);
  font-size: 1.35rem;
  font-weight: 500;
}

.method-steps p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.5;
}

.sources-band {
  background: linear-gradient(180deg, rgba(7, 6, 4, 0.97), #050403);
}

.source-card {
  width: min(1120px, 100%);
  margin: 0 auto;
  padding: 1.2rem;
}

.source-grid {
  position: relative;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.6rem;
}

.source-grid span {
  display: grid;
  min-height: 48px;
  place-items: center;
  border: 1px solid rgba(199, 154, 82, 0.22);
  border-radius: 4px;
  color: var(--muted);
  background: rgba(0, 0, 0, 0.25);
  font-family: "Trebuchet MS", Arial, sans-serif;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-align: center;
  text-transform: uppercase;
}

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

.donation-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem clamp(1rem, 3vw, 2rem);
  border-bottom: 1px solid rgba(199, 154, 82, 0.28);
  color: #f0dfbf;
  background:
    linear-gradient(90deg, rgba(74, 43, 18, 0.36), rgba(7, 6, 4, 0.94) 42%, rgba(66, 18, 13, 0.26)),
    #060504;
}

.donation-strip p {
  max-width: 680px;
  margin: 0;
  font-family: "Trebuchet MS", Arial, sans-serif;
  font-size: 0.9rem;
  line-height: 1.55;
}

.donation-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  justify-content: flex-end;
}

.donation-actions a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0.55rem 0.9rem;
  border: 1px solid rgba(241, 207, 135, 0.5);
  border-radius: 999px;
  color: #fff4dc;
  background:
    linear-gradient(180deg, rgba(199, 154, 82, 0.16), rgba(64, 34, 14, 0.58)),
    rgba(8, 6, 4, 0.86);
  font-family: "Trebuchet MS", Arial, sans-serif;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.donation-actions a:hover,
.donation-actions a:focus-visible {
  border-color: var(--red-hot);
  color: var(--gold-bright);
  background:
    linear-gradient(180deg, rgba(169, 53, 47, 0.24), rgba(64, 18, 13, 0.7)),
    rgba(8, 6, 4, 0.92);
  outline: none;
}

.footer-legal {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.4rem 1.1rem;
  padding: 1rem 1rem 0;
  border-top: 1px solid var(--line);
  margin-top: 0.85rem;
}

.footer-legal a {
  color: var(--muted);
  font-family: "Trebuchet MS", Arial, sans-serif;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.footer-legal a:hover,
.footer-legal a:focus-visible {
  color: var(--gold-bright);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.footer-credit {
  padding: 1.1rem 1rem 1.35rem;
  color: var(--gold-bright);
  font-family: "Trebuchet MS", Arial, sans-serif;
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-align: center;
  text-transform: uppercase;
}

.waiting-music[hidden] {
  display: none;
}

.waiting-music {
  position: fixed;
  right: clamp(1rem, 3vw, 2rem);
  bottom: clamp(1rem, 3vw, 2rem);
  z-index: 40;
  width: min(430px, calc(100vw - 2rem));
}

.waiting-music-card {
  position: relative;
  padding: 1rem;
  border: 1px solid rgba(241, 207, 135, 0.46);
  border-radius: var(--radius);
  box-shadow: 0 22px 70px rgba(0, 0, 0, 0.68);
  background:
    linear-gradient(180deg, rgba(241, 207, 135, 0.09), transparent 8rem),
    linear-gradient(135deg, rgba(74, 43, 18, 0.34), rgba(7, 6, 4, 0.96) 55%, rgba(57, 13, 10, 0.46)),
    #050403;
}

.waiting-music-card::before {
  position: absolute;
  inset: 8px;
  pointer-events: none;
  content: "";
  border: 1px solid rgba(241, 207, 135, 0.12);
  border-radius: 4px;
}

.waiting-music-head {
  position: relative;
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: 0.85rem;
  align-items: center;
  margin-bottom: 0.75rem;
}

.waiting-music-icon {
  display: grid;
  width: 56px;
  aspect-ratio: 1;
  place-items: center;
  border: 1px solid rgba(199, 154, 82, 0.5);
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.34);
}

.waiting-music-icon svg {
  width: 72%;
  height: 72%;
  fill: none;
  stroke: var(--gold-bright);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.6;
}

.waiting-music-icon .music-wave {
  stroke: var(--red-hot);
}

.waiting-music h2 {
  margin: 0;
  color: var(--ink);
  font-size: clamp(1.25rem, 4vw, 1.7rem);
  font-weight: 500;
}

.waiting-video-wrap {
  position: relative;
  display: grid;
  min-height: 150px;
  place-items: center;
  margin: 0 0 0.85rem;
  border: 1px solid rgba(199, 154, 82, 0.34);
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.42);
  overflow: hidden;
}

.waiting-video-wrap::after {
  position: absolute;
  inset: 0;
  pointer-events: none;
  content: "";
  border: 1px solid rgba(241, 207, 135, 0.08);
  box-shadow: inset 0 0 28px rgba(0, 0, 0, 0.68);
}

.waiting-video-wrap video {
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: 210px;
  object-fit: contain;
  opacity: 0.86;
  filter: sepia(0.22) contrast(1.08) brightness(0.86);
}

.waiting-music p {
  position: relative;
  margin: 0 0 0.7rem;
  color: #eadcc2;
  font-size: 0.92rem;
  line-height: 1.5;
}

.waiting-music p strong {
  color: var(--gold-bright);
}

.music-toggle {
  position: relative;
  width: 100%;
  margin-top: 0.2rem;
}

@media (max-width: 980px) {
  .console-grid,
  .method-steps {
    grid-template-columns: 1fr;
  }

  .input-panel,
  .results-panel {
    min-height: auto;
  }

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

@media (max-width: 640px) {
  .entry-notice {
    padding: 0;
  }

  .notice-frame {
    width: 100%;
    max-height: 100vh;
    border-radius: 0;
  }

  .notice-actions {
    flex-direction: column;
  }

  .notice-actions .primary-action,
  .notice-actions .ghost-action {
    flex-basis: auto;
    width: 100%;
  }

  .topbar {
    position: static;
    align-items: flex-start;
    flex-direction: column;
  }

  .topnav {
    width: 100%;
    justify-content: space-between;
  }

  .workbench,
  .method-band,
  .sources-band {
    padding: 1rem;
  }

  h1 {
    font-size: clamp(2.4rem, 16vw, 4rem);
  }

  .score-board {
    grid-template-columns: 1fr;
  }

  .trap-map,
  .evidence-grid,
  .query-box li {
    grid-template-columns: 1fr;
  }

  .panel-head,
  .claim-topline {
    align-items: flex-start;
    flex-direction: column;
  }

  .signal,
  .verdict-badge,
  .claim-risk {
    white-space: normal;
  }

  .source-grid {
    grid-template-columns: 1fr;
  }

  .donation-strip {
    align-items: stretch;
    flex-direction: column;
  }

  .donation-actions {
    justify-content: stretch;
  }

  .donation-actions a {
    flex: 1 1 100%;
  }

  .waiting-music {
    right: 0.75rem;
    bottom: 0.75rem;
    width: calc(100vw - 1.5rem);
  }

  .waiting-music-head {
    grid-template-columns: 48px 1fr;
  }

  .waiting-music-icon {
    width: 48px;
  }
}
