:root, [data-theme="light"] {
  --bg: #f6f4ef; --surface: #ffffff; --surface-2: #f0ede6; --line: #ddd7cb; --text: #1d1f24; --muted: #5d6270;
  --accent: #1f5f8b; --accent-2: #c2410c; --accent-ink: #ffffff; --ok: #15803d; --ok-bg: #e7f6ec; --warn: #a16207; --warn-bg: #fdf5dc;
  --err: #b42318; --err-bg: #fdecea; --test: #0f766e; --test-bg: #dff3f0; --main: #b42318; --main-bg: #fde8e6;
  --shadow: 0 1px 2px rgb(0 0 0 / .06), 0 6px 20px rgb(0 0 0 / .06); --radius: 14px; --focus: 0 0 0 3px rgb(31 95 139 / .35);
  color-scheme: light;
}
[data-theme="dark"] {
  --bg: #12151b; --surface: #1a1e26; --surface-2: #222833; --line: #323a48; --text: #e8eaef; --muted: #a2a9b8;
  --accent: #6cb4e4; --accent-2: #fb923c; --accent-ink: #0d1117; --ok: #4ade80; --ok-bg: #12301f; --warn: #facc15; --warn-bg: #352c0c;
  --err: #f87171; --err-bg: #3a1717; --test: #5eead4; --test-bg: #0f2f2b; --main: #fca5a5; --main-bg: #3f1616;
  --shadow: 0 1px 2px rgb(0 0 0 / .4), 0 6px 20px rgb(0 0 0 / .3); --focus: 0 0 0 3px rgb(108 180 228 / .45);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; }
h1 { font-size: clamp(1.6rem, 3.5vw, 2.3rem); letter-spacing: -.01em; }
h2 { font-size: 1.35rem; } h3 { font-size: 1.08rem; }
p { margin: 0 0 .8em; }
a { color: var(--accent); }
code, .mono { font-family: ui-monospace, "Cascadia Code", Consolas, monospace; font-size: .88em; overflow-wrap: anywhere; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 16px; }
.skip { position: absolute; left: -999px; } .skip:focus { left: 8px; top: 8px; background: var(--surface); padding: 8px; z-index: 99; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: 6px; }

/* Fejléc */
.topbar { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.topbar-inner { display: flex; align-items: center; gap: 16px; min-height: 64px; flex-wrap: wrap; padding-top: 6px; padding-bottom: 6px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; }
.brand-mark { width: 34px; height: 34px; color: var(--accent); flex: none; }
.brand span { display: flex; flex-direction: column; line-height: 1.1; } .brand small { color: var(--muted); font-size: .78rem; }
.mainnav { display: flex; gap: 4px; flex-wrap: wrap; flex: 1; }
.mainnav a { color: var(--text); text-decoration: none; padding: 8px 12px; border-radius: 999px; font-weight: 500; font-size: .95rem; }
.mainnav a:hover { background: var(--surface-2); }
.mainnav a.active { background: var(--accent); color: var(--accent-ink); }
.topbar-tools { display: flex; gap: 8px; align-items: center; }
.netpick select { font: inherit; font-size: .88rem; padding: 7px 10px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--text); max-width: 210px; }
.iconbtn { width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--text); cursor: pointer; font-size: 1.05rem; }
.netbanner { font-size: .88rem; padding: 6px 16px; text-align: center; font-weight: 600; }
.netbanner.test { background: var(--test-bg); color: var(--test); }
.netbanner.main { background: var(--main-bg); color: var(--main); }

/* Gombok, mezők */
.btn { --b: var(--surface-2); display: inline-flex; align-items: center; justify-content: center; gap: 8px; font: inherit; font-weight: 600; font-size: .95rem; padding: 10px 16px; border-radius: 10px; border: 1px solid var(--line); background: var(--b); color: var(--text); cursor: pointer; text-decoration: none; min-height: 42px; }
.btn:hover { filter: brightness(.97); }
.btn-primary { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
.btn-danger { background: var(--err); color: #fff; border-color: transparent; }
.btn-wallet { background: var(--text); color: var(--bg); border-color: transparent; font-size: .88rem; }
.btn[disabled], .btn[aria-busy="true"] { opacity: .55; cursor: not-allowed; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-top: 12px; }
label.f { display: block; margin-bottom: 14px; }
label.f > span { display: block; font-weight: 600; margin-bottom: 4px; }
label.f > span small { font-weight: 400; color: var(--muted); }
input[type=text], input[type=url], input[type=number], textarea, select.in { width: 100%; font: inherit; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--text); }
textarea { min-height: 130px; resize: vertical; }
.f.invalid input, .f.invalid textarea, .f.invalid select { border-color: var(--err); }
.ferr { color: var(--err); font-size: .87rem; margin-top: 4px; }
.hint { color: var(--muted); font-size: .87rem; margin-top: 4px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.check { display: flex; gap: 10px; align-items: flex-start; } .check input { margin-top: 5px; width: 18px; height: 18px; }

/* Kártyák, panelek */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); margin-bottom: 18px; }
.muted { color: var(--muted); }
.notice { border-radius: 12px; padding: 12px 14px; margin: 10px 0; border: 1px solid transparent; }
.notice.ok { background: var(--ok-bg); color: var(--ok); } .notice.warn { background: var(--warn-bg); color: var(--warn); } .notice.err { background: var(--err-bg); color: var(--err); }
.notice.info { background: var(--surface-2); color: var(--text); border-color: var(--line); }
.notice p:last-child { margin: 0; }
.pill { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: .78rem; font-weight: 700; background: var(--surface-2); color: var(--muted); border: 1px solid var(--line); white-space: nowrap; }
.pill.test { background: var(--test-bg); color: var(--test); border-color: transparent; } .pill.main { background: var(--main-bg); color: var(--main); border-color: transparent; }
.pill.s-minted { background: var(--ok-bg); color: var(--ok); border-color: transparent; } .pill.s-verifying, .pill.s-awaiting_wallet { background: var(--warn-bg); color: var(--warn); border-color: transparent; }

/* Kezdőlap */
.hero { display: grid; grid-template-columns: 1.25fr .9fr; gap: 32px; align-items: center; padding: 34px 0 10px; }
.lead { font-size: 1.12rem; color: var(--muted); max-width: 60ch; }
.steps3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin: 26px 0; padding: 0; list-style: none; counter-reset: s; }
.steps3 li { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; counter-increment: s; position: relative; }
.steps3 li::before { content: counter(s); display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); font-weight: 800; margin-bottom: 10px; }
.steps3 h3 { margin-bottom: .3em; } .steps3 p { color: var(--muted); margin: 0; font-size: .95rem; }

/* NFT-kártya – a kép soha nem torzul (object-fit: contain, elmosott háttér) */
.nft { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); display: flex; flex-direction: column; position: relative; }
.nft-media { position: relative; aspect-ratio: 1 / 1; background: var(--surface-2); overflow: hidden; }
.nft-media .bg { position: absolute; inset: -20px; background-size: cover; background-position: center; filter: blur(18px) saturate(1.1); opacity: .55; }
.nft-media img { position: relative; width: 100%; height: 100%; object-fit: contain; display: block; }
.nft-body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.nft-body h3 { margin: 0; }
.nft-body .field { color: var(--accent-2); font-weight: 600; font-size: .9rem; }
.nft-body .txt { font-size: .93rem; color: var(--text); white-space: pre-line; }
.nft-meta { display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; font-size: .8rem; color: var(--muted); border-top: 1px dashed var(--line); padding-top: 8px; margin-top: auto; }
.nft-meta dt { font-weight: 600; } .nft-meta dd { margin: 0; overflow-wrap: anywhere; }
.nft.clickable { cursor: pointer; transition: transform .12s; } .nft.clickable:hover { transform: translateY(-2px); }
/* Mintakártya: egyértelműen nem kiadott NFT */
.nft.sample { border: 2px dashed var(--accent-2); }
.nft.sample .nft-media::after { content: ""; position: absolute; inset: 0; background: repeating-linear-gradient(-45deg, transparent 0 18px, rgb(194 65 12 / .10) 18px 36px); pointer-events: none; }
.sample-ribbon { position: absolute; z-index: 3; top: 58px; left: -40px; transform: rotate(-35deg); background: var(--accent-2); color: #fff; font-weight: 800; letter-spacing: .12em; padding: 4px 48px; font-size: .82rem; box-shadow: var(--shadow); }
.sample-note { background: var(--warn-bg); color: var(--warn); font-weight: 700; font-size: .82rem; text-align: center; padding: 6px; }

/* Szerkesztő */
.editor { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(280px, .9fr); gap: 22px; align-items: start; }
.stepper { display: flex; gap: 6px; flex-wrap: wrap; margin: 18px 0; padding: 0; list-style: none; }
.stepper button { font: inherit; font-size: .9rem; border: 1px solid var(--line); background: var(--surface); color: var(--text); padding: 8px 14px; border-radius: 999px; cursor: pointer; }
.stepper button[aria-current="step"] { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
.stepper button .n { font-weight: 800; margin-right: 6px; }
.sticky { position: sticky; top: 120px; }
.uploader { border: 2px dashed var(--line); border-radius: var(--radius); padding: 16px; text-align: center; background: var(--surface-2); }
.uploader .imgbox { max-width: 340px; margin: 10px auto; }
.counter { font-size: .85rem; color: var(--muted); text-align: right; }
.counter.bad { color: var(--err); }
.savestate { font-size: .85rem; color: var(--muted); }

/* Állapotsor */
.timeline { list-style: none; padding: 0; margin: 12px 0; display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.timeline li { text-align: center; font-size: .8rem; color: var(--muted); padding-top: 26px; position: relative; }
.timeline li::before { content: ""; position: absolute; top: 4px; left: 50%; transform: translateX(-50%); width: 16px; height: 16px; border-radius: 50%; background: var(--surface-2); border: 2px solid var(--line); }
.timeline li.done::before { background: var(--ok); border-color: var(--ok); }
.timeline li.current { color: var(--text); font-weight: 700; } .timeline li.current::before { background: var(--warn); border-color: var(--warn); }

table.kv { width: 100%; border-collapse: collapse; font-size: .93rem; }
table.kv th, table.kv td { text-align: left; padding: 7px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.kv th { width: 38%; color: var(--muted); font-weight: 600; }
table.kv td { overflow-wrap: anywhere; }
pre.json { background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 12px; overflow: auto; max-height: 360px; font-size: .8rem; white-space: pre-wrap; overflow-wrap: anywhere; }
.readiness { list-style: none; padding: 0; margin: 8px 0; }
.readiness li { padding: 5px 0 5px 28px; position: relative; font-size: .93rem; }
.readiness li::before { position: absolute; left: 0; top: 4px; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font-size: .75rem; font-weight: 800; }
.readiness li.ok::before { content: "✓"; background: var(--ok-bg); color: var(--ok); }
.readiness li.no::before { content: "!"; background: var(--warn-bg); color: var(--warn); }
.readiness li small { display: block; color: var(--muted); }

/* Galéria */
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 18px; }
.success { border: 2px solid var(--ok); }
.success h2 { color: var(--ok); }
.empty { text-align: center; padding: 40px 16px; color: var(--muted); }
.list-row { display: grid; grid-template-columns: 72px 1fr auto; gap: 14px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.list-row img { width: 72px; height: 72px; object-fit: contain; background: var(--surface-2); border-radius: 10px; }
.thumbph { width: 72px; height: 72px; border-radius: 10px; background: var(--surface-2); display: grid; place-items: center; color: var(--muted); font-size: .75rem; }

.toast { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%) translateY(140%); background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 10px; transition: transform .2s; max-width: min(92vw, 560px); z-index: 50; box-shadow: var(--shadow); }
.toast.show { transform: translateX(-50%) translateY(0); }
.toast.err { background: var(--err); color: #fff; }
dialog { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--text); max-width: min(760px, 94vw); width: 100%; padding: 0; box-shadow: var(--shadow); }
dialog::backdrop { background: rgb(0 0 0 / .45); }
#modal-body { padding: 20px; max-height: 86vh; overflow: auto; }
.footer { color: var(--muted); font-size: .85rem; padding-top: 24px; padding-bottom: 40px; border-top: 1px solid var(--line); margin-top: 40px; }
.code-big { font: 800 2.2rem/1 ui-monospace, Consolas, monospace; letter-spacing: .2em; background: var(--surface-2); border-radius: 12px; padding: 12px 18px; display: inline-block; }
.cols2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }

.cols2 .nft, .editor .uploader .nft { max-width: 420px; margin-inline: auto; }
@media (max-width: 1000px) {
  .mainnav { order: 3; width: 100%; flex: 1 0 100%; overflow-x: auto; flex-wrap: nowrap; }
  .mainnav a { white-space: nowrap; }
  .topbar-tools { margin-left: auto; }
}
@media (max-width: 900px) {
  .hero, .editor, .cols2 { grid-template-columns: 1fr; }
  .sticky { position: static; }
  .steps3 { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .grid2 { grid-template-columns: 1fr; }
  .mainnav { order: 3; width: 100%; overflow-x: auto; flex-wrap: nowrap; }
  .mainnav a { white-space: nowrap; }
  .topbar-tools { margin-left: auto; }
  .netpick select { max-width: 130px; }
  .timeline { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .timeline li { font-size: .68rem; }
  .list-row { grid-template-columns: 56px 1fr; } .list-row > :last-child { grid-column: 1 / -1; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
