/* Kalkulator sati. Uses the site's CSS variables; fallbacks only for standalone preview. */
.ks {
  --ks-bg: var(--bg, #fff);
  --ks-fg: var(--fg, #111);
  --ks-muted: var(--muted, #5c5c5c);
  --ks-accent: var(--accent, #1f5eff);
  --ks-ink: var(--accent-ink, #006b4f);
  --ks-line: var(--line, #d9d9d9);
  --ks-card: var(--card, #f6f6f6);
  color: var(--ks-fg);
  font-variant-numeric: tabular-nums;
  display: grid;
  gap: 1rem;
}
.ks *, .ks *::before, .ks *::after { box-sizing: border-box; }
/* Grid tracks must not grow to a wide table's min-content width; tables scroll inside .ks-scroll instead. */
.ks, .ks-panel, .ks-settings, .ks-out:not(:empty) { grid-template-columns: minmax(0, 1fr); }
.ks > *, .ks-panel > *, .ks-settings > *, .ks-out > * { min-width: 0; }
.ks [hidden] { display: none !important; }
.ks :focus-visible { outline: 2px solid var(--ks-accent); outline-offset: 2px; }
.ks-lead { margin: 0; }

.ks-tabs { display: flex; flex-wrap: wrap; gap: .5rem; }
.ks-tab { position: relative; display: inline-flex; align-items: center; min-height: 2.75rem; padding: .5rem 1rem; border: 1px solid var(--ks-line); border-radius: 999px; background: var(--ks-bg); cursor: pointer; font-weight: 600; }
.ks-tab input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.ks-tab:has(input:checked) { background: var(--ks-fg); color: var(--ks-bg); border-color: var(--ks-fg); }
.ks-tab:has(input:focus-visible) { outline: 2px solid var(--ks-accent); outline-offset: 2px; }

.ks-panel, .ks-settings { display: grid; gap: 1rem; padding: 1.25rem; background: var(--ks-bg); border: 1px solid var(--ks-line); border-radius: 12px; }
.ks-drop { display: grid; gap: .35rem; justify-items: center; text-align: center; padding: 2rem 1rem; border: 2px dashed var(--ks-line); border-radius: 12px; cursor: pointer; background: var(--ks-card); }
.ks-drop span { color: var(--ks-muted); font-size: .9rem; }
.ks-drop.ks-over { border-color: var(--ks-accent); }
.ks-file { position: absolute; width: 1px; height: 1px; opacity: 0; }
.ks-file:focus-visible + * { outline: 2px solid var(--ks-accent); }
.ks-safe { margin: 0; font-weight: 600; color: var(--ks-ink); }

.ks-row { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem; }
.ks-grid2 { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); }
.ks-grid3 { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr)); }
.ks-field { display: grid; gap: .35rem; align-content: start; }
.ks-field > label { font-weight: 600; }
.ks-check { display: flex; gap: .6rem; align-items: flex-start; }
.ks-check input { width: 1.25rem; height: 1.25rem; margin-top: .15rem; flex: none; }
.ks input[type="text"], .ks input[type="date"], .ks select {
  width: 100%; min-height: 2.75rem; padding: .5rem .7rem; font: inherit;
  color: var(--ks-fg); background: var(--ks-bg); border: 1px solid var(--ks-line); border-radius: 8px;
}
.ks input[aria-invalid="true"] { border-color: #c62828; }
.ks-unit { position: relative; }
.ks-unit input { padding-right: 3rem !important; }
.ks-unit span { position: absolute; right: .75rem; top: 50%; transform: translateY(-50%); color: var(--ks-muted); pointer-events: none; }

.ks-btn, .ks-btn-s { min-height: 2.75rem; padding: .6rem 1.25rem; font: inherit; font-weight: 600; border-radius: 8px; cursor: pointer; }
.ks-btn { color: var(--ks-bg); background: var(--ks-fg); border: 0; }
.ks-btn-s { color: var(--ks-fg); background: var(--ks-card); border: 1px solid var(--ks-line); }

.ks-hint { margin: 0; font-size: .9rem; color: var(--ks-muted); }
.ks-error { margin: 0; font-size: .95rem; color: #c62828; }
.ks-error:empty { display: none; }
.ks-warn { padding: .75rem 1rem; font-size: .9rem; border: 1px solid var(--ks-line); border-left: 3px solid #b26a00; border-radius: 0 8px 8px 0; background: var(--ks-bg); }
.ks-warn ul { margin: .4rem 0 0; padding-left: 1.1rem; display: grid; gap: .25rem; }

.ks-settings > summary, .ks-sources > summary { cursor: pointer; font-weight: 600; min-height: 2.75rem; display: flex; align-items: center; }
.ks-settings:not([open]) { padding-block: .25rem; }

.ks-scroll { overflow-x: auto; }
.ks-table { width: 100%; border-collapse: collapse; }
.ks-table caption { caption-side: top; text-align: left; font-weight: 600; color: var(--ks-fg); padding: 0 0 .5rem; }
/* Reset the site-wide th/td look (uppercase, wide padding) inside the tool. */
.ks-table th, .ks-table td { padding: .45rem .5rem .45rem 0; font: inherit; letter-spacing: normal; text-transform: none; color: inherit; border-bottom: 1px solid var(--ks-line); vertical-align: middle; }
.ks-table thead th { font-size: .85rem; color: var(--ks-muted); font-weight: 600; text-align: right; }
.ks-table thead th:first-child { text-align: left; }
.ks-table tbody th, .ks-table tfoot th { text-align: left; font-weight: 400; }
.ks-table td { text-align: right; white-space: nowrap; }
.ks-table .ks-key th, .ks-table .ks-key td { font-weight: 700; }
.ks-days td, .ks-emp td { text-align: left; }
.ks-days input { min-width: 5.5rem; }
.ks-days .ks-we th { color: var(--ks-muted); }
.ks-tag { display: block; font-size: .78rem; color: var(--ks-ink); white-space: normal; }
.ks-emp td { min-width: 9rem; }

.ks-chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .5rem; }
.ks-chips li { display: inline-flex; align-items: center; gap: .25rem; padding: .25rem .25rem .25rem .75rem; border: 1px solid var(--ks-line); border-radius: 999px; background: var(--ks-card); }
.ks-chips button { min-width: 2.25rem; min-height: 2.25rem; border: 0; background: transparent; color: var(--ks-fg); font: inherit; font-size: 1.1rem; cursor: pointer; border-radius: 999px; }

.ks-out:not(:empty) { display: grid; gap: .75rem; }
.ks-summary { font-size: 1.1rem; margin: 0; }
.ks-note { margin: 0; font-size: .9rem; color: var(--ks-muted); }
.ks-sources { font-size: .9rem; color: var(--ks-muted); }
.ks-sources ul { padding-left: 1.1rem; display: grid; gap: .5rem; }
.ks-sources strong { color: var(--ks-fg); }
.ks-sources a { color: var(--ks-ink); }
.ks-sources q { overflow-wrap: anywhere; }
.ks-bridge { margin: 0; padding: 1rem 1.25rem; border-left: 3px solid var(--ks-accent); background: var(--ks-bg); border-radius: 0 8px 8px 0; }
.ks-bridge a { color: var(--ks-ink); font-weight: 600; }

@media (max-width: 480px) {
  .ks-panel, .ks-settings { padding: 1rem; }
  .ks-btn, .ks-btn-s { width: 100%; }
  .ks-table { font-size: .9rem; }
}
