/* NaoTsu Production 受付AIチャット（トップページ専用）
   既存の CSS 変数（--bg / --gold 等）を使う。クラスは全部 ntc- で始め、既存のスタイルと衝突させない。 */

.ntc-launcher {
  position: fixed; right: 20px; bottom: 20px; z-index: 90;
  display: flex; align-items: center; gap: 10px;
  padding: 6px 18px 6px 6px; border-radius: 100px;
  background: rgba(19,19,24,0.92); color: var(--text, #f4f1ea);
  border: 1px solid var(--border-strong, rgba(212,175,106,0.32));
  box-shadow: 0 10px 34px rgba(0,0,0,.45), 0 0 0 1px rgba(212,175,106,.08);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  font: 700 0.84rem/1.2 'Noto Sans JP', sans-serif; letter-spacing: .02em;
  cursor: pointer; transition: transform .2s, box-shadow .2s;
}
.ntc-launcher:hover { transform: translateY(-2px); box-shadow: 0 14px 40px rgba(0,0,0,.5), 0 0 22px rgba(212,175,106,.22); }
.ntc-launcher:focus-visible, .ntc-panel button:focus-visible, .ntc-panel a:focus-visible, .ntc-panel textarea:focus-visible {
  outline: 2px solid var(--gold-bright, #ecd49a); outline-offset: 2px;
}
.ntc-launcher[hidden] { display: none; }

/* 顔アイコン（同じ絵を拡大して顔のところだけ丸く切り抜く） */
.ntc-face {
  position: relative; flex-shrink: 0; overflow: hidden; border-radius: 50%;
  width: 44px; height: 44px; background: #fff;
  box-shadow: 0 0 0 2px var(--gold, #d4af6a);
}
.ntc-face img {
  position: absolute; max-width: none; width: 160%; height: 160%;
  left: -30%; top: -6%; display: block;
}
.ntc-face.sm { width: 40px; height: 40px; }

.ntc-panel {
  position: fixed; right: 20px; bottom: 20px; z-index: 95;
  width: min(400px, calc(100vw - 40px));
  height: min(640px, calc(100vh - var(--nav-h, 68px) - 40px));
  height: min(640px, calc(100dvh - var(--nav-h, 68px) - 40px));
  display: flex; flex-direction: column; overflow: hidden;
  background: var(--bg-elev, #131318); color: var(--text, #f4f1ea);
  border: 1px solid var(--border-strong, rgba(212,175,106,0.32)); border-radius: 18px;
  box-shadow: 0 24px 70px rgba(0,0,0,.6);
  font-family: 'Noto Sans JP', sans-serif;
}
.ntc-panel[hidden] { display: none; }

.ntc-head {
  flex-shrink: 0; display: flex; align-items: center; gap: 12px;
  padding: 14px 14px 12px 16px;
  background: linear-gradient(180deg, rgba(212,175,106,.10), rgba(212,175,106,0));
  border-bottom: 1px solid var(--border, rgba(255,255,255,0.09));
}
.ntc-head-text { flex: 1; min-width: 0; }
.ntc-title { margin: 0; font-size: .95rem; font-weight: 800; color: var(--text, #f4f1ea); }
.ntc-sub { margin: 2px 0 0; font-size: .72rem; color: var(--text-sub, #b3ada3); }
.ntc-icon-btn {
  flex-shrink: 0; width: 34px; height: 34px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: transparent; border: 1px solid transparent; color: var(--text-sub, #b3ada3);
  cursor: pointer; font-size: 1.05rem; line-height: 1; transition: background .2s, color .2s;
}
.ntc-icon-btn:hover { background: rgba(255,255,255,.07); color: var(--gold-bright, #ecd49a); }
.ntc-icon-btn svg { width: 18px; height: 18px; }

/* タブ（今は「文字で」1つだけなので非表示。2つ以上になったら自動で表示） */
.ntc-tabs { flex-shrink: 0; display: flex; gap: 4px; padding: 8px 12px 0; border-bottom: 1px solid var(--border, rgba(255,255,255,0.09)); }
.ntc-tabs[hidden] { display: none; }
.ntc-tab {
  padding: 8px 14px; border: none; border-radius: 10px 10px 0 0; cursor: pointer;
  background: transparent; color: var(--text-sub, #b3ada3); font: 700 .78rem 'Noto Sans JP', sans-serif;
}
.ntc-tab[aria-selected="true"] { background: var(--gold-soft, rgba(212,175,106,0.10)); color: var(--gold-bright, #ecd49a); }

.ntc-pane { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.ntc-pane[hidden] { display: none; }

.ntc-log {
  flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain;
  padding: 16px 14px 8px; display: flex; flex-direction: column; gap: 10px;
}
.ntc-msg {
  max-width: 88%; padding: 10px 13px; border-radius: 14px;
  font-size: .86rem; line-height: 1.75; white-space: pre-wrap; overflow-wrap: anywhere; word-break: break-word;
}
.ntc-msg.bot { align-self: flex-start; background: rgba(255,255,255,.05); border: 1px solid var(--border, rgba(255,255,255,0.09)); border-top-left-radius: 4px; }
.ntc-msg.user { align-self: flex-end; background: var(--gold-soft, rgba(212,175,106,0.10)); border: 1px solid var(--border-strong, rgba(212,175,106,0.32)); border-top-right-radius: 4px; }
.ntc-msg.note { align-self: center; max-width: 96%; background: rgba(236,212,154,.07); border: 1px dashed rgba(212,175,106,.4); color: var(--gold-bright, #ecd49a); font-size: .8rem; }
.ntc-info { align-self: center; font-size: .7rem; color: var(--text-muted, #7c766c); padding: 2px 10px; border-top: 1px solid var(--border, rgba(255,255,255,0.09)); }
.ntc-msg a { color: var(--gold-bright, #ecd49a); text-decoration: underline; text-underline-offset: 2px; }
.ntc-thinking { align-self: flex-start; font-size: .8rem; color: var(--text-sub, #b3ada3); padding: 4px 2px; }
.ntc-thinking::before { content: ''; display: inline-block; width: 8px; height: 8px; margin-right: 8px; border-radius: 50%; background: var(--gold, #d4af6a); animation: ntc-pulse 1s ease-in-out infinite; vertical-align: middle; }
@keyframes ntc-pulse { 0%,100% { opacity: .25; } 50% { opacity: 1; } }

.ntc-suggest { display: flex; flex-wrap: wrap; gap: 8px; padding: 2px 14px 10px; }
.ntc-suggest[hidden] { display: none; }
.ntc-chip {
  padding: 7px 12px; border-radius: 100px; cursor: pointer;
  background: transparent; color: var(--gold-bright, #ecd49a);
  border: 1px solid var(--border-strong, rgba(212,175,106,0.32));
  font: 500 .76rem 'Noto Sans JP', sans-serif; transition: background .2s;
}
.ntc-chip:hover { background: var(--gold-soft, rgba(212,175,106,0.10)); }
.ntc-chip:disabled { opacity: .5; cursor: default; }

.ntc-form { flex-shrink: 0; display: flex; gap: 8px; align-items: flex-end; padding: 10px 12px; border-top: 1px solid var(--border, rgba(255,255,255,0.09)); }
.ntc-input {
  flex: 1; min-width: 0; resize: none; max-height: 120px;
  padding: 10px 12px; border-radius: 12px;
  background: var(--bg, #0a0a0c); color: var(--text, #f4f1ea);
  border: 1px solid var(--border, rgba(255,255,255,0.09));
  font: 400 16px/1.5 'Noto Sans JP', sans-serif; /* 16px未満だと iPhone でズームされる */
}
.ntc-input::placeholder { color: var(--text-muted, #7c766c); }
.ntc-send {
  flex-shrink: 0; height: 44px; padding: 0 16px; border-radius: 12px; border: none; cursor: pointer;
  background: var(--grad-gold, linear-gradient(120deg, #b8893f 0%, #ecd49a 45%, #d4af6a 100%)); color: #1a1206;
  font: 800 .84rem 'Noto Sans JP', sans-serif;
}
.ntc-send:disabled { opacity: .45; cursor: default; }
.ntc-count { flex-shrink: 0; padding: 0 14px; margin-top: -4px; font-size: .68rem; color: var(--text-muted, #7c766c); text-align: right; }

.ntc-foot { flex-shrink: 0; padding: 10px 12px 12px; border-top: 1px solid var(--border, rgba(255,255,255,0.09)); background: rgba(0,0,0,.18); }
.ntc-handoff { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.ntc-handoff a {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 6px; border-radius: 10px; text-decoration: none; text-align: center;
  font: 700 .78rem 'Noto Sans JP', sans-serif;
}
.ntc-handoff .line { background: #06c755; color: #fff; }
.ntc-handoff .form { background: transparent; color: var(--gold-bright, #ecd49a); border: 1px solid var(--border-strong, rgba(212,175,106,0.32)); }
.ntc-note { margin: 8px 0 0; font-size: .66rem; line-height: 1.6; color: var(--text-muted, #7c766c); }

/* スマホ: 下から出る、ほぼ全面のシート */
@media (max-width: 600px) {
  .ntc-launcher { right: 14px; bottom: 14px; padding-right: 14px; font-size: .8rem; }
  .ntc-face { width: 40px; height: 40px; }
  .ntc-panel {
    left: 0; right: 0; bottom: 0; width: 100%;
    height: calc(100vh - var(--nav-h, 68px) - 8px); height: calc(100dvh - var(--nav-h, 68px) - 8px);
    border-radius: 18px 18px 0 0; border-left: none; border-right: none; border-bottom: none;
  }
  .ntc-foot { padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px)); }
}

@media (prefers-reduced-motion: reduce) {
  .ntc-thinking::before { animation: none; opacity: 1; }
}

.ntc-errcode { margin-left: 4px; font-size: .68rem; opacity: .75; }
