/* ── Settings Modal ── */
.settings-modal-content {
  max-width: 560px;
  max-height: 85vh;
  overflow-y: auto;
}

.settings-body {
  padding: 16px 20px 20px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.settings-section {
  border: 1px solid var(--theme-border);
  border-radius: 8px;
  overflow: hidden;
}

.settings-section-header {
  padding: 10px 14px;
  font-weight: 600;
  font-size: 0.95rem;
  background: rgba(255,255,255,0.05);
  display: flex;
  align-items: center;
  gap: 8px;
}

.settings-collapsible-header {
  cursor: pointer;
  transition: background 0.15s;
  user-select: none;
}

.settings-collapsible-header:hover {
  background: rgba(255,255,255,0.1);
}

.settings-collapse-icon {
  margin-left: 8px;
  font-size: 0.7rem;
  color: #666;
  transition: transform 0.2s;
  display: inline-block;
}

.settings-section.collapsed .settings-collapse-icon {
  transform: rotate(0deg);
}

.settings-section:not(.collapsed) .settings-collapse-icon {
  transform: rotate(90deg);
}

.settings-section.collapsed .settings-collapsible-body {
  display: none;
}

.settings-status {
  margin-left: auto;
  font-size: 0.75rem;
  font-weight: 400;
  color: #888;
  padding: 2px 8px;
  border-radius: 10px;
  background: rgba(255,255,255,0.06);
}

.settings-status.configured {
  color: #4caf50;
  background: rgba(76,175,80,0.12);
}

.settings-form {
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.settings-description {
  font-size: 0.85rem;
  color: #aaa;
  line-height: 1.5;
}

.settings-description a {
  color: #64b5f6;
  text-decoration: underline;
}

.settings-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  position: relative;
  flex: 1;
}

.settings-field label {
  font-size: 0.8rem;
  color: #aaa;
  font-weight: 500;
}

.settings-field input,
.settings-field textarea {
  background: #1e1e1e;
  border: 1px solid #555;
  border-radius: 6px;
  padding: 8px 10px;
  color: #fff;
  font-size: 0.85rem;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s;
}

.settings-field input:focus,
.settings-field textarea:focus {
  border-color: #64b5f6;
}

.settings-field textarea {
  resize: vertical;
  font-family: 'Consolas', 'Courier New', monospace;
  font-size: 0.78rem;
  min-height: 80px;
}

.settings-field-row {
  display: flex;
  gap: 10px;
}

.settings-toggle-vis {
  position: absolute;
  right: 8px;
  bottom: 7px;
  background: none;
  border: none;
  color: #888;
  cursor: pointer;
  padding: 2px 4px;
  font-size: 0.85rem;
}

.settings-toggle-vis:hover {
  color: #fff;
}

.settings-hint {
  font-size: 0.78rem;
  color: #888;
  min-height: 1.2em;
}

.settings-hint.success {
  color: #4caf50;
}

.settings-hint.error {
  color: #ef5350;
}

.settings-save-btn {
  align-self: flex-end;
  background: #1976d2;
  color: #fff;
  border: none;
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 0.85rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: background 0.2s;
}

.settings-save-btn:hover {
  background: #1565c0;
}

.settings-save-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.settings-btn-row {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  align-items: center;
}

.settings-clear-btn {
  background: transparent;
  border: 1px solid #555;
  color: #aaa;
  padding: 8px 10px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.85rem;
  transition: color 0.2s, border-color 0.2s;
}

.settings-clear-btn:hover {
  color: #ef5350;
  border-color: #ef5350;
}

.settings-warning {
  font-size: 0.8rem;
  color: #ffa726;
  background: rgba(255,167,38,0.08);
  border: 1px solid rgba(255,167,38,0.2);
  border-radius: 6px;
  padding: 8px 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* S3 Profile Cards */
.s3-profile-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 10px;
}

.s3-no-profiles {
  font-size: 0.82rem;
  color: #666;
  text-align: center;
  padding: 12px;
}

.s3-profile-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: rgba(255,255,255,0.04);
  border: 1px solid #333;
  border-radius: 8px;
  transition: border-color 0.2s, background 0.2s;
}

.s3-profile-card.default {
  border-color: rgba(255,153,0,0.35);
  background: rgba(255,153,0,0.06);
}

.s3-profile-card:hover {
  border-color: #555;
}

.s3-profile-info {
  flex: 1;
  min-width: 0;
}

.s3-profile-label {
  font-weight: 600;
  font-size: 0.88rem;
  color: #e0e0e0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.s3-default-badge {
  font-size: 0.68rem;
  font-weight: 500;
  color: #ff9900;
  background: rgba(255,153,0,0.12);
  padding: 1px 6px;
  border-radius: 4px;
  margin-left: 6px;
  vertical-align: middle;
}

.s3-profile-details {
  font-size: 0.75rem;
  color: #777;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.s3-profile-actions {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}

.s3-profile-action {
  background: transparent;
  border: 1px solid transparent;
  color: #666;
  padding: 4px 7px;
  border-radius: 5px;
  cursor: pointer;
  font-size: 0.75rem;
  transition: all 0.15s;
}

.s3-profile-action:hover {
  color: #ccc;
  background: rgba(255,255,255,0.08);
  border-color: #444;
}

.s3-profile-action[data-action="delete"]:hover {
  color: #ef5350;
  border-color: rgba(239,83,80,0.3);
  background: rgba(239,83,80,0.08);
}

.s3-profile-action[data-action="default"]:hover {
  color: #ff9900;
  border-color: rgba(255,153,0,0.3);
  background: rgba(255,153,0,0.08);
}

.s3-add-profile-btn {
  width: 100%;
  background: transparent;
  border: 1px dashed #444;
  color: #888;
  padding: 8px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.82rem;
  transition: all 0.2s;
  margin-bottom: 8px;
}

.s3-add-profile-btn:hover {
  border-color: #ff9900;
  color: #ff9900;
  background: rgba(255,153,0,0.05);
}

.s3-profile-form {
  border-top: 1px solid #333;
  padding-top: 12px;
  margin-top: 4px;
}

/* Light mode */
body:not(.dark-mode) .s3-profile-card {
  background: rgba(0,0,0,0.02);
  border-color: #ddd;
}
body:not(.dark-mode) .s3-profile-card.default {
  border-color: rgba(255,153,0,0.3);
  background: rgba(255,153,0,0.04);
}
body:not(.dark-mode) .s3-profile-card:hover { border-color: #bbb; }
body:not(.dark-mode) .s3-profile-label { color: #333; }
body:not(.dark-mode) .s3-profile-details { color: #888; }
body:not(.dark-mode) .s3-no-profiles { color: #999; }
body:not(.dark-mode) .s3-profile-action { color: #999; }
body:not(.dark-mode) .s3-profile-action:hover { color: #333; background: rgba(0,0,0,0.05); border-color: #ccc; }
body:not(.dark-mode) .s3-add-profile-btn { border-color: #ccc; color: #888; }
body:not(.dark-mode) .s3-add-profile-btn:hover { border-color: #ff9900; color: #e68a00; }
body:not(.dark-mode) .s3-profile-form { border-top-color: #ddd; }

.settings-help {
  font-size: 0.8rem;
  color: #888;
  text-align: center;
  padding: 4px 0;
}

.settings-help a {
  color: #64b5f6;
  text-decoration: underline;
}

/* Settings - Prominent guide card */
.settings-guide-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  margin-bottom: 12px;
  background: linear-gradient(135deg, rgba(78,154,245,0.10) 0%, rgba(155,119,255,0.10) 100%);
  border: 1px solid rgba(78,154,245,0.25);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
  color: inherit;
}

.settings-guide-card:hover {
  background: linear-gradient(135deg, rgba(78,154,245,0.18) 0%, rgba(155,119,255,0.18) 100%);
  border-color: rgba(78,154,245,0.4);
  transform: translateY(-1px);
}

.settings-guide-card .guide-card-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: rgba(78,154,245,0.15);
  color: #4e9af5;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.settings-guide-card .guide-card-text {
  flex: 1;
  min-width: 0;
}

.settings-guide-card .guide-card-title {
  font-weight: 600;
  font-size: 0.92rem;
  color: #e0e0e0;
}

.settings-guide-card .guide-card-sub {
  font-size: 0.78rem;
  color: #888;
  margin-top: 2px;
}

.settings-guide-card .guide-card-arrow {
  color: #666;
  font-size: 0.85rem;
  flex-shrink: 0;
  transition: transform 0.2s;
}

.settings-guide-card:hover .guide-card-arrow {
  transform: translateX(3px);
  color: #4e9af5;
}

/* Light mode */
body:not(.dark-mode) .settings-guide-card {
  background: linear-gradient(135deg, rgba(78,154,245,0.06) 0%, rgba(155,119,255,0.06) 100%);
  border-color: rgba(78,154,245,0.2);
}
body:not(.dark-mode) .settings-guide-card:hover {
  background: linear-gradient(135deg, rgba(78,154,245,0.12) 0%, rgba(155,119,255,0.12) 100%);
}
body:not(.dark-mode) .settings-guide-card .guide-card-icon {
  background: rgba(78,154,245,0.10);
}
body:not(.dark-mode) .settings-guide-card .guide-card-title {
  color: #333;
}
body:not(.dark-mode) .settings-guide-card .guide-card-sub {
  color: #666;
}

/* Settings - section label (non-collapsible heading) */
.settings-section-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: -12px;
}

/* Theme swatches */
.theme-body {
  padding: 12px 14px;
}

.theme-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
  gap: 10px;
}

.theme-swatch {
  background: none;
  border: 2px solid transparent;
  border-radius: 8px;
  padding: 6px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  transition: border-color 0.2s, transform 0.15s;
}

.theme-swatch:hover {
  border-color: var(--theme-border);
  transform: translateY(-1px);
}

.theme-swatch.active {
  border-color: var(--theme-accent);
  box-shadow: 0 0 0 1px var(--theme-accent);
}

.theme-swatch-preview {
  width: 100%;
  aspect-ratio: 4/3;
  border-radius: 4px;
  border: 1px solid;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 5px;
}

.theme-swatch-bar {
  width: 100%;
  height: 6px;
  border-radius: 2px;
}

.theme-swatch-accent {
  width: 50%;
  height: 4px;
  border-radius: 2px;
}

.theme-swatch-text {
  width: 70%;
  height: 3px;
  border-radius: 1px;
  opacity: 0.6;
}

.theme-swatch-name {
  font-size: 0.65rem;
  color: #aaa;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.theme-swatch.active .theme-swatch-name {
  color: var(--theme-accent);
  font-weight: 600;
}

/* Release Log */
.release-log-body {
  padding: 12px 14px;
  max-height: 400px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.release-log-body::-webkit-scrollbar { width: 5px; }
.release-log-body::-webkit-scrollbar-track { background: transparent; }
.release-log-body::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 3px; }
.release-log-body::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.2); }

.release-entry {
  border-left: 2px solid var(--theme-border);
  padding-left: 12px;
}

.release-entry.latest {
  border-left-color: var(--theme-accent);
}

.release-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 2px;
}

.release-version {
  font-size: 0.85rem;
  font-weight: 700;
  color: #ddd;
  font-variant-numeric: tabular-nums;
}

.release-date {
  font-size: 0.75rem;
  color: #666;
}

.release-badge {
  font-size: 0.6rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--theme-accent);
  background: color-mix(in srgb, var(--theme-accent) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--theme-accent) 25%, transparent);
  border-radius: 3px;
  padding: 1px 5px;
}

.release-title {
  font-size: 0.8rem;
  font-weight: 600;
  color: #bbb;
  margin-bottom: 4px;
}

.release-features {
  margin: 0;
  padding-left: 16px;
  list-style: none;
}

.release-features li {
  font-size: 0.75rem;
  color: #999;
  line-height: 1.5;
  position: relative;
  padding-left: 2px;
}

.release-features li::before {
  content: '\2022';
  color: #555;
  position: absolute;
  left: -12px;
}

.release-entry.latest .release-features li::before {
  color: var(--theme-accent);
}

/* Settings modal - light mode */
body:not(.dark-mode) .settings-section {
  border-color: var(--theme-border);
}

body:not(.dark-mode) .settings-section-header {
  background: rgba(0,0,0,0.03);
}

body:not(.dark-mode) .settings-collapsible-header:hover {
  background: rgba(0,0,0,0.06);
}

body:not(.dark-mode) .settings-status {
  background: rgba(0,0,0,0.05);
  color: #888;
}

body:not(.dark-mode) .settings-field input,
body:not(.dark-mode) .settings-field textarea {
  background: var(--theme-bg);
  border-color: var(--theme-border);
  color: var(--theme-text);
}

body:not(.dark-mode) .settings-field label {
  color: #666;
}

body:not(.dark-mode) .settings-description {
  color: #666;
}

body:not(.dark-mode) .settings-toggle-vis:hover {
  color: var(--theme-text);
}

body:not(.dark-mode) .settings-section-label {
  color: #999;
}

body:not(.dark-mode) .release-entry {
  border-left-color: var(--theme-border);
}

body:not(.dark-mode) .release-entry.latest {
  border-left-color: var(--theme-accent);
}

body:not(.dark-mode) .release-version {
  color: var(--theme-text);
}

body:not(.dark-mode) .release-title {
  color: #555;
}

body:not(.dark-mode) .release-features li {
  color: #666;
}

body:not(.dark-mode) .release-badge {
  color: var(--theme-accent);
  background: color-mix(in srgb, var(--theme-accent) 8%, transparent);
  border-color: color-mix(in srgb, var(--theme-accent) 20%, transparent);
}

body:not(.dark-mode) .release-log-body::-webkit-scrollbar-thumb {
  background: rgba(0,0,0,0.1);
}

body:not(.dark-mode) .release-log-body::-webkit-scrollbar-thumb:hover {
  background: rgba(0,0,0,0.2);
}

body:not(.dark-mode) .theme-swatch-name {
  color: #666;
}
