/* =====================================================
   MedDev Advisory - Device-Specific Scoping Worksheets
   One shared, browser-only layout for all device families.
   ===================================================== */

.device-tool-header .container {
  max-width: 960px;
}

.device-tool-header h1 {
  max-width: 900px;
  margin-inline: auto;
}

.device-tool-header p {
  max-width: 820px;
}

.device-tool-header .tag {
  color: #d8fffb;
  background: rgba(0, 180, 166, 0.2);
  border-color: rgba(112, 226, 217, 0.42);
}

.device-tool-proof-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.device-tool-overview {
  background: var(--white);
}

.device-tool-overview .landing-two-col {
  align-items: start;
}

.device-tool-guardrail {
  display: grid;
  gap: 16px;
}

.device-tool-guardrail-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  color: rgba(255, 255, 255, 0.88);
  line-height: 1.65;
}

.device-tool-guardrail-item i {
  flex: 0 0 auto;
  margin-top: 5px;
  color: var(--teal-light);
}

.device-tool-guardrail-item strong {
  color: var(--white);
}

.device-tool-workspace-section {
  background: var(--light-bg);
  scroll-margin-top: 84px;
}

.device-tool-workspace-header {
  max-width: 780px;
  margin: 0 auto 32px;
  text-align: center;
}

.device-tool-workspace-header p {
  color: var(--text-mid);
  line-height: 1.75;
}

.device-scope-form {
  margin: 0;
}

.device-scope-layout {
  display: grid;
  grid-template-columns: minmax(220px, 260px) minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

.device-scope-progress {
  position: sticky;
  top: 96px;
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--white);
  box-shadow: var(--shadow-sm);
}

.device-scope-progress .tag {
  margin-bottom: 16px;
}

.device-scope-progress h3 {
  margin: 0 0 8px;
  color: var(--navy);
  font-size: var(--text-md);
}

.device-scope-progress > p {
  margin: 0;
  color: var(--text-mid);
  font-size: var(--text-sm);
  line-height: 1.65;
}

.device-scope-meter {
  height: 8px;
  margin: 16px 0 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #e5ebf2;
}

.device-scope-meter > span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--teal), var(--blue));
  transition: width 180ms ease;
}

.device-scope-progress-count {
  color: var(--text-light);
  font-size: var(--text-xs);
}

.device-scope-nav {
  display: grid;
  gap: 8px;
  margin-top: 20px;
}

.device-scope-nav a {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  min-height: 44px;
  padding: 8px 10px;
  border-radius: var(--radius);
  color: var(--text-mid);
  font-size: var(--text-sm);
  font-weight: 600;
}

.device-scope-nav a:hover,
.device-scope-nav a:focus-visible {
  background: var(--light-bg);
  color: var(--blue);
}

.device-scope-nav-number {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 50%;
  background: #e8f1fb;
  color: var(--blue);
  font-size: var(--text-xs);
  font-weight: 800;
}

.device-scope-privacy {
  display: flex;
  gap: 10px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  color: var(--text-light);
  font-size: var(--text-xs);
  line-height: 1.55;
}

.device-scope-privacy i {
  flex: 0 0 auto;
  margin-top: 3px;
  color: var(--teal);
}

.device-scope-groups {
  display: grid;
  gap: 24px;
  min-width: 0;
}

.device-scope-card {
  min-width: 0;
  margin: 0;
  padding: 32px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--white);
  box-shadow: var(--shadow-sm);
  scroll-margin-top: 100px;
}

.device-scope-card legend {
  width: 100%;
  padding: 0;
}

.device-scope-card-heading {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

.device-scope-card-number {
  display: grid;
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  place-items: center;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--blue), var(--teal));
  color: var(--white);
  font-size: var(--text-sm);
  font-weight: 800;
}

.device-scope-card-title {
  display: block;
  color: var(--navy);
  font-size: clamp(1.25rem, 2vw, 1.5rem);
  font-weight: 750;
  line-height: 1.3;
}

.device-scope-card-description {
  display: block;
  margin-top: 6px;
  color: var(--text-mid);
  font-size: var(--text-sm);
  font-weight: 400;
  line-height: 1.65;
}

.device-scope-question-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
  margin-top: 24px;
}

.device-scope-field {
  min-width: 0;
}

.device-scope-field.is-wide {
  grid-column: 1 / -1;
}

.device-scope-field label {
  display: block;
  margin-bottom: 8px;
  color: var(--navy);
  font-size: var(--text-sm);
  font-weight: 700;
  line-height: 1.45;
}

.device-scope-field-help {
  margin: -2px 0 10px;
  color: var(--text-light);
  font-size: var(--text-xs);
  line-height: 1.55;
}

.device-scope-field select,
.device-scope-field input,
.device-scope-field textarea {
  width: 100%;
  min-height: 48px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--white);
  color: var(--text-dark);
  font: inherit;
  font-size: var(--text-sm);
  line-height: 1.5;
  transition: border-color 180ms ease, box-shadow 180ms ease;
}

.device-scope-field textarea {
  min-height: 112px;
  resize: vertical;
}

.device-scope-field select:focus,
.device-scope-field input:focus,
.device-scope-field textarea:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(30, 95, 168, 0.14);
}

.device-scope-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  padding: 32px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--white);
  box-shadow: var(--shadow-sm);
}

.device-scope-actions .btn {
  min-width: 220px;
  min-height: 44px;
}

.device-scope-actions-note {
  flex-basis: 100%;
  margin: 4px 0 0;
  color: var(--text-light);
  font-size: var(--text-xs);
  line-height: 1.55;
  text-align: center;
}

.device-scope-results {
  margin-top: 32px;
  padding: 32px;
  border: 1px solid rgba(0, 142, 132, 0.34);
  border-radius: var(--radius-lg);
  background: var(--white);
  box-shadow: var(--shadow-md);
  scroll-margin-top: 96px;
}

.device-scope-results[hidden] {
  display: none !important;
}

.device-scope-print-meta {
  display: none;
}

.device-scope-result-heading {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 24px;
  align-items: center;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border);
}

.device-scope-result-heading h2 {
  margin: 10px 0 8px;
  color: var(--navy);
  font-size: clamp(1.6rem, 3vw, 2.25rem);
}

.device-scope-result-heading p {
  max-width: 760px;
  margin: 0;
  color: var(--text-mid);
  line-height: 1.7;
}

.device-scope-result-state {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 220px;
  min-height: 48px;
  padding: 10px 16px;
  border: 1px solid rgba(30, 95, 168, 0.24);
  border-radius: 999px;
  background: #eef5fc;
  color: var(--blue);
  font-size: var(--text-sm);
  font-weight: 800;
  text-align: center;
}

.device-scope-result-state[data-state="review"] {
  border-color: rgba(196, 30, 58, 0.24);
  background: #fff2f4;
  color: #9c1830;
}

.device-scope-result-state[data-state="unresolved"] {
  border-color: rgba(180, 83, 9, 0.24);
  background: #fff7ed;
  color: #9a4d08;
}

.device-scope-result-state[data-state="evidence"] {
  border-color: rgba(122, 97, 29, 0.28);
  background: #fffbed;
  color: #715a18;
}

.device-scope-result-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 24px;
}

.device-scope-result-card {
  min-width: 0;
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--light-bg);
}

.device-scope-result-card h3 {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 14px;
  color: var(--navy);
  font-size: var(--text-md);
}

.device-scope-result-card h3 i {
  color: var(--teal);
}

.device-scope-result-card ul {
  display: grid;
  gap: 10px;
  margin: 0;
  padding-left: 20px;
}

.device-scope-result-card li,
.device-scope-result-empty {
  color: var(--text-mid);
  font-size: var(--text-sm);
  line-height: 1.6;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.device-scope-result-empty {
  margin: 0;
}

.device-scope-action-register {
  margin-top: 16px;
  padding: 24px;
  border: 1px solid rgba(30, 95, 168, 0.2);
  border-radius: var(--radius-lg);
  background: #f3f7fc;
}

.device-scope-action-register h3 {
  margin: 0 0 12px;
  color: var(--navy);
  font-size: var(--text-md);
}

.device-scope-action-register ol {
  display: grid;
  min-width: 0;
  gap: 10px;
  margin: 0;
  padding-left: 22px;
  color: var(--text-mid);
  font-size: var(--text-sm);
  line-height: 1.6;
}

.device-scope-action-register li {
  overflow-wrap: anywhere;
  word-break: break-word;
}

.device-scope-boundary-note {
  margin-top: 16px;
  padding: 16px;
  border-left: 4px solid var(--teal);
  border-radius: var(--radius);
  background: #eef8f7;
  color: var(--text-mid);
  font-size: var(--text-sm);
  line-height: 1.65;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.device-scope-result-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 24px;
}

.device-scope-result-actions .btn {
  min-height: 44px;
}

.device-tool-evidence-section {
  background: var(--white);
}

.device-tool-evidence-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 0.82fr);
  gap: 32px;
  align-items: start;
}

.device-tool-source-list,
.device-tool-related-list {
  display: grid;
  gap: 12px;
  margin-top: 20px;
}

.device-tool-source-list a,
.device-tool-related-list a {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  min-height: 44px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--white);
  color: var(--navy);
  font-size: var(--text-sm);
  font-weight: 650;
  line-height: 1.5;
}

.device-tool-source-list a:hover,
.device-tool-related-list a:hover {
  border-color: rgba(30, 95, 168, 0.42);
  color: var(--blue);
}

.device-tool-source-list i,
.device-tool-related-list i {
  flex: 0 0 auto;
  margin-top: 4px;
  color: var(--teal);
}

.device-tool-faq {
  display: grid;
  gap: 12px;
  margin-top: 20px;
}

.device-tool-faq details {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--light-bg);
}

.device-tool-faq summary {
  min-height: 48px;
  padding: 14px 16px;
  color: var(--navy);
  font-size: var(--text-sm);
  font-weight: 700;
  cursor: pointer;
}

.device-tool-faq details p {
  margin: 0;
  padding: 0 16px 16px;
  color: var(--text-mid);
  font-size: var(--text-sm);
  line-height: 1.65;
}

@media (max-width: 980px) {
  .device-tool-proof-grid,
  .device-scope-question-grid,
  .device-tool-evidence-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  .device-scope-layout {
    grid-template-columns: 1fr;
  }

  .device-scope-progress {
    position: static;
  }

  .device-scope-nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .device-tool-header {
    padding: 104px 20px 52px;
  }

  .device-tool-header .container {
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  .device-tool-header h1 {
    margin-bottom: 0;
    font-size: clamp(1.875rem, 9vw, 2.15rem);
    line-height: 1.12;
  }

  .device-tool-header .landing-header-actions {
    order: 3;
    width: 100%;
    margin-top: 20px;
  }

  .device-tool-header p {
    order: 4;
    margin-top: 22px;
    font-size: 1rem;
    line-height: 1.65;
  }

  .device-scope-card,
  .device-scope-actions,
  .device-scope-results {
    padding: 24px 20px;
  }

  .device-scope-nav,
  .device-scope-result-grid {
    grid-template-columns: 1fr;
  }

  .device-scope-result-heading {
    grid-template-columns: 1fr;
  }

  .device-scope-result-state {
    min-width: 0;
    width: 100%;
  }

  .device-scope-actions .btn,
  .device-scope-result-actions .btn {
    width: 100%;
    min-width: 0;
  }
}

@media print {
  @page {
    margin: 15mm;
  }

  .device-scope-ready .navbar,
  .device-scope-ready .mobile-nav,
  .device-scope-ready .device-tool-header,
  .device-scope-ready .landing-proof-strip,
  .device-scope-ready .device-tool-overview,
  .device-scope-ready .device-tool-workspace-header,
  .device-scope-ready .device-scope-form,
  .device-scope-ready .device-tool-evidence-section,
  .device-scope-ready .cta-section-simple,
  .device-scope-ready .footer,
  .device-scope-ready .device-scope-result-actions {
    display: none !important;
  }

  .device-scope-ready .device-tool-workspace-section {
    padding: 0 !important;
    background: var(--white) !important;
  }

  .device-scope-ready .device-scope-results {
    display: block !important;
    margin: 0;
    padding: 0;
    border: 0;
    box-shadow: none;
  }

  .device-scope-ready .device-scope-print-meta {
    display: grid;
    gap: 4px;
    margin-bottom: 18px;
    padding-bottom: 12px;
    border-bottom: 1px solid #cbd5e1;
    color: #102a4c;
    font-size: 10pt;
    line-height: 1.35;
  }

  .device-scope-ready .device-scope-print-meta strong {
    font-size: 14pt;
  }

  .device-scope-result-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .device-scope-result-card,
  .device-scope-action-register {
    break-inside: avoid;
  }

  a {
    color: inherit !important;
    text-decoration: none !important;
  }
}
