/* ==========================================================================
   Profile View Stylesheet - User Account, Knowledge Base & Achievements
   ========================================================================== */

/* 1. Top Hero Profile Header (Clean Unboxed iOS Style) */
.profile-hero-banner {
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 4px 4px 14px 4px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
  box-shadow: none;
}

.profile-hero-banner {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 18px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
}

[data-theme="light"] .profile-hero-banner {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  box-shadow: 0 4px 20px rgba(15, 23, 42, 0.04);
}

.profile-hero-left {
  display: flex;
  align-items: center;
  gap: 18px;
}

.user-avatar-circle {
  width: 60px;
  height: 60px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.15), rgba(168, 85, 247, 0.2));
  border: 2px solid var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  flex-shrink: 0;
  cursor: pointer;
  position: relative;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.user-avatar-circle:hover {
  transform: scale(1.06);
  box-shadow: 0 0 16px rgba(99, 102, 241, 0.35);
}

.avatar-edit-hint {
  position: absolute;
  bottom: -2px;
  right: -2px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  font-size: 0.7rem;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.user-info-text {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.profile-user-name-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.profile-user-name {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.01em;
  margin: 0;
}

.btn-edit-username {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s, background 0.2s;
}

.btn-edit-username:hover {
  color: var(--primary);
  background: rgba(99, 102, 241, 0.1);
}

.profile-rank-badge-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.profile-rank-pill {
  font-size: 0.78rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border);
}

.profile-score-pill {
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--text-secondary);
  background: var(--bg-tertiary);
  padding: 3px 10px;
  border-radius: var(--radius-full);
}

.profile-hero-badges {
  display: flex;
  align-items: center;
  gap: 10px;
}

.profile-pill-badge {
  font-size: 0.78rem;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  letter-spacing: 0.02em;
}

/* 2. Profile Dashboard 2-Column Grid Layout */
.profile-dashboard-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  width: 100%;
  padding-bottom: 30px;
}

@media (min-width: 900px) {
  .profile-dashboard-layout {
    grid-template-columns: 1fr 1fr;
    gap: 22px;
    align-items: stretch;
  }
}

.profile-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* 3. Quad Metrics Grid (Block 1) */
.profile-quad-metrics {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  padding: 16px;
}

@media (min-width: 768px) {
  .profile-quad-metrics {
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
  }
}

.quad-metric-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

[data-theme="light"] .quad-metric-card {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
}

.quad-metric-card:hover {
  transform: translateY(-2px);
  border-color: var(--primary);
}

.quad-metric-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  flex-shrink: 0;
}

.quad-metric-content {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.quad-metric-val {
  font-size: 1.35rem;
  font-weight: 800;
  font-family: var(--font-mono);
  color: var(--text-primary);
  line-height: 1.1;
}

.quad-metric-lbl {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
}

.quad-metric-sub {
  font-size: 0.72rem;
  color: var(--text-secondary);
  white-space: nowrap;
}

/* 4. Stability Tiers Breakdown (Block 2) */
.profile-tiers-card {
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.tier-bars-wrapper {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.tier-bar-row {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.tier-info-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.84rem;
}

.tier-label {
  font-weight: 700;
  color: var(--text-primary);
}

.tier-count {
  font-size: 0.78rem;
  color: var(--text-secondary);
  font-family: var(--font-mono);
}

.tier-progress-track {
  height: 7px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.tier-progress-fill {
  height: 100%;
  border-radius: var(--radius-full);
  transition: width 0.4s ease;
}

.tier-desc-hint {
  font-size: 0.72rem;
  color: var(--text-secondary);
}

/* 5. Achievement Badges Showcase (Block 3) */
.profile-badges-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  padding: 14px;
}

@media (min-width: 500px) {
  .profile-badges-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.badge-item-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 12px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

[data-theme="light"] .badge-item-card {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
}

.badge-item-card:hover {
  transform: translateY(-2px);
}

.badge-unlocked {
  border-color: rgba(245, 158, 11, 0.4);
  box-shadow: 0 2px 10px rgba(245, 158, 11, 0.08);
}

.badge-locked {
  opacity: 0.75;
}

.badge-card-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  flex-shrink: 0;
}

.badge-card-body {
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex: 1;
  min-width: 0;
}

.badge-card-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
}

.badge-card-desc {
  font-size: 0.72rem;
  color: var(--text-secondary);
  line-height: 1.25;
}

.badge-card-footer {
  margin-top: 4px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.badge-status-unlocked {
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.badge-bar-track {
  flex: 1;
  height: 5px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.badge-bar-fill {
  height: 100%;
  border-radius: var(--radius-full);
}

.badge-pct {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--text-secondary);
  font-family: var(--font-mono);
}

/* 6. Knowledge Base & CEFR Breakdown (Block 4) */
.profile-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  padding: 14px 14px 10px 14px;
}

.profile-stat-box {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  text-align: center;
}

[data-theme="light"] .profile-stat-box {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
}

.profile-stat-icon {
  font-size: 1.2rem;
}

.profile-stat-num {
  font-size: 1.35rem;
  font-weight: 800;
  font-family: var(--font-mono);
  color: var(--text-primary);
  line-height: 1.1;
}

.profile-stat-lbl {
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.profile-cefr-breakdown {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 6px 14px 14px 14px;
}

.cefr-badge-item {
  font-size: 0.76rem;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 5px;
  background: var(--bg-secondary);
  padding: 3px 8px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border);
}

[data-theme="light"] .cefr-badge-item {
  background: #f8fafc;
  border-color: #e2e8f0;
}

.cefr-dot {
  width: 7px;
  height: 7px;
  border-radius: var(--radius-full);
}

.btn-profile-action {
  background: linear-gradient(135deg, var(--primary), var(--primary-hover, #4f46e5));
  color: #ffffff;
  border: none;
  border-radius: var(--radius-md);
  padding: 11px 16px;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn-profile-action:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.3);
}

/* 7. Action Hub & Tools Grid (Block 5) */
.profile-actions-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
}

.btn-profile-tool {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  text-align: left;
  transition: all 0.2s ease;
}

[data-theme="light"] .btn-profile-tool {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
}

.btn-profile-tool:hover {
  background: var(--bg-tertiary);
  border-color: var(--primary);
  transform: translateX(3px);
}

[data-theme="light"] .btn-profile-tool:hover {
  background: #f1f5f9;
}

.tool-icon {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  flex-shrink: 0;
}

.tool-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
}

.tool-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-primary);
}

.tool-desc {
  font-size: 0.74rem;
  color: var(--text-secondary);
}

.tool-arrow {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-secondary);
  transition: transform 0.2s;
}

.btn-profile-tool:hover .tool-arrow {
  color: var(--primary);
  transform: translateX(2px);
}

.milestone-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 14px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  transition: background 0.2s ease, border-color 0.2s ease;
}

[data-theme="light"] .milestone-item {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
}

.milestone-item:hover {
  background: var(--bg-tertiary);
  border-color: rgba(99, 102, 241, 0.3);
}

[data-theme="light"] .milestone-item:hover {
  background: #f1f5f9;
}

.milestone-icon {
  font-size: 1.25rem;
  line-height: 1;
  flex-shrink: 0;
  margin-top: 2px;
}

.milestone-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.milestone-title {
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--text-primary);
}

.milestone-desc {
  font-size: 0.76rem;
  color: var(--text-secondary);
  line-height: 1.35;
}

/* 7. Mobile Responsive Optimizations */
@media (max-width: 640px) {
  .profile-hero-banner {
    padding: 14px 16px;
    margin-bottom: 16px;
  }
  .user-avatar-circle {
    width: 44px;
    height: 44px;
    font-size: 1.3rem;
  }
  .profile-user-name {
    font-size: 1.05rem;
  }
  .profile-card {
    padding: 16px 14px;
    gap: 14px;
  }
  .profile-card-header {
    padding-bottom: 10px;
  }
  .profile-card-icon {
    width: 34px;
    height: 34px;
    font-size: 1.1rem;
  }
  .profile-achieve-grid {
    padding: 12px 8px;
  }
  .achieve-val {
    font-size: 1.15rem;
  }
  .achieve-lbl {
    font-size: 0.7rem;
  }
  .profile-stat-box {
    padding: 10px 4px;
    gap: 4px;
  }
  .profile-stat-icon {
    width: 30px;
    height: 30px;
    font-size: 0.95rem;
  }
  .profile-stat-num {
    font-size: 1.15rem;
  }
  .profile-stat-lbl {
    font-size: 0.68rem;
  }
  .milestone-item {
    padding: 10px 12px;
    gap: 10px;
  }
}

/* ==========================================================================
   Settings View Stylesheet - FSRS Parameters, Audio & Data Configuration
   ========================================================================== */

/* 1. Top Hero Settings Header (Clean Unboxed iOS Style) */
.settings-hero-banner {
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 4px 4px 12px 4px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  box-shadow: none;
}

[data-theme="light"] .settings-hero-banner {
  background: transparent;
  border: none;
  box-shadow: none;
}

.settings-hero-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.settings-hero-icon {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  color: #ffffff;
  flex-shrink: 0;
  box-shadow: 0 4px 12px var(--primary-glow);
}

.settings-hero-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.settings-hero-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  margin: 0;
  line-height: 1.2;
  white-space: nowrap;
}

.settings-hero-subtitle {
  color: var(--text-secondary);
  font-size: 0.78rem;
  font-weight: 400;
  margin: 0;
  line-height: 1.35;
}

.settings-hero-badges {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.settings-pill-badge {
  font-size: 0.74rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  letter-spacing: 0.02em;
  white-space: nowrap;
}

/* 2. Symmetrical 2-Column Dashboard Grid */
.settings-layout-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  padding-bottom: 24px;
}

@media (min-width: 860px) {
  .settings-layout-grid {
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    align-items: stretch;
  }
}

/* ==========================================================================
   iOS Inset Grouped List & Modern Section Styling Architecture
   ========================================================================== */

.settings-group,
.profile-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  box-sizing: border-box;
}

#tab-settings .section-group-header,
.settings-group .section-group-header,
.profile-group .section-group-header {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  padding: 0 4px 2px 6px;
  text-align: left;
  width: 100%;
  box-sizing: border-box;
}

.section-group-title {
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: flex-start;
  text-align: left;
  gap: 6px;
  margin: 0;
}

[data-theme="light"] .section-group-title {
  color: #1e293b;
}

.section-group-hint {
  font-size: 0.73rem;
  color: var(--text-muted);
  opacity: 0.85;
}

/* Inset Grouped Card Container */
.inset-grouped-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
  width: 100%;
  box-sizing: border-box;
}

[data-theme="light"] .inset-grouped-card {
  background: #ffffff;
  border-color: #e2e8f0;
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.03);
}

.inset-grouped-card .optimizer-feature-card {
  margin: 0;
  border-radius: 0;
  border: none;
  border-bottom: 1px solid var(--border);
  padding: 14px 16px;
  box-sizing: border-box;
  width: 100%;
}

/* Setting Rows inside Inset Card with subtle divider */
.inset-grouped-card .setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  background: transparent;
  gap: 16px;
  width: 100%;
  box-sizing: border-box;
  transition: background 0.15s ease;
}

[data-theme="light"] .inset-grouped-card .setting-row {
  border-bottom: 1px solid #f1f5f9;
}

.inset-grouped-card .setting-row:last-child {
  border-bottom: none;
}

.inset-grouped-card .setting-row:hover {
  background: rgba(99, 102, 241, 0.03);
}

.setting-row.profile-presets-row {
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
}

.setting-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex: 1;
  min-width: 0;
}

.setting-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.3;
}

.setting-desc {
  font-size: 0.75rem;
  color: var(--text-secondary);
  line-height: 1.35;
}

/* Modern Select Dropdown */
.setting-select {
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-tertiary);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.82rem;
  font-weight: 600;
  outline: none;
  cursor: pointer;
  transition: all 0.2s ease;
  width: 215px;
  max-width: 215px;
  flex-shrink: 0;
  box-sizing: border-box;
}

.setting-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

[data-theme="light"] .setting-select {
  background: #ffffff;
  border-color: #cbd5e1;
}

[data-theme="light"] .setting-select:hover {
  border-color: var(--primary);
}

/* 6. Toggle Switch */
.switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--bg-tertiary);
  transition: .25s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 24px;
  border: 1px solid var(--border);
}

[data-theme="light"] .slider {
  background-color: #cbd5e1;
  border-color: #cbd5e1;
}

.slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 2px;
  bottom: 2px;
  background-color: white;
  transition: .25s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 50%;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

input:checked + .slider {
  background: linear-gradient(135deg, var(--primary) 0%, #4f46e5 100%);
  border-color: var(--primary);
}

input:checked + .slider:before {
  transform: translateX(20px);
}

/* 7. Action Buttons Toolbar in Setting Row */
.setting-actions-compact-row {
  flex-direction: column;
  align-items: stretch;
  gap: 12px;
}

.settings-buttons-group {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  width: 100%;
  box-sizing: border-box;
}

.settings-buttons-group .btn-setting-btn.danger {
  grid-column: 1 / -1;
}

@media (min-width: 540px) {
  .settings-buttons-group {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 860px) {
  .settings-buttons-group {
    grid-template-columns: repeat(2, 1fr);
  }
}

.btn-setting-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 38px;
  padding: 8px 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  text-align: center;
  white-space: nowrap;
  box-sizing: border-box;
}

.btn-setting-btn:hover {
  background: var(--bg-tertiary);
  border-color: var(--primary);
  color: var(--primary);
  transform: translateY(-1px);
}

.btn-setting-btn:active {
  transform: translateY(0);
}

[data-theme="light"] .btn-setting-btn {
  background: #ffffff;
  border-color: #cbd5e1;
  color: #1e293b;
}

[data-theme="light"] .btn-setting-btn:hover {
  background: #f8fafc;
  border-color: var(--primary);
  color: var(--primary);
}

.btn-setting-btn.primary {
  background: rgba(99, 102, 241, 0.12);
  border-color: rgba(99, 102, 241, 0.35);
  color: var(--primary);
}

.btn-setting-btn.primary:hover {
  background: var(--primary);
  color: #ffffff;
}

.btn-setting-btn.danger {
  background: rgba(239, 68, 68, 0.08);
  border-color: rgba(239, 68, 68, 0.25);
  color: #ef4444;
}

.btn-setting-btn.danger:hover {
  background: #ef4444;
  color: #ffffff;
}

/* ==========================================================================
   1-Tap Learning Profile Presets
   ========================================================================== */
.settings-profile-chips-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  width: 100%;
  box-sizing: border-box;
}

.btn-profile-preset {
  background: var(--bg-tertiary);
  border: 1.5px solid var(--border);
  border-radius: 12px;
  padding: 9px 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  cursor: pointer;
  transition: all 0.18s cubic-bezier(0.34, 1.56, 0.64, 1);
  touch-action: manipulation;
  outline: none;
  min-width: 0;
  width: 100%;
  box-sizing: border-box;
}

[data-theme="light"] .btn-profile-preset {
  background: #f8fafc;
  border-color: #e2e8f0;
}

.btn-profile-preset:hover {
  transform: translateY(-2px);
  border-color: var(--primary);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.15);
}

.btn-profile-preset.active {
  background: rgba(99, 102, 241, 0.12) !important;
  border-color: var(--primary) !important;
  box-shadow: 0 0 0 1.5px var(--primary), 0 4px 14px rgba(99, 102, 241, 0.2) !important;
  transform: translateY(-1px);
}

.preset-icon {
  font-size: 1.15rem;
  line-height: 1;
}

.preset-name {
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.1;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.btn-profile-preset.active .preset-name {
  color: var(--primary);
}

.preset-sub {
  font-size: 0.64rem;
  font-weight: 600;
  color: var(--text-muted);
  font-family: var(--font-mono);
  white-space: nowrap;
  text-align: center;
}

/* 8. Mobile Responsive Optimizations */
@media (max-width: 640px) {
  .settings-hero-banner {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 4px 4px 12px 4px;
    margin-bottom: 12px;
  }
  .settings-hero-left {
    width: auto;
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
  }
  .settings-hero-badges {
    width: auto;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-shrink: 0;
  }
  .settings-pill-badge {
    font-size: 0.72rem;
    padding: 4px 9px;
  }
  .settings-hero-icon {
    width: 36px;
    height: 36px;
    font-size: 1.15rem;
  }
  .settings-hero-title {
    font-size: 1.12rem;
    white-space: nowrap;
  }
  .inset-grouped-card .setting-row {
    padding: 12px 14px;
    gap: 10px;
  }
  .setting-title {
    font-size: 0.84rem;
  }
  .setting-desc {
    font-size: 0.74rem;
  }

  .setting-row.setting-select-row,
  .setting-row:has(.setting-select) {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }

  .setting-row.setting-select-row .setting-select,
  .setting-row:has(.setting-select) .setting-select {
    width: 100% !important;
    max-width: 100% !important;
    height: 38px;
    padding: 6px 12px;
    font-size: 0.82rem;
    border-radius: 8px;
  }

  .setting-row.setting-switch-row,
  .setting-row:has(.switch) {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}

@media (max-width: 480px) {
  .settings-buttons-group {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .btn-setting-btn {
    width: 100%;
    min-height: 40px;
  }
}

@media (max-width: 360px) {
  .settings-profile-chips-grid {
    grid-template-columns: 1fr;
    gap: 6px;
  }
  .btn-profile-preset {
    flex-direction: row;
    justify-content: space-between;
    padding: 8px 14px;
  }
}

