/* ═══════════════════════════════════════════════════
   macOS Desktop Simulation — Matt's Space
   Spec reference: Apple HIG + macOS Ventura/Sonoma
   ═══════════════════════════════════════════════════ */

/* ── Variables ── */
:root {
  /* Traffic lights */
  --tl-red:    #ff5f57;
  --tl-yellow: #ffbd2e;
  --tl-green:  #28c840;

  /* System colours */
  --accent:    #0071e3;
  --accent-h:  #0077ed;

  /* Surfaces */
  --win-bg:       rgba(251, 251, 253, 0.9);
  --titlebar-bg:  rgba(242, 242, 246, 0.9);
  --menubar-bg:   rgba(236, 236, 236, 0.82);
  --dock-bg:      rgba(255, 255, 255, 0.24);

  /* Text */
  --text:      #1d1d1f;
  --muted:     #6e6e73;
  --on-dark:   rgba(255, 255, 255, 0.92);
  --on-dark-m: rgba(255, 255, 255, 0.58);

  /* Geometry */
  --menubar-h:  24px;
  --titlebar-h: 28px;
  --win-r:      10px;
  --icon-base:  52px;
  --icon-peak:  82px;

  /* Typography */
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text",
          "SF Pro Display", "Helvetica Neue", Arial, sans-serif;
  --mono: "SF Mono", "Menlo", "Monaco", "Courier New", monospace;

  /* Motion */
  --spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --smooth: cubic-bezier(0.25, 0.1, 0.25, 1);
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
/* Ensure [hidden] always wins over explicit display values */
[hidden] { display: none !important; }

html, body {
  width: 100%; height: 100%; overflow: hidden;
  font-family: var(--font);
  font-size: 13px;
  line-height: 1.4;
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  user-select: none;
  cursor: default;
}

button { cursor: pointer; border: none; background: none; font: inherit; color: inherit; }
a      { text-decoration: none; color: inherit; }
h2, h3, p { margin: 0; }

/* ── Wallpaper — macOS aurora image with dark overlay ── */
body {
  background-color: #04091e; /* solid fallback — prevents black-canvas flash during animations */
  background-image:
    linear-gradient(rgba(0, 0, 18, 0.45), rgba(0, 0, 18, 0.45)),
    url('./assets/background/bluetime.jpg');
  background-size: cover;
  background-position: center;
  /* No background-attachment: fixed — causes repaint glitches during CSS transform animations */
}

body.app-booting .menubar,
body.app-booting .desktop,
body.app-booting .window,
body.app-booting .dock-shell,
body.app-booting .ctx-popover {
  opacity: 0;
  pointer-events: none;
}

/* ══════════════════════════════════════
   BOOT SCREEN
   ══════════════════════════════════════ */

#boot-screen {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: rgba(3, 8, 25, 0.72);
  transition: transform 0.72s cubic-bezier(0.76, 0, 0.24, 1);
}

/* Blurred wallpaper behind the text */
#boot-screen::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url('./assets/background/bluetime.jpg');
  background-size: calc(100% + 60px);
  background-position: center;
  filter: blur(22px) brightness(0.55);
  transform: scale(1.08);
  z-index: 0;
}

/* Keep text above the blur layer */
#boot-screen > * {
  position: relative;
  z-index: 1;
}

#boot-screen.exit {
  transform: translateY(-100%);
}

/* Wrapper — single line, centred */
.boot-hello-wrap {
  display: flex;
  align-items: baseline;
  flex-wrap: nowrap;
  max-width: 88vw;
  margin: 0;
  padding: 0;
  line-height: 1;
  overflow: visible;
}

/* Each character is injected by JS and animates independently */
.boot-char {
  font-family: 'Caveat', cursive;
  font-size: clamp(30px, 3.8vw, 54px);
  font-weight: 600;
  color: rgba(255, 255, 255, 0.92);
  display: inline-block;
  opacity: 0;
  will-change: opacity, transform;
  animation: char-write 0.42s cubic-bezier(0.22, 0.8, 0.36, 1) forwards;
  animation-delay: var(--boot-delay, 0ms);
  text-shadow:
    0 2px 18px rgba(0, 70, 130, 0.20),
    0 1px 3px  rgba(0, 50, 110, 0.12);
}

@keyframes char-write {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.boot-wave {
  display: inline-block;
  opacity: 0;
  font-size: clamp(30px, 3.8vw, 54px);
  line-height: 1;
  margin-left: 0.18em;
  transform-origin: 72% 88%;
  animation: boot-wave-emoji 1.5s ease forwards;
  animation-delay: var(--boot-delay, 0ms);
}

@keyframes boot-wave-emoji {
  0%   { opacity: 0; transform: scale(0.55) rotate(0deg); }
  10%  { opacity: 1; transform: scale(1.05) rotate(0deg); }
  14%  { opacity: 1; transform: scale(1.0)  rotate(0deg); }
  24%  { transform: rotate(24deg); }
  38%  { transform: rotate(-10deg); }
  52%  { transform: rotate(20deg); }
  66%  { transform: rotate(-6deg); }
  78%  { transform: rotate(14deg); }
  90%  { transform: rotate(-2deg); }
  100% { opacity: 1; transform: rotate(0deg); }
}

/* ══════════════════════════════════════
   MENU BAR
   ══════════════════════════════════════ */

.menubar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--menubar-h);
  z-index: 9000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 8px;
  background: rgba(0, 0, 0, 0.62);
  backdrop-filter: blur(24px) saturate(160%);
  -webkit-backdrop-filter: blur(24px) saturate(160%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.menubar-left,
.menubar-right {
  display: flex;
  align-items: center;
  gap: 2px;
}

.menu-apple {
  width: 30px;
  height: var(--menubar-h);
  display: grid;
  place-items: center;
  border-radius: 5px;
  color: rgba(255, 255, 255, 0.88);
  transition: background 0.12s;
}
.menu-apple:hover { background: rgba(255, 255, 255, 0.12); }

.menu-appname {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: -0.01em;
  padding: 0 8px 0 4px;
  color: rgba(255, 255, 255, 0.92);
}

.menu-items { display: flex; }

.menu-item {
  height: var(--menubar-h);
  padding: 0 9px;
  display: grid;
  place-items: center;
  font-size: 13px;
  border-radius: 5px;
  color: rgba(255, 255, 255, 0.88);
  transition: background 0.12s;
}
.menu-item:hover { background: rgba(255, 255, 255, 0.12); }

.menu-tagline {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.52);
  padding: 0 6px;
  white-space: nowrap;
}

.menu-divider {
  width: 1px;
  height: 13px;
  background: rgba(255, 255, 255, 0.18);
  margin: 0 5px;
}

.menu-status-icon {
  color: rgba(255, 255, 255, 0.80);
  opacity: 1;
  margin: 0 3px;
  flex-shrink: 0;
}

.menu-clock {
  font-size: 12px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.88);
  letter-spacing: 0.01em;
  padding-left: 5px;
  white-space: nowrap;
}

/* ══════════════════════════════════════
   DESKTOP
   ══════════════════════════════════════ */

.desktop {
  position: fixed;
  inset: var(--menubar-h) 0 0 0;
  z-index: 1;
}

/* ── Desktop Icons ── */
.desk-icon {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  width: 80px;
  padding: 8px 4px 6px;
  border-radius: 7px;
  background: transparent;
  transition: background 0.14s;
  -webkit-tap-highlight-color: transparent;
  cursor: grab;
  touch-action: none;
  will-change: left, top;
}

.desk-icon:hover   { background: rgba(255, 255, 255, 0.10); }
.desk-icon:active  { background: rgba(255, 255, 255, 0.16); }
.desk-icon.selected { background: transparent; }
.desk-icon.is-dragging {
  cursor: grabbing;
  z-index: 20;
  background: rgba(255, 255, 255, 0.14);
  transition: none;
}
.desk-icon:focus-visible {
  outline: 2px solid rgba(255,255,255,0.6);
  outline-offset: 2px;
}

.di-icon {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  font-size: 42px;
  line-height: 1;
  transition: transform 0.12s var(--spring);
}
.di-icon.has-image {
  filter: drop-shadow(0 8px 18px rgba(0, 0, 0, 0.22));
}
.di-icon-img {
  width: 58px;
  height: 58px;
  object-fit: contain;
  display: block;
}
.di-icon-emoji {
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.18));
}
.desk-icon:hover .di-icon { transform: scale(1.06); }
.desk-icon.is-dragging .di-icon { transform: none; }
.desk-icon.selected .di-icon {
  filter:
    drop-shadow(0 10px 22px rgba(0, 0, 0, 0.24))
    drop-shadow(0 0 12px rgba(132, 185, 255, 0.18));
}

.di-label {
  font-size: 11px;
  font-weight: 500;
  color: #ffffff;
  text-align: center;
  line-height: 1.35;
  word-break: break-word;
  text-shadow:
    0 1px 3px rgba(0, 0, 0, 0.85),
    0 0 8px  rgba(0, 0, 0, 0.60);
  max-width: 100%;
  padding: 1px 5px;
  border-radius: 3px;
}
.desk-icon.selected .di-label {
  background: rgba(0, 113, 227, 0.86);
  color: #fff;
  text-shadow: none;
  box-shadow:
    0 8px 18px rgba(0, 113, 227, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

/* ══════════════════════════════════════
   WINDOWS
   ══════════════════════════════════════ */

.window {
  position: fixed;
  border-radius: var(--win-r);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  z-index: 200;
  background: var(--win-bg);
  backdrop-filter: blur(40px) saturate(180%);
  -webkit-backdrop-filter: blur(40px) saturate(180%);
  box-shadow:
    0 0 0 0.5px rgba(28, 28, 30, 0.14),
    0 10px 24px rgba(16, 24, 40, 0.16),
    0 24px 64px rgba(15, 23, 42, 0.22),
    0 48px 96px rgba(15, 23, 42, 0.18);
  animation: win-in 0.24s var(--spring) both;
  will-change: transform, opacity;
}

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

@keyframes win-in {
  from { opacity: 0; transform: scale(0.88) translateY(8px); }
  to   { opacity: 1; transform: scale(1)    translateY(0);   }
}

/* Focused window gets deeper shadow */
.window.is-focused {
  box-shadow:
    0 0 0 0.5px rgba(28, 28, 30, 0.18),
    0 14px 30px rgba(16, 24, 40, 0.2),
    0 30px 80px rgba(15, 23, 42, 0.28),
    0 60px 120px rgba(15, 23, 42, 0.22);
}

/* ── Title Bar ── */
.win-titlebar {
  position: relative;
  height: var(--titlebar-h);
  display: flex;
  align-items: center;
  padding: 0 13px;
  flex-shrink: 0;
  background: var(--titlebar-bg);
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
  cursor: move;
}

.win-title {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.01em;
  pointer-events: none;
  white-space: nowrap;
}

/* ── Traffic Lights ── */
.traffic-lights {
  display: flex;
  align-items: center;
  gap: 8px;
  z-index: 1;
}

.tl {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
  position: relative;
  transition: filter 0.1s;
  padding: 0;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.tl:hover { filter: brightness(0.88); }
.tl:active { filter: brightness(0.75); }

.tl-close  { background: var(--tl-red); }
.tl-min    { background: var(--tl-yellow); }
.tl-max    { background: var(--tl-green); }

/* Icon glyphs on hover */
.tl::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background-position: center;
  background-repeat: no-repeat;
  background-repeat: no-repeat;
  background-position: center;
  background-size: 7px 7px;
  opacity: 0;
  transition: opacity 0.1s;
}
.window:hover .tl::after { opacity: 1; }

.tl-close::after {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3E%3Cpath d='M1 1l6 6M7 1L1 7' stroke='%23820005' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E");
}
.tl-min::after {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3E%3Cpath d='M1 4h6' stroke='%235c3d00' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E");
}
.tl-max::after {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3E%3Cpath d='M1.5 4h5M4 1.5v5' stroke='%23006500' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E");
}

/* ── Window Body ── */
.win-body {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* ══════════════════════════════════════
   CHAT WINDOW
   ══════════════════════════════════════ */

#win-chat {
  width: 700px;
  height: min(530px, calc(100vh - 160px));
  background: rgba(228, 236, 255, 0.52) !important;
}

/* Override title bar for frosted chat window */
#win-chat .win-titlebar {
  background: rgba(255, 255, 255, 0.28);
  border-bottom: 1px solid rgba(255, 255, 255, 0.32);
}

.chat-win-body {
  background: transparent;
}

/* Context chip bar — hidden (replaced by popover) */
.chat-ctx-bar { display: none; }

.ctx-chip {
  height: 26px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  border: 1px solid rgba(255, 255, 255, 0.6);
  background: rgba(255, 255, 255, 0.42);
  color: var(--muted);
  cursor: pointer;
  transition: background 0.14s, border-color 0.14s, color 0.14s;
  flex-shrink: 0;
}
.ctx-chip:hover { background: rgba(255, 255, 255, 0.62); color: var(--text); }
.ctx-chip.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* ── Chat welcome / empty state (Gemini-style) ── */
.chat-welcome {
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px 28px;
  overflow: hidden;
}

.chat-welcome-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  text-align: center;
  width: max-content;
  max-width: min(100%, 560px);
}

.chat-welcome-avatar-shell {
  position: relative;
  width: 76px;
  height: 76px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  overflow: visible;
  isolation: isolate;
}

.chat-welcome-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  background: #fff;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.12);
}

.chat-welcome-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.chat-welcome-msgs {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
  width: max-content;
  max-width: min(100%, 560px);
}

.chat-welcome-line {
  display: block;
  font-size: 16px;
  font-weight: 600;
  color: color-mix(in srgb, #14233c 88%, #5a6f8f 12%);
  line-height: 1.42;
  margin: 0;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.55s ease, transform 0.55s ease;
  letter-spacing: -0.025em;
  text-wrap: balance;
}

.chat-welcome-line:first-child {
  font-size: clamp(18px, 2vw, 20px);
  font-weight: 700;
  color: color-mix(in srgb, #0f1d33 92%, #5470a3 8%);
  line-height: 1.25;
  letter-spacing: -0.04em;
}

.chat-welcome-line:nth-child(2) {
  width: max-content;
  max-width: none;
  font-size: 14px;
  font-weight: 500;
  color: rgba(39, 53, 80, 0.82);
  line-height: 1.45;
  letter-spacing: -0.015em;
  text-wrap: nowrap;
  white-space: nowrap;
}

.chat-welcome-line.visible {
  opacity: 1;
  transform: translateY(0);
}

.chat-welcome-online-dot {
  position: absolute;
  bottom: 14px;
  right: 12px;
  transform: translate(46%, 46%);
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #30d158;
  border: 2px solid rgba(255, 255, 255, 0.96);
  pointer-events: none;
  z-index: 5;
  box-shadow:
    0 0 0 3px rgba(48, 209, 88, 0.14),
    0 3px 8px rgba(48, 209, 88, 0.22);
  animation: pulse-online 2.5s ease-in-out infinite;
}

/* Messages */
.chat-messages {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  scroll-behavior: smooth;
}
.chat-messages::-webkit-scrollbar { width: 4px; }
.chat-messages::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.1);
  border-radius: 2px;
}

.msg-row {
  display: flex;
  align-items: flex-end;
  gap: 8px;
}
.msg-row.user { justify-content: flex-end; }

.msg-avatar {
  width: 30px;
  height: 30px;
  font-size: 17px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.14);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
}
.avatar-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Online dot in chat title bar */
.title-online-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #30d158;
  margin-right: 5px;
  vertical-align: middle;
  position: relative;
  top: -1px;
  box-shadow: 0 0 0 2px rgba(48, 209, 88, 0.22);
  animation: pulse-online 2.5s ease-in-out infinite;
}
@keyframes pulse-online {
  0%, 100% { box-shadow: 0 0 0 2px rgba(48, 209, 88, 0.22); }
  50%       { box-shadow: 0 0 0 5px rgba(48, 209, 88, 0.10); }
}

/* Thinking dots (before typewriter starts) */
.thinking-dots {
  display: inline-flex;
  gap: 4px;
  align-items: center;
  padding: 2px 0;
}
.thinking-dots span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(0, 113, 227, 0.45);
  animation: dot-blink 1.3s ease-in-out infinite;
}
.thinking-dots span:nth-child(2) { animation-delay: 0.22s; }
.thinking-dots span:nth-child(3) { animation-delay: 0.44s; }
@keyframes dot-blink {
  0%, 80%, 100% { opacity: 0.18; transform: scale(0.75); }
  40%           { opacity: 1;    transform: scale(1);    }
}

.msg-bubble {
  max-width: 74%;
  padding: 9px 13px;
  border-radius: 17px;
  font-size: 13px;
  line-height: 1.65;
  display: flex;
  flex-direction: column;
}
.msg-bubble p { margin: 0; }

.msg-bubble.is-thinking {
  background: rgba(0, 0, 0, 0.045);
}

.msg-status-wrap {
  margin-bottom: 2px;
}

/* Clean thinking indicator: text + dots on one line */
.msg-status-badge {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 6px;
  padding: 2px 0;
  background: none;
  border: none;
  box-shadow: none;
}

.msg-status-text {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.01em;
  color: rgba(0, 0, 0, 0.36);
  white-space: nowrap;
  transition: opacity 0.25s ease;
}

/* Three-dot animation after the text */
.msg-status-dots {
  display: inline-flex;
  gap: 4px;
  align-items: center;
}
.msg-status-dots span {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.25);
  animation: dot-blink 1.3s ease-in-out infinite;
}
.msg-status-dots span:nth-child(2) { animation-delay: 0.22s; }
.msg-status-dots span:nth-child(3) { animation-delay: 0.44s; }

.msg-bubble.has-audio p {
  margin-top: 9px;
}

.msg-audio-wrap {
  display: flex;
  align-items: center;
  margin-bottom: 8px;
}

.msg-audio-btn {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  width: fit-content;
  min-height: 38px;
  padding: 7px 11px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(0, 0, 0, 0.07);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
  transition: transform 0.12s ease, background 0.14s ease, box-shadow 0.14s ease;
}

.msg-audio-btn:hover {
  background: rgba(255, 255, 255, 0.94);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.82),
    0 3px 10px rgba(0, 0, 0, 0.05);
}

.msg-audio-btn:active {
  transform: scale(0.97);
}

.msg-audio-btn.is-playing {
  background: rgba(0, 113, 227, 0.1);
  border-color: rgba(0, 113, 227, 0.14);
}

.msg-audio-icon {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(0, 113, 227, 0.12);
  color: var(--accent);
  font-size: 10px;
  line-height: 1;
  flex-shrink: 0;
}

.msg-audio-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
}

.msg-audio-duration {
  font-size: 11px;
  color: var(--muted);
}

.msg-row.agent .msg-bubble {
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.88);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  border-bottom-left-radius: 4px;
  color: var(--text);
}
.msg-row.user .msg-bubble {
  background: var(--accent);
  color: #fff;
  border-bottom-right-radius: 4px;
}

/* Thinking bubble: animated shimmer border */
.msg-bubble.is-thinking {
  background: rgba(255, 255, 255, 0.52) !important;
  border-color: transparent !important;
  box-shadow: none !important;
  position: relative;
  isolation: isolate;
}
.msg-bubble.is-thinking::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  background: linear-gradient(
    90deg,
    rgba(0, 113, 227, 0.0) 0%,
    rgba(0, 113, 227, 0.0) 25%,
    rgba(0, 113, 227, 0.22) 45%,
    rgba(140, 200, 255, 0.36) 50%,
    rgba(0, 113, 227, 0.22) 55%,
    rgba(0, 113, 227, 0.0) 75%,
    rgba(0, 113, 227, 0.0) 100%
  );
  background-size: 300% 100%;
  animation: bubble-border-scan 5s ease-in-out infinite;
  z-index: -1;
  border-radius: 17px 17px 17px 4px;
}
@keyframes bubble-border-scan {
  0%   { background-position: 300% 0; }
  100% { background-position: -300% 0; }
}

/* Suggestions */
.chat-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 6px 16px 4px;
  flex-shrink: 0;
  min-height: 40px;
  align-items: center;
}

.chat-suggestions button {
  height: 28px;
  padding: 0 13px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  color: var(--accent);
  background: rgba(255, 255, 255, 0.58);
  border: 1px solid rgba(0, 113, 227, 0.22);
  cursor: pointer;
  transition: background 0.14s;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.chat-suggestions button:hover { background: rgba(255, 255, 255, 0.82); }

/* Composer */
.chat-composer {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 8px 14px 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.38);
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.32);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.chat-composer-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Input wrap — houses context pill + text input */
.chat-input-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 5px;
  height: 33px;
  background: rgba(255, 255, 255, 0.68);
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 999px;
  padding: 0 12px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.chat-input-wrap:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.15);
}

/* Context pill inside the input */
.chat-ctx-pill {
  display: flex;
  align-items: center;
  gap: 4px;
  height: 22px;
  padding: 0 9px;
  border-radius: 999px;
  background: rgba(0, 113, 227, 0.1);
  border: 1px solid rgba(0, 113, 227, 0.22);
  font-size: 11.5px;
  font-weight: 600;
  color: #0071e3;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: background 0.14s;
}
.chat-ctx-pill:hover { background: rgba(0, 113, 227, 0.16); }

#chat-input {
  flex: 1;
  height: 100%;
  background: transparent;
  border: none;
  padding: 0;
  font: inherit;
  font-size: 13px;
  outline: none;
  color: var(--text);
  min-width: 0;
}
#chat-input::placeholder { color: rgba(110, 110, 115, 0.7); }

#chat-send {
  width: 33px;
  height: 33px;
  border-radius: 50%;
  background: var(--accent);
  border: none;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  cursor: pointer;
  transition: background 0.14s, transform 0.1s;
  box-shadow: 0 2px 8px rgba(0, 113, 227, 0.3);
}
#chat-send:hover  { background: var(--accent-h); }
#chat-send:active { transform: scale(0.92); }


/* Context switcher — native-style dropdown menu, fixed to body */
.ctx-popover {
  position: fixed;
  min-width: 148px;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 9px;
  padding: 4px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.14), 0 1px 4px rgba(0, 0, 0, 0.06);
  z-index: 99999;
}
.ctx-popover .ctx-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  height: 30px;
  padding: 0 10px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 400;
  color: rgba(0, 0, 0, 0.75);
  background: none;
  border: none;
  text-align: left;
  cursor: pointer;
  transition: background 0.1s;
  white-space: nowrap;
}
.ctx-popover .ctx-chip:hover { background: rgba(0, 113, 227, 0.08); color: #0071e3; }
.ctx-popover .ctx-chip.active { color: #0071e3; font-weight: 500; justify-content: space-between; }
.ctx-popover .ctx-chip.active::after { content: '✓'; font-size: 11px; flex-shrink: 0; }

/* User message context tag */
.msg-ctx-tag {
  display: block;
  font-size: 10.5px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.7);
  text-align: right;
  margin-top: 4px;
}

/* ══════════════════════════════════════
   PROJECT WINDOWS
   ══════════════════════════════════════ */

.win-proj { width: 520px; height: min(450px, calc(100vh - 160px)); }

#win-background {
  width: min(560px, calc(100vw - 36px));
  height: min(470px, calc(100vh - 92px));
}

#win-playbook {
  width: min(660px, calc(100vw - 36px));
  height: min(560px, calc(100vh - 124px));
}

.proj-body { overflow: hidden; }

/* Hero banner */
.proj-hero {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 22px 24px 20px;
  border-bottom: 1px solid rgba(15, 23, 42, 0.07);
  flex-shrink: 0;
}

.proj-emoji {
  font-size: 44px;
  line-height: 1;
  filter: drop-shadow(0 2px 8px rgba(0,0,0,0.15));
}
.proj-icon-shell {
  width: 74px;
  height: 74px;
  flex-shrink: 0;
  border-radius: 18px;
  overflow: hidden;
  background: #fff;
  box-shadow:
    0 1px 3px rgba(0, 0, 0, 0.08),
    0 8px 20px rgba(57, 76, 96, 0.12),
    inset 0 0 0 0.5px rgba(0, 0, 0, 0.06);
}
.proj-icon-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.proj-kicker {
  font-size: 11px;
  font-family: var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
  margin-bottom: 5px;
}

.proj-h2 {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--text);
}

/* Hero colour variants */
.hero-blue   { background: linear-gradient(135deg, rgba(223, 235, 255, 0.95), rgba(187, 212, 255, 0.96) 58%, rgba(241, 246, 255, 0.95)); }
.hero-green  { background: linear-gradient(135deg, rgba(222, 247, 233, 0.95), rgba(182, 233, 204, 0.98) 58%, rgba(241, 252, 246, 0.95)); }
.hero-red    { background: linear-gradient(135deg, rgba(255, 231, 236, 0.96), rgba(248, 193, 205, 0.98) 58%, rgba(255, 244, 246, 0.96)); }
.hero-purple { background: linear-gradient(135deg, rgba(241, 232, 255, 0.96), rgba(221, 196, 255, 0.98) 58%, rgba(248, 242, 255, 0.96)); }
.hero-amber  { background: linear-gradient(135deg, rgba(255, 245, 222, 0.96), rgba(255, 226, 171, 0.98) 58%, rgba(255, 251, 238, 0.96)); }
.hero-teal   { background: linear-gradient(135deg, rgba(224, 248, 247, 0.95), rgba(177, 233, 229, 0.98) 58%, rgba(241, 253, 252, 0.95)); }

/* Content area */
.proj-content {
  flex: 1;
  overflow-y: auto;
  padding: 18px 22px 20px;
}
.proj-content::-webkit-scrollbar { width: 4px; }
.proj-content::-webkit-scrollbar-thumb {
  background: rgba(0,0,0,0.1);
  border-radius: 2px;
}

.proj-summary {
  font-size: 13px;
  line-height: 1.72;
  color: var(--text);
  margin-bottom: 18px;
}

.proj-meta {
  border-top: 1px solid rgba(15, 23, 42, 0.08);
  margin-bottom: 18px;
}
.proj-meta-row {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 11px 2px;
  border-bottom: 1px solid rgba(15, 23, 42, 0.06);
}
.proj-meta-row:last-child {
  border-bottom: none;
}
.proj-meta-label {
  flex: 0 0 78px;
  font-size: 11px;
  font-family: var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  padding-top: 2px;
}
.proj-meta-value {
  flex: 1;
  font-size: 13px;
  line-height: 1.55;
  color: var(--text);
}

.proj-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 18px;
}

.stat-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 11px 8px;
  border-radius: 9px;
  background: rgba(0, 0, 0, 0.04);
  border: 1px solid rgba(0, 0, 0, 0.05);
  text-align: center;
}
.stat-card strong {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
}
.stat-card span {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.35;
}

.proj-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}

.proj-cta {
  margin-top: 6px;
  padding-top: 14px;
  border-top: 1px solid rgba(15, 23, 42, 0.08);
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 8px;
  font-size: 12px;
  line-height: 1.5;
}
.proj-cta-text {
  color: var(--muted);
}
.proj-cta-link {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
  border-bottom: 1px solid transparent;
  transition: border-color 0.15s ease;
  user-select: text;
}
.proj-cta-link:hover {
  border-bottom-color: var(--accent);
}

.tag {
  padding: 3px 11px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 500;
  background: rgba(0, 0, 0, 0.055);
  border: 1px solid rgba(0, 0, 0, 0.07);
  color: var(--muted);
}

.proj-hint {
  font-size: 12px;
  color: var(--muted);
  margin-top: 14px;
  line-height: 1.6;
}

/* ── Profile window ── */
/* ── Profile V3 ── */
.pv3-shell {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.99), rgba(250, 251, 253, 0.98));
  height: 100%;
  padding: 16px 18px 16px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.pv3-shell::-webkit-scrollbar { width: 5px; }
.pv3-shell::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.12); border-radius: 999px; }

/* Hero: larger portrait + bio */
.pv3-hero {
  display: grid;
  grid-template-columns: 100px minmax(0, 1fr);
  gap: 18px;
  align-items: center;
  padding: 10px 2px 16px;
  border-bottom: 1px solid #e8edf4;
}

.pv3-name-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 2px;
}

.pv3-hero-cta {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px 4px 8px;
  border-radius: 999px;
  background: rgba(37, 69, 221, 0.08);
  border: 1px solid rgba(37, 69, 221, 0.14);
  color: #2545dd;
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.16s, border-color 0.16s, color 0.16s;
  white-space: nowrap;
  line-height: 1.4;
}

.pv3-hero-cta:hover {
  background: rgba(37, 69, 221, 0.14);
  border-color: rgba(37, 69, 221, 0.24);
}

.pv3-hero-cta.is-playing {
  background: #2545dd;
  color: #fff;
  border-color: transparent;
}

.pv3-hero-cta-emoji {
  font-size: 11px;
  display: inline-flex;
  align-items: center;
  line-height: 1;
}

.pv3-hero-cta.is-playing .pv3-hero-cta-emoji {
  animation: pv3-cta-bounce 1.4s ease-in-out infinite;
}

@keyframes pv3-cta-bounce {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-1.5px); }
}
.pv3-photo-stage {
  width: 100px;
}
.pv3-photo-wrap {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 999px;
  overflow: hidden;
  background: linear-gradient(180deg, #eef2f7, #dfe8f2);
  box-shadow:
    0 8px 18px rgba(33, 57, 94, 0.12),
    inset 0 1px 0 rgba(255,255,255,0.7);
  border: 1px solid rgba(213, 222, 233, 0.95);
}
.pv3-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 22%;
  transform-origin: center center;
  image-rendering: -webkit-optimize-contrast;
  display: block;
}
.pv3-hero-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.pv3-name {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: #182334;
  margin-bottom: 3px;
}
.pv3-role {
  font-size: 12px;
  color: #65758c;
  margin-bottom: 8px;
}
.pv3-summary {
  display: none;
}
.pv3-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.pv3-tag {
  font-size: 10px;
  font-weight: 600;
  color: #0071e3;
  background: rgba(0,113,227,0.08);
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(0, 113, 227, 0.08);
}

/* Body: stacked content */
.pv3-layout {
  min-width: 0;
}
.pv3-main {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.pv3-section {
  border: none;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  padding: 0 2px;
}
.pv3-sec-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #9aa7b9;
  margin-bottom: 10px;
  padding-top: 2px;
}
.pv3-section + .pv3-section {
  border-top: 1px solid #e8edf4;
  padding-top: 14px;
}

/* Compact resume lists */
.pv3-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.pv3-list-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0 12px;
  align-items: start;
}
.pv3-item-year-inline {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #8fa0b5;
  line-height: 1.8;
  padding-top: 1px;
}
.pv3-item-year-inline--right {
  flex-shrink: 0;
  text-align: right;
  padding-top: 0;
  line-height: 1.4;
}
.pv3-item-year-inline--now {
  color: #0071e3;
}
.pv3-list-copy {
  min-width: 0;
}
.pv3-item-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 3px;
}
.pv3-item-name {
  font-size: 13px;
  font-weight: 700;
  color: #172334;
  margin-bottom: 0;
}
.pv3-item-name--now {
  color: #0071e3;
}
.pv3-item-role {
  margin-top: 2px;
  font-size: 10px;
  color: #8fa0b4;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.pv3-item-blurb {
  margin: 0;
  font-size: 11.5px;
  line-height: 1.5;
  color: #556375;
}
.pv3-inline-link {
  color: #0071e3;
  font-weight: 600;
  text-decoration: none;
}
.pv3-inline-link:hover {
  text-decoration: underline;
}
.pv3-meta-accent {
  color: #4a6da3;
  font-weight: 600;
}
.pv3-meta-divider {
  color: #a0acc0;
}
.pv3-edu-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0 12px;
  align-items: start;
}

@media (max-width: 900px) {
  #win-background {
    width: min(100vw - 20px, 560px);
    height: min(100vh - 88px, 580px);
  }
}

@media (max-width: 640px) {
  .pv3-shell {
    padding: 14px 14px 14px;
    gap: 12px;
  }
  .pv3-hero {
    grid-template-columns: 84px minmax(0, 1fr);
    gap: 14px;
  }
  .pv3-name {
    font-size: 17px;
  }
  .pv3-photo-stage {
    width: 84px;
  }
  .pv3-role {
    font-size: 11.5px;
    margin-bottom: 8px;
  }
  .pv3-list,
  .pv3-list--education,
  .pv3-list--experience {
    gap: 14px;
  }
  .pv3-list-item,
  .pv3-edu-item {
    grid-template-columns: minmax(0, 1fr);
    gap: 0 10px;
  }
  .pv3-item-head {
    gap: 10px;
  }
}

/* ── Playbook window ── */
.playbook-shell {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, rgba(255,255,255,0.72), rgba(244,247,255,0.9));
}

.playbook-scroll {
  flex: 1;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 22px 20px 12px;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.playbook-scroll::-webkit-scrollbar {
  display: none;
}

.playbook-intro {
  margin-bottom: 18px;
}

.playbook-heading {
  margin: 0 0 6px;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: rgba(14, 27, 52, 0.96);
}

.playbook-summary {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.55;
}

.playbook-routes {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.playbook-actions {
  flex-shrink: 0;
  padding: 14px 20px 18px;
}

/* ── Card container (accordion) ── */
.playbook-card {
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(0, 0, 0, 0.07);
  box-shadow: 0 2px 10px rgba(17, 31, 59, 0.055);
  overflow: hidden;
  transition: box-shadow 0.14s;
}
.playbook-card.is-open {
  box-shadow: 0 5px 18px rgba(17, 31, 59, 0.1);
}

/* ── Card header (clickable toggle) ── */
.playbook-card-header {
  display: flex;
  align-items: center;
  gap: 13px;
  width: 100%;
  padding: 13px 14px;
  text-align: left;
  cursor: pointer;
  transition: background 0.12s;
}
.playbook-card-header:hover {
  background: rgba(0, 0, 0, 0.02);
}

.playbook-card-emoji {
  font-size: 22px;
  line-height: 1;
  flex-shrink: 0;
}

.playbook-card-body {
  flex: 1;
  min-width: 0;
}

.playbook-card-title {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: rgba(14, 27, 52, 0.94);
  letter-spacing: -0.01em;
  margin-bottom: 3px;
}

.playbook-card-desc {
  margin: 0;
  font-size: 11.5px;
  color: var(--muted);
  line-height: 1.5;
}

.playbook-card-chevron {
  font-size: 18px;
  color: rgba(14, 27, 52, 0.25);
  flex-shrink: 0;
  transition: color 0.14s, transform 0.22s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.playbook-card:hover .playbook-card-chevron { color: rgba(14, 27, 52, 0.5); }
.playbook-card.is-open .playbook-card-chevron {
  transform: rotate(90deg);
  color: var(--accent);
}

/* ── Accordion expand area ── */
.playbook-card-steps {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.32s cubic-bezier(0.4, 0, 0.2, 1);
}

.playbook-steps-inner {
  display: flex;
  align-items: stretch;
  padding: 10px 14px 14px;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
  gap: 4px;
}

/* ── Step: horizontal column, equal width ── */
.pb-step {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 5px;
  padding: 8px 4px;
  position: relative;
}

/* Arrow connector between steps */
.pb-step:not(:last-child)::after {
  content: '→';
  position: absolute;
  right: -6px;
  top: 14px;
  font-size: 12px;
  color: rgba(0, 113, 227, 0.3);
  pointer-events: none;
}

.pb-step-num {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.pb-step-label {
  margin: 0;
  font-size: 12px;
  font-weight: 600;
  color: rgba(14, 27, 52, 0.9);
  line-height: 1.3;
}

.pb-step-btn {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 8px;
  border-radius: 5px;
  background: rgba(0, 113, 227, 0.1);
  color: var(--accent);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.12s;
  white-space: nowrap;
}
.pb-step-btn:hover { background: rgba(0, 113, 227, 0.18); }

.pb-step-hint {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 8px;
  border-radius: 5px;
  background: rgba(0, 0, 0, 0.04);
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
}

/* Primary CTA */
.playbook-cta {
  display: block;
  width: 100%;
  margin-top: 13px;
  padding: 11px 16px;
  border-radius: 11px;
  background: var(--accent);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  text-align: center;
  cursor: pointer;
  transition: background 0.14s, transform 0.11s;
  letter-spacing: -0.01em;
}
.playbook-cta:hover  { background: var(--accent-h); transform: translateY(-1px); }
.playbook-cta:active { transform: translateY(0); }

.playbook-cta-secondary {
  display: block;
  width: 100%;
  margin-top: 7px;
  padding: 9px 16px;
  border-radius: 11px;
  background: transparent;
  border: 1px solid rgba(0, 113, 227, 0.28);
  color: var(--accent);
  font-size: 12.5px;
  font-weight: 500;
  text-align: center;
  cursor: pointer;
  transition: background 0.14s, border-color 0.14s;
}
.playbook-cta-secondary:hover  { background: rgba(0, 113, 227, 0.06); border-color: rgba(0, 113, 227, 0.5); }
.playbook-cta-secondary:active { background: rgba(0, 113, 227, 0.1); }

/* Playbook window — compact */
#win-playbook {
  width: 380px;
  height: min(530px, calc(100vh - 118px));
}

/* ── Initial window positions (randomised further in JS) ── */
#win-chat        { top: 72px;  left: 50%; transform: translateX(-50%); }
#win-jobright    { top: 80px;  left: 140px; }
#win-yuanbao     { top: 96px;  left: 170px; }
#win-netease     { top: 112px; left: 200px; }
#win-background  { top: 80px;  left: 155px; }
#win-sideprojects{ top: 96px;  left: 185px; }
#win-playbook    { top: 112px; left: 210px; }

/* ══════════════════════════════════════
   DOCK
   ══════════════════════════════════════ */

.dock-shell {
  position: fixed;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 8000;
  display: flex;
  align-items: flex-end;
}

.dock {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: var(--dock-bg);
  backdrop-filter: blur(20px) saturate(190%) brightness(1.08);
  -webkit-backdrop-filter: blur(20px) saturate(190%) brightness(1.08);
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 18px;
  box-shadow:
    0 0 0 0.5px rgba(0, 0, 0, 0.12),
    0 8px 28px rgba(0, 0, 0, 0.38),
    inset 0 1px 0 rgba(255, 255, 255, 0.22);
}

.dock-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  cursor: pointer;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}

/* Icon image — all icons share the same rounded-square base */
.dock-img {
  width: var(--icon-base);
  height: var(--icon-base);
  border-radius: 16px;
  display: grid;
  place-items: center;
  padding: 0;
  transform-origin: bottom center;
  position: relative;
  z-index: 1;
  box-shadow:
    0 2px 8px  rgba(0, 0, 0, 0.22),
    0 1px 2px  rgba(0, 0, 0, 0.10);
  /* No transition — magnification removed, tooltip only */
}
.dock-img.has-image {
  background: transparent;
  box-shadow: none;
}
.dock-img.has-image .dock-img-photo {
  width: 100%;
  height: 100%;
  margin: 0;
  object-fit: contain;
  display: block;
  border-radius: 0;
}

/* Photo/Memoji dock icon */
.dock-memoji {
  background: #ffffff;
  overflow: hidden;
  padding: 0;
  box-shadow:
    0 2px 8px rgba(0, 0, 0, 0.22),
    0 1px 2px rgba(0, 0, 0, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.92);
}
.dock-memoji .dock-img-photo {
  width: 100%;
  height: 100%;
  margin: 0;
  object-fit: contain;
  display: block;
  border-radius: 0;
  background: #ffffff;
  transform: scale(1.12);
  transform-origin: center;
}
.dock-img-photo {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  border-radius: 0;
}

/* Emoji icons: white square background, consistent with styled icons */
.dock-emoji {
  background: #ffffff;
  font-size: 32px;
  line-height: 1;
  box-shadow:
    0 2px 8px  rgba(0, 0, 0, 0.18),
    0 1px 2px  rgba(0, 0, 0, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.95);
}

/* Styled (text-label) icons */
.dock-app {
  display: grid;
  place-items: center;
  font-size: 18px;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.02em;
  line-height: 1;
  box-shadow:
    0 2px 10px rgba(0, 0, 0, 0.25),
    inset 0 1px 0 rgba(255, 255, 255, 0.18);
  font-family: var(--font);
}
.dock-linkedin  { background: linear-gradient(180deg, #0a84c4, #005f8e); font-size: 18px; }
.dock-rednote   { background: linear-gradient(180deg, #f04040, #c01818); font-size: 15px; }
.dock-music     { background: linear-gradient(145deg, #2c1060, #6a20c8); }
.dock-xyzhu     { background: linear-gradient(145deg, #0e1230, #1a2060); font-size: 26px; }

/* Dot indicator (app is open) — absolutely positioned so it never adds height */
.dock-dot {
  position: absolute;
  bottom: -6px;
  left: 50%;
  transform: translateX(-50%);
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.45);
  opacity: 0;
  transition: opacity 0.2s;
  pointer-events: none;
}
.dock-dot.visible { opacity: 1; }

/* Tooltip */
.dock-tooltip {
  position: absolute;
  bottom: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  background: rgba(28, 28, 30, 0.88);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: rgba(255,255,255,0.92);
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  padding: 4px 10px;
  border-radius: 7px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s, transform 0.15s;
  z-index: 9999;
}
.dock-item:hover .dock-tooltip {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* Separator */
.dock-sep {
  width: 1px;
  height: 38px;
  background: rgba(255, 255, 255, 0.22);
  margin: 0 5px;
  align-self: center;
  flex-shrink: 0;
  border-radius: 1px;
}

/* Subtle press feedback only — no magnification */
.dock-item:active .dock-img {
  opacity: 0.78;
  transform: scale(0.94);
  transition: transform 0.08s ease, opacity 0.08s ease;
}

/* ══════════════════════════════════════
   MUSIC PLAYER — iOS-style, centered column
   ══════════════════════════════════════ */

:root {
  --player-art-size: 232px;
}

#win-player {
  width: 580px;
  height: min(548px, calc(100vh - 160px));
  background: rgba(247, 249, 255, 0.68) !important;
  border: 1px solid rgba(255, 255, 255, 0.82) !important;
}

#win-player .win-titlebar {
  background: rgba(255, 255, 255, 0.56);
  border-bottom: 1px solid rgba(0, 0, 0, 0.055);
}

.player-body {
  padding: 0;
  overflow: hidden;
  background: transparent;
}

.player-layout {
  display: grid;
  grid-template-columns: 1fr 0;           /* playlist hidden by default */
  height: 100%;
  min-height: 0;
  transition: grid-template-columns 0.38s cubic-bezier(0.32, 0.72, 0, 1);
}

.player-layout.show-queue {
  grid-template-columns: 1fr 192px;
}

/* ── Left stage: everything centered around artwork width ── */
.player-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 0;
  padding: 20px 16px;
  background: transparent;
}

/* Order: art (1) → info (2) → controls (3) */
.player-art-shell {
  order: 1;
  flex-shrink: 0;
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.player-stage-top {
  order: 2;
  flex-shrink: 0;
  width: var(--player-art-size);
  margin-bottom: 16px;
  position: relative;
}

.player-controls-card {
  order: 3;
  flex-shrink: 0;
  width: var(--player-art-size);  /* exact same width as artwork */
  padding: 0;
  background: none;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border-radius: 0;
}

/* ── Artwork ── */
.player-art {
  width: var(--player-art-size);
  height: var(--player-art-size);
  border-radius: 16px;
  overflow: hidden;
  flex-shrink: 0;
  box-shadow:
    0 22px 52px rgba(60, 70, 110, 0.22),
    0 6px 18px rgba(20, 27, 45, 0.12),
    0 0 0 0.5px rgba(0, 0, 0, 0.08);
}

.player-art-inner {
  width: 100%;
  height: 100%;
  background: linear-gradient(145deg, #202331, #111827);
  display: grid;
  place-items: center;
  position: relative;
  transition: background 0.45s ease;
}

.art-cover-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.35s ease;
}

.art-cover-img.loaded { opacity: 1; }
.art-fallback { transition: opacity 0.3s ease; }
.art-cover-img.loaded ~ .art-fallback { opacity: 0; pointer-events: none; }
.art-music-icon { opacity: 0.88; }

/* ── Track info (same width as artwork) ── */
.player-stage-copy {
  width: 100%;
  min-width: 0;
}

.player-app-label { display: none; }  /* removed — too noisy */

.player-track-title {
  font-size: 16px;
  line-height: 1.3;
  font-weight: 700;
  letter-spacing: -0.018em;
  color: rgba(10, 12, 22, 0.97);
  margin-bottom: 3px;
  padding-right: 38px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.player-track-artist {
  font-size: 13px;
  font-weight: 500;
  color: rgba(70, 80, 108, 0.92);
  padding-right: 38px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Note bubble: avatar + annotation */
.player-note-bubble {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  margin-top: 12px;
  padding: 8px 10px 8px 8px;
  background: rgba(255, 255, 255, 0.74);
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 12px;
  box-sizing: border-box;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 2px 10px rgba(60, 70, 110, 0.07);
  transition: opacity 0.28s ease;
}

.player-note-bubble.is-fading { opacity: 0; }
.player-note-bubble[hidden]   { display: none !important; }

.player-note-avatar {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.14);
}

.player-track-note {
  font-size: 12px;
  line-height: 1.55;
  color: rgba(35, 45, 75, 0.84);
  white-space: nowrap;
  overflow: hidden;    /* clip boundary — text disappears here, right at avatar edge */
  min-width: 0;
  flex: 1;
}

/* Marquee span: padding-left pushes text to start from the right edge of the container */
.player-track-note span {
  display: inline-block;
  padding-left: 100%;
  white-space: nowrap;
  animation: note-marquee 14s linear infinite;
}

@keyframes note-marquee {
  from { transform: translateX(0); }     /* text at right edge, about to enter */
  to   { transform: translateX(-100%); } /* text fully exits off left */
}

/* ── Controls (same width as artwork, no card) ── */
.player-seek {
  margin-bottom: 10px;
}

.player-progress-bar {
  width: 100%;
  height: 5px;
  background: rgba(26, 33, 52, 0.10);
  border-radius: 999px;
  position: relative;
  cursor: pointer;
  margin-bottom: 5px;
  transform: scaleY(0.6);
  transform-origin: center;
  transition: transform 0.15s ease;
  touch-action: none;
}

.player-progress-bar:hover,
.player-progress-bar.is-seeking {
  transform: scaleY(1);
}

.player-progress-fill {
  height: 100%;
  border-radius: 999px;
  background: rgba(245, 60, 104, 0.85);
  width: 0%;
  pointer-events: none;
  transition: width 0.25s linear;
  position: relative;
}

.player-progress-bar.is-seeking .player-progress-fill {
  transition: none;
}

/* Thumb handle */
.player-progress-fill::after {
  content: '';
  position: absolute;
  right: -5px;
  top: 50%;
  transform: translateY(-50%);
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.28);
  opacity: 0;
  transition: opacity 0.15s;
}

.player-progress-bar:hover .player-progress-fill::after,
.player-progress-bar.is-seeking .player-progress-fill::after {
  opacity: 1;
}

.player-times {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  font-family: var(--mono);
  color: rgba(80, 90, 115, 0.38);
  letter-spacing: 0.01em;
}

.player-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;  /* space buttons evenly across artwork width */
  margin-bottom: 12px;
}

.player-btn {
  display: grid;
  place-items: center;
  color: rgba(20, 26, 46, 0.65);
  border-radius: 50%;
  transition: opacity 0.12s, transform 0.1s;
}

.player-btn:hover  { opacity: 0.6; }
.player-btn:active { transform: scale(0.88); opacity: 0.4; }

.player-btn-play {
  width: 46px;
  height: 46px;
  background: rgba(10, 12, 22, 0.88);
  color: #ffffff;
  border-radius: 50%;
  box-shadow: 0 6px 18px rgba(10, 12, 22, 0.22);
}

.player-btn-play:hover {
  background: rgba(10, 12, 22, 0.78);
}

/* Bottom row: volume slider + queue toggle */
.player-bottom-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.player-volume-row {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 7px;
}

.player-vol-icon {
  font-size: 11px;
  opacity: 0.3;
  flex-shrink: 0;
}

/* Queue toggle button */
.player-queue-toggle {
  position: absolute;
  top: 2px;
  right: 0;
  width: 26px;
  height: 26px;
  border-radius: 7px;
  background: rgba(20, 26, 46, 0.07);
  color: rgba(20, 26, 46, 0.42);
  display: grid;
  place-items: center;
  transition: background 0.14s, color 0.14s;
}

.player-queue-toggle:hover {
  background: rgba(20, 26, 46, 0.11);
  color: rgba(20, 26, 46, 0.65);
}

.player-queue-toggle.active {
  background: rgba(20, 26, 46, 0.13);
  color: rgba(20, 26, 46, 0.82);
}

.player-volume-slider {
  flex: 1;
  -webkit-appearance: none;
  appearance: none;
  height: 3px;
  background: rgba(26, 33, 52, 0.10);
  border-radius: 999px;
  outline: none;
  cursor: pointer;
}

.player-volume-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: rgba(20, 26, 46, 0.45);
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}

/* ── Right playlist panel ── */
.player-queue {
  display: flex;
  flex-direction: column;
  min-height: 0;
  min-width: 0;
  overflow: hidden;
  padding: 16px 10px 12px;
  background: rgba(255, 255, 255, 0.18);
  border-left: 1px solid rgba(0, 0, 0, 0.07);
  opacity: 0;
  transition: opacity 0.22s ease 0.18s;   /* fade in after slide starts */
}

.player-layout.show-queue .player-queue {
  opacity: 1;
}

.player-queue-head {
  flex-shrink: 0;
  padding: 0 4px 10px;
  margin-bottom: 4px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.055);
}

.player-queue-kicker {
  display: none;   /* removed "Up Next" label */
}

.player-queue-title {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: rgba(22, 29, 46, 0.68);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 10px;
}

.player-tracklist {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 4px 0;
}

.player-tracklist::-webkit-scrollbar { width: 0; }

.player-track-item {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 4px 8px 4px 6px;
  border-radius: 10px;
  text-align: left;
  transition: background 0.12s;
  cursor: pointer;
}

.player-track-item:not(.active):hover {
  background: rgba(255, 255, 255, 0.82);
}

.player-track-item.active {
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 2px 10px rgba(80, 90, 130, 0.08);
}

.player-track-thumb {
  width: 36px;
  height: 36px;
  border-radius: 7px;
  overflow: hidden;
  flex-shrink: 0;
  background: linear-gradient(145deg, #202331, #111827);
  box-shadow: 0 2px 6px rgba(30, 41, 59, 0.14);
}

.player-track-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.player-track-thumb-fallback {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  color: rgba(255,255,255,0.6);
  font-size: 14px;
}

.player-track-copy {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.player-track-name {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: rgba(15, 20, 38, 0.94);
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.player-track-artist-name {
  display: block;
  font-size: 10.5px;
  font-weight: 400;
  color: rgba(70, 80, 110, 0.76);
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.player-track-index { display: none; }  /* removed track numbers — less noise */

.player-track-item.active .player-track-name {
  color: rgba(245, 60, 104, 0.92);
}

/* ── Menu bar mini player ── */
.menubar-player {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-right: 4px;
}
.menubar-player[hidden] { display: none !important; }

.mb-ctrl {
  width: 24px;
  height: var(--menubar-h);
  display: grid;
  place-items: center;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.88);
  border-radius: 4px;
  transition: background 0.12s;
  flex-shrink: 0;
}
.mb-ctrl:hover { background: rgba(255, 255, 255, 0.12); }

.mb-song {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.55);
  max-width: 160px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 0 4px;
}

/* ══════════════════════════════════════
   RECORDING / VOICE MEMO WINDOW
   ══════════════════════════════════════ */

.win-recording {
  width: 340px;
  height: 232px;
  background: linear-gradient(150deg, #1e2030, #252840) !important;
  border: 1px solid rgba(255, 255, 255, 0.09) !important;
  box-shadow:
    0 0 0 0.5px rgba(0, 0, 0, 0.5),
    0 12px 32px rgba(0, 0, 0, 0.38),
    0 32px 72px rgba(0, 0, 0, 0.28) !important;
}

.win-recording .win-titlebar {
  background: rgba(255, 255, 255, 0.04);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.win-recording .win-title {
  color: rgba(255, 255, 255, 0.55);
}

.rec-body {
  display: flex;
  flex-direction: column;
  padding: 18px 20px 16px;
  gap: 12px;
  flex: 1;
  min-height: 0;
  background: transparent;
}

.rec-meta {
  flex-shrink: 0;
  position: relative;
  padding-right: 54px;
}

.rec-label {
  font-size: 10px;
  color: rgba(255, 255, 255, 0.28);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 3px;
}

.rec-headline {
  display: block;
}

.rec-title {
  font-size: 17px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.88);
  letter-spacing: -0.022em;
  margin: 0;
  flex: 1;
  min-width: 0;
}

/* Waveform */
.rec-wave {
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2.5px;
  overflow: hidden;
}

.rec-bar {
  width: 2.5px;
  border-radius: 2px;
  background: rgba(196, 218, 255, 0.18);
  flex-shrink: 0;
  transform-origin: center;
  transition: background 0.4s ease, box-shadow 0.4s ease, opacity 0.4s ease;
}

.rec-body.is-playing .rec-bar {
  background: linear-gradient(180deg, rgba(242, 248, 255, 0.92), rgba(124, 174, 255, 0.9));
  box-shadow: 0 0 12px rgba(112, 169, 255, 0.22);
  animation: rec-wave-bounce var(--dur, 0.7s) ease-in-out infinite alternate;
}

@keyframes rec-wave-bounce {
  from { transform: scaleY(0.35); }
  to   { transform: scaleY(1);    }
}

.rec-footer {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.rec-progress-bar {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.10);
  border-radius: 999px;
  cursor: pointer;
  position: relative;
  transform: scaleY(0.6667);
  transform-origin: center;
  transition: transform 0.15s ease;
  touch-action: none;
}

.rec-progress-bar:hover,
.rec-progress-bar.is-seeking {
  transform: scaleY(1);
}

.rec-progress-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(241, 247, 255, 0.95), rgba(122, 173, 255, 0.98));
  width: 0%;
  pointer-events: none;
  transition: width 0.25s linear;
  box-shadow: 0 0 16px rgba(120, 170, 255, 0.28);
  position: relative;
}

.rec-progress-bar.is-seeking .rec-progress-fill {
  transition: none;
}

/* Thumb handle */
.rec-progress-fill::after {
  content: '';
  position: absolute;
  right: -6px;
  top: 50%;
  transform: translateY(-50%);
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.35);
  opacity: 0;
  transition: opacity 0.15s;
}

.rec-progress-bar:hover .rec-progress-fill::after,
.rec-progress-bar.is-seeking .rec-progress-fill::after {
  opacity: 1;
}

.rec-times {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  font-family: var(--mono);
  color: rgba(255, 255, 255, 0.26);
  letter-spacing: 0.01em;
}

.rec-play-btn {
  position: absolute;
  top: 0;
  right: 0;
  flex-shrink: 0;
  width: 38px;
  height: 38px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(251, 253, 255, 0.96), rgba(194, 220, 255, 0.92));
  color: #14213d;
  border: 1px solid rgba(255, 255, 255, 0.34);
  display: grid;
  place-items: center;
  box-shadow:
    0 10px 24px rgba(0, 0, 0, 0.28),
    0 0 0 1px rgba(114, 160, 245, 0.12);
  transition: background 0.12s, transform 0.1s, box-shadow 0.18s ease;
}

.rec-play-btn:hover  {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(215, 233, 255, 0.96));
  box-shadow:
    0 12px 28px rgba(0, 0, 0, 0.32),
    0 0 0 1px rgba(145, 189, 255, 0.18);
}
.rec-play-btn:active { transform: scale(0.91); }

/* ══════════════════════════════════════
   NOTES WINDOW
   ══════════════════════════════════════ */

.win-notes { width: 620px; height: min(460px, calc(100vh - 160px)); }

.notes-body {
  flex-direction: row;
  overflow: hidden;
}

/* ── Sidebar ── */
.notes-sidebar {
  width: 196px;
  flex-shrink: 0;
  background: #f5f5f2;
  border-right: 1px solid rgba(0, 0, 0, 0.09);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  padding: 6px 0 8px;
}
.notes-sidebar::-webkit-scrollbar { width: 0; }

.notes-list-item {
  padding: 7px 10px;
  cursor: pointer;
  border-radius: 8px;
  margin: 1px 6px;
  transition: background 0.12s;
  text-align: left;
  display: block;
  width: calc(100% - 12px);
  border: none;
  background: none;
}
.notes-list-item:hover { background: rgba(0,0,0,0.055); }
.notes-list-item.active {
  background: rgba(255, 196, 0, 0.30);
}

/* ══════════════════════════════════════
   PHOTOS WINDOW
   ══════════════════════════════════════ */

.win-photos {
  width: 720px;
  height: min(480px, calc(100vh - 160px));
}

.photos-body {
  display: flex;
  flex-direction: row;
  overflow: hidden;
  background: var(--win-bg);
}

.photos-sidebar {
  width: 168px;
  flex-shrink: 0;
  padding: 14px 10px;
  background: rgba(244, 244, 248, 0.82);
  border-right: 1px solid rgba(0, 0, 0, 0.07);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.photos-section-label {
  margin: 6px 8px 6px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(60, 60, 67, 0.44);
}

.photos-section-label:first-child { margin-top: 0; }

.photos-nav-item {
  width: 100%;
  padding: 7px 10px;
  border-radius: 7px;
  text-align: left;
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  transition: background 0.14s;
}

.photos-nav-item + .photos-nav-item {
  margin-top: 2px;
}

.photos-nav-item:hover {
  background: rgba(0, 0, 0, 0.06);
}

.photos-nav-item.active {
  background: rgba(0, 113, 227, 0.1);
  color: var(--accent);
  font-weight: 600;
}

.photos-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.photos-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 14px 18px 12px;
  flex-shrink: 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.photos-header-left {
  display: flex;
  align-items: baseline;
  gap: 10px;
  min-width: 0;
}

.photos-header-title {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
}

.photos-header-count {
  font-size: 12px;
  color: var(--muted);
}

.photos-arrows {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.photos-arrow {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.04);
  border: 1px solid rgba(0, 0, 0, 0.08);
  color: rgba(60, 60, 67, 0.75);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.16s, border-color 0.16s, color 0.16s, transform 0.16s;
}

.photos-arrow:hover {
  background: rgba(0, 0, 0, 0.08);
  border-color: rgba(0, 0, 0, 0.14);
  color: var(--text);
}

.photos-arrow:disabled {
  opacity: 0.35;
  cursor: default;
}

.photos-arrow svg {
  width: 12px;
  height: 12px;
}

/* ═══════════════════════════════════════
   PHOTO REEL — horizontal scroll-snap
   ═══════════════════════════════════════ */
.photos-reel {
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  gap: 18px;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  padding: 18px calc(50% - 132px);
  scrollbar-width: none;
  cursor: grab;
}
.photos-reel.is-dragging {
  scroll-snap-type: none;
  scroll-behavior: auto;
  cursor: grabbing;
}
.photos-reel::-webkit-scrollbar { display: none; }

.photos-reel-card {
  flex: 0 0 264px;
  max-width: 264px;
  aspect-ratio: 3 / 4;
  border-radius: 12px;
  overflow: hidden;
  scroll-snap-align: center;
  position: relative;
  user-select: none;
  -webkit-user-drag: none;
  background: rgba(0, 0, 0, 0.04);
  border: 1px solid rgba(0, 0, 0, 0.06);
  box-shadow: 0 10px 28px -20px rgba(0, 0, 0, 0.25);
  transition: transform 0.45s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.45s ease;
  transform: scale(0.9);
  opacity: 0.42;
  cursor: pointer;
}

.photos-reel-card.is-active {
  transform: scale(1);
  opacity: 1;
  box-shadow: 0 16px 36px -22px rgba(0, 0, 0, 0.32);
}

.photos-reel-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.photos-reel-card-caption {
  position: absolute;
  left: 14px;
  bottom: 14px;
  display: flex;
  flex-direction: column;
  gap: 1px;
  color: #fff;
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.55);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.4s ease 0.1s;
}

.photos-reel-card.is-active .photos-reel-card-caption {
  opacity: 1;
}

.photos-reel-card-year {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.22em;
  opacity: 0.85;
}

.photos-reel-card-season {
  font-size: 17px;
  font-weight: 300;
  font-style: italic;
  letter-spacing: -0.01em;
}

/* Footer — meta + progress dots */
.photos-reel-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 18px 14px;
  flex-shrink: 0;
  gap: 16px;
  border-top: 1px solid rgba(0, 0, 0, 0.04);
}

.photos-meta {
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.02em;
}

.photos-progress {
  display: flex;
  gap: 6px;
  align-items: center;
}

.photos-progress-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.16);
  transition: all 0.35s ease;
  cursor: pointer;
  border: none;
  padding: 0;
}

.photos-progress-dot.is-active {
  background: var(--accent);
  width: 18px;
  border-radius: 3px;
}

/* Lightbox */
.photo-lightbox {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.82);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
  border-radius: var(--win-r);
  animation: win-in 0.18s ease both;
}

.photo-lightbox[hidden] { display: none !important; }

.photo-lightbox-close {
  position: absolute;
  top: 12px;
  right: 14px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(255,255,255,0.14);
  color: rgba(255,255,255,0.8);
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.14s;
}

.photo-lightbox-close:hover { background: rgba(255,255,255,0.24); }

.photo-lightbox-inner {
  width: 80%;
  max-height: 80%;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 24px 60px rgba(0,0,0,0.5);
}

.photo-lightbox-inner > * {
  width: 100%;
  height: 100%;
  display: block;
  aspect-ratio: 4/3;
}

/* ══════════════════════════════════════
   TERMINAL WINDOW
   ══════════════════════════════════════ */

.win-terminal {
  width: 700px;
  height: min(440px, calc(100vh - 160px));
  background: linear-gradient(180deg, rgba(15, 20, 29, 0.98), rgba(8, 12, 19, 0.96)) !important;
  border: 1px solid rgba(151, 180, 255, 0.12) !important;
  box-shadow:
    0 0 0 0.5px rgba(255, 255, 255, 0.04),
    0 22px 60px rgba(0, 0, 0, 0.44),
    0 42px 100px rgba(0, 8, 20, 0.42) !important;
}

.terminal-titlebar {
  background: linear-gradient(180deg, rgba(36, 41, 54, 0.94), rgba(24, 28, 40, 0.92));
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.win-terminal .win-title {
  color: rgba(236, 244, 255, 0.74);
}

.terminal-body {
  display: flex;
  flex-direction: column;
  padding: 16px 18px 18px;
  gap: 12px;
  background:
    radial-gradient(circle at top right, rgba(62, 115, 255, 0.12), transparent 26%),
    linear-gradient(180deg, rgba(11, 16, 24, 0.98), rgba(7, 11, 17, 0.98));
}

.terminal-toolbar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.terminal-pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.07);
  color: rgba(225, 236, 255, 0.76);
  font-size: 11px;
  font-family: var(--mono);
}

.terminal-pill-muted {
  color: rgba(175, 194, 227, 0.52);
}

.terminal-pill-active {
  background: rgba(73, 119, 226, 0.20);
  border-color: rgba(120, 165, 255, 0.22);
  color: rgba(232, 243, 255, 0.92);
}

.terminal-screen {
  flex: 1;
  min-height: 0;
  padding: 16px 18px 14px;
  overflow-y: auto;
  border-radius: 14px;
  background:
    linear-gradient(180deg, rgba(8, 12, 18, 0.92), rgba(4, 8, 13, 0.96)),
    radial-gradient(circle at top left, rgba(105, 162, 255, 0.08), transparent 28%);
  border: 1px solid rgba(126, 153, 208, 0.10);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    inset 0 0 0 1px rgba(20, 33, 58, 0.32);
  font-family: var(--mono);
  cursor: text;
  display: flex;
  flex-direction: column;
}

.terminal-screen::-webkit-scrollbar {
  width: 8px;
}

.terminal-screen::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(112, 139, 186, 0.2);
}

.terminal-line {
  font-size: 13px;
  line-height: 1.7;
  color: rgba(208, 229, 255, 0.88);
  white-space: pre-wrap;
}

.terminal-line + .terminal-line {
  margin-top: 4px;
}

.terminal-line-dim {
  color: rgba(145, 167, 204, 0.52);
}

.terminal-line-output {
  color: rgba(172, 223, 198, 0.92);
}

.terminal-line-accent {
  color: rgba(146, 195, 255, 0.96);
}

.terminal-line-live {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  margin-top: auto;
  padding-top: 4px;
}

.terminal-prompt {
  color: rgba(124, 177, 255, 0.94);
  flex-shrink: 0;
}

.terminal-typed {
  color: rgba(246, 249, 255, 0.92);
  white-space: pre;
}

.terminal-command {
  color: rgba(246, 249, 255, 0.92);
}

.terminal-cursor {
  display: inline-block;
  width: 8px;
  height: 16px;
  margin-left: 2px;
  border-radius: 2px;
  background: rgba(120, 179, 255, 0.94);
  box-shadow: 0 0 10px rgba(115, 176, 255, 0.3);
  animation: terminal-cursor-blink 1.1s steps(1) infinite;
  flex-shrink: 0;
  vertical-align: text-bottom;
}

@keyframes terminal-cursor-blink {
  0%, 48% { opacity: 1; }
  50%, 100% { opacity: 0; }
}

/* Hidden real input that captures keystrokes */
.terminal-input-hidden {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  padding: 0;
  border: 0;
  top: -200px;
  left: -200px;
  pointer-events: none;
}

#terminal-output {
  display: flex;
  flex-direction: column;
}

/* Terminal output line types */
.terminal-line-error {
  color: rgba(255, 120, 100, 0.92);
}

.terminal-line-warn {
  color: rgba(255, 215, 100, 0.88);
}

.terminal-line-blank {
  height: 0.6em;
}

.terminal-line-box {
  color: rgba(100, 180, 255, 0.9);
  font-family: var(--mono);
}

.terminal-link {
  color: rgba(150, 199, 255, 0.98);
  text-decoration: none;
  border-bottom: 1px solid rgba(150, 199, 255, 0.32);
}

.terminal-link:hover {
  color: rgba(230, 242, 255, 0.98);
  border-bottom-color: rgba(230, 242, 255, 0.6);
}

.terminal-action-btn {
  appearance: none;
  border: 1px solid rgba(120, 170, 255, 0.22);
  background: rgba(120, 170, 255, 0.08);
  color: rgba(210, 231, 255, 0.94);
  font: inherit;
  font-size: 12px;
  line-height: 1.2;
  padding: 4px 10px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.terminal-action-btn:hover {
  background: rgba(120, 170, 255, 0.14);
  border-color: rgba(120, 170, 255, 0.34);
  transform: translateY(-1px);
}

.notes-item-title {
  font-size: 13px;
  font-weight: 600;
  color: #1d1d1f;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 2px;
  line-height: 1.35;
}

.notes-item-preview {
  font-size: 11px;
  color: #8e8e93;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
  line-height: 1.4;
}

/* ── Main content ── */
.notes-main {
  flex: 1;
  overflow-y: auto;
  padding: 18px 28px 28px;
  background: #ffffff;
  line-height: 1.6;
}
.notes-main::-webkit-scrollbar { width: 4px; }
.notes-main::-webkit-scrollbar-thumb {
  background: rgba(0,0,0,0.10);
  border-radius: 2px;
}

.notes-content-datetime {
  text-align: center;
  font-size: 11px;
  color: #8e8e93;
  margin-bottom: 14px;
  line-height: 1.4;
}

.notes-content-title {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.022em;
  color: #1d1d1f;
  margin-bottom: 10px;
  line-height: 1.25;
}

.notes-content-body {
  font-size: 13.5px;
  line-height: 1.68;
  color: #1d1d1f;
}

.notes-content-body p {
  margin-bottom: 12px;
}
.notes-content-body p:last-child { margin-bottom: 0; }
.notes-content-body h2,
.notes-content-body h3,
.notes-content-body h4 {
  color: #1d1d1f;
  letter-spacing: -0.02em;
  line-height: 1.3;
  margin: 18px 0 8px;
}
.notes-content-body h2 { font-size: 18px; font-weight: 750; }
.notes-content-body h3 { font-size: 15px; font-weight: 720; }
.notes-content-body h4 { font-size: 13.5px; font-weight: 700; }
.notes-content-body strong {
  font-weight: 750;
  color: #111113;
}
.notes-content-body em {
  font-style: normal;
  color: #5a5a60;
}
.notes-content-body ul,
.notes-content-body ol {
  margin: 10px 0 14px 18px;
  padding: 0;
}
.notes-content-body li {
  margin-bottom: 7px;
  padding-left: 2px;
}
.notes-content-body hr {
  border: 0;
  border-top: 1px solid rgba(0,0,0,0.08);
  margin: 18px 0;
}
.notes-content-body code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 12px;
  background: rgba(0, 0, 0, 0.045);
  padding: 1px 5px;
  border-radius: 6px;
}
.notes-content-body pre {
  margin: 12px 0 16px;
  padding: 12px 14px;
  background: #f5f5f7;
  border-radius: 12px;
  overflow-x: auto;
}
.notes-content-body pre code {
  background: transparent;
  padding: 0;
  border-radius: 0;
}

/* ── Notes dock icon ── */
.dock-notes {
  background: linear-gradient(160deg, #fff8a8 0%, #ffd200 100%);
  position: relative;
  overflow: visible;
}
.dock-notes::before {
  content: '';
  position: absolute;
  inset: 8px 10px 10px;
  background-image: repeating-linear-gradient(
    to bottom,
    transparent,
    transparent 7px,
    rgba(100,80,0,0.14) 7px,
    rgba(100,80,0,0.14) 8px
  );
  border-radius: 2px;
  pointer-events: none;
}

/* ══════════════════════════════════════
   PROJECTS / FINDER WINDOW
   ══════════════════════════════════════ */

.win-finder { width: 700px; height: min(470px, calc(100vh - 160px)); }

.finder-body {
  flex-direction: row;
  overflow: hidden;
}

/* ── Sidebar ── */
.finder-sidebar {
  width: 176px;
  flex-shrink: 0;
  background:
    linear-gradient(180deg, rgba(245, 246, 249, 0.96), rgba(235, 237, 242, 0.96));
  border-right: 1px solid rgba(15, 23, 42, 0.08);
  display: flex;
  flex-direction: column;
  padding: 10px 0 8px;
  overflow-y: auto;
}
.finder-sidebar::-webkit-scrollbar { width: 0; }

.finder-section-label {
  font-size: 11px;
  font-weight: 700;
  color: #6e6e73;
  letter-spacing: 0.055em;
  text-transform: uppercase;
  padding: 4px 14px 5px;
  flex-shrink: 0;
}

.finder-item {
  display: flex;
  align-items: center;
  gap: 7px;
  width: calc(100% - 10px);
  margin: 1px 5px;
  padding: 5px 10px;
  border-radius: 6px;
  font-size: 13px;
  color: #1d1d1f;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: background 0.1s, color 0.1s;
  flex-shrink: 0;
}
.finder-item:hover { background: rgba(255, 255, 255, 0.62); }
.finder-item.active {
  background: linear-gradient(180deg, #1683ff, #0071e3);
  color: #ffffff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.28);
}

.finder-item-icon {
  font-size: 15px;
  line-height: 1;
  flex-shrink: 0;
}
.finder-item-icon.is-image {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
}
.finder-item-icon-img {
  width: 22px;
  height: 22px;
  object-fit: contain;
  display: block;
}

.finder-item-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ── Main content ── */
.finder-main {
  flex: 1;
  overflow-y: auto;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.97), rgba(250, 251, 253, 0.97));
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.finder-main::-webkit-scrollbar { width: 4px; }
.finder-main::-webkit-scrollbar-thumb {
  background: rgba(0,0,0,0.1);
  border-radius: 2px;
}

/* Override proj-content inside finder so it doesn't try to flex-grow */
.finder-main .proj-body { overflow: visible; flex: none; }
.finder-main .proj-content { flex: none; overflow: visible; }

/* ── Side Projects ("AI 玩起来") ── */
.sp-shell {
  padding: 18px 20px 22px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.sp-intro {
  font-size: 12px;
  color: #6e6e73;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
}
.sp-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}
.sp-card {
  background: #fff;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 10px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.sp-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.1);
}
.sp-thumb {
  aspect-ratio: 16 / 8;
  background: #f5f5f7;
  overflow: hidden;
  display: grid;
  place-items: center;
}
.sp-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.sp-content {
  padding: 10px 12px 12px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  flex: 1;
  border-top: 1px solid rgba(15, 23, 42, 0.06);
}
.sp-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
}
.sp-title {
  font-size: 13.5px;
  font-weight: 700;
  color: #1d1d1f;
  letter-spacing: -0.01em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sp-date {
  font-family: "SF Mono", "Menlo", "Monaco", "Courier New", monospace;
  font-size: 10px;
  color: #6e6e73;
  flex-shrink: 0;
  letter-spacing: 0.02em;
}
.sp-tagline {
  font-size: 12px;
  color: #48484c;
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex: 1;
}
.sp-links {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  font-size: 11px;
}
.sp-links a:not(.sp-xhs) {
  color: #0071e3;
  text-decoration: none;
  font-weight: 500;
  padding: 2.5px 9px;
  border-radius: 999px;
  background: rgba(0, 113, 227, 0.08);
}
.sp-links a:not(.sp-xhs):hover {
  background: rgba(0, 113, 227, 0.15);
}
.sp-xhs {
  margin-left: auto;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #FF2442;
  color: #fff !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  line-height: 1;
  text-decoration: none;
  box-shadow: 0 2px 6px rgba(255, 36, 66, 0.25);
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.sp-xhs:hover {
  background: #e01c38;
  transform: translateY(-1px) scale(1.08);
  box-shadow: 0 4px 10px rgba(255, 36, 66, 0.35);
}

@media (max-width: 560px) {
  .sp-grid { grid-template-columns: 1fr; }
}

/* ══════════════════════════════════════
   BROWSER / QUIZ WINDOW
   ══════════════════════════════════════ */

.win-browser { width: 390px; height: min(760px, calc(100vh - 120px)); }

.browser-titlebar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 12px;
  height: 44px;
  flex-shrink: 0;
}

.browser-urlbar {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.browser-url {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(0,0,0,0.07);
  border-radius: 8px;
  padding: 5px 14px;
  font-size: 12px;
  color: #3c3c43;
  max-width: 320px;
  width: 100%;
  justify-content: center;
}

.browser-url-lock {
  font-size: 11px;
  opacity: 0.55;
}

.browser-url-text {
  font-weight: 500;
  opacity: 0.72;
}

.browser-spacer {
  /* mirrors traffic-lights width so url-bar is truly centered */
  width: 52px;
  flex-shrink: 0;
}

.browser-iframe {
  width: 100%;
  flex: 1;
  border: none;
  display: block;
  border-bottom-left-radius: 10px;
  border-bottom-right-radius: 10px;
  overflow: hidden;
}

/* ══════════════════════════════════════
   UTILITY
   ══════════════════════════════════════ */

/* Prevent text selection while dragging */
body.dragging * { user-select: none; cursor: move !important; }
body.dragging-desktop-icon * { user-select: none; }

/* ══════════════════════════════════════
   STICKER
   ══════════════════════════════════════ */

.sticker {
  position: absolute;
  width: 224px;
  background: #FFFDE7;
  box-shadow: 2px 6px 20px rgba(0, 0, 0, 0.22), 0 1px 3px rgba(0, 0, 0, 0.10);
  display: flex;
  flex-direction: column;
  border-radius: 2px;
}

.sticker-header {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 10px 5px 8px;
  background: rgba(0, 0, 0, 0.03);
  border-radius: 2px 2px 0 0;
  cursor: grab;
  flex-shrink: 0;
}

.sticker-header:active { cursor: grabbing; }

.sticker-label {
  font-family: var(--font);
  font-size: 11px;
  font-weight: 500;
  color: rgba(60, 40, 0, 0.35);
  letter-spacing: 0.02em;
  pointer-events: none;
  flex: 1;
  text-align: right;
}

.sticker-del {
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: var(--tl-red);
  display: flex;
  align-items: center;
  justify-content: center;
  color: transparent;
  font-size: 9px;
  line-height: 1;
  flex-shrink: 0;
  transition: color 0.1s;
}

.sticker-del:hover { color: rgba(80, 10, 10, 0.75); }

.sticker-body {
  width: 100%;
  min-height: 112px;
  padding: 10px 12px 24px;
  background: transparent;
  border: none;
  resize: none;
  font-family: var(--font);
  font-size: 13px;
  line-height: 1.6;
  color: #3E2A00;
  outline: none;
  cursor: text;
  user-select: text;
  -webkit-user-select: text;
  overflow: hidden;
  display: block;
}

.sticker-body::placeholder {
  color: rgba(62, 42, 0, 0.28);
}

.sticker-body:read-only {
  cursor: default;
  color: rgba(62, 42, 0, 0.7);
}

.sticker-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 8px 8px 10px;
  gap: 8px;
}

.sticker-hint {
  font-family: var(--font);
  font-size: 10px;
  color: rgba(62, 42, 0, 0.4);
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sticker-hint.saved {
  color: rgba(30, 100, 40, 0.7);
}

.sticker-save {
  font-family: var(--font);
  font-size: 11px;
  font-weight: 500;
  color: #3E2A00;
  background: rgba(0, 0, 0, 0.13);
  padding: 3px 10px;
  border-radius: 4px;
  flex-shrink: 0;
  transition: background 0.12s, opacity 0.12s;
}

.sticker-save:hover:not(:disabled) { background: rgba(0, 0, 0, 0.22); }

.sticker-save:disabled {
  opacity: 0.45;
  cursor: default;
}

@keyframes sticker-flash {
  0%, 100% { background: transparent; }
  35%      { background: rgba(220, 160, 0, 0.15); }
}

.sticker-body.is-flashing {
  animation: sticker-flash 0.5s ease;
}

/* ══════════════════════════════════════
   RESPONSIVE — SHORT SCREENS (≤ 700px tall)
   Plan A (min() on heights) handles hard limits above.
   Plan B below handles top offsets + Music Player internals.
   ══════════════════════════════════════ */
@media (max-height: 700px) {
  /* Tighten CSS-positioned windows so they sit higher */
  #win-chat        { top: 44px; }
  #win-background  { top: 48px; }
  #win-playbook    { top: 56px; }

  /* Scale down music player artwork to reclaim vertical space */
  :root { --player-art-size: clamp(192px, 31vh, 216px); }

  .player-stage          { padding: 10px 16px; }
  .player-art-shell      { margin-bottom: 10px; }
  .player-stage-top      { margin-bottom: 10px; }
  .player-controls       { margin-bottom: 8px; }
  .player-note-bubble    { margin-top: 6px; padding: 6px 8px; }
}
