/* ENB software hub (/software/…): article typography, answer boxes, tables, cards, the free tools and the invoice
   generator's print layout. Builds on site.css tokens (light + dark come for free). */

.sw-hero .page-hero-in, .sw-hero-copy { max-width: 860px; }
.sw-hero h1 { font-size: clamp(2rem, 4.6vw, 3.1rem); }
.sw-byline { margin: 18px 0 0; font-size: .9rem; color: rgba(255, 255, 255, .75); }
.sw-main { padding-top: clamp(32px, 5vw, 56px); }
.sw-h2 { font-size: clamp(1.4rem, 2.6vw, 1.85rem); margin-top: 2.2em; }

/* answer-first summary */
.sw-answer { border-left: 4px solid var(--brand); background: var(--brand-soft); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; padding: 18px 22px; margin: 0 0 28px; font-size: 1.08rem; max-width: 860px; }
.sw-answer p { margin: 0; color: var(--ink); }
.sw-status { border-radius: var(--radius-sm); padding: 14px 18px; margin: 0 0 24px; max-width: 860px; }
.sw-status-warn { background: var(--warn-soft); color: var(--ink); border: 1px solid color-mix(in srgb, var(--warn) 30%, transparent); }
.sw-status-ok { background: var(--ok-soft); }

/* layout: article + sticky table of contents */
.sw-layout { display: block; }
.sw-layout.has-toc { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: clamp(28px, 4vw, 56px); align-items: start; }
.sw-article { max-width: 860px; min-width: 0; }
.sw-aside { position: sticky; top: calc(var(--hdr-h) + 16px); display: grid; gap: 16px; }
.sw-toc, .sw-side-cta { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 16px 18px; background: var(--card); }
.sw-toc-h { font-weight: 750; font-size: .8rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 0 0 8px; }
.sw-toc ol { margin: 0; padding-left: 1.1em; font-size: .92rem; }
.sw-toc li { margin: 6px 0; }
.sw-toc a { color: var(--ink-2); text-decoration: none; }
.sw-toc a:hover { color: var(--brand-ink); text-decoration: underline; }
.sw-side-cta p { margin: 0 0 8px; font-size: .95rem; color: var(--ink-2); }
@media (max-width: 1020px) { .sw-layout.has-toc { grid-template-columns: 1fr; } .sw-aside { position: static; display: none; } }

/* long-form copy */
.sw-prose { font-size: 1.04rem; }
.sw-prose h2 { font-size: clamp(1.4rem, 2.6vw, 1.85rem); margin: 1.9em 0 .55em; scroll-margin-top: 100px; }
.sw-prose h3 { font-size: 1.15rem; margin: 1.5em 0 .4em; }
.sw-prose p, .sw-prose li { color: var(--ink-2); }
.sw-prose ul, .sw-prose ol { margin: 0 0 1.2em; }
.sw-prose li { margin: .35em 0; }
.sw-prose code { font-family: var(--mono); font-size: .88em; background: var(--bg-soft); border: 1px solid var(--line); border-radius: 6px; padding: 1px 6px; overflow-wrap: anywhere; }
.sw-note { background: var(--bg-soft); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 14px 18px; margin: 0 0 1.2em; }
.sw-table { overflow-x: auto; margin: 0 0 1.4em; border: 1px solid var(--line); border-radius: var(--radius-sm); -webkit-overflow-scrolling: touch; }
.sw-table table { width: 100%; border-collapse: collapse; font-size: .95rem; min-width: 520px; }
.sw-table th, .sw-table td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
.sw-table thead th { background: var(--bg-soft); font-weight: 700; color: var(--ink); }
.sw-table tbody th { font-weight: 600; color: var(--ink); }
.sw-table tr:last-child th, .sw-table tr:last-child td { border-bottom: 0; }
.sw-disclaimer { font-size: .88rem; color: var(--muted); border-top: 1px solid var(--line); padding-top: 14px; margin-top: 24px; }

/* feature points and steps */
.sw-points { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin: 8px 0 12px; }
.sw-point { display: flex; gap: 14px; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 18px; background: var(--card); }
.sw-point h3 { font-size: 1.02rem; margin: 2px 0 6px; }
.sw-point p { margin: 0; color: var(--muted); font-size: .95rem; }
@media (max-width: 720px) { .sw-points { grid-template-columns: 1fr; } }
.sw-steps { list-style: none; counter-reset: s; padding: 0; margin: 0 0 1em; }
.sw-steps li { counter-increment: s; position: relative; padding: 4px 0 14px 46px; color: var(--ink-2); }
.sw-steps li::before { content: counter(s); position: absolute; left: 0; top: 0; width: 32px; height: 32px; border-radius: 50%; background: var(--brand-strong); color: #fff; font-weight: 750; display: grid; place-items: center; font-size: .9rem; }

/* cards */
.sw-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 18px; margin: 18px 0; }
.sw-card { padding: 22px; }
.sw-card h3 { font-size: 1.08rem; }
.sw-card p { font-size: .94rem; }
.sw-kind { font-size: .72rem; font-weight: 750; letter-spacing: .08em; text-transform: uppercase; color: var(--brand-ink); margin-bottom: 8px; }
.sw-related { border-top: 1px solid var(--line); }

/* author box */
.sw-author { display: flex; gap: 16px; align-items: flex-start; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 18px; margin-top: 32px; background: var(--bg-soft); }
.sw-author img { width: 56px; height: 56px; object-fit: contain; border-radius: 12px; background: var(--card); padding: 6px; }
.sw-author p { margin: 4px 0 0; font-size: .92rem; color: var(--muted); }

/* call to action */
.sw-cta { border-radius: var(--radius); padding: clamp(24px, 4vw, 44px); background: linear-gradient(135deg, var(--navy), var(--navy-3)); color: #fff; display: grid; gap: 18px; }
.sw-cta h2 { color: #fff; font-size: clamp(1.5rem, 3vw, 2.1rem); margin: 0; }
.sw-cta p { color: rgba(255, 255, 255, .82); margin: 0; }
.sw-cta-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.sw-cta .btn-outline { color: #fff; border-color: rgba(255, 255, 255, .4); background: transparent; }
.sw-cta-note { font-size: .86rem; }
.sw-cta-note a { color: #fff; }
@media (max-width: 560px) { .sw-cta-actions .btn { width: 100%; } }

/* pillar: explore the hub */
.sw-explore-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 22px; }
.sw-explore-col h3 { font-size: 1.05rem; margin-bottom: 2px; }
.sw-explore-col ul { list-style: none; padding: 0; margin: 10px 0 0; }
.sw-explore-col li { margin: 7px 0; font-size: .94rem; }
.sw-explore-col a { color: var(--ink-2); text-decoration: none; }
.sw-explore-col a:hover { color: var(--brand-ink); text-decoration: underline; }
.sw-explore-more { margin-top: 26px; text-align: center; }
@media (max-width: 1100px) { .sw-explore-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 680px) { .sw-explore-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 420px) { .sw-explore-grid { grid-template-columns: 1fr; } }

/* pricing */
.sw-plan-name { font-size: 1.25rem; margin: 6px 0 4px; }

/* glossary */
.sw-letters { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 22px; }
.sw-letters a { display: inline-grid; place-items: center; min-width: 38px; height: 38px; border: 1px solid var(--line); border-radius: 10px; text-decoration: none; font-weight: 700; color: var(--ink-2); }
.sw-letters a:hover { border-color: var(--brand); color: var(--brand-ink); }
.sw-glossary { margin: 0; max-width: 860px; }
.sw-letter { font-size: 1.6rem; margin: 1.4em 0 .4em; color: var(--brand-ink); scroll-margin-top: 100px; }
.sw-term { border-bottom: 1px solid var(--line); padding: 14px 0; scroll-margin-top: 100px; }
.sw-term:target { background: var(--brand-soft); border-radius: 10px; padding-left: 12px; padding-right: 12px; }
.sw-term dt { font-weight: 750; font-size: 1.06rem; color: var(--ink); position: relative; }
.sw-term dd { margin: 6px 0 0; color: var(--ink-2); }
.sw-term dd p { margin: 0 0 4px; }
.sw-anchor { position: absolute; left: -22px; opacity: 0; text-decoration: none; color: var(--muted); }
.sw-term:hover .sw-anchor, .sw-anchor:focus { opacity: 1; }
.sw-more { font-size: .9rem; }

/* tools */
.sw-tool { border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); box-shadow: var(--shadow); padding: clamp(18px, 3vw, 32px); margin: 0 0 36px; scroll-margin-top: 100px; }
.sw-form { display: grid; gap: 14px; }
.sw-form fieldset { border: 0; padding: 0; margin: 0 0 6px; display: grid; gap: 12px; min-width: 0; }
.sw-form legend { font-weight: 750; margin-bottom: 8px; color: var(--ink); }
.sw-form-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
@media (max-width: 600px) { .sw-form-row { grid-template-columns: 1fr; } }
.sw-field { display: grid; gap: 6px; min-width: 0; }
.sw-field label, .sw-field > legend { font-weight: 650; font-size: .92rem; color: var(--ink); }
.sw-field small { color: var(--muted); font-size: .82rem; }
.sw-field input:not([type=radio]):not([type=checkbox]):not([type=file]), .sw-field textarea, .sw-field select, .inv-item input {
  width: 100%; min-height: 46px; border: 1.5px solid var(--line-2); border-radius: 10px; padding: 10px 12px; font: inherit; font-size: 1rem; color: var(--ink); background: var(--bg); }
.sw-field textarea { min-height: 0; resize: vertical; }
.sw-field input:focus, .sw-field textarea:focus, .sw-field select:focus, .inv-item input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft-2); }
.sw-radios { display: grid; gap: 8px; }
.sw-radios label { font-weight: 500; display: flex; gap: 8px; align-items: center; }
.sw-or { margin: 0; color: var(--muted); font-size: .9rem; text-align: center; }
.sw-form .btn { justify-self: start; }
.sw-result { margin-top: 20px; }
.sw-figures { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin: 0; }
.sw-figures > div { background: var(--bg-soft); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; }
.sw-figures dt { font-size: .82rem; color: var(--muted); font-weight: 650; }
.sw-figures dd { margin: 4px 0 0; font-size: 1.35rem; font-weight: 800; color: var(--ink); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.sw-figures .sw-total { background: var(--brand-soft); border-color: var(--brand-soft-2); }
.sw-error { color: var(--danger); background: var(--danger-soft); border-radius: 10px; padding: 10px 14px; }
.sw-warn { color: var(--warn); background: var(--warn-soft); border-radius: 10px; padding: 10px 14px; margin-top: 12px; }
.sw-tool-cta { margin: 18px 0 0; font-size: .95rem; color: var(--muted); }
.sw-score { display: flex; align-items: center; gap: 16px; margin-bottom: 14px; }
.sw-score-n { width: 72px; height: 72px; border-radius: 50%; display: grid; place-items: center; font-size: 1.6rem; font-weight: 800; background: var(--bg-soft); border: 3px solid var(--line-2); }
.sw-score[data-level="good"] .sw-score-n { border-color: var(--ok); color: var(--ok); }
.sw-score[data-level="warn"] .sw-score-n { border-color: var(--amber); color: var(--warn); }
.sw-score[data-level="bad"] .sw-score-n { border-color: var(--danger); color: var(--danger); }
.sw-score-l { display: grid; }
.sw-score-l small { color: var(--muted); }
.sw-inbox-preview { display: grid; gap: 2px; max-width: 360px; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; background: var(--bg); margin-bottom: 12px; }
.sw-ip-from { font-weight: 750; font-size: .9rem; }
.sw-ip-subj { font-size: .9rem; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sw-notes { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.sw-notes li { padding: 10px 14px 10px 38px; border-radius: 10px; position: relative; background: var(--bg-soft); color: var(--ink-2); }
.sw-notes li::before { position: absolute; left: 14px; top: 10px; font-weight: 800; }
.sw-notes .lv-good::before { content: "✓"; color: var(--ok); }
.sw-notes .lv-warn::before { content: "!"; color: var(--warn); }
.sw-notes .lv-bad::before { content: "×"; color: var(--danger); }
.sw-linkbox { display: grid; gap: 10px; border: 1px solid var(--line); border-radius: 12px; padding: 14px; background: var(--bg-soft); }
.sw-linkbox code { font-family: var(--mono); font-size: .9rem; overflow-wrap: anywhere; }
.sw-linkbox-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* invoice generator */
.inv-gen { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: clamp(20px, 3vw, 36px); align-items: start; }
@media (max-width: 960px) { .inv-gen { grid-template-columns: 1fr; } }
.inv-item { display: grid; grid-template-columns: minmax(0, 1fr) 70px 110px 40px; gap: 8px; margin-bottom: 8px; }
.inv-item .icon-btn { min-height: 46px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); color: var(--muted); font-size: 1.3rem; cursor: pointer; }
@media (max-width: 480px) { .inv-item { grid-template-columns: 1fr 60px 92px 36px; } }
.inv-preview-wrap { position: sticky; top: calc(var(--hdr-h) + 12px); }
.inv-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 14px; }
.inv-doc { background: #fff; color: #111827; border: 1px solid #e5e7eb; border-radius: 12px; padding: 28px; box-shadow: var(--shadow-sm); font-size: 14px; line-height: 1.5; }
.inv-doc h2, .inv-doc h3 { color: #111827; letter-spacing: 0; }
.inv-head { display: flex; justify-content: space-between; gap: 20px; border-bottom: 2px solid #0063e6; padding-bottom: 16px; margin-bottom: 16px; }
.inv-logo { max-height: 56px; max-width: 160px; width: auto; margin-bottom: 8px; }
.inv-biz { font-size: 1.2rem; margin: 0 0 4px; }
.inv-title { text-align: right; }
.inv-title h3 { font-size: 1.4rem; margin: 0 0 4px; color: #0063e6; letter-spacing: .06em; }
.inv-doc p { margin: 0 0 2px; color: #111827; }
.inv-small { font-size: 12.5px; color: #4b5563 !important; white-space: pre-line; }
.inv-label { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: #6b7280 !important; margin-bottom: 4px !important; }
.inv-bill { margin-bottom: 16px; }
.inv-table { width: 100%; border-collapse: collapse; margin-bottom: 12px; }
.inv-table th { background: #f3f4f6; font-size: 12px; text-align: left; padding: 8px; color: #374151; }
.inv-table td { padding: 8px; border-bottom: 1px solid #e5e7eb; vertical-align: top; color: #111827; }
.inv-table .r, .inv-table th.r { text-align: right; white-space: nowrap; }
.inv-totals { margin: 0 0 16px auto; max-width: 280px; }
.inv-totals > div { display: flex; justify-content: space-between; gap: 16px; padding: 4px 0; }
.inv-totals dt { color: #4b5563; }
.inv-totals dd { margin: 0; font-variant-numeric: tabular-nums; color: #111827; }
.inv-totals .inv-grand { border-top: 2px solid #111827; margin-top: 4px; padding-top: 8px; font-weight: 800; font-size: 1.05rem; }
.inv-totals .inv-grand dt { color: #111827; }
.inv-pay { background: #eff6ff; border-radius: 8px; padding: 10px 12px; margin-bottom: 10px; }
.inv-notes { white-space: pre-line; color: #374151 !important; }
.inv-foot { margin-top: 18px !important; font-size: 11px; color: #9ca3af !important; text-align: center; }

@media print {
  body.inv-printing * { visibility: hidden !important; }
  body.inv-printing .inv-doc, body.inv-printing .inv-doc * { visibility: visible !important; }
  body.inv-printing .inv-doc { position: absolute; left: 0; top: 0; width: 100%; border: 0; box-shadow: none; padding: 0; }
  body.inv-printing .fabs, body.inv-printing .consent, body.inv-printing .ld-sticky { display: none !important; }
  @page { margin: 14mm; }
}
.sw-tool [hidden], .inv-doc [hidden], .sw-result [hidden] { display: none !important; }
.inv-gen > * { min-width: 0; }
@media (max-width: 960px) { .inv-preview-wrap { position: static; } }
@media (max-width: 600px) {
  .inv-doc { padding: 16px; font-size: 12.5px; }
  .inv-head { flex-direction: column; gap: 10px; }
  .inv-title { text-align: left; }
  .inv-table th, .inv-table td { padding: 6px 4px; }
  .sw-tool { padding: 14px; }
}
