/* 3D katalog sayfası (makine) — portal üst çubuğunun altında tam ekran */
:root { --vp-bg: radial-gradient(ellipse at 50% 35%, #ffffff 0%, #eef1f5 55%, #e3e8ef 100%); --vp-solid: #eef1f5;
        --unit-bg: #fef3e7; --unit: #a15400; --vid-bg: #f3e8ff; --vid: #6b21a8; }
:root[data-theme="dark"] { --vp-bg: radial-gradient(ellipse at 50% 35%, #3a4352 0%, #232a35 55%, #161b23 100%); --vp-solid: #232a35;
        --unit-bg: #33240f; --unit: #f0a65a; --vid-bg: #2a1840; --vid: #d8b4fe; }
body.viewer { overflow: hidden; }
.viewer-page { display: grid; grid-template-columns: minmax(0, 1fr) clamp(340px, 28vw, 420px); height: calc(100vh - 58px); min-height: 0; }
.viewer-page .vp { position: relative; min-height: 0; overflow: hidden;
  background: var(--vp-bg); }
.viewer-page .vp canvas { display: block; width: 100%; height: 100%; touch-action: none; }
.vp .machine-title { position: absolute; top: 12px; left: 12px; right: 12px; display: flex; gap: 10px; align-items: center;
  flex-wrap: wrap; pointer-events: none; }
.vp .machine-title > * { pointer-events: auto; }
.vp .chip { background: var(--chip); border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; font-size: 13px; }
.vp .chip strong { font-size: 14px; }
.toolbar { position: absolute; left: 12px; bottom: 12px; right: 12px; display: flex; flex-wrap: wrap; gap: 10px; align-items: center; pointer-events: none; }
.toolbar > * { pointer-events: auto; }
.tool { display: flex; align-items: center; gap: 8px; background: var(--chip); border: 1px solid var(--line);
  border-radius: 8px; padding: 6px 10px; font-size: 13px; font-weight: 500; color: var(--text); flex-direction: row; }
.tool input[type=range] { width: 140px; accent-color: var(--brand); padding: 0; border: 0; }
.tool input[type=checkbox] { accent-color: var(--brand); }
button.tool { cursor: pointer; font: inherit; font-size: 13px; }
#tooltip { position: absolute; pointer-events: none; background: #111827; color: #fff; font-size: 12px; padding: 6px 8px;
  border-radius: 6px; max-width: 300px; transform: translate(12px, 12px); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; z-index: 3; }
#tooltip .code { color: #fbbf77; margin-right: 6px; font-family: var(--font-mono); }
#overlay { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; padding: 24px; color: var(--muted); background: var(--vp-solid); }
#overlay.error { color: var(--err); }

.viewer-page aside { background: var(--surface); border-left: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; }
.tabs { display: flex; border-bottom: 1px solid var(--line); padding: 0 8px; flex: 0 0 auto; }
.tabs button { border: 0; background: none; padding: 13px 14px 11px; font: inherit; font-weight: 500; font-size: 14px; color: var(--muted);
  border-bottom: 2px solid transparent; margin-bottom: -1px; cursor: pointer; }
.tabs button.active { color: var(--text); border-bottom-color: var(--brand); }
.badge-n { background: var(--accent); color: #fff; border-radius: 999px; font-size: 11px; padding: 1px 6px; margin-left: 4px; }
.tab-pane { display: flex; flex-direction: column; min-height: 0; flex: 1; overflow: hidden; }
.tab-pane.scroll { overflow-y: auto; padding: 16px; gap: 14px; }

#detail { padding: 16px; border-bottom: 1px solid var(--line); flex: 0 0 auto; }
@media (min-width: 961px) { #detail { max-height: 46vh; overflow-y: auto; overscroll-behavior: contain; } }
.detail-head { display: flex; justify-content: space-between; align-items: start; gap: 8px; }
#detail .code { font-family: var(--font-mono); font-size: 13px; color: var(--link);
  background: color-mix(in srgb, var(--brand) 12%, var(--tint)); padding: 3px 8px; border-radius: 6px; word-break: break-all; }
#detail h2 { margin: 10px 0 6px; font-size: 18px; line-height: 1.3; }
.unit-badge { display: inline-block; font-size: 12px; background: var(--unit-bg); color: var(--unit); padding: 2px 8px; border-radius: 999px; }
.desc { margin: 8px 0; color: var(--text-2); font-size: 14px; }
dl.meta { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; margin: 10px 0 14px; font-size: 13px; }
dl.meta dt { color: var(--muted); } dl.meta dd { margin: 0; word-break: break-word; }
.price { font-size: 18px; font-weight: 700; margin: 4px 0 10px; }
.buy { display: flex; gap: 8px; }
.buy .btn.primary { flex: 1; }
.stepper { display: flex; border: 1px solid var(--line-strong); border-radius: 8px; overflow: hidden; }
.stepper button { width: 34px; border: 0; background: var(--soft); color: var(--text); font-size: 16px; cursor: pointer; }
.stepper input { width: 52px; border: 0; border-radius: 0; text-align: center; padding: 6px; -moz-appearance: textfield; }
.stepper input::-webkit-inner-spin-button { -webkit-appearance: none; }
.detail-actions { display: flex; gap: 6px; margin-top: 10px; flex-wrap: wrap; }
.icon-btn { font-size: 20px; }

.list-head { padding: 12px 16px 8px; display: flex; flex-direction: column; gap: 8px; }
.list-head .row1 { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.list-head h3 { margin: 0; font-size: 14px; }
#list-count { font-size: 12px; color: var(--muted); }
#search { width: 100%; }
#part-list { list-style: none; margin: 0; padding: 0 8px 12px; overflow-y: auto; flex: 1; min-height: 0; }
#part-list .prow { width: 100%; display: flex; gap: 12px; align-items: center; justify-content: space-between;
  text-align: left; border: 0; background: transparent; padding: 7px 10px; border-radius: 8px; cursor: pointer; font: inherit; min-height: 38px; }
#part-list .prow { color: var(--text); }
#part-list .prow:hover { background: var(--soft); }
#part-list .prow.active { background: color-mix(in srgb, var(--accent) 16%, var(--tint)); box-shadow: inset 3px 0 0 var(--accent); }
#part-list .ptext { display: flex; flex-direction: column; min-width: 0; gap: 1px; }
#part-list .code { font-family: var(--font-mono); font-size: 11.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#part-list .name { font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#part-list .qty { font-size: 12px; color: var(--muted); white-space: nowrap; flex: 0 0 auto; }
#part-list .empty { padding: 16px; color: var(--muted); font-size: 13px; }

.mcard { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.mcard img { display: block; width: 100%; max-height: 200px; object-fit: contain; background: var(--soft); }
.mcard .body { padding: 14px; }
.doc-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.doc-list li { display: grid; grid-template-columns: 1fr auto; gap: 6px; align-items: center; }
.doc-list a.doc { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; padding: 10px; border: 1px solid var(--line);
  border-radius: 8px; color: inherit; }
.doc-list a.doc:hover { background: var(--soft); text-decoration: none; }
.doc-type { font-size: 11px; font-weight: 700; text-align: center; padding: 4px 0; border-radius: 6px; background: var(--indigo-bg); color: var(--indigo); }
.doc-type.pdf { background: var(--err-bg); color: var(--err); } .doc-type.gorsel { background: var(--info-bg); color: var(--info); }
.doc-type.video { background: var(--vid-bg); color: var(--vid); }
.doc-size { font-size: 12px; color: var(--muted); }

.svc { display: flex; flex-direction: column; gap: 10px; }
.thumbs { display: flex; flex-wrap: wrap; gap: 8px; }
.thumbs figure { margin: 0; position: relative; width: 72px; height: 72px; border-radius: 8px; overflow: hidden; border: 1px solid var(--line); }
.thumbs img { width: 100%; height: 100%; object-fit: cover; }
.thumbs button { position: absolute; top: 2px; right: 2px; width: 22px; height: 22px; border-radius: 999px; border: 0;
  background: rgba(17,24,39,.75); color: #fff; font-size: 14px; line-height: 1; padding: 0; cursor: pointer; }
.req-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.req-list a { display: grid; gap: 2px; border: 1px solid var(--line); border-radius: 8px; padding: 10px; font-size: 13px; color: inherit; }
.req-list a:hover { background: var(--soft); text-decoration: none; }
.req-list .top { display: flex; justify-content: space-between; gap: 8px; font-weight: 600; }

#cart { position: fixed; top: 0; right: 0; bottom: 0; width: min(420px, 100vw); background: var(--surface); box-shadow: var(--shadow-lg);
  transform: translateX(105%); transition: transform .22s ease; display: flex; flex-direction: column; z-index: 20; }
#cart.open { transform: none; }
.cart-head { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.cart-head h2 { margin: 0; font-size: 17px; }
#cart-items { list-style: none; margin: 0; padding: 8px 16px; overflow-y: auto; flex: 1; }
.cart-row { display: grid; grid-template-columns: 1fr 64px auto; gap: 8px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.cart-row .linklike { border: 0; background: none; text-align: left; padding: 0; display: flex; flex-direction: column; gap: 2px; min-width: 0; cursor: pointer; font: inherit; }
.cart-row .code { font-family: var(--font-mono); font-size: 12px; color: var(--link); }
.cart-row .name { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cart-row .lp { font-size: 12px; color: var(--muted); }
.cart-row input { width: 64px; text-align: center; padding: 6px; }
#cart-empty { color: var(--muted); padding: 24px 16px; font-size: 14px; }
.cart-foot { border-top: 1px solid var(--line); padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; }
#cart-summary { font-size: 13px; color: var(--muted); }
#backdrop { position: fixed; inset: 0; background: rgba(16,24,40,.3); z-index: 15; }
.cart-btn { position: relative; }
.cart-btn .count { margin-left: 4px; }
.cart-btn.bump { animation: bump .35s ease; }
@keyframes bump { 40% { transform: scale(1.08); } }

dialog { border: 0; border-radius: 14px; padding: 0; background: var(--surface); color: var(--text); width: min(520px, 94vw); box-shadow: var(--shadow-lg); }
dialog::backdrop { background: rgba(16,24,40,.4); }
.dlg { padding: 20px; display: flex; flex-direction: column; gap: 12px; }
.dlg h2 { margin: 0; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; }
.qr-box img { width: 240px; height: 240px; margin: 0 auto; image-rendering: pixelated; display: block; }

#toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: #111827; color: #fff; padding: 10px 16px;
  border-radius: 8px; font-size: 14px; z-index: 30; opacity: 0; transition: opacity .2s; pointer-events: none; }
#toast.show { opacity: 1; }

@media (max-width: 900px) {
  body.viewer { overflow: auto; }
  .viewer-page { grid-template-columns: minmax(0, 1fr); grid-template-rows: 55vh auto; height: auto; }
  .viewer-page aside { border-left: 0; border-top: 1px solid var(--line); min-height: 60vh; }
}

/* --- sağ tık menüsü ve görünürlük */
.ctx-menu { position: fixed; z-index: 60; min-width: 220px; max-width: 300px; background: var(--surface); color: var(--text);
            border: 1px solid var(--line-strong); border-radius: 10px; box-shadow: var(--shadow-lg); padding: 5px; font-size: 13px; }
.ctx-head { display: flex; flex-direction: column; gap: 1px; padding: 6px 10px 7px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.ctx-head .code { font-family: var(--font-mono); font-size: 12px; color: var(--link); }
.ctx-head span:not(.code) { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ctx-item { display: flex; width: 100%; justify-content: space-between; align-items: center; gap: 16px; border: 0; background: none;
            color: inherit; font: inherit; text-align: left; padding: 7px 10px; border-radius: 6px; cursor: pointer; }
.ctx-item:hover, .ctx-item:focus-visible { background: var(--soft); outline: none; }
.ctx-item:focus { outline: none; }
.ctx-item kbd { font-family: var(--font-mono); font-size: 11px; color: var(--muted); border: 1px solid var(--line);
                border-radius: 4px; padding: 0 5px; background: var(--surface-2); }
.ctx-menu hr { border: 0; border-top: 1px solid var(--line); margin: 4px 2px; }
.tool-accent { color: var(--link); font-weight: 600; cursor: pointer; }
.tool-hint { font-size: 12px; color: var(--muted); background: var(--chip); border-radius: 6px; padding: 4px 8px; }
#part-list .prow.is-hidden { opacity: .45; }
#part-list .prow.is-hidden .name::after { content: " · gizli"; color: var(--muted); font-size: 11px; }
@media (hover: none) { .tool-hint { display: none; } }

/* --- liste / ağaç seçici */
.seg { display: inline-flex; border: 1px solid var(--line-strong); border-radius: 8px; overflow: hidden; background: var(--surface); }
.seg button { border: 0; background: none; color: var(--muted); font: inherit; font-size: 13px; font-weight: 600; padding: 5px 10px; cursor: pointer; }
.seg button + button { border-left: 1px solid var(--line); }
.seg button.on { background: color-mix(in srgb, var(--brand) 14%, var(--tint)); color: var(--link); }
.seg.small button { padding: 3px 9px; font-size: 12px; }
/* --- montaj ağacı */
.tree { list-style: none; margin: 0; padding: 4px 0 12px; }
.trow { display: flex; align-items: center; gap: 4px; padding: 3px 10px 3px calc(8px + var(--d, 0) * 16px); font-size: 13px; cursor: pointer;
        border-radius: 6px; margin: 0 6px; min-height: 30px; }
.trow:hover { background: var(--soft); }
.trow.active { background: color-mix(in srgb, var(--accent) 16%, var(--tint)); }
.trow.node .tname { font-weight: 600; }
.trow .tname { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.trow .tname .code { font-family: var(--font-mono); font-size: 12px; color: var(--text-2); }
.trow .tcount { font-size: 12px; color: var(--muted); }
.trow .caret { width: 20px; height: 20px; border: 0; background: none; color: var(--muted); cursor: pointer; padding: 0; flex: 0 0 20px; }
.trow .caret::before { content: "▸"; display: inline-block; transition: transform .12s; }
.trow .caret.open::before { transform: rotate(90deg); }
.trow .caret.none::before { content: ""; }
.eye { width: 24px; height: 24px; border: 0; background: none; color: var(--muted); cursor: pointer; padding: 3px; flex: 0 0 24px; border-radius: 5px; }
.eye svg { width: 16px; height: 16px; display: block; }
.eye:hover { background: var(--line); color: var(--text); }
.eye.off { color: var(--text-3); }
.eye.part { color: var(--warn); }
.trow:has(.eye.off) .tname { opacity: .5; }
/* --- menü alt başlığı */
.ctx-sub { padding: 6px 10px 2px; font-size: 12px; font-weight: 500; color: var(--muted); }
/* --- kesit aracı */
#btn-section.on { color: var(--link); border-color: var(--brand); font-weight: 600; }
.section-tool { gap: 8px; padding: 4px 8px; }
.section-tool input[type=range] { width: 160px; accent-color: var(--accent); }
.section-tool .icon-btn { font-size: 18px; padding: 0 4px; }
.linklike { border: 0; background: none; color: var(--link); font: inherit; font-size: 13px; cursor: pointer; padding: 2px 4px; }
/* --- önerilen setler */
.kits { padding: 12px 16px 4px; border-bottom: 1px solid var(--line); }
.kits-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: var(--text); margin-bottom: 8px; }
.kits-head .linklike { text-transform: none; letter-spacing: 0; font-size: 12px; }
.kit { border: 1px solid var(--line); border-radius: 8px; margin-bottom: 8px; background: var(--surface); }
.kit summary { display: flex; justify-content: space-between; gap: 10px; padding: 9px 12px; cursor: pointer; list-style: none; }
.kit summary::-webkit-details-marker { display: none; }
.kit summary::before { content: "▸"; color: var(--muted); margin-right: -4px; transition: transform .12s; }
.kit[open] summary::before { transform: rotate(90deg); }
.kit-name { font-weight: 600; flex: 1; }
.kit-meta { font-size: 12px; color: var(--muted); white-space: nowrap; }
.kit > p, .kit > .detail-actions { margin: 0 12px 10px; }
.kit-items { list-style: none; margin: 0 0 10px; padding: 0 6px; }
.kit-items li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 6px 8px; font-size: 13px; border-radius: 6px; cursor: pointer; }
.kit-items li:hover { background: var(--soft); }
.kit-items li.missing { cursor: default; opacity: .55; }
.kit-items .ptext { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.kit-items .code { font-family: var(--font-mono); font-size: 11.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kit-items .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kit-items .qty { color: var(--muted); font-size: 12px; }

.view-seg { padding: 0; gap: 0; }
.view-seg button { padding: 6px 9px; }

/* --- makine sekmesi: garanti ve yaşam döngüsü */
.life { display: flex; flex-direction: column; gap: 10px; }
.warranty { border-radius: 10px; padding: 12px 14px; border: 1px solid var(--line); }
.warranty .w-title { font-weight: 700; }
.w-kapsamda { background: var(--ok-bg); border-color: var(--ok-line); color: var(--ok); }
.w-yakinda { background: var(--warn-bg); border-color: var(--warn-line); color: var(--warn); }
.w-bitti { background: var(--gray-bg); color: var(--gray); }
.w-baslamadi { background: var(--info-bg); border-color: var(--info-line); color: var(--info); }
.mini-timeline { list-style: none; margin: 0; padding: 0 0 0 14px; border-left: 2px solid var(--line-strong); display: flex; flex-direction: column; gap: 6px; }
.mini-timeline li { display: flex; justify-content: space-between; font-size: 13px; position: relative; }
.mini-timeline li::before { content: ""; position: absolute; left: -20px; top: 5px; width: 10px; height: 10px; border-radius: 50%; background: var(--ok); }
.mini-timeline li.future::before { background: var(--surface); border: 2px solid var(--blue); width: 6px; height: 6px; }
.mini-timeline li span:last-child { color: var(--muted); font-variant-numeric: tabular-nums; }
.punch-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.punch-list li { display: flex; flex-direction: column; gap: 2px; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; font-size: 13px; }

.kit-kind { font-size: 11px; font-weight: 700; border-radius: 99px; padding: 1px 8px; white-space: nowrap; align-self: center; }
.k-kritik { background: var(--err-bg); color: var(--err); }
.k-standart { background: var(--blue-bg); color: var(--blue); }
.k-bakim { background: var(--ok-bg); color: var(--ok); }
.k-ozel { background: var(--gray-bg); color: var(--gray); }
.kit-kritik { border-color: var(--err-line); }
.kit summary { flex-wrap: wrap; }
.kit-editor { display: flex; flex-direction: column; gap: 8px; padding-bottom: 10px; }
.kit-row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.kit-items.edit li { cursor: default; }
.kit-items.edit li > .code { flex: 1; cursor: pointer; color: var(--text); font-family: var(--font); font-size: 13px; }
.kit-items.edit input { width: 64px; flex: 0 0 64px; }
.kit-items.edit .code { cursor: pointer; }
.kit-items.edit input { padding: 3px 6px; text-align: right; }
.kit-banner { position: absolute; top: 56px; left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: 8px;
              background: var(--surface); border: 2px solid var(--accent); border-radius: 10px; padding: 6px 8px 6px 14px; box-shadow: var(--shadow-lg);
              font-size: 13px; z-index: 6; white-space: nowrap; }
#part-list .prow.in-kit { background: color-mix(in srgb, var(--accent) 16%, var(--tint)); }
#part-list .prow.in-kit .name::after { content: " · pakette"; color: var(--accent); font-size: 11px; font-weight: 700; }

/* teklif paneli */
.q-panel { background: color-mix(in srgb, var(--brand, #0f5bd7) 5%, var(--surface)); }
.q-panel .q-hint { margin: -2px 0 8px; }
.q-items li.on { background: color-mix(in srgb, var(--accent) 18%, var(--tint)); }
.q-items .price { font-size: 12px; white-space: nowrap; text-align: right; }
.q-total { display: flex; justify-content: space-between; padding: 6px 12px 10px; font-size: 13px; border-top: 1px dashed var(--line); }
.q-panel .detail-actions { margin-bottom: 10px; flex-wrap: wrap; }

/* üst çubuk sepet düğmesi */
.cart-btn { height: 34px; }
.cart-btn .ico { width: 17px; height: 17px; }
@media (max-width: 960px) { .cart-btn > span:not(.count) { display: none; } .nav a span { display: none; } .viewer-page { height: auto; } }
@media (max-width: 640px) {
  #fault-open > span { display: none; }                      /* telefonda yalnız simge; başlık sığsın */
  .topbar { gap: 6px; padding: 0 10px; }
  .topbar .brand-name, .topbar .brand span { display: none; }
  .kits-head, .kit summary { flex-wrap: wrap; }
  .list-head .row1 { flex-wrap: wrap; }
}
@media (max-width: 640px) {
  .toolbar { flex-wrap: nowrap; overflow-x: auto; left: 8px; right: 8px; bottom: 8px; gap: 6px; padding-bottom: 2px; scrollbar-width: none; }
  .toolbar::-webkit-scrollbar { display: none; }
  .toolbar > * { flex: 0 0 auto; }
  .tool-hint, label.tool:has(#focus-mode) { display: none; }
  .tool input[type=range] { width: 90px; }
  .vp .machine-title { top: 8px; left: 8px; right: 8px; gap: 6px; }
  .vp .machine-title .chip:not(:first-child) { display: none; }
}

/* ---------------------------------------------------------------- sol araç çubuğu (fare modları, görünüm, kesit, patlatma) */
.rail { position: absolute; left: 12px; top: 58px; display: flex; flex-direction: column; gap: 8px; z-index: 4; }
.rail-group { display: flex; flex-direction: column; gap: 2px; background: var(--chip); border: 1px solid var(--line); border-radius: 11px;
              padding: 3px; box-shadow: var(--shadow); backdrop-filter: blur(8px); }
.rail-btn { position: relative; width: 38px; height: 38px; border: 0; background: none; border-radius: 8px; display: grid; place-items: center;
            color: var(--text-2); cursor: pointer; padding: 0; }
.rail-btn svg { width: 19px; height: 19px; stroke: currentColor; fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.rail-btn:hover { background: var(--soft); color: var(--text); }
.rail-btn[aria-pressed="true"], .rail-btn.on { background: color-mix(in srgb, var(--brand) 16%, var(--tint)); color: var(--link); }
.rail-btn[data-mode="free"][aria-pressed="true"] { background: var(--soft); color: var(--text); }
.rail-btn:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }
.rail-btn::after { content: attr(data-tip); position: absolute; left: calc(100% + 12px); top: 50%; transform: translateY(-50%); background: #111827; color: #fff;
                   font-size: 12px; font-weight: 500; padding: 5px 9px; border-radius: 6px; white-space: nowrap; pointer-events: none; opacity: 0;
                   transition: opacity .12s .25s; z-index: 10; }
.rail-btn:hover::after { opacity: 1; }
.rail-fly { position: absolute; z-index: 5; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-lg);
            padding: 10px 12px 12px; min-width: 220px; display: flex; flex-direction: column; gap: 10px; }
.rail-fly.section-tool { gap: 10px; padding: 10px 12px 12px; }
.fly-title { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-size: 13px; font-weight: 600; color: var(--text); }
.fly-title .icon-btn { width: 24px; height: 24px; font-size: 16px; }
.fly-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; }
.fly-grid button { display: flex; justify-content: space-between; align-items: center; gap: 8px; border: 1px solid var(--line); background: var(--surface);
                   color: var(--text); border-radius: 7px; padding: 6px 9px; font: inherit; font-size: 13px; cursor: pointer; }
.fly-grid button:hover { border-color: var(--brand); background: var(--soft); }
.fly-grid kbd, .ctx-item kbd { font-family: var(--font-mono); font-size: 11px; color: var(--muted); }
.rail-fly input[type=range] { width: 100%; accent-color: var(--brand); }
.rail-fly .seg { align-self: flex-start; }
.vp-chips { position: absolute; left: 64px; bottom: 12px; display: flex; gap: 8px; z-index: 3; }
.vp .tool-hint { position: absolute; right: 12px; bottom: 12px; z-index: 3; }
.mode-hint { position: absolute; bottom: 14px; left: 50%; transform: translateX(-50%); background: #111827; color: #fff; padding: 7px 14px;
             border-radius: 999px; font-size: 13px; display: flex; gap: 12px; align-items: center; z-index: 4; box-shadow: var(--shadow-lg); white-space: nowrap; }
.mode-hint .kbd { opacity: .65; font-size: 12px; }
.zoom-box { position: absolute; border: 1.5px dashed var(--brand); background: color-mix(in srgb, var(--brand) 10%, transparent); pointer-events: none; z-index: 4; }
.vp[data-mode="rotate"] canvas { cursor: grab; } .vp[data-mode="rotate"] canvas:active { cursor: grabbing; }
.vp[data-mode="pan"] canvas { cursor: move; }
.vp[data-mode="zoom"] canvas { cursor: ns-resize; }
.vp[data-mode="area"] canvas { cursor: crosshair; }
@media (hover: none) { .rail-group[role="radiogroup"], .rail-btn::after { display: none; } }
@media (max-width: 640px) {
  .rail { top: auto; bottom: 8px; left: 8px; right: 8px; flex-direction: row; overflow-x: auto; scrollbar-width: none; }
  .rail-group { flex-direction: row; }
  .rail-btn::after { display: none; }
  .rail-fly { left: 8px !important; right: 8px; top: auto !important; bottom: 62px; }
  .vp-chips { left: 8px; bottom: 62px; }
  .mode-hint { display: none; }
}
.vp[data-mode]:not([data-mode="free"]) .tool-hint { display: none; }

/* tek parça penceresi (teklif kaleminden ?tek=1) */
body.viewer.single .topbar, body.viewer.single aside, body.viewer.single .tool-hint { display: none !important; }
body.viewer.single .viewer-page { grid-template-columns: 1fr; height: 100vh; grid-template-rows: none; }
body.viewer.single .machine-title .chip.part-chip { background: var(--brand); color: #fff; }
.q-items li { position: relative; }
.q-items .q-rm { width: 24px; height: 24px; font-size: 16px; opacity: .55; flex: 0 0 auto; }
.q-items li:hover .q-rm, .q-items .q-rm:focus-visible { opacity: 1; }
body.viewer.single .demo-bar { display: none !important; }

/* müşteri akışı düzeltmeleri */
#cart { z-index: 1001; }
#backdrop { z-index: 1000; }
body.viewer .demo-bar { right: auto; left: 70px; }
.svc-title { margin: 0 0 4px; font-size: 16px; }
.done-box { background: var(--ok-bg); color: var(--text); border: 1px solid color-mix(in srgb, var(--ok) 30%, transparent); border-radius: 10px;
            padding: 14px 16px; display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.done-box strong { color: var(--ok); }
.done-box p { margin: 0; font-size: 13.5px; line-height: 1.45; }
#part-list li { display: flex; align-items: stretch; }
#part-list li .prow { flex: 1; min-width: 0; }
.padd { flex: 0 0 auto; width: 30px; margin: 3px 4px 3px 2px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface);
        color: var(--link); font: inherit; font-weight: 600; font-size: 15px; cursor: pointer; display: grid; place-items: center; }
.padd:hover { border-color: var(--brand); background: var(--soft); }
.padd.in { background: var(--brand); border-color: var(--brand); color: #fff; font-size: 12px; }
.kb-suggest { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin-bottom: 14px; background: var(--soft, #f4f6f8); font-size: 14px; }
.kb-suggest summary { cursor: pointer; font-weight: 600; }
.kb-suggest ul { margin: 8px 0; padding-left: 18px; display: grid; gap: 6px; }

/* 3D açılamadığında: model alanı küçük bir bilgi kutusuna döner, liste ve formlar tam çalışır */
.no3d .rail, .no3d .rail-fly, .no3d .vp-chips, .no3d .vp .tool-hint, .no3d [data-listmode="tree"] { display: none !important; }
.no3d .viewer-page .vp { display: flex; flex-direction: column; justify-content: flex-end; min-height: 200px; }
.no3d .vp .machine-title { position: static; padding: 12px 12px 0; }
.no3d-note { margin: 12px; padding: 16px 18px; border: 1px dashed var(--line-strong, var(--line)); border-radius: 12px; background: var(--surface);
  display: flex; flex-direction: column; gap: 6px; font-size: 14px; color: var(--text-2, var(--text)); max-width: 560px; }
.no3d-note strong { color: var(--text); font-size: 15px; }
.no3d-note .small { color: var(--muted); font-size: 13px; }
@media (min-width: 961px) { .no3d .viewer-page .vp { justify-content: center; align-items: center; } }
@media (max-width: 960px) { .no3d .viewer-page { grid-template-rows: auto auto; } .no3d .viewer-page .vp { min-height: 0; } }
.no3d .viewer-page { grid-template-columns: minmax(0, 0.8fr) minmax(420px, 1.2fr); } @media (max-width: 960px) { .no3d .viewer-page { grid-template-columns: minmax(0, 1fr); } }
.no3d label.check:has(input[name="with_view"]) { display: none; }
.maint-link { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 14px; margin-bottom: 12px;
  border: 1px solid var(--line); border-radius: 10px; color: var(--text); text-decoration: none; background: var(--surface-2, var(--surface)); }
.maint-link:hover { border-color: var(--brand); text-decoration: none; }
.maint-link > span:first-child { display: flex; flex-direction: column; gap: 2px; }
.maint-link .small { color: var(--muted); }
.maint-link.due-gecikti { border-color: var(--err); } .maint-link.due-gecikti .small { color: var(--err); }
.maint-link.due-yaklasiyor { border-color: var(--warn); }
/* Üreticideki ilgili kişiler (makine sekmesi) */
.oem-contacts { border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px 6px; margin-bottom: 12px; }
.oem-contacts h3 { margin: 0 0 4px; font-size: 14px; }
.oem-contacts ul { list-style: none; margin: 0; padding: 0; }
.oem-contacts li { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 2px 10px; padding: 8px 0; border-top: 1px solid var(--line); font-size: 14px; }
.oem-contacts li:first-child { border-top: 0; }
.oem-contacts .oc-role { color: var(--muted); font-size: 13px; grid-row: span 2; }
.oem-contacts .oc-name { font-weight: 500; }
.oem-contacts .oc-links { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 13px; }
.oem-contacts .oc-links a { color: var(--link, var(--brand)); word-break: break-all; }
/* Makineye özel videolar */
.video-list { display: flex; flex-direction: column; gap: 12px; margin: 6px 0 10px; }
.video-item { margin: 0; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--surface-2, var(--surface)); }
.video-item video { display: block; width: 100%; max-height: 320px; background: #000; }
.video-item figcaption { display: flex; flex-direction: column; gap: 2px; padding: 8px 12px; font-size: 14px; }
.video-item .doc { margin: 10px 12px 0; }

/* Parça detayı: uygunluk rozeti */
.fit-badge { display: flex; gap: 9px; align-items: flex-start; margin: 2px 0 10px; padding: 8px 10px; border-radius: 6px;
  font-size: 13px; font-weight: 600; line-height: 1.3; border: 1px solid; }
.fit-badge small { display: block; font-weight: 400; font-size: 12px; opacity: .85; margin-top: 2px; }
.fit-badge .fit-ic { flex: none; width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; color: #fff; }
.fit-badge.ok { background: #eaf6ee; border-color: #b9dfc5; color: #1f5e33; }
.fit-badge.ok .fit-ic { background: #2e8b4e; }
.fit-badge.warn { background: #fff5e6; border-color: #f0d29e; color: #7a4d06; }
.fit-badge.warn .fit-ic { background: #c98a12; }

/* İlk kullanım: 3 adım */
.coach { position: absolute; left: 14px; bottom: 14px; z-index: 6; width: min(290px, calc(100% - 28px)); background: var(--panel, #fff);
  border: 1px solid var(--line, #d9dde0); border-radius: 10px; box-shadow: 0 8px 28px rgba(20, 30, 40, .16); padding: 10px 12px 12px; font-size: 13px; }
.coach-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.coach ol { list-style: none; margin: 0; padding: 0; counter-reset: c; display: grid; gap: 6px; }
.coach li { display: flex; gap: 9px; align-items: flex-start; color: var(--muted, #6b737a); counter-increment: c; }
.coach li small { display: block; font-size: 12px; opacity: .85; }
.coach .coach-n { flex: none; width: 20px; height: 20px; border-radius: 50%; border: 1.5px solid currentColor; display: grid; place-items: center; font-size: 11px; font-weight: 700; }
.coach .coach-n::before { content: counter(c); }
.coach li.now { color: var(--text, #1e2326); font-weight: 600; }
.coach li.now .coach-n { background: var(--brand, #ff7a00); border-color: var(--brand, #ff7a00); color: #fff; }
.coach li.done { text-decoration: line-through; }
.coach li.done .coach-n::before { content: '✓'; }
@media (max-width: 900px) { .coach { left: auto; right: 12px; bottom: 12px; width: min(260px, calc(100% - 24px)); } }   /* sol araç çubuğunun üstüne binmesin */
@media (max-width: 640px) { .coach { bottom: 70px; } }
@media (prefers-reduced-motion: no-preference) { .coach { animation: coach-in .35s ease-out; } @keyframes coach-in { from { opacity: 0; transform: translateY(8px); } } }

/* Çoklu seçim çubuğu */
.multi-bar { position: absolute; left: 50%; bottom: 16px; transform: translateX(-50%); z-index: 7; display: flex; gap: 14px; align-items: center;
  max-width: calc(100% - 28px); background: var(--panel, #fff); border: 1px solid var(--line, #d9dde0); border-radius: 12px;
  box-shadow: 0 10px 30px rgba(20, 30, 40, .2); padding: 10px 12px 10px 14px; flex-wrap: wrap; }
.multi-bar .mb-info { display: flex; flex-direction: column; gap: 1px; min-width: 0; font-size: 13px; }
.multi-bar .mb-info small { font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 340px; }
.multi-bar .mb-acts { display: flex; gap: 6px; flex-wrap: wrap; }
#part-list .prow.picked, #part-tree .trow.item.picked { box-shadow: inset 3px 0 0 var(--brand, #ff7a00); background: color-mix(in srgb, var(--brand, #ff7a00) 10%, transparent); }
.qc-dlg { border: 1px solid var(--line, #d9dde0); border-radius: 12px; padding: 18px; min-width: min(420px, 92vw); background: var(--panel, #fff); color: inherit; }
.qc-dlg::backdrop { background: rgba(10, 16, 22, .45); }
.qc-dlg h3 { margin: 0 0 6px; }
.qc-dlg select { width: 100%; margin: 8px 0 14px; }
.qc-dlg .qc-acts { display: flex; justify-content: flex-end; gap: 8px; }
@media (max-width: 700px) { .multi-bar { bottom: 10px; gap: 8px; } .multi-bar .mb-info small { max-width: 60vw; } }

/* Favori, müşterinin kodu, doğrudan sipariş, parça listesi kutusu */
.fav-btn { font-size: 18px; color: var(--muted, #6b737a); }
.fav-btn.on { color: #e0a100; }
.fav-mark { color: #e0a100; }
.prow .code .own { color: var(--muted, #6b737a); font-family: inherit; }
.own-code { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.own-dlg { border: 1px solid var(--line, #d9dde0); border-radius: 12px; padding: 0; background: var(--panel, #fff); color: inherit; min-width: min(380px, 92vw); }
.own-dlg::backdrop { background: rgba(10, 16, 22, .45); }
.cart-acts { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.cart-acts .btn { flex: 1 1 auto; }
#order-hint { margin: 6px 0 0; }
.order-lines { max-height: 240px; overflow: auto; margin: 4px 0 12px; border: 1px solid var(--line, #d9dde0); border-radius: 8px; }
.order-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.order-table td, .order-table th { padding: 6px 8px; border-bottom: 1px solid var(--line, #d9dde0); text-align: left; }
.order-table .right { text-align: right; white-space: nowrap; }
.order-table tfoot th { border-bottom: 0; }
.parts-list-box { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 12px; margin: 8px 0 12px;
  border: 1px solid var(--line, #d9dde0); border-radius: 8px; }
.parts-list-box > div:first-child { display: grid; gap: 2px; }

/* Araç çubuğu yazıları: her düğmenin ne yaptığı yanında yazar; "Daralt" ile yalnız simgeler kalır (tercih saklanır) */
.rail-btn:has(.rail-lbl) { width: auto; min-width: 38px; display: flex; align-items: center; justify-content: flex-start; gap: 8px; padding: 0 10px 0 9px; }
.rail-lbl { font-size: 12.5px; font-weight: 500; white-space: nowrap; line-height: 1; }
.rail-btn:has(.rail-lbl)::after { display: none; }                         /* yazı varken üstüne gelme balonu gereksiz */
.rail-toggle { align-self: flex-start; border: 1px solid var(--line); background: var(--chip); color: var(--muted); font: 500 11.5px/1 inherit;
  border-radius: 8px; padding: 6px 9px; cursor: pointer; box-shadow: var(--shadow); backdrop-filter: blur(8px); }
.rail-toggle:hover { color: var(--text); }
.rail.compact .rail-lbl { display: none; }
.rail.compact .rail-btn { width: 38px; padding: 0; justify-content: center; }
.rail.compact .rail-btn::after { display: block; }
@media (max-width: 640px) {
  .rail-toggle { display: none; }
  .rail-btn:has(.rail-lbl) { flex-direction: column; justify-content: center; gap: 3px; min-width: 56px; height: 46px; padding: 2px 4px; }
  .rail-lbl { font-size: 10px; }
}
.part-edit { min-width: min(560px, 94vw); }
.pe-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 12px; margin: 10px 0; }
.pe-grid label { display: grid; gap: 4px; font-size: 13px; }
.pe-grid input, .pe-grid select { height: 34px; padding: 0 9px; border: 1px solid var(--line, #d9dde0); border-radius: 6px; background: var(--surface, #fff); color: inherit; font: inherit; }
.pe-checks { display: grid; gap: 6px; align-content: end; }
.pe-money { padding-top: 10px; border-top: 1px solid var(--line, #d9dde0); }
@media (max-width: 560px) { .pe-grid { grid-template-columns: 1fr; } }

/* canlı demo şeridi (tanıtım sayfasından kayıtsız açılan müşteri ekranı) */
.live-demo-bar { height: 38px; display: flex; align-items: center; gap: 10px; padding: 0 16px; font-size: 13px;
  background: color-mix(in srgb, var(--primary, #2563eb) 10%, var(--surface)); border-bottom: 1px solid var(--line);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.live-demo-bar a { margin-left: auto; font-weight: 600; flex: none; }
@media (min-width: 961px) { .live-demo-bar + .viewer-page { height: calc(100vh - 96px); } }
@media (max-width: 640px) { .live-demo-bar { font-size: 12px; padding: 0 10px; } }
