/* TurfScout polls: isolated layout, existing Win95 bevel/press tokens. */
html body .hero.ts-polls-enabled { padding-top: 91px; }
html body .ts-poll-open {
    position: absolute; top: 40px; left: 8px; z-index: 40;
    display: inline-flex; align-items: center; justify-content: center; gap: 3px;
    min-height: 35px; max-width: calc(100% - 18px); padding: 5px 8px;
    font: bold 12px/1.25 Tahoma, Arial, sans-serif; letter-spacing: 0;
    color: #fff; background: #b02121; border: 1px solid var(--ink);
    border-radius: 0; box-shadow: var(--w95-outset); cursor: pointer;
    --w95-press-bg: #811818; --w95-press-color: #fff;
}
html body .ts-poll-open:is(:hover, :focus-visible):not(:is(:active, [data-ts-pressed])) { background: #941b1b; }
html body .ts-poll-open[data-state="live"] [data-poll-badge] { font-weight: 900; }
html body .ts-poll-dialog {
    position: fixed; inset: 0; box-sizing: border-box; margin: auto;
    width: min(520px, calc(100vw - 32px)); max-width: none;
    max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px);
    padding: 3px; overflow: auto; overscroll-behavior: contain;
    color: var(--ink); background: var(--w95-face);
    border: 1px solid var(--line-dark); border-radius: 0; box-shadow: var(--w95-window);
    text-align: left; font: 14px/1.5 Tahoma, Arial, sans-serif;
}
html body .ts-poll-dialog:not([open]) { display: none; }
.ts-poll-dialog::backdrop { background: rgb(0 0 0 / .48); }
html body .ts-poll-dialog.ts-poll-fallback { z-index: 5000; box-shadow: 0 0 0 100vmax rgb(0 0 0 / .48), var(--w95-window); }
.ts-poll-titlebar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 4px 5px 4px 9px; background: var(--brand); color: var(--paper); }
html body .ts-poll-titlebar h2 { margin: 0; color: inherit; font: bold 14px/1.4 Tahoma, Arial, sans-serif; }
.ts-poll-content { padding: 16px; }
.ts-poll-kicker { margin: 0 0 14px; color: var(--brand-dark); font-size: 10px; font-weight: 700; line-height: 1.5; }
html body .ts-poll-question { margin: 0 0 10px; color: var(--ink); font-size: 20px; line-height: 1.25; overflow-wrap: anywhere; }
.ts-poll-description { margin: 0 0 10px; overflow-wrap: anywhere; }
.ts-poll-deadline { margin: 0 0 18px; font-size: 12px; color: var(--text); }
html body .ts-poll-choices { padding: 0; border: 0; margin: 0 0 14px; min-width: 0; }
.ts-poll-choices legend { margin: 0 0 8px; padding: 0; font-size: 12px; font-weight: bold; }
.ts-poll-choice { display: flex; align-items: center; gap: 10px; min-height: 46px; padding: 10px 12px; margin: 0 0 8px; background: var(--bg); border: 1px solid var(--line-dark); box-shadow: var(--w95-outset); cursor: pointer; overflow-wrap: anywhere; }
.ts-poll-choice span { min-width: 0; }
.ts-poll-choice input { flex: 0 0 auto; width: 18px; height: 18px; margin: 0; accent-color: var(--brand); }
.ts-poll-choice:has(input:checked) { background: var(--brand-soft); color: var(--brand-dark); border-color: var(--w95-pressed-border); box-shadow: var(--w95-pressed); }
.ts-poll-choice:has(input:focus-visible) { outline: 2px dotted var(--ink); outline-offset: 2px; }
.ts-poll-choice:has(input:disabled) { cursor: default; }
html body .ts-poll-button {
    min-height: 44px; display: inline-flex; align-items: center; justify-content: center;
    padding: 10px 15px; margin: 0; border: 1px solid var(--line-dark); border-radius: 0;
    color: var(--ink); background: var(--w95-face); box-shadow: var(--w95-outset);
    font: bold 13px/1.3 Tahoma, Arial, sans-serif; cursor: pointer;
}
html body .ts-poll-primary { background: var(--brand); color: var(--paper); --w95-press-bg: var(--brand-dark); --w95-press-color: var(--paper); }
html body .ts-poll-primary:is(:hover, :focus-visible):not(:disabled):not(:is(:active, [data-ts-pressed])) { background: var(--brand-dark); }
html body :is(.ts-poll-open, .ts-poll-primary):focus-visible:not(:disabled) { outline-color: #fff; }
html body .ts-poll-button:disabled { cursor: default; opacity: .65; translate: none; }
html body .ts-poll-button[aria-busy="true"] { opacity: 1; box-shadow: var(--w95-pressed); border-color: var(--w95-pressed-border); cursor: progress; }
html body .ts-poll-close { min-height: 30px; width: 32px; padding: 0; font-size: 22px; line-height: 1; flex: 0 0 auto; }
.ts-poll-status { margin: 14px 0 0; font-size: 13px; font-weight: bold; color: var(--brand-dark); }
.ts-poll-status:empty { margin: 0; }
.ts-poll-status.ts-poll-error { color: #811818; }
.ts-poll-privacy { margin: 16px 0 10px; padding-top: 12px; border-top: 1px solid var(--line-dark); font-size: 11px; line-height: 1.5; color: var(--text); }
.ts-poll-history-link { font-size: 12px; font-weight: bold; color: var(--brand-dark); }
.ts-poll-results { list-style: none; padding: 0; margin: 18px 0 10px; }
.ts-poll-result { margin: 0 0 16px; }
.ts-poll-result-row { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; margin-bottom: 5px; }
.ts-poll-result-row span { min-width: 0; overflow-wrap: anywhere; }
.ts-poll-result-row strong { flex: 0 0 auto; color: var(--brand-dark); }
.ts-poll-result small { font-size: 11px; color: var(--text); }
.ts-poll-bar { height: 15px; padding: 3px; background: var(--paper); box-shadow: var(--w95-inset); }
.ts-poll-bar span { display: block; height: 100%; background: var(--brand); }
.ts-poll-total { font-size: 13px; font-weight: bold; }
html body .ts-poll-archive { max-width: 1100px; padding-block: 12px 32px; }
.ts-poll-archive-intro { background: var(--bg); padding: 18px; border: 1px solid var(--line-dark); box-shadow: var(--w95-window); margin-bottom: 18px; }
.ts-poll-archive-intro p { margin: 0 0 12px; }
.ts-poll-archive-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.ts-poll-archive-card { padding: 18px; min-width: 0; background: var(--bg); border: 1px solid var(--line-dark); box-shadow: var(--w95-window); }
.ts-poll-archive-card h2 { margin: 0 0 10px; font-size: 20px; line-height: 1.3; overflow-wrap: anywhere; }
.ts-poll-pagination { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 16px; margin-top: 24px; }
@media(max-width: 600px) {
    .ts-poll-content { padding: 13px; }
    .ts-poll-archive-grid { grid-template-columns: minmax(0, 1fr); }
}

/* Mobile title bar: centre polls between menu and share, keeping the
   original full-size logo below. The button replaces the decorative caption. */
@media (max-width: 620px) {
    html body .hero.ts-polls-enabled {
        padding-top: 45px;
    }

    html body .hero.ts-polls-enabled::before {
        content: "";
    }

    html body .hero.ts-polls-enabled .ts-poll-open {
        top: 5px;
        left: 44px;
        right: 44px;
        width: max-content;
        max-width: calc(100% - 88px);
        height: 25px;
        min-height: 25px;
        margin: 0 auto;
        padding: 2px 8px;
    }
}

/* TurfScout 95 refined: polls remain a keyboard-accessible modal window. */
html body .ts-poll-dialog { background: var(--w95-face); border-color: #8fa38e; }
html body .ts-poll-titlebar { min-height: 37px; background: var(--brand-dark); }
html body .ts-poll-content { background: #f8fbf6; }
html body .ts-poll-question { color: var(--ink); font-size: 19px; line-height: 1.3; }
html body .ts-poll-choice { min-height: 46px; color: var(--ink); background: #fff; border-color: #b6c5b4; }
html body .ts-poll-choice:hover:not(:has(input:disabled)) { background: #f1f8ef; }
html body .ts-poll-choice:has(input:checked) { color: var(--brand-dark); background: #e3f3e0; }
html body .ts-poll-archive-intro { background: #f2f8f0; border-color: #a7bba5; }
html body .ts-poll-archive-card { background: #fff; border-color: #a3b5a1; }
html body .ts-poll-archive-card h2 { color: var(--ink); font-size: 17px; }
html body .ts-poll-bar { height: 17px; background: #fff; }
html body .ts-poll-bar span { background: var(--brand); }

/* Polls belong in the centre of the green window title bar on ALL sizes;
   reserve left/right corners for the menu and share controls. */
html body .hero.ts-polls-enabled { padding-top: 59px; }
html body .hero.ts-polls-enabled .ts-poll-open {
    top: 8px;
    left: 42px;
    right: 42px;
    width: max-content;
    max-width: calc(100% - 92px);
    height: 24px;
    min-height: 24px;
    margin: 0 auto;
    padding: 2px 10px;
    border-color: #6d1717;
    font-size: 10px;
    line-height: 1.15;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
@media (max-width: 620px) {
    html body .hero.ts-polls-enabled { padding-top: 59px; }
    html body .hero.ts-polls-enabled .ts-poll-open { top: 6px; height: 24px; min-height: 24px; }
}
