/* Pastidy core look. The dock, the dashboard window and the popup share this. */

:root {
  --bg: #000000;
  --fill: #1c1c1e;
  --fill-hover: #2c2c2e;
  --line: rgba(255, 255, 255, 0.1);
  --text: #f5f5f7;
  --muted: #8e8e93;
  --accent: #ff9a4a;
  --on-accent: #000000;
  --blue: #0a84ff;
  --ok: #34c759;
  --danger: #ff453a;
  --g1: transparent;
  --g2: transparent;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --focus: 0 0 0 3px rgba(10, 132, 255, 0.4);
  --ear: 16px;
  --pill-w: 168px;
  --pill-h: 32px;
  --r: 24px;
  /* one type scale for everything */
  --t-small: 11px;
  --t-body: 13px;
  --t-card: 12px;
  --t-title: 15px;
  font: 13px/1.4 -apple-system, BlinkMacSystemFont, "Segoe UI Variable", "Segoe UI", system-ui, sans-serif;
  color-scheme: dark;
}

/* ---- themes ---- */
body[data-theme="midnight"] { --bg: #000; --fill: #1c1c1e; --fill-hover: #2c2c2e; --accent: #ff9a4a; }
body[data-theme="aurora"] { --bg: #040a10; --fill: rgba(255, 255, 255, 0.08); --fill-hover: rgba(255, 255, 255, 0.15); --accent: #5ef0c3; --g1: #1fd6a0; --g2: #7b5cff; }
body[data-theme="sunset"] { --bg: #0c0507; --fill: rgba(255, 255, 255, 0.08); --fill-hover: rgba(255, 255, 255, 0.15); --accent: #ff7a59; --g1: #ff5e3a; --g2: #ff2f92; }
body[data-theme="ocean"] { --bg: #020a14; --fill: rgba(255, 255, 255, 0.08); --fill-hover: rgba(255, 255, 255, 0.15); --accent: #4cc3ff; --g1: #1678ff; --g2: #00d4ff; }
body[data-theme="forest"] { --bg: #030a05; --fill: rgba(255, 255, 255, 0.08); --fill-hover: rgba(255, 255, 255, 0.15); --accent: #7be07b; --g1: #1f9d4a; --g2: #b6e04a; }
body[data-theme="rose"] { --bg: #0b0309; --fill: rgba(255, 255, 255, 0.08); --fill-hover: rgba(255, 255, 255, 0.15); --accent: #ff6fa5; --g1: #ff3d86; --g2: #8a4dff; }
body[data-theme="mono"] { --bg: #0a0a0a; --fill: rgba(255, 255, 255, 0.08); --fill-hover: rgba(255, 255, 255, 0.15); --accent: #ffffff; --g1: #ffffff; --g2: #6b6b70; }
body[data-theme="ember"] { --bg: #0d0600; --fill: rgba(255, 255, 255, 0.08); --fill-hover: rgba(255, 255, 255, 0.15); --accent: #ff9a2a; --g1: #ff6a00; --g2: #ffb300; }
body[data-theme="grape"] { --bg: #07030f; --fill: rgba(255, 255, 255, 0.08); --fill-hover: rgba(255, 255, 255, 0.15); --accent: #b57bff; --g1: #8e2de2; --g2: #4a00e0; }
body[data-theme="mint"] { --bg: #02100c; --fill: rgba(255, 255, 255, 0.08); --fill-hover: rgba(255, 255, 255, 0.15); --accent: #4dffc4; --g1: #00f5a0; --g2: #00b8f5; }
body[data-theme="lava"] { --bg: #0d0301; --fill: rgba(255, 255, 255, 0.08); --fill-hover: rgba(255, 255, 255, 0.15); --accent: #ff6a3d; --g1: #f12711; --g2: #f5af19; }
body[data-theme="ice"] { --bg: #030b10; --fill: rgba(255, 255, 255, 0.08); --fill-hover: rgba(255, 255, 255, 0.15); --accent: #8de8ff; --g1: #74ebd5; --g2: #9face6; }
body[data-theme="cherry"] { --bg: #0d0204; --fill: rgba(255, 255, 255, 0.08); --fill-hover: rgba(255, 255, 255, 0.15); --accent: #ff5a6a; --g1: #eb3349; --g2: #f45c43; }
body[data-theme="dusk"] { --bg: #04070c; --fill: rgba(255, 255, 255, 0.08); --fill-hover: rgba(255, 255, 255, 0.15); --accent: #9db4ff; --g1: #2b5876; --g2: #7a5c9e; }
body[data-theme="gold"] { --bg: #0c0800; --fill: rgba(255, 255, 255, 0.08); --fill-hover: rgba(255, 255, 255, 0.15); --accent: #ffcf33; --g1: #f7971e; --g2: #ffd200; }
body[data-theme="neon"] { --bg: #010a04; --fill: rgba(255, 255, 255, 0.08); --fill-hover: rgba(255, 255, 255, 0.15); --accent: #39ff14; --g1: #39ff14; --g2: #00e5ff; }
body[data-theme="teal"] { --bg: #021312; --fill: rgba(255, 255, 255, 0.08); --fill-hover: rgba(255, 255, 255, 0.15); --accent: #5ff0e0; --g1: #0f9b8e; --g2: #2bd4c0; }
body[data-theme="crimson"] { --bg: #120203; --fill: rgba(255, 255, 255, 0.08); --fill-hover: rgba(255, 255, 255, 0.15); --accent: #ff6b6b; --g1: #8b0000; --g2: #e53935; }
body[data-theme="lemon"] { --bg: #0d0d02; --fill: rgba(255, 255, 255, 0.08); --fill-hover: rgba(255, 255, 255, 0.15); --accent: #f4ef6a; --g1: #d4e157; --g2: #fff59d; }
body[data-theme="sky"] { --bg: #020a14; --fill: rgba(255, 255, 255, 0.08); --fill-hover: rgba(255, 255, 255, 0.15); --accent: #6cc8ff; --g1: #56ccf2; --g2: #2f80ed; }
body[data-theme="peach"] { --bg: #140706; --fill: rgba(255, 255, 255, 0.08); --fill-hover: rgba(255, 255, 255, 0.15); --accent: #ffb199; --g1: #ffb199; --g2: #ff0844; }
body[data-theme="lilac"] { --bg: #0a0912; --fill: rgba(255, 255, 255, 0.08); --fill-hover: rgba(255, 255, 255, 0.15); --accent: #d1b3ff; --g1: #c3cfe2; --g2: #c471f5; }
body[data-theme="slate"] { --bg: #05090b; --fill: rgba(255, 255, 255, 0.08); --fill-hover: rgba(255, 255, 255, 0.15); --accent: #7fd3df; --g1: #2c3e50; --g2: #4ca1af; }
body[data-theme="coral"] { --bg: #120708; --fill: rgba(255, 255, 255, 0.08); --fill-hover: rgba(255, 255, 255, 0.15); --accent: #ff9a9e; --g1: #ff9a9e; --g2: #ff6f61; }
body[data-theme="indigo"] { --bg: #06040f; --fill: rgba(255, 255, 255, 0.08); --fill-hover: rgba(255, 255, 255, 0.15); --accent: #a58bff; --g1: #3a1c71; --g2: #d76d77; }
body[data-theme="lime"] { --bg: #040a02; --fill: rgba(255, 255, 255, 0.08); --fill-hover: rgba(255, 255, 255, 0.15); --accent: #b8ff6a; --g1: #a8e063; --g2: #56ab2f; }
body[data-theme="magenta"] { --bg: #100208; --fill: rgba(255, 255, 255, 0.08); --fill-hover: rgba(255, 255, 255, 0.15); --accent: #ff6bd6; --g1: #f953c6; --g2: #b91d73; }
body[data-theme="steel"] { --bg: #07090b; --fill: rgba(255, 255, 255, 0.08); --fill-hover: rgba(255, 255, 255, 0.15); --accent: #aab8c8; --g1: #485563; --g2: #29323c; }
body[data-theme="copper"] { --bg: #100803; --fill: rgba(255, 255, 255, 0.08); --fill-hover: rgba(255, 255, 255, 0.15); --accent: #f0b07a; --g1: #b76e79; --g2: #f0c27b; }
body[data-theme="sand"] { --bg: #0c0a05; --fill: rgba(255, 255, 255, 0.08); --fill-hover: rgba(255, 255, 255, 0.15); --accent: #e8d19a; --g1: #f7d794; --g2: #c79a5f; }

/* One slim scrollbar everywhere, tinted by the theme. It must use the ::-webkit-scrollbar rules only:
   setting scrollbar-width or scrollbar-color makes the browser ignore them and bring back the arrow buttons. */
body { --scroll: color-mix(in srgb, var(--accent) 50%, rgba(255, 255, 255, 0.12)); }
*::-webkit-scrollbar { width: 9px; height: 9px; }
*::-webkit-scrollbar-track, *::-webkit-scrollbar-corner { background: transparent; }
*::-webkit-scrollbar-thumb { background: #fff; border-radius: 9px; border: 2.5px solid transparent; background-clip: padding-box; }
*::-webkit-scrollbar-thumb:hover { background: #fff; background-clip: padding-box; }
*::-webkit-scrollbar-button { display: none; width: 0; height: 0; }

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: transparent;
  color: var(--text);
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
}

button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: default; }
button:focus-visible, .card:focus-visible { outline: none; box-shadow: var(--focus); }
.hidden { display: none !important; }
body:not(.mode-main) .only-dock { display: none; }

/* ---- the shell: a pill when closed, the dashboard when open ---- */
body { --open-w: calc(100% - var(--ear) * 2); }
body.collapsed { --r: 16px; }
/* --pill-l is the long side, --pill-s the short side. Upright on the left and right edge they swap. */
body { --pill-s: 32px; --pill-l: calc(168px + var(--add-b, 0px) + var(--add-m, 0px) + var(--add-w, 0px)); --pill-w: var(--pill-l); --pill-h: var(--pill-s); }
body.has-badge { --add-b: 46px; }
body.has-mic { --add-m: 22px; }
body.has-wave { --add-w: 26px; }
body.small { --pill-s: 22px; --pill-l: 56px; }
body.small.has-badge { --pill-l: 104px; }
body[data-anchor="left-center"], body[data-anchor="right-center"] { --pill-w: var(--pill-s); --pill-h: var(--pill-l); }

.shell {
  position: absolute;
  background: var(--bg);
  width: var(--open-w);
  height: 100%;
  transition: width 0.28s var(--ease), height 0.28s var(--ease), border-radius 0.28s var(--ease);
}
body.collapsed .shell { width: var(--pill-w); height: var(--pill-h); }

/* where the dock sits on the screen */
body[data-anchor$="center"] .shell { left: 50%; transform: translateX(-50%); }
body[data-anchor$="left"] .shell { left: 0; --open-w: 100%; }
body[data-anchor$="right"] .shell { right: 0; --open-w: 100%; }
body[data-anchor^="top"] .shell { top: 0; }
body[data-anchor^="bottom"] .shell { bottom: 0; }
body[data-anchor$="left"], body[data-anchor$="right"] { --open-w: 100%; }
body[data-anchor="top-center"] .shell { border-radius: 0 0 var(--r) var(--r); }
body[data-anchor="top-left"] .shell { border-radius: 0 0 var(--r) 0; }
body[data-anchor="top-right"] .shell { border-radius: 0 0 0 var(--r); }
body[data-anchor="bottom-center"] .shell { border-radius: var(--r) var(--r) 0 0; }
body[data-anchor="bottom-left"] .shell { border-radius: 0 var(--r) 0 0; }
body[data-anchor="bottom-right"] .shell { border-radius: var(--r) 0 0 0; }
/* the middle of the left or right edge: the pill stands upright */
body[data-anchor="left-center"], body[data-anchor="right-center"] { --ear: 0px; --open-w: 100%; }
body[data-anchor="left-center"] .shell { left: 0; top: 50%; transform: translateY(-50%); border-radius: 0 var(--r) var(--r) 0; }
body[data-anchor="right-center"] .shell { left: auto; right: 0; top: 50%; transform: translateY(-50%); border-radius: var(--r) 0 0 var(--r); }
body[data-anchor="left-center"] .shell::before, body[data-anchor="left-center"] .shell::after,
body[data-anchor="right-center"] .shell::before, body[data-anchor="right-center"] .shell::after { display: none; }
/* free: anywhere on the screen, rounded all around */
body[data-anchor="free"] { --ear: 0px; --open-w: 100%; }
body[data-anchor="free"] .shell { left: 50%; top: 0; transform: translateX(-50%); border-radius: var(--r); }

/* the curved "ears" that join a centered dock to the screen edge */
.shell::before, .shell::after { content: ""; position: absolute; top: 0; width: var(--ear); height: var(--ear); pointer-events: none; display: none; }
body[data-anchor="top-center"] .shell::before, body[data-anchor="top-center"] .shell::after, body[data-anchor="bottom-center"] .shell::before, body[data-anchor="bottom-center"] .shell::after { display: block; }
.shell::before { left: calc(var(--ear) * -1); background: radial-gradient(circle at 0 100%, transparent var(--ear), var(--bg) calc(var(--ear) + 0.5px)); }
.shell::after { right: calc(var(--ear) * -1); background: radial-gradient(circle at 100% 100%, transparent var(--ear), var(--bg) calc(var(--ear) + 0.5px)); }
body[data-anchor="bottom-center"] .shell::before, body[data-anchor="bottom-center"] .shell::after { top: auto; bottom: 0; transform: scaleY(-1); }

.shell-in { position: absolute; inset: 0; border-radius: inherit; overflow: hidden; overflow: clip; }

/* animated theme glow */
.glow { position: absolute; inset: 0; overflow: hidden; pointer-events: none; opacity: 0; transition: opacity 0.4s ease; }
body:not([data-theme="midnight"]) .glow { opacity: 1; }
.glow::before, .glow::after { content: ""; position: absolute; border-radius: 50%; filter: blur(46px); opacity: 0.4; will-change: transform; animation: drift 16s ease-in-out infinite alternate; }
.glow::before { width: 55%; height: 140%; left: -10%; top: -30%; background: var(--g1); }
.glow::after { width: 50%; height: 130%; right: -10%; bottom: -45%; background: var(--g2); animation-duration: 22s; animation-direction: alternate-reverse; }
@keyframes drift { to { transform: translate(16%, 10%) scale(1.15); } }
body.collapsed .glow::before, body.collapsed .glow::after, body.static .glow::before, body.static .glow::after,
body.mode-app .glow::before, body.mode-app .glow::after, body.mode-popup .glow::before, body.mode-popup .glow::after { animation: none; }

/* window modes without a pill */
body.mode-app, body.mode-popup, body.mode-overlay { --ear: 0px; --r: 0px; }
body.mode-app .shell, body.mode-popup .shell { left: 0; top: 0; transform: none; width: 100%; height: 100%; border-radius: 0; transition: none; }
body.mode-popup .shell { border-radius: 18px; border: 1px solid var(--line); }
body.mode-app .notch-row, body.mode-popup .notch-row { display: none; }

/* ---- closed: the pill ---- */
.notch-row { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: 8px; transition: opacity 0.16s ease 0.08s; }
body:not(.collapsed) .notch-row { opacity: 0; pointer-events: none; transition-delay: 0s; }
.badge { font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--text); white-space: nowrap; max-width: 110px; overflow: hidden; text-overflow: ellipsis; }
body[data-anchor="left-center"] .notch-row, body[data-anchor="right-center"] .notch-row { flex-direction: column; }
body[data-anchor="left-center"] .badge, body[data-anchor="right-center"] .badge { writing-mode: vertical-rl; max-width: none; max-height: 110px; }
.wave { display: flex; align-items: center; gap: 2px; height: 14px; flex: none; }
.wave i { width: 2.5px; height: 30%; border-radius: 2px; background: var(--accent); animation: wave 0.9s ease-in-out infinite alternate; }
.wave i:nth-child(2) { animation-delay: -0.3s; } .wave i:nth-child(3) { animation-delay: -0.6s; } .wave i:nth-child(4) { animation-delay: -0.15s; }
@keyframes wave { from { height: 25%; } to { height: 100%; } }
body.static .wave i { animation-duration: 1.4s; }
body.mode-mirror .dash { display: none; }
body.mode-mirror .notch-row { opacity: 1; pointer-events: auto; }
body.mode-mirror .shell { transition: none; cursor: pointer; }
body.small .badge { font-size: 11px; }
.live { width: 6px; height: 6px; border-radius: 50%; background: var(--ok); flex: none; }
.live.off { background: var(--muted); }
.mic { width: 14px; height: 14px; flex: none; color: var(--ok); display: grid; place-items: center; }
.mic svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }
.mic.off { color: var(--danger); }
body.small .mic, body.small .wave { display: none; }
body.small .live { display: none; }

/* ---- open: the dashboard keeps its full size while the shell grows, so nothing reflows ---- */
.dash {
  position: absolute;
  width: var(--open-w);
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 14px 18px 14px;
  opacity: 1;
  transition: opacity 0.2s ease 0.08s;
}
body[data-anchor$="center"] .dash { left: 50%; transform: translateX(-50%); width: calc(100vw - var(--ear) * 2); }
body[data-anchor$="left"] .dash { left: 0; width: 100vw; }
body[data-anchor$="right"] .dash { right: 0; width: 100vw; }
body[data-anchor^="top"] .dash { top: 0; }
body[data-anchor^="bottom"] .dash { bottom: 0; }
body[data-anchor="left-center"] .dash { left: 0; right: auto; top: 0; transform: none; width: 100vw; }
body[data-anchor="right-center"] .dash { left: auto; right: 0; top: 0; transform: none; width: 100vw; }
body[data-anchor="free"] .dash { left: 50%; top: 0; transform: translateX(-50%); width: 100vw; }
body.collapsed .dash { opacity: 0; pointer-events: none; transition: opacity 0.08s ease; }
body.mode-app .dash, body.mode-popup .dash { left: 0; top: 0; transform: none; width: 100%; height: 100%; }
body.mode-app .dash { flex-direction: row; padding: 0; }
.col { flex: 1; min-width: 0; min-height: 0; display: flex; flex-direction: column; }
body.mode-app .col { padding: 18px 26px 16px; }
.sidebar { display: none; }
body.mode-app .sidebar { display: block; }

/* a thin strip on top of the dashboard that moves the window */
.grip { position: absolute; top: 0; left: 0; right: 0; height: 12px; display: grid; place-items: center; z-index: 4; }
.grip i { width: 34px; height: 4px; border-radius: 2px; background: rgba(255, 255, 255, 0.18); }
body.mode-overlay .grip { display: none; }

/* mascot */
/* The face is the animated mascot (mascot.svg, white). Each tab's colour shows as a soft glow behind it. */
.face { width: 18px; height: 18px; position: relative; display: grid; flex: none; transition: transform 0.2s ease; filter: drop-shadow(0 0 3px var(--mascot, transparent)); }
.face::before { content: ""; position: absolute; inset: 0; background: url("mascot.svg") center / contain no-repeat; }
.face i { display: none; }
body.small .notch-row .face { width: 14px; height: 14px; border-radius: 5px; }
.dash .face { width: 28px; height: 28px; border-radius: 9px; transition: background 0.3s ease, transform 0.2s ease; }
.dash .face i { width: 4px; height: 7px; }
.dash .face[data-badge]::after { content: attr(data-badge); position: absolute; right: -7px; top: -9px; font-size: 12px; line-height: 1; filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.6)); pointer-events: none; }
.dash .face[data-eyes="wide"] i { width: 5px; height: 8px; border-radius: 40%; }
.dash .face[data-eyes="sleepy"] i { height: 4px; border-radius: 4px 4px 50% 50%; }
.face.yay { animation: bounce 0.5s ease; }
.face.hmm i { height: 2px; border-radius: 2px; }
.face.think { transform: rotate(-8deg); }
.face.think i { animation: look 0.9s ease-in-out infinite alternate; }
.face.typing { transform: translateY(1px) rotate(-4deg); }
.face.typing i { animation: look 0.32s ease-in-out infinite alternate; }
@keyframes bounce { 30% { transform: translateY(-3px) scale(1.1); } 60% { transform: translateY(0) scale(0.97); } }
@keyframes blink { 0%, 94%, 100% { transform: scaleY(1); } 97% { transform: scaleY(0.1); } }
@keyframes look { from { transform: translate(-1.5px, 1px); } to { transform: translate(1.5px, 2px); } }

/* header */
.head { display: flex; align-items: center; gap: 10px; }
.search { flex: 1; display: flex; align-items: center; gap: 10px; height: 36px; padding: 0 4px; color: var(--muted); min-width: 0; }
.search svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; flex: none; }
.search input { flex: 1; min-width: 0; border: 0; background: transparent; outline: 0; color: var(--text); font-size: var(--t-title); }
.search input::placeholder { color: var(--muted); }
.page-title { flex: 1; font-size: 18px; font-weight: 700; letter-spacing: -0.3px; padding-left: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.round-btns { display: flex; gap: 4px; flex: none; }
.rbtn { width: 28px; height: 28px; border: 0; border-radius: 50%; background: var(--fill); color: var(--text); display: grid; place-items: center; padding: 0; transition: background 0.15s ease, transform 0.15s ease; }
.rbtn:hover { background: var(--fill-hover); }
.rbtn:active { transform: scale(0.92); }
.rbtn svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linejoin: round; stroke-linecap: round; }
.rbtn[aria-pressed="true"] { background: #fff; color: #000; }
/* the mic button: plain while live, red and crossed out while muted */
#btn-mic .slash { display: none; }
#btn-mic.muted, #btn-mic[aria-pressed="true"] { background: rgba(255, 69, 58, 0.22); color: var(--danger); }
#btn-mic.muted .slash { display: inline; }

/* tabs (dock and popup) */
.tabs { display: flex; align-items: center; gap: 4px; margin: 6px 0 8px; }
.tab-arrow { flex: none; width: 22px; height: 26px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); font-size: 18px; line-height: 1; padding: 0; }
.tab-arrow:hover { background: var(--fill); color: var(--text); }
body.mode-app .tabs { display: none; }
.tabs-scroll { flex: 1; display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding: 2px 0; }
.tabs-scroll::-webkit-scrollbar { display: none; }
.tab { flex: none; border: 0; border-radius: 999px; padding: 5px 12px; background: var(--fill); color: var(--text); font-size: var(--t-body); font-weight: 500; display: flex; gap: 6px; align-items: center; white-space: nowrap; transition: background 0.15s ease, color 0.15s ease; }
.tab:hover { background: var(--fill-hover); }
.tab .n { color: var(--muted); font-size: var(--t-small); }
.tab.on { background: #fff; color: #000; }
.tab.dragging { opacity: 0.6; transition: none; cursor: grabbing; }
.tab.on .n { color: #555; }
.tab.plus { padding: 6px 0; width: 32px; justify-content: center; font-size: 16px; line-height: 1; color: var(--muted); }
.tab-input { flex: none; width: 130px; border: 1.5px solid var(--blue); border-radius: 999px; background: var(--fill); padding: 5px 12px; outline: 0; font-size: var(--t-body); }
.text-btn { flex: none; border: 0; background: transparent; color: var(--muted); font-size: var(--t-small); padding: 5px 8px; border-radius: 7px; }
.text-btn:hover { color: var(--text); background: var(--fill); }
.text-btn[data-state="confirm"] { color: var(--danger); }

/* sidebar (dashboard window) */
.sidebar { width: 232px; flex: none; padding: 40px 12px 16px; overflow-y: auto; background: rgba(255, 255, 255, 0.035); border-right: 1px solid var(--line); }
.sb-brand { display: flex; align-items: center; gap: 10px; padding: 0 10px 14px; font-size: var(--t-title); font-weight: 700; }
.sb-group { margin: 14px 10px 4px; font-size: 10.5px; font-weight: 600; letter-spacing: 0.07em; color: var(--muted); text-transform: uppercase; display: flex; align-items: center; justify-content: space-between; }
.sb-group button { border: 0; background: transparent; color: var(--muted); font-size: 15px; line-height: 1; padding: 0 2px; }
.sb-group button:hover { color: var(--text); }
.sb-item { display: flex; align-items: center; gap: 10px; width: 100%; border: 0; background: transparent; text-align: left; padding: 7px 10px; border-radius: 8px; font-size: var(--t-body); color: var(--text); transition: background 0.12s ease; }
.sb-item:hover { background: var(--fill); }
.sb-item.on { background: var(--blue); color: #fff; }
.sb-item .ic { width: 16px; text-align: center; opacity: 0.9; }
.sb-item .n { margin-left: auto; font-size: var(--t-small); opacity: 0.6; }
.sb-input { width: 100%; border: 1.5px solid var(--blue); border-radius: 8px; background: var(--fill); padding: 6px 9px; outline: 0; font-size: var(--t-body); margin: 2px 0; }

/* content */
.content { flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; padding: 0 2px 4px; }
/* every tab fills the same frame, so a short page does not look smaller than a long one */
body.mode-main .content:not(.row-mode) { display: flex; flex-direction: column; }
body.mode-main .content:not(.row-mode) > .page { flex: 1 0 auto; }
.content.row-mode { overflow-y: hidden; display: flex; flex-direction: column; justify-content: center; }

/* the one-line row in the dock: six cards in view, scroll sideways for more */
.rowscroll { display: flex; gap: 12px; overflow-x: auto; overflow-y: hidden; padding: 2px 2px 8px; }
.rowscroll > .card { flex: 0 0 calc((100% - 36px) / 4); }
body.grabbing, body.grabbing * { cursor: grabbing !important; }
.rowscroll, .tabs-scroll, .tiles.one-row { cursor: grab; }

.day { margin: 14px 0 8px 2px; font-size: var(--t-small); font-weight: 600; color: var(--muted); }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
body.mode-app .grid { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 16px; }
body.mode-popup .grid { grid-template-columns: repeat(3, 1fr); }
body.mode-app .card { height: 150px; animation: none; content-visibility: auto; contain-intrinsic-size: 190px 150px; }

/* cards */
.card { position: relative; height: 120px; border-radius: 14px; background: var(--fill); overflow: hidden; cursor: default; display: flex; flex-direction: column; justify-content: space-between; padding: 10px 11px; transition: background 0.15s ease, transform 0.18s var(--ease), box-shadow 0.15s ease; animation: pop 0.28s var(--ease) both; }
@keyframes pop { from { opacity: 0; transform: translateY(6px) scale(0.97); } }
.card:hover { background: var(--fill-hover); transform: translateY(-1px); }
.card:active { transform: scale(0.985); }
.card.flash { box-shadow: 0 0 0 2px var(--ok) inset; }

.snip { font-size: var(--t-card); line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; word-break: break-word; }
.card .snip b { display: block; font-size: var(--t-body); margin-bottom: 2px; }
.card .snip span { color: var(--muted); }
.foot { display: flex; align-items: center; gap: 6px; font-size: 10.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.card.pic { background: var(--fill); padding: 0; }
.card.pic:hover { background: var(--fill-hover); }
.card.pic img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; padding: 12px 12px 26px; }
.card.pic .foot { position: absolute; left: 0; right: 0; bottom: 0; padding: 5px 10px; background: linear-gradient(to top, var(--fill) 60%, transparent); color: var(--muted); }

.card.swatch .big { font-size: var(--t-body); font-weight: 600; font-variant-numeric: tabular-nums; }
.card.swatch .foot { color: inherit; opacity: 0.75; }

.card.link .site { display: flex; align-items: center; gap: 7px; min-width: 0; }
.card.link .host { font-weight: 600; font-size: var(--t-card); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card.link .url { color: var(--muted); font-size: 10.5px; word-break: break-all; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; margin-top: 6px; }
.fav { width: 20px; height: 20px; border-radius: 6px; flex: none; background: var(--fill-hover); display: grid; place-items: center; font-size: 10px; font-weight: 700; color: var(--muted); overflow: hidden; }
.fav img { width: 100%; height: 100%; object-fit: contain; }

.aipanel.in-tab { position: relative; inset: auto; flex: 1; width: 100%; height: 100%; padding: 0; background: none; animation: none; }
body.mode-popup .head .face, body.mode-popup .head .page-title, body.mode-popup .round-btns { display: none; }
body.mode-popup .head { flex-wrap: wrap; }
body.mode-popup .tabs { display: none; }
.search-app { display: flex; padding: 0; overflow: hidden; }
.sf-side { width: 200px; flex: none; overflow-y: auto; padding: 8px 8px; border-right: 1px solid var(--line); }
.sf-title { font-size: 11px; color: var(--muted); padding: 12px 8px 4px; text-transform: uppercase; letter-spacing: 0.05em; }
.sf-item { display: flex; align-items: center; gap: 10px; width: 100%; border: 0; border-radius: 8px; background: transparent; color: var(--text); padding: 6px 10px; text-align: left; font-size: var(--t-body); }
.sf-item:hover { background: var(--fill); }
.sf-item.on { background: var(--fill-hover); font-weight: 600; }
.sf-ic { width: 18px; text-align: center; flex: none; }
.sf-main { flex: 1; min-width: 0; overflow-y: auto; }
.sf-row { display: grid; grid-template-columns: minmax(160px, 1.1fr) minmax(200px, 2fr) 150px; gap: 12px; align-items: center; width: 100%; padding: 6px 12px; border: 0; background: transparent; color: var(--text); text-align: left; font-size: var(--t-small); }
button.sf-row:hover { background: var(--fill); }
.sf-head { position: sticky; top: 0; z-index: 1; background: var(--bg); color: var(--muted); font-weight: 600; font-size: 11px; border-bottom: 1px solid var(--line); cursor: default; }
.sf-name { display: flex; align-items: center; gap: 8px; min-width: 0; }
.sf-name > span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sf-path, .sf-date { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sf-note { padding: 14px; color: var(--muted); font-size: var(--t-small); }
.pop-results { max-height: 420px; overflow-y: auto; scrollbar-width: none; }
.pop-results::-webkit-scrollbar { display: none; }
body.popup-moving * { user-select: none; cursor: grabbing; }
.pin-btn.on { background: #fff; color: #000; }
.file-row { flex-direction: row; align-items: center; gap: 10px; cursor: grab; }
.file-text { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.file-ic { flex: none; width: 36px; height: 36px; display: grid; place-items: center; border-radius: 8px; background: var(--fill); font-size: 18px; }
.file-thumb, .file-media { flex: none; width: 52px; height: 36px; border-radius: 8px; object-fit: cover; background: var(--fill); }
audio.file-media { width: 52px; height: 36px; }
.pop-foot { display: flex; flex-direction: column; gap: 6px; padding: 8px 10px; border-top: 1px solid var(--line); margin-top: 4px; }
.pop-more { border: 0; background: transparent; color: var(--accent); text-align: left; padding: 4px 0; font-size: var(--t-body); }
.pop-opt { display: flex; align-items: center; gap: 6px; font-size: var(--t-small); color: var(--muted); }
.rows { display: flex; flex-direction: column; gap: 2px; padding: 6px 0; }
.color-row { flex-direction: row; align-items: center; gap: 10px; }
.color-row .pop-path { margin-left: auto; }
.swatch-dot { flex: none; width: 22px; height: 22px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.15); }
body.mode-popup .hist-filters { order: -1; width: 100%; padding: 0 0 8px; }
.pop-results { display: flex; flex-direction: column; gap: 2px; padding: 6px 0; }
.pop-row { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; width: 100%; border: 0; border-radius: 10px; background: transparent; color: var(--text); padding: 7px 10px; text-align: left; }
.pop-row:hover { background: var(--fill); }
.pop-row.file-row { flex-direction: row; align-items: center; } /* list view: icon, then name and path */
.pop-name { font-size: var(--t-body); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.pop-path { font-size: var(--t-small); color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.pop-note { padding: 8px 10px; color: var(--muted); font-size: var(--t-small); }
.hist-filters { display: flex; align-items: center; gap: 6px; padding: 2px 0 10px; }
.hist-filters .sep { width: 1px; height: 18px; margin-left: 4px; background: var(--line); }
.card.lead { align-items: center; justify-content: center; gap: 6px; background: transparent; border: 1.5px dashed var(--fill-hover); color: var(--muted); text-align: center; font-size: var(--t-card); }
.card.lead:hover { background: var(--fill); color: var(--text); }
.card.lead .plus-ic { font-size: 22px; line-height: 1; }
.card.lead .pair { display: flex; flex-direction: column; gap: 5px; width: 100%; }
.card.lead .pair button { border: 0; border-radius: 8px; padding: 5px 6px; background: var(--fill-hover); font-size: var(--t-small); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card.lead .pair button:hover { background: rgba(255, 255, 255, 0.2); }
.card.lead .pair button.on { background: var(--accent); color: var(--on-accent); }

.tl, .actions { position: absolute; top: 6px; display: none; gap: 4px; z-index: 2; }
.tl { left: 6px; }
.actions { right: 6px; }
.card:hover .tl, .card:hover .actions, .card:focus-within .tl, .card:focus-within .actions { display: flex; }
.mini { width: 22px; height: 22px; border: 0; border-radius: 50%; background: rgba(0, 0, 0, 0.64); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); color: #fff; display: grid; place-items: center; padding: 0; }
.mini:hover { background: rgba(0, 0, 0, 0.88); }
.mini.on { background: var(--accent); color: #000; }
.mini.danger:hover { background: var(--danger); }
.mini svg { width: 11px; height: 11px; fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linejoin: round; stroke-linecap: round; }
.mini.on svg { fill: currentColor; }

/* notes */
.card.note { padding: 11px 12px; }
.card.note .snip { -webkit-line-clamp: 5; color: var(--muted); }
.card.note .snip b { color: var(--text); font-size: var(--t-body); font-weight: 600; margin-bottom: 4px; }

.empty { margin: 24px auto; max-width: 330px; padding: 22px 16px; text-align: center; color: var(--muted); font-size: var(--t-card); line-height: 1.5; }
.empty b { display: block; color: var(--text); font-weight: 600; font-size: 14px; margin-bottom: 4px; }

/* todo list, like Apple Reminders */
.todo-list { display: flex; flex-direction: column; padding: 2px 4px 8px; max-width: 760px; }
.todo-row { display: flex; align-items: flex-start; gap: 12px; padding: 9px 4px; border-radius: 8px; transition: background 0.2s ease; }
.todo-row.enter { animation: pop 0.3s var(--ease) both; }
.todo-row.finishing { animation: todo-out 0.5s 0.12s ease-in forwards; }
.todo-row.undoing { animation: todo-back 0.45s 0.08s ease forwards; }
@keyframes todo-out { to { opacity: 0; transform: translateX(26px); } }
@keyframes todo-back { to { opacity: 0; transform: translateX(-26px); } }
.todo-row:hover { background: var(--fill); }
.todo-row + .todo-row { border-top: 1px solid rgba(255, 255, 255, 0.05); }
.todo-check { position: relative; flex: none; width: 22px; height: 22px; margin-top: 1px; border-radius: 50%; border: 1.6px solid #5c5c61; background: transparent; padding: 0; display: grid; place-items: center; transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s var(--ease); }
.todo-check:hover { border-color: var(--ok); transform: scale(1.08); }
.todo-check.on { background: var(--ok); border-color: var(--ok); animation: tick-pop 0.4s var(--ease); }
.todo-check.on::after { content: ""; width: 5px; height: 10px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg) translate(-1px, -1px); animation: tick-draw 0.25s ease-out; }
/* a ring that spreads out when it is ticked */
.todo-row.finishing .todo-check::before { content: ""; position: absolute; inset: -2px; border-radius: 50%; border: 2px solid var(--ok); animation: ring-out 0.55s ease-out forwards; }
@keyframes tick-pop { 0% { transform: scale(0.7); } 55% { transform: scale(1.22); } 100% { transform: scale(1); } }
@keyframes tick-draw { from { opacity: 0; transform: rotate(45deg) translate(-1px, -1px) scale(0.2); } }
@keyframes ring-out { from { opacity: 0.9; transform: scale(1); } to { opacity: 0; transform: scale(2.1); } }
.todo-body { flex: 1; min-width: 0; }
.todo-text { font-size: 15px; line-height: 1.3; word-break: break-word; background: linear-gradient(currentColor, currentColor) 0 58% / 0 1.5px no-repeat; transition: background-size 0.35s ease, color 0.3s ease; }
.todo-row.done .todo-text, .todo-row.finishing .todo-text { background-size: 100% 1.5px; color: var(--muted); }
.todo-row.undoing .todo-text { background-size: 0 1.5px; color: var(--text); }
.todo-sub { margin-top: 2px; font-size: var(--t-small); color: var(--muted); }
.todo-sub.due { color: var(--danger); }
.todo-del { flex: none; opacity: 0; border: 0; background: transparent; color: var(--muted); width: 24px; height: 24px; border-radius: 6px; display: grid; place-items: center; padding: 0; }
.todo-row:hover .todo-del { opacity: 1; }
.todo-del:hover { color: var(--danger); background: var(--fill-hover); }
.todo-del svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }
.todo-head { font-size: var(--t-small); font-weight: 600; color: var(--muted); margin: 10px 4px 2px; }

/* composer */
.composer { display: flex; align-items: center; gap: 6px; margin-top: 8px; padding: 5px 5px 5px 14px; background: var(--fill); border-radius: 12px; }
.composer input { flex: 1; min-width: 0; border: 0; background: transparent; outline: 0; font-size: var(--t-body); }
.composer input::placeholder { color: var(--muted); }
.icon-plain, .add { width: 28px; height: 28px; flex: none; border: 0; border-radius: 8px; display: grid; place-items: center; padding: 0; }
.icon-plain { background: transparent; color: var(--muted); }
.icon-plain:hover { color: var(--text); background: var(--fill-hover); }
.icon-plain.on { color: var(--blue); }
.icon-plain svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linecap: round; }
.add { background: var(--accent); color: var(--on-accent); }
.add:hover { filter: brightness(1.06); }
.add svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }

.when-chip { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 8px; padding: 4px 6px 4px 10px; border-radius: 8px; background: rgba(10, 132, 255, 0.15); color: var(--blue); font-size: var(--t-card); }
.when-chip button { width: 20px; height: 20px; border: 0; border-radius: 5px; background: transparent; color: inherit; display: grid; place-items: center; padding: 0; }
.when-chip button:hover { background: rgba(10, 132, 255, 0.2); }
.when-chip svg { width: 9px; height: 9px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; }

/* full-size overlays inside the dashboard: picker, timer form, detail view */
.sheet, .detail, .aipanel { position: absolute; inset: 0; z-index: 5; background: radial-gradient(120% 90% at 100% 0%, color-mix(in srgb, var(--g1, var(--accent)) 16%, transparent), transparent 60%), radial-gradient(100% 80% at 0% 100%, color-mix(in srgb, var(--g2, var(--accent)) 14%, transparent), transparent 60%), var(--bg); display: flex; flex-direction: column; align-items: center; padding: 14px 18px 18px; animation: fade 0.2s ease both; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } }
.sheet-top, .days, .steps, .tform { width: min(100%, 480px); }
.sheet-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; padding-bottom: 14px; }
.sheet-title { flex: 1; min-width: 0; text-align: center; padding-top: 6px; }
.sheet-title div:first-child { font-size: var(--t-title); font-weight: 600; }
.sheet-sub { margin-top: 2px; color: var(--muted); font-size: var(--t-card); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.round { width: 32px; height: 32px; flex: none; border: 0; border-radius: 50%; background: var(--fill-hover); color: var(--text); display: grid; place-items: center; padding: 0; transition: filter 0.15s ease, transform 0.15s ease; }
.round:hover { filter: brightness(1.15); }
.round:active { transform: scale(0.92); }
.round svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
#d-star svg, #d-del svg { width: 14px; height: 14px; stroke-width: 1.4; }
#d-star.on { background: var(--accent); color: #000; }
#d-star.on svg { fill: currentColor; }
.round.ok { background: #fff; color: #000; }

.days { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 10px; scrollbar-width: none; }
.days::-webkit-scrollbar { display: none; }
.days .day { flex: none; width: 56px; margin: 0; padding: 8px 0 9px; border: 1px solid transparent; border-radius: 12px; background: var(--fill); color: var(--text); display: grid; gap: 4px; justify-items: center; font-size: var(--t-small); font-weight: 500; transition: border-color 0.15s ease, background 0.15s ease; }
.days .day b { font-size: var(--t-body); font-weight: 600; }
.days .day.on { border-color: var(--blue); color: var(--blue); background: rgba(10, 132, 255, 0.12); }

.steps { display: flex; align-items: center; justify-content: center; gap: 10px; margin-top: 12px; }
.stepper { display: flex; align-items: center; justify-content: center; gap: 14px; padding: 0 10px; height: 56px; min-width: 130px; border-radius: 14px; background: var(--fill); font-size: 24px; font-weight: 500; font-variant-numeric: tabular-nums; }
.stepper button { width: 26px; height: 26px; border: 0; border-radius: 50%; background: transparent; color: var(--text); font-size: 18px; line-height: 1; padding: 0; display: grid; place-items: center; }
.stepper button:hover { background: var(--fill-hover); }
.colon { color: var(--muted); font-size: 22px; }

.tform { display: flex; flex-direction: column; gap: 10px; align-items: stretch; }
.tform input { height: 40px; border: 0; border-radius: 12px; background: var(--fill); padding: 0 14px; outline: 0; font-size: 14px; }
.tform input::placeholder { color: var(--muted); }
.seg2 { display: flex; padding: 3px; border-radius: 10px; background: var(--fill); }
.seg2 button { flex: 1; border: 0; border-radius: 8px; background: transparent; padding: 6px 0; font-size: var(--t-card); color: var(--muted); }
.seg2 button.on { background: #fff; color: #000; }
.chips { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; }
.chips button { border: 0; border-radius: 999px; padding: 5px 12px; background: var(--fill); font-size: var(--t-card); }
.chips button:hover { background: var(--fill-hover); }

/* detail view */
.detail { align-items: stretch; padding: 14px 18px; }
/* In the dock the peek opens as a panel below the cards, so you still see the row above it. */
body.mode-main .detail { top: auto; height: 62%; border-top: 1px solid var(--line); }
.detail-top { display: flex; align-items: center; gap: 8px; padding-bottom: 10px; }
.d-title { flex: 1; font-weight: 600; font-size: 14px; padding-left: 4px; }
.detail-body { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; }
body.mode-main .detail-body, body.mode-app .detail-body { flex-direction: row; gap: 18px; }
.d-preview { flex: 1.2; min-width: 0; min-height: 0; border-radius: 14px; background: var(--fill); display: grid; place-items: center; overflow: hidden; }
.d-preview img { width: 100%; height: 100%; object-fit: contain; max-height: 100%; }
.d-preview.white { background: #fff; }
.d-preview .d-text { padding: 16px; white-space: pre-wrap; word-break: break-word; font-size: 13.5px; align-self: start; user-select: text; -webkit-user-select: text; }
.d-preview .d-swatch { width: 100%; height: 100%; display: grid; place-items: center; font-size: 22px; font-weight: 600; }
.d-preview textarea { width: 100%; height: 100%; border: 0; outline: 0; resize: none; background: transparent; padding: 14px; font-size: 13.5px; line-height: 1.5; user-select: text; -webkit-user-select: text; }
.d-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 10px; overflow-y: auto; }
.d-k { font-size: 10.5px; font-weight: 600; letter-spacing: 0.06em; color: var(--muted); text-transform: uppercase; }
.d-v { font-size: var(--t-body); margin-top: 2px; word-break: break-all; }
.d-row { display: flex; align-items: center; gap: 8px; padding: 9px 12px; border-radius: 12px; background: var(--fill); min-width: 0; }
.d-row span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.d-btns { display: flex; gap: 8px; flex-wrap: wrap; }
body .detail-body.clip-view { flex-direction: column; gap: 12px; }
.clip-view .d-preview { flex: 1; width: 100%; }
.d-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.d-bar .d-btns { margin-left: auto; flex-wrap: nowrap; }
.d-chip { padding: 6px 11px; border-radius: 999px; background: var(--fill); color: var(--muted); font-size: 12px; white-space: nowrap; max-width: 240px; overflow: hidden; text-overflow: ellipsis; }
.d-chip[hidden] { display: none; }
.tab.tagged::before { content: ''; flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--tag); }
.pill-btn { border: 0; border-radius: 999px; padding: 7px 13px; background: var(--fill); font-size: var(--t-card); font-weight: 500; }
.pill-btn:hover { background: var(--fill-hover); }
.pill-btn.main { background: #fff; color: #000; }

/* note editor, Apple Notes style */
.editor { display: flex; flex-direction: column; flex: 1; min-height: 0; width: 100%; max-width: 680px; margin: 0 auto; }
.editor input { border: 0; outline: 0; background: transparent; font-size: 22px; font-weight: 700; padding: 4px 0 6px; letter-spacing: -0.3px; }
.editor input::placeholder, .editor textarea::placeholder { color: color-mix(in srgb, var(--muted) 60%, transparent); }
.editor input, .editor textarea { caret-color: var(--accent); }
.editor textarea::selection, .editor input::selection { background: color-mix(in srgb, var(--accent) 40%, transparent); }
.editor .stamp { color: var(--accent); }
.editor textarea { flex: 1; border: 0; outline: 0; resize: none; background: transparent; font-size: 14px; line-height: 1.55; user-select: text; -webkit-user-select: text; }
.editor .stamp { color: var(--muted); font-size: var(--t-small); padding-bottom: 6px; }

/* context menu */
.menu { position: absolute; z-index: 9; min-width: 170px; padding: 5px; border-radius: 12px; background: rgba(36, 36, 38, 0.97); border: 1px solid var(--line); -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px); box-shadow: 0 12px 32px rgba(0, 0, 0, 0.6); animation: fade 0.14s ease both; }
.menu button { display: block; width: 100%; border: 0; background: transparent; text-align: left; padding: 6px 10px; border-radius: 7px; font-size: var(--t-card); }
.menu button:hover { background: var(--blue); }
.menu button.danger { color: var(--danger); }
.menu button.danger:hover { background: var(--danger); color: #fff; }
.menu hr { border: 0; border-top: 1px solid var(--line); margin: 4px 6px; }

/* first run: the logo and name */
.intro { position: fixed; left: 50%; top: 40px; transform: translateX(-50%); z-index: 60; display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 22px 30px; border-radius: 22px; background: var(--bg); box-shadow: 0 16px 50px rgba(0, 0, 0, 0.6); animation: intro-in 0.5s var(--ease) both; transition: opacity 0.5s ease; }
.intro.out { opacity: 0; }
.intro b { font-size: 22px; letter-spacing: -0.4px; }
.intro span { font-size: var(--t-card); color: var(--muted); text-align: center; }
.face.big { width: 46px; height: 46px; border-radius: 15px; }
.face.big i { width: 6px; height: 10px; }
@keyframes intro-in { from { opacity: 0; transform: translate(-50%, -8px) scale(0.96); } }

/* drop zone and toast */
.drop { position: absolute; inset: 8px; z-index: 7; display: grid; place-items: center; border: 2px dashed var(--blue); border-radius: 20px; background: rgba(0, 0, 0, 0.88); color: var(--blue); pointer-events: none; animation: fade 0.18s ease both; }
.drop-in { text-align: center; display: grid; gap: 4px; }
.drop-in b { font-size: 18px; }
.drop-in span { font-size: var(--t-card); opacity: 0.8; }
.toast { position: absolute; z-index: 10; left: 50%; bottom: 62px; transform: translateX(-50%); padding: 5px 12px; border-radius: 999px; background: #fff; color: #000; font-size: var(--t-card); opacity: 0; pointer-events: none; transition: opacity 0.2s ease; max-width: 90%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.toast.show { opacity: 1; }

/* privacy blur */
body.privacy .card .snip, body.privacy .card img, body.privacy .card .big, body.privacy .card .host, body.privacy .card .url, body.privacy .card .fav,
body.privacy .detail-body, body.privacy .todo-text, body.privacy .page .blurable { filter: blur(8px); }
.card img, .snip, .big, .host, .url, .fav, .detail-body, .todo-text { transition: filter 0.2s ease; }

.pop-name .hl { font-weight: inherit; color: var(--blue); }

/* ---- preview: a full view of the selected item, with a header of buttons ---- */
.preview-ov { position: fixed; inset: 0; z-index: 90; display: flex; flex-direction: column; background: rgba(12, 12, 14, 0.94); color: #f2f2f7; outline: 0; animation: fade 0.16s ease both; }
.pv-head { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-bottom: 1px solid rgba(255, 255, 255, 0.08); }
.pv-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.pv-btn { color: #f2f2f7; background: rgba(255, 255, 255, 0.1); }
.pv-btn.on { background: #fff; color: #000; }
.pv-action { border: 0; border-radius: 999px; padding: 5px 12px; background: rgba(255, 255, 255, 0.1); color: #f2f2f7; font-size: 12px; }
.pv-body { flex: 1; min-height: 0; overflow: auto; display: flex; align-items: center; justify-content: center; padding: 14px; }
.pv-img { max-width: 100%; max-height: 100%; transition: transform 0.08s linear; cursor: zoom-in; }
.pv-media { max-width: 100%; max-height: 100%; }
/* the preview window shows only the preview */
body.preview-win > :not(.preview-ov) { display: none !important; }
.vp { width: 100%; height: 100%; align-self: stretch; display: flex; flex-direction: column; background: #000; border-radius: 10px; overflow: hidden; }
.vp:fullscreen { border-radius: 0; }
.vp-video { flex: 1; min-height: 0; width: 100%; object-fit: contain; cursor: pointer; }
.vp-bar { display: flex; align-items: center; gap: 10px; padding: 8px 12px; background: rgba(255, 255, 255, 0.06); }
.vp-btn { border: 0; border-radius: 8px; padding: 4px 10px; background: rgba(255, 255, 255, 0.12); color: #f2f2f7; }
.vp-seek { flex: 1; min-width: 0; accent-color: var(--accent, #0a84ff); }
.vp-vol { width: 80px; accent-color: var(--accent, #0a84ff); }
.vp-time { font-size: 12px; color: #aeaeb2; white-space: nowrap; font-variant-numeric: tabular-nums; }
.pv-frame { width: 100%; height: 100%; border: 0; border-radius: 10px; background: #fff; }
.pv-body .rows { width: 100%; align-self: stretch; overflow-y: auto; }
.pv-note { color: #aeaeb2; padding: 14px; }
.pv-text { width: 100%; align-self: stretch; white-space: pre-wrap; word-break: break-word; font-size: 13px; margin: 0; }
.md { width: min(760px, 100%); line-height: 1.55; font-size: 14px; }
.md code { background: rgba(255, 255, 255, 0.1); border-radius: 5px; padding: 1px 5px; }
.md pre { background: rgba(255, 255, 255, 0.06); border-radius: 10px; padding: 10px 12px; overflow-x: auto; }

/* preview: text sits at the top with a Copy bar; the text can be selected */
.pv-body.pv-top { flex-direction: column; align-items: stretch; justify-content: flex-start; }
.pv-copybar { display: flex; justify-content: flex-end; padding-bottom: 8px; position: sticky; top: -14px; }
.pv-text, .md { user-select: text; -webkit-user-select: text; }

/* ---- the floating windows: the preview under the dock, and the search bar under a file dialog ---- */
body.mode-float, body.mode-float2, body.mode-dialogbar, html:has(body.mode-float), html:has(body.mode-float2), html:has(body.mode-dialogbar) { background: transparent; overflow: hidden; }
body.mode-float .shell, body.mode-float2 .shell, body.mode-dialogbar .shell { display: none; }
#float-root { display: none; height: 100vh; padding: 0; }
body.mode-float #float-root, body.mode-float2 #float-root, body.mode-dialogbar #float-root { display: flex; }
.fl-card, .db-card { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 8px; padding: 10px 12px; border-radius: 16px; background: #1c1c1e; border: 1px solid rgba(255, 255, 255, 0.08); box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5); color: #f5f5f7; overflow: hidden; }
.fl-head { display: flex; align-items: center; gap: 8px; }
.fl-title { flex: 1; font-weight: 600; font-size: 13px; }
.fl-btn { border: 0; border-radius: 999px; padding: 4px 10px; background: rgba(255, 255, 255, 0.1); color: inherit; font-size: 12px; cursor: pointer; }
.fl-btn:hover { background: rgba(255, 255, 255, 0.18); }
.fl-body { flex: 1; min-height: 0; overflow: auto; display: flex; align-items: center; justify-content: center; }
.fl-img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 8px; }
.fl-text { width: 100%; margin: 0; white-space: pre-wrap; word-break: break-word; font-size: 13px; align-self: flex-start; user-select: text; -webkit-user-select: text; }
.db-input { width: 100%; box-sizing: border-box; border: 0; outline: 0; border-radius: 10px; padding: 9px 12px; background: rgba(255, 255, 255, 0.08); color: inherit; font-size: 14px; }
.db-msg { font-size: 12px; color: #aeaeb2; }
.db-msg:empty { display: none; }
.db-list { display: flex; flex-direction: column; gap: 2px; overflow-y: auto; min-height: 0; }
.db-row { display: grid; grid-template-columns: 22px 1fr; column-gap: 8px; align-items: center; text-align: left; border: 0; border-radius: 8px; padding: 6px 8px; background: transparent; color: inherit; cursor: pointer; }
.db-row:hover { background: rgba(255, 255, 255, 0.1); }
.db-ic { grid-row: span 2; }
.db-name { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.db-path { font-size: 11px; color: #8e8e93; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* peek preview: quiet, with actions only where they help */
.fl-card { padding: 8px 10px 10px; gap: 6px; box-shadow: 0 8px 28px rgba(0, 0, 0, 0.45); background: color-mix(in srgb, var(--bg) 88%, #fff 12%); }
.fl-head { min-height: 22px; }
.fl-title { color: #aeaeb2; font-weight: 500; font-size: 12px; }
.fl-actions { display: flex; gap: 4px; }
.fl-note { color: #8e8e93; font-size: 13px; padding: 10px 2px; }
.fl-media { max-width: 100%; max-height: 100%; border-radius: 8px; }
body.privacy .fl-body { filter: blur(10px); }
/* Explorer preview window: a quiet title bar; the buttons appear when you hover it */
.preview-ov.pv-minimal .pv-head { background: transparent; border-bottom: 0; padding: 6px 8px; }
.preview-ov.pv-minimal .pv-body { padding: 8px 14px 14px; }
.preview-ov.pv-minimal .pv-extra { opacity: 0; transition: opacity 0.15s ease; }
.preview-ov.pv-minimal .pv-head:hover .pv-extra, .preview-ov.pv-minimal .pv-head:focus-within .pv-extra { opacity: 1; }

/* Peek: a text clip or note can be edited in the preview; it saves on its own. */
.fl-edit { width: 100%; height: 100%; min-height: 0; border: 0; outline: 0; resize: none; background: transparent; color: inherit; font: inherit; font-size: 13px; line-height: 1.45; padding: 2px; user-select: text; -webkit-user-select: text; }
.fl-body > .fl-edit { align-self: stretch; }
.fl-status { font-size: 11px; color: #8e8e93; white-space: nowrap; }
/* the hover preview, built like the detail view */
.fl-bar { flex-wrap: nowrap; min-width: 0; }
.fl-bar .d-chip { max-width: 160px; }
.fl-body.fl-column { flex-direction: column; align-items: stretch; justify-content: flex-start; gap: 8px; }
.fl-drag { cursor: grab; }
.fl-preview { display: flex; align-items: center; justify-content: center; height: 150px; border-radius: 12px; background: #fff; padding: 8px; flex: none; }
.fl-preview img { max-width: 100%; max-height: 100%; }
.fl-label { font-size: 11px; color: #8e8e93; }
.fl-pic { flex: none; max-width: 100%; height: auto; align-self: center; }
.fl-ocr { display: flex; flex-direction: column; gap: 6px; width: 100%; }
.fl-ocr-head { display: flex; align-items: center; justify-content: space-between; min-height: 24px; }
.fl-ocr-text { overflow: auto; padding: 8px 10px; border-radius: 10px; background: rgba(255, 255, 255, 0.06); font-size: 12px; line-height: 1.45; }
.fl-code { margin: 0; font-family: Consolas, 'Cascadia Mono', monospace; font-size: 12px; line-height: 1.45; white-space: pre-wrap; word-break: break-all; color: #e5e5ea; }
.fl-code .tok-tag { color: #ff7ab2; }
.fl-code .tok-attr { color: #fd8a1d; }
.fl-code .tok-str { color: #a6e22e; }
.fl-swatch { height: 96px; border-radius: 14px; flex: none; }
.fl-colors { display: flex; flex-direction: column; gap: 1px; }
.fl-color-row { display: flex; align-items: center; gap: 12px; border: 0; border-radius: 6px; background: transparent; color: inherit; padding: 4px 6px; text-align: left; }
.fl-color-row:hover { background: rgba(255, 255, 255, 0.08); }
.fl-k { width: 52px; font-size: 11px; color: #8e8e93; }
.fl-v { font-family: Consolas, 'Cascadia Mono', monospace; font-size: 12px; }

/* the text in a picture (OCR), under the picture in its popup */
.ocr-panel { display: flex; flex-direction: column; gap: 8px; padding: 10px; border-radius: 14px; background: var(--fill); }
.ocr-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ocr-lang { height: 30px; max-width: 200px; }
.ocr-text { width: 100%; min-height: 110px; max-height: 220px; resize: vertical; border: 0; border-radius: 10px; padding: 10px; background: var(--bg); color: var(--text); font: inherit; font-size: 13px; line-height: 1.45; }

/* Picture cards: only the folder, star and delete buttons, a bit bigger. */
.card.pic .actions { gap: 6px; }
.card.pic .actions .mini { width: 30px; height: 30px; }
.card.pic .actions .mini svg { width: 15px; height: 15px; }
