/* Mold Scanner AI — Tool Layout
   Shared styles for /tools/* pages.
   Matches the visual system set in /public/index.html. Import :root vars through the per-page style block, these rules apply on top.
*/

:root {
  --ms-bg: #000;
  --ms-bg-soft: #0a0a0a;
  --ms-bg-panel: #111111;
  --ms-bg-card: #141414;
  --ms-border: #1f1f1f;
  --ms-border-strong: #2a2a2a;
  --ms-text: #f5f5f5;
  --ms-text-muted: #9ca3af;
  --ms-text-dim: #6b7280;
  --ms-brand: #FF6B1A;
  --ms-brand-dim: #d9521a;
  --ms-brand-soft: rgba(255,107,26,0.1);
  --ms-ok: #00d166;
  --ms-warn: #f5a623;
  --ms-danger: #ff3b30;
  --ms-radius: 16px;
  --ms-radius-sm: 10px;
  --ms-max: 1120px;
  --ms-shadow-glow: 0 0 80px -10px rgba(255,107,26,0.35);
}

/* Scoped reset — only elements under .ms-container / .ms-nav / .ms-footer are affected */
.ms-container *, .ms-nav *, .ms-footer *, .ms-hub-grid *, .ms-tool-hero *, .ms-tool-surface *, .ms-result *, .ms-capture *, .ms-disclaimer *, .ms-faq * { box-sizing: border-box; }
.ms-container, .ms-nav, .ms-footer, .ms-hub-grid, .ms-tool-hero { margin: 0; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  background: var(--ms-bg);
  color: var(--ms-text);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "ss01", "cv11";
  overflow-x: hidden;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--ms-brand); text-decoration: none; }
a:hover { color: #ff7d33; }

.ms-container { max-width: var(--ms-max); margin: 0 auto; padding: 0 24px; }

/* Nav (shared with homepage) */
.ms-nav { position: sticky; top: 0; z-index: 50; background: rgba(0,0,0,0.75); backdrop-filter: saturate(180%) blur(16px); -webkit-backdrop-filter: saturate(180%) blur(16px); border-bottom: 1px solid var(--ms-border); }
.ms-nav-inner { display: flex; align-items: center; justify-content: space-between; height: 72px; }
.ms-brand { display: flex; align-items: center; gap: 12px; font-weight: 800; font-size: 17px; letter-spacing: -0.3px; color: var(--ms-text); }
.ms-brand img { width: 38px; height: 38px; border-radius: 10px; box-shadow: 0 2px 10px rgba(255,107,26,0.30); }
.ms-brand-word { line-height: 1.05; font-size: 15px; }
.ms-brand-word sup { color: var(--ms-brand); font-size: 10px; }
.ms-nav-links { display: flex; align-items: center; gap: 28px; }
.ms-nav-links a { color: var(--ms-text-muted); font-weight: 600; font-size: 14px; }
.ms-nav-links a:hover, .ms-nav-links a.active { color: var(--ms-text); }
.ms-nav-cta { background: var(--ms-brand); color: #000 !important; padding: 10px 18px; border-radius: 10px; font-weight: 800; font-size: 13px; transition: transform .15s ease, background .15s ease; }
.ms-nav-cta:hover { background: #ff7d33; transform: translateY(-1px); }
@media (max-width: 720px) { .ms-nav-links a:not(.ms-nav-cta) { display: none; } }

/* Tool page hero */
/* Landing-page CRO hero (center-aligned, tool pages are LANDING pages not blog pages — Victor's directive 2026-04-20) */
.ms-tool-hero { padding: 56px 0 36px; border-bottom: 1px solid var(--ms-border); text-align: center; }
.ms-tool-hero > .ms-container { display: flex; flex-direction: column; align-items: center; }
.ms-tool-hero h1 { font-size: clamp(34px, 5.2vw, 56px); line-height: 1.05; letter-spacing: -0.025em; font-weight: 900; max-width: 900px; margin: 0 auto; }
.ms-tool-hero .ms-tool-eyebrow { font-size: 12px; font-weight: 800; letter-spacing: 1.5px; text-transform: uppercase; color: var(--ms-brand); margin-bottom: 14px; display: inline-block; padding: 6px 14px; border: 1px solid rgba(255,107,26,0.35); background: rgba(255,107,26,0.08); border-radius: 999px; }
.ms-tool-hero .ms-tool-sub { color: var(--ms-text-muted); font-size: 18px; margin: 16px auto 0; max-width: 640px; line-height: 1.55; }
.ms-tool-hero .ms-tool-meta { display: flex; gap: 22px; flex-wrap: wrap; margin: 22px auto 0; font-size: 13px; color: var(--ms-text-dim); font-weight: 600; justify-content: center; }
.ms-tool-hero .ms-tool-meta span { display: inline-flex; align-items: center; gap: 6px; }
.ms-tool-hero .ms-tool-meta .dot { width: 6px; height: 6px; border-radius: 999px; background: var(--ms-ok); }
@media (max-width: 640px) { .ms-tool-hero { padding: 36px 0 24px; } .ms-tool-hero .ms-tool-meta { gap: 14px; font-size: 12px; } }

/* Tool card surface */
.ms-tool-surface { background: var(--ms-bg-card); border: 1px solid var(--ms-border); border-radius: var(--ms-radius); padding: 32px; margin: 24px 0; }
.ms-tool-surface.hero-surface { margin-top: 28px; padding: 36px; border: 1px solid var(--ms-border-strong); box-shadow: 0 40px 80px -32px rgba(255,107,26,0.22); }
.ms-tool-surface h2 { font-size: clamp(22px, 2.6vw, 28px); font-weight: 800; margin-bottom: 20px; letter-spacing: -0.015em; text-align: center; line-height: 1.2; }
.ms-tool-surface.hero-surface > h2 + p,
.ms-tool-surface.hero-surface > h2 ~ p:first-of-type { text-align: center; max-width: 640px; margin-left: auto; margin-right: auto; }
.ms-tool-surface p { color: var(--ms-text-muted); }
.ms-tool-surface label { display: block; font-size: 13px; font-weight: 700; color: var(--ms-text); margin-bottom: 8px; letter-spacing: 0.3px; text-transform: uppercase; }
.ms-tool-surface input[type="range"], .ms-tool-surface input[type="number"], .ms-tool-surface input[type="text"], .ms-tool-surface input[type="email"], .ms-tool-surface input[type="date"], .ms-tool-surface input[type="datetime-local"], .ms-tool-surface input[type="tel"], .ms-tool-surface select, .ms-tool-surface textarea {
  width: 100%;
  background: var(--ms-bg-panel);
  border: 1px solid var(--ms-border-strong);
  color: var(--ms-text);
  padding: 14px 16px;
  border-radius: var(--ms-radius-sm);
  font-size: 16px;
  font-family: inherit;
  min-height: 52px;
  -webkit-appearance: none;
          appearance: none;
}
.ms-tool-surface input:focus, .ms-tool-surface select:focus, .ms-tool-surface textarea:focus { outline: 2px solid var(--ms-brand); outline-offset: 2px; }

/* Native date / datetime-local inputs — brand the control so stock MM/DD/YYYY widget blends in */
.ms-tool-surface input[type="date"], .ms-tool-surface input[type="datetime-local"] {
  color-scheme: dark;
  font-weight: 600;
  letter-spacing: 0.3px;
  color: var(--ms-text);
  position: relative;
  line-height: 1.2;
}
.ms-tool-surface input[type="date"]::-webkit-datetime-edit,
.ms-tool-surface input[type="datetime-local"]::-webkit-datetime-edit { color: var(--ms-text); padding: 2px 0; }
.ms-tool-surface input[type="date"]::-webkit-datetime-edit-fields-wrapper,
.ms-tool-surface input[type="datetime-local"]::-webkit-datetime-edit-fields-wrapper { color: var(--ms-text); }
.ms-tool-surface input[type="date"]::-webkit-datetime-edit-text,
.ms-tool-surface input[type="datetime-local"]::-webkit-datetime-edit-text { color: var(--ms-text-dim); padding: 0 4px; }
.ms-tool-surface input[type="date"]::-webkit-datetime-edit-month-field,
.ms-tool-surface input[type="date"]::-webkit-datetime-edit-day-field,
.ms-tool-surface input[type="date"]::-webkit-datetime-edit-year-field,
.ms-tool-surface input[type="datetime-local"]::-webkit-datetime-edit-month-field,
.ms-tool-surface input[type="datetime-local"]::-webkit-datetime-edit-day-field,
.ms-tool-surface input[type="datetime-local"]::-webkit-datetime-edit-year-field,
.ms-tool-surface input[type="datetime-local"]::-webkit-datetime-edit-hour-field,
.ms-tool-surface input[type="datetime-local"]::-webkit-datetime-edit-minute-field,
.ms-tool-surface input[type="datetime-local"]::-webkit-datetime-edit-ampm-field { color: var(--ms-text); padding: 2px 4px; border-radius: 4px; }
.ms-tool-surface input[type="date"]::-webkit-datetime-edit-month-field:focus,
.ms-tool-surface input[type="date"]::-webkit-datetime-edit-day-field:focus,
.ms-tool-surface input[type="date"]::-webkit-datetime-edit-year-field:focus,
.ms-tool-surface input[type="datetime-local"]::-webkit-datetime-edit-month-field:focus,
.ms-tool-surface input[type="datetime-local"]::-webkit-datetime-edit-day-field:focus,
.ms-tool-surface input[type="datetime-local"]::-webkit-datetime-edit-year-field:focus,
.ms-tool-surface input[type="datetime-local"]::-webkit-datetime-edit-hour-field:focus,
.ms-tool-surface input[type="datetime-local"]::-webkit-datetime-edit-minute-field:focus,
.ms-tool-surface input[type="datetime-local"]::-webkit-datetime-edit-ampm-field:focus { background: rgba(255,107,26,0.18); color: var(--ms-brand); outline: none; }
.ms-tool-surface input[type="date"]::-webkit-calendar-picker-indicator,
.ms-tool-surface input[type="datetime-local"]::-webkit-calendar-picker-indicator {
  cursor: pointer;
  opacity: 0.85;
  filter: invert(54%) sepia(89%) saturate(2447%) hue-rotate(346deg) brightness(103%) contrast(101%);
  padding: 4px;
  border-radius: 6px;
  transition: background .15s ease, opacity .15s ease;
}
.ms-tool-surface input[type="date"]::-webkit-calendar-picker-indicator:hover,
.ms-tool-surface input[type="datetime-local"]::-webkit-calendar-picker-indicator:hover { background: rgba(255,107,26,0.15); opacity: 1; }
.ms-tool-surface input[type="date"]::-webkit-inner-spin-button,
.ms-tool-surface input[type="datetime-local"]::-webkit-inner-spin-button { display: none; }
/* Firefox date input — uses its own non-webkit chrome, gets color-scheme + base dark styling above */
.ms-tool-surface .ms-field { margin-bottom: 18px; }
.ms-field-label { display: block; font-size: 13px; font-weight: 700; color: var(--ms-text); margin-bottom: 10px; letter-spacing: 0.3px; text-transform: uppercase; }

/* Segmented chip group (replaces native select dropdowns) */
.ms-chip-group { display: flex; flex-wrap: wrap; gap: 8px; }
.ms-chip {
  appearance: none;
  background: var(--ms-bg-panel);
  border: 1px solid var(--ms-border-strong);
  color: var(--ms-text-muted);
  padding: 14px 20px;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.2px;
  cursor: pointer;
  font-family: inherit;
  min-height: 52px;
  transition: background .15s ease, border-color .15s ease, color .15s ease, transform .12s ease;
}
.ms-chip:hover:not(.active) { border-color: var(--ms-brand); color: var(--ms-text); transform: translateY(-1px); }
.ms-chip:focus-visible { outline: 2px solid var(--ms-brand); outline-offset: 2px; }
.ms-chip.active { background: var(--ms-brand); border-color: var(--ms-brand); color: #000; }
.ms-chip.active:hover { background: #ff7d33; border-color: #ff7d33; color: #000; }

/* Styled select (fallback where chip groups are not appropriate) */
.ms-tool-surface select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--ms-brand) 50%),
    linear-gradient(135deg, var(--ms-brand) 50%, transparent 50%);
  background-position: calc(100% - 20px) 20px, calc(100% - 15px) 20px;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 40px;
  color-scheme: dark;
}
.ms-tool-surface select option { background: var(--ms-bg-panel); color: var(--ms-text); }

/* Range slider polish (Chromium + WebKit + Firefox) */
.ms-tool-surface input[type="range"] { appearance: none; -webkit-appearance: none; background: transparent; padding: 0; border: 0; height: 36px; }
.ms-tool-surface input[type="range"]::-webkit-slider-runnable-track {
  height: 6px;
  background: linear-gradient(90deg, var(--ms-brand) 0%, var(--ms-brand) var(--ms-slider-fill, 50%), var(--ms-border-strong) var(--ms-slider-fill, 50%), var(--ms-border-strong) 100%);
  border-radius: 999px;
}
.ms-tool-surface input[type="range"]::-moz-range-track { height: 6px; background: var(--ms-border-strong); border-radius: 999px; }
.ms-tool-surface input[type="range"]::-moz-range-progress { height: 6px; background: var(--ms-brand); border-radius: 999px; }
.ms-tool-surface input[type="range"]::-webkit-slider-thumb {
  appearance: none; -webkit-appearance: none;
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--ms-brand);
  border: 4px solid #000;
  box-shadow: 0 6px 18px -2px rgba(255,107,26,0.65);
  cursor: grab;
  margin-top: -13px;
  transition: transform .12s ease, box-shadow .12s ease;
}
.ms-tool-surface input[type="range"]::-webkit-slider-thumb:active { cursor: grabbing; transform: scale(1.10); }
.ms-tool-surface input[type="range"]::-moz-range-thumb {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--ms-brand);
  border: 4px solid #000;
  box-shadow: 0 6px 18px -2px rgba(255,107,26,0.65);
  cursor: grab;
}
.ms-tool-surface input[type="range"]:focus-visible { outline: none; }
.ms-tool-surface input[type="range"]:focus-visible::-webkit-slider-thumb { outline: 2px solid var(--ms-text); outline-offset: 3px; }

/* Buttons */
.ms-btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 56px; padding: 14px 28px; border-radius: 12px; font-weight: 800; font-size: 16px; letter-spacing: 0.2px; cursor: pointer; border: 0; transition: transform .15s ease, background .15s ease, box-shadow .15s ease; font-family: inherit; }
.ms-btn-lg { min-height: 64px; padding: 18px 36px; font-size: 18px; letter-spacing: 0.1px; border-radius: 14px; }
.ms-btn-block { display: flex; width: 100%; }
.ms-btn-primary { background: var(--ms-brand); color: #000; }
.ms-btn-primary:hover:not(:disabled) { background: #ff7d33; transform: translateY(-1px); box-shadow: 0 12px 32px -6px rgba(255,107,26,0.50); }
.ms-btn-ghost { background: transparent; color: var(--ms-text); border: 1px solid var(--ms-border-strong); }
.ms-btn-ghost:hover:not(:disabled) { border-color: var(--ms-brand); color: var(--ms-brand); }
.ms-btn:disabled { opacity: 0.55; cursor: not-allowed; }

/* Result card */
.ms-result { background: linear-gradient(180deg, rgba(255,107,26,0.07), transparent), var(--ms-bg-card); border: 1px solid var(--ms-border-strong); border-radius: var(--ms-radius); padding: 32px; margin-top: 24px; text-align: center; }
.ms-result .ms-pdf-row { justify-content: center; }
.ms-result-badge { display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px; border-radius: 999px; font-size: 11px; font-weight: 800; letter-spacing: 1.2px; text-transform: uppercase; }
.ms-result-badge.ok { background: rgba(0,209,102,0.14); color: var(--ms-ok); }
.ms-result-badge.warn { background: rgba(245,166,35,0.14); color: var(--ms-warn); }
.ms-result-badge.danger { background: rgba(255,59,48,0.14); color: var(--ms-danger); }
.ms-result-score { font-size: 88px; font-weight: 900; letter-spacing: -0.04em; line-height: 1; margin: 16px 0 6px; background: linear-gradient(180deg, #fff 0%, #9ca3af 120%); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.ms-result-label { color: var(--ms-text-muted); font-size: 15px; }
.ms-result-detail { margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--ms-border); font-size: 15px; line-height: 1.65; }
.ms-result-detail strong { color: var(--ms-text); }

/* Email capture card (inline, never modal) */
.ms-capture { background: var(--ms-bg-panel); border: 1px solid var(--ms-border); border-radius: var(--ms-radius); padding: 28px 24px; margin: 24px 0; text-align: center; }
.ms-capture h3 { font-size: clamp(20px, 2.4vw, 24px); font-weight: 800; margin-bottom: 8px; line-height: 1.3; }
.ms-capture p { color: var(--ms-text-muted); font-size: 15px; margin: 0 auto 18px; max-width: 520px; }
.ms-capture-form { display: flex; gap: 12px; max-width: 560px; margin: 0 auto; flex-wrap: wrap; }
.ms-capture-form input[type="email"] { flex: 1 1 280px; min-width: 0; min-height: 60px; padding: 16px 20px; border-radius: 12px; border: 1px solid var(--ms-border-strong); background: var(--ms-bg-card); color: var(--ms-text); font-size: 17px; font-family: inherit; text-align: left; }
.ms-capture-form input[type="email"]:focus { outline: 2px solid var(--ms-brand); outline-offset: 2px; }
.ms-capture-form input[type="email"]::placeholder { color: var(--ms-text-dim); }
.ms-capture-form button { flex: 0 0 auto; min-height: 60px; padding: 16px 28px; font-size: 17px; border-radius: 12px; }
.ms-capture-trust { margin-top: 12px; color: var(--ms-text-dim); font-size: 12px; }
@media (max-width: 640px) {
  .ms-capture { padding: 24px 18px; }
  .ms-capture-form { flex-direction: column; gap: 10px; }
  .ms-capture-form input[type="email"] { flex-basis: auto; width: 100%; min-height: 64px; font-size: 17px; }
  .ms-capture-form button { width: 100%; min-height: 64px; }
}
.ms-capture-success { color: var(--ms-ok); font-weight: 700; padding: 12px 16px; background: rgba(0,209,102,0.10); border-radius: var(--ms-radius-sm); }
.ms-capture-warn { color: #ff9f40; font-weight: 700; padding: 12px 16px; background: rgba(255,159,64,0.10); border: 1px solid rgba(255,159,64,0.25); border-radius: var(--ms-radius-sm); margin-top: 10px; }
.ms-capture-error { color: var(--ms-danger); font-weight: 700; padding: 12px 16px; background: rgba(255,59,48,0.10); border-radius: var(--ms-radius-sm); margin-top: 10px; }
@media (max-width: 540px) { .ms-capture-form { flex-direction: column; } .ms-capture-form button { width: 100%; } }

/* Disclaimer banner (mandatory for health/legal tools) */
.ms-disclaimer { background: rgba(245,166,35,0.08); border: 1px solid rgba(245,166,35,0.28); border-radius: var(--ms-radius-sm); padding: 14px 18px; font-size: 13px; color: #f5dfb3; margin: 20px 0; line-height: 1.55; }
.ms-disclaimer strong { color: var(--ms-warn); }

/* PDF download button row */
.ms-pdf-row { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 20px; }

/* FAQ (uses .ms-container for centering, .ms-faq is a modifier only) */
.ms-faq { margin-top: 40px; margin-bottom: 40px; }
.ms-faq h2 { font-size: 28px; font-weight: 900; margin-bottom: 20px; letter-spacing: -0.02em; }
.ms-faq details { background: var(--ms-bg-card); border: 1px solid var(--ms-border); border-radius: var(--ms-radius-sm); padding: 18px 22px; margin-bottom: 10px; cursor: pointer; }
.ms-faq summary { font-weight: 700; font-size: 16px; list-style: none; outline: none; }
.ms-faq summary::-webkit-details-marker { display: none; }
.ms-faq summary::after { content: "+"; float: right; color: var(--ms-brand); font-size: 24px; font-weight: 700; transition: transform .2s ease; }
.ms-faq details[open] summary::after { transform: rotate(45deg); }
.ms-faq details p { color: var(--ms-text-muted); margin-top: 12px; font-size: 15px; }

/* Tool hub grid */
.ms-hub-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 20px; margin: 32px 0; }
.ms-hub-card {
  background: var(--ms-bg-card);
  border: 1px solid var(--ms-border);
  border-radius: var(--ms-radius);
  text-decoration: none;
  color: var(--ms-text);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}
.ms-hub-card:hover { transform: translateY(-4px); border-color: var(--ms-brand); box-shadow: 0 24px 48px -20px rgba(255,107,26,0.45); color: var(--ms-text); }
.ms-hub-card.soon { opacity: 0.72; cursor: not-allowed; pointer-events: none; }
.ms-hub-card .ms-hub-thumb { width: 100%; aspect-ratio: 16/9; overflow: hidden; position: relative; background: var(--ms-bg-soft); }
.ms-hub-card .ms-hub-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .5s ease; }
.ms-hub-card:hover .ms-hub-thumb img { transform: scale(1.06); }
.ms-hub-card .ms-hub-thumb::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,0) 55%, rgba(0,0,0,0.55) 100%); pointer-events: none; }
.ms-hub-card .ms-hub-pill {
  position: absolute; top: 12px; left: 12px; z-index: 2;
  font-size: 10px; font-weight: 800; letter-spacing: 1px; text-transform: uppercase;
  padding: 4px 10px; border-radius: 999px;
  background: var(--ms-brand); color: #000;
  box-shadow: 0 4px 14px -2px rgba(255,107,26,0.55);
}
.ms-hub-card.soon .ms-hub-pill { background: rgba(20,20,20,0.92); color: var(--ms-text-muted); box-shadow: none; border: 1px solid var(--ms-border-strong); }
.ms-hub-card .ms-hub-body { padding: 18px 22px 22px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.ms-hub-card h3 { font-size: 19px; font-weight: 800; line-height: 1.3; letter-spacing: -0.01em; }
.ms-hub-card p { color: var(--ms-text-muted); font-size: 14px; line-height: 1.55; }
.ms-hub-card .ms-hub-cta { margin-top: auto; color: var(--ms-brand); font-size: 13px; font-weight: 800; letter-spacing: 0.3px; padding-top: 4px; }

/* Internal link block (legacy text-only — kept for backward compatibility) */
.ms-related { margin: 40px 0; padding-top: 28px; border-top: 1px solid var(--ms-border); }
.ms-related h3 { font-size: 12px; font-weight: 800; letter-spacing: 1.5px; text-transform: uppercase; color: var(--ms-text-dim); margin-bottom: 16px; }
.ms-related-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.ms-related-grid a { display: block; padding: 12px 14px; background: var(--ms-bg-panel); border: 1px solid var(--ms-border); border-radius: var(--ms-radius-sm); font-size: 14px; font-weight: 600; color: var(--ms-text); transition: border-color .15s ease, color .15s ease; }
.ms-related-grid a:hover { border-color: var(--ms-brand); color: var(--ms-brand); }

/* Visual thumbnail grid (enterprise pattern for Related Reading) */
.ms-thumb-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; margin-top: 20px; }
.ms-thumb-card {
  background: var(--ms-bg-card);
  border: 1px solid var(--ms-border);
  border-radius: var(--ms-radius);
  text-decoration: none;
  color: var(--ms-text);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}
.ms-thumb-card:hover { transform: translateY(-4px); border-color: var(--ms-brand); box-shadow: 0 18px 40px -20px rgba(255,107,26,0.40); color: var(--ms-text); }
.ms-thumb-card .ms-thumb-img {
  width: 100%;
  aspect-ratio: 16/9;
  overflow: hidden;
  position: relative;
  background: var(--ms-bg-soft);
}
.ms-thumb-card .ms-thumb-img img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .4s ease; }
.ms-thumb-card:hover .ms-thumb-img img { transform: scale(1.04); }
.ms-thumb-card .ms-thumb-body { padding: 14px 16px 18px; }
.ms-thumb-card h4 { font-size: 15px; font-weight: 800; line-height: 1.3; letter-spacing: -0.01em; margin-bottom: 4px; }
.ms-thumb-card p { color: var(--ms-text-muted); font-size: 13px; line-height: 1.5; }

/* DEPRECATED v1.5.2: above-fold hero image is gone — tool pages put the TOOL above the fold, not a blog-post image. The class is kept for legacy pages until they migrate. */
.ms-tool-hero-image { display: none; }
.ms-tool-hero-image img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ms-tool-hero-image::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0) 40%, rgba(0,0,0,0.55) 100%);
  pointer-events: none;
}

/* Demo reel hidden on tool pages per v1.5.2 CRO pass (noise without conversion value). Kept in stylesheet for short-form video capture if needed. */
.ms-demo-reel { display: none; }

/* ============ TikTok-friendly additions (v1.5.3) ============ */

/* Dramatic threshold pop animation on the result card when crossing into danger */
@keyframes dangerPulse {
  0%   { box-shadow: 0 0 0 0 rgba(255,59,48,0.0), inset 0 0 0 1px rgba(255,59,48,0.3); transform: scale(1); }
  30%  { box-shadow: 0 0 0 24px rgba(255,59,48,0.0), inset 0 0 0 2px rgba(255,59,48,0.85); transform: scale(1.01); }
  60%  { box-shadow: 0 0 0 40px rgba(255,59,48,0.0), inset 0 0 0 1px rgba(255,59,48,0.35); transform: scale(1); }
  100% { box-shadow: 0 0 0 0 rgba(255,59,48,0.0), inset 0 0 0 1px rgba(255,59,48,0.0); transform: scale(1); }
}
.ms-result.pop-danger { animation: dangerPulse 0.9s ease-out 1; }
.ms-result.pop-warn   { animation: dangerPulse 0.7s ease-out 1; animation-name: warnPulse; }
@keyframes warnPulse {
  0%   { box-shadow: inset 0 0 0 1px rgba(245,166,35,0); transform: scale(1); }
  40%  { box-shadow: inset 0 0 0 2px rgba(245,166,35,0.8); transform: scale(1.006); }
  100% { box-shadow: inset 0 0 0 1px rgba(245,166,35,0); transform: scale(1); }
}

/* Share button */
.ms-share-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 56px; padding: 14px 24px;
  border-radius: 999px; border: 1px solid var(--ms-border-strong);
  background: transparent; color: var(--ms-text);
  font-weight: 700; font-size: 15px; font-family: inherit; cursor: pointer;
  transition: border-color .15s ease, color .15s ease, background .15s ease;
}
.ms-share-btn:hover { border-color: var(--ms-brand); color: var(--ms-brand); background: rgba(255,107,26,0.05); }
.ms-share-btn svg { width: 18px; height: 18px; }

/* Copied toast */
.ms-share-toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: var(--ms-ok); color: #000;
  padding: 12px 20px; border-radius: 999px;
  font-weight: 800; font-size: 14px;
  box-shadow: 0 8px 24px -4px rgba(0,209,102,0.45);
  z-index: 60;
  opacity: 0;
  transition: opacity .2s ease, transform .2s ease;
  pointer-events: none;
}
.ms-share-toast.show { opacity: 1; transform: translateX(-50%) translateY(-4px); }
/* Original demo-reel styles kept below for future use: */
.ms-demo-reel { background: var(--ms-bg-card); border: 1px solid var(--ms-border); border-radius: var(--ms-radius); padding: 24px; margin: 32px 0; position: relative; overflow: hidden; }
.ms-demo-reel::before {
  content: "";
  position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, transparent, var(--ms-brand), transparent);
  animation: demoSweep 3.5s ease-in-out infinite;
}
@keyframes demoSweep {
  0% { transform: translateX(-100%); opacity: 0; }
  15% { opacity: 1; }
  85% { opacity: 1; }
  100% { transform: translateX(100%); opacity: 0; }
}
.ms-demo-eyebrow { font-size: 11px; font-weight: 800; letter-spacing: 1.4px; text-transform: uppercase; color: var(--ms-brand); margin-bottom: 10px; }
.ms-demo-reel h3 { font-size: 20px; font-weight: 800; margin-bottom: 6px; }
.ms-demo-reel .ms-demo-sub { color: var(--ms-text-muted); font-size: 14px; margin-bottom: 18px; }
.ms-demo-track {
  position: relative;
  height: 10px;
  background: var(--ms-border-strong);
  border-radius: 999px;
  overflow: hidden;
}
.ms-demo-fill {
  position: absolute; top: 0; bottom: 0; left: 0;
  background: linear-gradient(90deg, #00d166 0%, #f5a623 50%, #ff3b30 100%);
  border-radius: 999px;
  animation: demoFill 6s ease-in-out infinite;
}
@keyframes demoFill {
  0%, 100% { width: 22%; }
  40%, 60% { width: 78%; }
}
.ms-demo-readout {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-top: 14px;
  font-size: 13px;
  font-weight: 700;
  color: var(--ms-text-muted);
}
.ms-demo-readout .ms-demo-score {
  font-size: 36px;
  font-weight: 900;
  color: var(--ms-text);
  letter-spacing: -0.02em;
  min-width: 90px;
  text-align: right;
}
.ms-demo-readout .ms-demo-score::after {
  content: "/100";
  font-size: 14px;
  color: var(--ms-text-dim);
  font-weight: 700;
  margin-left: 4px;
}

/* Footer */
.ms-footer { border-top: 1px solid var(--ms-border); margin-top: 80px; padding: 48px 0 32px; color: var(--ms-text-muted); font-size: 14px; }
.ms-footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 36px; margin-bottom: 32px; }
.ms-footer-links h4 { font-size: 12px; font-weight: 800; letter-spacing: 1.5px; text-transform: uppercase; margin-bottom: 12px; color: var(--ms-text); }
.ms-footer-links a { display: block; padding: 4px 0; color: var(--ms-text-muted); font-size: 14px; }
.ms-footer-links a:hover { color: var(--ms-brand); }
.ms-footer-bottom { padding-top: 20px; border-top: 1px solid var(--ms-border); display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; font-size: 12px; color: var(--ms-text-dim); }
@media (max-width: 720px) { .ms-footer-grid { grid-template-columns: 1fr 1fr; } }

/* Sub-480px polish: single-column footer, tighter nav, smaller score, safer hero scaling, wider tap targets */
@media (max-width: 480px) {
  .ms-container { padding: 0 18px; }
  .ms-nav-inner { height: 64px; }
  .ms-brand img { width: 34px; height: 34px; }
  .ms-brand-word { font-size: 13px; }
  .ms-nav-cta { padding: 9px 14px; font-size: 12px; }
  .ms-tool-hero { padding: 28px 0 20px; }
  .ms-tool-hero h1 { font-size: clamp(26px, 8vw, 34px); }
  .ms-tool-hero .ms-tool-sub { font-size: 15px; line-height: 1.5; }
  .ms-tool-hero .ms-tool-meta { gap: 10px; font-size: 11px; }
  .ms-tool-surface { padding: 20px 16px; }
  .ms-result-score { font-size: 62px; }
  .ms-share-btn { min-height: 48px; padding: 12px 18px; font-size: 14px; width: 100%; }
  .ms-btn { min-height: 52px; padding: 12px 20px; font-size: 15px; }
  .ms-btn-lg { min-height: 56px; padding: 14px 22px; font-size: 16px; }
  .ms-footer { margin-top: 48px; padding: 32px 0 24px; }
  .ms-footer-grid { grid-template-columns: 1fr; gap: 22px; margin-bottom: 24px; }
  .ms-footer-bottom { flex-direction: column; text-align: left; gap: 8px; }
  .ms-thumb-grid { grid-template-columns: 1fr; }
}

/* Sub-360px guard (iPhone SE 1st-gen and narrower): further compact nav */
@media (max-width: 360px) {
  .ms-container { padding: 0 14px; }
  .ms-brand-word { font-size: 12px; line-height: 1.0; }
  .ms-nav-cta { padding: 8px 12px; font-size: 11px; border-radius: 8px; }
  .ms-tool-hero h1 { font-size: clamp(24px, 8.8vw, 30px); }
  .ms-result-score { font-size: 54px; }
}
