@import url('willow-scrollbar.css');
body.share-themed:has(#tf-play),
body.share-themed:has(.tf-join),
body.tf-host-page {
    font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
}
body.share-themed:has(#tf-play) {
    background: linear-gradient(140deg, #e8eefc 0%, #f8fafc 42%, #e0f2fe 100%);
}
body.share-themed:has(#tf-play) footer,
body.share-themed:has(.tf-join) footer { display: none; }
body.share-themed:has(#tf-play),
body.share-themed:has(.tf-join) { min-height: 100dvh; display: flex; flex-direction: column; }
body.share-themed:has(#tf-play) header,
body.share-themed:has(.tf-join) header { flex: 0 0 auto; }
body.share-themed:has(.tf-join) main.tf-join-wrap {
    flex: 1; min-height: 0; display: flex; flex-direction: column;
    padding-top: 1rem; padding-bottom: 1rem;
}
body.share-themed:has(.tf-join.is-gym) {
    height: 100dvh;
    max-height: 100dvh;
    overflow: hidden;
}
.tf-theme-btn {
    border: 1px solid rgba(255,255,255,0.4); background: rgba(255,255,255,0.16); color: #fff;
    border-radius: 999px; padding: 0.4rem 0.8rem; font-weight: 800; font-size: 0.82rem; cursor: pointer;
}
.tf-join-wrap { max-width: 72rem; width: 100%; flex: 1; display: flex; flex-direction: column; min-height: 0; }
.tf-join { max-width: 40rem; margin: 0 auto; width: 100%; }
.tf-join.is-gym { max-width: none; flex: 1; display: flex; flex-direction: column; min-height: 0; }
.tf-join h2 { font-size: 1.7rem; margin: 0.3rem 0 0.7rem; color: #001A72; }
.tf-kicker { font-size: 0.75rem; letter-spacing: 0.1em; text-transform: uppercase; font-weight: 800; color: #001A72; margin: 0; }
.tf-join-form, .tf-join-block { display: grid; gap: 0.45rem; }
.tf-join input, .tf-join-submit, .tf-btn {
    border-radius: 0.75rem; padding: 0.75rem; font-size: 1rem;
}
.tf-join input { border: 1px solid #cbd5e1; background: #fff; color: #0f172a; }
.tf-join-submit, .tf-btn { background: #001A72; color: #fff; border: 0; font-weight: 700; cursor: pointer; }
.tf-hint { margin: 0; font-size: 0.88rem; color: #334155; }
.tf-error { color: #991b1b; background: #fef2f2; padding: 0.6rem 0.8rem; border-radius: 0.6rem; }
.tf-join label { color: #0f172a; font-weight: 700; }
.tf-join-gym {
    display: grid; gap: 1.1rem; align-items: stretch;
    flex: 1; min-height: 0;
}
.tf-join-card, .tf-gym-card {
    background: #fff; border: 1px solid #dbe3f0; border-radius: 1.15rem;
    padding: 1.1rem 1.15rem 1.2rem; box-shadow: 0 12px 28px rgba(15,23,42,0.06);
}
.tf-gym-card { min-height: 0; display: flex; flex-direction: column; gap: 0.55rem; }
.tf-levels-scroll {
    overflow: auto; min-height: 8rem; max-height: min(62vh, 34rem);
    padding-right: 0.2rem; margin: 0.15rem -0.15rem 0 0; flex: 1;
}
.tf-zones { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.tf-zone {
    display: inline-flex; align-items: center;
    border: 2px solid var(--tf-flag, #cbd5e1);
    background: var(--tf-flag, #fff);
    color: var(--tf-flag-text, #0f172a);
    border-radius: 999px; padding: 0.4rem 0.85rem; font-weight: 800; font-size: 0.88rem; text-decoration: none;
    opacity: 0.78;
}
.tf-zone.is-on { opacity: 1; box-shadow: 0 0 0 3px rgba(15,23,42,0.18); }
.tf-levels { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.55rem; }
.tf-level {
    display: grid; gap: 0.15rem; text-align: left; width: 100%;
    border: 1px solid #dbe3f0; background: #f8fafc; color: #0f172a;
    border-radius: 0.9rem; padding: 0.8rem 0.95rem; cursor: pointer; font: inherit;
}
.tf-level:hover, .tf-level:focus { border-color: #001A72; box-shadow: 0 0 0 3px rgba(0,26,114,0.12); background: #fff; }
.tf-level strong { font-size: 1.05rem; color: #0f172a; }
.tf-level span { color: #334155; font-size: 0.88rem; }
@media (min-width: 960px) {
    .tf-join-gym { grid-template-columns: minmax(17rem, 22.5rem) minmax(0, 1fr); }
    .tf-gym-card { max-height: none; height: 100%; }
    .tf-levels-scroll { max-height: none; }
}
@media (max-width: 959px) {
    .tf-join-gym { grid-template-columns: 1fr; grid-template-rows: auto minmax(14rem, 1fr); }
    .tf-gym-card { max-height: none; min-height: 0; }
    .tf-levels-scroll { max-height: none; }
}
.tf-play-main { max-width: 48rem; margin: 0 auto; padding: 1rem 1rem 2rem; }
#tf-play { display: grid; gap: 0.9rem; }
.tf-hud {
    display: flex; flex-wrap: wrap; gap: 0.7rem 1.1rem; align-items: baseline;
    background: rgba(255,255,255,0.92); border: 1px solid #e2e8f0; border-radius: 1rem;
    padding: 0.7rem 1rem; box-shadow: 0 10px 24px rgba(0,26,114,0.06);
}
.tf-hud-item { display: grid; gap: 0.05rem; }
.tf-hud-item b { font-size: clamp(1.4rem, 3vw, 1.9rem); color: #001A72; font-variant-numeric: tabular-nums; line-height: 1; }
.tf-hud-item span { font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; font-weight: 800; color: #64748b; }
.tf-wait {
    min-height: 58vh;
    display: grid; justify-items: center; align-content: center; gap: 0.85rem; text-align: center;
    font-weight: 800; font-size: clamp(1.05rem, 2.4vw, 1.35rem); color: #001A72;
}
.tf-wait-copy { margin: 0; max-width: 36rem; }
.tf-joke-card {
    width: min(40rem, 100%); margin: 0.15rem 0 0; padding: 0.85rem 1.15rem 1rem;
    border-radius: 1rem; background: #fff; border: 1px solid #dbe3f0;
    box-shadow: 0 10px 24px rgba(0, 26, 114, 0.06);
}
.tf-joke-kicker {
    margin: 0 0 0.35rem; font-size: 0.72rem; letter-spacing: 0.14em; text-transform: uppercase;
    font-weight: 800; color: #64748b;
}
.tf-joke {
    margin: 0; min-height: 2.8rem; font-size: clamp(1.15rem, 2.5vw, 1.5rem);
    line-height: 1.4; color: #001A72; transition: opacity 0.24s ease;
}
.tf-joke.is-out { opacity: 0; }
.tf-wait-names {
    position: relative; z-index: 1; list-style: none; margin: 0; padding: 0;
    display: flex; flex-wrap: wrap; justify-content: center; gap: 0.4rem;
}
.tf-wait-names li {
    background: #fff; color: #001A72; border-radius: 999px; padding: 0.35rem 0.75rem; font-size: 0.95rem;
}
.tf-wait-names li.is-you { box-shadow: inset 0 0 0 2px #001A72; }
.tf-wait-clock {
    display: inline-flex; align-items: center; gap: 0.5rem;
    font-size: clamp(2.6rem, 11vw, 4.6rem); font-weight: 800; color: #001A72;
    font-variant-numeric: tabular-nums; line-height: 1;
}
.tf-passage-wrap {
    position: relative; background: #fff; border: 1px solid #e2e8f0; border-radius: 1.15rem;
    padding: 1.15rem 1.2rem 1.3rem; box-shadow: 0 16px 36px rgba(15,23,42,0.06);
}
.tf-passage {
    font-size: clamp(1.6rem, 3.2vw, 2.15rem); line-height: 1.7; font-weight: 650;
    color: #334155; max-width: 42rem; word-break: break-word;
    font-family: ui-sans-serif, "Segoe UI", system-ui, sans-serif;
}
.tf-ch { white-space: pre-wrap; }
.tf-ch.is-upcoming { color: #475569; }
.tf-ch.is-ok { color: #001A72; }
.tf-ch.is-bad {
    color: #9f1239; text-decoration: underline wavy #e11d48;
    text-underline-offset: 0.12em;
}
.tf-ch.is-caret {
    color: #0f172a; background: #fde68a; box-shadow: inset 0 -0.18em 0 #001A72;
    border-radius: 0.15rem;
}
.tf-word.is-current { background: rgba(0,26,114,0.08); border-radius: 0.35rem; }
.tf-hidden {
    position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; z-index: 2;
    border: 0; padding: 0; margin: 0; font-size: 16px; cursor: text;
}
.tf-focus-catch {
    position: absolute; inset: 0; opacity: 0; cursor: text; z-index: 1; pointer-events: none;
}
.tf-bar { display: flex; justify-content: space-between; align-items: center; gap: 0.6rem; }
.tf-restart {
    display: inline-flex; align-items: center; gap: 0.35rem;
    border: 0; border-radius: 999px; background: #fff; color: #001A72; font-weight: 800;
    padding: 0.45rem 0.85rem; cursor: pointer; box-shadow: 0 1px 0 rgba(0,0,0,0.06);
}
.tf-ico { display: inline-block; flex: 0 0 auto; vertical-align: -0.15em; }
.tf-msg { min-height: 1.2rem; font-weight: 700; color: #991b1b; margin: 0; }
.tf-done {
    width: min(94vw, 42rem); max-height: 92dvh; border: 0; border-radius: 1.25rem; padding: 1rem 1rem 0.9rem;
    text-align: center; background: #fff; overflow: auto;
}
.tf-done::backdrop { background: rgba(15, 23, 42, 0.55); }
.tf-done-kicker { margin: 0; letter-spacing: 0.12em; text-transform: uppercase; font-weight: 800; color: #001A72; font-size: 0.78rem; }
.tf-done h2 { margin: 0.15rem 0 0.7rem; font-size: 1.45rem; }
.tf-stat-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.45rem; }
.tf-stat {
    margin: 0; border: 1px solid #e2e8f0; border-radius: 0.85rem; padding: 0.45rem 0.4rem 0.5rem; background: #f8fafc;
}
.tf-stat b { display: block; font-size: clamp(1.55rem, 4vw, 2rem); line-height: 1; color: #001A72; font-variant-numeric: tabular-nums; }
.tf-stat span { font-size: 0.68rem; letter-spacing: 0.08em; text-transform: uppercase; font-weight: 800; color: #475569; }
.tf-stat-sub { margin: 0.55rem 0 0.7rem; color: #334155; font-size: 0.92rem; }
.tf-stat-sub strong { color: #001A72; }
.tf-done-split { display: grid; gap: 0.7rem; text-align: left; }
.tf-slow { list-style: none; margin: 0.3rem 0 0; padding: 0; display: grid; gap: 0.22rem; }
.tf-slow li { display: flex; justify-content: space-between; gap: 0.6rem; font-weight: 700; font-size: 0.92rem; }
.tf-tips { list-style: none; margin: 0.3rem 0 0; padding: 0; display: grid; gap: 0.3rem; }
.tf-tips li { background: #f1f5f9; border-radius: 0.65rem; padding: 0.4rem 0.6rem; font-weight: 650; color: #0f172a; font-size: 0.9rem; }
.tf-done-actions {
    display: flex; justify-content: center; flex-wrap: wrap; gap: 0.45rem; margin-top: 0.8rem;
    position: sticky; bottom: 0; z-index: 1; background: #fff; padding-top: 0.55rem;
}
.tf-done-close, .tf-join-submit, .tf-host-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 0.35rem;
}
.tf-done-close { border: 0; border-radius: 0.75rem; background: #001A72; color: #fff; font-weight: 800; padding: 0.55rem 0.85rem; cursor: pointer; }
a.tf-done-close, a.tf-pack-next { text-decoration: none; }
.tf-bar .tf-pack-next[hidden] { display: none !important; }
.tf-bar .tf-pack-next {
    display: inline-flex; align-items: center; justify-content: center; text-align: center;
    border-radius: 999px; background: #001A72; color: #fff; font-weight: 800;
    padding: 0.45rem 0.9rem; white-space: normal;
}
.tf-done-quiet { background: #e2e8f0; color: #0f172a; }
@media (min-width: 900px) {
    .tf-done { width: min(92vw, 46rem); max-height: 92dvh; overflow: auto; padding: 0.95rem 1.1rem 0.85rem; }
    .tf-stat-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .tf-done-split { grid-template-columns: 1.1fr 0.9fr; gap: 1rem; align-items: start; }
    .tf-stat b { font-size: 1.7rem; }
}
.tf-board, .tf-host-board { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.55rem; width: 100%; }
.tf-race, .tf-host-race { width: min(64rem, 100%); margin-top: 0.4rem; }
.tf-race-head {
    display: grid; grid-template-columns: 7.5rem 1fr 5.2rem; gap: 0.55rem; align-items: center;
    font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; font-weight: 800; color: #475569;
    margin-bottom: 0.35rem;
}
.tf-finish-label { grid-column: 2; justify-self: end; display: inline-flex; align-items: center; gap: 0.25rem; color: #001A72; }
.tf-lane {
    display: grid; grid-template-columns: 7.5rem 1fr 5.2rem; gap: 0.55rem; align-items: center; text-align: left;
}
.tf-lane-name { font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tf-lane-rail {
    position: relative; height: 1.7rem; border-radius: 999px; background: #e2e8f0; overflow: hidden;
}
.tf-lane-rail::after {
    content: ""; position: absolute; top: 0; bottom: 0; right: 0; width: 3px; background: #001A72;
}
.tf-lane-fill {
    height: 100%; width: 0; min-width: 0; border-radius: 999px;
    background: linear-gradient(90deg, #001A72, #2563eb);
    transition: width 1s ease; display: flex; align-items: center; justify-content: flex-end;
    color: #fff; font-size: 0.75rem; font-weight: 800; padding-right: 0.45rem;
}
.tf-lane.is-done .tf-lane-fill { background: linear-gradient(90deg, #166534, #22c55e); }
.tf-lane.is-you .tf-lane-name { color: #001A72; }
.tf-lane.is-spotlight .tf-lane-rail { box-shadow: inset 0 0 0 2px #f59e0b; }
.tf-lane-meta { font-weight: 800; font-variant-numeric: tabular-nums; text-align: right; color: #001A72; }
.tf-lane,
.tf-lobby-chip { cursor: context-menu; }
.tf-ctx {
    position: fixed;
    z-index: 80;
    min-width: 13.5rem;
    max-width: calc(100vw - 1rem);
    padding: 0.4rem;
    background: #fff;
    border: 1px solid #dbe4ff;
    border-radius: 0.85rem;
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.18);
    box-sizing: border-box;
}
.tf-ctx[hidden] { display: none !important; }
.tf-ctx-name {
    margin: 0 0 0.25rem;
    padding: 0.35rem 0.55rem 0.45rem;
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #64748b;
    border-bottom: 1px solid #e2e8f0;
}
.tf-ctx button {
    display: block;
    width: 100%;
    text-align: left;
    border: 0;
    background: transparent;
    border-radius: 0.55rem;
    padding: 0.55rem 0.65rem;
    font-size: 0.9rem;
    font-weight: 700;
    color: #0f172a;
    cursor: pointer;
}
.tf-ctx button:hover { background: #eef2ff; }
.tf-ctx-danger { color: #b91c1c !important; }
.tf-ctx-danger:hover { background: #fef2f2 !important; }
.tf-host-page { position: relative; }
.tf-host-page::before {
    content: "";
    position: fixed;
    inset: -16%;
    z-index: 0;
    pointer-events: none;
    background:
        radial-gradient(circle at 20% 20%, rgba(255, 215, 0, 0.24), transparent 34%),
        radial-gradient(circle at 80% 16%, rgba(56, 189, 248, 0.2), transparent 38%),
        radial-gradient(circle at 50% 90%, rgba(129, 140, 248, 0.18), transparent 40%);
    animation: tf-wash 10s ease-in-out infinite alternate;
}
@keyframes tf-wash {
    0% { transform: translate3d(0, 0, 0) scale(1); }
    100% { transform: translate3d(-3%, 2.5%, 0) scale(1.07); }
}
.tf-host-bg { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 0; }
.tf-blob { position: absolute; border-radius: 50%; filter: blur(72px); opacity: 0.4; }
.tf-blob-a { width: 26rem; height: 26rem; left: -6rem; top: 10%; background: #93c5fd; animation: tf-float 12s ease-in-out infinite; }
.tf-blob-b { width: 20rem; height: 20rem; right: -5rem; top: 20%; background: #fde68a; animation: tf-float 14s ease-in-out infinite reverse; }
.tf-blob-c { width: 24rem; height: 24rem; left: 35%; bottom: -8rem; background: #c4b5fd; animation: tf-float 13s ease-in-out infinite; }
@keyframes tf-float {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(3%, 5%); }
}
.tf-host-bar, .tf-host-main { position: relative; z-index: 1; }
.tf-host-race {
    width: 100%;
    max-width: 92rem;
    margin: 0.2rem 0 0;
    text-align: left;
    overflow-x: auto;
}
.tf-board-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem 1rem;
    margin-bottom: 0.85rem;
}
.tf-board-title-row { display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; }
.tf-board-title-row h2 { margin: 0; font-size: 1.5rem; letter-spacing: -0.02em; }
.tf-code-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    border: 2px solid #001A72;
    background: #fff;
    color: #001A72;
    border-radius: 999px;
    padding: 0.28rem 0.75rem 0.28rem 0.65rem;
    cursor: pointer;
    font-weight: 800;
}
.tf-code-chip span { font-size: 0.68rem; letter-spacing: 0.08em; text-transform: uppercase; color: #64748b; }
.tf-code-chip strong { font-family: ui-monospace, Consolas, monospace; font-size: 1.05rem; letter-spacing: 0.12em; }
.tf-code-chip:hover { background: #001A72; color: #fff; }
.tf-code-chip:hover span { color: #bfdbfe; }
.tf-board-tools { display: flex; align-items: center; flex-wrap: wrap; gap: 0.85rem; margin: 0; }
.tf-view-toggle {
    display: inline-flex;
    background: #fff;
    border: 1.5px solid #cbd5e1;
    border-radius: 999px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.06);
}
.tf-view-toggle button {
    border: 0;
    background: transparent;
    padding: 0.4rem 0.85rem;
    font-weight: 800;
    font-size: 0.8rem;
    color: #475569;
    cursor: pointer;
}
.tf-view-toggle button.is-on { background: #001A72; color: #fff; }
.tf-zoom {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    background: #fff;
    border: 1.5px solid #cbd5e1;
    border-radius: 999px;
    padding: 0.2rem 0.3rem;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.06);
}
.tf-zoom button {
    width: 2.1rem;
    height: 2.1rem;
    border: 0;
    border-radius: 999px;
    background: #001A72;
    color: #fff;
    font-size: 1.25rem;
    font-weight: 800;
    line-height: 1;
    cursor: pointer;
}
.tf-zoom button:hover { background: #001454; }
.tf-zoom button:disabled { opacity: 0.4; cursor: default; }
.tf-zoom span { min-width: 3.2rem; text-align: center; font-weight: 800; font-variant-numeric: tabular-nums; color: #0f172a; font-size: 0.85rem; }
.tf-table-wrap {
    background: #fff;
    border-radius: 1.1rem;
    overflow: auto;
    box-shadow: 0 16px 36px rgba(0, 26, 114, 0.1);
    zoom: var(--tf-zoom, 1);
}
.tf-score-table { width: 100%; border-collapse: collapse; font-size: 1.15rem; }
.tf-host-page #tf-host-board { display: table-row-group; width: 100%; margin: 0; padding: 0; gap: 0; }
.tf-score-table th, .tf-score-table td { text-align: left; padding: 0.7em 0.85em; border-bottom: 1px solid #e2e8f0; }
.tf-score-table th {
    background: #001A72;
    color: #fff;
    font-size: 0.72em;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    font-weight: 800;
}
.tf-score-table td { font-weight: 800; color: #0f172a; }
.tf-score-table .tf-lane-name { max-width: 16rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tf-score-table tr.is-first .tf-rank { color: #ca8a04; }
.tf-score-table tr.is-done { background: #ecfdf5; }
.tf-score-table tr.is-done .tf-rank { color: #15803d; }
.tf-score-table tbody tr { cursor: context-menu; transition: background 0.35s ease; }
.tf-pbar {
    display: flex;
    height: 0.85em;
    min-width: 7rem;
    border-radius: 999px;
    overflow: hidden;
    background: #e2e8f0;
    box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.06);
}
.tf-pbar-fill {
    height: 100%;
    width: 0;
    border-radius: 999px;
    background: linear-gradient(90deg, #001A72, #38bdf8);
    transition: width 1s ease;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    color: #fff;
    font-size: 0.72em;
    font-weight: 800;
    box-sizing: border-box;
    padding-right: 0.4rem;
    white-space: nowrap;
}
.is-done .tf-pbar-fill { background: linear-gradient(90deg, #15803d, #4ade80); }
.tf-wpm, .tf-acc { font-variant-numeric: tabular-nums; white-space: nowrap; }
.tf-host-race[data-view="cards"] .tf-table-wrap { display: none; }
.tf-cards-space { display: none; }
.tf-host-race[data-view="cards"] .tf-cards-space {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr));
    gap: 0.55rem;
    align-content: start;
    zoom: var(--tf-zoom, 1);
}
.tf-student-card {
    display: flex;
    flex-direction: column;
    gap: 0.22rem;
    padding: 0.55rem 0.7rem;
    background: #fff;
    border-radius: 0.8rem;
    border: 2px solid rgba(0, 26, 114, 0.08);
    box-shadow: 0 8px 18px rgba(0, 26, 114, 0.08);
    cursor: context-menu;
    animation: tf-card-in 0.32s ease;
}
@keyframes tf-card-in {
    from { opacity: 0; transform: translateY(10px) scale(0.98); }
    to { opacity: 1; transform: none; }
}
.tf-student-card .tf-rank { margin: 0; font-size: 0.72rem; font-weight: 800; letter-spacing: 0.08em; color: #64748b; }
.tf-student-card.is-first .tf-rank { color: #ca8a04; }
.tf-student-card h3 { margin: 0; font-size: 0.95rem; font-weight: 800; letter-spacing: -0.02em; color: #0f172a; line-height: 1.2; }
.tf-student-card .tf-pbar { min-width: 0; height: 0.78em; margin-top: 0.15rem; }
.tf-card-meta { display: flex; justify-content: space-between; align-items: baseline; gap: 0.35rem; margin: 0.15rem 0 0; font-weight: 800; font-size: 0.78rem; color: #334155; }
.tf-card-meta strong { color: #001A72; font-size: 0.95rem; }
.tf-student-card.is-done { background: #ecfdf5; border-color: #22c55e; box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.22); }
.tf-code-modal-panel {
    width: min(96vw, 40rem);
    text-align: center;
    padding: 2rem 1.5rem 1.5rem;
    border-radius: 1.6rem;
    background: #fff;
    box-shadow: 0 32px 80px rgba(0, 26, 114, 0.28);
}
.tf-code-modal-kicker { margin: 0; font-size: 0.8rem; font-weight: 800; letter-spacing: 0.14em; text-transform: uppercase; color: #64748b; }
.tf-code-modal-url { margin: 0.45rem 0 0.65rem; font-size: clamp(1.45rem, 3.6vw, 2.5rem); font-weight: 800; color: #001A72; line-height: 1.25; overflow-wrap: break-word; }
.tf-code-modal-code { display: inline-block; margin: 0 0 1.1rem; padding: 0.3rem 0.85rem; border-radius: 0.8rem; background: #eef2ff; border: 3px solid #001A72; font-family: ui-monospace, Consolas, monospace; font-size: clamp(1.25rem, 3vw, 2.1rem); font-weight: 800; letter-spacing: 0.12em; color: #001A72; line-height: 1.2; }
.tf-code-modal-panel button { border: 0; border-radius: 0.75rem; background: #001A72; color: #fff; font-weight: 800; padding: 0.65rem 1.1rem; cursor: pointer; }
.willow-modal-backdrop[hidden] { display: none !important; }
.tf-rename {
    display: grid; gap: 0.45rem; margin-top: 0.8rem; padding: 0.8rem; border-radius: 0.9rem;
    background: #fff; border: 1px solid #e2e8f0; text-align: left;
}
.tf-rename[hidden] { display: none; }
.tf-rename input { border: 1px solid #cbd5e1; border-radius: 0.7rem; padding: 0.55rem 0.7rem; font: inherit; }
.tf-rename button { border: 0; border-radius: 0.7rem; background: #001A72; color: #fff; font-weight: 800; padding: 0.55rem 0.8rem; cursor: pointer; }
.tf-host-main.is-live .tf-host-label,
.tf-host-main.is-live .tf-host-url,
.tf-host-main.is-live .tf-host-code { display: none; }
.tf-host-main.is-live {
    justify-content: flex-start;
    align-items: stretch;
    text-align: left;
    width: min(92rem, 100%);
    margin: 0 auto;
    padding-top: 1.2rem;
    box-sizing: border-box;
}
.tf-link-box, .tf-editor { }
.tf-host-page { margin: 0; min-height: 100dvh; background: linear-gradient(165deg, #e0f2fe 0%, #eef2ff 45%, #fff7ed 100%); color: #0f172a; }
.tf-host-page,
.tf-host-page button,
.tf-host-page input,
.tf-host-page a,
.tf-host-page select { font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif; }
.tf-host-bar {
    display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 0.8rem;
    padding: 0.7rem 1rem; background: #001A72; color: #fff;
}
.tf-host-brand { display: inline-flex; align-items: center; gap: 0.45rem; color: #fff; text-decoration: none; font-weight: 800; }
.tf-host-brand img { width: 2rem; height: 2rem; border-radius: 999px; }
.tf-host-title { margin: 0; font-size: 1.05rem; }
.tf-host-actions { display: flex; flex-wrap: wrap; gap: 0.45rem; align-items: center; }
.tf-host-btn {
    appearance: none; border: 1px solid rgba(255,255,255,0.28); border-radius: 0.7rem;
    padding: 0.55rem 0.8rem; font-weight: 800; font-size: 0.9rem; cursor: pointer;
    color: #fff; background: rgba(255,255,255,0.14); text-decoration: none;
    display: inline-flex; align-items: center; gap: 0.35rem;
}
.tf-host-btn-start { background: #16a34a; }
.tf-host-btn-end { background: #dc2626; }
.tf-host-btn:disabled { opacity: 0.7; cursor: default; }
.tf-host-timer-field {
    display: inline-flex; align-items: center; gap: 0.4rem;
    padding: 0.2rem 0.45rem 0.2rem 0.7rem; border-radius: 999px;
    background: rgba(255,255,255,0.12); border: 1px solid rgba(255,255,255,0.28);
    color: #e0e7ff; font-weight: 800; font-size: 0.78rem; letter-spacing: 0.04em; text-transform: uppercase;
}
.tf-host-timer-field label { display: inline-flex; align-items: center; gap: 0.3rem; }
.tf-host-timer-field input {
    width: 4.4rem; border: 0; border-radius: 999px; padding: 0.4rem 0.35rem;
    text-align: center; font-size: 1.15rem; font-weight: 800; color: #001A72; background: #fff;
}
.tf-host-main {
    min-height: calc(100vh - 4.25rem); display: flex; flex-direction: column; align-items: center;
    justify-content: center; text-align: center; padding: 1.5rem 1rem 2.5rem;
}
.tf-host-main.is-live .tf-host-wait { align-self: flex-start; margin: 0 0 0.35rem; font-size: 0.95rem; color: #475569; }
.tf-host-label { margin: 0; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: #334155; }
.tf-host-url { margin: 0.35rem 0 0.7rem; font-size: clamp(1.7rem, 4.2vw, 3.1rem); font-weight: 800; color: #001A72; line-height: 1.25; overflow-wrap: break-word; max-width: 52rem; }
.tf-host-code {
    margin: 0.2rem auto 1rem; padding: 0.55rem 0.9rem; border-radius: 0.9rem; background: #fff;
    border: 3px solid #001A72; color: #001A72; font-family: ui-monospace, Consolas, monospace;
    font-size: clamp(1.45rem, 3.4vw, 2.4rem); font-weight: 800; letter-spacing: 0.1em;
}
.tf-host-clock { margin: 0.5rem 0; }
.tf-host-clock-kicker { display: inline-flex; align-items: center; gap: 0.4rem; font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase; }
.tf-host-clock-time { margin: 0.1rem 0 0; font-size: clamp(3.8rem, 14vw, 8rem); font-weight: 800; color: #001A72; font-variant-numeric: tabular-nums; }
.tf-host-wait { font-weight: 800; color: #001A72; font-size: 1.2rem; }
.tf-host-note { margin: 0.45rem 0 0; font-weight: 700; color: #92400e; }
.tf-host-msg { min-height: 1.1rem; font-weight: 700; color: #b91c1c; margin: 0.35rem 0 0; }
.willow-modal-backdrop {
    position: fixed; inset: 0; z-index: 90; display: flex; align-items: center; justify-content: center;
    padding: 1rem; background: rgba(15, 23, 42, 0.55);
    font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
}
.willow-modal-backdrop.hidden { display: none !important; }
.willow-modal-panel {
    width: min(28rem, 100%); background: #fff; color: #0f172a; border-radius: 1rem;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25); display: flex; flex-direction: column; overflow: hidden;
}
.willow-modal-header { padding: 1.25rem 1.5rem 0.4rem; }
.willow-modal-header h3 { margin: 0; font-size: 1.25rem; font-weight: 800; }
.willow-modal-body { padding: 0.4rem 1.5rem 1rem; }
.willow-modal-body p { margin: 0; color: #475569; line-height: 1.5; }
.willow-modal-footer { display: flex; justify-content: flex-end; gap: 0.6rem; padding: 0.9rem 1.5rem 1.2rem; border-top: 1px solid #e5e7eb; }
.willow-modal-footer button { border: 0; border-radius: 0.7rem; padding: 0.65rem 1rem; font-weight: 800; cursor: pointer; font-family: inherit; }
#willow-confirm-cancel { background: #e2e8f0; color: #0f172a; }
#willow-confirm-ok { background: #001A72; color: #fff; }
#willow-confirm-ok.is-danger { background: #dc2626; }
html[data-tf-theme="dark"] .willow-modal-panel,
html.dark .willow-modal-panel { background: #111827; color: #f8fafc; }
html[data-tf-theme="dark"] .willow-modal-body p,
html.dark .willow-modal-body p { color: #cbd5e1; }
html[data-tf-theme="dark"] .willow-modal-footer,
html.dark .willow-modal-footer { border-color: #334155; }
html[data-tf-theme="dark"] #willow-confirm-cancel,
html.dark #willow-confirm-cancel { background: #1e293b; color: #e5e7eb; }
.tf-spotlight {
    width: min(36rem, 96vw); margin: 1rem auto 0; padding: 1rem 1.2rem;
    border-radius: 1.2rem; background: linear-gradient(135deg, #fffbeb, #fef3c7);
    border: 2px solid #f59e0b; color: #78350f;
    box-shadow: 0 10px 24px rgba(245, 158, 11, 0.16);
}
.tf-host-main.is-live .tf-spotlight { width: 100%; max-width: none; margin: 0 0 0.85rem; text-align: left; box-sizing: border-box; }
.tf-spotlight-name { margin: 0.15rem 0 0; font-size: clamp(1.7rem, 4vw, 2.6rem); font-weight: 800; }
.tf-host-names { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.5rem; list-style: none; margin: 1rem 0 0; padding: 0; }
.tf-host-names li {
    background: #fff; border-radius: 999px; padding: 0.45rem 0.95rem; font-weight: 800;
    box-shadow: 0 6px 16px rgba(15, 23, 42, 0.08); animation: tf-card-in 0.25s ease;
}
.tf-host-board { list-style: none; width: min(64rem, 96vw); margin: 0.4rem auto 0; padding: 0; display: grid; gap: 0.55rem; text-align: left; }
.tf-host-row {
    display: grid; grid-template-columns: 2.2rem 1fr auto; gap: 0.7rem; align-items: center;
    background: #fff; border-radius: 0.9rem; padding: 0.7rem 0.9rem; font-weight: 800;
}
.tf-host-row.is-done { box-shadow: inset 0 0 0 2px #16a34a; }
.tf-host-row.is-spotlight { background: #fffbeb; box-shadow: inset 0 0 0 2px #f59e0b; }
.tf-host-row-pts { color: #001A72; font-variant-numeric: tabular-nums; }
.tf-menu { position: fixed; z-index: 40; background: #fff; border-radius: 0.6rem; box-shadow: 0 10px 24px rgba(0,0,0,0.16); }
.tf-menu button { border: 0; background: transparent; padding: 0.55rem 0.8rem; font-weight: 700; cursor: pointer; }
html[data-tf-theme="dark"] body.share-themed:has(#tf-play),
html[data-tf-theme="dark"] body.share-themed:has(.tf-join) {
    --share-text: #f8fafc;
    --share-muted: #e2e8f0;
    background: #0b1224; color: #f1f5f9;
}
html[data-tf-theme="dark"] .tf-join label,
html[data-tf-theme="dark"] .tf-join h2,
html[data-tf-theme="dark"] .tf-wait,
html[data-tf-theme="dark"] .tf-wait-clock,
html[data-tf-theme="dark"] .tf-done h2,
html[data-tf-theme="dark"] .tf-hud-item b,
html[data-tf-theme="dark"] .tf-passage,
html[data-tf-theme="dark"] .tf-slow li,
html[data-tf-theme="dark"] .tf-host-clock-kicker { color: #f8fafc; }
html[data-tf-theme="dark"] .tf-hero b,
html[data-tf-theme="dark"] .tf-kicker,
html[data-tf-theme="dark"] .tf-wait,
html[data-tf-theme="dark"] .tf-wait-clock { color: #bfdbfe; }
html[data-tf-theme="dark"] .tf-join-card,
html[data-tf-theme="dark"] .tf-gym-card {
    background: #111827; border-color: #475569; box-shadow: none;
}
html[data-tf-theme="dark"] .tf-join input,
html[data-tf-theme="dark"] .tf-level,
html[data-tf-theme="dark"] .tf-hud,
html[data-tf-theme="dark"] .tf-passage-wrap,
html[data-tf-theme="dark"] .tf-score-row { background: #1e293b; border-color: #64748b; color: #f8fafc; }
html[data-tf-theme="dark"] .tf-level:hover,
html[data-tf-theme="dark"] .tf-level:focus { background: #334155; }
html[data-tf-theme="dark"] .tf-level strong { color: #f8fafc; }
html[data-tf-theme="dark"] .tf-level span,
html[data-tf-theme="dark"] .tf-hint,
html[data-tf-theme="dark"] .tf-hud-item span,
html[data-tf-theme="dark"] .tf-hero span { color: #e2e8f0; }
html[data-tf-theme="dark"] .tf-join-submit,
html[data-tf-theme="dark"] .tf-btn,
html[data-tf-theme="dark"] .tf-done-close,
html[data-tf-theme="dark"] .tf-bar .tf-pack-next { background: #3b82f6; color: #fff; }
html[data-tf-theme="dark"] .tf-done-actions { background: #111827; }
html[data-tf-theme="dark"] .tf-stat { background: #1e293b; border-color: #64748b; }
html[data-tf-theme="dark"] .tf-stat b,
html[data-tf-theme="dark"] .tf-stat-sub strong,
html[data-tf-theme="dark"] .tf-lane-meta,
html[data-tf-theme="dark"] .tf-finish-label,
html[data-tf-theme="dark"] .tf-joke,
html[data-tf-theme="dark"] .tf-wait,
html[data-tf-theme="dark"] .tf-wait-clock { color: #bfdbfe; }
html[data-tf-theme="dark"] .tf-stat span,
html[data-tf-theme="dark"] .tf-race-head,
html[data-tf-theme="dark"] .tf-stat-sub { color: #e2e8f0; }
html[data-tf-theme="dark"] .tf-joke-card { background: #1e293b; border-color: #334155; }
html[data-tf-theme="dark"] .tf-joke-kicker { color: #cbd5e1; }
html[data-tf-theme="dark"] .tf-wait-names li { background: #1e293b; color: #f8fafc; }
html[data-tf-theme="dark"] .tf-lane-rail { background: #334155; }
html[data-tf-theme="dark"] .tf-lane-name { color: #f8fafc; }
html[data-tf-theme="dark"] .tf-ch.is-upcoming { color: #e2e8f0; }
html[data-tf-theme="dark"] .tf-ch.is-ok { color: #dbeafe; }
html[data-tf-theme="dark"] .tf-ch.is-bad { color: #fecdd3; text-decoration-color: #fb7185; }
html[data-tf-theme="dark"] .tf-ch.is-caret { color: #0f172a; background: #fbbf24; }
html[data-tf-theme="dark"] .tf-restart { background: #1e293b; color: #dbeafe; }
html[data-tf-theme="dark"] .tf-error { color: #fecaca; background: #7f1d1d; }
html[data-tf-theme="dark"] .tf-zone { opacity: 0.88; }
html[data-tf-theme="dark"] .tf-zone.is-on { opacity: 1; box-shadow: 0 0 0 3px rgba(191,219,254,0.45); }
html[data-tf-theme="dark"] .tf-word.is-current { background: rgba(147,197,253,0.16); }
html[data-tf-theme="dark"] .tf-done { background: #111827; color: #f8fafc; }
html[data-tf-theme="dark"] .tf-hero b,
html[data-tf-theme="dark"] .tf-done-kicker { color: #bfdbfe; }
html[data-tf-theme="dark"] .tf-tips li { background: #1e293b; color: #f8fafc; }
html[data-tf-theme="dark"] .tf-done-quiet { background: #334155; color: #f8fafc; }
html[data-tf-theme="dark"] .tf-host-page {
    background: #0b1224;
    color: #e5e7eb;
}
html[data-tf-theme="dark"] .tf-host-page::before {
    background:
        radial-gradient(circle at 20% 20%, rgba(251, 191, 36, 0.14), transparent 34%),
        radial-gradient(circle at 80% 16%, rgba(56, 189, 248, 0.12), transparent 38%),
        radial-gradient(circle at 50% 90%, rgba(129, 140, 248, 0.12), transparent 40%);
}
html[data-tf-theme="dark"] .tf-blob-a { background: #1e3a8a; }
html[data-tf-theme="dark"] .tf-blob-b { background: #854d0e; }
html[data-tf-theme="dark"] .tf-blob-c { background: #4c1d95; }
html[data-tf-theme="dark"] .tf-host-label { color: #cbd5e1; }
html[data-tf-theme="dark"] .tf-host-code { background: #020617; color: #f8fafc; border-color: #93c5fd; }
html[data-tf-theme="dark"] .tf-host-clock-time,
html[data-tf-theme="dark"] .tf-host-wait,
html[data-tf-theme="dark"] .tf-host-url { color: #93c5fd; }
html[data-tf-theme="dark"] .tf-host-names li,
html[data-tf-theme="dark"] .tf-host-row { background: #1e293b; color: #f8fafc; }
html[data-tf-theme="dark"] .tf-host-row-pts { color: #93c5fd; }
html[data-tf-theme="dark"] .tf-host-msg { color: #fca5a5; }
html[data-tf-theme="dark"] .tf-host-note { color: #fbbf24; }
html[data-tf-theme="dark"] .tf-menu { background: #1e293b; }
html[data-tf-theme="dark"] .tf-menu button { color: #e5e7eb; }
html[data-tf-theme="dark"] .tf-ctx { background: #1e293b; border-color: #334155; }
html[data-tf-theme="dark"] .tf-ctx-name { color: #cbd5e1; border-color: #334155; }
html[data-tf-theme="dark"] .tf-ctx button { color: #f8fafc; }
html[data-tf-theme="dark"] .tf-ctx button:hover { background: #334155; }
html[data-tf-theme="dark"] .tf-ctx-danger { color: #fca5a5 !important; }
html[data-tf-theme="dark"] .tf-ctx-danger:hover { background: #3f1d1d !important; }
html[data-tf-theme="dark"] .tf-view-toggle,
html[data-tf-theme="dark"] .tf-zoom,
html[data-tf-theme="dark"] .tf-code-chip,
html[data-tf-theme="dark"] .tf-table-wrap,
html[data-tf-theme="dark"] .tf-student-card,
html[data-tf-theme="dark"] .tf-code-modal-panel { background: #141414; color: #f8fafc; border-color: #334155; }
html[data-tf-theme="dark"] .tf-view-toggle button { color: #cbd5e1; }
html[data-tf-theme="dark"] .tf-view-toggle button.is-on,
html[data-tf-theme="dark"] .tf-zoom button { background: #2563eb; color: #fff; }
html[data-tf-theme="dark"] .tf-zoom span,
html[data-tf-theme="dark"] .tf-board-title-row h2,
html[data-tf-theme="dark"] .tf-score-table td,
html[data-tf-theme="dark"] .tf-student-card h3,
html[data-tf-theme="dark"] .tf-code-chip,
html[data-tf-theme="dark"] .tf-code-modal-code { color: #f8fafc; }
html[data-tf-theme="dark"] .tf-score-table th { background: #0f172a; }
html[data-tf-theme="dark"] .tf-score-table th,
html[data-tf-theme="dark"] .tf-score-table td { border-color: #334155; }
html[data-tf-theme="dark"] .tf-score-table tr.is-done,
html[data-tf-theme="dark"] .tf-student-card.is-done { background: #14532d; border-color: #4ade80; }
html[data-tf-theme="dark"] .tf-student-card.is-done h3 { color: #bbf7d0; }
html[data-tf-theme="dark"] .tf-pbar { background: #334155; }
html[data-tf-theme="dark"] .tf-card-meta,
html[data-tf-theme="dark"] .tf-code-modal-url,
html[data-tf-theme="dark"] .tf-host-main.is-live .tf-host-wait { color: #cbd5e1; }
html[data-tf-theme="dark"] .tf-card-meta strong { color: #93c5fd; }
html[data-tf-theme="dark"] .tf-rename { background: #1e293b; color: #f8fafc; border-color: #334155; }
html[data-tf-theme="dark"] .tf-lane-card,
html[data-tf-theme="dark"] .tf-lane-meta { color: #bfdbfe; }
html[data-tf-theme="dark"] .tf-rename input { background: #0f172a; color: #f8fafc; border-color: #475569; }
@media (prefers-reduced-motion: reduce) {
    .tf-joke, .tf-lane-fill, .tf-pbar-fill, .tf-student-card, .tf-host-names li { animation: none; transition: none; }
    .tf-host-page::before, .tf-blob { animation: none; }
}
@media (max-width: 720px) {
    .tf-board-head { align-items: flex-start; }
    .tf-host-page .tf-score-table,
    .tf-host-page #tf-host-board { display: block; width: 100%; }
    .tf-score-table { font-size: 0.95rem; }
    .tf-score-table thead { display: none; }
    .tf-score-table tr {
        display: grid;
        grid-template-columns: 1.5rem minmax(0, 1fr) auto auto;
        grid-template-areas: "rank name wpm acc" "rank bar bar bar";
        gap: 0.2rem 0.45rem;
        align-items: center;
        padding: 0.65rem 0.75rem;
        border-bottom: 1px solid #e2e8f0;
    }
    .tf-score-table td { display: block; width: auto; border: 0; padding: 0; }
    .tf-score-table .tf-rank { grid-area: rank; }
    .tf-score-table .tf-lane-name { grid-area: name; max-width: none; }
    .tf-score-table .tf-prog { grid-area: bar; }
    .tf-score-table .tf-wpm,
    .tf-score-table .tf-acc { font-size: 0.78rem; color: #475569; }
    .tf-score-table .tf-wpm { grid-area: wpm; }
    .tf-score-table .tf-acc { grid-area: acc; }
    .tf-table-wrap { overflow: auto; }
    .tf-host-race[data-view="cards"] .tf-cards-space { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
    .tf-passage { font-size: 1.45rem; }
    .tf-host-bar { grid-template-columns: 1fr; justify-items: center; }
    .tf-done { width: min(96vw, 38rem); padding: 0.85rem 0.75rem 0.7rem; }
    .tf-done-actions { flex-direction: column; align-items: stretch; }
    .tf-done-actions .tf-done-close,
    .tf-done-actions .tf-pack-next { width: 100%; }
    .tf-bar { flex-direction: column; align-items: stretch; }
    .tf-bar .tf-pack-next,
    .tf-bar .tf-restart { width: 100%; justify-content: center; }
    .tf-join h2 { font-size: 1.4rem; }
    .tf-join-card, .tf-gym-card { padding: 0.9rem 0.95rem 1rem; }
    .tf-lane, .tf-race-head { grid-template-columns: 5.2rem 1fr 3.6rem; gap: 0.35rem; }
}
dialog.ah-dialog { width: min(96vw, 42rem); max-width: min(96vw, 42rem); max-height: 92dvh; margin: auto; border: 0; border-radius: 1.2rem; padding: 0; background: transparent; overflow: hidden; }
dialog.ah-dialog[open] { display: block; }
.ah-dialog::backdrop { background: rgba(15, 23, 42, 0.55); }
.ah-panel { background: #fff; color: #0f172a; border-radius: 1.2rem; padding: 1.1rem 1.2rem 1rem; max-height: 92dvh; overflow: auto; }
.ah-panel h3 { margin: 0; font-size: 1.25rem; }
.ah-lead, .ah-empty, .ah-meta { color: #64748b; font-size: 0.92rem; }
.ah-tools { display: flex; gap: 0.4rem; align-items: center; margin-top: 0.55rem; }
.ah-tools button, .ah-mini {
    border: 0; border-radius: 0.6rem; background: #e2e8f0; color: #0f172a;
    font-weight: 800; font-size: 0.78rem; padding: 0.35rem 0.55rem; cursor: pointer;
}
.ah-tools button[disabled] { opacity: 0.45; cursor: default; }
.ah-item { display: flex; align-items: center; gap: 0.45rem; margin-top: 0.45rem; }
.ah-check { width: 1.05rem; height: 1.05rem; flex: 0 0 auto; }
.ah-row, .ah-score { display: flex; align-items: center; justify-content: space-between; gap: 0.6rem; width: 100%; text-align: left; border: 1px solid #e5e7eb; background: #fff; border-radius: 0.8rem; padding: 0.65rem 0.75rem; margin-top: 0; color: inherit; }
.ah-row { cursor: pointer; flex: 1; }
.ah-score { margin-top: 0.45rem; }
.ah-count { color: #001A72; font-weight: 800; white-space: nowrap; }
.ah-actions { display: flex; justify-content: flex-end; align-items: center; flex-wrap: wrap; gap: 0.45rem; margin-top: 0.9rem; }
.ah-actions button { border-radius: 0.7rem; padding: 0.55rem 0.8rem; border: 1px solid #d1d5db; background: #fff; font-weight: 700; }
#ah-close { background: #001A72; color: #fff; border-color: #001A72; }
.ah-export { display: flex; flex-wrap: wrap; gap: 0.45rem; margin-right: auto; }
.ah-export a { display: inline-flex; align-items: center; border-radius: 0.7rem; padding: 0.5rem 0.75rem; border: 1px solid #c7d2fe; background: #eef2ff; color: #001A72; font-weight: 800; font-size: 0.82rem; line-height: 1.2; text-decoration: none; white-space: nowrap; }
.ah-export a:hover { background: #e0e7ff; }
html[data-tf-theme="dark"] .ah-panel,
html.dark .ah-panel { background: #111827; color: #e5e7eb; }
html[data-tf-theme="dark"] .ah-row,
html[data-tf-theme="dark"] .ah-score,
html.dark .ah-row,
html.dark .ah-score { background: #1e293b; border-color: #334155; color: #f8fafc; }
html[data-tf-theme="dark"] .ah-export a,
html.dark .ah-export a { color: #93c5fd; background: #1e293b; border-color: #334155; }
@media (prefers-reduced-motion: reduce) {
    .tf-ch.is-caret { box-shadow: inset 0 -0.18em 0 #001A72; }
}
html[data-tf-theme="dark"] .tf-code-modal-url { color: #f8fafc; }
html[data-tf-theme="dark"] .tf-code-modal-code { color: #fde68a; background: #020617; border-color: #fde68a; }
