
html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: #0b0f14;
  color: #e6eef8;
  font-family: system-ui, sans-serif;
}

.layout {
  display: flex;
  height: 100vh;
  width: 100vw;
}

.sidebar {
  width: 320px;
  min-width: 320px;
  max-width: 320px;
  background: #0f1623;
  overflow-y: auto;
  padding: 12px;
  box-sizing: border-box;
}

.main {
  flex: 1;
  position: relative;
  background: #0b0f14;
}

.main canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

/* ── Compliance Panel ── */
#compliance-panel {
  position: fixed;
  right: 0;
  top: 0;
  width: 380px;
  height: 100vh;
  background: #1e1e2e;
  color: #cdd6f4;
  border-left: 1px solid #45475a;
  overflow-y: auto;
  z-index: 1000;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 13px;
  transition: transform 0.2s ease;
}
#compliance-panel.hidden { transform: translateX(100%); }

#compliance-panel .panel-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 16px; background: #313244; border-bottom: 1px solid #45475a;
  position: sticky; top: 0; z-index: 1;
}
#compliance-panel .panel-header h3 { margin: 0; font-size: 14px; font-weight: 600; }
#compliance-panel .close-btn {
  background: none; border: none; color: #cdd6f4; cursor: pointer; font-size: 18px; padding: 4px;
}

/* Form */
#compliance-panel .form-section { padding: 12px 16px; }
#compliance-panel .form-group { margin-bottom: 8px; }
#compliance-panel .form-group label {
  display: block; font-size: 11px; color: #a6adc8; margin-bottom: 2px;
}
#compliance-panel .form-group input,
#compliance-panel .form-group select {
  width: 100%; padding: 6px 8px; background: #313244; border: 1px solid #45475a;
  color: #cdd6f4; border-radius: 4px; font-size: 13px;
  box-sizing: border-box;
}
#compliance-panel .form-group input:focus,
#compliance-panel .form-group select:focus {
  border-color: #89b4fa; outline: none;
}
#compliance-panel .form-row { display: flex; gap: 8px; }
#compliance-panel .form-row .form-group { flex: 1; }
#compliance-panel .checkbox-group {
  display: flex; align-items: center; gap: 6px; margin-bottom: 8px;
}
#compliance-panel .checkbox-group input[type="checkbox"] { width: auto; }

/* Run button */
#compliance-panel .run-btn {
  width: 100%; padding: 10px; background: #89b4fa; color: #1e1e2e;
  border: none; border-radius: 6px; font-weight: 600; cursor: pointer;
  font-size: 13px; margin: 8px 0;
}
#compliance-panel .run-btn:hover { background: #74c7ec; }
#compliance-panel .run-btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* Results */
#compliance-panel .results-section { padding: 0 16px 16px; }
#compliance-panel .summary-bar {
  display: flex; gap: 12px; padding: 10px; background: #313244;
  border-radius: 6px; margin-bottom: 12px; font-size: 12px;
  flex-wrap: wrap;
}
#compliance-panel .summary-item { display: flex; align-items: center; gap: 4px; }
#compliance-panel .summary-pass { color: #a6e3a1; }
#compliance-panel .summary-fail { color: #f38ba8; }
#compliance-panel .summary-warn { color: #fab387; }
#compliance-panel .summary-na { color: #6c7086; }

#compliance-panel .category-header {
  font-size: 12px; font-weight: 600; color: #a6adc8; text-transform: uppercase;
  margin: 12px 0 6px; padding-bottom: 4px; border-bottom: 1px solid #45475a;
}

#compliance-panel .result-row {
  padding: 8px; margin-bottom: 4px; border-radius: 4px; background: #313244;
  border-left: 3px solid transparent;
}
#compliance-panel .result-row.pass { border-left-color: #a6e3a1; }
#compliance-panel .result-row.fail { border-left-color: #f38ba8; }
#compliance-panel .result-row.warning { border-left-color: #fab387; }
#compliance-panel .result-row.na { border-left-color: #6c7086; }

#compliance-panel .result-header {
  display: flex; justify-content: space-between; align-items: center;
}
#compliance-panel .result-name { font-weight: 500; font-size: 12px; }
#compliance-panel .result-status {
  font-size: 14px; min-width: 20px; text-align: center;
}
#compliance-panel .result-message {
  font-size: 11px; color: #a6adc8; margin-top: 4px; line-height: 1.4;
}
#compliance-panel .result-actions {
  display: flex; gap: 4px; margin-top: 6px;
}
#compliance-panel .result-actions button {
  padding: 3px 8px; font-size: 11px; border-radius: 3px;
  border: 1px solid #45475a; background: #1e1e2e; color: #cdd6f4; cursor: pointer;
}
#compliance-panel .result-actions button:hover { background: #45475a; }

/* Override editor */
#compliance-panel .override-editor {
  margin-top: 6px; padding: 8px; background: #1e1e2e; border-radius: 4px;
  border: 1px solid #45475a;
}
#compliance-panel .override-editor input {
  width: 80px; padding: 4px; background: #313244; border: 1px solid #45475a;
  color: #cdd6f4; border-radius: 3px; font-size: 12px;
}
#compliance-panel .override-editor button {
  padding: 3px 8px; font-size: 11px; border-radius: 3px; cursor: pointer;
  margin-left: 4px;
}
#compliance-panel .override-save {
  background: #a6e3a1; color: #1e1e2e; border: none;
}
#compliance-panel .override-reset {
  background: none; border: 1px solid #45475a; color: #cdd6f4;
}

/* Warnings */
#compliance-panel .warnings {
  padding: 8px; margin: 8px 0; background: #313244; border-radius: 4px;
  border-left: 3px solid #fab387; font-size: 11px; color: #fab387;
}

/* Entity Editor */
.entity-editor-section { margin-top: 8px; }
.entity-editor-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 8px 12px; background: #313244; border-radius: 6px; cursor: pointer;
  font-size: 12px; font-weight: 600; color: #cdd6f4; user-select: none;
}
.entity-editor-header:hover { background: #3b3d54; }
.toggle-arrow { font-size: 10px; color: #6c7086; }

.entity-tabs {
  display: flex; gap: 2px; padding: 6px 0; border-bottom: 1px solid #45475a; margin-bottom: 6px;
}
.entity-tab {
  padding: 4px 10px; border: none; border-radius: 4px 4px 0 0;
  background: transparent; color: #a6adc8; font-size: 11px; cursor: pointer;
}
.entity-tab.active { background: #45475a; color: #cdd6f4; }
.entity-tab:hover { background: #3b3d54; }

.entity-list { max-height: 300px; overflow-y: auto; }
.entity-card {
  margin: 3px 0; background: #1e1e2e; border-radius: 4px; border: 1px solid #313244;
}
.entity-card-header {
  display: flex; align-items: center; gap: 6px; padding: 6px 8px; cursor: pointer;
  font-size: 11px; color: #cdd6f4;
}
.entity-card-header:hover { background: #262640; }
.entity-icon { font-size: 10px; }
.entity-label { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.entity-area { font-size: 10px; color: #a6adc8; white-space: nowrap; }

.entity-card-details { padding: 6px 8px; border-top: 1px solid #313244; }
.entity-field { display: flex; align-items: center; gap: 6px; margin-bottom: 4px; }
.entity-field label { font-size: 10px; color: #a6adc8; min-width: 80px; }
.entity-field input, .entity-field select {
  flex: 1; padding: 3px 6px; background: #313244; border: 1px solid #45475a;
  border-radius: 3px; color: #cdd6f4; font-size: 11px;
}
.entity-field input:focus, .entity-field select:focus {
  border-color: #89b4fa; outline: none;
}

.entity-actions-row { display: flex; gap: 4px; margin-top: 6px; }
.entity-save-btn {
  padding: 3px 10px; background: #a6e3a1; color: #1e1e2e; border: none;
  border-radius: 3px; font-size: 10px; cursor: pointer; font-weight: 600;
}
.entity-save-btn:hover { background: #94d994; }
.entity-locate-btn, .entity-delete-btn {
  padding: 3px 8px; background: #313244; border: 1px solid #45475a;
  border-radius: 3px; font-size: 11px; cursor: pointer; color: #cdd6f4;
}
.entity-locate-btn:hover { background: #45475a; }
.entity-delete-btn { color: #f38ba8; border-color: #f38ba8; }
.entity-delete-btn:hover { background: rgba(243,139,168,0.2); }

.entity-add-btn {
  width: 100%; padding: 6px; margin-top: 4px; background: transparent;
  border: 1px dashed #45475a; border-radius: 4px; color: #89b4fa;
  font-size: 11px; cursor: pointer;
}
.entity-add-btn:hover { background: rgba(137,180,250,0.1); border-color: #89b4fa; }

/* Dialog Overlay */
.entity-dialog-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.6);
  display: flex; align-items: center; justify-content: center; z-index: 10000;
}
.entity-dialog {
  background: #1e1e2e; border: 1px solid #45475a; border-radius: 8px;
  padding: 16px; min-width: 280px; max-width: 360px; color: #cdd6f4;
}
.entity-dialog h4 { margin: 0 0 12px; font-size: 14px; }
.entity-dialog .entity-field { margin-bottom: 8px; }
.entity-dialog .entity-field label { min-width: 120px; }
.entity-dialog .entity-field input,
.entity-dialog .entity-field select {
  flex: 1; padding: 5px 8px; background: #313244; border: 1px solid #45475a;
  border-radius: 4px; color: #cdd6f4; font-size: 12px;
}
.entity-dialog-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 12px; }
.dialog-ok {
  padding: 6px 16px; background: #89b4fa; color: #1e1e2e; border: none;
  border-radius: 4px; cursor: pointer; font-weight: 600; font-size: 12px;
}
.dialog-ok:hover { background: #74a8f7; }
.dialog-cancel {
  padding: 6px 16px; background: transparent; border: 1px solid #45475a;
  border-radius: 4px; color: #cdd6f4; cursor: pointer; font-size: 12px;
}
.dialog-cancel:hover { background: #313244; }

/* Toast */
.comp-toast {
  position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: #313244; color: #a6e3a1; padding: 8px 20px; border-radius: 6px;
  font-size: 12px; opacity: 0; transition: all 0.3s; z-index: 10001;
  border: 1px solid #a6e3a1; pointer-events: none;
}
.comp-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ── Image Panel (Görsel Ekle) ── */
#image-panel {
  position: fixed;
  right: 0;
  top: 0;
  width: 340px;
  height: 100vh;
  background: #1e1e2e;
  color: #cdd6f4;
  border-left: 1px solid #45475a;
  overflow-y: auto;
  z-index: 1000;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 13px;
  transition: transform 0.2s ease;
}
#image-panel.hidden { transform: translateX(100%); }

#image-panel .panel-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 16px; background: #313244; border-bottom: 1px solid #45475a;
  position: sticky; top: 0; z-index: 1;
}
#image-panel .panel-header h3 { margin: 0; font-size: 14px; font-weight: 600; }
#image-panel .close-btn {
  background: none; border: none; color: #cdd6f4; cursor: pointer; font-size: 18px; padding: 4px;
}

.image-upload-area {
  border: 2px dashed #45475a;
  border-radius: 8px;
  padding: 20px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  color: #a6adc8;
}
.image-upload-area:hover,
.image-upload-area.dragover {
  border-color: #89b4fa;
  background: rgba(137, 180, 250, 0.05);
}

.image-library-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.image-library-item {
  position: relative;
  background: #313244;
  border: 1px solid #45475a;
  border-radius: 6px;
  padding: 6px;
  cursor: grab;
  transition: border-color 0.15s, box-shadow 0.15s;
  text-align: center;
}
.image-library-item:hover {
  border-color: #89b4fa;
  box-shadow: 0 0 0 1px rgba(137, 180, 250, 0.3);
}
.image-library-item:active { cursor: grabbing; }
.image-library-item .image-thumb {
  width: 100%;
  height: 60px;
  object-fit: contain;
  border-radius: 3px;
  pointer-events: none;
}
.image-library-item .image-name {
  display: block;
  font-size: 10px;
  color: #a6adc8;
  margin-top: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  pointer-events: none;
}
.image-library-item .image-del-btn {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 18px;
  height: 18px;
  border: none;
  background: rgba(243, 139, 168, 0.85);
  color: #1e1e2e;
  border-radius: 50%;
  font-size: 12px;
  line-height: 16px;
  text-align: center;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s;
  padding: 0;
}
.image-library-item:hover .image-del-btn { opacity: 1; }

/* ── Discipline Modal ──────────────────────────── */
.disc-modal-overlay {
  position: fixed; inset: 0; z-index: 9999;
  background: rgba(0,0,0,0.6);
  display: flex; align-items: center; justify-content: center;
}
.disc-modal {
  background: #1e293b; border-radius: 12px;
  padding: 24px 28px; min-width: 340px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
}
.disc-modal-title {
  font-size: 0.95rem; font-weight: 600; color: #e2e8f0;
  margin-bottom: 16px; text-align: center;
}
.disc-modal-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.disc-option {
  display: flex; align-items: center; gap: 8px;
  background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.1);
  color: #e2e8f0; border-radius: 8px;
  padding: 10px 14px; cursor: pointer;
  font-size: 0.82rem; transition: background 0.15s;
}
.disc-option:hover { background: rgba(255,255,255,0.12); }
.disc-option.selected { border-color: #60a5fa; background: rgba(96,165,250,0.15); }
.disc-dot {
  width: 12px; height: 12px; border-radius: 50%;
  display: inline-block; flex-shrink: 0;
}

/* ── Discipline Badge ──────────────────────────── */
.discipline-badge {
  position: absolute; top: 10px; left: 14px;
  z-index: 401; pointer-events: none;
  font-size: 0.65rem; font-weight: 700;
  padding: 2px 8px; border-radius: 4px;
  letter-spacing: 0.5px; text-transform: uppercase;
}

/* ── Layer Panel ───────────────────────────────── */
.layer-panel {
  position: fixed; top: 56px; right: 12px;
  z-index: 800; width: 420px; max-width: calc(100vw - 24px);
  background: #1e293b; border: 1px solid rgba(255,255,255,0.1);
  border-radius: 10px; box-shadow: 0 4px 20px rgba(0,0,0,0.4);
  overflow: hidden;
}
.layer-panel-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px; border-bottom: 1px solid rgba(255,255,255,0.08);
  color: #e2e8f0;
}
.lp-btn {
  background: none; border: none; color: #94a3b8; cursor: pointer;
  font-size: 1.1rem; padding: 0 4px; line-height: 1;
}
.lp-btn:hover { color: #e2e8f0; }
.layer-panel-body { padding: 6px 0; max-height: 240px; overflow-y: auto; }
.layer-row {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 14px; font-size: 0.78rem; color: #cbd5e1;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}
.layer-row .disc-dot { width: 10px; height: 10px; cursor: pointer; }
.layer-row .layer-disc-label {
  font-weight: 700; font-size: 0.65rem; text-transform: uppercase;
  padding: 1px 6px; border-radius: 3px; white-space: nowrap;
}
.layer-row .layer-filename {
  flex: 1; min-width: 0; max-width: 160px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-size: 0.72rem; color: #94a3b8;
}
.layer-row input[type=range] {
  width: 70px; accent-color: #60a5fa; height: 4px; flex-shrink: 0;
}
.layer-row .lp-eye {
  background: none; border: none; color: #94a3b8; cursor: pointer;
  font-size: 0.8rem; padding: 0 2px;
}
.layer-row .lp-eye:hover { color: #e2e8f0; }
.layer-row .lp-close {
  background: none; border: none; color: #64748b; cursor: pointer;
  font-size: 0.85rem; padding: 0 2px; flex-shrink: 0;
}
.layer-row .lp-close:hover { color: #ef4444; }
.layer-row .lp-align-reset, .layer-row .lp-align-start {
  background: none; border: none; color: #94a3b8; cursor: pointer;
  font-size: 0.75rem; padding: 0 2px; flex-shrink: 0;
}
.layer-row .lp-align-reset:hover { color: #f59e0b; }
.layer-row .lp-align-start:hover { color: #60a5fa; opacity: 1 !important; }
.layer-panel-footer {
  padding: 8px 14px; border-top: 1px solid rgba(255,255,255,0.08);
  display: flex; gap: 8px;
}
.lp-footer-btn {
  background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.1);
  color: #94a3b8; border-radius: 6px; padding: 5px 12px;
  font-size: 0.75rem; cursor: pointer;
}
.lp-footer-btn:hover { background: rgba(255,255,255,0.12); color: #e2e8f0; }

/* ── Project Panel ─────────────────────────────── */
.project-panel {
  position: fixed; top: 64px; right: 12px;
  z-index: 900; width: 360px;
  background: #1e293b; border: 1px solid rgba(255,255,255,0.1);
  border-radius: 10px; box-shadow: 0 4px 24px rgba(0,0,0,0.5);
  overflow: hidden; max-height: calc(100vh - 80px);
  display: flex; flex-direction: column;
}
.project-panel-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; border-bottom: 1px solid rgba(255,255,255,0.08);
  color: #e2e8f0; flex-shrink: 0;
}
.pp-btn {
  background: none; border: none; color: #94a3b8; cursor: pointer;
  font-size: 1.1rem; padding: 0 4px; line-height: 1;
}
.pp-btn:hover { color: #e2e8f0; }
.project-panel-body {
  overflow-y: auto; flex: 1; padding: 8px 0;
}
.pp-empty {
  text-align: center; color: #64748b; padding: 32px 16px;
  font-size: 0.82rem; line-height: 1.6;
}
.pp-card {
  padding: 12px 16px; border-bottom: 1px solid rgba(255,255,255,0.05);
  cursor: pointer; transition: background 0.15s;
}
.pp-card:hover { background: rgba(255,255,255,0.04); }
.pp-card-title {
  font-weight: 600; font-size: 0.85rem; color: #e2e8f0;
  display: flex; align-items: center; gap: 6px;
}
.pp-card-meta {
  font-size: 0.72rem; color: #64748b; margin-top: 4px;
}
.pp-card-discs {
  display: flex; gap: 4px; margin-top: 6px; flex-wrap: wrap;
}
.pp-card-disc {
  font-size: 0.6rem; font-weight: 700; text-transform: uppercase;
  padding: 1px 6px; border-radius: 3px;
}
.pp-card-disc.empty {
  border: 1px dashed rgba(255,255,255,0.15); color: #475569;
  background: none;
}
.pp-card-actions {
  display: flex; gap: 6px; margin-top: 8px;
}
.pp-card-actions button {
  background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.1);
  color: #94a3b8; border-radius: 5px; padding: 3px 10px;
  font-size: 0.7rem; cursor: pointer;
}
.pp-card-actions button:hover { background: rgba(255,255,255,0.12); color: #e2e8f0; }
.pp-card-actions button.danger:hover { background: rgba(239,68,68,0.2); color: #f87171; }
.pp-input {
  width: 100%; background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.15); border-radius: 6px;
  color: #e2e8f0; padding: 8px 12px; font-size: 0.82rem;
  box-sizing: border-box;
}
.pp-input:focus { outline: none; border-color: #60a5fa; }
.pp-save-btn {
  background: #3b82f6; border: none; color: #fff;
  border-radius: 6px; padding: 6px 16px;
  font-size: 0.8rem; cursor: pointer; font-weight: 600;
}
.pp-save-btn:hover { background: #2563eb; }

/* ── PDF Split Panel ───────────────────────────── */
.pdf-split-panel {
  position: fixed; top: 52px; right: 0;
  width: 410px; height: calc(100vh - 52px);
  z-index: 820;
  background: #1e293b; border-left: 1px solid rgba(255,255,255,0.08);
  display: flex; flex-direction: column;
  overflow: hidden;
  box-shadow: -4px 0 16px rgba(0,0,0,0.4);
}
.pdf-split-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px; border-bottom: 1px solid rgba(255,255,255,0.08);
  color: #e2e8f0; flex-shrink: 0;
}
.pdf-split-nav {
  display: flex; align-items: center; justify-content: center; gap: 12px;
  padding: 6px 14px; border-bottom: 1px solid rgba(255,255,255,0.06);
  flex-shrink: 0;
}
.pdf-split-viewer {
  flex: 1; overflow: auto; background: #111827;
  display: block;
  padding: 8px;
  position: relative;
}
.pdf-split-viewer canvas {
  display: block;
  box-shadow: 0 2px 8px rgba(0,0,0,0.4);
}
.pdf-highlight-layer {
  position: absolute; top: 0; left: 0;
  pointer-events: none;
}
.pdf-highlight-mark {
  position: absolute;
  background: rgba(250, 204, 21, 0.4);
  border: 1px solid rgba(250, 204, 21, 0.7);
  border-radius: 2px;
  pointer-events: none;
}
.pdf-highlight-mark.active {
  background: rgba(251, 146, 60, 0.5);
  border-color: rgba(251, 146, 60, 0.9);
}
.pdf-split-params {
  flex-shrink: 0; overflow-y: auto; max-height: 320px;
  padding: 12px 14px; border-top: 1px solid rgba(255,255,255,0.08);
}
.pdf-params-title {
  font-weight: 600; font-size: 0.78rem; color: #94a3b8;
  margin-bottom: 8px; text-transform: uppercase; letter-spacing: 0.5px;
}
.pdf-param-row {
  margin-bottom: 8px;
}
.pdf-param-row label {
  display: block; font-size: 0.72rem; color: #64748b; margin-bottom: 2px;
}
.pdf-param-row .pp-input {
  font-size: 0.78rem;
}
.pdf-param-row select, .pdf-split-params select {
  background: #1e293b; color: #e2e8f0;
  border: 1px solid rgba(255,255,255,0.15); border-radius: 4px;
  padding: 4px 8px; font-size: 0.78rem;
  -webkit-appearance: none; -moz-appearance: none; appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%2394a3b8'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 8px center;
  padding-right: 24px; cursor: pointer; width: 100%;
}
.pdf-param-row select option, .pdf-split-params select option {
  background: #1e293b; color: #e2e8f0;
  padding: 6px 8px;
}
.pdf-split-params input, .pdf-split-params textarea {
  background: #0f172a; color: #e2e8f0;
  border: 1px solid rgba(255,255,255,0.12); border-radius: 4px;
  padding: 4px 8px; font-size: 0.78rem; width: 100%;
  box-sizing: border-box;
}

/* ── Coordination Summary Panel ────────────────── */
.coord-panel {
  position: fixed; top: 64px; left: 50%; transform: translateX(-50%);
  z-index: 850; width: 420px;
  background: #1e293b; border: 1px solid rgba(255,255,255,0.1);
  border-radius: 10px; box-shadow: 0 4px 24px rgba(0,0,0,0.5);
  overflow: hidden; max-height: calc(100vh - 80px);
  display: flex; flex-direction: column;
}
.coord-panel-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; border-bottom: 1px solid rgba(255,255,255,0.08);
  color: #e2e8f0; flex-shrink: 0;
}
.coord-panel-body {
  overflow-y: auto; flex: 1; padding: 0;
}
.coord-section {
  padding: 12px 16px; border-bottom: 1px solid rgba(255,255,255,0.05);
}
.coord-section-title {
  font-size: 0.72rem; font-weight: 700; color: #64748b;
  text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 8px;
}
.coord-row {
  display: flex; align-items: center; gap: 8px;
  font-size: 0.8rem; color: #cbd5e1; padding: 3px 0;
}
.coord-row .coord-icon { width: 18px; text-align: center; flex-shrink: 0; }
.coord-row .coord-label { flex: 1; }
.coord-row .coord-value {
  font-size: 0.75rem; color: #94a3b8; text-align: right;
}
.coord-status-ok { color: #22c55e; }
.coord-status-warn { color: #f59e0b; }
.coord-status-empty { color: #475569; }

/* ── Checklist Panel ───────────────────────────── */
.checklist-panel {
  position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%);
  z-index: 860; width: 520px; max-height: 80vh;
  background: #1e293b; border: 1px solid rgba(255,255,255,0.1);
  border-radius: 10px; box-shadow: 0 8px 32px rgba(0,0,0,0.6);
  display: flex; flex-direction: column;
}
.checklist-panel-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; border-bottom: 1px solid rgba(255,255,255,0.08);
  color: #e2e8f0; flex-shrink: 0;
}
.checklist-tabs {
  display: flex; gap: 2px; padding: 8px 12px; flex-wrap: wrap;
  border-bottom: 1px solid rgba(255,255,255,0.06); flex-shrink: 0;
}
.cl-tab {
  font-size: 0.7rem; font-weight: 600; padding: 4px 10px;
  border-radius: 5px; cursor: pointer; border: none;
  background: rgba(255,255,255,0.06); color: #94a3b8;
}
.cl-tab:hover { background: rgba(255,255,255,0.1); }
.cl-tab.active { background: #3b82f6; color: #fff; }
.checklist-progress {
  padding: 6px 16px; font-size: 0.75rem; color: #64748b;
  flex-shrink: 0;
}
.checklist-body {
  flex: 1; overflow-y: auto; padding: 0;
}
.cl-item {
  padding: 10px 16px; border-bottom: 1px solid rgba(255,255,255,0.04);
}
.cl-item-title {
  font-size: 0.8rem; color: #e2e8f0; margin-bottom: 6px;
  display: flex; align-items: flex-start; gap: 6px;
}
.cl-item-title .cl-num {
  color: #64748b; font-size: 0.72rem; min-width: 18px; flex-shrink: 0;
}
.cl-item-controls {
  display: flex; gap: 8px; align-items: center;
}
.cl-item-controls select, .cl-item-controls input {
  font-size: 0.75rem; background: #1e293b;
  border: 1px solid rgba(255,255,255,0.15); border-radius: 4px;
  color: #e2e8f0; padding: 4px 8px;
}
.cl-item-controls select {
  width: 120px; cursor: pointer;
  -webkit-appearance: none; -moz-appearance: none; appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%2394a3b8'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 8px center;
  padding-right: 24px;
}
.cl-item-controls select option {
  background: #1e293b; color: #e2e8f0;
  padding: 6px 8px;
}
.cl-item-controls input { flex: 1; }
.cl-item-note {
  margin-top: 4px;
}
.cl-item-note textarea {
  width: 100%; font-size: 0.72rem; background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08); border-radius: 4px;
  color: #cbd5e1; padding: 4px 6px; resize: vertical; min-height: 28px;
  box-sizing: border-box;
}
.checklist-footer {
  padding: 8px 16px; border-top: 1px solid rgba(255,255,255,0.08);
  flex-shrink: 0; display: flex; gap: 8px;
}

/* ── Alignment Tool ────────────────────────────── */
.align-banner {
  position: fixed; top: 52px; left: 50%; transform: translateX(-50%);
  z-index: 900; background: #1e40af; color: #fff;
  padding: 8px 20px; border-radius: 0 0 8px 8px;
  font-size: 0.85rem; font-weight: 600;
  box-shadow: 0 4px 12px rgba(0,0,0,0.4);
  display: flex; align-items: center;
}
.align-result {
  position: fixed; top: 52px; right: 16px;
  z-index: 850; background: #065f46; color: #d1fae5;
  padding: 6px 14px; border-radius: 0 0 8px 8px;
  font-size: 0.75rem; font-weight: 600;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
  display: flex; align-items: center;
}
.align-star {
  position: absolute; width: 16px; height: 16px;
  margin-left: -8px; margin-top: -8px;
  pointer-events: none; z-index: 800;
}
.align-star svg {
  width: 16px; height: 16px;
}

/* ── Overlay Canvases (multi-discipline) ───────── */
.overlay-canvas {
  position: absolute; top: 0; left: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  z-index: 2;
}
