/* CmcIpucu — Boncuk fulmet görünümü (cmc token) */

.cmc-ipucu-balon {
  --cmc-ipucu-ease: cubic-bezier(0.32, 0.72, 0, 1);
  position: fixed;
  z-index: calc(var(--cmc-z-katman) + 12);
  min-width: 4.5rem;
  max-width: min(96vw, 32rem);
  max-height: none;
  padding: 0.4rem 0.55rem;
  margin: 0;
  overflow: visible;
  display: none;
  flex-direction: column;
  gap: 0.15rem;
  font-size: 0.78rem;
  font-weight: 500;
  line-height: 1.35;
  letter-spacing: 0.01em;
  color: var(--cmc-metin);
  background: color-mix(in srgb, var(--cmc-yuzey-yuzen) 94%, transparent);
  border: 1.5px solid color-mix(in srgb, var(--cmc-metin) 55%, var(--cmc-accent));
  border-radius: var(--cmc-radius-md, 12px);
  box-shadow: var(--cmc-golge-md, 0 14px 38px rgb(15 23 42 / 12%));
  backdrop-filter: blur(16px) saturate(160%);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
}

.cmc-ipucu-balon::before {
  content: '';
  position: absolute;
  top: 0;
  left: 12px;
  right: 12px;
  height: 2px;
  border-radius: 0 0 4px 4px;
  background: linear-gradient(90deg, transparent, var(--cmc-accent), transparent);
  opacity: 0.75;
  pointer-events: none;
}

.cmc-ipucu-balon[hidden] {
  display: none !important;
}

.cmc-ipucu-balon--acik {
  display: flex;
  opacity: 1;
  visibility: visible;
  /* Masaüstü: tıklamayı yutmaz (Boncuk S275). Mobil sheet aşağıda auto. */
  pointer-events: none;
  animation: cmc-ipucu-ac 0.22s var(--cmc-ipucu-ease);
}

.cmc-ipucu-balon--acik:not(.cmc-ipucu-balon--mobil) {
  cursor: default;
}

@keyframes cmc-ipucu-ac {
  from {
    opacity: 0;
    transform: translateY(6px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.cmc-ipucu-balon__ic {
  min-width: 0;
  overflow: visible;
}

.cmc-ipucu-balon__metin {
  display: block;
  white-space: pre-line;
  word-break: break-word;
}

.cmc-ipucu-balon__kisayol {
  display: block;
  margin-top: 0.15rem;
  color: var(--cmc-metin-zayif);
  font-family: var(--cmc-font-mono, ui-monospace, monospace);
  font-size: 0.72em;
}

/* Mobil sheet — üstte sabit; iç kaydırma */
.cmc-ipucu-balon--mobil {
  left: 50% !important;
  top: calc(env(safe-area-inset-top, 0px) + 1.75rem) !important;
  right: auto !important;
  bottom: auto !important;
  transform: translateX(-50%) !important;
  width: min(96vw, 35rem) !important;
  max-width: min(96vw, 35rem) !important;
  max-height: min(70dvh, 32rem);
  box-sizing: border-box;
  padding: 0.5rem 0.65rem;
  padding-bottom: calc(0.5rem + env(safe-area-inset-bottom, 0px));
  overflow: hidden;
  pointer-events: auto;
  touch-action: pan-x pan-y;
  border-width: 2px;
  box-shadow: 0 24px 56px rgb(2 6 23 / 32%);
  animation: cmc-ipucu-mobil-ac 0.26s var(--cmc-ipucu-ease);
}

.cmc-ipucu-balon--mobil .cmc-ipucu-balon__ic {
  max-height: min(62dvh, 28rem);
  overflow-x: auto;
  overflow-y: auto;
  overscroll-behavior: contain;
  touch-action: pan-x pan-y;
  -webkit-overflow-scrolling: touch;
}

.cmc-ipucu-balon--mobil::before {
  left: 18%;
  right: 18%;
  height: 3px;
  opacity: 0.9;
}

@keyframes cmc-ipucu-mobil-ac {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(-8px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0) scale(1);
  }
}

@media (hover: hover) and (pointer: fine) {
  [data-cmc-ipucu]:hover,
  [data-cmc-ipucu-metin]:hover {
    cursor: help;
  }
}

@media (prefers-reduced-motion: reduce) {
  .cmc-ipucu-balon--acik,
  .cmc-ipucu-balon--mobil {
    animation: none;
  }
}

/* Opsiyonel kompakt satır tablosu (yalnız sunucu üretir; istemci HTML basmaz) */
.cmc-ipucu-tbl {
  width: 100%;
  border-collapse: collapse;
  border-spacing: 0;
  font-size: 0.72rem;
  line-height: 1.3;
  margin: 0;
  border: 1px solid var(--cmc-kenar);
  border-radius: var(--cmc-radius-sm);
  overflow: hidden;
  background: color-mix(in srgb, var(--cmc-yuzey) 88%, transparent);
}

.cmc-ipucu-tbl tbody td {
  padding: 2px 6px;
  border-bottom: 1px solid var(--cmc-kenar);
  vertical-align: top;
}

.cmc-ipucu-tbl tbody tr:last-child td {
  border-bottom: none;
}

.cmc-ipucu-tbl tbody td:first-child {
  color: var(--cmc-metin-zayif);
  font-weight: 600;
  white-space: nowrap;
}
