:root {
  color-scheme: dark;
  --bg: #06080f;
  --ink: rgba(255, 255, 255, .92);
  --muted: rgba(255, 255, 255, .6);
  --faint: rgba(255, 255, 255, .42);
  --glass: rgba(255, 255, 255, .06);
  --stroke: rgba(255, 255, 255, .12);
  --hi: rgba(255, 255, 255, .22);
  --accent: #6e9bff;
  --accent-2: #a78bfa;
  --ok: #34d399;
  --err: #fda4af;
  --r: 22px;
  --font: "Inter", -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", system-ui, sans-serif;
  --mono: "SF Mono", ui-monospace, "Cascadia Code", Consolas, monospace;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  font: 15px/1.55 var(--font);
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

#aurora {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: linear-gradient(90deg, #1a1038, #102018);
}

#aurora::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(6, 8, 15, .48);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: radial-gradient(1px 1px at 20% 30%, rgba(255, 255, 255, .5), transparent),
    radial-gradient(1px 1px at 70% 18%, rgba(255, 255, 255, .35), transparent),
    radial-gradient(1px 1px at 85% 62%, rgba(255, 255, 255, .3), transparent),
    radial-gradient(1px 1px at 38% 78%, rgba(255, 255, 255, .28), transparent);
  opacity: .35;
}

.top, .wrap { position: relative; z-index: 2; }

.top {
  max-width: 980px;
  margin: 0 auto;
  padding: 22px 22px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.brand { font-weight: 700; letter-spacing: -.01em; display: flex; align-items: center; gap: 10px; }
.brand .dim { color: var(--muted); font-weight: 500; }
.mark {
  width: 26px; height: 26px; border-radius: 9px; display: inline-block;
  background: linear-gradient(135deg, #6e9bff, #a78bfa 60%, #34d399);
  box-shadow: 0 0 0 1px var(--hi) inset, 0 6px 18px rgba(110, 155, 255, .45);
}

.pill {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 12.5px; color: var(--muted);
  padding: 7px 13px; border-radius: 999px;
  background: var(--glass); border: 1px solid var(--stroke);
  backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  box-shadow: 0 1px 0 var(--hi) inset;
  white-space: nowrap;
}

.pulse { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 10px var(--ok); }

.wrap { max-width: 980px; margin: 0 auto; padding: 26px 22px 56px; }

.hero { text-align: center; padding: 22px 0 24px; }
.hero h1 {
  margin: 0;
  font-size: clamp(38px, 6vw, 62px);
  line-height: 1.02;
  letter-spacing: -.04em;
  font-weight: 750;
}
.hero h1 span {
  background: linear-gradient(100deg, #bcd0ff, #a78bfa 55%, #7ee8c7);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.note { color: var(--muted); max-width: 560px; margin: 14px auto 0; font-size: 15.5px; }

.steps {
  list-style: none; display: flex; gap: 8px; justify-content: center;
  padding: 0; margin: 20px 0 0; flex-wrap: wrap;
}
.steps li {
  display: inline-flex; align-items: center; gap: 9px;
  font-size: 13px; color: var(--muted);
  padding: 8px 14px 8px 8px; border-radius: 999px;
  background: var(--glass); border: 1px solid var(--stroke);
  backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
}
.steps b {
  width: 22px; height: 22px; border-radius: 50%;
  display: inline-grid; place-items: center;
  font-size: 12px; color: #06101f;
  background: linear-gradient(180deg, #fff, #bcd0ff);
}

.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 8px; }

.card {
  display: flex;
  flex-direction: column;
  background: var(--glass);
  border: 1px solid var(--stroke);
  border-radius: var(--r);
  padding: 20px;
  backdrop-filter: blur(24px) saturate(170%);
  -webkit-backdrop-filter: blur(24px) saturate(170%);
  box-shadow: 0 1px 0 var(--hi) inset, 0 24px 60px rgba(0, 0, 0, .45);
}
.grid > .card { height: 100%; }

.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; height: 28px; margin-bottom: 12px; }
.card-head h2 { font-size: 13px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); margin: 0; font-weight: 650; }
.tag {
  font-size: 11.5px; padding: 4px 10px; border-radius: 999px;
  color: #0a0f1e; background: linear-gradient(180deg, #fff, #bcd0ff); font-weight: 700;
}
.tag.soft { background: rgba(255, 255, 255, .1); color: var(--muted); border: 1px solid var(--stroke); font-weight: 600; }

.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

textarea {
  width: 100%; flex: 1 1 auto; min-height: 230px; resize: vertical;
  font: 12.5px/1.55 var(--mono); color: var(--ink);
  background: rgba(0, 0, 0, .32);
  border: 1px solid var(--stroke); border-radius: 14px;
  padding: 13px 14px; outline: none;
  box-shadow: 0 1px 0 var(--hi) inset;
}
textarea::placeholder { color: var(--faint); }
textarea:focus { border-color: rgba(110, 155, 255, .6); box-shadow: 0 0 0 3px rgba(110, 155, 255, .22); }

.drop {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1 1 auto;
  width: 100%;
  min-height: 230px;
  border: 1.5px dashed rgba(255, 255, 255, .22);
  border-radius: 14px;
  background: rgba(0, 0, 0, .25);
  padding: 26px 16px 40px;
  text-align: center;
  cursor: pointer;
  transition: border-color .2s, background .2s, transform .2s;
}
.drop p { margin: 8px 0 12px; color: var(--muted); font-size: 14px; pointer-events: none; }
.drop strong { color: var(--ink); font-weight: 650; }
.drop .link { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.drop-icon {
  width: 38px; height: 38px; margin: 0 auto; display: grid; place-items: center;
  border-radius: 12px; font-size: 18px; color: #0a0f1e;
  background: linear-gradient(180deg, #fff, #bcd0ff);
  pointer-events: none;
}
.drop:hover, .drop.over, .drop:focus-within { border-color: rgba(110, 155, 255, .7); background: rgba(110, 155, 255, .08); }
.drop input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  font-size: 0;
}

.file-name {
  position: absolute; left: 16px; right: 16px; bottom: 12px;
  min-height: 1.5em; margin: 0;
  font-size: 13px; color: var(--muted); overflow-wrap: anywhere;
  pointer-events: none;
  z-index: 1;
}
.file-name:not(:empty)::before { content: "▸ "; color: var(--ok); }

.row { margin-top: auto; padding-top: 14px; display: flex; gap: 10px; flex-wrap: wrap; }

.btn {
  --tr: 15%;
  appearance: none;
  position: relative;
  z-index: 0;
  width: 100%;
  max-width: 100%;
  height: 52px;
  min-height: 52px;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0 22px;
  white-space: nowrap;
  border-radius: 999px;
  border: 1px double rgba(255, 255, 255, .1);
  box-shadow:
    inset 2px -2px 1px -1px rgba(255, 255, 255, .32),
    inset -2px 2px 1px -1px rgba(255, 255, 255, .26),
    inset 6px -6px 1px -6px rgba(255, 255, 255, .18),
    inset -6px 6px 1px -6px rgba(255, 255, 255, .14),
    inset 0 0 2px rgba(0, 0, 0, .65),
    0 4px 8px rgba(0, 0, 0, .28);
  background: rgba(255, 255, 255, .04);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  cursor: pointer;
  filter: contrast(1.15) brightness(.98);
  user-select: none;
  font: 650 14.5px var(--font);
  color: var(--ink);
  transition: transform .22s, background .22s;
}
.btn-label {
  position: relative;
  z-index: 2;
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, .35));
}
.btn::before {
  content: "";
  position: absolute;
  z-index: 1;
  inset: 8px;
  border-radius: inherit;
  border: 1px solid rgba(255, 255, 255, .32);
  filter: blur(8px);
  pointer-events: none;
}
.btn::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  filter: blur(7px);
  pointer-events: none;
  background: linear-gradient(
    45deg,
    rgba(255, 255, 255, .42) 0%,
    transparent var(--tr),
    transparent calc(100% - var(--tr)),
    rgba(255, 255, 255, .26) 100%
  );
}
.circle-overlay {
  position: absolute;
  inset: 4px;
  border: 1px solid rgba(255, 255, 255, .18);
  border-radius: inherit;
  filter: blur(1px);
  pointer-events: none;
}
.btn.primary {
  background: linear-gradient(180deg, rgba(110, 155, 255, .16), rgba(167, 139, 250, .08));
  box-shadow:
    inset 2px -2px 1px -1px rgba(255, 255, 255, .48),
    inset -2px 2px 1px -1px rgba(190, 220, 255, .28),
    inset 6px -6px 1px -6px rgba(255, 255, 255, .22),
    inset -6px 6px 1px -6px rgba(167, 139, 250, .18),
    inset 0 0 2px rgba(0, 0, 0, .55),
    0 6px 18px rgba(110, 155, 255, .22);
}
.btn.ghost { background: rgba(255, 255, 255, .03); }
/* Secondary actions (Clear paste) sit beside the main button instead of owning the row. */
.btn.compact { width: auto; flex: 0 1 auto; padding: 0 18px; }
.btn:hover:not(:disabled) {
  background: rgba(255, 255, 255, .07);
  transform: translateY(-2px);
}
.btn.primary:hover:not(:disabled) {
  background: linear-gradient(180deg, rgba(110, 155, 255, .22), rgba(167, 139, 250, .12));
}
.btn:active:not(:disabled) { transform: scale(.98); }
.btn:disabled { opacity: .5; cursor: default; }
.btn:focus-visible, .drop:focus-visible, textarea:focus-visible, a:focus-visible {
  outline: 2px solid rgba(110, 155, 255, .8); outline-offset: 2px;
}

.status-card { margin-top: 16px; padding: 16px 20px; }
.status { margin: 0; color: var(--muted); font-size: 14px; }
#status.err { color: var(--err); }
a.download {
  display: inline-block; margin-top: 10px;
  color: #06101f; font-weight: 700; text-decoration: none;
  background: linear-gradient(180deg, #fff, #bcd0ff);
  padding: 10px 18px; border-radius: 999px;
}
#unmapped ul { margin: 12px 0 0; padding-left: 20px; color: var(--muted); font-size: 13.5px; }
#unmapped li { margin: 4px 0; }

/* "Saved in this browser…" line under the paste box. Kept in the layout even when
   empty so the buttons never jump when the note appears. */
.saved-note { min-height: 1.3em; margin: 10px 0 0; font-size: 12.5px; color: var(--muted); }
.saved-note:not(:empty)::before { content: "▸ "; color: var(--ok); }

.foot { text-align: center; color: var(--faint); font-size: 12.5px; margin-top: 22px; }

@media (max-width: 760px) {
  .grid { grid-template-columns: 1fr; }
  .top { flex-wrap: wrap; }
  .btn { width: 100%; }
  /* Full-width again on phones — easier to hit with a thumb. */
  .btn.compact { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
  .btn:hover:not(:disabled),
  .btn:active:not(:disabled) { transform: none; }
}
