/* /assets/debug-console.css  —  AHAVA=ECHAD debug overlay styling.  v1
 * Paired with /assets/debug-console.js (loaded only when ?debug=1 is active).
 * Forced LTR + monospace because the host pages are RTL Hebrew. */

#dbgc {
  position: fixed;
  top: 8px;
  right: 8px;
  width: min(420px, calc(100vw - 16px));
  max-height: 50vh;
  z-index: 2147483647; /* above any modal/overlay the page might raise */
  display: flex;
  flex-direction: column;
  font: 11px/1.35 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color: #e6e6e6;
  background: rgba(0, 0, 0, 0.92);
  border: 1px solid #444;
  border-radius: 6px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
  direction: ltr;
  text-align: left;
  unicode-bidi: isolate;
  user-select: text;
}

#dbgc.dbgc-collapsed { max-height: none; }
#dbgc.dbgc-collapsed #dbgc-log { display: none; }

#dbgc-bar {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 6px;
  background: #1a1a1a;
  border-bottom: 1px solid #333;
  border-radius: 6px 6px 0 0;
  flex-wrap: wrap;
}
#dbgc.dbgc-collapsed #dbgc-bar { border-bottom: none; border-radius: 6px; }

#dbgc-bar .dbgc-title {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #9aa;
  font-weight: 600;
}
#dbgc-hb, #dbgc-count {
  padding: 1px 5px;
  background: #2a2a2a;
  border-radius: 3px;
  color: #9ca;
  font-variant-numeric: tabular-nums;
}
#dbgc-count { color: #ca9; }

#dbgc-bar button {
  appearance: none;
  -webkit-appearance: none;
  margin: 0;
  padding: 2px 6px;
  font: inherit;
  color: #ddd;
  background: #333;
  border: 1px solid #555;
  border-radius: 3px;
  cursor: pointer;
  min-height: 22px; /* mobile tap target */
}
#dbgc-bar button:hover  { background: #444; }
#dbgc-bar button:active { background: #555; }

#dbgc-log {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: auto;
  padding: 4px 6px;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

.dbgc-row {
  white-space: pre-wrap;
  word-break: break-word;
  padding: 1px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}
.dbgc-row:last-child { border-bottom: none; }

.dbgc-dbg  { color: #bbb; }
.dbgc-log  { color: #fff; }
.dbgc-info { color: #6cf; }
.dbgc-ok   { color: #7d7; }
.dbgc-warn { color: #fc6; }
.dbgc-err  { color: #f77; background: rgba(255, 0, 0, 0.08); }

@media (prefers-color-scheme: light) {
  #dbgc {
    color: #1a1a1a;
    background: rgba(255, 255, 255, 0.96);
    border-color: #999;
  }
  #dbgc-bar { background: #eee; border-bottom-color: #ccc; }
  #dbgc-bar .dbgc-title { color: #556; }
  #dbgc-hb, #dbgc-count { background: #ddd; color: #363; }
  #dbgc-count { color: #633; }
  #dbgc-bar button { color: #222; background: #fafafa; border-color: #bbb; }
  #dbgc-bar button:hover  { background: #eee; }
  #dbgc-bar button:active { background: #ddd; }
  .dbgc-row  { border-bottom-color: rgba(0, 0, 0, 0.05); }
  .dbgc-dbg  { color: #555; }
  .dbgc-log  { color: #111; }
  .dbgc-info { color: #06c; }
  .dbgc-ok   { color: #060; }
  .dbgc-warn { color: #a60; }
  .dbgc-err  { color: #b00; background: rgba(255, 0, 0, 0.06); }
}

@media (max-width: 480px) {
  #dbgc { font-size: 10.5px; max-height: 45vh; }
}
