/* Shared pieces for the v3.2 quick-win calculators (compound interest, inflation, salary to hourly, CD) and the
   simcha gift budget: hero chart on the stage, year table, "How it works" + FAQ. Frame: tool-frame.css + tools/kit.css.
   Ink on paper, one yellow accent (the main line / figure only). */

/* Hero figure sizing */
.qw-figure { font-size: clamp(52px, 6.2vw, 92px); letter-spacing: -0.04em; margin-top: 14px; white-space: nowrap; }
.qw-figure.is-long { font-size: clamp(44px, 4.8vw, 72px); }
.qw-summary { align-self: stretch; display: flex; flex-direction: column; justify-content: center; }
.qw-summary .tf-subs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 760px) { .qw-figure { font-size: clamp(40px, 12vw, 76px); } }

/* Hero chart (stage) */
.qw-chart { margin: clamp(48px, 6vw, 72px) 0 0; padding: clamp(24px, 3vw, 40px); background: var(--stage-2); border: 1px solid var(--hair-stage); border-radius: var(--r-panel); }
.qw-chart-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 24px; margin-bottom: 28px; }
.qw-chart-title { font: 400 clamp(22px, 2vw, 28px)/1.2 var(--font-display); letter-spacing: -0.015em; color: var(--parchment); }
.qw-key { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; font: 400 13px/1.3 var(--font-sans); color: var(--parchment-2); }
.qw-key i { display: inline-block; width: 14px; height: 14px; border-radius: 3px; vertical-align: -2px; margin-right: 6px; }
.qw-key .qw-k-a { background: rgba(236, 230, 216, .78); }
.qw-key .qw-k-b { background: repeating-linear-gradient(135deg, rgba(236, 230, 216, .75) 0 2px, rgba(236, 230, 216, .1) 2px 6px); }
.qw-key .qw-k-y { background: var(--kesef); }
.qw-key .qw-k-line { height: 0; border-top: 2px dashed rgba(236, 230, 216, .6); border-radius: 0; }
.qw-plot { position: relative; height: 300px; }
.qw-svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.qw-grid { stroke: var(--hair-stage); stroke-width: 1; vector-effect: non-scaling-stroke; }
.qw-axis { position: relative; height: 22px; margin-top: 10px; }
.qw-axis span { position: absolute; top: 0; transform: translateX(-50%); font: 400 12px/1 var(--font-mono); color: var(--parchment-2); white-space: nowrap; }
.qw-axis span:first-child { transform: none; }
.qw-axis span:last-child { transform: translateX(-100%); }
.qw-chart-note { margin: 18px 0 0; font: 400 13.5px/1.5 var(--font-sans); color: var(--parchment-2); max-width: 60em; }
@media (max-width: 760px) { .qw-chart { padding: 20px; } .qw-plot { height: 220px; } }

/* Stacked bars on the stage (one per year or per item) */
.qw-bars { position: absolute; inset: 0; display: flex; align-items: flex-end; gap: 3px; }
.qw-bar { flex: 1 1 0; display: flex; flex-direction: column-reverse; min-width: 0; height: 100%; }
.qw-bar span { display: block; width: 100%; }
.qw-bar .qw-a { background: rgba(236, 230, 216, .78); border-radius: 0 0 2px 2px; }
.qw-bar .qw-b { background: repeating-linear-gradient(135deg, rgba(236, 230, 216, .75) 0 2px, rgba(236, 230, 216, .1) 2px 6px); }
.qw-bar .qw-y { background: var(--kesef); border-radius: 3px 3px 0 0; }
@media (prefers-reduced-motion: no-preference) { .qw-bar span { transition: height .5s var(--ease); } }

/* Year-by-year table */
.qw-table-panel { margin-top: 24px; }
.qw-table-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 16px; }
.qw-table-wrap { margin-top: 16px; max-height: 420px; overflow: auto; border-top: 1px solid var(--hair); -webkit-overflow-scrolling: touch; }
.qw-table { width: 100%; border-collapse: collapse; font: 400 14.5px/1.3 var(--font-sans); font-variant-numeric: tabular-nums; }
.qw-table th, .qw-table td { padding: 11px 10px; border-bottom: 1px solid var(--hair); text-align: right; white-space: nowrap; }
.qw-table th:first-child, .qw-table td:first-child { text-align: left; padding-left: 0; }
.qw-table thead th { position: sticky; top: 0; background: var(--paper-2); font: 500 13px/1.3 var(--font-sans); color: var(--ink-2); z-index: 1; }
.qw-table tbody tr:last-child td { font-weight: 500; }
.qw-table .is-mark td { background: var(--paper-3); font-weight: 600; }

/* Status line under actions */
.qw-status:empty { display: none; }
.qw-status { margin-top: 12px; }
.qw-sources a, .ks-disclaimer a { color: var(--ink); text-underline-offset: 3px; }

/* How it works + FAQ (paper, below the work area) */
.qw-learn { background: var(--paper); padding: 0 0 clamp(72px, 9vw, 112px); }
.qw-learn-title { margin: 0 0 clamp(28px, 3.5vw, 48px); padding-top: clamp(56px, 7vw, 96px); border-top: 1px solid var(--hair); }
.qw-howto { display: grid; gap: 32px; }
@media (min-width: 900px) { .qw-howto { grid-template-columns: repeat(3, 1fr); gap: 48px; } }
.qw-howto h3 { margin: 0 0 12px; }
.qw-howto p { margin: 0 0 10px; font: 400 16px/1.6 var(--font-sans); color: var(--ink-2); max-width: 34em; }
.qw-howto p strong { color: var(--ink); font-weight: 500; }
.qw-formula { display: block; margin: 12px 0; padding: 14px 16px; border-radius: var(--r-chip); background: var(--paper-2); border: 1px solid var(--hair); font: 400 14px/1.5 var(--font-mono); color: var(--ink); overflow-x: auto; white-space: nowrap; }
.qw-faq { margin-top: clamp(48px, 6vw, 80px); max-width: 860px; }
.qw-faq-title { margin: 0 0 16px; }
.qw-faq details { border-bottom: 1px solid var(--hair); }
.qw-faq details:first-of-type { border-top: 1px solid var(--hair); }
.qw-faq summary { list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 64px; padding: 14px 0; cursor: pointer;
  font: 400 clamp(19px, 1.6vw, 22px)/1.3 var(--font-display); color: var(--ink); }
.qw-faq summary::-webkit-details-marker { display: none; }
.qw-faq summary::after { content: ""; width: 12px; height: 12px; flex: none; opacity: .7; transition: transform .35s var(--ease-out);
  background: linear-gradient(currentColor, currentColor) center / 12px 1.5px no-repeat, linear-gradient(currentColor, currentColor) center / 1.5px 12px no-repeat; }
.qw-faq details[open] summary::after { transform: rotate(45deg); }
.qw-faq details > div { padding: 0 0 20px; }
.qw-faq details p { margin: 0 0 10px; font: 400 16px/1.65 var(--font-sans); color: var(--ink-2); max-width: 40em; }
@media (prefers-reduced-motion: reduce) { .qw-faq summary::after, .kc-more > summary::after { transition: none; } }

/* Selects inside the work area (same arrow as the other v3 tools) */
.tf-work select { width: 100%; padding: 0 40px 0 14px; appearance: none; -webkit-appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2312110E' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; background-size: 16px; }
.tf-work .ks-seg button { min-height: 44px; }
.qw-check { display: flex; gap: 12px; align-items: flex-start; margin-top: 20px; font: 400 15px/1.45 var(--font-sans); color: var(--ink); cursor: pointer; }
.qw-check input { width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--ink); flex: none; }
.qw-check small { display: block; margin-top: 2px; font-size: 13px; color: var(--ink-2); }
[hidden] { display: none !important; }

@media print {
  #site-header, footer, .tf-related, .tk-guide, .qw-learn, .tf-actions, .ks-reassure, .tk-actions, .kc-verdict__save, .kc-verdict__next, .tk-stack { display: none !important; }
  .tf-hero { padding: 24px 0 !important; }
  .tf-work { padding: 0 !important; }
  .tk-grid { display: block !important; }
  .qw-table-wrap { max-height: none; overflow: visible; }
  body { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
