/* NexusArcade — shared styles */
:root {
  --bg: #0E0F12;
  --bg-2: #121318;
  --surface: #17191F;
  --surface-2: #1E2128;
  --line: #2A2D36;
  --line-2: #22252D;
  --text: #F2F3F5;
  --text-2: #C9CCD4;
  --muted: #A9ADB8;
  --faint: #8A8F9C;
  --accent: #C6F432;
  --accent-ink: #0E0F12;
  --accent-soft: #3A3F2A;
  --danger: #FF7A6B;
  --ok: #7BE495;
  --radius: 16px;
  --radius-sm: 10px;
  --wrap: 1160px;
  --font-display: 'Space Grotesk', ui-sans-serif, system-ui, sans-serif;
  --font-body: 'Plus Jakarta Sans', ui-sans-serif, system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
}
img, svg { display: block; max-width: 100%; }
a { color: var(--accent); }
a:hover { color: #E2FF8A; }
h1, h2, h3, h4 { font-family: var(--font-display); letter-spacing: -0.03em; line-height: 1.1; margin: 0; }
p { margin: 0; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 24px; }
[hidden] { display: none !important; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 16px; background: var(--accent); color: var(--accent-ink); padding: 8px 12px; z-index: 100; }

/* Header */
.site-header { position: sticky; top: 0; z-index: 50; background: rgba(14, 15, 18, 0.92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line-2); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-top: 14px; padding-bottom: 14px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); }
.brand:hover { color: var(--text); }
.brand-mark { width: 34px; height: 34px; border-radius: 8px; background: var(--accent); display: grid; grid-template-columns: 1fr 1fr; gap: 3px; padding: 7px; flex: none; }
.brand-mark span { background: var(--accent-ink); border-radius: 2px; }
.brand-mark span:last-child { opacity: 0.35; }
.brand-name { font-family: var(--font-display); font-weight: 700; font-size: 21px; letter-spacing: -0.02em; }
.nav { display: flex; align-items: center; gap: 26px; font-size: 15px; }
.nav a { color: var(--text-2); text-decoration: none; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--text); }
.nav-toggle { display: none; background: none; border: 1px solid var(--line); color: var(--text); border-radius: 8px; width: 44px; height: 44px; cursor: pointer; align-items: center; justify-content: center; }
@media (max-width: 820px) {
  .nav-toggle { display: inline-flex; }
  .nav { display: none; position: absolute; top: 100%; left: 0; right: 0; flex-direction: column; align-items: stretch; gap: 0; background: var(--bg); border-bottom: 1px solid var(--line); padding: 8px 24px 20px; }
  .nav.open { display: flex; }
  .nav a { padding: 12px 0; border-bottom: 1px solid var(--line-2); }
  .nav .btn { margin-top: 12px; border-bottom: none; text-align: center; }
}

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 10px 18px; border-radius: var(--radius-sm); font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; border: 1px solid transparent; transition: transform .08s ease, background .15s ease; white-space: nowrap; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: #D6FF5C; color: var(--accent-ink); }
.btn-ghost { background: transparent; color: var(--text); border-color: #343843; }
.btn-ghost:hover { background: var(--surface); color: var(--text); }
.btn-danger { background: transparent; color: var(--danger); border-color: #4A2B28; }
.btn-danger:hover { background: #2A1816; color: var(--danger); }
.btn-lg { padding: 15px 28px; font-size: 17px; }
.btn-sm { min-height: 36px; padding: 6px 12px; font-size: 14px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

/* Generic */
.eyebrow { display: inline-block; font-size: 13px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent); border: 1px solid var(--accent-soft); padding: 6px 12px; border-radius: 99px; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.section { padding: 96px 0; }
.section-alt { background: var(--bg-2); border-top: 1px solid var(--line-2); border-bottom: 1px solid var(--line-2); }
.section-title { font-size: clamp(32px, 4.5vw, 44px); margin-bottom: 12px; }
.section-lead { color: var(--muted); font-size: 18px; max-width: 580px; margin-bottom: 48px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 26px; }
.pill { font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 99px; background: var(--accent); color: var(--accent-ink); }
.pill-soft { background: transparent; color: var(--faint); border: 1px solid var(--line); }
.grid-auto { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; }

/* Landing hero */
.hero { padding: 72px 0 88px; }
.hero .wrap { display: flex; flex-wrap: wrap; gap: 56px; align-items: center; }
.hero-copy { flex: 1 1 460px; min-width: 0; }
.hero h1 { font-size: clamp(40px, 6.4vw, 64px); line-height: 1.02; letter-spacing: -0.035em; margin: 20px 0 24px; }
.hero-lead { font-size: 19px; color: var(--muted); max-width: 520px; margin-bottom: 36px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; }
.hero-note { margin-top: 24px; font-size: 14px; color: var(--faint); }
.hero-visual { flex: 1 1 420px; min-width: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.mini-invoice { grid-column: span 2; background: #F7F7F4; color: #16181D; border-radius: var(--radius); padding: 22px 24px; font-size: 13px; }
.mini-invoice .row { display: flex; justify-content: space-between; gap: 12px; border-top: 1px solid #DDDDD6; padding: 8px 0; }
.mini-invoice .total { border-top: 2px solid #16181D; padding-top: 10px; font-weight: 700; font-size: 15px; display: flex; justify-content: space-between; }
.mini-tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; text-decoration: none; color: var(--text); }
.mini-tile:hover { border-color: #3D414C; color: var(--text); }
.mini-tile .ico { color: var(--accent); margin-bottom: 10px; }

.stats .wrap { display: flex; flex-wrap: wrap; gap: 40px; padding-top: 48px; padding-bottom: 48px; }
.stat { flex: 1 1 280px; }
.stat-num { font-family: var(--font-display); font-size: 44px; font-weight: 700; color: var(--accent); letter-spacing: -0.03em; line-height: 1.2; }
.stat p { margin-top: 4px; color: var(--muted); }

.tool-card { display: flex; flex-direction: column; text-decoration: none; color: var(--text); transition: border-color .15s ease, transform .15s ease; }
a.tool-card:hover { border-color: #4A4F5C; transform: translateY(-2px); color: var(--text); }
.tool-card .top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; color: var(--accent); }
.tool-card h3 { font-family: var(--font-body); letter-spacing: -0.01em; font-size: 19px; margin-bottom: 6px; }
.tool-card p { color: var(--muted); font-size: 15px; }
.tool-card .go { margin-top: auto; padding-top: 18px; font-weight: 600; font-size: 14px; color: var(--accent); }
.tool-card.soon { background: transparent; border-style: dashed; border-color: #343843; }
.tool-card.soon p { color: var(--faint); }

.steps { display: flex; flex-wrap: wrap; gap: 32px; }
.step { flex: 1 1 280px; }
.step-num { font-family: var(--font-display); font-size: 56px; font-weight: 700; color: #3A3E49; line-height: 1.1; }
.step h3 { font-family: var(--font-body); font-size: 21px; letter-spacing: -0.01em; margin: 4px 0 8px; }
.step p { color: var(--muted); }

.plans { display: flex; flex-wrap: wrap; gap: 20px; justify-content: center; }
.plan { flex: 1 1 320px; max-width: 440px; border-radius: 20px; padding: 36px; display: flex; flex-direction: column; }
.plan.featured { border: 2px solid var(--accent); }
.plan h3 { font-family: var(--font-body); font-size: 20px; letter-spacing: 0; }
.plan .price { font-family: var(--font-display); font-size: 52px; font-weight: 700; margin: 8px 0 12px; }
.plan .price small { font-size: 18px; color: var(--faint); font-weight: 500; }
.plan ul { list-style: none; padding: 0; margin: 0 0 28px; color: var(--muted); }
.plan li { padding: 4px 0 4px 26px; position: relative; }
.plan li::before { content: ""; position: absolute; left: 0; top: 11px; width: 14px; height: 8px; border-left: 2px solid var(--accent); border-bottom: 2px solid var(--accent); transform: rotate(-45deg); }
.plan .btn { margin-top: auto; width: 100%; }

.faq details { border-top: 1px solid var(--line); padding: 18px 0; }
.faq details:last-child { border-bottom: 1px solid var(--line); }
.faq summary { cursor: pointer; font-weight: 600; font-size: 18px; list-style: none; display: flex; justify-content: space-between; gap: 16px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--accent); font-size: 22px; line-height: 1; }
.faq details[open] summary::after { content: "−"; }
.faq details p { color: var(--muted); margin-top: 10px; }

.cta-band { text-align: center; }
.cta-band h2 { font-size: clamp(32px, 4.5vw, 48px); margin-bottom: 16px; }
.cta-band p { color: var(--muted); font-size: 18px; margin-bottom: 32px; }

/* Footer */
.site-footer { border-top: 1px solid var(--line-2); color: var(--faint); font-size: 14px; }
.site-footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 32px; padding-top: 48px; padding-bottom: 48px; }
.footer-cols { display: flex; flex-wrap: wrap; gap: 48px; }
.footer-cols h4 { font-family: var(--font-body); font-size: 13px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-2); margin-bottom: 12px; }
.footer-cols a { display: block; color: var(--faint); text-decoration: none; padding: 3px 0; }
.footer-cols a:hover { color: var(--text); }

/* Tool pages */
.tool-head { padding: 40px 0 24px; border-bottom: 1px solid var(--line-2); }
.tool-head h1 { font-size: clamp(30px, 4vw, 40px); margin-bottom: 6px; }
.crumbs { font-size: 14px; color: var(--faint); margin-bottom: 12px; }
.crumbs a { color: var(--faint); text-decoration: none; }
.crumbs a:hover { color: var(--text); }
.tool-layout { display: flex; flex-wrap: wrap; gap: 28px; padding: 28px 0 80px; align-items: flex-start; }
.tool-form { flex: 1 1 460px; max-width: 100%; min-width: 0; display: flex; flex-direction: column; gap: 18px; }
.tool-preview { flex: 1.2 1 520px; min-width: 0; position: sticky; top: 84px; }
@media (max-width: 960px) { .tool-preview { position: static; } }

.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.panel > h2 { font-family: var(--font-body); font-size: 17px; letter-spacing: 0; margin-bottom: 16px; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.fields { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field.full { grid-column: 1 / -1; }
.field label { font-size: 13px; font-weight: 600; color: var(--text-2); }
.field .hint { font-size: 12px; color: var(--faint); }
.field .hint.err { color: var(--danger); }
input, select, textarea {
  width: 100%; font: inherit; font-size: 15px; color: var(--text);
  background: var(--bg); border: 1px solid var(--line); border-radius: 8px;
  padding: 10px 12px; min-height: 44px;
}
textarea { resize: vertical; min-height: 72px; }
input::placeholder, textarea::placeholder { text-transform: none; color: #6B7080; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(198, 244, 50, 0.15); }
input[type="file"] { padding: 8px; }
input[type="checkbox"] { width: 20px; height: 20px; min-height: 0; accent-color: var(--accent); }
.check { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--text-2); }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; }

.item-row { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.8fr) minmax(0, 1.1fr) minmax(0, 1.2fr) minmax(0, 1fr) 44px; gap: 8px; align-items: end; padding: 14px 0; border-top: 1px solid var(--line-2); }
.item-row .f-desc { grid-column: 1 / 6; grid-row: 1; }
.item-row .icon-btn { grid-column: 6; grid-row: 1; }
.item-row select, .item-row input { padding-left: 8px; padding-right: 8px; }
.item-row select { padding-right: 4px; }
.item-row:first-of-type { border-top: none; padding-top: 0; }
.item-row .field label { font-size: 12px; }
.icon-btn { width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center; border-radius: 8px; border: 1px solid var(--line); background: transparent; color: var(--faint); cursor: pointer; }
.icon-btn:hover { color: var(--danger); border-color: #4A2B28; }
@media (max-width: 640px) {
  .item-row { grid-template-columns: 1fr 1fr; }
  .item-row .f-desc { grid-column: 1 / -1; }
  .item-row .icon-btn { grid-column: 1 / -1; grid-row: auto; width: 100%; }
}

.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.menu-item.item-row { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1.1fr) 44px; }
.menu-item.item-row .icon-btn { grid-column: auto; grid-row: auto; width: 44px; }
.menu-item.item-row .wide { grid-column: 1 / -1; }
@media (max-width: 640px) {
  .menu-item.item-row { grid-template-columns: 1fr 1fr 44px; }
  .menu-item.item-row .f-name { grid-column: 1 / 3; }
}
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 14px; }
table.data th { text-align: left; font-weight: 600; color: var(--muted); padding: 10px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.data td { padding: 10px 8px; border-bottom: 1px solid var(--line-2); vertical-align: top; }
table.data td.num, table.data th.num { text-align: right; font-variant-numeric: tabular-nums; }

.empty { text-align: center; color: var(--faint); padding: 32px 16px; }
.notice { font-size: 14px; color: var(--muted); background: var(--bg-2); border: 1px solid var(--line-2); border-radius: var(--radius-sm); padding: 12px 14px; }
.notice.warn { border-color: #4D3B1A; color: #F5C46B; background: #1C170D; }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(20px); background: var(--text); color: var(--bg); padding: 12px 18px; border-radius: 10px; font-weight: 600; font-size: 14px; opacity: 0; pointer-events: none; transition: all .2s ease; z-index: 200; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* Paper preview (invoice) */
.paper { background: #FFFFFF; color: #16181D; border-radius: 12px; padding: 32px; font-size: 13px; line-height: 1.5; box-shadow: 0 20px 60px rgba(0,0,0,0.35); }
.paper h2, .paper h3 { font-family: var(--font-body); letter-spacing: 0; }
.paper .pre { white-space: pre-line; }
.paper .sm { font-size: 11px; color: #5D616B; }
.paper .lbl { font-size: 10.5px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: #5D616B; margin-bottom: 2px; }
.inv-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 20px; padding-bottom: 16px; border-bottom: 2px solid #16181D; }
.inv-seller { display: flex; gap: 14px; align-items: flex-start; flex: 1 1 260px; min-width: 0; }
.inv-logo { width: 64px; height: 64px; object-fit: contain; flex: none; }
.inv-name { font-family: var(--font-display); font-weight: 700; font-size: 18px; letter-spacing: -0.01em; margin-bottom: 2px; }
.inv-meta { flex: 0 1 auto; text-align: right; }
.inv-title { font-weight: 800; letter-spacing: 0.1em; font-size: 16px; margin-bottom: 6px; }
.inv-meta table { margin-left: auto; border-collapse: collapse; }
.inv-meta td { padding: 1px 0 1px 12px; text-align: right; }
.inv-meta td:first-child { color: #5D616B; }
.inv-bill { padding: 14px 0; border-bottom: 1px solid #DDDDD6; }
.inv-bname { font-weight: 700; font-size: 15px; }
.inv-t { width: 100%; border-collapse: collapse; margin-top: 14px; font-size: 12px; }
.inv-t th { background: #F1F1EC; text-align: left; font-size: 10.5px; font-weight: 700; padding: 7px 5px; white-space: nowrap; }
.inv-t td { padding: 7px 5px; border-bottom: 1px solid #E6E6E0; vertical-align: top; }
.inv-t .r { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.inv-bottom { display: flex; flex-wrap: wrap; gap: 20px; margin-top: 16px; }
.inv-words { flex: 1 1 240px; min-width: 0; }
.inv-totals { flex: 0 1 260px; min-width: 220px; margin-left: auto; }
.tot { display: flex; justify-content: space-between; gap: 12px; padding: 4px 0; font-variant-numeric: tabular-nums; }
.tot.grand { border-top: 2px solid #16181D; margin-top: 4px; padding-top: 8px; font-weight: 800; font-size: 16px; }
.inv-foot { display: flex; flex-wrap: wrap; gap: 20px; align-items: flex-end; justify-content: space-between; margin-top: 22px; padding-top: 16px; border-top: 1px solid #DDDDD6; }
.inv-qr svg { width: 96px; height: 96px; margin: 0 auto 4px; }
.inv-decl { flex: 1 1 220px; min-width: 0; }
.inv-sign { text-align: center; min-width: 180px; }
.inv-sign .line { height: 48px; border-bottom: 1px solid #16181D; margin: 4px 0 4px; }
.inv-gen { margin-top: 18px; text-align: center; font-size: 10px; color: #8A8F9C; }
@media print { .inv-t th { -webkit-print-color-adjust: exact; print-color-adjust: exact; } }

.qr-box { background: #FFFFFF; border-radius: 12px; padding: 16px; display: inline-block; }
.qr-box svg, .qr-box img { width: 220px; height: 220px; }

/* Legal pages */
.prose { max-width: 760px; padding: 56px 24px 96px; margin: 0 auto; }
.prose h1 { font-size: 40px; margin-bottom: 8px; }
.prose h2 { font-size: 22px; margin: 36px 0 10px; }
.prose p, .prose li { color: var(--text-2); }
.prose p { margin-bottom: 12px; }

@media print {
  body { background: #fff; }
  .no-print, .site-header, .site-footer, .tool-head, .tool-form, .toast { display: none !important; }
  .tool-layout { padding: 0; display: block; }
  .tool-preview { position: static; }
  .paper { box-shadow: none; border-radius: 0; padding: 0; font-size: 11.5px; }
  .wrap { max-width: none; padding: 0; }
  @page { size: A4; margin: 12mm; }
}
