/* Tidy with MCP Assistant: the floating Tidy button, its popover, and Settings, Tidy with MCP Assistant */
.tidybtn { position: fixed; left: 0; top: 0; z-index: 85; display: inline-flex; align-items: center; gap: 4px; height: 26px; padding: 0 10px 0 7px; border-radius: var(--r-pill);
  border: 1px solid var(--line); background: var(--surface); color: var(--blue-ink); box-shadow: var(--sh-1); font: inherit; font-size: var(--fs-12); font-weight: 600; line-height: 1;
  cursor: pointer; opacity: 0.92; white-space: nowrap; transition: opacity 0.12s, border-color 0.12s, box-shadow 0.12s; }
.tidybtn[hidden], .tidybtn.gone { display: none; }
.tidybtn .ic { width: 14px; height: 14px; flex: none; }
.tidybtn:hover, .tidybtn:focus-visible { opacity: 1; border-color: var(--blue-btn); box-shadow: var(--sh-2); }
.tidybtn:focus-visible { outline: 2px solid var(--blue-btn); outline-offset: 2px; }
.tidybtn.busy { cursor: progress; color: var(--muted); }
.tidybtn.off, .tidybtn.long { color: var(--muted); }
.tidybtn.long { cursor: default; }
.tidyspin { display: inline-block; width: 12px; height: 12px; flex: none; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: tidyspin 0.8s linear infinite; }
.btn .tidyspin { margin-right: 2px; }
@keyframes tidyspin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .tidyspin { animation-duration: 2.4s; } .tidybtn { transition: none; } }
@media (pointer: coarse) { .tidybtn { height: 32px; padding: 0 12px 0 9px; font-size: var(--fs-13); } }

.tidypop { position: fixed; left: 0; top: 0; z-index: 86; display: flex; flex-direction: column; gap: 10px; max-height: min(62vh, 460px); padding: 12px 14px;
  border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--ink); box-shadow: var(--sh-pop); }
.tidypop[hidden] { display: none; }
.tidyhd { display: flex; align-items: center; gap: 6px; font-size: var(--fs-13); color: var(--blue-ink); }
.tidyhd .ic { width: 16px; height: 16px; flex: none; }
.tidyhd.warn { color: var(--amber); }
.tidyhd b { font-weight: 700; }
.tidytxt, .tidydiff { min-height: 0; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; font-size: var(--fs-14); line-height: 1.55;
  padding: 10px 12px; border-radius: var(--r-tight); background: var(--surface2); border: 1px solid var(--divider); }
.tidytxt[hidden], .tidydiff[hidden] { display: none; }
.tidytxt:focus-visible { outline: 2px solid var(--blue-btn); outline-offset: 1px; }
.tidymsg { margin: 0; font-size: var(--fs-14); line-height: 1.45; }
.tidyacts { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.tidyacts .tidychg { margin-left: auto; font-size: var(--fs-13); }
.btn.tidysm { min-height: 34px; padding: 0 14px; font-size: var(--fs-14); }
@media (pointer: coarse) { .btn.tidysm { min-height: 44px; } }
.tidydiff ins, .tdbox ins { text-decoration: none; background: var(--tint-good); color: var(--good); border-radius: 3px; padding: 0 2px; box-shadow: inset 0 -1px 0 var(--good); }
.tidydiff del, .tdbox del { text-decoration: line-through; color: var(--red); background: var(--tint-red); border-radius: 3px; padding: 0 2px; }
@media (forced-colors: active) { .tidybtn, .tidypop { border-color: CanvasText; } .tidydiff ins, .tdbox ins { text-decoration: underline; } }

/* Settings page */
.tdpage .tdcard { margin-bottom: 16px; }
.tdhead { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 14px; margin-bottom: 8px; }
.tdhead .sechead { margin: 0; margin-right: auto; }
.tdsteps { margin: 10px 0 8px; padding-left: 22px; font-size: var(--fs-14); line-height: 1.55; }
.tdsteps > li { margin: 4px 0; }
.tdsecrets { margin: 6px 0 2px; padding-left: 18px; }
.tdsecrets li { margin: 3px 0; overflow-wrap: anywhere; }
.tdsecrets code { font-size: var(--fs-13); padding: 1px 6px; border-radius: 6px; background: var(--chip-bg); }
.tdmore { margin-top: 6px; font-size: var(--fs-14); }
.tdmore summary { cursor: pointer; color: var(--grey-ink); font-weight: 600; min-height: 32px; line-height: 32px; }
.tdform { display: flex; flex-direction: column; gap: 18px; margin-top: 12px; padding-top: 16px; border-top: 1px solid var(--divider); }
.tdtones { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 4px; }
.tdtone { display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r-ctl); background: var(--surface); cursor: pointer; }
.tdtone:has(input:checked) { border-color: var(--blue-btn); background: var(--blue-tint); }
.tdtone input { width: 18px; height: 18px; margin: 1px 0 0; flex: none; accent-color: var(--blue-btn); }
.tdtone span { display: flex; flex-direction: column; gap: 2px; min-width: 0; font-size: var(--fs-14); }
.tdtone small { font-size: var(--fs-13); line-height: 1.35; }
.tdinfo, .tdprivacy { display: flex; align-items: flex-start; gap: 10px; margin: 0; font-size: var(--fs-14); line-height: 1.45; }
.tdinfo { padding: 10px 12px; border-radius: var(--r-ctl); background: var(--surface2); border: 1px solid var(--divider); }
.tdinfo .ic, .tdprivacy .ic { width: 16px; height: 16px; flex: none; margin-top: 2px; color: var(--muted); }
.tdprivacy { color: var(--muted); padding: 0 4px 24px; }
.tdtwo { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.tdwhere { display: flex; flex-direction: column; gap: 2px; margin-top: 4px; }
.tdwhere .chkl { align-items: flex-start; padding: 4px 0; }
.tdwhere .chkl input { margin-top: 2px; flex: none; }
.tdwhere small { font-size: var(--fs-13); }
.tdform .formact { gap: 12px; }
.tdba { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 4px; }
.tdba .minihead { margin-top: 12px; }
.tdbox { white-space: pre-wrap; overflow-wrap: anywhere; font-size: var(--fs-14); line-height: 1.55; padding: 10px 12px; border-radius: var(--r-tight); background: var(--surface2); border: 1px solid var(--divider); min-height: 64px; margin-bottom: 6px; }
.tdtryerr { margin: 10px 0 0; color: var(--red); font-size: var(--fs-14); }
.tdcard .formact { margin-top: 10px; }
@media (max-width: 760px) {
  .tdtones, .tdtwo, .tdba { grid-template-columns: minmax(0, 1fr); }
}
.tdhead .link.quiet { font-size: var(--fs-14); min-height: 28px; }
.tdcard > .featl { margin-top: 0; }
.tdcard > .featl li:first-child { padding-top: 0; }
.tdcard > .sechead + .small { margin: -4px 0 12px; }
