/* ==========================================================================
   Solaris 3 — Apple System Minimalist Browser Stylesheet
   Pure Native CSS3 • Hardware-Accelerated 60fps • Zero Frameworks
   ========================================================================== */

:root {
  --accent: #0A84FF;
  --accent-hover: #409CFF;
  --accent-soft: rgba(10, 132, 255, 0.18);
  --accent-border: rgba(10, 132, 255, 0.38);
  --success: #30D158;
  --warning: #FF9F0A;
  --danger: #FF453A;
  --ui-scale: 1;
  --page-zoom: 1;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-pill: 9999px;
  --font-sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Inter", "Segoe UI", Roboto, sans-serif;
  --font-mono: "SF Mono", "JetBrains Mono", Consolas, monospace;
}

/* Dark Mode (Default Apple System Palette) */
:root,
[data-theme="midnight"],
[data-theme="dark"] {
  --bg-base: #000000;
  --bg-elevated: #1C1C1E;
  --bg-tertiary: #2C2C2E;
  --bg-glass: rgba(28, 28, 30, 0.78);
  --bg-glass-heavy: rgba(28, 28, 30, 0.92);
  --bg-card: #1C1C1E;
  --bg-card-hover: #2C2C2E;
  --bg-input: #1C1C1E;
  --bg-input-focus: #2C2C2E;
  --border-subtle: rgba(255, 255, 255, 0.1);
  --border-strong: rgba(255, 255, 255, 0.18);
  --text-primary: #F5F5F7;
  --text-secondary: #8E8E93;
  --text-muted: #8E8E93;
  --shadow-lg: 0 20px 50px rgba(0, 0, 0, 0.65);
  --shadow-sm: 0 4px 14px rgba(0, 0, 0, 0.35);
}

/* Light Mode (Apple System Palette) */
[data-theme="light"] {
  --bg-base: #F5F5F7;
  --bg-elevated: #FFFFFF;
  --bg-tertiary: #E5E5EA;
  --bg-glass: rgba(255, 255, 255, 0.82);
  --bg-glass-heavy: rgba(255, 255, 255, 0.94);
  --bg-card: #FFFFFF;
  --bg-card-hover: #E5E5EA;
  --bg-input: #E5E5EA;
  --bg-input-focus: #FFFFFF;
  --border-subtle: rgba(0, 0, 0, 0.1);
  --border-strong: rgba(0, 0, 0, 0.18);
  --text-primary: #1D1D1F;
  --text-secondary: #86868B;
  --text-muted: #86868B;
  --shadow-lg: 0 18px 40px rgba(0, 0, 0, 0.1);
  --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.06);
}

[data-theme="graphite"] {
  --bg-base: #0E0E10;
  --bg-elevated: #1C1C1E;
  --bg-tertiary: #2C2C2E;
  --bg-glass: rgba(28, 28, 30, 0.82);
  --bg-glass-heavy: rgba(28, 28, 30, 0.94);
  --bg-card: #1C1C1E;
  --bg-card-hover: #2C2C2E;
  --bg-input: #1C1C1E;
  --bg-input-focus: #2C2C2E;
  --border-subtle: rgba(255, 255, 255, 0.1);
  --border-strong: rgba(255, 255, 255, 0.18);
  --text-primary: #F5F5F7;
  --text-secondary: #8E8E93;
  --text-muted: #8E8E93;
}

[data-theme="nord"] {
  --bg-base: #1E222A;
  --bg-elevated: #2E3440;
  --bg-tertiary: #3B4252;
  --bg-glass: rgba(46, 52, 64, 0.82);
  --bg-glass-heavy: rgba(36, 41, 51, 0.94);
  --bg-card: #2E3440;
  --bg-card-hover: #3B4252;
  --bg-input: #2E3440;
  --bg-input-focus: #3B4252;
  --border-subtle: rgba(255, 255, 255, 0.1);
  --border-strong: rgba(255, 255, 255, 0.18);
  --text-primary: #ECEFF4;
  --text-secondary: #D8DEE9;
  --text-muted: #8E8E93;
}

[data-theme="ocean"] {
  --bg-base: #050D14;
  --bg-elevated: #0E1B26;
  --bg-tertiary: #172A3A;
  --bg-glass: rgba(14, 27, 38, 0.82);
  --bg-glass-heavy: rgba(10, 20, 29, 0.94);
  --bg-card: #0E1B26;
  --bg-card-hover: #172A3A;
  --bg-input: #0E1B26;
  --bg-input-focus: #172A3A;
  --border-subtle: rgba(255, 255, 255, 0.1);
  --border-strong: rgba(255, 255, 255, 0.18);
  --text-primary: #F5F5F7;
  --text-secondary: #8E8E93;
  --text-muted: #8E8E93;
}

[data-ui-size="compact"] {
  --ui-scale: 0.92;
}
[data-ui-size="comfortable"] {
  --ui-scale: 1.07;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--bg-base);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: calc(14px * var(--ui-scale));
  user-select: none;
}

button, input, select, textarea {
  font-family: inherit;
  color: inherit;
  border: none;
  outline: none;
  background: none;
}

button {
  cursor: pointer;
}

/* ==========================================================================
   App Layout Shell
   ========================================================================== */
.browser-shell {
  display: flex;
  flex-direction: column;
  width: 100vw;
  height: 100vh;
  background: var(--bg-base);
  position: relative;
}

/* ==========================================================================
   Unified Native Browser Top Bar (Tabs + Navigation)
   ========================================================================== */
.top-chrome {
  background: var(--bg-glass);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--border-subtle);
  z-index: 100;
  display: flex;
  flex-direction: column;
  padding: 6px 10px 8px;
  gap: 6px;
  transition: background 0.2s ease;
}

/* Tab Strip */
.tab-strip-row {
  display: flex;
  align-items: center;
  gap: 6px;
  height: calc(34px * var(--ui-scale));
  overflow: hidden;
}

.window-dots {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 0 8px 0 4px;
  flex-shrink: 0;
}

.win-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  opacity: 0.85;
  transition: opacity 0.15s ease, transform 0.15s ease;
}
.win-dot:hover {
  opacity: 1;
  transform: scale(1.08);
}
.win-dot.close { background: #FF453A; }
.win-dot.min { background: #FF9F0A; }
.win-dot.max { background: #30D158; }

.tabs-container {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
  overflow-x: auto;
  scrollbar-width: none;
  padding: 1px 0;
}
.tabs-container::-webkit-scrollbar {
  display: none;
}

.browser-tab {
  display: flex;
  align-items: center;
  gap: 8px;
  height: calc(30px * var(--ui-scale));
  min-width: 120px;
  max-width: 215px;
  flex: 1;
  padding: 0 11px;
  border-radius: 10px;
  background: transparent;
  border: none;
  box-shadow: none;
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 500;
  transition: background 0.16s cubic-bezier(0.22, 1, 0.36, 1), color 0.16s ease, transform 0.16s ease, opacity 0.16s ease;
  position: relative;
  cursor: pointer;
}

.browser-tab:hover {
  background: rgba(142, 142, 147, 0.14);
  color: var(--text-primary);
}

.browser-tab.active {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.28);
}

.browser-tab.dragging {
  opacity: 0.45;
  transform: scale(0.96);
}

.browser-tab.drag-over {
  background: var(--accent-soft);
  color: var(--text-primary);
}

.tab-favicon {
  width: 15px;
  height: 15px;
  border-radius: 4px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
}

.browser-tab.active .tab-favicon {
  color: var(--accent);
}

.tab-favicon svg {
  width: 14px;
  height: 14px;
}

.tab-favicon img {
  width: 15px;
  height: 15px;
  border-radius: 3px;
  object-fit: contain;
}

.tab-title {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: left;
}

.tab-audio-badge {
  color: var(--accent);
  display: none;
  align-items: center;
  justify-content: center;
}
.tab-audio-badge svg {
  width: 13px;
  height: 13px;
}
.browser-tab.playing .tab-audio-badge {
  display: inline-flex;
}

.tab-close-btn {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  opacity: 0;
  transition: opacity 0.14s ease, background 0.14s ease, color 0.14s ease;
  flex-shrink: 0;
}

.tab-close-btn svg {
  width: 11px;
  height: 11px;
  stroke-width: 2.2;
}

.browser-tab:hover .tab-close-btn,
.browser-tab.active .tab-close-btn {
  opacity: 1;
}

.tab-close-btn:hover {
  background: rgba(255, 69, 58, 0.22);
  color: var(--danger);
}

.new-tab-btn {
  width: calc(28px * var(--ui-scale));
  height: calc(28px * var(--ui-scale));
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  background: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
  flex-shrink: 0;
  transition: all 0.15s ease;
}
.new-tab-btn:hover {
  background: var(--accent-soft);
  border-color: var(--accent-border);
  color: var(--accent);
}

/* Navigation Row */
.nav-bar-row {
  display: flex;
  align-items: center;
  gap: 8px;
  height: calc(36px * var(--ui-scale));
}

.nav-controls,
.quick-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.icon-btn {
  width: calc(32px * var(--ui-scale));
  height: calc(32px * var(--ui-scale));
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  transition: background 0.15s ease, color 0.15s ease, transform 0.1s ease;
  position: relative;
}

.icon-btn:hover:not(:disabled) {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

.icon-btn:active:not(:disabled) {
  transform: scale(0.95);
}

.icon-btn:disabled {
  opacity: 0.35;
  cursor: default;
}

.icon-btn svg {
  width: 16px;
  height: 16px;
  stroke-width: 1.9;
}

/* AdBlocker Shield Active/Inactive State */
.icon-btn.shield-btn.active {
  color: var(--accent);
  background: var(--accent-soft);
}
.icon-btn.shield-btn.inactive {
  color: var(--text-secondary);
}

.badge-count {
  position: absolute;
  top: 3px;
  right: 3px;
  min-width: 14px;
  height: 14px;
  padding: 0 3px;
  border-radius: 99px;
  background: var(--accent);
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Omnibox */
.omnibox-wrapper {
  flex: 1;
  max-width: 780px;
  margin: 0 auto;
  position: relative;
  display: flex;
  align-items: center;
}

.omnibox-bar {
  width: 100%;
  height: calc(33px * var(--ui-scale));
  background: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-pill);
  display: flex;
  align-items: center;
  padding: 0 12px;
  gap: 8px;
  transition: all 0.18s ease;
}

.omnibox-bar:focus-within {
  background: var(--bg-elevated);
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.omnibox-security-icon {
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.omnibox-security-icon svg {
  width: 14px;
  height: 14px;
}

.omnibox-input {
  flex: 1;
  font-size: 0.9rem;
  color: var(--text-primary);
  background: transparent;
  width: 100%;
}

.omnibox-input::placeholder {
  color: var(--text-secondary);
}

.omnibox-bookmark-btn {
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
  border-radius: 50%;
  transition: color 0.15s ease;
}
.omnibox-bookmark-btn:hover,
.omnibox-bookmark-btn.bookmarked {
  color: var(--accent);
}

/* Loading Progress Line */
.loading-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 2px;
  width: 0%;
  background: var(--accent);
  opacity: 0;
  transition: width 0.25s ease, opacity 0.2s ease;
  z-index: 200;
}
.loading-bar.loading {
  opacity: 1;
}

/* ==========================================================================
   Main Viewport Stack
   ========================================================================== */
.viewport-stack {
  flex: 1;
  position: relative;
  overflow: hidden;
  background: var(--bg-base);
}

.tab-viewport {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: none;
  overflow-y: auto;
  background: var(--bg-base);
}

.tab-viewport.active {
  display: flex;
  flex-direction: column;
}

.proxy-iframe {
  width: calc(100% / var(--page-zoom));
  height: calc(100% / var(--page-zoom));
  transform: scale(var(--page-zoom));
  transform-origin: 0 0;
  border: none;
  background: #fff;
  flex: 1;
}

/* ==========================================================================
   Internal Page: solaris://newtab (Flat Solid Background + Optional Wallpaper)
   ========================================================================== */
.newtab-page {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 6vh 28px 28px;
  background: var(--bg-base);
  overflow-y: auto;
  position: relative;
  isolation: isolate;
}

.newtab-wallpaper-bg {
  position: fixed;
  inset: 0;
  z-index: -2;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  pointer-events: none;
  display: none;
}

.newtab-wallpaper-overlay {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  display: none;
}

.newtab-page.has-wallpaper {
  background: transparent;
}

.newtab-page.has-wallpaper .newtab-wallpaper-bg,
.newtab-page.has-wallpaper .newtab-wallpaper-overlay {
  display: block;
}

.newtab-page.has-wallpaper .solaris-wordmark {
  color: #F5F5F7;
  text-shadow: 0 2px 16px rgba(0, 0, 0, 0.55);
}

.newtab-page.has-wallpaper .newtab-search-box,
.newtab-page.has-wallpaper .widget-card,
.newtab-page.has-wallpaper .shortcut-icon {
  background: rgba(28, 28, 30, 0.72);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-color: rgba(255, 255, 255, 0.16);
  color: #F5F5F7;
}

.newtab-page.has-wallpaper .newtab-search-input,
.newtab-page.has-wallpaper .clock-time,
.newtab-page.has-wallpaper .weather-temp,
.newtab-page.has-wallpaper .quick-notes-area {
  color: #F5F5F7;
}

.newtab-page.has-wallpaper .shortcut-label,
.newtab-page.has-wallpaper .widget-header,
.newtab-page.has-wallpaper .clock-date,
.newtab-page.has-wallpaper .weather-desc {
  color: rgba(245, 245, 247, 0.82);
}

.newtab-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: 640px;
  margin-top: 3vh;
  gap: 24px;
}

.solaris-wordmark {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.85rem;
  font-weight: 700;
  letter-spacing: -0.04em;
  color: var(--text-primary);
}

.solaris-badge {
  font-size: 0.82rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  background: var(--accent-soft);
  color: var(--accent);
  letter-spacing: 0.01em;
  border: 1px solid var(--accent-border);
}

.solaris-badge.unstable {
  background: rgba(255, 69, 58, 0.16) !important;
  color: #FF453A !important;
  border: 1px solid #FF453A !important;
}

.setting-row-with-icon {
  display: flex;
  align-items: center;
  gap: 14px;
}

.setting-icon-wrap {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.setting-icon-wrap svg {
  width: 18px;
  height: 18px;
}

.newtab-search-form {
  width: 100%;
  position: relative;
}

.newtab-search-box {
  width: 100%;
  height: 52px;
  border-radius: var(--radius-pill);
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  padding: 0 20px;
  gap: 12px;
  transition: all 0.2s ease;
}

.newtab-search-box:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
  transform: translateY(-1px);
}

.newtab-search-box svg {
  width: 19px;
  height: 19px;
  color: var(--accent);
  flex-shrink: 0;
}

.newtab-search-input {
  flex: 1;
  font-size: 1.02rem;
  color: var(--text-primary);
}
.newtab-search-input::placeholder {
  color: var(--text-secondary);
}

/* Quick Shortcuts Row */
.shortcuts-grid {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-top: 4px;
}

.shortcut-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: 78px;
  padding: 10px 6px;
  border-radius: var(--radius-md);
  cursor: pointer;
  position: relative;
  transition: background 0.15s ease, transform 0.15s ease;
}

.shortcut-item:hover {
  background: var(--bg-elevated);
  transform: translateY(-2px);
}

.shortcut-icon {
  width: 46px;
  height: 46px;
  border-radius: 13px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.shortcut-item:hover .shortcut-icon {
  background: var(--bg-tertiary);
}

.shortcut-icon img {
  width: 24px;
  height: 24px;
  object-fit: contain;
}

.shortcut-label {
  font-size: 0.78rem;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.shortcut-remove {
  position: absolute;
  top: 4px;
  right: 6px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-size: 11px;
  display: none;
  align-items: center;
  justify-content: center;
}
.shortcut-item:hover .shortcut-remove {
  display: flex;
}
.shortcut-remove:hover {
  color: var(--danger);
}

/* Bottom 3 Apple Surface Cards */
.newtab-widgets {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  width: 100%;
  max-width: 980px;
  margin-top: 32px;
}

.newtab-widgets.hidden {
  display: none;
}

.widget-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  min-height: 145px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.2s ease, background 0.2s ease;
}

.widget-card:hover {
  border-color: var(--border-strong);
}

.widget-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.76rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-secondary);
}

.clock-time {
  font-size: 2.35rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
  margin: 6px 0 2px;
}

.clock-date {
  font-size: 0.88rem;
  color: var(--text-secondary);
}

.weather-main {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin: 6px 0;
}

.weather-temp {
  font-size: 2.2rem;
  font-weight: 700;
  letter-spacing: -0.03em;
}

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

.weather-city-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.85rem;
  color: var(--accent);
  padding: 2px 6px;
  margin-left: -6px;
  border-radius: 6px;
}
.weather-city-btn:hover {
  background: var(--accent-soft);
}

.quick-notes-area {
  width: 100%;
  flex: 1;
  margin-top: 8px;
  resize: none;
  font-size: 0.88rem;
  line-height: 1.45;
  color: var(--text-primary);
  background: transparent;
  user-select: text;
}
.quick-notes-area::placeholder {
  color: var(--text-secondary);
}

/* ==========================================================================
   Internal Page: solaris://settings
   ========================================================================== */
.settings-page {
  flex: 1;
  display: flex;
  flex-direction: column;
  max-width: 1060px;
  width: 100%;
  margin: 0 auto;
  padding: 28px 32px 48px;
  gap: 22px;
}

.settings-top-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.settings-title-block h1 {
  font-size: 1.65rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.settings-title-block p {
  font-size: 0.88rem;
  color: var(--text-secondary);
  margin-top: 2px;
}

.settings-search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-pill);
  padding: 0 14px;
  height: 36px;
  width: 260px;
}
.settings-search-box:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.settings-search-box input {
  flex: 1;
  font-size: 0.88rem;
}

/* Horizontal Sub-Tabs */
.settings-tabs-nav {
  display: flex;
  align-items: center;
  gap: 6px;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 10px;
  overflow-x: auto;
}

.settings-tab-btn {
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text-secondary);
  white-space: nowrap;
  border: 1px solid transparent;
  transition: all 0.15s ease;
}
.settings-tab-btn:hover {
  color: var(--text-primary);
  background: var(--bg-elevated);
}
.settings-tab-btn.active {
  color: var(--accent);
  background: var(--accent-soft);
  border-color: var(--accent-border);
}

.settings-section {
  display: none;
  flex-direction: column;
  gap: 14px;
}
.settings-section.active {
  display: flex;
}

.setting-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.setting-card.column {
  flex-direction: column;
  align-items: stretch;
}

.setting-info h3 {
  font-size: 0.96rem;
  font-weight: 600;
  color: var(--text-primary);
}
.setting-info p {
  font-size: 0.83rem;
  color: var(--text-secondary);
  margin-top: 3px;
}

/* Controls: Select, Input, Toggle Switch, Buttons */
.ui-select,
.ui-input {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 7px 12px;
  font-size: 0.88rem;
  color: var(--text-primary);
  min-width: 190px;
}
.ui-select:focus,
.ui-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.ui-btn {
  padding: 8px 15px;
  border-radius: var(--radius-sm);
  font-size: 0.86rem;
  font-weight: 500;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  display: inline-flex;
  align-items: center;
  gap: 7px;
  transition: all 0.15s ease;
}
.ui-btn:hover {
  border-color: var(--border-strong);
}
.ui-btn.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.ui-btn.primary:hover {
  background: var(--accent-hover);
}
.ui-btn.danger {
  background: rgba(255, 69, 58, 0.14);
  border-color: rgba(255, 69, 58, 0.35);
  color: var(--danger);
}
.ui-btn.danger:hover {
  background: rgba(255, 69, 58, 0.25);
}

/* Switch Toggle */
.toggle-switch {
  position: relative;
  width: 44px;
  height: 24px;
  display: inline-block;
  flex-shrink: 0;
}
.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}
.toggle-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
  border-radius: 99px;
  transition: 0.2s;
}
.toggle-slider::before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 2px;
  bottom: 2px;
  background: #fff;
  border-radius: 50%;
  transition: 0.2s;
}
.toggle-switch input:checked + .toggle-slider {
  background: var(--accent);
  border-color: var(--accent);
}
.toggle-switch input:checked + .toggle-slider::before {
  transform: translateX(20px);
}

/* Preset Grid Cards (Themes & Tab Cloaks) */
.preset-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
  margin-top: 10px;
}

.preset-card {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 9px;
  cursor: pointer;
  transition: all 0.15s ease;
  text-align: center;
}
.preset-card:hover {
  border-color: var(--border-strong);
  transform: translateY(-2px);
}
.preset-card.active {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.preset-card img {
  width: 28px;
  height: 28px;
  object-fit: contain;
}
.preset-swatch {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  overflow: hidden;
  border: 1.5px solid var(--border-strong);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
  background-origin: border-box;
  background-clip: padding-box;
}

/* Accent Color Swatches & Custom Picker */
.accent-picker-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 12px;
}

.accent-swatches {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.accent-swatch-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  background: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-primary);
  transition: all 0.15s ease;
}
.accent-swatch-btn:hover {
  border-color: var(--border-strong);
  transform: translateY(-1px);
}
.accent-swatch-btn.active {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.accent-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  flex-shrink: 0;
}

.accent-custom-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.color-wheel-input {
  width: 36px;
  height: 34px;
  padding: 2px;
  border-radius: var(--radius-sm);
  background: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
  cursor: pointer;
}

/* ==========================================================================
   Internal Page: solaris://music (Ad-Free Music Player)
   ========================================================================== */
.music-page {
  flex: 1;
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  background: var(--bg-base);
}

.music-workspace {
  flex: 1;
  display: flex;
  overflow: hidden;
}

.music-sidebar {
  width: 230px;
  background: var(--bg-elevated);
  border-right: 1px solid var(--border-subtle);
  padding: 18px 12px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  overflow-y: auto;
  flex-shrink: 0;
}

.music-nav-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.music-nav-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-secondary);
  padding: 0 10px 4px;
}

.music-nav-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.89rem;
  font-weight: 500;
  color: var(--text-secondary);
  text-align: left;
  transition: all 0.15s ease;
}
.music-nav-btn:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}
.music-nav-btn.active {
  background: var(--accent-soft);
  color: var(--accent);
}

.music-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  padding: 24px 28px 110px;
  gap: 22px;
}

.music-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.music-search-form {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-pill);
  padding: 0 16px;
  height: 40px;
  width: 340px;
  max-width: 100%;
}
.music-search-form:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.music-search-form input {
  flex: 1;
  font-size: 0.92rem;
}

.music-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(175px, 1fr));
  gap: 18px;
}

.track-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  cursor: pointer;
  transition: all 0.18s ease;
  position: relative;
}
.track-card:hover {
  background: var(--bg-tertiary);
  border-color: var(--border-strong);
  transform: translateY(-3px);
}

.track-cover-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--bg-tertiary);
}
.track-cover-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.track-play-overlay {
  position: absolute;
  right: 8px;
  bottom: 8px;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-sm);
  opacity: 0;
  transform: translateY(4px);
  transition: all 0.18s ease;
}
.track-card:hover .track-play-overlay {
  opacity: 1;
  transform: translateY(0);
}

.track-metaTitle {
  font-size: 0.9rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.track-metaArtist {
  font-size: 0.8rem;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.track-actions-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 2px;
}

.track-mini-btn {
  font-size: 0.78rem;
  color: var(--text-secondary);
  padding: 3px 6px;
  border-radius: 5px;
}
.track-mini-btn:hover,
.track-mini-btn.liked {
  color: var(--accent);
  background: var(--accent-soft);
}

/* Persistent Global Audio Player Bar (Symmetrically Centered) */
.global-audio-bar {
  height: 70px;
  background: var(--bg-glass-heavy);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border-top: 1px solid var(--border-subtle);
  display: none;
  grid-template-columns: 1fr minmax(320px, 520px) 1fr;
  align-items: center;
  padding: 0 22px;
  gap: 20px;
  z-index: 150;
}
.global-audio-bar.visible {
  display: grid;
}

.player-now-playing {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  justify-self: start;
  max-width: 100%;
}
.player-now-playing img {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  object-fit: cover;
  background: var(--bg-tertiary);
  flex-shrink: 0;
}
.player-song-info {
  overflow: hidden;
}
.player-song-title {
  font-size: 0.88rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.player-song-artist {
  font-size: 0.78rem;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.player-center-controls {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  width: 100%;
  max-width: 520px;
  justify-self: center;
}
.player-buttons {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
}
.play-main-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease, transform 0.1s ease;
}
.play-main-btn:hover {
  background: var(--accent-hover);
  transform: scale(1.04);
}
.player-scrubber-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  font-size: 0.74rem;
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
}
.player-time-label {
  min-width: 32px;
  text-align: center;
}
.player-pct-badge {
  min-width: 38px;
  padding: 2px 6px;
  border-radius: 6px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  font-size: 0.7rem;
  font-weight: 600;
  text-align: center;
}
.range-slider {
  flex: 1;
  accent-color: var(--accent);
  height: 4px;
  cursor: pointer;
}

.player-right-controls {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  justify-self: end;
}

/* Floating Glassmorphic Mini-Player (Bottom-Right Corner) */
.floating-mini-player {
  position: fixed;
  right: 20px;
  bottom: 84px;
  width: 310px;
  background: var(--bg-glass-heavy);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid var(--border-strong);
  border-radius: 14px;
  box-shadow: var(--shadow-lg);
  padding: 10px 12px;
  display: none;
  flex-direction: column;
  gap: 8px;
  z-index: 260;
  transition: transform 0.2s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.2s ease;
}

.floating-mini-player.visible {
  display: flex;
}

.mini-player-top {
  display: flex;
  align-items: center;
  gap: 10px;
}

.mini-player-cover {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  object-fit: cover;
  background: var(--bg-tertiary);
  flex-shrink: 0;
  cursor: pointer;
}

.mini-player-meta {
  flex: 1;
  min-width: 0;
  cursor: pointer;
}

.mini-player-title {
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mini-player-artist {
  font-size: 0.74rem;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mini-player-controls {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.mini-ctrl-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  transition: background 0.15s ease, color 0.15s ease;
}

.mini-ctrl-btn:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

.mini-ctrl-btn.primary {
  background: var(--accent);
  color: #fff;
}

.mini-ctrl-btn.primary:hover {
  background: var(--accent-hover);
}

.mini-player-progress-track {
  width: 100%;
  height: 4px;
  border-radius: 99px;
  background: var(--bg-tertiary);
  overflow: hidden;
  cursor: pointer;
}

.mini-player-progress-fill {
  height: 100%;
  width: 0%;
  background: var(--accent);
  border-radius: 99px;
  transition: width 0.15s linear;
}

/* Custom Wallpaper Library Gallery in Appearance Settings */
.wallpaper-upload-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.wallpaper-gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(145px, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.wallpaper-card {
  position: relative;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--border-subtle);
  background: var(--bg-tertiary);
  overflow: hidden;
  cursor: pointer;
  transition: all 0.16s ease;
  display: flex;
  flex-direction: column;
}

.wallpaper-card:hover {
  border-color: var(--border-strong);
  transform: translateY(-2px);
}

.wallpaper-card.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-soft);
}

.wallpaper-thumb {
  width: 100%;
  height: 82px;
  background-size: cover;
  background-position: center;
  background-color: var(--bg-base);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  font-size: 0.78rem;
  font-weight: 500;
}

.wallpaper-card-footer {
  padding: 7px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  font-size: 0.78rem;
  font-weight: 500;
}

.wallpaper-card-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.wallpaper-delete-btn {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.68);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  opacity: 0;
  transition: opacity 0.15s ease, background 0.15s ease;
}

.wallpaper-card:hover .wallpaper-delete-btn {
  opacity: 1;
}

.wallpaper-delete-btn:hover {
  background: var(--danger);
}

.wallpaper-sliders-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--border-subtle);
}

/* Modal Dialogs */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 500;
}
.modal-backdrop.open {
  display: flex;
}
.modal-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 22px 24px;
  width: 100%;
  max-width: 480px;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.modal-card h2 {
  font-size: 1.15rem;
}
.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 6px;
}

@media (max-width: 820px) {
  .newtab-widgets {
    grid-template-columns: 1fr;
  }
  .music-sidebar {
    width: 170px;
  }
}
