/* ============================================
   webOS — base theme
   Monochrome dark UI with a single purple accent.
   ============================================ */

:root {
  --font-ui: "Figtree", sans-serif;
  --font-mono: "JetBrains Mono", monospace;

  --color-wallpaper: #16161a;
  --color-surface: #1e1e23;
  --color-surface-alt: #26262d;
  --color-surface-raised: #2c2c34;
  --color-border: #35353d;

  --color-text: #e8e8ec;
  --color-text-dim: #9c9ca6;
  --color-text-faint: #6c6c76;

  --color-accent: #9b6dff;
  --color-accent-dim: #7c5cd6;
  --color-accent-soft: rgba(155, 109, 255, 0.32);
  --color-white-soft: rgba(255, 255, 255, 0.14);

  --radius-window: 12px;
  --radius-panel: 8px;
  --taskbar-height: 46px;

  --color-icon: #9c9ca6;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: var(--font-ui);
  color: var(--color-text);
  user-select: none;
}

button {
  font-family: inherit;
  color: inherit;
}

/* ============================================
   Desktop
   ============================================ */

#wallpaper-layer {
  position: fixed;
  top: -30px;
  left: -30px;
  right: -30px;
  bottom: -30px;
  background: var(--color-wallpaper);
  z-index: 0;
  pointer-events: none;
}

#desktop {
  position: fixed;
  top: var(--taskbar-height);
  left: 0;
  right: 0;
  bottom: 0;
}

#desktop-icons {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-content: flex-start;
  gap: 4px;
  padding: 16px;
  height: 100%;
}

.desktop-icon {
  width: 94px;
  padding: 8px 4px;
  border-radius: var(--radius-panel);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  cursor: default;
  border: 1px solid transparent;
}

.desktop-icon:hover,
.desktop-icon:focus-visible {
  background: rgba(255, 255, 255, 0.06);
}

.desktop-icon.selected {
  background: var(--color-accent-soft);
  border-color: var(--color-accent-dim);
}

.icon-glyph {
  color: var(--color-icon);
}

.desktop-icon .icon-glyph {
  width: 58px;
  height: 58px;
}

.desktop-icon .icon-glyph svg {
  width: 100%;
  height: 100%;
}

.desktop-icon .icon-label {
  font-size: 13px;
  color: var(--color-text);
  text-align: center;
  line-height: 1.25;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
}

/* ============================================
   Taskbar (top)
   ============================================ */

#taskbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--taskbar-height);
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  display: flex;
  align-items: stretch;
  z-index: 10000;
}

#start-button {
  width: 54px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: none;
  background: transparent;
  color: #ffffff;
  font-size: 32px;
  font-family: var(--font-ui);
  font-weight: 600;
  line-height: 1;
  cursor: default;
  transition: color 0.12s ease, background 0.12s ease;
}

#start-button:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--color-accent);
}

#start-button.active {
  color: var(--color-accent);
  background: var(--color-accent-soft);
}

/* The start button's "Ø" reuses the logo's O + strike-wrap positioning, but
   the strike itself is one solid bar (not the logo's 3-piece split — that
   split exists only to support retracting before a spin, which this glyph
   never does) and its color inherits (currentColor) instead of the logo's
   hardcoded white, and it rotates further counterclockwise on click instead
   of spinning. */
.nextos-start-strike {
  position: absolute;
  top: -0.055em;
  left: -0.51em;
  width: 1.02em;
  height: 0.11em;
  background: currentColor;
  border-radius: 999px;
}

.nextos-start-glyph .nextos-strike-wrap {
  transition: transform 0.1s cubic-bezier(0.445, 0.05, 0.55, 0.95);
}

#start-button.active .nextos-start-glyph .nextos-strike-wrap {
  transform: translate(-50%, -50%) rotate(-135deg);
}

#start-menu {
  position: fixed;
  top: var(--taskbar-height);
  left: 0;
  width: 340px;
  height: 420px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-top: none;
  border-radius: 0 0 var(--radius-panel) var(--radius-panel);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.4);
  padding: 14px;
  z-index: 10001;
  display: flex;
  flex-direction: column;
  gap: 12px;
  /* clip-path (not transform) so the slide reveal never moves the panel
     above its own top edge — it can't visually pass over/through the
     taskbar, it just unfurls downward from underneath it. */
  clip-path: inset(0 0 100% 0);
  opacity: 0;
  pointer-events: none;
  transition: clip-path 0.2s ease, opacity 0.2s ease;
}

#start-menu.open {
  clip-path: inset(0 0 0 0);
  opacity: 1;
  pointer-events: auto;
}

#start-menu.hidden {
  display: none;
}

.start-menu-header {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 10px;
}

.start-menu-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--color-accent-soft);
  color: var(--color-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 14px;
  flex: 0 0 auto;
}

.start-menu-username {
  font-size: 14px;
  font-weight: 500;
  color: var(--color-text);
}

.start-menu-search {
  flex: 0 0 auto;
  width: 100%;
  background: var(--color-surface-alt);
  border: 1px solid var(--color-border);
  border-radius: 6px;
  padding: 8px 10px;
  font-size: 13px;
  font-family: inherit;
  color: var(--color-text);
}

.start-menu-search::placeholder {
  color: var(--color-text-faint);
}

.start-menu-search:focus {
  outline: none;
  border-color: var(--color-accent-dim);
}

.start-menu-apps {
  flex: 1;
  overflow-y: auto;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  align-content: start;
}

.start-menu-app {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 10px 4px 8px;
  border-radius: var(--radius-panel);
  cursor: default;
}

.start-menu-app:hover {
  background: var(--color-accent-soft);
}

.start-menu-app .icon-glyph {
  width: 44px;
  height: 44px;
}

.start-menu-app .icon-glyph svg { width: 100%; height: 100%; }

.start-menu-app .icon-label {
  font-size: 12px;
  color: var(--color-text);
  text-align: center;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.start-menu-footer {
  flex: 0 0 auto;
  display: flex;
  gap: 8px;
  border-top: 1px solid var(--color-border);
  padding-top: 12px;
}

.start-menu-power-btn {
  flex: 1;
  padding: 8px 0;
  border-radius: 6px;
  border: 1px solid var(--color-border);
  background: var(--color-surface-alt);
  color: var(--color-text-dim);
  font-size: 13px;
  font-family: inherit;
  cursor: default;
}

.start-menu-power-btn:hover {
  border-color: var(--color-accent-dim);
  color: var(--color-accent);
}

#taskbar-apps {
  display: flex;
  align-items: stretch;
  margin-left: 4px;
}

#taskbar-clock {
  margin-left: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
  color: #ffffff;
  font-size: 12px;
  line-height: 1.35;
  user-select: none;
}

#taskbar-clock-time {
  font-weight: 700;
  font-size: 18px;
}

#taskbar-clock-date {
  font-size: 12px;
}

.taskbar-app {
  display: flex;
  align-items: center;
  padding: 0 18px;
  font-size: 14px;
  color: var(--color-text-dim);
  border: none;
  background: transparent;
  cursor: default;
  border-left: 1px solid transparent;
  border-right: 1px solid transparent;
}

.taskbar-app:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--color-text);
}

.taskbar-app.active {
  color: var(--color-text);
  background: rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 -2px 0 var(--color-accent);
}

.taskbar-app.closing {
  opacity: 0;
  transition: opacity 0.15s ease;
}

/* ============================================
   Windows
   ============================================ */

#window-layer {
  position: fixed;
  top: var(--taskbar-height);
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
}

.window {
  position: absolute;
  display: flex;
  flex-direction: column;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-window);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
  overflow: hidden;
  pointer-events: auto;
  min-width: 260px;
  min-height: 160px;
}

.window.maximized {
  top: 0 !important;
  left: 0 !important;
  width: 100% !important;
  height: 100% !important;
  border-radius: 0;
}

.window.animating {
  transition: top 0.18s ease, left 0.18s ease, width 0.18s ease, height 0.18s ease, border-radius 0.18s ease;
}

.window.minimizing {
  transition: opacity 0.2s ease-in;
}

.window.closing {
  animation: windowClose 0.16s ease-in forwards;
  pointer-events: none;
}

.window.opening {
  animation: windowOpen 0.16s ease-out forwards;
}

.window.pulse-alert {
  animation: dialogPulse 0.125s ease-in-out 2;
}

@keyframes windowOpen {
  from { opacity: 0; transform: scale(0.94); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes windowClose {
  from { opacity: 1; transform: scale(1); }
  to { opacity: 0; transform: scale(0.94); }
}

@keyframes dialogPulse {
  0%, 100% { box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45); }
  50% { box-shadow: 0 0 0 8px var(--color-accent-soft), 0 16px 40px rgba(0, 0, 0, 0.45); }
}

.resize-handle {
  position: absolute;
  width: 12px;
  height: 12px;
  z-index: 5;
}

.resize-handle.nw { top: 0; left: 0; cursor: nwse-resize; }
.resize-handle.ne { top: 0; right: 0; cursor: nesw-resize; }
.resize-handle.sw { bottom: 0; left: 0; cursor: nesw-resize; }
.resize-handle.se { bottom: 0; right: 0; cursor: nwse-resize; }

.window .titlebar {
  height: 44px;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  background: var(--color-surface-alt);
  border-bottom: 1px solid var(--color-border);
  padding: 0 8px;
  cursor: default;
}

.window .titlebar-title {
  flex: 1;
  text-align: center;
  font-size: 14px;
  font-weight: 500;
  color: var(--color-text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.window .titlebar-buttons {
  display: flex;
  align-items: center;
  gap: 2px;
  position: absolute;
  right: 8px;
}

.win-btn {
  width: 29px;
  height: 29px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: default;
  transition: background 0.12s ease;
}

.win-btn svg {
  width: 13px;
  height: 13px;
}

.win-btn.min:hover,
.win-btn.max:hover {
  background: var(--color-white-soft);
}

.win-btn.close:hover {
  background: var(--color-accent-soft);
}

.window .content {
  flex: 1;
  overflow: auto;
  background: var(--color-surface);
}

.window.dialog .content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 18px 16px;
  text-align: center;
}

.window.dialog .dialog-text {
  font-size: 13px;
  color: var(--color-text);
  line-height: 1.4;
  max-width: 280px;
}

.window.dialog .dialog-subtext {
  font-size: 11px;
  color: var(--color-text-dim);
  line-height: 1.3;
  max-width: 280px;
  margin-top: -8px;
}

.welcome-line {
  font-size: 15px;
  color: var(--color-text);
  line-height: 1.5;
  max-width: 380px;
}

.dialog-buttons {
  display: flex;
  gap: 10px;
}

.dialog-btn {
  padding: 6px 20px;
  border-radius: 6px;
  border: 1px solid var(--color-border);
  background: var(--color-surface-raised);
  color: var(--color-text);
  font-size: 13px;
  cursor: default;
}

.dialog-btn:hover {
  border-color: var(--color-accent-dim);
  color: var(--color-accent);
}

/* ============================================
   File Manager
   ============================================ */

.filemanager {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.fm-toolbar {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-bottom: 1px solid var(--color-border);
}

.fm-nav-btn {
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--color-icon);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: default;
}

.fm-nav-btn svg { width: 15px; height: 15px; }

.fm-nav-btn:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.06);
  color: var(--color-text);
}

.fm-nav-btn:disabled {
  color: var(--color-text-faint);
  cursor: default;
}

.fm-breadcrumb {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 14px;
  color: var(--color-text-dim);
  padding: 4px 10px;
  background: var(--color-surface-alt);
  border-radius: 6px;
}

.fm-breadcrumb-item {
  cursor: default;
  padding: 2px 4px;
  border-radius: 4px;
}

.fm-breadcrumb-item:hover {
  color: var(--color-text);
  background: rgba(255, 255, 255, 0.06);
}

.fm-breadcrumb-sep {
  color: var(--color-text-faint);
  font-size: 11px;
}

.fm-body {
  flex: 1;
  display: flex;
  overflow: hidden;
}

.fm-sidebar {
  width: 215px;
  flex: 0 0 auto;
  background: var(--color-surface);
  border-right: 1px solid var(--color-border);
  overflow-y: auto;
  padding: 8px 6px;
  display: flex;
  flex-direction: column;
}

.fm-sidebar-section {
  margin-bottom: 10px;
}

.fm-sidebar-heading {
  font-size: 11px;
  color: var(--color-text-faint);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 4px 8px;
}

.fm-sidebar-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 8px;
  border-radius: 6px;
  font-size: 14px;
  color: var(--color-text-dim);
  cursor: default;
}

.fm-sidebar-item:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--color-text);
}

.fm-sidebar-item.active {
  background: var(--color-accent-soft);
  color: var(--color-text);
}

.fm-sidebar-item .fm-icon {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  color: var(--color-icon);
}

.fm-sidebar-item .fm-icon svg { width: 100%; height: 100%; }

.fm-sidebar-item .fm-label {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fm-eject-btn {
  width: 18px;
  height: 18px;
  border: none;
  background: transparent;
  color: var(--color-icon);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  flex: 0 0 auto;
}

.fm-eject-btn:hover {
  color: var(--color-accent);
  background: rgba(255, 255, 255, 0.08);
}

.fm-eject-btn svg { width: 11px; height: 11px; }

.fm-main {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
}

.fm-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(84px, 1fr));
  gap: 4px;
}

.fm-entry {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 10px 4px 8px;
  border-radius: var(--radius-panel);
  cursor: default;
  border: 1px solid transparent;
}

.fm-entry:hover {
  background: rgba(255, 255, 255, 0.05);
}

.fm-entry.selected {
  background: var(--color-accent-soft);
  border-color: var(--color-accent-dim);
}

.fm-entry .fm-entry-icon {
  width: 48px;
  height: 48px;
  color: var(--color-icon);
}

.fm-entry .fm-entry-icon svg { width: 100%; height: 100%; }

.fm-entry .fm-entry-icon .fm-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid var(--color-border);
}

.fm-entry .fm-entry-label {
  font-size: 13px;
  color: var(--color-text);
  text-align: center;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fm-empty {
  color: var(--color-text-faint);
  font-size: 13px;
  padding: 20px;
  text-align: center;
}

.fm-statusbar {
  flex: 0 0 auto;
  padding: 5px 12px;
  font-size: 11px;
  color: var(--color-text-faint);
  border-top: 1px solid var(--color-border);
}

/* ============================================
   Image Viewer
   ============================================ */

.image-viewer {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: var(--color-wallpaper);
}

.image-viewer img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 6px;
}

/* ============================================
   Media Player
   ============================================ */

.media-player {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000000;
}

.media-player video {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* ============================================
   Terminal
   ============================================ */

.terminal {
  height: 100%;
  overflow-y: auto;
  background: #000000;
  color: #e8e8ec;
  font-family: var(--font-mono);
  font-size: 13px;
  padding: 10px 12px;
  cursor: text;
}

.terminal-line {
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
}

.term-dir {
  color: var(--color-accent);
  font-weight: 600;
}

.term-file {
  color: #e8e8ec;
}

.terminal-input-line {
  display: flex;
  flex-wrap: wrap;
  line-height: 1.6;
}

.terminal-prompt {
  color: var(--color-accent);
  white-space: pre;
}

.terminal-typed {
  color: #e8e8ec;
  white-space: pre-wrap;
  word-break: break-all;
}

.terminal-cursor {
  color: #e8e8ec;
  margin-left: 1px;
  animation: termBlink 1s steps(1) infinite;
}

@keyframes termBlink {
  0%, 49% { opacity: 1; }
  50%, 100% { opacity: 0; }
}

.terminal-hidden-input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  border: none;
  pointer-events: none;
}

/* ============================================
   Task Manager
   ============================================ */

.task-manager {
  display: flex;
  height: 100%;
}

.tm-sidebar {
  flex: 0 0 auto;
  width: 56px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 10px 0;
  background: var(--color-surface);
  border-right: 1px solid var(--color-border);
}

.tm-nav-icon {
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--color-icon);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: default;
}

.tm-nav-icon svg { width: 20px; height: 20px; }

.tm-nav-icon:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--color-text);
}

.tm-nav-icon.active {
  background: var(--color-accent-soft);
  color: var(--color-text);
}

.tm-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.tm-header {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--color-border);
}

.tm-header-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--color-text);
}

.tm-run-task-btn {
  padding: 7px 16px;
  border-radius: 6px;
  border: 1px solid var(--color-border);
  background: var(--color-surface-raised);
  color: var(--color-text);
  font-size: 13px;
  font-family: inherit;
  cursor: default;
}

.tm-run-task-btn:hover {
  border-color: var(--color-accent-dim);
  color: var(--color-accent);
}

.tm-body {
  flex: 1;
  overflow: hidden;
}

.tm-process-list,
.tm-performance {
  height: 100%;
  overflow-y: auto;
}

.tm-process-list.hidden,
.tm-performance.hidden {
  display: none;
}

.tm-process-list {
  padding: 6px 18px;
}

.tm-process-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 11px 4px;
  border-bottom: 1px solid var(--color-border);
  font-size: 13px;
}

.tm-process-name {
  color: var(--color-text);
}

.tm-end-task-btn {
  padding: 6px 14px;
  border-radius: 6px;
  border: 1px solid var(--color-border);
  background: var(--color-surface-raised);
  color: var(--color-text-dim);
  font-size: 12px;
  font-family: inherit;
  cursor: default;
}

.tm-end-task-btn:hover:not(:disabled) {
  border-color: var(--color-accent-dim);
  color: var(--color-accent);
}

.tm-end-task-btn:disabled {
  opacity: 0.4;
  cursor: default;
}

.tm-performance {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 18px;
}

.tm-cpu-graph {
  flex: 0 0 220px;
  width: 100%;
  height: 220px;
  display: block;
  background: rgba(255, 255, 255, 0.02);
  border-radius: 8px;
  border: 1px solid var(--color-border);
}

.tm-cpu-details {
  flex: 1;
  overflow-y: auto;
}

.tm-cpu-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 10px;
}

.tm-cpu-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0 24px;
}

.tm-cpu-stats > div {
  display: flex;
  justify-content: space-between;
  padding: 7px 0;
  border-bottom: 1px solid var(--color-border);
  font-size: 13px;
}

.tm-cpu-stats span {
  color: var(--color-text-dim);
}

.tm-cpu-stats strong {
  color: var(--color-text);
  font-weight: 500;
}

/* ============================================
   Settings
   ============================================ */

.settings-app {
  display: flex;
  height: 100%;
}

.settings-sidebar {
  flex: 0 0 auto;
  width: 200px;
  display: flex;
  flex-direction: column;
  padding: 12px 8px;
  background: var(--color-surface);
  border-right: 1px solid var(--color-border);
}

.settings-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 8px;
  font-size: 13px;
  color: var(--color-text-dim);
  cursor: default;
}

.settings-nav-item:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--color-text);
}

.settings-nav-item.active {
  background: var(--color-accent-soft);
  color: var(--color-text);
}

.settings-nav-icon {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  color: var(--color-icon);
}

.settings-nav-icon svg { width: 100%; height: 100%; }

.settings-main {
  flex: 1;
  overflow-y: auto;
  padding: 32px;
}

.settings-panel {
  max-width: 440px;
  margin: 0 auto;
}

.settings-logo-space {
  height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.settings-rows {
  display: flex;
  flex-direction: column;
  margin-bottom: 26px;
}

.settings-row {
  display: flex;
  justify-content: space-between;
  padding: 10px 2px;
  border-bottom: 1px solid var(--color-border);
  font-size: 13px;
}

.settings-row span {
  color: var(--color-text-dim);
}

.settings-row strong {
  color: var(--color-text);
  font-weight: 500;
}

.settings-storage-bar {
  width: 100%;
  height: 10px;
  border-radius: 6px;
  background: var(--color-surface-alt);
  border: 1px solid var(--color-border);
  overflow: hidden;
}

.settings-storage-used {
  height: 100%;
  background: var(--color-accent);
}

.settings-storage-caption {
  margin-top: 8px;
  font-size: 12px;
  color: var(--color-text-dim);
  text-align: center;
}

.settings-panel.hidden {
  display: none;
}

.personalization-panel {
  max-width: 480px;
}

.wallpaper-preview-frame {
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 1px solid #ffffff;
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 18px;
}

.wallpaper-preview {
  width: 100%;
  height: 100%;
  background: #16161a;
}

.wallpaper-controls-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.wallpaper-type-select,
.wallpaper-direction-select,
.wallpaper-fit-select {
  background: var(--color-surface-alt);
  border: 1px solid var(--color-border);
  border-radius: 6px;
  padding: 8px 10px;
  font-size: 13px;
  font-family: inherit;
  color: var(--color-text);
}

.wallpaper-type-select:focus,
.wallpaper-direction-select:focus,
.wallpaper-fit-select:focus {
  outline: none;
  border-color: var(--color-accent-dim);
}

.wallpaper-reset-btn {
  padding: 7px 16px;
  border-radius: 6px;
  border: 1px solid var(--color-border);
  background: var(--color-surface-raised);
  color: var(--color-text);
  font-size: 13px;
  font-family: inherit;
  cursor: default;
}

.wallpaper-reset-btn:hover {
  border-color: var(--color-accent-dim);
  color: var(--color-accent);
}

.wallpaper-reset-btn.hidden {
  display: none;
}

.wallpaper-type-panel {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: flex-start;
}

.wallpaper-color-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.wallpaper-swatch {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: 1px solid var(--color-border);
  cursor: default;
  padding: 0;
}

.wallpaper-hex-label {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--color-text-dim);
  margin-right: 6px;
}

.wallpaper-choose-btn {
  padding: 8px 16px;
  border-radius: 6px;
  border: 1px solid var(--color-border);
  background: var(--color-surface-raised);
  color: var(--color-text);
  font-size: 13px;
  font-family: inherit;
  cursor: default;
}

.wallpaper-choose-btn:hover {
  border-color: var(--color-accent-dim);
  color: var(--color-accent);
}

/* ============================================
   Power sequence (shutdown / restart)
   ============================================ */

body.power-active #wallpaper-layer,
body.power-active #desktop,
body.power-active #taskbar,
body.power-active #window-layer {
  filter: blur(16px);
  transition: filter 0.35s ease;
}

#power-overlay {
  position: fixed;
  inset: 0;
  z-index: 30000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 24px;
  background: rgba(10, 10, 12, 0.55);
  transition: background 0.35s ease;
}

#power-overlay.power-boot-black {
  background: #000000;
}

#power-overlay .hidden {
  display: none;
}

.power-icon-stage {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 260px;
  height: 260px;
}

/* The power glyph is built from real shapes (not the "O" letterform) so its
   two halves can be independently animated. Both halves AND the strike live
   inside one rotated ".power-rotor" so the halves' top/bottom split is drawn
   at the strike's own 45deg axis instead of screen-vertical. Each half is a
   clipped window onto a double-height ring (the standard CSS half-circle
   trick); "erasing" a half means growing its clip-path inward FROM the edge
   that touches the strike, so it visibly shrinks into the strike instead of
   sliding past it into the other half's territory. A separate fill disc
   (behind the rotor) fades in/out to sell the "spinning until opaque" look,
   same mechanism as the About PC logo's .nextos-o-fill. */
.power-glyph {
  position: relative;
  display: inline-block;
}

.power-glyph-fill {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: #ffffff;
  opacity: 0;
}

.power-rotor {
  position: absolute;
  inset: 0;
  transform: rotate(-45deg);
}

.power-glyph-half {
  position: absolute;
  left: 0;
  width: 100%;
  height: 50%;
  overflow: hidden;
  color: #ffffff;
}

.power-glyph-half-a {
  top: 0;
  clip-path: inset(0 0 0% 0);
}

.power-glyph-half-b {
  bottom: 0;
  clip-path: inset(0% 0 0 0);
}

.power-glyph-ring-inner {
  position: absolute;
  left: 0;
  width: 100%;
  height: 200%;
  border: 0.09em solid currentColor;
  border-radius: 50%;
  box-sizing: border-box;
}

.power-glyph-half-a .power-glyph-ring-inner {
  top: 0;
}

.power-glyph-half-b .power-glyph-ring-inner {
  bottom: 0;
}

.power-strike {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 1.3em;
  height: 0.09em;
  margin-top: -0.045em;
  margin-left: -0.65em;
  background: #ffffff;
  border-radius: 999px;
}

.power-wordmark {
  display: inline-flex;
  align-items: center;
}

.power-word-part {
  font-family: var(--font-ui);
  font-weight: 600;
  font-size: 1em;
  color: #ffffff;
  line-height: 1;
  white-space: pre;
}

.power-countdown-text {
  color: var(--color-text);
  font-size: 15px;
  text-align: center;
}

.power-buttons {
  display: flex;
  gap: 40px;
}

.power-choice-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  background: transparent;
  border: none;
  color: var(--color-text-dim);
  font-size: 13px;
  font-family: inherit;
  cursor: default;
}

.power-choice-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 1.5px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text);
  transition: border-color 0.12s ease, color 0.12s ease, background 0.12s ease;
}

.power-choice-icon svg {
  width: 26px;
  height: 26px;
}

.power-choice-btn:hover .power-choice-icon {
  border-color: var(--color-accent);
  color: var(--color-accent);
  background: var(--color-accent-soft);
}

.power-final-text {
  color: var(--color-text);
  font-size: 16px;
  text-align: center;
  max-width: 420px;
  padding: 0 20px;
}

.power-turnon-btn {
  padding: 8px 28px;
  border-radius: 6px;
  border: 1px solid var(--color-border);
  background: var(--color-surface-raised);
  color: var(--color-text);
  font-size: 13px;
  font-family: inherit;
  cursor: default;
}

.power-turnon-btn:hover {
  border-color: var(--color-accent-dim);
  color: var(--color-accent);
}

.wallpaper-hidden-input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.settings-section-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text);
  margin: 24px 0 12px;
}

.settings-section-title:first-child {
  margin-top: 0;
}

.settings-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 24px 0 12px;
}

.settings-section-header .settings-section-title {
  margin: 0;
}

.settings-section-header:first-child {
  margin-top: 0;
}

.settings-field-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--color-border);
}

.settings-field-label {
  flex: 1;
  font-size: 13px;
  color: var(--color-text-dim);
}

.settings-toggle {
  position: relative;
  display: inline-block;
  width: 38px;
  height: 22px;
  flex: 0 0 auto;
  cursor: default;
}

.settings-toggle-checkbox {
  opacity: 0;
  width: 0;
  height: 0;
}

.settings-toggle-slider {
  position: absolute;
  inset: 0;
  background: var(--color-surface-alt);
  border: 1px solid var(--color-border);
  border-radius: 999px;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.settings-toggle-slider::before {
  content: "";
  position: absolute;
  width: 16px;
  height: 16px;
  left: 2px;
  top: 2px;
  border-radius: 50%;
  background: var(--color-text-dim);
  transition: transform 0.15s ease, background 0.15s ease;
}

.settings-toggle-checkbox:checked + .settings-toggle-slider {
  background: var(--color-accent-soft);
  border-color: var(--color-accent-dim);
}

.settings-toggle-checkbox:checked + .settings-toggle-slider::before {
  transform: translateX(16px);
  background: var(--color-accent);
}

.wallpaper-blur-row {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
}

.wallpaper-blur-label {
  font-size: 12px;
  color: var(--color-text-dim);
  flex: 0 0 auto;
}

.wallpaper-blur-slider {
  flex: 1;
  accent-color: var(--color-accent);
}

/* ============================================
   NextØS animated logo
   ============================================ */

.nextos-logo {
  display: inline-flex;
  align-items: baseline;
  font-family: var(--font-ui);
  font-weight: 600;
  color: #ffffff;
  line-height: 1;
  cursor: default;
  user-select: none;
}

.nextos-logo-text {
  white-space: pre;
}

.nextos-o-wrap {
  position: relative;
  display: inline-block;
}

.nextos-o-char {
  position: relative;
}

.nextos-o-fill {
  position: absolute;
  inset: 0.16em 0.1em;
  border-radius: 50%;
  background: currentColor;
  opacity: 0;
}

/* The strike is 3 pieces so it can rest as a classic "Ø" (outer pieces
   poking past the O) but retract to something that fits entirely inside
   the O before spinning. Rotation lives on the wrap; the outer pieces
   just scale in place, anchored (via transform-origin) at the seam
   where they touch the fixed center piece, so they always look flush. */
.nextos-strike-wrap {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  transform: translate(-50%, -50%) rotate(-45deg);
}

.nextos-strike-center {
  position: absolute;
  top: -0.055em;
  left: -0.15em;
  width: 0.3em;
  height: 0.11em;
  background: #ffffff;
  border-radius: 0;
  /* Deliberately wide + painted on top: it overlaps well into both outer
     pieces, so any sub-pixel rounding gap at the seam is fully covered
     rather than relying on two independent edges lining up exactly. */
  z-index: 2;
}

.nextos-strike-outer {
  position: absolute;
  top: -0.055em;
  width: 0.42em;
  height: 0.11em;
  background: #ffffff;
  transform: scaleX(1);
}

.nextos-strike-outer.nextos-strike-left {
  left: -0.51em;
  transform-origin: right center;
  border-radius: 999px 0 0 999px;
}

.nextos-strike-outer.nextos-strike-right {
  left: 0.09em;
  transform-origin: left center;
  /* Round only the outer tip; the inner (left) edge stays square, flush with the center. */
  border-radius: 0 999px 999px 0;
}

/* ============================================
   Notification Testing
   ============================================ */

.nt-app {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.nt-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--color-border);
}

.nt-row-label {
  font-size: 13px;
  color: var(--color-text);
}

.nt-trigger-btn {
  flex: 0 0 auto;
  padding: 6px 14px;
  border-radius: 6px;
  border: 1px solid var(--color-border);
  background: var(--color-surface-raised);
  color: var(--color-text);
  font-size: 13px;
  font-family: inherit;
  cursor: default;
}

.nt-trigger-btn:hover {
  border-color: var(--color-accent-dim);
  color: var(--color-accent);
}
