/*! DWG OfficeZip © 2026 Mahmut Tarı. All rights reserved. · ACadSharp © 2021 Albert Domenech (MIT) · third-party notices: /web/lib/NOTICE.md, /web/mitdwg/LICENSE-ACadSharp.txt */
/* Zengin yazı Faz 2 — yerinde MTEXT / TEXT düzenleyicisi (şerit B; mtextui.js). Renkler yalnız app.css :root belirteçlerinden. */

/* ---- düzenleme yüzeyi: tuvalin üstünde konumlu (ve yazının dönüşüyle döndürülmüş) contenteditable ---- */
.mt-ed { position: absolute; z-index: 31; box-sizing: content-box; margin: 0; padding: 0; border: 0; outline: none; background: transparent; white-space: pre-wrap; overflow-wrap: normal; hyphens: manual;
  min-height: 1em; user-select: text; -webkit-user-select: text; -webkit-touch-callout: default; -webkit-tap-highlight-color: transparent; caret-color: currentColor; cursor: text; pointer-events: auto; }
.mt-ed[hidden] { display: none; }
.mt-ed .mt-p { margin: 0; padding: 0; min-height: 1em; }
.mt-ed .mt-r { white-space: pre-wrap; }
/* sekme: genişliği JS verir (sonraki durağa dek); düzenlenemez; hafif işaret */
.mt-ed .mt-s { display: inline-block; width: 0; height: 0.8em; overflow: hidden; white-space: nowrap; vertical-align: baseline; color: transparent; user-select: none; -webkit-user-select: none;
  border-bottom: 1px dotted color-mix(in srgb, currentColor 35%, transparent); }
/* yığma (kesir): üst / alt küçük, "/" ve "#" altında çizgi, "^" çizgisiz */
.mt-ed .mt-k { display: inline-block; vertical-align: middle; text-align: center; line-height: 1.05; font-size: 0.7em; user-select: none; -webkit-user-select: none; padding: 0 1px; }
.mt-ed .mt-k .u, .mt-ed .mt-k .a { display: block; white-space: pre; }
.mt-ed .mt-k[data-tur="/"] .u { border-bottom: 1px solid currentColor; }
.mt-ed .mt-k[data-tur="#"] { display: inline-flex; align-items: center; gap: 0.1em; }
.mt-ed .mt-k[data-tur="#"] .u, .mt-ed .mt-k[data-tur="#"] .a { display: inline-block; }
.mt-ed .mt-k[data-tur="#"] .u::after { content: "/"; font-size: 1.43em; }
/* modelin bilmediği ham kod (\N, \X, \zq …): gizli ya da küçük çip */
.mt-ed .mt-h { user-select: none; -webkit-user-select: none; }
.mt-ed .mt-h:not([hidden]) { background: color-mix(in srgb, var(--accent) 28%, transparent); border-radius: 2px; }
/* alan (FIELD): gri zeminli, düzenlenemez */
.mt-ed .mt-a { background: color-mix(in srgb, currentColor 14%, transparent); border-radius: 2px; user-select: none; -webkit-user-select: none; }

/* ---- araç çubuğu: masaüstünde kutunun üstünde yüzer, telefonda klavyenin üstünde yatay kayan şerit ---- */
.mt-bar { position: absolute; z-index: 40; display: flex; flex-wrap: wrap; align-items: center; gap: 2px; padding: 3px; max-width: calc(100% - 8px); box-sizing: border-box;
  background: var(--bar); color: var(--fg); border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow); font-size: 13px; user-select: none; -webkit-user-select: none; }
.mt-bar[hidden], .mt-bar [hidden], .mt-bul[hidden], .mt-cetvel[hidden], .mt-menu[hidden] { display: none !important; }
.mt-bar.mt-tel { flex-wrap: nowrap; overflow-x: auto; overflow-y: hidden; border-radius: 0; border-width: 1px 0 0; box-shadow: 0 -2px 10px rgba(0, 0, 0, .25); -webkit-overflow-scrolling: touch; scrollbar-width: none; max-width: none; }
.mt-bar.mt-tel::-webkit-scrollbar { display: none; }
.mt-b { flex: 0 0 auto; min-width: 28px; height: 28px; padding: 0 4px; display: inline-flex; align-items: center; justify-content: center; gap: 4px; border: 0; border-radius: 6px; background: transparent; color: inherit; font: inherit; cursor: pointer; }
.mt-b:hover { background: var(--btn); }
.mt-b[aria-pressed="true"] { background: var(--btn-on); color: var(--accent); }
.mt-b:disabled { opacity: .35; cursor: default; }
.mt-b .ic { width: 18px; height: 18px; fill: currentColor; pointer-events: none; }
.mt-tel .mt-b { min-width: 44px; height: 44px; }
.mt-tel .mt-b .ic { width: 22px; height: 22px; }
.mt-grup { flex: 0 0 auto; display: inline-flex; gap: 1px; padding: 0 2px; border-left: 1px solid var(--line); border-right: 1px solid var(--line); }
.mt-sec { flex: 0 0 auto; height: 28px; max-width: 128px; background: var(--btn); color: var(--fg); border: 1px solid var(--line); border-radius: 6px; font: inherit; }
.mt-sayi { flex: 0 0 auto; width: 52px; height: 28px; box-sizing: border-box; text-align: center; background: var(--btn); color: var(--fg); border: 1px solid var(--line); border-radius: 6px; font: inherit; }
.mt-tel .mt-sec, .mt-tel .mt-sayi { height: 44px; font-size: 15px; }
.mt-b.mt-k { padding: 0 10px; font-weight: 600; }
.mt-b.mt-ok { background: var(--accent); color: var(--accent-fg); }
.mt-b.mt-ok:hover { background: var(--accent); filter: brightness(1.08); }
.mt-b.mt-iptal { color: var(--muted); }
.mt-kisa .mt-sec { max-width: 108px; }

/* ---- açılır menü (satır aralığı, liste, simge, harf kipi, biçimi temizle) ---- */
.mt-menu { position: absolute; z-index: 45; min-width: 120px; max-height: 60%; overflow: auto; padding: 4px; background: var(--panel); color: var(--fg); border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow); }
.mt-mi { display: block; width: 100%; padding: 7px 10px; border: 0; border-radius: 6px; background: transparent; color: inherit; font: inherit; text-align: left; cursor: pointer; white-space: nowrap; }
.mt-mi:hover, .mt-mi:focus-visible { background: var(--btn); outline: none; }
.mt-menu.mt-simgeler { display: grid; grid-template-columns: repeat(6, 1fr); gap: 2px; min-width: 0; }
.mt-menu.mt-simgeler .mt-mi { text-align: center; padding: 8px 6px; font-size: 16px; }
.mt-menu.mt-simgeler .mt-mi:nth-last-child(-n+2) { grid-column: span 3; font-size: 13px; }

/* ---- cetvel: kutunun üstünde, kutuyla aynı dönüşte; girinti işaretleri, sekme durakları, genişlik tutamağı ---- */
.mt-cetvel { position: absolute; z-index: 32; height: 22px; box-sizing: content-box; background: color-mix(in srgb, var(--bar) 92%, transparent); border: 1px solid var(--line); border-radius: 3px 3px 0 0; user-select: none; -webkit-user-select: none; touch-action: none; cursor: crosshair; }
.mt-cet-iz { position: absolute; left: 0; right: 0; bottom: 5px; height: 1px; background: var(--muted); pointer-events: none; }
.mt-cet-t { position: absolute; bottom: 0; width: 1px; height: 7px; background: var(--muted); pointer-events: none; }
/* girinti işaretleri: üçgen biçimli kutular (clip-path vuruş alanını da keser; üst ve alt işaret üst üste binmez) */
.mt-cet-m { position: absolute; width: 14px; height: 10px; margin-left: -7px; cursor: ew-resize; touch-action: none; }
.mt-cet-ilk { top: 1px; background: var(--accent); clip-path: polygon(0 0, 100% 0, 50% 100%); }
.mt-cet-asili { bottom: 1px; background: var(--accent); clip-path: polygon(50% 0, 100% 100%, 0 100%); }
.mt-cet-sag { bottom: 1px; background: var(--cad-hi); clip-path: polygon(50% 0, 100% 100%, 0 100%); }
@media (pointer: coarse) { .mt-cet-m { width: 22px; height: 11px; margin-left: -11px; } }
.mt-cet-d { position: absolute; bottom: 1px; width: 8px; height: 9px; margin-left: -1px; border-left: 2px solid var(--fg); border-bottom: 2px solid var(--fg); text-decoration: none; cursor: ew-resize; touch-action: none; }
.mt-cet-d-c { margin-left: -4px; border-left-color: transparent; }
.mt-cet-d-c::after { content: ""; position: absolute; left: 3px; bottom: 0; width: 2px; height: 9px; background: var(--fg); }
.mt-cet-d-r { margin-left: -8px; border-left: 0; border-right: 2px solid var(--fg); }
.mt-cet-d-d::after { content: ""; position: absolute; left: 4px; bottom: 2px; width: 2px; height: 2px; background: var(--fg); }
.mt-cet-gen { position: absolute; top: 0; width: 10px; height: 100%; margin-left: -5px; border-radius: 3px; background: var(--accent); opacity: .85; cursor: ew-resize; touch-action: none; }
.mt-cet-gen::before { content: ""; position: absolute; left: -10px; right: -10px; top: -6px; bottom: -6px; }

/* ---- bul ve değiştir çubuğu ---- */
.mt-bul { position: absolute; z-index: 41; display: flex; flex-wrap: wrap; align-items: center; gap: 4px; padding: 4px; max-width: calc(100% - 8px); box-sizing: border-box; background: var(--bar); color: var(--fg); border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow); font-size: 13px; }
.mt-bul input[type="text"] { width: 120px; height: 28px; box-sizing: border-box; padding: 0 6px; background: var(--btn); color: var(--fg); border: 1px solid var(--line); border-radius: 6px; font: inherit; }
.mt-bul-bk { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.mt-bul-d { height: 28px; padding: 0 8px; border: 0; border-radius: 6px; background: var(--btn); color: var(--fg); font: inherit; cursor: pointer; }
.mt-bul-d:hover { background: var(--btn-on); }

/* ---- yardımcılar ---- */
.mt-canli { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.mt-dosya { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
