/* ==================================================
   CNC TOOLS — OKUMA HELP
   ================================================== */

#okuma-help-modal {
  overflow: hidden;
}

#okuma-help-modal .okuma-help-panel {
  display: flex;
  flex-direction: column;
  width: min(900px, calc(100vw - 2rem));
  max-width: 100%;
  max-height: calc(100dvh - 2rem);
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

#okuma-help-modal .tool-modal__header {
  flex: 0 0 auto;
}

#okuma-help-modal .okuma-help-body {
  display: grid;
  flex: 1 1 auto;
  gap: 1rem;
  width: 100%;
  min-width: 0;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.okuma-help-intro {
  margin: 0;
  color: var(--cnc-muted);
  line-height: 1.5;
}

.okuma-help-sections {
  display: grid;
  align-content: start;
  gap: .8rem;
  min-width: 0;
}

/* Each topic is one top-level Collapse. */
.okuma-help-section {
  overflow: hidden;
  background: #151a22;
  border: 1px solid var(--cnc-line);
  border-radius: .85rem;
}

.okuma-help-section > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 3.5rem;
  padding: .9rem 1rem;
  color: var(--cnc-accent);
  background: rgba(34, 42, 53, .72);
  cursor: pointer;
  font-size: 1rem;
  font-weight: 900;
  letter-spacing: .035em;
  list-style: none;
  text-transform: uppercase;
  -webkit-tap-highlight-color: transparent;
}

.okuma-help-section > summary::-webkit-details-marker {
  display: none;
}

.okuma-help-section > summary::after {
  content: "+";
  flex: 0 0 auto;
  color: var(--cnc-text);
  font-size: 1.5rem;
  line-height: 1;
}

.okuma-help-section[open] > summary::after {
  content: "−";
}

.okuma-help-section > summary:hover,
.okuma-help-section > summary:focus-visible {
  background-color: rgba(255, 212, 0, .09);
  outline: none;
}

.okuma-help-section__content {
  display: grid;
  gap: .85rem;
  padding: .85rem;
}

/* Procedure headings and content live inside their parent Collapse. */
.okuma-help-procedure {
  min-width: 0;
  padding: .85rem .9rem;
  background: #202834;
  border: 1px solid rgba(100, 116, 139, .35);
  border-radius: .65rem;
}

.okuma-help-procedure__title {
  margin: 0 0 .7rem;
  color: var(--cnc-text);
  font-size: 1rem;
  font-weight: 850;
  line-height: 1.35;
}

.okuma-help-procedure__content {
  display: grid;
  gap: .75rem;
  color: var(--cnc-text);
}

.okuma-help-procedure__content p {
  margin: 0;
  line-height: 1.5;
}

.okuma-help-steps {
  display: grid;
  gap: .6rem;
  margin: 0;
  padding-left: 1.6rem;
}

.okuma-help-steps li {
  padding-left: .2rem;
  line-height: 1.5;
}

.okuma-help-step-reference {
  display: inline-block;
  margin: .25rem 0 0 .45rem;
  padding: .18rem .45rem;
  color: #f2f5f8;
  background: #0d1219;
  border: 1px solid rgba(100, 116, 139, .45);
  border-radius: .3rem;
  font-family: Consolas, "Courier New", monospace;
  font-size: .88em;
  font-weight: 700;
  white-space: nowrap;
  vertical-align: baseline;
}

.okuma-help-result {
  padding: .8rem .9rem;
  color: var(--cnc-text);
  background: rgba(157, 255, 87, .08);
  border: 1px solid rgba(157, 255, 87, .35);
  border-radius: .55rem;
  font-weight: 750;
  line-height: 1.45;
}

.okuma-help-note {
  padding: .8rem .9rem;
  color: #f5e9b2;
  background: rgba(255, 212, 0, .08);
  border: 1px solid rgba(255, 212, 0, .28);
  border-radius: .55rem;
  line-height: 1.5;
}

.okuma-help-code {
  overflow-x: auto;
  margin: 0;
  padding: .85rem;
  color: #f2f5f8;
  background: #0d1219;
  border: 1px solid rgba(100, 116, 139, .35);
  border-radius: .55rem;
  font-family: Consolas, "Courier New", monospace;
  font-size: .94rem;
  line-height: 1.55;
  white-space: pre;
  -webkit-overflow-scrolling: touch;
}

.okuma-help-empty {
  margin: 0;
  padding: .85rem;
  color: var(--cnc-muted);
  background: rgba(255, 255, 255, .025);
  border: 1px dashed var(--cnc-line);
  border-radius: .55rem;
}

@media (max-width: 800px) {
  #okuma-help-modal {
    width: 100dvw;
    height: 100dvh;
    padding: 0;
    align-items: stretch;
    justify-items: stretch;
  }

  #okuma-help-modal .okuma-help-panel {
    width: 100%;
    height: 100dvh;
    max-width: none;
    max-height: 100dvh;
    margin: 0;
    border-left: 0;
    border-right: 0;
    border-radius: 0;
    overflow: hidden;
  }

  #okuma-help-modal .okuma-help-body {
    padding: .75rem;
  }

  .okuma-help-section > summary {
    min-height: 3.8rem;
    padding: 1rem .9rem;
  }

  .okuma-help-section__content {
    padding: .7rem;
  }

  .okuma-help-procedure {
    padding: .8rem;
  }

  .okuma-help-steps li {
    padding-left: .1rem;
  }

  .okuma-help-step-reference {
    margin-left: 0;
  }
}
