/* ═══════════════════════════════════════════════════
   base.css — Reset, CSS custom properties (tokens),
              and typography defaults
   ═══════════════════════════════════════════════════ */

/* ── Box-model reset ─────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* ── Design tokens — Permanent Dark Mode (docs/DESIGN.md) ────────── */
:root {
  /* Canonical Tokens */
  --bg:             #151515;           /* Main background */
  --sidebar-bg:     #111111;           /* Sidebar background */
  --accent:         #FB6500;           /* Primary accent */
  --text:           #F5F2F2;           /* Primary text */
  --on-accent:      #151515;           /* Text on top of solid accent elements */

  /* Derived Tokens */
  --surface:        #1E1E1E;           /* Cards, modals, dropdowns, inputs */
  --border:         rgba(245, 242, 242, 0.09); /* Low-contrast white border */
  --border-subtle:  rgba(245, 242, 242, 0.06);
  --text-muted:     rgba(245, 242, 242, 0.6);  /* Muted text (~60% opacity) */
  --accent-hover:   #E05A00;           /* Subtle dark/light hover state for accent */
  --accent-soft:    rgba(251, 101, 0, 0.14);  /* Accent container/selected background */
  --danger:         #D32F2F;           /* Muted red (ONLY for delete/failed) */
  --success:        #388E3C;           /* Muted green (ONLY for "Ready" status) */

  /* Legacy Aliases Mapping to Canonical System */
  --bg-main:        var(--bg);
  --bg-sidebar:     var(--sidebar-bg);
  --bg-hover:       var(--surface);        /* Hover/active background for list items */
  --text-primary:   var(--text);
  --text-secondary: var(--text-muted);
  --text-tertiary:  var(--text-muted);
  --black:          var(--text);
  --white:          var(--surface);
  --white-text:     var(--on-accent);
  --btn-border:     var(--border);
}

/* ── App Shell / Touch Context & Selection Rules ──────── */
body.axon-native-app,
body.axon-native-app * {
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  -webkit-user-select: none;
}

/* Allow text selection and copy/paste inside chat messages and input fields */
body.axon-native-app .chat-message,
body.axon-native-app .chat-message *,
body.axon-native-app .message-body,
body.axon-native-app .message-body *,
body.axon-native-app .msg-bubble,
body.axon-native-app .msg-bubble *,
body.axon-native-app .user-msg,
body.axon-native-app .user-msg *,
body.axon-native-app .bot-msg,
body.axon-native-app .bot-msg *,
body.axon-native-app input,
body.axon-native-app textarea,
body.axon-native-app [contenteditable="true"] {
  user-select: text !important;
  -webkit-user-select: text !important;
  -webkit-touch-callout: default !important;
}

/* ── Custom Scrollbars ────────────────────────────── */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--surface) transparent;
}

::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--surface);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--border);
}
