/* KGOnePanel — mirrors ChatBox layout and style */
.kgone-panel {
  display: flex;
  flex-direction: column;
  width: var(--chat-box-width);
  background-color: #2d2d2d;
  border-left: 1px solid #3a3a3a;
  flex-shrink: 0;
  overflow: hidden;
}

.kgone-panel.is-hidden {
  display: none;
}

/* Header */
.kgone-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background-color: #3a3a3a;
  height: 40px;
  border-bottom: 1px solid #4a4a4a;
  padding: 0 15px;
  flex-shrink: 0;
}

.kgone-panel-header h3 {
  color: #e0e0e0;
  font-size: 12px;
  font-weight: bold;
  margin: 0;
}

/* Tab switcher */
.kgone-tabs {
  display: flex;
  background-color: #2d2d2d;
  border-bottom: 1px solid #3a3a3a;
  flex-shrink: 0;
}

.kgone-tab {
  flex: 1;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: #999;
  font-size: 11px;
  font-weight: 500;
  padding: 8px 4px;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}

.kgone-tab:hover {
  color: #ccc;
}

.kgone-tab.active {
  color: #e0e0e0;
  border-bottom-color: #5a9fd4;
}

.kgone-tab.is-disabled {
  color: #666;
  cursor: not-allowed;
}

.kgone-tab.is-disabled:hover {
  color: #666;
}

/* Scrollable body */
.kgone-panel-body {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Field groups */
.kgone-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.kgone-label {
  color: #aaa;
  font-size: 11px;
  font-weight: 500;
}

.kgone-input,
.kgone-textarea,
.kgone-select {
  background-color: #3a3a3a;
  border: 1px solid #4a4a4a;
  border-radius: 4px;
  color: #e0e0e0;
  font-size: 12px;
  padding: 6px 8px;
  outline: none;
  width: 100%;
  box-sizing: border-box;
}

.kgone-input:focus,
.kgone-textarea:focus,
.kgone-select:focus {
  border-color: #5a9fd4;
}

.kgone-textarea {
  resize: vertical;
  min-height: 60px;
  font-family: inherit;
}

.kgone-input::placeholder,
.kgone-textarea::placeholder {
  color: #666;
}

/* Hint text below textarea */
.kgone-hint {
  color: #666;
  font-size: 10px;
  line-height: 1.4;
  margin-top: 2px;
}

.kgone-hint strong {
  color: #999;
  font-weight: 600;
}

.kgone-powered-by {
  color: #666;
  font-size: 10px;
  text-align: center;
  margin-top: 12px;
  padding-top: 8px;
  border-top: 1px solid #333;
}

.kgone-powered-by a {
  color: #888;
  text-decoration: none;
  font-weight: 600;
}

.kgone-powered-by a:hover {
  color: #aaa;
  text-decoration: underline;
}

/* Two-column row (e.g. note + scale) */
.kgone-row {
  display: flex;
  gap: 8px;
}

.kgone-row .kgone-field {
  flex: 1;
}

/* Advanced expander */
.kgone-expander-toggle {
  background: transparent;
  border: none;
  color: #888;
  font-size: 11px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 0;
}

.kgone-expander-toggle:hover {
  color: #bbb;
}

.kgone-expander-toggle .arrow {
  font-size: 9px;
  transition: transform 0.15s;
}

.kgone-expander-toggle .arrow.open {
  transform: rotate(90deg);
}

.kgone-expander-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 8px 0 0 0;
}

/* Separator tab */
.kgone-separator-hint {
  color: #888;
  font-size: 11px;
  line-height: 1.5;
  text-align: center;
  padding: 20px 8px;
  background-color: #252525;
  border-radius: 6px;
}

.kgone-local-mode-card {
  background-color: #252525;
  border: 1px solid #3a3a3a;
  border-radius: 6px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.kgone-local-mode-title {
  color: #e0e0e0;
  font-size: 12px;
  font-weight: 600;
}

.kgone-local-mode-text {
  color: #999;
  font-size: 11px;
  line-height: 1.45;
}

.kgone-runtime-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.kgone-provider-chip {
  background-color: #313131;
  border: 1px solid #444;
  border-radius: 999px;
  color: #bbb;
  font-size: 10px;
  padding: 4px 8px;
}

.kgone-progress-block {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.kgone-progress-track {
  width: 100%;
  height: 8px;
  background-color: #1d1d1d;
  border: 1px solid #3a3a3a;
  border-radius: 999px;
  overflow: hidden;
}

.kgone-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #5a9fd4 0%, #7cc2f1 100%);
  transition: width 0.15s linear;
}

.kgone-region-info {
  background-color: #252525;
  border: 1px solid #3a3a3a;
  border-radius: 6px;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.kgone-region-info-label {
  color: #777;
  font-size: 10px;
}

.kgone-region-info-value {
  color: #e0e0e0;
  font-size: 11px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Generate / Separate button */
.kgone-btn-generate {
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
  padding: 8px 12px;
  width: 100%;
  margin-top: 6px;
}

.kgone-btn-generate-accent {
  background-color: #4a5fa0;
  border: none;
  color: #e0e0e0;
  cursor: pointer;
  transition: background-color 0.15s;
}

.kgone-btn-generate-accent:hover:not(:disabled) {
  background-color: #5a70b8;
}

.kgone-btn-generate-accent:disabled {
  background-color: #3a3a3a;
  color: #666;
  cursor: not-allowed;
}

.kgone-btn-generate.dialog-btn {
  min-height: 32px;
}

.kgone-btn-generate.dialog-btn:disabled {
  background-color: #3a3a3a;
  color: #666;
  cursor: not-allowed;
}

.kgone-btn-secondary {
  background-color: #353535;
  border: 1px solid #4a4a4a;
  border-radius: 4px;
  color: #ddd;
  font-size: 11px;
  font-weight: 600;
  padding: 8px 10px;
  cursor: pointer;
  flex: 1;
}

.kgone-btn-secondary:hover:not(:disabled) {
  background-color: #404040;
}

.kgone-btn-secondary:disabled {
  color: #666;
  cursor: not-allowed;
}

.kgone-btn-danger {
  border-color: #5a2a2a;
  color: #f0b0b0;
}

/* ── Audio player ──────────────────────────────────────────────────────────── */
.kgone-audio-player {
  display: flex;
  align-items: center;
  gap: 8px;
  background-color: #252525;
  border: 1px solid #3a3a3a;
  border-radius: 6px;
  padding: 8px 10px;
}

.kgone-player-play-btn {
  background: transparent;
  border: none;
  color: #e0e0e0;
  cursor: pointer;
  font-size: 13px;
  padding: 2px 4px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.kgone-player-play-btn:hover {
  color: #5a9fd4;
}

.kgone-player-progress-track {
  flex: 1;
  height: 4px;
  background-color: #3a3a3a;
  border-radius: 2px;
  cursor: pointer;
  position: relative;
}

.kgone-player-progress-track:hover {
  height: 6px;
  margin-top: -1px;
}

.kgone-player-progress-fill {
  height: 100%;
  background-color: #5a9fd4;
  border-radius: 2px;
  pointer-events: none;
  transition: width 0.1s linear;
}

.kgone-player-time {
  color: #888;
  font-size: 10px;
  white-space: nowrap;
  flex-shrink: 0;
}

.kgone-player-drag-handle {
  color: #555;
  cursor: grab;
  font-size: 12px;
  padding: 2px 4px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
}

.kgone-player-drag-handle:hover {
  color: #888;
}

.kgone-player-download-btn {
  background: transparent;
  border: none;
  color: #888;
  cursor: pointer;
  font-size: 12px;
  padding: 2px 4px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
}

.kgone-player-download-btn:hover {
  color: #5a9fd4;
}

/* ── Generation state feedback ─────────────────────────────────────────────── */
.kgone-gen-hint {
  color: #888;
  font-size: 10px;
  text-align: center;
  margin-top: -4px;
}

.kgone-error-msg {
  color: #e07a7a;
  font-size: 11px;
  background-color: #2a1a1a;
  border: 1px solid #5a2a2a;
  border-radius: 4px;
  padding: 6px 8px;
  word-break: break-word;
}

/* Spinner on button */
.kgone-spinner {
  animation: kgone-spin 0.8s linear infinite;
  margin-right: 6px;
}

@keyframes kgone-spin {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

/* Stem players (Separator tab) */
.kgone-stems {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.kgone-stem-player {
  display: flex;
  flex-direction: column;
}

/* Checkbox row (instrumental toggle) */
.kgone-checkbox-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.kgone-checkbox-row input[type="checkbox"] {
  width: 14px;
  height: 14px;
  accent-color: #5a9fd4;
  cursor: pointer;
}

.kgone-checkbox-row label {
  color: #aaa;
  font-size: 11px;
  cursor: pointer;
  user-select: none;
}
