* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Geist', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  background-color: #171717;
  color: #ededed;
  height: 100vh;
  padding: clamp(12px, 2.5vh, 24px);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow: hidden;
  position: relative;
  /* For absolute positioning of children */
}

body[data-theme='light'] {
  background-color: #f3f4f6;
  color: #1f2937;
}

html.theme-preload *,
html.theme-transition-suppress * {
  transition: none !important;
  animation: none !important;
}

.container {
  max-width: 1280px;
  margin: 0 auto;
  padding-bottom: clamp(12px, 2.5vh, 24px);
}

.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: clamp(16px, 3vh, 32px);
  gap: clamp(8px, 1.5vh, 16px);
  flex-wrap: wrap;
}

.header-content {
  display: flex;
  align-items: center;
  gap: 20px;
}

.logo {
  width: clamp(40px, 6vh, 56px);
  height: clamp(40px, 6vh, 56px);
  border-radius: 12px;
  background-color: transparent;
  box-shadow: none;
  filter: drop-shadow(0 6px 16px rgba(15, 23, 42, 0.22));
  -webkit-filter: drop-shadow(0 6px 16px rgba(15, 23, 42, 0.22));
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  display: block;
}

body[data-theme='dark'] .logo {
  filter: drop-shadow(0 6px 18px rgba(0, 0, 0, 0.45));
  -webkit-filter: drop-shadow(0 6px 18px rgba(0, 0, 0, 0.45));
}

.header h1 {
  font-size: 26px;
  font-weight: 600;
  margin-bottom: clamp(2px, 0.5vh, 6px);
  color: #F9F9F9;
  letter-spacing: -0.02em;
}

body[data-theme='light'] .header h1 {
  color: #111827;
}

.version {
  font-size: 14px;
  color: #A2A2A2;
  font-weight: 400;
  margin-top: -4px;
}

body[data-theme='light'] .version {
  color: #4b5563;
}


.hero-subtitle,
#heroSubtitle {
  color: #A2A2A2;
}

body[data-theme='light'] .hero-subtitle,
body[data-theme='light'] #heroSubtitle {
  color: #6b7280;
}

#diffTitle {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 4px;
}

#diffSubtitle {
  font-size: 14px;
  color: #60a5fa;
  font-weight: 500;
}

.tabs {
  display: flex;
  gap: 4px;
  background-color: #232323;
  padding: clamp(2px, 0.5vh, 4px);
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  margin-bottom: clamp(12px, 2.5vh, 24px);
  width: fit-content;
  max-width: 100%;
  overflow-x: auto;
  scrollbar-width: none;
  backdrop-filter: blur(12px);
}

.tabs::-webkit-scrollbar {
  display: none;
}

body[data-theme='light'] .tabs {
  background-color: rgba(248, 250, 252, 0.9);
  border: 1px solid rgba(148, 163, 184, 0.2);
  box-shadow: 0 8px 20px -12px rgba(15, 23, 42, 0.35);
}

.tab {
  padding: clamp(8px, 1.2vh, 12px) clamp(16px, 2vw, 28px);
  border-radius: 12px;
  font-weight: 500;
  font-size: 14px;
  border: none;
  cursor: pointer;
  background-color: transparent;
  color: #A2A2A2;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  height: clamp(36px, 5vh, 44px);
  flex: 0 0 auto;
  letter-spacing: -0.01em;
}

body[data-theme='light'] .tab {
  color: #475569;
}

.tab.active {
  background: #007AFF;
  color: #FAFAFA;
}

body[data-theme='light'] .tab.active {
  color: white;
}

.content {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: clamp(12px, 2vh, 24px);
  height: calc(100vh - clamp(140px, 22vh, 220px));
}

.panel {
  background-color: #232323;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

body[data-theme='light'] .panel {
  background: #ffffff;
  border: 1px solid rgba(148, 163, 184, 0.22);
  box-shadow: 0 20px 32px -24px rgba(15, 23, 42, 0.22);
}

.panel-header {
  padding: clamp(12px, 2.5vh, 24px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

body[data-theme='light'] .panel-header {
  border-bottom: 1px solid rgba(148, 163, 184, 0.18);
}

.panel-header-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: clamp(8px, 1.5vh, 16px);
  gap: clamp(8px, 1.5vh, 16px);
  flex-wrap: wrap;
}

.panel-header h2 {
  font-size: 19px;
  font-weight: 600;
  margin-bottom: clamp(2px, 0.5vh, 6px);
  color: #F9F9F9;
  letter-spacing: -0.02em;
}

body[data-theme='light'] .panel-header h2 {
  color: #0f172a;
}

.panel-header p {
  font-size: 14px;
  color: #A2A2A2;
  font-weight: 400;
}

body[data-theme='light'] .panel-header p {
  color: #6b7280;
}

#itemsSubtitle {
  color: #9ca3af;
}

body[data-theme='light'] #itemsSubtitle {
  color: #6b7280;
}

.controls {
  display: flex;
  gap: clamp(8px, 1vh, 12px);
  margin-top: clamp(10px, 2vh, 20px);
}

.search-wrapper {
  flex: 1;
  position: relative;
}

.search-input {
  width: 100%;
  padding: clamp(10px, 1.5vh, 14px) 18px;
  padding-left: 48px;
  background-color: rgba(35, 35, 35, 0.6);
  border: 1px solid rgba(231, 229, 228, 0.1);
  border-radius: 14px;
  color: #E5E5E5;
  font-size: 14px;
  transition: all 0.3s ease;
}

body[data-theme='light'] .search-input {
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(148, 163, 184, 0.12);
  color: #0f172a;
}

.search-section {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.search-icon {
  position: absolute;
  left: 18px;
  width: 20px;
  height: 20px;
  color: #a2a2a2;
  pointer-events: none;
}

body[data-theme='light'] .search-icon {
  color: #94a3b8;
}

.empty-state-icon {
  width: 64px;
  height: 64px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
  background-color: rgba(255, 255, 255, 0.05);
}

.empty-state-icon__svg {
  width: 32px;
  height: 32px;
  color: #6b7280;
  margin-bottom: 12px;
}

body[data-theme='light'] .empty-state-icon {
  background-color: rgba(148, 163, 184, 0.12);
}

body[data-theme='light'] .empty-state-icon__svg {
  color: #4b5563;
}

.search-input:focus {
  outline: none;
  border-color: rgba(0, 122, 255, 0.3);
  box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.1);
}

.search-input::placeholder {
  color: #717171;
}

body[data-theme='light'] .search-input::placeholder {
  color: #9ca3af;
}

.select {
  padding: 8px 40px 8px 16px;
  background-color: rgba(35, 35, 35, 0.6);
  border: 1px solid rgba(231, 229, 228, 0.1);
  border-radius: 12px;
  color: #D3D3D3;
  font-size: 14px;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  outline: none;
  height: 40px;
  transition: all 0.3s ease;
  background-image: url('data:image/svg+xml,%3csvg xmlns=%27http://www.w3.org/2000/svg%27 fill=%27none%27 viewBox=%270 0 20 20%27%3e%3cpath stroke=%27%23A2A2A2%27 stroke-linecap=%27round%27 stroke-linejoin=%27round%27 stroke-width=%271.5%27 d=%27M6 8l4 4 4-4%27/%3e%3c/svg%3e');
  background-position: right 16px center;
  background-repeat: no-repeat;
  background-size: 1em;
  padding-right: 40px;
  box-shadow: none;
}

body[data-theme='light'] .select {
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(148, 163, 184, 0.3);
  color: #0f172a;
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  -webkit-appearance: none;
  appearance: none;
  background-image: url('data:image/svg+xml,%3csvg xmlns=%27http://www.w3.org/2000/svg%27 fill=%27none%27 viewBox=%270 0 20 20%27%3e%3cpath stroke=%27%236b7280%27 stroke-linecap=%27round%27 stroke-linejoin=%27round%27 stroke-width=%271.5%27 d=%27M6 8l4 4 4-4%27/%3e%3c/svg%3e');
  background-position: right 16px center;
  background-repeat: no-repeat;
  background-size: 1em;
  padding-right: 40px;
  box-shadow: none;
}

.select:hover {
  border-color: rgba(231, 229, 228, 0.15);
}

body[data-theme='light'] .select:hover {
  border-color: rgba(148, 163, 184, 0.2);
}

.list {
  flex: 1;
  overflow-y: auto;
  padding: clamp(8px, 1.5vh, 16px);
  display: flex;
  flex-direction: column;
  gap: clamp(4px, 0.8vh, 8px);
  min-width: 0;
  /* Allow list to shrink below content width */
}

#itemsList,
ul,
li {
  list-style: none;
}

.list-item {
  /* height: 50px; removed to allow content to dictate height, but min-height matches badge text */
  min-height: clamp(40px, 5.5vh, 52px);
  padding: 0 clamp(10px, 1.5vh, 16px);
  /* Remove vertical padding, rely on height/flex */
  border-radius: 12px;
  cursor: pointer;
  background-color: rgb(56, 56, 56);
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(56, 56, 56, 0.8);
  color: #D3D3D3;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  min-width: 0;
  /* Allow item to shrink below content width */
}

body[data-theme='light'] .list-item {
  background: #ffffff;
  border: 1px solid rgba(148, 163, 184, 0.22);
  color: #475569;
  /* Matching the tab text color */
  box-shadow: 0 12px 26px -20px rgba(15, 23, 42, 0.22);
}

/* Left panel (backup list) items - slightly darker for visual hierarchy */
/* Default (Dark Mode) */
#backupList .list-item {
  background: rgba(48, 48, 48, 0.85);
}

#backupList .list-item:hover {
  background: rgba(52, 52, 52, 0.95);
}

/* Light Mode Override for Left Panel */
body[data-theme='light'] #backupList .list-item {
  background: #f1f5f9;
  /* Slate-100 - slightly darker than pure white */
}

body[data-theme='light'] #backupList .list-item:hover {
  background: #e2e8f0;
  /* Slate-200 */
}

.list-item:hover {
  background: rgba(56, 56, 56, 0.95);
  border-color: rgba(231, 229, 228, 0.15);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

body[data-theme='light'] .list-item:hover {
  background: #ffffff;
  border-color: rgba(148, 163, 184, 0.3);
  box-shadow: 0 16px 32px -22px rgba(15, 23, 42, 0.3), 0 6px 16px -12px rgba(15, 23, 42, 0.26);
}

.list-item.active {
  background: #0070e6;
  color: #FAFAFA;
  box-shadow: none;
  border-color: transparent;
}

body[data-theme='light'] .list-item.active {
  background: #0070e6;
  box-shadow: none;
  position: relative;
  z-index: 1;
}

.item-content {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
  /* Allow content to shrink */
  overflow: hidden;
  /* Hide overflow */
}

.item-content>span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
  /* Allow text to truncate */
}

.item-badges {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  /* Prevent badges from shrinking */
  margin-left: 12px;
}

/* Item badges moved up to be with item-content styles */

.dot {
  display: none;
}

.list-item.active .dot {
  background-color: #FFF9F6;
}

.badge {
  padding: 5px 14px;
  font-size: 12px;
  font-weight: 500;
  border-radius: 9999px;
  border: 1px solid;
  letter-spacing: 0.01em;
}

.badge-changed {
  background: rgba(249, 115, 22, 0.15);
  color: #f97316;
  border-color: rgba(249, 115, 22, 0.25);
}

.badge-deleted {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
  border-color: rgba(239, 68, 68, 0.25);
}

.badge-unchanged {
  background: rgba(34, 197, 94, 0.15);
  color: #22c55e;
  border-color: rgba(34, 197, 94, 0.25);
}

body[data-theme='light'] .badge-changed {
  background: rgba(249, 115, 22, 0.1);
  color: #c2410c;
  border-color: rgba(249, 115, 22, 0.16);
}

body[data-theme='light'] .badge-deleted {
  background: rgba(239, 68, 68, 0.1);
  color: #b91c1c;
  border-color: rgba(239, 68, 68, 0.16);
}

body[data-theme='light'] .badge-unchanged {
  background: rgba(34, 197, 94, 0.1);
  color: #15803d;
  border-color: rgba(34, 197, 94, 0.16);
}

.chevron {
  width: 20px;
  height: 20px;
  color: #717171;
  transition: all 0.3s ease;
}

.list-item:hover .chevron {
  color: #A2A2A2;
}

.list-item.active .chevron {
  color: #FAFAFA;
}

body[data-theme='light'] .chevron {
  color: #9ca3af;
}

body[data-theme='light'] .list-item:hover .chevron {
  color: #64748b;
}

body[data-theme='light'] .list-item.active .chevron {
  color: #f8fafc;
}

.loading,
.empty-state,
.error {
  text-align: center;
  color: #A2A2A2;
  padding: 48px 24px;
  font-weight: 400;
}

body[data-theme='light'] .loading,
body[data-theme='light'] .empty-state {
  color: #6b7280;
}

.error {
  color: #ef4444;
}

.status-message {
  margin-top: 10px;
  font-size: 13px;
  padding: 10px;
  border-radius: 8px;
}

.settings-inline-text.status-success {
  color: #22c55e;
}

.settings-inline-text.status-error {
  color: #ef4444;
}

.backup-status-error {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
}

.backup-status-success {
  background: rgba(34, 197, 94, 0.15);
  color: #22c55e;
}

body[data-theme='light'] .backup-status-error {
  background: rgba(239, 68, 68, 0.12);
}

body[data-theme='light'] .backup-status-success {
  background: rgba(34, 197, 94, 0.12);
}

.btn-primary,
.btn-secondary {
  padding: 14px 28px;
  border-radius: 12px;
  font-weight: 500;
  font-size: 14px;
  border: none;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  letter-spacing: -0.01em;
}

.btn-primary {
  background: #0070e6;
  color: #FAFAFA;
  box-shadow: none;
  transition: transform 0.2s ease, background-color 0.2s ease;
}

.btn-primary:hover {
  transform: translateY(-1px);
  background: #0070e6;
  box-shadow: none;
}

.btn-secondary {
  background-color: rgba(35, 35, 35, 0.6);
  color: #D3D3D3;
  border: 1px solid rgba(231, 229, 228, 0.1);
}

body[data-theme='light'] .btn-secondary {
  background-color: rgb(246, 248, 251);
  color: #0f172a;
  border: 1px solid #e5e7eb;
  box-shadow: 0 10px 24px -18px rgba(15, 23, 42, 0.24);
}

body[data-theme='light'] .btn-secondary:hover {
  background-color: #ffffff;
  border-color: rgba(148, 163, 184, 0.18);
}

/* Modals */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.modal-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
}

body[data-theme='light'] .modal-backdrop {
  background: rgba(30, 41, 59, 0.35);
}

.modal-dialog {
  position: relative;
  background: rgba(35, 35, 35, 0.95);
  border-radius: 24px;
  border: 1px solid rgba(231, 229, 228, 0.1);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7);
  width: 90%;
  max-width: 1200px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  backdrop-filter: blur(20px);
}

body[data-theme='light'] .modal-dialog {
  background: rgba(255, 255, 255, 0.97);
  border: 1px solid rgba(148, 163, 184, 0.28);
  box-shadow: 0 28px 60px -24px rgba(15, 23, 42, 0.35);
}

.settings-modal {
  width: 50vw;
  max-width: 50%;
}

.settings-card {
  position: relative;
  z-index: 1001;
  width: 100%;
  max-width: 400px;
  background-color: #232323;
  padding: 20px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  overflow-y: auto;
  max-height: calc(90vh - 40px);
  scrollbar-width: none;
  /* Firefox */
  -ms-overflow-style: none;
  /* IE and Edge */
}

/* Hide scrollbar for Chrome, Safari and Opera */
.settings-card::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}

body[data-theme='light'] .settings-card {
  background-color: rgba(255, 255, 255, 0.95);
  border: 1px solid rgba(148, 163, 184, 0.25);
  box-shadow: 0 25px 55px -18px rgba(15, 23, 42, 0.28);
  scrollbar-width: none;
  /* Firefox */
  -ms-overflow-style: none;
  /* IE and Edge */
}

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

#settingsTitle {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 24px;
}

.settings-header h2 {
  font-size: 18px;
  font-weight: 600;
  color: white;
  margin: 0;
}

body[data-theme='light'] .settings-header h2 {
  color: #0f172a;
}

.modal-header {
  padding: 28px;
  border-bottom: 1px solid rgba(231, 229, 228, 0.08);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: rgba(45, 45, 45, 0.7);
  color: #E5E5E5;
  border-radius: 24px 24px 0 0;
}

body[data-theme='light'] .modal-header {
  background-color: rgba(248, 250, 252, 0.92);
  color: #0f172a;
  border-bottom: 1px solid rgba(203, 213, 225, 0.55);
}

.modal-body {
  padding: 24px;
  overflow-y: auto;
  flex: 1;
  max-height: calc(90vh - 200px);
  color: #9ca3af;
  font-size: 14px;
}

body[data-theme='light'] .modal-body {
  color: #475569;
  background-color: #fff;
}

.modal-footer {
  padding: 16px 24px;
  background-color: rgba(45, 45, 45, 0.7);
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  border-bottom-left-radius: 16px;
  border-bottom-right-radius: 16px;
}

body[data-theme='light'] .modal-footer {
  background-color: rgba(248, 250, 252, 0.92);
  border-top: 1px solid rgba(203, 213, 225, 0.55);
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 28px;
  padding-top: 28px;
  border-top: 1px solid rgba(231, 229, 228, 0.08);
}

body[data-theme='light'] .modal-actions {
  border-top: 1px solid rgba(203, 213, 225, 0.55);
}

.confirm-dialog {
  max-width: 440px;
  width: min(92vw, 440px);
  max-height: none;
  background-color: rgb(30, 30, 30);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 30px 60px -12px rgba(0, 0, 0, 0.5), 0 18px 36px -18px rgba(0, 0, 0, 0.5);
}

.confirm-modal-header {
  border-radius: 24px 24px 0 0;
  padding: 24px 28px 12px;
  background: transparent;
  border-bottom: none;
}

.confirm-icon-container {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background-color: rgba(0, 122, 252, 0.15);
  color: #007AFC;
}

.confirm-btn-danger .confirm-icon-container,
.modal-dialog:has(.confirm-btn-danger) .confirm-icon-container {
  background-color: rgba(220, 38, 38, 0.15);
  color: #ef4444;
}

.confirm-modal-header h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  color: #f3f4f6;
}

.confirm-modal-body {
  padding: 8px 28px 24px;
  max-height: none;
  color: #9ca3af;
}

.confirm-modal-body p {
  margin: 0;
  line-height: 1.6;
  font-size: 15px;
}

.confirm-modal-footer {
  padding: 16px 28px 28px;
  justify-content: flex-end;
  background: transparent;
  border-top: none;
}

.confirm-btn-danger {
  background-color: #dc2626;
  border: none;
  color: #ffffff;
}

.confirm-btn-danger:hover {
  background-color: #b91c1c;
}

/* Light Theme Overrides */
body[data-theme='light'] .confirm-dialog {
  background-color: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: 0 30px 60px -12px rgba(15, 23, 42, 0.15), 0 18px 36px -18px rgba(15, 23, 42, 0.1);
}

body[data-theme='light'] .confirm-modal-header h2 {
  color: #1f2937;
}

body[data-theme='light'] .confirm-modal-body {
  color: #4b5563;
}

body[data-theme='light'] .confirm-icon-container {
  background-color: rgba(0, 122, 252, 0.08);
}

/* Diff Viewer - Claude-Inspired Design */
.diff-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: clamp(10px, 2vh, 20px);
  padding-bottom: clamp(10px, 2vh, 20px);
  border-bottom: 1px solid rgba(231, 229, 228, 0.08);
}

body[data-theme='light'] .diff-controls {
  border-bottom: 1px solid rgba(203, 213, 225, 0.55);
}

.diff-status {
  font-size: 14px;
  font-weight: 500;
  padding: 6px 16px;
  border-radius: 9999px;
  letter-spacing: 0.01em;
}

.status-unchanged {
  background: rgba(200, 200, 200, 0.15);
  color: #C8C8C8;
  border: 1px solid rgba(200, 200, 200, 0.25);
}

.status-changed {
  background: rgba(196, 196, 196, 0.15);
  color: #C4C4C4;
  border: 1px solid rgba(196, 196, 196, 0.25);
}

.status-deleted {
  background: rgba(191, 191, 191, 0.15);
  color: #BFBFBF;
  border: 1px solid rgba(191, 191, 191, 0.25);
}

body[data-theme='light'] .status-unchanged {
  background: rgba(226, 232, 240, 0.8);
  color: #475569;
  border-color: rgba(203, 213, 225, 0.8);
}

body[data-theme='light'] .status-changed {
  background: rgba(254, 226, 226, 0.8);
  color: #b91c1c;
  border-color: rgba(254, 202, 202, 0.8);
}

body[data-theme='light'] .status-deleted {
  background: rgba(254, 242, 242, 0.85);
  color: #dc2626;
  border-color: rgba(254, 215, 215, 0.85);
}

.diff-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(10px, 2vh, 20px);
}

.diff-column {
  background: linear-gradient(135deg, rgba(25, 25, 25, 0.6) 0%, rgba(20, 18, 17, 0.4) 100%);
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid rgba(231, 229, 228, 0.06);
  box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(12px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  height: 100%;
  box-sizing: border-box;
}

body[data-theme='light'] .diff-column {
  background: #ffffff;
  border: 1px solid rgba(203, 213, 225, 0.5);
  box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.1);
}

.diff-column h3 {
  font-size: 14px;
  font-weight: 500;
  padding: clamp(10px, 1.5vh, 16px) clamp(12px, 1.8vh, 20px);
  background: linear-gradient(135deg, rgba(35, 35, 35, 0.8) 0%, rgba(25, 25, 25, 0.6) 100%);
  border-bottom: 1px solid rgba(231, 229, 228, 0.08);
  margin: 0;
  color: #E5E5E5;
  letter-spacing: -0.01em;
}

body[data-theme='light'] .diff-column h3 {
  background: #f8fafc;
  border-bottom: 1px solid rgba(203, 213, 225, 0.6);
  color: #0f172a;
}

.diff-content {
  background: #1e1e1e;
  color: #e0e0e0;
  font-family: 'Fira Code', 'SF Mono', 'Menlo', 'Monaco', 'Consolas', monospace;
  font-size: 13px;
  line-height: 1.5;
  padding: clamp(10px, 2vh, 20px);
  overflow-x: auto;
  white-space: pre;
  flex: 1;
  margin: 0;
  border-radius: 0 0 16px 16px;
  height: 100%;
  box-sizing: border-box;
}

body[data-theme='light'] .diff-content {
  background: #ffffff;
  color: #1f2937;
  border-radius: 0 0 16px 16px;
}

body[data-theme='light'] .yaml-content {
  color: #1f2937;
  background: #ffffff;
}

.yaml-content {
  padding: clamp(10px, 2vh, 20px);
  margin: 0;
  font-family: 'SF Mono', 'Monaco', 'Menlo', 'Consolas', monospace;
  font-size: 13px;
  line-height: 1.7;
  color: #D3D3D3;
  overflow-x: auto;
  white-space: pre-wrap;
  word-wrap: break-word;
}

body[data-theme='light'] .yaml-content {
  background: #ffffff;
  color: #1e293b;
}

/* Form Elements */
.form-group {
  margin-bottom: 24px;
}

.form-group--stacked {
  display: flex;
  flex-direction: column;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 400;
  color: #d1d5db;
  letter-spacing: -0.01em;
  font-size: 14px;
}

body[data-theme='light'] .settings-card,
body[data-theme='light'] .settings-card label,
body[data-theme='light'] .settings-card .settings-inline-text,
body[data-theme='light'] .settings-card .settings-inline-btn,
body[data-theme='light'] .settings-card .settings-error-text,
body[data-theme='light'] .settings-card .settings-inline-text.status-success {
  color: #111827;
}

body[data-theme='light'] .settings-card .settings-inline-text.status-success {
  color: #16a34a;
}

body[data-theme='light'] .settings-card .settings-inline-text.status-error {
  color: #dc2626;
}

.form-group input[type="text"],
.form-group input[type="password"],
.form-group input[type="time"],
.form-group input[type="number"],
.form-group select {
  width: 100%;
  height: 40px;
  padding: 8px 12px;
  background-color: #2d2d2d;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  font-size: 14px;
  color: #d1d5db;
  box-sizing: border-box;
  transition: border-color 0.2s;
}

body[data-theme='light'] .form-group input[type="text"],
body[data-theme='light'] .form-group input[type="password"],
body[data-theme='light'] .form-group input[type="time"],
body[data-theme='light'] .form-group input[type="number"],
body[data-theme='light'] .form-group select {
  background-color: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(148, 163, 184, 0.14);
  color: #4b5563;
}

#scheduleFrequency:focus {
  outline: none !important;
  box-shadow: none !important;
}

.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: rgba(0, 122, 255, 0.3);
  box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.1);
}

.form-group select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%23A8A29E' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
  background-position: right 16px center;
  background-repeat: no-repeat;
  background-size: 1em;
  padding-right: 42px;
}

body[data-theme='light'] .form-group select {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%234b5563' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.8' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
  background-color: #ffffff;
  border: 1px solid rgba(148, 163, 184, 0.3);
  color: #1f2937;
}

body[data-theme='light'] .form-group select:focus {
  border-color: rgba(59, 130, 246, 0.5);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.time-input {
  font-family: Arial, Helvetica, sans-serif;
}

.form-group input[type="time"]::-webkit-calendar-picker-indicator {
  display: none;
}

.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.form-row .form-group {
  width: 100%;
}

@media (max-width: 500px) {
  .form-row {
    grid-template-columns: 1fr;
  }
}

.settings-inline-btn {
  align-self: flex-start;
  margin-top: 12px;
  padding: 14px 18px;
  min-height: 48px;
  border-radius: 12px;
  font-weight: 500;
  font-size: 14px;
  background-color: rgba(56, 56, 56, 0.8);
  color: #D3D3D3;
  border: 1px solid rgba(231, 229, 228, 0.1);
}

body[data-theme='light'] .settings-inline-btn {
  background-color: rgba(255, 255, 255, 0.95);
  color: #0f172a;
  border: 1px solid rgba(148, 163, 184, 0.12);
  box-shadow: 0 10px 24px -18px rgba(15, 23, 42, 0.24);
}

.settings-inline-text {
  margin-top: 4px;
  font-size: 13px;
  color: #A2A2A2;
  min-width: 140px;
  display: inline-block;
}

body[data-theme='light'] .settings-inline-text {
  color: #475569;
}

body[data-theme='light'] .settings-inline-text.status-success {
  color: #16a34a;
}

body[data-theme='light'] .settings-inline-text.status-error {
  color: #dc2626;
}

.settings-error-text {
  color: #ef4444;
  font-size: 12px;
  min-height: 18px;
  margin-top: 8px;
  line-height: 1.4;
}

body[data-theme='light'] .settings-error-text {
  color: #b91c1c;
}

/* Hide HA connection fields when managed by supervisor */
.ha-connection-fields.managed-by-supervisor {
  display: none;
}

.settings-divider {
  border-top: 1px solid rgba(231, 229, 228, 0.08);
  margin: 20px 0 16px;
}

body[data-theme='light'] .settings-divider {
  border-top: 1px solid rgba(203, 213, 225, 0.55);
}

.settings-schedule {
  display: none;
  margin-top: 16px;
}

.settings-schedule[data-frequency="daily"] .form-row,
.settings-schedule[data-frequency="hourly"] .form-row,
.settings-schedule[data-frequency="weekly"] .form-row {
  display: grid;
  gap: 12px;
}

.settings-schedule[data-frequency="daily"] .form-row {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.settings-schedule[data-frequency="hourly"] .form-row {
  grid-template-columns: minmax(0, 1fr);
}

.settings-schedule[data-frequency="weekly"] .form-row {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.settings-schedule[data-frequency="hourly"] #scheduleFrequency {
  width: 100%;
}

#scheduleOptions .form-group:last-of-type {
  margin-bottom: 0;
}

#scheduleOptions .form-row .form-group {
  margin-bottom: 0;
}

#maxBackupsOptions {
  margin-top: 16px;
}

#maxBackupsCount::-webkit-inner-spin-button,
#maxBackupsCount::-webkit-outer-spin-button {
  display: none;
  margin: 0;
  height: 20px;
  position: relative;
  right: 4px;
}

#maxBackupsCount {
  -webkit-appearance: textfield;
  -moz-appearance: textfield;
  appearance: textfield;
}

.settings-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 20px;
}

/* Toggle Switch - Claude Style */
.toggle-group {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.toggle {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 28px;
}

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

.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(120, 113, 108, 0.4);
  transition: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 28px;
}

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

.toggle input:checked+.toggle-slider {
  background: #007AFF;
}

.toggle input:checked+.toggle-slider:before {
  transform: translateX(22px);
}

body[data-theme='light'] .toggle-slider {
  background-color: rgba(148, 163, 184, 0.35);
}

body[data-theme='light'] .toggle-slider:before {
  background-color: #ffffff;
  box-shadow: 0 2px 6px rgba(148, 163, 184, 0.35);
}

/* Notification Toast */
.notification {
  position: fixed;
  top: 24px;
  right: 24px;
  padding: 16px 28px;
  border-radius: 14px;
  color: #FAFAFA;
  font-weight: 500;
  z-index: 2000;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
  animation: slideIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(12px);
}

body[data-theme='light'] .notification {
  border: 1px solid rgba(148, 163, 184, 0.25);
  box-shadow: 0 16px 34px -18px rgba(15, 23, 42, 0.35);
  color: #0f172a;
}

.notification.success {
  background: rgba(0, 200, 0, 0.9);
  color: #ffffff;
  text-shadow: 0 0 3px rgba(0, 0, 0, 0.3);
}

body[data-theme='light'] .notification.success {
  background: #22c55e;
  color: #ffffff;
}

.notification.error {
  background: rgba(239, 68, 68, 0.95);
}

body[data-theme='light'] .notification.error {
  background: #ef4444;
  color: #ffffff;
}

.notification.info {
  background: rgba(0, 122, 255, 0.95);
}

body[data-theme='light'] .notification.info {
  background: #3b82f6;
  color: #ffffff;
}

.diff-state-banner {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 42px;
  padding: 0 16px;
  font-size: 14px;
  font-weight: 500;
  border-radius: 8px;
  border: 1px solid;
  margin-bottom: 16px;
}

body[data-theme='light'] .diff-state-banner {
  border: 1px solid rgba(148, 163, 184, 0.35);
}

.diff-state-banner-deleted {
  background-color: rgba(239, 68, 68, 0.15);
  color: #ef4444;
  border-color: rgba(239, 68, 68, 0.25);
}

body[data-theme='light'] .diff-state-banner-deleted {
  background-color: rgba(254, 226, 226, 0.8);
  color: #b91c1c;
  border-color: rgba(254, 202, 202, 0.8);
}

.diff-state-banner-unchanged {
  background-color: rgba(34, 197, 94, 0.15);
  color: #22c55e;
  border-color: rgba(34, 197, 94, 0.25);
}

body[data-theme='light'] .diff-state-banner-unchanged {
  background: rgba(220, 252, 231, 0.8);
  color: #15803d;
  border-color: rgba(187, 247, 208, 0.8);
}

.diff-state-banner-changed {
  background-color: rgba(59, 130, 246, 0.15);
  color: #3b82f6;
  border-color: rgba(59, 130, 246, 0.25);
}

body[data-theme='light'] .diff-state-banner-changed {
  background: rgba(219, 234, 254, 0.8);
  color: #1d4ed8;
  border-color: rgba(191, 219, 254, 0.8);
}

/* Palette-aware diff header banners - palette 1 uses default blue */

[data-diff-palette="2"] .diff-state-banner-changed {
  background-color: rgba(0, 191, 165, 0.18);
  color: #00BFA5;
  border-color: rgba(0, 191, 165, 0.3);
}

body[data-theme='light'] [data-diff-palette="2"] .diff-state-banner-changed {
  background-color: rgba(0, 191, 165, 0.12);
  color: #00897b;
  border-color: rgba(0, 191, 165, 0.25);
}

[data-diff-palette="3"] .diff-state-banner-changed {
  background-color: rgba(0, 172, 193, 0.18);
  color: #00ACC1;
  border-color: rgba(0, 172, 193, 0.3);
}

body[data-theme='light'] [data-diff-palette="3"] .diff-state-banner-changed {
  background-color: rgba(0, 172, 193, 0.12);
  color: #0097a7;
  border-color: rgba(0, 172, 193, 0.25);
}

[data-diff-palette="4"] .diff-state-banner-changed {
  background-color: rgba(118, 255, 3, 0.15);
  color: #76FF03;
  border-color: rgba(118, 255, 3, 0.25);
}

body[data-theme='light'] [data-diff-palette="4"] .diff-state-banner-changed {
  background-color: rgba(76, 175, 80, 0.12);
  color: #388e3c;
  border-color: rgba(76, 175, 80, 0.25);
}

[data-diff-palette="5"] .diff-state-banner-changed {
  background-color: rgba(32, 178, 170, 0.2);
  color: #20B2AA;
  border-color: rgba(32, 178, 170, 0.3);
}

body[data-theme='light'] [data-diff-palette="5"] .diff-state-banner-changed {
  background-color: rgba(32, 178, 170, 0.12);
  color: #26a69a;
  border-color: rgba(32, 178, 170, 0.25);
}

[data-diff-palette="6"] .diff-state-banner-changed {
  background-color: rgba(46, 125, 50, 0.2);
  color: #4CAF50;
  border-color: rgba(46, 125, 50, 0.3);
}

body[data-theme='light'] [data-diff-palette="6"] .diff-state-banner-changed {
  background-color: rgba(46, 125, 50, 0.12);
  color: #2e7d32;
  border-color: rgba(46, 125, 50, 0.25);
}

[data-diff-palette="7"] .diff-state-banner-changed {
  background-color: rgba(77, 208, 225, 0.18);
  color: #4DD0E1;
  border-color: rgba(77, 208, 225, 0.3);
}

body[data-theme='light'] [data-diff-palette="7"] .diff-state-banner-changed {
  background-color: rgba(6, 182, 212, 0.12);
  color: #0891b2;
  border-color: rgba(6, 182, 212, 0.25);
}

[data-diff-palette="8"] .diff-state-banner-changed {
  background-color: rgba(0, 229, 255, 0.15);
  color: #00E5FF;
  border-color: rgba(0, 229, 255, 0.25);
}

body[data-theme='light'] [data-diff-palette="8"] .diff-state-banner-changed {
  background-color: rgba(6, 182, 212, 0.12);
  color: #0891b2;
  border-color: rgba(6, 182, 212, 0.25);
}

@keyframes slideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }

  to {
    transform: translateX(0);
    opacity: 1;
  }
}

hr {
  border: none;
  border-top: 1px solid rgba(231, 229, 228, 0.08);
  margin: 28px 0;
}

body[data-theme='light'] hr {
  border-top: 1px solid rgba(203, 213, 225, 0.55);
}

h3 {
  font-size: 17px;
  font-weight: 600;
  margin-bottom: 20px;
  color: #F9F9F9;
  letter-spacing: -0.02em;
}

body[data-theme='light'] h3 {
  color: #0f172a;
}

/* Diff Color Palette Selector - hidden, cycles via header click */
.diff-palette-bar {
  display: none;
}

body[data-theme='light'] .diff-palette-bar {
  display: none;
}

/* Make banner clickable for palette cycling */
.diff-banners-grid {
  cursor: pointer;
  user-select: none;
}

.diff-palette-label {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.5);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-right: 4px;
}

body[data-theme='light'] .diff-palette-label {
  color: rgba(0, 0, 0, 0.5);
}

.diff-palette-btn {
  display: flex;
  width: 32px;
  height: 20px;
  border-radius: 4px;
  overflow: hidden;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all 0.15s ease;
}

.diff-palette-btn:hover {
  transform: scale(1.1);
}

.diff-palette-btn.active {
  border-color: #60a5fa;
  box-shadow: 0 0 0 2px rgba(96, 165, 250, 0.3);
}

.diff-palette-btn-left,
.diff-palette-btn-right {
  width: 50%;
  height: 100%;
}

/* Palette 1: Original */
.diff-palette-btn[data-palette="1"] .diff-palette-btn-left {
  background: rgba(111, 23, 35, 0.8);
}

.diff-palette-btn[data-palette="1"] .diff-palette-btn-right {
  background: rgba(24, 57, 41, 0.8);
}

/* Palette 2: Rose & Emerald */
.diff-palette-btn[data-palette="2"] .diff-palette-btn-left {
  background: rgba(233, 30, 99, 0.4);
}

.diff-palette-btn[data-palette="2"] .diff-palette-btn-right {
  background: rgba(0, 191, 165, 0.4);
}

/* Palette 3: Sunset & Ocean */
.diff-palette-btn[data-palette="3"] .diff-palette-btn-left {
  background: rgba(255, 87, 34, 0.45);
}

.diff-palette-btn[data-palette="3"] .diff-palette-btn-right {
  background: rgba(0, 172, 193, 0.45);
}

/* Palette 4: Berry & Lime */
.diff-palette-btn[data-palette="4"] .diff-palette-btn-left {
  background: rgba(156, 39, 176, 0.4);
}

.diff-palette-btn[data-palette="4"] .diff-palette-btn-right {
  background: rgba(118, 255, 3, 0.35);
}

/* Palette 5: Salmon & Seafoam */
.diff-palette-btn[data-palette="5"] .diff-palette-btn-left {
  background: rgba(250, 128, 114, 0.5);
}

.diff-palette-btn[data-palette="5"] .diff-palette-btn-right {
  background: rgba(32, 178, 170, 0.45);
}

/* Palette 6: Ruby & Jade */
.diff-palette-btn[data-palette="6"] .diff-palette-btn-left {
  background: rgba(198, 40, 40, 0.5);
}

.diff-palette-btn[data-palette="6"] .diff-palette-btn-right {
  background: rgba(46, 125, 50, 0.5);
}

/* Palette 7: Peach & Aqua */
.diff-palette-btn[data-palette="7"] .diff-palette-btn-left {
  background: rgba(255, 171, 145, 0.55);
}

.diff-palette-btn[data-palette="7"] .diff-palette-btn-right {
  background: rgba(77, 208, 225, 0.45);
}

/* Palette 8: Magenta & Cyan */
.diff-palette-btn[data-palette="8"] .diff-palette-btn-left {
  background: rgba(255, 64, 129, 0.4);
}

.diff-palette-btn[data-palette="8"] .diff-palette-btn-right {
  background: rgba(0, 229, 255, 0.35);
}

/* Palette color overrides when applied */
/* Palette 1: Original solid alternating colors */
[data-diff-palette="1"] .diff-line-removed {
  background: rgb(92, 22, 32);
}

[data-diff-palette="1"] .diff-row:nth-child(even) .diff-line-removed {
  background: rgb(111, 23, 35);
}

[data-diff-palette="1"] .diff-line-added {
  background: rgb(21, 42, 32);
}

[data-diff-palette="1"] .diff-row:nth-child(even) .diff-line-added {
  background: rgb(24, 57, 41);
}

[data-diff-palette="1"] .diff-line-removed .diff-line-marker {
  color: rgb(220, 120, 130);
}

[data-diff-palette="1"] .diff-line-added .diff-line-marker {
  color: rgb(100, 200, 130);
}

[data-diff-palette="2"] .diff-line-removed {
  background: rgba(233, 30, 99, 0.18);
}

[data-diff-palette="2"] .diff-line-added {
  background: rgba(0, 191, 165, 0.18);
}

[data-diff-palette="2"] .diff-line-removed .diff-line-marker {
  color: #E91E63;
}

[data-diff-palette="2"] .diff-line-added .diff-line-marker {
  color: #00BFA5;
}

[data-diff-palette="3"] .diff-line-removed {
  background: rgba(255, 87, 34, 0.2);
}

[data-diff-palette="3"] .diff-line-added {
  background: rgba(0, 172, 193, 0.2);
}

[data-diff-palette="3"] .diff-line-removed .diff-line-marker {
  color: #FF5722;
}

[data-diff-palette="3"] .diff-line-added .diff-line-marker {
  color: #00ACC1;
}

[data-diff-palette="4"] .diff-line-removed {
  background: rgba(156, 39, 176, 0.18);
}

[data-diff-palette="4"] .diff-line-added {
  background: rgba(118, 255, 3, 0.15);
}

[data-diff-palette="4"] .diff-line-removed .diff-line-marker {
  color: #9C27B0;
}

[data-diff-palette="4"] .diff-line-added .diff-line-marker {
  color: #76FF03;
}

[data-diff-palette="5"] .diff-line-removed {
  background: rgba(250, 128, 114, 0.22);
}

[data-diff-palette="5"] .diff-line-added {
  background: rgba(32, 178, 170, 0.2);
}

[data-diff-palette="5"] .diff-line-removed .diff-line-marker {
  color: #FA8072;
}

[data-diff-palette="5"] .diff-line-added .diff-line-marker {
  color: #20B2AA;
}

[data-diff-palette="6"] .diff-line-removed {
  background: rgba(198, 40, 40, 0.22);
}

[data-diff-palette="6"] .diff-line-added {
  background: rgba(46, 125, 50, 0.22);
}

[data-diff-palette="6"] .diff-line-removed .diff-line-marker {
  color: #C62828;
}

[data-diff-palette="6"] .diff-line-added .diff-line-marker {
  color: #2E7D32;
}

[data-diff-palette="7"] .diff-line-removed {
  background: rgba(255, 171, 145, 0.28);
}

[data-diff-palette="7"] .diff-line-added {
  background: rgba(77, 208, 225, 0.22);
}

[data-diff-palette="7"] .diff-line-removed .diff-line-marker {
  color: #FFAB91;
}

[data-diff-palette="7"] .diff-line-added .diff-line-marker {
  color: #4DD0E1;
}

[data-diff-palette="8"] .diff-line-removed {
  background: rgba(255, 64, 129, 0.18);
}

[data-diff-palette="8"] .diff-line-added {
  background: rgba(0, 229, 255, 0.15);
}

[data-diff-palette="8"] .diff-line-removed .diff-line-marker {
  color: #FF4081;
}

[data-diff-palette="8"] .diff-line-added .diff-line-marker {
  color: #00E5FF;
}

/* Light mode palette overrides - stronger colors for visibility */
/* Palette 1: Original colors with alternating for light mode */
body[data-theme='light'] [data-diff-palette="1"] .diff-line-removed {
  background: rgba(220, 38, 38, 0.18);
}

body[data-theme='light'] [data-diff-palette="1"] .diff-row:nth-child(even) .diff-line-removed {
  background: rgba(220, 38, 38, 0.25);
}

body[data-theme='light'] [data-diff-palette="1"] .diff-line-added {
  background: rgba(22, 163, 74, 0.15);
}

body[data-theme='light'] [data-diff-palette="1"] .diff-row:nth-child(even) .diff-line-added {
  background: rgba(22, 163, 74, 0.22);
}

body[data-theme='light'] [data-diff-palette="1"] .diff-line-removed .diff-line-marker {
  color: #dc2626;
}

body[data-theme='light'] [data-diff-palette="1"] .diff-line-added .diff-line-marker {
  color: #16a34a;
}

body[data-theme='light'] [data-diff-palette="2"] .diff-line-removed {
  background: rgba(233, 30, 99, 0.18);
}

body[data-theme='light'] [data-diff-palette="2"] .diff-line-added {
  background: rgba(0, 191, 165, 0.18);
}

body[data-theme='light'] [data-diff-palette="2"] .diff-line-removed .diff-line-marker {
  color: #c2185b;
}

body[data-theme='light'] [data-diff-palette="2"] .diff-line-added .diff-line-marker {
  color: #00897b;
}

body[data-theme='light'] [data-diff-palette="3"] .diff-line-removed {
  background: rgba(255, 87, 34, 0.2);
}

body[data-theme='light'] [data-diff-palette="3"] .diff-line-added {
  background: rgba(0, 172, 193, 0.2);
}

body[data-theme='light'] [data-diff-palette="3"] .diff-line-removed .diff-line-marker {
  color: #e64a19;
}

body[data-theme='light'] [data-diff-palette="3"] .diff-line-added .diff-line-marker {
  color: #0097a7;
}

body[data-theme='light'] [data-diff-palette="4"] .diff-line-removed {
  background: rgba(156, 39, 176, 0.18);
}

body[data-theme='light'] [data-diff-palette="4"] .diff-line-added {
  background: rgba(76, 175, 80, 0.2);
}

body[data-theme='light'] [data-diff-palette="4"] .diff-line-removed .diff-line-marker {
  color: #7b1fa2;
}

body[data-theme='light'] [data-diff-palette="4"] .diff-line-added .diff-line-marker {
  color: #388e3c;
}

body[data-theme='light'] [data-diff-palette="5"] .diff-line-removed {
  background: rgba(250, 128, 114, 0.25);
}

body[data-theme='light'] [data-diff-palette="5"] .diff-line-added {
  background: rgba(32, 178, 170, 0.22);
}

body[data-theme='light'] [data-diff-palette="5"] .diff-line-removed .diff-line-marker {
  color: #e57373;
}

body[data-theme='light'] [data-diff-palette="5"] .diff-line-added .diff-line-marker {
  color: #26a69a;
}

body[data-theme='light'] [data-diff-palette="6"] .diff-line-removed {
  background: rgba(198, 40, 40, 0.2);
}

body[data-theme='light'] [data-diff-palette="6"] .diff-line-added {
  background: rgba(46, 125, 50, 0.2);
}

body[data-theme='light'] [data-diff-palette="6"] .diff-line-removed .diff-line-marker {
  color: #c62828;
}

body[data-theme='light'] [data-diff-palette="6"] .diff-line-added .diff-line-marker {
  color: #2e7d32;
}

body[data-theme='light'] [data-diff-palette="7"] .diff-line-removed {
  background: rgba(239, 68, 68, 0.18);
}

body[data-theme='light'] [data-diff-palette="7"] .diff-line-added {
  background: rgba(6, 182, 212, 0.2);
}

body[data-theme='light'] [data-diff-palette="7"] .diff-line-removed .diff-line-marker {
  color: #ef4444;
}

body[data-theme='light'] [data-diff-palette="7"] .diff-line-added .diff-line-marker {
  color: #0891b2;
}

body[data-theme='light'] [data-diff-palette="8"] .diff-line-removed {
  background: rgba(236, 72, 153, 0.18);
}

body[data-theme='light'] [data-diff-palette="8"] .diff-line-added {
  background: rgba(6, 182, 212, 0.18);
}

body[data-theme='light'] [data-diff-palette="8"] .diff-line-removed .diff-line-marker {
  color: #db2777;
}

body[data-theme='light'] [data-diff-palette="8"] .diff-line-added .diff-line-marker {
  color: #0891b2;
}

/* Diff Viewer - Split Layout */
.diff-viewer-shell {
  background: linear-gradient(135deg, rgba(22, 22, 22, 0.95) 0%, rgba(14, 14, 14, 0.92) 100%);
  border-radius: 16px;
  overflow: hidden;
  font-family: 'Fira Code', 'JetBrains Mono', 'SF Mono', 'Monaco', monospace;
  font-size: 13px;
  line-height: 1.45;
  height: 100%;
  display: flex;
  flex-direction: column;
}

body[data-theme='light'] .diff-viewer-shell {
  background: #ffffff;
}

.diff-compare-banner {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  padding: 16px 18px 14px;
  background: rgba(30, 30, 30, 0.9);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

body[data-theme='light'] .diff-compare-banner {
  background: #f8fafc;
  border-bottom: 1px solid rgba(203, 213, 225, 0.5);
}

.diff-compare-pill {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border-radius: 9999px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.01em;
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: rgba(45, 45, 45, 0.9);
  color: #d1d5db;
}

body[data-theme='light'] .diff-compare-pill {
  background: rgba(241, 245, 249, 0.85);
  border-color: rgba(148, 163, 184, 0.35);
  color: #0f172a;
}

.diff-compare-pill-accent {
  background: rgba(37, 99, 235, 0.2);
  color: #60a5fa;
  border-color: rgba(37, 99, 235, 0.35);
  box-shadow: inset 0 0 0 1px rgba(37, 99, 235, 0.2);
}

body[data-theme='light'] .diff-compare-pill-accent {
  background: rgba(59, 130, 246, 0.22);
  border-color: rgba(59, 130, 246, 0.35);
  color: #1d4ed8;
}

.diff-viewer-split {
  background: rgba(18, 18, 18, 0.95);
  border-radius: 0 0 16px 16px;
  overflow: hidden;
  flex: 1;
  display: flex;
  flex-direction: column;
}

body[data-theme='light'] .diff-viewer-split {
  background: #ffffff;
}

.diff-hunks {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 0;
  flex: 1;
}

.diff-hunk {
  background: rgba(26, 26, 26, 0.9);
  border-radius: 0;
  overflow: hidden;
  flex: 1;
}

body[data-theme='light'] .diff-hunk {
  background: #ffffff;
}

.diff-hunk-content {
  position: relative;
}

.diff-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: rgba(15, 15, 15, 0.32);
}

body[data-theme='light'] .diff-row {
  background: #ffffff;
}

.diff-row:nth-child(even) {
  background: rgba(35, 35, 40, 0.65);
}

/* Palette 1 uses its own solid alternating colors, so disable general alternating */
[data-diff-palette="1"] .diff-row:nth-child(even) {
  background: transparent;
}

body[data-theme='light'] .diff-row:nth-child(even) {
  background: #f4f6fb;
}

.diff-row.diff-row-context {
  background: rgba(12, 12, 12, 0.25);
}

body[data-theme='light'] .diff-row.diff-row-context {
  background: #e2e8f0;
}

.diff-cell {
  position: relative;
  border-top: 1px solid rgba(255, 255, 255, 0.04);
}

body[data-theme='light'] .diff-cell {
  border-top: 1px solid rgba(203, 213, 225, 0.6);
}

.diff-row:first-child .diff-cell {
  border-top: none;
}

.diff-cell-left {
  border-right: 1px solid rgba(255, 255, 255, 0.05);
}

body[data-theme='light'] .diff-cell-left {
  border-right: 1px solid rgba(203, 213, 225, 0.6);
}

.diff-hunk-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  background: rgba(32, 32, 32, 0.8);
  border-top: 1px solid rgba(255, 255, 255, 0.04);
}

body[data-theme='light'] .diff-hunk-footer {
  background: #ffffff;
  border-top: 1px solid rgba(203, 213, 225, 0.6);
  border-bottom-left-radius: 12px;
  border-bottom-right-radius: 12px;
}

.diff-hunk-summary {
  font-size: 12px;
  color: #9ca3af;
}

body[data-theme='light'] .diff-hunk-summary {
  color: #475569;
}

.diff-context-toggle {
  background: none;
  border: none;
  color: #60a5fa;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
  text-decoration-color: rgba(96, 165, 250, 0.4);
  transition: color 0.2s ease;
}

.diff-context-toggle:hover {
  color: #93c5fd;
}

body[data-theme='light'] .diff-context-toggle {
  color: #2563eb;
  text-decoration-color: rgba(37, 99, 235, 0.45);
  background: white;
}

body[data-theme='light'] .diff-context-toggle:hover {
  color: #3b82f6;
}

.diff-hunk--context-collapsed .diff-row-context {
  display: none;
}


.diff-line {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 14px;
  min-height: 28px;
  transition: background-color 0.2s ease;
}

body[data-theme='light'] .diff-line {
  background: rgba(255, 255, 255, 0.95);
}

.diff-line-left {
  border-radius: 0;
}

.diff-line-right {
  border-radius: 0;
}

.diff-line-empty {
  height: 30px;
}

.diff-line-context {
  background: rgba(25, 25, 25, 0.55);
  color: rgba(148, 163, 184, 0.6);
}

body[data-theme='light'] .diff-line-context {
  background: white;
  color: rgba(71, 85, 105, 0.75);
}

.diff-line-added {
  background: rgba(63, 185, 80, 0.12);
}

body[data-theme='light'] .diff-line-added {
  background: rgba(63, 185, 80, 0.18);
}

.diff-line-removed {
  background: rgba(248, 81, 73, 0.12);
}

body[data-theme='light'] .diff-line-removed {
  background: rgba(248, 81, 73, 0.18);
}

.diff-line-removed .diff-line-marker {
  color: #f85149;
}

.diff-line-marker {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  width: 16px;
  text-align: center;
  font-weight: 600;
  font-size: 13px;
  user-select: none;
  color: rgba(148, 163, 184, 0.7);
  flex-shrink: 0;
}

body[data-theme='light'] .diff-line-marker {
  color: #64748b;
}

.diff-line-added .diff-line-marker {
  color: #3fb950;
}

.diff-line-removed .diff-line-marker {
  color: #f85149;
}


.diff-line-num {
  display: inline-flex;
  justify-content: flex-end;
  align-items: center;
  width: 42px;
  text-align: right;
  padding-right: 10px;
  color: rgba(168, 162, 158, 0.55);
  font-size: 11.5px;
  font-weight: 500;
  user-select: none;
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}

body[data-theme='light'] .diff-line-num {
  color: rgba(100, 116, 139, 0.75);
}

.diff-line-text {
  margin: 0;
  padding: 0;
  flex: 1;
  color: #e5e7eb;
  white-space: pre-wrap;
  word-break: break-word;
}

body[data-theme='light'] .diff-line-text {
  color: #1f2937;
}

.diff-line-text code {
  font-family: inherit;
  background: none;
  padding: 0;
  color: inherit;
}

body[data-theme='light'] .diff-line-text code {
  color: inherit;
}

body[data-theme='light'] #sortSelect,
body[data-theme='light'] #searchBox,
body[data-theme='light'] #scheduleFrequency,
body[data-theme='light'] #scheduleTime,
body[data-theme='light'] #haUrl,
body[data-theme='light'] #haToken,
body[data-theme='light'] #liveConfigPath,
body[data-theme='light'] #backupFolderPath,
body[data-theme='light'] #scheduleDay,
body[data-theme='light'] #liveConfigPath,
body[data-theme='light'] #backupFolderPath,
body[data-theme='light'] #haUrl,
body[data-theme='light'] #haToken,
body[data-theme='light'] #maxBackupsCount {
  background-color: rgba(255, 255, 255, 0.96) !important;
  border: 1px solid rgba(148, 163, 184, 0.35) !important;
  color: #0f172a !important;
  box-shadow: none !important;
}

body[data-theme='light'] #itemsList .list-item,
body[data-theme='light'] #backupList .list-item {
  background: #ffffff;
  border: 1px solid rgba(148, 163, 184, 0.22);
}

/* Responsive adjustments - Mobile view */
@media (max-width: 500px) {
  .content {
    grid-template-columns: 1fr;
    height: auto;
  }

  .panel {
    min-height: 0;
    max-height: 50vh;
    overflow-y: auto;
  }

  .diff-container {
    grid-template-columns: 1fr;
  }

  .diff-row {
    grid-template-columns: 1fr;
  }

  .diff-cell-left {
    border-right: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  }

  .diff-row .diff-cell:not(:last-child) {
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  }

  body[data-theme='light'] .diff-row .diff-cell:not(:last-child),
  body[data-theme='light'] .diff-cell-left {
    border-bottom: 1px solid rgba(203, 213, 225, 0.6);
  }
}

@media (max-width: 500px) {
  .header {
    flex-direction: column;
    align-items: flex-start;
  }

  .header .btn-secondary {
    width: 100%;
  }

  .tabs {
    width: 100%;
  }

  .panel-header-actions {
    width: 100%;
  }

  .panel-header-actions .select {
    width: 100%;
  }

  .search-section {
    width: 100%;
  }

  .search-input {
    width: 100%;
  }

  .notification {
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    width: calc(100% - 40px);
    max-width: 360px;
  }

  .diff-line-num {
    width: 40px;
    font-size: 11px;
  }

  .diff-line-marker {
    width: 16px;
    font-size: 13px;
  }
}

@media (max-width: 500px) {
  body {
    padding: 16px;
  }

  .container {
    padding-bottom: 16px;
  }

  .tabs {
    gap: 8px;
  }

  .tab {
    padding: 12px 20px;
  }

  .panel-header-top {
    flex-direction: column;
    align-items: stretch;
  }

  .header {
    margin-bottom: 28px;
  }

  .header h1 {
    font-size: 22px;
  }

  .content {
    grid-template-columns: 1fr;
    gap: 20px;
    height: auto;
  }

  .diff-line-num {
    width: 35px;
    font-size: 11px;
  }

  .diff-line-marker {
    width: 14px;
    font-size: 12px;
  }

  .diff-line-text {
    font-size: 12px;
  }

  .modal-dialog {
    width: 95%;
    max-height: 95vh;
  }

  .settings-card {
    max-width: 95vw;
    padding: 16px;
  }
}

/* Scrollbar styling - consistent across all scrollable elements */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.1);
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.25);
}

body[data-theme='light'] ::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.05);
}

body[data-theme='light'] ::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.2);
}

body[data-theme='light'] ::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 0, 0, 0.3);
}


/* Selection styling */
::selection {
  background: rgba(0, 122, 255, 0.3);
  color: #F9F9F9;
}

body[data-theme='light'] ::selection {
  background: rgba(0, 122, 255, 0.2);
  color: #0f172a;
}

::-moz-selection {
  background: rgba(0, 122, 255, 0.3);
  color: #F9F9F9;
}

body[data-theme='light'] ::-moz-selection {
  background: rgba(0, 122, 255, 0.2);
  color: #0f172a;
}

/* Focus visible for accessibility */
*:focus-visible {
  outline: 2px solid rgba(0, 122, 255, 0.5);
  outline-offset: 2px;
}

/* Style diff viewer version banners to match modal header */
.diff-header {
  padding: 12px 28px;
  background-color: rgba(35, 35, 35, 0.95);
  color: #f8fafc;
  font-size: 14px;
  font-weight: 500;
  border-bottom: 1px solid rgba(231, 229, 228, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

body[data-theme='light'] .diff-header {
  background-color: rgba(248, 250, 252, 0.92);
  color: #0f172a;
  border-bottom: 1px solid rgba(203, 213, 225, 0.55);
}

.diff-header .diff-title {
  font-weight: 600;
  font-size: 15px;
  color: inherit;
}

.diff-header .diff-timestamp {
  opacity: 0.8;
  font-weight: 400;
  font-size: 13px;
  margin-left: 12px;
}

.diff-banners-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  margin: 16px 18px 0 18px;
}

/* Standalone grid for the diff viewer */
.diff-banners-grid--standalone {
  margin: 0 18px 16px 18px;
  border-radius: 8px;
  /* Rounded corners all sides */
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.24);
  width: calc(100% - 36px);
  box-sizing: border-box;
}

body[data-theme='light'] .diff-banners-grid--standalone {
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
}

/* Ensure the diff viewer shell has matching width and margins */
.diff-viewer-shell {
  margin: 0 18px;
  width: calc(100% - 36px);
  box-sizing: border-box;
}

.diff-state-banner--header {
  margin: 0;
  border-radius: 0;
  height: 42px;
  font-weight: 500;
  font-size: 14px;
  letter-spacing: 0.01em;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.1);
}

/* Ensure consistent height and alignment */
.diff-state-banner--header .diff-state-label {
  display: flex;
  align-items: center;
  height: 100%;
  padding: 0 16px;
}

.diff-state-banner-current {
  background-color: rgba(156, 163, 175, 0.15);
  color: #d1d5db;
  border-color: rgba(156, 163, 175, 0.25);
  border-radius: 8px 0 0 8px;
  text-shadow: none;
}

body[data-theme='light'] .diff-state-banner-current {
  background-color: rgba(209, 213, 219, 0.8);
  color: #6b7280;
  border-color: rgba(209, 213, 219, 0.8);
}

.diff-state-banner-changed {
  border-radius: 0 8px 8px 0;
  /* Square left corners, rounded right corners */
  position: relative;
  /* For z-index handling */
  z-index: 1;
  /* Ensure it sits above the shell */
  overflow: hidden;
  /* Prevent content from showing in corners */
}

.diff-state-banner-empty {
  background-color: transparent;
  border: none;
  border-radius: 0 8px 8px 0;
}

.diff-header--versions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  margin-top: 8px;
}

.diff-header-section {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.diff-header-section--right {
  align-items: flex-end;
  text-align: right;
}

body[data-theme='light'] .diff-header-section--right {
  color: inherit;
}

.modal-body--diff {
  padding: 12px 24px;
}

.modal-footer--diff {
  padding: 24px;
  background-color: rgba(45, 45, 45, 0.7);
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

body[data-theme='light'] .modal-footer--diff {
  background-color: #ffffff;
  border-top: 1px solid rgba(203, 213, 225, 0.55);
}

.modal-footer--diff .btn-secondary,
.modal-footer--diff .btn-primary {
  padding: 12px 24px;
  border-radius: 8px;
}

.modal-footer--diff .btn-primary {
  box-shadow: none;
}

body[data-theme='light'] .modal-footer--diff .btn-primary {
  box-shadow: none;
}

/* Responsive adjustments for backup list */
@media (max-width: 500px) {
  .list {
    padding: 8px 4px;
  }

  .list-item {
    padding: 10px 12px;
    border-radius: 10px;
  }

  .list-item {
    padding: 4px 4px;
  }

  .item-content {
    gap: 8px;
  }

  .badge {
    padding: 4px 8px;
    font-size: 12px;
  }

  .item-badges {
    gap: 6px;
    margin-left: 8px;
  }

  /* Make badges stack vertically on very small screens */
  @media (max-width: 400px) {
    .item-badges {
      flex-direction: column;
      align-items: flex-end;
      gap: 4px;
    }
  }
}

/* Code Viewer */
.code-viewer {
  padding: 16px;
  border-radius: 12px;
  text-align: left;
  font-size: 14px;
  white-space: pre-wrap;
  margin-top: 8px;
  background-color: #1e1e1e;
  color: #d1d5db;
  border: 1px solid rgba(255, 255, 255, 0.05);
  font-family: 'Fira Code', 'SF Mono', 'Menlo', 'Monaco', 'Consolas', monospace;
  line-height: 1.5;
  overflow-x: auto;
}

body[data-theme='light'] .code-viewer {
  background-color: #ffffff !important;
  color: #1f2937 !important;
  border: 1px solid rgba(203, 213, 225, 0.6);
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.05);
}

/* File icon styles */
.file-icon-container {
  width: 64px;
  height: 64px;
  background-color: rgba(255, 255, 255, 0.05);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
}

.file-icon {
  width: 32px;
  height: 32px;
  color: #6b7280;
}

body[data-theme='light'] .file-icon-container {
  background-color: #f3f4f6;
  /* Light grey background for light theme */
}

body[data-theme='light'] .file-icon {
  color: #9ca3af;
  /* Slightly darker grey than background in light mode */
}

.empty-state-message {
  color: #9ca3af;
}

/* Additional polish */
button {
  font-family: inherit;
}

input::placeholder {
  color: #717171;
}

/* Subtle animations */
@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

/* No fadeIn animation on list items - prevents flash when switching tabs */

/* Loading state */
.loading {
  position: relative;
}

.loading::after {
  display: none;
}

@keyframes pulse {

  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }

  50% {
    opacity: 0.5;
    transform: scale(1.2);
  }
}

/* Ensure 21px vertical spacing between all elements in settings card */
.settings-card>* {
  margin-bottom: 21px;
}

.settings-card>*:last-child {
  margin-bottom: 0;
}

/* Word-level diff highlighting */
.diff-word-added,
.diff-word-removed {
  border-radius: 2px;
  padding: 0 1px;
}

/* Palette 1: Original - subtle word highlights */
[data-diff-palette="1"] .diff-word-removed {
  background-color: rgba(180, 60, 70, 0.4);
}

[data-diff-palette="1"] .diff-word-added {
  background-color: rgba(60, 140, 90, 0.35);
}

body[data-theme='light'] [data-diff-palette="1"] .diff-word-removed {
  background-color: rgba(220, 38, 38, 0.25);
}

body[data-theme='light'] [data-diff-palette="1"] .diff-word-added {
  background-color: rgba(22, 163, 74, 0.25);
}

/* Palette 2: Rose & Emerald */
[data-diff-palette="2"] .diff-word-removed {
  background-color: rgba(233, 30, 99, 0.35);
}

[data-diff-palette="2"] .diff-word-added {
  background-color: rgba(0, 191, 165, 0.35);
}

body[data-theme='light'] [data-diff-palette="2"] .diff-word-removed {
  background-color: rgba(233, 30, 99, 0.25);
}

body[data-theme='light'] [data-diff-palette="2"] .diff-word-added {
  background-color: rgba(0, 191, 165, 0.3);
}

/* Palette 3: Sunset & Ocean */
[data-diff-palette="3"] .diff-word-removed {
  background-color: rgba(255, 87, 34, 0.35);
}

[data-diff-palette="3"] .diff-word-added {
  background-color: rgba(0, 172, 193, 0.35);
}

body[data-theme='light'] [data-diff-palette="3"] .diff-word-removed {
  background-color: rgba(255, 87, 34, 0.3);
}

body[data-theme='light'] [data-diff-palette="3"] .diff-word-added {
  background-color: rgba(0, 172, 193, 0.3);
}

/* Palette 4: Berry & Lime */
[data-diff-palette="4"] .diff-word-removed {
  background-color: rgba(156, 39, 176, 0.35);
}

[data-diff-palette="4"] .diff-word-added {
  background-color: rgba(118, 255, 3, 0.30);
}

body[data-theme='light'] [data-diff-palette="4"] .diff-word-removed {
  background-color: rgba(156, 39, 176, 0.25);
}

body[data-theme='light'] [data-diff-palette="4"] .diff-word-added {
  background-color: rgba(76, 175, 80, 0.3);
}

/* Palette 5: Salmon & Seafoam */
[data-diff-palette="5"] .diff-word-removed {
  background-color: rgba(250, 128, 114, 0.4);
}

[data-diff-palette="5"] .diff-word-added {
  background-color: rgba(32, 178, 170, 0.4);
}

body[data-theme='light'] [data-diff-palette="5"] .diff-word-removed {
  background-color: rgba(250, 128, 114, 0.35);
}

body[data-theme='light'] [data-diff-palette="5"] .diff-word-added {
  background-color: rgba(32, 178, 170, 0.35);
}

/* Palette 6: Ruby & Jade */
[data-diff-palette="6"] .diff-word-removed {
  background-color: rgba(198, 40, 40, 0.4);
}

[data-diff-palette="6"] .diff-word-added {
  background-color: rgba(46, 125, 50, 0.4);
}

body[data-theme='light'] [data-diff-palette="6"] .diff-word-removed {
  background-color: rgba(198, 40, 40, 0.3);
}

body[data-theme='light'] [data-diff-palette="6"] .diff-word-added {
  background-color: rgba(46, 125, 50, 0.3);
}

/* Palette 7: Peach & Aqua */
[data-diff-palette="7"] .diff-word-removed {
  background-color: rgba(255, 171, 145, 0.45);
}

[data-diff-palette="7"] .diff-word-added {
  background-color: rgba(77, 208, 225, 0.4);
}

body[data-theme='light'] [data-diff-palette="7"] .diff-word-removed {
  background-color: rgba(239, 68, 68, 0.25);
}

body[data-theme='light'] [data-diff-palette="7"] .diff-word-added {
  background-color: rgba(6, 182, 212, 0.3);
}

/* Palette 8: Magenta & Cyan */
[data-diff-palette="8"] .diff-word-removed {
  background-color: rgba(255, 64, 129, 0.35);
}

[data-diff-palette="8"] .diff-word-added {
  background-color: rgba(0, 229, 255, 0.3);
}

body[data-theme='light'] [data-diff-palette="8"] .diff-word-removed {
  background-color: rgba(236, 72, 153, 0.3);
}

body[data-theme='light'] [data-diff-palette="8"] .diff-word-added {
  background-color: rgba(6, 182, 212, 0.3);
}

/* Context Menu */
.context-menu {
  position: absolute;
  background: rgba(31, 31, 31, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.5), 0 8px 10px -6px rgba(0, 0, 0, 0.5);
  padding: 6px;
  z-index: 10000;
  min-width: 180px;
  animation: contextMenuFadeIn 0.15s ease-out;
}

@keyframes contextMenuFadeIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}

.context-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  font-size: 14px;
  color: #ededed;
  cursor: pointer;
  border-radius: 8px;
  transition: background-color 0.15s ease, transform 0.1s ease;
  user-select: none;
}

.context-menu-item:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

.context-menu-item:active {
  transform: scale(0.98);
}

.context-menu-item i {
  font-size: 18px;
  width: 20px;
  text-align: center;
  color: #a2a2a2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.context-menu-item i svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.context-menu-item.danger {
  color: #ef4444;
}

.context-menu-item.danger i {
  color: #ef4444;
}

.context-menu-item.danger:hover {
  background-color: rgba(239, 68, 68, 0.1);
}

.context-menu-separator {
  height: 1px;
  background-color: rgba(255, 255, 255, 0.08);
  margin: 4px 8px;
}

/* Lock Icon Badge */
.backup-item {
  position: relative;
}

.lock-indicator {
  margin-left: auto;
  color: currentColor;
  opacity: 0.85;
  font-size: 14px;
  flex-shrink: 0;
  line-height: 1;
  transition: color 0.2s ease;
}

#backupList .list-item:hover .lock-indicator,
#backupListContainer .list-item:hover .lock-indicator {
  opacity: 1;
}

body[data-theme='light'] .context-menu {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

body[data-theme='light'] .context-menu-item {
  color: #1f2937;
}

body[data-theme='light'] .context-menu-item:hover {
  background-color: rgba(0, 0, 0, 0.05);
}

body[data-theme='light'] .context-menu-separator {
  background-color: rgba(0, 0, 0, 0.08);
}