:root { --bg: #eef1f5; --panel: #ffffff; --line: #d5dbe3; --text: #1f2937; --dim: #64748b; --accent: #2563eb; }
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--bg); color: var(--text);
             font: 13px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
button, select, input { font: inherit; }
button { padding: 4px 10px; border: 1px solid #cbd5e1; border-radius: 5px; background: #f8fafc; cursor: pointer; color: var(--text); }
button:hover:not(:disabled) { background: #eef2f7; }
button:disabled { opacity: 0.5; cursor: default; }
button.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
button.primary:hover:not(:disabled) { background: #1d4ed8; }
button.round { width: 28px; height: 28px; padding: 0; border-radius: 50%; font-weight: 700; }
button.on { background: #dbeafe; border-color: #60a5fa; }
kbd { font-family: inherit; color: var(--dim); }
.dim { color: var(--dim); } .small { font-size: 12px; }
.yes { color: #15803d; font-weight: 600; } .no { color: #b91c1c; font-weight: 600; }
.mono { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 12px; }
#top { position: absolute; top: 0; left: 0; right: 0; height: 46px; display: flex; align-items: center; gap: 12px;
       padding: 0 12px; background: var(--panel); border-bottom: 1px solid var(--line); z-index: 5; }
#top .brand { font-weight: 700; font-size: 15px; } #top .brand small { color: var(--dim); font-weight: 400; }
#top label { color: var(--dim); display: flex; align-items: center; gap: 5px; }
#top input[type=number] { width: 70px; }
.spacer { flex: 1; }
#busy { display: flex; align-items: center; gap: 6px; color: var(--dim); }
.spinner { width: 14px; height: 14px; border: 2px solid #cbd5e1; border-top-color: var(--accent); border-radius: 50%;
           animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
main { position: absolute; top: 46px; left: 0; right: 0; bottom: 0; display: flex; }
aside { width: 280px; flex: none; overflow: auto; background: var(--panel); padding: 10px 12px; }
#left { border-right: 1px solid var(--line); } #right { border-left: 1px solid var(--line); width: 272px; }
aside section { margin-bottom: 16px; }
aside h2 { font-size: 12px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--dim); margin: 0 0 6px; }
#view { position: relative; flex: 1; min-width: 0; }
#view canvas { display: block; outline: none; }
#empty { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
         color: var(--dim); pointer-events: none; text-align: center; gap: 6px; }
#empty .big { font-size: 22px; color: #475569; }
#mouse-help { position: absolute; left: 10px; bottom: 10px; background: rgba(255,255,255,0.9); border: 1px solid var(--line);
              border-radius: 6px; padding: 4px 9px; color: #475569; font-size: 12px; }
#model-list { list-style: none; margin: 0; padding: 0; }
#model-list li { display: flex; align-items: center; gap: 6px; padding: 4px 6px; border-radius: 5px; cursor: pointer; }
#model-list li:hover { background: #f1f5f9; } #model-list li.sel { background: #dbeafe; }
#model-list li.none { color: var(--dim); cursor: default; background: none; }
#model-list .name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#model-list .badge { font-size: 11px; padding: 0 5px; border-radius: 8px; }
#model-list .badge.yes { background: #dcfce7; } #model-list .badge.no { background: #fee2e2; }
#model-list .rm { border: none; background: none; padding: 0 4px; color: var(--dim); font-size: 15px; line-height: 1; }
#model-list .rm:hover { color: #b91c1c; }
#info h1 { font-size: 14px; margin: 0 0 6px; word-break: break-all; }
#info table { border-collapse: collapse; width: 100%; }
#info td { padding: 1px 0; vertical-align: top; }
#info td:first-child { color: var(--dim); padding-right: 10px; white-space: nowrap; }
.bodies { margin: 6px 0 0; padding: 0; list-style: none; max-height: 140px; overflow: auto; }
.bodies li { display: flex; align-items: center; gap: 6px; }
.sw { width: 11px; height: 11px; border-radius: 2px; border: 1px solid rgba(0,0,0,0.25); flex: none; }
#warnings { margin: 8px 0 0; padding-left: 16px; color: #92400e; font-size: 12px; }
#report-box { margin-top: 8px; } #report-box summary { cursor: pointer; color: var(--dim); }
#report { font-size: 11px; white-space: pre-wrap; background: #f8fafc; border: 1px solid var(--line); border-radius: 4px; padding: 6px; }
.tools { display: flex; flex-direction: column; gap: 4px; }
.tools button { text-align: left; } .tools kbd { float: right; }
#export label { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 6px; color: var(--dim); }
#export select, #export input[type=text], #export input[type=number] { width: 145px; }
#export label.check { justify-content: flex-start; font-size: 12px; }
#export .row { display: flex; gap: 6px; margin: 8px 0 6px; } #export .row button { flex: 1; }
#ex-folder { word-break: break-all; margin-bottom: 6px; }
#ex-result { word-break: break-all; } #ex-result.ok { color: #15803d; } #ex-result.err { color: #b91c1c; }
#drop-overlay { position: fixed; inset: 0; z-index: 20; background: rgba(37,99,235,0.12); border: 4px dashed var(--accent);
                display: flex; align-items: center; justify-content: center; pointer-events: none; }
#drop-overlay div { background: #fff; padding: 16px 28px; border-radius: 10px; font-size: 20px; color: var(--accent);
                    box-shadow: 0 4px 20px rgba(15,23,42,0.15); }
#toast { position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%); z-index: 30; max-width: min(720px, 90vw);
         padding: 9px 14px; border-radius: 7px; background: #1e293b; color: #fff; box-shadow: 0 4px 16px rgba(0,0,0,0.2);
         white-space: pre-wrap; cursor: pointer; }
#toast.err { background: #b91c1c; }
.modal { position: fixed; inset: 0; z-index: 40; background: rgba(15,23,42,0.45); display: flex; align-items: center; justify-content: center; }
.modal[hidden] { display: none; }
.modal-box { position: relative; background: #fff; border-radius: 10px; width: min(760px, 94vw); max-height: 90vh; overflow: auto;
             padding: 18px 24px; box-shadow: 0 10px 40px rgba(0,0,0,0.3); }
.modal-box h1 { font-size: 18px; margin: 0 0 8px; } .modal-box h2 { font-size: 14px; margin: 16px 0 4px; }
.modal-box ul { padding-left: 18px; margin: 4px 0; } .modal-box li { margin: 2px 0; }
.modal-box dt { font-weight: 600; margin-top: 4px; } .modal-box dd { margin: 0 0 4px 16px; }
.modal-box .close { position: absolute; top: 12px; right: 12px; }
.keys td:first-child { padding-right: 16px; white-space: nowrap; }
.keys kbd { border: 1px solid #cbd5e1; border-radius: 3px; padding: 0 4px; color: var(--text); background: #f8fafc; }
[hidden] { display: none !important; }
#ed-toggle { width: 100%; text-align: left; } #ed-toggle kbd { float: right; }
#ed-panel { margin-top: 8px; }
.seg { display: flex; gap: 0; margin-bottom: 6px; } .seg button { flex: 1; border-radius: 0; } .seg button kbd { margin-left: 4px; }
.seg button:first-child { border-radius: 5px 0 0 5px; } .seg button:last-child { border-radius: 0 5px 5px 0; }
#ed-panel label.check { display: flex; align-items: center; gap: 6px; font-size: 12px; margin: 2px 0; }
.selinfo { background: #f8fafc; border: 1px solid var(--line); border-radius: 5px; padding: 5px 7px; margin: 6px 0; word-break: break-word; }
.selinfo hr { border: none; border-top: 1px solid var(--line); margin: 4px 0; }
.edgroup { display: flex; flex-wrap: wrap; gap: 4px; margin: 6px 0; align-items: center; }
.edgroup > span.dim { width: 100%; text-transform: uppercase; letter-spacing: 0.05em; font-size: 11px; }
.edgroup button { padding: 3px 8px; }
.xyz { display: flex; gap: 3px; width: 100%; } .xyz input { width: 33%; min-width: 0; }
#ed-panel .row { display: flex; gap: 6px; margin-top: 8px; } #ed-panel .row button { flex: 1; }
#ed-msg { margin-top: 6px; word-break: break-word; } #ed-msg.ok { color: #15803d; } #ed-msg.err { color: #b91c1c; font-weight: 600; }

.prm { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; width: 100%; font-size: 12px; }
.prm input[type=number], .prm input[type=text] { width: 64px; }
.prm select { font-size: 12px; max-width: 150px; }
#ed-busy { margin-top: 6px; color: #1d4ed8; font-weight: 600; display: flex; align-items: center; gap: 6px; }
#ed-busy[hidden] { display: none; }
.spin { width: 12px; height: 12px; border: 2px solid #93c5fd; border-top-color: #1d4ed8; border-radius: 50%;
        display: inline-block; animation: edspin 0.8s linear infinite; }
@keyframes edspin { to { transform: rotate(360deg); } }
#ed-panel.busy .edgroup { opacity: 0.6; }
