/* THC Notebook 0.1.0: Field Notebook ([thc_notebook]). Colors are the theme's tokens (--thc-*, then the block presets,
   then the brand literals), so THC Core's Display switch flips them for Dark and High contrast with no rules of our
   own; the few literals (text on the leaf color, the notice box) are restated for Dark. Fonts come from the theme.
   Phone first: one column, tap targets at least 44px, no sideways scroll at 360px. Nothing floats, sticks or is
   fixed. Sizes in rem/em so Core's text-size switch carries through. */

.thc-nb {
  --nb-canvas: var(--thc-canvas, var(--wp--preset--color--base, #f7f1e4));
  --nb-raised: var(--thc-surface-raised, var(--wp--preset--color--accent-5, #fcf8ef));
  --nb-muted: var(--thc-surface-muted, var(--wp--preset--color--accent-4, #ece4d9));
  --nb-border: var(--thc-border, var(--wp--preset--color--accent-6, #d9d0bc));
  --nb-text: var(--thc-text, var(--wp--preset--color--contrast, #332d25));
  --nb-leaf: var(--thc-leaf, var(--wp--preset--color--accent-1, #5e7d53));
  --nb-deep: var(--thc-leaf-deep, var(--wp--preset--color--accent-3, #3f5c3b));
  --nb-error: var(--thc-error, #a13d2d);
  --nb-on-leaf: #ffffff;
  --nb-flag-bg: #fbf1e3;
  --nb-flag-line: #b9742a;
  --nb-head: var(--wp--preset--font-family--platypi, "THC Platypi", Georgia, serif);
  --nb-radius: var(--thc-radius-md, 10px);
  color: var(--nb-text);
  margin-top: 1rem;
  overflow-wrap: anywhere;
}
:root[data-thc-theme="dark"] .thc-nb { --nb-on-leaf: #15130f; --nb-flag-bg: #2c241b; --nb-flag-line: #c98b4c; }
:root[data-thc-contrast="high"] .thc-nb { --nb-flag-bg: #ffffff; --nb-flag-line: #000000; }
:root[data-thc-contrast="high"][data-thc-theme="dark"] .thc-nb { --nb-flag-bg: #000000; --nb-flag-line: #ffffff; --nb-on-leaf: #000000; }

.thc-nb *, .thc-nb *::before, .thc-nb *::after { box-sizing: border-box; }
.thc-nb [hidden] { display: none !important; }
:where(.thc-nb) :where(button, input, select, textarea) { font: inherit; color: inherit; }
.thc-nb :focus-visible { outline: 3px solid var(--nb-leaf); outline-offset: 2px; }
.thc-nb h2:focus { outline: none; }

.thc-nb__nojs, .thc-nb__unavailable, .thc-nb__off { background: var(--nb-muted); border-radius: var(--nb-radius); font-weight: 600; margin: 1rem 0; padding: .75rem 1rem; }

/* status line: always there, plain, never floating */
.thc-nb__status { background: var(--nb-raised); border: 1px solid var(--nb-border); border-left: 4px solid var(--nb-leaf); border-radius: var(--nb-radius); font-size: .95rem; margin: 1rem 0; padding: .6rem .9rem; }
.thc-nb__status--offline, .thc-nb__status--error, .thc-nb__status--erased-elsewhere { border-left-color: var(--nb-flag-line); }
.thc-nb__status--other-account { border-left-color: var(--nb-error); }

/* tabs */
.thc-nb__tabs ul { display: flex; flex-wrap: wrap; gap: .4rem; list-style: none; margin: 0 0 1rem; padding: 0; }
.thc-nb__tabs li { margin: 0; }
.thc-nb__tab { align-items: center; border: 1.5px solid var(--nb-border); border-radius: 999px; color: inherit; display: inline-flex; font-weight: 600; min-height: 44px; padding: .4rem 1rem; text-decoration: none; }
.thc-nb__tab:hover { background: var(--nb-muted); }
.thc-nb__tab.is-current { background: var(--nb-deep); border-color: var(--nb-deep); color: var(--nb-on-leaf); }

.thc-nb__view { min-height: 12rem; }
.thc-nb__h2 { font-family: var(--nb-head); font-size: clamp(1.25rem, 1.1rem + .6vw, 1.55rem); line-height: 1.15; margin: 0 0 .6rem; }
.thc-nb__h3 { font-family: var(--nb-head); font-size: 1.15rem; margin: 1.5rem 0 .5rem; }
.thc-nb__note, .thc-nb__empty { font-size: .95rem; margin: .5rem 0; }
.thc-nb__hint { font-size: .9rem; margin: .2rem 0 0; opacity: .85; }
.thc-nb__muted { display: block; font-size: .92rem; opacity: .85; }
.thc-nb__label { font-weight: 600; margin: 0; }
.thc-nb__msg { background: var(--nb-muted); border-radius: var(--nb-radius); font-weight: 600; margin: 0 0 1rem; padding: .6rem .9rem; }
.thc-nb__msg--warn, .thc-nb__formmsg { background: var(--nb-flag-bg); border: 1.5px solid var(--nb-flag-line); border-radius: var(--nb-radius); font-weight: 600; margin: 0 0 1rem; padding: .6rem .9rem; }
.thc-nb__formmsg { margin: 0; }
.thc-nb__summary { font-weight: 600; margin: .75rem 0 .5rem; }
.thc-nb__row { align-items: center; display: flex; flex-wrap: wrap; gap: .5rem; }
.thc-nb__cols { align-items: end; display: grid; gap: .6rem .9rem; grid-template-columns: minmax(0, 1fr); margin: .5rem 0; }
@media (min-width: 560px) { .thc-nb__cols { grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr)); } }
.thc-nb__badge { border: 1px solid var(--nb-border); border-radius: 999px; font-size: .82em; margin-left: .4em; padding: .05em .55em; white-space: nowrap; }
.thc-nb__badge--warn { border-color: var(--nb-flag-line); }

/* buttons */
.thc-nb__btn { align-items: center; background: var(--nb-raised); border: 1.5px solid var(--nb-deep); border-radius: 999px; color: var(--nb-deep); cursor: pointer; display: inline-flex; font-weight: 600; justify-content: center; line-height: 1.2; min-height: 44px; padding: .5rem 1.1rem; text-align: center; text-decoration: none; }
.thc-nb__btn:hover { background: var(--nb-muted); }
.thc-nb__btn--primary { background: var(--nb-deep); color: var(--nb-on-leaf); }
.thc-nb__btn--primary:hover { background: var(--nb-leaf); border-color: var(--nb-leaf); }
.thc-nb__btn--quiet { border-color: var(--nb-border); color: inherit; }
.thc-nb__btn--danger { border-color: var(--nb-error); color: var(--nb-error); }
.thc-nb__btn--small { font-size: .92rem; padding: .35rem .8rem; }
.thc-nb__btn--chip { border-color: var(--nb-border); color: inherit; font-size: .92rem; font-weight: 500; padding: .3rem .75rem; }

/* forms */
.thc-nb__form, .thc-nb__confirm, .thc-nb__filters { background: var(--nb-raised); border: 1px solid var(--nb-border); border-radius: var(--thc-radius-lg, 16px); display: grid; gap: .85rem; margin: .75rem 0; padding: .9rem; }
.thc-nb__confirm { border-color: var(--nb-flag-line); }
.thc-nb__confirm p { margin: 0; }
.thc-nb__core, .thc-nb__species, .thc-nb__where, .thc-nb__secbody { display: grid; gap: .6rem; min-width: 0; }
.thc-nb__field { display: grid; gap: .25rem; min-width: 0; }
.thc-nb__field label, .thc-nb__fieldset legend { font-weight: 600; }
.thc-nb input:not([type="checkbox"]), .thc-nb select, .thc-nb textarea { background: var(--nb-canvas); border: 1.5px solid var(--nb-border); border-radius: 8px; max-width: 100%; min-height: 44px; padding: .45rem .6rem; width: 100%; }
.thc-nb textarea { min-height: 4.5rem; resize: vertical; }
.thc-nb input[type="checkbox"] { flex: none; height: 1.25em; margin: 0 .35em 0 0; width: 1.25em; }
.thc-nb__check { align-items: center; display: inline-flex; min-height: 44px; }
.thc-nb__fieldset { border: 1px solid var(--nb-border); border-radius: var(--nb-radius); display: flex; flex-wrap: wrap; gap: 0 1.1rem; margin: 0; min-width: 0; padding: .4rem .9rem; }
.thc-nb__whereline, .thc-nb__picked { margin: 0; }
.thc-nb__picked { font-size: .95rem; }

/* species suggestions: a plain list under the box, in the page's flow */
.thc-nb__suggest { border: 1.5px solid var(--nb-border); border-radius: var(--nb-radius); list-style: none; margin: 0; overflow: hidden; padding: 0; }
.thc-nb__suggest li { margin: 0; }
.thc-nb__suggest li + li { border-top: 1px solid var(--nb-border); }
.thc-nb__sugbtn { background: var(--nb-canvas); border: 0; cursor: pointer; display: block; min-height: 44px; padding: .5rem .75rem; text-align: left; width: 100%; }
.thc-nb__sugbtn:hover, .thc-nb__sugbtn:focus-visible { background: var(--nb-muted); }
.thc-nb__sugname { font-weight: 600; }
.thc-nb__chips { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .35rem; max-height: 13.5rem; overflow-y: auto; }

/* sections of the full form */
.thc-nb__details { border: 1px solid var(--nb-border); border-radius: var(--nb-radius); padding: 0 .9rem; }
.thc-nb__details > summary { cursor: pointer; font-weight: 600; min-height: 44px; padding: .65rem 0; }
.thc-nb__details[open] { padding-bottom: .9rem; }

/* the list */
.thc-nb__list { display: grid; gap: .5rem; list-style: none; margin: 0; padding: 0; }
.thc-nb__item { margin: 0; }
.thc-nb__itemlink { background: var(--nb-raised); border: 1px solid var(--nb-border); border-radius: var(--nb-radius); color: inherit; display: block; min-height: 44px; padding: .65rem .9rem; text-decoration: none; }
.thc-nb__itemlink:hover { border-color: var(--nb-deep); }
.thc-nb__itemname { font-weight: 600; }
.thc-nb__itemsci { opacity: .9; }

@media print { .thc-nb__tabs, .thc-nb__btn, .thc-nb__status, .thc-nb__filters { display: none; } }

/* 0.1.2: the no-AI note sits under the tool on this page */
.thc-nb > .thc-built, .thc-nb > details.thc-built { margin-top: 1.5rem; }
