/* VVIP Free Online Tools — builds on vvip.css tokens. */
.tool-page { padding-bottom: 0; }
.tool-hero { padding: 56px var(--gutter) 0; max-width: 980px; display: flex; flex-direction: column; gap: 16px; }
.tool-hero .crumb { margin-bottom: 8px; }
.tool-hero h1 { font-size: clamp(34px, 4.2vw, 56px); line-height: 1.04; letter-spacing: -.025em; font-weight: 600; text-wrap: balance; }
.tool-hero .lead { max-width: 760px; }
.trust { font-size: 13.5px; color: var(--muted); display: flex; align-items: center; gap: 10px; }
.trust::before { content: ''; width: 8px; height: 8px; transform: rotate(45deg); background: var(--champ); flex: none; }
.muted { color: var(--muted); }
.small { font-size: 13px; line-height: 1.6; }

/* Layout: steps + live preview */
.tool-layout { display: grid; grid-template-columns: minmax(0, 1fr) 400px; gap: 40px; padding: 40px var(--gutter) 0; align-items: start; }
.tool-main { min-width: 0; display: flex; flex-direction: column; gap: 18px; }
.stepper { list-style: none; margin: 0; padding: 0; display: flex; gap: 6px; flex-wrap: wrap; }
.stepper button { display: flex; align-items: center; gap: 8px; border: 1px solid var(--border); background: #fff; border-radius: 999px; padding: 6px 14px 6px 6px; font-size: 13px; font-weight: 600; color: var(--muted); cursor: pointer; min-height: 36px; }
.stepper button:hover { border-color: var(--champ); color: var(--ink); }
.stepper .sn { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-size: 11.5px; background: var(--divider); color: var(--faint); flex: none; }
.stepper button.past .sn { background: var(--charcoal); color: var(--champ); }
.stepper button.on { border-color: var(--charcoal); color: var(--ink); }
.stepper button.on .sn { background: var(--champ); color: var(--charcoal); }
.step-card { background: #fff; border: 1px solid var(--border); border-radius: 16px; padding: 36px 40px; display: flex; flex-direction: column; gap: 10px; }
.step-title { font-size: clamp(24px, 2.4vw, 30px); letter-spacing: -.015em; font-weight: 600; margin-bottom: 8px; }
.fields { display: flex; flex-direction: column; gap: 22px; }
.step-nav { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 18px; padding-top: 22px; border-top: 1px solid var(--divider); flex-wrap: wrap; }
.regen { margin: 6px 0 0; font-size: 13px; color: var(--muted); text-align: right; }
.err-sum { background: #FBEDEA; border: 1px solid #E9C3BC; color: var(--alert); border-radius: 10px; padding: 12px 14px; font-size: 14px; font-weight: 500; }

/* Fields */
fieldset.fld { border: 0; padding: 0; margin: 0; min-width: 0; }
.fld { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.fld-label { font-size: 14.5px; font-weight: 600; color: var(--ink); padding: 0; }
.fld-label .opt { font-weight: 400; font-size: 12.5px; color: var(--faint); margin-left: 4px; }
.fld-hint { font-size: 13px; color: var(--muted); line-height: 1.5; margin-top: -2px; }
.fld-err { font-size: 13px; color: var(--alert); font-weight: 500; }
.fld-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: end; }
.in { width: 100%; font: inherit; font-size: 16px; color: var(--ink); background: #fff; border: 1px solid var(--outline); border-radius: 10px; padding: 12px 14px; min-height: 48px; transition: border-color .15s, box-shadow .15s; }
textarea.in { resize: vertical; line-height: 1.5; min-height: 72px; }
.in:hover { border-color: #B9AE9D; }
.in:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(196,170,133,.25); }
.in::placeholder { color: #A9A196; }
.has-error .in { border-color: var(--alert); }
.in-wrap { display: flex; align-items: stretch; }
.in-wrap .in { border-radius: 0; flex: 1; min-width: 0; }
.in-wrap .in:first-child { border-radius: 10px 0 0 10px; }
.in-wrap .in:last-child { border-radius: 0 10px 10px 0; }
.in-wrap .in:only-child { border-radius: 10px; }
.affix { display: flex; align-items: center; padding: 0 12px; background: var(--tint); border: 1px solid var(--outline); border-right: 0; border-radius: 10px 0 0 10px; font-size: 14px; font-weight: 600; color: var(--gold); }
.affix.suf { border-right: 1px solid var(--outline); border-left: 0; border-radius: 0 10px 10px 0; }
input[type=number].in { -moz-appearance: textfield; }
input[type=number].in::-webkit-inner-spin-button { opacity: .4; }

.seg { display: flex; flex-wrap: wrap; gap: 8px; }
.seg-opt, .chk-opt { position: relative; cursor: pointer; }
.seg-opt input, .chk-opt input, .opt-card input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.seg-opt span { display: flex; align-items: center; min-height: 44px; padding: 0 18px; border: 1px solid var(--outline); border-radius: 999px; background: #fff; font-size: 14.5px; font-weight: 500; color: var(--sec); transition: all .15s; }
.seg-opt:hover span { border-color: var(--champ); }
.seg-opt input:checked + span { background: var(--charcoal); border-color: var(--charcoal); color: var(--linen); }
.seg-opt input:focus-visible + span, .chk-opt input:focus-visible + span, .opt-card input:focus-visible ~ b { outline: 2px solid var(--champ); outline-offset: 2px; }
.chk-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px; }
.chk-opt span { display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 10px 14px; border: 1px solid var(--outline); border-radius: 10px; background: #fff; font-size: 14.5px; color: var(--sec); transition: all .15s; }
.chk-opt span::before { content: ''; flex: none; width: 18px; height: 18px; border: 1.5px solid var(--gold); border-radius: 5px; background: #fff; }
.chk-opt:hover span { border-color: var(--champ); }
.chk-opt input:checked + span { border-color: var(--gold); background: var(--tint); color: var(--ink); font-weight: 500; }
.chk-opt input:checked + span::before { background: var(--gold) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3.5 8.5l3 3 6-7' fill='none' stroke='%23fff' stroke-width='2'/%3E%3C/svg%3E") center/12px no-repeat; }
.opt-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; }
.opt-card { position: relative; cursor: pointer; display: flex; flex-direction: column; gap: 6px; padding: 18px 18px 18px 48px; border: 1px solid var(--outline); border-radius: 12px; background: #fff; transition: all .15s; }
.opt-card::before { content: ''; position: absolute; left: 18px; top: 20px; width: 18px; height: 18px; border: 1.5px solid var(--gold); border-radius: 50%; background: #fff; }
.opt-card:has(input:checked) { border-color: var(--charcoal); box-shadow: inset 0 0 0 1px var(--charcoal); background: var(--tint); }
.opt-card:has(input:checked)::before { border: 5px solid var(--charcoal); }
.opt-card b { font-size: 16px; font-weight: 600; }
.opt-card span { font-size: 13.5px; line-height: 1.5; color: var(--muted); }

/* Preview */
.tool-preview { position: sticky; top: 104px; background: #fff; border: 1px solid var(--border); border-radius: 16px; padding: 22px 24px 26px; max-height: calc(100vh - 128px); overflow: auto; }
.pv-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 16px; padding-bottom: 14px; border-bottom: 1px solid var(--divider); }
.saved { font-size: 12px; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.saved::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: #7E9A6B; }
.pv-empty { margin: 0; font-size: 14.5px; color: var(--faint); line-height: 1.6; padding: 24px 0; text-align: center; }
.pv-title { font-size: 20px; font-weight: 600; letter-spacing: -.01em; }
.pv-sub { font-size: 13px; color: var(--muted); margin-top: 2px; }
.pv-count { font-family: var(--mono); font-size: 11.5px; letter-spacing: .08em; color: var(--gold); margin: 14px 0 8px; text-transform: uppercase; }
.pv-list { list-style: none; margin: 0; padding: 0; }
.pv-list li { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--divider); font-size: 14px; }
.pv-list .n { font-family: var(--mono); font-size: 12px; color: var(--faint); }
.pv-rules, .pv-guide { font-size: 13.5px; line-height: 1.55; }
.pv-rules .doc-intro, .pv-guide .doc-intro { font-size: 13.5px; margin: 12px 0; }
.pv-rules .rule-list, .pv-guide .guide-steps { gap: 10px; }
.pv-rules h3, .pv-guide h3 { font-size: 14px; }
.pv-guide .guide-h { font-size: 19px; }
.pv-guide .g-num { font-size: 22px; }
.pv-guide .g-step { grid-template-columns: 34px 1fr; padding: 10px 0; }
.pv-warn { font-size: 13px; color: var(--alert); margin: 12px 0 0; }
.pv-rev .metrics { grid-template-columns: 1fr 1fr; }
.pv-rev .metric b { font-size: 20px; }
.pv-rev .metric.hl { grid-column: 1 / -1; }

/* Result */
.tool-result { padding: 40px var(--gutter) 0; max-width: 1100px; margin: 0 auto; }
.res-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 20px; position: sticky; top: 85px; z-index: 5; background: rgba(247,244,238,.96); padding: 12px 0; }
.res-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.btn-ghost { background: transparent; color: var(--muted); border-color: transparent; }
.btn-ghost:hover { color: var(--alert); }
.btn-save { background: #fff; border-color: var(--champ); color: var(--gold); }
.btn-save:hover { background: var(--tint); color: var(--ink); }
.link-btn { background: none; border: 0; padding: 4px 0; font: inherit; font-size: 12px; font-weight: 700; letter-spacing: .08em; color: var(--gold); cursor: pointer; }
.link-btn:hover { color: var(--ink); }
.res-doc { background: #fff; border: 1px solid var(--border); border-radius: 16px; padding: 44px 48px; }
.res-head { display: flex; flex-direction: column; gap: 8px; margin-bottom: 18px; }
.res-head h2 { font-size: clamp(26px, 3vw, 38px); letter-spacing: -.02em; font-weight: 600; line-height: 1.1; }
.res-sub { font-size: 14px; color: var(--muted); }
.edit-hint { font-size: 13px; color: var(--muted); margin: 0 0 18px; display: flex; gap: 8px; align-items: center; }
.edit-hint::before { content: '✎'; color: var(--gold); }
.res-note { margin-top: 16px; }
[contenteditable] { border-radius: 6px; outline: none; transition: background .15s, box-shadow .15s; }
[contenteditable]:hover { background: var(--tint); }
[contenteditable]:focus { background: var(--tint); box-shadow: 0 0 0 2px var(--champ); }
.rm { flex: none; width: 32px; height: 32px; border: 0; background: transparent; color: var(--faint); font-size: 20px; line-height: 1; border-radius: 8px; cursor: pointer; opacity: .55; }
.rm:hover, .rm:focus-visible { opacity: 1; color: var(--alert); background: #FBEDEA; }

/* Checklist */
.cl-progress { background: var(--tint); border: 1px solid var(--tint-border); border-radius: 12px; padding: 16px 18px; margin-bottom: 16px; display: flex; flex-direction: column; gap: 10px; }
.cl-prog-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.cl-prog-top b { font-size: 16px; }
.cl-progress .bar { height: 6px; background: #EDE6DA; }
.cl-progress .bar i { width: 0; transition: width .25s; }
.cl-sec { margin-top: 28px; }
.cl-sec h3 { display: flex; justify-content: space-between; align-items: baseline; font-size: 13px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--ink); padding-bottom: 10px; border-bottom: 1.5px solid var(--charcoal); }
.cl-sec .cnt { font-family: var(--mono); font-size: 11.5px; color: var(--gold); letter-spacing: 0; font-weight: 500; }
.cl-sec ul { list-style: none; margin: 0; padding: 0; }
.cl-item { display: flex; align-items: center; gap: 12px; padding: 6px 0; border-bottom: 1px solid var(--divider); min-height: 52px; }
.cl-item input { appearance: none; -webkit-appearance: none; flex: none; width: 24px; height: 24px; margin: 0; border: 1.5px solid var(--gold); border-radius: 6px; background: #fff; cursor: pointer; display: grid; place-content: center; }
.cl-item input:checked { background: var(--gold); }
.cl-item input:checked::after { content: ''; width: 11px; height: 6px; border-left: 2.5px solid #fff; border-bottom: 2.5px solid #fff; transform: translateY(-1px) rotate(-45deg); }
.cl-item .txt { flex: 1; font-size: 16px; line-height: 1.45; padding: 6px 8px; margin-left: -8px; }
.cl-item.done .txt { color: var(--faint); text-decoration: line-through; text-decoration-color: var(--champ); }
.add-row { display: flex; gap: 8px; margin-top: 10px; }
.add-row .in { min-height: 42px; padding: 8px 12px; font-size: 15px; border-style: dashed; }
.add-row .btn { padding: 8px 16px; }

/* Rules + guide documents */
.doc { font-size: 16.5px; line-height: 1.65; color: var(--body); }
.doc-intro { margin: 0 0 22px; font-size: 17.5px; color: var(--sec); padding: 4px 8px; margin-left: -8px; }
.doc-closing { margin: 26px 0 0; font-weight: 500; padding: 4px 8px; margin-left: -8px; }
.rule-list { margin: 0; padding: 0; list-style: none; counter-reset: r; display: flex; flex-direction: column; gap: 4px; }
.rule { counter-increment: r; padding: 16px 0; border-top: 1px solid var(--divider); }
.rule-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.rule h3, .g-step h3, .g-good h3 { font-size: 17px; font-weight: 600; color: var(--ink); padding: 2px 8px; margin-left: -8px; }
.rule h3::before { content: counter(r) '.  '; color: var(--gold); font-family: var(--logo); font-weight: 400; }
.rule-body { white-space: pre-line; padding: 4px 8px; margin-left: -8px; margin-top: 2px; }
.guide-h { font-size: clamp(26px, 3vw, 38px); letter-spacing: -.02em; font-weight: 600; line-height: 1.1; margin-bottom: 6px; }
.guide-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.g-step { display: grid; grid-template-columns: 56px 1fr; gap: 14px; padding: 18px 0; border-top: 1px solid var(--divider); }
.g-num { font-family: var(--logo); font-weight: 300; font-size: 34px; line-height: 1; color: var(--gold); }
.g-main { min-width: 0; }
.g-good { margin-top: 18px; padding: 20px 22px; background: var(--tint); border: 1px solid var(--tint-border); border-radius: 12px; }

/* Revenue */
.tool-page[data-tool="revenue"] .tool-result { max-width: none; }
.rv-layout { display: grid; grid-template-columns: 400px minmax(0, 1fr); gap: 32px; align-items: start; }
.rv-inputs { display: flex; flex-direction: column; gap: 14px; position: sticky; top: 160px; max-height: calc(100vh - 180px); overflow: auto; padding-right: 4px; }
.rv-group { border: 1px solid var(--border); border-radius: 14px; background: #fff; padding: 18px 20px 20px; margin: 0; display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.rv-group legend { font-family: var(--mono); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--gold); padding: 0 6px; margin-left: -6px; }
.rv-group .fld-row { gap: 12px; }
.rv-group .fld-label { font-size: 13.5px; }
.rv-results { background: #fff; border: 1px solid var(--border); border-radius: 16px; padding: 32px 36px; display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.metric { border: 1px solid var(--border); border-radius: 12px; padding: 16px 18px; display: flex; flex-direction: column; gap: 6px; background: var(--tools-bg); min-width: 0; }
.metric span { font-size: 12.5px; color: var(--muted); line-height: 1.35; }
.metric b { font-size: 24px; font-weight: 600; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.metric.hl { background: var(--charcoal); border-color: var(--charcoal); grid-row: span 1; }
.metric.hl span { color: var(--on-dark); }
.metric.hl b { color: var(--champ); }
.metric.hl.neg b { color: #E59A8E; }
.rv-h { font-size: 13px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; margin-top: 14px; }
.tbl-wrap { overflow-x: auto; }
.rv-table { width: 100%; border-collapse: collapse; font-size: 14.5px; font-variant-numeric: tabular-nums; }
.rv-table th, .rv-table td { text-align: right; padding: 11px 10px; border-bottom: 1px solid var(--divider); white-space: nowrap; }
.rv-table thead th { font-size: 12px; font-weight: 600; color: var(--muted); }
.rv-table tbody th { text-align: left; font-weight: 600; }
.rv-table tr.exp { background: var(--tint); }
.rv-table.calc th { white-space: normal; font-weight: 500; }
.rv-table.calc th small { display: block; font-family: var(--mono); font-size: 11.5px; color: var(--faint); font-weight: 400; margin-top: 3px; }
.rv-table.calc td { font-weight: 600; vertical-align: top; }
.sbar { position: relative; display: flex; justify-content: flex-end; min-width: 120px; }
.sbar i { position: absolute; left: 0; top: 50%; height: 6px; margin-top: -3px; border-radius: 3px; background: var(--champ); opacity: .55; max-width: 55%; }
.sbar.neg i { background: var(--alert); }
.sbar span { position: relative; font-weight: 600; }
.sbar.neg span { color: var(--alert); }

/* Other tools */
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.tool-card.link { color: var(--ink); transition: border-color .15s, box-shadow .15s; }
.tool-card.link:hover { border-color: var(--champ); box-shadow: var(--shadow-hover); color: var(--ink); }
.tool-card .ch-cta { margin-top: 6px; }

/* Modal + toast */
.modal-back { position: fixed; inset: 0; z-index: 60; background: rgba(32,32,32,.45); display: grid; place-items: center; padding: 20px; }
.modal { background: #fff; border-radius: 16px; padding: 32px; max-width: 480px; width: 100%; box-shadow: var(--shadow-drop); display: flex; flex-direction: column; gap: 12px; }
.modal h2 { font-size: 24px; letter-spacing: -.01em; font-weight: 600; }
.modal p { margin: 0; font-size: 15.5px; line-height: 1.6; color: var(--sec); }
.modal p.muted { font-size: 14px; color: var(--muted); }
.modal .btn-row { margin-top: 10px; }
.toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); z-index: 70; background: var(--charcoal); color: var(--linen); padding: 12px 18px; border-radius: 10px; font-size: 14px; box-shadow: var(--shadow-drop); max-width: calc(100% - 40px); }

/* Responsive */
@media (max-width: 1100px) {
  .tool-layout { grid-template-columns: 1fr; }
  .tool-preview { position: static; max-height: none; }
  .rv-layout { grid-template-columns: 1fr; }
  .rv-inputs { position: static; max-height: none; overflow: visible; }
  .res-toolbar { top: 76px; }
}
@media (max-width: 760px) {
  .tool-hero { padding-top: 32px; }
  .tool-layout, .tool-result { padding-top: 24px; }
  .stepper .sl { display: none; }
  .stepper button { padding: 4px; }
  .stepper button.on { padding-right: 12px; }
  .stepper button.on .sl { display: inline; }
  .step-card { padding: 24px 20px; border-radius: 14px; }
  .step-nav .btn { flex: 1; }
  .step-nav > span:empty { display: none; }
  .fld-row { grid-template-columns: 1fr; }
  .chk-grid { grid-template-columns: 1fr 1fr; }
  .res-doc { padding: 24px 18px; border-radius: 14px; }
  .res-toolbar { top: 70px; }
  .res-actions { width: 100%; }
  .res-actions .btn { flex: 1 1 40%; padding: 12px 10px; }
  .g-step { grid-template-columns: 38px 1fr; gap: 10px; }
  .g-num { font-size: 26px; }
  .rv-results { padding: 22px 16px; }
  .metrics { grid-template-columns: 1fr 1fr; }
  .metric.hl { grid-column: 1 / -1; }
  .metric b { font-size: 20px; }
  .grid3 { grid-template-columns: 1fr; }
  .modal { padding: 24px 20px; }
}
@media (max-width: 420px) { .chk-grid { grid-template-columns: 1fr; } }

/* Print: only the result */
@media print {
  @page { margin: 16mm; }
  body { background: #fff; }
  .site-header, .site-footer, .no-print, .tool-others, .modal-back, .toast, .tool-hero, .tool-layout { display: none !important; }
  .tool-result { padding: 0; max-width: none; }
  .res-doc, .rv-results { border: 0; padding: 0; }
  .rv-layout { display: block; }
  .cl-item { min-height: 0; padding: 4px 0; break-inside: avoid; }
  .cl-sec, .rule, .g-step { break-inside: avoid; }
  [contenteditable]:hover, [contenteditable]:focus { background: none; box-shadow: none; }
  .metric.hl { background: #fff; border-color: var(--charcoal); }
  .metric.hl b, .metric.hl span { color: var(--ink); }
  .res-toolbar { position: static; }
}
