/* =====================================================================
   BodySecretsHub.one — Tool UI styles (loaded only on tool pages)
   ===================================================================== */

.bsh-tool { background: #fff; border: 1px solid var(--bsh-line); border-radius: var(--r-lg); box-shadow: var(--sh-md); overflow: hidden; }
.bsh-tool__head { padding: 1.3rem 1.5rem; border-bottom: 1px solid var(--bsh-line); background: linear-gradient(180deg, var(--bsh-primary-050), #fff); display: flex; align-items: center; gap: .8rem; }
.bsh-tool__head .bsh-ico { color: var(--bsh-primary); }
.bsh-tool__head h2 { margin: 0; font-size: 1.2rem; }
.bsh-tool__body { padding: 1.5rem; }
.bsh-tool__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
@media (max-width: 767px){ .bsh-tool__grid { grid-template-columns: 1fr; } }

.bsh-field { margin-bottom: 1rem; }
.bsh-field label { display: block; font-family: var(--font-display); font-weight: 600; color: var(--bsh-ink-soft); margin-bottom: .35rem; font-size: .92rem; }
.bsh-field .form-control, .bsh-field .form-select { border-radius: var(--r-xs); border: 1px solid var(--bsh-line-strong); padding: .7rem .9rem; }
.bsh-field .form-control:focus, .bsh-field .form-select:focus { border-color: var(--bsh-primary); box-shadow: 0 0 0 .2rem rgba(10,108,178,.15); }
.bsh-field__hint { color: var(--bsh-muted); font-size: .8rem; margin: .3rem 0 0; }
.bsh-inputgroup { display: flex; gap: .5rem; }
.bsh-inputgroup .form-control { flex: 1; }

.bsh-unit-toggle { display: inline-flex; border: 1px solid var(--bsh-line-strong); border-radius: 999px; overflow: hidden; margin-bottom: 1rem; }
.bsh-unit-toggle button { border: 0; background: #fff; padding: .45rem 1rem; font-family: var(--font-display); font-weight: 600; font-size: .85rem; color: var(--bsh-ink-soft); cursor: pointer; }
.bsh-unit-toggle button.is-active { background: var(--bsh-primary); color: #fff; }

/* Result card */
.bsh-result-card { background: var(--bsh-bg-soft); border: 1px solid var(--bsh-line); border-radius: var(--r); padding: 1.4rem; text-align: center; min-height: 160px; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.bsh-result-card .bsh-result-value { font-family: var(--font-display); font-weight: 800; font-size: 2.6rem; line-height: 1; color: var(--bsh-primary); }
.bsh-result-card .bsh-result-label { color: var(--bsh-muted); font-size: .9rem; margin-top: .3rem; }
.bsh-result-card .bsh-result-badge { display: inline-block; margin-top: .8rem; padding: .3rem .9rem; border-radius: 999px; font-weight: 600; font-family: var(--font-display); font-size: .85rem; }
.bsh-result-empty { color: var(--bsh-muted); }
.bsh-result-note { font-size: .82rem; color: var(--bsh-muted); margin-top: .8rem; }
.badge-low { background: #e7f1fb; color: #0a6cb2; } .badge-normal { background: #eaf7f0; color: #1f8a54; }
.badge-high { background: #fdf0e7; color: #c06a1b; } .badge-alert { background: #fdecec; color: #c53b3b; }

/* Scale bar */
.bsh-scale { margin-top: 1rem; }
.bsh-scale__track { position: relative; height: 12px; border-radius: 999px; background: linear-gradient(90deg,#7fb2dd,#4fae7e,#e6b455,#e07a5f); }
.bsh-scale__marker { position: absolute; top: -6px; width: 4px; height: 24px; background: #0e1c2b; border-radius: 3px; transform: translateX(-50%); box-shadow: 0 0 0 3px #fff; transition: left .4s ease; }
.bsh-scale__labels { display: flex; justify-content: space-between; font-size: .72rem; color: var(--bsh-muted); margin-top: .5rem; }

/* Actions bar */
.bsh-tool__actions { display: flex; flex-wrap: wrap; gap: .5rem; padding: 1rem 1.5rem; border-top: 1px solid var(--bsh-line); background: var(--bsh-bg-soft); }
.bsh-tool__actions button { display: inline-flex; align-items: center; gap: .4rem; border: 1px solid var(--bsh-line-strong); background: #fff; color: var(--bsh-ink-soft); border-radius: 999px; padding: .5rem 1rem; font-family: var(--font-display); font-weight: 600; font-size: .85rem; cursor: pointer; transition: .15s; }
.bsh-tool__actions button:hover { border-color: var(--bsh-primary); color: var(--bsh-primary); }
.bsh-tool__actions .bsh-ico-sm { width: 1rem; height: 1rem; }

/* Toast */
.bsh-toast { position: fixed; left: 50%; bottom: 26px; transform: translate(-50%, 20px); background: var(--bsh-ink); color: #fff; padding: .7rem 1.2rem; border-radius: 999px; font-weight: 600; font-family: var(--font-display); font-size: .9rem; box-shadow: var(--sh-lg); opacity: 0; transition: opacity .25s, transform .25s; z-index: 2000; }
.bsh-toast.show { opacity: 1; transform: translate(-50%, 0); }

/* Quiz */
.bsh-quiz { max-width: 640px; margin: 0 auto; }
.bsh-quiz__bar { display: flex; justify-content: space-between; font-family: var(--font-display); font-weight: 600; font-size: .85rem; color: var(--bsh-muted); margin-bottom: .5rem; }
.bsh-quiz__score { color: var(--bsh-primary); }
.bsh-quiz__progress { height: 6px; background: var(--bsh-line); border-radius: 999px; overflow: hidden; margin-bottom: 1.2rem; }
.bsh-quiz__progress span { display: block; height: 100%; background: linear-gradient(90deg,var(--bsh-primary),var(--bsh-teal)); transition: width .3s; }
.bsh-quiz__q { font-size: 1.25rem; margin: 0 0 1.1rem; }
.bsh-quiz__opts { display: grid; gap: .6rem; }
.bsh-quiz__opt { text-align: left; border: 1px solid var(--bsh-line-strong); background: #fff; border-radius: var(--r-sm); padding: .85rem 1.1rem; font-size: 1rem; cursor: pointer; transition: .15s; color: var(--bsh-ink-soft); font-weight: 500; }
.bsh-quiz__opt:hover:not(:disabled) { border-color: var(--bsh-primary); background: var(--bsh-primary-050); }
.bsh-quiz__opt.is-correct { border-color: var(--bsh-success); background: #eaf7f0; color: #1c6b43; font-weight: 600; }
.bsh-quiz__opt.is-wrong { border-color: var(--bsh-danger); background: #fdecec; color: #b93a3a; }
.bsh-quiz__explain { margin-top: 1rem; padding: .9rem 1.1rem; background: var(--bsh-bg-soft); border-radius: var(--r-sm); font-size: .95rem; border-left: 4px solid var(--bsh-primary); }
.bsh-quiz__explain .ok { color: var(--bsh-success); } .bsh-quiz__explain .no { color: var(--bsh-danger); }
.bsh-quiz__nav { margin-top: 1.2rem; text-align: right; }
.bsh-quiz__done { text-align: center; }
.bsh-quiz__ring { --pct:0; width: 130px; height: 130px; border-radius: 50%; margin: 0 auto 1rem; display: grid; place-items: center; background: conic-gradient(var(--bsh-primary) calc(var(--pct)*1%), var(--bsh-line) 0); }
.bsh-quiz__ring span { width: 100px; height: 100px; border-radius: 50%; background: #fff; display: grid; place-items: center; font-family: var(--font-display); font-weight: 800; font-size: 1.6rem; color: var(--bsh-primary); }

/* Flashcards */
.bsh-flash { max-width: 560px; margin: 0 auto; }
.bsh-flash__bar { display: flex; justify-content: space-between; align-items: center; font-family: var(--font-display); font-weight: 600; font-size: .85rem; color: var(--bsh-muted); margin-bottom: .8rem; }
.bsh-flash__shuffle { border: 1px solid var(--bsh-line-strong); background: #fff; border-radius: 999px; padding: .3rem .8rem; font-weight: 600; cursor: pointer; color: var(--bsh-ink-soft); }
.bsh-flash__card { width: 100%; min-height: 220px; border: 0; border-radius: var(--r-lg); cursor: pointer; position: relative; transform-style: preserve-3d; transition: transform .5s; background: transparent; }
.bsh-flash__card.is-flipped { transform: rotateY(180deg); }
.bsh-flash__face { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; text-align: center; padding: 2rem; border-radius: var(--r-lg); backface-visibility: hidden; -webkit-backface-visibility: hidden; box-shadow: var(--sh-md); font-size: 1.2rem; }
.bsh-flash__front { background: linear-gradient(135deg,var(--bsh-primary),var(--bsh-teal)); color: #fff; font-family: var(--font-display); font-weight: 700; }
.bsh-flash__back { background: #fff; border: 1px solid var(--bsh-line); color: var(--bsh-ink-soft); transform: rotateY(180deg); }
.bsh-flash__nav { display: flex; gap: .6rem; justify-content: center; margin-top: 1.2rem; }

/* Explorer */
.bsh-explore { display: grid; grid-template-columns: 220px 1fr; gap: 1.2rem; }
@media (max-width: 767px){ .bsh-explore { grid-template-columns: 1fr; } }
.bsh-explore__keys { display: flex; flex-direction: column; gap: .4rem; max-height: 420px; overflow: auto; }
@media (max-width: 767px){ .bsh-explore__keys { flex-direction: row; flex-wrap: wrap; } }
.bsh-explore__key { text-align: left; border: 1px solid var(--bsh-line); background: #fff; border-radius: var(--r-sm); padding: .7rem .9rem; cursor: pointer; font-family: var(--font-display); font-weight: 600; color: var(--bsh-ink-soft); transition: .15s; }
.bsh-explore__key:hover { border-color: var(--bsh-primary); }
.bsh-explore__key.is-active { background: var(--bsh-primary); color: #fff; border-color: var(--bsh-primary); }
.bsh-explore__panel { border: 1px solid var(--bsh-line); border-radius: var(--r); padding: 1.4rem; background: #fff; }
.bsh-explore__panel h3 { margin-top: 0; }

/* Reference/glossary list */
.bsh-ref-search { margin-bottom: 1.2rem; }
.bsh-ref-item { border: 1px solid var(--bsh-line); border-radius: var(--r-sm); padding: 1rem 1.2rem; margin-bottom: .7rem; background: #fff; }
.bsh-ref-item h3 { margin: 0 0 .3rem; font-size: 1.05rem; }
.bsh-ref-item p { margin: 0; font-size: .92rem; color: var(--bsh-body); }
.bsh-ref-empty { color: var(--bsh-muted); padding: 1rem 0; }

/* Journal / tracker rows */
.bsh-journal__row { display: grid; grid-template-columns: 1fr auto; gap: .6rem; align-items: center; padding: .6rem 0; border-bottom: 1px solid var(--bsh-line); }
.bsh-checklist { list-style: none; padding: 0; margin: 0; }
.bsh-checklist li { display: flex; align-items: center; gap: .7rem; padding: .6rem 0; border-bottom: 1px solid var(--bsh-line); }
.bsh-checklist input { width: 20px; height: 20px; accent-color: var(--bsh-primary); }
.bsh-progress-big { height: 14px; border-radius: 999px; background: var(--bsh-line); overflow: hidden; margin: .6rem 0; }
.bsh-progress-big span { display: block; height: 100%; background: linear-gradient(90deg,var(--bsh-primary),var(--bsh-teal)); transition: width .4s; }

/* Disclaimer strip inside tools */
.bsh-tool-note { display: flex; gap: .6rem; align-items: flex-start; font-size: .84rem; color: var(--bsh-muted); background: #fdf7ee; border: 1px solid #f2e2c8; border-radius: var(--r-sm); padding: .8rem 1rem; margin-top: 1.2rem; }
.bsh-tool-note .bsh-ico-sm { color: var(--bsh-warn); flex: none; margin-top: .1rem; }
