/* LINE Gateway (โหมด Line) — badge, popup เชื่อมต่อ, popup ตั้งค่าแชท */

.receive-mode-select {
  padding: 3px 8px;
  font-size: 0.8rem;
  border: 1px solid var(--color-border, #e5e7eb);
  border-radius: 6px;
  background: #fff;
  color: var(--color-gray-800, #1f2937);
  font-family: inherit;
}
.receive-mode-select:disabled { opacity: 0.6; }

.line-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 10px 2px 6px;
  border: 0;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 500;
  font-family: inherit;
  color: #fff;
  cursor: pointer;
}
.line-badge img { width: 14px; height: 14px; border-radius: 50%; background: #fff; object-fit: cover; }
.line-badge.is-connected { background: #06c755; }
.line-badge.is-disconnected { background: #9aa5b1; }
.line-badge:hover { filter: brightness(0.94); }

.line-settings-btn {
  padding: 3px 8px;
  font-size: 0.75rem;
  background: var(--color-gray-100, #f3f4f6);
  border: 1px solid var(--color-border, #e5e7eb);
  border-radius: 6px;
  cursor: pointer;
  font-family: inherit;
}

.line-modal { max-width: 400px; width: 92vw; }
.line-modal-wide { max-width: 560px; }
.line-modal-body { text-align: center; }
.line-muted { color: var(--color-gray-500, #6b7280); font-size: 0.82rem; }
.line-warn { color: #b45309; font-size: 0.8rem; margin: 6px 0; }
.line-error { color: #dc2626; font-size: 0.85rem; margin: 8px 0; }
.line-ok { font-size: 1.05rem; font-weight: 600; color: #06a847; }
.line-name { margin: 6px 0 14px; font-weight: 500; }
.line-actions { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }

.line-qr { width: 240px; height: 240px; display: block; margin: 10px auto; }
.line-qr-url { word-break: break-all; font-size: 0.7rem; display: block; margin: 10px 0; }

.line-pin { display: flex; gap: 8px; justify-content: center; margin: 14px 0 6px; }
.line-pin span {
  width: 40px;
  height: 50px;
  line-height: 46px;
  border: 2px solid #06c755;
  border-radius: 8px;
  font-size: 1.7rem;
  font-weight: 700;
}
.line-pin.is-expired span { border-color: #c4c9d0; color: #c4c9d0; }

.line-refresh-btn { margin-top: 6px; }
.line-spin { display: inline-block; }
.line-spin.is-spinning { animation: line-rot 0.8s linear infinite; }
@keyframes line-rot { to { transform: rotate(360deg); } }

.line-chat-tools, .line-chat-add { display: flex; gap: 8px; margin: 8px 0; }
.line-chat-tools input, .line-chat-add input, .line-audit-fields input {
  flex: 1;
  padding: 6px 10px;
  border: 1px solid var(--color-border, #e5e7eb);
  border-radius: 6px;
  font-family: inherit;
  font-size: 0.85rem;
}
.line-chat-list {
  max-height: 260px;
  overflow: auto;
  border: 1px solid var(--color-border, #e5e7eb);
  border-radius: 8px;
  padding: 4px 8px;
}
.line-chat-row { display: flex; align-items: center; gap: 8px; padding: 6px 2px; border-bottom: 1px solid #f1f3f5; cursor: pointer; font-size: 0.85rem; }
.line-chat-row:last-child { border-bottom: 0; }
.line-chat-name { flex: 1; word-break: break-word; }
.line-chat-id { color: var(--color-gray-400, #9ca3af); font-size: 0.7rem; font-family: monospace; }
.line-tag { background: #e5e7eb; border-radius: 8px; padding: 0 6px; font-size: 0.7rem; }
.line-tag-recent { background: #d1fae5; }
.line-hr { border: 0; border-top: 1px solid var(--color-border, #e5e7eb); margin: 14px 0; }
.line-small { font-size: 0.75rem; margin-top: 10px; }
.line-samples-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.line-samples-tools { display: flex; gap: 6px; }
.line-samples-tools .btn { padding: 3px 10px; font-size: 0.78rem; }
.line-sample-list { max-height: 300px; overflow: auto; border: 1px solid var(--color-border, #e5e7eb); border-radius: 8px; padding: 6px 10px; }
.line-sample { padding: 8px 0; border-bottom: 1px solid #f1f3f5; }
.line-sample:last-child { border-bottom: 0; }
.line-sample-meta { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; font-size: 0.72rem; color: var(--color-gray-500, #6b7280); }
.line-sample-text { margin: 6px 0; white-space: pre-wrap; word-break: break-word; font-family: inherit; font-size: 0.85rem; }
.line-sample-raw { background: #0f172a; color: #d1fae5; padding: 8px; border-radius: 6px; overflow: auto; font-size: 0.72rem; max-height: 220px; }
.line-audit-toggle { display: flex; align-items: center; gap: 8px; font-size: 0.88rem; font-weight: 500; }
.line-audit-fields { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.line-audit-fields p { flex-basis: 100%; margin: 0; }
