/* Functional styles for tool widgets — design system may override later */
.tool-map-wrap {
  position: relative;
  width: 100%;
  border: 1px solid var(--border, #2f3d4f);
  border-radius: 8px;
  overflow: hidden;
  background: #0b1a28;
  margin-top: .75rem;
}
.tool-map-wrap canvas {
  display: block;
  width: 100%;
  height: auto;
  cursor: crosshair;
}
.tool-map-hint { font-size: .8rem; color: var(--muted, #9aabbd); margin: .4rem 0 0; }
#q-table tr { cursor: pointer; }
#q-table tr.is-selected { background: rgba(61,156,240,.12); }
.df-toolbar { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin: .75rem 0; }
.df-view {
  border: 1px solid var(--border, #2f3d4f);
  border-radius: 8px;
  background: var(--bg, #0f1419);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .82rem;
  line-height: 1.45;
  max-height: 480px;
  overflow: auto;
}
.df-side-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .5rem;
}
@media (max-width: 720px) {
  .df-side-grid { grid-template-columns: 1fr; }
}
.df-side-pane { max-height: 480px; overflow: auto; border: 1px solid var(--border, #2f3d4f); border-radius: 8px; background: var(--bg, #0f1419); }
.df-line { padding: .1rem .55rem; white-space: pre-wrap; word-break: break-word; border-left: 3px solid transparent; }
.df-eq { color: var(--muted, #9aabbd); }
.df-del { background: rgba(240,113,120,.12); border-left-color: #f07178; color: #f5c0c3; }
.df-add { background: rgba(62,207,142,.12); border-left-color: #3ecf8e; color: #b6f0d3; }
.df-gap { min-height: 1.45em; background: rgba(255,255,255,.02); opacity: .5; }
.df-gutter, .df-num {
  display: inline-block;
  width: 2.2rem;
  margin-right: .4rem;
  color: var(--muted, #9aabbd);
  user-select: none;
}
.df-word-del { background: rgba(240,113,120,.35); border-radius: 2px; }
.df-word-add { background: rgba(62,207,142,.35); border-radius: 2px; }
.df-stats { font-size: .88rem; color: var(--muted, #9aabbd); margin: .35rem 0; }
button[aria-pressed="true"] { outline: 2px solid var(--accent, #3d9cf0); outline-offset: 2px; }

/* difftext word marks */
mark.df-add-word { background: #c6f6d5; color: inherit; padding: 0 .1em; }
mark.df-del-word { background: #fed7d7; color: inherit; padding: 0 .1em; text-decoration: line-through; }
.df-line { display: flex; gap: .5rem; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .85rem; line-height: 1.45; padding: .05rem .35rem; white-space: pre-wrap; word-break: break-word; }
.df-gutter { flex: 0 0 1.2rem; opacity: .55; user-select: none; }
.df-code { flex: 1; }
.df-add { background: rgba(72, 187, 120, 0.12); }
.df-del { background: rgba(245, 101, 101, 0.12); }
.df-blank { background: transparent; opacity: .35; }
.df-side-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; margin-top: .75rem; }
.df-side-pane { border: 1px solid var(--border, #2a3441); border-radius: 8px; max-height: 420px; overflow: auto; background: var(--panel, #0f1419); }
.df-toolbar { display: flex; gap: .5rem; flex-wrap: wrap; margin: .75rem 0; }
.df-stats { color: var(--muted, #9aa7b5); font-size: .9rem; }
@media (max-width: 800px) { .df-side-grid { grid-template-columns: 1fr; } }

/* Leaflet host — functional only */
.tool-leaflet { height: 420px; width: 100%; border-radius: 8px; border: 1px solid var(--border, #2a3441); margin-top: .75rem; background: #0b1220; }
.tool-leaflet .leaflet-container { background: #0b1220; font: inherit; }
