:root {
  --bg: #080c10;
  --surface: #0e1520;
  --surface2: #141e2d;
  --border: rgba(100,140,200,.13);
  --border2: rgba(100,140,200,.22);
  --text: #dce8f5;
  --muted: #6b84a0;
  --faint: #43566e;
  --accent: #4f9cf9;
  --accent2: #7ec8e3;
  /* Restrained 3-tier urgency (replaces the old 5-color rainbow):
     <=3d hot · <=14d warm(=accent) · else cool. */
  --hot: #ff6b66;
  --warm: var(--accent);
  --cool: #7d8ea6;
  --pos: #1fd693;
  --warn: #ffd27d;
  --mono: 'DM Mono', monospace;
  --display: 'Syne', sans-serif;
  --radius: 12px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--mono);
  min-height: 100vh;
  overflow-x: hidden;
  /* iOS polish: stop text auto-resizing, kill the grey tap flash, pad the
     home-indicator area, and avoid rubber-band overscroll showing white. */
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
  padding-bottom: env(safe-area-inset-bottom);
  overscroll-behavior-y: none;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* --- Native-app feel --- */

/* No iOS long-press "copy" callout / text selection on interactive chrome */
button, a, .ticker-chip, .more-chip, .tile, .tile-link,
.window-btn, .view-tab, .vt, .ctrl-btn, .nav-link, .days-badge {
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}

/* Tap "press" feedback — iOS has no hover, so taps otherwise feel dead */
@media (hover: none) {
  button:active, a.nav-link:active, .ticker-chip:active, .tile:active,
  .window-btn:active, .view-tab:active, .vt:active, .ctrl-btn:active, .tile-link:active {
    transform: scale(.96);
    opacity: .85;
    transition: transform .06s ease, opacity .06s ease;
  }
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(79,156,249,.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(79,156,249,.03) 1px, transparent 1px);
  background-size: 48px 48px;
  pointer-events: none;
  z-index: 0;
}

.wrap {
  position: relative;
  z-index: 1;
  max-width: 1280px;
  margin: 0 auto;
  /* respect the notch on landscape / rounded corners */
  padding: 0 max(20px, env(safe-area-inset-left)) 0 max(20px, env(safe-area-inset-right));
}

/* --- Header --- */

header {
  /* clear the status bar / Dynamic Island */
  padding: calc(16px + env(safe-area-inset-top)) 0 14px;
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

/* Wordmark: a small three-bar mark + "INTERVAL FUNDS" + a muted page word.
   Replaces the generic "Interval Fund <span>X</span>" h1 with a real mark. */
.brand {
  display: flex;
  align-items: baseline;
  gap: 9px;
  text-decoration: none;
  color: inherit;
}

.mark {
  display: inline-flex;
  align-items: flex-end;
  gap: 2px;
  height: 15px;
  transform: translateY(1px);
}
.mark-bar { width: 3px; background: var(--accent); display: block; border-radius: .5px; }
.mark-bar:nth-child(1) { height: 7px;  opacity: .55; }
.mark-bar:nth-child(2) { height: 15px; }
.mark-bar:nth-child(3) { height: 10px; opacity: .78; }

.word {
  font-family: var(--display);
  font-weight: 800;
  font-size: 18px;
  letter-spacing: -.3px;
  line-height: 1;
  color: var(--text);
}
.word-sub {
  font-size: 11px;
  color: var(--muted);
  letter-spacing: .2px;
}

.header-nav { display: flex; align-items: center; flex-wrap: wrap; }

.nav-link {
  font-size: 11px;
  letter-spacing: .5px;
  text-transform: uppercase;
  color: var(--muted);
  text-decoration: none;
  padding: 4px 14px;
  transition: color .15s;
}
.nav-link + .nav-link { border-left: 1px solid var(--border); }
.nav-link:hover { color: var(--text); }
.nav-link[aria-current="page"] { color: var(--accent); }

/* --- Status bar --- */

.status-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 0;
  font-size: 11px;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
}

/* --- Footer --- */

footer {
  border-top: 1px solid var(--border);
  padding: 14px 0 28px;
  font-size: 11px;
  color: var(--muted);
  line-height: 1.6;
  opacity: .7;
}

/* --- Mobile: larger tap targets --- */
@media (max-width: 600px) {
  .nav-link { padding: 9px 14px; font-size: 12px; }
}

/* Hide exports that don't work inside the native WebView (CSV download, print-to-PDF) */
.cap-native .csv-link,
.cap-native #exportPdf { display: none !important; }

/* Privacy link: shown only inside the native app (App Store requires it), hidden on the website */
.privacy-link { display: none; }
.cap-native .privacy-link { display: inline; }
