/* FlowDesk base: reset, typography, utilities. Tokens live in tokens.css. */

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
  background: var(--bg);
  overflow-x: hidden;
  overflow-x: clip;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  font-family: var(--font);
  font-size: var(--fs-base);
  line-height: var(--lh);
  letter-spacing: var(--ls-body);
  color: var(--text-2);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  overflow-x: clip;
}

img,
svg,
video,
canvas {
  display: block;
  max-width: 100%;
}

svg {
  flex-shrink: 0;
}

button,
input,
select,
textarea {
  font: inherit;
  letter-spacing: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  background: none;
  border: 0;
  padding: 0;
}

button:disabled {
  cursor: not-allowed;
}

a {
  color: var(--blue);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
  text-underline-offset: 2px;
}

p {
  margin: 0 0 var(--s3);
}

p:last-child {
  margin-bottom: 0;
}

ul,
ol {
  margin: 0;
  padding-left: 1.2em;
}

hr {
  border: 0;
  border-top: 1px solid var(--border);
  margin: var(--s5) 0;
}

table {
  border-collapse: collapse;
  border-spacing: 0;
}

::selection {
  background: rgba(4, 84, 255, 0.18);
}

:focus {
  outline: none;
}

:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
  border-radius: 6px;
}

[hidden] {
  display: none !important;
}

/* Scrollbars: thin and quiet */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--border-strong) transparent;
}

*::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

*::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: 10px;
  border: 3px solid transparent;
  background-clip: content-box;
}

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

/* ------------------------------------------------------------------ typography */
h1,
h2,
h3,
h4,
h5,
.h1,
.h2,
.h3,
.h4,
.h5 {
  margin: 0;
  color: var(--text);
  font-weight: var(--fw-semibold);
  line-height: 1.15;
}

h1,
.h1 {
  font-size: 32px;
  letter-spacing: var(--ls-head);
}

h2,
.h2 {
  font-size: var(--fs-2xl);
  letter-spacing: -0.03em;
}

h3,
.h3 {
  font-size: var(--fs-xl);
  letter-spacing: var(--ls-tight);
}

h4,
.h4 {
  font-size: var(--fs-lg);
  letter-spacing: var(--ls-tight);
}

h5,
.h5 {
  font-size: var(--fs-base);
  letter-spacing: var(--ls-body);
}

.display {
  font-size: var(--fs-hero);
  letter-spacing: var(--ls-head);
  font-weight: var(--fw-semibold);
  line-height: 1.05;
  color: var(--text);
}

.lead {
  font-size: var(--fs-lg);
  color: var(--text-2);
}

.text-xs { font-size: var(--fs-xs); }
.text-sm { font-size: var(--fs-sm); }
.text-md { font-size: var(--fs-md); }
.text-lg { font-size: var(--fs-lg); }
.text-xl { font-size: var(--fs-xl); }
.text-2xl { font-size: var(--fs-2xl); }
.text-3xl { font-size: var(--fs-3xl); letter-spacing: var(--ls-tight); }

.fw-400 { font-weight: 400; }
.fw-500 { font-weight: 500; }
.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }

.text-strong { color: var(--text); }
.text-body { color: var(--text-2); }
.muted,
.text-muted { color: var(--text-3); }
.faint { color: var(--text-4); }
.text-blue { color: var(--blue-ink); }
.text-red { color: var(--red-ink); }
.text-green { color: var(--green-ink); }
.text-amber { color: var(--amber-ink); }
.text-purple { color: var(--purple-ink); }

/* Price direction colours: up = green, down = red, neutral = muted */
.up { color: var(--up-ink); }
.down { color: var(--down-ink); }
.flat { color: var(--flat); }

.num,
.tabular {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}

.mono {
  font-family: var(--font-mono);
  font-size: 0.92em;
  letter-spacing: 0;
}

.upper {
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.label {
  font-size: var(--fs-sm);
  color: var(--text-3);
  font-weight: var(--fw-regular);
}

.eyebrow {
  font-size: var(--fs-xs);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-3);
  font-weight: var(--fw-semibold);
}

.ellipsis {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

.clamp-2,
.clamp-3 {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.clamp-2 { -webkit-line-clamp: 2; line-clamp: 2; }
.clamp-3 { -webkit-line-clamp: 3; line-clamp: 3; }

.nowrap { white-space: nowrap; }
.break { overflow-wrap: anywhere; }
.center { text-align: center; }
.right { text-align: right; }

kbd,
.kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border: 1px solid var(--border);
  border-bottom-width: 2px;
  border-radius: 5px;
  font-family: var(--font);
  font-size: 11px;
  font-weight: 600;
  color: var(--text-3);
  background: var(--panel);
}

code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  background: var(--bg-soft);
  border-radius: 5px;
  padding: 1px 5px;
}

/* Rendered markdown (fmt.md output) */
.prose {
  color: var(--text-2);
  font-size: var(--fs-md);
  line-height: 1.6;
}

.prose > * + * { margin-top: 0.75em; }
.prose h1, .prose h2, .prose h3, .prose h4 { margin-top: 1.2em; }
.prose h1 { font-size: 26px; }
.prose h2 { font-size: 21px; }
.prose h3 { font-size: 18px; }
.prose h4 { font-size: 16px; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li + li { margin-top: 0.25em; }
.prose blockquote {
  margin: 0;
  padding: 8px 14px;
  border-left: 3px solid var(--blue);
  background: var(--blue-tint);
  border-radius: 0 8px 8px 0;
  color: var(--text-2);
}
.prose pre {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  overflow-x: auto;
  font-size: 13px;
}
.prose pre code { background: none; padding: 0; }
.prose table {
  width: 100%;
  font-size: var(--fs-sm);
  display: block;
  overflow-x: auto;
}
.prose th, .prose td {
  text-align: left;
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.prose th { color: var(--text-3); font-weight: 500; }
.prose strong { color: var(--text); font-weight: 600; }

/* ------------------------------------------------------------------ layout utilities */
.row { display: flex; align-items: center; gap: var(--s3); min-width: 0; }
.row-top { display: flex; align-items: flex-start; gap: var(--s3); min-width: 0; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); min-width: 0; }
.row-end { display: flex; align-items: center; justify-content: flex-end; gap: var(--s3); }
.wrap { flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; gap: var(--s3); min-width: 0; }
.stack-sm { display: flex; flex-direction: column; gap: var(--s2); min-width: 0; }
.stack-lg { display: flex; flex-direction: column; gap: var(--s6); min-width: 0; }
.grow { flex: 1 1 auto; min-width: 0; }
.shrink-0 { flex-shrink: 0; }
.gap-1 { gap: var(--s1); }
.gap-2 { gap: var(--s2); }
.gap-3 { gap: var(--s3); }
.gap-4 { gap: var(--s4); }
.gap-6 { gap: var(--s6); }
.mt-1 { margin-top: var(--s1); }
.mt-2 { margin-top: var(--s2); }
.mt-3 { margin-top: var(--s3); }
.mt-4 { margin-top: var(--s4); }
.mt-6 { margin-top: var(--s6); }
.mb-2 { margin-bottom: var(--s2); }
.mb-4 { margin-bottom: var(--s4); }
.ml-auto { margin-left: auto; }
.p-0 { padding: 0 !important; }
.w-full { width: 100%; }
.min-w-0 { min-width: 0; }
.relative { position: relative; }
.scroll-x { overflow-x: auto; max-width: 100%; -webkit-overflow-scrolling: touch; }
.scroll-y { overflow-y: auto; }

.sr-only {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 899px) {
  .hide-mobile { display: none !important; }
}

@media (min-width: 900px) {
  .show-mobile { display: none !important; }
}

@media (max-width: 599px) {
  .hide-phone { display: none !important; }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
