/* ═══════════════════════════════════════════════════════════════
   NetKPSS Master Çalışma İstasyonu
   ═══════════════════════════════════════════════════════════════ */

.ms-root, #ms-root {
  min-height: calc(100vh - 64px);
  background: #0d0d16;
}

/* ── Dashboard ── */
.ms-dashboard { padding: 28px 20px 80px; max-width: 1100px; margin: 0 auto; }
.ms-dash-header { text-align: center; margin-bottom: 36px; }
.ms-dash-header h1 {
  font-family: Montserrat, sans-serif;
  font-size: 1.8rem;
  font-weight: 900;
  color: #e4e1ed;
  letter-spacing: -0.02em;
}
.ms-dash-header p { color: #908fa0; font-size: 0.9rem; margin-top: 6px; }

.ms-dash-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}

.ms-dash-card {
  position: relative;
  border-radius: 20px;
  padding: 28px 24px;
  background: rgba(31,31,39,0.8);
  border: 1px solid rgba(255,255,255,0.06);
  cursor: pointer;
  transition: transform 0.25s, box-shadow 0.25s, border-color 0.25s;
  overflow: hidden;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}
.ms-dash-card:hover {
  transform: translateY(-6px);
  border-color: color-mix(in srgb, var(--ms-color) 50%, transparent);
  box-shadow: 0 20px 50px rgba(0,0,0,0.4), 0 0 30px color-mix(in srgb, var(--ms-color) 20%, transparent);
}
.ms-dash-glow { position: absolute; inset: 0; pointer-events: none !important; }
.ms-dash-icon { font-size: 44px; display: block; margin-bottom: 12px; position: relative; }
.ms-dash-title {
  font-family: Montserrat, sans-serif;
  font-size: 1.15rem;
  font-weight: 800;
  color: #e4e1ed;
  position: relative;
}
.ms-dash-desc {
  font-size: 0.78rem;
  color: #908fa0;
  margin-top: 6px;
  line-height: 1.5;
  position: relative;
}
.ms-dash-meta {
  display: flex;
  gap: 10px;
  margin-top: 14px;
  flex-wrap: wrap;
  position: relative;
}
.ms-dash-meta span {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 9999px;
  background: rgba(255,255,255,0.05);
  color: #908fa0;
}
.ms-dash-engine {
  margin-top: 12px;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  position: relative;
}

/* ── Workspace Layout ── */
.ms-workspace { display: flex; flex-direction: column; height: calc(100vh - 64px); overflow: hidden; }

.ms-ws-topbar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 20px;
  background: rgba(19,19,27,0.95);
  border-bottom: 1px solid rgba(70,69,85,0.4);
  flex-shrink: 0;
}
.ms-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 10px;
  border: 1px solid rgba(70,69,85,0.5);
  background: rgba(31,31,39,0.6);
  color: #c7c4d7;
  font-family: Montserrat, sans-serif;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}
.ms-back:hover { border-color: rgba(193,193,255,0.4); color: #c1c1ff; }
.ms-ws-subject { display: flex; align-items: center; gap: 12px; }
.ms-ws-subj-title { font-weight: 800; font-size: 1rem; color: #e4e1ed; }
.ms-ws-engine { font-size: 0.68rem; color: #908fa0; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; }

.ms-ws-body {
  display: flex;
  flex: 1;
  overflow: hidden;
  --ws-notes-flex: 0.58;
  --ws-map-flex: 0.42;
}
.ms-layout-notes-first .ms-notes-main {
  flex: var(--ws-notes-flex) 1 0;
  min-width: 220px;
  order: 2;
  border-left: none;
  border-right: 1px solid rgba(70,69,85,0.25);
}
.ms-layout-notes-first .ms-sidebar { order: 1; }
.ms-layout-notes-first .ms-engine-side {
  flex: var(--ws-map-flex) 1 0;
  min-width: 240px;
  max-width: none;
  order: 4;
  border-left: 1px solid rgba(70,69,85,0.2);
}
/* Coğrafya dışı: motor paneli yok — not tam genişlik */
.ms-layout-notes-only {
  --ws-notes-flex: 1;
}
.ms-layout-notes-only .ms-notes-main {
  flex: 1 1 auto !important;
  max-width: none;
  border-right: none;
}
.ms-layout-map-first .ms-notes-main {
  flex: var(--ws-notes-flex) 1 0;
  min-width: 220px;
  order: 4;
}
.ms-layout-map-first .ms-engine-side {
  flex: var(--ws-map-flex) 1 0;
  min-width: 320px;
  order: 2;
  max-width: none;
}
.ms-layout-balanced .ms-notes-main,
.ms-layout-balanced .ms-engine-side {
  flex: 1 1 0;
  min-width: 200px;
  max-width: none;
}
.ms-layout-balanced .ms-notes-main { order: 2; }
.ms-layout-balanced .ms-engine-side { order: 4; }
.ms-ws-splitter {
  order: 3;
  width: 6px;
  flex-shrink: 0;
  cursor: col-resize;
  background: rgba(70,69,85,0.35);
  transition: background 0.15s;
  z-index: 2;
}
.ms-ws-splitter:hover { background: rgba(52,211,153,0.45); }
.ms-notes-tb-sep {
  display: inline-block;
  width: 1px;
  height: 18px;
  background: rgba(70,69,85,0.5);
  margin: 0 4px;
  vertical-align: middle;
}
.ms-ws-split-btn.active { border-color: #34d399; color: #6ee7b7; }
.ms-notes-main {
  display: flex;
  flex-direction: column;
  background: #f7f9fe;
  overflow: hidden;
  min-height: 0;
  flex: 1 1 auto;
}
.ms-engine-side.ms-engine-collapsed {
  flex: 0 0 48px !important;
  min-width: 48px !important;
  max-width: 48px !important;
  overflow: hidden;
}
.ms-engine-side.ms-engine-collapsed .ms-visual-area,
.ms-engine-side.ms-engine-collapsed .ms-ve-empty { display: none; }

/* Sidebar */
.ms-sidebar {
  width: 260px;
  flex-shrink: 0;
  border-right: 1px solid rgba(70,69,85,0.3);
  overflow-y: auto;
  background: rgba(13,13,22,0.9);
  padding: 12px 0;
  scrollbar-width: thin;
}
.ms-pri-group { padding: 8px 0; }
.ms-pri-label {
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #64637a;
  padding: 0 14px 6px;
}
.ms-topic-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  cursor: pointer;
  border-left: 2px solid transparent;
  transition: background 0.15s;
}
.ms-topic-item:hover { background: rgba(31,31,39,0.6); }
.ms-topic-item.active {
  background: rgba(93,95,239,0.1);
  border-left-color: #c1c1ff;
}
.ms-tdot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.ms-tname { flex: 1; font-size: 0.78rem; font-weight: 600; color: #c7c4d7; line-height: 1.3; }
.ms-topic-item.active .ms-tname { color: #e4e1ed; }
.ms-tq { font-size: 0.65rem; font-weight: 700; color: #64637a; flex-shrink: 0; }
.ms-tbanko { font-size: 0.6rem; color: #fbbf24; flex-shrink: 0; }
.ms-loading-notes {
  padding: 40px 20px;
  text-align: center;
  color: #908fa0;
  font-size: 0.8rem;
}

/* Engine panel */
.ms-engine-panel {
  flex: 1;
  overflow-y: auto;
  background: rgba(15,15,22,0.95);
  padding: 20px;
  scrollbar-width: thin;
}
.ms-visual-area { min-height: 400px; }
.ms-ve-empty, .sn-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 300px;
  color: #464555;
  text-align: center;
  gap: 10px;
  font-size: 0.85rem;
}

/* Notes panel — Serene / Lumina açık defter */
.ms-notes-panel {
  width: 360px;
  flex-shrink: 0;
  border-left: 1px solid #ebeef3;
  overflow: hidden;
  background: #f7f9fe;
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 10;
  padding: 0;
}
/* Sol TOC + defter — geniş panel (sadece masaüstü) */
@media (min-width: 901px) {
  .ms-notes-panel.ms-notes-toc-layout,
  .ms-notes-panel:has(.sn-shell) {
    width: min(680px, 52vw);
    min-width: 560px;
  }
}
.ms-notes-body {
  flex: 1;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.ms-notes-toolbar {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 0;
  border-bottom: 1px solid #ebeef3;
  background: #ffffff;
  flex-shrink: 0;
  position: relative;
}
.ms-notes-toolbar-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px 10px;
  min-height: 42px;
}
.ms-notes-toolbar-label {
  font-size: 0.58rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #404945;
  flex-shrink: 0;
  padding-right: 4px;
}
.ms-notes-tb-group {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px;
  border-radius: 10px;
  background: rgba(31,31,39,0.6);
  border: 1px solid rgba(70,69,85,0.35);
}
.ms-notes-tb-group--layout { flex-wrap: wrap; }
.ms-notes-back-btn {
  background: rgba(52,211,153,0.15) !important;
  border-color: rgba(52,211,153,0.45) !important;
  color: #6ee7b7 !important;
  margin-right: 4px;
}
.ms-notes-back-btn:hover { background: rgba(52,211,153,0.25) !important; }
.ms-notes-panel.ms-notes-pdf-mode .ms-notes-toolbar-row {
  border-bottom: 1px solid rgba(52,211,153,0.2);
}
.ms-tb-ico { font-size: 0.85rem; line-height: 1; }
.ms-tb-txt { font-size: 0.58rem; }
.ms-notes-tb-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 8px;
  border-radius: 8px;
  border: 1px solid #ebeef3;
  background: #f1f4f9;
  color: #404945;
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  font-size: 0.58rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
}
.ms-notes-tb-btn:hover { background: rgba(167, 215, 197, 0.35); border-color: #a7d7c5; color: #3a6758; }
.ms-notes-tb-btn.active {
  background: rgba(58, 103, 88, 0.12);
  border-color: #3a6758;
  color: #3a6758;
}
.ms-notes-tb-print { margin-left: auto; }
.ms-notes-toolbar-actions {
  display: flex;
  gap: 4px;
  flex: 1;
  justify-content: flex-end;
}
.ms-notes-resize {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 6px;
  cursor: ew-resize;
  z-index: 2;
}
.ms-notes-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 900;
  /* blur kaldırıldı — tam ekran notların üstüne binip bulanıklaştırıyordu */
}
.ms-notes-backdrop.active { display: block; }

body.ms-notes-fullscreen-active {
  overflow: hidden;
}

.ms-notes-panel.ms-notes-center {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(720px, 92vw) !important;
  height: min(78vh, 860px);
  z-index: 950;
  border-radius: 16px;
  border: 1px solid rgba(193,193,255,0.25);
  box-shadow: 0 24px 80px rgba(0,0,0,0.55);
  -webkit-font-smoothing: antialiased;
  backface-visibility: hidden;
}
.ms-notes-panel.ms-notes-center.ms-notes-toc-layout,
.ms-notes-panel.ms-notes-center:has(.sn-shell) {
  width: min(960px, 94vw) !important;
  height: min(86vh, 920px);
}
.ms-notes-panel.ms-notes-fullscreen {
  position: fixed;
  inset: 0;
  width: 100% !important;
  height: 100% !important;
  max-width: none !important;
  min-width: 0 !important;
  z-index: 1000;
  border-radius: 0;
  border: none;
  box-shadow: none;
  -webkit-font-smoothing: antialiased;
  backface-visibility: hidden;
}
.ms-engine-toolbar {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 10px;
}
.ms-engine-tb-btn {
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid rgba(70,69,85,0.4);
  background: rgba(31,31,39,0.8);
  color: #908fa0;
  font-family: Montserrat, sans-serif;
  font-size: 0.62rem;
  font-weight: 700;
  cursor: pointer;
}
.ms-engine-tb-btn:hover { border-color: #34d399; color: #6ee7b7; }
.ms-engine-panel.ms-engine-collapsed .ms-visual-area { display: none; }
.ms-engine-panel.ms-engine-collapsed { flex: 0 0 auto; min-height: 0; padding-bottom: 8px; }
.geo-map-body { display: block; }
.geo-zoom-group {
  display: inline-flex;
  gap: 2px;
  margin-left: auto;
}
.geo-tb-zoom {
  min-width: 32px;
  padding: 8px 10px !important;
  font-size: 0.85rem !important;
  line-height: 1;
}
.geo-toolbar { align-items: center; }

/* ── TopicCard ── */
.tc-card { }
.tc-header { margin-bottom: 16px; }
.tc-badges { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.tc-badge {
  font-size: 0.65rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 9999px;
  border: 1px solid;
}
.tc-banko { color: #ffc146; border-color: rgba(255,193,70,0.3); background: rgba(255,193,70,0.1); }
.tc-q { color: #908fa0; border-color: rgba(70,69,85,0.4); background: rgba(70,69,85,0.2); }
.tc-engine-label {
  font-size: 0.65rem;
  color: #64637a;
  display: flex;
  align-items: center;
  gap: 4px;
}
.tc-section { margin-bottom: 18px; }
.tc-section-title {
  font-size: 0.75rem;
  font-weight: 700;
  color: #c1c1ff;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.tc-ozet { font-size: 0.82rem; line-height: 1.7; color: #c7c4d7; }
.tc-puf-section { background: rgba(255,193,70,0.05); border: 1px solid rgba(255,193,70,0.15); border-radius: 12px; padding: 12px; }
.tc-puf-item {
  font-size: 0.78rem;
  color: #c7c4d7;
  padding: 6px 0;
  border-bottom: 1px solid rgba(70,69,85,0.2);
  line-height: 1.5;
  display: flex;
  gap: 8px;
}
.tc-puf-item:last-child { border-bottom: none; }
.tc-puf-num {
  width: 20px; height: 20px;
  border-radius: 6px;
  background: rgba(255,193,70,0.2);
  color: #ffc146;
  font-size: 0.65rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.tc-cel-section { background: rgba(248,113,113,0.05); border: 1px solid rgba(248,113,113,0.15); border-radius: 12px; padding: 12px; }
.tc-cel-item { font-size: 0.76rem; color: #c7c4d7; padding: 4px 0; line-height: 1.5; }

/* ── Timeline Engine ── */
.tl-engine { padding: 8px; }
.tl-section-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #908fa0;
  margin-bottom: 16px;
}
.tl-track { position: relative; padding-left: 24px; }
.tl-track::before {
  content: '';
  position: absolute;
  left: 11px;
  top: 0; bottom: 0;
  width: 2px;
  background: linear-gradient(180deg, #fbbf24, #f87171, #c1c1ff);
  pointer-events: none !important;
}
.tl-item { position: relative; margin-bottom: 20px; padding-left: 20px; }
.tl-dot {
  position: absolute;
  left: -17px; top: 6px;
  width: 12px; height: 12px;
  border-radius: 50%;
  background: #fbbf24;
  border: 2px solid #0d0d16;
  box-shadow: 0 0 8px rgba(251,191,36,0.5);
}
.tl-year {
  font-size: 0.72rem;
  font-weight: 800;
  color: #fbbf24;
  margin-bottom: 4px;
}
.tl-card {
  background: rgba(31,31,39,0.8);
  border: 1px solid rgba(70,69,85,0.3);
  border-radius: 12px;
  padding: 12px 14px;
}
.tl-title { font-weight: 700; font-size: 0.88rem; color: #e4e1ed; }
.tl-desc { font-size: 0.76rem; color: #908fa0; margin-top: 4px; line-height: 1.5; }
.tl-cause { font-size: 0.7rem; color: #fbbf24; margin-top: 6px; font-style: italic; }

.tl-tree { margin-top: 8px; }
.tl-tree-node { margin-bottom: 12px; }
.tl-tree-cause {
  display: inline-block;
  padding: 6px 12px;
  border-radius: 8px;
  background: rgba(248,113,113,0.15);
  border: 1px solid rgba(248,113,113,0.3);
  color: #fca5a5;
  font-size: 0.78rem;
  font-weight: 600;
}
.tl-tree-arrow { color: #64637a; font-size: 0.8rem; margin: 4px 0; }
.tl-tree-effect {
  display: inline-block;
  padding: 6px 12px;
  border-radius: 8px;
  background: rgba(63,223,165,0.15);
  border: 1px solid rgba(63,223,165,0.3);
  color: #3fdfa5;
  font-size: 0.78rem;
  font-weight: 600;
}

.tl-inkilaplar { margin-top: 24px; }
.tl-ink-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid rgba(70,69,85,0.2);
}
.tl-ink-year { font-weight: 800; color: #c1c1ff; font-size: 0.82rem; width: 48px; }
.tl-ink-title { flex: 1; font-size: 0.8rem; color: #e4e1ed; font-weight: 600; }
.tl-ink-ilke { font-size: 0.68rem; color: #908fa0; padding: 2px 8px; border-radius: 9999px; background: rgba(193,193,255,0.1); }
.tl-empty { font-size: 0.8rem; color: #64637a; padding: 20px; text-align: center; }
.tl-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
.tl-tab {
  padding: 6px 14px;
  border-radius: 9999px;
  border: 1px solid rgba(70,69,85,0.4);
  background: rgba(31,31,39,0.6);
  color: #908fa0;
  font-family: Montserrat, sans-serif;
  font-size: 0.68rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
}
.tl-tab.active {
  background: rgba(251,191,36,0.15);
  border-color: #fbbf24;
  color: #fbbf24;
}
.tl-tab-content { margin-bottom: 20px; }
.tl-tab-panel { display: none; }
.tl-tab-panel.active { display: block; }
.tl-tab-intro { font-size: 0.78rem; color: #908fa0; margin-bottom: 12px; line-height: 1.5; }
.tl-data-card {
  background: rgba(31,31,39,0.6);
  border: 1px solid rgba(70,69,85,0.3);
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 10px;
}
.tl-dc-title { font-weight: 700; font-size: 0.85rem; color: #fbbf24; margin-bottom: 6px; }
.tl-dc-body { font-size: 0.76rem; color: #c7c4d7; line-height: 1.55; }

/* ── Geo Engine (D3) — Kategorize Seçici ── */
.geo-engine { position: relative; display: flex; flex-direction: column; gap: 10px; min-height: 520px; }
.geo-toolbar { display: flex; flex-wrap: wrap; gap: 8px; }
.geo-picker {
  background: rgba(19,19,27,0.85);
  border: 1px solid rgba(70,69,85,0.35);
  border-radius: 14px;
  overflow: hidden;
}
.geo-cat-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  border-bottom: 1px solid rgba(70,69,85,0.35);
  background: rgba(13,13,22,0.6);
}
.geo-cat-tab {
  flex: 1 1 auto;
  min-width: 72px;
  padding: 10px 8px;
  border: none;
  background: transparent;
  color: #64637a;
  font-family: Montserrat, sans-serif;
  font-size: 0.62rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
}
.geo-cat-tab:hover { color: #c7c4d7; background: rgba(255,255,255,0.03); }
.geo-cat-tab.active {
  color: #34d399;
  border-bottom-color: #34d399;
  background: rgba(52,211,153,0.08);
}
.geo-cat-panels { padding: 10px; max-height: 130px; overflow-y: auto; scrollbar-width: thin; }
.geo-cat-panel { display: none; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 6px; }
.geo-cat-panel.active { display: grid; }
.geo-pick-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid rgba(70,69,85,0.35);
  background: rgba(31,31,39,0.7);
  color: #c7c4d7;
  font-family: Montserrat, sans-serif;
  font-size: 0.65rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  text-align: left;
}
.geo-pick-btn:hover { border-color: #34d399; transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0,0,0,0.2); }
.geo-pick-btn.geo-pick-active { border-color: #34d399; background: rgba(52,211,153,0.15); color: #6ee7b7; }
.geo-pick-go { font-size: 0.58rem; opacity: 0.6; flex-shrink: 0; }
.geo-pick-label { flex: 1; line-height: 1.3; }
.geo-lb-red .geo-pick-btn, .geo-pick-btn.geo-lb-red { border-left: 3px solid #ef4444; }
.geo-lb-orange .geo-pick-btn, .geo-pick-btn.geo-lb-orange { border-left: 3px solid #f97316; }
.geo-lb-green .geo-pick-btn, .geo-pick-btn.geo-lb-green { border-left: 3px solid #10b981; }
.geo-lb-blue .geo-pick-btn, .geo-pick-btn.geo-lb-blue { border-left: 3px solid #3b82f6; }
.geo-lb-cyan .geo-pick-btn, .geo-pick-btn.geo-lb-cyan { border-left: 3px solid #06b6d4; }
.geo-lb-amber .geo-pick-btn, .geo-pick-btn.geo-lb-amber { border-left: 3px solid #f59e0b; }
.geo-lb-purple .geo-pick-btn, .geo-pick-btn.geo-lb-purple { border-left: 3px solid #a855f7; }
.geo-lb-teal .geo-pick-btn, .geo-pick-btn.geo-lb-teal { border-left: 3px solid #14b8a6; }
.geo-lb-stone .geo-pick-btn, .geo-pick-btn.geo-lb-stone { border-left: 3px solid #78716c; }
.geo-tb-btn {
  padding: 8px 14px;
  border-radius: 10px;
  border: 1px solid rgba(70,69,85,0.4);
  background: rgba(31,31,39,0.8);
  color: #c7c4d7;
  font-family: Montserrat, sans-serif;
  font-size: 0.68rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
}
.geo-tb-btn:hover { border-color: #c1c1ff; color: #e4e1ed; }
.geo-tb-physical {
  background: linear-gradient(135deg, rgba(34,197,94,0.2), rgba(234,179,8,0.2), rgba(180,83,9,0.2));
}
.geo-tb-active { background: #334155 !important; color: #fff !important; }
.geo-tb-clear { color: #f87171; }
.geo-tb-on { color: #4ade80; }
.geo-tb-off { color: #64637a; }
.geo-d3-wrap { position: relative; flex-shrink: 0; }
.geo-d3-canvas {
  height: 400px;
  border-radius: 14px;
  border: 1px solid rgba(70,69,85,0.3);
  overflow: hidden;
  background: #fef3c7;
  position: relative;
  flex-shrink: 0;
}
.geo-svg { width: 100%; height: 100%; }
.geo-province { transition: fill 0.4s; }
.geo-layer-permanent-lakes { pointer-events: none; }
.geo-lake-spot { pointer-events: none; }
.geo-city-label { pointer-events: none !important; }
.geo-city-label-group { pointer-events: none !important; }
.geo-marker-group { pointer-events: none !important; }
.geo-marker-label { pointer-events: none !important; }
.geo-path-label { pointer-events: none !important; }
.geo-toast {
  position: absolute;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(15,23,42,0.92);
  color: #fff;
  padding: 10px 20px;
  border-radius: 9999px;
  font-size: 0.72rem;
  font-weight: 600;
  opacity: 0;
  transition: opacity 0.3s, transform 0.3s;
  border: 1px solid rgba(100,116,139,0.4);
  z-index: 20;
  max-width: 90%;
  text-align: center;
  pointer-events: none !important;
}
.geo-error { padding: 40px; text-align: center; color: #f87171; }

/* ── Matrix Engine ── */
.mx-engine { padding: 8px; }
.mx-section-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #908fa0;
  margin-bottom: 14px;
}
.mx-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; }
.mx-card {
  background: rgba(31,31,39,0.8);
  border: 1px solid rgba(70,69,85,0.3);
  border-radius: 14px;
  padding: 16px;
  text-align: center;
}
.mx-card-icon { font-size: 28px; display: block; margin-bottom: 8px; }
.mx-card-label { font-weight: 700; font-size: 0.85rem; color: #e4e1ed; }
.mx-card-tip { font-size: 0.72rem; color: #908fa0; margin-top: 4px; }

.mx-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
  margin-bottom: 12px;
}
.mx-table th, .mx-table td {
  border: 1px solid rgba(70,69,85,0.3);
  padding: 8px 12px;
  text-align: center;
}
.mx-table th { background: rgba(93,95,239,0.15); color: #c1c1ff; font-weight: 700; }
.mx-table td { color: #c7c4d7; }
.mx-unknown { color: #fbbf24 !important; font-weight: 700; }
.mx-rule { font-size: 0.76rem; color: #908fa0; padding: 4px 0; }
.mx-keywords { display: flex; flex-wrap: wrap; gap: 8px; }
.mx-kw {
  padding: 6px 14px;
  border-radius: 8px;
  background: rgba(96,165,250,0.15);
  border: 1px solid rgba(96,165,250,0.3);
  color: #60a5fa;
  font-size: 0.8rem;
  font-weight: 600;
}
.mx-gram-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.mx-gram-item {
  padding: 10px;
  border-radius: 10px;
  background: rgba(31,31,39,0.6);
  border: 1px solid rgba(70,69,85,0.3);
  font-size: 0.78rem;
  color: #c7c4d7;
  text-align: center;
  font-weight: 600;
}

/* ── Formula Engine ── */
.fm-engine { padding: 8px; }
.fm-section-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #908fa0;
  margin-bottom: 14px;
}
.fm-formula-block {
  background: rgba(31,31,39,0.6);
  border: 1px solid rgba(70,69,85,0.3);
  border-radius: 14px;
  padding: 16px;
  margin-bottom: 14px;
}
.fm-formula-name { font-weight: 700; font-size: 0.9rem; color: #f87171; margin-bottom: 12px; }
.fm-step { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 4px; }
.fm-step-num {
  width: 24px; height: 24px;
  border-radius: 8px;
  background: rgba(248,113,113,0.2);
  color: #f87171;
  font-size: 0.72rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.fm-step-text { font-size: 0.8rem; color: #c7c4d7; line-height: 1.5; padding-top: 2px; }
.fm-step-arrow { color: #64637a; margin-left: 7px; font-size: 0.8rem; }

/* ── Legal Engine ── */
.lg-engine { padding: 8px; }
.lg-section-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #908fa0;
  margin-bottom: 14px;
}
.lg-node { margin-bottom: 12px; }
.lg-node-title {
  display: inline-block;
  padding: 8px 16px;
  border-radius: 10px;
  background: rgba(167,139,250,0.15);
  border: 1px solid rgba(167,139,250,0.3);
  color: #a78bfa;
  font-weight: 700;
  font-size: 0.85rem;
}
.lg-depth-1 .lg-node-title { background: rgba(96,165,250,0.15); border-color: rgba(96,165,250,0.3); color: #60a5fa; font-size: 0.78rem; }
.lg-children { margin-top: 8px; margin-left: 16px; display: flex; flex-wrap: wrap; gap: 8px; }
.lg-child {
  padding: 6px 12px;
  border-radius: 8px;
  background: rgba(31,31,39,0.6);
  border: 1px solid rgba(70,69,85,0.3);
  font-size: 0.76rem;
  color: #c7c4d7;
}
.lg-guncel-box {
  margin-top: 20px;
  padding: 14px;
  border-radius: 12px;
  background: rgba(63,223,165,0.08);
  border: 1px solid rgba(63,223,165,0.2);
}
.lg-guncel-title { font-weight: 700; font-size: 0.82rem; color: #3fdfa5; margin-bottom: 6px; }
.lg-guncel-body { font-size: 0.76rem; color: #908fa0; line-height: 1.6; }

.ms-error { text-align: center; padding: 60px; color: #f87171; }

.ms-empty-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: #e4e1ed;
  margin: 0 0 6px;
}
.ms-empty-sub {
  margin: 0;
  font-size: 0.85rem;
  color: #908fa0;
  line-height: 1.5;
}
.ms-empty-sub strong { color: #c1c1ff; }

.ms-workspace-empty .ms-ws-body-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
  padding: 32px 24px;
}
.ms-empty-ders {
  text-align: center;
  max-width: 420px;
}
.ms-empty-ders .ms-empty-title {
  font-size: 1.35rem;
  margin-top: 16px;
}
.ms-empty-back {
  margin-top: 24px;
  padding: 10px 20px;
  border-radius: 10px;
  border: 1px solid #3f3f4d;
  background: #1a1a24;
  color: #c1c1ff;
  cursor: pointer;
  font-size: 0.85rem;
}
.ms-empty-back:hover { background: #252532; }

.sn-empty, .mr-empty {
  color: #908fa0;
}

.ms-loading-screen {
  text-align: center;
  padding: 80px 24px;
  color: #908fa0;
  font-size: 0.9rem;
}

.ms-mobile-topics-btn {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 14px;
  border-radius: 12px;
  border: none;
  background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
  color: #fff;
  font-family: Montserrat, sans-serif;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  touch-action: manipulation;
  flex-shrink: 0;
  box-shadow: 0 4px 18px rgba(99, 102, 241, 0.45);
}
.ms-mobile-topics-btn .material-symbols-outlined { font-size: 20px; }

.ms-sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 110;
}
.ms-sidebar-backdrop.active { display: block; }

body.ms-sidebar-open { overflow: hidden; }

/* ── Mobile ── */
@media (max-width: 900px) {
  .ms-dashboard { padding-bottom: calc(88px + env(safe-area-inset-bottom)); }
  .ms-mobile-topics-btn { display: inline-flex; }
  .ms-ws-topbar {
    display: grid;
    grid-template-columns: auto 1fr;
    grid-template-areas:
      "back subject"
      "topics topics";
    gap: 10px;
    padding: 10px 14px;
    align-items: center;
  }
  .ms-back { grid-area: back; }
  .ms-ws-subject { grid-area: subject; flex: 1; min-width: 0; }
  .ms-mobile-topics-btn {
    grid-area: topics;
    width: 100%;
    padding: 12px 16px;
    font-size: 0.88rem;
  }
  .ms-ws-subj-title { font-size: 0.9rem; }
  .ms-ws-body {
    flex-direction: column;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
  }
  .ms-ws-splitter { display: none !important; }
  .ms-sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: min(300px, 88vw);
    max-height: none;
    z-index: 120;
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    border-right: 1px solid rgba(70,69,85,0.4);
    box-shadow: 8px 0 32px rgba(0,0,0,0.45);
  }
  .ms-sidebar.is-open { transform: translateX(0); }
  .ms-notes-panel,
  .ms-notes-panel.ms-notes-toc-layout,
  .ms-notes-panel:has(.sn-shell),
  .ms-notes-panel.ms-notes-main,
  .ms-notes-panel.ms-notes-fullscreen,
  .ms-notes-panel.ms-notes-center {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
  }
  .ms-layout-notes-first .ms-notes-main,
  .ms-layout-notes-only .ms-notes-main,
  .ms-layout-map-first .ms-notes-main,
  .ms-layout-balanced .ms-notes-main {
    min-width: 0 !important;
    max-width: 100% !important;
  }
  .ms-notes-body,
  #ms-study-notes {
    min-width: 0;
    max-width: 100%;
  }
  .ms-notes-panel {
    min-height: 50vh;
    border-left: none;
    border-top: 1px solid rgba(70,69,85,0.3);
    order: 2;
  }
  .ms-engine-panel,
  .ms-engine-side {
    width: 100% !important;
    min-width: 0 !important;
    max-width: none !important;
    order: 3;
    min-height: 280px;
  }
  .ms-engine-side.ms-engine-collapsed {
    min-height: 0 !important;
    flex: 0 0 auto !important;
  }
  .ms-workspace {
    height: auto;
    min-height: calc(100vh - 64px);
    overflow: visible;
    padding-bottom: calc(72px + env(safe-area-inset-bottom));
  }
  .ms-dash-grid { grid-template-columns: 1fr; }
  .ms-notes-toolbar-row { gap: 4px; padding: 6px 8px; }
  .ms-tb-txt { display: none; }
  .ms-notes-tb-btn { padding: 6px 8px; }
  .ms-notes-tb-group { gap: 2px; }
  .ms-ws-split-btn { display: none !important; }
  .ms-notes-resize { display: none; }
  .ms-visual-area { min-height: 260px; }
  .ms-topic-item {
    padding: 12px 14px;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
  }
}
