/* =========================================================
   Navigator9 – Light Glass Edition
   File: assets/navigator9/navigator9.css
   ========================================================= */

/* ===== Design Tokens ===== */
:root{
  /* 背景（モーダル外）も明るめに */
  --n9-bg: rgba(255, 239, 120, .55);

  /* ★パネル本体：しっかり黄色（ポップ） */
  --n9-panel-bg: #FFED29;

  /* 枠線は黒寄りで“ポップ漫画感” */
  --n9-border: rgba(0,0,0,.18);
  --n9-border-strong: rgba(0,0,0,.30);

  /* 文字は黒寄りにしないと読みにくい */
  --n9-text: rgba(15, 16, 18, .92);
  --n9-sub: rgba(15, 16, 18, .62);

  /* アクセントは“青”のままでコントラスト強く */
  --n9-accent: #0b63b6;

  /* 影は“くっきり”系 */
  --n9-shadow: 0 6px 5px rgba(0,0,0,.12), 0 22px 40px rgba(0,0,0,.20);

  --n9-radius: 18px;
  --n9-font: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans JP", sans-serif;
}

/* =========================================================
   Floating Button (FAB)
========================================================= */
.n9-fab{
  position: fixed;
  right: 15px;
  bottom: 15px;
  z-index: 5000;
  width: 130px;
  height: 130px;
  border-radius: 50%;
  border: 2px solid #fff;
  cursor: pointer;
  color: rgba(255, 255, 255, .92);
  text-shadow: 0 1px 0 rgba(255, 255, 255, .55), 0 0 3px rgba(0, 0, 0, .18), 0 6px 18px rgba(0, 0, 0, .16);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-family: var(--n9-font);
  font-weight: 900;
  text-align: center;
   background: border-box;
  box-shadow: 0 12px 28px rgba(0,0,0,.22);
}

/* 画像 */
.n9-fab img{
  width: 60px;
  height: auto;
  pointer-events: none;
  margin-top: -5px;
}

/* テキスト */
.n9-fab span{
  font-size: 0.9rem;
  letter-spacing: .05em;
}

.n9-fab::before,
.n9-fab::after{
  content:"";
  position:absolute;
  width:100%;
  height:100%;
  border-radius:50%;
  border: 3px solid rgba(0,255,140,.55);
  animation: n9ripple 3s infinite ease-out;
  pointer-events:none;
}

.n9-fab::after{
  animation-delay: 1.5s;
}

@keyframes n9ripple{
  0%{
    transform: scale(1);
    opacity:.6;
  }
  70%{
    transform: scale(1.9);
    opacity:0;
  }
  100%{
    opacity:0;
  }
}

.n9-fab:hover{
  box-shadow:
    0 22px 50px rgba(0,0,0,.35),
    inset 0 2px 6px rgba(255,255,255,.25);
    background: rgba(255,255,255,.25);
}

.n9-fab:active{
  transform: scale(.96);
}

/* =========================================================
   Modal Base
========================================================= */
.n9-modal{
  position: fixed;
  inset: 0;
  z-index: 999999;

  display: block;
  opacity: 0;
  pointer-events: none;
  transition: opacity .22s ease;
}

.n9-modal.is-open{
  opacity: 1;
  pointer-events: auto;
}

.n9-modal__backdrop{
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.18);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

/* =========================================================
   Panel
========================================================= */
.n9-modal__panel{
  position: absolute;
  right: 18px;
  bottom: 88px;

  width: min(420px, calc(100vw - 36px));
  max-height: min(72vh, 640px);
  overflow: hidden;

  border-radius: var(--n9-radius);
  background: var(--n9-panel-bg);
  border: 1px solid var(--n9-border);
  box-shadow: var(--n9-shadow);

  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);

  transform: translateY(16px) scale(.985);
  opacity: 0;
  transition:
    transform .28s cubic-bezier(.22,.61,.36,1),
    opacity .22s ease;
}

.n9-modal.is-open .n9-modal__panel{
  transform: translateY(0) scale(1);
  opacity: 1;
}

/* =========================================================
   Close Button
========================================================= */
.n9-modal__close{
  position: absolute;
  top: 10px;
  right: 10px;

  width: 38px;
  height: 38px;

  border-radius: 999px;
  border: 1px solid var(--n9-border-strong);
  background: rgba(255,255,255,.85);

  color: var(--n9-text);
  font-size: 16px;

  display: grid;
  place-items: center;
  cursor: pointer;
  transition: all .18s ease;
}

.n9-modal__close:hover{
  border-color: var(--n9-accent);
}

.n9-modal__close:focus-visible{
  outline: 2px solid var(--n9-accent);
  outline-offset: 3px;
}

/* =========================================================
   Root Content
========================================================= */
#navigator9-root{
  padding: 54px 16px;
  font-family: var(--n9-font);
  color: var(--n9-text);
  overflow-y: auto;
  max-height: inherit;
}

/* =========================================================
   Text
========================================================= */
.n9-msg{
  margin: 0 0 12px;
  font-size: 16px;
  line-height: 1.6;
}

.n9-sub{
  margin: 12 0;
  font-size: 12px;
  color: var(--n9-sub);
}

/* =========================================================
   Grid + Buttons
========================================================= */
.n9-grid{
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.n9-btn{
  width: 100%;
  text-align: center;
  padding: 14px;
  border-radius: 8px;
  border: none;

  background: rgba(255,255,255,1);
  color: var(--n9-text);
  font-family: var(--n9-font);
  font-size: 1rem;

  cursor: pointer;
  transition: all .18s ease;
}

.n9-btn:hover{
  background: #00ff00;
}

.n9-btn:active{
  transform: translateY(1px);
}

.n9-btn:focus-visible{
  outline: 2px solid var(--n9-accent);
  outline-offset: 2px;
}

/* =========================================================
   Input
========================================================= */
.n9-input{
  width: 100%;
  padding: 12px;
  border-radius: 14px;
  border: 1px solid var(--n9-border);

  background: #ffffff;
  color: var(--n9-text);
  font-family: var(--n9-font);

  resize: vertical;
}

.n9-input:focus-visible{
  outline: 2px solid var(--n9-accent);
  outline-offset: 2px;
}

/* =========================================================
   Action Buttons
========================================================= */
.n9-actions{
  display: flex;
  gap: 10px;
  margin-top: 12px;
}

.n9-actions .n9-btn{
  color: #fff;
  text-align: center;
}

.n9-selector{
  background: #fff;
  border: 2px solid #fff;
}

/* 紫（進む） */
.n9-forward,
.n9-final-forward{
  background: #B788EA;
}

/* 緑（戻る） */
.n9-backward,
.n9-final-backward{
  background: #32cd32;
}

.n9-final-backward{
  margin: 10px 0 0;
}

/* 選択状態（複数選択ボタン） */
.n9-selector.is-selected,
.n9-selector[aria-pressed="true"]{
  background: #9acd32;
}

.n9-forward.is-disabled{
  opacity: .45;
  pointer-events: none;
}

/* =========================================================
   AI Draft
========================================================= */
.n9-ai-draft{
  background: rgba(255,255,255,.92);
  border: 2px solid rgba(0,0,0,.14);
  border-radius: 18px;
  padding: 14px;

  font-size: 15px;
  line-height: 1.7;
  color: rgba(0,0,0,.86);

  white-space: pre-wrap; /* \n を改行として見せる */
  overflow: auto;        /* はみ出た分はスクロール */
  max-height: 260px;     /* 好みで調整 */
}

/* =========================================================
   Estimate
========================================================= */
.n9-estimate{
  font-size: 1rem;
  font-weight: 700;
  text-align: center;
  margin: 0 0 30px;
}
.n9-estimate span{
  font-size: 1.6rem;
}

/* =========================================================
   Chips
========================================================= */
.n9-chiprow{
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.n9-chip{
  font-size: 12px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--n9-border);
  background: rgba(0,0,0,.04);
  color: var(--n9-sub);
}

/* =========================================================
   Loading
========================================================= */
.n9-loading{
  display: flex;
  align-items: center;
  gap: 10px;
}

.n9-dot{
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--n9-accent);
  animation: n9dot 1.1s infinite ease-in-out;
}
.n9-dot:nth-child(2){ animation-delay: .12s; }
.n9-dot:nth-child(3){ animation-delay: .24s; }

@keyframes n9dot{
  0%,80%,100%{ transform: translateY(0); opacity: .5; }
  40%{ transform: translateY(-4px); opacity: 1; }
}

/* =========================================================
   Background Lite Dim
========================================================= */
body.n9-modal-open .qd-stage-lite{
  opacity: .25;
  filter: blur(1px);
  transition: opacity .2s ease, filter .2s ease;
}

/* =========================================================
   Responsive
========================================================= */
@media (max-width: 480px){
  .n9-modal__panel{
    right: 12px;
    bottom: 76px;
    width: calc(100vw - 24px);
    max-height: min(80vh, 680px);
  }
.qd-sec {
    align-items: anchor-center;
}  
.n9-fab{
  width: 90px;
  height: 90px;
  border:2px solid rgba(255,255,255,.9);
  gap:2px
}

/* 画像 */
.n9-fab img{
  width: 40px;
}

/* テキスト */
.n9-fab span{
  font-size: 0.7rem;
  letter-spacing: .05em;
}
}

/* =========================================================
   Reduced Motion
========================================================= */
@media (prefers-reduced-motion: reduce){
  .n9-modal,
  .n9-modal__panel,
  .n9-btn,
  .n9-dot{
    transition: none !important;
    animation: none !important;
  }
}

/* =========================================================
   Navigator9 polish (loader)
========================================================= */
.n9-modal__loader{
  position: absolute;
  inset: 0;
  display: none;
  place-items: center;
  gap: 10px;

  background: rgba(255,255,255,.55);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);

  z-index: 3;
}
.n9-modal__loader.is-on{ display: grid; }

.n9-spinner{
  width: 34px;
  height: 34px;
  border-radius: 999px;
  border: 3px solid rgba(0,0,0,.18);
  border-top-color: rgba(0,0,0,.55);
  animation: n9spin .8s linear infinite;
}
@keyframes n9spin{ to{ transform: rotate(360deg); } }

.n9-loading-text{
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .06em;
  color: rgba(0,0,0,.65);
}