/* Year-ahead planner (tools/year-ahead.html). Frame: tool-frame.css + tools/kit.css + core.css. */

.ya-summary { align-self: stretch; display: flex; flex-direction: column; justify-content: center; }
.ya-summary-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; }
.ya-view button { min-height: 40px; padding: 0 14px; font-size: 13.5px; }
.ya-view[hidden] { display: none; }
.ya-figure { font-size: clamp(64px, 8vw, 112px); letter-spacing: -0.04em; margin-top: 14px; }
.ya-subs { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.ya-subs .tf-sub { font-size: 21px; }
@media (max-width: 760px) { .ya-figure { font-size: clamp(56px, 18vw, 96px); } .ya-subs { grid-template-columns: 1fr 1fr; } }
#ya-pay-note:empty { display: none; }

/* ---------- The calendar strip (hero visual) ---------- */
.ya-cal { 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); }
.ya-cal-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 12px 24px; margin-bottom: 28px; }
.ya-cal-title { font: 400 clamp(22px, 2vw, 28px)/1.2 var(--font-display); letter-spacing: -0.015em; color: var(--parchment); }
.ya-cal-key { display: flex; flex-wrap: wrap; gap: 6px 18px; font: 400 13px/1.3 var(--font-sans); color: var(--parchment-2); }
.ya-cal-key > span { display: inline-flex; align-items: center; gap: 8px; }
.ya-key { display: inline-block; width: 14px; height: 10px; border-radius: 2px; }
.ya-key--due { background: rgba(236, 230, 216, .78); }
.ya-key--line { height: 0; border-top: 2px dashed var(--kesef); border-radius: 0; }
.ya-key--fund { height: 0; border-top: 1.5px solid var(--parchment); border-radius: 0; }

.ya-strip { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 0 10px; }
.ya-mo { position: relative; display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto auto 220px auto auto auto auto; align-content: start; min-width: 0; padding: 10px 6px 12px; border-radius: 12px; transition: background .3s var(--ease); }
.ya-mo.is-tight { background: rgba(236, 230, 216, .055); box-shadow: inset 0 0 0 1px rgba(236, 230, 216, .16); }
.ya-mo-head { display: flex; align-items: baseline; justify-content: space-between; gap: 4px; margin: 0; }
.ya-mo-name { font: 400 22px/1 var(--font-display); letter-spacing: -0.01em; color: var(--parchment); }
.ya-mo-year { font: 400 11px/1 var(--font-mono); color: var(--parchment-3); }
.ya-mo-amt { margin: 8px 0 10px; font: 400 15px/1 var(--font-sans); font-variant-numeric: tabular-nums; color: var(--parchment); letter-spacing: -0.01em; white-space: nowrap; }
.ya-mo.is-empty .ya-mo-amt { color: var(--parchment-3); }
.ya-mo-col { position: relative; display: flex; align-items: flex-end; border-bottom: 1px solid var(--hair-stage); }
.ya-mo-bar { width: 100%; height: calc(var(--h) * 100%); min-height: 0; display: flex; flex-direction: column-reverse; gap: 2px; border-radius: 6px 6px 2px 2px; overflow: hidden; }
.ya-seg { --a: .8; position: relative; min-height: 2px; background: rgba(236, 230, 216, var(--a)); display: flex; align-items: flex-end; overflow: hidden; }
.ya-seg-l { display: block; padding: 0 6px 6px; font: 500 11.5px/1.15 var(--font-sans); color: var(--stage); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ya-mo-line { position: absolute; left: -6px; right: -6px; bottom: calc(var(--s) * 100%); height: 0; border-top: 2px dashed var(--kesef); pointer-events: none; }
.ya-mo-chag { display: flex; flex-direction: column; gap: 3px; min-height: 18px; margin: 10px 0 0; }
.ya-mo-chag i { font: italic 400 13.5px/1.15 var(--font-display); color: var(--parchment); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ya-mo-names { margin: 10px 0 0; font: 400 11.5px/1.35 var(--font-sans); color: var(--parchment-3); overflow-wrap: anywhere; }
.ya-mo-fund { margin: 8px 0 0; font: 400 12px/1.3 var(--font-sans); font-variant-numeric: tabular-nums; color: var(--parchment-2); white-space: nowrap; }
.ya-mo-fund span { display: block; font-size: 11px; color: var(--parchment-3); }
.ya-mo-pay { display: flex; gap: 3px; margin: 8px 0 0; min-height: 5px; }
.ya-mo-pay b { width: 5px; height: 5px; border-radius: 50%; background: var(--parchment-2); }
.ya-mo-flag { position: absolute; top: -12px; left: 50%; transform: translateX(-50%); margin: 0; padding: 3px 9px; border-radius: var(--r-pill); background: var(--parchment); color: var(--stage); font: 500 11px/1.2 var(--font-sans); white-space: nowrap; }
.ya-mo.is-short .ya-mo-fund { color: var(--parchment); }

.ya-fund { position: relative; height: 56px; margin: 14px 0 34px; }
.ya-fund svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.ya-fund-path { fill: none; stroke: var(--parchment); stroke-width: 1.5; vector-effect: non-scaling-stroke; stroke-linejoin: round; }
.ya-fund-area { fill: rgba(236, 230, 216, .07); stroke: none; }
.ya-fund-zero { stroke: var(--hair-stage); stroke-width: 1; vector-effect: non-scaling-stroke; }
.ya-fund-dot { position: absolute; width: 9px; height: 9px; margin: -4.5px 0 0 -4.5px; border-radius: 50%; background: var(--stage-2); box-shadow: 0 0 0 1.5px var(--parchment); }
.ya-fund-dot[hidden] { display: none; }
.ya-fund-label { position: absolute; left: 0; top: calc(100% + 10px); font: 400 12px/1.3 var(--font-sans); color: var(--parchment-3); }
.ya-cal-note { margin: 18px 0 0; font: 400 13.5px/1.5 var(--font-sans); color: var(--parchment-2); max-width: 60em; }

@media (prefers-reduced-motion: no-preference) {
  .ya-mo-bar { transition: height .55s var(--ease); }
  .ya-seg { transition: flex-grow .55s var(--ease); }
  .ya-mo-line { transition: bottom .55s var(--ease); }
}

@media (max-width: 1100px) and (min-width: 761px) {
  .ya-strip { gap: 0 4px; }
  .ya-mo { padding: 10px 3px 12px; }
  .ya-mo-name { font-size: 18px; }
  .ya-mo-amt { font-size: 13px; }
  .ya-seg-l { display: none; }
  .ya-mo-names { display: none; }
}

/* Phones: a clean month list. Bars run sideways. */
@media (max-width: 760px) {
  .ya-cal { padding: 20px 16px; }
  .ya-strip { grid-template-columns: 1fr; gap: 0; }
  .ya-mo { grid-template-columns: 52px minmax(0, 1fr) auto; grid-template-rows: auto auto auto; column-gap: 12px; row-gap: 6px; align-items: center; padding: 14px 10px; border-radius: 10px; border-bottom: 1px solid var(--hair-stage); }
  .ya-mo.is-tight { border-bottom-color: transparent; }
  .ya-mo-head { grid-column: 1; grid-row: 1 / span 2; flex-direction: column; align-items: flex-start; gap: 4px; }
  .ya-mo-name { font-size: 20px; }
  .ya-mo-amt { grid-column: 3; grid-row: 1; margin: 0; font-size: 16px; text-align: right; }
  .ya-mo-col { grid-column: 2; grid-row: 1; height: 14px; border-bottom: 0; background: rgba(236, 230, 216, .06); border-radius: 4px; align-items: stretch; }
  .ya-mo-bar { height: 100%; width: calc(var(--h) * 100%); flex-direction: row; border-radius: 4px; }
  .ya-seg { min-height: 0; min-width: 2px; }
  .ya-seg-l { display: none; }
  .ya-mo-line { left: calc(var(--s) * 100%); right: auto; top: -4px; bottom: -4px; height: auto; border-top: 0; border-left: 2px dashed var(--kesef); }
  .ya-mo-chag { grid-column: 2 / span 2; grid-row: 2; flex-direction: row; flex-wrap: wrap; gap: 2px 10px; min-height: 0; margin: 0; }
  .ya-mo-chag:empty { display: none; }
  .ya-mo-names { grid-column: 2; grid-row: 3; margin: 0; font-size: 12.5px; }
  .ya-mo-fund { grid-column: 3; grid-row: 3; margin: 0; text-align: right; font-size: 12.5px; }
  .ya-mo-fund span { display: inline; }
  .ya-mo-pay { grid-column: 1; grid-row: 3; margin: 0; }
  .ya-mo-flag { position: static; transform: none; grid-column: 1 / -1; grid-row: 4; justify-self: start; }
  .ya-fund { display: none; }
}

/* ---------- Work area ---------- */
#ya-regular-note a, .ya-sources a, .tk-field small a { color: var(--ink); text-underline-offset: 3px; }
.ya-fine-hint { margin-top: 16px; line-height: 1.55; }
.ya-intro { margin: -12px 0 8px; font: 400 15px/1.6 var(--font-sans); color: var(--ink-2); max-width: 40em; }
.ya-group { margin-top: 28px; }
.ya-group-t { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 0 0 4px; padding-bottom: 10px; border-bottom: 1px solid var(--hair-strong); font: 400 21px/1.2 var(--font-display); letter-spacing: -0.01em; color: var(--ink); }
.ya-group-sum { font: 400 13.5px/1 var(--font-sans); font-variant-numeric: tabular-nums; color: var(--ink-2); }
.ya-list { list-style: none; margin: 0; padding: 0; }
.ya-row { padding: 12px 0; border-bottom: 1px solid var(--hair); }
.ya-row-main { display: grid; grid-template-columns: minmax(0, 1fr) 168px 168px 44px; gap: 8px; align-items: center; }
.tf-work input.ya-row-name:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]) { min-height: 44px; border-color: transparent; border-bottom: 1px dashed var(--hair-strong); border-radius: 0; background: transparent; padding: 0 2px; font: 500 15.5px/1.2 var(--font-sans); color: var(--ink); width: 100%; }
.tf-work input.ya-row-name:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]):hover { border-bottom-color: var(--ink); }
.tf-work input.ya-row-name:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]):focus { border-color: var(--ink); border-radius: var(--r-chip); box-shadow: 0 0 0 3px var(--kesef-soft); }
.tf-work .ya-row-amt input:not([type="checkbox"]) { font-size: 16px; padding-right: 4px; }
.ya-row-amt span:last-child { font-size: 13px; padding-right: 10px; }
.ya-row-amt { min-height: 44px; }
.ya-when { position: relative; }
.ya-when > summary { list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 44px; padding: 0 12px; border: 1px solid var(--hair-strong); border-radius: var(--r-chip); background: var(--paper-2); cursor: pointer; font: 400 14px/1.2 var(--font-sans); color: var(--ink); }
.ya-when > summary::-webkit-details-marker { display: none; }
.ya-when > summary::after { content: ""; width: 7px; height: 7px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(45deg) translateY(-2px); opacity: .6; flex: none; }
.ya-when[open] > summary { border-color: var(--ink); }
.ya-when-t { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.ya-when-pop { position: absolute; z-index: 6; right: 0; top: calc(100% + 6px); width: 340px; padding: 16px; border-radius: var(--r-panel); background: var(--paper-2); border: 1px solid var(--hair-strong); box-shadow: 0 20px 50px -18px rgba(18, 17, 14, .35); }
.ya-sched-l { display: block; margin-bottom: 8px; }
.tf-work .ya-sched { width: 100%; margin-bottom: 14px; padding: 0 12px; }
.ya-mchips { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; }
.tf-work .ya-mchip { display: grid; place-items: center; align-content: center; gap: 2px; min-height: 48px; padding: 0; border: 1px solid var(--hair-strong); border-radius: var(--r-chip); background: var(--paper-2); color: var(--ink); font: 500 14px/1 var(--font-sans); cursor: pointer; }
.ya-mchip small { font: 400 10px/1 var(--font-mono); color: var(--ink-3); }
.tf-work .ya-mchip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--paper-2); }
.ya-mchip[aria-pressed="true"] small { color: rgba(251, 250, 246, .7); }
.ya-mchip:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.ya-when-help { margin: 12px 0 0; font: 400 12.5px/1.45 var(--font-sans); color: var(--ink-2); }
.ya-row-x { width: 44px; height: 44px; display: grid; place-items: center; border: 0; border-radius: var(--r-pill); background: none; color: var(--ink-2); cursor: pointer; }
.ya-row-x svg { width: 14px; height: 14px; }
.ya-row-x:hover { background: var(--paper-3); color: var(--ink); }
.ya-row-sub { display: flex; flex-wrap: wrap; gap: 2px 14px; margin: 4px 0 0; font: 400 13px/1.45 var(--font-sans); color: var(--ink-2); }
.ya-row-split { font-variant-numeric: tabular-nums; color: var(--ink); }
.ya-row.is-zero .ya-row-split { color: var(--ink-3); }
.ya-row.is-zero .ya-row-name { color: var(--ink-2); }
.ya-row-link { color: var(--ink); text-underline-offset: 3px; }
.ya-add { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; margin-top: 6px; padding: 0 2px; border: 0; background: none; font: 500 14px/1 var(--font-sans); color: var(--ink); cursor: pointer; }
.ya-add svg { width: 14px; height: 14px; }
.ya-add:hover { text-decoration: underline; text-underline-offset: 4px; }
@media (max-width: 1180px) and (min-width: 1024px) { .ya-row-main { grid-template-columns: minmax(0, 1fr) 140px 140px 44px; } }
@media (max-width: 600px) {
  .ya-row-main { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 44px; row-gap: 6px; }
  .tf-work input.ya-row-name:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]) { grid-column: 1 / span 2; }
  .ya-row-amt span:last-child { display: none; }
  .tf-work .ya-row-amt input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]) { padding-right: 10px; }
  .ya-row-x { grid-column: 3; grid-row: 1; }
  .ya-row-amt { grid-column: 1; grid-row: 2; }
  .ya-when { grid-column: 2 / span 2; grid-row: 2; }
  .ya-when-pop { width: min(340px, calc(100vw - 48px)); }
}

.ya-status:empty { display: none; }
.ya-status { margin-top: 12px; }

/* ---------- Month by month ---------- */
.ya-fc { margin-top: 32px; }
.ya-fc-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 32px; margin-bottom: 20px; }
.ya-fc-sub { margin: 0; font: 400 14px/1.5 var(--font-sans); color: var(--ink-2); max-width: 44em; }
.ya-fc-table { width: 100%; border-collapse: collapse; font: 400 15px/1.3 var(--font-sans); }
.ya-fc-table th, .ya-fc-table td { padding: 12px 10px; text-align: right; border-bottom: 1px solid var(--hair); vertical-align: top; font-variant-numeric: tabular-nums; }
.ya-fc-table thead th { font: 500 12.5px/1.3 var(--font-sans); color: var(--ink-2); border-bottom-color: var(--hair-strong); }
.ya-fc-table th:first-child, .ya-fc-table td:first-child { text-align: left; padding-left: 0; }
.ya-fc-table tbody th { font: 400 16px/1.3 var(--font-display); color: var(--ink); white-space: nowrap; }
.ya-fc-table td small { display: block; margin-top: 3px; font-size: 12px; color: var(--ink-2); }
.ya-fc-table tr.is-tight { background: var(--paper); }
.ya-flag { display: block; width: fit-content; margin-top: 4px; padding: 2px 8px; border-radius: var(--r-pill); background: var(--ink); color: var(--paper-2); font: 500 11.5px/1.4 var(--font-sans); }
.ya-flag--short { background: var(--down); }
.ya-fc-table .tk-neg { color: var(--down); }
@media (max-width: 900px) {
  .ya-fc-table thead { display: none; }
  .ya-fc-table, .ya-fc-table tbody, .ya-fc-table tr { display: block; }
  .ya-fc-table tr { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; padding: 14px 0; border-bottom: 1px solid var(--hair); }
  .ya-fc-table tr.is-tight { padding: 14px 12px; margin: 0 -12px; border-radius: 10px; }
  .ya-fc-table th, .ya-fc-table td { border: 0; padding: 4px 0; text-align: left; }
  .ya-fc-table tbody th { grid-column: 1 / -1; font-size: 19px; padding-bottom: 6px; display: flex; align-items: center; gap: 10px; }
  .ya-fc-table tbody th .ya-flag { margin-top: 0; }
  .ya-fc-table td::before { content: attr(data-l); display: block; font: 400 12px/1.3 var(--font-sans); color: var(--ink-2); margin-bottom: 2px; }
}
[hidden] { display: none !important; }

@media print {
  #site-header, footer, .tf-related, .tk-guide, .tf-actions, .ks-reassure, .tk-actions, .ya-view, .kc-verdict__save, .kc-verdict__next, .ya-add, .ya-row-x, .kc-more, [data-kc-banner] { display: none !important; }
  .tf-hero { padding: 24px 0 !important; }
  .tf-work { padding: 0 !important; }
  .tk-grid { display: block !important; }
  .ya-when-pop { display: none !important; }
  body { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
