.modern-subpage #content.tk-page {
  --tk-ink: #19363a;
  --tk-muted: #415d61;
  --tk-line: #cbdcdb;
  --tk-panel: #fff;
  --tk-soft: #edf6f3;
  --tk-accent: #075d54;
  --tk-danger: #9d272e;
  --tk-primary: #136b61;
  color: var(--tk-ink);
}
.tk-page *, .tk-page *::before, .tk-page *::after { box-sizing: border-box; min-width: 0; }
.tk-page [hidden] { display: none !important; }
.modern-subpage #content.tk-page :is(h1,h2,h3,h4,strong,legend,caption) { color: var(--tk-ink); }
.modern-subpage #content.tk-page h1 { font-size: clamp(24px, 4.5vw, 34px); line-height: 1.35; margin: 10px 0 14px; word-break: keep-all; }
.modern-subpage #content.tk-page h2 { font-size: clamp(20px, 3.7vw, 26px); line-height: 1.45; margin: 0 0 12px; }
.modern-subpage #content.tk-page h3 { font-size: 18px; line-height: 1.5; margin: 18px 0 10px; }
.modern-subpage #content.tk-page p { margin: 10px 0 14px; color: var(--tk-muted); line-height: 1.75; overflow-wrap: anywhere; }
.modern-subpage #content.tk-page .tk-kicker { color: var(--tk-accent); font-size: 13px; font-weight: 700; }
.modern-subpage #content.tk-page .tk-header p:not(.tk-kicker) { font-size: 16px; font-weight: 400; margin: 12px 0; }
.tk-page .tk-panel {
  background: var(--tk-panel); border: 1px solid var(--tk-line); border-radius: 10px; padding: clamp(12px, 2.7vw, 22px); margin: 16px 0 22px;
}
.tk-page fieldset { border: 0; padding: 0; margin: 16px 0; }
.tk-page legend { font-weight: 750; margin: 0 0 7px; padding: 0; }
.tk-page .tk-grid, .tk-page .tk-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 12px 0; }
.tk-page label { display: block; color: var(--tk-ink); font-size: 14px; font-weight: 650; }
.modern-subpage #content.tk-page :is(input[type=text],input[type=date],input[type=month],select,textarea) {
  display: block; width: 100%; min-height: 44px; height: auto; margin-top: 4px; padding: 7px 9px; font: inherit; color: var(--tk-ink);
  background: var(--tk-panel); border: 1px solid var(--tk-line); border-radius: 6px;
}
.modern-subpage #content.tk-page select { appearance: auto; }
.modern-subpage #content.tk-page button {
  display: inline-flex; align-items: center; justify-content: center; min-height: 44px; height: auto; padding: 8px 12px;
  font: inherit; font-size: 14px; font-weight: 750; line-height: 1.45; white-space: normal; color: var(--tk-ink);
  background: var(--tk-panel); border: 1px solid var(--tk-line); border-radius: 7px; box-shadow: none; cursor: pointer;
}
.modern-subpage #content.tk-page button:hover { background: var(--tk-soft); }
.modern-subpage #content.tk-page button.tk-primary { background: var(--tk-primary); color: white; }
.modern-subpage #content.tk-page button:disabled { opacity: .6; cursor: not-allowed; }
.tk-page :is(input,select,textarea,button,summary,a,[tabindex]):focus-visible { outline: 3px solid var(--tk-accent); outline-offset: 3px; }
.tk-page details { border-top: 1px solid var(--tk-line); padding: 7px 0; margin-top: 10px; }
.tk-page summary { color: var(--tk-accent); font-weight: 700; min-height: 40px; padding: 7px 0; cursor: pointer; }
.modern-subpage #content.tk-page .tk-error { color: var(--tk-danger); font-weight: 700; }
.tk-page .tk-error:empty { display: none; }
.tk-page .tk-card { background: var(--tk-soft); border-radius: 8px; padding: 10px; border: 1px solid var(--tk-line); }
.tk-page .tk-card span, .tk-page .tk-card strong { display: block; overflow-wrap: anywhere; }
.tk-page .tk-card strong { font-size: clamp(16px, 3.5vw, 24px); }
.tk-page .tk-entry { border: 1px solid var(--tk-line); border-radius: 8px; padding: 12px; }
.tk-page .tk-entry legend { padding-inline: 6px; }
.tk-page .tk-actions label { align-self: end; }
.tk-page .tk-detail { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); margin: 12px 0; }
.tk-page .tk-detail > * { padding: 6px; margin: 0; border-bottom: 1px solid var(--tk-line); overflow-wrap: anywhere; }
.tk-page .tk-detail dd { text-align: right; }
.tk-page .tk-scroll { max-width: 100%; overflow-x: auto; margin: 12px 0; }
.tk-page table { width: 100%; margin: 0; font-size: 13px; color: var(--tk-ink); border-collapse: collapse; }
.tk-page caption { text-align: left; font-weight: 700; padding-bottom: 6px; }
.tk-page :is(th,td) { padding: 8px; border: 1px solid var(--tk-line); white-space: nowrap; }
.tk-page thead { background: var(--tk-soft); }
.tk-page .tk-chart { display: grid; gap: 5px; margin: 14px 0; }
.tk-page .tk-chart-row { display: grid; grid-template-columns: minmax(3ch, 7ch) minmax(24px, 1fr) minmax(8ch, auto); align-items: center; gap: 8px; padding: 4px; border-radius: 5px; font-size: 13px; }
.tk-page .tk-chart-row span { text-align: right; overflow-wrap: anywhere; }
.tk-page .tk-bar { height: 12px; background: var(--tk-line); border-radius: 10px; overflow: hidden; }
.tk-page .tk-bar::before { display: block; content: ''; width: var(--fill); height: 100%; background: var(--tk-accent); }
.tk-page .tk-header { margin-bottom: 20px; }
.tk-page #tk-result-title { scroll-margin-top: 95px; }
.tk-page .tk-guide li { color: var(--tk-muted); overflow-wrap: anywhere; }
.tk-page .tk-guide h2:not(:first-child) { margin-top: 24px !important; }
.tk-page [aria-invalid=true] { outline: 2px solid var(--tk-danger); }
.modern-subpage #content.tk-page.tk-dark {
  color-scheme: dark; --tk-ink: #ecf6f5; --tk-muted: #c6dedb; --tk-line: #50736e; --tk-panel: #172d30;
  --tk-soft: #223d3d; --tk-accent: #a4ebd6; --tk-danger: #ffbdc1; background: var(--tk-panel);
}
.modern-subpage #content.tk-page.tk-dark a { color: var(--tk-accent); }
@media (max-width: 540px) {
  .tk-page .tk-grid { grid-template-columns: 1fr; }
  .tk-page .tk-actions button { flex: 1 1 auto; }
  .tk-page .tk-actions label { width: 100%; }
}
@media print {
  body:has(.tk-page) :is(.modern-site-header,#sidebar,#copyright,.tk-no-print,.modern-mobile-dock,ins,iframe) { display: none !important; }
  body:has(.tk-page) :is(#main,#main > .row > div,#content,.wrapper,#tk-result,#tk-goal-panel) {
    width: 100% !important; max-width: none !important; margin: 0 !important; padding: 0 !important;
    background: white !important; color: black !important; box-shadow: none !important;
  }
  .modern-subpage #content.tk-page:is(.tk-page, .tk-dark) { --tk-panel: #fff; --tk-ink: #111; --tk-muted: #222; --tk-soft: #f2f2f2; --tk-accent: #123833; }
  .tk-page .tk-scroll { overflow: visible; }
  .tk-page :is(th,td) { white-space: normal; overflow-wrap: anywhere; padding: 2px; font-size: 9px; }
  .tk-page tr, .tk-page .tk-card { break-inside: avoid; }
}
.tk-page .tk-composition { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; margin: 12px 0; }
.tk-page .tk-donut {
  --segments: var(--tk-line); width: 142px; aspect-ratio: 1; flex: 0 0 142px; border-radius: 50%; display: grid; place-items: center;
  background: var(--segments);
}
.tk-page .tk-donut::after { content: ''; width: 62%; aspect-ratio: 1; border-radius: 50%; background: var(--tk-panel); }
.tk-page .tk-legend { padding: 0; margin: 0; list-style: none; }
.tk-page .tk-legend li { overflow-wrap: anywhere; font-size: 14px; color: var(--tk-ink); }
.tk-page .tk-legend li::before { content: ''; display: inline-block; width: .85em; height: .85em; margin-right: 6px; border-radius: 3px; background: var(--swatch); }
.tk-page .tk-line { display: block; width: 100%; max-height: 180px; background: var(--tk-soft); border-radius: 8px; }
.tk-page .tk-line polyline { fill: none; stroke: var(--tk-accent); stroke-width: 2.5; }
.tk-page .tk-line circle { fill: var(--tk-accent); }
.tk-page .tk-history-row { display: flex; gap: 7px; flex-wrap: wrap; align-items: center; margin: 8px 0; }
.tk-page .tk-chart-row { grid-template-columns: minmax(7ch, auto) minmax(24px, 1fr) minmax(7ch, auto); }
.tk-page .tk-chart-row strong { overflow-wrap: anywhere; }
@media print {
  body:has(.tk-page) #tk-goal-panel:has(#tk-goal-result:empty) { display: none !important; }
}
