/* RapiDoc page — aligned with finocurve-service (dark theme + chrome) */

:root {
  --bg-primary: #0f0f23;
  --text-primary: #ffffff;
  --text-secondary: #94a3b8;
  --font-family: 'Open Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  /* Top chrome: global nav + page header + vertical padding — host must have explicit height or RapiDoc never scrolls */
  --rapidoc-chrome: 220px;
}

html {
  overflow-y: auto;
  height: auto;
}

html,
body.rapidoc-shell {
  overflow-x: hidden;
}

body.rapidoc-shell {
  margin: 0;
  min-height: 100vh;
  overflow-y: auto !important;
  background: var(--bg-primary);
  font-family: var(--font-family);
  color: var(--text-primary);
}

.rapidoc-shell nav {
  padding: 12px 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(15, 15, 35, 0.95);
  position: relative;
  z-index: 2;
}

.rapidoc-shell nav a {
  color: var(--text-secondary);
  text-decoration: none;
  margin-right: 16px;
  font-size: 14px;
}

.rapidoc-shell nav a:hover {
  color: #6366f1;
}

.rapidoc-page {
  padding: 24px;
  padding-bottom: 32px;
  position: relative;
  z-index: 1;
}

.rapidoc-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
}

.rapidoc-logo {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  object-fit: contain;
  filter: drop-shadow(0 2px 8px rgba(99, 102, 241, 0.3));
}

.rapidoc-title {
  font-size: 24px;
  font-weight: 600;
  color: var(--text-primary);
}

.rapidoc-subtitle {
  font-size: 14px;
  color: var(--text-secondary);
  margin-top: 2px;
}

.rapidoc-bg {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 340px;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.rapidoc-bg__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.25;
}

.rapidoc-bg__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(15, 15, 35, 0.3) 0%, var(--bg-primary) 300px);
}

/* RapiDoc shadow tree uses height: 100% + internal overflow; the host needs a real height (not only min-height). */
.rapidoc-page rapi-doc {
  display: block;
  width: 100%;
  height: calc(100vh - var(--rapidoc-chrome));
  height: calc(100dvh - var(--rapidoc-chrome));
  min-height: 280px;
}
