/* Hizalama araç çubuğu ve cetvel: iki ekranda aynı bileşen */
.hz {
    --hz-metin: var(--metin, #1f2937);
    --hz-ikincil: var(--metin-ikincil, #4b5563);
    --hz-cizgi: var(--cizgi, #e5e7eb);
    --hz-vurgu: var(--birincil, #2563eb);
    --hz-vurgu-zemin: var(--zemin-vurgu, #eff6ff);
    --hz-yuzey: var(--yuzey, #fff);
    --hz-gri: var(--t-gri-100, #f3f4f6);

    display: grid;
    gap: .5rem;
    padding: .625rem .75rem;
    border: 1px solid var(--hz-cizgi);
    border-radius: 12px;
    background: var(--hz-yuzey);
    color: var(--hz-metin);
    font-size: .875rem;
}

.hz *, .hz *::before, .hz *::after { box-sizing: border-box; }
.hz [hidden] { display: none !important; }
.hz button { font-family: inherit; color: inherit; }

.hz-satir { display: flex; flex-wrap: wrap; align-items: flex-end; gap: .5rem .875rem; }
.hz-grup { display: grid; gap: .2rem; }
.hz-baslik { color: var(--hz-ikincil); font-size: .75rem; line-height: 1; }
.hz-dugmeler { display: flex; gap: 4px; }

.hz-dugme { display: grid; place-items: center; width: 40px; height: 40px; padding: 0; border: 1px solid var(--hz-cizgi); border-radius: 8px; background: var(--hz-yuzey); cursor: pointer; transition: border-color .15s, background-color .15s; }
.hz-dugme svg { display: block; width: 22px; height: 22px; }
.hz-dugme:disabled { opacity: .38; cursor: not-allowed; }

/* Mobilde Geçmiş, Yatay ve Dikey tek satıra sığsın diye düğmeler bu bileşende kalır */
@media (hover: hover) {
    .hz-dugme:hover:not(:disabled) { border-color: var(--hz-vurgu); background: var(--hz-vurgu-zemin); }
}

.hz-secmeli { display: inline-flex; padding: 3px; border-radius: 10px; background: var(--hz-gri); }
.hz-secmeli button { min-height: 34px; padding: 0 .625rem; border: 0; border-radius: 7px; background: transparent; color: var(--hz-ikincil); font-size: .8125rem; font-weight: 600; white-space: nowrap; cursor: pointer; }
.hz-secmeli button[aria-pressed="true"] { background: var(--hz-yuzey); color: var(--hz-metin); box-shadow: 0 1px 2px rgb(0 0 0 / .14); }
.hz-secmeli button:disabled { opacity: .45; cursor: not-allowed; }

.hz-sag { display: flex; align-items: center; gap: .375rem; margin-left: auto; }
.hz-metin { min-height: 34px; padding: 0 .625rem; border: 1px solid var(--hz-cizgi); border-radius: 8px; background: var(--hz-yuzey); font-size: .8125rem; font-weight: 600; white-space: nowrap; cursor: pointer; }
.hz-metin[aria-pressed="true"] { border-color: var(--hz-vurgu); background: var(--hz-vurgu-zemin); }
.hz-metin:disabled { opacity: .45; cursor: not-allowed; }
.hz-dugmeler .hz-metin { min-height: 40px; }

.hz-cetvel-dugme { display: flex; align-items: center; gap: .375rem; height: 40px; padding: 0 .75rem; border: 1px solid var(--hz-cizgi); border-radius: 8px; background: var(--hz-yuzey); font-weight: 600; cursor: pointer; }
.hz-cetvel-dugme svg { display: block; width: 22px; height: 22px; }
.hz-cetvel-dugme[aria-pressed="true"] { border-color: var(--hz-vurgu); background: var(--hz-vurgu); color: #fff !important; }

.hz-cetvel-arac { display: flex; flex-wrap: wrap; align-items: center; gap: .375rem .5rem; color: var(--hz-ikincil); font-size: .8125rem; }
.hz-bilgi { margin: 0; color: var(--hz-ikincil); font-size: .8125rem; font-variant-numeric: tabular-nums; }

.hz button:focus-visible { outline: 2px solid var(--hz-vurgu); outline-offset: 2px; }

/* Cetvel ve kılavuzlar: kartın çevresinde. .sahne'deki perspective konum kapsayıcısı olmasın diye kart-kap göreli */
.kart-kap { position: relative; }
.hz-cetvelli { margin: 22px 0 0 22px; }
.kart-kap.hz-cetvelli { width: calc(100% - 22px); }
.sahne--folyo .kart-kap.hz-cetvelli { width: min(calc(100% - 22px), 360px); }

.hz-cetvel, .hz-cetvel-kose, .hz-merkez, .hz-guvenli { display: none; }
.hz-cetvelli > .hz-cetvel, .hz-cetvelli > .hz-cetvel-kose { display: block; }
.hz-cetvelli .hz-merkez, .hz-cetvelli .hz-guvenli { display: block; }

.hz-cetvel { position: absolute; z-index: 4; touch-action: none; }
.hz-cetvel--ust { top: -22px; left: 0; width: 100%; height: 22px; cursor: s-resize; }
.hz-cetvel--sol { top: 0; left: -22px; width: 22px; height: 100%; cursor: e-resize; }
.hz-cetvel-kose { position: absolute; top: -22px; left: -22px; z-index: 4; width: 22px; height: 22px; background: #dce3ea; color: #334155; font: 600 9px/22px system-ui, "Segoe UI", sans-serif; text-align: center; }

.hz-katman { position: absolute; inset: 0; z-index: 3; overflow: hidden; pointer-events: none; }
.hz-merkez { position: absolute; }
.hz-merkez--dik { top: 0; bottom: 0; left: 50%; border-left: 1px dashed rgb(49 117 144 / .6); }
.hz-merkez--yatay { top: 50%; right: 0; left: 0; border-top: 1px dashed rgb(49 117 144 / .6); }
.hz-guvenli { position: absolute; border: 1px dashed rgb(49 117 144 / .75); border-radius: 3px; }

.hz-yapis { position: absolute; display: block; background: #ec4899; }
.hz-yapis[hidden] { display: none; }
.hz-yapis--dik { top: 0; bottom: 0; width: 1px; }
.hz-yapis--yatay { right: 0; left: 0; height: 1px; }

.hz-kilavuz { position: absolute; display: block; padding: 0; border: 0; background: transparent; pointer-events: auto; touch-action: none; }
.hz-kilavuz[hidden] { display: none; }
.hz-kilavuz--dik { top: 0; bottom: 0; width: 11px; margin-left: -5px; cursor: ew-resize; }
.hz-kilavuz--yatay { right: 0; left: 0; height: 11px; margin-top: -5px; cursor: ns-resize; }
.hz-kilavuz::before { content: ""; position: absolute; background: #0ea5e9; }
.hz-kilavuz--dik::before { top: 0; bottom: 0; left: 5px; width: 1px; }
.hz-kilavuz--yatay::before { top: 5px; right: 0; left: 0; height: 1px; }
.hz-kilavuz span { position: absolute; top: 4px; left: 8px; display: none; padding: 1px 5px; border-radius: 4px; background: #0369a1; color: #fff; font: 600 11px/1.3 system-ui, "Segoe UI", sans-serif; white-space: nowrap; }
.hz-kilavuz--yatay span { left: auto; right: 6px; top: 8px; }
.hz-kilavuz:hover span, .hz-kilavuz:focus-visible span, .hz-kilavuz--tasiniyor span { display: block; }
.hz-kilavuz:focus-visible { outline: 2px solid #0369a1; outline-offset: -2px; }

@media (max-width: 640px) {
    .hz { padding: .5rem; }
    .hz-dugme { width: 44px; height: 44px; }
    .hz-secmeli button { min-height: 40px; padding: 0 .5rem; }
    .hz-sag { width: 100%; margin-left: 0; }
    .hz-metin { min-height: 44px; }
    .hz-cetvel-dugme { height: 44px; margin-left: auto; }
}
