/* Terms & policies — the two legal categories on the Daddysvps console language.
   Category one is fetched from terms.html and purchase-terms.html and arrives as `.terms-sec`
   markup styled by terms.css, which is written against the home-page tokens. Remapping those
   tokens to the console palette here is the same move `.terms-gate.is-console` makes, and it is
   what lets one sheet style both surfaces without a second copy of the clause rules. */
.legal-page{--accent:#efa465;--accent-soft:#efa46512}
html[data-theme=light] .legal-page{--accent:#a94d17;--accent-soft:#a94d1710}
.legal-page .sidebar .active .nav-symbol{color:var(--accent)}

.legal-status{margin-left:auto;white-space:nowrap;padding:5px 10px;border-radius:6px;background:var(--raised);color:var(--muted);font-size:12px;font-weight:600}

/* The category switch, drawn the same way as the updates filter so the two RESOURCES pages
   read as one family. */
.legal-tabs{display:flex;align-items:flex-end;gap:22px;flex-wrap:wrap;margin:26px 0 22px;padding:0 2px;border-bottom:1px solid var(--line)}
.legal-tabs button{position:relative;flex:none;display:inline-flex;align-items:center;gap:8px;padding:9px 0 12px;border:0;background:none;color:var(--muted);font-size:12.5px;font-weight:600;white-space:nowrap;transition:color .14s ease}
.legal-tabs button:hover{color:var(--text)}
.legal-tabs button[aria-selected=true]{color:var(--text)}
.legal-tabs button[aria-selected=true]:after{content:"";position:absolute;bottom:-1px;left:0;right:0;height:2px;background:var(--accent)}
.legal-tabs i{min-width:19px;padding:1px 7px;border:1px solid var(--line);border-radius:999px;color:var(--muted);font-size:10px;font-style:normal;font-weight:700;text-align:center}
.legal-tabs i:empty{display:none}
.legal-tabs button[aria-selected=true] i{border-color:transparent;background:var(--accent-soft);color:var(--accent)}

.legal-panel{min-width:0}
.legal-panel:focus-visible{outline:2px solid var(--muted);outline-offset:6px;border-radius:8px}

/* Hands the home-page tokens the fetched clauses are written against to the console palette. */
.legal-doc{--ink:var(--text);--muted-ink:var(--muted);--rule:var(--line);--card-1:var(--panel);--surface:var(--accent);--page:var(--bg);--quick:.14s;--ease:ease}
/* terms.css colours the clause bullets by theme with a two-class selector; a third class is what
   keeps them on the console accent instead of the home-page blue. */
.legal-page .legal-doc .terms-sec-body li:before{background:var(--accent)}
html.dark .legal-page .legal-doc .terms-sec-body li:before{background:var(--accent)}
.legal-page .terms-sec:first-of-type{border-top:0}
/* The clause number column is 190px on the home document; the console keeps it tighter so the
   body gets the room back before the two-column split stops paying for itself. */
.legal-page .terms-sec{scroll-margin-top:88px;grid-template-columns:170px minmax(0,1fr)}
.legal-page .terms-sec-body a{color:var(--accent);text-decoration:underline;text-underline-offset:3px}
.legal-page .terms-sec-body a:hover{opacity:.78}

.legal-group+.legal-group{margin-top:34px;padding-top:30px;border-top:1px solid var(--line)}
.legal-group-head{display:flex;align-items:flex-start;justify-content:space-between;gap:22px;flex-wrap:wrap}
.legal-group-head h2{margin:0;font-size:15px;font-weight:650;letter-spacing:-.2px}
.legal-group-head p{margin:6px 0 0;max-width:620px;color:var(--muted);font-size:12.5px;line-height:1.7}
.legal-chips{display:flex;flex-wrap:wrap;gap:7px;list-style:none;margin:0;padding:0}
.legal-chips li{padding:5px 9px;border:1px solid var(--line);border-radius:7px;background:var(--raised);color:var(--muted);font-size:10px;font-weight:700;letter-spacing:.04em;white-space:nowrap}
.legal-chips li:first-child{border-color:color-mix(in srgb,var(--accent) 45%,var(--line));background:var(--accent-soft);color:var(--accent)}

.legal-toc{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:2px 26px;margin:20px 0 4px;padding:18px 20px;border:1px solid var(--line);border-radius:14px;background:var(--panel)}
.legal-toc:empty{display:none}
.legal-toc a{padding:7px 0;color:var(--muted);font-size:12px;line-height:1.5;transition:color .14s ease}
.legal-toc a:hover{color:var(--text);text-decoration:underline;text-underline-offset:4px}

/* Loading and failure are states of the terms panel only — the policies are in the document. */
.legal-skeleton{display:grid;gap:14px;margin:4px 0 18px}
.legal-skeleton span{height:56px;border-radius:12px;background:linear-gradient(90deg,var(--panel) 25%,var(--raised) 50%,var(--panel) 75%);background-size:220% 100%;animation:legal-shimmer 1.5s ease-in-out infinite}
.legal-skeleton span:nth-child(2){height:74px}
.legal-skeleton span:nth-child(4){height:44px}
.legal-skeleton span:nth-child(5){height:66px}
@keyframes legal-shimmer{from{background-position:120% 0}to{background-position:-120% 0}}
.legal-loading{margin:0;color:var(--muted);font-size:12.5px}
.legal-failed{padding:20px;border:1px solid var(--line);border-left:3px solid var(--accent);border-radius:12px;background:var(--panel)}
.legal-failed p{margin:0 0 14px;font-size:13px;line-height:1.7}
.legal-failed div{display:flex;flex-wrap:wrap;gap:10px}
.legal-failed a,.legal-failed button{display:inline-flex;align-items:center;padding:9px 14px;border:1px solid var(--line);border-radius:8px;background:var(--raised);color:var(--text);font-size:12px;font-weight:600;transition:background .14s ease}
.legal-failed a:hover,.legal-failed button:hover{background:var(--hover)}

@media(max-width:860px){
  .legal-toc{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media(max-width:700px){
  .legal-status{display:none}
  .legal-tabs{gap:18px}
  .legal-group-head{flex-direction:column;gap:12px}
  .legal-toc{grid-template-columns:minmax(0,1fr);padding:14px 16px}
  /* One column, as terms.css already does for the home document at this width. */
  .legal-page .terms-sec{grid-template-columns:minmax(0,1fr);gap:12px}
  .legal-page .terms-sec h2 span{display:inline;margin:0 8px 0 0;vertical-align:2px}
}
@media(prefers-reduced-motion:reduce){
  .legal-skeleton span{animation:none}
}
