:root {
    color-scheme: light;
    --tc-bg: #f4f6f2;
    --tc-paper: #fff;
    --tc-ink: #17241d;
    --tc-muted: #52635a;
    --tc-line: #d7dfd8;
    --tc-accent: #a91a1c;
    --tc-accent-hover: #861316;
    --tc-radius: 1rem;
}

*, *::before, *::after { box-sizing: border-box; }
body {
    margin: 0;
    background: var(--tc-bg);
    color: var(--tc-ink);
    font: 1rem/1.55 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
a { color: var(--tc-accent); text-underline-offset: .2em; }
a:focus-visible, button:focus-visible, select:focus-visible, input:focus-visible {
    outline: 3px solid #185d44;
    outline-offset: 3px;
}
h1, h2, h3, p { margin: 0; overflow-wrap: anywhere; }
h1, h2, h3 { line-height: 1.16; }
.tc-shell { width: min(100% - 2rem, 70rem); margin-inline: auto; }
.tc-skip { position: absolute; top: .5rem; left: .5rem; z-index: 3; padding: .5rem 1rem; background: var(--tc-paper); transform: translateY(-200%); }
.tc-skip:focus { transform: none; }
.tc-header { background: var(--tc-paper); border-bottom: 1px solid var(--tc-line); }
.tc-header__inner { min-height: 4.5rem; display: flex; align-items: center; justify-content: space-between; gap: .75rem; padding-block: .7rem; }
.tc-brand { display: flex; align-items: center; gap: .65rem; color: var(--tc-ink); font-weight: 750; line-height: 1.1; text-decoration: none; }
.tc-brand img { display: block; border-radius: .5rem; }
.tc-brand small { display: block; margin-top: .2rem; color: var(--tc-muted); font-weight: 550; }
.tc-header__nav { display: flex; align-items: center; gap: clamp(.6rem, 3vw, 1.5rem); }
.tc-header__nav > a:not(.tc-button) { color: var(--tc-ink); font-weight: 650; }
.tc-header__nav > a:not(.tc-button):not([aria-current]) { text-decoration: none; }
.tc-main { padding-block: clamp(1.5rem, 5vw, 3.75rem); }

.tc-hero {
    padding: clamp(1.4rem, 6vw, 4rem);
    border: 1px solid var(--tc-line);
    border-radius: var(--tc-radius);
    background: radial-gradient(ellipse at 98% 5%, #f5dbd9, transparent 62%), linear-gradient(130deg, #fff, #f8faf6);
}
.tc-hero h1 { max-width: 22ch; font-size: clamp(2.15rem, 5vw, 4rem); font-weight: 780; letter-spacing: -.05em; }
.tc-hero p { max-width: 53ch; margin-top: .8rem; color: var(--tc-muted); font-size: clamp(1rem, 2vw, 1.15rem); }
.tc-hero--detail h1 { margin-top: .65rem; }
.tc-button {
    display: inline-flex;
    width: fit-content;
    max-width: 100%;
    min-height: 2.75rem;
    align-items: center;
    justify-content: center;
    padding: .6rem 1rem;
    border: 1px solid var(--tc-accent);
    border-radius: .625rem;
    background: var(--tc-accent);
    color: #fff;
    font: inherit;
    font-weight: 700;
    line-height: 1.25;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
}
.tc-button:hover { border-color: var(--tc-accent-hover); background: var(--tc-accent-hover); }
.tc-button--secondary { border-color: #bac8bd; background: var(--tc-paper); color: var(--tc-ink); }
.tc-button--secondary:hover { border-color: #95a89b; background: #eaf0e9; }

.tc-filters {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr)) auto auto;
    gap: .75rem 1rem;
    align-items: end;
    margin-block: 1.5rem 2rem;
    padding: 1rem;
    border: 1px solid var(--tc-line);
    border-radius: var(--tc-radius);
    background: var(--tc-paper);
}
.tc-filters label, .tc-copy label { display: grid; gap: .25rem; font-size: .9rem; font-weight: 650; }
.tc-filters select, .tc-copy select { width: 100%; min-height: 2.75rem; padding: .5rem .65rem; border: 1px solid #bac8bd; border-radius: .625rem; background: var(--tc-paper); color: var(--tc-ink); font: inherit; }
.tc-filters .tc-check { display: flex; align-items: center; gap: .45rem; min-height: 2.75rem; }
.tc-check input { width: 1.1rem; height: 1.1rem; margin: 0; accent-color: var(--tc-accent); }
.tc-results h2 { margin-bottom: .85rem; font-size: 1.2rem; }
.tc-results h2 span { color: var(--tc-muted); font-weight: 550; }
.tc-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .9rem; }
.tc-card, .tc-panel, .tc-empty, .tc-sections > li { border: 1px solid var(--tc-line); border-radius: var(--tc-radius); background: var(--tc-paper); }
.tc-card { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: .65rem; padding: 1.2rem; }
.tc-card:hover, .tc-card:focus-within { border-color: #a5b6a8; }
.tc-card h3 { font-size: 1.2rem; }
.tc-card h3 a { color: var(--tc-ink); text-decoration: none; }
.tc-card h3 a:hover, .tc-card h3 a:focus-visible { text-decoration: underline; }
.tc-card h3 a::after { position: absolute; inset: 0; border-radius: var(--tc-radius); content: ""; }
.tc-card p { color: var(--tc-muted); font-size: .95rem; }
.tc-card__action { margin-top: auto; color: var(--tc-accent); font-size: .9rem; font-weight: 700; }
.tc-badge { display: inline-block; padding: .25rem .55rem; border-radius: .4rem; background: #f5e5e3; color: #852021; font-size: .78rem; font-weight: 750; }
.tc-badge--free { background: #e1efe4; color: #25513a; }
.tc-meta { display: flex; flex-wrap: wrap; gap: .25rem .6rem; margin: 0; padding: 0; list-style: none; color: var(--tc-muted); font-size: .9rem; font-weight: 570; }
.tc-meta li + li::before { content: "·"; margin-right: .55rem; }
.tc-hero .tc-meta { margin-top: .8rem; }
.tc-empty { padding: clamp(1.25rem, 4vw, 2.5rem); }
.tc-empty p { color: var(--tc-muted); }
.tc-empty h1 + p, .tc-empty .tc-button { margin-top: .65rem; }

.tc-back { display: inline-block; margin-bottom: 1rem; font-weight: 650; }
.tc-detail__layout { display: grid; grid-template-columns: minmax(0, 2fr) minmax(16rem, 1fr); align-items: start; gap: 1.25rem; margin-top: 1.5rem; }
.tc-detail h2, .tc-upgrade h2 { font-size: clamp(1.25rem, 3vw, 1.55rem); }
.tc-sections { display: grid; gap: .75rem; margin: .75rem 0 0; padding: 0; list-style: none; counter-reset: tc-section; }
.tc-sections > li { padding: 1.05rem 1.15rem; counter-increment: tc-section; }
.tc-sections header { display: flex; justify-content: space-between; align-items: baseline; gap: .5rem; }
.tc-sections header h3 { font-size: 1.1rem; }
.tc-sections header h3::before { content: counter(tc-section) ". "; color: var(--tc-muted); }
.tc-sections header span { flex-shrink: 0; color: var(--tc-muted); font-size: .88rem; }
.tc-sections ul { display: grid; gap: .5rem; margin: .65rem 0 0; padding-left: 1.15rem; }
.tc-sections ul p, .tc-sections ul span, .tc-section-description, .tc-section-type, .tc-station { color: var(--tc-muted); }
.tc-section-description, .tc-section-type { margin-top: .25rem; }
.tc-section-type { font-size: .9rem; }
.tc-station { display: block; font-size: .8rem; font-weight: 650; }
.tc-detail__side { display: grid; gap: .75rem; }
.tc-panel { padding: 1.15rem; }
.tc-panel p, .tc-upgrade p { margin-top: .45rem; color: var(--tc-muted); }
.tc-panel .tc-button { margin-top: .65rem; }
.tc-copy { display: grid; gap: .3rem; margin-top: .65rem; }
.tc-copy .tc-button { width: 100%; }
.tc-materials { margin: .55rem 0 0; padding-left: 1.15rem; }
.tc-upgrade { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 1rem 2rem; align-items: center; margin-top: 1.5rem; padding: clamp(1.25rem, 4vw, 2rem); border: 1px solid #e5ccc8; border-radius: var(--tc-radius); background: #fbf1ef; }
.tc-upgrade__actions { display: grid; justify-items: start; gap: .4rem; }
.tc-upgrade__actions a { font-weight: 700; }
.tc-footer { border-top: 1px solid var(--tc-line); }
.tc-footer .tc-shell { display: flex; flex-wrap: wrap; gap: .5rem 1rem; padding-block: 1rem; }
.tc-footer a { color: var(--tc-muted); font-size: .9rem; }

@media (max-width: 54rem) {
    .tc-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .tc-filters button { justify-self: end; }
    .tc-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 40rem) {
    .tc-header__nav > a:not(.tc-button) { display: none; }
    .tc-grid, .tc-detail__layout, .tc-upgrade { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 24rem) {
    .tc-filters { grid-template-columns: minmax(0, 1fr); }
    .tc-filters button { justify-self: stretch; width: 100%; }
}
