@font-face { font-family: 'Barlow Condensed'; font-style: normal; font-weight: 600; font-display: swap; src: url('/fonts/barlow-condensed-600.woff2') format('woff2'); }
@font-face { font-family: 'Barlow Condensed'; font-style: normal; font-weight: 700; font-display: swap; src: url('/fonts/barlow-condensed-700.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 400; font-display: swap; src: url('/fonts/inter-400.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 500; font-display: swap; src: url('/fonts/inter-500.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 600; font-display: swap; src: url('/fonts/inter-600.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 700; font-display: swap; src: url('/fonts/inter-700.woff2') format('woff2'); }

:root {
  --nx-bg: #0d1117;
  --nx-surface: #141b24;
  --nx-surface-alt: #1b2431;
  --nx-surface-hover: #232f40;
  --nx-border: #243041;
  --nx-border-strong: #34445a;
  --nx-ink: #f1f5f9;
  --nx-muted: #98a8bc;
  --nx-accent: #eb5a2c;
  --nx-accent-hover: #ff6b3d;
  --nx-accent-text: #ff7e54;
  --nx-accent-soft: rgba(235, 90, 44, .16);
  --nx-blue: #3b9eff;
  --nx-green: #22c55e;
  --nx-amber: #f59e0b;
  --nx-danger: #f25c5c;
  --nx-danger-bg: rgba(242, 92, 92, .13);
  --nx-danger-border: rgba(242, 92, 92, .38);
  --nx-focus: #ff7e54;
  --nx-radius: 6px;
  --nx-radius-sm: 4px;
  --nx-shadow-pop: 0 14px 36px rgba(0, 0, 0, .55);
  --nx-bar-h: 50px;
  --nx-bottom-h: 58px;
  --nx-font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --nx-display: 'Barlow Condensed', 'DIN Alternate', 'Bahnschrift', 'Arial Narrow', system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { font-size: 16px; color-scheme: dark; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--nx-bg);
  color: var(--nx-ink);
  font: 15px/1.5 var(--nx-font);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100dvh;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: #6ab5ff; text-underline-offset: 2px; }
a:hover { color: #99ceff; }
:focus-visible { outline: 2px solid var(--nx-focus); outline-offset: 2px; }
svg { display: block; flex-shrink: 0; }
[hidden] { display: none !important; }

/* Top bar — Hudl / PlayDiagram matte obsidian single row */
.nx-bar {
  position: sticky; top: 0; z-index: 40;
  height: var(--nx-bar-h);
  padding: 0 14px;
  background: #0a0e13;
  color: var(--nx-ink);
  border-bottom: 1px solid var(--nx-border);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
}
.nx-bar-left, .nx-bar-right { display: flex; align-items: center; gap: 8px; min-width: 0; }
.nx-bar-left { overflow: hidden; }
.nx-bar-right { justify-content: flex-end; flex-shrink: 0; }
.nx-brand {
  display: inline-flex; align-items: center; gap: 8px;
  color: #fff; text-decoration: none;
  font: 700 16px/1 var(--nx-display); letter-spacing: .08em; text-transform: uppercase;
  flex-shrink: 0;
}
.nx-brand img { border-radius: 4px; }
.nx-bar-sep { width: 1px; height: 20px; background: var(--nx-border); flex-shrink: 0; }
.nx-book-trigger {
  display: inline-flex; align-items: center; gap: 7px; min-width: 0; max-width: 240px;
  padding: 5px 9px; border-radius: var(--nx-radius-sm);
  border: 1px solid var(--nx-border); background: var(--nx-surface);
  color: var(--nx-ink); cursor: pointer; font-size: 14px; font-weight: 600;
}
.nx-book-trigger:hover { background: var(--nx-surface-alt); border-color: var(--nx-border-strong); }
.nx-book-trigger span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nx-pill-count {
  font-variant-numeric: tabular-nums; font-size: 12px; font-weight: 700;
  padding: 1px 6px; border-radius: 3px;
  background: var(--nx-surface-hover); color: var(--nx-muted); flex-shrink: 0;
}

/* Sharp underline workspace tabs — zero pill chrome */
.nx-tabs { display: flex; align-items: stretch; height: var(--nx-bar-h); gap: 4px; }
.nx-tab {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 0 14px; border: 0; border-bottom: 2px solid transparent; border-radius: 0;
  background: transparent; color: var(--nx-muted); cursor: pointer;
  font: 700 13px/1 var(--nx-display); letter-spacing: .07em; text-transform: uppercase;
  white-space: nowrap; transition: color .12s, border-color .12s;
}
.nx-tab:hover { color: #fff; }
.nx-tab.active { color: #fff; border-bottom-color: var(--nx-accent); }
.nx-tab.active svg { color: var(--nx-accent-text); }

.save-state { font-size: 13px; color: var(--nx-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 185px; }
.nx-bar-link {
  display: inline-flex; align-items: center; height: 32px; padding: 0 10px;
  border-radius: var(--nx-radius-sm); color: #dbe5f0; text-decoration: none;
  font: 700 13px/1 var(--nx-display); letter-spacing: .06em; text-transform: uppercase;
  white-space: nowrap;
}
.nx-bar-link:hover { background: var(--nx-surface-alt); color: #fff; }
.nx-bar-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 32px; padding: 0 11px; border-radius: var(--nx-radius-sm);
  border: 1px solid var(--nx-border-strong); background: var(--nx-surface);
  color: var(--nx-ink); cursor: pointer;
  font: 600 13px/1 var(--nx-font); white-space: nowrap;
}
.nx-bar-btn:hover { background: var(--nx-surface-hover); border-color: #465a75; }
.nx-bar-btn.accent { background: var(--nx-accent); color: #fff; border-color: var(--nx-accent); font-weight: 700; }
.nx-bar-btn.accent:hover { background: var(--nx-accent-hover); border-color: var(--nx-accent-hover); }
.nx-bar-btn.icon-only { width: 32px; padding: 0; }

/* Mobile bottom nav */
.nx-bottom-nav {
  display: none;
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  min-height: var(--nx-bottom-h);
  padding: 5px 6px calc(5px + env(safe-area-inset-bottom, 0px));
  background: #0a0e13; border-top: 1px solid var(--nx-border);
  grid-template-columns: repeat(3, 1fr); gap: 4px;
  transform: translateZ(0);
}
.nx-bottom-tab {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  border: 0; border-top: 2px solid transparent; background: transparent; color: var(--nx-muted);
  border-radius: 0; font: 700 11px/1 var(--nx-display); letter-spacing: .06em; text-transform: uppercase;
  cursor: pointer; padding: 4px;
}
.nx-bottom-tab.active { color: #fff; border-top-color: var(--nx-accent); }
.nx-bottom-tab.active svg { color: var(--nx-accent-text); }

/* Crisp rectangular buttons & inputs */
.nx-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 8px 13px; border-radius: var(--nx-radius-sm);
  border: 1px solid var(--nx-border-strong);
  background: var(--nx-surface-alt); color: var(--nx-ink);
  font-size: 14px; font-weight: 600; line-height: 1.25; cursor: pointer; text-decoration: none;
  white-space: nowrap; transition: background .12s, border-color .12s;
}
.nx-btn:hover:not(:disabled) { background: var(--nx-surface-hover); border-color: #4a5f7a; }
.nx-btn:disabled { opacity: .38; cursor: not-allowed; }
.nx-btn.primary { background: var(--nx-accent); border-color: var(--nx-accent); color: #fff; font-weight: 700; }
.nx-btn.primary:hover:not(:disabled) { background: var(--nx-accent-hover); border-color: var(--nx-accent-hover); }
.nx-btn.ghost { border-color: transparent; background: transparent; color: var(--nx-muted); }
.nx-btn.ghost:hover:not(:disabled) { background: var(--nx-surface-alt); color: #fff; }
.nx-btn.danger-ghost { border-color: var(--nx-danger-border); background: var(--nx-danger-bg); color: #ff8c8c; }
.nx-btn.danger-ghost:hover:not(:disabled) { background: rgba(242, 92, 92, .22); color: #fff; }
.nx-btn.danger { background: #dc2626; border-color: #dc2626; color: #fff; }
.nx-btn.small { padding: 6px 10px; font-size: 13px; }
.nx-btn.icon-only { width: 34px; height: 34px; padding: 0; }
.nx-btn.full { width: 100%; }

.nx-seg {
  display: inline-flex; align-items: center; gap: 2px;
  padding: 2px; border-radius: var(--nx-radius-sm);
  background: #0b0f15; border: 1px solid var(--nx-border);
}
.nx-seg button {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 0; background: transparent; color: var(--nx-muted);
  padding: 5px 11px; border-radius: 3px; font-size: 13px; font-weight: 600; cursor: pointer;
}
.nx-seg button:hover { color: #fff; }
.nx-seg button.active { background: var(--nx-accent); color: #fff; font-weight: 700; }

.nx-field-label { display: flex; flex-direction: column; gap: 5px; font-size: 13px; font-weight: 600; color: var(--nx-muted); }
.nx-input, .nx-select, .nx-textarea {
  width: 100%; padding: 8px 10px; border-radius: var(--nx-radius-sm);
  border: 1px solid var(--nx-border-strong);
  background: #0c1118; color: var(--nx-ink); font-size: 15px; line-height: 1.4;
}
.nx-input::placeholder, .nx-textarea::placeholder { color: #63758c; }
.nx-input:focus, .nx-select:focus, .nx-textarea:focus { border-color: var(--nx-accent); outline: none; }
.nx-textarea { resize: vertical; min-height: 82px; }
.nx-help { margin: 0; font-size: 14px; color: var(--nx-muted); line-height: 1.45; }

/* Popover menu */
.nx-popover {
  position: fixed; z-index: 80; min-width: 232px; max-width: min(300px, calc(100vw - 16px));
  max-height: calc(100dvh - 24px); overflow-y: auto;
  background: #131a23; border: 1px solid var(--nx-border-strong);
  border-radius: var(--nx-radius); box-shadow: var(--nx-shadow-pop); padding: 5px;
}
.nx-menu-section {
  padding: 6px 9px 4px; font: 700 11px/1.2 var(--nx-display);
  letter-spacing: .08em; text-transform: uppercase; color: var(--nx-muted);
}
.nx-menu-item {
  width: 100%; display: flex; align-items: center; gap: 9px;
  padding: 8px 9px; border: 0; border-radius: var(--nx-radius-sm); background: transparent;
  color: var(--nx-ink); font-size: 14px; font-weight: 500; text-align: left;
  cursor: pointer; text-decoration: none;
}
.nx-menu-item:hover:not(:disabled) { background: var(--nx-surface-hover); color: #fff; }
.nx-menu-item.active { background: var(--nx-accent-soft); color: var(--nx-accent-text); font-weight: 700; }
.nx-menu-item.danger { color: #ff8080; }
.nx-menu-item.danger:hover:not(:disabled) { background: var(--nx-danger-bg); color: #ffb3b3; }
.nx-menu-item:disabled { opacity: .38; cursor: not-allowed; }
.nx-menu-item .nx-menu-meta { margin-left: auto; font-size: 12px; color: var(--nx-muted); font-variant-numeric: tabular-nums; }
.nx-menu-sep { height: 1px; background: var(--nx-border); margin: 5px 4px; }

/* Banners (compatible with account-ui.js) */
.account-banner, .recovery-banner {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
  padding: 9px 16px; background: #292011; border-bottom: 1px solid #6b4e1b;
  color: #fde68a; font-size: 14px;
}
.account-banner button, .recovery-banner button {
  padding: 5px 10px; border-radius: var(--nx-radius-sm); border: 1px solid #8a6424;
  background: #3d2f17; color: #fef3c7; font-size: 13px; font-weight: 600; cursor: pointer;
}

/* Toast with inline action */
.nx-toast {
  position: fixed; left: 50%; bottom: 22px; z-index: 90;
  transform: translate(-50%, 14px); opacity: 0; pointer-events: none;
  display: inline-flex; align-items: center; gap: 12px;
  max-width: min(560px, calc(100vw - 24px));
  padding: 10px 14px; border-radius: var(--nx-radius-sm);
  background: #1b2432; color: #fff; border: 1px solid var(--nx-border-strong);
  font-size: 14px; font-weight: 500; box-shadow: var(--nx-shadow-pop);
  transition: opacity .15s ease, transform .15s ease;
}
.nx-toast.show { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.nx-toast-action {
  border: 1px solid var(--nx-accent); background: var(--nx-accent);
  color: #fff; border-radius: 3px; padding: 4px 10px;
  font-size: 13px; font-weight: 700; cursor: pointer; white-space: nowrap;
}
.nx-toast-action:hover { background: var(--nx-accent-hover); }

/* Dialogs (account-ui, billing-ui, analytics privacy dialog) */
dialog {
  width: min(470px, calc(100vw - 24px));
  border: 1px solid var(--nx-border-strong); border-radius: var(--nx-radius);
  padding: 20px; background: var(--nx-surface); color: var(--nx-ink);
  box-shadow: var(--nx-shadow-pop);
}
dialog::backdrop { background: rgba(4, 7, 11, .72); }
dialog h2 { margin: 0; font: 700 20px/1.2 var(--nx-display); letter-spacing: .02em; }
dialog p { margin: 10px 0; font-size: 14px; color: var(--nx-muted); }
dialog label { display: flex; flex-direction: column; gap: 6px; margin: 12px 0; font-size: 14px; font-weight: 600; color: var(--nx-ink); }
dialog input:not([type="checkbox"]), dialog select {
  padding: 8px 10px; border-radius: var(--nx-radius-sm);
  border: 1px solid var(--nx-border-strong); background: #0c1118; color: var(--nx-ink); font-size: 15px;
}
.dialog-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 6px; }
.dialog-heading button { width: 32px; height: 32px; border-radius: var(--nx-radius-sm); border: 1px solid var(--nx-border-strong); background: var(--nx-surface-alt); color: var(--nx-ink); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; font-size: 17px; }
.dialog-actions, .privacy-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; margin-top: 16px; }
.dialog-actions button, .privacy-actions button {
  padding: 8px 13px; border-radius: var(--nx-radius-sm); border: 1px solid var(--nx-border-strong);
  background: var(--nx-surface-alt); color: var(--nx-ink); font-size: 14px; font-weight: 600; cursor: pointer;
}
.dialog-actions button.primary, .privacy-actions button:first-child { background: var(--nx-accent); border-color: var(--nx-accent); color: #fff; }
.dialog-actions button.danger { background: #dc2626; border-color: #dc2626; color: #fff; }
.google-sign-in { width: 100%; display: flex; align-items: center; justify-content: center; gap: 10px; padding: 9px; border-radius: var(--nx-radius-sm); border: 1px solid var(--nx-border-strong); background: var(--nx-surface-alt); color: #fff; font-weight: 600; cursor: pointer; }
.auth-divider { text-align: center; margin: 12px 0; font-size: 13px; color: var(--nx-muted); }
.account-links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.form-error { color: #ff8585; font-size: 14px; font-weight: 600; margin: 8px 0; }
.nx-shortcut-list { display: grid; grid-template-columns: auto 1fr; gap: 9px 14px; margin: 14px 0 0; align-items: center; }
.nx-shortcut-list > kbd { justify-self: start; }
.nx-shortcut-list kbd { display: inline-block; padding: 2px 7px; border-radius: 3px; background: #0b0f15; border: 1px solid var(--nx-border-strong); color: #fff; font: 700 12px/1.3 ui-monospace, SFMono-Regular, Consolas, monospace; }
.nx-shortcut-list span { font-size: 14px; color: var(--nx-muted); }

/* Native print mount: isolates 100%-scale sheets from app UI on iOS Safari/Chrome, Android & Desktop */
#nx-print-sheet { display: none; }
@media print {
  html, body { margin: 0 !important; padding: 0 !important; background: #ffffff !important; color: #111111 !important; min-height: 0 !important; }
  body.has-print-sheet #app,
  body.has-print-sheet #nx-menu,
  body.has-print-sheet #toast,
  body.has-print-sheet #dialog,
  body.has-print-sheet #privacy-settings { display: none !important; }
  body.has-print-sheet #nx-print-sheet { display: block !important; }
}
