/* Shared mobile visual language for public network tools.
   Desktop is untouched: every rule is inside max-width 767px
   or scoped accordion chrome that matches ping/portchecker. */

.tm-tools,
.tm-m {
  display: none;
}

body.tm-tool .nd-guide-stack {
  width: min(1120px, calc(100% - 40px));
  margin: 8px auto 0;
}

body.tm-tool .nd-guide-stack .site-knowledge-hub-link--tool { margin: 0 0 12px; }
body.tm-tool .nd-guide-stack .site-knowledge-hub-link__btn { min-height: 44px; }

body.tm-tool .nd-guide--acc {
  width: 100%;
  margin: 0;
  padding: 0 0 56px;
}

body.tm-tool .nd-guide__acc {
  background: #fff;
  border: 1px solid rgba(42, 171, 226, 0.12);
  border-radius: 16px;
  box-shadow: 0 6px 24px rgba(15, 45, 82, 0.06);
  overflow: hidden;
}

body.tm-tool .nd-guide__acc-sum {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 20px;
  cursor: pointer;
  list-style: none;
}

body.tm-tool .nd-guide__acc-sum::-webkit-details-marker,
body.tm-tool .nd-guide__acc-sum::marker { display: none; }

body.tm-tool .nd-guide__acc-text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-width: 0;
}

body.tm-tool .nd-guide__acc-sum .nd-guide__label { margin-bottom: 6px; }

body.tm-tool .nd-guide__acc-title {
  margin: 0;
  font-size: 16px;
  line-height: 1.55;
}

body.tm-tool .nd-guide__acc-sum::after {
  content: "+";
  flex: 0 0 26px;
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #2aabe2;
  color: #fff;
  font-size: 18px;
  font-weight: 700;
  line-height: 1;
}

body.tm-tool .nd-guide__acc[open] > .nd-guide__acc-sum { border-bottom: 1px solid #e2e8f0; }
body.tm-tool .nd-guide__acc[open] > .nd-guide__acc-sum::after { content: "\2212"; }

body.tm-tool .nd-guide--acc .nd-guide__inner {
  background: transparent;
  border: 0;
  box-shadow: none;
  border-radius: 0;
  padding: 8px 22px 28px;
}

@media screen and (max-width: 767px) {
  body.tm-tool {
    --tm-canvas: #eef1f5;
    --tm-surface: #ffffff;
    --tm-ink: #0d1520;
    --tm-ink-3: #8593a1;
    --tm-brand: #f59e0b;
    --tm-accent: #00a651;
    --tm-gap: 12px;
    --tm-radius: 20px;
    --tm-radius-sm: 14px;
    --tm-elev: 0 1px 2px rgba(13, 21, 32, 0.04), 0 10px 24px -16px rgba(13, 21, 32, 0.18);
    background: var(--tm-canvas) !important;
  }

  body.tm-tool .news-public-page,
  body.tm-tool .news-article {
    background: var(--tm-canvas) !important;
    padding-bottom: 20px;
  }

  body.tm-tool .news-public-topbar,
  body.tm-tool .news-article__label,
  body.tm-tool .news-article__deck,
  body.tm-tool .news-article__meta,
  body.tm-tool .news-article__aside,
  body.tm-tool .nd-tool-services,
  body.tm-tool .te-head,
  body.tm-tool .pt-topology,
  body.tm-tool .wh-examples,
  body.tm-tool .sc-examples,
  body.tm-tool .dl-examples,
  body.tm-tool .wh-toolbar,
  body.tm-tool .sc-toolbar,
  body.tm-tool .dl-toolbar,
  body.tm-tool .wh-stats,
  body.tm-tool .sc-stats,
  body.tm-tool .dl-stats,
  body.tm-tool .wh-status-line,
  body.tm-tool .sc-status-line,
  body.tm-tool .dl-status-line,
  body.tm-tool .wh-console-wrap,
  body.tm-tool .sc-console-wrap,
  body.tm-tool .dl-console-wrap {
    display: none !important;
  }

  body.tm-tool .news-article > .news-public-container {
    width: auto;
    margin: 8px var(--tm-gap) 0;
    padding: 0;
    background: transparent;
    border-radius: 0;
    box-shadow: none;
  }

  body.tm-tool .news-article__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 4px 4px 14px;
    border: 0;
  }

  body.tm-tool .news-article__title {
    display: flex;
    align-items: center;
    gap: 9px;
    margin: 0 !important;
    font-size: 15px !important;
    font-weight: 800 !important;
    letter-spacing: -0.2px;
    line-height: 1.35;
    color: var(--tm-ink) !important;
  }

  body.tm-tool .news-article__title::before {
    content: "";
    width: 4px;
    height: 17px;
    border-radius: 999px;
    flex-shrink: 0;
    background: var(--tm-brand);
  }

  body.tm-tool .tm-tools {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 11px;
    border-radius: 999px;
    background: rgba(0, 166, 81, 0.08);
    color: var(--tm-accent) !important;
    font-size: 11.5px;
    font-weight: 700;
    text-decoration: none !important;
  }

  body.tm-tool .tm-tools::after {
    content: "";
    width: 5px;
    height: 5px;
    border-left: 1.6px solid currentColor;
    border-bottom: 1.6px solid currentColor;
    transform: rotate(45deg);
    opacity: 0.85;
  }

  body.tm-tool .nd-tool-layout { display: block; }

  body.tm-tool .nd-tool-main {
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
  }

  body.tm-tool .te-wrap,
  body.tm-tool .te-wrap.te-light,
  body.tm-tool .nd-app {
    margin: 0;
    padding: 0;
    max-width: none;
    background: transparent;
  }

  body.tm-tool .te-shell {
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
  }

  body.tm-tool .tm-m { display: block; }

  .tm-m-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 0 0 12px;
  }

  .tm-m-search {
    position: relative;
    display: block;
    min-height: 48px;
    border-radius: var(--tm-radius-sm);
    background: var(--tm-surface);
    box-shadow: var(--tm-elev);
    overflow: hidden;
    direction: ltr;
  }

  .tm-m-search:focus-within {
    box-shadow: var(--tm-elev), 0 0 0 3px rgba(245, 158, 11, 0.16);
  }

  .tm-m-search__icon {
    position: absolute;
    left: 4px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    pointer-events: none;
    z-index: 1;
  }

  .tm-m-search__icon img {
    width: 20px;
    height: 20px;
    opacity: 0.42;
  }

  .tm-m-host {
    display: block;
    width: 100%;
    height: 48px;
    margin: 0;
    padding: 0 76px 0 40px;
    border: 0;
    outline: none;
    background: transparent;
    font-size: 15px;
    font-weight: 500;
    color: var(--tm-ink);
    direction: ltr;
    unicode-bidi: isolate;
    text-align: left;
    -webkit-appearance: none;
    appearance: none;
  }

  .tm-m-host::placeholder {
    color: var(--tm-ink-3);
    font-weight: 500;
    direction: ltr;
    text-align: left;
  }

  .tm-m-field {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 48px;
    padding: 0 14px;
    border-radius: var(--tm-radius-sm);
    background: var(--tm-surface);
    box-shadow: var(--tm-elev);
  }

  .tm-m-field:focus-within {
    box-shadow: var(--tm-elev), 0 0 0 3px rgba(245, 158, 11, 0.16);
  }

  .tm-m-field__label {
    flex: 0 0 auto;
    font-size: 13px;
    font-weight: 700;
    color: var(--tm-ink-3);
  }

  .tm-m-port,
  .tm-m-select {
    flex: 1;
    min-width: 0;
    height: 46px;
    margin: 0;
    padding: 0;
    border: 0;
    outline: none;
    background: transparent;
    font-family: inherit;
    font-size: 16px;
    font-weight: 700;
    color: var(--tm-ink);
    direction: ltr;
    unicode-bidi: isolate;
    text-align: left;
    -webkit-appearance: none;
    appearance: none;
  }

  .tm-m-port {
    font-size: 18px;
    font-variant-numeric: tabular-nums;
  }

  .tm-m-select {
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'><path fill='%238593a1' d='M1.2 1.4L6 6.2l4.8-4.8' stroke='%238593a1' stroke-width='1.6' fill='none' stroke-linecap='round' stroke-linejoin='round'/></svg>");
    background-repeat: no-repeat;
    background-position: left 0 center;
    padding-left: 16px;
  }

  .tm-m-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
  }

  .tm-m-chip {
    min-height: 36px;
    padding: 0 12px;
    border: 0;
    border-radius: 999px;
    background: var(--tm-surface);
    box-shadow: var(--tm-elev);
    color: var(--tm-ink);
    font-family: inherit;
    font-size: 13px;
    font-weight: 700;
    direction: ltr;
  }

  .tm-m-chip.is-on {
    background: rgba(245, 158, 11, 0.14);
    color: #b45309;
  }

  .tm-m-chip:disabled { opacity: 0.55; }

  .tm-m-hint {
    margin: 0 6px;
    font-size: 12.5px;
    font-weight: 500;
    color: var(--tm-ink-3);
    line-height: 1.6;
  }

  .tm-m-btn {
    position: absolute;
    right: 4px;
    top: 50%;
    transform: translateY(-50%);
    height: 40px;
    margin: 0;
    padding: 0 14px;
    border: 0;
    border-radius: 11px;
    background: linear-gradient(180deg, #f8a917, #ef8f05);
    color: #fff;
    font-family: inherit;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: -0.2px;
    cursor: pointer;
    z-index: 1;
    -webkit-tap-highlight-color: transparent;
  }

  .tm-m-btn:active { transform: translateY(-50%) scale(0.96); }
  .tm-m-btn:disabled { opacity: 0.62; }

  body.tm-tool .te-error {
    margin: 10px 6px 0;
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
    font-size: 13px;
    font-weight: 600;
    color: #be3030;
    line-height: 1.5;
  }

  body.tm-tool .te-error:not(.visible),
  body.tm-tool .te-error:empty {
    display: none;
  }

  body.tm-tool .sc-hero {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    margin: 0 0 10px;
    padding: 18px 16px 16px;
    border: 0;
    border-radius: var(--tm-radius);
    background: var(--tm-surface);
    box-shadow: var(--tm-elev);
    text-align: center;
  }

  body.tm-tool .sc-hero:not(.is-live) { display: none; }

  body.tm-tool .sc-badge {
    margin: 0;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
  }

  body.tm-tool .sc-summary { text-align: center; }
  body.tm-tool .sc-summary-title {
    font-size: 16px;
    font-weight: 800;
    letter-spacing: -0.3px;
    color: var(--tm-ink);
    direction: ltr;
  }
  body.tm-tool .sc-summary-sub {
    font-size: 12.5px;
    font-weight: 500;
    color: var(--tm-ink-3);
  }

  body.tm-tool .wh-card,
  body.tm-tool .sc-card,
  body.tm-tool .dl-card,
  body.tm-tool .wh-panel,
  body.tm-tool .sc-panel,
  body.tm-tool .dl-panel,
  body.tm-tool .wh-section,
  body.tm-tool .sc-section,
  body.tm-tool .dl-results,
  body.tm-tool .wh-table-wrap,
  body.tm-tool .sc-table-wrap,
  body.tm-tool .dl-table-wrap,
  body.tm-tool .wh-tags,
  body.tm-tool .sc-san-block,
  body.tm-tool .wh-ns-block,
  body.tm-tool .sc-warning {
    border: 0;
    border-radius: var(--tm-radius);
    background: var(--tm-surface);
    box-shadow: var(--tm-elev);
  }

  body.tm-tool .wh-sections,
  body.tm-tool .sc-sections {
    gap: 10px;
    margin: 0 0 10px;
  }

  body.tm-tool .wh-section-title,
  body.tm-tool .sc-section-title,
  body.tm-tool .dl-results-head,
  body.tm-tool .sc-san-title {
    padding: 12px 14px;
    background: transparent;
    border-bottom: 1px solid rgba(13, 21, 32, 0.06);
    color: var(--tm-ink);
    font-size: 13px;
    font-weight: 800;
  }

  body.tm-tool .wh-kv,
  body.tm-tool .dl-table {
    font-size: 13px;
  }

  body.tm-tool .nd-intake,
  body.tm-tool .nd-launch {
    margin: 0 0 10px;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
  }

  body.tm-tool .nd-intake__lead {
    margin: 0 6px 10px;
    font-size: 12.5px;
    font-weight: 500;
    color: var(--tm-ink-3);
    line-height: 1.6;
  }

  body.tm-tool .nd-intake__grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
  }

  body.tm-tool .nd-field,
  body.tm-tool .nd-field--full {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 10px;
    grid-column: auto;
    min-height: 48px;
    padding: 0 14px;
    border-radius: var(--tm-radius-sm);
    background: var(--tm-surface);
    box-shadow: var(--tm-elev);
  }

  body.tm-tool .nd-field:focus-within {
    box-shadow: var(--tm-elev), 0 0 0 3px rgba(245, 158, 11, 0.16);
  }

  body.tm-tool .nd-field label {
    flex: 0 0 auto;
    margin: 0;
    font-size: 13px;
    font-weight: 700;
    color: var(--tm-ink-3);
  }

  body.tm-tool .nd-select {
    flex: 1;
    min-width: 0;
    width: auto;
    height: 46px;
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
    font-size: 14px;
    font-weight: 700;
    color: var(--tm-ink);
  }

  body.tm-tool .nd-select:focus {
    box-shadow: none;
    border: 0;
  }

  body.tm-tool .nd-captcha {
    margin: 10px 0 0;
    padding: 0;
    border: 0;
  }

  body.tm-tool .nd-captcha__label {
    margin: 0 6px 8px;
    font-size: 13px;
    font-weight: 700;
    color: var(--tm-ink-3);
  }

  body.tm-tool .nd-captcha__box {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 8px;
    min-height: 48px;
    padding: 6px 8px 6px 10px;
    border-radius: var(--tm-radius-sm);
    background: var(--tm-surface);
    box-shadow: var(--tm-elev);
  }

  body.tm-tool .nd-captcha__box:focus-within {
    box-shadow: var(--tm-elev), 0 0 0 3px rgba(245, 158, 11, 0.16);
  }

  body.tm-tool .nd-captcha__img {
    width: auto;
    height: 36px;
    border: 0;
    border-radius: 8px;
    flex: 0 0 auto;
  }

  body.tm-tool .nd-captcha__refresh {
    flex: 0 0 auto;
    padding: 6px 10px;
    border: 0;
    border-radius: 10px;
    background: #f3f5f8;
    color: var(--tm-ink);
    font-size: 12px;
    font-weight: 700;
  }

  body.tm-tool .nd-captcha__input {
    flex: 1;
    min-width: 0;
    width: auto;
    height: 36px;
    padding: 0 8px;
    border: 0;
    border-radius: 10px;
    background: #f3f5f8;
    box-shadow: none;
    font-size: 16px;
    font-weight: 700;
    color: var(--tm-ink);
  }

  body.tm-tool .nd-intake__note {
    margin: 10px 6px 0;
    font-size: 12.5px;
    font-weight: 500;
    color: var(--tm-ink-3);
    line-height: 1.6;
  }

  body.tm-tool .nd-intake__hint {
    margin: 8px 6px 0;
    font-size: 13px;
    font-weight: 600;
  }

  body.tm-tool .nd-launch {
    align-items: stretch;
    margin-bottom: 12px;
  }

  body.tm-tool .nd-start-btn {
    width: 100%;
    height: 48px;
    padding: 0 14px;
    border: 0;
    border-radius: 12px;
    background: linear-gradient(180deg, #f8a917, #ef8f05) !important;
    color: #fff !important;
    font-size: 14px;
    font-weight: 800;
    box-shadow: var(--tm-elev);
  }

  body.tm-tool .nd-start-btn svg { display: none; }

  body.tm-tool .nd-restart-btn {
    width: 100%;
    min-height: 44px;
    border: 0;
    border-radius: 12px;
    background: var(--tm-surface);
    box-shadow: var(--tm-elev);
    color: var(--tm-ink);
  }

  body.tm-tool .nd-progress-wrap {
    margin: 0 0 12px;
    padding: 14px;
    border: 0;
    border-radius: var(--tm-radius);
    background: var(--tm-surface);
    box-shadow: var(--tm-elev);
  }

  body.tm-tool .nd-summary {
    gap: 8px;
    margin: 0 0 12px;
  }

  body.tm-tool .nd-summary > * {
    border: 0;
    border-radius: var(--tm-radius-sm);
    background: var(--tm-surface);
    box-shadow: var(--tm-elev);
  }

  body.tm-tool .nd-guide-stack {
    width: auto;
    margin: 12px var(--tm-gap) 0;
  }

  body.tm-tool .nd-guide-stack .site-knowledge-hub-link__btn {
    width: 100%;
    min-height: 48px;
    border: 0;
    border-radius: 20px;
    background: #fff;
    box-shadow: var(--tm-elev);
    color: #00a651 !important;
    font-size: 13.5px;
    font-weight: 700;
  }

  body.tm-tool .nd-guide--acc { padding-bottom: 28px; }

  body.tm-tool .nd-guide__acc {
    border: 0;
    border-radius: 20px;
    box-shadow: var(--tm-elev);
  }

  body.tm-tool .nd-guide__acc-sum { padding: 16px; }

  body.tm-tool .nd-guide__acc-sum .nd-guide__label {
    background: rgba(245, 158, 11, 0.12);
    color: #d97706;
  }

  body.tm-tool .nd-guide__acc-title {
    font-size: 14.5px;
    font-weight: 800;
    letter-spacing: -0.2px;
    color: #0d1520;
  }

  body.tm-tool .nd-guide__acc-sum::after {
    background: linear-gradient(180deg, #f8a917, #ef8f05);
  }

  body.tm-tool .nd-guide--acc .nd-guide__inner { padding: 4px 16px 22px; }
}
