/* ===== ruzgar.css — son temiz sürüm (wind/'e özel) ===== */

/* Sayfa iskeleti */
.article-container {
  max-width: 800px;
  margin: 0 auto;
  padding: 2rem 40px 3rem;
  line-height: 1.65;
  font-size: 1.05rem;
  box-sizing: border-box;
}
.article-container h1 {
  text-align: center;
  font-size: 1.75rem;
  margin-bottom: 1.5rem;
}
.article-container h2 {
  font-size: 1.25rem;
  margin: 2rem 0 0.6rem;
  font-weight: 600;
}
.article-container p {
  margin: 0 0 1rem;
}
.article-container ul {
  margin: 0 0 1.2rem 1.1rem;
  padding-left: 0.9rem;
}
.article-container li {
  margin-bottom: 0.35rem;
}

/* Açıklamalar / Notlar */
.legal-note {
  font-size: 0.95rem;
  line-height: 1.6;
  color: #374151;
  background: #f8fafc;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 14px 16px;
  margin-top: 20px;
}
.legal-note strong {
  color: #111827;
}

/* Kart */
.kart {
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 16px 18px;
  background: #fafbfe;
  margin-bottom: 18px;
  width: 100%;
  overflow-x: auto; /* yatay kaydırma */
  -webkit-overflow-scrolling: touch;
}

.kart h2 {
  margin: 0 0 10px;
  font-size: 1.35rem;
  color: #1b2a4e;
}

.kart h3 {
  margin: 0 0 10px;
  font-size: 1.25rem;
  color: #1b2a4e;
}

/* Başlık yanına küçük etiket (çip) */
.kart .etiket {
  display: inline-block;
  font-size: 0.9rem;
  color: #0f766e;
  background: #ecfeff;
  border: 1px solid #99f6e4;
  border-radius: 6px;
  padding: 2px 8px;
  margin-left: 6px;
}

/* Form ızgarası ve alanlar */
.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(260px, 1fr));
  gap: 12px 16px;
}
@media (max-width: 720px) {
  .grid {
    grid-template-columns: 1fr;
  }
}

.alan {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.alan input,
.alan select {
  background: #fff;
  border: 1px solid #d1d5db;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 0.95rem;
  outline: none;
}
.alan input:focus,
.alan select:focus {
  border-color: #22c55e;
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.2);
}

/* Vurgulu (etiketli) alan kutusu */
.alan.etiket {
  background: #ecfeff;
  border: 1px solid #bbf7d0;
  box-shadow: inset 0 0 0 1px #d1fae5;
  border-radius: 12px;
  padding: 12px 14px 14px;
}

/* Birim metni */
.birim {
  position: absolute;
  right: 14px;
  bottom: 14px;
  color: #6b7280;
  font-size: 0.9rem;
  pointer-events: none;
}

/* İpucu */
.ipucu {
  color: #6b7280;
  font-size: 0.9rem;
  margin-top: 8px;
}

/* Butonlar */
.buton-satiri {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.btn {
  border: 0;
  background: #1b2a4e;
  color: #fff;
  padding: 10px 16px;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease;
}
.btn:hover {
  background: #16203f;
}
.btn-primary {
  display: inline-block;
  padding: 10px 14px;
  border-radius: 8px;
  background: #1d4ed8;
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  margin-top: 10px;
}
.btn-primary:hover {
  background: #1e40af;
}
.btn-ghost {
  display: inline-block;
  padding: 10px 14px;
  border-radius: 8px;
  background: #f3f4f6;
  color: #111827;
  text-decoration: none;
  font-weight: 600;
  border: 1px solid #e5e7eb;
}
.btn-ghost:hover {
  background: #e5e7eb;
}

/* Ayırıcı ve küçük not */
.sep {
  height: 1px;
  background: #e5e7eb;
  margin: 20px 0;
}
.note {
  font-size: 12px;
  color: #6b7280;
}

/* Sonuç kutuları (KPI) */
.sonuclar {
  background: #f8fafc;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 12px 14px;
  margin-top: 12px;
  color: #111827;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 12px;
}
.kpi {
  background: #f0f9ff;
  border: 1px solid #bae6fd;
  border-radius: 10px;
  padding: 10px 12px;
  text-align: center;
  transition: all 0.2s ease;
}
.kpi:hover {
  background: #e0f2fe;
  transform: translateY(-2px);
}
.kpi b {
  display: block;
  font-size: 13px;
  color: #0369a1;
}
.kpi .val {
  font-size: 20px;
  font-weight: 600;
  margin-top: 4px;
  color: #0c4a6e;
}
.kpi.ok .val {
  color: #15803d;
}
.kpi.bad .val {
  color: #b91c1c;
}

/* Zone sonuçları */
.sonuclar.zones {
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-top: 16px;
}
.zone {
  background: #fdf4ff;
  border: 1px solid #e9d5ff;
  border-radius: 10px;
  padding: 12px;
  text-align: center;
  transition: all 0.2s ease;
}
.zone:hover {
  background: #f5f3ff;
  transform: translateY(-2px);
}
.zone h3 {
  font-size: 14px;
  margin: 0 0 6px;
  color: #6b21a8;
}
.zone .big {
  font-size: 22px;
  font-weight: 700;
  color: #4a044e;
  margin-bottom: 4px;
}
.zone .muted {
  font-size: 12px;
  color: #6b7280;
}

/* Zone durum rozeti ve renkleri */
.sonuclar.zones .zone {
  position: relative;
}
.sonuclar.zones .zone::after {
  content: "";
  position: absolute;
  top: 10px;
  right: 12px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
}
/* OK (yeşil) */
.sonuclar.zones .zone.ok {
  border-color: #16a34a33 !important;
  box-shadow: 0 0 0 2px #16a34a1a inset;
}
.sonuclar.zones .zone.ok::after {
  content: "✓";
  color: #16a34a;
  background: #16a34a1a;
  border: 1px solid #16a34a66;
}
/* NO (kırmızı) */
.sonuclar.zones .zone.no {
  border-color: #dc262633 !important;
  box-shadow: 0 0 0 2px #dc26261a inset;
}
.sonuclar.zones .zone.no::after {
  content: "✕";
  color: #dc2626;
  background: #dc26261a;
  border: 1px solid #dc262666;
}

/* ===== Rapor Modal ===== */
#rapor-wrap {
  display: none;
}
#rapor-overlay {
  position: fixed;
  inset: 0;
  background: #0009;
  backdrop-filter: blur(2px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
}
#rapor {
  display: none;
  background: #fff;
  color: #000;
  font: 14px/1.45 "Segoe UI", Arial, sans-serif;
  position: relative;
  width: 900px;
  max-width: calc(100vw - 40px);
  max-height: 90vh;
  overflow: auto;
  border-radius: 12px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
  padding: 16px 18px;
}
.r-head {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  margin: 0 0 10px;
}
.r-brand {
  display: flex;
  gap: 10px;
  align-items: center;
}
.r-logo {
  width: 56px;
  height: 56px;
  object-fit: contain;
  border: 1px solid #ddd;
  border-radius: 6px;
  background: #fff;
}
.r-company small {
  color: #444;
}
.r-title {
  margin-left: auto;
  text-align: right;
}
.r-title h1 {
  margin: 0 0 4px;
  font-size: 18pt;
  letter-spacing: 0.2px;
}
.r-note {
  color: #b91c1c;
}

.r-body {
  padding: 4px 2px 12px;
}
.r-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 16px;
}
.r-card {
  background: #fafbfe;
  border: 1px solid #e6e9f2;
  border-radius: 10px;
  padding: 12px;
  margin-bottom: 40px;
}
.r-card h3 {
  margin: 0 0 8px;
  font-size: 14px;
  color: #111827;
}
.r-btns {
  position: sticky;
  bottom: 0;
  background: #fff;
  padding: 12px 22px;
  border-top: 2px solid #e5e8f0;
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

/* Rapor tabloları */
.r-table,
.rapor-meta {
  width: 100%;
  border-collapse: collapse;
  margin: 10px 0 16px;
}
.r-table th,
.r-table td,
.rapor-meta th,
.rapor-meta td {
  border: 1px solid #dfe3e8;
  padding: 6px 8px;
  text-align: left;
}
.rapor-meta th {
  width: 28%;
  background: #f8fafc;
}
.r-table th {
  background: #f3f4f6;
}

/* Gizli sayfa alt yazısı */
.r-pagefooter {
  display: none;
}

/* ===== Yazdırma ===== */
@media print {
  @page {
    size: A4;
    margin: 12mm;
  }
  .r-btns {
    display: none;
  }
  header,
  main,
  footer,
  .language-selector,
  .whatsapp-link {
    display: none !important;
  }
  body {
    visibility: visible !important;
  }
  #rapor-wrap,
  #rapor,
  #rapor * {
    visibility: visible !important;
  }
  #rapor-overlay {
    position: static !important;
    background: transparent !important;
    backdrop-filter: none !important;
  }
  #rapor {
    display: block !important;
    position: static !important;
    max-height: none !important;
    height: auto !important;
    box-shadow: none !important;
    border: none !important;
    overflow: visible !important;
  }
  /* Başlık ile hemen gelen içerik ayrı sayfaya atılmasın */
  .r-card h3 {
    break-after: avoid;
    break-after: avoid-page;
  }
}

/* Ekranda watermark merkezde dursun (transparan) */
.r-watermark {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(-18deg);
  width: 70%;
  max-width: 160mm;
  text-align: center;
  pointer-events: none;
  user-select: none;
  z-index: 0;
}
.r-w1 {
  font-size: 44pt;
  font-weight: 800;
  color: rgba(185, 28, 28, 0.2);
  margin: 0;
}
.r-w2 {
  font-size: 44pt;
  font-weight: 700;
  color: rgba(185, 28, 28, 0.2);
  margin: 6pt 0 0 0;
}

/* Katmanlar listesi — satırlar arası aralık */
#layers {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Satır içi düzen (seçim + kalınlık + sil) */
#layers .layer-row {
  display: grid;
  grid-template-columns: minmax(140px, 1fr) minmax(140px, 1fr) 40px;
  align-items: center;
  column-gap: 12px;
}
#layers .layer-row .rm {
  width: 40px;
}

/* CAM AĞIRLIK – Katman satırlarını SADECE mobilde 2 kolona düşür */
@media (max-width: 768px) {
  .article-container {
    max-width: 100% !important;
  }

  /* Satırı iki sütunlu grid yap */
  #cam #layers .layer-row {
    display: grid !important;
    grid-template-columns: minmax(140px, 1fr) minmax(140px, 1fr);
    gap: 10px 12px; /* dikey / yatay boşluk */
    align-items: center;
    position: relative; /* X butonu için referans */
    margin-bottom: 12px;
    padding-right: 44px; /* X butonu çakışmasın */
  }

  /* Her iki alan da yarım genişlikte olsun */
  #cam #layers .layer-row > .etiket.alan {
    width: auto !important; /* masaüstü genişlik kurallarını kır */
    margin: 0 !important;
  }
  #cam #layers .layer-row > .etiket.alan select,
  #cam #layers .layer-row > .etiket.alan input {
    width: 100% !important;
  }

  /* Birim etiketi (mm) input içinde sağda sabit */
  #cam #layers .layer-row .etiket.alan {
    position: relative;
  }
  #cam #layers .layer-row .etiket.alan input {
    padding-right: 44px; /* birim yazısı için yer aç */
  }
  #cam #layers .layer-row .etiket.alan .birim {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    color: #6b7280;
  }

  /* Sil (X) butonu satırın sağ üstünde sabit */
  #cam #layers .layer-row .rm {
    position: absolute;
    right: -30px;
    top: 15px;
    width: 36px;
    height: 36px;
    padding: 0;
    z-index: 1;
  }

  #cam .alan.etiket {
    padding: 10px;
  }
}
/* === Geometri: input + birim aynı satır === */
label.etiket.alan:has(select.u-len) {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 96px; /* input geniş, birim 96px */
  gap: 8px;
  align-items: center;
}

/* Sayı kutusu solda, birim sağda */
label.etiket.alan:has(select.u-len) > input[type="number"] {
  grid-column: 1 / 2;
  width: 100%;
}
label.etiket.alan:has(select.u-len) > select.u-len {
  grid-column: 2 / 3;
  width: 100%;
}

/* Katmanlar: thk + ulen aynı satır */
.layer-row label.etiket:has(select[data-field="ulen"]) {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 96px; /* input geniş, birim 96px */
  gap: 8px;
  align-items: center;
}
.layer-row
  label.etiket:has(select[data-field="ulen"])
  > input[data-field="thk"] {
  grid-column: 1 / 2;
  width: 100%;
}
.layer-row
  label.etiket:has(select[data-field="ulen"])
  > select[data-field="ulen"] {
  grid-column: 2 / 3;
  width: 100%;
}

/* Çok dar ekranlar için birim kutusunu biraz daralt */
@media (max-width: 768px) {
  .layer-row label.etiket:has(select[data-field="ulen"]) {
    grid-template-columns: minmax(0, 2fr) 33px;
  }
  #cam #layers .layer-row .etiket.alan input {
    padding-right: 12px; /* birim yazısı için yer aç */
  }
  label.etiket.alan select[data-field="ulen"] {
    padding: 5px;
  }

  label.etiket.alan select[data-field="type"] {
    width: 100%; /* label içini tamamen doldursun */
    display: inline-block;
    width: 33.33% !important;
    box-sizing: border-box;
  }
  select[data-field="ulen"] {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
  }
}

.weight-table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  overflow: hidden;
  margin: 10px 0 24px;
  font-size: clamp(13px, 1.6vw, 15px);
}
.weight-table caption {
  text-align: left;
  font-weight: 600;
  padding: 10px 12px;
  color: #111827;
}
.weight-table thead tr:first-child th {
  background: #f8fafc;
}
.weight-table th,
.weight-table td {
  padding: 10px 12px;
  border-top: 1px solid #f1f5f9;
  text-align: left;
  white-space: nowrap;
}
.weight-table thead .units th {
  color: #64748b;
  font-weight: 500;
}
.weight-table tbody tr:nth-child(even) {
  background: #fcfcfd;
}
