/* ════════════════════════════════════════════════════════════════
   21-OS — וייב קוד ניוז · מערכת הפעלה
   macOS-inspired desktop OS with floating draggable windows.
   The site IS a desktop — no scrolling page.
   Signature: GSAP Draggable for window dragging + native pointer events.
   Palette: deep cosmic blue gradient desktop, glass-blur windows,
            traffic-light chrome (red/yellow/green), translucent dock.
   ════════════════════════════════════════════════════════════════ */

/* ─── Design Tokens ─── */
:root {
  /* Desktop background */
  --desktop-bg-1: #0a1530;
  --desktop-bg-2: #16215a;
  --desktop-bg-3: #2a1d5e;
  --desktop-bg-4: #491a78;
  --desktop-stars: rgba(255, 255, 255, 0.6);

  /* Window chrome */
  --window-bg: rgba(245, 246, 252, 0.94);
  --window-bg-active: rgba(252, 253, 255, 0.97);
  --window-chrome: rgba(232, 235, 245, 0.78);
  --window-chrome-active: rgba(218, 222, 235, 0.86);
  --window-border: rgba(255, 255, 255, 0.65);
  --window-shadow: rgba(0, 5, 25, 0.55);
  --window-shadow-soft: rgba(0, 5, 25, 0.35);

  /* Traffic light colors */
  --tl-close: #ff5f57;
  --tl-close-d: #e0443e;
  --tl-min: #febc2e;
  --tl-min-d: #dea123;
  --tl-max: #28c840;
  --tl-max-d: #1aab29;

  /* Dock */
  --dock-bg: rgba(40, 50, 85, 0.45);
  --dock-border: rgba(255, 255, 255, 0.25);
  --dock-icon-size: 44px;

  /* Text */
  --window-fg: #1d1d2a;
  --window-fg-soft: #4f5267;
  --window-fg-dim: #8d90a3;

  /* Chat skin brand colors */
  --wa-green:   #25D366;
  --wa-green-d: #128C7E;
  --wa-bg:      #efeae2;
  --tg-blue:    #2AABEE;
  --tg-blue-d:  #229ED9;
  --tg-bg:      #e7eef5;
  --ms-blue:    #0099FF;
  --ms-purple:  #A033FF;
  --ms-bg:      #f0eaf5;

  /* Fonts */
  --font-system: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Heebo', 'Segoe UI', sans-serif;
  --font-ui:     'Heebo', -apple-system, BlinkMacSystemFont, 'SF Pro Display', system-ui, sans-serif;
  --font-mono:   'JetBrains Mono', 'SF Mono', Menlo, Consolas, monospace;

  /* Sizes */
  --titlebar: 32px;
  --titlebar-mobile: 38px;
  --menubar: 26px;
}

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

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  width: 100%;
  font-family: var(--font-ui);
  color: var(--window-fg);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

html { background: #0a1530; }

/* ─────────────────────────────────────────
   DESKTOP BACKGROUND
   Deep cosmic gradient + animated stars
───────────────────────────────────────── */
body {
  background:
    radial-gradient(circle at 12% 18%, rgba(105, 90, 220, 0.45) 0%, transparent 42%),
    radial-gradient(circle at 88% 22%, rgba(60, 200, 240, 0.32) 0%, transparent 40%),
    radial-gradient(circle at 78% 88%, rgba(220, 80, 180, 0.35) 0%, transparent 42%),
    radial-gradient(circle at 22% 82%, rgba(80, 120, 240, 0.32) 0%, transparent 38%),
    linear-gradient(135deg, var(--desktop-bg-1) 0%, var(--desktop-bg-2) 35%, var(--desktop-bg-3) 65%, var(--desktop-bg-4) 100%);
  background-attachment: fixed;
  position: relative;
}

/* Subtle star/grid field overlay */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  background-image:
    radial-gradient(circle at 18% 32%, rgba(255,255,255,0.55) 1px, transparent 1.5px),
    radial-gradient(circle at 82% 18%, rgba(255,255,255,0.4) 1px, transparent 1.5px),
    radial-gradient(circle at 65% 76%, rgba(255,255,255,0.5) 1px, transparent 1.5px),
    radial-gradient(circle at 30% 88%, rgba(255,255,255,0.35) 1px, transparent 1.5px),
    radial-gradient(circle at 92% 60%, rgba(255,255,255,0.45) 1px, transparent 1.5px),
    radial-gradient(circle at 48% 8%, rgba(255,255,255,0.5) 1px, transparent 1.5px),
    radial-gradient(circle at 8% 56%, rgba(255,255,255,0.4) 1px, transparent 1.5px),
    radial-gradient(circle at 38% 48%, rgba(255,255,255,0.35) 1px, transparent 1.5px);
  background-size: 1100px 700px;
  background-repeat: repeat;
  opacity: 0.85;
  animation: stars-drift 90s linear infinite;
}

@keyframes stars-drift {
  from { background-position: 0 0; }
  to { background-position: 1100px 700px; }
}

/* Subtle vignette */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  background: radial-gradient(ellipse at center, transparent 35%, rgba(0, 0, 12, 0.45) 100%);
}

/* ─────────────────────────────────────────
   TOP MENUBAR (global)
───────────────────────────────────────── */
.menubar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--menubar);
  z-index: 9000;
  display: flex;
  align-items: center;
  padding: 0 14px;
  gap: 16px;
  background: rgba(15, 22, 50, 0.42);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.18);
  color: rgba(255, 255, 255, 0.92);
  font-size: 12.5px;
  font-weight: 500;
  letter-spacing: 0.01em;
}
.menubar-apple {
  width: 18px; height: 18px;
  display: inline-grid;
  place-items: center;
  font-size: 16px;
}
.menubar-app {
  font-weight: 700;
  color: rgba(255, 255, 255, 0.98);
}
.menubar-item {
  cursor: default;
  opacity: 0.85;
  transition: opacity .15s;
}
.menubar-item:hover { opacity: 1; }
.menubar-spacer { flex: 1; }
.menubar-right {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 12px;
  letter-spacing: 0.04em;
  opacity: 0.92;
}
.menubar-clock {
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.05em;
}

/* ─────────────────────────────────────────
   DESKTOP STAGE — where windows live
───────────────────────────────────────── */
.desktop {
  position: fixed;
  top: var(--menubar);
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2;
  overflow: hidden;
}

.desktop-icons {
  position: absolute;
  top: 28px;
  right: 28px;
  display: flex;
  flex-direction: column;
  gap: 22px;
  z-index: 4;
}

.desktop-icon {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 78px;
  cursor: pointer;
  user-select: none;
  transition: transform .18s ease;
}
.desktop-icon:hover { transform: translateY(-2px); }
.desktop-icon-art {
  width: 56px; height: 56px;
  display: grid;
  place-items: center;
  font-size: 26px;
  background: linear-gradient(180deg, rgba(255,255,255,0.18), rgba(255,255,255,0.06));
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.22);
  box-shadow: 0 4px 14px rgba(0,0,0,0.35);
}
.desktop-icon-label {
  margin-top: 6px;
  font-size: 11.5px;
  color: rgba(255,255,255,0.94);
  text-align: center;
  text-shadow: 0 1px 2px rgba(0,0,0,0.6);
  font-weight: 500;
}

/* ─────────────────────────────────────────
   WINDOWS — the heart of the OS
───────────────────────────────────────── */
.window {
  position: absolute;
  display: flex;
  flex-direction: column;
  background: var(--window-bg);
  border-radius: 12px;
  border: 1px solid var(--window-border);
  box-shadow:
    0 0 0 0.5px rgba(0, 0, 0, 0.4),
    0 18px 50px -12px var(--window-shadow),
    0 8px 24px -8px var(--window-shadow-soft),
    inset 0 1px 0 rgba(255, 255, 255, 0.6);
  overflow: hidden;
  min-width: 260px;
  min-height: 180px;
  backdrop-filter: blur(22px) saturate(160%);
  -webkit-backdrop-filter: blur(22px) saturate(160%);
  font-family: var(--font-ui);
  will-change: transform;
  touch-action: none;
}

.window.active {
  background: var(--window-bg-active);
  box-shadow:
    0 0 0 0.5px rgba(0, 0, 0, 0.4),
    0 24px 60px -10px rgba(0, 5, 25, 0.65),
    0 10px 30px -8px rgba(0, 5, 25, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.window.minimized {
  pointer-events: none;
  opacity: 0;
  transform: scale(0.2) translateY(120vh);
  transition: opacity .35s, transform .45s cubic-bezier(.4, 1.4, .6, 1);
}

.window.closing {
  pointer-events: none;
  opacity: 0;
  transform: scale(0.85);
  transition: opacity .25s, transform .3s;
}

.window.maximized {
  top: 0 !important;
  left: 0 !important;
  width: 100% !important;
  height: 100% !important;
  border-radius: 0;
}

/* Title bar */
.window-titlebar {
  display: flex;
  align-items: center;
  height: var(--titlebar);
  padding: 0 12px;
  background: var(--window-chrome);
  border-bottom: 1px solid rgba(0, 0, 0, 0.07);
  cursor: grab;
  user-select: none;
  flex-shrink: 0;
  gap: 10px;
}
.window.active .window-titlebar {
  background: var(--window-chrome-active);
}
.window-titlebar:active { cursor: grabbing; }

.traffic-lights {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.tl {
  width: 13px;
  height: 13px;
  border-radius: 50%;
  display: inline-block;
  position: relative;
  cursor: pointer;
  transition: filter .15s, transform .15s;
  border: 0.5px solid rgba(0, 0, 0, 0.15);
}
.tl:hover { filter: brightness(1.08); }
.tl:active { transform: scale(0.92); }
.tl-close  { background: var(--tl-close); }
.tl-min    { background: var(--tl-min); }
.tl-max    { background: var(--tl-max); }

/* Glyph on hover */
.tl::after {
  content: '';
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 9px;
  font-weight: 700;
  color: rgba(0, 0, 0, 0.6);
  opacity: 0;
  transition: opacity .12s;
}
.tl:hover::after { opacity: 1; }
.tl-close::after { content: '×'; }
.tl-min::after   { content: '−'; }
.tl-max::after   { content: '+'; }

.window-title {
  flex: 1;
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  color: var(--window-fg);
  letter-spacing: 0.005em;
  pointer-events: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 0 4px;
}
.window-title-en {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--window-fg-dim);
  margin-right: 8px;
}

.window-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}
.win-act {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 5px;
  background: transparent;
  border: 0;
  color: var(--window-fg-soft);
  font-size: 12px;
  cursor: pointer;
  transition: background .12s;
}
.win-act:hover { background: rgba(0, 0, 0, 0.07); color: var(--window-fg); }

.window-body {
  flex: 1;
  overflow: auto;
  background: var(--window-bg);
  color: var(--window-fg);
  position: relative;
}
.window.active .window-body { background: var(--window-bg-active); }

.window-body::-webkit-scrollbar { width: 8px; height: 8px; }
.window-body::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.18);
  border-radius: 4px;
}
.window-body::-webkit-scrollbar-track { background: transparent; }

/* Resize handle */
.resize-handle {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 14px;
  cursor: ns-resize;
  z-index: 4;
}
.resize-handle::after {
  content: '';
  position: absolute;
  bottom: 4px;
  left: 50%;
  transform: translateX(-50%);
  width: 32px;
  height: 4px;
  border-radius: 2px;
  background: rgba(0, 0, 0, 0.18);
}

/* ─────────────────────────────────────────
   DOCK — bottom app launcher
───────────────────────────────────────── */
.dock {
  position: fixed;
  bottom: 14px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 8500;
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 8px 12px;
  background: var(--dock-bg);
  border: 1px solid var(--dock-border);
  border-radius: 18px;
  backdrop-filter: blur(28px) saturate(180%);
  -webkit-backdrop-filter: blur(28px) saturate(180%);
  box-shadow:
    0 12px 32px rgba(0, 0, 0, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.dock-item {
  width: var(--dock-icon-size);
  height: var(--dock-icon-size);
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(255,255,255,0.16), rgba(255,255,255,0.04));
  border: 1px solid rgba(255,255,255,0.22);
  cursor: pointer;
  font-size: 22px;
  position: relative;
  transition: transform .18s cubic-bezier(.3, 1.4, .4, 1), background .15s;
  box-shadow: 0 4px 10px rgba(0,0,0,0.35);
}
.dock-item:hover {
  transform: translateY(-8px) scale(1.12);
}
.dock-item.active::after {
  content: '';
  position: absolute;
  bottom: -5px;
  left: 50%;
  transform: translateX(-50%);
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.9);
}
.dock-item.has-window:not(.active)::after {
  content: '';
  position: absolute;
  bottom: -5px;
  left: 50%;
  transform: translateX(-50%);
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.45);
}
.dock-label {
  position: absolute;
  bottom: calc(100% + 14px);
  left: 50%;
  transform: translateX(-50%) translateY(6px);
  background: rgba(20, 25, 50, 0.92);
  color: rgba(255, 255, 255, 0.96);
  font-size: 11.5px;
  padding: 4px 10px;
  border-radius: 6px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity .15s, transform .15s;
  font-weight: 500;
}
.dock-item:hover .dock-label {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ─────────────────────────────────────────
   CONTENT TEMPLATES INSIDE WINDOWS
───────────────────────────────────────── */
.win-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 14px;
  background: rgba(0, 0, 0, 0.04);
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  font-size: 11.5px;
  color: var(--window-fg-soft);
}
.win-toolbar strong { color: var(--window-fg); }

.win-content {
  padding: 16px;
}

/* Ticker window */
.ticker-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.ticker-item {
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: 12px;
  padding: 10px 12px;
  background: rgba(0, 0, 0, 0.03);
  border-radius: 7px;
  font-size: 13px;
  border-right: 3px solid rgba(80, 90, 200, 0.5);
}
.ticker-item-time {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  color: rgba(80, 90, 200, 0.95);
  letter-spacing: 0.03em;
}
.ticker-item-text {
  line-height: 1.5;
  color: var(--window-fg);
}

/* Featured article window */
.article-feature {
  padding: 18px;
}
.article-cat {
  display: inline-block;
  font-size: 10.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 700;
  padding: 3px 8px;
  background: rgba(80, 90, 200, 0.12);
  color: rgba(50, 60, 160, 0.95);
  border-radius: 4px;
  margin-bottom: 10px;
  font-family: var(--font-mono);
}
.article-title {
  font-size: 22px;
  line-height: 1.22;
  font-weight: 800;
  margin: 0 0 12px;
  color: var(--window-fg);
  letter-spacing: -0.005em;
}
.article-excerpt {
  font-size: 14px;
  line-height: 1.6;
  color: var(--window-fg-soft);
  margin: 0 0 14px;
}
.article-meta {
  display: flex;
  gap: 14px;
  font-size: 11.5px;
  color: var(--window-fg-dim);
  flex-wrap: wrap;
  padding-top: 12px;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
}
.article-meta span strong { color: var(--window-fg); font-weight: 600; }

/* News window — list of items */
.news-list {
  display: flex;
  flex-direction: column;
}
.news-row {
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  cursor: pointer;
  transition: background .12s;
}
.news-row:hover { background: rgba(0, 0, 0, 0.03); }
.news-row:last-child { border-bottom: 0; }
.news-time {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  color: var(--window-fg-soft);
  letter-spacing: 0.02em;
}
.news-body { min-width: 0; }
.news-headline {
  font-size: 13.5px;
  font-weight: 700;
  line-height: 1.35;
  margin: 0 0 3px;
  color: var(--window-fg);
}
.news-dek {
  font-size: 11.5px;
  color: var(--window-fg-soft);
  line-height: 1.45;
  margin: 0 0 5px;
}
.news-meta {
  display: flex;
  gap: 8px;
  font-size: 10.5px;
  color: var(--window-fg-dim);
}
.urgency-pill {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 3px;
  font-size: 10px;
  font-weight: 700;
  font-family: var(--font-mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.urgency-breaking { background: #ffe0e0; color: #c0392b; }
.urgency-high     { background: #fff3cf; color: #b07b00; }
.urgency-normal   { background: #e0e6f0; color: #4a5577; }

/* Quote window */
.quote-window-body {
  padding: 26px 22px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  background:
    radial-gradient(ellipse at top right, rgba(80, 90, 200, 0.08), transparent 70%),
    radial-gradient(ellipse at bottom left, rgba(200, 80, 180, 0.06), transparent 70%);
  height: 100%;
}
.quote-text {
  font-size: 19px;
  line-height: 1.45;
  font-weight: 600;
  color: var(--window-fg);
  margin: 0;
  letter-spacing: -0.005em;
}
.quote-text::before {
  content: '"';
  font-size: 36px;
  line-height: 0;
  color: rgba(80, 90, 200, 0.4);
  vertical-align: -10px;
  margin-left: 4px;
}
.quote-attribution {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.quote-author {
  font-size: 13px;
  font-weight: 700;
  color: var(--window-fg);
}
.quote-role {
  font-size: 11.5px;
  color: var(--window-fg-dim);
  letter-spacing: 0.02em;
}

/* ─────────────────────────────────────────
   CHAT (Messages) WINDOW
───────────────────────────────────────── */
.chat-inner {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: var(--wa-bg);
  font-family: var(--font-ui);
}
.chat-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: var(--wa-green-d);
  color: white;
  flex-shrink: 0;
}
.chat-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.95);
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 16px;
  flex-shrink: 0;
}
.chat-head-info { flex: 1; min-width: 0; }
.chat-head-name {
  font-size: 13.5px;
  font-weight: 700;
  line-height: 1.1;
}
.chat-head-status {
  font-size: 11px;
  opacity: 0.92;
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 1px;
}
.chat-head-status .dot {
  width: 6px; height: 6px;
  background: #4dff8a;
  border-radius: 50%;
  display: inline-block;
  animation: typing-pulse 1.4s infinite ease-in-out;
}
@keyframes typing-pulse {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}
.chat-head-actions {
  font-size: 18px;
  letter-spacing: 1px;
  opacity: 0.9;
  cursor: default;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='40'%3E%3Cpath d='M8 6c0-1 .8-2 2-2h2c1 0 2 1 2 2v2c0 1-1 2-2 2h-2c-1 0-2-1-2-2V6zm16 16c0-1 .8-2 2-2h2c1 0 2 1 2 2v2c0 1-1 2-2 2h-2c-1 0-2-1-2-2v-2z' fill='%23d4d0c4' opacity='0.32'/%3E%3C/svg%3E");
}
.msg-date-sep {
  text-align: center;
  font-size: 11px;
  color: var(--window-fg-dim);
  margin: 6px 0;
  font-weight: 500;
}

.bubble {
  max-width: 78%;
  align-self: flex-start;
  padding: 7px 10px 5px;
  border-radius: 8px 8px 8px 2px;
  background: white;
  border: 1px solid rgba(0, 0, 0, 0.04);
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.04);
  position: relative;
  font-size: 13px;
  line-height: 1.4;
}
.bubble-text { color: var(--window-fg); }
.bubble-time {
  display: block;
  text-align: left;
  font-size: 10px;
  color: var(--window-fg-dim);
  margin-top: 3px;
  letter-spacing: 0.02em;
}
.bubble-top {
  display: flex;
  gap: 6px;
  margin-bottom: 3px;
  align-items: center;
  flex-wrap: wrap;
}
.bubble-tag {
  display: inline-block;
  font-size: 9.5px;
  font-weight: 700;
  font-family: var(--font-mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 1px 6px;
  border-radius: 3px;
  background: var(--wa-green);
  color: white;
}
.urgent-badge {
  display: inline-block;
  font-size: 9.5px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 3px;
  background: #ffe0e0;
  color: #c0392b;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.bubble.urgent {
  background: #fff8e0;
  border-color: #ffd770;
}

.typing {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 9px 12px;
  background: white;
  border-radius: 8px 8px 8px 2px;
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.04);
}
.typing-dot {
  width: 6px; height: 6px;
  background: var(--window-fg-dim);
  border-radius: 50%;
  animation: typing-bounce 1.2s infinite ease-in-out;
}
.typing-dot:nth-child(2) { animation-delay: 0.18s; }
.typing-dot:nth-child(3) { animation-delay: 0.36s; }
@keyframes typing-bounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
  30% { transform: translateY(-3px); opacity: 1; }
}

.chat-input {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: #f0f0ec;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
}
.chat-input-field {
  flex: 1;
  background: white;
  border-radius: 18px;
  padding: 7px 14px;
  font-size: 12.5px;
  color: var(--window-fg-soft);
  border: 1px solid rgba(0, 0, 0, 0.05);
}
.chat-send {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--wa-green);
  color: white;
  display: grid;
  place-items: center;
  cursor: pointer;
  border: 0;
  font-size: 14px;
}

.skin-switcher {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: #e8e8e2;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
  flex-shrink: 0;
}
.skin-label {
  font-size: 10.5px;
  font-family: var(--font-mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--window-fg-dim);
  margin-left: auto;
}
.skin-btn {
  width: 26px; height: 26px;
  border-radius: 6px;
  border: 1px solid rgba(0, 0, 0, 0.12);
  background: white;
  font-family: var(--font-system);
  font-weight: 700;
  font-size: 12px;
  color: var(--window-fg-soft);
  cursor: pointer;
  transition: all .15s;
  display: grid;
  place-items: center;
}
.skin-btn:hover { border-color: rgba(0, 0, 0, 0.25); }
.skin-btn.active {
  background: var(--wa-green);
  color: white;
  border-color: var(--wa-green);
}

/* Skin: WhatsApp */
.chat-inner.skin-wa { background: var(--wa-bg); }
.chat-inner.skin-wa .chat-header { background: var(--wa-green-d); }
.chat-inner.skin-wa .bubble-tag { background: var(--wa-green); color: white; }
.chat-inner.skin-wa .chat-send { background: var(--wa-green); }
.chat-inner.skin-wa .skin-btn.active { background: var(--wa-green); border-color: var(--wa-green); color: white; }

/* Skin: Telegram */
.chat-inner.skin-tg { background: var(--tg-bg); }
.chat-inner.skin-tg .chat-header { background: var(--tg-blue-d); }
.chat-inner.skin-tg .bubble-tag { background: var(--tg-blue); color: white; }
.chat-inner.skin-tg .chat-send { background: var(--tg-blue); }
.chat-inner.skin-tg .skin-btn.active { background: var(--tg-blue); border-color: var(--tg-blue); color: white; }
.chat-inner.skin-tg .chat-input-field { font-family: var(--font-system); }

/* Skin: Messenger */
.chat-inner.skin-ms { background: var(--ms-bg); }
.chat-inner.skin-ms .chat-header { background: linear-gradient(135deg, var(--ms-blue), var(--ms-purple)); }
.chat-inner.skin-ms .bubble-tag { background: linear-gradient(135deg, var(--ms-blue), var(--ms-purple)); color: white; }
.chat-inner.skin-ms .chat-send { background: linear-gradient(135deg, var(--ms-blue), var(--ms-purple)); }
.chat-inner.skin-ms .skin-btn.active { background: linear-gradient(135deg, var(--ms-blue), var(--ms-purple)); border-color: var(--ms-purple); color: white; }
.chat-inner.skin-ms .chat-input-field { font-family: var(--font-system); }

/* ─────────────────────────────────────────
   ARTICLE & NEWS PAGE LAYOUTS (article.html, news.html)
───────────────────────────────────────── */
.page-info {
  position: fixed;
  top: var(--menubar);
  left: 50%;
  transform: translateX(-50%);
  z-index: 7000;
  margin-top: 12px;
  padding: 6px 16px;
  background: rgba(15, 22, 50, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-radius: 999px;
  color: rgba(255, 255, 255, 0.95);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.04em;
  display: flex;
  align-items: center;
  gap: 12px;
}
.page-info strong { font-weight: 700; }
.page-info-pill {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: rgba(255, 255, 255, 0.15);
  padding: 2px 8px;
  border-radius: 999px;
}

.windows-grid {
  position: fixed;
  top: calc(var(--menubar) + 50px);
  left: 0;
  right: 0;
  bottom: 90px;
  z-index: 2;
  overflow: auto;
  padding: 24px;
}

/* Stack of article windows (article.html) */
.article-window {
  position: relative;
  width: 360px;
  background: var(--window-bg);
  border-radius: 12px;
  border: 1px solid var(--window-border);
  box-shadow:
    0 0 0 0.5px rgba(0, 0, 0, 0.4),
    0 16px 40px -10px rgba(0, 5, 25, 0.5);
  overflow: hidden;
  backdrop-filter: blur(22px);
  display: flex;
  flex-direction: column;
}
.article-window.active {
  background: var(--window-bg-active);
  box-shadow:
    0 0 0 0.5px rgba(0, 0, 0, 0.5),
    0 22px 50px -10px rgba(0, 5, 25, 0.6);
}
.article-window-body {
  padding: 18px;
  flex: 1;
}
.article-window .article-title { font-size: 18px; }
.article-window .article-excerpt { font-size: 13px; }

/* News windows on news.html */
.news-window {
  position: relative;
  width: 320px;
  background: var(--window-bg);
  border-radius: 12px;
  border: 1px solid var(--window-border);
  box-shadow:
    0 0 0 0.5px rgba(0, 0, 0, 0.4),
    0 16px 40px -10px rgba(0, 5, 25, 0.5);
  overflow: hidden;
  backdrop-filter: blur(22px);
  display: flex;
  flex-direction: column;
}
.news-window-body {
  padding: 16px;
}
.news-window-headline {
  font-size: 15px;
  font-weight: 700;
  line-height: 1.32;
  color: var(--window-fg);
  margin: 0 0 8px;
}
.news-window-dek {
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--window-fg-soft);
  margin: 0 0 12px;
}
.news-window-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 10px;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
  font-size: 11px;
  color: var(--window-fg-dim);
}

/* ─────────────────────────────────────────
   REDUCED MOTION
───────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  body::before { animation: none; }
  .window, .dock-item, .typing-dot, .chat-head-status .dot { transition: none !important; animation: none !important; }
}

/* ─────────────────────────────────────────
   RESPONSIVE
───────────────────────────────────────── */
@media (max-width: 800px) {
  :root { --titlebar: 38px; }
  .menubar { font-size: 11px; padding: 0 10px; gap: 10px; }
  .menubar-right { gap: 8px; font-size: 11px; }
  .menubar-item:not(.menubar-app):not(:first-of-type) { display: none; }
  .desktop-icons { top: 14px; right: 14px; gap: 16px; }
  .desktop-icon { width: 64px; }
  .desktop-icon-art { width: 46px; height: 46px; font-size: 22px; }
  .dock { bottom: 8px; padding: 6px 10px; gap: 6px; border-radius: 14px; }
  .dock-item { width: 36px; height: 36px; font-size: 18px; }
  :root { --dock-icon-size: 36px; }
  .window { border-radius: 10px; }
  .window-title { font-size: 12px; }
  .windows-grid { padding: 14px; }
  .article-window, .news-window { width: 100%; max-width: 360px; }
  .article-title { font-size: 18px; }
  .quote-text { font-size: 16px; }
}

@media (max-width: 480px) {
  .desktop-icons { display: none; }
  .menubar-right .menubar-clock { display: none; }
}

/* ─────────────────────────────────────────
   INTRO FADE-IN
───────────────────────────────────────── */
@keyframes os-fade-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
.window { animation: os-fade-in 0.4s cubic-bezier(.2, .8, .2, 1) both; }
.dock   { animation: os-fade-in 0.5s 0.15s cubic-bezier(.2, .8, .2, 1) both; }
.menubar { animation: os-fade-in 0.3s 0s cubic-bezier(.2, .8, .2, 1) both; }

@media (prefers-reduced-motion: reduce) {
  .window, .dock, .menubar { animation: none; }
}
