:root { font-family: "Segoe UI", Arial, sans-serif; color: #323232; background: #f7f7f7; font-size: 16px; }
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; display: flex; flex-direction: column; }
#app { min-height: 100vh; display: flex; flex-direction: column; }
a { color: #c30039; }
button { font: inherit; cursor: pointer; }
button:disabled { opacity: .5; cursor: not-allowed; }
:focus-visible { outline: 3px solid #ec9b00; outline-offset: 3px; }
main h1[tabindex="-1"]:focus { outline: none; }
.site-header { background: #323232; color: white; position: sticky; top: 0; z-index: 10; transition: background-color .75s ease, color .75s ease, box-shadow .75s ease; }
.site-header.is-compact { background: white; color: #323232; box-shadow: 0 2px 6px #0002; }
.header-inner { max-width: 1120px; min-height: 84px; margin: auto; padding: 14px 28px; display: flex; align-items: center; gap: 25px; flex-wrap: wrap; transition: min-height .75s ease, padding .75s ease; }
.is-compact .header-inner { min-height: 64px; padding-top: 8px; padding-bottom: 8px; }
.brand { display: flex; align-items: center; gap: 14px; color: inherit; text-decoration: none; margin-right: auto; }
.brand-logo { display: block; width: 112px; height: auto; transition: width .75s ease; }
.is-compact .brand-logo { width: 88px; }
.brand-copy { display: grid; gap: 2px; line-height: 1.15; }
.brand-copy strong { letter-spacing: .09em; font-size: .95rem; }
.brand-copy small { font-size: .8rem; color: #e3e3e3; transition: color .75s ease; }
.is-compact .brand-copy small { color: #6d6e70; }
.navigation { display: flex; gap: 24px; }
.navigation a { color: inherit; font-weight: 600; text-decoration: none; padding: 8px 0; }
.navigation a.active, .navigation a:hover { border-bottom: 3px solid #f3446b; }
.menu-toggle { display: none; width: 44px; height: 44px; background: none; border: 1px solid #999; padding: 10px; }
.menu-toggle span { display: block; height: 2px; margin: 4px 0; background: currentColor; }
.menu-toggle { color: inherit; }
.page-content { flex: 1; width: min(100% - 48px, 1032px); margin: 48px auto 80px; }
.hero { background: #c30039; color: white; padding: clamp(38px, 8vw, 80px); min-height: 300px; display: flex; flex-direction: column; justify-content: center; }
.hero h1 { font-size: clamp(2.2rem, 6vw, 4.5rem); line-height: 1.02; max-width: 700px; margin: 14px 0 20px; letter-spacing: -.04em; }
.hero p:last-child { font-size: 1.2rem; margin: 0; }
.home-page { overflow: hidden; background: white; }
.home-page .hero { min-height: 270px; }
.home-page .intro-panel { max-width: none; margin: 0; position: static; border: 0; padding: clamp(24px, 5vw, 48px); }
.home-page .intro-panel h2 { margin: 10px 0; }
.home-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; }
.home-actions .button { min-width: 220px; min-height: 54px; display: inline-flex; justify-content: center; align-items: center; text-align: center; text-decoration: none; }
.home-actions .home-primary { min-width: min(100%, 300px); }
.home-help { margin: 24px 0 0; }
.eyebrow { margin: 0; text-transform: uppercase; letter-spacing: .16em; font-weight: 700; font-size: .75rem; }
.eyebrow.dark { color: #a20030; }
.intro-panel, .card { background: white; border: 1px solid #dedede; padding: clamp(24px, 4vw, 38px); }
.intro-panel { max-width: 780px; margin: -20px 0 0 30px; position: relative; border-top: 4px solid #323232; }
.intro-panel p, .card p, .page-heading p { line-height: 1.6; }
h1, h2, h3 { line-height: 1.15; }
.intro-panel h2, .card h2 { margin-top: 12px; }
.text-link { display: inline-block; margin-top: 14px; font-weight: 700; }
.page-heading { margin-bottom: 32px; }
.page-heading h1 { font-size: clamp(2rem, 5vw, 3.3rem); margin: 10px 0; letter-spacing: -.03em; }
.page-heading > p:last-child { color: #6d6e70; }
.card { margin: 20px 0; border-top: 4px solid #c30039; }
.facts { margin: 24px 0; }
.facts div { display: flex; gap: 16px; padding: 10px 0; border-bottom: 1px solid #dedede; }
.facts dt { width: 190px; flex-shrink: 0; font-weight: 700; }
.facts dd { margin: 0; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; }
.button { min-height: 44px; padding: 10px 18px; border: 1px solid #c30039; background: #c30039; color: white; font-weight: 700; }
.actions a.button { display: inline-flex; align-items: center; text-decoration: none; }
.button.secondary { color: #323232; background: white; border-color: #999; }
.button.danger { background: #a51d2d; }
.button:hover:not(:disabled) { filter: brightness(.92); }
.flashcard-answer { font-size: 1.5rem; font-weight: 700; overflow-wrap: anywhere; }
.hint { font-size: .9rem; color: #6d6e70; }
.danger-zone h3 { margin-top: 36px; }
.confirmation { border-left: 4px solid #a51d2d; padding: 4px 16px 16px; margin: 18px 0; background: #fff5f6; }
.status { min-height: 1.5em; font-weight: 600; }
.catalog-filters { display: flex; flex-wrap: wrap; gap: 16px; }
.catalog-filters div { display: grid; gap: 6px; flex: 1 1 220px; }
.catalog-filters label { font-weight: 700; }
.catalog-filters input, .catalog-filters select { width: 100%; min-height: 44px; padding: 8px; border: 1px solid #999; background: white; color: inherit; font: inherit; }
.catalog-table-wrap { overflow-x: auto; container-type: inline-size; }
.catalog-table { width: 100%; border-collapse: collapse; }
.catalog-table th, .catalog-table td { padding: 12px; text-align: left; border-bottom: 1px solid #dedede; vertical-align: middle; overflow-wrap: anywhere; }
.catalog-table audio { width: 240px; max-width: 100%; }
.catalog-progress-cell { font-weight: 700; }
.catalog-details-toggle { display: flex; align-items: center; gap: .4em; min-height: 32px; padding: 4px 0; border: 0; background: none; color: #58595b; font-size: .875rem; }
.catalog-details-toggle:hover { text-decoration: underline; }
.catalog-details-toggle::before { content: ""; border-block: .28em solid transparent; border-left: .38em solid currentColor; }
.catalog-details-toggle[aria-expanded="true"]::before { transform: rotate(90deg); }
.catalog-table .catalog-detail-row > td { padding: 0; background: #f7f7f7; }
.catalog-history { contain: inline-size; max-width: 100cqw; padding: 12px 16px; font-size: .9rem; }
.catalog-history > p { margin: 0; }
.catalog-history-summary { margin: 0 0 12px; }
.catalog-history-summary div { display: flex; gap: 12px; padding: 5px 0; }
.catalog-history-summary dt { font-weight: 700; }
.catalog-history-summary dd { margin: 0; }
.attempt-history { padding-left: 20px; margin: 8px 0 0; }
.attempt-history li { padding: 4px 0; }
.catalog-storage-warning { padding: 10px 14px; border-left: 4px solid #a51d2d; background: #fff5f6; }
.site-footer { background: #c30039; color: white; padding: 28px 24px; }
.site-footer div { max-width: 1032px; margin: auto; display: flex; justify-content: space-between; gap: 16px; }
#blazor-error-ui { display: none; position: fixed; bottom: 0; background: #fff4ce; padding: 16px; width: 100%; z-index: 100; }
#blazor-error-ui .dismiss { float: right; border: 0; padding: 0; background: transparent; color: inherit; cursor: pointer; }
.app-startup { width: min(100% - 32px, 520px); margin: clamp(56px, 16vh, 170px) auto 32px; text-align: center; }
.app-startup h1 { margin: .45em 0; font-size: clamp(1.6rem, 6vw, 2.5rem); }
.app-startup-spinner { display: block; width: 42px; height: 42px; margin: 0 auto 24px; border-radius: 50%; border: 4px solid #edd9df; border-top-color: #c30039; animation: app-startup-spin .85s linear infinite; }
@keyframes app-startup-spin { to { transform: rotate(360deg); } }
@media (max-width: 64rem) {
  .menu-toggle { display: block; }
  .navigation { display: none; width: 100%; flex-direction: column; gap: 2px; padding-bottom: 8px; }
  .navigation.is-open { display: flex; }
  .navigation a { padding: 12px 0; }
}
@media (max-width: 600px) {
  .header-inner { padding: 12px 18px; min-height: 72px; }
  .page-content { width: calc(100% - 32px); margin: 28px auto 48px; }
  .intro-panel { margin: -12px 12px 0; }
  .home-page .hero { min-height: 230px; padding: 30px 22px; }
  .home-page .intro-panel { margin: 0; padding: 24px 20px; }
  .home-actions { display: grid; grid-template-columns: minmax(0, 1fr); }
  .home-actions .button, .home-actions .home-primary { min-width: 0; width: 100%; }
  .facts div { display: block; }
  .facts dd { margin-top: 5px; }
  .site-footer div { flex-direction: column; }
  .catalog-table { min-width: 880px; }
  .catalog-history-summary div { display: block; }
  .catalog-history-summary dd { margin-top: 3px; }
}
@media (prefers-reduced-motion: reduce) {
  .site-header, .header-inner, .brand-copy small, .brand-logo { transition: none; }
  .app-startup-spinner { animation: none; }
}
