.tk-page {
  --tk-line: #d9dfd6;
  --tk-panel: #fff;
  --tk-soft: #f4f7f1;
  --tk-muted: #526151;
  --tk-strong: #182519;
  --tk-accent: #cafa7b;
  --tk-accent-deep: #365222;
  color: var(--tk-strong);
}
[data-theme='dark'] .tk-page {
  --tk-line: #344238;
  --tk-panel: #181e1a;
  --tk-soft: #222d23;
  --tk-muted: #afbdaf;
  --tk-strong: #eef4ed;
  --tk-accent-deep: #cefa85;
}
.tk-page h1,
.tk-page h2,
.tk-page h3,
.tk-page dl,
.tk-page dd,
.tk-page fieldset {
  margin: 0;
}
.tk-header {
  max-width: 56rem;
  margin: 0 0 2.1rem;
}
.tk-header h1 {
  font-size: clamp(2.3rem, 5vw, 4rem);
  font-weight: 650;
  letter-spacing: -0.065em;
  line-height: 1.02;
  text-wrap: balance;
}
.tk-header p {
  font-size: clamp(1.02rem, 2vw, 1.2rem);
  max-width: 48rem;
  margin: 1rem 0 0;
  line-height: 1.6;
  color: var(--tk-muted);
}
.tk-back {
  display: inline-block;
  margin-bottom: 1rem;
  color: var(--tk-muted);
  font-size: 0.94rem;
  text-decoration: underline;
  text-underline-offset: 0.22em;
}
.tk-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 18.5rem), 1fr));
  gap: 1rem;
}
.tk-page h2 {
  font-weight: 650;
  letter-spacing: -0.035em;
  line-height: 1.2;
  font-size: 1.4rem;
}
.tk-tile,
.tk-directory-card,
.tk-panel,
.tk-results {
  background: var(--tk-panel);
  border: 1px solid var(--tk-line);
  border-radius: 1rem;
  padding: clamp(1.2rem, 2.5vw, 1.65rem);
  min-width: 0;
}
.tk-tile {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  color: inherit;
  text-decoration: none;
  min-height: 13rem;
  transition:
    border-color 0.15s ease,
    transform 0.15s ease;
}
.tk-tile:hover,
.tk-tile:focus-visible {
  border-color: var(--tk-accent-deep);
  transform: translateY(-2px);
}
.tk-tile-top,
.tk-directory-cap {
  width: 100%;
  display: flex;
  gap: 1rem;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.7rem;
}
.tk-symbol {
  width: 2.8rem;
  height: 2.8rem;
  border: 1px solid var(--tk-line);
  border-radius: 0.7rem;
  background: var(--tk-soft);
  color: var(--tk-accent-deep);
  display: grid;
  place-items: center;
}
.tk-meta,
.tk-count,
.tk-directory-cap small,
.tk-note,
.tk-plan-detail {
  font-size: 0.88rem;
  color: var(--tk-muted);
}
.tk-tile p,
.tk-directory-card p,
.tk-workflow p,
.tk-method p {
  line-height: 1.55;
  color: var(--tk-muted);
  margin: 0.6rem 0 0;
}
.tk-tag {
  color: var(--tk-accent-deep);
  font-size: 0.82rem;
  font-weight: 600;
  background: var(--tk-soft);
  padding: 0.3rem 0.65rem;
  border-radius: 0.45rem;
}
.tk-directory-card {
  display: flex;
  flex-direction: column;
}
.tk-directory-card h2 {
  font-size: 1.65rem;
}
.tk-facts {
  margin: 1.1rem 0 !important;
  padding-top: 0.7rem;
  border-top: 1px solid var(--tk-line);
}
.tk-facts > div {
  display: grid;
  grid-template-columns: 3.4rem 1fr;
  gap: 0.5rem;
  padding: 0.33rem 0;
  line-height: 1.4;
  font-size: 0.93rem;
}
.tk-facts dt {
  color: var(--tk-muted);
}
.tk-links {
  margin-top: auto;
  display: flex;
  gap: 0.6rem 1.15rem;
  flex-wrap: wrap;
}
.tk-source {
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, currentColor 40%, transparent);
  text-underline-offset: 0.24em;
  color: var(--tk-accent-deep);
}
.tk-source:hover,
.tk-source:focus-visible {
  text-decoration-color: currentColor;
}
.tk-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  align-items: flex-end;
}
.tk-filters > .tk-field:first-child {
  width: min(100%, 24rem);
}
.tk-filters select {
  min-width: 12rem;
}
.tk-count {
  margin: 1.25rem 0 0.65rem;
}
.tk-page .tk-submit {
  background: #243524;
  color: #f5ffef;
  border: 1px solid #293a27;
  border-radius: 0.5rem;
  padding: 0.66rem 1.15rem;
  font: inherit;
  font-weight: 650;
  min-height: 2.75rem;
  cursor: pointer;
}
[data-theme='dark'] .tk-page .tk-submit {
  background: var(--tk-accent);
  color: #182519;
}
.tk-page .tk-submit:hover {
  filter: brightness(1.1);
}
.tk-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}
.tk-field {
  display: flex;
  flex-direction: column;
  gap: 0.43rem;
  min-width: 0;
  color: var(--tk-strong);
  font-weight: 550;
  font-size: 0.94rem;
}
.tk-field select,
.tk-field input {
  min-width: 0;
  max-width: 100%;
  width: 100%;
  min-height: 2.75rem;
  font: inherit;
  font-weight: 400;
  color: inherit;
  background-color: var(--tk-panel);
  border: 1px solid var(--tk-line);
  border-radius: 0.5rem;
  padding: 0.55rem 0.7rem;
  box-sizing: border-box;
}
.tk-field select {
  padding-right: 2rem;
  text-overflow: ellipsis;
}
.tk-field .tk-input {
  display: flex;
  align-items: center;
  border: 1px solid var(--tk-line);
  border-radius: 0.5rem;
  background: var(--tk-panel);
}
.tk-input:focus-within {
  outline: 2px solid var(--tk-accent-deep);
  outline-offset: 2px;
}
.tk-field .tk-input input {
  border: 0;
  outline: none;
  background: transparent;
  font-variant-numeric: tabular-nums;
}
.tk-input small {
  font-size: 0.82rem;
  padding-right: 0.7rem;
  color: var(--tk-muted);
}
.tk-field input[aria-invalid='true'] {
  outline: 1px solid #b55c3d;
}
.tk-span {
  grid-column: 1/-1;
}
.tk-calculator,
.tk-advisor {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
  gap: 1.2rem;
  align-items: start;
}
.tk-panel > h2,
.tk-priorities {
  margin-bottom: 1.4rem;
}
.tk-results {
  background: var(--tk-soft);
}
.tk-result-header {
  display: flex;
  gap: 0.65rem;
  align-items: center;
}
.tk-result-header h2 {
  font-size: 1.1rem;
}
.tk-result {
  padding: 1rem 0;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  border-bottom: 1px solid var(--tk-line);
  font-size: 0.95rem;
}
.tk-result dt {
  color: var(--tk-muted);
}
.tk-result dd {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}
.tk-primary-result {
  flex-direction: column;
  align-items: flex-start;
  gap: 0.2rem;
  padding: 1.65rem 0 1.25rem;
}
.tk-primary-result dd {
  font-size: clamp(2.2rem, 4.5vw, 3.6rem);
  letter-spacing: -0.06em;
  line-height: 1.08;
}
.tk-note {
  margin: 0.85rem 0 0;
  line-height: 1.45;
}
.tk-note:empty {
  display: none;
}
.tk-plan-detail {
  font-weight: 400;
  line-height: 1.5;
}
.tk-method {
  max-width: 58rem;
  padding: 1.5rem 0 0;
  margin-top: 1.5rem;
  border-top: 1px solid var(--tk-line);
}
.tk-method h2,
.tk-method summary {
  font-size: 1.15rem;
  font-weight: 650;
}
.tk-method summary {
  cursor: pointer;
}
.tk-priorities {
  border: 0 !important;
  padding: 0 !important;
  margin-top: 1.65rem !important;
  min-width: 0;
}
.tk-priorities legend {
  font-size: 1.05rem;
  font-weight: 650;
}
.tk-priorities .tk-note {
  margin: 0.25rem 0 0.6rem;
}
.tk-priorities label {
  display: grid;
  grid-template-columns: 5.5rem minmax(2rem, 1fr) 2rem;
  gap: 0.7rem;
  align-items: center;
  min-height: 2.35rem;
  font-size: 0.92rem;
}
.tk-priorities input {
  width: 100%;
  accent-color: var(--tk-accent-deep);
  cursor: pointer;
}
.tk-priorities output {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.tk-workflow {
  scroll-margin-top: 5.25rem;
  background: var(--tk-soft);
}
.tk-workflow article {
  margin-top: 1.25rem;
  padding-top: 1.2rem;
  border-top: 1px solid var(--tk-line);
}
.tk-workflow .tk-kicker {
  font-size: 0.85rem;
  margin: 0 0 0.4rem;
  font-weight: 600;
  color: var(--tk-accent-deep);
}
.tk-workflow h3 {
  font-size: 0.98rem;
}
.tk-workflow p.tk-model-name {
  font-size: 1.25rem;
  font-weight: 620;
  color: var(--tk-strong);
  letter-spacing: -0.02em;
}
.tk-workflow .tk-model-name .tk-source {
  color: inherit;
}
.tk-workflow article > .tk-source {
  display: inline-block;
  margin-top: 0.55rem;
}
.tk-workflow ol {
  padding-left: 1.2rem;
  line-height: 1.55;
  margin: 0.6rem 0 0;
}
.tk-workflow ol li + li {
  margin-top: 0.45rem;
}
@media (max-width: 760px) {
  .tk-calculator,
  .tk-advisor {
    grid-template-columns: 1fr;
  }
  .tk-header {
    margin-bottom: 1.55rem;
  }
  .tk-filters .tk-field {
    flex: 1 1 10rem;
  }
  .tk-filters select {
    min-width: 0;
  }
}
@media (max-width: 450px) {
  .tk-fields {
    grid-template-columns: 1fr;
  }
  .tk-tile {
    min-height: 0;
  }
  .tk-filters .tk-field:first-child {
    flex-basis: 100%;
  }
}
@media (prefers-reduced-motion: reduce) {
  .tk-tile {
    transition: none;
  }
  .tk-tile:hover,
  .tk-tile:focus-visible {
    transform: none;
  }
}

.tk-inputs-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.4rem;
}
.tk-jump {
  display: none;
  color: var(--tk-accent-deep);
  text-decoration: underline;
  text-underline-offset: 0.2em;
  font-size: 0.9rem;
}
#calculator-inputs,
#calculator-result {
  scroll-margin-top: 5.25rem;
}
@media (max-width: 760px) {
  .tk-jump {
    display: inline-block;
  }
  .tk-results > .tk-jump {
    margin-top: 1rem;
  }
}
