/* LINE統合管理 共通スタイル(スマホ優先レスポンシブ) */
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Noto Sans JP", sans-serif;
  background: #f0f2f5;
  color: #222;
  font-size: 15px;
}
a { color: #06c755; text-decoration: none; }
button { font: inherit; cursor: pointer; }

/* ヘッダー */
.topbar {
  display: flex; align-items: center; gap: 12px;
  background: #06c755; color: #fff;
  padding: 10px 14px; flex-wrap: wrap;
}
.topbar a { color: #fff; }
.brand { font-weight: 700; font-size: 16px; }
.nav { display: flex; gap: 14px; flex: 1; }
.me { display: flex; gap: 10px; align-items: center; font-size: 13px; }
.me-name { opacity: .9; }
.push-toggle {
  background: rgba(255,255,255,.18); border: none; border-radius: 8px;
  padding: 4px 8px; font-size: 15px; opacity: .75;
}
.push-toggle.on { opacity: 1; background: rgba(255,255,255,.32); }

.container { max-width: 900px; margin: 0 auto; padding: 12px; }

/* カード・バッジ */
.badges { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.badge-card {
  background: #fff; border-radius: 10px; padding: 8px 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,.08); font-size: 13px;
}
.badge-card b { color: #e53935; font-size: 16px; margin-left: 4px; }

/* フィルタ */
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.filters select {
  padding: 6px 8px; border: 1px solid #ccc; border-radius: 8px; background: #fff;
}

/* スレッド一覧 */
.thread-list { list-style: none; margin: 0; padding: 0; }
.thread-item {
  background: #fff; border-radius: 10px; margin-bottom: 8px;
  box-shadow: 0 1px 3px rgba(0,0,0,.08);
}
.thread-item a { display: flex; gap: 10px; padding: 10px 12px; color: inherit; align-items: center; }
.avatar {
  width: 44px; height: 44px; border-radius: 50%; background: #ddd;
  object-fit: cover; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; font-size: 20px;
}
.thread-main { flex: 1; min-width: 0; }
.thread-top { display: flex; gap: 6px; align-items: center; }
.thread-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.thread-preview { color: #777; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 2px; }
.thread-side { text-align: right; flex-shrink: 0; font-size: 12px; color: #999; }
.unread {
  display: inline-block; min-width: 20px; text-align: center;
  background: #e53935; color: #fff; border-radius: 10px;
  font-size: 12px; padding: 1px 6px; margin-top: 4px;
}

/* チップ */
.chip { display: inline-block; font-size: 11px; border-radius: 4px; padding: 1px 6px; color: #fff; }
.chip-account { background: #607d8b; }
.chip-unhandled { background: #e53935; }
.chip-in_progress { background: #fb8c00; }
.chip-done { background: #9e9e9e; }
.chip-blocked { background: #333; }

/* トーク画面 */
.chat-header {
  background: #fff; border-radius: 10px; padding: 10px 12px; margin-bottom: 10px;
  box-shadow: 0 1px 3px rgba(0,0,0,.08);
}
.chat-header .row1 { display: flex; align-items: center; gap: 10px; }
.chat-controls { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; align-items: center; }
.chat-controls select, .chat-controls button {
  padding: 6px 10px; border: 1px solid #ccc; border-radius: 8px; background: #fff; font-size: 13px;
}
.btn-status.active { background: #06c755; color: #fff; border-color: #06c755; }

.chat-log { padding: 4px 0; }
.msg { display: flex; margin: 6px 0; }
.msg.in { justify-content: flex-start; }
.msg.out { justify-content: flex-end; }
.bubble {
  max-width: 75%; padding: 8px 12px; border-radius: 16px;
  white-space: pre-wrap; word-break: break-word; font-size: 14px; line-height: 1.5;
}
.msg.in .bubble { background: #fff; border-top-left-radius: 4px; box-shadow: 0 1px 2px rgba(0,0,0,.1); }
.msg.out .bubble { background: #8de055; border-top-right-radius: 4px; }
.msg-meta { font-size: 10px; color: #999; align-self: flex-end; margin: 0 6px; flex-shrink: 0; }
.bubble img { max-width: 100%; border-radius: 8px; display: block; }
.bubble .sticker { width: 120px; }

/* 返信フォーム */
.reply-box {
  position: sticky; bottom: 0; background: #f0f2f5; padding: 8px 0 12px;
}
.reply-inner {
  background: #fff; border-radius: 12px; padding: 10px;
  box-shadow: 0 1px 4px rgba(0,0,0,.12);
}
.canned-row { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
.canned-row button {
  font-size: 12px; padding: 3px 8px; border: 1px solid #06c755; color: #06c755;
  background: #fff; border-radius: 12px;
}
.reply-form { display: flex; gap: 8px; align-items: flex-end; }
.reply-form textarea {
  flex: 1; border: 1px solid #ccc; border-radius: 8px; padding: 8px;
  font: inherit; resize: vertical; min-height: 44px; max-height: 160px;
}
.btn-send {
  background: #06c755; color: #fff; border: none; border-radius: 8px;
  padding: 10px 18px; font-weight: 600;
}
.btn-send:disabled { opacity: .5; }
.send-result { font-size: 13px; margin-top: 6px; }
.send-result.ok { color: #2e7d32; }
.send-result.ng { color: #c62828; }

/* メモ */
.memo-box textarea { width: 100%; min-height: 60px; border: 1px solid #ccc; border-radius: 8px; padding: 8px; font: inherit; }

/* フォーム全般・ログイン */
.card {
  background: #fff; border-radius: 10px; padding: 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,.08); margin-bottom: 12px;
}
.login-wrap { max-width: 360px; margin: 60px auto; }
.login-wrap h1 { text-align: center; color: #06c755; font-size: 20px; }
.field { margin-bottom: 12px; }
.field label { display: block; font-size: 13px; color: #555; margin-bottom: 4px; }
.field input[type=text], .field input[type=password], .field input[type=number],
.field select, .field textarea {
  width: 100%; padding: 9px; border: 1px solid #ccc; border-radius: 8px; font: inherit;
}
.btn-primary {
  background: #06c755; color: #fff; border: none; border-radius: 8px;
  padding: 10px 18px; font-weight: 600; width: 100%;
}
.btn-small { padding: 5px 12px; width: auto; font-size: 13px; }
.btn-danger { background: #e53935; }
.alert { background: #fdecea; color: #c62828; border-radius: 8px; padding: 10px 12px; margin-bottom: 12px; font-size: 14px; }
.notice { background: #e8f5e9; color: #2e7d32; border-radius: 8px; padding: 10px 12px; margin-bottom: 12px; font-size: 14px; }

/* テーブル(設定画面) */
.table-wrap { overflow-x: auto; }
table.list { width: 100%; border-collapse: collapse; background: #fff; border-radius: 10px; }
table.list th, table.list td { padding: 8px 10px; border-bottom: 1px solid #eee; text-align: left; font-size: 13px; }
table.list th { background: #fafafa; color: #666; }
details.editor { margin-bottom: 10px; }
details.editor summary { cursor: pointer; padding: 6px 0; color: #06c755; font-weight: 600; }

@media (max-width: 600px) {
  .bubble { max-width: 85%; }
  .nav { gap: 10px; font-size: 14px; }
}
