/* Tonne-km — «бортовой журнал»: графит, разметка дороги, янтарные цифры. */
.tk-app {
  --tk-bg: #f2f3f5;
  --tk-card: #ffffff;
  --tk-ink: #22252b;
  --tk-muted: #6b7078;
  --tk-line: #d9dce1;
  --tk-accent: #b97a0a;
  --tk-accent-soft: #fdf3dd;
  --tk-good: #1e6b3a;
  --tk-bad: #b3261e;
  --tk-bad-bg: #fdecea;
  --tk-steel: #2f6fed;
  --tk-focus: #2f6fed;
  background: var(--tk-bg);
  border: 1px solid var(--tk-line);
  border-radius: 18px;
  color: var(--tk-ink);
  padding: clamp(16px, 3vw, 30px);
  display: grid;
  gap: 18px;
  font-variant-numeric: tabular-nums;
}
html[data-theme="dark"] .tk-app {
  --tk-bg: #14171c;
  --tk-card: #1c2026;
  --tk-ink: #eef1f5;
  --tk-muted: #9aa0ab;
  --tk-line: #30353e;
  --tk-accent: #ffbe3c;
  --tk-accent-soft: #2b2311;
  --tk-good: #7bd79d;
  --tk-bad: #ff9d97;
  --tk-bad-bg: #331715;
  --tk-steel: #8fb2ff;
  --tk-focus: #8fb2ff;
}
@media (prefers-color-scheme: dark) {
  html:not([data-theme="light"]) .tk-app {
    --tk-bg: #14171c;
    --tk-card: #1c2026;
    --tk-ink: #eef1f5;
    --tk-muted: #9aa0ab;
    --tk-line: #30353e;
    --tk-accent: #ffbe3c;
    --tk-accent-soft: #2b2311;
    --tk-good: #7bd79d;
    --tk-bad: #ff9d97;
    --tk-bad-bg: #331715;
    --tk-steel: #8fb2ff;
    --tk-focus: #8fb2ff;
  }
}
.tk-kicker { font-size: 0.76rem; font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase; color: var(--tk-muted); }
.tk-ledger { background: var(--tk-card); border: 1px solid var(--tk-line); border-radius: 12px; overflow: hidden; }
.tk-ledger-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; border-bottom: 2px solid var(--tk-ink); }
.tk-add { min-height: 44px; padding: 8px 18px; border-radius: 8px; border: 1px solid var(--tk-ink); background: var(--tk-ink); color: var(--tk-bg); font: inherit; font-weight: 800; cursor: pointer; }
.tk-table-wrap { overflow-x: auto; }
.tk-table { width: 100%; border-collapse: collapse; min-width: 560px; }
.tk-table th { text-align: left; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--tk-muted); padding: 10px 12px; border-bottom: 1px solid var(--tk-line); white-space: nowrap; }
.tk-table td { padding: 8px 12px; border-bottom: 1px solid var(--tk-line); vertical-align: middle; }
.tk-table tbody tr:last-child td { border-bottom: 0; }
.tk-rownum { font-weight: 800; color: var(--tk-muted); }
.tk-table input { min-height: 44px; width: 100%; min-width: 90px; padding: 8px 10px; border: 1px solid var(--tk-line); border-radius: 8px; background: var(--tk-bg); color: var(--tk-ink); font: inherit; font-weight: 700; }
.tk-table input[aria-invalid="true"] { border-color: var(--tk-bad); }
.tk-tkm { font-weight: 800; white-space: nowrap; }
.tk-tkm--over { color: var(--tk-bad); }
.tk-over { display: block; font-size: 0.74rem; font-weight: 700; color: var(--tk-bad); }
.tk-del { min-width: 44px; min-height: 44px; border: 1px solid var(--tk-line); background: transparent; color: var(--tk-muted); border-radius: 8px; font-size: 1.2rem; cursor: pointer; }
.tk-del:hover { color: var(--tk-bad); border-color: var(--tk-bad); }
.tk-note { margin: 0; padding: 10px 16px 14px; font-size: 0.84rem; color: var(--tk-muted); }
.tk-params { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; }
.tk-field { display: grid; gap: 6px; font-size: 0.84rem; font-weight: 700; color: var(--tk-muted); background: var(--tk-card); border: 1px solid var(--tk-line); border-radius: 10px; padding: 12px; }
.tk-field input, .tk-field select { min-height: 44px; width: 100%; padding: 8px 10px; border: 1px solid var(--tk-line); border-radius: 8px; background: var(--tk-bg); color: var(--tk-ink); font: inherit; font-size: 0.98rem; font-weight: 700; }
.tk-field input[aria-invalid="true"] { border-color: var(--tk-bad); }
.tk-field select { appearance: auto; }
.tk-error { margin: 0; padding: 12px 14px; border-radius: 10px; background: var(--tk-bad-bg); color: var(--tk-bad); font-weight: 700; font-size: 0.92rem; }
.tk-outcome { display: grid; gap: 14px; }
.tk-hero { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; align-items: center; background: var(--tk-ink); color: var(--tk-bg); border-radius: 12px; padding: clamp(18px, 3vw, 28px); }
.tk-hero .tk-kicker { color: inherit; opacity: 0.7; }
.tk-hero-main { display: grid; gap: 4px; }
.tk-hero-num { font-size: clamp(2.4rem, 6vw, 4rem); font-weight: 900; letter-spacing: -0.03em; line-height: 1; color: var(--tk-accent); }
html[data-theme="dark"] .tk-hero-num, html:not([data-theme="light"]) .tk-hero-num { color: var(--tk-accent); }
.tk-hero-sub { font-weight: 600; opacity: 0.85; }
.tk-road-bar { height: 18px; border-radius: 999px; background: rgba(127, 127, 127, 0.35); overflow: hidden; position: relative; }
.tk-road-bar i { display: block; height: 100%; background: repeating-linear-gradient(90deg, var(--tk-accent) 0 14px, rgba(0,0,0,0.25) 14px 20px); }
.tk-road-legend { display: flex; justify-content: space-between; gap: 10px; margin-top: 8px; font-size: 0.84rem; font-weight: 700; opacity: 0.9; }
.tk-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.tk-stat { background: var(--tk-card); border: 1px solid var(--tk-line); border-left: 5px solid var(--tk-accent); border-radius: 10px; padding: 12px 14px; display: grid; gap: 2px; }
.tk-stat span { font-size: 0.78rem; font-weight: 700; color: var(--tk-muted); }
.tk-stat b { font-size: 1.25rem; font-weight: 850; letter-spacing: -0.01em; }
.tk-stat--bad { border-left-color: var(--tk-bad); }
.tk-stat--bad b { color: var(--tk-bad); }
.tk-empty { border: 2px dashed var(--tk-line); border-radius: 12px; padding: 36px 24px; text-align: center; display: grid; gap: 12px; justify-items: center; color: var(--tk-muted); }
.tk-empty p { margin: 0; max-width: 520px; }
.tk-empty-road { width: min(420px, 100%); height: 14px; border-radius: 999px; background: var(--tk-line); overflow: hidden; }
.tk-empty-road i { display: block; width: 40%; height: 100%; background: repeating-linear-gradient(90deg, var(--tk-muted) 0 12px, transparent 12px 18px); opacity: 0.6; }
.tk-btn { min-height: 46px; padding: 10px 20px; border-radius: 10px; border: 1px solid var(--tk-line); background: var(--tk-card); color: var(--tk-ink); font: inherit; font-weight: 800; cursor: pointer; }
.tk-btn--primary { background: var(--tk-ink); color: var(--tk-bg); border-color: var(--tk-ink); }
.tk-method { margin: 0; font-size: 0.82rem; color: var(--tk-muted); max-width: 90ch; }
.tk-visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.tk-add:focus-visible, .tk-del:focus-visible, .tk-btn:focus-visible, .tk-table input:focus-visible, .tk-field input:focus-visible, .tk-field select:focus-visible { outline: 3px solid var(--tk-focus); outline-offset: 2px; }

@media (max-width: 1000px) {
  .tk-params { grid-template-columns: repeat(3, 1fr); }
  .tk-stats { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .tk-params { grid-template-columns: 1fr 1fr; }
  .tk-hero { grid-template-columns: 1fr; }
  .tk-stats { grid-template-columns: 1fr 1fr; }
  .tk-stat b { font-size: 1.05rem; }
}

#js-tool-container-tonne-kilometer-calculator [hidden]{display:none!important}

.tk-app>section,.tk-app>p{min-width:0}

.tk-table-wrap{position:relative}
html[data-theme="dark"] .tk-hero{background:#0c0e11;color:#eef1f5}
@media (prefers-color-scheme:dark){html:not([data-theme="light"]) .tk-hero{background:#0c0e11;color:#eef1f5}}

/* ===== ToolBoss site adapter: integration only, the app design above is shipped as built ===== */
#js-tool-container-tonne-kilometer-calculator:not(.tb-focus-mode){background:transparent!important;border:none!important;box-shadow:none!important;padding:0!important;border-radius:0!important;}
#js-tool-container-tonne-kilometer-calculator .js-premium-app-html-content{background:transparent!important;}
#js-tool-container-tonne-kilometer-calculator:has(.tb-presets-drawer) .tk-app{margin-top:20px;}
#js-tool-container-tonne-kilometer-calculator [hidden]{display:none!important;}
#js-tool-container-tonne-kilometer-calculator .tk-app{border-bottom-left-radius:0;border-bottom-right-radius:0;}
#js-tool-container-tonne-kilometer-calculator .tk-table{background:transparent;}
#js-tool-container-tonne-kilometer-calculator .tk-table th{color:var(--tk-muted);}
#js-tool-container-tonne-kilometer-calculator .tk-table td.tk-tkm{color:var(--tk-ink);}
#js-tool-container-tonne-kilometer-calculator .tk-table td.tk-tkm--over{color:var(--tk-bad);}
#js-tool-container-tonne-kilometer-calculator .tk-field select{min-height:44px;width:100%;padding:8px 10px!important;border:1px solid var(--tk-line)!important;border-radius:8px!important;background:var(--tk-bg)!important;color:var(--tk-ink)!important;font-size:.98rem!important;font-weight:700!important;}
#js-tool-container-tonne-kilometer-calculator .tk-app input[aria-invalid="true"]{border-color:var(--tk-bad)!important;}