/* Luigi Pesce site: shared design layer (v1.0). Loaded after each page's own styles.
   One header, one footer, one button system, one chip, one card, readable text, friendlier tables. */

/* ---------- text: nothing under 13px, helpers 14px ---------- */
.small { font-size: 0.875rem; }
.eyebrow { color: var(--muted); font-size: 0.875rem; letter-spacing: 0; text-transform: none; font-weight: 600; margin: 0 0 10px; }
.field > span, .hero-facts span, .idx-name, .status, .legend, .form-note { font-size: 0.875rem; }
.stat span, .mrow .nm, .news a span:last-child, .svc .risk { font-size: 0.8125rem; }
th { font-size: 0.8125rem; text-transform: none; letter-spacing: 0; }
table { font-size: 0.9rem; }
.lede { color: var(--muted); }
.svc p, .lab-desc, .steps li, .legend { color: var(--muted); }
.what { margin: 0 0 14px; color: var(--muted); font-size: 0.95rem; }
.what b { color: var(--text); }
.result-line { font-family: Georgia, "Times New Roman", serif; font-size: clamp(1.25rem, 2.6vw, 1.7rem); line-height: 1.25; margin: 4px 0 14px; color: var(--text); min-height: 1.3em; }
.result-line b { color: var(--gold2); }

/* ---------- buttons: primary (gold), secondary (gold outline), tertiary (link) ---------- */
.btn { border-radius: 10px; min-height: 44px; padding: 11px 20px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.btn-sm { min-height: 38px; padding: 7px 14px; font-size: 0.875rem; }
.btn-gold { background: var(--gold); color: #1a1405; border-color: var(--gold); }
.btn-ghost { background: transparent; border-color: var(--gold); color: var(--gold2); }
.btn-ghost:hover { background: rgba(227, 185, 78, .1); }
.btn-link, .open-link { background: none; border: 0; padding: 0; color: var(--gold2); font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; }
.btn-link:hover, .open-link:hover { text-decoration: underline; }
.btn[disabled] { opacity: .6; cursor: default; transform: none; filter: none; }
.spin { width: 15px; height: 15px; border: 2px solid rgba(26, 20, 5, .35); border-top-color: #1a1405; border-radius: 50%; animation: spin .7s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }
a:focus-visible, button:focus-visible, summary:focus-visible, .term:focus-visible { outline: 2px solid var(--gold2); outline-offset: 2px; }

/* ---------- one chip style for every filter ---------- */
.r-chip, .chip, .range-tabs button { background: var(--bg2); color: var(--text); border: 1px solid var(--line); border-radius: 999px; padding: 8px 14px; min-height: 38px; font: inherit; font-size: 0.875rem; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; gap: 6px; }
.r-chip:hover, .chip:hover, .range-tabs button:hover { border-color: var(--gold); }
.r-chip.on, .chip.on, .range-tabs button.on { background: var(--gold); border-color: var(--gold); color: #1a1405; font-weight: 700; }
.chip.on b { color: #1a1405; }
.hint { color: var(--muted); font-size: 0.8125rem; margin: 2px 0 0; flex-basis: 100%; }

/* ---------- one card style ---------- */
.panel, .svc, .idx, .card-lite { border-radius: var(--radius); border: 1px solid var(--line); }
.panel { padding: 24px; }
.section { padding: 56px 0 8px; }
.section-head { margin-bottom: 24px; }
.page-top { padding-top: 40px; }
.page-top h1 { font-size: clamp(2rem, 5vw, 3.2rem); }

/* ---------- global header ---------- */
.site-head { position: sticky; top: 0; z-index: 40; display: flex; align-items: center; gap: 20px; min-height: 56px; padding: 8px clamp(12px, 3vw, 40px); background: var(--bg2); border-bottom: 1px solid var(--line); }
.tape + .site-head { top: 36px; }
.site-nav { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.site-nav > a, .dd > a { color: var(--muted); text-decoration: none; font-size: 1rem; padding: 10px 14px; border-radius: 9px; display: inline-flex; align-items: center; gap: 6px; min-height: 44px; }
.site-nav > a:hover, .dd > a:hover { color: var(--text); background: rgba(255, 255, 255, .06); }
.site-nav a.cur { color: var(--gold2); font-weight: 700; box-shadow: inset 0 -2px 0 var(--gold); border-radius: 9px 9px 0 0; }
.dd { position: relative; }
.dd-menu { display: none; position: absolute; top: 100%; left: 0; min-width: 250px; background: var(--bg2); border: 1px solid var(--line); border-radius: 12px; padding: 6px; box-shadow: 0 18px 50px rgba(0, 0, 0, .5); }
.dd:hover .dd-menu, .dd:focus-within .dd-menu { display: block; }
.dd-menu a { display: block; color: var(--text); text-decoration: none; padding: 10px 12px; border-radius: 8px; font-size: 0.95rem; }
.dd-menu a span { display: block; color: var(--muted); font-size: 0.8125rem; }
.dd-menu a:hover { background: rgba(227, 185, 78, .1); }
.dd-menu a.cur { color: var(--gold2); font-weight: 700; }
.head-phone { color: var(--text); text-decoration: none; font-weight: 600; white-space: nowrap; font-variant-numeric: tabular-nums; min-height: 44px; display: inline-flex; align-items: center; }
.head-phone:hover { color: var(--gold2); }
.site-head .menu-btn { display: none; align-items: center; gap: 8px; background: none; border: 1px solid var(--line); color: var(--text); border-radius: 10px; font: inherit; font-size: 1rem; font-weight: 600; padding: 8px 14px; min-height: 44px; cursor: pointer; }
.nav-cta-m { display: none; }
.pill-bar { display: flex; justify-content: center; padding: 10px 16px 0; }
.pill { display: inline-flex; align-items: center; gap: 10px; max-width: 100%; border: 1px solid rgba(227, 185, 78, .55); background: rgba(227, 185, 78, .08); border-radius: 999px; padding: 4px 6px 4px 6px; font-size: 0.9rem; }
.pill a { color: var(--text); text-decoration: none; display: inline-flex; align-items: center; gap: 10px; padding: 4px 4px; }
.pill a:hover { color: var(--gold2); }
.pill b { background: var(--gold); color: #1a1405; border-radius: 999px; padding: 2px 10px; font-size: 0.8125rem; flex: none; }
.pill button { background: none; border: 0; color: var(--muted); cursor: pointer; font: inherit; font-size: 0.8125rem; padding: 6px 10px; border-radius: 999px; min-height: 32px; flex: none; }
.pill button:hover { color: var(--text); background: rgba(255, 255, 255, .08); }

@media (max-width: 1100px) { .head-phone { display: none; } }
@media (max-width: 920px) {
  .site-head .menu-btn { display: inline-flex; margin-left: auto; }
  .head-cta { display: none; }
  .site-nav { display: none; position: fixed; left: 0; right: 0; top: var(--head-bottom, 64px); bottom: 0; flex-direction: column; align-items: stretch; gap: 0; margin: 0; padding: 10px clamp(16px, 4vw, 48px) 96px; background: var(--bg); overflow-y: auto; z-index: 39; }
  .site-nav.open { display: flex; }
  .site-nav > a, .dd > a { font-size: 1.1rem; padding: 14px 6px; min-height: 52px; border-bottom: 1px solid var(--line); border-radius: 0; }
  .site-nav a.cur { box-shadow: none; }
  .dd-menu { display: block; position: static; border: 0; box-shadow: none; background: none; padding: 0 0 6px 16px; min-width: 0; }
  .dd-menu a { padding: 12px 6px; min-height: 48px; border-bottom: 1px solid var(--line); border-radius: 0; }
  .nav-cta-m { display: flex; gap: 10px; position: fixed; left: 0; right: 0; bottom: 0; padding: 12px clamp(16px, 4vw, 48px) calc(12px + env(safe-area-inset-bottom)); background: var(--bg2); border-top: 1px solid var(--line); }
  .nav-cta-m .btn { flex: 1; }
  body.menu-open { overflow: hidden; }
  .pill { border-radius: 16px; }
}

/* ---------- home ---------- */
.svc-grid.four { grid-template-columns: repeat(4, 1fr); }
.how { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; counter-reset: how; padding: 0; margin: 0; list-style: none; }
.how li { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; counter-increment: how; color: #d0d8ea; }
.how li::before { content: counter(how); display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--gold); color: #1a1405; font-weight: 800; margin-bottom: 12px; }
.how strong { display: block; color: var(--text); font-family: Georgia, serif; font-size: 1.2rem; margin-bottom: 4px; }
.tool-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.tool { display: flex; flex-direction: column; gap: 8px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; color: var(--text); text-decoration: none; transition: border-color .15s, transform .12s; }
.tool:hover { border-color: var(--gold); transform: translateY(-2px); }
.tool p { margin: 0; color: #d0d8ea; font-size: 0.95rem; flex: 1; }
.tool span { color: var(--gold2); font-weight: 600; }
.about { display: grid; grid-template-columns: 1.2fr 0.8fr; gap: 40px; align-items: center; }
.about .quote-line { font-size: clamp(1.4rem, 3vw, 2rem); line-height: 1.25; margin: 0; }
.strip-foot { margin: 16px 0 0; }
.skel { min-height: 118px; background: linear-gradient(100deg, var(--panel) 30%, var(--panel2) 50%, var(--panel) 70%); background-size: 200% 100%; animation: skel 1.3s linear infinite; cursor: default; }
@keyframes skel { from { background-position: 200% 0; } to { background-position: -200% 0; } }
@media (max-width: 1000px) { .svc-grid.four, .tool-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 760px) { .how, .about { grid-template-columns: 1fr; } .about { gap: 20px; } }
@media (max-width: 520px) { .svc-grid.four, .tool-grid { grid-template-columns: 1fr; } }

/* box spreads: basic first, the rest behind "Show advanced" */
.adv-only { display: none !important; }
.show-adv .adv-only { display: block !important; }
.show-adv .stat.adv-only { display: block !important; }
.show-adv label.adv-only { display: block !important; }

/* ---------- jargon tooltips ---------- */
.term { position: relative; border-bottom: 1px dotted var(--gold); cursor: help; white-space: nowrap; }
.term i { display: inline-grid; place-items: center; width: 18px; height: 18px; margin-left: 4px; border-radius: 50%; border: 1px solid var(--gold); color: var(--gold2); font-style: normal; font-size: 0.8125rem; font-weight: 700; line-height: 1; vertical-align: 1px; }
.term:hover::after, .term:focus::after { content: attr(data-tip); position: absolute; left: 0; top: calc(100% + 6px); z-index: 60; width: min(290px, 72vw); background: var(--bg2); border: 1px solid var(--gold); border-radius: 10px; padding: 10px 12px; color: var(--text); font: 400 0.875rem/1.45 "Segoe UI", system-ui, sans-serif; white-space: normal; text-transform: none; letter-spacing: 0; text-align: left; box-shadow: 0 14px 40px rgba(0, 0, 0, .55); }
.term.tip-right:hover::after, .term.tip-right:focus::after { left: auto; right: 0; }

/* ---------- tables: sticky header, zebra rows, sort arrows, fewer columns first ---------- */
tbody tr:nth-child(even) td { background: rgba(255, 255, 255, .028); }
th[data-k] { cursor: pointer; white-space: nowrap; user-select: none; }
th[data-k]:not(.sorted)::after { content: " ↕"; color: var(--muted); font-weight: 400; }
th.sorted { color: var(--gold2); }
.cols-btn { margin: 0 0 10px; }
table[data-cols="4"]:not(.all-cols) tr > :nth-child(n+5),
table[data-cols="5"]:not(.all-cols) tr > :nth-child(n+6),
table[data-cols="6"]:not(.all-cols) tr > :nth-child(n+7) { display: none; }
table tr > [colspan] { display: table-cell !important; }
@media (min-width: 701px) {
  .table-wrap.sticky { max-height: 620px; overflow: auto; }
  .table-wrap.sticky thead th { position: sticky; top: 0; z-index: 2; background: var(--panel); box-shadow: 0 1px 0 var(--line); }
}
@media (max-width: 700px) {
  table.cards, table.cards tbody { display: block; }
  table.cards thead { position: absolute; left: -9999px; top: -9999px; }
  table.cards tr { display: block; border: 1px solid var(--line); border-radius: 12px; margin: 0 0 10px; padding: 10px 14px; background: var(--bg2); }
  table.cards tbody tr:nth-child(even) td { background: none; }
  table.cards td { display: flex; justify-content: space-between; align-items: baseline; gap: 14px; border: 0; padding: 5px 0; text-align: right; white-space: normal; min-width: 0 !important; }
  table.cards td::before { content: attr(data-label); color: var(--muted); text-align: left; flex: none; max-width: 55%; font-size: 0.8125rem; font-weight: 400; }
  table.cards td:first-child { display: block; text-align: left; font-size: 1.05rem; padding-bottom: 6px; }
  table.cards td:first-child::before, table.cards td[colspan]::before, table.cards td:empty { display: none; content: none; }
  table.cards td[colspan] { display: block !important; text-align: left; }
  table.cards[data-cols="4"]:not(.all-cols) tr > :nth-child(n+5),
  table.cards[data-cols="5"]:not(.all-cols) tr > :nth-child(n+6),
  table.cards[data-cols="6"]:not(.all-cols) tr > :nth-child(n+7) { display: none; }
}

/* ---------- states ---------- */
.retry { display: inline-flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.example-tag { display: inline-block; background: rgba(227, 185, 78, .14); border: 1px solid rgba(227, 185, 78, .5); color: var(--gold2); border-radius: 999px; padding: 2px 10px; font-size: 0.8125rem; font-weight: 700; margin-bottom: 10px; }
.preview { opacity: .78; }
.info-banner { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; background: rgba(91, 141, 239, .1); border: 1px solid rgba(91, 141, 239, .45); border-radius: 12px; padding: 12px 16px; margin: 0 0 18px; color: #d6ddee; font-size: 0.95rem; }
.info-banner p { margin: 0; flex: 1 1 320px; }

/* ---------- footer ---------- */
.site-foot { max-width: 1400px; margin: 72px auto 0; padding: 28px clamp(12px, 3vw, 40px) 56px; border-top: 1px solid var(--line); color: var(--muted); font-size: 0.875rem; line-height: 1.65; }
.site-foot p { margin: 0 0 12px; max-width: 86ch; }
.site-foot .who { font-size: 1rem; color: var(--text); }
.site-foot details { margin: 0 0 14px; }
.site-foot summary { cursor: pointer; color: var(--gold2); font-weight: 600; padding: 8px 0; min-height: 44px; display: inline-flex; align-items: center; }
.site-foot details p { color: var(--muted); }
.site-foot .stamp { color: var(--muted); }

/* phone fixes */
small { font-size: 0.8125rem; }
.range-tabs { flex-wrap: wrap; }
.quote-actions .btn { white-space: normal; text-align: center; }
@media (max-width: 520px) { .mrow { grid-template-columns: 56px 1fr auto auto; gap: 8px; } .news a { grid-template-columns: 1fr; gap: 2px; } .stats { grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); } }
@media (max-width: 920px) { .contact { grid-template-columns: 1fr !important; } }
.hero-cta .btn { white-space: normal; text-align: center; }
