/* ==========================================================================
   HESAPLAMA ARAÇLARI (mdosc/arac.php, mdosc/araclar.php)
   Hesaplayıcı hero'nun sağ sütununda durur; form alanları components.css (.field, .select).
   ========================================================================== */

.tl-hero .page-hero__inner { align-items: start; }
/* Güvence rozetleri */
.tl-facts { display: flex; flex-wrap: wrap; gap: 8px; }
.tl-facts li {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 12px 7px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-2);
  box-shadow: var(--shadow-xs);
}
.tl-facts .i { width: 16px; height: 16px; padding: 2px; border-radius: 50%; background: var(--green-100); color: var(--green-700); stroke-width: 3; }

.tl-note {
  display: flex;
  gap: 10px;
  max-width: 560px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--red-500);
  border-radius: var(--radius);
  background: var(--surface);
  font-size: var(--fs-sm);
  line-height: 1.55;
  color: var(--ink-2);
}
.tl-note .i { flex: none; width: 18px; height: 18px; margin-top: 1px; color: var(--red-600); }
.tl-meta { font-size: 13px; color: var(--muted); }

/* ---------- Hesaplayıcı kartı ---------- */
.tool {
  position: relative;
  display: grid;
  gap: 20px;
  padding: clamp(20px, 3vw, 28px);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
}
/* Üstte ince marka çizgisi */
.tool::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  background: linear-gradient(90deg, var(--navy-900), var(--navy-700) 60%, var(--red-600));
}

/* Duruma göre gizlenen alan ve satırlar (tools.js) */
.tool [hidden] { display: none !important; }

.tool__head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}
.tool__head-icon {
  display: grid;
  flex: none;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: var(--navy-900);
  color: #fff;
}
.tool__head-icon .i { width: 20px; height: 20px; }
.tool__head strong { display: block; font-size: 1.0625rem; letter-spacing: -.01em; }
.tool__head small { display: block; font-size: 13px; color: var(--muted); }

.tool__label {
  margin-bottom: 8px;
  padding: 0;
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--ink);
}

/* Seçim düğmeleri: tek parça ray, seçili olan beyaz kart gibi öne çıkar */
.tool__seg { min-width: 0; margin: 0; padding: 0; border: 0; }
.tool__seg legend { float: left; width: 100%; }
.tool__track {
  clear: both;
  display: flex;
  gap: 4px;
  padding: 4px;
  border-radius: 12px;
  background: var(--surface-2);
  box-shadow: inset 0 0 0 1px var(--line);
}
.tool__track label { position: relative; flex: 1 1 0; min-width: 0; cursor: pointer; }
.tool__track input { position: absolute; opacity: 0; pointer-events: none; }
.tool__track span {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 6px 8px;
  border-radius: 9px;
  font-size: var(--fs-sm);
  font-weight: 600;
  line-height: 1.25;
  text-align: center;
  color: var(--ink-2);
  transition: background-color .2s, color .2s, box-shadow .2s;
}
.tool__track small { font-size: 11.5px; font-weight: 500; color: var(--muted); }
.tool__track label:hover span { color: var(--ink); }
.tool__track input:checked + span {
  background: var(--surface);
  color: var(--navy-900);
  box-shadow: 0 1px 2px rgb(11 31 69 / .08), 0 2px 8px rgb(11 31 69 / .08), inset 0 0 0 1px var(--line-2);
}
.tool__track input:focus-visible + span { outline: 2px solid var(--red-600); outline-offset: 1px; }

/* Yan yana iki alan (ör. giriş ve çıkış tarihi) */
.tool__pair { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 420px) {
  .tool__pair { grid-template-columns: 1fr; }
}

/* Tutar alanları */
.tool__field { gap: 6px; }
.tool__field label { font-weight: 600; }
.tool__money { position: relative; }
.tool__money input { padding-right: 46px; font-weight: 600; font-variant-numeric: tabular-nums; text-align: right; }
[data-field="tutar"] .tool__money input,
[data-field="kar"] .tool__money input { min-height: 54px; font-size: 1.25rem; }
.tool__money span {
  position: absolute;
  top: 50%;
  right: 16px;
  transform: translateY(-50%);
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--muted);
  pointer-events: none;
}
.tool__hint { font-size: 12px; line-height: 1.45; color: var(--muted); }

.tool__more { border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); }
.tool__more > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  font-size: var(--fs-sm);
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}
.tool__more > summary::-webkit-details-marker { display: none; }
.tool__more > summary::after {
  content: "+";
  font-size: 18px;
  font-weight: 500;
  line-height: 1;
  color: var(--muted);
}
.tool__more[open] > summary::after { content: "−"; }
.tool__more[open] { padding: 0 14px 14px; }
.tool__more[open] > summary { margin: 0 -14px; }
/* <details> içeriğinde grid boşluğu uygulanmaz; alanlar arası boşluk doğrudan verilir */
.tool__more .tool__field + .tool__field { margin-top: 16px; }
.tool__more .tool__money input { background: var(--surface); }

/* Sonuçlar: ara satırlar sade, toplam lacivert blokta */
.tool__result {
  display: grid;
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  font-variant-numeric: tabular-nums;
}
.tool__result > div { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 11px 16px; }
.tool__result > div + div { border-top: 1px solid var(--line); }
.tool__result dt { font-size: var(--fs-sm); color: var(--ink-2); }
.tool__result dt span { color: var(--muted); }
.tool__result dd { margin: 0; font-weight: 600; text-align: right; white-space: nowrap; }
.tool__result > .tool__total {
  align-items: center;
  padding: 16px;
  border-top: 0;
  background: var(--navy-900);
  color: #fff;
}
.tool__total dt { font-weight: 600; color: rgb(255 255 255 / .8); }
.tool__total dd { font-size: 1.5rem; font-weight: 800; letter-spacing: -.02em; color: #fff; }
.tool__result dt small { display: block; margin-top: 2px; font-size: 12px; color: var(--muted); }
/* Ara toplam (ör. net ücret, fatura toplamı) */
.tool__result > .tool__sub { background: var(--surface-2); }
.tool__sub dt { font-weight: 600; color: var(--ink); }
.tool__sub dd { font-weight: 700; }
/* Uyarı satırı (ör. 1 yıldan az çalışma) */
.tool__result > .tool__warn { background: var(--red-50); }
.tool__warn dt { font-weight: 600; color: var(--red-700); }
.tool__result > [data-row="devreden"] { border-top: 0; background: var(--red-50); }
.tool__result > [data-row="devreden"] dt,
.tool__result > [data-row="devreden"] dd { color: var(--red-700); }

/* Aylık tablo (bordro) */
.tool__scroll { overflow-x: auto; }
.tool__table { width: 100%; border-collapse: collapse; font-size: 13px; font-variant-numeric: tabular-nums; }
.tool__table th,
.tool__table td { padding: 8px 6px; border-bottom: 1px solid var(--line); text-align: right; white-space: nowrap; }
.tool__table thead th { font-size: 12px; font-weight: 600; color: var(--muted); }
.tool__table th[scope="row"],
.tool__table thead th:first-child { text-align: left; font-weight: 600; color: var(--ink-2); }
.tool__table tr.is-current { background: var(--navy-50); }
.tool__table tr.is-current th,
.tool__table tr.is-current td { color: var(--navy-900); font-weight: 700; }
.tool__table tfoot th,
.tool__table tfoot td { border-bottom: 0; font-weight: 700; color: var(--ink); }

.tl-sources { font-size: var(--fs-sm); color: var(--muted); }
.tl-sources a { color: var(--ink-2); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--line-strong); }
.tl-sources a:hover { color: var(--red-600); text-decoration-color: currentColor; }

/* ---------- Araçlar listesi ---------- */
.tl-list-section { padding-top: 0; }
.tl-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 18px; }
.tl-list a {
  position: relative;
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  align-content: start;
  gap: 10px;
  height: 100%;
  padding: 28px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: var(--surface);
  box-shadow: var(--shadow-xs);
  transition: border-color .2s, box-shadow .2s, transform .2s;
}
.tl-list a::after {
  content: "";
  position: absolute;
  top: -60px;
  right: -60px;
  width: 160px;
  height: 160px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--navy-50), transparent 70%);
  pointer-events: none;
}
.tl-list a:hover { border-color: var(--navy-200); box-shadow: var(--shadow); transform: translateY(-2px); }
.tl-list__icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  margin-bottom: 4px;
  border-radius: 14px;
  background: var(--navy-900);
  color: #fff;
}
.tl-list__icon .i { width: 22px; height: 22px; }
.tl-list strong { font-size: 1.1875rem; letter-spacing: -.01em; }
.tl-list small { font-size: 14px; line-height: 1.55; color: var(--muted); }
.tl-list .link-arrow { margin-top: auto; justify-self: start; }

@media (prefers-reduced-motion: reduce) {
  .tl-list a:hover { transform: none; }
}
@media (max-width: 960px) {
  .tl-hero .page-hero__inner { gap: 32px; }
}
@media (max-width: 420px) {
  .tool__track span { font-size: 13px; }
  .tool__total dd { font-size: 1.3125rem; }
}
