.panel {
  background: rgba(255,255,255,0.94); border: 1px solid var(--border);
  border-radius: var(--radius-xl); padding: 22px; box-shadow: var(--shadow-md); margin-bottom: 24px;
}
.panel-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 18px; }
.panel-title { margin: 0; font-size: 18px; font-weight: 900; letter-spacing: -0.03em; }
.panel-desc { margin: 6px 0 0; color: var(--text-muted); font-size: 13px; line-height: 1.6; }

.badge { display: inline-flex; align-items: center; height: 24px; padding: 0 9px; border-radius: 999px; font-size: 12px; font-weight: 800; white-space: nowrap; margin-left: 6px; }
.badge-green { background: var(--green-soft); color: var(--green); }
.badge-blue { background: var(--blue-soft); color: var(--blue); }
.badge-purple { background: var(--purple-soft); color: var(--purple); }
.badge-red { background: var(--red-soft); color: var(--red); }
.badge-yellow { background: var(--yellow-soft); color: var(--yellow); }

.primary-btn, .ghost-btn, .mini-btn, .danger-btn {
  border-radius: 999px; font-weight: 800; white-space: nowrap; transition: 0.2s;
}
.primary-btn { height: 42px; border: none; background: var(--primary); color: #fff; padding: 0 18px; box-shadow: 0 10px 22px rgba(234,122,0,0.25); font-size: 14px; }
.primary-btn:hover { background: var(--primary-dark); transform: translateY(-1px); }
.primary-btn:active { transform: translateY(0); }
.ghost-btn { height: 42px; border: 1px solid var(--border); background: #fff; padding: 0 16px; color: var(--text-main); font-size: 14px; }
.ghost-btn:hover { transform: translateY(-1px); box-shadow: var(--shadow-md); }
.mini-btn { border: 1px solid var(--border); background: #fff; height: 34px; padding: 0 12px; border-radius: var(--radius-sm); font-size: 13px; font-weight: 800; color: var(--text-sub); }
.mini-btn:hover { background: var(--primary); color: #fff; border-color: var(--primary); }
.mini-btn.primary-soft { background: var(--primary-soft); color: var(--primary); border-color: rgba(234,122,0,0.2); }
.mini-btn.primary-soft:hover { background: var(--primary-soft-hover); border-color: rgba(234,122,0,0.35); }
.danger-btn { border: 1px solid #fecaca; background: #fff; color: var(--red); height: 38px; padding: 0 13px; }
.danger-btn:hover { background: var(--red); color: #fff; border-color: var(--red); }

.form-grid { display: grid; gap: 18px; }
.form-group label { display: block; font-weight: 800; margin-bottom: 8px; font-size: 14px; }
.form-group input, .form-group textarea, .form-group select {
  width: 100%; border: 1px solid var(--border); border-radius: var(--radius-md);
  padding: 0 14px; min-height: 46px; outline: none; font-size: 14px; background: #fff; transition: 0.2s; color: var(--text-main);
}
.form-group textarea { padding-top: 12px; resize: vertical; min-height: 108px; }
.form-group input::placeholder, .form-group textarea::placeholder { color: var(--text-muted); }
.form-group input:focus, .form-group textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-ring); }
.form-group.grow { flex: 1; }
.form-row { display: flex; gap: 12px; align-items: flex-end; }
.form-actions { display: flex; gap: 12px; }

.advanced { border: 1px dashed #f0b066; background: #fffaf4; border-radius: 16px; padding: 16px; margin: 0; }
.advanced summary { padding: 10px 0; font-size: 14px; font-weight: 800; color: var(--text-sub); cursor: pointer; user-select: none; }
.advanced summary:hover { color: var(--text-main); }

.empty-state { text-align: center; color: var(--text-muted); padding: 48px 24px; font-size: 14px; }
.empty-state-icon { width: 72px; height: 72px; margin: 0 auto 16px; opacity: 0.25; color: var(--text-muted); }

.hidden { display: none !important; }
.result-area.hidden { display: none; }
.url-box { display: flex; gap: 0; margin: 16px 0 20px; }
.url-box input { flex: 1; padding: 11px 16px; border: 1px solid var(--border); border-radius: var(--radius-md) 0 0 var(--radius-md); font-size: 14px; font-family: ui-monospace, SFMono-Regular, monospace; background: var(--surface-dim); color: var(--text-main); }
.actions { display: flex; gap: 10px; flex-wrap: wrap; }

.modal { position: fixed; inset: 0; z-index: 200; display: flex; align-items: center; justify-content: center; padding: 24px; }
.modal.hidden { display: none; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(15,23,42,0.5); backdrop-filter: blur(6px); }
.modal-content { position: relative; background: #fff; border-radius: var(--radius-xl); box-shadow: var(--shadow-lg); width: 100%; max-width: 740px; max-height: 85vh; display: flex; flex-direction: column; overflow: hidden; }
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 20px 28px; border-bottom: 1px solid var(--border); }
.modal-header h3 { font-size: 18px; font-weight: 900; }
.modal-close { background: var(--surface-dim); border: none; font-size: 1.3rem; color: var(--text-sub); cursor: pointer; width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; border-radius: var(--radius-sm); transition: 0.15s; }
.modal-close:hover { color: var(--text-main); background: var(--border); }
.modal-body { flex: 1; overflow: hidden; }

.toast { position: fixed; right: 26px; top: 24px; z-index: 300; background: #fff; border: 1px solid #bbf7d0; color: #166534; border-radius: var(--radius-md); padding: 12px 16px; font-weight: 800; box-shadow: var(--shadow-lg); display: none; }
.toast.show { display: block; animation: fadeUp 0.2s ease; }
.toast.error { border-color: #fecaca; color: var(--red-text); }

.config-layout { display: flex; height: 100%; min-height: 420px; }
.config-channels { width: 200px; border-right: 1px solid var(--border); padding: 14px; overflow-y: auto; background: var(--surface-dim); }
.channel-list { display: flex; flex-direction: column; gap: 8px; }
.channel-item { display: flex; align-items: center; justify-content: space-between; padding: 9px 12px; border-radius: var(--radius-sm); font-size: 14px; cursor: pointer; transition: 0.15s; border: none; background: transparent; width: 100%; text-align: left; color: var(--text-sub); }
.channel-item:hover { background: #fff; color: var(--text-main); }
.channel-item.active { background: #fff; color: var(--primary); font-weight: 800; box-shadow: var(--shadow-xs); }
.channel-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--border); flex-shrink: 0; }
.channel-dot.ok { background: var(--green); }
.config-panel-inline { margin-top: 18px; }

.settings-page { max-width: 920px; }
