/* ==========================================================================
   AlexcppOS
   A Plasma-flavoured desktop, an i3 session, and a bare console.
   Theme colours (--accent / --dim / --bg) are set on :root at runtime.
   ========================================================================== */

:root {
  --accent: #4ade80;
  --dim: #166534;
  --bg: #080a09;

  /* Surfaces are derived from --bg so every theme stays coherent.
     The two percentages MUST sum to 100: when they sum to less, CSS multiplies
     the result's alpha by that sum, and these surfaces have to stay opaque —
     a window you can see the previous window's text through is unreadable. */
  --s0: var(--bg);
  --s1: color-mix(in srgb, var(--bg) 95%, #fff 5%);
  --s2: color-mix(in srgb, var(--bg) 91%, #fff 9%);
  --s3: color-mix(in srgb, var(--bg) 86%, #fff 14%);

  --line: color-mix(in srgb, #fff 10%, transparent);
  --line-strong: color-mix(in srgb, var(--accent) 45%, transparent);
  --glow: color-mix(in srgb, var(--accent) 16%, transparent);

  --fg: #e3e7e5;
  --fg-muted: color-mix(in srgb, var(--fg) 58%, transparent);
  --fg-faint: color-mix(in srgb, var(--fg) 34%, transparent);

  --mono: ui-monospace, "SF Mono", "JetBrains Mono", "Fira Code", Menlo, Consolas, monospace;
  --sans: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

  --panel-h: 44px;
  --radius: 6px;
  --shadow: 0 12px 40px rgba(0, 0, 0, .55), 0 2px 8px rgba(0, 0, 0, .4);
  --shadow-lg: 0 24px 70px rgba(0, 0, 0, .7), 0 4px 12px rgba(0, 0, 0, .5);
  --ease: cubic-bezier(.2, .7, .3, 1);
}

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

/* Several shells below set `display` on elements that are toggled with the
   `hidden` attribute, which would otherwise win over the UA rule. */
[hidden] { display: none !important; }

html, body {
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: var(--s0);
  color: var(--fg);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

#stage { position: fixed; inset: 0; }

/* Screen brightness and night light. Sits above every shell — including the
   panel — because turning a display down dims all of it, and below nothing,
   because it must never intercept a click. */
#display-filter {
  position: fixed;
  inset: 0;
  z-index: 900;
  pointer-events: none;
  background: rgb(0 0 0 / var(--screen-dim, 0));
  transition: background .12s linear;
}
#display-filter::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgb(255 168 60 / var(--screen-warm, 0));
  mix-blend-mode: multiply;
  transition: background .12s linear;
}

::selection { background: var(--accent); color: #000; }

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

button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }

a { color: var(--accent); text-underline-offset: 3px; }

* { scrollbar-width: thin; scrollbar-color: var(--s3) transparent; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-thumb { background: var(--s3); border-radius: 5px; border: 2px solid transparent; background-clip: content-box; }
*::-webkit-scrollbar-track { background: transparent; }

/* Inline icon wrapper — every icon inherits colour and sizes to the text. */
.i { display: inline-flex; width: 1.15em; height: 1.15em; flex: 0 0 auto; vertical-align: -0.2em; }
.i svg { width: 100%; height: 100%; display: block; }
.i.big { width: 2.1em; height: 2.1em; }

.muted { color: var(--fg-muted); }
.nowrap { white-space: nowrap; }
.spacer { flex: 1; }
kbd, code {
  font-family: var(--mono);
  font-size: 0.88em;
  background: var(--s2);
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 0 .35em;
}

.no-anim *, .no-anim *::before, .no-anim *::after {
  animation-duration: .001ms !important;
  transition-duration: .001ms !important;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    transition-duration: .001ms !important;
  }
}

/* ══ boot ═══════════════════════════════════════════════════════════════ */

.boot {
  position: fixed;
  inset: 0;
  background: #000;
  color: var(--fg-muted);
  font-family: var(--mono);
  font-size: 12.5px;
  padding: 2rem clamp(1rem, 4vw, 3rem);
  overflow: hidden;
  cursor: pointer;
}
.boot-line { white-space: pre-wrap; word-break: break-word; }
.boot-line.ok { color: var(--fg); }
.ok-tag { color: var(--accent); }
.boot-hint {
  position: absolute;
  bottom: 1.5rem; left: 50%;
  transform: translateX(-50%);
  color: var(--fg-faint);
  font-size: 11px;
  letter-spacing: .08em;
}

/* ══ display manager ════════════════════════════════════════════════════ */

.dm {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  animation: fade-in .35s var(--ease);
}
.dm.out { opacity: 0; transition: opacity .3s ease; }

.dm-wall { position: absolute; inset: 0; z-index: 0; }
.dm-wall::after {
  content: "";
  position: absolute;
  inset: 0;
  backdrop-filter: blur(22px) saturate(.7);
  background: color-mix(in srgb, var(--s0) 58%, transparent);
}

.dm-clock {
  position: absolute;
  top: clamp(2rem, 8vh, 5rem);
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  text-align: center;
}
.dm-clock .t { display: block; font-size: clamp(3rem, 9vw, 5rem); font-weight: 200; letter-spacing: -.04em; line-height: 1; }
.dm-clock .d { display: block; color: var(--fg-muted); margin-top: .35rem; }

.dm-card {
  position: relative;
  z-index: 2;
  display: grid;
  justify-items: center;
  gap: .35rem;
  padding: 2rem 2rem 1.75rem;
  border-radius: 12px;
  background: color-mix(in srgb, var(--s1) 82%, transparent);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(14px);
  width: min(92vw, 400px);
}
.dm-card h1 { margin: .5rem 0 0; font-size: 1.15rem; font-weight: 600; }
.dm-card p { margin: 0; font-size: .8125rem; }
.dm-hint {
  margin: .5rem 0 1.1rem !important;
  color: var(--fg-faint);
  text-align: center;
  max-width: 30ch;
  line-height: 1.45;
}

.dm-avatar {
  width: 88px; height: 88px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: var(--s2);
  border: 2px solid var(--line-strong);
  color: var(--fg-faint);
}
.dm-avatar svg { width: 48px; height: 48px; }
.dm-avatar img { width: 100%; height: 100%; object-fit: cover; }

/* The session tiles are the login control — full-width rows, one click each. */
.dm-session-list { display: grid; gap: .4rem; width: 100%; }

.dm-session {
  display: flex;
  align-items: center;
  gap: .7rem;
  width: 100%;
  text-align: left;
  padding: .65rem .8rem;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--s0);
  color: var(--fg);
  transition: border-color .14s ease, background .14s ease, transform .1s ease;
}
.dm-session-text { flex: 1; min-width: 0; }
.dm-session-text strong { display: block; font-size: 13.5px; font-weight: 600; }
.dm-session-text .muted { display: block; font-size: 11.5px; line-height: 1.35; }
.dm-session .i { color: var(--fg-faint); }
.dm-go { opacity: 0; transition: opacity .14s ease, transform .14s ease; }

.dm-session:hover,
.dm-session:focus-visible {
  background: var(--s2);
  border-color: var(--accent);
  outline: none;
}
.dm-session:hover .dm-go,
.dm-session:focus-visible .dm-go { opacity: 1; transform: translateX(2px); }
.dm-session:active { transform: translateY(1px); }

.dm-session.on { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.dm-session.on .i:first-child { color: var(--accent); }

.dm-foot {
  position: absolute;
  z-index: 2;
  bottom: 1.25rem;
  left: 0; right: 0;
  display: flex;
  justify-content: space-between;
  padding-inline: 1.5rem;
  font-size: .75rem;
  color: var(--fg-faint);
}
.dm-foot a { display: inline-flex; align-items: center; gap: .4rem; text-decoration: none; color: var(--fg-muted); }
.dm-foot a svg { width: 14px; height: 14px; }
.dm-foot a:hover { color: var(--accent); }

@keyframes fade-in { from { opacity: 0 } to { opacity: 1 } }

/* ══ wallpaper ══════════════════════════════════════════════════════════ */

.wallpaper {
  position: absolute;
  inset: 0;
  z-index: 0;
  background-size: cover;
  background-position: center;
}
.wallpaper[data-mode="grid"] {
  background-image:
    linear-gradient(color-mix(in srgb, var(--accent) 7%, transparent) 1px, transparent 1px),
    linear-gradient(90deg, color-mix(in srgb, var(--accent) 7%, transparent) 1px, transparent 1px),
    radial-gradient(ellipse 90% 70% at 50% 30%, color-mix(in srgb, var(--accent) 9%, transparent), transparent 70%),
    linear-gradient(160deg, var(--s1), var(--s0) 60%);
  background-size: 46px 46px, 46px 46px, 100% 100%, 100% 100%;
}
.wallpaper[data-mode="image"]::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom,
    color-mix(in srgb, var(--s0) 45%, transparent),
    color-mix(in srgb, var(--s0) 65%, transparent));
}

/* ══ desktop shell ══════════════════════════════════════════════════════ */

/* The area the desktop cube rotates: wallpaper, icons, and windows. Sized to
   exclude the panel, so the panel stays put while the workspace turns. */
.desk-stage {
  position: absolute;
  inset: 0 0 var(--panel-h) 0;
  overflow: hidden;
}

body[data-shell="desktop"] .win-layer {
  position: absolute;
  inset: 0;
  z-index: 10;
}

/* The window layer spans the whole desktop and sits above the desktop icons,
   so it must not swallow clicks aimed at them. Only the windows themselves
   take pointer events; the empty space between them is transparent to the
   mouse and the icons underneath stay reachable. */
.win-layer { pointer-events: none; }
.win { pointer-events: auto; }

.desk-icons {
  position: absolute;
  inset: 12px;
  z-index: 1;
  /* Fill downward first, then start a new column — desktop convention. */
  display: grid;
  grid-template-rows: repeat(auto-fill, 92px);
  grid-auto-columns: 92px;
  grid-auto-flow: column;
  justify-content: start;
  align-content: start;
  gap: 4px;
}

.desk-icon {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 4px;
  padding: 8px 4px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: none;
  color: var(--fg);
  text-align: center;
  transition: background .12s ease, border-color .12s ease;
}
.desk-icon .label {
  font-size: 11.5px;
  line-height: 1.25;
  text-shadow: 0 1px 3px rgba(0, 0, 0, .9);
  overflow-wrap: anywhere;
}
.desk-icon .i.big { color: var(--accent); filter: drop-shadow(0 2px 4px rgba(0, 0, 0, .6)); }
.desk-icon:hover { background: color-mix(in srgb, var(--accent) 10%, transparent); }
.desk-icon.sel { background: color-mix(in srgb, var(--accent) 18%, transparent); border-color: var(--line-strong); }

/* Rubber-band selection. Sits above the icons but below the windows, so a
   window covering part of the desktop covers the band too — as it should. */
.marquee {
  position: absolute;
  z-index: 5;
  border: 1px solid var(--accent);
  border-radius: 2px;
  background: color-mix(in srgb, var(--accent) 15%, transparent);
  pointer-events: none;
}

/* Stop the drag from turning into a text selection across the desktop. */
.desk-stage.selecting { user-select: none; -webkit-user-select: none; }

/* ── panel ──────────────────────────────────────────────────────────────── */

.panel {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: var(--panel-h);
  z-index: 300;
  display: flex;
  align-items: stretch;
  gap: 6px;
  padding: 4px 6px;
  background: color-mix(in srgb, var(--s1) 86%, transparent);
  border-top: 1px solid var(--line);
  backdrop-filter: blur(16px) saturate(1.2);
}

.panel-launcher {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: 0 .85rem;
  border: 0;
  border-radius: 4px;
  background: none;
  color: var(--fg);
  font-weight: 500;
  transition: background .12s ease, color .12s ease;
}
.panel-launcher .i { color: var(--accent); }
.panel-launcher:hover { background: var(--s2); }
.panel-launcher.on { background: var(--accent); color: #000; }
.panel-launcher.on .i { color: #000; }

.panel-tasks {
  flex: 1;
  min-width: 0;
  display: flex;
  gap: 4px;
  overflow-x: auto;
  scrollbar-width: none;
}
.panel-tasks::-webkit-scrollbar { display: none; }

.task {
  display: flex;
  align-items: center;
  gap: .45rem;
  min-width: 0;
  max-width: 190px;
  padding: 0 .7rem;
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 4px;
  background: var(--s2);
  color: var(--fg-muted);
  transition: background .12s ease, color .12s ease, border-color .12s ease;
}
.task .lbl { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12.5px; }
.task:hover { background: var(--s3); color: var(--fg); }
.task.active { color: var(--fg); border-bottom-color: var(--accent); background: var(--s3); }
.task.min { opacity: .55; font-style: italic; }

.panel-pager { display: flex; gap: 2px; align-items: center; }
.pip {
  width: 24px; height: 24px;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: none;
  color: var(--fg-faint);
  font-size: 11px;
  transition: all .12s ease;
}
.pip.has { color: var(--fg-muted); border-color: var(--fg-faint); }
.pip.on { background: var(--accent); border-color: var(--accent); color: #000; font-weight: 700; }

.panel-tray { display: flex; align-items: center; gap: 2px; padding-left: 4px; border-left: 1px solid var(--line); }
.tray-btn {
  position: relative;
  width: 30px; height: 30px;
  display: grid; place-items: center;
  border: 0; border-radius: 4px;
  background: none;
  color: var(--fg-muted);
}
.tray-btn:hover { background: var(--s2); color: var(--accent); }
.tray-btn.on { background: var(--s3); color: var(--accent); }
.tray-btn svg { width: 17px; height: 17px; }

.tray-badge {
  position: absolute;
  top: 1px; right: 0;
  min-width: 14px; height: 14px;
  padding: 0 3px;
  display: grid; place-items: center;
  border-radius: 7px;
  background: var(--accent);
  color: #000;
  font-size: 9.5px;
  font-weight: 700;
  line-height: 1;
}

/* ── tray popups ────────────────────────────────────────────────────────── */

.tray-popup {
  position: absolute;
  right: 6px;
  bottom: calc(var(--panel-h) + 6px);
  z-index: 330;
  width: min(94vw, 360px);
  max-height: min(64vh, 480px);
  display: flex;
  flex-direction: column;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--s1) 96%, transparent);
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(18px);
  overflow: hidden;
  animation: pop-up .16s var(--ease);
}

.tray-popup header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  padding: .7rem .85rem;
  border-bottom: 1px solid var(--line);
}
.tray-popup header strong { font-size: 13px; }
.tray-popup > p { margin: 0; padding: .6rem .85rem .8rem; font-size: 11.5px; line-height: 1.45; }

.notif-list { overflow-y: auto; padding: .35rem; display: grid; gap: 2px; }
.notif {
  display: flex;
  align-items: flex-start;
  gap: .6rem;
  padding: .55rem .6rem;
  border-radius: 6px;
  background: var(--s0);
}
.notif .i { color: var(--accent); margin-top: .1em; }
.notif-main { flex: 1; min-width: 0; }
.notif-main strong { display: block; font-size: 12.5px; }
.notif-main .muted { display: block; font-size: 11.5px; line-height: 1.4; }
.notif time { font-size: 10.5px; color: var(--fg-faint); font-variant-numeric: tabular-nums; }
.notif-empty { padding: 1.5rem .85rem; text-align: center; font-size: 12px; margin: 0; }

/* ── sliders ────────────────────────────────────────────────────────────── */

.slider { display: grid; gap: .45rem; padding: .75rem .85rem .25rem; }
.slider-head {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-size: 12.5px;
  color: var(--fg-muted);
}
.slider-head .i { color: var(--accent); }
.slider-head output {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--fg);
  font-variant-numeric: tabular-nums;
}

.slider input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 4px;
  border-radius: 2px;
  background: var(--s3);
  outline: none;
}
.slider input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--accent);
  border: 0;
  cursor: pointer;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent);
}
.slider input[type="range"]::-moz-range-thumb {
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--accent);
  border: 0;
  cursor: pointer;
}
.slider input[type="range"]:focus-visible { box-shadow: 0 0 0 2px var(--accent); }

.panel-clock {
  display: grid;
  place-items: center;
  padding: 0 .7rem;
  border: 0; border-radius: 4px;
  background: none;
  color: var(--fg);
  font-variant-numeric: tabular-nums;
  line-height: 1.15;
}
.panel-clock:hover { background: var(--s2); }
.panel-clock .time { font-size: 13px; font-weight: 600; }
.panel-clock .date { font-size: 10.5px; color: var(--fg-muted); }

/* ── application launcher ───────────────────────────────────────────────── */

.launcher {
  position: absolute;
  left: 6px;
  bottom: calc(var(--panel-h) + 6px);
  z-index: 320;
  width: min(94vw, 520px);
  max-height: min(70vh, 560px);
  display: flex;
  flex-direction: column;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--s1) 94%, transparent);
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(20px);
  overflow: hidden;
  animation: pop-up .16s var(--ease);
}
@keyframes pop-up { from { opacity: 0; transform: translateY(8px) scale(.985) } to { opacity: 1; transform: none } }

.launcher-head {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .9rem 1rem;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--accent) 7%, transparent);
}
.launcher-head .avatar {
  width: 38px; height: 38px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--s2);
  border: 1px solid var(--line-strong);
  color: var(--accent);
}
.launcher-head .avatar svg { width: 20px; height: 20px; }
.launcher-head strong { display: block; font-size: 13.5px; }
.launcher-head .muted { font-size: 11.5px; font-family: var(--mono); }

.launcher-search {
  display: flex;
  align-items: center;
  gap: .55rem;
  padding: .6rem 1rem;
  border-bottom: 1px solid var(--line);
  color: var(--fg-faint);
}
.launcher-search input { flex: 1; background: none; border: 0; outline: none; color: var(--fg); }

.launcher-body { display: grid; grid-template-columns: 128px 1fr; min-height: 0; flex: 1; }

.launcher-cats {
  display: flex;
  flex-direction: column;
  padding: .5rem;
  gap: 2px;
  border-right: 1px solid var(--line);
  overflow-y: auto;
}
.cat {
  text-align: left;
  padding: .4rem .6rem;
  border: 0; border-radius: 4px;
  background: none;
  color: var(--fg-muted);
  font-size: 12.5px;
}
.cat:hover { background: var(--s2); color: var(--fg); }
.cat.on { background: var(--accent); color: #000; font-weight: 600; }

.launcher-apps { padding: .5rem; overflow-y: auto; display: grid; gap: 2px; align-content: start; }

.lapp {
  display: flex;
  align-items: center;
  gap: .7rem;
  text-align: left;
  padding: .45rem .6rem;
  border: 0; border-radius: 5px;
  background: none;
  color: var(--fg);
}
.lapp .i.big { color: var(--accent); width: 1.7em; height: 1.7em; }
.lapp-main strong { display: block; font-size: 13px; font-weight: 500; }
.lapp-main .muted { font-size: 11px; }
.lapp:hover { background: var(--s2); }

.launcher-foot {
  display: flex;
  gap: .4rem;
  padding: .55rem .75rem;
  border-top: 1px solid var(--line);
  background: var(--s0);
}

/* ── context menu, notifications, sheets ────────────────────────────────── */

.ctx-menu {
  position: fixed;
  z-index: 400;
  min-width: 210px;
  padding: 4px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--s1) 96%, transparent);
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(16px);
  animation: pop-up .12s var(--ease);
}
.ctx-item {
  display: flex;
  align-items: center;
  gap: .6rem;
  width: 100%;
  padding: .42rem .6rem;
  border: 0; border-radius: 5px;
  background: none;
  color: var(--fg);
  text-align: left;
  font-size: 13px;
}
.ctx-item .i { color: var(--fg-faint); }
.ctx-item:hover { background: var(--accent); color: #000; }
.ctx-item:hover .i { color: #000; }
.ctx-sep { height: 1px; background: var(--line); margin: 4px 6px; }

.notifications {
  position: absolute;
  right: 12px;
  bottom: calc(var(--panel-h) + 12px);
  z-index: 350;
  display: grid;
  gap: 8px;
  justify-items: end;
  pointer-events: none;
}
.toast {
  display: flex;
  align-items: flex-start;
  gap: .6rem;
  max-width: 320px;
  padding: .7rem .9rem;
  border-radius: 8px;
  border: 1px solid var(--line-strong);
  background: color-mix(in srgb, var(--s2) 96%, transparent);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
  animation: slide-in .22s var(--ease);
}
.toast .i { color: var(--accent); margin-top: .1em; }
.toast strong { display: block; font-size: 13px; }
.toast .muted { font-size: 12px; }
.toast.out { opacity: 0; transform: translateX(12px); transition: all .35s ease; }
@keyframes slide-in { from { opacity: 0; transform: translateX(16px) } to { opacity: 1; transform: none } }

.shortcut-sheet {
  position: fixed;
  inset: 0;
  z-index: 450;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, .55);
  backdrop-filter: blur(4px);
}
.shortcut-sheet .sheet {
  max-width: min(92vw, 460px);
  padding: 1.5rem 1.75rem;
  border-radius: 10px;
  border: 1px solid var(--line-strong);
  background: var(--s1);
  box-shadow: var(--shadow-lg);
}
.shortcut-sheet h2 {
  margin: 0 0 1rem;
  font-size: 12px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--accent);
}
.shortcut-sheet dl { display: grid; grid-template-columns: max-content 1fr; gap: .35rem 1.5rem; margin: 0; }
.shortcut-sheet dt { font-family: var(--mono); font-size: 12.5px; color: var(--accent); white-space: nowrap; }
.shortcut-sheet dd { margin: 0; color: var(--fg-muted); font-size: 13px; }
.shortcut-sheet p { margin: 1rem 0 0; font-size: 12px; }

/* ══ windows ════════════════════════════════════════════════════════════ */

/* Windows are fully opaque: a translucent window over another window's text is
   unreadable, and no amount of blur fixes it. Depth comes from the shadow. */
.win {
  position: absolute;
  display: flex;
  flex-direction: column;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--s1);
  box-shadow: var(--shadow);
  overflow: hidden;
  animation: win-in .16s var(--ease);
}
@keyframes win-in { from { opacity: 0; transform: scale(.97) } to { opacity: 1; transform: none } }

.win.hidden { display: none; }
.win.closing { opacity: 0; transform: scale(.97); transition: all .1s ease; }
.win.maximized { border-radius: 0; }
.win.focused { border-color: var(--line-strong); box-shadow: var(--shadow-lg); }

.win-titlebar {
  display: flex;
  align-items: center;
  gap: .55rem;
  height: 34px;
  flex: 0 0 auto;
  padding: 0 .35rem 0 .7rem;
  background: linear-gradient(var(--s2), var(--s1));
  border-bottom: 1px solid var(--line);
  cursor: grab;
  user-select: none;
}
.win-titlebar:active { cursor: grabbing; }
.win.tiling .win-titlebar { cursor: default; }

.win-icon { display: flex; width: 15px; height: 15px; color: var(--fg-faint); }
.win-icon svg { width: 100%; height: 100%; }
.win.focused .win-icon { color: var(--accent); }

.win-title { flex: 1; min-width: 0; font-size: 12.5px; color: var(--fg-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.win.focused .win-title { color: var(--fg); }

.win-controls { display: flex; gap: 1px; }
.win-btn {
  width: 26px; height: 24px;
  display: grid; place-items: center;
  border: 0; border-radius: 4px;
  background: none;
  color: var(--fg-faint);
}
.win-btn svg { width: 14px; height: 14px; }
.win-btn:hover { background: var(--s3); color: var(--fg); }
.win-btn.danger:hover { background: #c0392b; color: #fff; }

.win-body { flex: 1 1 auto; overflow: auto; outline: none; overscroll-behavior: contain; background: var(--s1); }

/* Eight resize handles, invisible but grabbable. */
.win-edge, .win-corner { position: absolute; }
.e-n { top: -3px; left: 8px; right: 8px; height: 7px; cursor: ns-resize; }
.e-s { bottom: -3px; left: 8px; right: 8px; height: 7px; cursor: ns-resize; }
.e-w { left: -3px; top: 8px; bottom: 8px; width: 7px; cursor: ew-resize; }
.e-e { right: -3px; top: 8px; bottom: 8px; width: 7px; cursor: ew-resize; }
.c-nw { top: -3px; left: -3px; width: 12px; height: 12px; cursor: nwse-resize; }
.c-ne { top: -3px; right: -3px; width: 12px; height: 12px; cursor: nesw-resize; }
.c-sw { bottom: -3px; left: -3px; width: 12px; height: 12px; cursor: nesw-resize; }
.c-se { bottom: -3px; right: -3px; width: 12px; height: 12px; cursor: nwse-resize; }
.win.tiling .win-edge, .win.tiling .win-corner, .win.maximized .win-edge, .win.maximized .win-corner { display: none; }

/* ── desktop cube ───────────────────────────────────────────────────────── */

.cube-stage {
  position: absolute;
  inset: 0;
  z-index: 250;
  overflow: hidden;
  background: var(--s0);
  perspective: 1500px;
  pointer-events: none;          /* purely decorative; input waits it out */
}

/* Both the cube and its faces turn about an axis half a screen behind the
   glass, which is what makes the faces meet at a real 90° corner. */
.cube {
  position: absolute;
  inset: 0;
  transform-style: preserve-3d;
  transform-origin: 50% 50% calc(var(--half) * -1);
}

.cube-face {
  position: absolute;
  inset: 0;
  overflow: hidden;
  backface-visibility: hidden;
  transform-origin: 50% 50% calc(var(--half) * -1);
  background: var(--s0);
}

/* Faces turning away darken, so the corner reads as an edge and not a seam. */
.cube-shade {
  position: absolute;
  inset: 0;
  z-index: 99;
  background: #000;
  opacity: 0;
}

.snap-preview {
  position: absolute;
  z-index: 5;
  border: 2px solid var(--accent);
  background: var(--glow);
  border-radius: var(--radius);
  pointer-events: none;
  transition: all .1s var(--ease);
}

.switcher {
  position: fixed;
  z-index: 500;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  display: grid;
  gap: 2px;
  padding: 8px;
  border-radius: 10px;
  border: 1px solid var(--line-strong);
  background: color-mix(in srgb, var(--s1) 96%, transparent);
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(16px);
  min-width: 260px;
}
.switcher-item {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .45rem .7rem;
  border-radius: 5px;
  color: var(--fg-muted);
  font-size: 13px;
}
.switcher-item .i { width: 16px; height: 16px; }
.switcher-item.on { background: var(--accent); color: #000; font-weight: 600; }

/* ══ app chrome ═════════════════════════════════════════════════════════ */

.toolbar {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .45rem .7rem;
  background: var(--s2);
  border-bottom: 1px solid var(--line);
  font-size: 12.5px;
}
.toolbar .path { display: inline-flex; align-items: center; gap: .45rem; font-family: var(--mono); color: var(--fg-muted); }
.toolbar .path svg { width: 15px; height: 15px; color: var(--accent); }

.btn {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  padding: .45rem .85rem;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--s2);
  color: var(--fg);
  text-decoration: none;
  font-size: 13px;
  transition: background .12s ease, border-color .12s ease;
}
.btn:hover { background: var(--s3); border-color: var(--fg-faint); }
.btn.sm { padding: .28rem .6rem; font-size: 12px; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #000; font-weight: 600; }
.btn.primary:hover { filter: brightness(1.08); }
.btn-row { display: flex; flex-wrap: wrap; gap: .5rem; margin: .75rem 0; }

/* ── document view ──────────────────────────────────────────────────────── */

.doc { padding: 1.25rem 1.5rem 2rem; max-width: 74ch; }
.doc h1 { margin: 0 0 .35rem; font-size: 1.5rem; letter-spacing: -.02em; }
.doc h2 {
  margin: 1.75rem 0 .6rem;
  font-size: .75rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--accent);
}
.doc h3 { margin: 1rem 0 .35rem; font-size: .9375rem; }
.doc p { margin: 0 0 .9rem; color: #c8cecb; }
.doc .lead { font-size: 1rem; color: var(--fg); }
.doc .meta { font-family: var(--mono); font-size: 12px; color: var(--fg-muted); }
.doc ul { margin: .35rem 0 .9rem; padding-left: 1.1rem; color: var(--fg-muted); }
.doc li { margin-bottom: .2rem; }
.doc pre {
  font-family: var(--mono);
  font-size: 12.5px;
  background: var(--s0);
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: .9rem;
  overflow-x: auto;
}

.doc-hero { display: flex; align-items: center; gap: 1.25rem; margin-bottom: 1.5rem; }
.doc-avatar {
  width: 84px; height: 84px;
  flex: 0 0 auto;
  border-radius: 8px;
  overflow: hidden;
  display: grid; place-items: center;
  background: var(--s2);
  border: 1px solid var(--line-strong);
  color: var(--fg-faint);
}
.doc-avatar svg { width: 40px; height: 40px; }
.doc-avatar img { width: 100%; height: 100%; object-fit: cover; }

.kv { display: grid; grid-template-columns: max-content 1fr; gap: .25rem 1.5rem; margin: 0 0 .9rem; font-size: 13px; }
.kv dt { color: var(--fg-faint); }
.kv dd { margin: 0; }

.chips { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: .9rem; }
.chip {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--fg-muted);
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: .1rem .45rem;
}

.entry { padding: .7rem 0; border-bottom: 1px solid var(--line); }
.entry:last-of-type { border-bottom: 0; }
.entry-head { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }

.copyable { position: relative; padding-right: 5rem; }
.copyable .btn { position: absolute; top: 0; right: 0; }

/* Availability badge, shared by About / Services / Contact. */
.doc .badge {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  margin: .5rem 0 1rem;
  padding: .35rem .8rem;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  color: var(--accent);
  font-size: 12.5px;
}
.pulse {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 70%, transparent);
  animation: pulse-ring 2.4s ease-out infinite;
}
@keyframes pulse-ring {
  70% { box-shadow: 0 0 0 8px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}

/* ── contact gate ───────────────────────────────────────────────────────── */

.gate {
  display: grid;
  gap: .6rem;
  margin: .5rem 0 1rem;
  padding: .9rem 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--s0);
}
.gate-trigger {
  justify-self: start;
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .5rem .9rem;
  border: 0;
  border-radius: 5px;
  background: var(--accent);
  color: #000;
  font-weight: 600;
  font-size: 13px;
}
.gate-trigger:hover { filter: brightness(1.08); }
.gate-note { margin: 0 !important; font-size: 12px; color: var(--fg-faint) !important; }
.gate-row { display: flex; align-items: center; gap: .5rem; }
.gate-row canvas { border: 1px solid var(--line); border-radius: 4px; display: block; }
.gate-refresh, .gate-submit {
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--s2);
  color: var(--fg);
  padding: .45rem .8rem;
  font-size: 13px;
}
.gate-refresh { width: 34px; padding: .45rem 0; }
.gate-refresh:hover, .gate-submit:hover { border-color: var(--accent); color: var(--accent); }
.gate-row input {
  flex: 1;
  min-width: 0;
  background: var(--s0);
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: .45rem .6rem;
  font-family: var(--mono);
  letter-spacing: .18em;
  text-transform: uppercase;
  outline: none;
}
.gate-row input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--glow); }
.gate-error { margin: 0 !important; font-size: 12px; color: #f87171 !important; }

.gate.revealed { gap: 1px; padding: 0; background: var(--line); overflow: hidden; }
.gate-item {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: .6rem .9rem;
  background: var(--s1);
  text-decoration: none;
  font-family: var(--mono);
  font-size: 12.5px;
}
.gate-item:hover { background: var(--s2); }
.gate-label { color: var(--fg-faint); }
.gate-value { color: var(--accent); overflow-wrap: anywhere; text-align: right; }

.btn[disabled] { opacity: .45; cursor: not-allowed; }
.btn[disabled]:hover { background: var(--s2); border-color: var(--line); filter: none; }

/* ── services app ───────────────────────────────────────────────────────── */

.svc {
  padding: 1rem 0;
  border-bottom: 1px solid var(--line);
}
.svc:last-of-type { border-bottom: 0; }
.svc-head { display: flex; align-items: baseline; gap: .7rem; }
.svc-num {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--fg-faint);
}
.svc-head h3 { margin: 0; font-size: 1rem; }
.svc-summary { margin: .3rem 0 .6rem !important; color: var(--accent) !important; }

/* ── references app ─────────────────────────────────────────────────────── */

.ref {
  margin: 0 0 1.25rem;
  padding: 1rem 1.1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--s0);
}
.ref blockquote {
  margin: 0 0 .8rem;
  padding-left: .9rem;
  border-left: 2px solid var(--line-strong);
  color: #c8cecb;
}
.ref figcaption strong { display: block; font-size: 13px; }
.ref figcaption .muted { font-size: 12px; }
.ref details { margin-top: .7rem; }
.ref summary {
  cursor: pointer;
  font-size: 11px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--fg-faint);
}
.ref summary:hover { color: var(--accent); }
.ref details p {
  margin: .6rem 0 0;
  font-size: 12.5px;
  font-style: italic;
  color: var(--fg-faint);
}

.empty-app { display: grid; place-content: center; justify-items: center; gap: .5rem; height: 100%; padding: 2rem; text-align: center; color: var(--fg-muted); }
.empty-app .i.big { color: var(--fg-faint); width: 2.6em; height: 2.6em; }
.empty-app h3 { margin: 0; color: var(--fg); font-size: 1rem; }
.empty-app p { margin: 0; max-width: 44ch; font-size: 13px; }

/* ── icon grid / file listing ───────────────────────────────────────────── */

.icon-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(104px, 1fr));
  gap: 4px;
  padding: .75rem;
  align-content: start;
}
.icon-tile {
  display: grid;
  justify-items: center;
  align-content: start;
  gap: 5px;
  padding: .85rem .4rem;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: none;
  color: var(--fg);
  text-align: center;
}
.icon-tile .i.big { color: var(--accent); }
.icon-tile .label { font-size: 12.5px; overflow-wrap: anywhere; }
.icon-tile .sub { font-size: 10.5px; color: var(--fg-faint); font-family: var(--mono); }
.icon-tile:hover { background: var(--s2); }
.icon-tile.sel { background: color-mix(in srgb, var(--accent) 16%, transparent); border-color: var(--line-strong); }

.list-rows { display: grid; gap: 1px; }
.row {
  display: flex;
  align-items: center;
  gap: .75rem;
  width: 100%;
  padding: .6rem .75rem;
  border: 0; border-radius: 5px;
  background: none;
  color: var(--fg);
  text-align: left;
  text-decoration: none;
}
.row:hover { background: var(--s2); }
.row .i { color: var(--accent); }
.row-main { flex: 1; min-width: 0; }
.row-main strong { display: block; font-size: 13px; font-weight: 500; }
.row-main .muted { display: block; font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── paint ──────────────────────────────────────────────────────────────── */

.paint { display: grid; gap: .75rem; padding: .75rem; justify-items: center; }

.paint-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .75rem;
  width: 100%;
}
.paint-tools .swatches { margin: 0; gap: .3rem; }

.paint-swatch {
  padding: 3px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--s2);
  line-height: 0;
}
.paint-swatch .dot { width: 18px; height: 18px; border: 2px solid var(--s0); }
.paint-swatch.on { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }

.paint-sizes { display: flex; gap: .3rem; }
.size-btn {
  width: 28px; height: 28px;
  display: grid; place-items: center;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--s2);
}
.size-btn span { display: block; border-radius: 50%; background: var(--fg-muted); }
.size-btn.on { border-color: var(--accent); }
.size-btn.on span { background: var(--accent); }

.paint canvas {
  width: 100%;
  max-width: 720px;
  aspect-ratio: 720 / 430;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: #0b0d0c;
  cursor: crosshair;
  touch-action: none;          /* let the pointer draw instead of scrolling */
}

.paint-saved { width: 100%; }
.paint-saved h3 { margin: .25rem 0 .5rem; font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--accent); }
.paint-saved p { margin: .6rem 0 0; font-size: 11.5px; }

.thumb-strip { display: flex; gap: .5rem; overflow-x: auto; padding-bottom: .35rem; }
.saved-shot { margin: 0; flex: 0 0 auto; width: 116px; }
.saved-shot img {
  width: 116px; height: 70px;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #0b0d0c;
  cursor: pointer;
  display: block;
}
.saved-shot img:hover { border-color: var(--accent); }
.saved-shot figcaption {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .25rem;
  font-size: 10.5px;
  color: var(--fg-muted);
  margin-top: 2px;
}
.saved-shot figcaption span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.link-btn {
  border: 0;
  background: none;
  color: var(--fg-faint);
  padding: 0;
  line-height: 0;
}
.link-btn svg { width: 13px; height: 13px; }
.link-btn:hover { color: #f87171; }

/* ── recycle bin ────────────────────────────────────────────────────────── */

.bin-row { cursor: pointer; }
.bin-row .i { color: var(--fg-faint); }
.bin-row:hover .i { color: var(--accent); }

/* ── reviews ────────────────────────────────────────────────────────────── */

.review-form { max-width: none; }
.review-row { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; }
@media (max-width: 560px) { .review-row { grid-template-columns: 1fr; } }

.review-form select {
  background: var(--s0);
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: .5rem .65rem;
  outline: none;
}
.review-form select:focus { border-color: var(--accent); }

.review-entry { background: color-mix(in srgb, var(--accent) 5%, var(--s0)); }
.review-head { display: flex; justify-content: space-between; align-items: center; }
.review-stars { color: var(--accent); letter-spacing: .1em; font-size: 13px; }
.review-entry .btn-row { margin: .6rem 0 0; }

/* ── gallery ────────────────────────────────────────────────────────────── */

.thumb-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 6px;
  padding: .75rem;
}
.thumb {
  position: relative;
  aspect-ratio: 4 / 3;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 5px;
  overflow: hidden;
  background: var(--s0);
}
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .25s var(--ease); }
.thumb:hover img { transform: scale(1.04); }
.thumb-cap {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: .35rem .5rem;
  font-size: 11.5px;
  text-align: left;
  background: linear-gradient(transparent, rgba(0, 0, 0, .85));
  color: #fff;
}

.lightbox {
  position: absolute;
  inset: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: auto 1fr auto;
  place-items: center;
  gap: .5rem;
  padding: 1rem;
  background: rgba(0, 0, 0, .88);
  backdrop-filter: blur(6px);
}
.lightbox figure { margin: 0; display: grid; gap: .5rem; justify-items: center; max-height: 100%; min-width: 0; }
.lightbox img { max-width: 100%; max-height: calc(100% - 2.5rem); object-fit: contain; border-radius: 4px; }
.lightbox figcaption { font-size: 12.5px; color: var(--fg-muted); text-align: center; }
.lb-nav, .lb-close {
  display: grid; place-items: center;
  width: 38px; height: 38px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--s1);
  color: var(--fg);
}
.lb-nav:hover, .lb-close:hover { background: var(--accent); color: #000; }
.lb-close { position: absolute; top: .75rem; right: .75rem; }

/* ── settings widgets ───────────────────────────────────────────────────── */

.swatches { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1rem; }
.swatch {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .35rem .7rem .35rem .4rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--s2);
  color: var(--fg-muted);
  font-size: 12.5px;
}
.swatch .dot {
  width: 20px; height: 20px;
  border-radius: 50%;
  background: var(--sw-accent, var(--accent));
  border: 2px solid var(--sw-bg, var(--s0));
  box-shadow: 0 0 0 1px var(--line);
}
.swatch:hover { color: var(--fg); }
.swatch.on { border-color: var(--accent); color: var(--fg); box-shadow: 0 0 0 1px var(--accent) inset; }

.switch { display: inline-flex; align-items: center; gap: .6rem; margin-bottom: 1rem; font-size: 13px; }
.switch input { width: 16px; height: 16px; accent-color: var(--accent); }

.form { display: grid; gap: .75rem; max-width: 46ch; }
.form label { display: grid; gap: .3rem; font-size: 12.5px; color: var(--fg-muted); }
.form input, .form textarea {
  background: var(--s0);
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: .5rem .65rem;
  outline: none;
  resize: vertical;
}
.form input:focus, .form textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--glow); }

/* ── system info ────────────────────────────────────────────────────────── */

.neofetch { display: flex; gap: 1.5rem; padding: 1.25rem 1.5rem; flex-wrap: wrap; }
.neofetch .ascii {
  margin: 0;
  font-family: var(--mono);
  font-size: 9px;
  line-height: 1.15;
  color: var(--accent);
  white-space: pre;
}
.nf-head { font-family: var(--mono); font-size: 13px; }
.nf-head strong { color: var(--accent); }
.nf-rule { height: 1px; background: var(--line); margin: .35rem 0 .6rem; }
.neofetch .kv { font-family: var(--mono); font-size: 12px; }

/* ══ terminal ═══════════════════════════════════════════════════════════ */

.win.is-term .win-body { background: color-mix(in srgb, #000 55%, var(--s0)); }
.term { display: flex; flex-direction: column; min-height: 100%; padding: 8px 10px; font-family: var(--mono); font-size: 12.5px; }
.term-out { white-space: pre-wrap; word-break: break-word; }
.term-line { min-height: 1.5em; }
.term-line .prompt, .term-input-row .prompt { color: var(--accent); }
.term-line .cmd { color: var(--fg); }
.term-line .key { color: var(--accent); }
.term-line.err { color: #f87171; }
.term-line.warn { color: #fbbf24; }
.term-line.muted { color: var(--fg-faint); }
.term-line a { color: var(--accent); }

.term-input-row { display: flex; align-items: baseline; gap: .5ch; }
.term-input { flex: 1; min-width: 0; background: none; border: 0; outline: none; padding: 0; caret-color: var(--accent); }

.ascii { white-space: pre; color: var(--accent); font-size: 11px; line-height: 1.2; overflow-x: auto; }

/* ══ i3 session ═════════════════════════════════════════════════════════ */

body[data-shell="tiling"] .i3-desk { position: absolute; inset: 26px 0 0 0; }
body[data-shell="tiling"] .win-layer { position: absolute; inset: 0; z-index: 10; }
body[data-shell="tiling"] .win { border-radius: 3px; }
body[data-shell="tiling"] .win-titlebar { height: 26px; background: var(--s2); }

.i3-bar {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 26px;
  z-index: 300;
  display: flex;
  align-items: stretch;
  background: var(--s1);
  border-bottom: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 12px;
  user-select: none;
}
.i3-ws { display: flex; }
.i3-ws .ws {
  min-width: 26px;
  padding: 0 8px;
  border: 0;
  background: none;
  color: var(--fg-faint);
}
.i3-ws .ws.used { color: var(--fg-muted); }
.i3-ws .ws.on { background: var(--accent); color: #000; font-weight: 700; }
.i3-ws .ws:hover:not(.on) { background: var(--s3); color: var(--fg); }

.i3-title { flex: 1; display: flex; align-items: center; padding: 0 12px; color: var(--fg-muted); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.i3-status { display: flex; }
.i3-status .chunk { display: flex; align-items: center; padding: 0 10px; border-left: 1px solid var(--line); color: var(--fg-muted); }
.i3-status .chunk.accent { color: var(--accent); }

.i3-empty {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: grid;
  place-content: center;
  text-align: center;
  color: var(--fg-faint);
  font-family: var(--mono);
  font-size: 12.5px;
  pointer-events: none;
}
.i3-empty p { margin: .2rem 0; }
.i3-empty kbd { color: var(--accent); }

.i3-run {
  position: absolute;
  top: 26px; left: 0; right: 0;
  z-index: 320;
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .4rem .75rem;
  background: var(--s2);
  border-bottom: 1px solid var(--accent);
  font-family: var(--mono);
  font-size: 12.5px;
}
.i3-run .prompt { color: var(--accent); }
.i3-run input { flex: 0 0 240px; background: none; border: 0; outline: none; }
.i3-run .hits { color: var(--fg-faint); overflow: hidden; white-space: nowrap; }

.win.i3-full { z-index: 40 !important; }

/* ══ console session ════════════════════════════════════════════════════ */

body[data-shell="console"] { background: #000; }
.tty { position: absolute; inset: 0; display: flex; flex-direction: column; background: #000; }
.tty-head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: .3rem .75rem;
  border-bottom: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--fg-faint);
  flex-wrap: wrap;
}
.tty-head b { color: var(--accent); font-weight: 500; }
.tty-layer { position: relative; flex: 1; }
.win.tty-win {
  position: absolute !important;
  inset: 0 !important;
  width: auto !important;
  height: auto !important;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  background: #000;
  animation: none;
}
.win.tty-win .win-titlebar { display: none; }
.win.tty-win .win-body { background: #000; }

/* ══ compact / touch ════════════════════════════════════════════════════ */

@media (max-width: 820px), (pointer: coarse) and (max-width: 1024px) {
  :root { --panel-h: 52px; }

  .desk-icons {
    grid-auto-flow: row;
    grid-template-rows: none;
    grid-template-columns: repeat(auto-fill, minmax(78px, 1fr));
    grid-auto-rows: 84px;
    inset: 8px;
  }

  /* The cube is skipped entirely on small screens — see isCompact() in cube.js. */

  /* Both parents (.desk-stage, .i3-desk) already exclude their shell chrome,
     so the layer fills them completely. */
  body[data-shell="desktop"] .win-layer,
  body[data-shell="tiling"] .win-layer {
    inset: 0;
    overflow-y: auto;
    padding: 8px;
    display: grid;
    gap: 8px;
    align-content: start;
    z-index: 200;                     /* above the desktop icons when open */
  }
  .win {
    position: relative !important;
    inset: auto !important;
    width: auto !important;
    height: auto !important;
    max-height: 78vh;
    animation: none;
    pointer-events: auto;
  }
  .win-edge, .win-corner, .snap-preview { display: none !important; }

  .panel-tasks { display: none; }
  .panel-launcher .lbl { display: none; }
  .launcher { left: 4px; right: 4px; width: auto; }
  .launcher-body { grid-template-columns: 1fr; }
  .launcher-cats { flex-direction: row; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--line); }
  .cat { white-space: nowrap; }

  .doc { padding: 1rem 1.1rem 1.75rem; }
  .doc-hero { flex-direction: column; align-items: flex-start; gap: .75rem; }
  .copyable { padding-right: 0; }
  .copyable .btn { position: static; margin-bottom: .5rem; }
  .neofetch .ascii { display: none; }
  .lightbox { grid-template-columns: 1fr; }
  .lb-nav { position: absolute; top: 50%; transform: translateY(-50%); }
  .lb-nav.prev { left: .5rem; }
  .lb-nav.next { right: .5rem; }

  .dm-clock .t { font-size: 2.6rem; }
  .dm-card { padding: 1.5rem 1.25rem; }
  .dm-foot { display: none; }
}
