:root {
  --background-color: #ffffff;
  --card-background: #f8f9fa;
  --text-color: #212529;
  --muted-text-color: #6c757d;
  --border-color: #e9ecef;
  --accent-color: #1DB954;
  --accent-color-hover: #1aa34a;
  --input-background: #f1f3f5;
  --btn-secondary-bg: #e9ecef;
  --btn-secondary-hover-bg: #dee2e6;
  --btn-secondary-text: #495057;
  --error-color: #dc3545;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  width: 350px;
  background-color: var(--background-color);
  color: var(--text-color);
  margin: 0;
}

.container {
  padding: 16px;
}

.header {
  text-align: center;
  margin-bottom: 24px;
}

.logo-icon {
  width: 56px;
  height: 56px;
  margin-bottom: 12px;
}

.title {
  font-size: 1.5em;
  margin: 0;
}

.subtitle {
  font-size: 0.9em;
  color: var(--muted-text-color);
  margin: 4px 0 0;
}

.setting-card {
  background-color: var(--card-background);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 16px;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}

.card-title {
  font-size: 1em;
  font-weight: 600;
  margin: 0;
}

.card-description {
  font-size: 0.85em;
  color: var(--muted-text-color);
  margin: 0 0 16px 0;
  line-height: 1.4;
}
.card-description a {
  color: var(--accent-color);
  text-decoration: none;
}
.card-description a:hover {
  text-decoration: underline;
}

.btn {
  padding: 8px 16px;
  border: none;
  border-radius: 20px;
  font-weight: bold;
  cursor: pointer;
  transition: background-color 0.2s, transform 0.1s;
  font-size: 0.85em;
}
.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background-color: var(--accent-color);
  color: #fff;
  margin-top: 10px;
}
.btn-primary:hover {
  background-color: var(--accent-color-hover);
}

.btn-secondary {
  background-color: var(--btn-secondary-bg);
  color: var(--btn-secondary-text);
}
.btn-secondary:hover {
  background-color: var(--btn-secondary-hover-bg);
}

.input-field {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  background-color: var(--input-background);
  color: var(--text-color);
  box-sizing: border-box;
  font-size: 0.9em;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.input-field:focus {
  outline: none;
  border-color: var(--accent-color);
  box-shadow: 0 0 0 2px rgba(29, 185, 84, 0.2);
}

.api-key-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.slider-group {
  display: flex;
  align-items: center;
  gap: 12px;
}
input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  background: var(--border-color);
  border-radius: 5px;
  outline: none;
  flex-grow: 1;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  background: var(--accent-color);
  border-radius: 50%;
  cursor: pointer;
  transition: background-color 0.2s;
}
input[type="range"]::-webkit-slider-thumb:hover {
  background: var(--accent-color-hover);
}
.slider-value-display {
  font-size: 0.9em;
  font-weight: 500;
  color: var(--muted-text-color);
  min-width: 40px;
  text-align: right;
}

.switch {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 22px;
}
.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}
.slider-toggle {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  transition: .4s;
  border-radius: 22px;
}
.slider-toggle:before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .4s;
  border-radius: 50%;
}
input:checked + .slider-toggle {
  background-color: var(--accent-color);
}
input:checked + .slider-toggle:before {
  transform: translateX(18px);
}

.stats-group {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.stats-group .card-description {
  margin-bottom: 0;
}

.footer {
  text-align: center;
  min-height: 20px;
  margin-top: 8px;
}
#status-message {
  font-size: 0.85em;
  font-weight: bold;
}
.status-success {
  color: var(--accent-color);
}
.status-error {
  color: var(--error-color);
}