/* Simulateur de dividendes. Same look as the other pages (navy #0d2b45 / #164d73, Arial);
   dark mode follows the site's html.dark-mode class. */
:root {
  --navy: #0d2b45; --navy-2: #164d73;
  --paper: #ffffff; --soft: #f5f8fb; --ink: #222; --ink-2: #4a5563; --ink-3: #6b7682; --rule: #e0e6ed; --rule-2: #c9d2dc;
  --accent: #164d73; --accent-soft: #e8f4fd; --link: #164d73; --up: #1e9e5a; --down: #d0392b;
  --me: #164d73; --pru: #d68910; --cen: #7f8c8d; --opt: #27ae60; --spend: #f39c12;
  --thead: #0d2b45; --thead-ink: #ffffff; --shadow: 0 2px 8px rgba(0,0,0,.06);
}
.dark-mode {
  --paper: #1e1e1e; --soft: #242424; --ink: #e6e6e6; --ink-2: #c4c4c4; --ink-3: #9a9a9a; --rule: #2f2f2f; --rule-2: #454545;
  --accent: #6cb2ff; --accent-soft: #1d2a36; --link: #6cb2ff; --up: #45c587; --down: #ff7563;
  --me: #6cb2ff; --pru: #f0a54a; --cen: #a7b1ba; --opt: #45c587; --spend: #e0b062;
  --thead: #0f2236; --thead-ink: #e8f4fd; --shadow: 0 2px 10px rgba(0,0,0,.4);
}

.sim { max-width: 1200px; margin: 0 auto; padding: 16px 20px 30px; font-family: Arial, Helvetica, sans-serif; color: var(--ink); line-height: 1.6; font-size: 15px; }
.sim *, .sim *::before, .sim *::after { box-sizing: border-box; }
.sim p, .sim li { font-size: 15px; }
.sim a { color: var(--link); font-weight: 600; text-decoration: none; }
.sim a:hover { text-decoration: underline; }
.sim h1 { color: var(--navy); font-size: 2.1em; margin: 14px 0 10px; line-height: 1.3; border-bottom: 3px solid var(--navy-2); padding-bottom: 12px; font-weight: 700; }
.sim h2 { color: var(--navy); font-size: 1.5em; margin: 36px 0 14px; border-left: 4px solid var(--navy-2); padding-left: 12px; line-height: 1.3; }
.sim h3 { color: var(--navy-2); font-size: 1.2em; margin: 26px 0 10px; }
.dark-mode .sim h1, .dark-mode .sim h2 { border-color: var(--accent); }
.dark-mode .sim h3 { color: #9fd0ff !important; }
.sim .num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.sim .r { text-align: right; }
.sim .up { color: var(--up); } .sim .down { color: var(--down); } .sim .flat { color: var(--ink-3); }
.sim .muted { color: var(--ink-3); }
.sim .note { color: var(--ink-3); font-size: 13.5px; }
.sim .tk { font-size: 12px; font-weight: 700; color: var(--ink-3); display: inline-block; min-width: 3.4em; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Same blocks as the dividend calendar page */
.crumbs { font-size: 13px; color: var(--ink-3); display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.crumbs a { font-weight: 400 !important; }
.article-meta { color: var(--ink-3); font-size: 13px !important; margin: 10px 0 6px; padding: 8px 12px; background: var(--soft); border-left: 3px solid var(--navy-2); display: inline-block; }
.article-intro { background: linear-gradient(135deg, #0d2b45 0%, #164d73 100%); color: #fff; padding: 20px 26px; border-radius: 8px; margin: 18px 0 22px; box-shadow: 0 4px 12px rgba(13,43,69,.15); }
.article-intro p { color: #e8f4fd; font-size: 16px; margin: 6px 0; }
.article-intro strong { color: #fff; }
.highlight-box { background: var(--accent-soft); border-left: 4px solid var(--navy-2); padding: 14px 20px; border-radius: 4px; margin: 18px 0; }
.highlight-box p { margin: 4px 0; }
.calc { margin: 6px 0 2px; padding-left: 20px; }
.calc li { margin: 4px 0; }
.toc { background: var(--paper); border: 1px solid var(--rule); border-radius: 8px; padding: 16px 24px; margin: 34px 0 10px; box-shadow: var(--shadow); }
.sim .toc .toc-t { margin: 0; border: 0; padding: 0 0 8px; font-size: 1.15em; border-bottom: 2px solid var(--rule); }
.toc ol { margin: 10px 0 0 20px; padding: 0; columns: 2 280px; column-gap: 30px; }
.toc li { padding: 3px 0; font-size: 14px; }
.steps { padding-left: 22px; }
.steps li { margin: 8px 0; }
ul.plain { padding-left: 20px; }
ul.plain li { margin: 8px 0; }
.faq details { background: var(--paper); border: 1px solid var(--rule); border-radius: 8px; margin: 8px 0; padding: 0 16px; }
.faq summary { cursor: pointer; font-weight: 700; color: var(--navy); padding: 13px 0; list-style: none; }
.dark-mode .faq summary { color: var(--ink); }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; float: right; color: var(--navy-2); font-weight: 700; }
.faq details[open] summary::after { content: "−"; }
.faq details p { margin: 0 0 14px; }
.related ul { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 8px; }
.related li { background: var(--paper); border: 1px solid var(--rule); border-radius: 6px; }
.related a { display: block; padding: 10px 14px; }

/* Tables (navy header, like the calendar table) */
.tablebox { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 12px 0; }
.sim-table { width: 100%; border-collapse: collapse; font-size: 14px; background: var(--paper); box-shadow: var(--shadow); border-radius: 6px; overflow: hidden; }
.sim-table thead { background: var(--thead); }
.sim-table th { color: var(--thead-ink); padding: 11px 10px; text-align: left; font-weight: 600; font-size: 12.5px; text-transform: uppercase; letter-spacing: .4px; white-space: nowrap; }
.sim-table th.r { text-align: right; }
.sim-table td { padding: 9px 10px; border-bottom: 1px solid var(--rule); }
.sim-table tbody tr:hover td { background: var(--soft); }
.tax-t { max-width: 520px; }

/* Forms and buttons */
.sim label { display: block; font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .4px; color: var(--ink-3); margin: 0 0 5px; }
.sim input[type="number"], .sim input[type="text"], .sim select { width: 100%; background: var(--paper); color: var(--ink); border: 1px solid var(--rule-2); border-radius: 6px; padding: 9px 10px; font: 15px Arial, Helvetica, sans-serif; }
.sim input:focus, .sim select:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: transparent; }
.sim input::placeholder { color: var(--ink-3); opacity: .85; }
.sim .btn { display: inline-flex; align-items: center; gap: 8px; background: var(--navy); color: #fff; border: 1px solid var(--navy); border-radius: 6px; padding: 9px 16px; font: 700 14px Arial, Helvetica, sans-serif; cursor: pointer; }
.sim .btn:hover { background: var(--navy-2); }
.sim .btn.ghost { background: var(--paper); color: var(--navy); border-color: var(--rule-2); }
.dark-mode .sim .btn.ghost { color: var(--ink); }
.sim .btn.ghost:hover { border-color: var(--navy-2); background: var(--soft); }
.sim .btn[disabled] { opacity: .45; cursor: default; }
.sim .btn.small { padding: 6px 12px; font-size: 13px; }
.row-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 14px; }

/* Starting point panel */
.panel { background: var(--paper); border: 1px solid var(--rule); border-radius: 8px; box-shadow: var(--shadow); margin: 0 0 12px; }
.panel-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px 20px; padding: 14px 20px; border-radius: 8px 8px 0 0; }
.panel:not(.folded) .panel-bar { border-bottom: 1px solid var(--rule); }
.panel-title { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; min-width: 0; }
.sim .panel-title h2 { margin: 0; font-size: 1.3em; }
.chips { display: none; margin: 0; flex-wrap: wrap; gap: 6px; }
.folded .chips { display: flex; }
.chips span { font-size: 12.5px; color: var(--ink-2); background: var(--soft); border: 1px solid var(--rule); border-radius: 999px; padding: 4px 10px; white-space: nowrap; }
.fold { flex: none; }
.fold svg { transition: transform .2s; }
.folded .fold svg { transform: rotate(180deg); }
.panel-body { padding: 18px 20px 20px; }
.sim .panel h3 { margin: 0; font-size: 1.05em; }
.sub-h { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 16px; margin: 24px 0 6px; }
.sub-h .note { margin: 0; }
.saves { display: grid; grid-template-columns: minmax(200px, 1.3fr) minmax(160px, 1fr) auto; gap: 10px 12px; align-items: end; background: var(--soft); border: 1px solid var(--rule); border-radius: 8px; padding: 12px; }
.saves-b { display: flex; gap: 8px; }
.save-note { margin: 8px 2px 18px; }
#msg { color: var(--up); font-weight: 700; }
.grp-you { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; max-width: 720px; }
.groups { display: grid; grid-template-columns: repeat(auto-fit, minmax(205px, 1fr)); gap: 14px; margin-top: 22px; }
fieldset.grp { border: 1px solid var(--rule); border-radius: 8px; margin: 0; padding: 12px 14px 14px; display: grid; gap: 12px; align-content: start; min-width: 0; }
fieldset.grp legend { font-weight: 700; font-size: 13.5px; padding: 0 6px; margin-left: -6px; color: var(--navy); }
.dark-mode fieldset.grp legend { color: var(--ink); }
fieldset.grp .note { margin: 0; font-size: 12.5px; }
.grp-me { border-color: var(--me); box-shadow: inset 3px 0 0 var(--me); }
.sim .grp-me legend { color: var(--me); }
.ref-grid { display: grid; grid-template-columns: auto 1fr 1fr; gap: 6px 8px; align-items: center; }
.ref-grid input { min-width: 0; text-align: right; }
.ref-h { font-size: 10.5px; font-weight: 700; text-transform: uppercase; color: var(--ink-3); text-align: right; }
.ref-n { font-weight: 700; font-size: 13px; }
.ref-n.pru { color: var(--pru); } .ref-n.cen { color: var(--cen); } .ref-n.opt { color: var(--opt); }

/* Positions */
.pos-wrap { overflow-x: auto; margin: 0 -20px; padding: 0 20px; -webkit-overflow-scrolling: touch; }
table.pos { width: 100%; min-width: 980px; border-collapse: collapse; font-size: 14px; }
table.pos th { font-size: 10.5px; font-weight: 700; text-transform: uppercase; color: var(--ink-3); vertical-align: bottom; padding: 8px 6px; line-height: 1.25; border-bottom: 2px solid var(--navy-2); text-align: left; }
table.pos th.r { text-align: right; }
table.pos td { padding: 8px 6px 2px; vertical-align: middle; }
table.pos td.sel { min-width: 220px; }
table.pos input[type="number"] { text-align: right; padding: 8px; min-width: 84px; }
table.pos tr.hint td { padding: 2px 6px 10px 0; border-bottom: 1px solid var(--rule); font-size: 12.5px; color: var(--ink-3); }
table.pos tfoot td { border-top: 2px solid var(--navy-2); padding-top: 10px; font-weight: 700; }
table.pos .note-cell, table.pos #tot-yld { font-weight: 400; font-size: 13px; color: var(--ink-3); }
.x { all: unset; cursor: pointer; width: 32px; height: 32px; display: grid; place-items: center; border-radius: 6px; font-size: 20px; color: var(--ink-3); }
.x:hover { background: var(--accent-soft); color: var(--down); }
.x:focus-visible { outline: 2px solid var(--accent); }

/* Results */
.card { background: var(--paper); border: 1px solid var(--rule); border-radius: 8px; cursor: pointer; position: relative; box-shadow: var(--shadow); transition: box-shadow .15s; }
.card:hover { box-shadow: 0 4px 14px rgba(0,0,0,.1); }
.card.on { box-shadow: 0 0 0 2px var(--c), var(--shadow); }
.card:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.card.me { --c: var(--me); } .card.pru { --c: var(--pru); } .card.cen { --c: var(--cen); } .card.opt { --c: var(--opt); }
.card .eyebrow { margin: 0; color: var(--c); font-weight: 700; font-size: 12.5px !important; text-transform: uppercase; letter-spacing: .6px; }
.card .desc { margin: 4px 0 0; font-size: 13px !important; color: var(--ink-3); line-height: 1.4; }
.card dt { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .4px; color: var(--ink-3); }
.card dd { margin: 4px 0 0; font-size: 17px; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }
.card small { font-size: .45em; font-weight: 600; color: var(--ink-3); }
.feat { padding: 20px 22px 6px; border-top: 5px solid var(--me); }
.feat-top { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 12px 30px; }
.feat-hero { text-align: right; }
.feat .big { font-size: clamp(34px, 5.5vw, 52px) !important; font-weight: 700; line-height: 1; margin: 0; color: var(--navy); white-space: normal; }
.dark-mode .feat .big { color: var(--ink); }
.feat .sub { margin: 6px 0 0; font-size: 13px !important; color: var(--ink-3); }
.feat-grid { margin: 16px 0 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); border-top: 1px solid var(--rule); }
.feat-grid div { padding: 12px 12px 14px 0; }
.feat-grid .dd2 { font-size: 12.5px; font-weight: 400; color: var(--ink-3); margin-top: 3px; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 14px; margin: 14px 0 8px; }
.cards .card { padding: 16px 18px 6px; border-top: 4px solid var(--c); }
.cards .mid { font-size: clamp(24px, 2.8vw, 30px) !important; font-weight: 700; line-height: 1.1; margin: 12px 0 2px; color: var(--ink); white-space: normal; }
.cards .cmp { margin: 0 0 10px; font-size: 13px !important; }
.cards dl { margin: 0; display: grid; grid-template-columns: 1fr 1fr; border-top: 1px solid var(--rule); }
.cards dl div { padding: 9px 8px 9px 0; border-bottom: 1px solid var(--rule); display: flex; flex-direction: column; justify-content: space-between; }
.cards dl div:nth-last-child(-n+2) { border-bottom: 0; }

/* Month by month / year by year */
.detail { margin-top: 24px; background: var(--paper); border: 1px solid var(--rule); border-radius: 8px; box-shadow: var(--shadow); overflow: hidden; }
.detail-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; padding: 14px 18px 6px; }
.sim .detail-bar h3 { margin: 0; }
.detail-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.jump select { padding: 6px 10px; font-size: 14px; width: auto; }
.detail-note { margin: 0; padding: 0 18px 10px; }
.scroll { max-height: min(70vh, 640px); overflow: auto; -webkit-overflow-scrolling: touch; }
#detail-t { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 860px; }
#detail-t th { position: sticky; top: 0; z-index: 1; background: var(--thead); color: var(--thead-ink); padding: 10px; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .3px; text-align: left; white-space: nowrap; }
#detail-t th.r { text-align: right; }
#detail-t td { padding: 8px 10px; white-space: nowrap; border-bottom: 1px solid var(--rule); }
#detail-t th:first-child, #detail-t td:first-child { padding-left: 18px; }
#detail-t th:last-child, #detail-t td:last-child { padding-right: 18px; }
#detail-t tr.yr td { background: var(--accent-soft); border-bottom: 1px solid var(--rule-2); }
#detail-t tr.pay td { background: color-mix(in srgb, var(--opt) 8%, transparent); }
#detail-t tr.pay td:nth-child(3) { color: var(--up); font-weight: 700; }
#detail-t td.who { font-size: 12px; font-weight: 700; color: var(--ink-3); }
#detail-t tbody tr:not(.yr):hover td { background: var(--soft); }
#detail-t small { font-size: 11.5px; }

/* Segmented switches */
.seg { display: inline-flex; border: 1px solid var(--rule-2); border-radius: 6px; padding: 3px; gap: 2px; background: var(--paper); }
.seg button { all: unset; cursor: pointer; font: 700 13px Arial, Helvetica, sans-serif; padding: 7px 12px; border-radius: 4px; color: var(--ink-2); }
.seg button[aria-pressed="true"] { background: var(--navy); color: #fff; }
.dark-mode .seg button[aria-pressed="true"] { background: var(--navy-2); }
.seg button:focus-visible { outline: 2px solid var(--accent); }

/* Charts */
.chart-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; margin: 32px 0 8px; }
.sim .chart-head h3 { margin: 0; }
.chart { position: relative; background: var(--paper); border: 1px solid var(--rule); border-radius: 8px; padding: 10px 10px 4px; box-shadow: var(--shadow); }
.chart svg { display: block; width: 100%; height: auto; touch-action: pan-y; }
.chart .grid { stroke: var(--rule); stroke-width: 1; }
.chart .ax { fill: var(--ink-3); font: 11px Arial, sans-serif; }
.chart .ln { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; opacity: .85; }
.chart .ln.sel { stroke-width: 3.4; opacity: 1; }
.chart .ln.me { stroke: var(--me); } .chart .ln.pru { stroke: var(--pru); } .chart .ln.cen { stroke: var(--cen); } .chart .ln.opt { stroke: var(--opt); }
.chart .bar { fill: var(--navy-2); opacity: .9; }
.dark-mode .chart .bar { fill: var(--accent); opacity: .75; }
.chart .spend { fill: var(--spend); }
.chart .tgt { fill: none; stroke: var(--ink); stroke-width: 1.5; stroke-dasharray: 5 4; }
.chart .cursor { stroke: var(--ink-3); stroke-width: 1; stroke-dasharray: 2 3; }
.tip { position: absolute; top: 14px; pointer-events: none; background: var(--paper); border: 1px solid var(--rule-2); border-radius: 6px; padding: 8px 10px; font-size: 13px; line-height: 1.5; box-shadow: var(--shadow); min-width: 190px; }
.tip > b { display: block; margin-bottom: 2px; }
.tip span { display: flex; justify-content: space-between; gap: 14px; color: var(--ink-2); }
.tip span b { color: var(--ink); }
.legend { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 8px 0 0; font-size: 13.5px; color: var(--ink-2); }
.k::before { content: ""; display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; background: var(--c, var(--ink)); }
.k.me { --c: var(--me); } .k.pru { --c: var(--pru); } .k.cen { --c: var(--cen); } .k.opt { --c: var(--opt); } .k.bar { --c: var(--navy-2); } .k.spend { --c: var(--spend); }
.dark-mode .k.bar { --c: var(--accent); }
.k.tgt::before { height: 0; border-top: 2px dashed var(--ink); border-radius: 0; background: none; vertical-align: 3px; }
.tip .k::before { width: 9px; height: 9px; }
.tip .k { justify-content: flex-start; }
.tip .k b { margin-left: auto; }

#hold td { font-size: 14px; }
.figures { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; margin: 6px 0 0; }
.figures div { background: var(--paper); border: 1px solid var(--rule); border-radius: 8px; padding: 12px 14px; }
.figures dt { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .4px; color: var(--ink-3); }
.figures dd { margin: 4px 0 0; font-size: 18px; font-weight: 700; color: var(--navy); font-variant-numeric: tabular-nums; }
.dark-mode .figures dd { color: var(--ink); }

/* Phones: each share becomes a small card of labelled fields. */
@media (max-width: 760px) {
  .sim { padding: 10px 12px 24px; }
  .sim h1 { font-size: 1.6em; }
  .sim h2 { font-size: 1.3em; }
  .pos-wrap { overflow: visible; margin: 0; padding: 0; }
  table.pos { min-width: 0; display: block; }
  table.pos thead { display: none; }
  table.pos tbody, table.pos tfoot { display: block; }
  table.pos tr.prow { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 10px; border-top: 2px solid var(--navy-2); padding-top: 12px; position: relative; }
  table.pos tr.prow td { display: block; padding: 0; text-align: left; }
  table.pos tr.prow td.sel { grid-column: 1 / -1; padding-right: 40px; min-width: 0; }
  table.pos tr.prow td:last-child { position: absolute; top: 12px; right: 0; }
  table.pos tr.prow td[data-l]::before { content: attr(data-l); display: block; font-size: 10.5px; font-weight: 700; text-transform: uppercase; color: var(--ink-3); margin-bottom: 4px; }
  table.pos input[type="number"] { width: 100%; min-width: 0; }
  table.pos tr.hint { display: block; }
  table.pos tr.hint td { display: block; padding: 8px 0 14px; }
  table.pos tfoot tr { display: flex; flex-wrap: wrap; gap: 4px 14px; align-items: baseline; }
  table.pos tfoot td { display: block; padding: 10px 0 0; border: 0; }
  table.pos tfoot td:empty { display: none; }
  .saves { grid-template-columns: 1fr; }
  .feat-hero { text-align: left; }
  .panel-bar { padding: 12px 14px; align-items: flex-start; }
  .panel-body { padding: 14px; }
  .feat { padding: 16px 14px 6px; }
  .card dd { font-size: 15px; }
  .seg button { padding: 6px 9px; font-size: 12.5px; }
  .article-intro { padding: 16px 18px; }
  .toc ol { columns: 1; }
}
@media print {
  .sticker-bar, .menu_header, .main-nav, .row-actions, .seg, .fold, .saves, .save-note, .footer-container, #cb-theme-toggle { display: none !important; }
  .scroll { max-height: none; overflow: visible; }
}
