/* ============================================================
   CodeWithSQL — shared external stylesheet (cws-ux.css)
   Loaded on every page after the inline design system (inc_cws_styles.php).
   Uses the established design tokens of that system (blue #2563EB, ink #0F1B33,
   muted #5B6B85, border #E6EBF2, soft #EFF4FF / #F4F8FF, Plus Jakarta Sans).
   Sections: 1 font · 2 accessibility · 3 navigation · 4 search · 5 lessons
   (hero, practice links, dialects) · 6 author + editorial method · 7 mentorship ·
   8 responsive tables/code · 9 contrast fixes
   ============================================================ */

.cws {
	--cws-blue: #2563EB;
	--cws-blue-dark: #1c4fd8;
	--cws-ink: #0F1B33;
	--cws-ink-2: #334063;
	--cws-muted: #5B6B85;
	--cws-border: #E6EBF2;
	--cws-soft: #EFF4FF;
	--cws-soft-2: #F4F8FF;
	--cws-radius: 16px;
}

/* ---------- 1. FONT: self-hosted Plus Jakarta Sans (variable, SIL OFL 1.1) ---------- */
@font-face {
	font-family: 'Plus Jakarta Sans';
	font-style: normal;
	font-weight: 200 800;
	font-display: swap;
	src: url('fonts/PlusJakartaSans-latin.woff2') format('woff2');
	unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
	font-family: 'Plus Jakarta Sans';
	font-style: normal;
	font-weight: 200 800;
	font-display: swap;
	src: url('fonts/PlusJakartaSans-latin-ext.woff2') format('woff2');
	unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* ---------- 2. ACCESSIBILITY ---------- */
.cws-sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.cws-skip { position: absolute; left: 16px; top: -60px; z-index: 100; background: var(--cws-ink); color: #fff !important; padding: 10px 16px; border-radius: 8px; font-weight: 700; font-size: 14px; }
.cws-skip:focus { top: 12px; }
.cws main:focus { outline: none; }
.cws a:focus-visible, .cws button:focus-visible, .cws input:focus-visible, .cws select:focus-visible,
.cws textarea:focus-visible, .cws summary:focus-visible, .cws [tabindex]:focus-visible {
	outline: 3px solid var(--cws-blue); outline-offset: 2px; border-radius: 6px;
}
/* links inside running text are underlined so they are not identified by colour alone */
.cws .lesson-block-content p a, .cws .lesson-block-content li a, .cws .cws-prose p a, .cws .pil-prose p a,
.cws .pil-article p a, .cws .callout p a, .cws .cws-foot-bottom a, .cws .dir-article p a, .cws .cws-author-body a {
	text-decoration: underline; text-underline-offset: 2px; text-decoration-thickness: 1px;
}
/* heading levels corrected in markup (TOC h2, takeaways h3) keep their former look */
.cws .page-toc .page-toc-title { font-size: 0.9rem; font-weight: 700; color: #06283D; margin: 0 0 12px; display: flex; align-items: center; gap: 8px; letter-spacing: normal; }
.cws .takeaways .takeaways-title { font-size: 0.9rem; font-weight: 700; color: #06283D; margin: 0 0 12px; display: flex; align-items: center; gap: 8px; }
.cws .fn-toc-title, .cws .tool-procon .tool-procon-title { font: inherit; }

/* ---------- 3. NAVIGATION ---------- */
.cws-nav { justify-content: flex-start; gap: 8px; }
.cws-navlinks { margin-left: auto; }
.cws-search-btn { order: 2; display: inline-flex; align-items: center; gap: 8px; color: #3A4761; font-weight: 600; font-size: 15px; padding: 9px 12px; border-radius: 9px; border: 1px solid var(--cws-border); background: #fff; margin-left: 10px; white-space: nowrap; }
.cws-search-btn:hover, .cws-search-btn[aria-expanded="true"] { color: var(--cws-blue); background: var(--cws-soft); border-color: #cddcf7; }
.cws-burger { order: 3; }
.cws-navlinks { order: 1; }
@media (max-width: 1279px) {
	.cws-search-btn-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
	.cws-search-btn { padding: 9px 10px; }
	.cws-navlinks a { padding: 8px 11px; }
}
/* Below 1100px the full link row no longer fits (it measured 955px wide at 768px), so the
   menu button takes over; previously this only happened below 768px. */
@media (max-width: 1100px) {
	.cws-nav { padding: 16px 32px; }
	.cws-search-btn { margin-left: auto; }
	.cws-burger { display: inline-flex; margin-left: 4px; }
	.cws-navlinks { position: absolute; top: 100%; left: 0; right: 0; flex-direction: column; align-items: stretch; gap: 4px; background: #fff; padding: 12px 16px 18px; box-shadow: 0 12px 30px rgba(20,50,120,0.12); border-top: 1px solid #EEF2F7; display: none; z-index: 40; margin-left: 0; }
	.cws-navlinks.open { display: flex; }
	.cws-navlinks a { padding: 12px 14px; }
	.cws-navlinks a.cws-mentor { margin-left: 0; justify-content: center; margin-top: 6px; }
	.cws-dd { width: 100%; }
	.cws-dd-btn { width: 100%; justify-content: space-between; padding: 12px 14px; font-size: 15px; }
	.cws-dd-menu { position: static; box-shadow: none; border: none; padding: 0 0 4px 12px; min-width: 0; }
}
@media (max-width: 767px) {
	.cws-nav { padding: 14px 16px; }
	.cws-brand { font-size: 18px; }
}
/* touch targets: menu button and search button are at least 44px */
.cws-burger, .cws-search-btn { min-height: 44px; min-width: 44px; justify-content: center; }

/* ---------- 4. SEARCH ---------- */
.cws-search-panel { border-top: 1px solid #EEF2F7; background: #fff; box-shadow: 0 14px 30px rgba(20,50,120,0.08); position: relative; z-index: 45; }
.cws-search-panel[hidden] { display: none; }
.cws-search-panel .cws-search-form { max-width: 820px; margin: 0 auto; padding: 16px 32px 18px; }
.cws-search-form { position: relative; display: flex; gap: 10px; align-items: stretch; }
.cws-search-input { flex: 1; min-width: 0; padding: 13px 16px; border: 1px solid #D7DEEA; border-radius: 10px; font-size: 16px; color: var(--cws-ink); background: #fff; font-family: inherit; }
.cws-search-input:focus { outline: none; border-color: var(--cws-blue); box-shadow: 0 0 0 3px rgba(37,99,235,0.15); }
.cws-search-submit { padding: 0 20px; border-radius: 10px; border: none; background: linear-gradient(135deg,#2f7bf6,#1c4fd8); color: #fff; font-weight: 700; font-size: 15px; font-family: inherit; cursor: pointer; min-height: 46px; }
.cws-search-list { position: absolute; left: 0; right: 0; top: calc(100% + 4px); background: #fff; border: 1px solid var(--cws-border); border-radius: 12px; box-shadow: 0 18px 44px rgba(20,50,120,0.16); max-height: min(70vh, 520px); overflow-y: auto; padding: 6px; z-index: 60; text-align: left; }
.cws-search-panel .cws-search-list { left: 32px; right: 32px; top: calc(100% - 10px); }
.cws-search-list[hidden] { display: none; }
.cws-sugg-label { font-size: 11.5px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--cws-muted); padding: 10px 10px 4px; }
.cws-sugg-opt { display: flex; flex-direction: column; gap: 2px; padding: 9px 10px; border-radius: 8px; cursor: pointer; }
.cws-sugg-opt[aria-selected="true"], .cws-sugg-opt:hover { background: var(--cws-soft); }
.cws-sugg-opt[aria-selected="true"] { box-shadow: inset 3px 0 0 var(--cws-blue); }
.cws-sugg-title { font-size: 14.5px; font-weight: 600; color: var(--cws-ink); }
.cws-sugg-meta { font-size: 12.5px; color: var(--cws-muted); }
.cws-sugg-all { margin-top: 4px; border-top: 1px solid #F0F3F8; border-radius: 0 0 8px 8px; font-size: 14px; font-weight: 700; color: var(--cws-blue); }
.cws-sugg-empty { padding: 12px 10px; font-size: 14px; color: var(--cws-muted); }
.cws-sugg-loading { font-style: italic; }
.cws-sugg-error { color: #8a3b12; background: #fff7ed; border-radius: 8px; }

/* search results page */
.srch-hero .srch-hero-inner { padding-top: 52px; padding-bottom: 56px; }
.cws .srch-hero .srch-title { font-size: 40px; }
.srch-hero .cws-search-form { max-width: 760px; margin-top: 26px; }
.srch-hero .cws-search-input { border-color: transparent; }
.srch-hero .cws-search-submit { background: #fff; color: #123a86; }
.srch-body { max-width: 980px; margin: 0 auto; padding: 44px 56px 72px; }
.srch-summary { font-size: 15.5px; color: var(--cws-ink-2); margin: 0 0 18px; }
.srch-notice { background: #fffbeb; border: 1px solid #fde68a; color: #7c4a03; border-radius: 12px; padding: 13px 16px; font-size: 14.5px; margin: 0 0 18px; }
.srch-notice.err { background: #fdecec; border-color: #f2b8b8; color: #a42a2a; }
.srch-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 28px; padding: 0; list-style: none; }
.srch-chips a { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--cws-border); color: var(--cws-ink-2); border-radius: 100px; padding: 7px 13px; font-size: 13.5px; font-weight: 600; }
.srch-chips a:hover { border-color: #cddcf7; color: var(--cws-blue); }
.srch-chips a[aria-current="true"] { background: var(--cws-blue); border-color: var(--cws-blue); color: #fff; }
.srch-chips .n { font-weight: 700; opacity: .8; }
.srch-group { margin: 0 0 34px; }
.srch-group h2 { font-size: 19px; font-weight: 800; margin: 0 0 12px; display: flex; align-items: baseline; gap: 10px; }
.srch-group h2 .n { font-size: 13.5px; color: var(--cws-muted); font-weight: 600; }
.srch-list { list-style: none; margin: 0; padding: 0; border: 1px solid var(--cws-border); border-radius: var(--cws-radius); overflow: hidden; }
.srch-list li { border-top: 1px solid #F0F3F8; }
.srch-list li:first-child { border-top: none; }
.srch-list a { display: block; padding: 14px 18px; color: inherit; }
.srch-list a:hover { background: var(--cws-soft-2); }
.srch-list .t { display: block; font-size: 16px; font-weight: 700; color: var(--cws-blue); line-height: 1.35; }
.srch-list .m { display: block; font-size: 13px; color: var(--cws-muted); margin-top: 3px; }
.srch-list .d { display: block; font-size: 14px; color: #42506e; margin-top: 5px; line-height: 1.55; }
.srch-list mark { background: #fff3bf; color: inherit; padding: 0 1px; border-radius: 2px; }
.srch-more { display: inline-block; margin-top: 10px; font-weight: 700; font-size: 14.5px; color: var(--cws-blue); }
.srch-help { background: var(--cws-soft-2); border: 1px solid #E4ECFA; border-radius: var(--cws-radius); padding: 22px 24px; }
.srch-help h2 { font-size: 18px; margin: 0 0 10px; }
.srch-help ul { margin: 0 0 14px; padding-left: 20px; color: #42506e; font-size: 14.5px; line-height: 1.7; }
.srch-help .srch-hubs { display: flex; flex-wrap: wrap; gap: 8px; }
.srch-help .srch-hubs a { border: 1px solid #cddcf7; background: #fff; color: var(--cws-blue); border-radius: 9px; padding: 8px 12px; font-weight: 600; font-size: 14px; }
@media (max-width: 767px) {
	.cws-search-panel .cws-search-form { padding: 12px 16px 14px; }
	.cws-search-panel .cws-search-list { left: 16px; right: 16px; }
	.cws-search-submit { padding: 0 14px; }
	.srch-body { padding: 30px 16px 56px; }
}

/* ---------- 5. LESSONS ---------- */
/* hero (was inline styles in inc_cws_lesson_header.php; now responsive) */
.lh-hero { background: linear-gradient(115deg,#1e5fe0 0%,#123a86 52%,#0a1a38 100%); position: relative; overflow: hidden; }
.lh-hero::before { content: ''; position: absolute; top: -120px; right: -80px; width: 520px; height: 520px; border-radius: 50%; background: radial-gradient(circle,rgba(90,150,255,0.35),transparent 70%); }
.lh-inner { max-width: 1280px; margin: 0 auto; padding: 26px 56px 40px; position: relative; }
.lh-crumb { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; font-size: 14.5px; font-weight: 600; margin: 0 0 22px; padding: 0; list-style: none; }
.lh-crumb li { display: inline-flex; align-items: center; gap: 10px; }
.cws .lh-crumb a { color: #c3d3ef; }
.cws .lh-crumb a:hover { color: #fff; }
.cws .lh-crumb [aria-current] { color: #fff; font-weight: 700; }
.lh-crumb svg { opacity: .5; flex-shrink: 0; }
.lh-title { font-size: 44px; font-weight: 800; letter-spacing: -0.03em; color: #fff; margin: 0 0 12px; line-height: 1.12; }
.lh-sub { font-size: 17px; line-height: 1.6; color: #c3d3ef; margin: 0 0 20px; max-width: 840px; }
.lh-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 26px; color: #bcd0f2; font-size: 14.5px; font-weight: 500; }
.lh-meta span { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
@media (max-width: 991px) { .lh-inner { padding: 24px 40px 36px; } .lh-title { font-size: 36px; } }
@media (max-width: 767px) { .lh-inner { padding: 20px 16px 30px; } .lh-title { font-size: 30px; } .lh-sub { font-size: 16px; } .lh-crumb { font-size: 13.5px; } }

/* Key takeaways: the list items were flex rows, so every text run and inline <code> became a
   separate flex item that could not wrap (measured overflow to 482px at 390px). Plain text flow
   with the icon positioned in the gutter instead. */
.cws .takeaways ul li { display: block; position: relative; padding-left: 20px; }
.cws .takeaways ul li > .bi:first-child { position: absolute; left: 0; top: 9px; }
.cws .takeaways ul li code { overflow-wrap: anywhere; }
/* "All chapters" rows in the lesson footer: allow long chapter names to wrap on phones */
.cws .lf-chrow { flex-wrap: wrap; row-gap: 2px; }
.cws .lf-chrow > span { flex-shrink: 1 !important; min-width: 0; }

/* lesson body spacing on small screens (legacy bootstrap container keeps 12px gutters) */
@media (max-width: 767px) {
	.cws .lesson-content-section { padding-top: 24px; }
	.cws .lesson-block { padding: 22px 16px; }
}

/* Practise this chapter (data/lesson_links.php) */
.lx-panel { background: #fff; border: 1px solid var(--cws-border); border-radius: 18px; box-shadow: 0 8px 26px rgba(20,50,120,0.05); padding: 26px 28px 20px; margin: 0 0 28px; }
.lx-head { display: flex; align-items: center; gap: 10px; font-size: 19px; font-weight: 800; margin: 0 0 4px; color: var(--cws-ink); }
.lx-sub { font-size: 14px; color: var(--cws-muted); margin: 0 0 16px; }
.lx-cols { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.lx-col h3 { font-size: 13px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--cws-muted); margin: 0 0 8px; }
.lx-col ul { list-style: none; margin: 0; padding: 0; }
.lx-col li { margin: 0; border-top: 1px solid #F0F3F8; }
.lx-col li:first-child { border-top: none; }
.cws .lx-col a { display: block; padding: 9px 0; font-size: 14.5px; font-weight: 600; color: var(--cws-blue); line-height: 1.4; }
.cws .lx-col a:hover { text-decoration: underline; }
.lx-col .lx-tag { display: block; font-size: 12.5px; font-weight: 500; color: var(--cws-muted); margin-top: 2px; }
@media (max-width: 991px) { .lx-cols { grid-template-columns: 1fr 1fr; } }
@media (max-width: 640px) { .lx-cols { grid-template-columns: 1fr; } .lx-panel { padding: 22px 18px 14px; } }

/* SQL dialect panel + per-example labels (data/lesson_dialects.php) */
.dx-panel { background: var(--cws-soft-2); border: 1px solid #E4ECFA; border-radius: 14px; padding: 18px 22px; margin: 0 0 30px; }
.dx-panel h2 { font-size: 16px; font-weight: 800; margin: 0 0 8px; color: var(--cws-ink); display: flex; align-items: center; gap: 8px; }
.dx-panel p { font-size: 14.5px; color: #42506e; line-height: 1.65; margin: 0 0 10px; }
.dx-panel ul { margin: 0 0 10px; padding-left: 20px; }
.dx-panel li { font-size: 14.5px; color: #42506e; line-height: 1.65; margin-bottom: 4px; }
.dx-panel code { background: #fff; border: 1px solid var(--cws-border); border-radius: 5px; padding: 1px 5px; font-size: 0.9em; color: #1c3d8f; }
.dx-panel .dx-env { font-size: 13px; color: var(--cws-muted); margin: 0; }
.cws .dx-panel a { color: var(--cws-blue); font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }
.dx-panel details summary { cursor: pointer; font-weight: 700; color: var(--cws-blue); font-size: 14.5px; }
.dx-panel .dx-sources { margin: 0 0 12px; }
.dx-panel .dx-sources ul { margin: 8px 0 0; }
.dx-panel .dx-sources li { font-size: 13.5px; overflow-wrap: anywhere; }
.dx-panel .dx-stale { background: #fffbeb; border: 1px solid #fde68a; color: #7c4a03; border-radius: 10px; padding: 10px 14px; font-size: 14px; }
.dx-tags { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: -8px 0 16px; font-size: 12.5px; color: var(--cws-muted); }
.dx-tag { display: inline-flex; align-items: center; gap: 5px; border-radius: 100px; padding: 3px 10px; font-weight: 600; border: 1px solid; }
.dx-tag.dx-for { background: #fff; color: #1c3d8f; border-color: #cddcf7; }
.dx-tag.dx-ran { background: #ecfdf3; color: #0b6b3a; border-color: #b7ebc9; }
.dx-tag.dx-none { background: #f6f7f9; color: #4a5568; border-color: #e2e6ec; }
.dx-tags .dx-k { font-weight: 700; color: var(--cws-ink-2); }

/* ---------- 6. AUTHOR PANEL + EDITORIAL METHOD ---------- */
.cws-author { max-width: 860px; margin: 0 auto; padding: 8px 24px 48px; }
.cws-author-card { display: flex; gap: 18px; align-items: flex-start; border: 1px solid var(--cws-border); border-radius: 18px; padding: 24px 26px; background: #fff; box-shadow: 0 8px 26px rgba(20,50,120,0.05); }
.cws-author-av { width: 52px; height: 52px; border-radius: 50%; background: linear-gradient(135deg,#2f7bf6,#1c4fd8); color: #fff; font-weight: 800; font-size: 20px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.cws-author-head { font-size: 18px; font-weight: 800; margin: 2px 0 6px; color: var(--cws-ink); }
.cws-author-desc { font-size: 15px; color: #42506e; line-height: 1.65; margin: 0 0 8px; }
.cws-author-links, .cws-author-method { font-size: 14px; color: var(--cws-muted); margin: 0 0 4px; }
.cws-author-body a { color: var(--cws-blue); font-weight: 600; }
.cws-sec.cws-method-sec { max-width: 1160px; }
.cws-method-head { margin-bottom: 40px; }
.cws .cws-method-h2 { font-size: 32px; margin: 0; }
.cws-method { display: grid; grid-template-columns: repeat(2, 1fr); gap: 22px; }
.cws-method .cws-card h3 { font-size: 17px; }
.cws-method .cws-card p + p { margin-top: 10px; }
.cws-method .cws-card a { color: var(--cws-blue); font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }
.cws-method-note { max-width: 820px; margin: 22px auto 0; font-size: 14px; color: var(--cws-muted); text-align: center; line-height: 1.6; }
@media (max-width: 767px) { .cws-method { grid-template-columns: 1fr; } .cws-author { padding: 8px 16px 40px; } .cws-author-card { padding: 20px 18px; } }

/* ---------- 7. MENTORSHIP ---------- */
.mn-sec { padding-bottom: 0; }
.cws-sec.mn-sec:not(.narrow):not(.xnarrow) { max-width: 1160px; }
.mn-sec-top { padding-top: 24px; }
.mn-sec-head { margin-bottom: 32px; }
.cws .mn-h2 { margin: 0; }
.mn-enquiry { margin-top: 22px; }
.mn-ask { margin: 0 0 20px; padding-left: 22px; }
.mn-ask li { font-size: 15px; color: #42506e; line-height: 1.65; margin-bottom: 4px; }
.cws .mn-cta { font-size: 15px; }
.mn-small a { color: var(--cws-blue); font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }
.mn-facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; border: 1px solid var(--cws-border); border-radius: 18px; overflow: hidden; background: #fff; }
.mn-fact { padding: 22px 24px; border-right: 1px solid #F0F3F8; border-bottom: 1px solid #F0F3F8; }
.mn-fact:nth-child(3n) { border-right: none; }
.mn-fact:nth-last-child(-n+3) { border-bottom: none; }
.mn-fact dt { font-size: 12.5px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--cws-muted); margin: 0 0 6px; }
.mn-fact dd { margin: 0; font-size: 15px; color: var(--cws-ink-2); line-height: 1.6; }
.mn-fact dd a { color: var(--cws-blue); font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }
.mn-mentor { display: flex; gap: 20px; align-items: flex-start; border: 1px solid var(--cws-border); border-radius: 18px; padding: 26px 28px; background: #fff; }
.mn-mentor .av { width: 60px; height: 60px; border-radius: 50%; background: linear-gradient(135deg,#2f7bf6,#1c4fd8); color: #fff; font-weight: 800; font-size: 21px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.mn-mentor h3 { font-size: 19px; font-weight: 800; margin: 0 0 4px; }
.mn-mentor .rl { font-size: 14.5px; color: var(--cws-muted); margin: 0 0 10px; }
.mn-mentor p { font-size: 15px; color: #42506e; line-height: 1.65; margin: 0 0 8px; }
.mn-mentor a { color: var(--cws-blue); font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }
.mn-outcomes { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 12px 28px; }
.mn-outcomes li { display: flex; gap: 10px; align-items: flex-start; font-size: 15px; color: var(--cws-ink-2); line-height: 1.55; }
.mn-outcomes svg { flex-shrink: 0; margin-top: 2px; }
.mn-enquiry { border: 1.5px solid #cddcf7; background: var(--cws-soft-2); border-radius: 18px; padding: 28px 30px; }
.mn-enquiry h3 { font-size: 20px; font-weight: 800; margin: 0 0 10px; }
.mn-enquiry ol { margin: 0 0 18px; padding-left: 22px; }
.mn-enquiry li { font-size: 15px; color: #42506e; line-height: 1.65; margin-bottom: 6px; }
.mn-enquiry .mn-small { font-size: 13.5px; color: var(--cws-muted); margin: 14px 0 0; }
@media (max-width: 991px) { .mn-facts { grid-template-columns: 1fr 1fr; } .mn-fact:nth-child(3n) { border-right: 1px solid #F0F3F8; } .mn-fact:nth-child(2n) { border-right: none; } .mn-fact:nth-last-child(-n+3) { border-bottom: 1px solid #F0F3F8; } .mn-fact:nth-last-child(-n+2) { border-bottom: none; } }
@media (max-width: 640px) { .mn-facts { grid-template-columns: 1fr; } .mn-fact { border-right: none !important; border-bottom: 1px solid #F0F3F8 !important; } .mn-fact:last-child { border-bottom: none !important; } .mn-outcomes { grid-template-columns: 1fr; } .mn-mentor { flex-direction: column; padding: 22px 20px; } .mn-enquiry { padding: 22px 20px; } }

/* ---------- 10. CLOUD DATABASES SECTION (tpl-cloud-databases.php) ---------- */
.cws .cl-hero-inner { padding-top: 44px; padding-bottom: 48px; }
.cws .cws-hero .cl-title { font-size: 34px; letter-spacing: -0.03em; }
.cws .cl-lead { max-width: 760px; }
.cws .cl-crumb .cl-crumb-current { color: #e6eefc; }
.cws .cl-freshness { padding-top: 26px; }
.cws .cl-keypoints ul { margin: 6px 0 0; padding-left: 20px; }
.cws .cl-keypoints li { font-size: 15px; line-height: 1.65; color: #1a2540; margin-bottom: 6px; }
.cws .cl-table caption { caption-side: top; text-align: left; font-size: 13.5px; font-weight: 700; color: var(--cws-muted); padding: 0 0 8px; }
.cws .cl-table tbody th { font-weight: 700; color: var(--cws-ink); text-align: left; }
.cws .cl-price-note { background: var(--cws-soft-2); border: 1px solid #E4ECFA; border-radius: 10px; padding: 10px 14px; font-size: 14px; color: #42506e; }
.cws .cl-example { border: 1px solid var(--cws-border); border-radius: 14px; padding: 6px 20px 14px; margin: 18px 0; background: #fff; }
.cws .cl-example h3 { margin-top: 14px; }
.cws .cl-assume { margin: 0 0 10px; padding-left: 20px; }
.cws .cl-assume li { font-size: 14px; color: #42506e; margin-bottom: 3px; }
.cws .cl-total th, .cws .cl-total td { font-weight: 800; color: var(--cws-ink); background: var(--cws-soft-2); }
.cws .cl-list { columns: 2; column-gap: 28px; padding-left: 18px; margin: 0 0 18px; }
.cws .cl-list li { break-inside: avoid; margin-bottom: 7px; font-size: 15px; }
.cws .cl-list a { color: var(--cws-blue); font-weight: 600; }
@media (max-width: 767px) { .cws .cws-hero .cl-title { font-size: 28px; } .cws .cl-list { columns: 1; } .cws .cl-example { padding: 4px 14px 12px; } }

/* ---------- 11. RESEARCH PAGES: CODE BLOCKS + PRINTABLE CHEAT SHEETS (tpl-research.php) ---------- */
.cws .rl-code { margin: 14px 0 18px; }
.cws .rl-code figcaption { font-size: 12px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--cws-muted); margin: 0 0 6px; }
.cws .rl-pre { background: #0c1730; border: 1px solid rgba(255,255,255,0.08); border-radius: 12px; padding: 16px 18px; margin: 0; overflow-x: auto; white-space: pre; }
.cws .rl-pre code { background: none; padding: 0; color: #e6ecf7; font-size: 13.5px; line-height: 1.7; font-family: ui-monospace,'SF Mono',Menlo,Consolas,monospace; white-space: pre; }
.cws .rl-print { margin: 0 0 18px; }
.cws .rl-print-btn { color: var(--cws-blue); border-color: var(--cws-blue); }
@media print {
	.cws .cl-crumb, .cws .dir-kicker, .cws .cws-cta, .cws .dir-related, .cws .dir-toc, .cws .rl-print, .cws .cl-freshness { display: none; }
	.cws header.cws-hero { background: #fff; padding: 0; }
	.cws header.cws-hero .cl-title, .cws header.cws-hero .cl-lead { color: #000; }
	.cws .cws-nav, .cws .cws-footer, .cws nav, .cws footer { display: none; }
	.cws .dir-article { max-width: none; }
	.cws .cmp-table th, .cws .cmp-table td { padding: 4px 8px; font-size: 11pt; }
	.cws .rl-pre { background: #fff; border: 1px solid #999; }
	.cws .rl-pre code { color: #000; }
	.cws .dir-article h2 { break-after: avoid; }
	.cws .cmp-tablewrap { break-inside: avoid; }
}

/* homepage resource cards added after the legacy inline-styled ones (tpl-home.php) */
.cws a.cws-card-link { display: block; text-decoration: none; color: inherit; }
.cws .cws-card-cta { color: #2563EB; font-weight: 700; font-size: 14px; }

/* ---------- 12. SQL PLAYGROUND PANEL (inc_cws_playground_tool.php, cws-playground.js) ---------- */
.cws .pg-tool { background: var(--cws-soft-2); border-bottom: 1px solid var(--cws-border); padding: 26px 0 30px; }
.cws .pg-inner { max-width: 1100px; margin: 0 auto; padding: 0 24px; }
.cws .pg-notice { background: #fff; border: 1px solid #E4ECFA; border-left: 4px solid var(--cws-blue); border-radius: 10px; padding: 10px 14px; font-size: 14px; line-height: 1.6; color: #42506e; margin: 0 0 14px; }
.cws .pg-examples { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0 0 12px; }
.cws .pg-examples-lbl { font-size: 13px; font-weight: 700; color: var(--cws-muted); }
.cws .pg-chip { border: 1px solid var(--cws-border); background: #fff; color: var(--cws-ink); border-radius: 999px; padding: 6px 12px; font-size: 13px; font-weight: 600; cursor: pointer; min-height: 36px; }
.cws .pg-chip:hover, .cws .pg-chip:focus-visible { border-color: var(--cws-blue); color: var(--cws-blue); }
.cws .pg-lbl { display: block; font-size: 13px; font-weight: 700; color: var(--cws-ink); margin: 6px 0 6px; }
.cws .pg-hint { font-weight: 500; color: var(--cws-muted); margin-left: 6px; }
.cws .pg-editor { display: block; width: 100%; box-sizing: border-box; min-height: 180px; resize: vertical; background: #0c1730; color: #e6ecf7; border: 1px solid #0c1730; border-radius: 12px; padding: 14px 16px; font: 14px/1.65 ui-monospace,'SF Mono',Menlo,Consolas,monospace; tab-size: 4; }
.cws .pg-editor:focus { outline: 3px solid rgba(46,108,246,0.45); outline-offset: 2px; }
.cws .pg-output { min-height: 220px; }
.cws .pg-actions, .cws .pg-opts { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 12px 0; }
.cws .pg-opts label, .cws .pg-dataset { font-size: 13px; font-weight: 700; color: var(--cws-ink); display: inline-flex; gap: 6px; align-items: center; }
.cws .pg-select { border: 1px solid var(--cws-border); border-radius: 8px; padding: 6px 8px; font-size: 13.5px; background: #fff; color: var(--cws-ink); min-height: 36px; }
.cws .pg-run { min-height: 40px; padding: 8px 22px; border: 0; cursor: pointer; }
.cws .pg-btn { border: 1px solid var(--cws-border); background: #fff; color: var(--cws-ink); border-radius: 10px; padding: 8px 14px; font-size: 13.5px; font-weight: 600; cursor: pointer; min-height: 40px; display: inline-flex; align-items: center; }
.cws .pg-btn:hover, .cws .pg-btn:focus-within, .cws .pg-btn:focus-visible { border-color: var(--cws-blue); color: var(--cws-blue); }
.cws .pg-btn[hidden] { display: none; }
.cws .pg-file input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.cws .pg-file { position: relative; }
.cws .pg-dataset { margin-left: auto; }
.cws .pg-status { min-height: 22px; font-size: 14px; color: var(--cws-muted); margin: 4px 0 8px; }
.cws .pg-status.pg-ok { color: #1d6b3f; }
.cws .pg-status.pg-error { color: #b4233a; font-weight: 600; white-space: pre-wrap; }
.cws .pg-tablewrap { max-width: 100%; overflow-x: auto; margin: 0 0 14px; background: #fff; border: 1px solid var(--cws-border); border-radius: 12px; }
.cws .pg-table { border-collapse: collapse; width: 100%; font-size: 13.5px; }
.cws .pg-table caption { caption-side: top; text-align: left; padding: 8px 12px; font-size: 12.5px; font-weight: 700; color: var(--cws-muted); }
.cws .pg-table th, .cws .pg-table td { border-top: 1px solid var(--cws-border); padding: 7px 12px; text-align: left; white-space: nowrap; font-family: ui-monospace,'SF Mono',Menlo,Consolas,monospace; }
.cws .pg-table th { background: var(--cws-soft-2); font-weight: 700; color: var(--cws-ink); }
.cws .pg-null { color: var(--cws-muted); font-style: italic; }
.cws .pg-json { background: #fff; border: 1px solid var(--cws-border); border-radius: 12px; padding: 12px 14px; font-size: 13px; line-height: 1.6; max-height: 520px; overflow: auto; color: var(--cws-ink); }
.cws .pg-schema { margin-top: 6px; font-size: 14px; }
.cws .pg-schema summary { cursor: pointer; font-weight: 700; color: var(--cws-ink); min-height: 32px; }
.cws .pg-schema-body p { margin: 6px 0; font-family: ui-monospace,'SF Mono',Menlo,Consolas,monospace; font-size: 13px; color: #42506e; overflow-wrap: anywhere; }
.cws .pg-muted { color: var(--cws-muted); }
@media (max-width: 767px) { .cws .pg-inner { padding: 0 16px; } .cws .pg-dataset { margin-left: 0; } .cws .pg-editor { font-size: 13px; } }

/* ---------- 8. RESPONSIVE TABLES AND CODE ---------- */
/* Tables wider than a phone screen scroll inside their own box instead of widening the page
   (measured: lesson tables reached 427-506px and the function/blog tables 415-645px at 390px). */
@media (max-width: 767px) {
	.cws table { display: block; max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
	.cws pre, .cws .sql-example, .cws .sql-output { max-width: 100%; overflow-x: auto; }
	.cws .sql-example { padding: 16px 16px; }
	.cws .cws-hero h1 { overflow-wrap: anywhere; }
	/* exercise hub rows: the topic chip moves under the title instead of pushing past the edge */
	.cws .ex-row { flex-wrap: wrap; }
	.cws .ex-row .mid { min-width: 0; flex-basis: calc(100% - 60px); }
	.cws .ex-row .topic { margin-left: 44px; }
}
.cws .ex-row .num { color: var(--cws-muted); }
.cws [data-cws-scroll]:focus-visible { outline: 3px solid var(--cws-blue); outline-offset: 2px; }

/* ---------- 9. CONTRAST FIXES (WCAG AA 4.5:1 for small text) ---------- */
/* #8A97AD / #9aa6bd / #7A88A3 / #bbb / #888 on white measured 1.9-3.6:1; the design
   system's muted token #5B6B85 measures above 5:1 on white and on #F4F8FF. */
.cws .cws-brand .ext, .cws .dir-checked, .cws .ex-reveal-try, .cws .ex-nav .dir, .cws .fn-output-label,
.cws .tool-spec .k, .cws .dir-article > .k, .cws .lesson-block-header .back-to-top, .cws .sql-output-label { color: var(--cws-muted); }
.cws .lesson-block-header .back-to-top:hover { color: var(--cws-blue); }
/* muted text that replaces low-contrast colours removed from legacy inline styles */
.cws .cws-muted { color: var(--cws-muted); }
.cws .fn-mistake .fn-code-label { color: #b4233a; }
.cws .tool-spec .dir-stars { color: #8a5300; }
.cws .cmp-table th.b, .cws .cmp-strengths .cmp-col h3 { color: #0b6e40; }
.cws .callout p code, .cws .pil-note p code { color: #a3246a; }
.cws .pil-code .pil-code-label, .cws .pil-code .cm { color: #8f9dbd; }
.cws .cws-foot-bottom .made, .cws .cws-foot-bottom .made a { color: #9aa8c4; }
