/* ==========================================================================
   NusaOS — Hyprland / Kali inspired WebOS
   ========================================================================== */

:root {
  --accent: #50fa7b;
  --accent-2: #7aa2f7;
  --accent-rgb: 80, 250, 123;
  --bg: #07090e;
  --glass: rgba(13, 17, 25, 0.72);
  --glass-2: rgba(19, 25, 36, 0.88);
  --glass-3: rgba(255, 255, 255, 0.045);
  --line: rgba(255, 255, 255, 0.085);
  --line-strong: rgba(255, 255, 255, 0.16);
  --text: #dce6f5;
  --muted: #8b98ad;
  --dim: #5c687c;
  --red: #ff5f57;
  --yellow: #febc2e;
  --green: #28c840;
  --radius: 14px;
  --shadow: 0 26px 70px rgba(0, 0, 0, 0.62);
  --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

html, body {
  height: 100%;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--text);
  background: var(--bg);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection { background: rgba(var(--accent-rgb), 0.28); color: #fff; }

button, input, textarea, select { font-family: inherit; color: inherit; }

button { cursor: pointer; }

a { color: var(--accent-2); }

::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  border: 2px solid transparent;
  background-clip: content-box;
}
::-webkit-scrollbar-thumb:hover { background: rgba(var(--accent-rgb), 0.4); background-clip: content-box; }

.hidden { display: none !important; }

/* ==========================================================================
   Wallpaper
   ========================================================================== */

#wallpaper {
  position: fixed;
  inset: 0;
  z-index: 0;
  background-color: #05070b;
  background-size: cover;
  background-position: center;
  transition: background 0.6s ease;
}

#wallpaper::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
  background-size: 46px 46px;
  mask-image: radial-gradient(ellipse at 50% 40%, #000 10%, transparent 78%);
  -webkit-mask-image: radial-gradient(ellipse at 50% 40%, #000 10%, transparent 78%);
  opacity: 0.7;
}

#wallpaper::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% 120%, rgba(0, 0, 0, 0) 30%, rgba(0, 0, 0, 0.55) 100%);
}

.wall-aurora {
  background:
    radial-gradient(1000px 620px at 16% 18%, rgba(34, 211, 238, 0.22), transparent 62%),
    radial-gradient(900px 560px at 84% 12%, rgba(139, 92, 246, 0.24), transparent 60%),
    radial-gradient(900px 700px at 52% 106%, rgba(16, 185, 129, 0.15), transparent 62%),
    linear-gradient(158deg, #070b12 0%, #0a0f1a 46%, #05070c 100%);
}

.wall-kali {
  background:
    radial-gradient(900px 620px at 22% 20%, rgba(56, 132, 255, 0.24), transparent 60%),
    radial-gradient(800px 600px at 82% 78%, rgba(14, 165, 233, 0.14), transparent 62%),
    radial-gradient(700px 500px at 70% 6%, rgba(120, 160, 255, 0.12), transparent 60%),
    linear-gradient(160deg, #060a14 0%, #081226 52%, #04060d 100%);
}

.wall-synth {
  background:
    radial-gradient(880px 560px at 20% 24%, rgba(236, 72, 153, 0.22), transparent 62%),
    radial-gradient(900px 620px at 82% 18%, rgba(124, 58, 237, 0.26), transparent 60%),
    radial-gradient(900px 700px at 50% 108%, rgba(14, 165, 233, 0.14), transparent 60%),
    linear-gradient(160deg, #0a0712 0%, #120b22 48%, #06040c 100%);
}

.wall-matrix {
  background:
    radial-gradient(900px 640px at 24% 18%, rgba(34, 197, 94, 0.2), transparent 60%),
    radial-gradient(800px 600px at 80% 80%, rgba(16, 185, 129, 0.12), transparent 62%),
    linear-gradient(160deg, #040906 0%, #07130c 52%, #020504 100%);
}

.wall-carbon {
  background:
    radial-gradient(900px 640px at 20% 20%, rgba(148, 163, 184, 0.14), transparent 60%),
    radial-gradient(800px 600px at 82% 78%, rgba(100, 116, 139, 0.12), transparent 62%),
    linear-gradient(160deg, #0a0c10 0%, #11151c 52%, #06080b 100%);
}

/* ==========================================================================
   Top bar (GNOME)
   ========================================================================== */

#topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 40px;
  z-index: 9000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
  font-size: 12px;
  background: rgba(7, 10, 16, 0.62);
  backdrop-filter: blur(26px) saturate(1.3);
  -webkit-backdrop-filter: blur(26px) saturate(1.3);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.03), 0 10px 30px rgba(0, 0, 0, 0.25);
  user-select: none;
}

.tb-left, .tb-right { display: flex; align-items: center; gap: 10px; min-width: 0; }
.tb-left { flex: 1; }
.tb-right { flex: 1; justify-content: flex-end; }
.tb-center { position: absolute; left: 50%; transform: translateX(-50%); }

.tb-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 27px;
  padding: 0 12px;
  border-radius: 9px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text);
  font-size: 12px;
  font-weight: 500;
  transition: background 0.15s, border-color 0.15s;
}
.tb-btn:hover { background: rgba(255, 255, 255, 0.07); border-color: var(--line); }

.tb-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent);
}

.tb-sep { width: 1px; height: 16px; background: var(--line); }

.tb-app {
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 260px;
}

.tb-clock {
  border: 1px solid transparent;
  background: transparent;
  color: var(--text);
  font-size: 12px;
  font-weight: 500;
  padding: 5px 12px;
  border-radius: 9px;
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.tb-clock:hover { background: rgba(255, 255, 255, 0.07); border-color: var(--line); }

.tb-chip {
  color: var(--muted);
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 7px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  white-space: nowrap;
}

.tb-user {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 11.5px;
  white-space: nowrap;
}

.tb-led {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 9px var(--accent);
  animation: pulse 2.6s ease-in-out infinite;
}

@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.45; } }

/* ==========================================================================
   Dock (Ubuntu style)
   ========================================================================== */

#dock {
  position: fixed;
  left: 13px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 8500;
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 9px;
  border-radius: 20px;
  background: rgba(12, 16, 24, 0.58);
  backdrop-filter: blur(24px) saturate(1.35);
  -webkit-backdrop-filter: blur(24px) saturate(1.35);
  border: 1px solid var(--line);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.dock-item {
  position: relative;
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 14px;
  background: transparent;
  color: var(--c, var(--text));
  transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

.dock-item svg { width: 23px; height: 23px; }

.dock-item:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--line);
  transform: translateX(3px) scale(1.04);
}

.dock-item.active {
  background: rgba(var(--accent-rgb), 0.1);
  border-color: rgba(var(--accent-rgb), 0.3);
}

.dock-item.active::after {
  content: '';
  position: absolute;
  left: -8px;
  top: 50%;
  width: 3px;
  height: 17px;
  border-radius: 3px;
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent);
  transform: translateY(-50%);
}

.dock-item::before {
  content: attr(data-label);
  position: absolute;
  left: calc(100% + 12px);
  top: 50%;
  transform: translateY(-50%) translateX(-4px);
  background: var(--glass-2);
  border: 1px solid var(--line);
  color: var(--text);
  font-size: 11px;
  padding: 5px 9px;
  border-radius: 8px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.12s, transform 0.12s;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.45);
}

.dock-item:hover::before { opacity: 1; transform: translateY(-50%) translateX(0); }

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

#desktop { position: fixed; inset: 40px 0 0 0; z-index: 1; }

#desktop-icons {
  position: absolute;
  top: 18px;
  left: 92px;
  display: grid;
  grid-template-columns: 86px;
  gap: 4px;
  z-index: 2;
}

.desk-icon {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 9px 6px;
  border-radius: 12px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text);
  font-size: 10.5px;
  line-height: 1.2;
  text-align: center;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.8);
  transition: background 0.14s, border-color 0.14s;
  user-select: none;
}
.desk-icon svg { width: 34px; height: 34px; color: var(--c, var(--text)); filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.5)); }
.desk-icon:hover { background: rgba(255, 255, 255, 0.07); border-color: var(--line); }
.desk-icon.sel { background: rgba(var(--accent-rgb), 0.14); border-color: rgba(var(--accent-rgb), 0.35); }

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

#windows {
  position: fixed;
  inset: 40px 0 0 0;
  pointer-events: none;
  z-index: 100;
}

.window {
  position: absolute;
  pointer-events: auto;
  display: flex;
  flex-direction: column;
  min-width: 340px;
  min-height: 220px;
  border-radius: var(--radius);
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(24, 30, 43, 0.82), rgba(10, 14, 21, 0.82));
  backdrop-filter: blur(24px) saturate(1.25);
  -webkit-backdrop-filter: blur(24px) saturate(1.25);
  border: 1px solid var(--line);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  animation: winIn 0.18s cubic-bezier(0.2, 0.9, 0.3, 1.2);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.window.focused {
  border-color: rgba(var(--accent-rgb), 0.34);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.68), 0 0 0 1px rgba(var(--accent-rgb), 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.07);
}

.window.minimized { display: none; }

.window.max {
  left: 76px !important;
  top: 0 !important;
  width: calc(100% - 76px) !important;
  height: 100% !important;
  border-radius: 0;
}

@keyframes winIn {
  from { opacity: 0; transform: scale(0.97) translateY(10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.win-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 42px;
  flex: 0 0 42px;
  padding: 0 9px 0 14px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.012));
  border-bottom: 1px solid var(--line);
  cursor: grab;
  user-select: none;
}
.win-bar:active { cursor: grabbing; }

.win-ico {
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  color: var(--c, var(--accent));
  flex: 0 0 auto;
}
.win-ico svg { width: 17px; height: 17px; }

.win-title {
  flex: 1;
  min-width: 0;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.015em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #e7edf8;
}

.win-tools { display: flex; align-items: center; gap: 4px; flex: 0 0 auto; }

.win-btn {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  transition: background 0.13s, color 0.13s, border-color 0.13s;
}
.win-btn svg { width: 13px; height: 13px; }
.win-btn:hover { background: rgba(255, 255, 255, 0.09); color: var(--text); border-color: var(--line); }
.win-btn.close:hover { background: rgba(255, 95, 87, 0.9); color: #160404; border-color: transparent; }

.win-body {
  position: relative;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.resizer {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 18px;
  height: 18px;
  cursor: nwse-resize;
  z-index: 5;
}
.resizer::after {
  content: '';
  position: absolute;
  right: 4px;
  bottom: 4px;
  width: 7px;
  height: 7px;
  border-right: 2px solid rgba(255, 255, 255, 0.18);
  border-bottom: 2px solid rgba(255, 255, 255, 0.18);
  border-radius: 0 0 3px 0;
}

/* ==========================================================================
   Shared controls
   ========================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 29px;
  padding: 0 11px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.045);
  color: var(--text);
  font-size: 11.5px;
  font-weight: 500;
  white-space: nowrap;
  transition: background 0.13s, border-color 0.13s, color 0.13s;
}
.btn svg { width: 14px; height: 14px; }
.btn:hover { background: rgba(255, 255, 255, 0.09); border-color: var(--line-strong); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }

.btn.primary {
  background: linear-gradient(180deg, rgba(var(--accent-rgb), 0.95), rgba(var(--accent-rgb), 0.72));
  border-color: rgba(var(--accent-rgb), 0.55);
  color: #06130a;
  font-weight: 700;
}
.btn.primary:hover { background: var(--accent); }

.btn.blue {
  background: rgba(122, 162, 247, 0.16);
  border-color: rgba(122, 162, 247, 0.4);
  color: #bcd0ff;
}
.btn.blue:hover { background: rgba(122, 162, 247, 0.26); }

.btn.danger { color: #ffb4ae; border-color: rgba(255, 95, 87, 0.3); background: rgba(255, 95, 87, 0.08); }
.btn.danger:hover { background: rgba(255, 95, 87, 0.2); }

.btn.ghost { background: transparent; }

.inp, select.inp, textarea.inp {
  height: 30px;
  padding: 0 10px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.35);
  color: var(--text);
  font-size: 12px;
  outline: none;
  transition: border-color 0.13s, box-shadow 0.13s;
}
.inp:focus { border-color: rgba(var(--accent-rgb), 0.5); box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.1); }
select.inp { cursor: pointer; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 8px;
  border-radius: 7px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.035);
  color: var(--muted);
  font-size: 10.5px;
}

.spin {
  width: 13px;
  height: 13px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.18);
  border-top-color: var(--accent);
  animation: spin 0.7s linear infinite;
  display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ==========================================================================
   Launcher
   ========================================================================== */

#launcher {
  position: fixed;
  inset: 0;
  z-index: 9500;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(4, 7, 12, 0.58);
  backdrop-filter: blur(18px) saturate(1.2);
  -webkit-backdrop-filter: blur(18px) saturate(1.2);
  animation: fadeIn 0.16s ease;
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.launcher-panel {
  width: min(880px, 92vw);
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  padding: 18px;
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(24, 30, 43, 0.9), rgba(10, 14, 21, 0.92));
  border: 1px solid var(--line-strong);
  box-shadow: 0 40px 120px rgba(0, 0, 0, 0.7), inset 0 1px 0 rgba(255, 255, 255, 0.07);
  animation: winIn 0.2s cubic-bezier(0.2, 0.9, 0.3, 1.1);
}

.launcher-search {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 50px;
  padding: 0 16px;
  border-radius: 13px;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.3);
}
.launcher-search svg { width: 19px; height: 19px; color: var(--muted); flex: 0 0 auto; }
.launcher-search input {
  flex: 1;
  height: 100%;
  border: none;
  outline: none;
  background: transparent;
  font-size: 15px;
  letter-spacing: 0.02em;
}
.launcher-search input::placeholder { color: var(--dim); }
.launcher-search kbd {
  font-size: 10px;
  color: var(--dim);
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 2px 6px;
}

.launcher-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  padding: 16px 2px 6px;
  overflow: auto;
}

.launcher-app {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 9px;
  padding: 16px 10px;
  border-radius: 14px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text);
  font-size: 11.5px;
  transition: background 0.13s, border-color 0.13s, transform 0.13s;
}
.launcher-app svg { width: 32px; height: 32px; color: var(--c, var(--text)); }
.launcher-app:hover { background: rgba(255, 255, 255, 0.06); border-color: var(--line); transform: translateY(-2px); }
.launcher-app small { color: var(--dim); font-size: 9.5px; }

.launcher-foot {
  display: flex;
  gap: 16px;
  justify-content: flex-end;
  padding: 8px 4px 0;
  color: var(--dim);
  font-size: 10px;
  letter-spacing: 0.04em;
  border-top: 1px solid var(--line);
  margin-top: 10px;
  padding-top: 10px;
}

/* ==========================================================================
   Lock screen
   ========================================================================== */

#lock {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: grid;
  place-items: center;
  background: rgba(4, 7, 12, 0.55);
  backdrop-filter: blur(30px) saturate(1.2);
  -webkit-backdrop-filter: blur(30px) saturate(1.2);
}

.lock-card {
  width: min(360px, 90vw);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 30px 26px;
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(24, 30, 43, 0.92), rgba(10, 14, 21, 0.94));
  border: 1px solid var(--line-strong);
  box-shadow: 0 40px 120px rgba(0, 0, 0, 0.7);
}
.lock-logo {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  background: rgba(var(--accent-rgb), 0.12);
  border: 1px solid rgba(var(--accent-rgb), 0.4);
  color: var(--accent);
  font-size: 28px;
  font-weight: 700;
  box-shadow: 0 0 40px rgba(var(--accent-rgb), 0.18);
}
.lock-card h1 { margin: 0; font-size: 18px; letter-spacing: 0.06em; }
.lock-card p { margin: 0; color: var(--muted); font-size: 11.5px; text-align: center; }
.lock-card input {
  width: 100%;
  height: 38px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.35);
  padding: 0 12px;
  outline: none;
  text-align: center;
}
.lock-card input:focus { border-color: rgba(var(--accent-rgb), 0.55); }
.lock-card button {
  width: 100%;
  height: 38px;
  border-radius: 10px;
  border: 1px solid rgba(var(--accent-rgb), 0.55);
  background: var(--accent);
  color: #06130a;
  font-weight: 700;
  letter-spacing: 0.04em;
}
.lock-error { color: #ffb4ae; font-size: 11px; min-height: 14px; }

/* ==========================================================================
   Toasts + modal
   ========================================================================== */

#toasts {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 11000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 360px;
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 11px 14px;
  border-radius: 11px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  background: var(--glass-2);
  backdrop-filter: blur(18px);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5);
  font-size: 11.5px;
  line-height: 1.5;
  animation: toastIn 0.2s cubic-bezier(0.2, 0.9, 0.3, 1.1);
}
.toast.err { border-left-color: var(--red); }
.toast.info { border-left-color: var(--accent-2); }
.toast.out { animation: toastOut 0.18s ease forwards; }

@keyframes toastIn { from { opacity: 0; transform: translateX(24px); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateX(24px); } }

#modal-root:empty { display: none; }
#modal-root {
  position: fixed;
  inset: 0;
  z-index: 10500;
  display: grid;
  place-items: center;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(3, 6, 10, 0.55);
  backdrop-filter: blur(8px);
  animation: fadeIn 0.14s ease;
}

.modal-card {
  position: relative;
  width: min(440px, 92vw);
  max-height: 78vh;
  display: flex;
  flex-direction: column;
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(24, 30, 43, 0.95), rgba(10, 14, 21, 0.96));
  border: 1px solid var(--line-strong);
  box-shadow: 0 40px 100px rgba(0, 0, 0, 0.7);
  animation: winIn 0.18s cubic-bezier(0.2, 0.9, 0.3, 1.1);
  overflow: hidden;
}
.modal-head { padding: 15px 18px 0; font-size: 13px; font-weight: 600; }
.modal-body { padding: 14px 18px; color: var(--muted); font-size: 12px; line-height: 1.6; overflow: auto; }
.modal-body .inp { width: 100%; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 0 18px 16px; }
.modal-list { display: flex; flex-direction: column; gap: 2px; max-height: 46vh; overflow: auto; margin-top: 8px; }
.modal-row {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 9px;
  border-radius: 8px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text);
  font-size: 11.5px;
  text-align: left;
  width: 100%;
}
.modal-row:hover { background: rgba(255, 255, 255, 0.06); border-color: var(--line); }
.modal-row svg { width: 15px; height: 15px; color: var(--muted); flex: 0 0 auto; }
.modal-row .grow { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.noscript {
  position: fixed;
  inset: 0;
  z-index: 20000;
  display: grid;
  place-items: center;
  background: #07090e;
  color: var(--text);
  font-size: 14px;
}

/* ==========================================================================
   File Manager (Nautilus)
   ========================================================================== */

.fm { display: flex; flex-direction: column; height: 100%; background: rgba(6, 9, 14, 0.28); }

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

.fm-toolbar .grow { flex: 1; }

.fm-crumbs {
  display: flex;
  align-items: center;
  gap: 3px;
  padding: 7px 12px;
  font-size: 11px;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
  white-space: nowrap;
}
.fm-crumb {
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  padding: 3px 7px;
  border-radius: 6px;
  font-size: 11px;
}
.fm-crumb:hover { background: rgba(255, 255, 255, 0.07); color: var(--text); }
.fm-crumb.cur { color: var(--accent); background: rgba(var(--accent-rgb), 0.08); border-color: rgba(var(--accent-rgb), 0.2); }
.fm-slash { color: var(--dim); }

.fm-list { flex: 1; overflow: auto; padding: 4px 0; }

.fm-row {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr) 78px 132px 34px;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  border: 1px solid transparent;
  border-left: 2px solid transparent;
  font-size: 11.5px;
  cursor: default;
  user-select: none;
}
.fm-row:hover { background: rgba(255, 255, 255, 0.04); }
.fm-row.sel {
  background: rgba(var(--accent-rgb), 0.1);
  border-color: rgba(var(--accent-rgb), 0.18);
  border-left-color: var(--accent);
}
.fm-name { display: flex; align-items: center; gap: 8px; min-width: 0; }
.fm-name span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fm-ico { width: 18px; height: 18px; flex: 0 0 auto; display: grid; place-items: center; }
.fm-ico svg { width: 17px; height: 17px; }
.fm-ico.dir { color: #ffd479; }
.fm-ico.py { color: #6cb6ff; }
.fm-ico.php { color: #a78bfa; }
.fm-ico.nb { color: #fb923c; }
.fm-ico.web { color: #34d399; }
.fm-ico.md { color: #93c5fd; }
.fm-ico.img { color: #f472b6; }
.fm-ico.txt { color: #cbd5e1; }
.fm-meta { color: var(--dim); font-size: 10px; text-align: right; }
.fm-open {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  opacity: 0;
}
.fm-row:hover .fm-open { opacity: 1; }
.fm-open:hover { background: rgba(var(--accent-rgb), 0.14); color: var(--accent); border-color: rgba(var(--accent-rgb), 0.3); }

.fm-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 6px 12px;
  border-top: 1px solid var(--line);
  color: var(--dim);
  font-size: 10px;
}

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

/* ==========================================================================
   Editor + console
   ========================================================================== */

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

.ed-toolbar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 9px;
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}
.ed-toolbar .grow { flex: 1; }
.ed-file {
  font-size: 10.5px;
  color: var(--muted);
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 4px 8px;
  max-width: 240px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ed-file.dirty { color: var(--yellow); border-color: rgba(254, 188, 46, 0.35); }

.ed-main { flex: 1; min-height: 0; position: relative; }
.ed-main .CodeMirror {
  height: 100%;
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 1.65;
  background: rgba(5, 8, 12, 0.55);
}
.ed-main .CodeMirror-gutters { background: rgba(5, 8, 12, 0.6); border-right: 1px solid var(--line); }
.ed-main .CodeMirror-focused { outline: none; }
.ed-main .CodeMirror-cursor { border-left-color: var(--accent); }

.ed-console {
  flex: 0 0 0;
  height: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  border-top: 1px solid var(--line);
  background: rgba(2, 5, 8, 0.92);
  transition: height 0.16s ease;
  overflow: hidden;
}
.ed-console.open { height: 190px; flex-basis: 190px; }
.ed-console-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 10px;
  border-bottom: 1px solid var(--line);
  font-size: 10px;
  color: var(--dim);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  flex: 0 0 auto;
}
.ed-console-head .grow { flex: 1; }
.ed-console-out {
  flex: 1;
  margin: 0;
  padding: 9px 11px;
  overflow: auto;
  font-family: var(--mono);
  font-size: 11.5px;
  line-height: 1.6;
  color: #c9d6e8;
  white-space: pre-wrap;
  word-break: break-word;
}
.ed-console-out .ok { color: var(--accent); }
.ed-console-out .err { color: #ff9d97; }
.ed-console-out .dim { color: var(--dim); }
.ed-console-out .info { color: #9ec1ff; }

/* ==========================================================================
   Notebook
   ========================================================================== */

.nb { display: flex; flex-direction: column; height: 100%; }
.nb-toolbar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}
.nb-toolbar .grow { flex: 1; }
.nb-cells { flex: 1; overflow: auto; padding: 14px; display: flex; flex-direction: column; gap: 10px; }

.nb-cell {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(8, 12, 18, 0.55);
  overflow: hidden;
  transition: border-color 0.14s;
}
.nb-cell:focus-within { border-color: rgba(var(--accent-rgb), 0.3); }
.nb-cell-head {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 8px;
  background: rgba(255, 255, 255, 0.028);
  border-bottom: 1px solid var(--line);
  font-size: 9.5px;
  color: var(--dim);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.nb-cell-head .grow { flex: 1; }
.nb-tag {
  padding: 2px 6px;
  border-radius: 5px;
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 9px;
}
.nb-tag.code { color: #9ec1ff; border-color: rgba(122, 162, 247, 0.35); }
.nb-tag.md { color: #ffd479; border-color: rgba(255, 212, 121, 0.3); }
.nb-mini {
  width: 23px;
  height: 23px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
}
.nb-mini:hover { background: rgba(255, 255, 255, 0.08); color: var(--text); border-color: var(--line); }
.nb-mini svg { width: 12px; height: 12px; }
.nb-mini.run:hover { color: var(--accent); border-color: rgba(var(--accent-rgb), 0.3); }
.nb-mini.del:hover { color: #ff9d97; border-color: rgba(255, 95, 87, 0.3); }

.nb-src {
  width: 100%;
  min-height: 64px;
  resize: vertical;
  border: none;
  outline: none;
  background: transparent;
  padding: 10px 12px;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.6;
  color: #d7e3f4;
  tab-size: 4;
}

.nb-md {
  padding: 12px 14px;
  font-size: 12px;
  line-height: 1.7;
  color: var(--text);
  overflow: auto;
}
.nb-md h1, .nb-md h2, .nb-md h3 { margin: 0 0 8px; line-height: 1.3; }
.nb-md h1 { font-size: 17px; color: #fff; }
.nb-md h2 { font-size: 15px; color: #eaf1fb; }
.nb-md h3 { font-size: 13px; }
.nb-md p { margin: 0 0 8px; }
.nb-md code { background: rgba(255, 255, 255, 0.08); border-radius: 4px; padding: 1px 5px; font-size: 11px; }
.nb-md pre { background: rgba(0, 0, 0, 0.4); border: 1px solid var(--line); border-radius: 8px; padding: 9px; overflow: auto; }
.nb-md a { color: var(--accent-2); }

.nb-out {
  margin: 0;
  padding: 9px 12px;
  border-top: 1px solid var(--line);
  background: rgba(2, 5, 8, 0.7);
  font-family: var(--mono);
  font-size: 11px;
  line-height: 1.6;
  color: #bfe9cc;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 220px;
  overflow: auto;
}
.nb-out.err { color: #ff9d97; }
.nb-out:empty { display: none; }

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

.term {
  height: 100%;
  display: flex;
  flex-direction: column;
  background: rgba(1, 4, 6, 0.9);
  padding: 12px 13px 8px;
  font-size: 12.5px;
  line-height: 1.62;
  color: #7dfba7;
  text-shadow: 0 0 8px rgba(80, 250, 123, 0.22);
}
.term-out { flex: 1; overflow: auto; white-space: pre-wrap; word-break: break-word; }
.term-out .cmd { color: #d9ffe6; }
.term-out .muted { color: #4f7d5d; }
.term-out .err { color: #ff8f88; text-shadow: 0 0 8px rgba(255, 95, 87, 0.25); }
.term-out .info { color: #7fd4ff; }
.term-out .acc { color: #b6ffd0; }
.term-out .dir { color: #7fd4ff; }
.term-line { display: flex; align-items: baseline; gap: 8px; flex: 0 0 auto; padding-top: 2px; }
.term-prompt { color: #50fa7b; white-space: nowrap; font-weight: 600; }
.term-input {
  flex: 1;
  min-width: 0;
  border: none;
  outline: none;
  background: transparent;
  color: #d9ffe6;
  font-family: var(--mono);
  font-size: 12.5px;
  caret-color: var(--accent);
}

/* ==========================================================================
   XAMPP panel
   ========================================================================== */

.xp { height: 100%; overflow: auto; padding: 14px; }
.xp h3 { margin: 0 0 10px; font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }

.xp-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-bottom: 16px; }
.xp-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.015));
}
.xp-card-top { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.xp-card-top svg { width: 17px; height: 17px; color: var(--c, var(--accent)); }
.xp-card-top strong { font-size: 12px; letter-spacing: 0.03em; }
.xp-status { display: flex; align-items: center; gap: 6px; font-size: 10px; color: var(--muted); margin-bottom: 10px; }
.xp-led { width: 7px; height: 7px; border-radius: 50%; background: var(--dim); }
.xp-led.on { background: var(--green); box-shadow: 0 0 9px var(--green); }
.xp-led.off { background: var(--red); box-shadow: 0 0 9px rgba(255, 95, 87, 0.6); }
.xp-led.warn { background: var(--yellow); box-shadow: 0 0 9px rgba(254, 188, 46, 0.6); }
.xp-card .btn { width: 100%; height: 27px; font-size: 10.5px; }
.xp-card .btn + .btn { margin-top: 5px; }

.xp-info {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 7px;
  margin-bottom: 16px;
}
.xp-kv {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(0, 0, 0, 0.22);
  font-size: 10.5px;
}
.xp-kv span { color: var(--dim); }
.xp-kv b { color: var(--text); font-weight: 500; }

.xp-db { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: rgba(0, 0, 0, 0.18); }
.xp-db-head { display: flex; align-items: center; gap: 8px; padding: 9px 11px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.xp-db-head .grow { flex: 1; }
.xp-db-body { display: grid; grid-template-columns: 180px minmax(0, 1fr); min-height: 210px; }
.xp-tables { border-right: 1px solid var(--line); padding: 6px; overflow: auto; max-height: 300px; }
.xp-tables button {
  display: flex;
  align-items: center;
  gap: 7px;
  width: 100%;
  padding: 6px 8px;
  border-radius: 7px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  font-size: 11px;
  text-align: left;
}
.xp-tables button:hover { background: rgba(255, 255, 255, 0.06); color: var(--text); }
.xp-tables button svg { width: 13px; height: 13px; color: var(--accent-2); }
.xp-query { display: flex; flex-direction: column; min-width: 0; }
.xp-query textarea {
  width: 100%;
  height: 78px;
  resize: vertical;
  border: none;
  border-bottom: 1px solid var(--line);
  outline: none;
  background: rgba(0, 0, 0, 0.35);
  padding: 9px 11px;
  font-family: var(--mono);
  font-size: 11.5px;
  line-height: 1.6;
  color: #cfe0f5;
}
.xp-query-bar { display: flex; align-items: center; gap: 6px; padding: 7px 9px; border-bottom: 1px solid var(--line); }
.xp-query-bar .grow { flex: 1; }
.xp-result { flex: 1; overflow: auto; max-height: 260px; }
.xp-table { width: 100%; border-collapse: collapse; font-size: 10.5px; }
.xp-table th {
  position: sticky;
  top: 0;
  background: rgba(18, 24, 34, 0.98);
  color: var(--muted);
  text-align: left;
  padding: 6px 9px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.xp-table td { padding: 5px 9px; border-bottom: 1px solid rgba(255, 255, 255, 0.04); color: #c8d5e6; max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.xp-table tr:hover td { background: rgba(255, 255, 255, 0.03); }
.xp-note { padding: 12px; color: var(--dim); font-size: 11px; line-height: 1.6; }
.xp-note code { color: var(--accent); }

/* ==========================================================================
   Notepad / Calculator / Settings / Image
   ========================================================================== */

.np { display: flex; flex-direction: column; height: 100%; }
.np-bar { display: flex; align-items: center; gap: 6px; padding: 7px 9px; border-bottom: 1px solid var(--line); }
.np-bar .grow { flex: 1; }
.np textarea {
  flex: 1;
  resize: none;
  border: none;
  outline: none;
  background: rgba(5, 8, 12, 0.5);
  padding: 14px;
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 1.7;
  color: #dbe6f5;
  tab-size: 4;
}

.calc { height: 100%; display: flex; flex-direction: column; padding: 12px; gap: 10px; background: rgba(5, 8, 12, 0.35); }
.calc-screen {
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(0, 0, 0, 0.4);
  padding: 12px 14px;
  text-align: right;
  min-height: 72px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 3px;
}
.calc-expr { color: var(--dim); font-size: 10.5px; min-height: 14px; overflow: hidden; white-space: nowrap; }
.calc-val { color: var(--text); font-size: 25px; font-weight: 500; letter-spacing: 0.02em; overflow: hidden; white-space: nowrap; }
.calc-grid { flex: 1; display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.calc-key {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.045);
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
  transition: background 0.1s, transform 0.06s;
}
.calc-key:hover { background: rgba(255, 255, 255, 0.1); }
.calc-key:active { transform: scale(0.97); }
.calc-key.op { color: var(--accent-2); }
.calc-key.eq { background: var(--accent); color: #06130a; border-color: rgba(var(--accent-rgb), 0.6); font-weight: 700; }
.calc-key.warn { color: #ffb4ae; }

.set { height: 100%; overflow: auto; padding: 16px; }
.set h3 { margin: 0 0 10px; font-size: 11px; letter-spacing: 0.09em; text-transform: uppercase; color: var(--muted); }
.set section { margin-bottom: 20px; }
.set-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 10px 0; border-bottom: 1px solid rgba(255, 255, 255, 0.05); font-size: 11.5px; }
.set-row:last-child { border-bottom: none; }
.set-row .hint { color: var(--dim); font-size: 10px; margin-top: 3px; }
.swatches { display: flex; gap: 8px; flex-wrap: wrap; }
.swatch {
  width: 64px;
  height: 44px;
  border-radius: 9px;
  border: 2px solid transparent;
  background-size: cover;
  background-position: center;
  position: relative;
  overflow: hidden;
  transition: transform 0.12s, border-color 0.12s;
}
.swatch:hover { transform: translateY(-2px); }
.swatch.on { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.14); }
.swatch span {
  position: absolute;
  inset: auto 0 0 0;
  font-size: 8px;
  text-align: center;
  padding: 2px;
  background: rgba(0, 0, 0, 0.55);
  color: #dfe8f6;
}
.swatch.wall-aurora, .swatch.wall-kali, .swatch.wall-synth, .swatch.wall-matrix, .swatch.wall-carbon { background-size: 220% 220%; }
.accent-dots { display: flex; gap: 8px; }
.accent-dot {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid transparent;
  background: var(--d);
  transition: transform 0.12s, border-color 0.12s;
}
.accent-dot:hover { transform: scale(1.12); }
.accent-dot.on { border-color: #fff; box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.12); }
.set-about { color: var(--muted); font-size: 11px; line-height: 1.8; }
.set-about b { color: var(--text); }

.imgview { height: 100%; display: grid; place-items: center; background: repeating-conic-gradient(rgba(255, 255, 255, 0.04) 0% 25%, transparent 0% 50%) 50% / 22px 22px; padding: 14px; overflow: auto; }
.imgview img { max-width: 100%; max-height: 100%; border-radius: 8px; box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5); }

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 820px) {
  .tb-chip#tb-db, .tb-chip#tb-net { display: none; }
  .tb-left { flex: 0 0 auto; }
  .tb-app, .tb-sep { display: none; }
  .tb-center { position: static; transform: none; flex: 1; text-align: center; }
  .tb-clock { width: 100%; text-align: center; }
  .tb-right { flex: 0 0 auto; }
  .tb-user { display: none; }
  #desktop-icons { left: 12px; top: 10px; grid-template-columns: 76px; }
  .desk-icon { font-size: 9.5px; }
  .desk-icon svg { width: 28px; height: 28px; }

  #dock {
    left: 50%;
    top: auto;
    bottom: 10px;
    transform: translateX(-50%);
    flex-direction: row;
    border-radius: 18px;
    padding: 7px;
    gap: 4px;
    max-width: 96vw;
    overflow-x: auto;
  }
  .dock-item { width: 42px; height: 42px; }
  .dock-item:hover { transform: translateY(-3px); }
  .dock-item.active::after { left: 50%; top: auto; bottom: -7px; width: 15px; height: 3px; transform: translateX(-50%); }
  .dock-item::before { display: none; }

  .window.max { left: 0 !important; width: 100% !important; height: 100% !important; }
  #windows { inset: 40px 0 62px 0; }
  #desktop { inset: 40px 0 62px 0; }
  .launcher-grid { grid-template-columns: repeat(3, 1fr); }
  .xp-cards { grid-template-columns: 1fr; }
  .xp-db-body { grid-template-columns: 1fr; }
  .xp-tables { border-right: none; border-bottom: 1px solid var(--line); max-height: 140px; }
  .fm-row { grid-template-columns: 24px minmax(0, 1fr) auto; }
  .fm-row > .fm-meta + .fm-meta, .fm-row .fm-open { display: none; }
  .fm-name span { white-space: normal; word-break: break-word; }
}

@media (max-width: 520px) {
  .tb-clock { font-size: 11px; padding: 5px 6px; }
  .tb-left { gap: 6px; }
  .tb-btn { padding: 0 8px; }
  .launcher-grid { grid-template-columns: repeat(2, 1fr); }
  .window { min-width: 0; }
  .ed-toolbar .btn span { display: none; }
}
