/* Budgie Desktop Preview
   Colors from budgie-desktop internal theme (src/theme/common/_colors.scss)
   Layout from panel.ini + Budgie Menu / Raven source */

:root {
  --panel-height: 39px;
  --panel-top-height: 32px;
  --panel-left-width: 52px;
  --dock-height: 56px;
  --panel-bg: #161616;
  --panel-border: #0f1116;
  --panel-fg: #ffffff;
  --panel-fg-dim: rgba(255, 255, 255, 0.7);
  --chrome-top: 0px;
  --chrome-bottom: var(--panel-height);
  --chrome-left: 0px;

  --accent: #6bca81;
  --accent-hover: #7dd694;
  --accent-fg: #000000;
  --danger: #f04a50;

  --surface: #1e1e1e;
  --surface-raised: #262626;
  --surface-hover: rgba(255, 255, 255, 0.1);
  --surface-active: rgba(255, 255, 255, 0.15);
  --surface-fg: #ffffff;
  --surface-fg-dim: rgba(255, 255, 255, 0.65);
  --entry-bg: rgba(255, 255, 255, 0.1);
  --entry-border: rgba(0, 0, 0, 0.25);

  --shadow: 0 8px 28px rgba(0, 0, 0, 0.55);
  --font: "Noto Sans", "Cantarell", "Ubuntu", system-ui, sans-serif;
  --transition: 170ms ease-out;

  --sym-filter: invert(1) brightness(1.15);
  --wallpaper: url("assets/wallpapers/valley-midnight.jpg");

  --raven-width: 280px;
  --raven-bg: #161616;
  --raven-header: #262626;
  --raven-widget: #262626;

  --menu-width: 520px;
  --menu-height: min(520px, 55vh);
  --menu-cat-width: 168px;

  /* Nemo / GTK window */
  --win-bg: #2d2d2d;
  --win-header: #353535;
  --win-sidebar: #2a2a2a;
  --win-content: #2d2d2d;
  --win-fg: #eeeeec;
  --win-fg-dim: #9a9a9a;
  --win-border: #1a1a1a;
  --win-hover: rgba(255, 255, 255, 0.07);
  --win-selected: rgba(107, 202, 129, 0.28);
  --win-input: #3a3a3a;
  --win-shadow: 0 18px 50px rgba(0, 0, 0, 0.55);
  --win-radius: 8px;
  --close: #e35d4b;
  --close-hover: #f26d5b;
  --max: #6bca81;
  --min: #e6a317;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  font-family: var(--font);
  font-size: 13px;
  color: var(--panel-fg);
  background: #0a0a0c;
  -webkit-font-smoothing: antialiased;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}

button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

img {
  display: block;
  user-select: none;
  -webkit-user-drag: none;
}

.sym {
  filter: var(--sym-filter);
}

/* ---------- Desktop ---------- */

.desktop {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.wallpaper {
  position: absolute;
  inset: 0;
  background: var(--wallpaper) center / cover no-repeat;
  z-index: 0;
}

.desktop-icons {
  position: absolute;
  top: 16px;
  left: 16px;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 96px;
}

.desk-icon {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 6px 4px;
  border-radius: 6px;
  color: #fff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.85);
  transition: background var(--transition);
}

.desk-icon:hover {
  background: rgba(255, 255, 255, 0.12);
}

.desk-icon:focus-visible,
.desk-icon.selected {
  background: rgba(107, 202, 129, 0.28);
  outline: 1px solid rgba(107, 202, 129, 0.5);
}

.desk-icon img {
  width: 48px;
  height: 48px;
  object-fit: contain;
}

.desk-icon span {
  font-size: 12px;
  text-align: center;
  line-height: 1.25;
  max-width: 88px;
  word-break: break-word;
}

/* ---------- Layout chooser (preview chrome) ---------- */

.layout-chooser {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 35;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 14px 16px 16px;
  border-radius: 14px;
  background: rgba(22, 22, 22, 0.42);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  opacity: 0.38;
  transition: opacity 200ms ease, background 200ms ease, border-color 200ms ease;
  user-select: none;
  pointer-events: auto;
}

.layout-chooser:hover,
.layout-chooser:focus-within {
  opacity: 0.96;
  background: rgba(22, 22, 22, 0.88);
  border-color: rgba(255, 255, 255, 0.16);
}

.layout-chooser-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.7);
}

.layout-chooser-options {
  display: flex;
  gap: 10px;
}

.layout-opt {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: 100px;
  padding: 10px 8px 10px;
  border-radius: 10px;
  color: rgba(255, 255, 255, 0.85);
  transition: background-color var(--transition), color var(--transition), box-shadow var(--transition);
}

.layout-opt:hover {
  background: rgba(255, 255, 255, 0.1);
}

.layout-opt.active {
  background: rgba(107, 202, 129, 0.22);
  color: #fff;
  box-shadow: inset 0 0 0 1px rgba(107, 202, 129, 0.55);
}

.layout-opt-name {
  font-size: 12px;
  font-weight: 600;
}

.layout-preview {
  position: relative;
  width: 72px;
  height: 48px;
  border-radius: 5px;
  background: linear-gradient(145deg, rgba(80, 120, 140, 0.45), rgba(30, 40, 50, 0.55));
  border: 1px solid rgba(255, 255, 255, 0.12);
  overflow: hidden;
}

.lp-bar {
  position: absolute;
  background: rgba(255, 255, 255, 0.72);
}

.lp-top {
  top: 0;
  left: 0;
  right: 0;
  height: 5px;
}

.lp-bottom {
  bottom: 0;
  left: 0;
  right: 0;
  height: 6px;
}

.lp-left {
  top: 5px;
  bottom: 0;
  left: 0;
  width: 7px;
}

.lp-dock {
  bottom: 4px;
  left: 50%;
  transform: translateX(-50%);
  width: 38px;
  height: 8px;
  border-radius: 4px;
}

.layout-opt.active .lp-bar {
  background: var(--accent);
}

/* ---------- Panel ---------- */

.panel {
  position: absolute;
  z-index: 50;
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  background: var(--panel-bg);
  color: var(--panel-fg);
  padding: 0 2px;
  user-select: none;
}

.panel[hidden] {
  display: none !important;
}

.panel-bottom {
  left: 0;
  right: 0;
  bottom: 0;
  height: var(--panel-height);
  box-shadow: 0 -1px 0 var(--panel-border);
}

.panel-top {
  left: 0;
  right: 0;
  top: 0;
  height: var(--panel-top-height);
  box-shadow: 0 1px 0 var(--panel-border);
}

.panel-left {
  top: var(--panel-top-height);
  left: 0;
  bottom: 0;
  width: var(--panel-left-width);
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  padding: 6px 0;
  box-shadow: 1px 0 0 var(--panel-border);
}

.panel-left-inner {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  flex: 1;
  min-height: 0;
}

.panel-start,
.panel-center,
.panel-end {
  display: flex;
  align-items: stretch;
  gap: 0;
}

.panel-center {
  flex: 1;
  justify-content: center;
  min-width: 0;
}

.panel-end {
  margin-left: auto;
}

.panel-top .panel-start,
.panel-top .panel-end,
.panel-top .panel-center {
  align-items: stretch;
}

.panel-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 100%;
  padding: 0 6px;
  transition: background-color var(--transition);
}

.panel-btn:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

.panel-btn:active,
.panel-btn[aria-expanded="true"] {
  background-color: var(--accent);
  color: var(--accent-fg);
}

.panel-btn:active .sym,
.panel-btn[aria-expanded="true"] .sym {
  filter: invert(0) brightness(0);
}

.panel-menu-btn {
  min-width: 40px;
  padding: 0 8px;
}

.menu-grid-icon {
  width: 20px;
  height: 20px;
}

.icon-tasklist {
  display: flex;
  align-items: stretch;
  gap: 0;
  margin-left: 2px;
}

.task-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 100%;
  padding: 0 4px;
  transition: background-color var(--transition);
}

.task-btn:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

.task-btn img {
  width: 24px;
  height: 24px;
  object-fit: contain;
}

.task-indicator {
  position: absolute;
  left: 50%;
  bottom: 2px;
  transform: translateX(-50%);
  width: 0;
  height: 3px;
  border-radius: 2px;
  background: var(--accent);
  transition: width var(--transition);
}

.task-btn.running .task-indicator {
  width: 12px;
}

.task-btn.active .task-indicator {
  width: 22px;
  background: color-mix(in srgb, var(--accent) 70%, white);
}

.task-btn.active {
  background-color: rgba(255, 255, 255, 0.08);
}

/* Vertical icon tasklist (Unity left dock) */
.icon-tasklist.vertical {
  flex-direction: column;
  align-items: stretch;
  margin: 0;
  width: 100%;
  gap: 2px;
}

.icon-tasklist.vertical .task-btn {
  width: 100%;
  height: 44px;
  padding: 0;
}

.icon-tasklist.vertical .task-btn img {
  width: 28px;
  height: 28px;
}

.icon-tasklist.vertical .task-indicator {
  left: 3px;
  top: 50%;
  bottom: auto;
  transform: translateY(-50%);
  width: 3px;
  height: 0;
  border-radius: 2px;
}

.icon-tasklist.vertical .task-btn.running .task-indicator {
  width: 3px;
  height: 12px;
}

.icon-tasklist.vertical .task-btn.active .task-indicator {
  width: 3px;
  height: 22px;
  background: color-mix(in srgb, var(--accent) 70%, white);
}

/* ---------- Layout modes ---------- */

/* Traditional: bottom panel only (default) */
.layout-traditional {
  --chrome-top: 0px;
  --chrome-bottom: var(--panel-height);
  --chrome-left: 0px;
}

.layout-traditional .panel-top,
.layout-traditional .panel-left {
  display: none !important;
}

.layout-traditional .panel-bottom {
  display: flex !important;
}

/* Unity-like: top panel + left dock */
.layout-unity {
  --chrome-top: var(--panel-top-height);
  --chrome-bottom: 0px;
  --chrome-left: var(--panel-left-width);
}

.layout-unity .panel-bottom {
  display: none !important;
}

.layout-unity .panel-top,
.layout-unity .panel-left {
  display: flex !important;
}

.layout-unity .panel-left {
  top: var(--panel-top-height);
  bottom: 0;
}

.layout-unity .desktop-icons {
  left: calc(var(--panel-left-width) + 12px);
  top: calc(var(--panel-top-height) + 12px);
}

.layout-unity .budgie-menu {
  left: 4px;
  top: calc(var(--panel-top-height) + 6px);
  bottom: auto;
}

/* macOS-like (Cupertino): top panel + bottom dock */
.layout-cupertino {
  --chrome-top: var(--panel-top-height);
  --chrome-bottom: calc(var(--dock-height) + 16px);
  --chrome-left: 0px;
}

.layout-cupertino .panel-left {
  display: none !important;
}

.layout-cupertino .panel-top {
  display: flex !important;
}

.layout-cupertino .panel-bottom {
  display: flex !important;
  left: 50%;
  right: auto;
  bottom: 10px;
  transform: translateX(-50%);
  width: auto;
  height: var(--dock-height);
  padding: 0 10px;
  border-radius: 16px;
  background: rgba(22, 22, 22, 0.72);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.45), inset 0 0 0 1px rgba(255, 255, 255, 0.08);
  justify-content: center;
  gap: 0;
}

.layout-cupertino .panel-bottom .panel-start,
.layout-cupertino .panel-bottom .panel-end {
  display: none !important;
}

.layout-cupertino .panel-bottom .panel-center {
  display: flex;
  flex: 0 0 auto;
  margin: 0;
  align-items: center;
}

.layout-cupertino .panel-bottom .icon-tasklist {
  margin: 0;
  gap: 4px;
  align-items: center;
}

.layout-cupertino .panel-bottom .task-btn {
  width: 48px;
  height: 48px;
  border-radius: 12px;
}

.layout-cupertino .panel-bottom .task-btn img {
  width: 36px;
  height: 36px;
}

.layout-cupertino .panel-bottom .task-indicator {
  bottom: 3px;
  height: 3px;
}

.layout-cupertino .desktop-icons {
  top: calc(var(--panel-top-height) + 12px);
}

.layout-cupertino .budgie-menu {
  left: 4px;
  top: calc(var(--panel-top-height) + 6px);
  bottom: auto;
}

/* Chrome offsets for Raven / maximized windows / popovers */
.raven {
  top: var(--chrome-top);
  bottom: var(--chrome-bottom);
}

.layout-unity .raven {
  left: auto;
}

.layout-cupertino .status-popover,
.layout-unity .status-popover {
  bottom: auto;
  top: calc(var(--panel-top-height) + 6px);
}

.layout-traditional .status-popover {
  bottom: calc(var(--panel-height) + 6px);
  top: auto;
}

.nemo-window.maximized {
  top: var(--chrome-top);
  left: var(--chrome-left);
  width: calc(100% - var(--chrome-left));
  height: calc(100% - var(--chrome-top) - var(--chrome-bottom));
  border-radius: 0;
}

.desktop.raven-open .nemo-window:not(.maximized) {
  max-width: calc(100vw - var(--raven-width) - var(--chrome-left) - 24px);
}

.system-tray {
  display: flex;
  align-items: center;
  padding: 0 6px;
  opacity: 0.55;
}

.tray-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--panel-fg-dim);
}

.status-applet {
  display: flex;
  align-items: stretch;
}

.status-item {
  min-width: 28px;
  padding: 0 4px;
}

.status-item img {
  width: 16px;
  height: 16px;
}

.panel-clock {
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.01em;
  padding: 0 10px;
  min-width: auto;
}

.panel-clock span {
  white-space: nowrap;
}

.raven-trigger {
  min-width: 30px;
  padding: 0 6px;
}

.raven-trigger img {
  width: 16px;
  height: 16px;
}

/* ---------- Budgie Menu ---------- */

.budgie-menu {
  position: absolute;
  left: 4px;
  bottom: calc(var(--chrome-bottom) + 6px);
  z-index: 60;
  width: var(--menu-width);
  max-width: calc(100vw - 16px);
  height: var(--menu-height);
  filter: drop-shadow(0 10px 30px rgba(0, 0, 0, 0.55));
}

.budgie-menu[hidden] {
  display: none;
}

.budgie-menu-panel {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: var(--panel-bg);
  border-radius: 8px;
  overflow: hidden;
  padding: 8px;
  color: var(--surface-fg);
}

.budgie-menu-header {
  flex-shrink: 0;
  margin-bottom: 8px;
}

.menu-search-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--entry-bg);
  border-radius: 6px;
  padding: 6px 10px;
}

.menu-search-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  opacity: 0.85;
}

.menu-search {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  color: var(--surface-fg);
  font: inherit;
  font-size: 14px;
  padding: 2px 0;
  min-width: 0;
}

.menu-search::placeholder {
  color: var(--surface-fg-dim);
}

.menu-search::-webkit-search-cancel-button {
  filter: invert(1);
}

.budgie-menu-body {
  flex: 1;
  display: flex;
  min-height: 0;
  gap: 4px;
}

.menu-categories {
  flex: 0 0 var(--menu-cat-width);
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 2px 4px 2px 0;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.25) transparent;
}

.menu-cat {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  text-align: left;
  padding: 6px 10px;
  border-radius: 6px;
  color: var(--surface-fg);
  transition: background-color var(--transition);
  white-space: nowrap;
}

.menu-cat:hover {
  background: rgba(255, 255, 255, 0.1);
}

.menu-cat.selected {
  background: var(--accent);
  color: var(--accent-fg);
}

.menu-cat.selected img {
  filter: invert(0) brightness(0);
}

.menu-cat img {
  width: 20px;
  height: 20px;
  object-fit: contain;
  flex-shrink: 0;
}

.menu-cat .cat-glyph {
  width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
}

.menu-cat span {
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.menu-apps-scroll {
  flex: 1;
  min-width: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 2px 0 2px 4px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.3) transparent;
}

.menu-apps {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.menu-app {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  text-align: left;
  padding: 6px 10px;
  border-radius: 6px;
  transition: background-color var(--transition);
}

.menu-app:hover {
  background: rgba(255, 255, 255, 0.1);
}

.menu-app:active {
  background: var(--accent);
  color: var(--accent-fg);
}

.menu-app:active .menu-app-desc {
  color: rgba(0, 0, 0, 0.65);
}

.menu-app img {
  width: 32px;
  height: 32px;
  object-fit: contain;
  flex-shrink: 0;
}

.menu-app-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
  gap: 1px;
}

.menu-app-name {
  font-size: 13px;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.menu-app-desc {
  font-size: 11px;
  color: var(--surface-fg-dim);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.menu-empty {
  margin: 24px 12px;
  text-align: center;
  color: var(--surface-fg-dim);
  font-size: 15px;
}

.budgie-menu-footer {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 8px;
  margin-top: 4px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  gap: 8px;
}

.menu-user-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px 4px 4px;
  border-radius: 999px;
  transition: background-color var(--transition);
  min-width: 0;
}

.menu-user-btn:hover {
  background: rgba(255, 255, 255, 0.1);
}

.user-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  padding: 5px;
  box-sizing: border-box;
}

.menu-user-btn span {
  font-size: 13px;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.menu-footer-actions {
  display: flex;
  align-items: center;
  gap: 2px;
}

.menu-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  transition: background-color var(--transition);
}

.menu-icon-btn:hover {
  background: rgba(255, 255, 255, 0.1);
}

.menu-icon-btn:active {
  background: var(--accent);
}

.menu-icon-btn:active .sym {
  filter: invert(0) brightness(0);
}

.menu-icon-btn img {
  width: 16px;
  height: 16px;
}

/* ---------- Power dialog ---------- */

.power-dialog {
  position: absolute;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(2px);
}

.power-dialog[hidden] {
  display: none;
}

.power-dialog-card {
  display: flex;
  gap: 12px;
  padding: 20px 24px;
  background: var(--panel-bg);
  border-radius: 12px;
  box-shadow: var(--shadow);
}

.power-dialog-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: 88px;
  padding: 14px 8px;
  border-radius: 10px;
  transition: background-color var(--transition);
  font-size: 12px;
}

.power-dialog-item:hover {
  background: rgba(255, 255, 255, 0.1);
}

.power-dialog-item.danger:hover {
  background: rgba(240, 74, 80, 0.2);
}

.power-dialog-item img {
  width: 28px;
  height: 28px;
}

/* ---------- Status popovers ---------- */

.status-popover {
  position: absolute;
  bottom: calc(var(--chrome-bottom) + 6px);
  right: 48px;
  z-index: 55;
  min-width: 240px;
  padding: 12px;
  background: var(--panel-bg);
  border-radius: 8px;
  box-shadow: var(--shadow);
  color: var(--surface-fg);
}

.status-popover[hidden] {
  display: none;
}

.sound-popover {
  right: 100px;
}

.net-popover {
  right: 130px;
}

.batt-popover {
  right: 70px;
}

.status-popover-row,
.raven-sound-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.status-popover-row img,
.raven-sound-row img {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.status-slider {
  flex: 1;
  -webkit-appearance: none;
  appearance: none;
  height: 6px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.15);
  outline: none;
}

.status-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  border: none;
}

.status-slider::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  border: none;
}

.status-pct {
  font-size: 12px;
  color: var(--surface-fg-dim);
  min-width: 36px;
  text-align: right;
}

.net-status-row,
.batt-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.net-status-row img,
.batt-row img {
  width: 22px;
  height: 22px;
}

.net-name {
  font-weight: 600;
  font-size: 13px;
}

.net-sub {
  font-size: 12px;
  color: var(--surface-fg-dim);
  margin-top: 2px;
}

.status-sep {
  height: 1px;
  background: rgba(255, 255, 255, 0.08);
  margin: 10px 0;
}

.power-profiles {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.profile-btn {
  text-align: left;
  padding: 8px 10px;
  border-radius: 6px;
  font-size: 13px;
  transition: background-color var(--transition);
}

.profile-btn:hover {
  background: rgba(255, 255, 255, 0.1);
}

.profile-btn.active {
  background: var(--accent);
  color: var(--accent-fg);
  font-weight: 600;
}

/* ---------- Raven ---------- */

.raven {
  position: absolute;
  top: var(--chrome-top);
  right: 0;
  bottom: var(--chrome-bottom);
  width: var(--raven-width);
  z-index: 40;
  display: flex;
  flex-direction: column;
  background: var(--raven-bg);
  color: var(--surface-fg);
  box-shadow: -4px 0 24px rgba(0, 0, 0, 0.4);
  transform: translateX(0);
  transition: top 160ms ease, bottom 160ms ease;
}

.raven[hidden] {
  display: none;
}

.raven.open {
  display: flex;
}

.raven-header {
  flex-shrink: 0;
  background: var(--raven-header);
  padding: 4px 8px;
  display: flex;
  justify-content: center;
}

.raven-switcher {
  display: inline-flex;
  background: rgba(0, 0, 0, 0.25);
  border-radius: 6px;
  padding: 2px;
  gap: 2px;
}

.raven-tab {
  padding: 6px 16px;
  border-radius: 5px;
  font-size: 12px;
  font-weight: 600;
  color: var(--surface-fg-dim);
  transition: background-color var(--transition), color var(--transition);
}

.raven-tab:hover {
  color: var(--surface-fg);
}

.raven-tab.active {
  background: rgba(255, 255, 255, 0.12);
  color: var(--surface-fg);
}

.raven-stack {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.25) transparent;
}

.raven-page {
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.raven-page[hidden] {
  display: none;
}

.raven-widget {
  background: var(--raven-widget);
  border-radius: 8px;
  overflow: hidden;
}

.raven-widget-header {
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--surface-fg);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.raven-widget-body {
  padding: 10px 12px 12px;
}

.raven-device-name {
  margin-top: 8px;
  font-size: 11px;
  color: var(--surface-fg-dim);
}

/* Raven calendar */
.rc-month-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.rc-month-label {
  font-weight: 600;
  font-size: 13px;
}

.rc-nav {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  font-size: 18px;
  line-height: 1;
  color: var(--surface-fg);
  transition: background-color var(--transition);
}

.rc-nav:hover {
  background: rgba(255, 255, 255, 0.1);
}

.rc-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  text-align: center;
  font-size: 11px;
  color: var(--surface-fg-dim);
  margin-bottom: 4px;
}

.rc-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
}

.rc-day {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  border-radius: 50%;
  color: var(--surface-fg);
}

.rc-day.muted {
  color: rgba(255, 255, 255, 0.28);
}

.rc-day.today {
  background: var(--accent);
  color: var(--accent-fg);
  font-weight: 700;
}

/* Raven media */
.raven-media {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  text-align: center;
}

.media-art {
  width: 72px;
  height: 72px;
  border-radius: 8px;
  background: linear-gradient(135deg, #3a3a3a, #1a1a1a);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.media-title {
  font-weight: 600;
  font-size: 13px;
}

.media-artist {
  font-size: 11px;
  color: var(--surface-fg-dim);
  margin-top: 2px;
}

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

.media-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background-color var(--transition);
}

.media-btn:hover {
  background: rgba(255, 255, 255, 0.1);
}

.media-btn img {
  width: 16px;
  height: 16px;
}

.media-play {
  width: 42px;
  height: 42px;
  background: rgba(255, 255, 255, 0.08);
}

.raven-notif-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 48px 16px;
  color: var(--surface-fg-dim);
  text-align: center;
}

.raven-notif-empty img {
  width: 32px;
  height: 32px;
  opacity: 0.5;
}

.raven-notif-empty p {
  margin: 0;
  font-size: 14px;
}

.raven-clear-btn {
  padding: 6px 14px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.08);
  font-size: 12px;
  opacity: 0.5;
  cursor: default;
}

/* ---------- Nemo window ---------- */

.nemo-window {
  position: absolute;
  top: 8%;
  left: 12%;
  width: min(920px, 76vw);
  height: min(580px, 72vh);
  z-index: 30;
  display: flex;
  flex-direction: column;
  background: var(--win-bg);
  color: var(--win-fg);
  border-radius: var(--win-radius);
  box-shadow: var(--win-shadow);
  overflow: hidden;
  border: 1px solid var(--win-border);
}

.nemo-window[hidden] {
  display: none;
}

/* maximized geometry is driven by layout --chrome-* vars (see Layout modes) */

.nemo-titlebar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 40px;
  padding: 0 8px 0 12px;
  background: var(--win-header);
  flex-shrink: 0;
  cursor: default;
  user-select: none;
}

.nemo-titlebar-left {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.nemo-title-icon {
  width: 18px;
  height: 18px;
  object-fit: contain;
}

.nemo-title {
  font-size: 13px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nemo-window-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nemo-wc {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  flex-shrink: 0;
}

.nemo-min {
  background: var(--min);
}

.nemo-max {
  background: var(--max);
}

.nemo-close {
  background: var(--close);
}

.nemo-close:hover {
  background: var(--close-hover);
}

.nemo-menubar {
  display: flex;
  align-items: center;
  gap: 0;
  padding: 0 6px;
  height: 28px;
  background: var(--win-header);
  border-bottom: 1px solid rgba(0, 0, 0, 0.2);
  flex-shrink: 0;
}

.nemo-menu-btn {
  padding: 2px 10px;
  border-radius: 4px;
  font-size: 12px;
  color: var(--win-fg);
}

.nemo-menu-btn:hover {
  background: var(--win-hover);
}

.nemo-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  background: var(--win-header);
  border-bottom: 1px solid rgba(0, 0, 0, 0.15);
  flex-shrink: 0;
}

.nemo-toolbar-group {
  display: flex;
  align-items: center;
  gap: 2px;
}

.nemo-tb-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 28px;
  border-radius: 5px;
  color: var(--win-fg);
  transition: background-color var(--transition);
}

.nemo-tb-btn:hover:not(:disabled) {
  background: var(--win-hover);
}

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

.nemo-tb-btn.active {
  background: rgba(107, 202, 129, 0.22);
}

.nemo-tb-btn img {
  width: 16px;
  height: 16px;
}

.nemo-pathbar {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  background: var(--win-input);
  border-radius: 6px;
  padding: 3px 8px;
  height: 28px;
}

.nemo-crumb {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--win-fg);
  min-width: 0;
}

.nemo-crumb img {
  width: 16px;
  height: 16px;
  object-fit: contain;
}

.nemo-crumb span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nemo-body {
  flex: 1;
  display: flex;
  min-height: 0;
}

.nemo-sidebar {
  width: 180px;
  flex-shrink: 0;
  background: var(--win-sidebar);
  border-right: 1px solid rgba(0, 0, 0, 0.2);
  overflow-y: auto;
  padding: 8px 6px;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.sidebar-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--win-fg-dim);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 8px 10px 4px;
}

.sidebar-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  text-align: left;
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 13px;
  color: var(--win-fg);
  transition: background-color var(--transition);
}

.sidebar-item:hover {
  background: var(--win-hover);
}

.sidebar-item.active {
  background: var(--win-selected);
}

.sidebar-item img {
  width: 18px;
  height: 18px;
  object-fit: contain;
  flex-shrink: 0;
}

.nemo-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: var(--win-content);
}

.nemo-search-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.15);
  background: var(--win-header);
}

.nemo-search-bar[hidden] {
  display: none;
}

.nemo-search-bar img {
  width: 16px;
  height: 16px;
}

.nemo-search-input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  color: var(--win-fg);
  font: inherit;
  font-size: 13px;
}

.nemo-content {
  flex: 1;
  overflow: auto;
  padding: 12px;
  min-height: 0;
}

.nemo-list-header {
  display: none;
}

.nemo-content.view-icons {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 8px;
  align-content: start;
}

.nemo-content.view-icons .nemo-list-header {
  display: none;
}

.nemo-content.view-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 0;
}

.nemo-content.view-list .nemo-list-header {
  display: grid;
  grid-template-columns: 28px 1fr 90px 120px;
  gap: 8px;
  padding: 6px 16px;
  font-size: 11px;
  font-weight: 600;
  color: var(--win-fg-dim);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  position: sticky;
  top: 0;
  background: var(--win-content);
  z-index: 1;
}

.nemo-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 10px 6px;
  border-radius: 6px;
  cursor: default;
  user-select: none;
  color: var(--win-fg);
  transition: background-color var(--transition);
}

.nemo-item:hover {
  background: var(--win-hover);
}

.nemo-item.selected {
  background: var(--win-selected);
}

.nemo-item img {
  width: 48px;
  height: 48px;
  object-fit: contain;
}

.nemo-item img[src*="thumbnails/"] {
  object-fit: cover;
  border-radius: 4px;
}

.view-list .nemo-item img[src*="thumbnails/"] {
  border-radius: 2px;
}

.nemo-item-name {
  font-size: 12px;
  text-align: center;
  word-break: break-word;
  max-width: 100%;
  line-height: 1.25;
}

.nemo-item-meta {
  display: none;
}

.view-list .nemo-item {
  flex-direction: row;
  justify-content: flex-start;
  gap: 8px;
  padding: 6px 16px;
  border-radius: 0;
  display: grid;
  grid-template-columns: 28px 1fr 90px 120px;
  align-items: center;
}

.view-list .nemo-item img {
  width: 22px;
  height: 22px;
}

.view-list .nemo-item-name {
  text-align: left;
  font-size: 13px;
}

.view-list .nemo-item-meta {
  display: contents;
}

.view-list .nemo-item-size,
.view-list .nemo-item-date {
  font-size: 12px;
  color: var(--win-fg-dim);
}

.nemo-statusbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 12px;
  font-size: 11px;
  color: var(--win-fg-dim);
  background: var(--win-header);
  border-top: 1px solid rgba(0, 0, 0, 0.15);
  flex-shrink: 0;
}

/* Desktop dim when menu open (subtle) */
.desktop.menu-open .wallpaper {
  filter: brightness(0.92);
}
