/* Receipt Collector — dark-chrome instrument panel, cold red accent. Vanilla, no deps. */

.rc-app {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  align-items: start;
  margin: 1.5rem 0 1rem;
}
@media (max-width: 768px) { .rc-app { grid-template-columns: 1fr; } }

/* ── panes ── */
.rc-form, .rc-out {
  background: linear-gradient(#17171c, #131317);
  border: 1px solid #3a3a44;
  border-radius: 8px;
  padding: 0 0 16px;
  overflow: hidden;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04), 0 2px 10px rgba(0, 0, 0, 0.35);
  transition: border-color 0.2s;
}
.rc-form:focus-within, .rc-out:focus-within {
  border-color: #55556a;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05),
              0 2px 10px rgba(0, 0, 0, 0.35),
              0 0 14px rgba(204, 0, 0, 0.08);
}
/* keep the live receipt in view while composing */
@media (min-width: 769px) { .rc-out { position: sticky; top: 18px; } }

.rc-panehead {
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 0.8rem;
  padding: 9px 16px;
  margin-bottom: 14px;
  font: 600 0.68rem/1.4 "JetBrains Mono", ui-monospace, monospace;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #7a7a88;
  background: linear-gradient(#1e1e24, #16161a);
  border-bottom: 1px solid #3a3a44;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}
.rc-panehead::after {
  content: "";
  position: absolute;
  left: 16px;
  bottom: -1px;
  width: 26px;
  height: 1px;
  background: #CC0000;
  box-shadow: 0 0 8px rgba(204, 0, 0, 0.5);
}

/* ── fields ── */
.rc-field { display: block; padding: 0 16px 12px; }
.rc-field > span {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.6rem;
  margin-bottom: 6px;
  font: 600 0.66rem/1.4 "JetBrains Mono", ui-monospace, monospace;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #7a7a88;
}
.rc-field a {
  color: #ff6a6a;
  text-transform: none;
  letter-spacing: 0;
  font-weight: 600;
  text-decoration: none;
  border-bottom: 1px dotted rgba(204, 0, 0, 0.5);
  transition: color 0.15s, border-color 0.15s;
}
.rc-field a:hover { color: #ff9a9a; border-bottom-color: #CC0000; }
.rc-field a:focus-visible { outline: 2px solid #CC0000; outline-offset: 2px; border-radius: 2px; }
.rc-row { display: flex; gap: 0; }
.rc-row .rc-field { flex: 1; min-width: 0; }
@media (max-width: 520px) { .rc-row { flex-direction: column; } }

#rc-claim, .rc-field input, .rc-field select {
  width: 100%;
  box-sizing: border-box;
  background: #0c0c0f;
  color: #c8c8d0;
  border: 1px solid #3a3a44;
  border-radius: 4px;
  padding: 8px 10px;
  font: 400 0.9rem/1.5 "JetBrains Mono", ui-monospace, monospace;
  outline: 0;
  caret-color: #CC0000;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.35);
  transition: border-color 0.15s, box-shadow 0.15s;
}
#rc-claim { resize: vertical; line-height: 1.6; min-height: 74px; }
#rc-claim:hover, .rc-field input:hover, .rc-field select:hover { border-color: #4a4a56; }
#rc-claim:focus, .rc-field input:focus, .rc-field select:focus {
  border-color: #CC0000;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.35), 0 0 10px rgba(204, 0, 0, 0.14);
}
#rc-claim::placeholder, .rc-field input::placeholder { color: #55556a; }
#rc-claim::selection, .rc-field input::selection { background: rgba(204, 0, 0, 0.35); color: #f0f0f6; }

/* ── tier selector — tints to the leaderboard's tier colors ── */
.rc-field select {
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
  padding-right: 30px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%237a7a88' stroke-width='1.6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 10px 6px;
}
.rc-field select:focus-visible { outline: 1px solid #CC0000; outline-offset: 1px; }
#rc-tier:has(option[value="FACT"]:checked) {
  color: #6fd06f;
  border-color: #2a5a2a;
  box-shadow: inset 3px 0 0 #2a5a2a, inset 0 2px 4px rgba(0, 0, 0, 0.35);
}
#rc-tier:has(option[value="ATTRIBUTED"]:checked) {
  color: #d0b060;
  border-color: #5a4a2a;
  box-shadow: inset 3px 0 0 #5a4a2a, inset 0 2px 4px rgba(0, 0, 0, 0.35);
}
#rc-tier:has(option[value="RUMOR"]:checked) {
  color: #d07060;
  border-color: #5a2a2a;
  box-shadow: inset 3px 0 0 #5a2a2a, inset 0 2px 4px rgba(0, 0, 0, 0.35);
}
#rc-tier option { background: #16161a; color: #c8c8d0; }

/* ── buttons ── */
.rc-btns { display: inline-flex; gap: 8px; }
.rc-btn {
  background: linear-gradient(#26262e, #1b1b21);
  color: #c8c8d0;
  border: 1px solid #55556a;
  border-radius: 4px;
  padding: 4px 12px;
  font: 600 0.66rem/1.4 "JetBrains Mono", ui-monospace, monospace;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
  transition: border-color 0.15s, color 0.15s, box-shadow 0.15s;
}
.rc-btn:hover {
  border-color: #CC0000;
  color: #e8e8f0;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05), 0 0 10px rgba(204, 0, 0, 0.2);
}
.rc-btn:active { background: #16161a; }
.rc-btn:focus-visible { outline: 2px solid #CC0000; outline-offset: 2px; }
.rc-btn-primary {
  background: linear-gradient(#3a0d0d, #240808);
  border-color: #CC0000;
  color: #ff8a8a;
}
.rc-btn-primary:hover {
  color: #fff;
  background: linear-gradient(#4a1010, #300a0a);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 0 12px rgba(204, 0, 0, 0.35);
}
.rc-btn-primary:active { background: #240808; }

/* ── degree meter (mirrors the scanner gauge) ── */
.rc-degree {
  margin: 0 16px 14px;
  padding: 12px 14px 10px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid #2a2a32;
  border-radius: 6px;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.3);
}
.rc-degree-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  margin-bottom: 8px;
}
.rc-degree-head span {
  font: 600 0.62rem/1.4 "JetBrains Mono", ui-monospace, monospace;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #7a7a88;
}
.rc-degree-head b {
  font: 800 0.95rem/1 "JetBrains Mono", ui-monospace, monospace;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
  color: #e8e8f0;
  white-space: nowrap;
}
.rc-degree:has(.rc-band-low) .rc-degree-head b { color: #3fd0d0; }
.rc-degree:has(.rc-band-moderate) .rc-degree-head b { color: #f0b040; }
.rc-degree:has(.rc-band-high) .rc-degree-head b {
  color: #ff4444;
  text-shadow: 0 0 12px rgba(204, 0, 0, 0.4);
}
.rc-degree-track {
  position: relative;
  height: 16px;
  background: #0a0a0d;
  border: 1px solid #3a3a44;
  border-radius: 4px;
  overflow: hidden;
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.6);
}
/* tick scale etched over the fill — every 10 points */
.rc-degree-track::after {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(90deg,
    transparent 0,
    transparent calc(10% - 1px),
    rgba(10, 10, 13, 0.85) calc(10% - 1px),
    rgba(10, 10, 13, 0.85) 10%);
  pointer-events: none;
}
.rc-degree-fill {
  height: 100%;
  width: 0;
  transition: width 0.4s cubic-bezier(0.22, 1, 0.36, 1);
  background: linear-gradient(#00b4b4, #007878);
  box-shadow: 0 0 10px rgba(0, 160, 160, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.18);
}
.rc-degree-fill.rc-band-low {
  background: linear-gradient(#00b4b4, #007878);
  box-shadow: 0 0 10px rgba(0, 160, 160, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.18);
}
.rc-degree-fill.rc-band-moderate {
  background: linear-gradient(#e09a20, #a06000);
  box-shadow: 0 0 10px rgba(208, 138, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.18);
}
.rc-degree-fill.rc-band-high {
  background: linear-gradient(#e02222, #990e0e);
  box-shadow: 0 0 12px rgba(204, 0, 0, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.18);
}
.rc-degree-scale {
  display: flex;
  justify-content: space-between;
  margin-top: 5px;
  font: 500 0.6rem/1 "JetBrains Mono", ui-monospace, monospace;
  letter-spacing: 0.08em;
  color: #55556a;
}
.rc-degree-note {
  margin: 9px 0 0;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  font: 400 0.82rem/1.55 Inter, system-ui, sans-serif;
  color: #a8a8b4;
}

/* ── JSON readout — the receipt tape ── */
.rc-json {
  margin: 0 16px;
  padding: 10px 14px 16px;
  background: #0c0c0f;
  border: 1px solid #3a3a44;
  border-bottom: 0;
  border-radius: 4px 4px 0 0;
  font: 400 0.8rem/1.6 "JetBrains Mono", ui-monospace, monospace;
  color: #9fe0c0;
  white-space: pre;
  overflow-x: auto;
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.45);
}
.rc-json::before {
  content: "receipt.json";
  display: block;
  white-space: normal;
  padding-bottom: 8px;
  margin-bottom: 10px;
  border-bottom: 1px dashed #2a2a32;
  font: 600 0.6rem/1.4 "JetBrains Mono", ui-monospace, monospace;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #55556a;
}
.rc-json::selection { background: rgba(204, 0, 0, 0.35); color: #f0f0f6; }
/* serrated tear-off edge under the tape */
.rc-tape-edge {
  height: 8px;
  margin: 0 16px 2px;
  background: #0c0c0f;
  -webkit-mask: conic-gradient(from -45deg at 50% 100%, #000 90deg, transparent 0) 50% / 12px 100%;
  mask: conic-gradient(from -45deg at 50% 100%, #000 90deg, transparent 0) 50% / 12px 100%;
  filter: drop-shadow(0 1px 0 #3a3a44);
}

/* ── explainer notes ── */
.rc-note { margin-top: 2.2rem; }
.rc-note h3 {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin: 1.7rem 0 0.5rem;
  font: 800 1.02rem/1.3 Inter, system-ui, sans-serif;
  letter-spacing: -0.01em;
  color: #e8e8f0;
}
.rc-note h3::before {
  content: "";
  flex: none;
  width: 14px;
  height: 2px;
  background: #CC0000;
}
.rc-note p { color: #c8c8d0; line-height: 1.75; }
.rc-note a { color: #ff6a6a; }
.rc-note a:hover { color: #ff9a9a; }
.rc-note code {
  background: #16161a;
  border: 1px solid #3a3a44;
  border-radius: 3px;
  padding: 1px 5px;
  font: 0.85em "JetBrains Mono", monospace;
  color: #c8c8d0;
}

/* ── bookmarklet — a draggable pill ── */
.rc-bm {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border: 1px dashed #CC0000;
  border-radius: 5px;
  color: #ff6a6a;
  font-weight: 700;
  text-decoration: none;
  cursor: grab;
  background: rgba(204, 0, 0, 0.05);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
  transition: color 0.15s, background 0.15s, box-shadow 0.15s;
}
.rc-bm::before {
  content: "";
  flex: none;
  width: 8px;
  height: 13px;
  opacity: 0.7;
  background-image: radial-gradient(circle, currentColor 1.2px, transparent 1.4px);
  background-size: 5px 5px;
}
.rc-bm:hover {
  color: #ff9a9a;
  background: rgba(204, 0, 0, 0.12);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04), 0 0 12px rgba(204, 0, 0, 0.25);
}
.rc-bm:active { cursor: grabbing; }
.rc-bm:focus-visible { outline: 2px solid #CC0000; outline-offset: 3px; }

@media (prefers-reduced-motion: reduce) {
  .rc-degree-fill { transition: none; }
  .rc-form, .rc-out, .rc-btn, .rc-bm, .rc-field a,
  #rc-claim, .rc-field input, .rc-field select { transition: none; }
}
