:root {
    --hq-ink: #173c3b;
    --hq-muted: #536b69;
    --hq-accent: #087465;
    --hq-line: #d9e5df;
    --hq-paper: #fff;
    --hq-wash: #eef6f2;
}
.io-black-mode {
    --hq-ink: #e6f2ef;
    --hq-muted: #b2c8c3;
    --hq-accent: #8ddbc4;
    --hq-line: #39524c;
    --hq-paper: #202d2a;
    --hq-wash: #283a35;
}
.hq-shell, .hq-results {
    width: min(1180px, calc(100% - 40px));
    margin: 18px auto 36px;
    color: var(--hq-ink);
}
.hq-shell { display: grid; grid-template-columns: 152px minmax(0, 1fr); align-items: start; gap: 24px; }
.hq-body { display: grid; min-width: 0; gap: 16px; }
.hq-topic-nav { display: flex; align-items: baseline; flex-wrap: wrap; gap: 0 18px; padding: 5px 12px; background: var(--hq-wash); border-inline-start: 3px solid var(--hq-accent); color: var(--hq-ink); }
.hq-topic-nav strong { font-size: 14px; }
.hq-topic-now { margin: -6px 0 0; font-size: 14px; }
.hq-topic-now a { display: inline-flex; align-items: center; min-height: 32px; }
.hq-topic-menu { position: relative; flex: 0 0 auto; z-index: 5; color: var(--hq-ink); }
.hq-topic-menu summary { display: list-item; min-width: 44px; line-height: 44px; font-size: 14px; cursor: pointer; }
.hq-topic-menu nav { position: absolute; inset-inline-end: 0; top: 100%; display: grid; grid-template-columns: repeat(2, 1fr); width: 190px; padding: 6px; border-radius: 8px; background: var(--hq-paper); border: 1px solid var(--hq-line); box-shadow: 0 4px 15px #0002; }
.hq-topic-menu:not([open]) nav { display: none; }
.hq-topic-menu a { display: grid; place-items: center; min-height: 42px; color: var(--hq-accent); }
.hq-topic-nav > div { display: flex; flex-wrap: wrap; gap: 0 12px; }
.hq-topic-nav summary { color: var(--hq-accent); line-height: 40px; }
.hq-topic-nav a { display: inline-flex; align-items: center; min-height: 40px; font-size: 14px; }
.hqtopic-figure img { display: block; max-width: 100%; height: auto; margin-inline: auto; }
.hqtopic-figure figcaption { text-align: center; }
@media (max-width: 767px) {
    .hq-topic-nav { display: block; padding: 3px 8px; }
    .hq-topic-nav strong { position: absolute; clip-path: inset(50%); overflow: hidden; width: 1px; height: 1px; }
    .hq-topic-nav > div { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 0 4px; }
    .hq-topic-nav a { justify-content: center; min-height: 36px; }
    .hq-topic-nav summary { line-height: 36px; text-align: center; }
}
.hq-shell h1, .hq-results h1 { margin: 0; color: var(--hq-ink); font-size: clamp(21px, 2vw, 30px); font-weight: 700; line-height: 1.35; }
.hq-panel h2, .hq-rail h2 { margin: 0; color: var(--hq-ink); font-size: 18px; line-height: 1.45; }
.hq-shell a, .hq-results a, .hq-route, .hq-list a, .hq-facts a, .hq-tag-entry a { color: var(--hq-accent); }
.hq-shell a:hover, .hq-results a:hover, .hq-route:hover, .hq-list a:hover, .hq-facts a:hover { text-decoration: underline; text-underline-offset: .2em; }
.hq-shell > .hq-body { grid-column: 2; grid-row: 1; }
.hq-rail {
    grid-column: 1; grid-row: 1;
    position: sticky; top: calc(var(--main-nav-hight, 80px) + 8px); align-self: start;
    max-height: calc(100vh - var(--main-nav-hight, 80px) - 24px); overflow: auto;
    padding: 12px 10px; border-inline-start: 2px solid var(--hq-line); scroll-margin-top: calc(var(--main-nav-hight, 80px) + 8px);
}
.hq-rail h2 { margin: 0 8px 8px; font-size: 15px; }
.hq-rail a { display: block; padding: 7px 8px; color: var(--hq-muted); border-radius: 5px; }
.hq-rail a:hover { background: var(--hq-wash); }
.hq-intro { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; padding: 6px 0 15px; border-bottom: 2px solid var(--hq-accent); scroll-margin-top: var(--main-nav-hight, 80px); }
.hq-region { color: var(--hq-muted); margin: 0 0 4px; font-size: 12px; letter-spacing: .12em; }
.hq-find { display: flex; flex: 0 1 370px; min-width: 0; margin: 0; gap: 6px; }
.hq-find input[type=search] { flex: 1; min-width: 0; width: 100%; height: 44px; background: var(--hq-paper); border: 1px solid var(--hq-line); border-radius: 7px; padding: 0 10px; font-size: 16px; color: var(--hq-ink); }
.hq-find input::placeholder { color: var(--hq-muted); opacity: 1; }
.hq-find button { min-height: 44px; flex-shrink: 0; padding: 0 17px; border: 0; border-radius: 7px; background: #096c5c; color: white; font-weight: 600; cursor: pointer; }
.hq-find label { position: absolute; width: 1px; height: 1px; clip-path: inset(50%); overflow: hidden; white-space: nowrap; }
.hq-jump { display: none; }
.hq-columns { display: grid; grid-template-columns: minmax(0, 1.8fr) minmax(200px, 1fr); gap: 16px; }
.hq-panel { min-width: 0; border: 1px solid var(--hq-line); background: var(--hq-paper); border-radius: 12px; padding: 18px 20px; color: var(--hq-ink); }
.hq-heading { display: flex; gap: 12px; align-items: baseline; justify-content: space-between; }
.hq-heading a { flex-shrink: 0; font-size: 14px; padding: 4px 0; }
.hq-routes { display: grid; margin-top: 9px; }
.hq-route { display: grid; grid-template-columns: 5em minmax(0, 1fr); gap: 2px 12px; padding: 8px 0; color: var(--hq-ink); border-top: 1px solid var(--hq-line); }
.hq-route strong { grid-row: span 2; color: var(--hq-accent); font-size: 14px; }
.hq-route span { line-height: 1.45; overflow-wrap: anywhere; }
.hq-route time, .hq-list time { color: var(--hq-muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.hq-shortcuts { display: flex; flex-wrap: wrap; align-content: start; gap: 6px; margin-top: 13px; }
.hq-shortcuts a { display: inline-flex; align-items: center; min-height: 40px; padding: 6px 11px; background: var(--hq-wash); border-radius: 6px; }
.hq-list { margin: 10px 0 0; padding: 0; list-style: none; }
.hq-list li { display: flex; gap: 12px; align-items: center; justify-content: space-between; padding: 6px 0; border-top: 1px solid var(--hq-line); }
.hq-list a { display: flex; align-items: center; gap: 12px; min-width: 0; min-height: 36px; font-size: 15px; line-height: 1.55; color: var(--hq-ink); }
.hq-list a span, .hq-results h1 { overflow-wrap: anywhere; }
.hq-list time { flex-shrink: 0; }
.hq-thumb { width: 72px; height: 48px; flex: 0 0 72px; border-radius: 5px; object-fit: cover; }
.hq-edition { display: inline-block; margin-right: .5em; padding: 1px 5px; color: var(--hq-muted); background: var(--hq-wash); border-radius: 3px; }
.hq-facts { margin: 12px 0; padding: 10px 16px; background: var(--hq-wash); color: var(--hq-ink); border-inline-start: 3px solid var(--hq-accent); }
.hq-facts div { display: grid; grid-template-columns: 5em minmax(0, 1fr); gap: 8px; padding: 4px 0; }
.hq-facts dd { margin: 0; overflow-wrap: anywhere; }
.hq-facts a, .hq-tag-entry a { text-decoration: underline; }
.hq-panel + h2 { margin-top: 20px; }
:is(.hq-shell,.hq-results,.hq-panel,.hq-facts,.hq-list,.hq-tag-entry) :focus-visible { outline: 3px solid var(--hq-accent); outline-offset: 2px; }
@media (max-width: 880px) {
    .hq-columns { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 767px) {
    body { --main-nav-hight: 56px; }
    .main-header.header-fixed { padding: 5px 8px; }
    .main-header .logo-expanded img { height: 28px; width: auto; }
    .main-header .hqt-nav-control { min-width: 44px; min-height: 44px; }
    .hq-shell, .hq-results { width: calc(100% - 24px); margin: 8px auto 24px; }
    .hq-shell { display: flex; flex-direction: column; gap: 16px; }
    .hq-body { width: 100%; gap: 10px; }
    .hq-results.hq-body { width: calc(100% - 24px); }
    .hq-rail { position: static; order: 1; max-height: none; display: flex; flex-wrap: wrap; width: 100%; padding: 12px; gap: 4px; }
    .hq-rail h2 { width: 100%; }
    .hq-rail a { min-height: 40px; }
    .hq-intro { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; padding: 4px 0 10px; }
    .hq-intro > div { grid-area: 1 / 1; }
    .hq-region { font-size: 11px; }
    .hq-find { grid-column: 1 / -1; }
    .hq-jump { display: inline-flex; min-height: 40px; align-items: center; grid-area: 1 / 2; font-size: 13px; }
    .hq-columns { gap: 10px; }
    .hq-panel { padding: 12px 14px; border-radius: 9px; }
    .hq-list li { position: relative; display: block; }
    .hq-list time { display: block; }
    .hq-route { grid-template-columns: 4.4em minmax(0, 1fr); gap: 2px 8px; }
    .hq-list a { min-height: 32px; }
}
