@font-face {
  font-family: "Inter";
  src: url("./fonts/Inter-latin.woff2") format("woff2");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("./fonts/JetBrainsMono-latin.woff2") format("woff2");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #0f1419;
  --surface: #1a222c;
  --surface-2: #232d3a;
  --border: #2e3a4a;
  --ink: #e8eef4;
  --muted: #8b9aab;
  --accent: #3db8a8;
  --accent-dim: #2a8f83;
  --danger: #e07070;
  --ok: #6fbf8a;
  --warn: #d4a85a;
  --paper: #f2ebe0;
  --paper-ink: #1c2430;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --radius: 10px;
  --pad: 16px;
  --max: 720px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.55;
}
a { color: var(--accent); text-decoration: none; }
a:hover { color: #5ecfc0; text-decoration: underline; }
img, svg { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

.app-shell { min-height: 100vh; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 12px var(--pad);
  background: rgba(15, 20, 25, 0.92);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(8px);
}
.brand {
  display: inline-flex; align-items: center; gap: 10px;
  color: var(--ink); text-decoration: none; font-weight: 600;
}
.brand:hover { text-decoration: none; color: var(--ink); }
.brand-mark { width: 28px; height: 28px; color: var(--accent); flex-shrink: 0; }
.brand-text { font-size: 16px; letter-spacing: -0.02em; }
.topbar-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.demo-switch {
  display: flex; gap: 4px; flex-wrap: wrap;
  padding: 2px; background: var(--surface); border: 1px solid var(--border); border-radius: 8px;
}
.demo-switch button {
  border: 0; background: transparent; color: var(--muted);
  padding: 6px 8px; border-radius: 6px; cursor: pointer; font-size: 11px;
  min-height: 44px;
}
.demo-switch button[aria-pressed="true"] {
  background: var(--surface-2); color: var(--ink);
}

.demo-select {
  display: none;
  min-height: 44px;
  padding: 6px 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--ink);
  font-size: 12px;
  max-width: 140px;
}
.topbar-wallet { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
@media (max-width: 759px) {
  .topbar { flex-wrap: wrap; align-items: flex-start; }
  .demo-switch { display: none; }
  .demo-select { display: inline-block; }
  .topbar-actions { width: 100%; justify-content: space-between; }
  .btn-ghost { min-height: 36px; padding: 6px 10px; font-size: 13px; }
}
.nav-links {
  display: flex; gap: 4px; padding: 0 var(--pad) 12px;
  border-bottom: 1px solid var(--border); overflow-x: auto;
}
.nav-links a {
  color: var(--muted); padding: 10px 12px; border-radius: 8px;
  white-space: nowrap; min-height: 44px; display: inline-flex; align-items: center;
}
.nav-links a[aria-current="page"] {
  color: var(--ink); background: var(--surface); text-decoration: none;
}
.main {
  flex: 1; width: 100%; max-width: var(--max);
  margin: 0 auto; padding: 24px var(--pad) 48px;
}
.footer {
  border-top: 1px solid var(--border); padding: 20px var(--pad);
  color: var(--muted); font-size: 13px; text-align: center;
}

.icon { width: 20px; height: 20px; flex-shrink: 0; }
.icon-lg { width: 40px; height: 40px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 10px 16px; border-radius: 8px;
  border: 1px solid transparent; cursor: pointer;
  font-weight: 600; text-decoration: none; line-height: 1.2;
}
.btn:hover { text-decoration: none; }
.btn:disabled, .btn[aria-disabled="true"] {
  opacity: 0.45; cursor: not-allowed;
}
.btn-primary { background: var(--accent); color: #06201c; }
.btn-primary:hover:not(:disabled) { background: #4ecabb; color: #06201c; }
.btn-secondary {
  background: var(--surface-2); color: var(--ink); border-color: var(--border);
}
.btn-secondary:hover:not(:disabled) { border-color: var(--accent-dim); }
.btn-ghost {
  background: transparent; color: var(--muted); border-color: var(--border);
}
.btn-danger { background: transparent; color: var(--danger); border-color: var(--danger); }

.chip {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 28px; padding: 4px 10px; border-radius: 999px;
  background: var(--surface-2); border: 1px solid var(--border);
  font-size: 12px; font-family: var(--mono); color: var(--ink);
}
.chip-ok { border-color: var(--ok); color: var(--ok); }
.chip-warn { border-color: var(--warn); color: var(--warn); }
.chip-muted { color: var(--muted); }
.chip-open { border-color: var(--accent); color: var(--accent); }
.chip-resolved { border-color: var(--ok); color: var(--ok); }
.chip-cancelled { border-color: var(--muted); color: var(--muted); }

.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px;
}
.card + .card { margin-top: 12px; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.hero h1 {
  margin: 0 0 12px; font-size: 28px; line-height: 1.2;
  letter-spacing: -0.03em; font-weight: 650;
}
.lead { margin: 0; color: var(--muted); font-size: 16px; }
.section-title {
  margin: 0 0 8px; font-size: 13px; letter-spacing: 0.04em;
  text-transform: uppercase; color: var(--muted); font-weight: 600;
}
.muted { color: var(--muted); }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.hr { border: 0; border-top: 1px solid var(--border); margin: 8px 0; }

.form-grid { display: grid; gap: 14px; }
label.field { display: grid; gap: 6px; }
label.field > span { font-size: 13px; color: var(--muted); font-weight: 600; }
.field input, .field select, .field textarea {
  width: 100%; min-height: 44px; padding: 10px 12px;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 8px; color: var(--ink);
}
.field textarea { min-height: 96px; resize: vertical; }
.field input:disabled, .field select:disabled, .field textarea:disabled {
  opacity: 0.55;
}
.help { font-size: 12px; color: var(--muted); }

.banner {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 12px 14px; border-radius: 8px; border: 1px solid var(--border);
  background: var(--surface-2);
}
.banner-warn { border-color: rgba(212, 168, 90, 0.45); }
.banner-danger { border-color: rgba(224, 112, 112, 0.5); }
.banner-ok { border-color: rgba(111, 191, 138, 0.45); }
.banner .icon { color: var(--warn); margin-top: 2px; }
.banner-danger .icon { color: var(--danger); }
.banner-ok .icon { color: var(--ok); }

.empty {
  text-align: center; padding: 40px 16px; color: var(--muted);
}
.empty .icon-lg { margin: 0 auto 12px; color: var(--muted); }

.ticket-list { display: grid; gap: 10px; }
.ticket-item {
  display: grid; gap: 8px; padding: 14px; text-decoration: none;
  color: inherit; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius);
}
.ticket-item:hover { border-color: var(--accent-dim); text-decoration: none; }
.ticket-item h3 { margin: 0; font-size: 16px; }
.ticket-meta { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

.receipt {
  background: var(--paper); color: var(--paper-ink);
  border-radius: var(--radius); padding: 20px 18px;
  font-family: var(--mono); font-size: 13px; line-height: 1.6;
}
.receipt h2 {
  margin: 0 0 12px; font-family: var(--sans); font-size: 18px;
  letter-spacing: -0.02em;
}
.receipt dl { margin: 0; display: grid; gap: 8px; }
.receipt dt { color: #5a6675; font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em; }
.receipt dd { margin: 0; word-break: break-all; }
.receipt-stub {
  border-top: 1px dashed #c4b8a6; margin-top: 14px; padding-top: 12px;
  display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap;
}

.skeleton {
  background: linear-gradient(90deg, var(--surface-2), var(--border), var(--surface-2));
  background-size: 200% 100%;
  animation: shimmer 1.2s linear infinite;
  border-radius: 6px; height: 14px;
}
@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
[aria-busy="true"] .skeleton { display: block; }

.faq details {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 12px 14px;
}
.faq details + details { margin-top: 8px; }
.faq summary {
  cursor: pointer; font-weight: 600; min-height: 44px;
  list-style: none; display: flex; align-items: center;
}
.faq summary::-webkit-details-marker { display: none; }
.faq details[open] summary { margin-bottom: 8px; color: var(--accent); }
.faq p { margin: 0; color: var(--muted); }

@media (min-width: 760px) {
  :root { --pad: 24px; --max: 880px; }
  .hero h1 { font-size: 36px; }
  .topbar { padding-top: 14px; padding-bottom: 14px; }
  .main { padding-top: 36px; }
  
.demo-select {
  display: none;
  min-height: 44px;
  padding: 6px 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--ink);
  font-size: 12px;
  max-width: 140px;
}
.topbar-wallet { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
@media (max-width: 759px) {
  .topbar { flex-wrap: wrap; align-items: flex-start; }
  .demo-switch { display: none; }
  .demo-select { display: inline-block; }
  .topbar-actions { width: 100%; justify-content: space-between; }
  .btn-ghost { min-height: 36px; padding: 6px 10px; font-size: 13px; }
}
.nav-links { justify-content: flex-start; }
}
@media (min-width: 1280px) {
  :root { --max: 960px; }
}

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}
