.horse-quiz-widget {
    --horse-quiz-ink: #151515;
    --horse-quiz-text: #444;
    --horse-quiz-muted: #666;
    --horse-quiz-line: #e6e6e6;
    --horse-quiz-viewport-height: 100vh;
    --horse-quiz-keyboard-gap: 0px;
    --horse-quiz-mobile-floor: 80px;
    color: var(--horse-quiz-text);
    font-family: "IBM Plex Sans", sans-serif;
    font-size: 14px;
    line-height: 1.55;
    text-align: left;
}

.horse-quiz-widget,
.horse-quiz-widget * { box-sizing: border-box; }
.horse-quiz-widget[hidden],
.horse-quiz-widget [hidden] { display: none !important; }
body.search-is-visible .horse-quiz-widget,
body.nav-wrap-is-visible .horse-quiz-widget { visibility: hidden; }
.horse-quiz-widget h2,
.horse-quiz-widget h3,
.horse-quiz-widget p,
.horse-quiz-widget ol,
.horse-quiz-widget ul,
.horse-quiz-widget form { margin: 0; }
.horse-quiz-widget h2,
.horse-quiz-widget h3,
.horse-quiz-widget label { color: var(--horse-quiz-ink); }
.horse-quiz-widget button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: auto;
    min-height: 44px;
    margin: 0;
    padding: 9px 12px;
    border: 1px solid transparent;
    border-radius: 0;
    background: transparent;
    color: var(--horse-quiz-ink);
    font: inherit;
    font-weight: 600;
    line-height: 1.4;
    letter-spacing: normal;
    text-transform: none;
    white-space: normal;
    cursor: pointer;
    transition: background-color .15s ease, border-color .15s ease;
}
.horse-quiz-widget button:hover { background: #f3f3f3; color: var(--horse-quiz-ink); }
.horse-quiz-widget button:focus-visible,
.horse-quiz-widget a:focus-visible,
.horse-quiz-widget summary:focus-visible,
.horse-quiz-widget .horse-quiz-answer:focus-visible {
    outline: 2px solid var(--horse-quiz-ink);
    outline-offset: 2px;
}
.horse-quiz-widget button:disabled { opacity: .48; cursor: default; }

.horse-quiz-widget .horse-quiz-launcher {
    position: fixed;
    z-index: 200;
    right: 20px;
    bottom: 96px;
    flex-direction: column;
    gap: 2px;
    width: 56px;
    min-height: 56px;
    padding: 5px 3px;
    border: 1px solid #e4e4e4;
    background: #fff;
    color: var(--horse-quiz-ink);
    font-size: 12px;
    font-weight: 500;
    line-height: 1.2;
}
.horse-quiz-widget .horse-quiz-launcher:hover,
.horse-quiz-widget .horse-quiz-launcher[aria-expanded="true"] {
    border-color: #bfbfbf;
    background: #fff;
    color: var(--horse-quiz-ink);
    box-shadow: inset 3px 0 0 var(--horse-quiz-ink);
}
.horse-quiz-launcher-mark {
    display: block;
    width: 22px;
    height: 22px;
    flex: 0 0 auto;
}

.horse-quiz-panel {
    position: fixed;
    z-index: 201;
    right: 100px;
    bottom: 40px;
    display: flex;
    flex-direction: column;
    width: 440px;
    max-width: calc(100vw - 124px);
    max-height: min(760px, calc(var(--horse-quiz-viewport-height) - 64px));
    border: 1px solid var(--horse-quiz-line);
    border-radius: 0;
    background: #fff;
    overflow: hidden;
}
.horse-quiz-header {
    position: relative;
    display: flex;
    align-items: center;
    flex: 0 0 auto;
    min-height: 104px;
    padding: 16px 68px 16px 24px;
    border-bottom: 1px solid var(--horse-quiz-line);
}
.horse-quiz-heading-group { min-width: 0; }
.horse-quiz-widget .horse-quiz-eyebrow {
    margin-bottom: 2px;
    color: var(--horse-quiz-muted);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .08em;
}
.horse-quiz-widget h2 {
    font-size: 25px;
    font-weight: 700;
    line-height: 1.3;
}
.horse-quiz-widget .horse-quiz-intro {
    margin-top: 3px;
    color: var(--horse-quiz-text);
    font-size: 12px;
    line-height: 1.4;
}
.horse-quiz-widget .horse-quiz-icon-button {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 44px;
    min-height: 44px;
    padding: 10px;
}
.horse-quiz-body {
    min-height: 0;
    padding: 17px 24px 20px;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
}
.horse-quiz-loading { padding: 18px 0 24px; color: var(--horse-quiz-muted); }
.horse-quiz-widget .horse-quiz-loading button { margin-top: 12px; }

.horse-quiz-round-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    min-height: 40px;
    padding-bottom: 7px;
    border-bottom: 1px solid var(--horse-quiz-line);
}
.horse-quiz-widget .horse-quiz-round-toolbar h3 {
    min-width: 0;
    font-size: 16px;
    font-weight: 700;
    line-height: 1.4;
    overflow-wrap: anywhere;
}
.horse-quiz-round-meta { display: flex; align-items: center; flex: 0 0 auto; gap: 4px; }
.horse-quiz-round-meta > span { color: var(--horse-quiz-muted); font-size: 12px; white-space: nowrap; }
.horse-quiz-refresh-icon { display: block; width: 16px; height: 16px; flex: 0 0 auto; }
.horse-quiz-widget .horse-quiz-round-meta .horse-quiz-text-button {
    padding: 5px 3px 5px 9px;
    font-size: 12px;
    white-space: nowrap;
}
.horse-quiz-widget .horse-quiz-clues {
    margin-bottom: 16px;
    padding: 0;
    list-style: none;
    counter-reset: horse-quiz-clue;
}
.horse-quiz-clues li {
    position: relative;
    min-height: 42px;
    padding: 10px 0 10px 40px;
    border-bottom: 1px solid var(--horse-quiz-line);
    line-height: 1.55;
    overflow-wrap: anywhere;
}
.horse-quiz-clues li:last-child { border-bottom: 0; }
.horse-quiz-clues li::before {
    counter-increment: horse-quiz-clue;
    content: counter(horse-quiz-clue, decimal-leading-zero);
    position: absolute;
    left: 0;
    top: 9px;
    color: var(--horse-quiz-muted);
    font-size: 15px;
    font-weight: 600;
    line-height: 1.5;
    font-variant-numeric: tabular-nums;
}
.horse-quiz-form {
    padding-top: 16px;
    border-top: 1px solid var(--horse-quiz-line);
}
.horse-quiz-widget label {
    display: block;
    margin-bottom: 8px;
    font-size: 16px;
    font-weight: 700;
    line-height: 1.4;
}
.horse-quiz-search-field {
    display: flex;
    align-items: center;
    gap: 9px;
    min-height: 46px;
    padding: 0 12px;
    border: 1px solid #bcbcbc;
    border-radius: 0;
    background: #fff;
    color: var(--horse-quiz-muted);
    transition: border-color .15s ease, box-shadow .15s ease;
}
.horse-quiz-search-field:focus-within {
    border-color: var(--horse-quiz-ink);
    box-shadow: inset 0 0 0 1px var(--horse-quiz-ink);
}
.horse-quiz-search-icon { flex: 0 0 auto; }
.horse-quiz-widget input[type="search"] {
    display: block;
    flex: 1;
    min-width: 0;
    width: 100%;
    max-width: none;
    height: 44px;
    margin: 0;
    padding: 8px 0;
    border: 0;
    border-radius: 0;
    outline: 0;
    background: transparent;
    color: var(--horse-quiz-ink);
    font-family: inherit;
    font-size: 16px;
    line-height: 1.4;
    box-shadow: none;
    -webkit-appearance: none;
    appearance: none;
}
.horse-quiz-widget input::placeholder { color: var(--horse-quiz-muted); }
.horse-quiz-widget .horse-quiz-search-status {
    min-height: 20px;
    margin-top: 5px;
    color: var(--horse-quiz-muted);
    font-size: 12px;
    line-height: 1.5;
}
.horse-quiz-results {
    display: grid;
    max-height: 190px;
    margin-top: 8px;
    border: 1px solid var(--horse-quiz-line);
    background: #fff;
    overflow-y: auto;
    overscroll-behavior: contain;
}
.horse-quiz-widget .horse-quiz-result {
    display: flex;
    justify-content: space-between;
    gap: 9px;
    width: 100%;
    padding: 9px 10px;
    border-bottom: 1px solid var(--horse-quiz-line);
    text-align: left;
    font-weight: 400;
}
.horse-quiz-widget .horse-quiz-result:last-child { border-bottom: 0; }
.horse-quiz-widget .horse-quiz-result:hover { background: #f5f5f5; }
.horse-quiz-result-name { min-width: 0; overflow-wrap: anywhere; }
.horse-quiz-result-name strong { display: block; font-weight: 600; }
.horse-quiz-result-name small { display: block; color: var(--horse-quiz-muted); font-size: 12px; }
.horse-quiz-horse-year { color: var(--horse-quiz-muted); font-size: 12px; white-space: nowrap; font-weight: 400; }
.horse-quiz-selected {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-top: 11px;
    padding: 10px 12px;
    border: 1px solid var(--horse-quiz-line);
    border-left: 3px solid var(--horse-quiz-ink);
    background: #f7f7f7;
}
.horse-quiz-selected > div { min-width: 0; }
.horse-quiz-selected strong { display: block; font-size: 14px; overflow-wrap: anywhere; }
.horse-quiz-selected-label { display: block; margin-bottom: 2px; font-size: 11px; color: var(--horse-quiz-muted); }
.horse-quiz-widget .horse-quiz-text-button {
    flex-shrink: 0;
    padding: 8px 10px;
    color: var(--horse-quiz-ink);
    font-size: 13px;
}
.horse-quiz-actions {
    display: flex;
    align-items: stretch;
    gap: 8px;
    margin-top: 13px;
}
.horse-quiz-widget .horse-quiz-primary {
    flex: 1 1 auto;
    min-width: 0;
    min-height: 46px;
    border-color: var(--horse-quiz-ink);
    background: var(--horse-quiz-ink);
    color: #fff;
    font-size: 15px;
    font-weight: 600;
}
.horse-quiz-widget .horse-quiz-primary:hover:not(:disabled) {
    border-color: #333;
    background: #333;
    color: #fff;
}
.horse-quiz-widget .horse-quiz-secondary {
    border-color: var(--horse-quiz-ink);
    background: #fff;
    color: var(--horse-quiz-ink);
}
.horse-quiz-widget .horse-quiz-secondary:hover { border-color: var(--horse-quiz-ink); background: #f3f3f3; }
.horse-quiz-actions .horse-quiz-text-button {
    flex: 0 0 auto;
    min-height: 44px;
    text-decoration: underline;
    text-underline-offset: 3px;
}
.horse-quiz-widget .horse-quiz-message {
    margin-top: 12px;
    padding: 10px 12px;
    border: 1px solid var(--horse-quiz-line);
    border-left: 3px solid var(--horse-quiz-ink);
    background: #f7f7f7;
    color: var(--horse-quiz-text);
    font-size: 13px;
    overflow-wrap: anywhere;
}
.horse-quiz-widget .horse-quiz-message[data-kind="error"] {
    border-left-width: 5px;
    background: #f0f0f0;
    color: var(--horse-quiz-ink);
    font-weight: 600;
}
.horse-quiz-answer {
    padding: 16px;
    border: 1px solid var(--horse-quiz-line);
    border-top: 3px solid var(--horse-quiz-ink);
    background: #f7f7f7;
}
.horse-quiz-widget .horse-quiz-answer-label {
    margin-bottom: 6px;
    color: var(--horse-quiz-muted);
    font-size: 12px;
    font-weight: 600;
}
.horse-quiz-widget .horse-quiz-answer h3 {
    font-size: 22px;
    line-height: 1.35;
    font-weight: 700;
    overflow-wrap: anywhere;
}
.horse-quiz-widget .horse-quiz-answer .horse-quiz-horse-year { margin-top: 6px; }
.horse-quiz-widget .horse-quiz-answer-link {
    display: inline-block;
    margin-top: 12px;
    color: var(--horse-quiz-ink);
    text-decoration: underline;
    text-underline-offset: 3px;
    font-size: 13px;
}
.horse-quiz-widget .horse-quiz-answer button { display: flex; width: 100%; margin-top: 16px; }
.horse-quiz-history {
    margin-top: 16px;
    padding-top: 11px;
    border-top: 1px solid var(--horse-quiz-line);
    color: var(--horse-quiz-muted);
    font-size: 12px;
}
.horse-quiz-history summary { min-height: 36px; padding: 7px 0; cursor: pointer; }
.horse-quiz-widget .horse-quiz-history ul { max-height: 150px; padding: 8px 0 0 18px; overflow-y: auto; }
.horse-quiz-history li { padding: 3px 0; overflow-wrap: anywhere; }
.horse-quiz-widget .horse-quiz-storage-note {
    margin-top: 14px;
    color: var(--horse-quiz-muted);
    font-size: 11px;
    text-align: center;
}

@media (max-width: 1100px) and (min-width: 601px) {
    .horse-quiz-widget .horse-quiz-launcher { right: 16px; bottom: 72px; }
    .horse-quiz-panel {
        right: 88px;
        bottom: 16px;
        max-width: calc(100vw - 104px);
        max-height: calc(var(--horse-quiz-viewport-height) - 100px);
    }
}

@media (max-width: 600px) {
    .horse-quiz-widget .horse-quiz-launcher {
        right: 68px;
        bottom: max(12px, env(safe-area-inset-bottom));
        width: 48px;
        min-height: 48px;
        padding: 3px 2px;
        font-size: 11px;
    }
    .horse-quiz-launcher-mark { width: 20px; height: 20px; }
    .horse-quiz-panel {
        left: 12px;
        right: 12px;
        bottom: calc(var(--horse-quiz-mobile-floor) + var(--horse-quiz-keyboard-gap) + env(safe-area-inset-bottom));
        width: auto;
        max-width: none;
        max-height: calc(var(--horse-quiz-viewport-height) - var(--horse-quiz-mobile-floor) - 36px - env(safe-area-inset-bottom));
    }
    .horse-quiz-header { min-height: 94px; padding: 12px 60px 12px 18px; }
    .horse-quiz-widget h2 { font-size: 22px; }
    .horse-quiz-widget .horse-quiz-intro { font-size: 11px; }
    .horse-quiz-body { padding: 14px 18px 18px; }
    .horse-quiz-clues li { padding-top: 9px; padding-bottom: 9px; }
}

@media (max-width: 360px) {
    .horse-quiz-header { padding-left: 15px; }
    .horse-quiz-widget h2 { font-size: 21px; }
    .horse-quiz-body { padding-right: 14px; padding-left: 14px; }
    .horse-quiz-round-toolbar { align-items: flex-start; }
    .horse-quiz-widget .horse-quiz-round-toolbar h3 { font-size: 15px; }
}

@media (prefers-reduced-motion: reduce) {
    .horse-quiz-widget button,
    .horse-quiz-search-field { transition: none; }
}
