/* manifolio.com: the inner pages (docs, changelog, status, legal) and the standalone pages (coming soon, 404, 503).
   Same tokens and nav as the landing; the maroon header cuts cleanly into the white page. */

body.pg { background: #FFF; }

/* ── nav: always solid, sticky ── */
.pg-nav { position: sticky; height: 4.5rem; }
.pg-nav::before { height: 100%; opacity: 1; pointer-events: auto; }
.pg-nav .lp-nav-in { height: 4.5rem; }
.pg-nav .lp-links a.is-active { color: #FFF; }

/* ── header band ── */
.pg-hero { position: relative; overflow: hidden; background: var(--maroon-landing); color: #FFF; }
.pg-hero .tx-grid svg { top: -16rem; }
.pg-hero-in { position: relative; padding-top: 4rem; padding-bottom: 4.5rem; }
.pg-h1 { max-width: 48rem; font-size: 3.25rem; line-height: 3.875rem; font-weight: 600; letter-spacing: -0.02em; text-wrap: balance; }
.pg-lead { max-width: 40rem; margin-top: 1rem; font-size: 1.125rem; line-height: 1.75rem; color: rgba(255,255,255,.82); text-wrap: pretty; }
.pg-crumbs { display: flex; align-items: center; gap: .375rem; margin-top: 1.5rem; font-size: max(13px, .875rem); line-height: 1.25rem; color: rgba(255,255,255,.72); }
.pg-crumbs a { color: rgba(255,255,255,.92); transition: color var(--d-hover) var(--ease-out); }
.pg-crumbs a:hover { color: var(--orange-300); }
.pg-crumbs svg { flex: none; width: .875rem; height: .875rem; }
.pg-hero-in .pg-crumbs:first-child { margin: 0 0 1.25rem; }

.pg-main { padding: 4rem 0 7.5rem; }

/* ── markdown body ── */
.doc-body { min-width: 0; color: var(--text-2); font-size: 1rem; line-height: 1.75rem; }
.doc-body > :first-child { margin-top: 0; }
.doc-body p, .doc-body ul, .doc-body ol { margin-top: 1rem; }
.doc-body h2 { margin-top: 3rem; font-size: 1.5rem; line-height: 2rem; font-weight: 600; letter-spacing: -0.01em; color: var(--text-1); scroll-margin-top: 6rem; }
.doc-body h3, .doc-body h4 { margin-top: 2rem; font-size: 1.125rem; line-height: 1.625rem; font-weight: 600; color: var(--text-1); scroll-margin-top: 6rem; }
.doc-body h2 + p, .doc-body h3 + p { margin-top: .75rem; }
.doc-anchor { color: inherit; }
.doc-anchor:hover { color: var(--orange-700); }
.doc-body ul, .doc-body ol { padding-left: 1.25rem; }
.doc-body ul { list-style: disc; }
.doc-body ol { list-style: decimal; }
.doc-body li { padding-left: .25rem; }
.doc-body li + li { margin-top: .375rem; }
.doc-body li::marker { color: var(--text-3); }
.doc-body strong { font-weight: 600; color: var(--text-1); }
.doc-body a:not(.doc-anchor) { color: var(--orange-700); text-decoration: underline; text-decoration-color: rgba(194,65,12,.35); text-underline-offset: .2em; transition: text-decoration-color var(--d-hover) var(--ease-out); }
.doc-body a:not(.doc-anchor):hover { text-decoration-color: currentColor; }
.doc-body :not(pre) > code { padding: .125rem .375rem; border-radius: .375rem; border: 1px solid #ECECEC; background: #F6F6F6; font-family: var(--mono); font-size: .875em; color: var(--text-1); overflow-wrap: anywhere; }
.doc-body img { max-width: 100%; border-radius: .75rem; }

.doc-code { margin-top: 1.25rem; }
.doc-code + p, .doc-table + p { margin-top: 1.25rem; }
.doc-code .code-head { height: 2.75rem; }
.doc-code .code-head .code-lang { margin-left: 0; padding: 0 .25rem; flex: 1; }
.doc-code .code-body { padding: 1rem 1.25rem 1.125rem; }

.doc-table { margin-top: 1.25rem; overflow-x: auto; border: 1px solid var(--line); border-radius: .875rem; scrollbar-width: thin; }
.doc-table.is-clipped { -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 1.125rem), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - 1.125rem), transparent); }
.doc-table table { width: 100%; border-collapse: collapse; font-size: .9375rem; line-height: 1.5rem; }
.doc-table th { padding: .75rem 1rem; background: #FAFAFA; border-bottom: 1px solid var(--line); text-align: left; font-weight: 600; color: var(--text-1); white-space: nowrap; }
.doc-table td { padding: .75rem 1rem; vertical-align: top; color: var(--text-2); }
.doc-table tr + tr td { border-top: 1px solid var(--line-soft); }
.doc-table td code { white-space: nowrap; overflow-wrap: normal; }
@media (max-width: 639.98px) {
  .doc-table, .doc-table.is-clipped { overflow: visible; -webkit-mask-image: none; mask-image: none; }
  .doc-table table, .doc-table tbody, .doc-table tr, .doc-table td { display: block; }
  .doc-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .doc-table tr { padding: .875rem 1rem; }
  .doc-table tr + tr { border-top: 1px solid var(--line); }
  .doc-table td, .doc-table tr + tr td { padding: 0; border-top: 0; }
  .doc-table td + td { margin-top: .625rem; }
  .doc-table td:first-child { font-weight: 600; color: var(--text-1); }
  .doc-table td:not(:first-child)::before { content: attr(data-label); display: block; font-size: .8125rem; line-height: 1.25rem; font-weight: 500; color: var(--text-3); }
  .doc-table td code { white-space: normal; overflow-wrap: anywhere; }
}

/* ── docs index ── */
.di-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
/* ultimul card singur pe rând se întinde pe tot rândul, în loc să stea orfan */
.di-card:last-child:nth-child(3n + 1) { grid-column: 1 / -1; }
.di-card-g { font-size: 12px; line-height: 16px; font-weight: 500; letter-spacing: .04em; text-transform: uppercase; color: var(--orange-700); text-wrap: balance; }
.di-card { position: relative; display: flex; flex-direction: column; gap: .5rem; min-height: 9.5rem; padding: 1.5rem 1.5rem 3.25rem; border-radius: var(--r-card); border: 1px solid var(--line); background: #FFF; transition: border-color var(--d-hover) var(--ease-out), background-color var(--d-hover) var(--ease-out), transform var(--d-press) var(--ease-out); }
.di-card:hover { border-color: var(--orange-border-soft); background-color: var(--orange-50); }
.di-card:active { transform: scale(.99); }
.di-card-t { font-size: 1.125rem; line-height: 1.625rem; font-weight: 600; color: var(--text-1); }
.di-card-d { font-size: .9375rem; line-height: 1.5rem; color: var(--text-3); }
.di-card-go { position: absolute; left: 1.5rem; bottom: 1.25rem; display: inline-flex; color: var(--orange-700); transition: transform var(--d-hover) var(--ease-out); }
.di-card:hover .di-card-go { transform: translateX(.25rem); }

/* ── docs page ── */
.docs-grid { display: grid; grid-template-columns: 14.5rem minmax(0, 1fr) 13rem; gap: 3.5rem; align-items: start; }
.docs-side, .docs-toc { position: sticky; top: 6.5rem; max-height: calc(100vh - 8rem); overflow-y: auto; scrollbar-width: none; }
.docs-main { min-width: 0; max-width: 46rem; }
.docs-nav a { display: block; padding: .375rem .75rem; border-radius: .5rem; font-size: .9375rem; line-height: 1.375rem; color: var(--text-3); transition: color var(--d-hover) var(--ease-out), background-color var(--d-hover) var(--ease-out); }
.docs-nav a:hover { color: var(--text-1); background-color: #F6F6F6; }
.docs-nav a.is-on { color: var(--text-1); background-color: #F2F2F2; font-weight: 500; }
.docs-home { margin-bottom: .5rem; font-weight: 500; }
.docs-group + .docs-group { margin-top: 1.25rem; }
.docs-group-t { padding: 0 .75rem .375rem; font-size: 12px; line-height: 16px; font-weight: 500; letter-spacing: .04em; text-transform: uppercase; color: var(--text-3); }
.docs-menu { display: none; }

.doc-toc-t { margin-bottom: .5rem; font-size: 12px; line-height: 16px; font-weight: 500; letter-spacing: .04em; text-transform: uppercase; color: var(--text-3); }
.doc-toc a { display: block; padding: .3125rem 0 .3125rem .875rem; border-left: 2px solid var(--line-soft); font-size: max(13px, .875rem); line-height: 1.25rem; color: var(--text-3); transition: color var(--d-hover) var(--ease-out), border-color var(--d-hover) var(--ease-out); }
.doc-toc a:hover { color: var(--text-1); }
.doc-toc a.is-on { color: var(--text-1); border-left-color: var(--orange); }

.doc-pager { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; margin-top: 4rem; padding-top: 2rem; border-top: 1px solid var(--line-soft); }
.doc-pager a { display: flex; flex-direction: column; gap: .25rem; padding: 1rem 1.25rem; border-radius: var(--r-card); border: 1px solid var(--line); transition: border-color var(--d-hover) var(--ease-out), background-color var(--d-hover) var(--ease-out); }
.doc-pager a:hover { border-color: var(--orange-border-soft); background-color: var(--orange-50); }
.doc-pager .dp-next { grid-column: 2; align-items: flex-end; text-align: right; }
.dp-k { display: inline-flex; align-items: center; gap: .375rem; font-size: max(13px, .875rem); line-height: 1.25rem; color: var(--text-3); }
.dp-k svg { width: 1rem; height: 1rem; }
.dp-t { font-size: 1rem; line-height: 1.5rem; font-weight: 600; color: var(--text-1); }

/* ── legal ── */
.legal-grid { display: grid; grid-template-columns: minmax(0, 46rem) 13rem; justify-content: space-between; gap: 3.5rem; align-items: start; }

/* ── changelog ── */
.cl-list { max-width: 62rem; }
.cl-item { display: grid; grid-template-columns: 12rem minmax(0, 1fr); gap: 2.5rem; padding: 2.5rem 0; scroll-margin-top: 6rem; }
.cl-item:first-child { padding-top: 0; }
.cl-item + .cl-item { border-top: 1px solid var(--line-soft); }
.cl-meta { display: flex; flex-direction: column; align-items: flex-start; gap: .625rem; padding-top: .25rem; }
.cl-ver { display: inline-flex; align-items: center; height: 1.75rem; padding: 0 .75rem; border-radius: var(--r-pill); background: var(--orange-50); border: 1px solid var(--orange-border-soft); font-family: var(--mono); font-size: 12px; line-height: 16px; font-weight: 500; color: var(--orange-800); }
.cl-meta time { font-size: max(13px, .875rem); line-height: 1.25rem; color: var(--text-3); }
.cl-title { font-size: 1.5rem; line-height: 2rem; font-weight: 600; letter-spacing: -0.01em; color: var(--text-1); }
.cl-body { margin-top: .75rem; }

/* ── status ── */
.st-wrap { max-width: calc(50rem + 2 * max(2rem, calc(50% - 38.75rem))); margin-inline: 0; }
.st-head { display: flex; align-items: center; gap: 1rem; padding: 1.5rem 1.75rem; border-radius: 1.25rem; border: 1px solid var(--line); }
.st-ic { display: grid; place-items: center; flex: none; width: 3.5rem; height: 3.5rem; border-radius: 50%; }
.st-ic svg { width: 1.75rem; height: 1.75rem; }
.is-operational .st-ic { background: var(--green-100); color: var(--green-900); }
.is-degraded .st-ic { background: var(--orange-100); color: var(--orange-800); }
.is-down .st-ic { background: var(--red-50); color: var(--red-700); }
.st-head-t { flex: 1; min-width: 0; }
.st-overall { font-size: 1.375rem; line-height: 1.875rem; font-weight: 600; color: var(--text-1); }
.st-at { margin-top: .125rem; font-size: max(13px, .875rem); line-height: 1.25rem; color: var(--text-3); }
.st-refresh.btn-white { flex: none; height: 2.75rem; padding: 0 1.125rem; border: 1px solid var(--line); font-size: max(13px, .875rem); font-weight: 500; transition: background-color var(--d-hover) var(--ease-out), transform var(--d-press) var(--ease-out); }
.st-refresh.btn-white:hover { background-color: #F6F6F6; }
.st-refresh svg { width: 1rem; height: 1rem; }
.st-list { margin-top: 1.25rem; border-radius: 1.25rem; border: 1px solid var(--line); }
.st-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 1.25rem; padding: 1.125rem 1.75rem; }
.st-row + .st-row { border-top: 1px solid var(--line-soft); }
.st-row-t b { display: block; font-size: 1rem; line-height: 1.5rem; font-weight: 600; color: var(--text-1); }
.st-row-t span { display: block; font-size: max(13px, .875rem); line-height: 1.25rem; color: var(--text-3); }
.st-ms { font-size: max(13px, .875rem); line-height: 1.25rem; color: var(--text-3); font-variant-numeric: tabular-nums; }
.st-pill { display: inline-flex; align-items: center; gap: .4375rem; height: 1.75rem; padding: 0 .75rem; border-radius: var(--r-pill); font-size: max(12px, .8125rem); line-height: 1rem; font-weight: 500; white-space: nowrap; }
.st-pill.ok { background: var(--green-100); color: var(--green-900); }
.st-pill.bad { background: var(--red-50); color: var(--red-700); }
.st-dot { width: .375rem; height: .375rem; border-radius: 50%; background: currentColor; }

/* ── standalone pages ── */
body.bare { background: var(--p-dark, var(--maroon-landing)); }
body.bare .tx-grid { background: var(--p-dark-slab, var(--maroon-landing)); }
.bare-main { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 100vh; min-height: 100svh; padding: 7rem 1.5rem 8rem; overflow: hidden; color: #FFF; text-align: center; }
.bare-main .tx-grid svg { top: -4rem; }
.bare-logo { position: absolute; top: 2.25rem; left: 50%; height: 2.75rem; transform: translateX(-50%); }
.bare-in { position: relative; display: flex; flex-direction: column; align-items: center; max-width: 52rem; }
.bare-h1 { margin-top: 1.25rem; font-size: 4rem; line-height: 4.75rem; font-weight: 600; letter-spacing: -0.02em; text-wrap: balance; }
.bare-sub { max-width: 36rem; margin-top: 1.25rem; font-size: 1.125rem; line-height: 1.75rem; color: rgba(255,255,255,.84); text-wrap: pretty; }
.bare-cta.btn-primary { margin-top: 2.25rem; padding: 0 1.75rem; transition: background-color var(--d-hover) var(--ease-out), transform var(--d-press) var(--ease-out); }
.bare-cta.btn-primary:hover { background-color: var(--orange-600); }
.bare-cta.btn-primary:active { transform: scale(.97); }
.bare-foot { position: absolute; left: 0; right: 0; bottom: 2rem; display: flex; justify-content: center; align-items: center; gap: 1.5rem; font-size: max(13px, .875rem); line-height: 1.25rem; color: rgba(255,255,255,.72); }
.bare-lang { display: flex; gap: .25rem; }
.bare-lang a { display: inline-flex; align-items: center; min-height: 2.75rem; padding: 0 .5rem; color: rgba(255,255,255,.72); transition: color var(--d-hover) var(--ease-out); }
.bare-lang a:hover, .bare-lang a[aria-current] { color: #FFF; }
.bare-lang a[aria-current] { text-decoration: underline; text-underline-offset: .25em; }
@media (prefers-reduced-motion: no-preference) {
  .bare-in > * { animation: bare-op 700ms var(--ease-out) both, bare-up 800ms var(--ease-out) both; }
  .bare-in > :nth-child(2) { animation-delay: 80ms; }
  .bare-in > :nth-child(3) { animation-delay: 160ms; }
  .bare-in > :nth-child(4) { animation-delay: 240ms; }
}
@keyframes bare-op { from { opacity: 0; } }
@keyframes bare-up { from { translate: 0 1rem; } }

/* ── between desktop and phone ── */
@media (max-width: 1279.98px) {
  .docs-grid { grid-template-columns: 13.5rem minmax(0, 1fr); gap: 3rem; }
  .docs-toc { display: none; }
  .legal-grid { grid-template-columns: minmax(0, 46rem); }
  .di-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .di-card:last-child:nth-child(3n + 1) { grid-column: auto; }
  .di-card:last-child:nth-child(2n + 1) { grid-column: 1 / -1; }
}

@media (max-width: 1023.98px) {
  .pg-nav, .pg-nav .lp-nav-in { height: 4rem; }
  .pg-hero-in { padding-top: 2.5rem; padding-bottom: 2.75rem; }
  .pg-h1 { font-size: 2.25rem; line-height: 2.75rem; }
  .pg-lead { margin-top: .75rem; font-size: 1rem; line-height: 1.5rem; }
  .pg-main { padding: 2.5rem 0 5rem; }
  .docs-grid { grid-template-columns: minmax(0, 1fr); }
  .docs-side { display: none; }
  .docs-main { max-width: none; }
  .docs-menu { display: block; margin-bottom: 2rem; border-radius: var(--r-card); border: 1px solid var(--line); }
  .docs-menu summary { display: flex; align-items: center; gap: .5rem; min-height: 3.25rem; padding: 0 1rem; cursor: pointer; list-style: none; }
  .docs-menu summary::-webkit-details-marker { display: none; }
  .dm-label { font-size: max(13px, .875rem); color: var(--text-3); }
  .dm-cur { flex: 1; min-width: 0; font-size: .9375rem; font-weight: 500; color: var(--text-1); text-align: right; }
  .dm-ic { display: inline-flex; color: var(--text-3); transition: transform var(--d-hover) var(--ease-out); }
  .dm-ic svg { width: 1.25rem; height: 1.25rem; }
  .docs-menu[open] .dm-ic { transform: rotate(180deg); }
  .docs-menu .docs-nav { padding: .25rem .5rem 1rem; border-top: 1px solid var(--line-soft); }
  .docs-menu .docs-group { margin-top: .75rem; }
  .docs-menu .docs-nav a { padding: .625rem .75rem; }
  .doc-body h2 { margin-top: 2.5rem; font-size: 1.375rem; line-height: 1.875rem; }
  .doc-pager { gap: .75rem; margin-top: 3rem; }
  .cl-item { grid-template-columns: minmax(0, 1fr); gap: 1rem; padding: 2rem 0; }
  .cl-meta { flex-direction: row; align-items: center; gap: .75rem; padding: 0; }
  .cl-title { font-size: 1.25rem; line-height: 1.75rem; }
  .st-head { flex-wrap: wrap; padding: 1.25rem; }
  .st-ic { width: 3rem; height: 3rem; }
  .st-overall { font-size: 1.125rem; line-height: 1.625rem; }
  .st-refresh.btn-white { width: 100%; justify-content: center; }
  .st-row { grid-template-columns: minmax(0, 1fr) auto; gap: .25rem 1rem; padding: 1rem 1.25rem; }
  .st-ms { grid-row: 2; }
  .st-pill { grid-row: 1 / span 2; grid-column: 2; }
  .bare-h1 { font-size: 2.5rem; line-height: 2.875rem; }
  .bare-sub { font-size: 1rem; line-height: 1.5rem; }
}

@media (max-width: 767.98px) {
  .di-grid { grid-template-columns: minmax(0, 1fr); }
  .di-card { min-height: 0; }
  .doc-pager { grid-template-columns: minmax(0, 1fr); }
  .doc-pager .dp-next { grid-column: 1; }
  .doc-code { margin-inline: -1rem; border-radius: 0; border-left: 0; border-right: 0; }
  .doc-code .code-body { padding-inline: 1rem; }
  .bare-main { padding: 6.5rem 1rem 7rem; }
  .bare-logo { top: 1.5rem; height: 2.5rem; }
  .bare-logo .mf-mark { width: 1.625rem !important; height: 1.625rem !important; }
  .bare-logo .mf-wordmark { font-size: 1.625rem !important; }
  .bare-foot { flex-direction: column; gap: 0; bottom: 1.25rem; }
}
/* pagina scurtă nu încarcă sticla: butonul ia totuși portocaliul ars AA din paletă (plat, alb avea 2,8:1) */
body.bare .btn-primary { background: var(--p-grad-btn, var(--orange)); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .3), 0 10px 22px -10px rgba(194, 65, 12, .7); }
