/* © 2026 Kaikias Software
   Ring List's help pages (server/ringlist/help.py makes them from help/pages/). The website's ring and black,
   the app's own colors in the light, following the reader's device, or the app's Appearance setting when it's
   been chosen on this device (data-theme, set before the page paints). */
:root{
  --bg:#ffffff; --bg2:#f7f6f3; --card:#ffffff; --text:#1f2328; --muted:#5f6673; --dim:#8b919b; --hair:#e5e3de; --hair2:#efede8;
  --accent:#2563eb; --accent-bg:#eef4ff; --sun:hsl(45 100% 45%); --tip:#15803d; --tip-bg:#effaf2; --note:#2563eb; --note-bg:#eef4ff; --caution:#b45309; --caution-bg:#fff7e6;
  --shadow:0 1px 2px rgba(20,20,30,.06), 0 8px 24px rgba(20,20,30,.08); --frame:#d9d6cf; --kbd:#f7f6f3;
  --ring:conic-gradient(from 0deg, hsl(0 85% 62%), hsl(45 100% 55%), hsl(130 65% 50%), hsl(195 85% 55%), hsl(265 80% 65%), hsl(320 80% 62%), hsl(0 85% 62%));
  --top:58px; --side:272px;
  color-scheme:light;
}
@media (prefers-color-scheme: dark){
  :root:not([data-theme="light"]){
    --bg:#0b0b0e; --bg2:#121319; --card:#17181a; --text:#eceef0; --muted:#9aa0a6; --dim:#6b7078; --hair:rgba(255,255,255,.1); --hair2:rgba(255,255,255,.06);
    --accent:#60a5fa; --accent-bg:rgba(96,165,250,.12); --sun:hsl(48 100% 55%); --tip:#4ade80; --tip-bg:rgba(74,222,128,.08); --note:#60a5fa; --note-bg:rgba(96,165,250,.09); --caution:#fbbf24; --caution-bg:rgba(251,191,36,.08);
    --shadow:0 1px 2px rgba(0,0,0,.4), 0 10px 30px rgba(0,0,0,.45); --frame:#33353a; --kbd:#212226;
    color-scheme:dark;
  }
}
:root[data-theme="dark"]{
  --bg:#0b0b0e; --bg2:#121319; --card:#17181a; --text:#eceef0; --muted:#9aa0a6; --dim:#6b7078; --hair:rgba(255,255,255,.1); --hair2:rgba(255,255,255,.06);
  --accent:#60a5fa; --accent-bg:rgba(96,165,250,.12); --sun:hsl(48 100% 55%); --tip:#4ade80; --tip-bg:rgba(74,222,128,.08); --note:#60a5fa; --note-bg:rgba(96,165,250,.09); --caution:#fbbf24; --caution-bg:rgba(251,191,36,.08);
  --shadow:0 1px 2px rgba(0,0,0,.4), 0 10px 30px rgba(0,0,0,.45); --frame:#33353a; --kbd:#212226;
  color-scheme:dark;
}
*{box-sizing:border-box;}
html{scroll-padding-top:calc(var(--top) + 16px); -webkit-text-size-adjust:100%;}
body{margin:0; background:var(--bg); color:var(--text); font-family:Figtree,-apple-system,BlinkMacSystemFont,"Segoe UI",Helvetica,Arial,sans-serif; font-size:17px; line-height:1.6; -webkit-font-smoothing:antialiased;}
a{color:var(--accent); text-decoration:none;}
a:hover{text-decoration:underline;}
:focus-visible{outline:2px solid var(--accent); outline-offset:2px; border-radius:6px;}
.nowrap{white-space:nowrap;}
.lsym{color:var(--sun);}
.skip{position:absolute; left:-999px; top:8px; z-index:50; background:var(--card); padding:8px 14px; border-radius:8px; border:1px solid var(--hair);}
.skip:focus{left:8px;}

/* ---- the top bar ---- */
.top{position:sticky; top:0; z-index:20; height:var(--top); display:flex; align-items:center; gap:14px; padding:0 max(16px, env(safe-area-inset-right)) 0 max(16px, env(safe-area-inset-left));
  background:color-mix(in srgb, var(--bg) 86%, transparent); backdrop-filter:blur(14px); -webkit-backdrop-filter:blur(14px); border-bottom:1px solid var(--hair);}
.brand{display:flex; align-items:center; gap:10px; color:var(--text); font-weight:500; font-size:1.05rem; letter-spacing:-.01em; white-space:nowrap; flex:none;}
.brand:hover{text-decoration:none;}
.brand b{font-weight:800;}
.ring{position:relative; width:22px; height:22px; border-radius:50%; flex:none; display:inline-block;}
.ring::before{content:''; position:absolute; inset:0; border-radius:50%; background:var(--ring);
  -webkit-mask:radial-gradient(farthest-side, transparent calc(100% - 5px), #000 calc(100% - 4px)); mask:radial-gradient(farthest-side, transparent calc(100% - 5px), #000 calc(100% - 4px));}
.menu-btn{display:none; flex:none; width:40px; height:40px; margin-left:-8px; border:0; border-radius:10px; background:transparent; color:var(--text); cursor:pointer; align-items:center; justify-content:center;}
.menu-btn:hover{background:var(--hair2);}
.search{position:relative; flex:1; max-width:460px; margin-left:auto;}
.search > svg{position:absolute; left:12px; top:50%; transform:translateY(-50%); color:var(--dim); pointer-events:none;}
.search input{width:100%; height:38px; padding:0 12px 0 36px; font:inherit; font-size:.95rem; color:var(--text); background:var(--bg2); border:1px solid var(--hair); border-radius:10px; outline:none; -webkit-appearance:none; appearance:none;}
.search input::placeholder{color:var(--dim);}
.search input:focus{border-color:var(--accent); background:var(--card);}
.search input::-webkit-search-cancel-button{-webkit-appearance:none;}
.results{position:absolute; left:0; right:0; top:calc(100% + 8px); max-height:min(70vh, 520px); overflow:auto; background:var(--card); border:1px solid var(--hair); border-radius:12px; box-shadow:var(--shadow); padding:6px; overscroll-behavior:contain;}
.results a{display:block; padding:9px 12px; border-radius:8px; color:var(--text);}
.results a:hover, .results a.on{background:var(--accent-bg); text-decoration:none;}
.results b{display:block; font-weight:650;}
.results small{display:block; color:var(--muted); font-size:.84rem; line-height:1.4;}
.results small.where{color:var(--dim); font-size:.76rem; text-transform:uppercase; letter-spacing:.05em;}
.results mark{background:none; color:var(--accent); font-weight:650;}
.results .none{padding:12px; color:var(--muted); font-size:.92rem;}
.open-app{flex:none; padding:7px 14px; border-radius:999px; border:1px solid var(--hair); color:var(--text); font-weight:600; font-size:.9rem; white-space:nowrap;}
.open-app:hover{text-decoration:none; border-color:var(--dim);}

/* ---- the three columns: every topic, the page, what's on it ---- */
.layout{display:grid; grid-template-columns:var(--side) minmax(0, 1fr) 216px; max-width:1360px; margin:0 auto;}
.sidebar{position:sticky; top:var(--top); align-self:start; height:calc(100vh - var(--top)); height:calc(100dvh - var(--top)); overflow:auto; padding:20px 12px 40px 16px; border-right:1px solid var(--hair); font-size:.93rem; overscroll-behavior:contain;}
.sidebar a{display:block; padding:5px 10px; border-radius:8px; color:var(--muted); line-height:1.35;}
.sidebar a:hover{color:var(--text); background:var(--hair2); text-decoration:none;}
.sidebar a.cur{color:var(--accent); background:var(--accent-bg); font-weight:600;}
.sidebar .side-home{font-weight:650; color:var(--text); margin-bottom:6px;}
.sidebar details{margin:2px 0;}
.sidebar summary{list-style:none; display:flex; align-items:center; gap:6px; padding:6px 10px; border-radius:8px; cursor:pointer; font-weight:650; color:var(--text); user-select:none; -webkit-user-select:none;}
.sidebar summary::-webkit-details-marker{display:none;}
.sidebar summary::after{content:''; margin-left:auto; width:7px; height:7px; border-right:1.8px solid var(--dim); border-bottom:1.8px solid var(--dim); transform:rotate(-45deg); transition:transform .15s ease; flex:none;}
.sidebar details[open] > summary::after{transform:rotate(45deg);}
.sidebar summary:hover{background:var(--hair2);}
.sidebar ul{list-style:none; margin:2px 0 8px; padding:0 0 0 10px; border-left:1px solid var(--hair); margin-left:14px;}
.sidebar .side-app{display:none;}

main{min-width:0; padding:28px clamp(18px, 4vw, 56px) 60px;}
article, .related, .prevnext, main > footer{max-width:760px; margin-left:auto; margin-right:auto;}
.crumbs{display:flex; flex-wrap:wrap; gap:6px; align-items:center; font-size:.86rem; color:var(--dim); margin-bottom:10px;}
.crumbs a{color:var(--muted);}
h1{font-size:clamp(1.8rem, 4.2vw, 2.35rem); line-height:1.15; letter-spacing:-.022em; margin:0 0 10px; font-weight:800; text-wrap:balance;}
.lead{font-size:1.16rem; line-height:1.5; color:var(--muted); margin:0 0 26px; text-wrap:pretty;}
article h2{font-size:1.4rem; line-height:1.25; letter-spacing:-.012em; margin:40px 0 10px; font-weight:750;}
article h3{font-size:1.1rem; margin:28px 0 6px; font-weight:700;}
article p{margin:0 0 14px;}
article ul, article ol{margin:0 0 16px; padding-left:1.35em;}
article li{margin:4px 0;}
article li > p{margin:0 0 6px;}
article strong{font-weight:680;}
article hr{border:0; border-top:1px solid var(--hair); margin:32px 0;}
article code{font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace; font-size:.88em; background:var(--bg2); border:1px solid var(--hair2); border-radius:5px; padding:1px 5px;}
article pre{background:var(--bg2); border:1px solid var(--hair); border-radius:10px; padding:12px 14px; overflow:auto; font-size:.9rem;}
article pre code{background:none; border:0; padding:0;}
kbd{display:inline-block; min-width:1.6em; padding:1px 6px; font:inherit; font-size:.82em; font-weight:600; text-align:center; background:var(--kbd); border:1px solid var(--hair); border-bottom-width:2px; border-radius:6px; white-space:nowrap;}
article blockquote{margin:0 0 16px; padding:2px 0 2px 16px; border-left:3px solid var(--hair); color:var(--muted);}

/* Steps: an ordered list is something to do, one numbered step after another. */
article ol{list-style:none; counter-reset:step; padding-left:0;}
article ol > li{counter-increment:step; position:relative; padding-left:2.5em; margin:10px 0; min-height:1.75em;}
article ol > li::before{content:counter(step); position:absolute; left:0; top:.05em; width:1.75em; height:1.75em; border-radius:50%; background:var(--accent-bg); color:var(--accent); font-weight:700; font-size:.88em; display:flex; align-items:center; justify-content:center;}
article ol ol, article ul ol{margin-top:8px;}

/* Tables: what's what, side by side; they scroll sideways on a phone rather than squeeze. */
.table-wrap{overflow-x:auto; margin:0 0 18px; border:1px solid var(--hair); border-radius:12px;}
table{border-collapse:collapse; width:100%; font-size:.95rem;}
th, td{text-align:left; padding:9px 14px; border-bottom:1px solid var(--hair); vertical-align:top;}
th{font-weight:650; background:var(--bg2); white-space:nowrap;}
tr:last-child td{border-bottom:0;}
td:first-child{white-space:nowrap;}
td.wrap:first-child, table.wrap td:first-child{white-space:normal;}

/* Asides */
.callout{margin:18px 0; padding:12px 16px; border-radius:12px; background:var(--note-bg); border:1px solid color-mix(in srgb, var(--note) 22%, transparent);}
.callout > :last-child{margin-bottom:0;}
.callout-title{font-weight:700; font-size:.8rem; text-transform:uppercase; letter-spacing:.06em; color:var(--note); margin:0 0 4px !important;}
.callout.tip{background:var(--tip-bg); border-color:color-mix(in srgb, var(--tip) 22%, transparent);}
.callout.tip .callout-title{color:var(--tip);}
.callout.caution{background:var(--caution-bg); border-color:color-mix(in srgb, var(--caution) 26%, transparent);}
.callout.caution .callout-title{color:var(--caution);}

/* On a phone / On a computer: one after another without the script; tabs with it, opened on the reader's device. */
.tabs{margin:16px 0 20px;}
.tab-name{font-size:.8rem; text-transform:uppercase; letter-spacing:.06em; color:var(--muted); margin:18px 0 6px; font-weight:700;}
.tabs.live{border:1px solid var(--hair); border-radius:12px; overflow:hidden;}
.tabs.live .tab-name{display:none;}
.tab-bar{display:flex; gap:2px; padding:5px; background:var(--bg2); border-bottom:1px solid var(--hair); overflow-x:auto;}
.tab-bar button{font:inherit; font-size:.9rem; font-weight:600; color:var(--muted); background:transparent; border:0; border-radius:8px; padding:6px 14px; cursor:pointer; white-space:nowrap;}
.tab-bar button:hover{color:var(--text);}
.tab-bar button[aria-selected="true"]{background:var(--card); color:var(--text); box-shadow:0 1px 2px rgba(0,0,0,.12);}
.tabs.live .tab{padding:14px 16px 4px;}
.tabs.live .tab[hidden]{display:none;}
.tabs.live .tab > :last-child{margin-bottom:12px;}

/* Pictures: a phone's screen is shown narrow, in a frame; a computer's, the page's width. */
figure.shot{margin:20px 0 24px; text-align:center;}
figure.shot img{display:block; margin:0 auto; max-width:100%; height:auto; border:1px solid var(--frame); border-radius:14px; box-shadow:var(--shadow); background:var(--bg2);}
figure.shot.phone img{max-width:min(100%, 320px); border-radius:22px;}
figure.shot figcaption{margin-top:10px; font-size:.88rem; color:var(--muted); text-wrap:balance;}
.shots{display:flex; gap:18px; justify-content:center; align-items:flex-start; flex-wrap:wrap; margin:20px 0 24px;}
.shots figure.shot{margin:0; flex:0 1 300px;}
.shots figure.shot.wide{flex:1 1 100%;}
img.inline-pic{height:1.25em; width:auto; vertical-align:-.25em;}
article svg.diagram{display:block; width:100%; height:auto; margin:18px 0 22px;}

/* Cards: a section's pages, See also, the front page */
.cards{display:grid; grid-template-columns:repeat(auto-fill, minmax(240px, 1fr)); gap:12px; margin:18px 0;}
.card{display:flex; flex-direction:column; gap:4px; padding:14px 16px; border:1px solid var(--hair); border-radius:14px; background:var(--card); color:var(--text); transition:border-color .15s ease, transform .15s ease;}
.card:hover{text-decoration:none; border-color:var(--accent); transform:translateY(-1px);}
.card b{font-weight:680; line-height:1.3;}
.card span{color:var(--muted); font-size:.9rem; line-height:1.45;}
.related{margin-top:44px;}
.related h2{font-size:.8rem; text-transform:uppercase; letter-spacing:.06em; color:var(--muted); margin:0 0 4px; font-weight:700;}
.related .cards{margin-top:8px;}
.prevnext{display:grid; grid-template-columns:1fr 1fr; gap:12px; margin-top:32px;}
.prevnext a{display:flex; flex-direction:column; gap:2px; padding:12px 16px; border:1px solid var(--hair); border-radius:14px; color:var(--text);}
.prevnext a:hover{text-decoration:none; border-color:var(--accent);}
.prevnext a span{font-size:.78rem; text-transform:uppercase; letter-spacing:.06em; color:var(--dim); font-weight:700;}
.prevnext a b{font-weight:650; line-height:1.3;}
.prevnext .next{text-align:right;}
main > footer{margin-top:48px; padding-top:20px; border-top:1px solid var(--hair); color:var(--muted); font-size:.93rem;}
main > footer p{margin:0 0 8px;}
main > footer .fine{font-size:.84rem; color:var(--dim);}
main > footer .fine a{color:var(--muted);}

/* What's on this page */
.toc{position:sticky; top:var(--top); align-self:start; max-height:calc(100vh - var(--top)); overflow:auto; padding:34px 16px 30px 0; font-size:.86rem;}
.toc p{margin:0 0 8px; font-size:.76rem; text-transform:uppercase; letter-spacing:.06em; color:var(--dim); font-weight:700;}
.toc ul{list-style:none; margin:0; padding:0; border-left:1px solid var(--hair);}
.toc a{display:block; padding:4px 0 4px 12px; margin-left:-1px; border-left:1px solid transparent; color:var(--muted); line-height:1.35;}
.toc a:hover{color:var(--text); text-decoration:none;}
.toc a.on{color:var(--accent); border-left-color:var(--accent);}

/* ---- the front page ---- */
body.home main{padding-top:44px;}
body.home h1{font-size:clamp(2.1rem, 6vw, 3rem); text-align:center;}
body.home .lead{text-align:center; max-width:34em; margin-left:auto; margin-right:auto;}
body.home article{max-width:1000px;}
body.home .layout, body.section .layout{grid-template-columns:var(--side) minmax(0, 1fr);}   /* (no "On this page" there: the room is the page's) */
.home-start{display:grid; grid-template-columns:repeat(auto-fit, minmax(200px, 1fr)); gap:12px; margin:26px 0 8px;}
.home-start .card{border-color:color-mix(in srgb, var(--accent) 30%, var(--hair)); background:var(--accent-bg);}
/* Every section and its pages, in columns, each section under the one before it whatever their lengths. */
.home-grid{columns:3 270px; column-gap:14px; margin-top:28px;}
.home-section{break-inside:avoid; margin:0 0 14px; border:1px solid var(--hair); border-radius:16px; padding:16px 18px 14px; background:var(--card);}
.home-section h2{margin:0 0 2px; font-size:1.12rem;}
.home-section h2 a{color:var(--text);}
.home-section p{color:var(--muted); font-size:.92rem; margin:0 0 10px; line-height:1.45;}
.home-section ul{list-style:none; margin:0; padding:0; font-size:.95rem;}
.home-section li{margin:0; padding:3px 0;}

/* ---- narrower: no "On this page"; then a phone: the topics slide in from the side ---- */
@media (max-width:1180px){
  .layout{grid-template-columns:var(--side) minmax(0, 1fr);}
  .toc{display:none;}
}
@media (max-width:860px){
  body{font-size:16.5px;}
  .layout{display:block;}
  .menu-btn{display:flex;}
  .open-app{display:none;}
  .brand span:last-child{font-size:1rem;}
  .search{max-width:none;}
  .sidebar{position:fixed; z-index:30; top:var(--top); left:0; bottom:0; height:auto; align-self:auto; width:min(86vw, 330px); background:var(--bg); border-right:1px solid var(--hair); box-shadow:var(--shadow);
    transform:translateX(-105%); transition:transform .22s ease; visibility:hidden; padding:16px 12px calc(30px + env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left)); font-size:1rem;}
  .sidebar a, .sidebar summary{padding-top:8px; padding-bottom:8px;}
  body.menu-open .sidebar{transform:none; visibility:visible;}
  body.menu-open::after{content:''; position:fixed; inset:var(--top) 0 0 0; z-index:25; background:rgba(0,0,0,.45);}
  body.menu-open{overflow:hidden;}
  .sidebar .side-app{display:block; margin:14px 0 0; padding:10px 14px; border:1px solid var(--hair); border-radius:999px; text-align:center; color:var(--text); font-weight:600;}
  main{padding:20px 18px 48px;}
  .prevnext{grid-template-columns:1fr;}
  .prevnext > span{display:none;}
  .prevnext .next{text-align:left;}
  .results{position:fixed; left:10px; right:10px; top:calc(var(--top) + 4px);}
}
@media (max-width:420px){
  .brand span:last-child{display:none;}   /* (the ring alone, so the search has room) */
}
@media (prefers-reduced-motion: reduce){ *{transition:none !important;} }
@media print{
  .top, .sidebar, .toc, .prevnext, .related, main > footer, .tab-bar{display:none !important;}
  .layout{display:block;} .tabs.live .tab[hidden]{display:block;} .tabs.live .tab-name{display:block;}
}
