/* Shared UI kit. Blue brand. Components are prefixed ui- so they never collide with existing styles.
   Dark mode: <html data-theme="dark"> (set by ui.js). */
:root {
	--ui-blue-50: #eff6ff; --ui-blue-100: #dbeafe; --ui-blue-500: #3b82f6; --ui-blue-600: #2563eb; --ui-blue-700: #1d4ed8; --ui-blue-900: #1e3a8a;
	--ui-bg: #f8fafc; --ui-surface: #ffffff; --ui-surface-2: #f1f5f9; --ui-border: #e2e8f0;
	--ui-text: #0f172a; --ui-muted: #64748b; --ui-accent: var(--ui-blue-600); --ui-accent-hover: var(--ui-blue-700);
	--ui-ok: #059669; --ui-warn: #d97706; --ui-bad: #dc2626; --ui-radius: 12px;
	--ui-shadow: 0 1px 2px rgba(15, 23, 42, .06), 0 4px 14px rgba(15, 23, 42, .06);
}
html[data-theme="dark"] {
	--ui-bg: #0b1220; --ui-surface: #111a2e; --ui-surface-2: #172238; --ui-border: #243049;
	--ui-text: #e6edf7; --ui-muted: #93a4bf; --ui-accent: #3b82f6; --ui-accent-hover: #60a5fa;
	--ui-shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 6px 20px rgba(0, 0, 0, .35);
}

.ui-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 8px 16px; border-radius: 10px; border: 1px solid transparent; font: 600 14px/1.2 inherit; cursor: pointer; text-decoration: none; transition: background .15s, border-color .15s, transform .05s; }
.ui-btn:active { transform: translateY(1px); }
.ui-btn:focus-visible, .ui-input:focus-visible { outline: 3px solid rgba(59, 130, 246, .45); outline-offset: 1px; }
.ui-btn[disabled], .ui-btn[aria-disabled="true"] { opacity: .55; cursor: not-allowed; }
.ui-btn-primary { background: var(--ui-accent); color: #fff; }
.ui-btn-primary:hover { background: var(--ui-accent-hover); }
.ui-btn-secondary { background: var(--ui-surface); color: var(--ui-text); border-color: var(--ui-border); }
.ui-btn-secondary:hover { background: var(--ui-surface-2); }
.ui-btn-danger { background: var(--ui-bad); color: #fff; }
.ui-btn-ghost { background: transparent; color: var(--ui-accent); }
.ui-btn-ghost:hover { background: var(--ui-blue-50); }
.ui-btn-sm { min-height: 32px; padding: 4px 12px; font-size: 13px; }
.ui-btn-lg { min-height: 48px; padding: 12px 22px; font-size: 16px; }

.ui-card { background: var(--ui-surface); color: var(--ui-text); border: 1px solid var(--ui-border); border-radius: var(--ui-radius); box-shadow: var(--ui-shadow); padding: 20px; }
.ui-input { display: block; width: 100%; min-height: 40px; padding: 8px 12px; border: 1px solid var(--ui-border); border-radius: 10px; background: var(--ui-surface); color: var(--ui-text); font: 400 15px/1.4 inherit; }
.ui-input:focus { border-color: var(--ui-accent); }
.ui-badge { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--ui-blue-100); color: var(--ui-blue-900); }
.ui-badge-ok { background: #d1fae5; color: #065f46; } .ui-badge-warn { background: #fef3c7; color: #92400e; } .ui-badge-bad { background: #fee2e2; color: #991b1b; }
.ui-big-number { font-size: 40px; font-weight: 800; letter-spacing: -.02em; line-height: 1; font-variant-numeric: tabular-nums; color: var(--ui-accent); }

.ui-toasts { position: fixed; z-index: 100; right: 16px; bottom: 16px; display: flex; flex-direction: column; gap: 8px; max-width: min(92vw, 380px); }
.ui-toast { background: #0f172a; color: #fff; border-left: 4px solid var(--ui-blue-500); border-radius: 10px; padding: 12px 14px; font-size: 14px; box-shadow: var(--ui-shadow); animation: ui-in .18s ease-out; }
.ui-toast.ok { border-color: var(--ui-ok); } .ui-toast.error { border-color: var(--ui-bad); } .ui-toast.warn { border-color: var(--ui-warn); }
@keyframes ui-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.ui-overlay { position: fixed; inset: 0; z-index: 90; background: rgba(2, 6, 23, .6); display: flex; align-items: center; justify-content: center; padding: 16px; }
.ui-modal { width: min(100%, 460px); max-height: 90vh; overflow: auto; background: var(--ui-surface); color: var(--ui-text); border-radius: 16px; padding: 22px; box-shadow: var(--ui-shadow); }
.ui-modal h2 { margin: 0 0 8px; font-size: 20px; font-weight: 700; }
.ui-modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; flex-wrap: wrap; }

.ui-skel { border-radius: 8px; min-height: 14px; background: linear-gradient(90deg, var(--ui-surface-2) 25%, var(--ui-border) 37%, var(--ui-surface-2) 63%); background-size: 400% 100%; animation: ui-shimmer 1.3s ease infinite; }
@keyframes ui-shimmer { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }
.ui-empty { text-align: center; padding: 36px 16px; color: var(--ui-muted); }
.ui-empty strong { display: block; color: var(--ui-text); font-size: 17px; margin-bottom: 4px; }
.ui-error { border: 1px solid #fecaca; background: #fef2f2; color: #991b1b; border-radius: 12px; padding: 14px 16px; }
@media (prefers-reduced-motion: reduce) { .ui-skel, .ui-toast { animation: none; } .ui-btn { transition: none; } }

/* Header + mobile navigation */
#nav a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 6px; }
#site-header header a, #site-header header button { -webkit-tap-highlight-color: transparent; }
#accountBtn { min-height: 44px; min-width: 44px; justify-content: center; }
.ui-bottomnav { display: none; }
@media (max-width: 767px) {
  #nav { display: none !important; }
  .ui-bottomnav { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 60; background: #0f172a; border-top: 1px solid #1e293b; padding-bottom: env(safe-area-inset-bottom); }
  .ui-bottomnav a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 56px; color: #cbd5e1; font-size: 11px; font-weight: 600; text-decoration: none; }
  .ui-bottomnav a[aria-current=page] { color: #60a5fa; }
  .ui-bottomnav svg { width: 22px; height: 22px; }
  body { padding-bottom: 64px; }
}
#site-header header a[aria-label] { min-height: 44px; }
.ui-tap { display: inline-flex; align-items: center; min-height: 44px; padding: 0 8px; }
.ui-install { position: fixed; left: 12px; right: 12px; bottom: 76px; z-index: 70; display: flex; flex-wrap: wrap; align-items: center; gap: 10px; background: #0f172a; color: #fff; border: 1px solid #334155; border-radius: 14px; padding: 12px 14px; box-shadow: 0 10px 30px rgba(2, 6, 23, .35); max-width: 520px; margin: 0 auto; }
@media (min-width: 768px) { .ui-install { bottom: 20px; left: auto; right: 20px; margin: 0; } }
.ui-install-text { flex: 1 1 200px; font-size: 14px; }
.ui-install-yes, .ui-install-no { min-height: 44px; padding: 0 16px; border-radius: 10px; font-weight: 600; font-size: 14px; cursor: pointer; }
.ui-install-yes { background: #2563eb; color: #fff; border: 0; }
.ui-install-no { background: transparent; color: #cbd5e1; border: 1px solid #475569; }
