/* ===== 入力ボックス（モダン Gemini 風） ===== */
.input-box {
  background: var(--input-bg);
  border: 1.5px solid var(--stroke);
  border-radius: 24px;
  transition: border-color .3s, box-shadow .3s;
  position: relative;
  box-shadow: 0 2px 12px rgba(0,0,0,.06), 0 0 0 0 transparent;
  overflow: hidden;
}
body[data-theme="dark"] .input-box {
  box-shadow: 0 2px 20px rgba(0,0,0,.25), inset 0 1px 0 rgba(255,255,255,.04);
}
.input-box:hover {
  border-color: color-mix(in srgb, var(--pri) 35%, var(--stroke));
  box-shadow: 0 4px 24px rgba(0,0,0,.08);
}
body[data-theme="dark"] .input-box:hover {
  box-shadow: 0 4px 30px rgba(0,0,0,.35), inset 0 1px 0 rgba(255,255,255,.05);
}
.input-box:focus-within {
  border-color: var(--pri);
  box-shadow: 0 0 0 3px var(--input-ring), 0 4px 24px rgba(59,122,237,.10);
}
body[data-theme="dark"] .input-box:focus-within {
  box-shadow: 0 0 0 3px var(--input-ring), 0 4px 32px rgba(59,122,237,.15), inset 0 1px 0 rgba(255,255,255,.05);
}
/* ファイルをドラッグして重ねている状態（`_wireFileDropzone` が付け外しする）。
   **枠と面の両方を変える。** 枠だけだと hover / focus-within と見分けが付かない
   （どちらも枠が青くなる）。 */
.input-box.is-drop-target {
  border-color: var(--pri);
  border-style: dashed;
  background: color-mix(in srgb, var(--pri) 6%, var(--input-bg));
  box-shadow: 0 0 0 3px var(--input-ring);
}
.src-upload-zone.is-drop-target {
  border-color: var(--pri);
  background: color-mix(in srgb, var(--pri) 8%, transparent);
  color: var(--text-secondary);
}

.input-box textarea {
  width: 100%;
  background: transparent;
  border: none;
  outline: none;
  resize: none;
  color: var(--text);
  font-size: 15px;
  line-height: 1.6;
  padding: 18px 22px 6px;
  min-height: 44px;
  max-height: 50vh;
  overflow-y: auto;
  transition: height .1s ease;
  -webkit-appearance: none;
  appearance: none;
  border-radius: 0;
}
.input-box textarea::placeholder {
  color: var(--text-muted);
  font-size: 14px;
}

/* 入力ボックス下部ツールバー */
/* 折り返しを許す。添付・原文の「済み」表示で左のボタンが広がると、
   送信ボタンが枠（overflow: hidden）の外へはみ出して切れる。 */
.input-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  row-gap: 6px;
  padding: 6px 14px 10px 10px;
  border-top: 1px solid color-mix(in srgb, var(--stroke) 50%, transparent);
  margin: 0 8px;
  container-type: inline-size;
}
.tool-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 8px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 500;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: background .15s, color .15s;
  white-space: nowrap;
  flex-shrink: 0;
}
/* 原稿の読み込み中。押せば理由が出るので、見た目だけ弱める（`_renderScriptBusy`）。 */
.tool-btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; }
.tool-btn:hover {
  background: var(--chip-bg-hover);
  color: var(--text-secondary);
}
.tool-btn svg { width: 16px; height: 16px; flex-shrink: 0; }

.tool-btn-active {
  background: var(--chip-bg);
  color: var(--text-secondary);
}

/* 原文との照合・原稿添付: セット済みの状態 */
.tool-btn.has-source,
.tool-btn.has-file {
  background: linear-gradient(135deg, rgba(59,122,237,.12), rgba(107,79,221,.06));
  border: 1px solid rgba(59,122,237,.3);
  color: var(--text);
  font-weight: 600;
  position: relative;
}
.tool-btn.has-source:hover,
.tool-btn.has-file:hover {
  background: linear-gradient(135deg, rgba(59,122,237,.18), rgba(107,79,221,.09));
  border-color: rgba(59,122,237,.4);
}
.tool-btn.has-source::after,
.tool-btn.has-file::after {
  content: '✓';
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--pri);
  color: white;
  font-size: 9px;
  font-weight: 700;
  margin-left: 2px;
}

/* アイコンのみボタン */
.tool-btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px; height: 34px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: background .2s, color .2s, transform .15s;
}
.tool-btn-icon:hover {
  background: var(--chip-bg-hover);
  color: var(--text-secondary);
  transform: scale(1.08);
}
.tool-btn-icon:active { transform: scale(.94); }
.tool-btn-icon.active-indicator { color: var(--pri); }
.tool-btn-icon svg { width: 17px; height: 17px; }

/* モード選択: 未選択時のアイコンボタン */
.mode-trigger-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px; height: 32px;
  border-radius: 10px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: background .15s, color .15s;
}
.mode-trigger-icon:hover { background: var(--chip-bg-hover); color: var(--text-secondary); }
.mode-trigger-icon svg { width: 16px; height: 16px; }

/* モード選択: 選択時のピル */
.mode-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 6px 4px 10px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 600;
  background: var(--chip-bg);
  border: 1px solid var(--stroke);
  color: var(--text-secondary);
  cursor: default;
  animation: fadeIn .15s;
}
@keyframes fadeIn { from { opacity: 0; transform: scale(.95); } to { opacity: 1; transform: scale(1); } }
.mode-pill-icon { display: inline-flex; align-items: center; color: var(--pri); }
.mode-pill-icon svg { width: 14px; height: 14px; }
.mode-pill-dismiss {
  width: 20px; height: 20px;
  border-radius: 6px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  transition: background .12s, color .12s;
}
.mode-pill-dismiss:hover { background: var(--chip-bg-hover); color: var(--text); }

/* モード選択項目 */
.dropdown-mode-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 14px;
  border: none;
  background: transparent;
  cursor: pointer;
  text-align: left;
  transition: background .1s;
  color: var(--text-secondary);
}
.dropdown-mode-item:hover { background: var(--chip-bg); }
.mode-item-icon { display: flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 8px; flex-shrink: 0; }
.mode-item-content { flex: 1; min-width: 0; }
.mode-item-title { font-size: 13px; font-weight: 600; color: var(--text); }
.mode-item-desc { font-size: 11px; color: var(--text-muted); margin-top: 1px; }
.mode-check { font-size: 14px; color: var(--pri); opacity: 0; flex-shrink: 0; }
.dropdown-mode-item.active .mode-check { opacity: 1; }
.dropdown-menu-right { left: auto; right: 0; }

/* 2つの送信ボタンは折り返さない（片方だけ下の段に落ちる）。幅が足りないときは
   `.input-toolbar` の折り返しでグループごと下の段へ送る。 */
.send-group {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  margin-left: auto;
}

/* 送信ボタン */
.send-btn {
  height: 38px;
  padding: 0 14px;
  border-radius: 19px;
  border: none;
  background: linear-gradient(135deg, var(--pri), var(--pri2));
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  cursor: pointer;
  transition: all .2s ease;
  box-shadow: 0 4px 16px rgba(79,140,255,.25);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  letter-spacing: .02em;
}
.send-btn:hover {
  box-shadow: 0 6px 24px rgba(79,140,255,.35);
  transform: translateY(-1px);
}
.send-btn:active { transform: translateY(0) scale(.97); }
.send-btn svg { width: 15px; height: 15px; flex-shrink: 0; transition: transform .2s; }
.send-btn:hover svg { transform: translateX(2px); }
.send-btn:disabled {
  opacity: .35;
  cursor: default;
  box-shadow: none;
  background: var(--chip-bg-hover);
  color: var(--text-muted);
}
.send-btn:disabled:hover { opacity: .35; transform: none; box-shadow: none; }
.send-btn:disabled:hover svg { transform: none; }
.send-btn:disabled:active { transform: none; }

/* 非活性（入力モード不一致）のスタイル — 見た目のみ薄くし、クリックは可能 */
.send-btn.inactive {
  opacity: .35;
  box-shadow: none;
  background: var(--chip-bg-hover);
  color: var(--text-muted);
}
.send-btn.inactive svg { display: none; }

/* キーボードヒント */
.send-hint {
  font-size: 11px;
  font-family: inherit;
  color: var(--text-muted);
  opacity: 0;
  transition: opacity .2s;
  pointer-events: none;
  white-space: nowrap;
}
.input-box:focus-within .send-hint { opacity: .6; }
/* 入力枠が最大幅より狭いときは消す（判定はツールバーの内容幅。最大幅で 638px）。
   透明でも幅は取るので、残すと送信ボタンが枠（overflow: hidden）の外へ押し出されて切れる。 */
@container (max-width: 629px) {
  .send-hint { display: none; }
}
/* ボタン2つ分の幅も無いときだけ縦に積む（横に並べたままだと片方が切れる）。 */
@container (max-width: 229px) {
  .send-group { flex-wrap: wrap; }
}

/* オプション折りたたみ */
.options-accordion {
  margin-top: 8px;
  border-radius: 12px;
  border: 1px solid var(--stroke);
  background: var(--panel);
  overflow: hidden;
  transition: margin .2s;
}
.options-accordion-header {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  user-select: none;
  transition: color .12s;
}
.options-accordion-header:hover { color: var(--text-secondary); }
.options-accordion-header svg {
  width: 12px; height: 12px;
  transition: transform .2s ease;
  flex-shrink: 0;
}
.options-accordion.open .options-accordion-header svg { transform: rotate(180deg); }
.options-accordion-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height .25s ease;
}
.options-accordion.open .options-accordion-body { max-height: 400px; }
.options-accordion-body-inner {
  padding: 0 10px 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.opt-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 500;
  border: 1px solid var(--stroke);
  background: var(--chip-bg);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all .12s;
  user-select: none;
}
.opt-chip:hover { border-color: rgba(79,140,255,.30); }
.opt-chip.active {
  border-color: var(--pri);
  background: rgba(79,140,255,.10);
  color: var(--text);
}
.opt-chip .opt-check {
  width: 14px; height: 14px;
  border-radius: 4px;
  border: 1.5px solid var(--stroke);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  transition: all .12s;
  flex-shrink: 0;
}
.opt-chip.active .opt-check {
  background: var(--pri);
  border-color: var(--pri);
  color: #fff;
}

/* 添付ファイル表示 */
.attachment-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px 5px 10px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 500;
  background: var(--chip-bg);
  color: var(--text-secondary);
  border: 1px solid var(--stroke);
}
.attachment-pill .remove-btn {
  width: 16px; height: 16px;
  border-radius: 50%;
  border: none;
  background: var(--chip-bg-hover);
  color: var(--text-muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  line-height: 1;
  transition: background .12s;
}
.attachment-pill .remove-btn:hover { background: rgba(224,64,96,.15); color: var(--danger); }

/* クイックアクションカード */
.quick-card {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid var(--stroke);
  background: var(--panel);
  backdrop-filter: blur(8px);
  cursor: pointer;
  transition: background .15s, border-color .15s;
  min-width: 0;
  position: relative;
  z-index: 1;
}
.quick-card:hover {
  background: var(--card-hover);
  border-color: rgba(79,140,255,.30);
  z-index: 10;
}
.quick-card-icon {
  width: 24px; height: 24px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.quick-card-icon svg { width: 13px; height: 13px; }
.quick-card h4 { font-size: 11px; font-weight: 600; color: var(--text); margin: 0; }
.quick-card p  { font-size: 10.5px; color: var(--text-muted); margin: 0; margin-top: 2px; line-height: 1.4; }

/* インライン確認バー */
.inline-confirm {
  margin-top: 10px;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--panel);
  border: 1px solid var(--stroke);
  backdrop-filter: blur(8px);
  animation: confirmSlide .25s cubic-bezier(.22,1,.36,1);
}
@keyframes confirmSlide {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}
.inline-confirm-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.inline-confirm-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  line-height: 1.4;
}
.inline-confirm-dismiss {
  width: 24px; height: 24px;
  border-radius: 6px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background .12s, color .12s;
}
.inline-confirm-dismiss:hover { background: var(--chip-bg-hover); color: var(--text); }
.inline-confirm-dismiss svg { width: 14px; height: 14px; }
.inline-confirm-actions {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}
.inline-confirm-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 9px;
  border: 1px solid var(--stroke);
  background: var(--chip-bg);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all .15s;
}
.inline-confirm-btn:hover {
  border-color: var(--pri);
  background: rgba(59,122,237,.08);
  color: var(--text);
  transform: translateY(-1px);
}
.inline-confirm-btn .icb-icon {
  width: 24px; height: 24px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.inline-confirm-btn .icb-icon svg { width: 13px; height: 13px; }
.inline-confirm-btn .icb-text { min-width: 0; }
.inline-confirm-btn .icb-title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.inline-confirm-btn .icb-desc {
  font-size: 10px;
  font-weight: 400;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.inline-confirm-btn.selected {
  border-color: var(--pri);
  background: rgba(59,122,237,.10);
  color: var(--text);
  box-shadow: 0 0 0 2px rgba(59,122,237,.15);
}
.inline-confirm-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.inline-confirm-row .inline-confirm-actions { flex: 1; min-width: 0; }
.ic-send-btn {
  flex-shrink: 0;
  animation: fadeIn .15s;
}

/* ナビ */
.nav-btn {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 10px 12px; border-radius: 12px; font-size: 14px;
  border: 1px solid transparent; background: transparent;
  color: var(--text-muted); cursor: pointer; opacity: .7;
  transition: all .18s;
}
.nav-btn:hover { background: var(--chip-bg); opacity: .85; }
.nav-btn.active {
  opacity: 1;
  color: var(--text);
}
body[data-theme="light"] .nav-btn.active {
  background: linear-gradient(90deg, rgba(59,122,237,.18), rgba(107,79,221,.10));
  border-color: rgba(59,122,237,.35);
}
body[data-theme="dark"] .nav-btn.active {
  background: linear-gradient(90deg, rgba(79,140,255,.28), rgba(122,92,255,.18));
  border-color: rgba(79,140,255,.45);
  box-shadow: 0 10px 26px rgba(79,140,255,.18);
}
.nav-icon { width: 18px; height: 18px; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; color: var(--text-secondary); }
.nav-icon svg { width: 18px; height: 18px; }

