/* Wais Driver: the free study platform's shell and pages (issue #180). Loaded after the shared sheets on every page
   (landing.css and study.css bundle it last), so its rules settle the header, the footer and the new pages.
   Phone first: everything is laid out for a 360px screen, then widened. A civic study look: white surfaces,
   sign blue, lane-marking yellow, one line of yellow under the hero; no blur, no motion a slow phone pays for.
   Browser floor Chrome 80 / Safari 13.1: no :is/:where/:has, no aspect-ratio, no flex gap (grid gap only). */
:root{--w-blue:#0b3d91;--w-blue-deep:#082c6b;--w-blue-tint:#eaf1fc;--w-yellow:#ffd23f;--w-yellow-deep:#e6b800;
  --w-ink:#0d1b2a;--w-muted:#4a5568;--w-line:#d5dbe6;--w-paper:#f7f5ec;--w-white:#fff;--w-green:#17803f;--w-green-tint:#e8f5ed;
  --w-radius:14px;--w-gutter:16px}

/* ---- Header: one row on a 360px phone: mark, EN/TL, Lookup, Reviewers, Tools ---- */
body .site-header.w-header{display:flex;align-items:center;justify-content:flex-start;height:auto;min-height:60px;padding:6px var(--w-gutter);
  background:#fff!important;box-shadow:0 1px 0 var(--w-line);position:sticky;top:0;z-index:50}
.w-header .w-brand{display:inline-flex;align-items:center;min-height:44px;margin-right:auto;color:var(--w-ink);font-weight:800;font-size:18px;
  text-decoration:none;white-space:nowrap}
.w-header .w-brand img{width:32px;height:32px;margin-right:8px;flex:none}
.w-header .w-lang{display:flex;margin-right:6px;padding:2px;border:1px solid var(--w-line);border-radius:99px;background:var(--w-blue-tint)}
body .w-header .w-lang a{display:grid;place-items:center;min-width:34px;min-height:36px!important;padding:0 6px;border-radius:99px;
  color:var(--w-blue);font-size:13px;font-weight:800;text-decoration:none}
body .w-header .w-lang a[aria-current=page]{background:var(--w-blue);color:#fff}
.w-header .w-lang .lang-long{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
.w-header .w-lang .lang-short{display:inline}
.w-nav{display:flex;align-items:center}
body .w-nav a{display:inline-flex;align-items:center;min-height:44px;padding:0 7px;color:var(--w-ink);font-size:14px;font-weight:700;
  text-decoration:none;white-space:nowrap;border-radius:8px}
body .w-nav a[aria-current=page]{color:var(--w-blue);box-shadow:inset 0 -3px 0 var(--w-yellow)}
.w-nav a:hover{color:var(--w-blue)}
@media(max-width:479px){.w-header .w-brand-name{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0)}.w-header .w-brand img{margin-right:0}}
@media(max-width:359px){body .w-nav a{padding:0 4px;font-size:13px}.w-header .w-lang{margin-right:2px}}
@media(min-width:760px){body .site-header.w-header{padding-inline:max(24px,calc((100vw - 1120px)/2))}body .w-nav a{padding:0 12px;font-size:15px}.w-header .w-lang{margin-right:12px}}
/* The study workspace keeps its sound switch in the header; on a narrow phone the guides link makes room for it. */
@media(max-width:399px){.study-page .w-nav a:last-child{display:none}}

/* ---- Footer ---- */
body .site-footer.w-footer{padding:32px var(--w-gutter) 40px;background:#102b46;color:#fff}
.w-footer-top{max-width:1120px;margin:0 auto 18px}
body .w-footer .w-footer-brand{color:#fff;font-weight:800;font-size:20px;text-decoration:none}
body .w-footer p{color:#dbe5f3;margin:6px 0 0;font-size:15px}
.w-footer-links{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:2px 16px;max-width:1120px;margin:0 auto 18px}
body .w-footer-links a{display:flex;align-items:center;min-height:44px;color:#fff;font-size:15px;text-decoration:none}
.w-footer-links a:hover{text-decoration:underline}
body .w-footer .w-footer-note{max-width:1120px;margin:8px auto 0;color:#b9c7da;font-size:13px}
@media(min-width:760px){.w-footer-links{grid-template-columns:repeat(4,minmax(0,1fr))}body .site-footer.w-footer{padding-inline:max(24px,calc((100vw - 1120px)/2))}}

/* ---- Shared parts ---- */
.w-wrap{width:auto;max-width:1120px;margin:0 auto;padding:0 var(--w-gutter)}
.w-narrow{max-width:760px}
.w-page main,.w-page #main{background:#fff}
.w-page .w-wrap{padding-top:18px;padding-bottom:40px}
.w-label{margin:0 0 6px;color:var(--w-blue);font-size:12px;font-weight:800;letter-spacing:.08em}
.w-page h1,.w-home h1{margin:0 0 10px;color:var(--w-ink);font-size:clamp(28px,7.4vw,46px);line-height:1.1;letter-spacing:-.02em}
.w-page h2,.w-home h2{font-size:clamp(23px,5.6vw,34px);line-height:1.15;margin:0 0 14px;color:var(--w-ink)}
.w-lead{margin:0 0 18px;color:var(--w-muted);font-size:17px;line-height:1.5;max-width:62ch}
.w-subhead{margin:30px 0 12px!important;font-size:22px!important}
.w-note{margin:22px 0;padding:12px 14px;border-left:4px solid var(--w-yellow);background:var(--w-paper);color:var(--w-ink);font-size:15px;line-height:1.5}
.w-more{margin:14px 0 0}.w-more .text-link{margin-right:16px}
.w-actions{display:grid;grid-template-columns:1fr;gap:10px;margin:0 0 16px}
@media(min-width:560px){.w-actions{display:flex;flex-wrap:wrap}.w-actions .w-btn{margin:0 10px 0 0}}
.w-btn{display:inline-flex;align-items:center;justify-content:center;min-height:50px;padding:12px 20px;border-radius:12px;border:2px solid transparent;
  font-size:16px;font-weight:800;line-height:1.2;text-align:center;text-decoration:none;cursor:pointer}
.w-btn span{margin-left:6px}
.w-btn-primary{background:var(--w-blue);color:#fff;box-shadow:0 3px 0 var(--w-blue-deep)}
.w-btn-primary:hover{background:var(--w-blue-deep);color:#fff}
.w-btn-ghost{background:#fff;color:var(--w-blue);border-color:var(--w-blue)}
.w-btn-ghost:hover{background:var(--w-blue-tint)}
.w-btn:focus-visible,.w-search-go:focus-visible,.w-chip:focus-visible{outline:3px solid var(--w-yellow);outline-offset:2px}

/* ---- Home: hero with the study lookup ---- */
.w-home #main{background:#fff}
.w-hero{background:var(--w-blue);color:#fff;padding:22px 0 30px;border-bottom:6px solid var(--w-yellow)}
.w-hero .w-kicker{display:inline-block;margin:0 0 12px;padding:5px 10px;border-radius:99px;background:rgba(255,255,255,.12);color:#fff;font-size:13px;font-weight:700}
.w-home .w-hero h1{color:#fff;font-size:clamp(30px,8.4vw,54px);max-width:16ch}
.w-hero .w-lead{color:#dbe7fb;font-size:16px}
.w-hero .w-actions{margin-top:16px}
.w-hero .w-btn-primary{background:var(--w-yellow);color:var(--w-ink);box-shadow:0 3px 0 var(--w-yellow-deep)}
.w-hero .w-btn-primary:hover{background:#ffdc66;color:var(--w-ink)}
.w-hero .w-btn-ghost{background:transparent;color:#fff;border-color:rgba(255,255,255,.7)}
.w-hero .w-btn-ghost:hover{background:rgba(255,255,255,.1)}
.w-trust{display:flex;flex-wrap:wrap;margin:6px 0 0;padding:0;list-style:none;color:#dbe7fb;font-size:14px}
.w-trust li{margin:4px 14px 0 0}.w-trust li::before{content:"\2713";margin-right:6px;color:var(--w-yellow);font-weight:800}

/* The search box: a label, one row of input and button, a hint, and instant results (lookup.js). */
.w-search{margin:0 0 6px}
.w-search-label{display:block;margin:0 0 8px;font-size:15px;font-weight:700;line-height:1.4}
.w-search-row{display:grid;grid-template-columns:minmax(0,1fr) auto;border-radius:12px;background:#fff;box-shadow:0 0 0 2px var(--w-yellow)}
.w-search-row input[type=search]{width:100%;min-height:52px;padding:0 14px;border:0;border-radius:12px 0 0 12px;background:#fff;color:var(--w-ink);font:inherit;font-size:17px;-webkit-appearance:none}
.w-search-row input[type=search]:focus{outline:3px solid var(--w-blue);outline-offset:-3px}
.w-search-go{min-height:52px;padding:0 18px;border:0;border-radius:0 12px 12px 0;background:var(--w-yellow);color:var(--w-ink);font:inherit;font-weight:800;cursor:pointer}
.w-search-hint{margin:8px 0 0;font-size:14px;color:var(--w-muted)}
.w-hero .w-search-hint,.w-hero .w-search-label{color:#e6eefb}
.w-search-results{margin-top:10px;padding:6px 14px;border-radius:12px;background:#fff;color:var(--w-ink);box-shadow:0 8px 24px rgba(13,27,42,.2)}
.w-search-results .w-results{margin:0}
.w-search-results .w-result{padding:10px 0}
.w-results-more{margin:6px 0 8px;font-weight:700}.w-results-more a{color:var(--w-blue)}
.w-results-none{margin:10px 0;color:var(--w-muted)}

/* The lookup page */
.w-search-page .w-search-row{box-shadow:0 0 0 2px var(--w-blue)}
.w-search-page .w-search-go{background:var(--w-blue);color:#fff}
.w-search-page .w-search-label{color:var(--w-ink)}
.w-chips{display:flex;flex-wrap:wrap;margin:12px 0 0;padding:0;list-style:none}
.w-chips li{margin:0 6px 6px 0}
.w-chip{display:inline-flex;align-items:center;min-height:40px;padding:0 12px;border:1px solid var(--w-line);border-radius:99px;background:#fff;
  color:var(--w-ink);font-size:13px;font-weight:700;text-decoration:none}
.w-chip[aria-pressed=true]{background:var(--w-blue);border-color:var(--w-blue);color:#fff}
.w-search-status{min-height:1.4em;margin:6px 0 0;color:var(--w-muted);font-size:14px}
.w-results{margin:10px 0 0;padding:0;list-style:none}
.w-result{padding:16px 0;border-bottom:1px solid var(--w-line)}
.w-result:last-child{border-bottom:0}
.w-result p{margin:0}
.w-result-topic{color:var(--w-blue);font-size:12px;font-weight:800;letter-spacing:.04em;text-transform:uppercase}
.w-result-q,.w-result-title{display:block;margin:4px 0 6px!important;color:var(--w-ink);font-size:17px;font-weight:800;line-height:1.35}
a.w-result-title{color:var(--w-blue)}
.w-result-a{padding:8px 10px;border-radius:8px;background:var(--w-green-tint);color:#135f31;font-weight:700;line-height:1.4}
.w-result-a span{font-weight:800}
.w-result-why{margin-top:8px!important;color:var(--w-muted);line-height:1.5}
.w-result-source{margin-top:8px}
.w-result-source summary{min-height:40px;display:flex;align-items:center;color:var(--w-blue);font-weight:700;cursor:pointer}
.w-result-source blockquote{margin:6px 0 0;padding:10px 12px;border-left:4px solid var(--w-blue);background:var(--w-paper);font-size:15px}
.w-result-source cite{display:block;margin-top:6px;color:var(--w-muted);font-size:13px;font-style:normal}
.w-result-links{display:flex;flex-wrap:wrap;margin-top:6px!important}
.w-result-links a{display:inline-flex;align-items:center;min-height:40px;margin-right:16px;color:var(--w-blue);font-weight:700;font-size:15px}
.w-next{margin:28px 0 0;padding:18px;border-radius:var(--w-radius);background:var(--w-blue-tint)}
.w-next-title{margin:0 0 12px;font-weight:800;font-size:18px}

/* ---- Home sections ---- */
.w-section{padding:30px 0}
.w-section+.w-section{border-top:1px solid #eef1f6}
.w-mode-grid,.w-tool-grid,.w-guide-grid{display:grid;grid-template-columns:1fr;gap:12px;margin:0;padding:0;list-style:none}
@media(min-width:640px){.w-mode-grid,.w-guide-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.w-tool-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(min-width:1000px){.w-mode-grid{grid-template-columns:repeat(4,minmax(0,1fr))}.w-guide-grid{grid-template-columns:repeat(3,minmax(0,1fr))}}
.w-mode a{display:grid;grid-template-columns:auto 1fr;grid-template-areas:"figure name" "figure text";gap:2px 14px;align-items:start;height:100%;padding:16px;
  border:1px solid var(--w-line);border-radius:var(--w-radius);background:#fff;color:var(--w-ink);text-decoration:none}
.w-mode a:hover{border-color:var(--w-blue);box-shadow:0 2px 0 var(--w-blue)}
.w-mode-figure{grid-area:figure;display:grid;place-items:center;width:56px;height:56px;border-radius:12px;background:var(--w-blue);color:#fff;font-size:22px;font-weight:800}
.w-mode-drill .w-mode-figure{background:var(--w-yellow);color:var(--w-ink)}
.w-mode-lessons .w-mode-figure{background:var(--w-green)}
.w-mode-lookup .w-mode-figure{background:#102b46;font-size:18px}
.w-mode-name{grid-area:name;font-size:18px;font-weight:800}
.w-mode-text{grid-area:text;color:var(--w-muted);font-size:15px;line-height:1.45}
.w-home .p-road-demo{display:block}
.w-home .p-road-demo .x-demo{max-width:720px;margin-top:8px}
.w-tool{display:grid;grid-template-columns:auto 1fr;gap:14px;align-items:center;padding:16px;border:1px solid var(--w-line);border-radius:var(--w-radius);
  color:var(--w-ink);text-decoration:none;background:var(--w-paper)}
.w-tool:hover{border-color:var(--w-blue)}
.w-tool strong{display:block;font-size:17px}
.w-tool span span{display:block;color:var(--w-muted);font-size:15px;line-height:1.4}
.w-tool-icon{display:grid;place-items:center;width:48px;height:48px;border-radius:10px;background:#fff;border:2px solid var(--w-ink);font-weight:800;font-size:20px;font-family:ui-monospace,Menlo,Consolas,monospace}
.w-guide{display:block;height:100%;padding:14px 16px;border:1px solid var(--w-line);border-left:5px solid var(--w-yellow);border-radius:12px;color:var(--w-ink);text-decoration:none;background:#fff}
.w-guide:hover{border-color:var(--w-blue);border-left-color:var(--w-yellow)}
.w-guide strong{display:block;font-size:17px}
.w-guide span{color:var(--w-muted);font-size:14px}
.w-lesson-list{display:grid;grid-template-columns:1fr;gap:0 24px;margin:20px 0 0;padding:0;list-style:none}
@media(min-width:760px){.w-lesson-list{grid-template-columns:repeat(2,minmax(0,1fr))}}
.w-lesson-list a{display:grid;grid-template-columns:34px 1fr auto;gap:10px;align-items:center;min-height:48px;padding:6px 0;border-bottom:1px solid #eef1f6;
  color:var(--w-ink);text-decoration:none}
.w-lesson-list a:hover .w-lesson-title{color:var(--w-blue);text-decoration:underline}
.w-lesson-num{color:var(--w-blue);font-weight:800;font-variant-numeric:tabular-nums}
.w-lesson-title{font-weight:700;line-height:1.3}
.w-lesson-count{min-width:30px;padding:2px 8px;border-radius:99px;background:var(--w-blue-tint);color:var(--w-blue);font-size:13px;font-weight:800;text-align:center}
.w-facts{display:grid;grid-template-columns:1fr;gap:10px;margin:0 0 16px;padding:0;list-style:none}
@media(min-width:640px){.w-facts{grid-template-columns:repeat(3,minmax(0,1fr))}}
.w-facts li{display:grid;grid-template-columns:auto 1fr;gap:12px;align-items:center;padding:12px 14px;border-radius:12px;background:var(--w-paper)}
.w-facts strong{color:var(--w-blue);font-size:26px;font-weight:800}
.w-facts span{font-size:15px;line-height:1.4}

/* ---- Lessons ---- */
.w-lesson-cards{display:grid;grid-template-columns:1fr;gap:10px;margin:18px 0 0;padding:0;list-style:none}
@media(min-width:760px){.w-lesson-cards{grid-template-columns:repeat(2,minmax(0,1fr))}}
.w-lesson-card{display:grid;grid-template-columns:44px 1fr;gap:12px;height:100%;padding:14px;border:1px solid var(--w-line);border-radius:var(--w-radius);color:var(--w-ink);text-decoration:none;background:#fff}
.w-lesson-card:hover{border-color:var(--w-blue)}
.w-lesson-card .w-lesson-num{display:grid;place-items:center;width:44px;height:44px;border-radius:10px;background:var(--w-blue-tint)}
.w-lesson-body strong{display:block;font-size:17px;line-height:1.3}
.w-lesson-body span{display:block;margin:4px 0;color:var(--w-muted);font-size:15px;line-height:1.45}
.w-lesson-body em{color:var(--w-blue);font-style:normal;font-size:13px;font-weight:800}
.w-lesson h1{margin-top:4px}
.w-rule{margin:0 0 14px;padding:16px;border:1px solid var(--w-line);border-radius:var(--w-radius);background:#fff}
.w-rule h3{margin:0 0 8px;font-size:19px}
.w-rule p{margin:0 0 8px;line-height:1.6}
.w-rule-source{color:var(--w-muted);font-size:14px}
.w-rule-source span{font-weight:800;color:var(--w-ink)}
.w-rule-source a{color:var(--w-blue)}
.w-rule-quotes summary{display:flex;align-items:center;min-height:44px;color:var(--w-blue);font-weight:700;cursor:pointer}
.w-rule-quotes .ex-quote,.w-sample .ex-quote{margin:8px 0;padding:10px 12px;border-left:4px solid var(--w-blue);background:var(--w-paper);font-size:15px}
.w-rule-quotes .ex-quote p,.w-sample .ex-quote p{margin:0}
.w-rule-quotes cite,.w-sample cite{display:block;margin-top:6px;color:var(--w-muted);font-size:13px;font-style:normal}
.w-remember{margin:18px 0;padding:16px;border-radius:var(--w-radius);background:var(--w-blue);color:#fff}
.w-remember h2{margin:0 0 10px!important;color:#fff!important;font-size:20px!important}
.w-remember ul{margin:0;padding:0;list-style:none}
.w-remember li{display:grid;grid-template-columns:1fr;gap:2px;padding:8px 0;border-top:1px solid rgba(255,255,255,.2)}
.w-remember strong{color:var(--w-yellow)}
@media(min-width:640px){.w-remember li{grid-template-columns:1fr 1fr;gap:16px}}
.w-samples{margin:0;padding:0;list-style:none}
.w-sample{margin:0 0 14px;padding:16px;border:1px solid var(--w-line);border-radius:var(--w-radius)}
.w-sample-q{margin:0 0 8px;font-weight:800;font-size:17px;line-height:1.4}
.w-sample-options{margin:0 0 10px;padding-left:22px}
.w-sample-options li{margin:4px 0;line-height:1.4}
.w-sample-options li.is-answer{color:#135f31;font-weight:700}
.w-sample-mark{font-size:13px}
.w-sample-why{margin:0 0 8px;color:var(--w-muted);line-height:1.5}
.w-all-lesson-qs{margin:14px 0 0;border:1px solid var(--w-line);border-radius:var(--w-radius);background:var(--w-paper)}
.w-all-lesson-qs>summary{display:flex;align-items:center;min-height:50px;padding:0 16px;color:var(--w-blue);font-weight:800;cursor:pointer}
.w-all-lesson-qs>ol{padding:0 12px 4px}
.w-all-lesson-qs .w-sample{background:#fff}
.w-pager{display:grid;grid-template-columns:1fr;gap:10px;margin:24px 0 0}
@media(min-width:640px){.w-pager{grid-template-columns:1fr 1fr}.w-pager-next{grid-column:2;text-align:right}}
.w-pager a{display:block;padding:12px 14px;border:1px solid var(--w-line);border-radius:12px;color:var(--w-ink);text-decoration:none}
.w-pager a:hover{border-color:var(--w-blue)}
.w-pager small{display:block;color:var(--w-muted);font-size:13px;font-weight:700}
.w-pager span{font-weight:800}

/* ---- Plate-ending checker (explainer.js plate()) ---- */
.w-plate{margin:20px 0;padding:16px;border:2px solid var(--w-ink);border-radius:var(--w-radius);background:#fff}
.w-plate .ex-tool-title{margin:0 0 10px;font-size:20px}
.w-plate .ex-label{margin:12px 0 6px;font-weight:800;font-size:15px}
.w-plate-digits{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:6px}
@media(min-width:560px){.w-plate-digits{grid-template-columns:repeat(10,minmax(0,1fr))}}
.w-plate-digit{min-height:44px;border:2px solid var(--w-line);border-radius:10px;background:var(--w-paper);color:var(--w-ink);font:inherit;font-size:18px;font-weight:800;
  font-family:ui-monospace,Menlo,Consolas,monospace;cursor:pointer}
.w-plate-digit[aria-pressed=true]{background:var(--w-yellow);border-color:var(--w-ink)}
.w-plate-digit:disabled{cursor:default;opacity:.65}
.w-plate-result{min-height:1.5em;margin:14px 0 0;padding:0;font-weight:800;font-size:17px;line-height:1.4;color:var(--w-blue)}
.w-plate.is-live .w-plate-result{padding:12px;border-radius:10px;background:var(--w-blue-tint)}
.w-plate-tables{display:grid;grid-template-columns:1fr;gap:12px;margin:14px 0 0}
@media(min-width:640px){.w-plate-tables{grid-template-columns:1fr 1fr}}
.w-plate .ex-table{width:100%;border-collapse:collapse;font-size:15px}
.w-plate .ex-table th,.w-plate .ex-table td{padding:6px 8px;border-bottom:1px solid var(--w-line);text-align:left}
.w-plate-note,.w-plate-source{margin:12px 0 0;color:var(--w-muted);font-size:14px;line-height:1.5}

/* ---- Advertising and partner links (app/monetization.py); nothing of this renders while they are off ---- */
.w-ad{max-width:760px;margin:24px auto;padding:0 var(--w-gutter);text-align:center}
.w-ad-label{margin:0 0 4px;color:#6b7280;font-size:11px;font-weight:700;letter-spacing:.08em;text-transform:uppercase}
.w-ad-unit{display:block;min-height:100px;max-height:320px;overflow:hidden}
.w-ad-unit[data-ad-status=unfilled]{display:none!important}
.w-ad-study{margin:16px 0;padding:0}
.w-partner{margin:24px 0;padding:16px;border:1px solid var(--w-line);border-radius:var(--w-radius);background:var(--w-paper)}
.w-partner-badge{display:inline-block;margin:0 0 8px;padding:3px 8px;border-radius:6px;background:#fff;border:1px solid var(--w-line);color:var(--w-muted);font-size:12px;font-weight:800;letter-spacing:.04em;text-transform:uppercase}
.w-partner-title{margin:0 0 4px;font-weight:800;font-size:17px}
.w-partner-text{margin:0 0 10px;line-height:1.5}
.w-partner-link{display:inline-flex;align-items:center;min-height:44px;color:var(--w-blue);font-weight:800}
.w-partner-note{margin:8px 0 0;color:var(--w-muted);font-size:13px;line-height:1.45}

/* ---- Study workspace: five parts in the mode bar, the drill picked out by a link ---- */
.study-modes.is-five{grid-template-columns:repeat(5,minmax(0,1fr))}
.e-card.is-selected{box-shadow:0 0 0 3px var(--w-yellow)}
.e-setting{color:var(--w-muted)}
.x-result-next{display:grid;grid-template-columns:1fr;gap:10px;margin:18px 0}
.x-result-next .button,.x-result-next .text-link{justify-content:center}
@media(min-width:560px){.x-result-next{grid-template-columns:auto auto 1fr;align-items:center}.x-result-next .small-copy{grid-column:1/-1}}
.result-priorities a{color:var(--w-blue);font-weight:700}
.w-hero .w-search,.w-hero .w-lead{max-width:760px}
