/* Cleared to Study: phone and installed-app layout.
   Desktop is untouched; everything here applies at 48rem and below. */

.app-tabs,
.app-sheet { display: none; }

@media (max-width: 48rem) {
	:root { --tabs-h: calc(3.9rem + env(safe-area-inset-bottom, 0px)); }
	html { -webkit-tap-highlight-color: transparent; scroll-padding-bottom: var(--tabs-h); }
	body { padding-bottom: var(--tabs-h); }
	a, button, label, summary, select { touch-action: manipulation; }
	html.sheet-open { overflow: hidden; }

	/* The tip banner takes a quarter of the screen on a phone. The tip link stays in the
	   footer and in the Study menu. */
	.ppk-banner { display: none; }

	/* Header: brand only. Navigation moves to the bottom tab bar. */
	.site-top { padding-block: 0.75rem 0.55rem; gap: 0; }
	.site-top .brand { font-size: 1.3rem; }
	.site-nav { display: none; }

	/* Inside a certificate: one scrolling row of chips. */
	.site-sub { width: 100%; padding: 0 0 0.6rem; }
	.site-subnav { flex-wrap: nowrap; overflow-x: auto; gap: 0.4rem; padding: 0.55rem var(--gutter) 0.1rem; scrollbar-width: none; -webkit-overflow-scrolling: touch; align-items: center; border-top: 1px solid rgba(255, 255, 255, 0.18); }
	.site-subnav::-webkit-scrollbar { display: none; }
	.site-subnav .where { display: none; }
	.site-subnav a { flex: none; padding: 0.6rem 0.95rem; border: 1.5px solid rgba(255, 255, 255, 0.35); border-radius: 999px; font-size: 1rem; line-height: 1; white-space: nowrap; }
	.site-subnav a:hover { border-color: #fff; }
	.site-subnav a[aria-current='page'] { background: var(--sign-yellow); color: #0b1f3f; border-color: var(--sign-yellow); font-weight: 700; }

	/* Titles and breadcrumbs: get to the content. */
	.crumbs { padding-top: 0.2rem; font-size: 0.85rem; overflow-x: auto; white-space: nowrap; scrollbar-width: none; }
	.crumbs::-webkit-scrollbar { display: none; }
	.crumbs ol { flex-wrap: nowrap; }
	.crumbs li { flex: none; }
	.page-title { padding-block: 0.8rem 1.5rem !important; font-size: clamp(1.9rem, 8vw, 2.4rem) !important; line-height: 1.04; }
	.crumbs + .page-title { padding-top: 0.6rem !important; }
	.ppk-main { padding-block: 1.4rem 2.5rem; }

	/* Home hero */
	.hero { padding-block: 1.4rem 2.2rem; }
	.hero h1 { font-size: clamp(2.2rem, 10vw, 2.9rem); }
	.hero p { font-size: 1.1rem; margin-bottom: 1rem; }
	.hero .signs { display: grid; grid-template-columns: 1fr 1fr; gap: 0.6rem; margin-top: 1.2rem; }
	.hero .signs .sign { text-align: center; font-size: 1.1rem; padding: 0.85em 0.4em; }
	.hero .signs .sign:first-child { grid-column: 1 / -1; font-size: 1.25rem; }

	/* Bigger touch targets in lists and the footer */
	.site-foot a { display: inline-block; padding-block: 0.4rem; }
	.site-foot .cols { grid-template-columns: 1fr 1fr; gap: 1.4rem 1.2rem; }
	.site-foot .cols > div:first-child { grid-column: 1 / -1; }
	.site-foot .legal { font-size: 0.85rem; }

	/* Study screens: thumb-sized, with the main action always in reach. */
	.ppk-app button.sign, .ppk-app .sign { min-height: 3.1rem; }
	.ppk-app select { min-height: 3rem; font-size: 1.05rem; }
	.ppk-app .ctl--check input { width: 1.5rem; height: 1.5rem; }
	.pt-setup, .fc-controls { gap: 0.9rem; }
	.pt-setup .ctl, .fc-controls .ctl { flex: 1 1 100%; }
	.ppk-go { display: flex; flex-direction: column; gap: 0.7rem; align-items: stretch; }
	.ppk-go .sign { width: 100%; text-align: center; }
	.ppk-top { position: sticky; top: 0; z-index: 6; background: #f7f9fb; padding-block: 0.4rem; }
	.ppk-x { min-width: 2.75rem; min-height: 2.75rem; }
	.pt-q legend { font-size: 1.35rem; }
	.pt-choice { padding: 0.85rem 0.7rem; align-items: center; }
	.pt-choice input { margin-top: 0; width: 1.4rem; height: 1.4rem; }
	.pt-choice label { font-size: 1.08rem; padding-block: 0.15rem; }
	.ppk-panel.is-run { display: flex; flex-direction: column; min-height: calc(100svh - 10.5rem - var(--tabs-h)); }
	.fc-actions:empty { display: none; }
	.pt-actions, .fc-actions { margin-top: auto !important; position: sticky; bottom: var(--tabs-h); z-index: 5; margin-inline: calc(var(--gutter) * -1); padding: 0.75rem var(--gutter); background: linear-gradient(180deg, rgba(247, 249, 251, 0), #f7f9fb 26%); display: flex; gap: 0.7rem; }
	.pt-actions .sign { flex: 1; text-align: center; font-size: 1.2rem; }
	.fc-actions .fc-btns { display: flex; gap: 0.7rem; width: 100%; }
	.fc-actions .fc-btns .sign { flex: 1; text-align: center; }
	.fc-face, .fc-card { min-height: min(24rem, 52vh); }

	/* Practice and flashcards open full screen (the tab bar is covered), so pin to the screen edge. */
	.ppk-app.is-focus { padding-bottom: 0; }
	.ppk-app.is-focus .ppk-panel.is-run { min-height: calc(100svh - 5.2rem); }
	.ppk-app.is-focus .pt-actions, .ppk-app.is-focus .fc-actions { bottom: 0; padding-bottom: calc(0.85rem + env(safe-area-inset-bottom, 0px)); }

	/* Tools: full-width controls */
	.ppk-tool input, .ppk-tool select { min-height: 3rem; font-size: 1.05rem; }
	.ppk-tool .sign, .ppk-tool button { min-height: 2.9rem; }

	/* Bottom tab bar */
	.app-tabs { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; z-index: 50; left: 0; right: 0; bottom: 0; background: #0b1f3f; border-top: 2px solid #f6c400; padding: 0.15rem 0 env(safe-area-inset-bottom, 0px); box-shadow: 0 -6px 18px rgba(0, 0, 0, 0.22); font-family: var(--sans, sans-serif); }
	.app-tabs a, .app-tabs button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.2rem; min-height: 3.6rem; padding: 0.35rem 0.1rem; background: none; border: 0; color: rgba(255, 255, 255, 0.78); font: inherit; font-size: 0.82rem; font-weight: 500; line-height: 1; text-decoration: none; cursor: pointer; }
	.app-tabs a:active, .app-tabs button:active { background: rgba(255, 255, 255, 0.08); }
	.app-tabs [aria-current='page'], .app-tabs .is-here, .app-tabs [aria-expanded='true'] { color: #f6c400; font-weight: 700; }
	.app-tabs svg { display: block; }
	.app-tabs :focus-visible { outline: 3px solid #f6c400; outline-offset: -3px; }

	/* Study sheet */
	.app-sheet { display: block; position: fixed; inset: 0; z-index: 60; }
	.app-sheet[hidden] { display: none; }
	.app-sheet-bg { position: absolute; inset: 0; background: rgba(5, 12, 26, 0.55); opacity: 0; transition: opacity 0.18s ease; }
	.app-sheet-card { position: absolute; left: 0; right: 0; bottom: 0; max-height: 88vh; overflow-y: auto; background: #f7f9fb; border-top: 4px solid #0b1f3f; border-radius: 1.1rem 1.1rem 0 0; padding: 0.4rem var(--gutter) calc(1rem + env(safe-area-inset-bottom, 0px)); transform: translateY(100%); transition: transform 0.2s ease; font-family: var(--sans, sans-serif); color: #0f1c2b; overscroll-behavior: contain; }
	.app-sheet.on .app-sheet-bg { opacity: 1; }
	.app-sheet.on .app-sheet-card { transform: none; }
	.app-sheet-grab { width: 2.6rem; height: 0.3rem; border-radius: 99px; background: #b8c4d2; margin: 0.35rem auto 0.5rem; }
	.app-sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
	.app-sheet-head h2 { font-size: 1.45rem; margin: 0; color: #0b1f3f; }
	.app-sheet-x { width: 2.75rem; height: 2.75rem; border: 2px solid #0f1c2b; background: #fff; font-size: 1.6rem; line-height: 1; cursor: pointer; }
	.app-certs { list-style: none; margin: 0.6rem 0 0; padding: 0; }
	.app-certs li { margin: 0; padding: 0.85rem 0; border-top: 1px solid #ccd6e0; }
	.app-certs strong { display: block; font-size: 1.15rem; color: #0b1f3f; margin-bottom: 0.5rem; }
	.app-cert-links { display: flex; flex-wrap: wrap; gap: 0.5rem; }
	.app-cert-links a { display: inline-flex; align-items: center; min-height: 2.75rem; padding: 0 0.9rem; border: 2px solid #0f1c2b; background: #fff; color: #0f1c2b; font-weight: 600; font-size: 1rem; text-decoration: none; }
	.app-cert-links a:first-child { background: #f6c400; }
	.app-sheet-foot { border-top: 3px solid #0b1f3f; margin-top: 0.4rem; padding-top: 0.9rem; display: grid; gap: 0.6rem; }
	.app-btn { min-height: 3rem; padding: 0 1rem; border: 2px solid #0b1f3f; background: #0b1f3f; color: #fff; font: inherit; font-weight: 700; font-size: 1.05rem; cursor: pointer; }
	.app-btn--quiet { background: #fff; color: #0b1f3f; }
	.app-btn[hidden], .app-ios[hidden] { display: none; }
	.app-ios, .app-status, .app-support { margin: 0; font-size: 0.95rem; color: #41556b; }
	.app-status:empty { display: none; }
	.app-support a { color: #1b4f9c; }

	/* Installed app: more room, no browser-style extras */
	html.is-app .ppk-banner { display: none; }
	html.is-app .site-top { padding-top: calc(0.75rem + env(safe-area-inset-top, 0px)); }
}

@media (max-width: 48rem) and (prefers-reduced-motion: reduce) {
	.app-sheet-bg, .app-sheet-card { transition: none; }
}

@media print { .app-tabs, .app-sheet { display: none !important; } }

/* study extras */
body .x-listen{background:none;border:0;color:inherit;text-decoration:underline;font:inherit;font-size:.92rem;cursor:pointer;padding:4px 0;min-height:32px;opacity:.85}
body .x-dash{display:flex;flex-wrap:wrap;gap:18px 28px;align-items:center;padding:16px 18px;margin:0 0 18px;border:2px solid currentColor;border-radius:12px;background:rgba(127,127,127,.07)}
body .x-ring{display:flex;gap:12px;align-items:center}body .x-ring svg{flex:none}
body .x-ring b,body .x-stat b{display:block;font-size:1.5rem;line-height:1.1}body .x-ring span,body .x-stat span{display:block;font-size:.86rem;opacity:.85}
body .x-goal{font-size:.9rem;margin-left:auto}body .x-goal select{font:inherit;padding:5px 8px;border-radius:6px;margin-left:4px}
body .x-backup{margin-top:28px}body .x-file{cursor:pointer;position:relative}body .x-file input{position:absolute;inset:0;opacity:0;cursor:pointer;width:100%}
body .x-thanks{margin:8px 0 0}
body .x-sisters-wrap{grid-column:1/-1;border-top:1px solid rgba(127,127,127,.35);padding-top:18px;margin-top:8px}body .x-sisters-wrap h3{margin:0 0 10px;font-size:1rem;color:inherit}body .x-sisters a{color:inherit}body .x-sisters{list-style:none;margin:0;padding:0;display:grid;grid-template-columns:repeat(auto-fit,minmax(210px,1fr));gap:6px 22px}
body .x-sisters span{opacity:.75;font-size:.88rem}
body .x-mini{font-weight:700}
@media print{body .x-size,body .x-listen,body .x-dash,body .x-backup,body .x-sisters-wrap{display:none}}

body .ppk-banner .btn-ghost{color:#fff!important;border-color:rgba(255,255,255,.75)}

/* Exam categories in the study sheet */
.app-certs li.app-cat { padding: 0.9rem 0 0.3rem; border-top: 0; font-weight: 700; font-size: 0.95rem; color: #41556b; }
.app-certs li.app-cat:first-child { padding-top: 0.2rem; }

/* text size button: fixed, lower left */
body .x-size{position:fixed;left:12px;bottom:12px;z-index:60;width:46px;height:46px;border-radius:50%;background:#0b1f3f;color:#fff;border:2px solid #f6c400;font:700 1rem/1 inherit;cursor:pointer;display:flex;align-items:center;justify-content:center;box-shadow:0 2px 8px rgba(0,0,0,.35);padding:0}
body .x-size[data-s="1"]{font-size:1.15rem}body .x-size[data-s="2"]{font-size:1.3rem}
@media (max-width:48rem){body .x-size{bottom:calc(4.6rem + env(safe-area-inset-bottom,0px))}}
/* support banner shows on phones too, compact (not inside the installed app) */
@media (max-width:48rem){html:not(.is-app) body #ppk-banner:not([hidden]){display:block}body #ppk-banner p{font-size:.88rem;margin:0 0 6px}}
/* tip prompt after finishing a test, quiz or deck */
body .x-tip{margin:14px 0;padding:12px 14px;border-left:5px solid #f6c400;background:rgba(127,127,127,.12)}
body .x-tip p{margin:0 0 8px}body .x-tip .x-tip-row{display:flex;gap:8px;flex-wrap:wrap;margin:0}
body .x-tip .btn{display:inline-block;padding:.45rem .9rem;background:#0b1f3f;color:#fff;text-decoration:none;font-weight:700;border-radius:4px;border:2px solid #0b1f3f}
body .x-tip .btn-ghost{background:transparent;color:inherit;border-color:currentColor;cursor:pointer;font:inherit;font-weight:700}
@media print{body .x-tip{display:none}}
/* top menu dropdown */
.site-nav details{position:relative}.site-nav summary{list-style:none;cursor:pointer;color:rgba(255,255,255,.88);padding-block:.2rem;border-bottom:2px solid transparent}
.site-nav summary::-webkit-details-marker{display:none}.site-nav summary::after{content:" \25BE"}
.site-nav summary:hover,.site-nav details.on summary,.site-nav details[open] summary{color:#fff;border-bottom-color:#f6c400}
.site-nav details>div{position:absolute;left:0;top:100%;z-index:30;background:#0b1f3f;min-width:14rem;padding:.4rem 0;box-shadow:0 6px 16px rgba(0,0,0,.35)}
.site-nav details>div a{display:block;padding:.5rem 1rem;border-bottom:0;white-space:nowrap}
.site-nav details>div a:hover,.site-nav details>div a[aria-current=page]{background:rgba(255,255,255,.1)}
.site-nav .nl{display:contents}
@media (max-width: 48rem) { .site-foot .cols > div:nth-child(2), .site-foot .cols > div:nth-child(3) { grid-column: 1 / -1; } .site-foot .cols > div:nth-child(2) ul, .site-foot .cols > div:nth-child(3) ul { columns: 2; column-gap: 1rem; } }

body .x-readbtn{position:fixed;left:12px;bottom:66px;z-index:60;width:46px;height:46px;border-radius:23px;border:1px solid rgba(0,0,0,.2);background:linear-gradient(180deg,#fff,#e9eef5);color:#15213a;font:700 .95rem system-ui,sans-serif;cursor:pointer;box-shadow:0 1px 4px rgba(0,0,0,.2)}
body .x-readbtn[aria-pressed=true]{background:linear-gradient(180deg,#fff3b0,#f5d76e)}
html.x-read body,html.x-read body *{font-family:Verdana,Tahoma,"Trebuchet MS",sans-serif!important;letter-spacing:.03em;word-spacing:.12em}
html.x-read body{line-height:1.85}html.x-read p,html.x-read li{max-width:70ch}
@media print{body .x-readbtn{display:none}}
