/* Isolated from page templates: shared HTML, browser-only personal state. */
#tr-research [hidden], [data-research-tyre][hidden], [data-research-vehicle][hidden], [data-research-size][hidden] { display: none !important; }
.tr-research-launch {
    position: fixed; left: 16px; bottom: max(16px, env(safe-area-inset-bottom)); z-index: 997;
    background: #10232d; color: #fff; border: 1px solid #0db1e7; border-radius: 24px;
    padding: 10px 16px; min-height: 44px; font-size: 14px; font-weight: 700;
    box-shadow: 0 3px 12px #0003; max-width: calc(100vw - 32px);
}
.tr-research-launch span { margin-left: 8px; color: #0db1e7; }
#tr-research-dialog {
    background: #fff; color: #172b36; border: 1px solid #95a7b0; border-radius: 12px;
    padding: 24px; width: min(560px, calc(100% - 24px)); max-height: 85vh; max-height: 85dvh;
    overflow: auto; margin: auto; box-shadow: 0 15px 70px #0005; font-size: 15px;
}
#tr-research-dialog::backdrop { background: #07151caa; }
#tr-research-dialog h2, #tr-research-dialog h3 { background: none; color: #172b36; padding: 0; border: 0; margin: 0 0 12px; font-size: 22px; }
#tr-research-dialog h3 { font-size: 18px; margin-top: 20px; }
#tr-research-dialog p { font-size: 14px; line-height: 1.5; margin: 10px 0; }
.tr-research-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
#tr-research-form label { display: block; font-weight: 700; margin: 12px 0 4px; }
#tr-research-form input { width: 100%; box-sizing: border-box; padding: 10px; border: 1px solid #758996; border-radius: 4px; background: #fff; color: #172b36; font-size: 16px; }
#tr-research-dialog button, .tr-research-save {
    min-height: 44px; padding: 8px 12px; border: 1px solid #607886; border-radius: 5px;
    background: #f1f7fa; color: #132d3c; font-size: 14px; line-height: 1.4; font-weight: 700; cursor: pointer;
}
/* On the page a Save button sits among small controls (the Watch button, the
   compare tick, chips), so it takes their size; 44px stays for the tray dialog. */
.tr-research-save { margin: 6px 0; min-height: 32px; padding: 4px 12px; border-radius: 4px; font-size: 13px; font-weight: 600; }
.tyd-titletools button.tr-research-save { background: #f1f7fa; color: #132d3c; border-color: #607886; }
.tyd-titletools button.tr-research-save[aria-pressed="true"] { background: #c7eef8; color: #132d3c; border-color: #007b9d; }
.tyd-titletools { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.tyd-titletools .tr-research-save { margin: 0; }
/* research-tray.js reveals the button after first paint. Hold its box from the
   start: a late reveal widened the tools by ~90px, pushed them under a tyre name
   that only just fitted beside them and moved the whole page (desktop CLS ~0.2).
   !important to outrank Bootstrap's [hidden] { display: none !important }. */
.tyd-titletools .tr-research-save[hidden] { display: block !important; visibility: hidden; }
.tr-research-save[aria-pressed="true"] { background: #c7eef8; border-color: #007b9d; }
#tr-research-dialog button:disabled { opacity: .55; cursor: default; }
#tr-research-dialog button[type="submit"], #tr-research-dialog [data-research-compare] { background: #0db1e7; color: #07151c; border-color: #007b9d; }
.tr-research-links { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 16px; }
#tr-research-dialog a, #tr-research-dialog a:visited { color: #006889; text-decoration: underline; }
.tr-research-links a { display: inline-flex; align-items: center; min-height: 44px; }
.tr-research-list { list-style: none; padding: 0; margin: 0; }
.tr-research-list li { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 8px; padding: 10px 0; border-bottom: 1px solid #d8e3e9; }
.tr-research-list label { display: flex; align-items: center; gap: 10px; min-height: 44px; margin: 0; }
.tr-research-list input { width: 20px; height: 20px; flex-shrink: 0; }
.tr-research-list a { display: block; margin-left: 30px; overflow-wrap: anywhere; }
.tr-research-controls { display: flex; flex-wrap: wrap; gap: 10px; }
#tr-research-choices { border-block: 1px solid #d8e3e9; margin: 16px 0; padding: 10px 0; }
#tr-research-choices summary { cursor: pointer; min-height: 44px; font-weight: 700; padding: 8px 0; }
#tr-research-choices summary span { display: block; font-weight: 400; font-size: 14px; overflow-wrap: anywhere; }
.tr-research-list label span { min-width: 0; overflow-wrap: anywhere; }
.tr-research-toast { position: fixed; left: 16px; bottom: 72px; z-index: 998; width: min(340px, calc(100vw - 32px)); background: #10232d; color: #fff; padding: 12px; border-radius: 6px; font-size: 14px; }
#tr-research :focus-visible, .tr-research-save:focus-visible { outline: 3px solid #0083a9; outline-offset: 3px; }
@media (max-width: 400px) { #tr-research-dialog { padding: 16px; } }
@media print { #tr-research, .tr-research-save { display: none !important; } }
