* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; overflow: hidden; font: 13px/1.35 "Segoe UI", system-ui, sans-serif; color: #1f2933; background: #eef1f5; }
button { font: inherit; cursor: pointer; }
input, select, textarea { font: inherit; }
#app { display: flex; flex-direction: column; height: 100vh; }

/* Üst bar */
#top { display: flex; align-items: center; gap: 4px; padding: 4px 8px; background: #2b3440; color: #e6ebf1; height: 38px; flex: none; }
.logo { font-weight: 800; letter-spacing: 1px; font-size: 16px; margin-right: 10px; color: #fff; }
.logo b { color: #ff7a2f; }
.tb { background: transparent; border: 1px solid transparent; color: inherit; padding: 4px 8px; border-radius: 4px; }
.tb:hover { background: #3c4757; border-color: #4d5a6c; }
.sep { width: 1px; height: 20px; background: #4d5a6c; margin: 0 4px; }
.spacer { flex: 1; }
#docName { background: #3a4452; border: 1px solid #4d5a6c; color: #fff; padding: 3px 8px; border-radius: 4px; width: 200px; }
#toolCount { font-size: 12px; color: #a9b6c6; margin-right: 8px; }

/* Şerit */
#ribbon { display: flex; background: #fff; border-bottom: 1px solid #cfd6df; flex: none; }
#wsWrap { padding: 8px; border-right: 1px solid #e1e6ec; display: flex; align-items: center; }
#ws { padding: 6px 8px; border: 1px solid #b9c3cf; border-radius: 4px; font-weight: 600; background: #f7f9fb; }
#ribbonMain { flex: 1; min-width: 0; }
#tabs { display: flex; gap: 2px; padding: 2px 6px 0; border-bottom: 1px solid #e1e6ec; }
#tabs button { border: none; background: none; padding: 5px 12px; font-weight: 600; font-size: 12px; color: #52606d; border-bottom: 2px solid transparent; }
#tabs button.on { color: #0b6bcb; border-bottom-color: #0b6bcb; }
#tabs button.sk { color: #e8590c; }
#toolbar { display: flex; align-items: stretch; gap: 0; padding: 3px 4px; overflow-x: auto; min-height: 66px; }
.grp { display: flex; flex-direction: column; border-right: 1px solid #e6eaef; padding: 0 6px; }
.grp .btns { display: flex; gap: 1px; flex: 1; }
.tool { display: flex; flex-direction: column; align-items: center; justify-content: center; width: 54px; border: 1px solid transparent; background: none; border-radius: 4px; padding: 2px; font-size: 10.5px; color: #33404d; line-height: 1.1; text-align: center; }
.tool .ic { font-size: 19px; height: 24px; line-height: 24px; }
.tool:hover { background: #e9f2fc; border-color: #b8d4f2; }
.tool.off { opacity: .45; }
.tool.finish { background: #e8f6ec; border-color: #9fd3ad; color: #1d7a3a; font-weight: 700; width: 70px; }
.grp .gl { font-size: 10.5px; font-weight: 700; color: #52606d; border: none; background: none; padding: 1px 4px; border-radius: 3px; margin-top: 1px; }
.grp .gl:hover { background: #eef2f6; }

main { flex: 1; display: flex; min-height: 0; }
#browser { width: 240px; background: #fff; border-right: 1px solid #cfd6df; overflow: auto; font-size: 12.5px; flex: none; }
#browser h4 { margin: 0; padding: 7px 10px; font-size: 11px; letter-spacing: .5px; color: #6b7785; background: #f5f7fa; border-bottom: 1px solid #e6eaef; }
.node { display: flex; align-items: center; gap: 5px; padding: 3px 8px 3px 10px; cursor: default; white-space: nowrap; }
.node:hover { background: #eef5fd; }
.node.sel { background: #d6e8fb; }
.node.l1 { padding-left: 24px; }
.node .eye { cursor: pointer; width: 16px; text-align: center; opacity: .8; }
.node .eye.hid { opacity: .25; }
.node .nm { flex: 1; overflow: hidden; text-overflow: ellipsis; }
.node .dot { width: 10px; height: 10px; border-radius: 2px; border: 1px solid #0003; }
.node .tw { width: 12px; color: #6b7785; cursor: pointer; }
.node.err .nm { color: #c62828; }

#viewport { flex: 1; position: relative; min-width: 0; overflow: hidden; }
#viewport canvas { display: block; }
#viewcube { position: absolute; top: 8px; right: 8px; width: 110px; height: 110px; z-index: 3; cursor: pointer; }
#homeBtn { position: absolute; top: 10px; right: 120px; z-index: 3; border: 1px solid #c8d0da; background: #fff; border-radius: 4px; width: 28px; height: 28px; }
#navbar { position: absolute; bottom: 10px; left: 50%; transform: translateX(-50%); display: flex; gap: 2px; background: #fff; border: 1px solid #c8d0da; border-radius: 6px; padding: 3px; z-index: 3; box-shadow: 0 2px 6px #0001; }
#navbar button { border: 1px solid transparent; background: none; border-radius: 4px; padding: 3px 7px; font-size: 12px; }
#navbar button:hover { background: #eef5fd; }
#navbar button.on { background: #d6e8fb; border-color: #9cc4ee; }
#status { position: absolute; left: 8px; bottom: 8px; font-size: 12px; color: #3e4c59; background: #ffffffd9; padding: 3px 8px; border-radius: 4px; z-index: 3; max-width: 40%; pointer-events: none; }
.lbl2d { font: 600 11px "Segoe UI", sans-serif; color: #0b4f9c; background: #ffffffe6; border: 1px solid #9cc4ee; border-radius: 3px; padding: 0 4px; pointer-events: auto; cursor: pointer; white-space: nowrap; }
.lbl2d.sel { color: #fff; background: #e8590c; border-color: #e8590c; }

/* Sağ panel */
#panel { width: 300px; background: #fff; border-left: 1px solid #cfd6df; overflow: auto; flex: none; }
#panel .ph { display: flex; align-items: center; padding: 8px 10px; background: #2f6fb5; color: #fff; font-weight: 600; position: sticky; top: 0; z-index: 1; }
#panel .ph span { flex: 1; }
#panel .ph button { background: none; border: none; color: #fff; font-size: 16px; }
#panel .pb { padding: 8px 10px; }
.row { display: flex; align-items: center; gap: 6px; margin: 5px 0; }
.row label { width: 110px; color: #4a5763; font-size: 12px; flex: none; }
.row input[type=text], .row input[type=number], .row select { flex: 1; min-width: 0; padding: 4px 6px; border: 1px solid #c3ccd6; border-radius: 3px; }
.row input.bad { border-color: #d32f2f; background: #fff0f0; }
.row .val { font-size: 11px; color: #7b8794; width: 56px; text-align: right; flex: none; }
.hint { font-size: 11.5px; color: #6b7785; margin: 6px 0; }
.err { color: #c62828; font-size: 12px; margin: 6px 0; }
.btnrow { display: flex; gap: 6px; margin-top: 10px; flex-wrap: wrap; }
.btn { border: 1px solid #b9c3cf; background: #f7f9fb; padding: 5px 12px; border-radius: 4px; }
.btn:hover { background: #eaf1f8; }
.btn.pri { background: #0b6bcb; border-color: #0b6bcb; color: #fff; }
.btn.pri:hover { background: #095aab; }
.btn.sm { padding: 3px 8px; font-size: 12px; }
.sect { font-weight: 700; font-size: 11.5px; color: #52606d; margin: 12px 0 4px; border-bottom: 1px solid #e6eaef; padding-bottom: 3px; }
table.kv { width: 100%; border-collapse: collapse; font-size: 12px; }
table.kv td { padding: 3px 4px; border-bottom: 1px solid #f0f2f5; }
table.kv td:last-child { text-align: right; font-variant-numeric: tabular-nums; }
textarea.code { width: 100%; height: 180px; font: 12px Consolas, monospace; border: 1px solid #c3ccd6; border-radius: 3px; padding: 6px; }
.swatches { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.sw { border: 1px solid #c8d0da; border-radius: 4px; padding: 4px; font-size: 10.5px; text-align: center; background: #fff; }
.sw i { display: block; height: 28px; border-radius: 3px; margin-bottom: 3px; }
.sw:hover { border-color: #0b6bcb; }

/* Zaman çizelgesi */
#timeline { height: 44px; background: #fff; border-top: 1px solid #cfd6df; display: flex; align-items: center; gap: 3px; padding: 0 8px; overflow-x: auto; flex: none; }
#timeline .tl-l { font-size: 11px; font-weight: 700; color: #6b7785; margin-right: 6px; white-space: nowrap; }
.chip { display: flex; align-items: center; gap: 4px; border: 1px solid #c8d0da; background: #f7f9fb; border-radius: 4px; padding: 3px 7px; font-size: 11.5px; white-space: nowrap; cursor: pointer; }
.chip:hover { border-color: #0b6bcb; }
.chip.sup { opacity: .45; text-decoration: line-through; }
.chip.err { border-color: #d32f2f; background: #fff0f0; color: #b71c1c; }
.chip.act { border-color: #e8590c; background: #fff4ec; }

#menu { position: fixed; z-index: 50; background: #fff; border: 1px solid #c3ccd6; border-radius: 6px; box-shadow: 0 6px 20px #0002; padding: 4px; min-width: 230px; max-height: 70vh; overflow: auto; }
#menu .mi { display: flex; align-items: center; gap: 8px; padding: 5px 8px; border-radius: 4px; cursor: pointer; font-size: 12.5px; }
#menu .mi:hover { background: #eef5fd; }
#menu .mi .ic { width: 20px; text-align: center; }
#menu .mi .en { color: #8a96a3; font-size: 11px; margin-left: auto; padding-left: 10px; }
#menu .mi .ph2 { font-size: 10px; background: #fff1e0; color: #b35c00; border-radius: 3px; padding: 0 4px; margin-left: 6px; }
#menu .mi.off { color: #8a96a3; }
#menu .mh { font-size: 10.5px; font-weight: 700; color: #6b7785; padding: 6px 8px 2px; }

#toast { position: fixed; bottom: 60px; left: 50%; transform: translateX(-50%); z-index: 60; display: flex; flex-direction: column; gap: 6px; align-items: center; pointer-events: none; }
#toast div { background: #263140; color: #fff; padding: 7px 14px; border-radius: 6px; box-shadow: 0 4px 14px #0003; font-size: 13px; }
#toast div.warn { background: #b35c00; }
#toast div.bad { background: #c62828; }

#modal { position: fixed; inset: 0; background: #0006; z-index: 40; display: flex; align-items: flex-start; justify-content: center; padding-top: 10vh; }
#modal .box { background: #fff; border-radius: 8px; width: 560px; max-width: 94vw; max-height: 78vh; overflow: auto; box-shadow: 0 12px 40px #0004; }
#modal .box h3 { margin: 0; padding: 12px 16px; border-bottom: 1px solid #e6eaef; font-size: 15px; }
#modal .box .mb { padding: 12px 16px; }
#modal input.search { width: 100%; padding: 8px 10px; font-size: 14px; border: 1px solid #b9c3cf; border-radius: 4px; }

#sheet { position: fixed; inset: 0; background: #59626e; z-index: 30; display: flex; flex-direction: column; }
#sheet .sbar { display: flex; gap: 6px; padding: 8px; background: #2b3440; color: #fff; align-items: center; }
#sheet .sbar b { margin-right: 10px; }
#sheet .swrap { flex: 1; overflow: auto; display: flex; align-items: flex-start; justify-content: center; padding: 20px; }
#sheet canvas { background: #fff; box-shadow: 0 6px 30px #0006; max-width: 100%; height: auto; }
.kb { font-size: 11.5px; padding: 2px 8px; border-radius: 10px; margin-right: 8px; background: #3a4452; color: #c9d3df; }
.kb[data-st="ok"] { background: #1f5130; color: #9ff0b5; }
.kb[data-st="hata"] { background: #5c2626; color: #ffb4b4; }
.con2d, .dim2d { display: inline-block; font: 700 10.5px "Segoe UI", sans-serif; border-radius: 3px; padding: 0 4px; pointer-events: auto; cursor: pointer; white-space: nowrap; transform: translate(6px, -14px); }
.con2d { color: #2b3440; background: #fff; border: 1px solid #9aa7b6; }
.dim2d { color: #0d47a1; background: #e8f1fd; border: 1px solid #5b8fd6; font-weight: 600; font-size: 11.5px; }
.con2d.bad, .dim2d.bad { color: #fff; background: #d32f2f; border-color: #d32f2f; }
.con2d.sel, .dim2d.sel { color: #fff; background: #e8590c; border-color: #e8590c; }

/* Montaj */
.jglyph{pointer-events:auto;cursor:pointer;font-size:13px;line-height:1;padding:3px 5px;border-radius:5px;background:#fff;border:1.5px solid #1e88e5;color:#0d47a1;box-shadow:0 1px 3px rgba(0,0,0,.25);transform:translate(10px,-14px)}
.jglyph:hover{background:#e3f2fd}
.jglyph.bad{border-color:#d32f2f;color:#d32f2f;background:#ffebee}
.jglyph.sup{opacity:.45}
.jtypes{display:flex;flex-wrap:wrap;gap:3px;flex:1}
.jtypes .btn{padding:3px 6px}

/* Bulut */
#btnCloud.on{background:#e3f2fd;color:#0d47a1}
.cloudp{display:flex;gap:8px;align-items:flex-start;border:1px solid #e3e7ec;border-radius:7px;padding:6px;margin:5px 0;background:#fff}
.cloudp.cur{border-color:#1e88e5;box-shadow:0 0 0 1px #1e88e5 inset}
.cloudp img,.cloudp .ph{width:84px;height:58px;object-fit:cover;border-radius:5px;background:#eef2f6;flex:none;display:flex;align-items:center;justify-content:center;color:#8a97a6;font-size:22px}
.cloudp .ci{flex:1;min-width:0}
.cloudp b{display:block;font-size:13px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
