/* ============================================================
   BASE — Reset, body, global typography, focus, scrollbars
   ============================================================ */

*,
*::before,
*::after { box-sizing: border-box; }

html,
body {
  width: 100%;
  min-height: 100%;
  margin: 0;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

button,
input { font: inherit; }
button { color: inherit; }
a { color: inherit; text-decoration: none; }

button:focus-visible,
input:focus-visible,
a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Scrollbars */
*::-webkit-scrollbar        { width: 9px; height: 9px; }
*::-webkit-scrollbar-track  { background: rgba(0,0,0,0.06); }
*::-webkit-scrollbar-thumb  {
  background: linear-gradient(180deg, #7caadf, #4e85cc);
  border: 2px solid rgba(255,255,255,0.6);
  border-radius: 99px;
}
*::-webkit-scrollbar-thumb:hover { background: #4078bf; }

/* Custom cursor system */
body {
  cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24'%3E%3Cpath d='M4 3l8 8H8l2 7-3 1-2-7-3 3z' fill='%23f0f6ff' stroke='%230e2540' stroke-width='1'/%3E%3C/svg%3E") 2 2, default;
}

button, a, input, [role='button'],
.dock-button, .list-button, .route-button, .result-button,
.project-card, .note-card, .context-item, .win-btn,
.snap-button, .bar-button, .icon-button,
.mobile-tabs button, .confirm-actions button {
  cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24'%3E%3Cpath d='M8 3v8H5.5l5 5 1.7-1.7L9.9 12H12V3z' fill='%23f0f6ff' stroke='%230e2540' stroke-width='1' stroke-linejoin='round'/%3E%3Cpath d='M12 10.2h1.9l2.3 2.3v5.1h-2.2v-4l-2.1-2.1z' fill='%23f0f6ff' stroke='%230e2540' stroke-width='1' stroke-linejoin='round'/%3E%3C/svg%3E") 6 2, pointer !important;
}

body.dragging-window,
body.dragging-window * {
  cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24'%3E%3Cpath d='M12 3l2.6 2.6L13 7.2v3.3h3.3l1.6-1.6L20.5 12l-2.6 2.6-1.6-1.6H13v3.3l1.6 1.6L12 20.5l-2.6-2.6 1.6-1.6H7.7l-1.6 1.6L3.5 12l2.6-2.6 1.6 1.6H11V7.2L9.4 5.6z' fill='%23f0f6ff' stroke='%230e2540' stroke-width='0.9'/%3E%3C/svg%3E") 12 12, move !important;
  user-select: none !important;
}

body.resizing-window,
body.resizing-window * {
  user-select: none !important;
}

.resize-handle-n, .resize-handle-s {
  cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24'%3E%3Cpath d='M12 3l3 3h-2v12h2l-3 3-3-3h2V6H9z' fill='%23f0f6ff' stroke='%230e2540' stroke-width='1'/%3E%3C/svg%3E") 12 12, ns-resize !important;
}
.resize-handle-e, .resize-handle-w {
  cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24'%3E%3Cpath d='M3 12l3-3v2h12V9l3 3-3 3v-2H6v2z' fill='%23f0f6ff' stroke='%230e2540' stroke-width='1'/%3E%3C/svg%3E") 12 12, ew-resize !important;
}
.resize-handle-ne, .resize-handle-sw {
  cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24'%3E%3Cpath d='M5 19h6v-2H8.4L17 8.4V11h2V5h-6v2h2.6L7 15.6V13H5z' fill='%23f0f6ff' stroke='%230e2540' stroke-width='1'/%3E%3C/svg%3E") 12 12, nesw-resize !important;
}
.resize-handle-nw, .resize-handle-se {
  cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24'%3E%3Cpath d='M5 5v6h2V8.4L15.6 17H13v2h6v-6h-2v2.6L8.4 7H11V5z' fill='%23f0f6ff' stroke='%230e2540' stroke-width='1'/%3E%3C/svg%3E") 12 12, nwse-resize !important;
}

/* Motion reduction */
body.no-motion *,
body.no-motion *::before,
body.no-motion *::after {
  animation: none !important;
  transition: none !important;
  scroll-behavior: auto !important;
}

/* Plain/dev mode */
body.plain-mode .dev-detail { display: none; }
body:not(.plain-mode) .plain-detail { display: none; }
