/* Insurance network library - extends /styles.css + /illness/illness.css */

.ins-hero h1 { max-width: 16ch; }
.ins-lead { font-size: clamp(17px, 2vw, 20px); color: var(--ink-2); margin-top: 14px; max-width: 58ch; font-weight: 450; }

.ins-check {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px 22px 20px;
  margin: 28px 0 8px;
}
.ins-check h2 { font-size: 22px; margin: 0 0 6px; }
.ins-check-sub { color: var(--ink-2); font-size: 15px; margin: 0 0 16px; max-width: 62ch; }
.ins-grid {
  display: grid;
  /* minmax(0,1fr): long <option> labels must not widen the track past the card */
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 12px;
}
.ins-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.ins-field select { width: 100%; min-width: 0; }
.ins-field.span-2 { grid-column: 1 / -1; }
.ins-field label { font-size: 12px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: #6b624f; }
.ins-field input, .ins-field select, .ins-field textarea {
  font: inherit; font-size: 16px; color: var(--ink);
  background: var(--paper);
  border: 1.5px solid var(--line);
  border-radius: 14px;
  padding: 12px 14px;
  min-height: 48px;
}
.ins-field textarea { min-height: 88px; resize: vertical; }
.ins-field input:focus, .ins-field select:focus, .ins-field textarea:focus {
  outline: 3px solid var(--green-soft); border-color: var(--green);
}
.ins-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin-top: 14px; }
.ins-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  color: var(--ink-2);
  font-size: 14.5px;
  font-weight: 700;
  cursor: pointer;
}
.ins-toggle input { width: 18px; height: 18px; accent-color: var(--green-deep); }
.ins-more { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin: 14px 0 0; }
.ins-more-count { color: #6b624f; font-size: 14px; }
.ins-card-rating { display: flex; align-items: baseline; gap: 4px; font-size: 14px; }
.ins-rating { font-weight: 800; color: var(--green-deep); white-space: nowrap; }
.ins-rating-count { color: #6b624f; font-size: 13px; }
.ins-results { margin-top: 18px; display: grid; gap: 10px; }
.ins-empty,
.ins-loading { color: #6b624f; font-size: 15px; padding: 12px 2px; }
.ins-loading::before {
  content: "";
  display: inline-block;
  width: 11px;
  height: 11px;
  margin-right: 9px;
  border: 2px solid var(--line);
  border-top-color: var(--green-deep);
  border-radius: 50%;
  animation: ins-spin .8s linear infinite;
}
@keyframes ins-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .ins-loading::before { animation: none; } }
.ins-error {
  padding: 14px 16px;
  border: 1px solid #d9aaa0;
  border-radius: var(--radius-sm);
  background: #f7ebe8;
  color: #6d2e21;
}
.ins-error p { margin: 0; }
.ins-retry {
  min-height: 44px;
  margin-top: 10px;
  padding: 8px 14px;
  border: 1px solid #9b4c3d;
  border-radius: 999px;
  background: transparent;
  color: #6d2e21;
  font: inherit;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
}
.ins-card {
  display: grid; gap: 6px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
}
.ins-card > a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--green-deep);
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: .16em;
}
.ins-card .meta { font-size: 14px; color: var(--ink-2); }
.ins-pills { display: flex; flex-wrap: wrap; gap: 6px; }

/* Call / map affordances, shared by result cards, directory rows and the
   facility page. Sized as real tap targets: these are the links someone reaches
   for one-handed, on the way to the facility. */
.ins-contact-link,
.ins-contact-none {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  padding: 2px 10px 2px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--green-deep);
  font-size: 13.5px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}
.ins-contact-link:hover { border-color: var(--green-2); background: var(--green-soft); }
.ins-contact-link:focus-visible { outline: 3px solid var(--green-deep); outline-offset: 2px; }
.ins-contact-none { color: #948a74; border-style: dashed; font-weight: 600; }
.ins-card-contact { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 2px; }
.ins-provenance { display: block; margin-top: 3px; color: #6b624f; font-size: 12.5px; }

/* Call and directions sit between the facility's name and its address, where
   they read as the answer to "I have found the place, now what". */
.ins-facility-actions { margin: 18px 0 20px; }
.ins-facility-actions .ins-action { gap: 8px; }

@media (max-width: 720px) {
  /* Calling is the primary act and takes the full width; the two ways to find
     the place share the line below it rather than stacking three deep. */
  .ins-facility-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }
  .ins-facility-actions .ins-action { justify-content: center; }
  .ins-facility-actions .btn-primary { grid-column: 1 / -1; }
}
.ins-pill {
  font-size: 12px; font-weight: 700; letter-spacing: .02em;
  padding: 4px 10px; border-radius: 999px;
  background: var(--green-soft); color: var(--green-deep);
}
.ins-pill.warn { background: var(--amber-soft); color: var(--amber); }
.ins-pill.no { background: #f3e4e0; color: #8a3b2a; }
.ins-pill.restricted { background: #f3e4e0; color: #7b3022; }
.ins-pill.neutral { background: var(--paper-2); color: var(--ink-2); }

.ins-result-list { display: grid; gap: 12px; }
.ins-result-summary { color: #6b624f; font-size: 14px; }
.ins-result-verdict {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper-2);
}
.ins-result-verdict.yes { border-color: #afc99b; background: var(--green-soft); color: #285632; }
.ins-result-verdict.no { border-color: #d9aaa0; background: #f7ebe8; color: #6d2e21; }
.ins-result-verdict.caution,
.ins-result-verdict.ip-only,
.ins-result-verdict.op-only { border-color: #d9b37f; background: var(--amber-soft); color: #744213; }
.ins-result-verdict .ins-source { flex-basis: 100%; color: inherit; opacity: .82; }
.ins-result-note { color: #744213; font-size: 14px; line-height: 1.55; }

.ins-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.ins-chip-prompt { display: block; margin-bottom: 7px; color: var(--ink-2); font-size: 14px; font-weight: 700; }
.ins-chip {
  min-height: 44px;
  padding: 8px 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--card);
  color: var(--green-deep);
  font: inherit;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
}
.ins-chip.selected,
.ins-chip[aria-pressed="true"] { border-color: var(--green-deep); background: var(--green-soft); }

.ins-verdict {
  border-radius: var(--radius-sm);
  padding: 18px 20px;
  margin: 18px 0 8px;
  border: 1px solid var(--line);
}
.ins-verdict.yes { background: var(--green-soft); border-color: #c5d9b4; }
.ins-verdict.no { background: #f7ebe8; border-color: #e8cfc7; }
.ins-verdict.ip-only, .ins-verdict.op-only, .ins-verdict.caution { background: var(--amber-soft); border-color: #ead3b4; }
.ins-verdict h2 { font-size: 26px; margin: 0 0 6px; }
.ins-verdict p { margin: 0; color: var(--ink-2); max-width: 62ch; }

.ins-table-wrap { overflow-x: auto; margin-top: 12px; border-radius: 12px; }
.ins-table-wrap:focus-visible { outline: 3px solid var(--green-deep); outline-offset: 3px; }
.ins-table { width: 100%; border-collapse: collapse; font-size: 15px; }
.ins-table th, .ins-table td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.ins-table th { font-size: 12px; letter-spacing: .05em; text-transform: uppercase; color: #6b624f; }
.ins-table a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--green-deep);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: .16em;
}

.ins-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; margin: 18px 0; }
@media (max-width: 720px) { .ins-stats { grid-template-columns: 1fr 1fr; } }
.ins-stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 14px 16px; }
.ins-stat .k { font-size: 12px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; color: #6b624f; }
.ins-stat .v { font-size: 28px; font-weight: 800; letter-spacing: -0.04em; margin-top: 4px; }

.ins-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.ins-tile {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 16px 18px; display: grid; gap: 6px;
}
.ins-tile h3 { font-size: 18px; margin: 0; }
.ins-tile p { margin: 0; color: var(--ink-2); font-size: 14.5px; }
.ins-tile .go { color: var(--green-deep); font-weight: 800; font-size: 14px; }

.ins-fine { font-size: 13.5px; color: #6b624f; margin-top: 18px; max-width: 72ch; line-height: 1.55; }
.ins-clues { margin: 8px 0 0; padding-left: 1.1em; color: var(--ink-2); font-size: 14px; }
.ins-nearby { margin-top: 8px; font-size: 14px; color: var(--ink-2); }

@media (max-width: 720px) {
  .ins-table-wrap { overflow: visible; }
  .ins-table,
  .ins-table tbody,
  .ins-table tr,
  .ins-table td { display: block; width: 100%; }
  .ins-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }
  .ins-table tr {
    margin: 0 0 12px;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--card);
  }
  .ins-table td {
    display: grid;
    grid-template-columns: minmax(82px, 30%) 1fr;
    gap: 10px;
    padding: 8px 0;
    border: 0;
  }
  .ins-table td::before {
    content: attr(data-label);
    color: #6b624f;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .05em;
    text-transform: uppercase;
  }
  .ins-table a { min-height: 44px; margin: -8px 0; }
}

.ins-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* `hidden` must win over the display rules on .btn / .ins-toggle, or the
   checker's optional controls stay on screen when the module hides them. */
.ins-check [hidden] { display: none !important; }

@media (max-width: 720px) {
  /* Two short controls per row rather than a single column of seven, so the
     results start on the first screen instead of below the fold. Anything
     narrower than ~330px falls back to one column on its own. */
  /* Fixed two columns, not auto-fit: `grid-column: 1 / -1` does not resolve
     reliably against auto-repeat tracks, and the card and search fields must
     span the full width. */
  .ins-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .ins-check { padding: 16px 15px 15px; }
  .ins-check h2 { font-size: 20px; }
  .ins-check-sub { font-size: 14.5px; margin-bottom: 13px; }
  .ins-field label { font-size: 11px; letter-spacing: .05em; }
  .ins-field textarea { min-height: 62px; }
  /* Typing needs the full width; the selects do not. */
  .ins-field:has(input[type="search"]) { grid-column: 1 / -1; }
  .ins-actions { gap: 8px 12px; margin-top: 12px; }
  .ins-actions .btn { flex: 1 1 auto; justify-content: center; }
  .ins-toggle { flex: 1 0 100%; }
  .ins-card { padding: 13px 14px; }
  .ins-card > a { min-height: 0; margin: 2px 0 1px; line-height: 1.35; }
  .ins-card .meta { font-size: 13.5px; }
  .ins-result-verdict { padding: 9px 11px; }
  .ins-more .btn { flex: 1 1 auto; justify-content: center; }
}

/* Only the narrowest handsets (below iPhone-mini width) drop to one column;
   360px and 375px devices keep the two-column bar. */
@media (max-width: 339px) {
  .ins-grid { grid-template-columns: minmax(0, 1fr); }
  .ins-dir-more { grid-template-columns: minmax(0, 1fr); }
}
