/* =========================================================
   IFFUN Inflations-Fachtool – Plugin-Stylesheet
   Alle Klassen mit iffun- präfixiert, damit das Theme nicht
   überschrieben wird und umgekehrt. Self-contained.
   ========================================================= */

.iffun-inflation{
  /* Tokens */
  --iffun-bg:        #f6f7f9;
  --iffun-surface:   #ffffff;
  --iffun-surface-2: #f1f3f6;
  --iffun-line:      #e2e6ec;
  --iffun-line-2:    #cdd3dc;
  --iffun-text:      #0e1a2b;
  --iffun-text-2:    #3a4658;
  --iffun-muted:     #6a7383;
  --iffun-primary:   #143a6b;
  --iffun-primary-2: #1f5fa8;
  --iffun-tint:      #e8eef7;
  --iffun-accent:    #b08436;
  --iffun-r-sm: 4px; --iffun-r-md: 8px; --iffun-r-lg: 14px;
  --iffun-shadow: 0 1px 2px rgba(14,26,43,.05);
  --iffun-f-sans: "Inter", -apple-system, "Segoe UI", Roboto, system-ui, sans-serif;
  --iffun-f-serif:"Source Serif 4", Georgia, "Times New Roman", serif;

  font-family: var(--iffun-f-sans);
  color: var(--iffun-text);
  font-size: 16px;
  line-height: 1.55;
  background: var(--iffun-bg);
  border-radius: var(--iffun-r-lg);
  padding: 28px clamp(16px, 3vw, 36px);
  margin: 16px 0;
  -webkit-font-smoothing: antialiased;
}
.iffun-inflation *,
.iffun-inflation *::before,
.iffun-inflation *::after { box-sizing: border-box; }

.iffun-inflation h2,
.iffun-inflation h3,
.iffun-inflation h4,
.iffun-inflation h5{
  font-family: var(--iffun-f-serif);
  color: var(--iffun-text);
  letter-spacing: -.005em;
  margin: 0;
}
.iffun-inflation p{ margin: 0; }
.iffun-inflation small{ font-size: 12.5px; }

/* Eyebrow */
.iffun-eyebrow{
  text-transform: uppercase;
  letter-spacing: .14em;
  font-size: 12px;
  color: var(--iffun-primary-2);
  font-weight: 600;
  margin: 0 0 10px;
}

/* Hero */
.iffun-hero{ padding: 8px 0 24px; border-bottom: 1px solid var(--iffun-line); margin-bottom: 24px; }
.iffun-h1{
  font-family: var(--iffun-f-serif);
  font-size: clamp(26px, 3.4vw, 38px);
  font-weight: 700;
  line-height: 1.15;
  margin: 0 0 14px;
}
.iffun-lead{ color: var(--iffun-text-2); font-size: 17px; max-width: 760px; margin-bottom: 22px; }
.iffun-hero-facts{
  display: grid; grid-template-columns: repeat(4,1fr);
  border-top: 1px solid var(--iffun-line); border-bottom: 1px solid var(--iffun-line);
  margin: 0;
}
.iffun-hero-facts > div{ padding: 14px 16px 14px 0; border-right: 1px solid var(--iffun-line); }
.iffun-hero-facts > div:last-child{ border-right: none; }
.iffun-hero-facts dt{ font-size: 11.5px; color: var(--iffun-muted); text-transform: uppercase; letter-spacing: .1em; margin-bottom: 4px; font-weight: 600; }
.iffun-hero-facts dd{ margin: 0; font-family: var(--iffun-f-serif); font-size: 19px; font-weight: 600; }
@media (max-width: 820px){
  .iffun-hero-facts{ grid-template-columns: repeat(2,1fr); }
  .iffun-hero-facts > div:nth-child(2){ border-right: none; }
}

/* Mode Switch */
.iffun-mode-switch{ display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 0 0 24px; }
.iffun-mode-btn{
  display: flex; align-items: center; gap: 16px;
  padding: 16px 18px;
  background: var(--iffun-surface);
  border: 1px solid var(--iffun-line);
  border-radius: var(--iffun-r-lg);
  text-align: left; cursor: pointer; font: inherit; color: inherit;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.iffun-mode-btn:hover{ border-color: var(--iffun-line-2); box-shadow: var(--iffun-shadow); }
.iffun-mode-btn.is-active{ border-color: var(--iffun-primary); box-shadow: 0 0 0 3px var(--iffun-tint); background: #fff; }
.iffun-mode-num{ font-family: var(--iffun-f-serif); font-size: 26px; color: var(--iffun-primary); font-weight: 700; padding-right: 12px; border-right: 1px solid var(--iffun-line); }
.iffun-mode-text strong{ display: block; font-size: 15.5px; color: var(--iffun-text); }
.iffun-mode-text em{ display: block; font-style: normal; font-size: 12.5px; color: var(--iffun-muted); margin-top: 2px; }
@media (max-width: 720px){ .iffun-mode-switch{ grid-template-columns: 1fr; } }

/* Panels */
.iffun-panel{ background: var(--iffun-surface); border: 1px solid var(--iffun-line); border-radius: var(--iffun-r-lg); padding: 28px clamp(16px, 2.4vw, 30px); margin-bottom: 20px; }
.iffun-panel-hist{ background: var(--iffun-surface); }
.iffun-panel-adv{ background: var(--iffun-surface); }
.iffun-panel-hints{ background: var(--iffun-surface-2); border: 1px solid var(--iffun-line); }
.iffun-panel[hidden]{ display: none; }
.iffun-panel-head{ max-width: 820px; margin-bottom: 24px; }
.iffun-panel-head h3{ font-size: clamp(22px, 2.4vw, 28px); margin: 4px 0 10px; line-height: 1.2; }
.iffun-panel-lead{ color: var(--iffun-text-2); font-size: 16px; }

/* Timeline */
.iffun-timeline{
  list-style: none; padding: 18px 0 6px; margin: 0 0 22px;
  display: grid; grid-template-columns: repeat(4,1fr);
  position: relative;
  border-top: 1px solid var(--iffun-line);
  border-bottom: 1px solid var(--iffun-line);
}
.iffun-timeline::before{
  content: ""; position: absolute; left: 6%; right: 6%; top: 50%; height: 2px;
  background: linear-gradient(90deg, var(--iffun-primary-2), var(--iffun-primary));
  opacity: .35;
}
.iffun-timeline li{ position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; padding: 6px; }
.iffun-dot{ width: 12px; height: 12px; border-radius: 50%; background: #fff; border: 3px solid var(--iffun-primary-2); margin-bottom: 6px; }
.iffun-dot.is-now{ background: var(--iffun-primary); border-color: var(--iffun-primary); }
.iffun-yr{ font-family: var(--iffun-f-serif); font-size: 20px; font-weight: 700; }
.iffun-cap{ font-size: 12px; color: var(--iffun-muted); }
@media (max-width: 640px){ .iffun-timeline{ grid-template-columns: repeat(2,1fr); } .iffun-timeline::before{ display: none; } }

/* Product Grid */
.iffun-product-grid{ display: grid; grid-template-columns: repeat(4,1fr); gap: 12px; margin-bottom: 22px; }
@media (max-width: 1000px){ .iffun-product-grid{ grid-template-columns: repeat(2,1fr); } }
@media (max-width: 560px){ .iffun-product-grid{ grid-template-columns: 1fr; } }
.iffun-product{ background: #fff; border: 1px solid var(--iffun-line); border-radius: var(--iffun-r-md); padding: 16px 16px 12px; display: flex; flex-direction: column; gap: 6px; }
.iffun-product-head{ display: flex; align-items: center; gap: 10px; border-bottom: 1px solid var(--iffun-line); padding-bottom: 8px; margin-bottom: 4px; }
.iffun-product-cat{ width: 8px; height: 8px; border-radius: 50%; background: var(--iffun-primary-2); }
.iffun-product-cat[data-cat="food"]{ background: #2e7a55; }
.iffun-product-cat[data-cat="media"]{ background: #6a4e9a; }
.iffun-product-cat[data-cat="tech"]{ background: var(--iffun-primary-2); }
.iffun-product-cat[data-cat="auto"]{ background: var(--iffun-accent); }
.iffun-product-name{ font-weight: 600; font-size: 14.5px; }
.iffun-product-rows{ display: flex; flex-direction: column; gap: 2px; font-size: 13.5px; }
.iffun-product-row{ display: flex; justify-content: space-between; padding: 3px 0; }
.iffun-product-row .iffun-y{ color: var(--iffun-muted); font-variant-numeric: tabular-nums; }
.iffun-product-row .iffun-p{ font-variant-numeric: tabular-nums; color: var(--iffun-text-2); }
.iffun-product-row.is-now{ margin-top: 4px; border-top: 1px dashed var(--iffun-line); padding-top: 6px; }
.iffun-product-row.is-now .iffun-y{ color: var(--iffun-text); font-weight: 600; }
.iffun-product-row.is-now .iffun-p{ background: var(--iffun-primary); color: #fff; padding: 3px 10px; border-radius: 999px; font-weight: 600; font-size: 12.5px; }
.iffun-product-foot{ font-size: 12px; color: var(--iffun-muted); display: flex; justify-content: space-between; margin-top: 4px; }
.iffun-product-foot strong{ color: var(--iffun-primary); font-weight: 600; }

/* Matrix */
.iffun-matrix-wrap{ background: #fff; border: 1px solid var(--iffun-line); border-radius: var(--iffun-r-md); padding: 0 18px; margin-bottom: 24px; }
.iffun-matrix-wrap > summary{ cursor: pointer; padding: 12px 0; font-weight: 600; color: var(--iffun-primary); list-style: none; display: flex; justify-content: space-between; align-items: center; }
.iffun-matrix-wrap > summary::after{ content: "+"; font-size: 20px; color: var(--iffun-muted); font-weight: 400; }
.iffun-matrix-wrap[open] > summary::after{ content: "–"; }
.iffun-table-scroll{ overflow-x: auto; padding-bottom: 4px; }
.iffun-matrix-table{ width: 100%; border-collapse: collapse; font-size: 13.5px; font-variant-numeric: tabular-nums; }
.iffun-matrix-table th, .iffun-matrix-table td{ text-align: right; padding: 8px 10px; border-bottom: 1px solid var(--iffun-line); }
.iffun-matrix-table th:first-child, .iffun-matrix-table td:first-child{ text-align: left; font-weight: 500; }
.iffun-matrix-table thead th{ font-weight: 600; color: var(--iffun-muted); font-size: 11.5px; letter-spacing: .05em; text-transform: uppercase; border-bottom: 2px solid var(--iffun-line-2); }
.iffun-matrix-table td.iffun-now{ font-weight: 600; color: var(--iffun-primary); }
.iffun-footnote{ font-size: 12px; color: var(--iffun-muted); padding: 8px 0 12px; }

/* Takeaways */
.iffun-takeaways{ border-top: 1px solid var(--iffun-line); padding-top: 24px; }
.iffun-takeaways h4{ font-size: 20px; margin-bottom: 14px; color: var(--iffun-primary); }
.iffun-takeaway-grid{ display: grid; grid-template-columns: repeat(3,1fr); gap: 12px; }
.iffun-takeaway-grid article{ background: #fff; border: 1px solid var(--iffun-line); border-left: 3px solid var(--iffun-primary); border-radius: var(--iffun-r-md); padding: 16px 18px; }
.iffun-takeaway-grid h5{ font-size: 14.5px; margin-bottom: 6px; }
.iffun-takeaway-grid p{ color: var(--iffun-text-2); font-size: 14px; }
@media (max-width: 900px){ .iffun-takeaway-grid{ grid-template-columns: 1fr; } }

/* Advisor */
.iffun-advisor-grid{ display: grid; grid-template-columns: 360px 1fr; gap: 24px; align-items: start; }
@media (max-width: 980px){ .iffun-advisor-grid{ grid-template-columns: 1fr; } }
.iffun-inputs{ background: #fff; border: 1px solid var(--iffun-line); border-radius: var(--iffun-r-md); padding: 4px 20px 16px; }
.iffun-inputs fieldset{ border: none; padding: 0; margin: 0; }
.iffun-inputs legend{ font-weight: 600; color: var(--iffun-primary); font-size: 13px; letter-spacing: .05em; text-transform: uppercase; padding: 12px 0 4px; }
.iffun-field{ display: flex; flex-direction: column; gap: 6px; padding: 10px 0; border-top: 1px solid var(--iffun-line); }
.iffun-field > span{ font-size: 12.5px; color: var(--iffun-text-2); font-weight: 500; }
.iffun-field input[type=number]{ font: inherit; font-size: 15.5px; padding: 9px 12px; border: 1px solid var(--iffun-line-2); border-radius: var(--iffun-r-sm); background: #fff; width: 100%; font-variant-numeric: tabular-nums; color: var(--iffun-text); }
.iffun-field input[type=number]:focus{ outline: 2px solid var(--iffun-primary-2); outline-offset: 1px; border-color: var(--iffun-primary-2); }
.iffun-field-readonly output{ font-family: var(--iffun-f-serif); font-size: 21px; font-weight: 600; color: var(--iffun-primary); }
.iffun-input-suffix{ display: flex; align-items: center; gap: 10px; }
.iffun-input-suffix em{ font-style: normal; color: var(--iffun-muted); font-size: 12.5px; white-space: nowrap; }
.iffun-seg{ display: grid; grid-template-columns: repeat(4,1fr); border: 1px solid var(--iffun-line-2); border-radius: var(--iffun-r-sm); overflow: hidden; }
.iffun-seg input{ position: absolute; opacity: 0; pointer-events: none; }
.iffun-seg label{ text-align: center; padding: 8px 4px; font-size: 12.5px; cursor: pointer; border-right: 1px solid var(--iffun-line); color: var(--iffun-text-2); background: #fff; font-weight: 500; white-space: nowrap; }
.iffun-seg label:last-of-type{ border-right: none; }
.iffun-seg input:checked + label{ background: var(--iffun-primary); color: #fff; }
.iffun-custom-row{ display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.iffun-custom-row[hidden]{ display: none; }
.iffun-custom-row input{ max-width: 120px; }
.iffun-custom-row em{ font-style: normal; color: var(--iffun-muted); font-size: 12.5px; }
.iffun-switch-field{ flex-direction: row; align-items: center; justify-content: space-between; gap: 14px; }
.iffun-switch-field > span:first-child small{ display: block; color: var(--iffun-muted); font-weight: 400; font-size: 12px; margin-top: 2px; }
.iffun-switch{ position: relative; width: 42px; height: 24px; flex-shrink: 0; }
.iffun-switch input{ opacity: 0; width: 0; height: 0; }
.iffun-slider{ position: absolute; inset: 0; background: var(--iffun-line-2); border-radius: 24px; cursor: pointer; transition: .15s; }
.iffun-slider::before{ content: ""; position: absolute; left: 3px; top: 3px; width: 18px; height: 18px; background: #fff; border-radius: 50%; transition: .15s; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.iffun-switch input:checked + .iffun-slider{ background: var(--iffun-primary); }
.iffun-switch input:checked + .iffun-slider::before{ transform: translateX(18px); }
.iffun-form-note{ font-size: 12px; color: var(--iffun-muted); border-top: 1px dashed var(--iffun-line); padding-top: 8px; margin-top: 8px; }

/* Results */
.iffun-results{ display: flex; flex-direction: column; gap: 18px; }
.iffun-kpi-row{ display: grid; grid-template-columns: repeat(4,1fr); gap: 10px; }
@media (max-width: 900px){ .iffun-kpi-row{ grid-template-columns: repeat(2,1fr); } }
.iffun-kpi{ background: #fff; border: 1px solid var(--iffun-line); border-radius: var(--iffun-r-md); padding: 14px 16px; display: flex; flex-direction: column; gap: 4px; }
.iffun-kpi-label{ font-size: 11.5px; color: var(--iffun-muted); text-transform: uppercase; letter-spacing: .06em; font-weight: 600; }
.iffun-kpi-value{ font-family: var(--iffun-f-serif); font-size: 24px; font-weight: 700; color: var(--iffun-primary); font-variant-numeric: tabular-nums; }
.iffun-kpi-sub{ font-size: 12px; color: var(--iffun-muted); }

.iffun-chart-wrap{ margin: 0; background: #fff; border: 1px solid var(--iffun-line); border-radius: var(--iffun-r-md); padding: 16px 18px; }
.iffun-chart-wrap figcaption{ display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; font-size: 13px; color: var(--iffun-text-2); font-weight: 500; margin-bottom: 10px; }
.iffun-legend{ display: flex; gap: 14px; font-size: 12px; color: var(--iffun-muted); font-weight: 400; }
.iffun-lg{ display: inline-block; width: 14px; height: 3px; vertical-align: middle; margin-right: 5px; border-radius: 2px; }
.iffun-lg-nom{ background: var(--iffun-primary); }
.iffun-lg-real{ background: var(--iffun-accent); }
.iffun-chart-wrap canvas{ width: 100%; height: auto; display: block; }

.iffun-milestones{ display: grid; grid-template-columns: repeat(4,1fr); gap: 10px; }
@media (max-width: 900px){ .iffun-milestones{ grid-template-columns: repeat(2,1fr); } }
.iffun-ms{ background: #fff; border: 1px solid var(--iffun-line); border-radius: var(--iffun-r-md); padding: 12px 14px; font-size: 12.5px; }
.iffun-ms-yr{ font-family: var(--iffun-f-serif); font-size: 17px; font-weight: 700; color: var(--iffun-primary); display: block; }
.iffun-ms-val{ display: block; color: var(--iffun-text); font-variant-numeric: tabular-nums; margin-top: 4px; }
.iffun-ms-real{ display: block; color: var(--iffun-muted); font-size: 12px; font-variant-numeric: tabular-nums; }

.iffun-interpret{ background: var(--iffun-tint); border: 1px solid #d6e0f0; border-radius: var(--iffun-r-md); padding: 16px 20px; }
.iffun-interpret h4{ font-size: 17px; margin-bottom: 8px; color: var(--iffun-primary); }
.iffun-interpret ul{ margin: 0; padding-left: 18px; color: var(--iffun-text-2); }
.iffun-interpret li{ margin-bottom: 4px; }

/* Hint Grid */
.iffun-hint-grid{ display: grid; grid-template-columns: repeat(2,1fr); gap: 12px; }
@media (max-width: 780px){ .iffun-hint-grid{ grid-template-columns: 1fr; } }
.iffun-hint-grid article{ background: #fff; border: 1px solid var(--iffun-line); border-radius: var(--iffun-r-md); padding: 18px 20px; }
.iffun-hint-grid h5{ color: var(--iffun-primary); font-size: 14.5px; margin-bottom: 6px; }
.iffun-hint-grid p{ color: var(--iffun-text-2); font-size: 14px; }

/* Credit */
.iffun-credit{
  display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  border-top: 1px solid var(--iffun-line);
  margin-top: 18px; padding-top: 14px;
  font-size: 12px; color: var(--iffun-muted);
}

/* Print */
@media print{
  .iffun-mode-switch{ display: none; }
  .iffun-panel[hidden]{ display: block !important; }
  .iffun-inflation{ background: #fff; }
}
