/* THC Field Tools 0.15.0: Museum Records ([thc_range_finder mode="museum"]).
   On the rf.css tokens (the root is ".thc-rf.thc-mr"); the few colours of its own are restated for THC Core's Display
   switch (html[data-thc-theme="dark"] / [data-theme="dark"]) and high contrast (html[data-thc-contrast="high"]), as
   guide.css does. The device's own dark setting is deliberately not followed. Nothing floats, sticks or overlays: the
   species suggestions and every decoded record open inline. Phone first (360 px), touch targets at least 44 px. */

.thc-mr {
  --mr-raised: var(--thc-rf-raised, #fcf8ef);
  --mr-canvas: var(--thc-rf-canvas, #f7f1e4);
  --mr-muted: var(--thc-rf-muted, #ece4d9);
  --mr-border: var(--thc-rf-border, #d9d0bc);
  --mr-stroke: var(--thc-rf-stroke, #8a7f66);
  --mr-leaf: var(--thc-rf-leaf, #5e7d53);
  --mr-deep: var(--thc-rf-deep, #3f5c3b);
  --mr-type-bg: #efe2c0; --mr-type-text: #5a4612; --mr-type-border: #c9ab5c;
  --mr-prot-bg: #f8e9e5; --mr-prot-text: #7d2a1f; --mr-prot-border: #d7a197;
  --mr-active: #e3eadb;
  --mr-bar: #93ad84;
  --mr-error: #a63d2f;
  overflow-wrap: anywhere;
}
:root[data-theme="dark"] .thc-mr, :root[data-thc-theme="dark"] .thc-mr {
  --mr-type-bg: #3b3220; --mr-type-text: #f0d999; --mr-type-border: #8a7434;
  --mr-prot-bg: #3a2522; --mr-prot-text: #f0b4aa; --mr-prot-border: #8a4a3f;
  --mr-active: #2f3a2b;
  --mr-bar: #6d8b62;
  --mr-error: #f0a49d;
}
:root[data-thc-contrast="high"] .thc-mr { --mr-type-bg: #fff; --mr-type-text: #000; --mr-type-border: #000; --mr-prot-bg: #fff; --mr-prot-text: #000; --mr-prot-border: #000; --mr-active: #e6e6e6; --mr-bar: #000; --mr-error: #8a0000; }
:root[data-thc-contrast="high"][data-thc-theme="dark"] .thc-mr { --mr-type-bg: #000; --mr-type-text: #fff; --mr-type-border: #fff; --mr-prot-bg: #000; --mr-prot-text: #fff; --mr-prot-border: #fff; --mr-active: #333; --mr-bar: #fff; --mr-error: #ffb4ab; }
:root[data-theme="dark"] .thc-mr .thc-rf__btn:not(.thc-rf__btn--ghost), :root[data-thc-theme="dark"] .thc-mr .thc-rf__btn:not(.thc-rf__btn--ghost) { color: #15130f; } /* light leaf button: dark text, as guide.css */
:root[data-theme="dark"] .thc-mr input, :root[data-theme="dark"] .thc-mr select, :root[data-theme="dark"] .thc-mr textarea,
:root[data-thc-theme="dark"] .thc-mr input, :root[data-thc-theme="dark"] .thc-mr select, :root[data-thc-theme="dark"] .thc-mr textarea { color: #eee; background: #1f1d1a; }

.thc-mr *, .thc-mr *::before, .thc-mr *::after { box-sizing: border-box; }
.thc-mr [hidden] { display: none !important; }
.thc-mr a { color: var(--mr-deep); }
.thc-mr a:focus-visible, .thc-mr summary:focus-visible, .thc-mr [tabindex]:focus-visible, .thc-mr button:focus-visible, .thc-mr input:focus-visible, .thc-mr select:focus-visible, .thc-mr textarea:focus-visible { outline: 2px solid var(--mr-leaf); outline-offset: 2px; }
.thc-mr__status { margin: 0 0 .8rem; min-height: 1.4em; font-size: var(--wp--preset--font-size--small, .875rem); color: var(--mr-deep); }
.thc-mr__status.is-error, .thc-mr .is-error { color: var(--mr-error); }
.thc-mr__muted { color: var(--mr-deep); font-size: var(--wp--preset--font-size--small, .875rem); }
.thc-mr__h2 { margin: 0 0 .4rem; font-size: 1.3em; line-height: 1.25; }
.thc-mr__h2:focus { outline: none; }
.thc-mr__h3 { margin: .2rem 0 .4rem; font-size: 1.05em; }

/* ---------- panels and the form ---------- */
.thc-mr__panel { background: var(--mr-raised); border: 1px solid var(--mr-border); border-radius: var(--thc-rf-radius, 12px); padding: 1rem; margin: 0 0 1rem; }
.thc-mr__row { display: flex; flex-wrap: wrap; gap: .7rem 1rem; align-items: flex-end; }
.thc-mr__row + .thc-mr__row { margin-top: .8rem; }
.thc-mr__row--end { justify-content: space-between; align-items: center; }
.thc-mr__field { display: flex; flex-direction: column; gap: .3rem; flex: 1 1 14rem; min-width: 0; }
.thc-mr__field--species { flex-basis: 100%; }
.thc-mr__label { font-size: var(--wp--preset--font-size--small, .875rem); font-weight: 600; color: var(--mr-deep); }
.thc-mr__input, .thc-mr__select, .thc-mr__textarea { font: inherit; color: inherit; background: var(--mr-canvas); border: 1px solid var(--mr-stroke); border-radius: 10px; padding: .55em .8em; width: 100%; min-width: 0; min-height: 44px; }
.thc-mr__textarea { min-height: 6.5em; resize: vertical; margin: .2rem 0 .6rem; }
.thc-mr__chosen { margin: .1rem 0 0; font-size: var(--wp--preset--font-size--small, .875rem); color: var(--mr-deep); }
.thc-mr__check { display: flex; align-items: center; gap: .55em; min-height: 44px; cursor: pointer; flex: 1 1 16rem; }
.thc-mr__check input { width: 1.25em; height: 1.25em; margin: 0; flex: none; accent-color: var(--mr-leaf); }
.thc-mr .thc-rf__btn, .thc-mr .thc-rf__btn--ghost { min-height: 44px; display: inline-flex; align-items: center; justify-content: center; text-align: center; text-decoration: none; white-space: normal; }
.thc-mr .thc-rf__btn:disabled { opacity: .55; cursor: default; }
.thc-mr__go { flex: 0 0 auto; }

/* species suggestions: an inline list under the field (pushes the page down; never floats) */
.thc-mr__options { list-style: none; margin: .2rem 0 0; padding: .25rem; border: 1px solid var(--mr-stroke); border-radius: 10px; background: var(--mr-canvas); max-height: 22rem; overflow-y: auto; }
.thc-mr__opt { padding: .55rem .7rem; min-height: 44px; display: flex; flex-wrap: wrap; align-items: center; gap: 0 .4em; border-radius: 8px; cursor: pointer; }
.thc-mr__opt:hover, .thc-mr__opt.is-active { background: var(--mr-active); }
.thc-mr__opt.is-active { outline: 2px solid var(--mr-leaf); outline-offset: -2px; }
.thc-mr__opt-eng { font-weight: 600; }
.thc-mr__opt-sci { color: var(--mr-deep); }
.thc-mr__opt--world { border-top: 1px dashed var(--mr-border); font-weight: 600; color: var(--mr-deep); }

/* ---------- results ---------- */
.thc-mr__results { margin: 0 0 1rem; scroll-margin-top: 5rem; }
.thc-mr__head { margin: 0 0 .6rem; }
.thc-mr__sub { margin: 0 0 .4rem; color: var(--mr-deep); }
.thc-mr__frame, .thc-mr__note { margin: .3rem 0; font-size: var(--wp--preset--font-size--small, .875rem); }
.thc-mr__note { padding: .5em .8em; border-left: 3px solid var(--mr-leaf); background: var(--mr-raised); }
.thc-mr__notice p { margin: 0 0 .4rem; }
.thc-mr__chips-lead { margin: .6rem 0 .3rem; }
.thc-mr__chips { display: flex; flex-wrap: wrap; gap: .4rem; margin: 0 0 .8rem; }
.thc-mr__chip { font: inherit; font-size: .92em; min-height: 44px; padding: .3em .9em; border-radius: 999px; border: 1px solid var(--mr-border); background: var(--mr-raised); color: inherit; cursor: pointer; display: inline-flex; align-items: center; gap: .35em; }
.thc-mr__chip:hover { border-color: var(--mr-stroke); background: var(--mr-muted); }
.thc-mr__chip.is-on { background: var(--mr-leaf); border-color: var(--mr-leaf); color: #fff; }
:root[data-theme="dark"] .thc-mr__chip.is-on, :root[data-thc-theme="dark"] .thc-mr__chip.is-on { color: #15130f; }
.thc-mr__chip-n { font-size: .85em; opacity: .85; }
.thc-mr__chip--text { cursor: default; border-style: dashed; } /* review round: a code that cannot be a filter */
.thc-mr__chip--text:hover { background: var(--mr-raised); border-color: var(--mr-border); }
.thc-mr__decades { margin: 0 0 1rem; }
.thc-mr__decades p { margin: 0 0 .3rem; }
.thc-mr__bars { display: flex; align-items: flex-end; gap: 2px; height: 3rem; padding: 0 .1rem; border-bottom: 1px solid var(--mr-border); }
.thc-mr__bar { flex: 1 1 0; min-width: 2px; background: var(--mr-bar); border-radius: 2px 2px 0 0; }
.thc-mr__bars-axis { display: flex; justify-content: space-between; font-size: .75em; color: var(--mr-deep); }

.thc-mr__list { list-style: none; margin: 0 0 1rem; padding: 0; display: flex; flex-direction: column; gap: .6rem; }
.thc-mr__card { border: 1px solid var(--mr-border); border-radius: var(--thc-rf-radius, 12px); background: var(--mr-raised); }
.thc-mr__card.is-open { border-color: var(--mr-stroke); }
.thc-mr__card-btn { font: inherit; color: inherit; background: none; border: 0; width: 100%; text-align: left; padding: .85rem 1rem; cursor: pointer; display: flex; flex-direction: column; gap: .25rem; min-height: 44px; border-radius: var(--thc-rf-radius, 12px); }
.thc-mr__card-btn:hover { background: var(--mr-muted); }
.thc-mr__card-top { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem .6rem; }
.thc-mr__card-id { font-weight: 700; font-size: 1.08em; }
.thc-mr__badges { display: inline-flex; flex-wrap: wrap; gap: .3rem; }
.thc-mr .thc-mr__badge--type { background: var(--mr-type-bg); color: var(--mr-type-text); border-color: var(--mr-type-border); }
.thc-mr .thc-mr__badge--protect { background: var(--mr-prot-bg); color: var(--mr-prot-text); border-color: var(--mr-prot-border); }
.thc-mr .thc-mr__badge--photo { background: transparent; color: var(--mr-deep); border-style: dashed; }
.thc-mr__card-lines { display: flex; flex-direction: column; gap: .1rem; font-size: .95em; }
.thc-mr__card-inst, .thc-mr__card-prep { color: var(--mr-deep); font-size: .92em; }
.thc-mr__card-place { font-size: .92em; }
.thc-mr__card-cue { margin-top: .2rem; font-weight: 600; font-size: .9em; color: var(--mr-deep); text-decoration: underline; text-underline-offset: 2px; }
.thc-mr__card.is-open .thc-mr__card-cue { text-decoration: none; }
.thc-mr__decoded { padding: 0 1rem 1rem; border-top: 1px dashed var(--mr-border); }

/* the decoded view: label, value as given, what it means */
.thc-mr__dl { margin: .6rem 0 0; display: grid; grid-template-columns: 1fr; gap: 0; }
.thc-mr__k { font-weight: 700; font-size: .85em; letter-spacing: .02em; text-transform: uppercase; color: var(--mr-deep); margin: .75rem 0 .1rem; }
.thc-mr__v { margin: 0; display: flex; flex-direction: column; gap: .2rem; }
.thc-mr__val { font-weight: 700; }
.thc-mr__expl strong { font-weight: 700; }
.thc-mr__form .thc-mr__status { margin: .8rem 0 0; }
.thc-mr__expl { font-size: .95em; line-height: 1.45; }
.thc-mr__issues, .thc-mr__unread { margin: .2rem 0 0; padding-left: 1.2em; }
.thc-mr__cite { margin-top: 1rem; padding-top: .6rem; border-top: 1px solid var(--mr-border); }
.thc-mr__dl--small .thc-mr__k { margin-top: .5rem; }
.thc-mr__citation { margin: .8rem 0 .3rem; padding: .6em .8em; background: var(--mr-canvas); border: 1px solid var(--mr-border); border-radius: 8px; font-size: .95em; }
.thc-mr__actions { display: flex; flex-wrap: wrap; gap: .5rem; margin: .6rem 0 0; align-items: center; }
.thc-mr__copybox { font: inherit; font-size: .9em; flex: 1 1 100%; min-height: 44px; padding: .4em .6em; border: 1px solid var(--mr-stroke); border-radius: 8px; background: var(--mr-canvas); color: inherit; }
.thc-mr__more { margin: 0 0 1rem; width: 100%; }
.thc-mr__portals { display: flex; flex-wrap: wrap; gap: .5rem; margin: .4rem 0 0; }
.thc-mr__portal { flex: 1 1 8rem; }
.thc-mr__elsewhere p { margin: 0 0 .3rem; }
.thc-mr__shared { border-color: var(--mr-stroke); }

/* ---------- paste box and how it works ---------- */
.thc-mr__paste .thc-mr__h2 { font-size: 1.15em; }
.thc-mr__paste > p { margin: 0 0 .5rem; }
.thc-mr__count { margin-left: .4rem; }
.thc-mr__paste-out { margin-top: .6rem; }
.thc-mr__paste-out .thc-mr__list { margin-top: .6rem; }
.thc-mr__lookup { margin-top: .3rem; align-self: flex-start; }
.thc-mr__how p, .thc-mr__how ul { margin: .5rem 0; }

@media (min-width: 700px) {
  .thc-mr__panel { padding: 1.1rem 1.25rem; }
  .thc-mr__dl { grid-template-columns: minmax(10rem, 13rem) 1fr; column-gap: 1.2rem; }
  .thc-mr__k { margin: .7rem 0 0; text-transform: none; letter-spacing: 0; font-size: .92em; }
  .thc-mr__v { margin: .7rem 0 0; }
  .thc-mr__more { width: auto; }
  .thc-mr__portal { flex: 0 1 auto; }
}
@media (prefers-reduced-motion: reduce) {
  .thc-mr *, .thc-mr *::before, .thc-mr *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}
@media print {
  .thc-mr__form, .thc-mr__chips, .thc-mr__chips-lead, .thc-mr__more, .thc-mr__paste, .thc-mr__actions, .thc-mr__elsewhere, .thc-mr__card-cue { display: none !important; }
  .thc-mr__decoded[hidden] { display: none !important; }
}
