@font-face {
  font-family: "JetBrains Mono";
  src: url("/canvas/fonts/jetbrains-mono-latin-400-normal.woff2?feeds-version=feeds-v4") format("woff2");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "JetBrains Mono";
  src: url("/canvas/fonts/jetbrains-mono-latin-600-normal.woff2?feeds-version=feeds-v4") format("woff2");
  font-style: normal;
  font-weight: 600;
  font-display: swap;
}

:root {
  --feeds-surface-width: 100vw;
  --feeds-surface-height: 100dvh;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  color-scheme: dark;
  background: #000;
  font-family: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, Monaco, Consolas, monospace;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

* { box-sizing: border-box; }

html,
body {
  width: var(--feeds-surface-width);
  height: var(--feeds-surface-height);
  margin: 0;
  overflow: hidden;
  overscroll-behavior: none;
  background: #000;
}

body {
  position: fixed;
  top: 0;
  right: auto;
  bottom: auto;
  left: 0;
  width: var(--feeds-surface-width);
  height: var(--feeds-surface-height);
  min-width: 280px;
  min-height: 360px;
  touch-action: pan-y;
}

#feeds-canvas {
  position: fixed;
  z-index: 1;
  top: 0;
  right: auto;
  bottom: auto;
  left: 0;
  display: block;
  width: var(--feeds-surface-width);
  height: var(--feeds-surface-height);
  background: transparent;
  pointer-events: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.safe-area-probe {
  position: fixed;
  inset: var(--safe-top) var(--safe-right) var(--safe-bottom) var(--safe-left);
  visibility: hidden;
  pointer-events: none;
}

.feeds-scroll {
  position: fixed;
  z-index: 0;
  top: 0;
  right: auto;
  bottom: auto;
  left: 0;
  width: var(--feeds-surface-width);
  height: var(--feeds-surface-height);
  overflow-x: hidden;
  overflow-y: scroll;
  overscroll-behavior: contain;
  scrollbar-width: none;
  touch-action: pan-y;
  -webkit-overflow-scrolling: touch;
  contain: strict;
  will-change: scroll-position;
}

.feeds-scroll::-webkit-scrollbar { display: none; }

.feeds-scroll-spacer {
  width: 1px;
  height: 100vh;
}

.article-video-player {
  position: absolute;
  display: block;
  margin: 0;
  border: 0;
  border-radius: 14px;
  background: #000;
  object-fit: contain;
  touch-action: pan-y;
}

.canvas-input-bridge {
  position: fixed;
  z-index: -1;
  left: 0;
  bottom: 0;
  width: 2px;
  height: 2px;
  min-height: 0;
  margin: 0;
  padding: 0;
  border: 0;
  opacity: 0.01;
  color: transparent;
  background: transparent;
  caret-color: transparent;
  font-size: 16px;
  pointer-events: none;
}

.visually-hidden {
  position: fixed;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (prefers-reduced-motion: reduce) {
  .feeds-scroll { scroll-behavior: auto; }
}

@media print {
  body::after {
    content: "Open Feeds on screen to read your subscriptions.";
    display: block;
    padding: 2rem;
    color: #111;
    background: #fff;
  }
  #feeds-canvas { display: none; }
}

.native-field, .canvas-input-bridge[data-visible="true"] {
  position: fixed; z-index: 4; display: block; margin: 0; padding: 10px 12px;
  min-height: 44px; border: 1px solid #48484a; border-radius: 10px;
  opacity: 1; color: #f5f5f7; background: #080808; caret-color: #0a84ff;
  font: 16px/24px "JetBrains Mono", monospace; pointer-events: auto;
  user-select: text; -webkit-user-select: text; touch-action: auto; outline: none;
}
.native-field:focus, .canvas-input-bridge[data-visible="true"]:focus { border-color: #0a84ff; }
.native-field::placeholder, .canvas-input-bridge::placeholder { color: #8e8e93; }
.native-field[hidden] { display: none; }
textarea.native-field { resize: none; }
