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

:root {
  --font-mono: "Courier New", monospace;
  --mono-color: #7aa2d4;
}

body {
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  background: #111;
  color: #d8d8d8;
  min-height: 100vh;
  font-size: 14px;
  line-height: 1.5;
}

/* Site title */

.site-title {
  width: 100%;
  text-align: center;
  padding: 1.5rem 2rem 0.5rem;
}

.site-title span:first-child {
  display: block;
  font-size: 1.1rem;
  font-weight: 600;
  color: #f0f0f0;
  letter-spacing: 0.01em;
}

.site-subtitle {
  display: block;
  color: #666;
  font-size: 0.8rem;
  margin-top: 0.2rem;
}

/* Layout */

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
}

.grid2 {
  display: grid;
  grid-template-columns: minmax(0, 600px);
  justify-content: center;
  gap: 1.5rem;
}

.grid2.has-results {
  grid-template-columns: minmax(0, 600px) minmax(0, 600px);
}

@media (max-width: 800px) {
  .grid2 {
    grid-template-columns: 1fr;
  }
}

/* Card */

.card {
  background: #181818;
  border: 1px solid #272727;
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.25rem;
}

.card h2 {
  font-size: 0.78rem;
  font-weight: 600;
  color: #aaa;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 1rem;
}

/* Fixture buttons */

.fixture-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.9rem;
}

.fixture-btn {
  background: transparent;
  color: #888;
  border: 1px solid #2e2e2e;
  padding: 0.3rem 0.65rem;
  font-size: 0.75rem;
  cursor: pointer;
  transition: color 0.1s, border-color 0.1s;
}

.fixture-btn:hover {
  background: transparent;
  color: #d8d8d8;
  border-color: #555;
}

/* Textarea */

textarea {
  width: 100%;
  height: 260px;
  background: #111;
  color: #ccc;
  border: 1px solid #2e2e2e;
  padding: 0.85rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  resize: vertical;
}

textarea:focus {
  outline: none;
  border-color: #555;
}

/* Buttons */

button {
  background: #f0f0f0;
  color: #111;
  border: none;
  padding: 0.55rem 1.2rem;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}

button:hover {
  background: #d8d8d8;
}

button:disabled {
  background: #2e2e2e;
  color: #555;
  cursor: not-allowed;
}

.btn-secondary {
  background: transparent;
  color: #888;
  border: 1px solid #2e2e2e;
}

.btn-secondary:hover {
  background: transparent;
  color: #d8d8d8;
  border-color: #555;
}

.btn-sm {
  padding: 0.35rem 0.75rem;
  font-size: 0.78rem;
}

.btn-row {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  margin-top: 0.9rem;
  flex-wrap: wrap;
}

.status-msg {
  color: #666;
  font-size: 0.78rem;
}

/* Explain list */

.explain-list {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 0.5rem 1.25rem;
  font-size: 0.82rem;
}

.explain-list dt {
  color: #d8d8d8;
  font-weight: 600;
  padding-top: 0.05rem;
}

.explain-list dd {
  color: #666;
  line-height: 1.5;
}

/* Stat grid */

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1px;
  background: #222;
  border: 1px solid #222;
  margin-bottom: 1rem;
}

.stat {
  background: #181818;
  padding: 0.85rem 1rem;
}

.stat-label {
  color: #555;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin-bottom: 0.3rem;
}

.stat-value {
  color: #f0f0f0;
  font-size: 1.05rem;
  font-weight: 600;
}

.stat-sub {
  color: #555;
  font-size: 0.72rem;
  margin-top: 0.2rem;
}

/* Table */

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
}

th {
  text-align: left;
  color: #555;
  font-weight: 600;
  padding: 0.45rem 0.6rem;
  border-bottom: 1px solid #222;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

td {
  padding: 0.45rem 0.6rem;
  border-bottom: 1px solid #1e1e1e;
  color: #aaa;
  vertical-align: top;
}

tr:hover td {
  background: #1e1e1e;
}

/* Badges */

.badge {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  font-size: 0.7rem;
  font-weight: 600;
  border: 1px solid transparent;
}

.badge-change,
.badge-ok      { background: #0d2018; color: #4ade80; border-color: #1a4030; }
.badge-payment { background: #0d1a2e; color: #60a5fa; border-color: #1a3050; }
.badge-rbf     { background: #2a0e00; color: #fb923c; border-color: #4a1800; }
.badge-warn    { background: #2a1a00; color: #fbbf24; border-color: #4a3000; }

/* Warnings */

.warn-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.5rem;
}

.warn-text {
  font-size: 0.78rem;
  color: #fbbf24;
  margin-top: 0.3rem;
}

.rbf-text {
  font-size: 0.78rem;
  color: #fb923c;
  margin-top: 0.3rem;
}

/* Section label */

.section-title {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: #4a4a4a;
  margin-bottom: 0.6rem;
  font-weight: 600;
}

/* Mono */

.mono {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--mono-color);
  word-break: break-all;
}

/* PSBT box */

.psbt-box {
  background: #111;
  border: 1px solid #222;
  padding: 0.85rem;
  word-break: break-all;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--mono-color);
  max-height: 110px;
  overflow-y: auto;
}

/* Error box */

.error-box {
  background: #1e0000;
  border: 1px solid #500;
  padding: 0.85rem;
  color: #f87171;
  font-size: 0.82rem;
}

/* Results */

#results {
  display: none;
}

/* PSBT copy button */

.psbt-copy-btn {
  margin-top: 0.75rem;
}
