@font-face {
  font-family: 'Geist';
  src: url('https://musechain.io/fonts/geist/geist-latin-wght-normal.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg-canvas: #0a0b0d;
  --bg-surface: #121418;
  --bg-surface-elevated: #1a1e24;
  --bg-card: #15181e;
  --border-subtle: #242933;
  --border-active: #3b4252;
  --text-main: #f3f5f8;
  --text-muted: #8b95a5;
  --text-dim: #5c6575;
  --accent-lime: #ccff00;
  --accent-lime-dim: rgba(204, 255, 0, 0.12);
  --accent-lime-hover: #b8e600;
  --status-success: #10b981;
  --status-success-bg: rgba(16, 185, 129, 0.12);
  --status-failed: #ef4444;
  --status-failed-bg: rgba(239, 68, 68, 0.14);
  --font-sans: 'Geist', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
}

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

body {
  background-color: var(--bg-canvas);
  color: var(--text-main);
  font-family: var(--font-sans);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.shell {
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 1.25rem 4rem;
}

/* Header */
.top-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 2.5rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.95rem;
}

.brand-link {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  text-decoration: none;
  color: var(--text-main);
  font-weight: 600;
}

.iris-pip {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--accent-lime);
  box-shadow: 0 0 10px var(--accent-lime);
}

.sep {
  color: var(--text-dim);
}

.office-badge a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.85rem;
}
.office-badge a:hover {
  color: var(--accent-lime);
}

.task-tag {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.nav-links {
  display: flex;
  gap: 1.25rem;
}

.nav-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.85rem;
  transition: color 0.15s;
}

.nav-links a:hover {
  color: var(--accent-lime);
}

/* Hero */
.hero-section {
  margin-bottom: 3rem;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 2.5rem;
  align-items: center;
}

.hero-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--accent-lime-dim);
  border: 1px solid rgba(204, 255, 0, 0.25);
  color: var(--accent-lime);
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 500;
  margin-bottom: 1rem;
}

.pulse-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-lime);
  animation: pulse 2s infinite ease-in-out;
}

@keyframes pulse {
  0% { transform: scale(0.95); opacity: 0.6; }
  50% { transform: scale(1.4); opacity: 1; }
  100% { transform: scale(0.95); opacity: 0.6; }
}

h1 {
  font-size: 2.5rem;
  letter-spacing: -0.03em;
  font-weight: 700;
  line-height: 1.15;
  margin-bottom: 1rem;
}

.lede {
  color: var(--text-muted);
  font-size: 1.05rem;
  line-height: 1.6;
  margin-bottom: 1.75rem;
}

.lede code {
  color: var(--accent-lime);
  background: rgba(204, 255, 0, 0.08);
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
  font-size: 0.9em;
}

.hero-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.55rem 1.1rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.15s ease;
  font-family: inherit;
  text-decoration: none;
}

.btn-primary {
  background: var(--accent-lime);
  color: #0b0d0e;
  font-weight: 600;
}
.btn-primary:hover {
  background: var(--accent-lime-hover);
}

.btn-outline {
  background: var(--bg-surface);
  color: var(--text-main);
  border-color: var(--border-subtle);
}
.btn-outline:hover {
  border-color: var(--border-active);
  background: var(--bg-surface-elevated);
}

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

.btn-lime {
  background: var(--accent-lime);
  color: #0b0d0e;
  font-weight: 600;
}

.btn-ghost {
  background: transparent;
  border-color: var(--border-subtle);
  color: var(--text-muted);
}
.btn-ghost:hover {
  color: var(--text-main);
  border-color: var(--text-muted);
}

.cover-card {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface);
}

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

.cover-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 0.85rem 1rem;
  background: linear-gradient(180deg, transparent 0%, rgba(10, 11, 13, 0.92) 80%);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.cover-overlay .tag {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent-lime);
  font-weight: 600;
}

.cover-overlay .caption {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Controls */
.controls-section {
  margin-bottom: 2rem;
}

.filter-bar {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  padding: 0.85rem 1.25rem;
  border-radius: var(--radius-md);
  flex-wrap: wrap;
}

.filter-group {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.select-field {
  background: var(--bg-canvas);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  padding: 0.4rem 0.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-family: inherit;
  outline: none;
}
.select-field:focus {
  border-color: var(--accent-lime);
}

.filter-meta {
  margin-left: auto;
  font-size: 0.8rem;
  color: var(--text-dim);
}

/* Receipts Grid */
.receipts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 1.5rem;
  margin-bottom: 3.5rem;
}

.receipt-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  position: relative;
  transition: border-color 0.2s, transform 0.2s;
}

.receipt-card:hover {
  border-color: var(--border-active);
  transform: translateY(-2px);
}

.receipt-card.status-failed-card {
  border-left: 3px solid var(--status-failed);
}

.receipt-card.status-success-card {
  border-left: 3px solid var(--status-success);
}

.card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1rem;
}

.app-meta {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.app-name {
  font-weight: 600;
  font-size: 1.05rem;
  color: var(--text-main);
}

.contract-addr {
  font-size: 0.75rem;
  font-family: var(--font-mono);
  color: var(--text-dim);
}

.badge-status {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.badge-status.success {
  background: var(--status-success-bg);
  color: var(--status-success);
}

.badge-status.failed {
  background: var(--status-failed-bg);
  color: var(--status-failed);
}

.card-field-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin-bottom: 1.25rem;
  flex-grow: 1;
}

.card-field {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 0.82rem;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.05);
  padding-bottom: 0.4rem;
}

.field-label {
  color: var(--text-dim);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.field-value {
  color: var(--text-main);
  text-align: right;
  max-width: 60%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.field-value.fn-code {
  font-family: var(--font-mono);
  color: var(--accent-lime);
  background: rgba(204, 255, 0, 0.08);
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  font-size: 0.8rem;
}

.field-value.caller-tag {
  font-family: var(--font-mono);
}

.calldata-omitted-notice {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-sm);
  padding: 0.45rem 0.65rem;
  font-size: 0.72rem;
  color: var(--text-dim);
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 1rem;
}

.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 0.85rem;
  border-top: 1px solid var(--border-subtle);
}

.link-explorer {
  color: var(--accent-lime);
  text-decoration: none;
  font-size: 0.8rem;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.link-explorer:hover {
  text-decoration: underline;
}

.btn-select-ticket {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  font-size: 0.75rem;
  padding: 0.3rem 0.6rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s;
}

.btn-select-ticket:hover {
  color: var(--text-main);
  border-color: var(--border-active);
  background: var(--bg-surface-elevated);
}

/* States */
.state-panel {
  text-align: center;
  padding: 4rem 2rem;
  background: var(--bg-surface);
  border: 1px dashed var(--border-subtle);
  border-radius: var(--radius-md);
  margin-bottom: 3.5rem;
}

.state-panel h3 {
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
}

.state-panel p {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 1.5rem;
}

.empty-icon {
  font-size: 2.5rem;
  color: var(--text-dim);
  margin-bottom: 1rem;
}

.spinner {
  width: 36px;
  height: 36px;
  border: 3px solid var(--border-subtle);
  border-top-color: var(--accent-lime);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 1.5rem;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.hidden {
  display: none !important;
}

/* Compact Ticket Preview */
.share-preview-section {
  margin-bottom: 3.5rem;
  border-top: 1px solid var(--border-subtle);
  padding-top: 2.5rem;
}

.section-header {
  margin-bottom: 1.5rem;
}

.section-header h2 {
  font-size: 1.5rem;
  letter-spacing: -0.02em;
  margin-bottom: 0.25rem;
}

.section-header p {
  color: var(--text-muted);
  font-size: 0.88rem;
}

.share-stage {
  display: flex;
  justify-content: center;
  padding: 1.5rem 0;
}

.compact-ticket {
  width: 100%;
  max-width: 460px;
  background: #0f1115;
  border: 1px solid #282e38;
  border-radius: 8px;
  position: relative;
  box-shadow: 0 16px 40px rgba(0,0,0,0.5);
  padding: 1.75rem 1.5rem 1.25rem;
}

.ticket-notch {
  width: 16px;
  height: 16px;
  background: var(--bg-canvas);
  position: absolute;
  border-radius: 50%;
}

.top-notch {
  top: -8px;
  left: calc(50% - 8px);
}

.bottom-notch {
  bottom: -8px;
  left: calc(50% - 8px);
}

.ticket-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.ticket-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  color: var(--text-main);
}

.lime-circle {
  width: 8px;
  height: 8px;
  background: var(--accent-lime);
  border-radius: 50%;
}

.ticket-badge {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.2rem 0.55rem;
  border-radius: 4px;
  letter-spacing: 0.05em;
}

.ticket-badge.success {
  background: var(--status-success-bg);
  color: var(--status-success);
}
.ticket-badge.failed {
  background: var(--status-failed-bg);
  color: var(--status-failed);
}

.ticket-barcode-line {
  height: 2px;
  background: repeating-linear-gradient(90deg, #323a46, #323a46 4px, transparent 4px, transparent 8px);
  margin-bottom: 1.25rem;
}

.ticket-body {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  margin-bottom: 1.5rem;
}

.ticket-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.82rem;
}

.ticket-row .k {
  color: var(--text-dim);
  font-size: 0.75rem;
}

.ticket-row .v {
  color: var(--text-main);
  font-weight: 500;
}

.mono {
  font-family: var(--font-mono);
}

.ticket-barcode-bottom {
  border-top: 1px dashed #242933;
  padding-top: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.fake-bars {
  height: 24px;
  background: repeating-linear-gradient(90deg, #4b5563, #4b5563 2px, transparent 2px, transparent 4px, #4b5563 4px, #4b5563 7px, transparent 7px, transparent 9px);
  opacity: 0.35;
}

.ticket-actions {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
}

/* Protocol Card */
.protocol-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  margin-bottom: 3rem;
}

.protocol-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.protocol-header h3 {
  font-size: 1rem;
  color: var(--text-main);
}

.protocol-card p {
  color: var(--text-muted);
  font-size: 0.85rem;
  line-height: 1.6;
}

/* Footer */
.page-footer {
  border-top: 1px solid var(--border-subtle);
  padding-top: 2rem;
  display: flex;
  justify-content: space-between;
  font-size: 0.82rem;
  color: var(--text-dim);
  flex-wrap: wrap;
  gap: 1rem;
}

.page-footer a {
  color: var(--text-muted);
  text-decoration: none;
}
.page-footer a:hover {
  color: var(--accent-lime);
}

/* Toast */
.toast {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background: var(--accent-lime);
  color: #0b0d0e;
  padding: 0.6rem 1.2rem;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 600;
  box-shadow: 0 8px 24px rgba(0,0,0,0.5);
  z-index: 1000;
  transition: opacity 0.2s, transform 0.2s;
}

@media (max-width: 800px) {
  .hero-grid {
    grid-template-columns: 1fr;
  }
  .cover-card {
    order: -1;
  }
  .receipts-grid {
    grid-template-columns: 1fr;
  }
}