/* The look of a tool page, shared by every page built on the common template.
   Loaded after the page's own <style>, so a rule here wins over the same
   selector there. It carries the landing page's palette and type (Comfortaa
   over Source Sans 3, the purple band, orange for emphasis) and the sizes a
   phone needs: 16px in every field, because iOS zooms the page on focus below
   that, and 46px of height to tap.

   White on the purple band is 11.9:1 at its darkest and 8.6:1 at its lightest.
   Text links are #7f3289, 7.4:1 on white. Ink on the orange is #222, 7.4:1. */
:root {
  --purple:#572e91; --purple2:#7f3289; --deep:#382280; --lilac:#f5f1fa; --lilac2:#ece4f5; --orange:#ff9911;
  --bg:#faf8fd; --surface:#fff; --border:#e6e3ec; --text:#222; --dim:#4b5563; --muted:#6b7280;
  --accent:#7f3289; --accent-soft:#f5f1fa;
  --head:"Comfortaa","Segoe UI",sans-serif; --body:"Source Sans 3",-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,sans-serif;
}
body { font-family:var(--body); font-size:17px; line-height:1.6; background:var(--bg); color:var(--text); }
a { color:var(--purple2); }

/* The band: back link and source on top, the name under them. */
header { position:relative; overflow:hidden; border:0; color:#fff; background:linear-gradient(135deg,var(--deep) 0%,var(--purple) 55%,var(--purple2) 100%); }
header::after { content:""; position:absolute; right:-70px; top:-90px; width:230px; height:230px; border-radius:50%; border:24px solid #fff; opacity:.1; pointer-events:none; }
header .wrap { position:relative; z-index:1; display:flex; flex-direction:column-reverse; align-items:stretch; gap:1.1rem; padding:.8rem 1.25rem 1.9rem; }
header nav { display:flex; align-items:center; gap:.5rem; }
header nav a { display:inline-flex; align-items:center; min-height:40px; margin:0; padding:0 .9rem; border-radius:99px; color:#fff; font-size:.92rem; font-weight:600; text-decoration:none; }
header nav a:first-child { padding-left:0; }
header nav a:first-child::before { content:"\2190"; margin-right:.45rem; }
header nav a:nth-child(2) { margin-left:auto; border:1.5px solid rgba(255,255,255,.55); }
header nav a:hover, header nav a:focus-visible { text-decoration:underline; text-underline-offset:3px; }
header nav a:focus-visible, header nav button:focus-visible { outline:3px solid var(--orange); outline-offset:2px; }
header h1 { font-family:var(--head); font-weight:700; font-size:2rem; line-height:1.25; color:#fff; }
header h1 small { display:block; margin:.5rem 0 0; font-family:var(--body); font-weight:400; font-size:1rem; line-height:1.45; color:rgba(255,255,255,.88); max-width:60ch; }

main { padding:1.4rem 0 3rem; }
.lede { font-size:1.02rem; color:var(--dim); max-width:70ch; margin-bottom:1.2rem; }
.lede-more { display:none; }

.panel { border-radius:14px; border:1px solid var(--border); padding:1.15rem 1.2rem; margin-bottom:1.1rem; box-shadow:0 5px 12px rgba(56,34,128,.06); }
.panel h2 { font-family:var(--head); font-size:.82rem; letter-spacing:.07em; color:var(--purple); margin-bottom:.8rem; }

label { font-size:.92rem; font-weight:600; color:var(--dim); margin:.75rem 0 .3rem; }
select, textarea, input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=file]) {
  width:100%; font:inherit; font-size:16px; min-height:46px; padding:.55rem .7rem; border:1.5px solid var(--border); border-radius:10px; background:#fff; color:var(--text); }
textarea { font-family:var(--mono, ui-monospace, monospace); font-size:16px; line-height:1.45; }
select:focus, textarea:focus, input:focus { outline:3px solid var(--lilac2); outline-offset:0; border-color:var(--purple2); }
input[type=checkbox], input[type=radio] { width:20px; height:20px; accent-color:var(--purple); flex:0 0 auto; }
input[type=file] { font-size:.95rem; min-height:46px; padding:.2rem 0; max-width:100%; }
input[type=file]::file-selector-button { font:inherit; font-weight:700; min-height:40px; margin-right:.7rem; padding:.4rem 1rem; border-radius:99px; border:1.5px solid var(--purple); background:#fff; color:var(--purple); cursor:pointer; }
input[type=range] { width:100%; min-height:40px; accent-color:var(--purple); }
label.chk, label.check, .chk label, label:has(> input[type=checkbox]), label:has(> input[type=radio]) { min-height:40px; align-items:center; }
.lab, label.lab, .item .lab { font-size:.85rem; }
button.small { min-height:40px; font-size:.88rem; padding:.35rem .9rem; }
.auth, .pill, .src, .legend span { font-size:.85rem; }
.row { gap:.7rem; }
button { font-family:var(--body); font-size:.98rem; font-weight:700; min-height:46px; padding:.55rem 1.2rem; border-radius:99px; border:1.5px solid var(--purple); background:var(--purple); color:#fff; }
button.secondary { background:#fff; color:var(--purple); }
button:focus-visible { outline:3px solid var(--orange); outline-offset:2px; }
.top-tabs button { min-height:46px; border-radius:0; border:0; border-bottom:3px solid transparent; background:none; color:var(--dim); font-weight:600; font-size:1rem; padding:.5rem .9rem; }
.top-tabs button.on { color:var(--purple); border-bottom-color:var(--orange); }

.stat { margin:.3rem 1.4rem .5rem 0; }
.stat b { font-family:var(--head); font-weight:700; font-size:1.55rem; color:var(--purple); line-height:1.2; }
.stat span { font-size:.88rem; color:var(--dim); }
table { font-size:.92rem; }
th, td { padding:.5rem .6rem; }
th { font-size:.84rem; color:var(--purple); font-weight:700; }
.tscroll:focus-visible { outline:3px solid var(--orange); }
.note { font-size:.93rem; margin-top:.65rem; }
.mini { font-size:.88rem; color:var(--dim); }
.warn, .ok { font-size:.93rem; border-radius:10px; padding:.6rem .8rem; }
ol.work { font-size:.95rem; } ol.work li { margin-bottom:.5rem; }
pre { font-size:.85rem; border-radius:10px; }
blockquote { border-left-color:var(--orange); border-radius:0 10px 10px 0; font-size:.98rem; }

footer { border:0; background:var(--deep); color:rgba(255,255,255,.85); padding:1.6rem 1.25rem; font-size:.92rem; }
footer a { color:#fff; font-weight:600; }

/* The font button joins the band instead of floating over the page. */
header nav #dys-font-btn { min-height:40px; min-width:40px; margin:0; padding:0 .7rem; border-radius:99px; border:1.5px solid rgba(255,255,255,.55); background:transparent; color:#fff; font-size:.92rem; }

@media (max-width:700px) {
  body { font-size:16.5px; }
  header .wrap { padding:.6rem 1.1rem 1.4rem; gap:.8rem; }
  header h1 { font-size:1.5rem; }
  header h1 small { font-size:.95rem; margin-top:.4rem; }
  .wrap { padding:0 1.1rem; }
  main { padding-top:1.1rem; }
  .panel { padding:1.05rem 1.05rem; }
  /* A wide table keeps its first column in view while the rest scrolls. */
  table { font-size:.88rem; }
  th, td { padding:.5rem .45rem; }
  th { white-space:normal; vertical-align:bottom; line-height:1.25; }
  .tscroll th:first-child, .tscroll td:first-child { position:sticky; left:0; z-index:1; background:var(--surface); white-space:normal; max-width:8.2rem; box-shadow:6px 0 6px -6px rgba(56,34,128,.18); }
  /* The explanation folds to two lines so the first field is on the first screen. */
  .lede.folded { display:-webkit-box; -webkit-box-orient:vertical; -webkit-line-clamp:2; line-clamp:2; overflow:hidden; margin-bottom:.2rem; }
  .lede-more { display:inline-flex; align-items:center; min-height:44px; margin:0 0 .7rem; padding:0; border:0; background:none; color:var(--purple2); font-size:.98rem; font-weight:700; text-decoration:underline; text-underline-offset:3px; border-radius:6px; }
}
@media print { header { background:none; color:#000; } header h1, header h1 small, header nav a { color:#000; } .lede-more, header nav { display:none; } .lede.folded { display:block; } }

/* A destructive button stays red on white: red text on the purple fill is 2.4:1. */
button.danger { background:#fff; color:#b91c1c; border-color:#b91c1c; }
