/* emacs.se — Omarchy-inspired. Colours are set at runtime from Omarchy palettes (themes.js); defaults below are retro-82. */
:root {
  --bg: #05182e; --bg-dark: #031222; --bg-light: #0a2540;
  --fg: #f6dcac; --fg-dim: #3f8f8a; --fg-bright: #f6dcac;
  --accent: #faa968; --sel: #134e5a; --muted: #2a6b78;
  --red: #f85525; --yellow: #e97b3c; --green: #028391; --cyan: #8cbfb8;
  --blue: #3f8f8a; --magenta: #3f8f8a; --orange: #faa968;

  --gap-in: 5px; --gap-out: 10px; --border: 2px;
  --bar-h: 30px;
  --mono: "JetBrainsMono Nerd Font", "JetBrains Mono", ui-monospace, monospace;
  --ease: cubic-bezier(.05, .9, .1, 1.05);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100dvh;
  background: var(--bg-dark); color: var(--fg);
  font: 400 14px/1.6 var(--mono);
  font-feature-settings: "calt" 1, "liga" 1;
  overflow-x: hidden;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
::selection { background: var(--sel); color: var(--fg-bright); }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; padding: 0; }
:focus-visible { outline: 1px solid var(--accent); outline-offset: 2px; }
b, strong { color: var(--fg-bright); font-weight: 600; }

/* ── wallpaper ─────────────────────────────────────────── */
#wall {
  position: fixed; inset: 0; z-index: -1;
  background:
    radial-gradient(1200px 700px at 85% 110%, color-mix(in srgb, var(--accent) 22%, transparent), transparent 60%),
    radial-gradient(900px 600px at 0% -10%, color-mix(in srgb, var(--magenta) 16%, transparent), transparent 60%),
    linear-gradient(160deg, var(--bg-dark), color-mix(in srgb, var(--bg-dark) 70%, black));
  transition: background .4s;
}
#wall::after { /* faint dot grid */
  content: ""; position: absolute; inset: 0;
  background-image: radial-gradient(color-mix(in srgb, var(--fg) 9%, transparent) 1px, transparent 1px);
  background-size: 22px 22px;
  mask-image: linear-gradient(to bottom, black, transparent 85%);
}
[data-mode="light"] #wall {
  background:
    radial-gradient(1200px 700px at 85% 110%, color-mix(in srgb, var(--accent) 18%, transparent), transparent 60%),
    radial-gradient(900px 600px at 0% -10%, color-mix(in srgb, var(--magenta) 12%, transparent), transparent 60%),
    var(--bg-dark);
}

/* ── waybar ────────────────────────────────────────────── */
#bar {
  position: sticky; top: 0; z-index: 20;
  height: var(--bar-h);
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  padding: 0 12px;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  font-size: 12px; color: var(--fg);
}
.bar-l, .bar-r { display: flex; align-items: center; gap: 14px; }
.bar-r { justify-content: flex-end; }
.logo { font-weight: 800; font-size: 15px; color: var(--accent); width: 18px; }
#workspaces { display: flex; gap: 2px; }
#workspaces a {
  display: inline-flex; align-items: center; gap: 6px;
  height: var(--bar-h); padding: 0 7px;
  color: var(--fg-dim); text-decoration: none; position: relative;
}
#workspaces a:hover { color: var(--fg-bright); }
#workspaces a .lbl { display: none; }
#workspaces a.on { color: var(--fg-bright); }
#workspaces a.on .num { color: var(--accent); font-weight: 700; }
#workspaces a.on .lbl { display: inline; }
#workspaces a.on::after {
  content: ""; position: absolute; left: 7px; right: 7px; bottom: 4px; height: 2px; background: var(--accent);
}
#clock { color: var(--fg-bright); letter-spacing: .02em; }
#theme-btn { display: inline-flex; align-items: center; gap: 7px; }
#theme-btn .dot { width: 9px; height: 9px; background: var(--accent); box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 30%, transparent); }
#theme-btn:hover, #lang-btn:hover, .mx:hover { color: var(--fg-bright); }
.mx { padding: 1px 6px; border: 1px solid var(--muted); color: var(--fg-dim); }

/* ── runstreak (port of the richard.runstreak bar widget) ── */
.bar-c { display: flex; align-items: center; gap: 16px; }
#streak { display: inline-flex; align-items: center; gap: 6px; height: var(--bar-h); padding: 0 6px; color: var(--fg-bright); font-variant-numeric: tabular-nums; }
#streak:hover, #streak[aria-expanded="true"] { color: var(--accent); }
#xv-btn { display: inline-flex; align-items: center; height: var(--bar-h); padding: 0 6px; color: var(--fg-bright); }
#xv-btn:hover, #xv-btn[aria-expanded="true"] { color: var(--accent); }
#xv-btn .xv-ico { width: 15px; height: 15px; }
.run-ico { width: 14px; height: 14px; flex-shrink: 0; }
#streak-panel {
  position: fixed; top: calc(var(--bar-h) + 6px); z-index: 45;
  width: min(400px, calc(100vw - 16px)); padding: 20px 22px;
  background: var(--bg); border: var(--border) solid var(--accent); color: var(--fg-bright);
  box-shadow: 0 30px 80px -20px rgba(0,0,0,.55);
  display: grid; gap: 16px; animation: popin .22s var(--ease);
  font-variant-numeric: tabular-nums;
}
#streak-panel[hidden] { display: none; }
.rs-hero { display: flex; align-items: center; gap: 14px; }
.rs-hero .run-ico { width: 46px; height: 46px; color: var(--accent); }
.rs-big { font-size: 40px; font-weight: 700; line-height: 1; letter-spacing: -.02em; }
.rs-cap { font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--fg-dim); }
.rs-sub { font-size: 12px; color: var(--fg-dim); }
.rs-sep { height: 1px; background: color-mix(in srgb, var(--fg) 18%, transparent); }
.rs-tiles { display: grid; grid-template-columns: repeat(3, 1fr); }
.rs-tiles b { display: block; font-size: 18px; font-weight: 600; }
.rs-row { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; }
.rs-row .dim { white-space: nowrap; }
.rs-meter { height: 6px; background: color-mix(in srgb, var(--fg) 12%, transparent); }
.rs-meter i { display: block; height: 100%; min-width: 6px; background: var(--accent); transition: width .3s var(--ease); }
.rs-ladder { display: grid; grid-template-columns: 16px 1fr auto auto; gap: 4px 10px; font-size: 12.5px; }
.rs-ladder .done { color: var(--fg-bright); } .rs-ladder .todo { color: var(--fg-dim); }
.rs-ladder .ok { color: var(--green); }
.rs-block { display: grid; gap: 6px; }

/* ── tiling desktop ────────────────────────────────────── */
#desktop {
  padding: var(--gap-out);
  min-height: calc(100dvh - var(--bar-h));
  display: grid; gap: calc(var(--gap-in) * 2);
  align-content: start;
}
#desktop.enter-r { animation: slide-r .38s var(--ease); }
#desktop.enter-l { animation: slide-l .38s var(--ease); }
@keyframes slide-r { from { transform: translateX(6%); opacity: 0; } }
@keyframes slide-l { from { transform: translateX(-6%); opacity: 0; } }

.win {
  position: relative; min-width: 0;
  display: flex; flex-direction: column;
  background: color-mix(in srgb, var(--bg) 94%, transparent);
  border: var(--border) solid color-mix(in srgb, var(--muted) 80%, transparent);
  transition: border-color .15s;
  animation: popin .32s var(--ease) both;
  animation-delay: var(--d, 0ms);
}
.win:hover, .win:focus-within, .win.focus { border-color: var(--accent); }
@keyframes popin { from { transform: scale(.94); opacity: 0; } }

.win-body { padding: 18px 20px; flex: 1; min-width: 0; }
.win-body.flush { padding: 0; }

/* emacs mode-line */
.ml {
  display: flex; gap: 14px; align-items: center; white-space: nowrap; overflow: hidden;
  height: 24px; padding: 0 10px 0 0;
  background: var(--bg-light); color: var(--fg-dim); font-size: 11.5px;
}
.ml .st { background: var(--muted); color: var(--fg-bright); padding: 0 10px; height: 100%; display: inline-flex; align-items: center; transition: background .15s, color .15s; }
.win:hover .ml .st, .win:focus-within .ml .st, .win.focus .ml .st { background: var(--accent); color: var(--bg); }
.ml .buf { color: var(--fg-bright); font-weight: 600; }
.ml .sp { flex: 1; }
.ml .mode { color: var(--fg); }

/* small bits */
kbd {
  display: inline-block; font: 600 12px/1 var(--mono);
  padding: 4px 6px 3px; min-width: 22px; text-align: center;
  color: var(--fg-bright); background: var(--bg-light);
  border: 1px solid var(--muted); border-bottom-width: 2px;
  font-variant-ligatures: none;
}
.keys { display: inline-flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.keys code { color: var(--magenta); font-size: 12.5px; }
.dim { color: var(--fg-dim); }
.acc { color: var(--accent); }
.h { font-size: 11px; text-transform: uppercase; letter-spacing: .14em; color: var(--fg-dim); margin: 0 0 12px; font-weight: 600; }
.h::before { content: "# "; color: var(--accent); }
mark { background: color-mix(in srgb, var(--yellow) 35%, transparent); color: var(--fg-bright); }

.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 7px 12px; border: 1px solid var(--muted); color: var(--fg-bright);
  background: color-mix(in srgb, var(--bg-light) 60%, transparent);
  text-decoration: none !important; transition: border-color .15s, background .15s;
}
.btn:hover { border-color: var(--accent); background: var(--sel); }
.btn .k { color: var(--fg-dim); font-size: 11px; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--bg); font-weight: 600; }
.btn.primary .k { color: color-mix(in srgb, var(--bg) 70%, transparent); }
.btn.primary:hover { filter: brightness(1.08); }

/* ── workspace: hem ────────────────────────────────────── */
.ws-hem { grid-template-columns: 1.15fr 1fr 1fr; grid-template-areas: "hero hero fetch" "tip scratch fetch"; }
.ws-hem .hero { grid-area: hero; } .ws-hem .fetch { grid-area: fetch; }
.ws-hem .tip { grid-area: tip; } .ws-hem .scratch { grid-area: scratch; }

.hero .win-body { padding: clamp(22px, 4vw, 48px); display: flex; flex-direction: column; justify-content: center; gap: 22px; min-height: 340px; }
.prompt { color: var(--fg-dim); font-size: 13px; }
.prompt .p { color: var(--green); } .prompt .c { color: var(--fg-bright); }
.title {
  margin: 0; font-weight: 800; letter-spacing: -.045em; line-height: .92;
  font-size: clamp(54px, 9vw, 128px); color: var(--fg-bright);
}
.title .tld { color: var(--accent); }
.cursor { display: inline-block; width: .5em; height: .82em; background: var(--accent); margin-left: .06em; vertical-align: -.02em; animation: blink 1.1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.lead { margin: 0; max-width: 58ch; font-size: 15px; color: var(--fg); }
.lead .who { color: var(--fg-bright); font-weight: 600; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; }

.ff { display: flex; flex-direction: column; gap: 20px; height: 100%; }
.ff-logo { color: var(--accent); font-size: 84px; line-height: 1; font-weight: 800; width: 1.25em; height: 1.25em; display: grid; place-items: center; border: var(--border) solid var(--accent); background: color-mix(in srgb, var(--accent) 10%, transparent); }
.ff-user { color: var(--accent); font-weight: 700; }
.ff-user span { color: var(--fg-bright); }
.ff-rule { color: var(--fg-dim); margin: 0 0 4px; overflow: hidden; white-space: nowrap; }
.ff dl { margin: 0; display: grid; grid-template-columns: max-content 1fr; gap: 3px 14px; }
.ff dt { color: var(--accent); font-weight: 600; }
.ff dd .nw { white-space: nowrap; }
.ff dd { margin: 0; color: var(--fg); overflow-wrap: anywhere; }
.swatches { display: grid; grid-template-columns: repeat(8, 1fr); gap: 0; margin-top: auto; }
.swatches i { height: 18px; }

.tip .win-body { display: flex; flex-direction: column; gap: 14px; }
.tip-keys kbd { font-size: 20px; padding: 9px 12px 7px; }
.tip-keys code { font-size: 16px; }
.tip-desc { color: var(--fg-bright); font-size: 15px; margin: 0; min-height: 3em; }
.tip-foot { display: flex; justify-content: space-between; align-items: center; margin-top: auto; color: var(--fg-dim); font-size: 12px; }
.tip-foot button:hover { color: var(--accent); }

.scratch textarea {
  width: 100%; height: 100%; min-height: 150px; resize: none; border: 0; outline: 0;
  background: transparent; color: var(--fg-bright); font: inherit; padding: 0;
  caret-color: var(--accent);
}
.scratch .cm { color: var(--fg-dim); white-space: pre-wrap; margin: 0 0 6px; font-style: italic; }

/* ── workspace: tips ───────────────────────────────────── */
.ws-tips, .ws-vi { grid-template-columns: minmax(0, 1fr); }
.keys code { white-space: nowrap; color: var(--accent); }
.keys code.cmd { color: var(--fg-bright); background: var(--bg-light); border-left: 2px solid var(--accent); padding: 2px 7px; font-weight: 600; font-size: 12px; }
.tiptop { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: calc(var(--gap-in) * 2); }
.modegrid { display: grid; grid-template-columns: 1fr auto 1fr; gap: 8px 12px; align-items: center; }
.vmode { border: 1px solid var(--muted); padding: 10px 12px; display: grid; gap: 2px; background: color-mix(in srgb, var(--bg-light) 50%, transparent); }
.vmode b { text-transform: uppercase; letter-spacing: .1em; font-size: 12px; }
.vmode span { color: var(--fg-dim); font-size: 12px; }
.m-cmd { border-color: var(--accent); } .m-cmd b { color: var(--accent); }
.m-ins b { color: var(--green); } .m-ex b { color: var(--yellow); }
.arr { display: grid; gap: 2px; text-align: center; color: var(--fg-dim); font-size: 11.5px; white-space: nowrap; }
.arr.v { text-align: left; padding-left: 14px; }
.walker .win-body { padding: 0; }
.walker-in { display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--muted); }
.walker-in .glyph { color: var(--accent); font-weight: 800; }
.walker-in input {
  flex: 1; min-width: 0; background: none; border: 0; outline: 0; color: var(--fg-bright);
  font: 500 17px var(--mono);
}
.walker-in input::placeholder { color: var(--fg-dim); }
.walker-in .count { color: var(--fg-dim); font-size: 12px; white-space: nowrap; }
.chips { display: flex; gap: 6px; padding: 10px 18px; overflow-x: auto; scrollbar-width: none; }
.chips button { white-space: nowrap; padding: 3px 9px; color: var(--fg-dim); border: 1px solid transparent; font-size: 12px; }
.chips button:hover { color: var(--fg-bright); }
.chips button.on { color: var(--bg); background: var(--accent); }
.notation { padding: 12px 18px 14px; border-top: 1px solid color-mix(in srgb, var(--muted) 60%, transparent); color: var(--fg-dim); font-size: 12.5px; }
.notation kbd { font-size: 11px; padding: 2px 5px 1px; min-width: 0; }

.tipgrid { columns: 340px; column-gap: calc(var(--gap-in) * 2); }
.tipgrid .win { break-inside: avoid; margin-bottom: calc(var(--gap-in) * 2); }
.tipgrid .win-body { padding: 14px 16px 10px; }
.tiplist { list-style: none; margin: 0; padding: 0; }
.tiplist li { display: grid; grid-template-columns: 96px 1fr; gap: 12px; padding: 6px 0; align-items: baseline; border-top: 1px dashed color-mix(in srgb, var(--muted) 55%, transparent); }
.tiplist li:first-child { border-top: 0; }
.tiplist li.wide { grid-template-columns: 1fr; gap: 4px; }
.keys code { font-variant-ligatures: none; }
.tiplist li .d { color: var(--fg); font-size: 13px; }
.empty { padding: 30px; text-align: center; color: var(--fg-dim); }
.fineprint { color: var(--fg-dim); font-size: 12px; }
.fineprint pre { white-space: pre-wrap; margin: 10px 0 0; font: inherit; }

/* code / syntax */
.code { margin: 0; font: 13px/1.6 var(--mono); white-space: pre; overflow-x: auto; }
.code .cm { color: var(--fg-dim); font-style: italic; }
.code .st { color: var(--green); }
.code .kw { color: var(--magenta); }
.code .fn { color: var(--blue); }
.code .q  { color: var(--cyan); }
.code .nu { color: var(--orange); }
.code .pa { color: var(--fg-dim); }

/* ── workspace: projekt ────────────────────────────────── */
.ws-projekt { grid-template-columns: 1fr; max-width: 980px; width: 100%; margin: 0 auto; }
.org h1 { font-size: 22px; color: var(--fg-bright); margin: 0 0 4px; font-weight: 700; }
.org .meta { color: var(--fg-dim); font-size: 12px; margin: 0 0 22px; }
.org .meta b { color: var(--fg-dim); font-weight: 400; }
.org h2 { font-size: 16px; margin: 22px 0 6px; color: var(--blue); font-weight: 600; display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.org h2::before { content: "**"; color: var(--accent); }
.org p { margin: 0 0 0 calc(3ch + 10px); max-width: 70ch; }
.kw-TODO { color: var(--red); font-weight: 800; }
.kw-NEXT { color: var(--yellow); font-weight: 800; }
.kw-DONE { color: var(--green); font-weight: 800; }

/* ── workspace: filer ──────────────────────────────────── */
.ws-filer { grid-template-columns: minmax(280px, 1fr) 2.2fr; }
.dired { font-size: 13px; }
.dired .path { color: var(--blue); font-weight: 600; margin: 0 0 10px; }
.dired ul { list-style: none; margin: 0; padding: 0; }
.dired li a, .dired li button {
  display: grid; grid-template-columns: 11ch 6ch 1fr; gap: 10px; width: 100%; text-align: left;
  padding: 4px 8px; margin: 0 -8px; color: var(--fg); text-decoration: none;
}
.dired li a:hover, .dired li button:hover, .dired li .on { background: var(--sel); color: var(--fg-bright); }
.dired .perm { color: var(--fg-dim); } .dired .size { color: var(--yellow); text-align: right; }
.dired .name { color: var(--fg-bright); } .dired .name.dir { color: var(--blue); }
.dired .help { margin-top: 18px; color: var(--fg-dim); font-size: 12px; }
.viewer .win-body { padding: 0; max-height: calc(100dvh - var(--bar-h) - var(--gap-out) * 2 - 28px); overflow: auto; }
.viewer .code { display: grid; grid-template-columns: max-content 1fr; padding: 12px 0; overflow: visible; }
.viewer .ln { color: color-mix(in srgb, var(--fg-dim) 70%, transparent); text-align: right; padding: 0 14px 0 16px; user-select: none; border-right: 1px solid color-mix(in srgb, var(--muted) 60%, transparent); }
.viewer .src { padding: 0 18px; }

/* ── workspace: om mig ─────────────────────────────────── */
.ws-om { grid-template-columns: 1.3fr 1fr; grid-template-areas: "about faq" "about contact"; }
.ws-om .about { grid-area: about; } .ws-om .faq { grid-area: faq; } .ws-om .contact { grid-area: contact; }
.about p { max-width: 64ch; margin: 0 0 14px; font-size: 15px; }
.about .org h1 { margin-bottom: 18px; }
.faq details { border-top: 1px dashed color-mix(in srgb, var(--muted) 60%, transparent); padding: 10px 0; }
.faq details:first-of-type { border-top: 0; padding-top: 0; }
.faq summary { cursor: pointer; list-style: none; color: var(--fg-bright); font-weight: 600; display: flex; gap: 10px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::before { content: "▸"; color: var(--accent); transition: transform .15s; }
.faq details[open] summary::before { transform: rotate(90deg); }
.faq details p { margin: 8px 0 0 22px; }
.contact ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.contact li { display: grid; grid-template-columns: 9ch 1fr; gap: 10px; }
.contact li span { color: var(--fg-dim); }

/* ── workspace: länkar ─────────────────────────────────── */
.ws-lankar { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.ws-lankar .arch { grid-column: span 3; }
.links { list-style: none; margin: 0; padding: 0; }
.links li { padding: 8px 0; border-top: 1px dashed color-mix(in srgb, var(--muted) 55%, transparent); }
.links li:first-child { border-top: 0; padding-top: 0; }
.links a { font-weight: 600; }
.links a::after { content: " ↗"; color: var(--fg-dim); font-weight: 400; }
.links .d { display: block; color: var(--fg-dim); font-size: 12.5px; }
.archgrid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px 28px; }
.archgrid .h { margin-bottom: 8px; }

/* ── M-x palette (walker) ──────────────────────────────── */
#palette { position: fixed; inset: 0; z-index: 50; display: grid; place-items: start center; padding: 14vh 16px 16px; background: color-mix(in srgb, var(--bg-dark) 45%, transparent); }
#palette[hidden] { display: none; }
.pal-box { width: min(620px, 100%); background: var(--bg); border: var(--border) solid var(--accent); box-shadow: 0 30px 80px -20px rgba(0,0,0,.6); animation: popin .22s var(--ease); }
.pal-input { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--muted); }
.pal-prompt { color: var(--accent); font-weight: 700; }
#pal-q { flex: 1; min-width: 0; background: none; border: 0; outline: 0; color: var(--fg-bright); font: 500 16px var(--mono); }
#pal-list { list-style: none; margin: 0; padding: 6px; max-height: min(52vh, 440px); overflow-y: auto; }
#pal-list li { display: flex; align-items: center; gap: 12px; padding: 7px 10px; cursor: pointer; color: var(--fg); }
#pal-list li.on { background: var(--sel); color: var(--fg-bright); box-shadow: inset 2px 0 0 var(--accent); }
#pal-list .ico { width: 14px; text-align: center; color: var(--accent); }
#pal-list .sw { display: inline-flex; width: 52px; height: 12px; flex-shrink: 0; }
#pal-list .sw i { flex: 1; }
#pal-list .lab { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#pal-list .lab b { color: var(--accent); font-weight: 700; }
#pal-list .hint { color: var(--fg-dim); font-size: 11.5px; }
#pal-list .cur { color: var(--green); font-size: 11px; }

/* ── mako notification + echo area ─────────────────────── */
#notify { position: fixed; top: calc(var(--bar-h) + 10px); right: 10px; z-index: 60; display: grid; gap: 8px; width: min(360px, calc(100vw - 20px)); pointer-events: none; }
.toast { background: var(--bg); border: var(--border) solid var(--accent); padding: 10px 14px; color: var(--fg-bright); font-size: 13px; animation: toast-in .3s var(--ease); }
.toast small { display: block; color: var(--fg-dim); font-size: 11px; }
.toast.out { opacity: 0; transform: translateX(20px); transition: .25s; }
@keyframes toast-in { from { transform: translateX(40px); opacity: 0; } }
#echo { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; padding: 3px 12px; font-size: 12.5px; color: var(--fg-bright); background: var(--bg-dark); border-top: 1px solid var(--muted); transform: translateY(100%); transition: transform .2s var(--ease); }
#echo.show { transform: none; }

/* ── responsive ────────────────────────────────────────── */
@media (max-width: 1100px) {
  .ws-hem { grid-template-columns: 1fr 1fr; grid-template-areas: "hero hero" "fetch tip" "fetch scratch"; }
  .ws-lankar { grid-template-columns: 1fr 1fr; }
  .ws-lankar .arch { grid-column: span 2; }
  .archgrid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 760px) {
  :root { --gap-out: 8px; }
  body { font-size: 13.5px; }
  #bar { grid-template-columns: 1fr auto; padding: 0 8px; }
  .bar-c #clock { display: none; }
  #bar { grid-template-columns: auto 1fr auto; }
  .bar-c { justify-content: center; }
  .bar-r { gap: 10px; }
  #theme-name, .mx { display: none; }
  #workspaces a { padding: 0 6px; }
  #workspaces a.on .lbl { display: none; }
  .tiptop { grid-template-columns: minmax(0, 1fr); }
  .modegrid { grid-template-columns: 1fr; }
  .arr { text-align: left; }
  .modegrid > div:empty { display: none; }
  .ws-hem, .ws-om, .ws-filer, .ws-lankar { grid-template-columns: minmax(0, 1fr); grid-template-areas: none; }
  .ws-hem > *, .ws-om > * { grid-area: auto !important; }
  .ws-lankar .arch { grid-column: auto; }
  .archgrid { grid-template-columns: 1fr; }
  .hero .win-body { min-height: 0; }
  .win-body { padding: 16px; }
  .tiplist li { grid-template-columns: 1fr; gap: 4px; }
  .viewer .win-body { max-height: 70vh; }
  .ml .hide-sm { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* focus follows mouse: hovered window steals the border from the default-focused one */
#desktop:has(.win:hover) .win.focus:not(:hover):not(:focus-within) { border-color: color-mix(in srgb, var(--muted) 80%, transparent); }
#desktop:has(.win:hover) .win.focus:not(:hover):not(:focus-within) .ml .st { background: var(--muted); color: var(--fg-bright); }
