/**
 * Cute Desk App - https://cutedesk.app
 * Copyright (c) Digiguys Inc. All rights reserved.
 * Unauthorized copying, modification, or redistribution of this file is prohibited.
 */

/* ═══════════════════════════════════════════════════════════════════════
   CSS VARIABLES & RESET
   ═══════════════════════════════════════════════════════════════════════ */
:root {
  --font-clock: Helvetica, Arial, sans-serif;
  --font-title: Helvetica, Arial, sans-serif;
  --font-body: Helvetica, Arial, sans-serif;
  
  --color-window-bg: rgba(255, 255, 255, 0.85);
  --color-window-border: rgba(0, 0, 0, 0.12);
  --color-window-border-focus: rgba(0, 0, 0, 0.25);
  --color-titlebar-bg: rgba(245, 245, 247, 0.95);
  --color-text-primary: #1d1d1f;
  --color-text-secondary: #6e6e73;
  --color-text-tertiary: #aeaeb2;
  --color-accent: #007aff;
  --color-danger: #ff3b30;
  --color-success: #34c759;
  
  --shadow-window: 0 10px 40px rgba(0, 0, 0, 0.15), 0 2px 10px rgba(0, 0, 0, 0.1);
  --shadow-window-focus: 0 12px 50px rgba(0, 0, 0, 0.2), 0 4px 15px rgba(0, 0, 0, 0.12);
  
  --radius-window: 12px;
  --radius-button: 6px;
  --radius-input: 8px;
  
  --min-window-width: 200;
  --min-window-height: 150;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--color-text-primary);
  min-width: 1024px;
}

/* ═══════════════════════════════════════════════════════════════════════
   BACKGROUNDS
   ═══════════════════════════════════════════════════════════════════════ */
/* Page background gradients by color */
.bg-default {
  background: linear-gradient(135deg, #ffecd2 0%, #fcb69f 50%, #ee9ca7 100%);
}
.bg-pink {
  background: linear-gradient(135deg, #ffeef8 0%, #ffb6c1 50%, #ff91a4 100%);
}
.bg-blue {
  background: linear-gradient(135deg, #e0f7ff 0%, #87ceeb 50%, #6bb3d9 100%);
}
.bg-green {
  background: linear-gradient(135deg, #e8fdf5 0%, #98d8c8 50%, #7ec8a3 100%);
}
.bg-yellow {
  background: linear-gradient(135deg, #fffde7 0%, #fff59d 50%, #ffeb3b 100%);
}
.bg-purple {
  background: linear-gradient(135deg, #f3e8ff 0%, #d8b4fe 50%, #c084fc 100%);
}

#desktop {
  width: 100%;
  height: 100%;
  position: relative;
}

/* ═══════════════════════════════════════════════════════════════════════
   WINDOW STYLES
   ═══════════════════════════════════════════════════════════════════════ */
.window {
  position: absolute;
  background: var(--color-window-bg);
  border: 1px solid var(--color-window-border);
  border-radius: var(--radius-window);
  box-shadow: var(--shadow-window);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: box-shadow 0.15s ease, border-color 0.15s ease;
}

.window.focused {
  border-color: var(--color-window-border-focus);
  box-shadow: var(--shadow-window-focus);
}

.window-titlebar {
  height: 36px;
  min-height: 36px;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
}

.window-titlebar:active {
  cursor: grabbing;
}

/* Larger touch target for titlebar on mobile */
@media (pointer: coarse) {
  .window-titlebar {
    height: 44px;
    min-height: 44px;
  }
}

.window-title {
  font-family: var(--font-title);
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text-primary);
  pointer-events: none;
  opacity: 0.5;
  transition: opacity 0.15s ease;
  display: flex;
  align-items: center;
  gap: 6px;
}

.window-title i {
  font-size: 12px;
  line-height: 1;
}

.window.focused .window-title {
  opacity: 1;
}

.window-menu-container {
  position: relative;
  display: flex;
  align-items: center;
  gap: 6px;
}

.window-menu-btn {
  width: 24px;
  height: 24px;
  background: rgba(0, 0, 0, 0.05);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  transition: background 0.15s ease, opacity 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  opacity: 0.5;
  font-size: 12px;
  color: var(--color-text-secondary);
}

.window-menu-btn i {
  line-height: 1;
  transform: scaleX(0.8) translateY(1px);
}

.window.focused .window-menu-btn {
  opacity: 1;
}

.window-menu-btn:hover {
  background: rgba(0, 0, 0, 0.1);
  opacity: 1;
}

.page-menu-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: none;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  font-size: 14px;
  color: #555;
  transition: transform 0.15s ease, background 0.15s ease;
}

.page-menu-btn i {
  line-height: 1;
  transform: scaleX(0.8) translateY(1px);
}

.page-menu-btn:hover {
  background: rgba(255, 255, 255, 0.95);
  transform: scale(1.1);
}

.page-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 14px;
  font-size: 13px;
  text-align: left;
  background: none;
  border: none;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
  cursor: pointer;
  color: #333;
  font-family: inherit;
}

.page-menu-item:first-of-type {
  border-top: none;
}

.page-menu-item:hover {
  background: rgba(0, 0, 0, 0.05);
}

.page-menu-item i {
  font-size: 14px;
  color: var(--color-text-secondary);
  line-height: 1;
}

/* Widget Dock */
.widget-dock {
  display: flex;
  gap: 8px;
}

.dock-icon {
  width: 36px;
  cursor: grab;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: none;
  cursor: pointer;
  font-size: 16px;
  color: #555;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s ease, opacity 0.15s ease, box-shadow 0.15s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.dock-icon i {
  line-height: 1;
}

.dock-icon:hover {
  transform: scale(1.1);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.dock-icon.inactive {
  opacity: 0.4;
}

.dock-icon.inactive:hover {
  opacity: 0.7;
}

.dock-icon.dragging {
  opacity: 0.3;
  cursor: grabbing;
}

.dock-icon.drag-over {
  transform: scale(1.15);
}

.dock-icon:active {
  cursor: grabbing;
}

/* Dock divider (thin vertical line between dock icons and control buttons) */
.dock-divider {
  width: 1px;
  height: 20px;
  background: rgba(0, 0, 0, 0.15);
  flex-shrink: 0;
}

/* Widgets dock button (always present, between dock and page menu) */
.widgets-dock-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: none;
  cursor: pointer;
  font-size: 16px;
  color: #555;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s ease, opacity 0.15s ease, box-shadow 0.15s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.widgets-dock-btn i {
  line-height: 1;
}

.widgets-dock-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.widgets-dock-btn.inactive {
  opacity: 0.4;
}

.widgets-dock-btn.inactive:hover {
  opacity: 0.7;
}

.new-chat-btn {
  width: 24px;
  height: 24px;
  background: rgba(0, 0, 0, 0.05);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  font-size: 14px;
  color: var(--color-text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.5;
  transition: background 0.15s ease, opacity 0.15s ease;
}

.window.focused .new-chat-btn {
  opacity: 1;
}

.new-chat-btn:hover {
  background: rgba(0, 0, 0, 0.1);
  opacity: 1;
}

.new-chat-btn.hidden {
  display: none;
}

.today-btn {
  width: 24px;
  height: 24px;
  background: rgba(0, 0, 0, 0.05);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  font-size: 14px;
  color: var(--color-text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  opacity: 0.5;
  transition: background 0.15s ease, opacity 0.15s ease;
}

.window.focused .today-btn {
  opacity: 1;
}

.today-btn:hover {
  background: rgba(0, 0, 0, 0.1);
  opacity: 1;
}

.order-btn {
  width: 24px;
  height: 24px;
  background: rgba(0, 0, 0, 0.05);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  font-size: 12px;
  color: var(--color-text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  opacity: 0.5;
  transition: background 0.15s ease, opacity 0.15s ease;
}

.window.focused .order-btn {
  opacity: 1;
}

.order-btn:hover {
  background: rgba(0, 0, 0, 0.1);
  opacity: 1;
}

.order-btn.active {
  background: var(--color-accent);
  color: white;
  opacity: 1;
}

.clear-notes-btn {
  width: 24px;
  height: 24px;
  background: rgba(0, 0, 0, 0.05);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  font-size: 12px;
  color: var(--color-text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  opacity: 0.5;
  transition: background 0.15s ease, opacity 0.15s ease;
  padding: 0;
}

.clear-notes-btn i {
  line-height: 1;
}

/* Chrome browser fix - icon renders off-center */
.browser-chrome .clear-notes-btn i {
  transform: translateX(-1px);
}

/* Windows - use default pointer instead of pixelated grab hand */
.os-windows .window-titlebar {
  cursor: default;
}

.os-windows .window-titlebar:active {
  cursor: default;
}

.os-windows .dock-icon {
  cursor: default;
}

.os-windows .dock-icon.dragging,
.os-windows .dock-icon:active {
  cursor: default;
}

.os-windows .todo-item {
  cursor: default;
}

.os-windows .todo-drag-handle {
  cursor: default;
}

.os-windows .todo-list.order-mode .todo-item {
  cursor: default;
}

.os-windows .todo-list.order-mode .todo-item.dragging {
  cursor: default;
}

.os-windows .link-item.dragging {
  cursor: default;
}

.os-windows .widgets-item--dragging {
  cursor: default;
}

.window.focused .clear-notes-btn {
  opacity: 1;
}

.clear-notes-btn:hover {
  background: rgba(0, 0, 0, 0.1);
  opacity: 1;
}

.add-photo-btn {
  width: 24px;
  height: 24px;
  background: rgba(0, 0, 0, 0.05);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  font-size: 12px;
  color: var(--color-text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  opacity: 0.5;
  transition: background 0.15s ease, opacity 0.15s ease;
  padding: 0;
}

.window.focused .add-photo-btn {
  opacity: 1;
}

.add-photo-btn:hover {
  background: rgba(0, 0, 0, 0.1);
  opacity: 1;
}

.window-menu-popup {
  display: none;
  position: fixed;
  top: 0;
  right: 0;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15), 0 0 0 0.5px rgba(0, 0, 0, 0.1);
  width: max-content;
  overflow: hidden;
  z-index: 99999;
}

.window-menu-popup.open {
  display: block;
}

.window-menu-item {
  display: block;
  width: 100%;
  padding: 8px 12px;
  font-size: 12px;
  text-align: left;
  background: none;
  border: none;
  cursor: pointer;
  color: #333;
  font-family: inherit;
  transition: background 0.1s ease;
  white-space: nowrap;
}

.window-menu-item:hover {
  background: rgba(0, 0, 0, 0.05);
}

.window-menu-item .fi {
  margin-right: 8px;
  font-size: 11px;
  vertical-align: middle;
  opacity: 0.7;
}

.menu-icon {
  font-family: var(--font-body);
  margin-right: 6px;
}

.window-menu-colors {
  display: flex;
  gap: 6px;
  padding: 8px 12px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.window-color-btn,
.page-color-btn {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid rgba(0, 0, 0, 0.1);
  cursor: pointer;
  transition: transform 0.1s ease, border-color 0.1s ease;
  outline: none;
  padding: 0;
  appearance: none;
  -webkit-appearance: none;
  overflow: hidden;
  background-clip: padding-box;
  -webkit-background-clip: padding-box;
}

.window-color-btn:hover,
.page-color-btn:hover {
  transform: scale(1.15);
}

.window-color-btn.selected {
  border-color: rgba(0, 0, 0, 0.35);
}

.window-content {
  flex: 1;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  position: relative;
}

.widget-skeleton {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
}
.skeleton-line {
  height: 14px;
  border-radius: 6px;
  background: linear-gradient(90deg, rgba(0,0,0,0.04) 25%, rgba(0,0,0,0.08) 50%, rgba(0,0,0,0.04) 75%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.5s ease-in-out infinite;
}
.skeleton-line.w75 { width: 75%; }
.skeleton-line.w50 { width: 50%; }
.skeleton-line.w90 { width: 90%; }
@keyframes skeleton-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.window-resize-handle {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 24px;
  height: 24px;
  cursor: nwse-resize;
  display: flex;
  align-items: center;
  justify-content: center;
  touch-action: none;
}

/* Larger touch target for mobile devices */
@media (pointer: coarse) {
  .window-resize-handle {
    width: 36px;
    height: 36px;
  }
}

.window-resize-handle i {
  font-size: 16px;
  color: var(--color-text-tertiary);
  opacity: 0.5;
  transform: rotate(45deg) translate(2px, 2px);
  line-height: 1;
}

/* ═══════════════════════════════════════════════════════════════════════
   WIDGET COMMON STYLES
   ═══════════════════════════════════════════════════════════════════════ */
.widget-scroll {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 4px 12px 12px;
}

.widget-input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--color-window-border);
  border-radius: var(--radius-input);
  font-family: var(--font-body);
  font-size: 14px;
  outline: none;
  transition: border-color 0.15s ease;
}

.widget-input:focus {
  border-color: var(--color-accent);
}

.widget-input::placeholder {
  color: var(--color-text-tertiary);
}

select.widget-input {
  appearance: none;
  -webkit-appearance: none;
  background: white url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23666' d='M6 8L1 3h10z'/%3E%3C/svg%3E") no-repeat right 12px center;
  padding-right: 36px;
  cursor: pointer;
}

.widget-btn {
  background: var(--color-accent);
  color: white;
  border: none;
  border-radius: var(--radius-button);
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: opacity 0.15s ease;
  opacity: 0.5;
}

.window.focused .widget-btn {
  opacity: 1;
}

.widget-btn:hover {
  opacity: 1;
}

.widget-btn.secondary {
  background: rgba(0, 0, 0, 0.05);
  color: var(--color-text-primary);
}

.widget-btn.danger {
  background: var(--color-danger);
}

/* ═══════════════════════════════════════════════════════════════════════
   CLOCK WIDGET
   ═══════════════════════════════════════════════════════════════════════ */

/* Transparent window so sky shows through the titlebar */
#window-clock {
  background: transparent !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

#window-clock .window-content {
  overflow: visible;
}

#window-clock .clock-widget {
  overflow: visible;
}

#window-clock .window-titlebar {
  position: relative;
  z-index: 4;
}

#window-clock .clock-sky,
#window-clock .clock-sun-container,
#window-clock .clock-earth {
  top: -36px;
}

@media (pointer: coarse) {
  #window-clock .clock-sky,
  #window-clock .clock-sun-container,
  #window-clock .clock-earth {
    top: -44px;
  }
}

.clock-widget {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  padding: 0 20px 20px;
  position: relative;
  overflow: hidden;
  container-type: size;
}

/* Sky layer - furthest back */
.clock-sky {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
  z-index: 0;
}

.clock-sky img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Sun/Moon container - middle layer */
.clock-sun-container {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
  z-index: 1;
}

.clock-sun-circle {
  position: absolute;
  width: 26px;
  height: 26px;
  transform: translate(-50%, -50%);
  transition: opacity 0.3s ease;
  object-fit: contain;
}

.clock-moon {
  position: absolute;
  width: 26px;
  height: 26px;
  transform: translate(-50%, -50%);
  transition: opacity 0.3s ease;
  object-fit: contain;
}

/* Earth layer - in front of sun/moon */
.clock-earth {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
  z-index: 2;
}

.clock-earth img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Day/Night image toggling */
.clock-bg-day {
  opacity: 1;
  transition: opacity 1s ease;
}

.clock-bg-night {
  opacity: 0;
  transition: opacity 1s ease;
}

.clock-widget.night-mode .clock-bg-day {
  opacity: 0;
}

.clock-widget.night-mode .clock-bg-night {
  opacity: 1;
}

/* Time and date - frontmost layer */
.clock-content {
  position: relative;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.clock-time {
  font-family: var(--font-clock);
  font-size: clamp(24px, 22cqw, 72px);
  font-weight: 700;
  color: var(--color-text-primary);
  letter-spacing: -1px;
  opacity: 0.7;
}

.clock-date {
  font-family: var(--font-body);
  font-size: clamp(12px, 6cqw, 22px);
  font-weight: 600;
  color: var(--color-text-primary);
  opacity: 0.7;
  text-align: center;
  line-height: 1.6;
  margin-top: 14px;
}

.clock-day-name {
  font-size: clamp(12px, 7cqw, 24px);
}

.clock-widget.night-mode .clock-time,
.clock-widget.night-mode .clock-date {
  color: #ffffff;
}

#window-clock.night-mode .window-title {
  color: rgba(255, 255, 255, 0.85);
}

#window-clock.night-mode .window-menu-btn {
  color: rgba(255, 255, 255, 0.7);
  background: rgba(255, 255, 255, 0.1);
}

#window-clock.night-mode .window-menu-btn:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* Shooting star - only visible in night mode on hover */
.shooting-star {
  position: absolute;
  top: 20%;
  right: -10%;
  width: 0;
  height: 0;
  opacity: 0;
  z-index: 1;
  pointer-events: none;
}

.shooting-star::after {
  content: '';
  position: absolute;
  top: 50%;
  right: -1px;
  transform: translateY(-50%) rotate(-22deg);
  width: 40px;
  height: 1.5px;
  background: linear-gradient(to right, rgba(255, 255, 255, 0.8), transparent);
  transform-origin: left center;
}

.shooting-star.active {
  animation: shootingStar 1.2s ease-in-out forwards;
}

@keyframes shootingStar {
  0% {
    top: 15%;
    right: -5%;
    opacity: 0;
    transform: scale(0.5);
  }
  15% {
    opacity: 0.4;
    transform: scale(0.8);
  }
  35% {
    opacity: 1;
    transform: scale(1);
  }
  55% {
    opacity: 1;
    transform: scale(1);
  }
  75% {
    opacity: 0.5;
    transform: scale(0.7);
  }
  100% {
    top: 55%;
    right: 95%;
    opacity: 0;
    transform: scale(0.3);
  }
}

/* ═══════════════════════════════════════════════════════════════════════
   NOTES WIDGET
   ═══════════════════════════════════════════════════════════════════════ */
.notes-textarea {
  width: 100%;
  height: 100%;
  border: none;
  resize: none;
  font-family: 'Consolas', 'Menlo', 'Monaco', 'Courier New', monospace;
  font-size: 14px;
  line-height: 1.6;
  padding: 0 16px 16px;
  outline: none;
  background: transparent;
  color: var(--color-text-primary);
}

.window-menu-font-size {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  font-size: 12px;
  color: var(--color-text-primary);
  border-top: 1px solid rgba(0, 0, 0, 0.08);
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.window-menu-font-size .fi {
  font-size: 11px;
  opacity: 0.7;
  margin-right: 2px;
}

.notes-font-sizes {
  display: flex;
  gap: 6px;
  margin-left: auto;
}

.notes-font-size-btn,
.weather-temp-btn {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid rgba(0, 0, 0, 0.1);
  background: none;
  font-size: 10px;
  font-weight: 600;
  color: var(--color-text-primary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: transform 0.1s ease, border-color 0.1s ease;
  font-family: inherit;
  overflow: hidden;
}

.notes-font-size-btn:hover,
.weather-temp-btn:hover {
  transform: scale(1.15);
}

.notes-font-size-btn.selected,
.weather-temp-btn.selected {
  border-color: rgba(0, 0, 0, 0.35);
}

/* ═══════════════════════════════════════════════════════════════════════
   TODO WIDGET
   ═══════════════════════════════════════════════════════════════════════ */
.todo-input-wrap {
  padding: 0 10px 6px;
  border-bottom: 1px solid var(--color-window-border);
}

.todo-add-input {
  font-size: 12px;
  padding: 6px 8px;
}

.todo-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  cursor: grab;
}

.todo-item:last-child {
  border-bottom: none;
}

.todo-item.dragging {
  opacity: 0.5;
}

.todo-item.drag-over {
  border-top: 2px solid var(--color-accent);
}

.todo-checkbox {
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
  flex-shrink: 0;
  font-size: 18px;
  color: var(--color-text-tertiary);
}

.todo-checkbox i {
  line-height: 1;
}

.todo-checkbox.checked {
  color: var(--color-success);
}

.todo-text {
  flex: 1;
  font-size: 14px;
  line-height: 1.5;
  outline: none;
  border: none;
  background: transparent;
  font-family: var(--font-body);
}

.todo-text.completed {
  text-decoration: line-through;
  color: var(--color-text-tertiary);
}

.todo-delete {
  opacity: 0;
  background: none;
  color: var(--color-danger);
  border: none;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  transition: opacity 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  flex-shrink: 0;
  pointer-events: none;
}

.todo-delete i {
  line-height: 1;
}

.todo-item:hover .todo-delete,
.todo-delete.visible {
  opacity: 1;
  pointer-events: auto;
}

.todo-drag-handle {
  display: none;
  width: 16px;
  height: 16px;
  color: var(--color-text-tertiary);
  font-size: 14px;
  cursor: grab;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
}

.todo-list.order-mode .todo-drag-handle {
  display: flex;
}

.todo-list.order-mode .todo-delete {
  display: none;
}

.todo-list.order-mode .todo-item {
  cursor: grab;
}

.todo-list.order-mode .todo-item.dragging {
  cursor: grabbing;
}

/* ═══════════════════════════════════════════════════════════════════════
   LINKS WIDGET
   ═══════════════════════════════════════════════════════════════════════ */
.links-container {
  height: 100%;
  display: flex;
  flex-direction: column;
}

.links-add-wrap {
  padding: 0 10px 6px;
  border-bottom: 1px solid var(--color-window-border);
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.links-add-wrap input {
  flex: 1;
  font-size: 12px;
  padding: 6px 8px;
}

.links-add-wrap button {
  font-size: 12px;
  padding: 6px 10px;
}

.links-grid-wrap {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
}

.links-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(52px, 1fr));
  gap: 8px;
  justify-items: center;
}

.link-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  width: 48px;
  cursor: pointer;
  position: relative;
  transition: transform 0.15s ease, opacity 0.15s ease;
}

.link-item.dragging {
  opacity: 0.4;
  cursor: grabbing;
}

.link-item.drag-over {
  transform: scale(1.1);
}

.link-icon-wrap {
  position: relative;
  width: 40px;
  height: 40px;
}

.link-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.05);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.link-icon:hover {
  transform: scale(1.05);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.link-favicon {
  width: 20px;
  height: 20px;
  object-fit: contain;
}

.link-favicon-placeholder {
  font-size: 18px;
  color: var(--color-text-tertiary);
  display: flex;
  align-items: center;
  justify-content: center;
}

.link-favicon-placeholder i {
  line-height: 1;
}

.link-delete {
  position: absolute;
  top: -4px;
  right: -4px;
  background: none;
  color: var(--color-danger);
  border: none;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.link-delete i {
  line-height: 1;
}

.link-item:hover .link-delete {
  opacity: 1;
}

.link-label {
  font-size: 10px;
  color: var(--color-text-secondary);
  text-align: center;
  width: 100%;
  cursor: pointer;
  word-break: break-all;
}

.link-label:hover {
  color: var(--color-accent);
}

.links-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--color-text-tertiary);
  font-size: 12px;
}

/* ═══════════════════════════════════════════════════════════════════════
   WIDGETS LAUNCHER WIDGET
   ═══════════════════════════════════════════════════════════════════════ */
.widgets-container {
  height: 100%;
  display: flex;
  flex-direction: column;
}

.widgets-grid-wrap {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
}

.widgets-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
  gap: 14px;
  justify-items: center;
}

.widgets-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  width: 68px;
  cursor: pointer;
  position: relative;
  transition: transform 0.15s ease, opacity 0.15s ease;
}

.widgets-item:hover {
  transform: scale(1.05);
}

.widgets-item--inactive {
  opacity: 0.4;
}

.widgets-item--inactive:hover {
  opacity: 0.7;
}

.widgets-item--dragging {
  opacity: 0.3;
  cursor: grabbing;
}

.widgets-item-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.05);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: #555;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.widgets-item:hover .widgets-item-icon {
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
}

.widgets-item-label {
  font-size: 10px;
  color: var(--color-text-secondary);
  text-align: center;
  width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.widgets-close-btn {
  width: 24px;
  height: 24px;
  background: rgba(0, 0, 0, 0.05);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  font-size: 12px;
  color: var(--color-text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  opacity: 0.5;
  transition: background 0.15s ease, opacity 0.15s ease;
}

.widgets-close-btn i {
  line-height: 1;
}

.window.focused .widgets-close-btn {
  opacity: 1;
}

.widgets-close-btn:hover {
  background: rgba(0, 0, 0, 0.1);
  opacity: 1;
}

/* ═══════════════════════════════════════════════════════════════════════
   CALCULATOR WIDGET
   ═══════════════════════════════════════════════════════════════════════ */
#window-calc {
  background: #2a2a2a !important;
  border-color: rgba(255, 255, 255, 0.08);
}

#window-calc .window-title {
  color: rgba(255, 255, 255, 0.85);
}

#window-calc .window-menu-btn {
  color: rgba(255, 255, 255, 0.7);
  background: rgba(255, 255, 255, 0.1);
}

#window-calc .window-menu-btn:hover {
  background: rgba(255, 255, 255, 0.2);
}

#window-calc .window-resize-handle i {
  color: rgba(255, 255, 255, 0.3);
}

.calc-container {
  display: flex;
  flex-direction: row;
  height: 100%;
}

/* Wrapper keeps gradients fixed while tape scrolls */
.calc-tape-wrap {
  flex: 1;
  min-width: 120px;
  position: relative;
  border-right: 1px solid var(--color-window-border);
}

.calc-tape {
  width: 100%;
  height: 100%;
  overflow-y: auto;
  background:
    linear-gradient(rgba(255, 254, 245, 0.7), rgba(255, 254, 245, 0.7)),
    url('/images/calculator/paper-texture.svg'),
    #fffef5;
  background-size: auto, 300px 300px, auto;
  background-blend-mode: normal, multiply, normal;
  padding: 8px 8px;
  font-family: 'SF Mono', 'Menlo', monospace;
  font-size: 11px;
  color: var(--color-text-secondary);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

/* Paper roll shadow - stays fixed at top and bottom of visible area */
.calc-tape-wrap::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
  z-index: 3;
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.12) 0%, transparent 5%),
    linear-gradient(0deg, rgba(0, 0, 0, 0.12) 0%, transparent 5%);
}

.calc-tape-content {
  display: flex;
  flex-direction: column;
}

.calc-tape-line {
  padding: 2px 0;
  text-align: right;
  white-space: nowrap;
}

.calc-tape-line.operator {
  color: var(--color-text-tertiary);
}

.calc-tape-line.result {
  font-weight: 600;
  color: var(--color-text-primary);
  border-top: 1px dashed var(--color-text-tertiary);
  margin-top: 2px;
  padding-top: 2px;
}

.calc-tape-line.current {
  font-weight: 600;
  color: #1c1c1e;
  font-size: 12px;
  margin-top: 4px;
}

.calc-keypad {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  width: 130px;
  flex-shrink: 0;
  background: #2a2a2a;
}

.calc-buttons {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: repeat(5, 18px);
  gap: 4px;
  padding: 4px 4px 28px 4px;
}

/* ── Vintage keycap base style ── */
.calc-btn {
  border: none;
  padding: 0;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--font-body);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  position: relative;

  /* Cream/ivory keycap */
  background: linear-gradient(180deg, #f5f0e3 0%, #e8e0cc 100%);
  color: #2c2c2c;
  box-shadow:
    0 3px 0 0 #b8ad96,
    0 4px 4px rgba(0, 0, 0, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.6);
  transform: translateY(0);
  transition: transform 0.06s ease, box-shadow 0.06s ease;
}

.calc-btn:hover {
  background: linear-gradient(180deg, #faf5e8 0%, #ede5d1 100%);
}

.calc-btn:active {
  transform: translateY(3px);
  box-shadow:
    0 0 0 0 #b8ad96,
    0 1px 2px rgba(0, 0, 0, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

/* ── Operator keys (orange) ── */
.calc-btn.operator {
  background: linear-gradient(180deg, #f0962a 0%, #d47f18 100%);
  color: #fff;
  box-shadow:
    0 3px 0 0 #9e5e0e,
    0 4px 4px rgba(0, 0, 0, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.calc-btn.operator:hover {
  background: linear-gradient(180deg, #f8a23e 0%, #da8a24 100%);
}

.calc-btn.operator:active {
  transform: translateY(3px);
  box-shadow:
    0 0 0 0 #9e5e0e,
    0 1px 2px rgba(0, 0, 0, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

/* ── Function keys (dark) ── */
.calc-btn.function {
  background: linear-gradient(180deg, #4a4a4a 0%, #353535 100%);
  color: #e8e8e8;
  box-shadow:
    0 3px 0 0 #1a1a1a,
    0 4px 4px rgba(0, 0, 0, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.calc-btn.function:hover {
  background: linear-gradient(180deg, #555555 0%, #404040 100%);
}

.calc-btn.function:active {
  transform: translateY(3px);
  box-shadow:
    0 0 0 0 #1a1a1a,
    0 1px 2px rgba(0, 0, 0, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

/* ═══════════════════════════════════════════════════════════════════════
   TIMER WIDGET
   ═══════════════════════════════════════════════════════════════════════ */
#window-timer {
  background: #1c1c1e !important;
  border-color: rgba(255, 255, 255, 0.08);
}

#window-timer .window-title {
  color: rgba(255, 255, 255, 0.85);
}

#window-timer .window-menu-btn {
  color: rgba(255, 255, 255, 0.7);
  background: rgba(255, 255, 255, 0.1);
}

#window-timer .window-menu-btn:hover {
  background: rgba(255, 255, 255, 0.2);
}

#window-timer .window-resize-handle i {
  color: rgba(255, 255, 255, 0.3);
}

/* Titlebar overlays content so timer ring can use full height */
#window-timer .window-titlebar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 4;
  background: transparent;
}

#window-timer .window-content {
  /* Content fills full widget height behind the absolute titlebar */
}

#window-timer .window-resize-handle {
  z-index: 3;
}

.timer-container {
  display: flex;
  flex-direction: row;
  height: 100%;
}

/* Left panel - timer list */
.timer-list-panel {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 36px; /* Clear the overlaid titlebar */
}

.timer-list {
  flex: 1;
  min-height: 0; /* Allow list to shrink so bottom buttons stay visible */
  overflow-y: auto;
  padding: 2px 4px;
}

.timer-list-empty {
  color: rgba(255, 255, 255, 0.3);
  font-size: 10px;
  text-align: center;
  padding: 8px 4px;
}

.timer-list-item {
  display: flex;
  align-items: center;
  padding: 4px 4px;
  border-radius: 5px;
  cursor: pointer;
  gap: 2px;
  transition: background 0.15s ease;
  margin-bottom: 1px;
}

.timer-list-item:hover {
  background: rgba(255, 255, 255, 0.06);
}

.timer-list-item.selected {
  background: rgba(232, 145, 45, 0.2);
}

.timer-list-item-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 4px;
}

.timer-list-name {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.85);
  font-size: 10px;
  font-weight: 500;
  padding: 0;
  flex: 1;
  min-width: 0;
  font-family: inherit;
  outline: none;
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
}

.timer-list-name:focus {
  background: rgba(255, 255, 255, 0.08);
  border-radius: 3px;
  padding: 0 2px;
}

.timer-list-time {
  font-size: 9px;
  color: #E8912D;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  flex-shrink: 0;
}

.timer-list-time.done {
  color: #4cd964;
}

.timer-list-item.paused .timer-list-time {
  color: rgba(255, 255, 255, 0.4);
}

.timer-list-delete {
  background: none;
  border: none;
  color: #ff453a;
  cursor: pointer;
  padding: 0;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.15s ease;
  flex-shrink: 0;
}

.timer-list-item:hover .timer-list-delete {
  opacity: 1;
}

.timer-list-delete:hover {
  color: #ff453a;
}

.timer-bottom-btns {
  display: flex;
  flex-shrink: 0; /* Never collapse - always visible at bottom */
  justify-content: center;
  gap: 8px;
  padding: 4px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.timer-presets-btn,
.timer-custom-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #E8912D;
  background: rgba(232, 145, 45, 0.06);
  color: #E8912D;
  cursor: pointer;
  font-size: 13px;
  transition: transform 0.15s ease, background 0.15s ease;
}

.timer-presets-btn:hover,
.timer-custom-btn:hover {
  transform: scale(1.08);
  background: rgba(232, 145, 45, 0.18);
}

.timer-bottom-btns.disabled .timer-presets-btn,
.timer-bottom-btns.disabled .timer-custom-btn {
  opacity: 0.3;
  pointer-events: none;
  border-color: rgba(255, 255, 255, 0.15);
  color: rgba(255, 255, 255, 0.3);
}

.timer-presets-btn i,
.timer-custom-btn i {
  line-height: 1;
}

/* Right panel - timer display */
.timer-display-panel {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  overflow: hidden;
  position: relative;
  padding-top: 16px; /* Clear the overlaid titlebar */
  container-type: size;
}

/* Presets grid */
.timer-presets-wrap {
  width: 100%;
  height: calc(100% + 16px);
  overflow-y: auto;
  padding: 8px;
  padding-top: 30px; /* Clear the overlaid titlebar */
  margin-top: -16px;
}

.timer-presets-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(46px, 1fr));
  gap: 6px;
  justify-items: center;
}

.timer-preset-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  width: 44px;
  cursor: pointer;
}

.timer-preset-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px solid #E8912D;
  background: rgba(232, 145, 45, 0.06);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s ease, background 0.15s ease;
  color: #E8912D;
  font-size: 13px;
  font-weight: 600;
}

.timer-preset-icon:hover {
  transform: scale(1.08);
  background: rgba(232, 145, 45, 0.18);
}

.timer-preset-number {
  font-size: 14px;
  font-weight: 600;
  color: #E8912D;
}

.timer-preset-label {
  font-size: 10px;
  color: rgba(255, 255, 255, 0.5);
  text-align: center;
}

/* Timer display (ring) */
.timer-display {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 4px;
}

.timer-ring-container {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
}

.timer-ring-svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.timer-ring-bg {
  fill: none;
  stroke: rgba(255, 255, 255, 0.08);
  stroke-width: 6;
}

.timer-ring-progress {
  fill: none;
  stroke: #E8912D;
  stroke-width: 6;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.5s linear;
}

.timer-display.done .timer-ring-progress {
  stroke: #4cd964;
}

.timer-ring-content {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
}

.timer-countdown-text {
  font-size: clamp(10px, 14cqw, 42px);
  font-weight: 600;
  color: rgba(255, 255, 255, 0.95);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.5px;
}

.timer-display.done .timer-countdown-text {
  color: #4cd964;
  font-size: clamp(10px, 16cqw, 34px);
}

.timer-duration-label {
  font-size: clamp(5px, 8cqw, 20px);
  color: #E8912D;
  margin-top: 2px;
}

.timer-display.done .timer-duration-label {
  color: rgba(255, 255, 255, 0.5);
}

/* Timer ring area - positions ring + controls together */
.timer-ring-area {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.timer-ring-area .timer-ring-container {
  width: 85%;
  max-width: none;
}

/* Timer controls - positioned in bottom corners of the ring's bounding box */
.timer-controls {
  position: absolute;
  bottom: -8px;
  left: 4px;
  right: 4px;
  display: flex;
  justify-content: space-between;
  pointer-events: none;
}

.timer-ctrl-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.7);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  transition: background 0.15s ease, transform 0.15s ease;
  pointer-events: auto;
}

.timer-ctrl-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: scale(1.08);
}

.timer-ctrl-btn.primary {
  background: #E8912D;
  color: #fff;
}

.timer-ctrl-btn.primary:hover {
  background: #d4811f;
}

.timer-ctrl-btn i {
  line-height: 1;
}

/* Timer done flash animation */
.timer-display-panel.timer-flash {
  animation: timerFlash 0.2s ease-out;
}

@keyframes timerFlash {
  0%   { background-color: rgba(232, 145, 45, 0.5); }
  100% { background-color: transparent; }
}

/* Custom timer form */
.timer-custom-form {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 8px;
  width: 100%;
  height: 100%;
}

.timer-custom-inputs {
  display: flex;
  align-items: flex-start;
  gap: 4px;
}

.timer-custom-field {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.timer-custom-field label {
  font-size: 8px;
  color: rgba(255, 255, 255, 0.4);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.timer-custom-input {
  width: 40px;
  height: 32px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 6px;
  color: rgba(255, 255, 255, 0.9);
  font-size: 16px;
  font-weight: 600;
  text-align: center;
  font-family: inherit;
  outline: none;
  -moz-appearance: textfield;
}

.timer-custom-input::-webkit-outer-spin-button,
.timer-custom-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.timer-custom-input:focus {
  border-color: #E8912D;
}

.timer-custom-separator {
  color: rgba(255, 255, 255, 0.4);
  font-size: 16px;
  font-weight: 600;
  padding-top: 6px;
}

.timer-custom-buttons {
  display: flex;
  gap: 8px;
}

.timer-custom-start {
  background: #E8912D;
  color: #fff;
  border: none;
  padding: 6px 16px;
  border-radius: 14px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s ease;
}

.timer-custom-start:hover {
  background: #d4811f;
}

.timer-custom-back {
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.7);
  border: none;
  padding: 6px 12px;
  border-radius: 14px;
  font-size: 12px;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s ease;
}

.timer-custom-back:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* ═══════════════════════════════════════════════════════════════════════
   CHATBOT WIDGET
   ═══════════════════════════════════════════════════════════════════════ */
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.chat-message {
  max-width: 85%;
  padding: 10px 14px;
  border-radius: 16px;
  font-size: 14px;
  line-height: 1.4;
  word-wrap: break-word;
}

.chat-message.user {
  align-self: flex-end;
  background: var(--color-accent);
  color: white;
  border-bottom-right-radius: 4px;
}

.chat-message.assistant {
  align-self: flex-start;
  background: #e9e9eb;
  color: var(--color-text-primary);
  border-bottom-left-radius: 4px;
}

.chat-message code {
  background: rgba(0, 0, 0, 0.08);
  padding: 2px 5px;
  border-radius: 4px;
  font-family: 'SF Mono', Monaco, 'Courier New', monospace;
  font-size: 12px;
}

.chat-message pre {
  background: rgba(0, 0, 0, 0.08);
  padding: 8px 10px;
  border-radius: 6px;
  overflow-x: auto;
  margin: 6px 0;
}

.chat-message pre code {
  background: none;
  padding: 0;
  font-size: 11px;
}

.chat-message strong {
  font-weight: 600;
}

.chat-message em {
  font-style: italic;
}

.chat-message h3,
.chat-message h4,
.chat-message h5,
.chat-message h6 {
  margin: 8px 0 4px 0;
  font-weight: 600;
  line-height: 1.3;
}

.chat-message h3 {
  font-size: 16px;
}

.chat-message h4 {
  font-size: 14px;
}

.chat-message h5 {
  font-size: 13px;
}

.chat-message h6 {
  font-size: 12px;
}

.chat-message.error {
  align-self: center;
  background: #ffebeb;
  color: var(--color-danger);
  font-size: 12px;
}

.chat-loading {
  align-self: flex-start;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.chat-loading-dot {
  width: 8px;
  height: 8px;
  background: #8e8e93;
  border-radius: 50%;
  animation: chatPulse 1.4s ease-in-out infinite;
}

.chat-loading-dot:nth-child(2) {
  animation-delay: 0.2s;
}

.chat-loading-dot:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes chatPulse {
  0%, 100% {
    transform: scale(1);
    opacity: 0.5;
  }
  50% {
    transform: scale(1.3);
    opacity: 1;
  }
}

.chat-error-link {
  color: var(--color-accent);
  cursor: pointer;
  text-decoration: underline;
  margin-left: 4px;
}

.chat-error-link:hover {
  opacity: 0.8;
}

.chat-open-settings {
  color: var(--color-accent);
  cursor: pointer;
  text-decoration: underline;
}

.chat-open-settings:hover {
  opacity: 0.8;
}

.error-popup-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
}

.error-popup {
  background: white;
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
  max-width: 400px;
  width: 90%;
  overflow: hidden;
}

.error-popup-header {
  padding: 14px 16px;
  font-weight: 600;
  font-size: 15px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
  display: flex;
  align-items: center;
  gap: 8px;
}

.error-popup-content {
  padding: 16px;
  font-size: 13px;
  line-height: 1.5;
  max-height: 300px;
  overflow-y: auto;
}

.error-popup-content pre {
  background: #f5f5f5;
  padding: 10px;
  border-radius: 6px;
  font-size: 11px;
  overflow-x: auto;
  margin: 8px 0 0 0;
  white-space: pre-wrap;
  word-break: break-all;
}

.error-popup-footer {
  padding: 12px 16px;
  border-top: 1px solid rgba(0, 0, 0, 0.1);
  text-align: right;
}

.error-popup-close {
  background: var(--color-accent);
  color: white;
  border: none;
  padding: 8px 20px;
  border-radius: 6px;
  font-size: 13px;
  cursor: pointer;
}

.error-popup-close:hover {
  opacity: 0.9;
}

.chat-input-wrap {
  padding: 12px;
  border-top: 1px solid var(--color-window-border);
  display: flex;
  gap: 8px;
}

.chat-input-wrap input {
  flex: 1;
}

.chat-send-btn {
  width: 36px;
  height: 36px;
  padding: 0;
  font-size: 18px;
  font-weight: 600;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.chat-settings-btn {
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
  color: var(--color-text-secondary);
  padding: 8px;
}

.chat-settings {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  top: 0;
  padding: 16px;
  background: rgba(250, 250, 250, 0.98);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  overflow-y: auto;
  z-index: 10;
}

.chat-settings.hidden {
  display: none;
}

.chat-settings-intro {
  font-size: 12px;
  line-height: 1.5;
  color: var(--color-text-secondary);
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--color-window-border);
}

.chat-settings-intro a {
  color: var(--color-text-secondary);
  text-decoration: underline;
}

.chat-settings-intro a:hover {
  color: var(--color-text-primary);
}

.chat-settings-intro .note {
  font-size: 11px;
  color: var(--color-text-tertiary);
  margin-top: 8px;
}

.chat-settings label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: var(--color-text-secondary);
  margin-bottom: 4px;
  margin-top: 12px;
}

.chat-settings label:first-child {
  margin-top: 0;
}

.chat-settings input {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--color-window-border);
  border-radius: var(--radius-button);
  font-size: 13px;
  outline: none;
  transition: border-color 0.15s ease;
}

.chat-settings input:focus {
  border-color: var(--color-accent);
}

.chat-settings input::placeholder {
  color: var(--color-text-tertiary);
}

.chat-settings-hint {
  font-size: 11px;
  color: var(--color-text-tertiary);
  margin-top: 4px;
}

.chat-settings-hint a {
  color: var(--color-text-tertiary);
  text-decoration: underline;
}

.chat-settings-hint a:hover {
  color: var(--color-text-secondary);
}

.chat-settings-note {
  font-size: 11px;
  color: var(--color-text-tertiary);
  margin-top: 12px;
}

.chat-settings-buttons {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.chat-settings-buttons .widget-btn {
  flex: 1;
}

.chat-settings-buttons .widget-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.chat-settings-buttons .widget-btn:disabled:hover {
  opacity: 0.5;
}

.chat-settings-dismiss a {
  font-size: 11px;
  color: var(--color-text-tertiary);
  cursor: pointer;
  text-decoration: underline;
}

.chat-settings-dismiss a:hover {
  color: var(--color-text-secondary);
}

/* Chat Unlock Overlay */
.chat-unlock-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(250, 250, 250, 0.98);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 15;
}

.chat-unlock-overlay.hidden {
  display: none;
}

.chat-unlock-box {
  text-align: center;
  padding: 24px;
  max-width: 240px;
}

.chat-unlock-icon {
  font-size: 36px;
  margin-bottom: 12px;
}

.chat-unlock-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--color-text-primary);
  margin-bottom: 8px;
}

.chat-unlock-desc {
  font-size: 12px;
  color: var(--color-text-secondary);
  margin-bottom: 16px;
  line-height: 1.4;
}

.chat-unlock-input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--color-window-border);
  border-radius: var(--radius-button);
  font-size: 13px;
  margin-bottom: 12px;
  text-align: center;
}

.chat-unlock-input::placeholder {
  color: var(--color-text-tertiary);
}

.chat-unlock-input:focus {
  outline: none;
  border-color: var(--color-accent);
}

.chat-unlock-btn {
  width: 100%;
  padding: 10px 16px;
  background: var(--color-accent);
  color: white;
  border: none;
  border-radius: var(--radius-button);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
}

.chat-unlock-btn:hover {
  opacity: 0.9;
}

.chat-unlock-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.chat-unlock-error {
  font-size: 11px;
  color: var(--color-danger);
  margin-top: 8px;
}

.chat-unlock-error.hidden {
  display: none;
}

.chat-unlock-setup {
  font-size: 11px;
  color: var(--color-text-tertiary);
  margin-top: 12px;
}

.chat-unlock-setup a {
  color: var(--color-accent);
  cursor: pointer;
  text-decoration: none;
}

.chat-unlock-setup a:hover {
  text-decoration: underline;
}

/* ═══════════════════════════════════════════════════════════════════════
   PHOTO WIDGET
   ═══════════════════════════════════════════════════════════════════════ */
#window-photo .window-content {
  overflow: visible;
}

#window-photo .window-titlebar {
  position: relative;
  z-index: 4;
  background: linear-gradient(to bottom, rgba(255, 255, 255, 0.35), transparent);
}

#window-photo .window-resize-handle {
  z-index: 3;
}

.photo-container {
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 12px;
  position: relative;
}

.photo-container.has-photo {
  position: absolute;
  top: -36px;
  left: 0;
  right: 0;
  bottom: 0;
  height: auto;
  padding: 0;
  overflow: hidden;
  z-index: 1;
}

.photo-container.has-photo .photo-drop-zone {
  flex: 1;
  min-height: 0;
}

.photo-drop-zone {
  width: 100%;
  height: 100%;
  border: 2px dashed var(--color-text-tertiary);
  border-radius: var(--radius-input);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--color-text-secondary);
  font-size: 14px;
  transition: all 0.15s ease;
  gap: 8px;
}

.photo-drop-zone.drag-over {
  border-color: var(--color-accent);
  background: rgba(0, 122, 255, 0.05);
}

.photo-drop-text {
  color: var(--color-text-secondary);
}

.photo-upload-text {
  font-size: 12px;
  color: var(--color-text-tertiary);
}

.photo-upload-text a {
  color: var(--color-accent);
  text-decoration: none;
}

.photo-upload-text a:hover {
  text-decoration: underline;
}

/* ═══════════════════════════════════════════════════════════════════════
   CALENDAR WIDGET
   ═══════════════════════════════════════════════════════════════════════ */
.calendar-container {
  height: 100%;
  display: flex;
  flex-direction: column;
  padding: 0 4% 4%;
  container-type: size;
}

.calendar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4%;
  flex-shrink: 0;
}

.calendar-title {
  font-size: clamp(12px, 6cqw, 22px);
  font-weight: 600;
  color: var(--color-text-primary);
  opacity: 0.7;
}

.calendar-nav {
  display: flex;
  gap: 4px;
}

.calendar-nav-btn {
  background: none;
  border: none;
  width: clamp(20px, 8cqw, 32px);
  height: clamp(20px, 8cqw, 32px);
  border-radius: 50%;
  cursor: pointer;
  font-size: clamp(10px, 5cqw, 16px);
  color: var(--color-text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease;
}

.calendar-nav-btn:hover {
  background: rgba(0, 0, 0, 0.05);
}

.calendar-nav-btn i {
  line-height: 1;
}

.calendar-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
  margin-bottom: 2%;
  flex-shrink: 0;
}

.calendar-weekday {
  text-align: center;
  font-size: clamp(7px, 3cqw, 12px);
  font-weight: 500;
  color: var(--color-text-tertiary);
  text-transform: uppercase;
  padding: 2% 0;
}

.calendar-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  grid-template-rows: repeat(5, 1fr);
  gap: 2px;
  flex: 1;
  min-height: 0;
}

.calendar-day {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: clamp(9px, 4cqw, 15px);
  color: var(--color-text-secondary);
  cursor: default;
  min-width: 0;
  min-height: 0;
  position: relative;
}

.calendar-day:not(.other-month) {
  cursor: pointer;
}

.calendar-day.other-month {
  color: var(--color-text-tertiary);
  opacity: 0.5;
}

.calendar-day.today {
  color: white;
  font-weight: 600;
}

.calendar-day.today::before {
  content: '';
  position: absolute;
  width: clamp(18px, 7cqw, 28px);
  height: clamp(18px, 7cqw, 28px);
  background: var(--color-accent);
  border-radius: 50%;
  z-index: -1;
}

.calendar-day.selected::before {
  content: '';
  position: absolute;
  width: clamp(18px, 7cqw, 28px);
  height: clamp(18px, 7cqw, 28px);
  background: rgba(0, 0, 0, 0.12);
  border-radius: 50%;
  z-index: -1;
}

.photo-drop-zone.has-photo {
  border: none;
  padding: 0;
  border-radius: 0;
  position: relative;
}

/* Default photo hover overlay */
.photo-hover-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.45);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.photo-container.is-default:hover .photo-hover-overlay,
.photo-hover-overlay.visible {
  opacity: 1;
  pointer-events: auto;
}

.photo-hover-frame {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: calc(100% - 24px);
  height: calc(100% - 24px);
  border: 2px dashed rgba(255, 255, 255, 0.5);
  border-radius: var(--radius-input);
}

.photo-hover-overlay .photo-drop-text {
  color: rgba(255, 255, 255, 0.9);
  font-size: 14px;
}

.photo-hover-overlay .photo-upload-text {
  color: rgba(255, 255, 255, 0.6);
  font-size: 12px;
}

.photo-hover-overlay .photo-upload-text a {
  color: rgba(255, 255, 255, 0.85);
}

.photo-image {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.photo-nav-btn {
  position: absolute;
  top: calc(50% - 14px);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.25);
  color: white;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.15s ease, background 0.15s ease;
  z-index: 10;
  opacity: 0;
  padding: 0;
}

.photo-drop-zone:hover .photo-nav-btn:not(:disabled) {
  opacity: 1;
}

.photo-nav-btn:hover:not(:disabled) {
  background: rgba(0, 0, 0, 0.4);
}

.photo-nav-btn:disabled {
  display: none;
}

.photo-prev-btn {
  left: 8px;
}

.photo-next-btn {
  right: 8px;
}

.photo-nav-btn i {
  font-size: 16px;
  line-height: 1;
  color: white;
  transform: translateY(1px);
}

/* ═══════════════════════════════════════════════════════════════════════
   WEATHER WIDGET
   ═══════════════════════════════════════════════════════════════════════ */
#window-weather {
  transition: box-shadow 0.15s ease, border-color 0.15s ease, background 1s ease;
}

#window-weather .window-content {
  overflow: visible;
}

#window-weather .window-titlebar {
  position: relative;
  z-index: 4;
}

.weather-container {
  height: calc(100% + 36px);
  display: flex;
  flex-direction: column;
  padding: 38px 16px 30px;
  position: relative;
  top: -36px;
  container-type: size;
}

.weather-bg-image {
  position: absolute;
  top: 60%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 75%;
  aspect-ratio: 1;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  filter: blur(4px);
  opacity: 0.45;
  pointer-events: none;
  z-index: 0;
}

.weather-loading,
.weather-error {
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--color-text-secondary);
  font-size: 13px;
  gap: 12px;
}

.weather-error {
  color: var(--color-text-tertiary);
}

.weather-location-input {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  max-width: 200px;
}

.weather-location-input input {
  padding: 8px 10px;
  border: 1px solid var(--color-window-border);
  border-radius: var(--radius-button);
  font-size: 13px;
  text-align: center;
}

.weather-permission-hint {
  font-size: 11px;
  color: var(--color-text-tertiary);
  line-height: 1.4;
  max-width: 200px;
  margin-top: 4px;
}

.weather-autocomplete {
  position: relative;
  width: 100%;
}

.weather-autocomplete-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: white;
  border: 1px solid var(--color-window-border);
  border-radius: var(--radius-button);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  max-height: 150px;
  overflow-y: auto;
  z-index: 100;
  margin-top: 4px;
}

.weather-autocomplete-item {
  padding: 8px 10px;
  font-size: 13px;
  cursor: pointer;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.weather-autocomplete-item:last-child {
  border-bottom: none;
}

.weather-autocomplete-item:hover {
  background: rgba(0, 0, 0, 0.05);
}

.weather-autocomplete-city {
  color: var(--color-text-primary);
}

.weather-autocomplete-region {
  color: var(--color-text-tertiary);
  font-size: 12px;
}

.weather-autocomplete-loading {
  padding: 8px 10px;
  font-size: 12px;
  color: var(--color-text-tertiary);
  text-align: center;
}

.weather-content {
  display: flex;
  flex-direction: column;
  height: 100%;
  align-items: center;
  justify-content: space-between;
  position: relative;
  z-index: 1;
}

.weather-city {
  font-size: clamp(12px, 6cqw, 22px);
  font-weight: 500;
  color: var(--color-text-secondary);
  margin-bottom: 4px;
  align-self: flex-start;
  text-decoration: none;
  cursor: pointer;
}

.weather-main {
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: 100%;
}

.weather-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 1;
  position: relative;
}

.weather-icon::before {
  content: '';
  position: absolute;
  width: 180%;
  height: 180%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.8) 0%, rgba(255, 255, 255, 0.35) 35%, rgba(255, 255, 255, 0.1) 60%, transparent 80%);
  pointer-events: none;
  z-index: 0;
}

.weather-icon-img {
  width: clamp(40px, 24cqw, 68px);
  height: clamp(40px, 24cqw, 68px);
  object-fit: contain;
  position: relative;
  z-index: 1;
}

.weather-temp {
  font-family: var(--font-clock);
  font-size: clamp(24px, 22cqw, 72px);
  font-weight: 600;
  color: var(--color-text-primary);
  letter-spacing: -1px;
  flex-shrink: 0;
  margin-left: 4px;
  opacity: 0.7;
}

.weather-condition {
  font-size: clamp(12px, 6cqw, 22px);
  color: var(--color-text-secondary);
  text-align: center;
}

.weather-details {
  display: flex;
  justify-content: center;
  gap: 10px;
  font-size: clamp(12px, 6cqw, 20px);
  color: var(--color-text-secondary);
  white-space: nowrap;
  position: relative;
  z-index: 2;
  flex-shrink: 0;
  margin-top: 10px;
  padding-bottom: 4px;
}

.weather-detail-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
}

.weather-detail-value {
  font-weight: 600;
}

.weather-detail-label {
  font-size: clamp(9px, 4.5cqw, 16px);
  opacity: 0.7;
}

.weather-detail-label i {
  font-size: clamp(9px, 4.5cqw, 16px);
  line-height: 1;
}

.weather-high {
  color: var(--color-text-primary);
}

.weather-low {
  color: var(--color-text-primary);
}

/* ═══════════════════════════════════════════════════════════════════════
   QUOTES WIDGET
   ═══════════════════════════════════════════════════════════════════════ */

/* Paper texture covers entire widget including titlebar */
#window-quotes::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.35;
  background: url('/images/quotes/paper-texture.svg');
  background-size: 300px 300px;
  border-radius: inherit;
  mix-blend-mode: multiply;
}

#window-quotes .window-titlebar {
  position: relative;
  z-index: 2;
}

#window-quotes {
  overflow: hidden;
}

#window-quotes .window-content {
  position: relative;
  z-index: 1;
  overflow: visible;
}

#window-quotes .window-resize-handle {
  z-index: 3;
}

#window-quotes .window-menu-popup {
  background: rgba(255, 255, 255, 1);
}

.quotes-container {
  position: absolute;
  top: -36px;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  padding: 40px 14px 20px 14px; /* top padding clears the titlebar */
  justify-content: flex-end;
  container-type: size;
}

.quotes-author-image {
  position: absolute;
  top: 1%;
  right: -10%;
  width: 70%;
  aspect-ratio: 1;
  border-radius: 50%;
  background-size: cover;
  background-position: center;
  opacity: 0.3;
  pointer-events: none;
  z-index: 0;
}

.quotes-loading {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-tertiary);
  font-size: 13px;
}

.quotes-error {
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--color-text-tertiary);
  font-size: 13px;
  gap: 8px;
}

.quotes-content {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  overflow: visible;
  position: relative;
  z-index: 1;
}

.quotes-text {
  font-family: 'Georgia', 'Times New Roman', serif;
  font-size: clamp(11px, 7cqw, 28px);
  font-style: italic;
  line-height: 1.45;
  color: var(--color-text-primary);
  text-align: center;
  margin-bottom: 10px;
}

.quotes-text::before {
  content: '"';
}

.quotes-text::after {
  content: '"';
}

.quotes-author-line {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  position: relative;
}

.quotes-author {
  font-size: clamp(8px, 4.5cqw, 14px);
  color: var(--color-text-secondary);
}

.quotes-author::before {
  content: '— ';
}

.quotes-info-icon {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-tertiary);
  cursor: help;
  user-select: none;
}

.quotes-info-icon i {
  font-size: 10px;
  line-height: 1;
  transform: translateY(-1px);
}

.quotes-info-icon:hover {
  color: var(--color-text-secondary);
}

.quotes-info-tooltip {
  position: absolute;
  bottom: 100%;
  right: 0;
  margin-bottom: 6px;
  background: rgba(40, 40, 40, 0.95);
  color: #fff;
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 9px;
  font-family: var(--font-body);
  font-style: normal;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.15s, visibility 0.15s;
  z-index: 10000;
  width: 140px;
  text-align: left;
  line-height: 1.3;
  pointer-events: none;
}

.quotes-info-tooltip::after {
  content: '';
  position: absolute;
  top: 100%;
  right: 4px;
  border: 5px solid transparent;
  border-top-color: rgba(40, 40, 40, 0.95);
}

.quotes-info-icon:hover .quotes-info-tooltip {
  opacity: 1;
  visibility: visible;
}

/* ═══════════════════════════════════════════════════════════════════════
   PLANT WIDGET
   ═══════════════════════════════════════════════════════════════════════ */

/* Transparent window so plant image shows through the titlebar */
#window-plant {
  background: transparent !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

#window-plant .window-content {
  overflow: visible;
}

#window-plant .window-titlebar {
  position: relative;
  z-index: 4;
}

#window-plant .window-resize-handle {
  z-index: 3;
}

.plant-widget {
  height: 100%;
  position: relative;
  overflow: visible;
}

.plant-widget.night-mode .plant-image-container {
  filter: brightness(0.6) saturate(0.7) sepia(0.3) hue-rotate(180deg);
}

/* Plant window in night mode */
#window-plant.night-mode {
  border-color: rgba(0, 0, 0, 0.4);
}

#window-plant.night-mode .window-title {
  color: rgba(255, 255, 255, 0.85);
}

#window-plant.night-mode .window-menu-btn {
  color: rgba(255, 255, 255, 0.7);
  background: rgba(255, 255, 255, 0.1);
}

#window-plant.night-mode .window-menu-btn:hover {
  background: rgba(255, 255, 255, 0.2);
}

.plant-image-container {
  position: absolute;
  top: -36px;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 0;
}

@media (pointer: coarse) {
  .plant-image-container {
    top: -44px;
  }
}

.plant-image-container img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.plant-controls {
  position: absolute;
  bottom: 12px;
  right: 12px;
  z-index: 3;
}

.plant-water-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.5);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s ease, background 0.15s ease;
  padding: 0;
}

.plant-water-btn:hover {
  transform: scale(1.1);
}

.plant-water-btn.watered {
  background: rgba(52, 199, 89, 0.3);
}

.plant-water-btn.watering {
  animation: plantWatering 0.6s ease;
}

@keyframes plantWatering {
  0% { transform: rotate(0deg); }
  25% { transform: rotate(-20deg); }
  50% { transform: rotate(0deg); }
  75% { transform: rotate(-10deg); }
  100% { transform: rotate(0deg); }
}

.plant-water-icon {
  width: 26px;
  height: 26px;
  object-fit: contain;
}


/* ═══════════════════════════════════════════════════════════════════════
   SEARCH WIDGET
   ═══════════════════════════════════════════════════════════════════════ */
.search-container {
  height: 100%;
  display: flex;
  flex-direction: column;
}

.search-form {
  display: flex;
  width: 100%;
  gap: 6px;
  flex-shrink: 0;
  padding: 0 10px 6px;
}

.search-input {
  flex: 1;
  padding: 6px 8px;
  border: 1px solid var(--color-window-border);
  border-radius: var(--radius-input);
  font-size: 12px;
  font-family: var(--font-body);
  background: rgba(255, 255, 255, 0.8);
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.search-input:focus {
  border-color: var(--color-accent);
}

.search-input::placeholder {
  color: var(--color-text-tertiary);
}

.search-btn {
  padding: 6px 10px;
  border: none;
  border-radius: var(--radius-button);
  background: var(--color-accent);
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  transition: background 0.15s ease, transform 0.1s ease, opacity 0.15s ease;
  opacity: 0.5;
}

.search-btn i {
  line-height: 1;
  transform: translateY(1px);
}

.window.focused .search-btn {
  opacity: 1;
}

.search-btn:hover {
  opacity: 1;
}

.search-btn:active {
  transform: scale(0.95);
}

.search-history {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-content: flex-start;
  padding: 8px 10px;
}

.search-history-item {
  padding: 4px 10px;
  background: rgba(0, 0, 0, 0.05);
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 12px;
  font-size: 12px;
  color: var(--color-text-secondary);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
  white-space: nowrap;
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.search-history-item:hover {
  background: var(--color-accent);
  color: white;
  border-color: var(--color-accent);
}

/* ═══════════════════════════════════════════════════════════════════════
   SCROLLBAR STYLES
   ═══════════════════════════════════════════════════════════════════════ */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 0, 0, 0.3);
}

/* ═══════════════════════════════════════════════════════════════════════
   ABOUT MODAL
   ═══════════════════════════════════════════════════════════════════════ */
.about-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
}

.about-modal {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.97) 0%, rgba(255, 243, 230, 0.95) 50%, rgba(255, 230, 225, 0.95) 100%);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
  width: 500px;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  text-align: center;
}

.about-modal-content {
  padding: 24px 20px;
}

.about-app-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 12px;
  border-radius: 12px;
}

.about-app-name {
  font-size: 18px;
  font-weight: 600;
  color: var(--color-text-primary);
  margin-bottom: 8px;
}

.about-version {
  font-size: 13px;
  color: var(--color-text-secondary);
  margin-bottom: 4px;
}

.about-date {
  font-size: 12px;
  color: var(--color-text-tertiary);
}

.about-modal-footer {
  padding: 4px 20px 16px;
}

.about-close-btn {
  background: var(--color-accent);
  color: white;
  border: none;
  padding: 8px 24px;
  border-radius: 6px;
  font-size: 13px;
  cursor: pointer;
  font-family: inherit;
}

.about-close-btn:hover {
  opacity: 0.9;
}

.about-tip {
  font-size: 13px;
  color: var(--color-text-secondary);
  margin-top: 16px;
  line-height: 1.5;
}

.about-tip-link {
  color: var(--color-accent);
  text-decoration: none;
}

.about-tip-link:hover {
  text-decoration: underline;
}

.about-apps {
  font-size: 13px;
  color: var(--color-text-secondary);
  margin-top: 8px;
  line-height: 1.5;
}

.about-apps-link {
  color: var(--color-accent);
  text-decoration: none;
}

.about-apps-link:hover {
  text-decoration: underline;
}

.about-privacy {
  font-size: 13px;
  color: var(--color-text-secondary);
  margin-top: 16px;
  line-height: 1.5;
  padding-top: 12px;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
}

.about-attribution {
  font-size: 11px;
  color: var(--color-text-tertiary);
  margin-top: 12px;
}

.about-attribution a {
  color: var(--color-text-tertiary);
  text-decoration: underline;
}

.about-legal {
  font-size: 11px;
  color: var(--color-text-tertiary);
  margin-top: 8px;
}

.about-legal a {
  color: var(--color-text-tertiary);
  text-decoration: underline;
}

.about-copyright {
  font-size: 11px;
  color: var(--color-text-tertiary);
  margin-top: 8px;
}

/* ═══════════════════════════════════════════════════════════════════════
   COOKIE CONSENT BANNER
   ═══════════════════════════════════════════════════════════════════════ */
.consent-banner {
  position: fixed;
  bottom: 20px;
  left: 20px;
  right: 20px;
  max-width: 480px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.97) 0%, rgba(255, 243, 230, 0.95) 50%, rgba(255, 230, 225, 0.95) 100%);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
  padding: 20px;
  z-index: 10001;
}

.consent-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--color-text-primary);
  margin-bottom: 12px;
}

.consent-message {
  font-size: 13px;
  color: var(--color-text-secondary);
  line-height: 1.5;
  margin-bottom: 16px;
}

.consent-buttons {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

.consent-btn {
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: opacity 0.15s ease;
}

.consent-btn.primary {
  background: var(--color-accent);
  color: white;
}

.consent-btn.primary:hover {
  opacity: 0.9;
}

.consent-btn.secondary {
  background: rgba(0, 0, 0, 0.05);
  color: var(--color-text-secondary);
}

.consent-btn.secondary:hover {
  background: rgba(0, 0, 0, 0.1);
}

/* ═══════════════════════════════════════════════════════════════════════
   TIP MODAL
   ═══════════════════════════════════════════════════════════════════════ */
.tip-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
}

.tip-modal {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
  width: 400px;
  overflow: hidden;
  text-align: center;
}

.tip-modal-content {
  padding: 24px 24px 20px;
}

.tip-modal-icon {
  margin-bottom: 16px;
}

.tip-modal-icon img {
  width: 64px;
  height: 64px;
  border-radius: 14px;
}

.tip-modal-title {
  font-size: 20px;
  font-weight: 600;
  color: var(--color-text-primary);
  margin-bottom: 12px;
}

.tip-modal-message {
  font-size: 14px;
  color: var(--color-text-secondary);
  line-height: 1.5;
  margin-bottom: 20px;
}

.tip-modal-buttons {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.tip-modal-btn {
  padding: 12px 40px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: opacity 0.15s ease;
  align-self: center;
}

.tip-modal-btn.primary {
  background: var(--color-accent);
  color: white;
}

.tip-modal-btn.primary:hover {
  opacity: 0.9;
}

.tip-modal-btn.secondary {
  background: rgba(0, 0, 0, 0.05);
  color: var(--color-text-secondary);
}

.tip-modal-btn.secondary:hover {
  background: rgba(0, 0, 0, 0.1);
}

.tip-modal-links {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
}

.tip-modal-link {
  font-size: 14px;
  color: var(--color-text-tertiary);
  cursor: pointer;
  text-decoration: none;
}

.tip-modal-link#tip-remind-later {
  margin-bottom: 4px;
}

.tip-modal-link:hover {
  text-decoration: underline;
}

/* ═══════════════════════════════════════════════════════════════════════
   ONBOARDING MODAL
   ═══════════════════════════════════════════════════════════════════════ */
.onboarding-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
}

.onboarding-modal {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.97) 0%, rgba(255, 243, 230, 0.95) 50%, rgba(255, 230, 225, 0.95) 100%);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
  width: 780px;
  aspect-ratio: 1.54 / 1;
  max-width: 90%;
  max-height: 90%;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.onboarding-modal-header {
  padding: 20px 48px 16px 48px;
  text-align: center;
}

.onboarding-modal-icon {
  margin-bottom: 12px;
}

.onboarding-modal-icon img {
  width: 64px;
  height: 64px;
  border-radius: 14px;
}

.onboarding-modal-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--color-text-primary);
  margin-bottom: 8px;
}

.onboarding-modal-subtitle {
  font-size: 14px;
  color: var(--color-text-secondary);
  line-height: 1.4;
}

.onboarding-modal-content {
  padding: 8px 24px;
  flex: 1;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.onboarding-steps {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.onboarding-step-image {
  width: 100%;
  flex: 1;
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
}

.onboarding-step-image img,
.onboarding-step-image video {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 8px;
}

.onboarding-step-image {
  display: flex;
  align-items: center;
  justify-content: center;
}

.onboarding-video-wrapper {
  position: relative;
  max-width: 100%;
  height: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 8px;
  overflow: hidden;
}

.onboarding-video-wrapper iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: 8px;
}

.onboarding-video-placeholder {
  position: relative;
  max-width: 100%;
  height: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 8px;
  overflow: hidden;
  background: #000;
}

.onboarding-video-placeholder img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.7;
}

.onboarding-video-play {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: white;
  text-decoration: none;
  transition: opacity 0.15s ease;
}

.onboarding-video-play:hover {
  opacity: 0.8;
}

.onboarding-video-play i {
  font-size: 48px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  width: 80px;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(10px);
}

.onboarding-video-play span {
  font-size: 14px;
  font-weight: 500;
  background: rgba(0, 0, 0, 0.5);
  padding: 6px 12px;
  border-radius: 4px;
}

.onboarding-video-loading {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.3s ease;
}

.onboarding-video-loading.hidden {
  opacity: 0;
  pointer-events: none;
}

.onboarding-video-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(0, 0, 0, 0.1);
  border-top-color: #666;
  border-radius: 50%;
  animation: onboarding-spin 0.8s linear infinite;
}

@keyframes onboarding-spin {
  to { transform: rotate(360deg); }
}

.onboarding-step-nav {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-top: 16px;
}

.onboarding-step-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: rgba(0, 0, 0, 0.05);
  font-size: 18px;
  color: #555;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  padding: 0;
}

.onboarding-step-btn i {
  line-height: 1;
  transform: translateY(1px);
}

.onboarding-step-btn:hover:not(:disabled) {
  background: rgba(0, 0, 0, 0.05);
}

.onboarding-step-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.onboarding-step-dots {
  display: flex;
  gap: 8px;
}

.onboarding-step-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.2);
  transition: all 0.2s;
}

.onboarding-step-dot.active {
  background: #888;
}

.onboarding-step-label {
  font-size: 13px;
  color: var(--color-text-secondary);
  text-align: center;
  margin-top: 12px;
}

.onboarding-modal-footer {
  padding: 8px 48px 16px 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.onboarding-back-btn {
  position: absolute;
  right: calc(50% + 70px);
  background: none;
  border: none;
  font-size: 14px;
  font-weight: 500;
  color: var(--color-text-tertiary);
  cursor: pointer;
  font-family: inherit;
  padding: 10px 16px;
}

.onboarding-back-btn:hover {
  color: var(--color-text-secondary);
}

.onboarding-dont-show {
  position: absolute;
  left: 24px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--color-text-secondary);
  cursor: pointer;
  user-select: none;
}

.onboarding-checkbox {
  font-size: 18px;
  color: var(--color-text-tertiary);
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.onboarding-checkbox i {
  line-height: 1;
  transform: translateY(-1px);
}

.onboarding-checkbox.checked {
  color: var(--color-accent);
}

.onboarding-close-btn {
  background: var(--color-accent);
  color: white;
  border: none;
  padding: 10px 24px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
}

.onboarding-close-btn:hover {
  opacity: 0.9;
}

/* -----------------------------------------------------------------------
   ONBOARDING FLOW — 3-phase animation system
   ----------------------------------------------------------------------- */

/* Modal body (flex child that grows to fill remaining space) */
.onboarding-modal-body {
  flex: 1;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

/* Splash element (shared across phases, transitions size/position) */
.onboarding-splash {
  text-align: center;
  padding: 20px 48px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: transform 1.5s ease, padding 1.5s ease;
}

.onboarding-splash-icon img {
  border-radius: 14px;
  transition: width 1.5s ease, height 1.5s ease;
}

.onboarding-splash-title {
  font-weight: 600;
  color: rgb(80, 35, 35);
  transition: font-size 1.5s ease, margin-top 1.5s ease;
}

.onboarding-splash-desc {
  color: rgb(80, 35, 35);
  font-weight: 500;
  line-height: 1.35;
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: font-size 1.5s ease, margin-top 1.5s ease, max-height 1.5s ease, opacity 1s ease;
}

/* ---- Phase 1: Splash (centered, large) ---- */
.onboarding-modal--phase1 .onboarding-splash {
  transform: translateY(85px);
  padding: 40px 48px 20px;
}

.onboarding-modal--phase1 .onboarding-splash-icon img {
  width: 240px;
  height: 240px;
  opacity: 0;
  animation: onboardingFadeIn 1.8s ease forwards;
}

.onboarding-modal--phase1 .onboarding-splash-title {
  font-size: 32px;
  margin-top: 24px;
  opacity: 0;
  animation: onboardingFadeIn 1.4s ease 1.5s forwards;
}

.onboarding-modal--phase1 .onboarding-splash-desc {
  font-size: 0;
  margin-top: 0;
}

.onboarding-modal--phase1 .onboarding-modal-body {
  visibility: hidden;
  opacity: 0;
}

.onboarding-modal--phase1 .onboarding-modal-footer {
  display: none;
}

/* ---- Phase 2: Description (header shrinks, tagline appears large) ---- */
.onboarding-modal--phase2 .onboarding-splash {
  transform: translateY(60px);
  padding: 20px 48px 12px;
}

.onboarding-modal--phase2 .onboarding-splash-icon img {
  width: 48px;
  height: 48px;
}

.onboarding-modal--phase2 .onboarding-splash-title {
  font-size: 18px;
  margin-top: 10px;
}

.onboarding-modal--phase2 .onboarding-splash-desc {
  font-size: clamp(20px, 3.2vw, 30px);
  margin-top: 28px;
  max-height: 200px;
  opacity: 1;
  transition: font-size 1.5s ease, margin-top 1.5s ease, max-height 1.5s ease, opacity 1s ease 1.5s;
}

/* Widget icons row (Phase 2) */
.onboarding-splash-icons {
  display: flex;
  gap: 20px;
  margin-top: 28px;
  justify-content: center;
}

.onboarding-splash-icons i {
  font-size: 32px;
  color: rgb(80, 35, 35);
  opacity: 0;
  transform: scale(0.5);
  animation: onboardingIconIn 0.5s ease forwards;
}

.onboarding-modal--phase1 .onboarding-splash-icons {
  display: none;
}

.onboarding-splash-icons--exit {
  transition: opacity 0.35s ease;
  opacity: 0 !important;
}

.onboarding-modal--phase3 .onboarding-splash-icons {
  display: none;
}

@keyframes onboardingIconIn {
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.onboarding-modal--phase2 .onboarding-modal-body {
  visibility: hidden;
  opacity: 0;
}

.onboarding-modal--phase2 .onboarding-modal-footer {
  display: flex;
}

/* Bullet list */
.onboarding-bullets {
  display: flex;
  flex-direction: column;
  gap: clamp(8px, 1.2vw, 14px);
  padding: 8px 48px 12px;
  overflow: hidden;
}

.onboarding-bullet {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: clamp(14px, 1.9vw, 17px);
  font-weight: 400;
  line-height: 1.35;
  color: rgb(150, 80, 80);
  opacity: 0;
  transform: translateY(12px);
  animation: bulletAppear 1.45s ease forwards;
}

.onboarding-bullet b {
  color: rgb(80, 35, 35);
  font-weight: 400;
  margin-right: -3px;
}

.onboarding-bullet-icon {
  flex-shrink: 0;
  width: 18px;
  font-size: clamp(14px, 1.7vw, 17px);
  color: rgb(80, 35, 35);
  margin-top: 4px;
}

/* Continue button (appears after last bullet) */
.onboarding-continue-wrap {
  display: flex;
  justify-content: center;
  padding: 10px 0 4px;
  opacity: 0;
  animation: bulletAppear 1.45s ease forwards;
}

.onboarding-continue-btn {
  background: var(--color-accent);
  color: white;
  border: none;
  padding: 12px 40px;
  border-radius: 10px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: opacity 0.15s ease;
}

.onboarding-continue-btn:hover {
  opacity: 0.85;
}

@media (max-height: 550px) {
  .onboarding-bullets { gap: 6px; padding: 4px 24px 6px; }
  .onboarding-bullet { font-size: 12px; gap: 8px; line-height: 1.3; }
  .onboarding-bullet-icon { font-size: 12px; width: 14px; margin-top: 2px; }
  .onboarding-continue-wrap { padding: 6px 0 2px; }
  .onboarding-continue-btn { padding: 8px 28px; font-size: 13px; }
  .onboarding-modal--phase3 .onboarding-splash { padding: 10px 24px 0; }
  .onboarding-modal--phase3 .onboarding-splash-icon img { width: 36px; height: 36px; }
  .onboarding-modal--phase3 .onboarding-splash-title { font-size: 15px; margin-top: 6px; }
  .onboarding-modal--phase3 .onboarding-splash-desc { font-size: 12px; margin-top: 4px; }
}

/* ---- Phase 3: Bullets (description shrinks, bullets appear) ---- */
.onboarding-modal--phase3 .onboarding-splash {
  transform: translateY(0);
  padding: 20px 48px 18px;
}

.onboarding-modal--phase3 .onboarding-splash-icon img {
  width: 48px;
  height: 48px;
}

.onboarding-modal--phase3 .onboarding-splash-title {
  font-size: 18px;
  margin-top: 10px;
}

.onboarding-modal--phase3 .onboarding-splash-desc {
  font-size: 15px;
  font-weight: 400;
  margin-top: 6px;
  max-height: 200px;
  opacity: 0.7;
  transition: font-size 1.5s ease, margin-top 1.5s ease, opacity 1s ease;
}

.onboarding-modal--phase3 .onboarding-modal-body {
  visibility: visible;
  opacity: 0;
  animation: onboardingFadeIn 1.4s ease 1.3s forwards;
}

.onboarding-modal--phase3 .onboarding-modal-footer {
  display: flex;
}

/* Footer enter (fade in) */
.onboarding-modal-footer--enter {
  opacity: 0;
  animation: onboardingFadeIn 1.4s ease 1.3s forwards;
}

/* ---- Keyframes ---- */
@keyframes onboardingFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes bulletAppear {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideLeftOut {
  to {
    transform: translateX(-100%);
    opacity: 0;
  }
}

@keyframes slideRightIn {
  from {
    transform: translateX(60%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* ═══════════════════════════════════════════════════════════════════════
   SOLITAIRE WIDGET
   ═══════════════════════════════════════════════════════════════════════ */

/* Window overrides for solitaire (green background flows through titlebar) */
#window-solitaire {
  background: transparent !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  border-color: rgba(0, 0, 0, 0.15);
}

#window-solitaire .window-content {
  overflow: visible;
}

#window-solitaire .window-title {
  color: rgba(255, 255, 255, 0.85);
}

#window-solitaire .window-menu-btn {
  color: rgba(255, 255, 255, 0.7);
  background: rgba(255, 255, 255, 0.1);
}

#window-solitaire .window-menu-btn:hover {
  background: rgba(255, 255, 255, 0.2);
}

#window-solitaire .window-resize-handle i {
  color: rgba(255, 255, 255, 0.3);
}

#window-solitaire .window-titlebar {
  position: relative;
  z-index: 4;
  background: transparent;
}

#window-solitaire .window-resize-handle {
  z-index: 3;
}

.sol-container {
  width: 100%;
  height: calc(100% + 36px);
  margin-top: -36px;
  background: linear-gradient(135deg, #349921 0%, #277714 40%, #1d5e0f 100%);
  overflow: hidden;
  position: relative;
  border-radius: 12px;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

@media (pointer: coarse) {
  .sol-container {
    height: calc(100% + 44px);
    margin-top: -44px;
  }
  .sol-scale-wrapper {
    top: 44px;
  }
}

.sol-scale-wrapper {
  position: absolute;
  top: 36px;
  left: 0;
  width: 463px;
  transform-origin: top left;
  padding: 6px;
  box-sizing: border-box;
}

/* Top row: stock, waste, spacer, 4 foundations */
.sol-top-row {
  display: flex;
  gap: 5px;
  margin-bottom: 10px;
  align-items: flex-start;
}

.sol-spacer {
  width: 20px;
  flex-shrink: 0;
}

.sol-foundations {
  display: flex;
  gap: 5px;
}

/* Card slots */
.sol-stock,
.sol-waste,
.sol-foundation {
  width: 60px;
  height: 85px;
  border-radius: 6px;
  position: relative;
  flex-shrink: 0;
  cursor: pointer;
}

.sol-empty-slot {
  width: 60px;
  height: 85px;
  border: 2px dashed rgba(255, 255, 255, 0.25);
  border-radius: 6px;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  color: rgba(255, 255, 255, 0.25);
}

.sol-foundation-slot {
  font-size: 28px;
}

.sol-foundation-slot.sol-red {
  color: rgba(200, 50, 50, 0.3);
}

.sol-foundation-slot.sol-black {
  color: rgba(0, 0, 0, 0.25);
}

.sol-redeal-icon {
  cursor: pointer;
  color: rgba(255, 255, 255, 0.45);
  font-size: 20px;
}

.sol-redeal-icon:hover {
  color: rgba(255, 255, 255, 0.7);
}

/* Cards */
.sol-card {
  width: 60px;
  height: 85px;
  border-radius: 6px;
  overflow: hidden;
  position: relative;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
  cursor: pointer;
  flex-shrink: 0;
}

.sol-card img {
  width: 100%;
  height: 100%;
  display: block;
  pointer-events: none;
  border-radius: 6px;
}

.sol-face-down {
  cursor: default;
}

.sol-stock-card {
  cursor: pointer;
}

/* Tableau */
.sol-tableau {
  display: flex;
  gap: 5px;
  align-items: flex-start;
}

.sol-tableau-col {
  width: 60px;
  min-height: 85px;
  position: relative;
  flex-shrink: 0;
}

.sol-tableau-card {
  position: absolute;
  left: 0;
  width: 60px;
}

.sol-tableau-empty {
  min-height: 85px;
}

/* Drag ghost */
.sol-drag-ghost {
  position: absolute;
  pointer-events: none;
  z-index: 9999;
  opacity: 0.92;
}

.sol-drag-ghost .sol-card {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.45);
}

.sol-drag-card {
  position: absolute;
  left: 0;
  width: 60px;
}

/* Controls (below tableau) */
.sol-controls {
  display: flex;
  gap: 8px;
  margin-top: 6px;
  justify-content: center;
}

.sol-ctrl-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: rgba(255, 255, 255, 0.9);
  padding: 5px 14px;
  border-radius: 50px;
  font-size: 12px;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s;
  white-space: nowrap;
  line-height: 1.2;
}

.sol-ctrl-btn i {
  font-size: 11px;
  line-height: 1;
}

.sol-ctrl-btn:hover {
  background: rgba(255, 255, 255, 0.3);
}

.sol-ctrl-btn:disabled {
  opacity: 0.35;
  cursor: default;
}

.sol-ctrl-btn:disabled:hover {
  background: rgba(255, 255, 255, 0.15);
}

/* Win overlay */
.sol-win-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  border-radius: 0 0 12px 12px;
}

.sol-win-box {
  background: white;
  border-radius: 12px;
  padding: 24px 36px;
  text-align: center;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.sol-win-message {
  font-size: 22px;
  font-weight: 600;
  color: #277714;
  margin-bottom: 16px;
}

.sol-win-btn {
  background: #277714;
  color: white;
  border: none;
  padding: 8px 24px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  transition: opacity 0.15s;
}

.sol-win-btn:hover {
  opacity: 0.85;
}

/* Undo button */
.sol-undo-ctrl:disabled {
  opacity: 0.35;
  cursor: default;
}

.sol-undo-ctrl i {
  font-size: 10px;
  margin-right: 2px;
}

/* Stuck overlay */
.sol-stuck-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  border-radius: 0 0 12px 12px;
}

.sol-stuck-box {
  background: white;
  border-radius: 12px;
  padding: 20px 30px;
  text-align: center;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.sol-stuck-message {
  font-size: 18px;
  font-weight: 600;
  color: #c0392b;
  margin-bottom: 6px;
}

.sol-stuck-sub {
  font-size: 12px;
  color: #888;
  margin-bottom: 16px;
}

.sol-stuck-actions {
  display: flex;
  gap: 8px;
  justify-content: center;
}

.sol-stuck-undo-btn,
.sol-stuck-new-btn {
  border: none;
  padding: 8px 20px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  transition: opacity 0.15s;
}

.sol-stuck-undo-btn {
  background: #3498db;
  color: white;
}

.sol-stuck-new-btn {
  background: #277714;
  color: white;
}

.sol-stuck-undo-btn:hover,
.sol-stuck-new-btn:hover {
  opacity: 0.85;
}

/* ═══════════════════════════════════════════════════════════════════════
   BREAKOUT WIDGET
   ═══════════════════════════════════════════════════════════════════════ */

.brk-container {
  width: 100%;
  height: 100%;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #1a1a2e;
  cursor: none;
}

.brk-canvas {
  display: block;
}

#window-breakout .window-titlebar {
  background: #1a1a2e;
  border-bottom: 1px solid #2a2a4a;
}

#window-breakout .window-title {
  color: #fff;
}

#window-breakout .window-menu-btn,
#window-breakout .window-menu-btn i {
  color: #aaa;
}

#window-breakout .window-resize-handle i {
  color: #444;
}

/* ═══════════════════════════════════════════════════════════════════════
   MEETING PLANNER WIDGET
   ═══════════════════════════════════════════════════════════════════════ */

/* Settings panel */
.mp-settings {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 16px;
  background: rgba(250, 250, 250, 0.98);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  overflow-y: auto;
  z-index: 10;
}

.mp-settings.hidden {
  display: none;
}

.mp-settings label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: var(--color-text-secondary);
  margin-bottom: 4px;
  margin-top: 10px;
}

.mp-settings label:first-of-type {
  margin-top: 0;
}

.mp-opt {
  color: var(--color-text-tertiary);
  font-weight: 400;
}

.mp-settings input[type="text"],
.mp-settings input[type="date"] {
  width: 100%;
  padding: 7px 10px;
  border: 1px solid var(--color-window-border);
  border-radius: var(--radius-button);
  font-size: 13px;
  font-family: inherit;
  background: white;
  outline: none;
}

.mp-settings input:focus {
  border-color: var(--color-accent);
}

.mp-settings input::placeholder {
  color: var(--color-text-tertiary);
}

.mp-settings-error {
  font-size: 12px;
  color: var(--color-danger);
  margin-top: 10px;
}

.mp-settings-error.hidden {
  display: none;
}

.mp-settings-buttons {
  display: flex;
  gap: 8px;
  margin-top: 14px;
}

.mp-settings-buttons .widget-btn {
  flex: 1;
}

/* Main view */
.mp-main {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 0 0 0 2%;
  container-type: size;
}

/* Navigation */
.mp-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2%;
  flex-shrink: 0;
  gap: 4px;
  padding-left: 2%;
  padding-right: 2%;
}

.mp-date-label {
  font-size: clamp(12px, 4cqw, 18px);
  font-weight: 600;
  color: var(--color-text-primary);
  opacity: 0.7;
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mp-nav-buttons {
  display: flex;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
}

.mp-nav-btn {
  background: none;
  border: none;
  width: clamp(20px, 8cqw, 32px);
  height: clamp(20px, 8cqw, 32px);
  border-radius: 50%;
  cursor: pointer;
  font-size: clamp(10px, 5cqw, 16px);
  color: var(--color-text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.mp-nav-btn:hover {
  background: rgba(0, 0, 0, 0.05);
}

/* Header */
.mp-table {
  width: 100%;
  table-layout: fixed;
  border-collapse: separate;
  border-spacing: 1px;
}

.mp-hcell {
  font-size: 11px;
  font-weight: 600;
  color: var(--color-text-secondary);
  padding: 4px 6px;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
}


.mp-hcell-dst {
  font-size: 8px;
  color: #e6a800;
  flex-shrink: 0;
}

.mp-hcell-arrow {
  font-size: 10px;
  color: var(--color-text-tertiary);
  flex-shrink: 0;
}

.mp-hcell-name {
  overflow: hidden;
  text-overflow: ellipsis;
}

.mp-hcell-input {
  width: 100%;
  border: 1px solid var(--color-accent);
  border-radius: 3px;
  font-size: 11px;
  font-weight: 600;
  font-family: inherit;
  text-align: center;
  padding: 2px 4px;
  outline: none;
  background: white;
}

.mp-hcell-input::-webkit-calendar-picker-indicator,
.mp-hcell-input::-webkit-list-button {
  display: none !important;
}

/* Time grid */
.mp-grid {
  flex: 1;
  overflow-y: auto;
}

.mp-cell {
  font-size: 11px;
  padding: 5px 6px;
  text-align: center;
  border-radius: 3px;
  white-space: nowrap;
}

.mp-cell.mp-work {
  background: rgba(52, 199, 89, 0.15);
  color: #1a7a2e;
}

.mp-cell.mp-transition {
  background: rgba(255, 204, 0, 0.15);
  color: #8a6d00;
}

.mp-cell.mp-night {
  background: rgba(142, 142, 147, 0.1);
  color: var(--color-text-tertiary);
}

.mp-cell.mp-midnight {
  border-top: 2px solid var(--color-text-tertiary);
}

/* Settings description text */
.mp-settings-desc {
  font-size: 12px;
  color: var(--color-text-secondary);
  margin-bottom: 12px;
  line-height: 1.4;
}

/* City input with inline dropdown arrow */
.mp-city-wrap {
  position: relative;
}

.mp-city-wrap input {
  width: 100%;
  padding-right: 28px;
}

.mp-city-wrap input::-webkit-calendar-picker-indicator,
.mp-city-wrap input::-webkit-list-button {
  display: none !important;
}

.mp-city-arrow {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 14px;
  color: var(--color-text-tertiary);
  pointer-events: auto;
  cursor: pointer;
}

.mp-city-wrap input:disabled + .mp-city-arrow {
  opacity: 0.4;
  cursor: not-allowed;
}

/* Date input with inline calendar icon */
.mp-date-wrap {
  position: relative;
}

.mp-date-wrap input {
  width: 100%;
  padding-right: 28px;
}

.mp-date-icon {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 14px;
  color: var(--color-text-tertiary);
  cursor: pointer;
}

/* Calendar dropdown */
.mp-cal-dropdown {
  background: white;
  border: 1px solid var(--color-window-border);
  border-radius: 8px;
  padding: 10px;
  margin-top: 6px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.mp-cal-dropdown.hidden {
  display: none;
}

.mp-cal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.mp-cal-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text-primary);
  opacity: 0.7;
}

.mp-cal-nav-btn {
  background: none;
  border: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 11px;
  color: var(--color-text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease;
}

.mp-cal-nav-btn:hover {
  background: rgba(0, 0, 0, 0.05);
}

.mp-cal-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  margin-bottom: 4px;
}

.mp-cal-weekdays span {
  text-align: center;
  font-size: 7px;
  font-weight: 500;
  color: var(--color-text-tertiary);
  text-transform: uppercase;
}

.mp-cal-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 1px;
}

.mp-cal-day {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  color: var(--color-text-secondary);
  cursor: pointer;
  aspect-ratio: 1;
  border-radius: 50%;
  transition: background 0.1s;
}

.mp-cal-day:hover:not(.empty) {
  background: rgba(0, 0, 0, 0.05);
}

.mp-cal-day.empty {
  cursor: default;
}

.mp-cal-day.today {
  color: var(--color-accent);
  font-weight: 600;
}

.mp-cal-day.selected {
  background: var(--color-accent);
  color: white;
  font-weight: 600;
}

.mp-cal-day.selected.today {
  color: white;
}

.mp-settings input:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ═══════════════════════════════════════════════════════════════════════
   NEWS WIDGET
   ═══════════════════════════════════════════════════════════════════════ */

/* Paper texture overlay — same technique as Quotes widget */
#window-news::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.35;
  background: url('/images/quotes/paper-texture.svg');
  background-size: 300px 300px;
  border-radius: inherit;
  mix-blend-mode: multiply;
}

#window-news .window-titlebar {
  position: relative;
  z-index: 4;
}

#window-news {
  overflow: hidden;
}

#window-news .window-content {
  position: relative;
  z-index: 1;
  overflow: visible;
  min-height: 0;
}

#window-news .window-resize-handle {
  z-index: 3;
}

#window-news .window-menu-popup {
  background: rgba(255, 255, 255, 1);
}

.news-widget {
  display: flex;
  flex-direction: column;
  height: calc(100% + 36px);
  margin-top: -36px;
  padding: 22px 12px 0;
  min-height: 0;
}

.news-header {
  text-align: center;
  padding: 0 0 4px;
  border-bottom: 2px solid #1a1a1a;
}

.news-masthead {
  font-family: Georgia, 'Times New Roman', Times, serif;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 6px;
  text-transform: uppercase;
  color: #1a1a1a;
  line-height: 1.1;
}

.news-source {
  font-size: 9px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: #888;
  margin-top: 1px;
}

.news-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 5px 0 4px;
  border-bottom: 1px solid #d0c8b8;
}

.news-updated {
  font-size: 10px;
  color: #999;
  font-style: italic;
}

.news-refresh-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: #888;
  padding: 2px 4px;
  font-size: 11px;
  border-radius: 3px;
  display: flex;
  align-items: center;
  transition: color 0.2s;
}

.news-refresh-btn:hover {
  color: #1a1a1a;
}

.news-list {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding-top: 2px;
  min-height: 0;
}

.news-item {
  display: flex;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px solid #d8d0c4;
  text-decoration: none;
  color: inherit;
  animation: news-fade-in 0.4s ease both;
}

.news-item:last-child {
  border-bottom: none;
}

@keyframes news-fade-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.news-index {
  font-family: Georgia, 'Times New Roman', Times, serif;
  font-size: 14px;
  font-weight: 700;
  color: #8b2500;
  min-width: 20px;
  line-height: 1.3;
  flex-shrink: 0;
}

.news-item-text {
  min-width: 0;
}

.news-headline {
  font-family: Georgia, 'Times New Roman', Times, serif;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.3;
  color: #1a1a1a;
  margin: 0;
  transition: color 0.2s;
}

.news-item:hover .news-headline {
  color: #8b2500;
}

.news-blurb {
  font-size: 11px;
  line-height: 1.4;
  color: #555;
  margin: 2px 0 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Loading & error states */
.news-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 0;
}

.news-spinner {
  width: 20px;
  height: 20px;
  border: 2px solid #d8d0c4;
  border-top-color: #1a1a1a;
  border-radius: 50%;
  animation: news-spin 0.7s linear infinite;
}

@keyframes news-spin {
  to { transform: rotate(360deg); }
}

.news-error {
  text-align: center;
  padding: 30px 10px;
  color: #888;
}

.news-error i {
  font-size: 18px;
  color: #bbb;
  margin-bottom: 6px;
  display: block;
}

.news-error p {
  margin: 4px 0 0;
  font-size: 12px;
}

.news-error-detail {
  font-size: 10px !important;
  color: #aaa;
}
