/* Snaptools Design System v1: tool help components */
.st-help{
  position:relative;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  flex:0 0 auto;
  vertical-align:middle;
  margin-left:6px;
  line-height:1;
}
.st-help-button{
  width:20px;
  height:20px;
  min-width:20px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  border:0;
  border-radius:999px;
  background:#eaf3ff;
  color:#2563eb;
  font-weight:800;
  font-size:12px;
  line-height:1;
  text-align:center;
  cursor:pointer;
  padding:0;
  appearance:none;
  -webkit-appearance:none;
}
.st-help-button:hover,
.st-help-button:focus{
  background:#dbeafe;
  outline:2px solid rgba(74,144,226,.22);
  outline-offset:2px;
}
.st-help-popover{
  position:absolute;
  z-index:999;
  left:50%;
  bottom:calc(100% + 10px);
  transform:translateX(-50%);
  width:min(300px,80vw);
  padding:14px 16px;
  border-radius:14px;
  background:#152159;
  color:#fff;
  box-shadow:0 14px 36px rgba(21,33,89,.22);
  font-size:.88rem;
  line-height:1.65;
  text-align:left;
  opacity:0;
  visibility:hidden;
  pointer-events:none;
  transition:.16s ease;
}
.st-help-popover::after{
  content:"";
  position:absolute;
  left:50%;
  bottom:-7px;
  transform:translateX(-50%);
  border-width:7px 7px 0 7px;
  border-style:solid;
  border-color:#152159 transparent transparent transparent;
}
.st-help-popover strong{display:block;margin-bottom:6px;color:#fff;font-size:.92rem;}
.st-help-popover span{display:block;color:#e5eefc;}
.st-help.is-open .st-help-popover,
.st-help:focus-within .st-help-popover{opacity:1;visibility:visible;pointer-events:auto;}

.st-guide-section{max-width:1100px;margin:32px auto;background:#fff;border-radius:20px;padding:32px;box-shadow:0 8px 24px rgba(21,33,89,.06);}
.st-section-heading.compact{text-align:center;margin:0 auto 24px;}
.st-section-heading.compact h2{margin:0 0 8px;color:#152159;font-size:1.55rem;}
.st-section-heading.compact p{margin:0 auto;color:#64748b;line-height:1.8;max-width:760px;}
.st-step-list{display:grid;grid-template-columns:repeat(3,1fr);gap:16px;list-style:none;padding:0;margin:0;counter-reset:none;}
.st-step-item{display:flex;gap:14px;padding:20px;border:1px solid #e6edf7;border-radius:18px;background:#f8fbff;}
.st-step-num{flex:0 0 auto;display:inline-flex;align-items:center;justify-content:center;height:28px;padding:0 10px;border-radius:999px;background:#4A90E2;color:#fff;font-size:.78rem;font-weight:800;}
.st-step-item h3{margin:2px 0 8px;color:#152159;font-size:1.05rem;}
.st-step-item p{margin:0;color:#475569;line-height:1.75;font-size:.94rem;}
.st-guide-grid{display:grid;grid-template-columns:repeat(2,1fr);gap:16px;}
.st-guide-card{padding:22px;border:1px solid #e6edf7;border-radius:18px;background:#f8fbff;}
.st-guide-card h3{margin:0 0 10px;color:#152159;font-size:1.08rem;}
.st-guide-card p{margin:0;color:#475569;line-height:1.8;}
.st-example{display:flex;align-items:center;gap:10px;margin:14px 0;padding:10px 12px;border-radius:12px;background:#fff;border:1px solid #e6edf7;}
.st-example span{display:inline-flex;align-items:center;justify-content:center;min-width:34px;height:24px;border-radius:999px;background:#eaf3ff;color:#2563eb;font-size:.78rem;font-weight:800;}
.st-example code{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;color:#152159;white-space:normal;}
.st-guide-note{margin-top:12px!important;font-size:.92rem;color:#64748b!important;}
.st-sample-box{max-width:1100px;margin:32px auto;display:flex;align-items:center;justify-content:space-between;gap:20px;background:linear-gradient(135deg,#eef7ff,#f8fbff);border:1px solid #dbeafe;border-radius:20px;padding:28px;}
.st-sample-box h2{margin:0 0 8px;color:#152159;font-size:1.35rem;}
.st-sample-box p{margin:0;color:#475569;line-height:1.8;}
.st-sample-button{border:0;border-radius:999px;background:#4A90E2;color:#fff;font-weight:800;padding:12px 22px;white-space:nowrap;cursor:pointer;box-shadow:0 8px 18px rgba(74,144,226,.24);}
.st-sample-button:hover{filter:brightness(.97);}

.setting-group label{
  display:inline-flex!important;
  align-items:center;
  gap:6px;
  line-height:1.35;
}
.setting-group label .st-help{transform:translateY(-1px);}
.drop-area .st-help{margin-top:8px;margin-left:0;}
.drop-area .st-help-button{width:22px;height:22px;min-width:22px;}

@media(max-width:768px){
  .st-guide-section{padding:24px 20px;margin:24px auto;}
  .st-step-list,.st-guide-grid{grid-template-columns:1fr;}
  .st-step-item{padding:18px;}
  .st-sample-box{display:block;padding:24px 20px;}
  .st-sample-button{margin-top:16px;width:100%;}

  /* スマホではツールチップを画面内モーダル風に表示して、左右の見切れを防止 */
  .st-help-popover{
    position:fixed;
    left:16px;
    right:16px;
    top:50%;
    bottom:auto;
    transform:translateY(-50%);
    width:auto;
    max-width:none;
    max-height:70vh;
    overflow:auto;
    padding:18px 18px;
    border-radius:18px;
    box-shadow:0 20px 60px rgba(15,23,42,.32);
  }
  .st-help-popover::after{display:none;}
  .st-help.is-open::before{
    content:"";
    position:fixed;
    inset:0;
    z-index:998;
    background:rgba(15,23,42,.28);
  }
  .st-help.is-open .st-help-popover{z-index:999;}
}

/* Mobile tooltip v2: body-level bottom sheet. Prevent clipping inside tool cards/forms. */
.st-help-mobile-backdrop{
  position:fixed;
  inset:0;
  z-index:9998;
  background:rgba(15,23,42,.38);
  opacity:0;
  transition:opacity .18s ease;
}
.st-help-mobile-backdrop.is-visible{opacity:1;}
.st-help-mobile-sheet{
  position:fixed;
  left:12px;
  right:12px;
  bottom:12px;
  z-index:9999;
  max-height:min(72vh,520px);
  overflow:auto;
  padding:20px 20px 18px;
  border-radius:22px;
  background:#152159;
  color:#fff;
  box-shadow:0 24px 70px rgba(15,23,42,.36);
  transform:translateY(18px);
  opacity:0;
  transition:transform .18s ease, opacity .18s ease;
  -webkit-overflow-scrolling:touch;
}
.st-help-mobile-sheet.is-visible{
  transform:translateY(0);
  opacity:1;
}
.st-help-mobile-sheet strong{
  display:block;
  margin:0 34px 8px 0;
  color:#fff;
  font-size:1rem;
  line-height:1.5;
}
.st-help-mobile-sheet span{
  display:block;
  color:#e5eefc;
  font-size:.92rem;
  line-height:1.8;
  white-space:pre-line;
}
.st-help-mobile-close{
  position:absolute;
  top:12px;
  right:12px;
  width:32px;
  height:32px;
  border:0;
  border-radius:999px;
  background:rgba(255,255,255,.12);
  color:#fff;
  font-size:22px;
  line-height:1;
  cursor:pointer;
}
.st-help-mobile-close:focus{
  outline:2px solid rgba(255,255,255,.55);
  outline-offset:2px;
}
body.st-help-lock{overflow:hidden;}

@media(max-width:900px){
  /* スマホ・狭いタブレットではインラインポップオーバーを出さず、JSのボトムシートに任せる */
  .st-help.is-open .st-help-popover,
  .st-help:focus-within .st-help-popover{
    opacity:0!important;
    visibility:hidden!important;
    pointer-events:none!important;
  }
  .st-help.is-open::before{display:none!important;}
  .st-help-button{
    width:22px;
    height:22px;
    min-width:22px;
  }
}
.tool-help-panel-close,
.tool-help-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 999px;
  background: #f1f5f9;
  color: #334155;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}

.tool-help-panel,
.tool-help-popover {
  position: relative;
}
/* Sprint UI polish: keep only the body-level mobile sheet visible and place close button consistently. */
.st-help-mobile-sheet{position:fixed!important;padding-top:22px!important;}
.st-help-mobile-close{
  position:absolute!important;
  top:12px!important;
  right:12px!important;
  width:34px!important;
  height:34px!important;
  display:grid!important;
  place-items:center!important;
  padding:0!important;
  border:0!important;
  border-radius:999px!important;
  background:rgba(255,255,255,.14)!important;
  color:#fff!important;
  font-size:24px!important;
  line-height:1!important;
}
.st-help-mobile-content{padding-right:4px;}
@media(max-width:900px){
  .st-help-popover{display:none!important;}
}
