/* Cantarella Resolver — flat dark, purple-cyan accent, Linear/Vercel-like */
:root {
  --bg: #0a0a0c;
  --surface: #131316;
  --surface-2: #1a1a1f;
  --border: #26262c;
  --text: #f4f4f5;
  --muted: #9c9ca6;
  --purple: #8b7cff;
  --cyan: #22d3ee;
  --danger: #f87171;
  --ok: #34d399;
  --radius: 12px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, -apple-system, "Segoe UI", "Myanmar Text", "Noto Sans Myanmar", sans-serif;
  font-size: 16px;
  line-height: 1.55;
}
.wrap { max-width: 680px; margin: 0 auto; padding: 0 20px; }
.mono { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; word-break: break-all; }
.hidden { display: none !important; }
.muted { color: var(--muted); }

/* Top bar */
.topbar { border-bottom: 1px solid var(--border); background: rgba(10,10,12,.9); position: sticky; top: 0; z-index: 10; }
.topbar-in { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 56px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); }
.mark {
  font-family: ui-monospace, Menlo, monospace;
  font-size: 15px; font-weight: 700; color: #0a0a0c;
  background: linear-gradient(135deg, var(--purple), var(--cyan));
  border-radius: 8px; padding: 5px 8px; line-height: 1;
}
.brand-name { font-weight: 700; letter-spacing: -.02em; }
.accent { color: var(--purple); }
.balance {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; color: var(--muted);
  border: 1px solid var(--border); border-radius: 999px; padding: 6px 12px;
  background: var(--surface); white-space: nowrap;
}
.balance-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); flex: none; }
.balance-dot.ok { background: var(--ok); }
.balance-dot.bad { background: var(--danger); }

/* Hero */
.hero { padding: 44px 0 8px; }
.hero h1 { font-size: 30px; line-height: 1.2; letter-spacing: -.03em; margin: 0 0 10px; }
.grad { background: linear-gradient(90deg, var(--purple), var(--cyan)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.sub { color: var(--muted); margin: 0; font-size: 16px; }

/* Stepper */
.steps {
  list-style: none; display: flex; gap: 0; margin: 28px 0 20px; padding: 0;
  border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden;
  background: var(--surface);
}
.step { flex: 1; display: flex; align-items: center; justify-content: center; gap: 8px; padding: 11px 4px; font-size: 13.5px; color: var(--muted); border-left: 1px solid var(--border); }
.step:first-child { border-left: none; }
.step-n {
  width: 22px; height: 22px; border-radius: 50%; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--surface-2); border: 1px solid var(--border); font-size: 12px;
}
.step.active { color: var(--text); }
.step.active .step-n { background: var(--purple); border-color: var(--purple); color: #fff; }
.step.done .step-n { background: var(--ok); border-color: var(--ok); color: #06281c; }

/* Panels */
.panel {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 22px 20px; margin-bottom: 20px;
}
.panel h2 { font-size: 18px; margin: 0 0 16px; letter-spacing: -.02em; }
.panel-foot { display: flex; justify-content: flex-end; margin-top: 20px; }
.panel-foot.row { justify-content: space-between; }

/* Mode cards */
.modes { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.mode {
  text-align: left; background: var(--surface-2); color: var(--text);
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px; cursor: pointer; display: flex; flex-direction: column; gap: 4px;
  min-height: 44px; font-family: inherit;
}
.mode:hover { border-color: var(--purple); }
.mode.selected { border-color: var(--purple); box-shadow: 0 0 0 1px var(--purple); }
.mode-ico { font-size: 22px; color: var(--cyan); }
.mode-name { font-weight: 700; font-size: 16px; }
.mode-desc { font-size: 13px; color: var(--muted); line-height: 1.45; }
.mode-tag { font-size: 12px; color: var(--purple); margin-top: 6px; }

/* Fields */
.field { display: block; margin-bottom: 16px; }
.label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 6px; }
.req { color: var(--danger); }
input[type="url"], input[type="text"], textarea {
  width: 100%; background: var(--bg); color: var(--text);
  border: 1px solid var(--border); border-radius: 9px;
  padding: 12px 13px; font-size: 15px; font-family: inherit;
}
input:focus, textarea:focus { outline: none; border-color: var(--purple); box-shadow: 0 0 0 1px var(--purple); }
input::placeholder, textarea::placeholder { color: #5b5b64; }
.hint { display: block; font-size: 12.5px; color: var(--muted); margin-top: 5px; }
textarea { resize: vertical; font-family: ui-monospace, Menlo, monospace; font-size: 13.5px; word-break: break-all; }

.advanced { border: 1px solid var(--border); border-radius: 9px; padding: 12px 14px; margin-top: 4px; }
.advanced summary { cursor: pointer; font-size: 14px; font-weight: 600; color: var(--muted); }
.advanced .field { margin-top: 14px; }
.advanced .field:last-child { margin-bottom: 2px; }

/* Buttons */
.btn {
  appearance: none; border: 1px solid var(--border); border-radius: 9px;
  background: var(--surface-2); color: var(--text);
  font-family: inherit; font-size: 15px; font-weight: 600;
  padding: 12px 20px; min-height: 44px; cursor: pointer;
}
.btn:hover { border-color: var(--purple); }
.btn.primary { background: var(--purple); border-color: var(--purple); color: #fff; }
.btn.primary:hover { filter: brightness(1.1); }
.btn.solve {
  background: linear-gradient(135deg, var(--purple), var(--cyan));
  border: none; color: #fff; font-size: 16px; padding: 13px 26px;
}
.btn.solve:disabled { opacity: .55; cursor: wait; }
.btn.ghost { background: transparent; }
.linklike { background: none; border: none; color: var(--cyan); font: inherit; font-size: 14px; cursor: pointer; padding: 0; text-decoration: underline; }

/* Summary */
.summary { margin: 0 0 8px; }
.summary > div { display: flex; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--border); font-size: 14px; }
.summary > div:last-child { border-bottom: none; }
.summary dt { color: var(--muted); flex: none; width: 92px; }
.summary dd { margin: 0; overflow-wrap: anywhere; }

/* Progress / result / error */
.progress { display: flex; align-items: center; gap: 10px; margin-top: 18px; color: var(--muted); font-size: 14px; }
.spinner {
  width: 18px; height: 18px; border-radius: 50%; flex: none;
  border: 2px solid var(--border); border-top-color: var(--cyan);
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.result { margin-top: 18px; border-top: 1px solid var(--border); padding-top: 16px; }
.result-ok { color: var(--ok); font-weight: 700; margin: 0 0 12px; }
.result-meta { display: flex; gap: 20px; flex-wrap: wrap; font-size: 13.5px; color: var(--muted); margin: 4px 0 14px; }
.copied { color: var(--ok); font-size: 13.5px; margin-left: 10px; }
.err {
  background: rgba(248, 113, 113, .1); border: 1px solid rgba(248, 113, 113, .4);
  color: #fca5a5; border-radius: 9px; padding: 12px 14px; font-size: 14px; margin: 16px 0 0;
}

.foot { color: var(--muted); font-size: 13px; padding: 4px 0 40px; }
.foot p { margin: 0 0 8px; }

@media (max-width: 520px) {
  .hero { padding-top: 32px; }
  .hero h1 { font-size: 25px; }
  .modes { grid-template-columns: 1fr; }
  .step-t { display: none; }
  .panel { padding: 18px 16px; }
}
