:root {
  --bg: #fafaf7;
  --ink: #1a1a1a;
  --muted: #6b6b6b;
  --accent: #e8453c;
  --accent-dim: #f0a8a4;
  --green: #2d7a3a;
  --yellow: #c4920a;
  --card-bg: #fff;
  --border: #1a1a1a;
  --mono: 'SF Mono', 'Fira Code', 'Cascadia Code', 'Consolas', monospace;
  --serif: 'Georgia', 'Times New Roman', serif;
}

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

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

#app { max-width: 640px; margin: 0 auto; padding: 24px 20px 60px; }

/* Header */
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 40px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--ink);
}

.logo {
  font-family: var(--serif);
  font-style: italic;
  font-size: 22px;
  font-weight: bold;
  letter-spacing: -0.5px;
}

.logo .dot { color: var(--accent); }

.lang-switch {
  display: flex;
  gap: 2px;
  font-size: 12px;
  border: 1px solid var(--ink);
}

.lang-switch button {
  background: none;
  border: none;
  padding: 4px 10px;
  cursor: pointer;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--ink);
}

.lang-switch button.active {
  background: var(--ink);
  color: var(--bg);
}

/* Intro */
.intro {
  margin-bottom: 32px;
}

.intro h1 {
  font-family: var(--serif);
  font-size: 32px;
  font-weight: bold;
  line-height: 1.2;
  margin-bottom: 8px;
  letter-spacing: -1px;
}

.intro p {
  color: var(--muted);
  font-size: 14px;
}

/* Input */
.input-area {
  margin-bottom: 24px;
}

.input-area textarea {
  width: 100%;
  min-height: 120px;
  padding: 14px;
  border: 2px solid var(--ink);
  background: var(--card-bg);
  font-family: var(--mono);
  font-size: 14px;
  resize: vertical;
  outline: none;
  transition: border-color 0.15s;
}

.input-area textarea:focus {
  border-color: var(--accent);
}

.input-area textarea::placeholder {
  color: #aaa;
}

.sample-link {
  display: inline-block;
  margin-top: 8px;
  font-size: 12px;
  color: var(--muted);
  text-decoration: underline;
  cursor: pointer;
}

.sample-link:hover {
  color: var(--accent);
}

.btn-analyze {
  display: block;
  width: 100%;
  padding: 14px;
  background: var(--ink);
  color: var(--bg);
  border: none;
  font-family: var(--mono);
  font-size: 15px;
  font-weight: bold;
  cursor: pointer;
  margin-top: 12px;
  transition: background 0.15s;
}

.btn-analyze:hover { background: var(--accent); }
.btn-analyze:disabled { opacity: 0.5; cursor: not-allowed; }

.pricing-hint {
  margin-top: 16px;
  padding: 10px 14px;
  font-size: 12px;
  line-height: 1.5;
  color: var(--muted);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.pricing-hint strong { color: var(--ink); }

/* Result */
.result {
  display: none;
  margin-top: 32px;
}

.result.visible { display: block; }

.score-block {
  text-align: center;
  padding: 32px 20px;
  border: 2px solid var(--ink);
  background: var(--card-bg);
  margin-bottom: 20px;
}

.score-number {
  font-family: var(--serif);
  font-size: 72px;
  font-weight: bold;
  line-height: 1;
  letter-spacing: -3px;
}

.score-number.low { color: var(--green); }
.score-number.mid { color: var(--yellow); }
.score-number.high { color: var(--accent); }

.score-label {
  font-size: 13px;
  color: var(--muted);
  margin-top: 8px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.category-badge {
  display: inline-block;
  padding: 4px 12px;
  margin-top: 12px;
  font-size: 12px;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 1px;
  border: 1px solid var(--ink);
}

.worry-tax {
  text-align: center;
  padding: 20px;
  background: var(--ink);
  color: var(--bg);
  margin-bottom: 20px;
}

.worry-tax .amount {
  font-family: var(--serif);
  font-style: italic;
  font-size: 36px;
  font-weight: bold;
}

.worry-tax .label {
  font-size: 12px;
  opacity: 0.7;
  margin-top: 4px;
}

.verdict {
  font-family: var(--serif);
  font-style: italic;
  font-size: 20px;
  line-height: 1.4;
  padding: 20px;
  border-left: 4px solid var(--accent);
  background: var(--card-bg);
  margin-bottom: 20px;
}

.reality-check {
  padding: 16px 20px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  margin-bottom: 8px;
  font-size: 14px;
}

.reality-check .label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--muted);
  margin-bottom: 4px;
}

.prescription {
  padding: 16px 20px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  margin-bottom: 24px;
  font-size: 14px;
}

.prescription .label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--muted);
  margin-bottom: 4px;
}

/* Share section */
.share-section {
  margin-top: 28px;
  padding-top: 24px;
  border-top: 1px dashed var(--muted);
}

.share-section h3 {
  font-family: var(--serif);
  font-size: 18px;
  margin-bottom: 8px;
}

.share-section p {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 16px;
}

.btn-receipt {
  display: block;
  width: 100%;
  padding: 14px;
  background: var(--accent);
  color: #fff;
  border: none;
  font-family: var(--mono);
  font-size: 14px;
  font-weight: bold;
  cursor: pointer;
  transition: opacity 0.15s;
}

.btn-receipt:hover { opacity: 0.85; }

.btn-again {
  display: block;
  width: 100%;
  padding: 12px;
  background: none;
  color: var(--muted);
  border: 1px solid var(--muted);
  font-family: var(--mono);
  font-size: 13px;
  cursor: pointer;
  margin-top: 8px;
}

.btn-again:hover { color: var(--ink); border-color: var(--ink); }

/* Payment modal */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.5);
  z-index: 100;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-overlay.visible { display: flex; }

.modal {
  background: var(--bg);
  border: 2px solid var(--ink);
  max-width: 480px;
  width: 100%;
  padding: 28px;
  max-height: 90vh;
  overflow-y: auto;
}

.modal h2 {
  font-family: var(--serif);
  font-size: 22px;
  margin-bottom: 8px;
}

.modal .price {
  font-family: var(--serif);
  font-style: italic;
  font-size: 32px;
  color: var(--accent);
  margin: 16px 0;
}

.modal .step {
  margin-bottom: 16px;
}

.modal .step-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--muted);
  margin-bottom: 4px;
}

.wallet-address {
  font-family: var(--mono);
  font-size: 12px;
  padding: 10px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  word-break: break-all;
  position: relative;
}

.copy-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  background: var(--ink);
  color: var(--bg);
  border: none;
  padding: 4px 8px;
  font-size: 11px;
  cursor: pointer;
  font-family: var(--mono);
}

.modal input[type="text"] {
  width: 100%;
  padding: 10px;
  border: 1px solid var(--border);
  font-family: var(--mono);
  font-size: 12px;
  outline: none;
}

.modal input[type="text"]:focus {
  border-color: var(--accent);
}

.modal .btn-submit {
  display: block;
  width: 100%;
  padding: 14px;
  background: var(--ink);
  color: var(--bg);
  border: none;
  font-family: var(--mono);
  font-size: 14px;
  font-weight: bold;
  cursor: pointer;
  margin-top: 16px;
}

.modal .btn-submit:hover { background: var(--accent); }
.modal .btn-submit:disabled { opacity: 0.5; }

.modal .btn-close {
  display: block;
  width: 100%;
  padding: 10px;
  background: none;
  color: var(--muted);
  border: none;
  font-family: var(--mono);
  font-size: 13px;
  cursor: pointer;
  margin-top: 8px;
}

.modal .error-msg {
  color: var(--accent);
  font-size: 13px;
  margin-top: 8px;
}

/* Receipt */
.receipt {
  display: none;
  margin-top: 32px;
  border: 2px solid var(--ink);
  background: #fff;
  padding: 0;
}

.receipt.visible { display: block; }

.receipt-header {
  background: var(--ink);
  color: var(--bg);
  padding: 16px 20px;
  text-align: center;
}

.receipt-header .title {
  font-family: var(--serif);
  font-style: italic;
  font-size: 20px;
}

.receipt-header .id {
  font-size: 11px;
  opacity: 0.6;
  margin-top: 4px;
}

.receipt-body {
  padding: 24px 20px;
}

.receipt-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px dashed #ddd;
  font-size: 13px;
}

.receipt-row .key {
  color: var(--muted);
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 1px;
}

.receipt-row .val {
  text-align: right;
  max-width: 60%;
}

.receipt-thought {
  padding: 16px 0;
  border-bottom: 1px dashed #ddd;
}

.receipt-thought .label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--muted);
  margin-bottom: 6px;
}

.receipt-thought .text {
  font-family: var(--serif);
  font-style: italic;
  font-size: 16px;
  line-height: 1.5;
}

.receipt-score {
  text-align: center;
  padding: 20px 0;
  border-bottom: 1px dashed #ddd;
}

.receipt-score .number {
  font-family: var(--serif);
  font-size: 48px;
  font-weight: bold;
}

.receipt-footer {
  padding: 16px 0 8px;
  text-align: center;
}

.receipt-footer .verdict {
  font-family: var(--serif);
  font-style: italic;
  font-size: 16px;
  border: none;
  padding: 0;
  margin: 0 0 8px;
}

.receipt-footer .tx {
  font-size: 10px;
  color: var(--muted);
  word-break: break-all;
}

/* Loading */
.loading {
  display: none;
  text-align: center;
  padding: 40px;
}

.loading.visible { display: block; }

.loading .dots {
  font-family: var(--serif);
  font-style: italic;
  font-size: 24px;
  color: var(--muted);
}

.loading .dots::after {
  content: '...';
  animation: dots 1.4s infinite;
}

@keyframes dots {
  0%, 20% { content: ''; }
  40% { content: '.'; }
  60% { content: '..'; }
  80%, 100% { content: '...'; }
}

/* Footer */
.footer {
  margin-top: 60px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  font-size: 11px;
  color: var(--muted);
  text-align: center;
}

.footer a {
  color: var(--muted);
  text-decoration: underline;
}

/* Mobile */
@media (max-width: 480px) {
  .intro h1 { font-size: 26px; }
  .score-number { font-size: 56px; }
  .worry-tax .amount { font-size: 28px; }
  .verdict { font-size: 17px; }
}
