:root {
  color-scheme: dark;
  --bg-0: #080808;
  --bg-1: #15140f;
  --panel: #24231f;
  --panel-2: #111110;
  --border: #706039;
  --text: #f3edda;
  --muted: #beb59f;
  --ok: #f4cf58;
  --ok-dark: #332b13;
  --btn: #f0cb55;
  --btn-2: #b48b28;
  --metal: linear-gradient(165deg, #30302b 0%, #1b1b18 22%, #24231f 44%, #111110 100%);
  --gold: linear-gradient(115deg, #aa8022 0%, #f6d96f 24%, #d7ad36 48%, #ffe79a 72%, #bb912c 100%);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Space Grotesk", sans-serif;
  color: var(--text);
  background: linear-gradient(145deg, var(--bg-0), var(--bg-1));
  overflow-x: hidden;
}

.bg-orb {
  position: fixed;
  width: 380px;
  height: 380px;
  filter: blur(70px);
  opacity: 0.35;
  pointer-events: none;
}

.orb-a {
  background: #d7ad36;
  top: -140px;
  left: -100px;
}

.orb-b {
  background: #8d702b;
  right: -120px;
  bottom: -140px;
}

.shell {
  width: min(1300px, 95vw);
  margin: 28px auto;
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 18px;
}

.left-rail,
.panel,
.card {
  border: 1px solid rgba(131, 199, 255, 0.45);
  border-radius: 14px;
  background: linear-gradient(165deg, rgba(9, 53, 105, 0.93), rgba(8, 44, 89, 0.96));
  box-shadow: inset 0 0 0 1px rgba(131, 199, 255, 0.1), 0 20px 45px rgba(0, 0, 0, 0.3);
}

.left-rail {
  padding: 16px;
  animation: reveal 450ms ease;
}

.rail-title {
  margin-top: 0;
  font-family: "Rajdhani", sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.rail-btn {
  width: 100%;
  border: 0;
  border-radius: 10px;
  padding: 10px;
  color: #031429;
  font-weight: 700;
  background: linear-gradient(90deg, #66ffd8, #1bd0ff);
  cursor: pointer;
}

.rail-info {
  margin-top: 18px;
  color: var(--muted);
  font-size: 14px;
}

.dot::before {
  content: "● ";
  color: var(--ok);
}

.panel {
  padding: 18px;
  animation: reveal 600ms ease;
}

.header h1 {
  margin: 0;
  font-family: "Rajdhani", sans-serif;
  font-size: clamp(1.8rem, 2.7vw, 2.4rem);
}

.header p {
  margin: 4px 0 12px;
  color: var(--muted);
}

.status-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: 10px;
  border: 1px solid rgba(165, 255, 147, 0.35);
  background: linear-gradient(90deg, rgba(66, 139, 87, 0.78), rgba(57, 116, 72, 0.55));
  margin-bottom: 14px;
}

.check {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 700;
  color: var(--ok);
  background: var(--ok-dark);
}

.status-banner strong {
  color: #b3ff53;
}

.status-banner p {
  margin: 2px 0 0;
  color: #e7ffe8;
}

.grid {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 14px;
}

.card {
  padding: 14px;
}

.card h3 {
  margin-top: 0;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text);
  font-family: "Rajdhani", sans-serif;
  font-size: 1.24rem;
}

.field-grid {
  display: grid;
  gap: 10px;
}

.two-col {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.span-2 {
  grid-column: 1 / -1;
}

label {
  display: grid;
  gap: 4px;
  font-size: 0.9rem;
  color: var(--text);
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px;
  color: var(--text);
  background: linear-gradient(180deg, var(--panel), var(--panel-2));
  outline: none;
}

#reportQr {
  max-width: 100%;
  height: auto;
}

.external-panel code {
  overflow-wrap: anywhere;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--ok);
  box-shadow: 0 0 0 2px rgba(244, 207, 88, 0.25);
}

button:focus-visible,
a:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--ok);
  outline-offset: 3px;
}

input::placeholder,
textarea::placeholder {
  color: var(--muted);
  opacity: 1;
}

select option {
  color: var(--text);
  background: var(--panel-2);
}

input::file-selector-button {
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 6px 9px;
  color: #171308;
  background: var(--gold);
  cursor: pointer;
}

a {
  color: var(--ok);
}

.upload-btn {
  margin-top: 12px;
  width: 100%;
  border: 0;
  border-radius: 10px;
  padding: 12px;
  font-weight: 700;
  font-size: 1rem;
  color: #171308;
  background: var(--gold);
  cursor: pointer;
}

.upload-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.progress-box {
  margin-top: 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px;
  display: flex;
  gap: 12px;
  align-items: center;
  background: var(--panel-2);
}

.spinner {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 5px solid rgba(244, 207, 88, 0.2);
  border-top-color: var(--ok);
  animation: spin 1s linear infinite;
}

.progress-box h4 {
  margin: 0;
  font-size: 1.4rem;
  font-family: "Rajdhani", sans-serif;
}

.progress-box p {
  margin: 2px 0 0;
  color: var(--muted);
}

.result-grid {
  margin-top: 14px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.result-title-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.big {
  width: 54px;
  height: 54px;
  font-size: 2rem;
}

.result-title-row h2 {
  margin: 0;
  color: #c4ff52;
}

.result-title-row p {
  margin: 2px 0 0;
  color: #ebf7ff;
}

.result-list {
  margin: 12px 0;
}

.result-list div {
  display: grid;
  grid-template-columns: 170px 1fr;
  padding: 8px 0;
  border-bottom: 1px solid rgba(120, 192, 255, 0.3);
  gap: 8px;
}

.result-list dt {
  color: #e7f6ff;
}

.result-list dd {
  margin: 0;
  color: var(--ok);
  word-break: break-all;
}

.host-response {
  border: 1px solid rgba(120, 192, 255, 0.3);
  border-radius: 10px;
  padding: 10px;
  background: var(--panel-2);
}

.host-response h4 {
  margin: 0 0 8px;
  text-transform: uppercase;
  color: var(--ok);
}

.host-response p {
  margin: 5px 0;
}

.host-response strong {
  color: #9efa4f;
}

.json {
  margin: 0;
  padding: 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg-0);
  color: var(--ok);
  min-height: 270px;
  overflow: auto;
}

.hidden {
  display: none;
}

.pending-card {
  margin-bottom: 14px;
}

.tron-wallet-card {
  margin-bottom: 14px;
}

.tron-node-card {
  margin-bottom: 14px;
}

.node-state {
  display: inline-block;
  padding: 8px 12px;
  border: 1px solid var(--muted);
  border-radius: 8px;
  font-weight: 700;
}

.node-state[data-state="running"] {
  color: var(--ok);
  border-color: var(--ok);
}

.tron-node-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
}

.tron-node-metrics dt {
  color: var(--muted);
}

.tron-node-metrics dd {
  margin: 6px 0 0;
  overflow-wrap: anywhere;
}

.tron-wallet-card .card-heading {
  margin-bottom: 8px;
}

.tron-wallet-card .card-heading h3 {
  margin-bottom: 0;
}

.wallet-download {
  color: #c4f064;
  font-size: 0.9rem;
  font-weight: 700;
}

.wallet-description,
.wallet-status {
  color: var(--muted);
}

.wallet-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.wallet-controls .primary-btn,
.wallet-controls .secondary-btn {
  width: auto;
  margin-top: 0;
}

.wallet-controls button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.wallet-address {
  display: block;
  margin-top: 8px;
  overflow-wrap: anywhere;
  color: #c4f064;
}

.wallet-address.hidden {
  display: none;
}

.wallet-token-contract {
  overflow-wrap: anywhere;
}

.pending-card .card-heading h3 {
  margin-bottom: 0;
}

.pending-requests {
  display: grid;
  gap: 8px;
}

.pending-request {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-top: 1px solid rgba(166, 183, 170, 0.17);
}

.pending-request strong,
.pending-request span {
  display: block;
}

.pending-request strong {
  color: #eff7df;
}

.pending-request span {
  margin-top: 3px;
  color: #87958b;
  font-size: 0.75rem;
}

.external-shell {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 24px;
}

.external-panel {
  width: min(620px, 100%);
  padding: 30px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--metal);
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.24);
}

.external-panel h1 {
  margin: 0;
  color: #f4f6ef;
  font-family: "Rajdhani", sans-serif;
  font-size: clamp(2.1rem, 5vw, 3.4rem);
  line-height: 0.95;
}

.external-intro {
  margin: 14px 0 24px;
  color: var(--muted);
  line-height: 1.5;
}

.external-panel .primary-btn {
  margin-top: 8px;
}

.external-status {
  min-height: 1.4em;
  margin: 16px 0 0;
  color: #c4f064;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes reveal {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 1100px) {
  .shell {
    grid-template-columns: 1fr;
  }

  .left-rail {
    order: 2;
  }

  .grid,
  .result-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 700px) {
  .two-col {
    grid-template-columns: 1fr;
  }

  .result-list div {
    grid-template-columns: 1fr;
  }
}

/* Receiving console */
body {
  background: radial-gradient(ellipse at 75% 0%, rgba(166, 127, 33, 0.12), transparent 50%),
    repeating-linear-gradient(115deg, rgba(255, 232, 161, 0.012) 0, rgba(255, 232, 161, 0.012) 1px, transparent 1px, transparent 5px),
    linear-gradient(135deg, var(--bg-0), var(--bg-1));
}

.left-rail,
.panel,
.card {
  border-color: var(--border);
  border-radius: 8px;
  background: var(--metal);
  box-shadow: inset 0 1px 0 rgba(255, 232, 161, 0.1), 0 20px 45px rgba(0, 0, 0, 0.4);
}

.left-rail {
  padding: 22px 18px;
}

.eyebrow,
.section-kicker {
  margin: 0 0 6px;
  color: #c4f064;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.rail-title {
  margin-bottom: 28px;
  color: #f3f6e9;
  font-size: 2rem;
  line-height: 0.95;
  letter-spacing: 0;
  text-transform: none;
}

.rail-btn,
.primary-btn,
.secondary-btn,
.close-btn {
  border: 0;
  border-radius: 5px;
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  transition: transform 160ms ease, opacity 160ms ease, background 160ms ease;
}

.rail-btn:hover,
.primary-btn:hover,
.secondary-btn:hover,
.close-btn:hover {
  transform: translateY(-1px);
}

.rail-btn {
  color: #171308;
  background: var(--gold);
}

.rail-info {
  margin-top: 32px;
  line-height: 1.7;
}

.receiving-screen {
  padding-bottom: 22px;
  animation: reveal 500ms ease;
}

.receiving-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 10px 2px 20px;
}

.receiving-header h1 {
  margin: 0;
  color: #f4f6ef;
  font-family: "Rajdhani", sans-serif;
  font-size: clamp(2.1rem, 4vw, 3.5rem);
  letter-spacing: 0.01em;
  line-height: 0.95;
}

.receiving-header > div:first-child > p:last-child {
  max-width: 560px;
  margin: 12px 0 0;
  color: var(--muted);
}

.session-badge,
.verified-label,
.lock-mark,
.file-count {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
}

.session-badge {
  border: 1px solid #53645c;
  border-radius: 99px;
  padding: 8px 11px;
  color: #b9c5bc;
  font-size: 0.76rem;
}

.session-badge span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ok);
}

.session-badge.connected span {
  background: var(--ok);
  box-shadow: 0 0 0 4px rgba(244, 207, 88, 0.12);
}

.steps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 14px;
  border-bottom: 1px solid rgba(166, 183, 170, 0.2);
}

.step {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 0 6px 11px;
  border-bottom: 2px solid transparent;
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
}

.step span {
  color: inherit;
  font-family: "Rajdhani", sans-serif;
  font-size: 1.15rem;
}

.step.active {
  border-color: var(--ok);
  color: #eff7df;
}

.step.done {
  color: #c4f064;
}

.receiving-grid {
  display: grid;
  grid-template-columns: 0.88fr 1.12fr;
  gap: 14px;
}

.authorization-alert {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 14px;
  padding: 11px 13px;
  border: 1px solid rgba(244, 162, 97, 0.45);
  border-left: 3px solid #f4a261;
  background: rgba(244, 162, 97, 0.08);
}

.authorization-alert > span {
  display: grid;
  width: 21px;
  height: 21px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 50%;
  color: #21140d;
  background: #f4a261;
  font-weight: 700;
}

.authorization-alert strong,
.authorization-alert p {
  display: block;
}

.authorization-alert strong {
  color: #ffd1aa;
  font-size: 0.82rem;
}

.authorization-alert p {
  margin: 3px 0 0;
  color: #b9aaa0;
  font-size: 0.75rem;
}

.connection-card,
.intake-card {
  min-height: 290px;
}

.card-heading,
.report-top,
.intake-actions,
.report-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.card-heading h3,
.report-top h3 {
  margin-bottom: 16px;
  color: #f0f4e9;
  text-transform: none;
}

.lock-mark,
.file-count {
  color: #c4f064;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.receiving-screen input:not([type="checkbox"]) {
  border-color: var(--border);
  background: var(--panel-2);
}

.consent-row {
  display: flex;
  grid-template-columns: none;
  align-items: flex-start;
  gap: 9px;
  margin-top: 16px;
  color: #aab8ad;
  font-size: 0.78rem;
  line-height: 1.35;
}

.consent-row input {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  accent-color: var(--ok);
}

.primary-btn,
.secondary-btn,
.close-btn {
  padding: 11px 13px;
}

.primary-btn {
  width: 100%;
  margin-top: 17px;
  color: #171308;
  background: var(--gold);
}

.primary-btn span {
  float: right;
  font-size: 1.2rem;
  line-height: 0.8;
}

.received-files {
  min-height: 166px;
  padding: 4px 0;
}

.load-meter {
  margin-top: 13px;
}

.load-meter > div:first-child {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: #9eaca1;
  font-size: 0.7rem;
  text-transform: uppercase;
}

.load-meter strong {
  color: #c4f064;
}

.meter-track {
  height: 7px;
  margin-top: 7px;
  overflow: hidden;
  border-radius: 99px;
  background: var(--bg-0);
}

.meter-track i {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--gold);
  transition: width 300ms ease;
}

.empty-state {
  display: grid;
  min-height: 150px;
  place-items: center;
  border: 1px dashed #53645c;
  color: var(--muted);
  font-size: 0.86rem;
}

.file-row {
  display: grid;
  grid-template-columns: 42px 1fr 20px;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(166, 183, 170, 0.17);
}

.file-icon {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border: 1px solid #53645c;
  border-radius: 5px;
  color: #f4a261;
  font-size: 0.62rem;
  font-weight: 700;
}

.file-row strong,
.file-row span {
  display: block;
}

.file-row span {
  margin-top: 3px;
  color: #87958b;
  font-size: 0.72rem;
}

.file-row b {
  color: #c4f064;
}

.intake-actions {
  align-items: stretch;
  margin-top: 14px;
}

.secondary-btn {
  color: var(--text);
  background: var(--metal);
  border: 1px solid var(--border);
}

.close-btn {
  color: #171308;
  background: var(--gold);
}

.primary-btn:disabled,
.secondary-btn:disabled,
.close-btn:disabled {
  cursor: not-allowed;
  opacity: 1;
  color: var(--muted);
  background: #25231c;
  transform: none;
}

.inline-error {
  min-height: 18px;
  margin: 8px 0 0;
  color: #f4a261;
  font-size: 0.76rem;
}

.receive-links {
  margin-top: 10px;
  padding: 11px;
  border-left: 2px solid var(--ok);
  background: rgba(244, 207, 88, 0.06);
}

.receive-links > div {
  display: grid;
  grid-template-columns: 112px 1fr;
  gap: 8px;
  align-items: center;
  margin: 6px 0;
}

.receive-links span,
.receive-links small {
  color: #9eaca1;
  font-size: 0.7rem;
}

.receive-links code {
  overflow-wrap: anywhere;
  color: #eff7df;
  font-size: 0.7rem;
}

.receive-links small {
  display: block;
  margin-top: 9px;
}

.report-card {
  margin-top: 14px;
  border-color: rgba(196, 240, 100, 0.5);
}

.verified-label {
  color: #c4f064;
  font-size: 0.68rem;
  font-weight: 700;
}

.report-summary {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  align-items: start;
  padding: 13px 0;
  border-top: 1px solid rgba(166, 183, 170, 0.2);
  border-bottom: 1px solid rgba(166, 183, 170, 0.2);
}

.report-summary span,
.report-summary strong {
  display: block;
}

.report-summary span {
  margin-bottom: 5px;
  color: #87958b;
  font-size: 0.72rem;
  text-transform: uppercase;
}

.report-summary strong {
  color: #eff7df;
  font-size: 0.78rem;
  overflow-wrap: anywhere;
}

.report-card .json {
  min-height: 120px;
  margin-top: 12px;
  border-color: #53645c;
  background: #111817;
  color: #c4f064;
  font-size: 0.72rem;
}

.legacy-flow {
  opacity: 0.7;
}

.status-banner {
  border-color: var(--border);
  background: linear-gradient(110deg, #302813, #171611);
}

.status-banner strong,
.host-response strong,
.result-title-row h2,
.eyebrow,
.section-kicker,
.wallet-download,
.wallet-address,
.lock-mark,
.file-count,
.verified-label,
.load-meter strong,
.step.done,
.external-status {
  color: var(--ok);
}

.file-row b,
.file-icon,
.result-list dd {
  color: var(--ok);
}

.card h3,
.card-heading h3,
.report-top h3,
.rail-title,
.external-panel h1,
.receiving-header h1,
.result-list dt,
.result-title-row p,
.status-banner p,
.report-summary strong,
.receive-links code,
.step.active {
  color: var(--text);
}

.consent-row,
.load-meter > div:first-child,
.receive-links span,
.receive-links small,
.session-badge {
  color: var(--muted);
}

.result-list div,
.host-response,
.steps,
.file-row,
.report-summary {
  border-color: var(--border);
}

.rail-btn,
.primary-btn,
.upload-btn,
.close-btn {
  box-shadow: inset 0 1px 0 rgba(255, 244, 194, 0.55), 0 3px 8px rgba(0, 0, 0, 0.3);
}

.rail-btn:disabled,
.primary-btn:disabled,
.secondary-btn:disabled,
.upload-btn:disabled,
.close-btn:disabled {
  color: var(--muted);
  background: #25231c;
  box-shadow: none;
  opacity: 1;
  cursor: not-allowed;
}

.report-card .json {
  border-color: var(--border);
  background: var(--bg-0);
  color: var(--ok);
}

.empty-state,
.session-badge,
.file-icon,
.report-card {
  border-color: var(--border);
}

.file-row span,
.pending-request span,
.report-summary span {
  color: var(--muted);
}

@media (max-width: 700px) {
  .receiving-header,
  .intake-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .receiving-header {
    gap: 14px;
  }

  .session-badge {
    align-self: flex-start;
  }

  .steps {
    gap: 2px;
  }

  .step {
    gap: 4px;
    font-size: 0.62rem;
  }

  .receiving-grid,
  .report-summary {
    grid-template-columns: 1fr;
  }

  .report-summary {
    gap: 10px;
  }
}
