/* MyVibi documents page. Builds on styles.css tokens (palette follows time of day). */
.nav-links a.active { color: var(--ink); }
.nav-links a.active::after { transform: scaleX(1); }
.docs-main { max-width: 1180px; margin: 0 auto; padding: 120px 24px 40px; }

/* hero: same idea as the app's calendar hero (gradient card, tear-off date, glass stats) */
.docs-hero { padding: 0; }
.hero-card { position: relative; overflow: hidden; border-radius: 36px; padding: 44px; background: linear-gradient(135deg, var(--p), var(--s));
  display: grid; grid-template-columns: auto 1fr; gap: 28px 36px; align-items: center; box-shadow: 0 30px 80px -20px color-mix(in srgb, var(--p) 60%, transparent); }
.blob { position: absolute; border-radius: 50%; background: rgba(255,255,255,.14); pointer-events: none; animation: drift 18s ease-in-out infinite alternate; }
.blob.b1 { width: 380px; height: 380px; right: -120px; top: -160px; }
.blob.b2 { width: 220px; height: 220px; left: 30%; bottom: -140px; animation-duration: 24s; }
.tear { position: relative; width: 112px; border-radius: 22px; background: #fff; color: #17123a; text-align: center; padding: 10px 0 12px; box-shadow: 0 16px 34px rgba(0,0,0,.25); transform: rotate(-5deg); }
.tear::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 34px; border-radius: 22px 22px 0 0; background: var(--grad); filter: saturate(1.2); }
.tear small { position: relative; display: block; font-weight: 800; font-size: 12px; letter-spacing: .14em; }
.tear small:first-child { color: #fff; }
.tear b { display: block; font-family: var(--display); font-size: 52px; line-height: 1.05; margin-top: 6px; }
.tear small:last-child { color: #6b6690; font-weight: 600; letter-spacing: .06em; }
.hero-txt { position: relative; }
.hero-txt .kicker { color: rgba(255,255,255,.85); margin-bottom: 10px; }
.hero-txt h1 { font-size: clamp(36px, 5vw, 64px); font-weight: 800; text-wrap: balance; }
.hero-txt h1 span { opacity: .78; }
.hero-txt p { margin-top: 14px; max-width: 620px; color: rgba(255,255,255,.88); font-size: 18px; }
.hero-stats { position: relative; grid-column: 1 / -1; display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.hero-stats button { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 12px; align-items: center; text-align: left; padding: 14px 18px; border-radius: 22px;
  background: rgba(255,255,255,.16); border: 1px solid rgba(255,255,255,.28); backdrop-filter: blur(10px); transition: background .25s, transform .25s var(--ease); }
.hero-stats button:hover { background: rgba(255,255,255,.26); transform: translateY(-2px); }
.hero-stats button.on { background: #fff; color: #17123a; }
.hero-stats span { grid-row: span 2; font-size: 28px; }
.hero-stats b { font-family: var(--display); font-size: 28px; line-height: 1; }
.hero-stats small { font-size: 13px; opacity: .85; }

/* segmented tabs with sliding gradient thumb (app: VibioSegmentedTabs) */
.seg-wrap { position: sticky; top: 88px; z-index: 20; display: flex; justify-content: center; margin: 34px 0 30px; }
.seg { position: relative; display: flex; gap: 4px; padding: 5px; border-radius: 999px; background: rgba(12,10,32,.72); border: 1px solid var(--line);
  backdrop-filter: blur(16px) saturate(1.3); -webkit-backdrop-filter: blur(16px) saturate(1.3); box-shadow: 0 14px 40px rgba(0,0,0,.35); max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.seg::-webkit-scrollbar { display: none; }
.seg-thumb { position: absolute; top: 5px; bottom: 5px; left: 0; width: 0; border-radius: 999px; background: var(--grad); box-shadow: 0 8px 22px color-mix(in srgb, var(--p) 50%, transparent);
  transition: transform .45s var(--ease), width .45s var(--ease); }
.seg button { position: relative; z-index: 1; display: flex; align-items: center; gap: 8px; padding: 11px 18px; border-radius: 999px; white-space: nowrap; font-weight: 600; color: var(--mute); transition: color .3s; }
.seg button[aria-selected="true"] { color: #fff; }
.t-ico { font-size: 18px; }
.t-n { min-width: 24px; height: 22px; padding: 0 7px; border-radius: 999px; display: grid; place-items: center; font-size: 12px; font-weight: 700; background: rgba(255,255,255,.12); }
.seg button[aria-selected="true"] .t-n { background: rgba(255,255,255,.25); }

/* document layout: sticky table of contents + clauses */
.doc-panel { display: none; grid-template-columns: 270px 1fr; gap: 36px; align-items: start; }
.doc-panel.on { display: grid; animation: panelIn .55s var(--ease); }
@keyframes panelIn { from { opacity: 0; transform: translateY(18px); } }
.toc { position: sticky; top: 168px; padding: 20px; border-radius: 26px; background: var(--glass); border: 1px solid var(--line); max-height: calc(100vh - 190px); overflow: auto; }
.toc-title { font-size: 12px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--s); margin-bottom: 10px; }
.toc nav { display: grid; gap: 2px; }
.toc a { display: grid; grid-template-columns: 58px 1fr; gap: 6px; padding: 8px 10px; border-radius: 12px; font-size: 14px; line-height: 1.35; color: var(--mute); transition: background .2s, color .2s; }
.toc a span { font-weight: 700; font-variant-numeric: tabular-nums; color: color-mix(in srgb, var(--s) 70%, var(--mute)); }
.toc a:hover { background: rgba(255,255,255,.06); color: var(--ink); }
.toc a.on { background: color-mix(in srgb, var(--p) 28%, transparent); color: var(--ink); }
.toc-progress { height: 4px; border-radius: 4px; background: rgba(255,255,255,.08); margin-top: 14px; overflow: hidden; }
.toc-progress i { display: block; height: 100%; width: 0; background: var(--grad); border-radius: 4px; transition: width .2s linear; }

.doc { min-width: 0; display: grid; gap: 16px; }
.doc-head { display: flex; gap: 18px; align-items: center; }
.doc-ico { width: 64px; height: 64px; border-radius: 20px; display: grid; place-items: center; font-size: 30px; background: var(--grad); flex: none; box-shadow: 0 12px 28px color-mix(in srgb, var(--p) 45%, transparent); }
.doc-head h2 { font-size: clamp(24px, 2.6vw, 34px); font-weight: 800; text-wrap: balance; line-height: 1.12; }
.doc-head p { color: var(--mute); margin-top: 4px; }
.facts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.fact { padding: 16px; border-radius: 22px; background: linear-gradient(160deg, color-mix(in srgb, var(--p) 20%, transparent), var(--glass)); border: 1px solid var(--line); display: flex; flex-direction: column; gap: 2px; }
.fact span { font-size: 24px; margin-bottom: 6px; }
.fact b { font-family: var(--display); font-size: 18px; }
.fact small { color: var(--mute); font-size: 13px; line-height: 1.4; }
.party { padding: 18px 22px; border-radius: 22px; background: rgba(255,255,255,.035); border: 1px dashed var(--line); color: var(--mute); font-size: 15px; }
.party p + p { margin-top: 8px; }
.party strong { color: var(--ink); }

.clause { scroll-margin-top: 170px; padding: 24px 26px; border-radius: 26px; background: var(--glass); border: 1px solid var(--line); transition: border-color .3s, background .3s; }
.clause.on { border-color: color-mix(in srgb, var(--s) 45%, transparent); background: color-mix(in srgb, var(--p) 8%, var(--glass)); }
.clause header { display: flex; align-items: center; gap: 14px; margin-bottom: 12px; }
.clause header::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.num { min-width: 46px; height: 34px; padding: 0 10px; border-radius: 12px; display: grid; place-items: center; font-weight: 800; font-size: 14px; background: var(--grad); font-variant-numeric: tabular-nums; white-space: nowrap; }
.clause h3 { font-size: 21px; font-weight: 700; line-height: 1.2; letter-spacing: -.02em; max-width: 70%; }
.clause-body { color: color-mix(in srgb, var(--ink) 82%, var(--mute)); font-size: 16px; line-height: 1.7; max-width: 72ch; }
.clause-body p + p, .clause-body p + ul, .clause-body ul + p { margin-top: 10px; }
.clause-body ul { list-style: none; display: grid; gap: 8px; }
.clause-body li { position: relative; padding-left: 22px; }
.clause-body li::before { content: ""; position: absolute; left: 4px; top: .62em; width: 8px; height: 8px; border-radius: 50%; background: var(--grad); }
.clause-body strong { color: var(--ink); }
.clause-body a, .party a, .doc-foot a { color: var(--s); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: color-mix(in srgb, var(--s) 45%, transparent); }
code { font: 600 13px ui-monospace, "SF Mono", Menlo, monospace; padding: 2px 7px; border-radius: 7px; background: rgba(255,255,255,.08); }
mark.ph { background: color-mix(in srgb, var(--t) 22%, transparent); color: var(--t); padding: 1px 6px; border-radius: 6px; font-weight: 600; font-size: .92em; }
.table-wrap { overflow-x: auto; border-radius: 16px; border: 1px solid var(--line); margin-top: 6px; }
.ctable { width: 100%; border-collapse: collapse; font-size: 14px; }
.ctable th { text-align: left; padding: 12px 14px; font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--mute); background: rgba(255,255,255,.04); }
.ctable td { padding: 12px 14px; border-top: 1px solid var(--line); vertical-align: top; }
.doc-foot { color: var(--mute); font-size: 14px; padding: 8px 4px 0; }
@media (max-width: 1020px) {
  .doc-panel, .doc-panel.on { grid-template-columns: 1fr; }
  .toc { position: static; max-height: none; }
  .toc nav { grid-template-columns: 1fr 1fr; }
  .facts { grid-template-columns: 1fr 1fr; }
  .seg-wrap { top: 76px; }
}
@media (max-width: 600px) {
  .docs-main { padding: 96px 16px 30px; }
  .hero-card { grid-template-columns: 1fr; padding: 28px 22px; border-radius: 30px; gap: 20px; }
  .tear { width: 92px; } .tear b { font-size: 40px; }
  .hero-stats { grid-template-columns: 1fr; }
  .seg button { padding: 10px 12px; gap: 6px; } .t-lbl { font-size: 14px; } .t-n { display: none; }
  .toc { display: none; }
  .clause { padding: 20px 18px; scroll-margin-top: 150px; }
  .clause h3 { max-width: none; font-size: 19px; }
  .clause header { flex-wrap: wrap; } .clause header::after { display: none; }
}

.hero-rings { position: absolute; right: 10px; top: -10px; width: 340px; height: 260px; margin: 0; z-index: 0; }
.hero-card .hero-txt { padding-right: 280px; }
@media (max-width: 1020px) { .hero-rings { width: 240px; height: 190px; right: -20px; top: -20px; opacity: .8; } .hero-card .hero-txt { padding-right: 0; } }
@media (max-width: 600px) { .hero-rings { width: 180px; height: 150px; right: -30px; top: -10px; } }
