/* Free tools — loaded after /style.css on every /tools page.
   Same six colours, nothing new: surfaces are the guide cards' #111a18 and
   #303b37, accents are --calm and --signal. Every control is at least 44px
   tall, and text fields are 17px so iOS Safari does not zoom on focus. */

[hidden] { display: none !important; }

/* Tools sit inside .prose; undo its list indents and paragraph colour where they get in the way. */
.prose .opts, .prose .cards, .prose .tool-links { padding-left: 0; }
.prose .opts li, .prose .cards li, .prose .tool-links li { margin: 0; }
.prose .tool__q { color: var(--bone); margin: 0 0 16px; }
.prose .tool__label { margin: 0 0 10px; }
.prose .result h3 { margin-top: 26px; }

.tool {
  margin: 8px 0 40px;
  padding: clamp(18px, 4vw, 28px);
  border: 1px solid #303b37;
  border-radius: 24px;
  background: #111a18;
}
.tool[aria-busy="true"] { opacity: 0.7; }

.tool__label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--dim);
  margin: 0 0 10px;
}
.tool__q {
  font-size: clamp(19px, 2.6vw, 22px);
  font-weight: 700;
  line-height: 1.3;
  color: var(--bone);
  margin: 0 0 16px;
  text-wrap: balance;
}
.tool__group { border: 0; padding: 0; margin: 0 0 22px; min-width: 0; }
.tool__group:last-of-type { margin-bottom: 18px; }
.tool__group legend { padding: 0; }

.tool__progress {
  height: 4px;
  border-radius: 4px;
  background: rgba(242, 240, 235, 0.1);
  margin: 0 0 20px;
  overflow: hidden;
}
.tool__progress span {
  display: block;
  height: 100%;
  width: 0;
  background: var(--calm);
  transition: width 0.25s ease;
}

/* Answer buttons: one tap, full width, text left. */
.opts { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.opt {
  width: 100%;
  min-height: 54px;
  padding: 13px 16px;
  text-align: left;
  font: inherit;
  font-size: 16.5px;
  line-height: 1.35;
  color: var(--bone);
  background: rgba(242, 240, 235, 0.04);
  border: 1px solid #303b37;
  border-radius: 16px;
  cursor: pointer;
  transition: border-color 0.12s ease, background 0.12s ease;
}
.opt:hover { border-color: var(--calm); }
.opt[aria-pressed="true"] { border-color: var(--calm); background: rgba(155, 232, 216, 0.12); }

/* Chips: small choices, one or several. */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  min-height: 44px;
  padding: 10px 16px;
  font: inherit;
  font-size: 15.5px;
  color: var(--bone);
  background: rgba(242, 240, 235, 0.04);
  border: 1px solid #303b37;
  border-radius: 999px;
  cursor: pointer;
}
.chip:hover { border-color: var(--calm); }
.chip[aria-pressed="true"] { background: var(--calm); border-color: var(--calm); color: var(--ink); font-weight: 600; }

.field { display: block; margin: 0 0 18px; }
.field > span { display: block; font-size: 15px; font-weight: 600; color: var(--bone); margin-bottom: 8px; }
.field input, .field select, .field textarea {
  width: 100%;
  min-height: 52px;
  padding: 12px 14px;
  font: inherit;
  font-size: 17px;
  color: var(--bone);
  background: #0b0f0e;
  border: 1px solid #303b37;
  border-radius: 14px;
}
.field textarea { min-height: 96px; resize: vertical; line-height: 1.45; }
.field input:focus, .field select:focus, .field textarea:focus { outline: 2px solid var(--calm); outline-offset: 1px; border-color: var(--calm); }
.field small { display: block; margin-top: 6px; font-size: 13px; color: var(--dim); }
.field--inline { display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: center; }
.field--inline input { width: 96px; text-align: center; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 52px;
  padding: 0 26px;
  font: inherit;
  font-size: 16.5px;
  font-weight: 700;
  color: var(--ink);
  background: var(--calm);
  border: 1px solid var(--calm);
  border-radius: 999px;
  cursor: pointer;
  text-decoration: none !important;
}
.btn:hover { filter: brightness(1.06); }
.btn--ghost { color: var(--bone); background: transparent; border-color: #303b37; font-weight: 600; }
.btn--ghost:hover { border-color: var(--calm); filter: none; }
.btn--small { min-height: 44px; padding: 0 16px; font-size: 15px; }
.btn[disabled] { opacity: 0.5; cursor: default; }
.btn--block { width: 100%; }

.tool__row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.tool__or { display: flex; align-items: center; gap: 12px; margin: 22px 0 16px; color: var(--dim); font-size: 14px; }
.tool__or::before, .tool__or::after { content: ""; flex: 1; height: 1px; background: #303b37; }

.status { min-height: 1.4em; margin: 10px 0 0; font-size: 14px; color: var(--dim); }

/* Results */
/* html already has scroll-padding-top for the sticky header; this only adds a little air. */
.result { margin-top: 26px; scroll-margin-top: 12px; }
.result:focus { outline: none; }
.result > h2, .result__title {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(24px, 4vw, 32px);
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin: 0 0 12px;
  color: var(--bone);
}
.result__big {
  display: block;
  font-family: var(--display);
  font-size: clamp(44px, 11vw, 72px);
  line-height: 1;
  letter-spacing: -0.03em;
  color: var(--calm);
  margin: 4px 0 12px;
}
.result p { color: var(--dim); margin: 0 0 14px; }
.result strong { color: var(--bone); }
@media (prefers-reduced-motion: no-preference) {
  .result:not([hidden]) { animation: tool-in 0.28s ease both; }
  @keyframes tool-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
}

.cards { display: grid; gap: 12px; margin: 16px 0; padding: 0; list-style: none; }
.card {
  padding: 16px 18px;
  border: 1px solid #303b37;
  border-radius: 18px;
  background: rgba(242, 240, 235, 0.03);
}
.card h3, .card__title { display: block; margin: 0 0 6px; font-size: 17px; font-weight: 700; line-height: 1.35; color: var(--bone); font-family: var(--text); letter-spacing: 0; }
.card p { margin: 0 0 8px; font-size: 15.5px; line-height: 1.5; color: var(--dim); }
.card p:last-child { margin-bottom: 0; }
.card a { font-weight: 600; }
.card .mission__grade { margin-bottom: 8px; }
.card__safety { font-size: 13.5px !important; color: var(--dim); border-left: 2px solid rgba(255, 159, 28, 0.5); padding-left: 10px; }
.card__meta { font-size: 13px !important; color: var(--dim); }

.bars { display: grid; gap: 10px; margin: 16px 0 20px; }
.bar { display: grid; grid-template-columns: 92px 1fr 34px; gap: 10px; align-items: center; font-size: 14.5px; color: var(--bone); }
.bar__track { height: 10px; border-radius: 10px; background: rgba(242, 240, 235, 0.08); overflow: hidden; }
.bar__fill { display: block; height: 100%; border-radius: 10px; background: var(--calm); }
.bar__val { text-align: right; color: var(--dim); font-variant-numeric: tabular-nums; }

.tool-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0 0; }

/* Result hero: what you got, in one glance, with Share right under it. */
.result-hero {
  position: relative;
  padding: clamp(18px, 4.5vw, 28px);
  border: 1px solid rgba(155, 232, 216, 0.28);
  border-radius: 22px;
  background:
    radial-gradient(120% 90% at 100% 0%, rgba(155, 232, 216, 0.14), transparent 60%),
    radial-gradient(90% 80% at 0% 100%, rgba(255, 159, 28, 0.08), transparent 60%),
    #0b100f;
}
.prose .result-hero__eyebrow, .result-hero__eyebrow {
  margin: 0 0 10px;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--calm);
}
.prose .result-hero__title, .result-hero__title {
  margin: 0;
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(34px, 10vw, 60px);
  line-height: 1.02;
  letter-spacing: -0.03em;
  color: var(--bone);
  text-wrap: balance;
  overflow-wrap: anywhere;
}
.prose .result-hero__lead, .result-hero__lead { margin: 12px 0 0; font-size: 16.5px; line-height: 1.5; color: rgba(242, 240, 235, 0.82); }
.result-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0 0; }
.result-actions .btn { flex: 1 1 auto; }
.result-hero .result-status { margin: 10px 0 0; min-height: 0; }
.result-hero .result-status:empty { margin: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.result-details { margin-top: 30px; }
.prose .result-details > h3:first-child { margin-top: 0; }
.result-details details { margin: 18px 0 0; border-top: 1px solid #303b37; padding-top: 14px; }
.result-details summary { cursor: pointer; font-weight: 600; color: var(--bone); min-height: 44px; display: flex; align-items: center; }

/* The one call to action, directly under the result. */
.tool-cta {
  margin: 14px 0 0;
  padding: 18px;
  border: 1px solid rgba(155, 232, 216, 0.5);
  border-radius: 22px;
  background: linear-gradient(160deg, rgba(155, 232, 216, 0.16), rgba(155, 232, 216, 0.03) 70%);
  box-shadow: 0 10px 40px -18px rgba(155, 232, 216, 0.45);
}
.tool-cta__head { display: flex; gap: 14px; align-items: center; }
.tool-cta__icon { flex: none; width: 52px; height: 52px; border-radius: 14px; background: #000; box-shadow: 0 0 0 1px #303b37; }
.prose .tool-cta__eyebrow, .tool-cta__eyebrow { margin: 0 0 3px; font-size: 11.5px; font-weight: 700; letter-spacing: 0.09em; text-transform: uppercase; color: var(--calm); }
.prose .tool-cta__title, .tool-cta__title { margin: 0; font-family: var(--text); font-weight: 700; font-size: 18px; line-height: 1.3; letter-spacing: 0; color: var(--bone); }
.prose .tool-cta__text, .tool-cta__text { margin: 12px 0 14px; font-size: 15px; line-height: 1.5; color: var(--dim); }
.tool-cta__foot { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; }
.tool-cta__badge { display: inline-block; line-height: 0; border-radius: 10px; transition: transform 0.12s ease; }
.tool-cta__badge:hover { transform: translateY(-1px); }
.tool-cta__badge img { width: 156px; height: auto; }
.tool-cta small { font-size: 12px; color: var(--dim); flex: 1 1 160px; }

/* Share sheet: preview of the image, then share / save / copy. */
.share-sheet {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: rgba(5, 5, 6, 0.72);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}
.share-sheet__panel {
  width: 100%;
  max-width: 460px;
  max-height: 94vh;
  overflow-y: auto;
  padding: 16px 16px max(16px, env(safe-area-inset-bottom));
  border: 1px solid #303b37;
  border-bottom: 0;
  border-radius: 24px 24px 0 0;
  background: #111a18;
}
@media (min-width: 640px) {
  .share-sheet { align-items: center; }
  .share-sheet__panel { border-bottom: 1px solid #303b37; border-radius: 24px; }
}
.share-sheet__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.share-sheet__title { margin: 0; font-weight: 700; color: var(--bone); }
.share-sheet__close { width: 44px; height: 44px; font-size: 26px; line-height: 1; color: var(--bone); background: transparent; border: 1px solid #303b37; border-radius: 999px; cursor: pointer; }
.share-sheet__preview { width: min(100%, calc(56vh * 0.8)); aspect-ratio: 1080 / 1350; margin: 0 auto 14px; border-radius: 16px; overflow: hidden; background: #050506; border: 1px solid #303b37; }
.share-sheet__preview[aria-busy="true"] { background: linear-gradient(100deg, #0b100f 30%, #16211f 50%, #0b100f 70%) 0 0 / 200% 100%; animation: sheet-wait 1.1s linear infinite; }
@keyframes sheet-wait { to { background-position: -200% 0; } }
.share-sheet__preview img { display: block; width: 100%; height: 100%; object-fit: contain; }
.share-sheet__preview img:not([src]) { visibility: hidden; }
.share-sheet__actions { display: grid; gap: 10px; }
.share-sheet__row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.share-sheet__row .btn { width: 100%; }
html.sheet-open { overflow: hidden; }

/* Week / calendar grids */
.week { display: grid; gap: 10px; margin: 16px 0; }
.week__day { padding: 14px 16px; border: 1px solid #303b37; border-radius: 16px; background: rgba(242, 240, 235, 0.03); }
.week__day b { display: block; color: var(--bone); margin-bottom: 4px; }
.week__day span { display: block; color: var(--dim); font-size: 15px; line-height: 1.45; }

.tool-note { font-size: 13px; color: var(--dim); margin: 12px 0 0; }

/* Related tools list on every tool page */
.tool-links { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 18px 0 8px; padding: 0; list-style: none; }
.tool-links a { display: block; height: 100%; padding: 16px 18px; border: 1px solid #303b37; border-radius: 18px; background: #111a18; color: var(--bone); font-weight: 600; text-decoration: none !important; }
.tool-links a:hover { border-color: var(--calm); }
.tool-links small { display: block; margin-top: 4px; font-weight: 400; color: var(--dim); font-size: 14px; }
@media (max-width: 600px) { .tool-links { grid-template-columns: 1fr; } }

