/* Flying Hands Learning redesign. Loaded after the existing styles. */
:root {
  /* Colours come only from flyinghands.in: navy, green, yellow, red and warm paper. */
  --fx-navy: #111e49;
  --fx-ink: #172342;
  --fx-ink-2: #505b71;
  --fx-forest: #155c32;
  --fx-forest-2: #0c4827;
  --fx-green: #318a3f;
  --fx-paper: #fffdf5;
  --fx-paper-dim: #fff3c9;
  --fx-card: #ffffff;
  --fx-line: #dce4d7;
  --fx-coral: #e63c46;
  --fx-coral-deep: #ba2034;
  --fx-sun: #f8ce39;
  --fx-sun-soft: #ffe77a;
  --fx-mint: #d9efbd;
  --fx-sky: #ffe77a;
  --fx-lilac: #ffe77a;
  --fx-pink: #fff3c9;
  --fx-lime: #d9efbd;
  --fx-radius: 20px;
  --fx-shadow: 0 1px 2px rgba(17, 30, 73, .06), 0 12px 30px rgba(17, 30, 73, .08);
  --fx-font: "Segoe UI Variable Text", "Segoe UI", Roboto, "Noto Sans", system-ui, -apple-system, sans-serif;
  --fx-display: "Segoe UI Variable Display", "Segoe UI", Roboto, "Noto Sans", system-ui, -apple-system, sans-serif;
  --fx-head: 68px;
}

:root { --ink: var(--fx-ink); --muted: #505b71; --cream: var(--fx-paper); --paper: #fff; --orange: var(--fx-coral-deep); }
html { scroll-padding-top: calc(var(--fx-head) + 16px); }
body { background: var(--fx-paper) !important; color: var(--fx-ink); font-family: var(--fx-font); font-size: 17px; line-height: 1.6; }
body :where(h1, h2, h3, h4, strong.brand-title) { color: inherit; font-family: var(--fx-display); letter-spacing: 0; }
body main h1 { font-size: clamp(2.15rem, 6vw, 4rem); line-height: 1.04; font-weight: 800; }
body main h2 { font-size: clamp(1.65rem, 3.6vw, 2.5rem); line-height: 1.12; font-weight: 800; }
body main h3 { line-height: 1.3; }
body .shell { width: min(1180px, calc(100% - 32px)); }
body .muted, body .section-intro, body .detail-summary { color: var(--fx-ink-2); }
body .eyebrow, body .detail-topline { color: var(--fx-coral-deep); font-size: .8rem; font-weight: 800; letter-spacing: .08em; }
body a { text-underline-offset: 3px; }
body :focus-visible { outline: 3px solid #111e49 !important; outline-offset: 3px; border-radius: 6px; }
body ::selection { background: var(--fx-sun); color: var(--fx-ink); }

/* Controls */
body .button, body button.button, body a.button {
  min-height: 48px; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 20px; border: 2px solid var(--fx-ink); border-radius: 14px; box-shadow: 3px 3px 0 var(--fx-ink);
  background: #fff; color: var(--fx-ink) !important; font-weight: 800; text-decoration: none; transition: transform .14s, box-shadow .14s;
}
body .button:hover { transform: translate(-1px, -1px); box-shadow: 5px 5px 0 var(--fx-ink); }
body .button:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--fx-ink); }
body .button-orange, body a.button-orange, body button.button-orange { background: var(--fx-coral) !important; }
body .button-dark, body button.button-dark { background: var(--fx-sun) !important; }
body main input:not([type=checkbox]):not([type=radio]), body main select, body main textarea {
  min-height: 48px; border: 2px solid #505b71; border-radius: 13px; background: #fff; color: var(--fx-ink); font: inherit; font-size: 16px;
}
body main input:focus, body main select:focus, body main textarea:focus { border-color: var(--fx-ink); box-shadow: 0 0 0 3px var(--fx-sun); outline: none; }
body main summary { min-height: 44px; cursor: pointer; }

/* Header */
body .site-header {
  position: sticky !important; top: 0; z-index: 60; min-height: var(--fx-head); padding: 0;
  background: var(--fx-forest) !important; border: 0; box-shadow: 0 8px 24px rgba(17, 30, 73, .22); backdrop-filter: none;
}
body .site-header .nav-wrap { width: min(1240px, calc(100% - 28px)); min-height: var(--fx-head); display: flex; align-items: center; gap: 18px; padding: 0; }
body .site-header .brand { flex: none; display: inline-flex; align-items: center; gap: 10px; min-height: 44px; color: #fff; font-family: var(--fx-display); font-weight: 800; font-size: 1.02rem; text-decoration: none; }
body .site-header .brand-logo { width: 40px; height: 40px; }
html.fx-built body .site-header #main-navigation,
html.fx-built body .site-header.site-header .nav-wrap > .main-nav,
html.fx-built body .site-header.site-header .nav-wrap > .header-actions { display: none !important; }
body .site-header .fx-nav > a, body .site-header .fx-menu > summary, body .site-header .fx-icon-btn { color: #ffffff !important; }
body .site-header .fx-menu-panel a, body .site-header .fx-signin { color: var(--fx-ink) !important; }
.fx-nav { flex: 1; display: flex; align-items: center; gap: 2px; min-width: 0; }
.fx-nav > a, .fx-menu > summary {
  display: inline-flex; align-items: center; gap: 5px; min-height: 44px; padding: 0 12px; border-radius: 12px; color: #ffffff; font-size: .95rem; font-weight: 650; text-decoration: none; list-style: none; cursor: pointer; white-space: nowrap;
}
.fx-menu > summary::-webkit-details-marker { display: none; }
.fx-menu > summary::after { content: ""; width: 7px; height: 7px; margin: -3px 0 0 3px; border: solid currentColor; border-width: 0 2px 2px 0; transform: rotate(45deg); }
.fx-nav > a:hover, .fx-menu > summary:hover, .fx-menu[open] > summary, .fx-nav > a[aria-current=page] { background: var(--fx-forest-2); color: #fff; }
.fx-menu { position: relative; }
.fx-menu-panel { position: absolute; top: calc(100% + 10px); left: 0; display: grid; min-width: 250px; padding: 8px; border: 2px solid var(--fx-ink); border-radius: 16px; background: #fff; box-shadow: 5px 5px 0 var(--fx-ink); }
.fx-menu-panel a { min-height: 44px; display: flex; align-items: center; padding: 8px 12px; border-radius: 10px; color: var(--fx-ink); font-weight: 650; text-decoration: none; }
.fx-menu-panel a:hover { background: #fff3c9; }
.fx-actions { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.fx-icon-btn { position: relative; display: inline-grid; place-items: center; width: 44px; height: 44px; border: 0; border-radius: 12px; background: transparent; color: #fff; cursor: pointer; text-decoration: none; }
.fx-icon-btn:hover { background: var(--fx-forest-2); }
.fx-icon-btn svg, .fx-tabbar svg { width: 23px; height: 23px; }
.fx-signin { display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px; border-radius: 12px; background: var(--fx-sun); color: var(--fx-ink); font-weight: 800; text-decoration: none; }
.fx-menu-btn { display: none; }

/* Mobile menu and tabs */
.fx-sheet { width: min(420px, 100%); max-width: 100%; height: 100dvh; max-height: 100dvh; margin: 0 0 0 auto; padding: 0; border: 0; background: var(--fx-paper); color: var(--fx-ink); }
.fx-sheet::backdrop { background: rgba(17, 30, 73, .55); }
.fx-sheet-head { position: sticky; top: 0; display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; background: var(--fx-forest); color: #fff; font-weight: 800; }
.fx-sheet-body { padding: 8px 16px 32px; }
.fx-sheet h2 { margin: 20px 0 8px; color: var(--fx-coral-deep); font-size: .8rem; letter-spacing: .08em; text-transform: uppercase; }
.fx-sheet a { min-height: 48px; display: flex; align-items: center; border-bottom: 1px solid var(--fx-line); color: var(--fx-ink); font-weight: 650; text-decoration: none; }
.fx-tabbar { display: none; }

/* Home hero */
.fx-hero { position: relative; overflow: hidden; color: #fff; background: linear-gradient(120deg, #f5c12a 0%, #ffe77a 52%, #f8ce39 100%); }
.fx-hero::before { content: ""; position: absolute; inset: 0; opacity: .1; background-image: linear-gradient(#fff 1px, transparent 1px), linear-gradient(90deg, #fff 1px, transparent 1px); background-size: 44px 44px; mask-image: linear-gradient(120deg, #000, transparent 62%); }
.fx-hero-grid { position: relative; display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(320px, .75fr); gap: 56px; align-items: center; padding: 64px 0 54px; }
.fx-kicker { display: inline-flex; align-items: center; min-height: 34px; margin: 0 0 18px; padding: 4px 13px; border-radius: 999px; background: var(--fx-sun); color: var(--fx-ink); font-size: .85rem; font-weight: 800; }
.fx-hero h1 { margin: 0; color: #fff; font-size: clamp(2.7rem, 6.2vw, 5rem); }
.fx-hero h1 em { color: var(--fx-sun); font-style: normal; }
.fx-lede { max-width: 600px; margin: 18px 0 24px; color: #fff0d4; font-size: clamp(1.06rem, 2vw, 1.28rem); }
.fx-hero .top-search { margin: 0; padding: 0; background: none; }
.fx-hero .top-search .shell { width: 100%; }
.fx-hero .filter-bar { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: center; margin: 0; padding: 10px; border: 0; border-radius: 20px; background: #fff; box-shadow: 0 20px 44px rgba(0, 0, 0, .28); color: var(--fx-ink); }
.fx-hero .search-field { margin: 0; }
.fx-hero .search-field input { width: 100%; border-color: transparent !important; font-size: 17px; }
.fx-hero .fh-filter-details, .fx-hero .filter-bar > details { grid-column: 1 / -1; padding: 0 6px; }
.fx-hero .filter-bar summary { display: flex; align-items: center; color: var(--fx-forest-2); font-weight: 800; }
.fx-classes { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; }
.fx-classes span { align-self: center; margin-right: 4px; color: #fff0d4; font-weight: 700; }
.fx-classes button { min-width: 46px; min-height: 44px; padding: 0 12px; border: 1.5px solid rgba(255, 255, 255, .42); border-radius: 12px; background: rgba(255, 255, 255, .08); color: #fff; font: inherit; font-weight: 800; cursor: pointer; }
.fx-classes button:hover { border-color: var(--fx-sun); background: var(--fx-sun); color: var(--fx-ink); }
.fx-stack { position: relative; min-height: 370px; }
.fx-note { position: absolute; width: 268px; padding: 20px; border: 2px solid var(--fx-ink); border-radius: 20px; box-shadow: 7px 7px 0 rgba(0, 0, 0, .34); color: var(--fx-ink); }
.fx-note b { display: block; font-family: var(--fx-display); font-size: 1.32rem; line-height: 1.15; }
.fx-note small { display: block; margin-top: 6px; font-size: .92rem; font-weight: 650; }
.fx-note-a { top: 0; right: 6px; background: var(--fx-sun); transform: rotate(3deg); }
.fx-note-b { top: 126px; left: 0; background: var(--fx-mint); transform: rotate(-3deg); }
.fx-note-c { top: 246px; right: 18px; background: #fff; transform: rotate(1.5deg); }
.fx-tick { display: inline-grid; place-items: center; width: 24px; height: 24px; margin-right: 6px; border-radius: 50%; background: var(--fx-forest-2); color: #fff; font-size: .8rem; }
.fx-stats { position: relative; display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid rgba(255, 255, 255, .18); }
.fx-stats div { padding: 16px 0 20px; }
.fx-stats b { display: block; color: var(--fx-sun); font-family: var(--fx-display); font-size: 1.65rem; line-height: 1.1; }
.fx-stats span { color: #fff0d4; font-size: .92rem; }

/* Home sections */
body .fh-intro, body .fh-seo-home { display: none; }
body .home-shortcuts { margin: 0; padding: 44px 0 10px; background: none; }
body .home-shortcuts .shell { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
body .home-shortcuts a { position: relative; display: block; min-height: 136px; padding: 20px; border: 2px solid var(--fx-ink); border-radius: var(--fx-radius); box-shadow: 4px 4px 0 var(--fx-ink); color: var(--fx-ink); text-decoration: none; transition: transform .14s, box-shadow .14s; }
body .home-shortcuts a:hover { transform: translate(-2px, -2px); box-shadow: 7px 7px 0 var(--fx-ink); }
body .home-shortcuts a:nth-child(1) { background: var(--fx-mint); }
body .home-shortcuts a:nth-child(2) { background: var(--fx-sun); }
body .home-shortcuts a:nth-child(3) { background: var(--fx-lilac); }
body .home-shortcuts a:nth-child(4) { background: var(--fx-sky); }
body .home-shortcuts strong { display: block; font-family: var(--fx-display); font-size: 1.25rem; line-height: 1.15; }
body .home-shortcuts span { display: block; margin-top: 6px; color: var(--fx-ink); font-size: .95rem; }
#resources, body .resources-section { background: none; }
body .section-heading { align-items: end; gap: 16px; margin-bottom: 22px; }
body .result-count { padding: 5px 12px; border-radius: 999px; background: #fff3c9; color: var(--fx-ink); font-weight: 800; }
body .resource-groups { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
body .class-resource-box { min-width: 0; margin: 0; overflow: hidden; border: 2px solid var(--fx-ink); border-radius: var(--fx-radius); background: #fff; box-shadow: 4px 4px 0 var(--fx-ink); }
body .class-resource-box:has(> [aria-expanded=true]) { grid-column: 1 / -1; }
body .class-resource-heading { position: relative; width: 100%; min-height: 126px; display: grid; grid-template-columns: 76px minmax(0, 1fr) 28px; column-gap: 14px; align-content: center; align-items: center; padding: 16px; border: 0; background: var(--fx-tile, #fff); color: var(--fx-ink); text-align: left; cursor: pointer; }
.class-resource-box:nth-child(7n+1) { --fx-tile: var(--fx-sun); }
.class-resource-box:nth-child(7n+2) { --fx-tile: var(--fx-mint); }
.class-resource-box:nth-child(7n+3) { --fx-tile: var(--fx-sky); }
.class-resource-box:nth-child(7n+4) { --fx-tile: var(--fx-lilac); }
.class-resource-box:nth-child(7n+5) { --fx-tile: #fff3c9; }
.class-resource-box:nth-child(7n+6) { --fx-tile: var(--fx-lime); }
.class-resource-box:nth-child(7n) { --fx-tile: var(--fx-pink); }
body .resource-group-class { grid-row: 1 / span 2; display: grid; place-items: center; width: 72px; height: 72px; padding: 4px; border-radius: 18px; background: var(--fx-ink); color: #fff; font-family: var(--fx-display); font-size: .78rem; font-weight: 800; line-height: 1.1; text-align: center; }
body .resource-group-class[data-num]::before { content: attr(data-num); display: block; color: var(--fx-sun); font-size: 1.9rem; line-height: 1; }
body .class-resource-label { grid-column: 2; font-family: var(--fx-display); font-size: 1.2rem; font-weight: 800; line-height: 1.15; }
body .class-resource-subjects, body .class-resource-count { display: inline; grid-column: 2; padding: 0; background: none !important; color: var(--fx-ink); font-size: .9rem; font-weight: 650; }
body .class-resource-chevron { grid-column: 3; grid-row: 1 / span 3; color: var(--fx-ink); font-size: 1.4rem; }
body .class-resource-content { padding: 18px; }
body .resource-group-heading { display: flex; align-items: center; justify-content: space-between; margin: 12px 0; }
body .resource-group-subject { font-family: var(--fx-display); font-size: 1.28rem; font-weight: 800; }
body .resource-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
body .resource-card { min-height: 60px; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 14px; border: 1.5px solid var(--fx-line); border-radius: 14px; background: #fffdf5; color: var(--fx-ink); font-weight: 650; text-decoration: none; box-shadow: none; }
body .resource-card:hover { border-color: var(--fx-ink); background: #fff3c9; transform: none; }
body .resource-access-label { flex: none; padding: 2px 8px; border-radius: 999px; background: #d9efbd; color: #0c4827; font-size: .76rem; font-weight: 800; }

/* Chapter reader */
.fx-progress { position: fixed; top: 0; left: 0; z-index: 70; width: 100%; height: 4px; background: transparent; }
.fx-progress i { display: block; width: 100%; height: 100%; background: var(--fx-coral); transform: scaleX(var(--fx-read, 0)); transform-origin: left; }
body .detail-section { padding-top: 0; background: none; }
body .detail-section > .shell.narrow { width: min(820px, calc(100% - 32px)); padding-top: 24px; }
body .detail-section h1 { margin: 12px 0 14px; font-size: clamp(2.05rem, 5.4vw, 3.45rem); }
.fx-title-meta { display: block; margin-top: 10px; color: var(--fx-coral-deep); font-size: clamp(1rem, 2.4vw, 1.25rem); line-height: 1.3; }
body .detail-topline span { padding: 3px 9px; border-radius: 999px; background: #fff3c9; color: var(--fx-ink); }
body .fh-learning-tools { position: static !important; display: grid; grid-template-columns: 1fr 1fr auto auto; gap: 10px; align-items: end; margin: 18px 0; padding: 14px; border: 2px solid var(--fx-ink); border-radius: 18px; background: #fff; box-shadow: 4px 4px 0 var(--fx-ink); }
body .fh-learning-tools small { grid-column: 1 / -1; }
body .fh-section-toc { position: sticky !important; top: var(--fx-head); z-index: 20; display: flex; align-items: center; gap: 8px; margin: 18px -4px; padding: 9px 4px; overflow-x: auto; background: var(--fx-paper); scrollbar-width: none; }
body .fh-section-toc strong { flex: none; }
body .fh-section-toc a { flex: none; min-height: 40px; display: inline-flex; align-items: center; padding: 0 13px; border: 1.5px solid var(--fx-ink); border-radius: 999px; background: #fff; color: var(--fx-ink); font-size: .9rem; font-weight: 700; text-decoration: none; }
body .fh-reader-section { margin: 34px 0; }
body .fh-reader-section > h2 { padding-bottom: 10px; border-bottom: 4px solid var(--fx-sun); }
body .prose { font-size: 1.08rem; line-height: 1.75; }
body .qa-extract-heading { margin: 22px 0 14px; padding: 18px; border-left: 6px solid var(--fx-coral); border-radius: 0 16px 16px 0; background: #fff3c9; }
body .qa-card { margin: 14px 0; padding: 18px; border: 1.5px solid var(--fx-line); border-radius: 18px; background: #fff; box-shadow: var(--fx-shadow); }
body .qa-card > .muted { margin: 0 0 6px; color: var(--fx-coral-deep); font-size: .82rem; font-weight: 800; }
body .qa-card h3 { margin: 0 0 12px; font-size: 1.13rem; font-weight: 750; }
body .qa-card details summary { display: inline-flex; align-items: center; padding: 0 15px; border-radius: 12px; background: var(--fx-mint); color: var(--fx-ink); font-weight: 800; list-style: none; }
body .qa-card details summary::-webkit-details-marker { display: none; }
body .qa-card details[open] summary { margin-bottom: 8px; background: #fff3c9; }
body .next-step { padding: 20px; border: 2px solid var(--fx-ink); border-radius: 18px; background: var(--fx-sun); box-shadow: 4px 4px 0 var(--fx-ink); }

/* Store, sign-in and general pages */
body .store-hero { padding: 62px 0; color: #fff; background: linear-gradient(120deg, #d9283b 0%, #ab142b 100%) !important; }
body .store-hero h1 { max-width: 780px; margin: 8px 0 14px; color: #fff; }
body .store-hero p { max-width: 650px; color: #fff0d4; font-size: 1.15rem; }
body .store-hero .eyebrow { color: var(--fx-sun); }
body .store-hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 22px; }
body .store-filter { padding: 16px; border: 2px solid var(--fx-ink); border-radius: 18px; background: #fff; box-shadow: 4px 4px 0 var(--fx-ink); }
body .store-empty { margin-top: 22px; padding: 42px 22px; border: 2px dashed #505b71; border-radius: 20px; background: #fff; text-align: center; }
.fx-empty-action { margin-top: 12px; }
body .auth-section { min-height: calc(100dvh - var(--fx-head) - 180px); display: grid; place-items: center; padding: 48px 16px; background: linear-gradient(120deg, #0d4526 0%, #155c32 48%, #1f7d47 100%); }
body .auth-card { width: min(480px, 100%); padding: 30px; border: 2px solid var(--fx-ink); border-radius: 24px; background: #fff; box-shadow: 8px 8px 0 rgba(0, 0, 0, .34); }
body .auth-card h1 { margin: 8px 0 10px; font-size: clamp(2rem, 6vw, 2.75rem); }
body .auth-card .g_id_signin { min-height: 44px; margin-top: 22px; }

/* Footer */
body .site-footer, body footer { background: var(--fx-forest) !important; color: #fff0d4; }
body footer a, body footer summary { display: inline-flex; align-items: center; min-height: 44px !important; color: #fff; }
body .ai-floating-launcher { position: fixed !important; right: 18px; bottom: 18px; z-index: 50; min-height: 50px; border: 2px solid var(--fx-ink) !important; border-radius: 16px !important; background: var(--fx-lilac) !important; box-shadow: 4px 4px 0 var(--fx-ink) !important; color: var(--fx-ink) !important; }

/* Stronger rules for controls also styled by older inline CSS */
.fx-hero h1 { font-size: clamp(2.7rem, 5.3vw, 4.35rem); }
.fx-hero h1 em { display: block; }
#main-content .home-shortcuts .shell a { min-height: 132px; padding: 20px; border: 2px solid var(--fx-ink); border-radius: var(--fx-radius); box-shadow: 4px 4px 0 var(--fx-ink); }
#main-content .home-shortcuts .shell a:nth-child(1) { background: var(--fx-mint) !important; }
#main-content .home-shortcuts .shell a:nth-child(2) { background: var(--fx-sun) !important; }
#main-content .home-shortcuts .shell a:nth-child(3) { background: var(--fx-lilac) !important; }
#main-content .home-shortcuts .shell a:nth-child(4) { background: var(--fx-sky) !important; }
#main-content .class-resource-box { padding: 0 !important; background: #fff !important; }
#main-content .class-resource-heading { border-radius: 0 !important; background: var(--fx-tile, #fff) !important; box-shadow: none !important; }
#main-content .class-resource-subjects, #main-content .class-resource-count { justify-self: start; min-height: 0; margin: 0; text-align: left; }
#main-content .class-resource-subjects { grid-row: 2; }
#main-content .class-resource-count { grid-row: 3; }
#main-content .class-resource-label { grid-row: 1; }
#main-content .resource-group-class { grid-row: 1 / span 3; }
#main-content .class-resource-chevron { color: var(--fx-ink) !important; }
#main-content select, #main-content input:not([type=checkbox]):not([type=radio]):not([type=hidden]), #main-content .button, #main-content summary { min-height: 48px !important; }
.fx-hero .filter-bar:not(.fx-open) > :not(.search-field):not(.button):not(.fx-filter-toggle):not(script) { display: none !important; }
.fx-hero .filter-bar.fx-open { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.fx-hero .filter-bar.fx-open > .search-field, .fx-hero .filter-bar.fx-open > details, .fx-hero .filter-bar.fx-open > .fx-filter-toggle { grid-column: 1 / -1; }
.fx-hero .filter-bar select { width: 100%; min-width: 0; }
.fx-hero .filter-bar > .search-field { order: -2; grid-row: auto !important; grid-column: 1; }
.fx-hero .filter-bar > .button { order: -1; grid-row: auto !important; grid-column: auto !important; }
.fx-hero .filter-bar.fx-open > .button { grid-column: 1 / -1 !important; }
#main-content :is(h1, h2, h3, h4) { font-family: var(--fx-display); }
.fx-filter-toggle { grid-column: 1 / -1; order: 9; min-height: 44px; border: 0; border-radius: 10px; background: #fff3c9; color: var(--fx-ink); font: inherit; font-size: .95rem; font-weight: 750; cursor: pointer; }
.fx-filter-toggle::after { content: "+"; margin-left: 8px; }
.fx-filter-toggle[aria-expanded=true]::after { content: "–"; }
#main-content .detail-topline span::before, #main-content .detail-topline span::after { content: none !important; }
#main-content .detail-topline { display: flex; flex-wrap: wrap; gap: 6px; }
#main-content .store-section { background: none !important; }
body .site-header.site-header { height: var(--fx-head); box-sizing: border-box; padding-top: 0; padding-bottom: 3px; }
body .site-header .nav-wrap.nav-wrap { height: calc(var(--fx-head) - 3px); min-height: 0; }

@media (max-width: 1040px) {
  .fx-nav { display: none; }
  .fx-menu-btn { display: inline-grid; }
  .fx-hero-grid { grid-template-columns: 1fr; gap: 26px; padding: 44px 0 30px; }
  .fx-stack { display: none; }
  body .home-shortcuts .shell { grid-template-columns: repeat(2, 1fr); }
  body .resource-groups { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  :root { --fx-head: 58px; }
  body { font-size: 16.5px; padding-bottom: calc(68px + env(safe-area-inset-bottom)); }
  body .site-header .brand { font-size: .94rem; }
  body .site-header .brand-logo { width: 36px; height: 36px; }
  .fx-signin, .fx-brand-rest { display: none; }
  .fx-tabbar { position: fixed; right: 0; bottom: 0; left: 0; z-index: 55; display: grid; grid-template-columns: repeat(5, 1fr); padding-bottom: env(safe-area-inset-bottom); background: var(--fx-forest); box-shadow: 0 -6px 20px rgba(17, 30, 73, .24); }
  .fx-tabbar a { min-height: 62px; display: grid; place-items: center; align-content: center; gap: 2px; color: #fff0d4; font-size: .72rem; font-weight: 700; text-decoration: none; }
  .fx-tabbar a[aria-current=page] { color: var(--fx-sun); }
  body .ai-floating-launcher { right: 12px; bottom: calc(76px + env(safe-area-inset-bottom)); width: 50px; min-width: 50px; padding: 0 !important; overflow: hidden; }
  body .ai-floating-launcher span:not(.ai-floating-spark) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .fx-hero h1 { font-size: clamp(2.55rem, 13vw, 3.4rem); }
  .fx-stats b { font-size: 1.35rem; }
  .fx-stats span { font-size: .8rem; }
  .fx-hero .filter-bar { grid-template-columns: 1fr; }
  .fx-hero .filter-bar > .button { width: 100%; }
  body .home-shortcuts { padding-top: 26px; }
  body .home-shortcuts .shell { gap: 12px; }
  body .home-shortcuts a { min-height: 124px; padding: 15px; }
  body .home-shortcuts strong { font-size: 1.08rem; }
  body .home-shortcuts span { font-size: .86rem; }
  body .resource-groups { grid-template-columns: 1fr; gap: 12px; }
  body .class-resource-heading { min-height: 104px; }
  body .fh-learning-tools { grid-template-columns: 1fr 1fr; }
  body .fh-learning-tools .button, body .fh-learning-tools > button, body .fh-learning-tools > a { width: 100%; }
  body .store-hero-actions .button { flex: 1 1 42%; }
  body .store-filter { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto !important; }
  body *, body *::before, body *::after { transition: none !important; animation: none !important; }
}
/* Compact layout */
:root { --fx-head: 56px; --fx-radius: 14px; }
body { font-size: 16px; line-height: 1.5; }
body main h1 { font-size: clamp(1.75rem, 3.6vw, 2.6rem); line-height: 1.1; }
body main h2 { font-size: clamp(1.3rem, 2.4vw, 1.8rem); line-height: 1.15; }
#main-content .section, #main-content > section:not(.fx-hero):not(.home-shortcuts):not(.store-hero):not(.auth-section) { padding-top: 22px; padding-bottom: 22px; }
body .eyebrow { margin-bottom: 4px; font-size: .74rem; }
body .section-heading { margin-bottom: 12px; gap: 10px; }
body .section-heading p { margin-top: 2px; margin-bottom: 0; }
body .button, body button.button, body a.button { min-height: 44px; padding: 7px 14px; border-radius: 11px; box-shadow: 2px 2px 0 var(--fx-ink); font-size: .94rem; }
body .button:hover { box-shadow: 3px 3px 0 var(--fx-ink); }
#main-content select, #main-content input:not([type=checkbox]):not([type=radio]):not([type=hidden]), #main-content .button, #main-content summary { min-height: 44px !important; }
body main input:not([type=checkbox]):not([type=radio]), body main select, body main textarea { border-radius: 10px; font-size: 16px; }
body .site-header .brand-logo { width: 34px; height: 34px; }
.fx-nav > a, .fx-menu > summary { padding: 0 10px; font-size: .9rem; }
.fx-ai-docked .ai-floating-launcher { display: none !important; }
.fx-ai-btn { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 12px; border: 0; border-radius: 10px; background: var(--fx-lilac); color: var(--fx-ink); font: inherit; font-size: .9rem; font-weight: 800; cursor: pointer; }
.fx-ai-btn svg { width: 18px; height: 18px; }
.fx-signin { min-height: 40px; padding: 0 13px; border-radius: 10px; font-size: .9rem; }
.ai-study-panel { z-index: 65 !important; }

.fx-hero-grid { grid-template-columns: minmax(0, 1fr) 300px; gap: 28px; padding: 24px 0 16px; }
.fx-kicker { min-height: 26px; margin-bottom: 8px; padding: 2px 10px; font-size: .76rem; }
.fx-hero h1 { font-size: clamp(2rem, 3.8vw, 3rem); }
.fx-lede { margin: 8px 0 12px; font-size: 1rem; }
.fx-hero .filter-bar { grid-template-columns: minmax(0, 1fr) auto; gap: 6px; padding: 6px; border-radius: 14px; }
.fx-hero .filter-bar > .search-field { grid-column: 1; }
.fx-filter-toggle { min-height: 40px; border-radius: 8px; font-size: .88rem; }
.fx-classes { flex-wrap: nowrap; gap: 6px; margin-top: 10px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
.fx-classes::-webkit-scrollbar { display: none; }
.fx-classes span { flex: none; font-size: .88rem; white-space: nowrap; }
.fx-classes button { flex: none; min-width: 44px; border-radius: 10px; }
.fx-stack { display: grid; gap: 8px; min-height: 0; align-content: center; }
.fx-note, .fx-note-a, .fx-note-b, .fx-note-c { position: static; width: auto; padding: 10px 12px; border-radius: 12px; box-shadow: 3px 3px 0 rgba(0, 0, 0, .34); transform: none; }
.fx-note b { font-size: 1rem; }
.fx-note small { margin-top: 1px; font-size: .8rem; }
.fx-tick { width: 18px; height: 18px; font-size: .68rem; }
.fx-stats { border-top-color: rgba(255, 255, 255, .14); }
.fx-stats div { display: flex; align-items: baseline; gap: 6px; padding: 8px 0 10px; }
.fx-stats b { font-size: 1.1rem; }
.fx-stats span { font-size: .82rem; }

body .home-shortcuts { padding: 14px 0 0; }
body .home-shortcuts .shell { gap: 10px; }
#main-content .home-shortcuts .shell a { min-height: 66px; padding: 10px 12px; border-radius: 12px; box-shadow: 2px 2px 0 var(--fx-ink); }
body .home-shortcuts strong { font-size: 1rem; }
body .home-shortcuts span { margin-top: 1px; font-size: .82rem; line-height: 1.25; }
body .resource-groups { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
#main-content .class-resource-box { border-radius: 12px; box-shadow: 2px 2px 0 var(--fx-ink); }
body .class-resource-heading { min-height: 68px; grid-template-columns: 44px minmax(0, 1fr) 18px; column-gap: 9px; padding: 9px 10px; }
#main-content .resource-group-class { width: 44px; height: 44px; padding: 2px; border-radius: 10px; font-size: .62rem; }
#main-content .resource-group-class[data-num] { font-size: 0; }
body .resource-group-class[data-num]::before { font-size: 1.3rem; }
body .class-resource-label { font-size: .96rem; }
body .class-resource-subjects, body .class-resource-count { font-size: .76rem; line-height: 1.2; }
body .class-resource-chevron { font-size: 1.1rem; }
body .class-resource-content { padding: 10px; }
body .resource-group-heading { margin: 6px 0; }
body .resource-group-subject { font-size: 1.05rem; }
body .resource-grid { grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 6px; }
body .resource-card { min-height: 44px; padding: 6px 10px; border-radius: 10px; font-size: .9rem; line-height: 1.2; }

body .detail-section > .shell.narrow { padding-top: 10px; }
body .detail-section h1 { margin: 6px 0; font-size: clamp(1.55rem, 3.2vw, 2.25rem); }
.fx-title-meta { margin-top: 3px; font-size: .92rem; }
#main-content .detail-topline { gap: 4px; font-size: .68rem; }
body .detail-topline span { padding: 1px 7px; }
body .fh-learning-tools { gap: 6px; margin: 8px 0; padding: 8px; border-radius: 12px; box-shadow: 2px 2px 0 var(--fx-ink); }
body .fh-learning-tools small { font-size: .76rem; }
body .fh-section-toc { gap: 6px; margin: 8px -4px; padding: 5px 4px; }
body .fh-section-toc a { min-height: 34px; padding: 0 10px; font-size: .82rem; }
body .fh-reader-section { margin: 16px 0; }
body .fh-reader-section > h2 { padding-bottom: 5px; border-bottom-width: 3px; }
body .prose { font-size: 1rem; line-height: 1.6; }
body .qa-extract-heading { margin: 10px 0; padding: 10px 12px; border-left-width: 4px; }
body .qa-card { margin: 8px 0; padding: 10px 12px; border-radius: 12px; }
body .qa-card > .muted { margin-bottom: 2px; font-size: .74rem; }
body .qa-card h3 { margin-bottom: 6px; font-size: 1rem; line-height: 1.35; }
body .qa-card details summary { min-height: 40px !important; padding: 0 11px; border-radius: 9px; font-size: .88rem; }
body .next-step { padding: 12px; border-radius: 12px; box-shadow: 2px 2px 0 var(--fx-ink); }

body .store-hero { padding: 24px 0; }
body .store-hero h1 { margin: 4px 0 6px; font-size: clamp(1.7rem, 3.4vw, 2.5rem); }
body .store-hero p { font-size: 1rem; }
body .store-hero-actions { gap: 8px; margin-top: 12px; }
body .store-filter { gap: 8px; padding: 10px; border-radius: 12px; box-shadow: 2px 2px 0 var(--fx-ink); }
body .store-empty { margin-top: 10px; padding: 18px 14px; border-radius: 12px; }
body .auth-section { min-height: 0; padding: 26px 16px; }
body .auth-card { padding: 20px; border-radius: 16px; box-shadow: 4px 4px 0 rgba(0, 0, 0, .34); }
body .auth-card h1 { font-size: clamp(1.55rem, 4vw, 2rem); }
body .auth-card .g_id_signin { margin-top: 12px; }
body footer a, body footer summary { min-height: 34px !important; font-size: .9rem; }

@media (max-width: 1040px) {
  .fx-hero-grid { grid-template-columns: 1fr; gap: 0; padding: 18px 0 10px; }
  .fx-stack { display: none; }
  body .home-shortcuts .shell { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  body .resource-groups { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  :root { --fx-head: 50px; }
  body { font-size: 15.5px; padding-bottom: calc(54px + env(safe-area-inset-bottom)); }
  body .shell { width: calc(100% - 20px); }
  body .site-header .brand { font-size: .84rem; line-height: 1.05; }
  body .site-header .brand-logo { width: 30px; height: 30px; }
  .fx-ai-btn.fx-header-ai { display: none; }
  .fx-icon-btn { width: 42px; height: 42px; }
  .fx-hero h1 { font-size: clamp(1.8rem, 8.2vw, 2.2rem); }
  .fx-hero h1 em { display: inline; }
  .fx-lede { font-size: .94rem; }
  .fx-hero .filter-bar { grid-template-columns: minmax(0, 1fr) auto; }
  .fx-hero .filter-bar > .button { width: auto; }
  .fx-stats div { display: block; padding: 6px 0 8px; }
  .fx-stats b { font-size: 1rem; }
  .fx-stats span { font-size: .72rem; }
  body .home-shortcuts .shell { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  #main-content .home-shortcuts .shell a { min-height: 58px; padding: 8px 10px; }
  body .home-shortcuts strong { font-size: .92rem; }
  body .home-shortcuts span { font-size: .74rem; }
  body .resource-groups { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  body .class-resource-box:has(> [aria-expanded=true]) { grid-column: 1 / -1; }
  body .class-resource-heading { min-height: 60px; grid-template-columns: 36px minmax(0, 1fr) 14px; column-gap: 7px; padding: 8px; }
  #main-content .resource-group-class { width: 36px; height: 36px; border-radius: 8px; }
  body .resource-group-class[data-num]::before { font-size: 1.08rem; }
  body .class-resource-label { font-size: .84rem; }
  body .class-resource-subjects, body .class-resource-count { font-size: .68rem; }
  .fx-tabbar a, .fx-tabbar button { min-height: 52px; gap: 0; font-size: .66rem; }
  .fx-tabbar svg { width: 20px; height: 20px; }
  .ai-study-panel { right: 8px !important; bottom: calc(60px + env(safe-area-inset-bottom)) !important; left: 8px !important; width: auto !important; max-height: calc(100dvh - 120px) !important; overflow: auto; }
  body .fh-learning-tools { grid-template-columns: 1fr 1fr; }
  body .store-hero-actions .button { flex: 1 1 44%; }
}
.fx-hero-grid > *, .fx-hero .top-search, .fx-hero .top-search .shell, .fx-hero .filter-bar, .fx-hero .search-field { min-width: 0; max-width: 100%; }
@media (max-width: 1040px) { .fx-hero-grid { grid-template-columns: minmax(0, 1fr); } }
#main-content .fh-section-toc { border: 0 !important; border-bottom: 1px solid var(--fx-line) !important; border-radius: 0 !important; background: var(--fx-paper) !important; box-shadow: none !important; backdrop-filter: none !important; }
#main-content .shell > .fh-sort { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 0 0 8px; }
#main-content .shell > .fh-sort select { width: auto; max-width: 62%; }
#main-content .class-resource-box:not(:has(> [aria-expanded=true])) > .fh-sort { display: none !important; }
#main-content .resource-group-class:not([data-num]) { font-size: 0; }
#main-content .resource-group-class:not([data-num])::before { content: "Aa"; color: var(--fx-sun); font-size: 1rem; line-height: 1; }
#main-content .home-shortcuts { padding: 12px 0 0 !important; }
#main-content .fh-section-reader { display: block !important; }
#main-content .fh-section-toc { width: auto; max-width: none; }
#main-content .resource-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0; }
#main-content .resource-actions .button { width: auto; flex: 0 1 auto; }
.fx-tabbar button { min-height: 52px; display: grid; place-items: center; align-content: center; border: 0; background: none; color: #fff0d4; font: inherit; font-size: .66rem; font-weight: 700; cursor: pointer; }

@media print {
  .fx-tabbar, .fx-progress, .fx-sheet, body .site-header, body .ai-floating-launcher, body .fh-section-toc { display: none !important; }
  body { padding: 0; background: #fff !important; }
}

/* Flying Hands palette: navy, green, yellow and red bands, as on flyinghands.in */
body :where(h1, h2, h3) { color: var(--fx-navy); }
body :focus-visible { outline-color: var(--fx-navy) !important; box-shadow: 0 0 0 6px var(--fx-sun-soft) !important; }
body .site-header :focus-visible, body footer :focus-visible, .fx-tabbar :focus-visible, .fx-sheet-head :focus-visible { outline-color: var(--fx-sun-soft) !important; box-shadow: none !important; }
body .site-header { background: linear-gradient(120deg, #0d4526 0%, #155c32 48%, #1f7d47 100%) !important; box-shadow: inset 0 -3px 0 var(--fx-sun), 0 8px 24px rgba(17, 30, 73, .2); }
body .site-header .brand { color: #ffd54a; }
body .site-header .fx-nav > a[aria-current=page] { background: var(--fx-sun); color: var(--fx-navy) !important; }
body .button.button-orange, body a.button.button-orange, body button.button.button-orange { background: var(--fx-forest) !important; color: #fff !important; }
body .button.button-dark, body button.button.button-dark { background: var(--fx-sun) !important; color: var(--fx-navy) !important; }

.fx-hero { color: var(--fx-navy); }
.fx-hero::before { opacity: .22; }
.fx-kicker { background: var(--fx-navy); color: #fff; letter-spacing: .06em; text-transform: uppercase; }
.fx-hero h1 { color: var(--fx-navy); }
.fx-hero h1 em { color: var(--fx-forest); }
.fx-lede, .fx-stats span { color: var(--fx-ink); }
.fx-hero .filter-bar { border: 2px solid var(--fx-navy); box-shadow: 0 4px 0 var(--fx-navy); }
.fx-hero .filter-bar > .button { background: var(--fx-forest) !important; color: #fff !important; }
.fx-classes span { color: var(--fx-navy); }
.fx-classes button { border: 2px solid var(--fx-navy); background: #fff; color: var(--fx-navy); box-shadow: 0 3px 0 var(--fx-navy); }
.fx-classes button:hover { border-color: var(--fx-navy); background: var(--fx-forest); color: #fff; }
.fx-stats { border-top-color: rgba(17, 30, 73, .22); }
.fx-stats b { color: var(--fx-coral-deep); }
.fx-note, .fx-note-a, .fx-note-b, .fx-note-c { border-color: var(--fx-navy); box-shadow: 0 4px 0 var(--fx-navy); }
.fx-note-a { background: var(--fx-forest); color: #fff; }
.fx-note-b { background: #fff; color: var(--fx-navy); }
.fx-note-c { background: var(--fx-coral-deep); color: #fff; }
.fx-note-c .fx-tick { background: #fff; color: var(--fx-coral-deep); }

#main-content .home-shortcuts .shell a { color: var(--fx-navy) !important; box-shadow: 0 4px 0 var(--fx-navy); }
#main-content .home-shortcuts .shell a:nth-child(1) { background: var(--fx-forest) !important; color: #fff !important; }
#main-content .home-shortcuts .shell a:nth-child(2) { background: var(--fx-sun) !important; }
#main-content .home-shortcuts .shell a:nth-child(3) { background: linear-gradient(120deg, #d9283b, #ab142b) !important; color: #fff !important; }
#main-content .home-shortcuts .shell a:nth-child(4) { background: var(--fx-navy) !important; color: #fff !important; }
#main-content .home-shortcuts .shell a strong, #main-content .home-shortcuts .shell a span { color: inherit !important; }
#resources .section-heading h2 { display: inline; box-shadow: inset 0 -.38em 0 var(--fx-sun-soft); }
body .result-count { background: var(--fx-navy); color: #fff; }

.class-resource-box.class-resource-box { --fx-tile: var(--fx-sun); --fx-tile-ink: var(--fx-navy); --fx-badge: var(--fx-navy); --fx-badge-ink: var(--fx-sun); }
.class-resource-box.class-resource-box:nth-child(4n+2) { --fx-tile: var(--fx-forest); --fx-tile-ink: #fff; --fx-badge: var(--fx-sun); --fx-badge-ink: var(--fx-navy); }
.class-resource-box.class-resource-box:nth-child(4n+3) { --fx-tile: var(--fx-coral-deep); --fx-tile-ink: #fff; --fx-badge: var(--fx-sun); --fx-badge-ink: var(--fx-navy); }
.class-resource-box.class-resource-box:nth-child(4n) { --fx-tile: var(--fx-navy); --fx-tile-ink: #fff; --fx-badge: var(--fx-sun); --fx-badge-ink: var(--fx-navy); }
#main-content .class-resource-box { border-color: var(--fx-navy); box-shadow: 0 3px 0 var(--fx-navy); }
#main-content .class-resource-heading, #main-content .class-resource-label, #main-content .class-resource-subjects, #main-content .class-resource-count, #main-content .class-resource-chevron { color: var(--fx-tile-ink) !important; }
#main-content .resource-group-class { background: var(--fx-badge) !important; color: var(--fx-badge-ink) !important; }
#main-content .resource-group-class::before { color: var(--fx-badge-ink) !important; }
body .resource-card:hover { border-color: var(--fx-forest); }
body .resource-access-label.resource-access-paid { background: var(--fx-sun-soft); color: var(--fx-navy); }

/* Chapter reader: marks are colour coded so students can scan a page */
body .qa-card { border-left: 5px solid var(--fx-navy); }
body .qa-card[data-reader-marks] { border-left-color: var(--fx-forest); }
body .qa-card[data-reader-marks="2"], body .qa-card[data-reader-marks="3"] { border-left-color: var(--fx-sun); }
body .qa-card[data-reader-marks="4"], body .qa-card[data-reader-marks="5"], body .qa-card[data-reader-marks="6"] { border-left-color: var(--fx-coral-deep); }
body .qa-card[data-reader-marks]::before { content: "Marks: " attr(data-reader-marks); float: right; margin: 0 0 4px 8px; padding: 1px 9px; border-radius: 999px; background: var(--fx-mint); color: var(--fx-forest-2); font-size: .72rem; font-weight: 800; }
body .qa-card[data-reader-marks="2"]::before, body .qa-card[data-reader-marks="3"]::before { background: var(--fx-sun-soft); color: var(--fx-navy); }
body .qa-card[data-reader-marks="4"]::before, body .qa-card[data-reader-marks="5"]::before, body .qa-card[data-reader-marks="6"]::before { background: var(--fx-coral-deep); color: #fff; }
body .qa-card .qa-number { display: inline-block; margin-right: 4px; padding: 0 8px; border-radius: 999px; background: var(--fx-navy); color: #fff; font-size: .78em; }
body .qa-card details summary { background: var(--fx-forest); color: #fff; }
body .qa-card details[open] summary { background: var(--fx-paper-dim); color: var(--fx-navy); }
body .fh-section-toc a { border-color: var(--fx-navy); }
body .fh-section-toc a:hover { background: var(--fx-sun-soft); }
.fx-title-meta { color: var(--fx-coral-deep); }

body .site-footer, body footer { background: var(--fx-navy) !important; box-shadow: inset 0 4px 0 var(--fx-sun); }
body .auth-card { box-shadow: 0 6px 0 var(--fx-forest-2); }
#main-content { color: var(--fx-ink); }
#main-content .eyebrow, #main-content .resource-group-chevron { color: var(--fx-coral-deep) !important; }
#main-content .store-hero .eyebrow { color: var(--fx-sun) !important; }
#main-content .resource-group, #main-content .trust-strip { border-color: var(--fx-line) !important; }
#main-content .resource-group-count { background: var(--fx-navy) !important; color: #fff !important; }
#main-content select { background-color: #fff; color: var(--fx-ink); }
body .site-header, body .site-header .nav-wrap, body .site-header .fx-actions { color: #fff; }
body .learning-study-notice, body .learning-study-notice a, body footer :is(p, span, small, li, summary, a) { color: #fff0d4 !important; }

/* Remaining older colours replaced with the Flying Hands palette */
#main-content :is(details, .prose, .tool-card, .source-card, .topic-test-card, .qa-toolbar, blockquote), body .learning-study-notice { border-color: var(--fx-line) !important; }
#main-content .qa-card { border-color: var(--fx-line) !important; border-left: 5px solid var(--fx-navy) !important; }
#main-content .qa-card[data-reader-marks] { border-left-color: var(--fx-forest) !important; }
#main-content .qa-card[data-reader-marks="2"], #main-content .qa-card[data-reader-marks="3"] { border-left-color: var(--fx-sun) !important; }
#main-content .qa-card[data-reader-marks="4"], #main-content .qa-card[data-reader-marks="5"], #main-content .qa-card[data-reader-marks="6"] { border-left-color: var(--fx-coral-deep) !important; }
#main-content .qa-extract-heading { border-color: var(--fx-line) !important; border-left-color: var(--fx-coral) !important; background: var(--fx-paper-dim) !important; }
#main-content select, #main-content .fh-learning-tools :is(select, button, a) { border-color: var(--fx-ink-2) !important; }
#main-content :is(label, small, .affiliate-note, .topic-test-hub, .topic-test-hub p, .topic-test-card, .fh-learning-tools), #main-content .fh-learning-tools :is(label, button:not(.button), a:not(.button)) { color: var(--fx-ink) !important; }
#main-content .topic-test-hub { border-color: var(--fx-navy) !important; background: var(--fx-paper-dim) !important; }
#main-content .topic-test-card { background: #fff !important; }
#main-content .button.button-light { border-color: var(--fx-navy) !important; background: #fff !important; color: var(--fx-navy) !important; }
#main-content .button.button-light:is([aria-pressed=true], .active, .is-active) { background: var(--fx-navy) !important; color: #fff !important; }
#main-content .resource-actions-top { background: transparent !important; }
#main-content .qa-toolbar { background: var(--fx-paper-dim) !important; }
#main-content .qa-section-nav { border-color: var(--fx-navy) !important; background: #fff !important; }
#main-content blockquote { background: var(--fx-paper-dim) !important; color: var(--fx-ink); }
#main-content .store-empty { border-color: var(--fx-ink-2) !important; }
#main-content .notice-warning, #main-content .notice-warning strong { background: var(--fx-paper-dim) !important; color: var(--fx-ink) !important; }
body [class*="continue-studying"]:not(a):not(button):not(span) { background: var(--fx-navy) !important; color: #fff !important; }
body .continue-studying-link, body .continue-studying-dismiss, body [class*="continue-studying"] span { color: #fff !important; }
body .continue-studying-link { display: inline-flex; align-items: center; min-height: 44px; }
body .continue-studying-dismiss { min-width: 44px; min-height: 44px; }
#main-content .fx-note b, #main-content .fx-note small { color: inherit !important; }
#main-content .detail-breadcrumb span { color: var(--fx-ink-2); }
body .learning-study-notice-panel { color: #fff0d4 !important; }
html body aside.continue-studying { background: var(--fx-navy) !important; background-image: none !important; }

/* Class and subject pages */
.fh-class-links, .fx-hub-links { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 18px auto; }
.fh-class-links strong, .fx-hub-links strong { margin-right: 4px; color: var(--fx-navy); }
.fh-class-links a, .fx-hub-links a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 14px; border: 2px solid var(--fx-navy); border-radius: 12px; background: #fff; box-shadow: 0 3px 0 var(--fx-navy); color: var(--fx-navy); font-weight: 800; text-decoration: none; }
.fh-class-links a:hover, .fx-hub-links a:hover { background: var(--fx-forest); color: #fff; }
.fx-hub .resource-group { margin: 18px 0; padding: 0; border: 0; }
.fx-hub .resource-group-subject a { color: var(--fx-navy); text-decoration-color: var(--fx-sun); text-decoration-thickness: 3px; }
.fx-hub .resource-card { min-height: 48px; }
.fx-hub .fh-learning-tools, .fx-hub .fh-sort, .fx-hub .fx-progress { display: none !important; }
/* Ask AI removed at the owner's request */
body .ai-floating-launcher, body .ai-study-panel, .fx-ai-btn { display: none !important; }

/* Levels: kids, school, college, university and competitive exams */
.fh-levels { padding: 14px 0 0; }
.fh-levels .shell { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
.fh-levels a { position: relative; display: flex; flex-direction: column; justify-content: center; min-height: 66px; padding: 10px 12px; border: 2px solid var(--fx-navy); border-radius: 12px; background: var(--fx-forest); box-shadow: 0 4px 0 var(--fx-navy); color: #fff; text-decoration: none; }
.fh-levels a strong { font-family: var(--fx-display); font-size: 1rem; line-height: 1.2; }
.fh-levels a span { margin-top: 1px; font-size: .82rem; line-height: 1.25; }
.fh-levels a.fh-level-soon { background: #fff; color: var(--fx-navy); }
.fh-levels a.fh-level-soon span { align-self: flex-start; margin-top: 4px; padding: 1px 8px; border-radius: 999px; background: var(--fx-sun-soft); font-size: .74rem; font-weight: 800; }
.fh-levels a:hover { transform: translateY(-1px); }
.fx-soon { margin: 14px 0; padding: 18px; border: 2px dashed var(--fx-navy); border-radius: 14px; background: var(--fx-paper-dim); }
.fx-soon strong { display: block; color: var(--fx-navy); font-family: var(--fx-display); font-size: 1.4rem; }
.fx-soon p { margin: 6px 0 12px; }
@media (max-width: 1040px) { .fh-levels .shell { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 720px) { .fh-levels { padding-top: 10px; } .fh-levels .shell { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; } .fh-levels a { min-height: 58px; padding: 8px 10px; } .fh-levels a strong { font-size: .92rem; } .fh-levels a:last-child { grid-column: 1 / -1; } }
/* The Continue reminder used the old orange through a stronger older rule. */
.fh-polished .continue-studying.continue-studying-popup.continue-studying, body .continue-studying.continue-studying-popup.continue-studying.continue-studying { background: var(--fx-navy) !important; background-image: none !important; color: #fff !important; }

/* Phone header: the full name "Flying Hands Learning" stays on one line. */
@media (max-width: 560px) {
  body .site-header .brand { font-size: clamp(.6rem, 3.05vw, .84rem); gap: 6px; white-space: nowrap; letter-spacing: -.015em; min-width: 0; }
  body .site-header .brand .fx-brand-rest { display: inline !important; }
  body .site-header .brand-logo { width: 28px; height: 28px; }
  body .site-header .nav-wrap { gap: 4px; }
  .fx-actions { gap: 0; }
  .fx-icon-btn { width: 38px; height: 42px; }
}
@media (max-width: 340px) {
  body .site-header .brand { font-size: 2.7vw; gap: 5px; }
  body .site-header .brand-logo { width: 24px; height: 24px; }
  .fx-icon-btn { width: 34px; }
}
