/* ==========================================================================
   On Call Notary — contextual SMS scope helper
   "What do you need help with?" panel on detention routes.
   Uses the site.css tokens only; no new colors, no gradients.
   ========================================================================== */

.sms-scope-section { margin: 0 0 2.4rem; scroll-margin-top: 110px; }

.scope-assist {
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-sm); padding: clamp(1.4rem, 3vw, 2rem);
  min-width: 0;
}
.scope-head { max-width: 62ch; margin-bottom: 1.3rem; }
.scope-head h2 { font-size: clamp(1.35rem, 2.4vw, 1.7rem); margin-bottom: .4rem; }
.scope-head p { color: var(--slate); font-size: .98rem; margin: 0; }

/* Known facility (facility pages): shown as a fixed fact, never re-asked */
.scope-context {
  display: flex; align-items: flex-start; gap: .55rem; margin: 0 0 1.1rem;
  padding: .7rem .95rem; background: var(--paper); border: 1px solid var(--line);
  border-radius: var(--radius-sm); font-size: .95rem; color: var(--slate);
}
.scope-context svg { width: 18px; height: 18px; flex: none; color: var(--gold-600); margin-top: .18rem; }
.scope-context strong { color: var(--navy-900); }

/* Form is enhancement-only: hidden until JS is ready, so no-JS visitors see
   the static text/call actions and the <noscript> note instead. */
.scope-form { display: none; }
.scope-assist.is-ready .scope-form { display: grid; gap: 1.1rem 2.2rem; }
.scope-assist.is-ready .scope-form > .scope-col { display: flex; flex-direction: column; gap: 1.1rem; min-width: 0; }
@media (min-width: 900px) {
  .scope-assist.is-ready .scope-form { grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); align-items: start; }
}

.scope-field { display: flex; flex-direction: column; gap: .4rem; min-width: 0; }
.scope-field > label, .scope-readiness legend {
  font-weight: 700; font-size: .95rem; color: var(--navy-900);
}
.scope-field .opt { font-weight: 500; color: var(--slate); }
.scope-hint { font-size: .85rem; color: var(--slate); margin: 0; }

.scope-form select, .scope-form input[type="text"], .scope-form textarea {
  width: 100%; min-height: 48px; padding: .7rem .9rem; margin: 0;
  font: inherit; font-size: 1rem; line-height: 1.4; color: var(--ink);
  background: var(--white); border: 1.5px solid #C7D2E0; border-radius: var(--radius-sm);
  -webkit-appearance: none; appearance: none;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.scope-form select {
  padding-right: 2.6rem; cursor: pointer;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' fill='none' stroke='%230A2240' stroke-width='2'%3E%3Cpath d='M2 4l4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right .95rem center; background-size: 12px;
}
.scope-form textarea { min-height: 128px; resize: vertical; }
.scope-form select:hover, .scope-form input[type="text"]:hover, .scope-form textarea:hover { border-color: var(--navy-600); }
.scope-form select:focus-visible, .scope-form input[type="text"]:focus-visible, .scope-form textarea:focus-visible {
  outline: 3px solid var(--gold-500); outline-offset: 2px; border-color: var(--navy-700);
}

/* Readiness: three-way segmented radio group, thumb-sized, no default */
.scope-readiness { border: 0; padding: 0; margin: 0; min-width: 0; }
.scope-readiness legend { padding: 0; margin-bottom: .45rem; }
.scope-seg { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .5rem; }
.scope-seg input { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.scope-seg label {
  display: flex; align-items: center; justify-content: center; text-align: center;
  min-height: 48px; padding: .55rem .6rem; cursor: pointer;
  border: 1.5px solid #C7D2E0; border-radius: var(--radius-sm);
  font-weight: 600; font-size: .93rem; line-height: 1.25; color: var(--navy-900); background: var(--white);
  transition: background .15s ease, border-color .15s ease, color .15s ease;
}
.scope-seg label:hover { border-color: var(--navy-600); background: var(--paper); }
.scope-seg input:checked + label { background: var(--navy-900); border-color: var(--navy-900); color: var(--white); }
.scope-seg input:focus-visible + label { outline: 3px solid var(--gold-500); outline-offset: 2px; }
@media (max-width: 360px) { .scope-seg { grid-template-columns: 1fr; } }

/* Issue-specific scope guidance, revealed after an issue is chosen */
.scope-guide {
  background: var(--paper); border: 1px solid var(--line); border-left: 4px solid var(--navy-700);
  border-radius: var(--radius-sm); padding: .95rem 1.1rem; font-size: .93rem; color: var(--ink);
  animation: scope-fade .28s ease-out both;
}
.scope-guide[hidden] { display: none; }
.scope-guide .eyebrow { margin-bottom: .2rem; font-size: .7rem; }
.scope-guide p { margin: 0 0 .75rem; color: var(--slate); }
.scope-guide p:last-child { margin-bottom: 0; }
@keyframes scope-fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* Message preview + actions */
.scope-preview-head { display: flex; justify-content: space-between; align-items: baseline; gap: .8rem; flex-wrap: wrap; }
.scope-reset {
  background: none; border: 0; padding: .2rem 0; cursor: pointer; font: inherit;
  font-size: .86rem; font-weight: 700; color: var(--navy-700); text-decoration: underline; text-underline-offset: 2px;
}
.scope-reset:hover { color: var(--navy-600); }
.scope-reset[hidden] { display: none; }

.scope-actions { display: flex; flex-wrap: wrap; gap: .7rem; align-items: center; margin-top: .2rem; }
.scope-actions .btn { min-height: 48px; }
.scope-actions .btn svg { width: 1.05em; height: 1.05em; }
@media (max-width: 480px) { .scope-actions .btn { flex: 1 1 100%; } }
.scope-status { font-size: .88rem; font-weight: 600; color: var(--green); flex-basis: 100%; min-height: 1.3em; margin: 0; }
.scope-fallback { font-size: .9rem; color: var(--slate); margin: .8rem 0 0; }
.scope-fallback a { font-weight: 700; color: var(--navy-800); white-space: nowrap; }
.scope-assist noscript p { margin: 0 0 1rem; font-size: .95rem; color: var(--slate); }

/* Reduced motion: no reveal animation or hover transitions */
@media (prefers-reduced-motion: reduce) {
  .scope-guide { animation: none; }
  .scope-form select, .scope-form input[type="text"], .scope-form textarea, .scope-seg label { transition: none; }
}
