:root {
    color-scheme: light;
    --navy: #215b87;
    --accent: var(--navy);
    --brand-background: var(--navy) linear-gradient(to right, #1b598f, #2f7da4);
    --ink: #363636;
    --muted: #666;
    --border: #e2e2e2;
    --control-border: #949494;
    --panel: #fff;
    --soft: #f6f6f6;
    --preview-shade: linear-gradient(0deg, #080808f5, #080808d9 12%, transparent 58%);
    --selected-bg: #dedede;
    --popover-shadow: 0 6px 20px #0002;
    --success: #176346;
    --warning: #844604;
    --danger: #9d3040;
    --layout-width: 1468px;
    --page-gutter: 16px;
    --floating-right: max(12px, env(safe-area-inset-right));
    --section-gap: 20px;
    --item-gap: 12px;
}
* { box-sizing: border-box; }
body {
    margin: 0; min-height: 100vh; display: flex; flex-direction: column;
    background: var(--brand-background);
    color: var(--ink); font: 14px/1.45 "Segoe UI", "Malgun Gothic", "Apple SD Gothic Neo", sans-serif;
    overflow-wrap: anywhere;
}
@media screen and (prefers-reduced-motion: no-preference) {
    body { animation: page-enter .3s ease-out; }
    @keyframes page-enter { from { opacity: 0; } to { opacity: 1; } }
}
a { color: inherit; text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
button, summary { cursor: pointer; }
button:disabled { opacity: .55; cursor: default; }
img { max-width: 100%; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; }
.container { width: min(var(--layout-width), calc(100% - 2 * var(--page-gutter))); margin-inline: auto; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.icon-definitions { position: absolute; pointer-events: none; }
.inline-icon { stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; vertical-align: middle; flex: none; }
.icon-star { fill: currentColor; stroke: none; }
summary { list-style: none; }
summary::-webkit-details-marker { display: none; }
#header {
    background: url("../icons/pattern.webp"), var(--brand-background);
}
.top-strip { background: var(--navy); color: white; }
.top-strip .container { min-height: 40px; display: flex; align-items: center; gap: 8px; font-weight: 750; }
.top-strip h1, .top-strip a { color: inherit; font: inherit; margin: 0; }
.masthead { position: relative; height: 177px; }
.masthead::after {
    content: ""; position: absolute; right: 0; bottom: 0; width: 256px; height: 217px;
    background: url("../icons/mascot.webp") bottom right / contain no-repeat; pointer-events: none;
}
.wordmark { display: inline-flex; height: 112px; transform: scaleX(1.24); transform-origin: left center; align-items: center; gap: 5px; text-decoration: none; }

.wordmark:hover { text-decoration: none; }
.wordmark img { display: block; width: 84px; height: 84px; filter: drop-shadow(0 5px 0 #173557); }
.wordmark > span {
    font: 1000 83px/.98 "Arial Black", "Malgun Gothic", sans-serif; letter-spacing: -.075em; white-space: nowrap;
    color: #fff; -webkit-text-stroke: 9px #2261a0; paint-order: stroke fill;
    filter: drop-shadow(0 3px 0 #173b67) drop-shadow(0 4px 0 #142e51);
}
.wordmark b { color: #c9f000; font-weight: inherit; }
.toolbelt { position: absolute; z-index: 2; left: 0; right: 264px; bottom: 10px; display: flex; align-items: center; gap: 10px; }
#content-search { flex: 0 1 560px; min-width: 160px; position: relative; }
#search-input { width: 100%; height: 40px; padding: 0 40px 0 11px; border: 2px solid var(--control-border); border-radius: 0; background: var(--panel); font-size: 14px; }
#content-search button { display: grid; place-items: center; position: absolute; right: 2px; top: 2px; height: 36px; width: 38px; border: 0; background: var(--panel); }
#directory-tools { display: flex; flex: none; align-items: center; gap: 4px; }
.tool-circle { display: inline-flex; flex: none; align-items: center; justify-content: center; text-align: center; width: 40px; height: 40px; border: 0; border-radius: 50%; padding: 3px; background: var(--panel); color: var(--ink); font-size: 11px; line-height: 1.12; font-weight: bold; box-shadow: 0 1px 4px #0003; }
.tool-circle:is(:hover, :focus-visible, [aria-current]) { background: var(--soft); text-decoration: none; }
.shortcut, .category-links a { font-size: 10px; }
/* Move shortcuts into the desktop overflow menu as the header narrows. */
.menu-group .category-links > :where(:nth-child(-n+9)) { display: none; }
@media (max-width: 1439px) {
    :nth-child(8 of .shortcut) { display: none; }
    .menu-group .category-links > :nth-child(8) { display: inline-flex; }
}
@media (max-width: 1483px) {
    :nth-child(9 of .shortcut) { display: none; }
    .menu-group .category-links > :nth-child(9) { display: inline-flex; }
}
.menu-group { position: relative; display: flex; gap: 4px; }
.menu-toggle { order: 1; font-size: 23px; }
.drawer-only { display: none; }
.menu-group .category-links { position: absolute; z-index: 9; top: calc(100% + 4px); right: 0; padding: 8px; display: none; grid-template-columns: repeat(6, max-content); gap: 6px; border-radius: 5px; border: 1px solid var(--border); background: var(--soft); box-shadow: var(--popover-shadow); }
.menu-group .category-links a { border: 1px solid var(--control-border); }
.menu-toggle[aria-expanded="true"] + #directory-tools .category-links { display: grid; }
#base-content { flex: 1; padding-block: var(--section-gap); }
.sheet { padding: var(--section-gap) 24px; background: var(--panel); border-radius: 16px; }
.crumb { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 0 0 var(--item-gap); min-height: 22px; color: var(--muted); font-size: 13px; }
.crumb a { color: var(--ink); }
.page-heading { font-size: 26px; line-height: 1.25; margin: 0 0 var(--item-gap); }
.page-heading::before { content: ""; display: inline-block; width: 5px; height: .8em; margin-right: 10px; background: var(--accent); border-radius: 3px; }
.search-summary, .empty-message, .activity-time { color: var(--muted); }
.empty-message { margin: 0; padding-block: 4px; }
.primary-action { display: inline-grid; place-items: center; padding: 10px 16px; border: 0; border-radius: 10px; background: var(--accent); color: white; font-weight: 700; text-align: center; }
.primary-action:hover { filter: brightness(.88); text-decoration: none; }
.error-page { text-align: center; }
.error-page h1 { font: 700 clamp(100px, 16vw, 208px)/1 "Segoe UI", sans-serif; color: var(--accent); margin: 0; }
.error-page p { font-size: 18px; margin: var(--item-gap) 0 var(--section-gap); }
.activity-item a, .about-page p a, .submission-reply p a, .empty-message a { text-decoration: underline; text-underline-offset: .15em; }
.activity-item { padding: 10px 0; border-bottom: 1px solid var(--border); }
.site-footer { padding-block: var(--item-gap); color: white; font-size: 13px; }
.site-footer .container, .site-footer nav { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; }
.site-footer nav a, .site-footer nav button { color: inherit; background: none; border: 0; padding: 0; }
.site-footer :focus-visible, .menu-toggle:focus-visible, .wordmark:focus-visible { outline-color: white; }
.site-footer header { flex: 1 1 32rem; }
.site-footer .container > div { margin-inline-start: auto; text-align: end; }
.site-footer nav { justify-content: flex-end; margin-bottom: 4px; }
.site-footer header a { font-size: 18px; font-weight: 700; }
.site-footer p { max-width: 80ch; margin: 4px 0; word-break: keep-all; }
.site-footer small { font-size: inherit; }
.page-jump { position: fixed; z-index: 4; right: var(--floating-right); bottom: max(16px, env(safe-area-inset-bottom)); display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 50%; color: white; background: transparent; }
.page-jump[data-up] .jump-arrow { transform: rotate(180deg); transform-origin: 22px 22px; }
.jump-progress[stroke-dashoffset="100"] { visibility: hidden; }
@media (min-width: 1561px) {
    :root { --floating-right: calc((100% - var(--layout-width)) / 4 - 22px); }
    .page-jump { top: 50%; bottom: auto; transform: translateY(-50%); }
}
#site-notice { position: fixed; z-index: 20; bottom: 18px; left: 50%; transform: translateX(-50%); background: var(--ink); color: white; border-radius: 5px; padding: 8px 14px; opacity: 0; pointer-events: none; }
#site-notice.visible { opacity: 1; }
@media (min-width: 961px) and (max-width: 1100px) {
    #header { padding-bottom: 52px; }
    .toolbelt { right: 0; bottom: -44px; }
}
@media (max-width: 960px) {
    :root { --page-gutter: 8px; --section-gap: 14px; --item-gap: 8px; }
    #header { position: sticky; top: 0; z-index: 15; }
    .top-strip, .masthead::after { display: none; }
    .masthead { height: 56px; display: flex; align-items: center; gap: 6px; }
    .wordmark { flex: none; width: 44px; height: 44px; justify-content: center; transform: none; }
    .wordmark img { width: 32px; height: 32px; filter: none; }
    .wordmark > span { display: none; }
    .toolbelt { position: static; flex: 1; min-width: 0; gap: 6px; }
    #content-search { flex: 1; min-width: 0; }
    #search-input { font-size: 16px; }
    .menu-group { position: static; }
    .page-jump { --accent: var(--ink); left: max(12px, env(safe-area-inset-left)); right: auto; background: var(--accent); box-shadow: var(--popover-shadow); }
    .menu-toggle.tool-circle { width: 44px; height: 44px; background: transparent; color: white; box-shadow: none; font-size: 26px; }
    .menu-group #directory-tools { display: none; }
    html:has(#menu-drawer[open]) { overflow: hidden; }
    #menu-drawer { position: fixed; inset: 0 auto 0 0; width: min(270px, 84vw); height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; background: var(--ink); color: white; }
    #menu-drawer[open] { display: flex; flex-direction: column; }
    #menu-drawer::backdrop { background: #0006; }
    .drawer-heading { display: flex; align-items: center; justify-content: space-between; padding: env(safe-area-inset-top) 6px 0 16px; min-height: 56px; background: var(--navy); }
    .drawer-heading strong { font-size: 18px; }
    .drawer-heading button { width: 44px; height: 44px; border: 0; background: none; font-size: 24px; }
    #menu-drawer #directory-tools { display: block; flex: 1; overflow-y: auto; overscroll-behavior: contain; padding-bottom: env(safe-area-inset-bottom); }
    #menu-drawer .category-links .drawer-only { display: inline; }
    #directory-tools .shortcut, #menu-drawer br { display: none; }
    #menu-drawer :where(#directory-tools > a:not(.shortcut), [data-pwa-install], .category-links a) { display: flex; align-items: center; justify-content: flex-start; gap: 6px; width: 100%; min-height: 44px; padding: 8px 16px; border: 0; border-radius: 0; background: none; color: inherit; font: inherit; box-shadow: none; }
    #menu-drawer :where(#directory-tools > a, [data-pwa-install]) { border-bottom: 1px solid #ffffff20; }
    #menu-drawer :is(a, summary, button):is(:hover, [aria-current]) { background: #ffffff18; text-decoration: none; }
    #menu-drawer :focus-visible { outline: 2px solid currentColor; outline-offset: -3px; }
    #menu-drawer .drawer-label { display: block; padding: 16px 16px 4px; color: #b7d9ef; }
    @media (prefers-reduced-motion: no-preference) {
        #menu-drawer[open] { animation: menu-enter .18s ease-out; }
        @keyframes menu-enter { from { transform: translateX(-100%); } }
    }
    #base-content { padding-top: 8px; }
    .site-footer { padding-bottom: max(16px, env(safe-area-inset-bottom)); }
    .site-footer .container > div { width: 100%; text-align: center; }
    .site-footer nav { display: grid; grid-template-columns: repeat(3, 1fr); max-width: 24em; margin-inline: auto; gap: 0; }
    .pwa-install-unavailable .site-footer nav { grid-template-columns: repeat(2, 1fr); }
    .site-footer nav > * { display: grid; place-items: center; min-height: 36px; }
    .site-footer small { display: grid; place-items: center; min-height: 44px; margin-inline: 52px; }
}
@media (max-width: 480px) {
    .sheet { padding: 12px; }
}
