:root {
  --qem-ink: #102858;
  --qem-blue: #1264d8;
  --qem-blue-deep: #0b3478;
  --qem-muted: #607795;
  --qem-line: #d9e7f5;
  --qem-surface: #fff;
  --qem-soft: #f3f8fe;
}

html { scroll-behavior: smooth; }
body { margin: 0; background: #fbfdff; color: var(--qem-ink); font-family: "Segoe UI", Arial, sans-serif; }
a { color: var(--qem-blue); }
a:focus-visible, button:focus-visible, input:focus-visible { outline: 3px solid #72a8ff; outline-offset: 3px; }

.site-header { position: relative; z-index: 2; background: rgba(255,255,255,.96); border-bottom: 1px solid #e3edf8; }
.header-inner, .footer-inner { width: min(1120px, calc(100% - 40px)); margin-inline: auto; }
.header-inner { min-height: 62px; display: flex; align-items: center; gap: 22px; }
.brand-lockup, .footer-brand { display: inline-flex; align-items: center; gap: 10px; color: var(--qem-ink); text-decoration: none; flex: 0 0 auto; }
.brand-mark { width: 27px; height: 34px; fill: var(--qem-blue); }
.brand-image { display: block; width: auto; height: 46px; max-width: min(248px, 42vw); object-fit: contain; }
.header-tagline { color: #7186a1; font-size: .78rem; padding-left: 2px; }
.header-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; margin-left: auto; }
.header-pill { min-height: 36px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 0 13px; border: 1px solid #d8e5f3; border-radius: 9px; background: #fff; color: #26466d; text-decoration: none; font-size: .82rem; white-space: nowrap; transition: background .16s ease, border-color .16s ease, color .16s ease; }
.header-pill:hover, .header-pill.is-current { background: #eaf3ff; border-color: #bfd8fa; color: #075bc8; }
.header-logout { display: inline-flex; margin: 0; }
.header-logout button { font: inherit; cursor: pointer; }

.home-main { width: 100%; }
.home-hero { position: relative; overflow: hidden; min-height: 390px; border-bottom: 1px solid #dceafa; background: linear-gradient(108deg, #f7fbff 0%, #edf6ff 43%, #e8f4ff 100%); }
.home-hero-inner { width: min(1440px, calc(100% - 48px)); min-height: 410px; margin: auto; position: relative; display: grid; grid-template-columns: minmax(0, 45fr) minmax(0, 55fr); align-items: stretch; }
.home-hero-copy { min-width: 0; position: relative; z-index: 1; align-self: center; padding: 34px 20px 32px 0; }
.home-kicker { margin: 0 0 8px; color: #2868b9; font-size: .69rem; font-weight: 800; letter-spacing: .24em; text-transform: uppercase; }
.home-kicker span { color: #84a8d5; padding-inline: 3px; }
.home-hero h1 { margin: 0; color: #102f6b; font: 700 clamp(2.7rem, 5.3vw, 4.3rem)/.98 Georgia, "Times New Roman", serif; letter-spacing: -.045em; }
.home-hero h2 { margin: 5px 0 4px; color: #102858; font: 700 clamp(1.05rem, 2vw, 1.42rem)/1.25 Georgia, "Times New Roman", serif; }
.home-hero-description { max-width: 550px; margin: 0 0 11px; color: #4f6888; font-size: .9rem; line-height: 1.48; }
.home-search { min-height: 49px; max-width: 575px; display: flex; align-items: center; gap: 11px; padding: 4px 5px 4px 14px; background: #fff; border: 1px solid #86b7f4; border-radius: 12px; box-shadow: 0 4px 13px rgba(19,83,159,.08); }
.home-search svg { width: 20px; height: 20px; flex: 0 0 auto; fill: none; stroke: #1769d2; stroke-width: 2; }
.home-search input { flex: 1; min-width: 0; border: 0; outline: 0; color: var(--qem-ink); font: inherit; font-size: .86rem; }
.home-search input::placeholder { color: #7587a0; opacity: 1; }
.home-search input:focus-visible { outline: none; }
.home-search:focus-within { outline: 3px solid #b8d7ff; outline-offset: 2px; }
.home-search button { min-height: 39px; flex: 0 0 auto; padding: 0 19px; border: 0; border-radius: 8px; background: var(--qem-blue); color: #fff; font-size: .82rem; font-weight: 700; }
.home-search button:hover { background: #0b55bb; }
.search-examples { margin: 6px 0 9px; color: #657d9d; font-size: .72rem; }
.search-examples a { color: #305986; text-decoration: none; }
.search-examples a:hover { text-decoration: underline; }
.home-benefits { display: flex; flex-wrap: wrap; gap: 7px; list-style: none; margin: 0; padding: 0; }
.home-benefits li { display: inline-flex; align-items: center; gap: 6px; padding: 4px 9px; border: 1px solid rgba(202,222,244,.72); border-radius: 99px; background: rgba(255,255,255,.7); color: #31577f; font-size: .69rem; }
.home-benefits li span { color: #1769d2; font-size: .85rem; }

.home-hero__media { position: relative; min-width: 0; min-height: 390px; overflow: hidden; align-self: stretch; }
.home-hero__media::before { position: absolute; z-index: 1; inset: 0 auto 0 0; width: 20%; background: linear-gradient(90deg, #edf6ff 0%, rgba(237,246,255,.68) 35%, transparent 100%); content: ""; pointer-events: none; }
.home-hero__image { display: block; width: 100%; height: 100%; min-height: 390px; object-fit: cover; object-position: 60% center; }

.home-content { width: min(1120px, calc(100% - 40px)); margin: 0 auto; padding: 18px 0 36px; }
.alphabet-section { margin-bottom: 16px; }
.home-section-heading { margin-bottom: 10px; align-items: center; }
.home-section-heading h2 { margin: 0; color: var(--qem-ink); font: 700 1.22rem/1.2 Georgia, "Times New Roman", serif; letter-spacing: -.01em; }
.home-section-heading p { margin: 3px 0 0; color: var(--qem-muted); font-size: .79rem; }
.heading-with-icon { display: flex; align-items: center; gap: 13px; }
.section-symbol { display: grid; width: 30px; height: 34px; place-items: center; color: #1769d2; font-size: 1.45rem; line-height: 1; }
.section-symbol.flame { color: #e9802b; }
.section-symbol.plus { font-size: 1.8rem; }
.section-symbol.bulb { color: #e2a000; }
.section-count { color: #657d9d; font-size: .75rem; white-space: nowrap; }
.alphabet-nav { display: flex; gap: 7px; overflow-x: auto; padding: 1px 1px 6px; scrollbar-color: #c5d9f0 transparent; scrollbar-width: thin; }
.alphabet-letter { display: inline-flex; flex: 1 0 32px; min-width: 32px; height: 32px; align-items: center; justify-content: center; border: 1px solid #d8e5f3; border-radius: 8px; background: #fff; color: #1769d2; font-size: .78rem; font-weight: 700; text-decoration: none; transition: background .15s ease, border-color .15s ease, transform .15s ease; }
.alphabet-letter:hover, .alphabet-letter:focus-visible { transform: translateY(-1px); border-color: #8ebbf0; background: #eaf3ff; color: #0a4fae; }
.alphabet-letter.disabled { background: #f1f5f9; color: #a5b1c0; }

.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin: 14px 0 20px; }
.stat-card { display: flex; flex-direction: row; min-width: 0; min-height: 70px; align-items: center; gap: 13px; padding: 11px 14px; border: 1px solid #dce8f5; border-radius: 12px; background: #fff; box-shadow: 0 4px 14px rgba(33,73,119,.035); }
.stat-icon { display: grid; width: 42px; height: 42px; flex: 0 0 auto; place-items: center; border-radius: 12px; background: #e4f0ff; color: #1264d8; font-size: 1.35rem; font-weight: 700; }
.stat-card div { display: flex; min-width: 0; flex-direction: column; gap: 2px; }
.stat-card strong { color: var(--qem-ink); font: 700 1.48rem/1 Georgia, "Segoe UI", sans-serif; }
.stat-card div span { color: #607795; font-size: .73rem; line-height: 1.25; }
.stat-green { background: #f2fbf8; border-color: #d8eee6; }.stat-green .stat-icon { background: #dcf5e9; color: #159768; }
.stat-violet { background: #f8f6ff; border-color: #e8e2fb; }.stat-violet .stat-icon { background: #eee9ff; color: #7050ca; }
.stat-gold { background: #fffaf0; border-color: #f6ebcf; }.stat-gold .stat-icon { background: #fff0c8; color: #d49300; }

.word-section { margin-top: 20px; }
.section-link { color: #075fc8; font-size: .76rem; text-decoration: none; white-space: nowrap; }
.section-link:hover { text-decoration: underline; }
.section-link span { margin-left: 4px; font-size: 1rem; }
.word-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
.word-card { position: relative; display: flex; min-width: 0; min-height: 142px; flex-direction: column; padding: 13px 13px 11px 48px; border: 1px solid #e0eaf5; border-radius: 11px; background: var(--qem-surface); box-shadow: 0 4px 15px rgba(31,72,121,.045); color: var(--qem-ink); transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease; }
.word-card:hover { transform: translateY(-2px); border-color: #aacbf1; box-shadow: 0 8px 20px rgba(31,72,121,.09); }
.word-card-icon { position: absolute; top: 13px; left: 12px; display: grid; width: 32px; height: 32px; place-items: center; border-radius: 9px; background: #e8f2ff; color: #1264d8; font-size: 1rem; }
.word-card-category { overflow: hidden; color: #2365ab; font-size: .68rem; line-height: 1.3; text-overflow: ellipsis; white-space: nowrap; }
.word-card h3 { margin: 3px 0 4px; color: #172e53; font-size: .94rem; font-weight: 700; line-height: 1.2; }
.word-card h3 a { color: inherit; text-decoration: none; }
.word-card p { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; margin: 0 0 7px; color: #687e98; font-size: .72rem; line-height: 1.38; }
.word-card-link { width: fit-content; margin-top: auto; color: #075fc8; font-size: .7rem; text-decoration: none; }
.word-card-link:hover { text-decoration: underline; }
.word-card-link span { font-size: .9rem; }
.empty-note { margin: 0; padding: 13px 16px; border: 1px solid #dce8f5; border-radius: 10px; background: #f6faff; color: #607795; font-size: .83rem; }
.discover-section { padding-bottom: 8px; }

.page-main { width: min(1120px, calc(100% - 40px)); min-height: 55vh; margin: 0 auto; padding: 34px 0 48px; }
.page-main .word-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.page-main .word-card { min-height: 160px; }
.word-detail h1, .page-heading h1 { color: var(--qem-ink); }

.site-footer { margin-top: 0; padding: 0; border-top: 1px solid #dbe8f5; background: #f2f7fd; color: inherit; font-size: inherit; text-align: left; }
.footer-inner { min-height: 110px; display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 24px; padding-block: 18px; }
.footer-brand { display: block; width: min(100%, 340px); justify-self: start; }
.footer-logo { display: block; width: 100%; height: auto; max-width: 100%; object-fit: contain; }
.footer-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px 19px; }
.footer-links a, .footer-credit { color: #607795; font-size: .72rem; text-decoration: none; }
.footer-links a:hover, .footer-credit a:hover { color: #075fc8; text-decoration: underline; }
.footer-credit { margin: 0; text-align: right; line-height: 1.65; white-space: nowrap; }
.footer-credit a { color: #42688f; }

@media (min-width: 1440px) {
  .home-hero-inner { width: min(1400px, calc(100% - 48px)); }
  .home-hero__media { margin-right: calc((100vw - 100%) / -2); }
}
@media (max-width: 1050px) {
  .header-inner { flex-wrap: wrap; gap: 8px 15px; padding-block: 9px; }
  .header-actions { gap: 5px; }
  .header-pill { padding-inline: 9px; font-size: .76rem; }
  .home-hero-inner { width: min(100% - 40px, 960px); grid-template-columns: minmax(0, 52fr) minmax(0, 48fr); min-height: 390px; }
  .home-hero { min-height: 370px; }
  .home-hero-copy { padding-right: 12px; }
  .home-hero__media, .home-hero__image { min-height: 350px; }
  .home-hero__image { object-position: 64% center; }
  .word-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .footer-inner { grid-template-columns: minmax(0, 1fr) auto; gap: 14px 24px; }
  .footer-brand { width: min(100%, 270px); }
  .footer-links { grid-column: 1 / -1; grid-row: 2; justify-content: center; gap: 10px 17px; }
  .footer-credit { grid-column: 2; grid-row: 1; }
}
@media (max-width: 767.98px) {
  .header-inner, .home-hero-inner, .home-content, .footer-inner, .page-main { width: min(100% - 28px, 620px); }
  .header-inner { min-height: unset; padding-block: 10px; }
  .brand-image { height: 35px; max-width: min(190px, 48vw); }
  .header-tagline { display: none; }
  .header-actions { flex: 1 0 100%; justify-content: flex-start; overflow-x: auto; padding: 1px 0 3px; }
  .header-pill { min-height: 33px; }
  .home-hero, .home-hero-inner { min-height: 0; }
  .home-hero-inner { display: grid; grid-template-columns: minmax(0, 1fr); padding-block: 25px 18px; }
  .home-hero-copy { width: 100%; padding: 0; }
  .home-hero h1 { font-size: clamp(2.5rem, 10vw, 3.55rem); }
  .home-hero-description { max-width: 520px; }
  .home-hero__media { min-height: 0; height: clamp(190px, 48vw, 300px); margin-top: 20px; border-radius: 15px; }
  .home-hero__media::before { width: 12%; background: linear-gradient(90deg, rgba(237,246,255,.7), transparent); }
  .home-hero__image { min-height: 0; height: 100%; object-position: 66% center; }
  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .word-grid, .page-main .word-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .footer-inner { display: flex; flex-direction: column; align-items: center; gap: 16px; padding-block: 20px; text-align: center; }
  .footer-brand { width: min(100%, 240px); }
  .footer-links { order: 0; justify-content: center; gap: 10px 16px; }
  .footer-credit { margin: 0; text-align: center; white-space: normal; }
}
@media (max-width: 479.98px) {
  .header-inner, .home-hero-inner, .home-content, .footer-inner, .page-main { width: calc(100% - 28px); }
  .header-pill { padding-inline: 8px; font-size: .71rem; }
  .home-kicker { font-size: .6rem; letter-spacing: .18em; }
  .home-hero h1 { font-size: clamp(2.3rem, 11vw, 3rem); }
  .home-hero h2 { font-size: 1.08rem; }
  .home-search { gap: 7px; padding-left: 10px; }
  .home-search input { font-size: .76rem; }
  .home-search button { padding-inline: 11px; font-size: .72rem; }
  .search-examples { line-height: 1.5; }
  .home-benefits { gap: 5px; }
  .home-benefits li { padding-inline: 7px; font-size: .63rem; }
  .home-hero__media { height: 190px; margin-top: 17px; }
  .home-section-heading { align-items: flex-start; }
  .heading-with-icon { gap: 8px; }
  .home-section-heading h2 { font-size: 1.08rem; }
  .home-section-heading p { max-width: 30ch; font-size: .73rem; }
  .section-count { font-size: .67rem; }
  .alphabet-nav { gap: 6px; }
  .alphabet-letter { flex-basis: 34px; min-width: 34px; height: 34px; }
  .stats-grid { gap: 8px; }
  .stat-card { min-height: 67px; gap: 9px; padding: 9px; }
  .stat-icon { width: 35px; height: 35px; border-radius: 10px; }
  .stat-card strong { font-size: 1.28rem; }
  .stat-card div span { font-size: .64rem; }
  .word-grid, .page-main .word-grid { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .word-card { min-height: 123px; }
  .footer-brand { width: min(100%, 220px); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; }
}
.public-directory { padding: clamp(2rem, 5vw, 4.5rem) 0; }
.public-directory__intro { margin-bottom: 2rem; }
.public-directory h1 { color: #12335b; font-size: clamp(2rem, 4vw, 3.25rem); margin: .5rem 0; }
.public-directory p { color: #5b7190; max-width: 680px; }
.eyebrow { color: #2477dc; font-size: .75rem; font-weight: 700; letter-spacing: .14em; }
.alphabet-grid { display: grid; grid-template-columns: repeat(13, minmax(44px, 1fr)); gap: .75rem; }
.alphabet-grid a, .alphabet-grid span { display: grid; place-items: center; aspect-ratio: 1; border: 1px solid #dbe8f5; border-radius: 14px; color: #145cc4; background: #fff; font-weight: 700; text-decoration: none; box-shadow: 0 6px 18px rgba(35,87,140,.08); }
.alphabet-grid .is-disabled { color: #aebdce; background: #f4f8fc; }
.directory-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1rem; margin-top: 2rem; }
.directory-card { display:block; padding: 1.4rem; border:1px solid #dfeaf5; border-radius:16px; background:#fff; text-decoration:none; color:#12335b; box-shadow:0 8px 24px rgba(33,74,115,.08); }
.directory-card h2, .directory-card h3 { margin:0 0 .65rem; font-size:1.2rem; }.directory-card span { color:#5d7694; font-size:.9rem; }.directory-card b { color:#1f73da; float:right; }
.directory-cards--compact { margin-top: 0; }.word-card-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(240px,1fr)); gap:1rem; margin-top:2rem; }
.word-card { display:block; padding:1.4rem; border:1px solid #dfeaf5; border-radius:16px; background:#fff; color:#12335b; text-decoration:none; }.word-card h2 { margin:.35rem 0; }.word-card p { margin:0; }.word-card__rank { color:#2477dc; font-size:.8rem; font-weight:700; }
.about-page__grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:1rem; margin-top:2rem; }.about-page article { padding:1.5rem; border:1px solid #dfeaf5; border-radius:16px; background:#fff; }
@media (max-width: 700px) { .alphabet-grid { grid-template-columns:repeat(7,minmax(38px,1fr)); gap:.5rem; }.about-page__grid { grid-template-columns:1fr; } }
