/**
 * 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);
}

/* On dark custom page backgrounds, a faint black shadow blends into the backdrop.
   Deepen it and add a subtle light rim so windows keep visible elevation/edges.
   Rim/glow are listed BEFORE the dark shadow — box-shadow paints the first-listed
   layer on top, so the dark shadow must come last or it covers the rim, leaving
   a visible dark gap between the window edge and the glow. */
#desktop[data-bg-mode="dark"] .window {
  --shadow-window: 0 0 0 1px rgba(255, 255, 255, 0.1), 0 10px 40px rgba(0, 0, 0, 0.55), 0 2px 10px rgba(0, 0, 0, 0.35);
  --shadow-window-focus: 0 0 0 1px rgba(255, 255, 255, 0.14), 0 12px 55px rgba(0, 0, 0, 0.6), 0 4px 15px rgba(0, 0, 0, 0.4);
}

/* Near-true-black backgrounds: the shadow itself has no darker room to read against,
   so the light rim/glow has to carry all the elevation cue — boost it accordingly. */
#desktop[data-bg-mode="black"] .window {
  --shadow-window: 0 0 0 1px rgba(255, 255, 255, 0.22), 0 0 30px rgba(255, 255, 255, 0.05), 0 10px 45px rgba(0, 0, 0, 0.6);
  --shadow-window-focus: 0 0 0 1px rgba(255, 255, 255, 0.3), 0 0 40px rgba(255, 255, 255, 0.08), 0 12px 55px rgba(0, 0, 0, 0.65);
}

.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);
  text-decoration: none;
  box-sizing: border-box;
  flex-shrink: 0;
}

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

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

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

.window-menu-btn:disabled,
.window.focused .window-menu-btn:disabled {
  opacity: 0.25;
  cursor: default;
}

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

.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;
}

.page-menu-item-logo {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

/* 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;
}

/* Dim overlay shown behind the widget launcher panel */
#widgets-launcher-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  z-index: 999;
  animation: widgets-overlay-in 0.2s ease forwards;
}

@keyframes widgets-overlay-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* 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;
}

a.window-menu-item {
  text-decoration: none;
  color: inherit;
}

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

.window-menu-item:disabled {
  opacity: 0.4;
  cursor: default;
}

.window-menu-item:disabled:hover {
  background: none;
}

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

.window-menu-item img {
  width: 11px;
  height: 11px;
  margin-right: 8px;
  vertical-align: middle;
  /* document-back/forward.svg are solid-filled glyphs, unlike the outline .fi icon font used
     everywhere else in this menu — the same box size still reads far bolder/darker at equal
     opacity because a filled shape has much higher ink coverage than a thin stroke, so this
     needs a noticeably lower opacity than .window-menu-item .fi's 0.7 to actually match it. */
  opacity: 0.35;
}

.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);
}

.page-color-custom {
  background: conic-gradient(red, yellow, lime, cyan, blue, magenta, red);
}

.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 {
  top: -36px;
}

@media (pointer: coarse) {
  #window-clock .clock-sky,
  #window-clock .clock-sun-container {
    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;
}

/* 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(14px, 7cqw, 26px);
  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(14px, 8cqw, 28px);
}

.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);
}

/* Keep the resize handle above the sky/earth layers */
#window-clock .window-resize-handle {
  z-index: 3;
}

#window-clock.night-mode .window-resize-handle i {
  color: rgba(255, 255, 255, 0.7);
}

#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,
.sticky-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,
.sheets-font-size-btn,
.sticky-font-size-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,
.sheets-font-size-btn:hover,
.sticky-font-size-btn:hover {
  transform: scale(1.15);
}

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

/* ── Notes — Markdown documents ─────────────────────────────────────── */
.nt {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  font-size: var(--nt-font);
  color: var(--color-text-primary);
}
.nt-size-s { --nt-font: 12px; }
.nt-size-m { --nt-font: 14px; }
.nt-size-l { --nt-font: 16px; }

.nt-view-preview .nt-source { display: none; }
.nt-view-source .nt-preview { display: none; }

.nt-source {
  flex: 1;
  min-height: 0;
  height: auto;
  width: 100%;
  border: none;
  resize: none;
  font-family: 'Consolas', 'Menlo', 'Monaco', 'Courier New', monospace;
  font-size: var(--nt-font);
  line-height: 1.6;
  padding: 0 16px 16px;
  outline: none;
  background: transparent;
  color: var(--color-text-primary);
}

.nt-preview {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 0 16px 12px;
  line-height: 1.55;
  outline: none;
  word-break: break-word;
  cursor: default;
  user-select: text;
}
.nt-preview > :first-child { margin-top: 0; }
.nt-preview h1, .nt-preview h2, .nt-preview h3,
.nt-preview h4, .nt-preview h5, .nt-preview h6 {
  margin: 0.8em 0 0.3em;
  line-height: 1.25;
  font-weight: 600;
}
.nt-preview h1 { font-size: 1.5em; }
.nt-preview h2 { font-size: 1.3em; }
.nt-preview h3 { font-size: 1.15em; }
.nt-preview h4 { font-size: 1.05em; }
.nt-preview h5 { font-size: 1em; }
.nt-preview h6 { font-size: 0.95em; }
.nt-preview p { margin: 0 0 0.6em; }
.nt-preview ul, .nt-preview ol {
  margin: 0 0 0.6em;
  padding-left: 1.4em;
}
.nt-preview li > ul, .nt-preview li > ol { margin-bottom: 0; }
.nt-preview li.nt-task {
  list-style: none;
  margin-left: -1.2em;
}
.nt-preview .nt-cb {
  margin: 0 0.4em 0 0;
  vertical-align: -1px;
  accent-color: var(--color-accent);
  cursor: pointer;
}
.nt-preview blockquote {
  margin: 0 0 0.6em;
  padding: 0.1em 0 0.1em 0.8em;
  border-left: 3px solid var(--color-accent);
  color: var(--color-text-secondary);
}
.nt-preview code {
  font-family: 'Consolas', 'Menlo', 'Monaco', 'Courier New', monospace;
  font-size: 0.9em;
  background: rgba(0, 0, 0, 0.06);
  border-radius: 4px;
  padding: 0 0.3em;
}
.nt-preview pre {
  position: relative;
  margin: 0 0 0.6em;
  padding: 8px 10px;
  background: rgba(0, 0, 0, 0.06);
  border-radius: 6px;
  overflow: auto;
  white-space: pre;
}
/* A block with a language label reserves a top strip for it so the label never sits on top of
   the first line of code; a bare ``` block gets only the hover Copy button, over the code */
.nt-preview pre[data-lang] { padding-top: 22px; }
/* Top-right corner of a code block: the fence's language label, and a Copy button that only
   shows while hovering the block (or when it has keyboard focus) so the code stays uncluttered */
.nt-preview .nt-pre-bar {
  position: absolute;
  top: 4px;
  right: 6px;
  display: flex;
  align-items: center;
  gap: 4px;
  font-family: var(--font-body);
  font-size: 10px;
  line-height: 1;
  color: var(--color-text-secondary);
  user-select: none;
}
.nt-preview .nt-lang {
  padding: 2px 4px;
  opacity: 0.7;
}
.nt-preview .nt-copy {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  padding: 0;
  border: none;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.06);
  color: var(--color-text-secondary);
  font-size: 12px;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.1s ease, background 0.1s ease;
}
.nt-preview pre:hover .nt-copy,
.nt-preview .nt-copy:focus-visible { opacity: 1; }
.nt-preview .nt-copy:hover { background: rgba(0, 0, 0, 0.12); color: var(--color-text); }
.nt-preview pre code {
  background: none;
  padding: 0;
  font-size: 0.9em;
}
.nt-preview table {
  border-collapse: collapse;
  margin: 0 0 0.6em;
  font-size: 0.95em;
}
.nt-preview th, .nt-preview td {
  border: 1px solid var(--color-window-border);
  padding: 2px 8px;
  text-align: left;
}
.nt-preview th { font-weight: 600; }
.nt-al { text-align: left; }
.nt-ac { text-align: center; }
.nt-ar { text-align: right; }
.nt-preview hr {
  border: none;
  border-top: 1px solid var(--color-window-border);
  margin: 0.8em 0;
}
.nt-preview a {
  color: var(--color-accent);
  text-decoration: underline;
}
.nt-preview img {
  max-width: 100%;
  height: auto;
  border-radius: 6px;
}
.nt-preview del { opacity: 0.6; }

/* Quick-reference strip of basic Markdown syntax — Source view only, one row, scrolls sideways */
.nt-legend {
  display: flex;
  gap: 6px;
  padding: 4px 8px;
  overflow-x: auto;
  overflow-y: hidden;
  white-space: nowrap;
  flex-shrink: 0;
  scrollbar-width: none; /* still scrolls (wheel, trackpad, drag); just no visible bar */
}
.nt-legend::-webkit-scrollbar { display: none; }
.nt-legend[hidden] { display: none; }
.nt-legend-chip {
  flex-shrink: 0;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.06);
  font-family: 'Consolas', 'Menlo', 'Monaco', 'Courier New', monospace;
  font-size: 11px;
  color: var(--color-text-secondary);
  cursor: pointer;
  transition: background 0.1s ease;
}
.nt-legend-chip:hover {
  background: rgba(0, 0, 0, 0.12);
}

.nt-status {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 8px;
  font-size: 11px;
  color: var(--color-text-secondary);
  white-space: nowrap;
  overflow: hidden;
  flex-shrink: 0;
}
.nt-title {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ═══════════════════════════════════════════════════════════════════════
   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%;
  overflow-y: auto;
}


.widgets-search-wrap {
  padding: 10px 12px 2px;
  display: flex;
  justify-content: center;
  position: sticky;
  top: 0;
  z-index: 1;
}

.widgets-search-box {
  position: relative;
  width: 100%;
  max-width: 240px;
}

.widgets-search-input {
  width: 100%;
  box-sizing: border-box;
  height: 30px;
  padding: 0 30px 0 10px;
  border-radius: 20px;
  border: none;
  background: rgba(0, 0, 0, 0.1);
  font-size: 12px;
  color: var(--color-text);
  outline: none;
  transition: border-color 0.15s, background 0.15s;
}

.widgets-search-input::placeholder {
  color: var(--color-text-secondary);
  opacity: 0.5;
}

.widgets-search-input:focus {
  background: rgba(0, 0, 0, 0.07);
}

.widgets-search-icon {
  position: absolute;
  right: 9px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 13px;
  color: var(--color-text-secondary);
  pointer-events: none;
  transition: opacity 0.1s;
}

.widgets-search-clear {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  display: none;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border: none;
  background: none;
  cursor: pointer;
  padding: 0;
  font-size: 15px;
  color: var(--color-text-secondary);
  line-height: 1;
}

.widgets-search-clear:hover {
  color: var(--color-text);
}

.widgets-search-box--has-text .widgets-search-icon {
  display: none;
}

.widgets-search-box--has-text .widgets-search-clear {
  display: flex;
}

.widgets-no-results {
  grid-column: 1 / -1;
  text-align: center;
  padding: 24px 0;
  color: var(--color-text-secondary);
  font-size: 12px;
}

.widgets-grid-wrap {
  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-grid--preview {
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 12px;
}

.widgets-item--preview {
  width: 100%;
}

.widgets-item-preview {
  width: 100%;
  aspect-ratio: 3 / 2;
  border-radius: 8px;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.05);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12);
  transition: box-shadow 0.15s ease;
  position: relative;
}

.widgets-item-preview::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 28px;
  background: linear-gradient(to bottom, transparent, rgba(0, 0, 0, 0.25));
  pointer-events: none;
}

.widgets-item:hover .widgets-item-preview {
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.18);
}

.widgets-item-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
  display: block;
  pointer-events: none;
  transform: scale(1.03);
}

.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;
}

.widgets-view-icon-btn.active,
.widgets-view-preview-btn.active {
  background: rgba(0, 0, 0, 0.12);
  opacity: 1;
}

.widgets-view-icon-btn i,
.widgets-view-preview-btn i,
.widgets-whatsnew-btn i,
.widgets-cleanup-btn i {
  transform: none;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ═══════════════════════════════════════════════════════════════════════
   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);
}

/* ═══════════════════════════════════════════════════════════════════════
   POMODORO WIDGET
   ═══════════════════════════════════════════════════════════════════════ */
#window-pomodoro {
  background: #9B2226 !important;
  border-color: rgba(255, 255, 255, 0.1);
}

#window-pomodoro .window-title {
  color: rgba(255, 255, 255, 0.9);
}

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

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

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

#window-pomodoro .window-titlebar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 4;
  background: transparent;
}

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

.pomo-container {
  width: 100%;
  height: 100%;
  overflow: hidden;
  container-type: size;
}

.pomo-display {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  padding: 4px;
  padding-top: 9px;
  gap: 2px;
}

.pomo-tomato-area {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 85%;
  aspect-ratio: 1;
  margin-top: 10px;
}

.pomo-tomato-container {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pomo-tomato-svg {
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
}

.pomo-ring-content {
  position: absolute;
  top: 52%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  pointer-events: none;
}

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

.pomo-done-text {
  color: #FFB4A2;
  font-size: clamp(8px, 10cqw, 28px);
}

.pomo-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 4px;
}

.pomo-phase-label {
  font-size: clamp(8px, 4cqw, 14px);
  font-weight: 600;
  color: rgba(255, 255, 255, 0.9);
  text-align: center;
  word-wrap: break-word;
  overflow-wrap: break-word;
  max-width: 100%;
  line-height: 1.3;
}

.pomo-dots {
  display: flex;
  gap: 5px;
  justify-content: center;
}

.pomo-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: 2px solid #FF6B6B;
  background: transparent;
  transition: background 0.3s ease, border-color 0.3s ease;
}

.pomo-dot.filled {
  background: #FF6B6B;
  border-color: #FF6B6B;
}

.pomo-controls {
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: center;
}

.pomo-controls-row {
  display: flex;
  gap: 6px;
  justify-content: center;
  align-items: center;
}

.pomo-btn {
  height: 26px;
  min-width: 26px;
  border-radius: 13px;
  border: none;
  background: rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.85);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 600;
  font-family: inherit;
  padding: 0 10px;
  transition: background 0.15s ease, transform 0.15s ease;
  gap: 4px;
}

.pomo-btn:hover {
  background: rgba(255, 255, 255, 0.22);
  transform: scale(1.05);
}

.pomo-btn.primary {
  background: #E63946;
  color: #fff;
}

.pomo-btn.primary:hover {
  background: #d32f3f;
}

.pomo-btn.danger {
  color: rgba(255, 255, 255, 0.5);
}

.pomo-btn.danger:hover {
  color: rgba(255, 255, 255, 0.8);
  background: rgba(255, 255, 255, 0.15);
}

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

/* Tick mark animations */
.pomo-tick {
  transition: stroke 0.4s ease;
}

.pomo-tick.elapsed {
  stroke: rgba(255, 255, 255, 0.15) !important;
}

/* Flash animation on phase complete */
.pomo-container.pomo-flash {
  animation: pomoFlash 0.2s ease-out;
}

@keyframes pomoFlash {
  0%   { background-color: rgba(230, 57, 70, 0.6); }
  100% { background-color: transparent; }
}

/* ═══════════════════════════════════════════════════════════════════════
   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;
}

/* Turnstile slot above the chat input; empty (and collapsed) unless Cloudflare asks for a click */
.chat-turnstile {
  display: flex;
  justify-content: center;
}

.chat-turnstile:not(:empty) {
  padding: 8px 12px 0;
}

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

.chat-input-row {
  display: flex;
  gap: 8px;
  flex: 1;
}

.chat-input-container {
  position: relative;
  flex: 1;
}

.chat-input-container input {
  width: 100%;
  box-sizing: border-box;
}

.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-input-locked {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
}

/* Send button: swap the accent blue for a neutral gray when locked, and override
   the higher-specificity ".window.focused .widget-btn { opacity: 1 }" rule. */
.chat-send-btn.chat-input-locked {
  background: rgba(0, 0, 0, 0.08);
  color: var(--color-text-tertiary);
  opacity: 1;
}

.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);
}

/* Character counter */
.chat-char-counter {
  position: absolute;
  bottom: 4px;
  right: 7px;
  font-size: 9px;
  color: var(--color-text-tertiary);
  pointer-events: none;
  user-select: none;
  line-height: 1;
}

.chat-char-counter.chat-char-warn {
  color: var(--color-danger);
}

/* Token counter strip */
.chat-token-counter {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 4px 12px;
  font-size: 10px;
  color: var(--color-text-tertiary);
  text-align: center;
  letter-spacing: 0.01em;
  user-select: none;
}

.chat-token-counter.hidden {
  display: none;
}

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

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

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

.chat-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: 180px;
  text-align: left;
  line-height: 1.5;
  pointer-events: none;
}

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

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

.chat-limit-footer {
  padding: 20px 0 24px;
  text-align: center;
}

.chat-info-list {
  margin: 0;
  padding: 0 0 0 12px;
  list-style: disc;
}

.chat-info-list li {
  margin-bottom: 2px;
}

.chat-info-list li:last-child {
  margin-bottom: 0;
}

/* Settings mode-switch footer */
.chat-settings-mode-footer {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--color-window-border);
  text-align: center;
}

.chat-switch-to-gemini {
  background: none;
  border: none;
  font-size: 12px;
  color: var(--color-text-tertiary);
  cursor: pointer;
  text-decoration: underline;
  padding: 0;
}

.chat-switch-to-gemini: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-block {
  align-self: flex-start;
}

.weather-city {
  font-size: clamp(12px, 6cqw, 22px);
  font-weight: 500;
  color: var(--color-text-secondary);
  text-decoration: none;
  cursor: pointer;
  display: block;
}

.weather-stale {
  font-size: 10px;
  color: rgba(0, 0, 0, 0.38);
  margin-top: 2px;
}

.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(14px, 7cqw, 24px);
  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(11px, 5.5cqw, 19px);
  opacity: 0.7;
}

.weather-detail-label i {
  font-size: clamp(11px, 5.5cqw, 19px);
  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 6px 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;
  padding-bottom: 2px;
}

.quotes-text {
  font-family: 'Georgia', 'Times New Roman', serif;
  font-size: 14px; /* initial fallback; overridden by JS binary search */
  font-style: italic;
  line-height: 1.3;
  color: var(--color-text-primary);
  text-align: center;
  margin-bottom: 4px;
}

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

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

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

.quotes-tip-btn {
  margin-top: 10px;
  font-size: 10px;
  padding: 2px 10px;
  opacity: 0.7;
}

.quotes-author {
  font-size: 13px;
  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;
}

/* ═══════════════════════════════════════════════════════════════════════
   WORD OF THE DAY WIDGET
   ═══════════════════════════════════════════════════════════════════════ */

/* Walnut wood grain over the whole widget — the flashcard sits on a desk top */
#window-word::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
  z-index: 0;
  background: url('/images/word/walnut-texture.svg');
  background-size: 300px 300px;
  border-radius: inherit;
}

#window-word {
  overflow: hidden;
  background: linear-gradient(160deg, #8a5f3a 0%, #744b2d 45%, #5d3b20 100%) !important;
}

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

#window-word .window-title,
#window-word .window-menu-btn {
  color: rgba(248, 238, 220, 0.92);
}

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

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

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

.word-card {
  position: absolute;
  top: 2px;
  left: 12px;
  right: 14px;
  bottom: 18px; /* clears the resize handle in the window corner */
  perspective: 800px;
  cursor: pointer;
  font-family: 'American Typewriter', 'Courier Prime', 'Courier New', Courier, monospace;
}

.word-card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform 0.5s ease;
}

.word-card-inner.flipped {
  transform: rotateY(180deg);
}

.word-face {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  background: #fdfaf0;
  border: 1px solid rgba(120, 90, 55, 0.35);
  border-radius: 8px;
  box-shadow: inset 0 0 22px rgba(95, 68, 36, 0.14), 0 2px 3px rgba(25, 14, 6, 0.35), 0 8px 18px rgba(25, 14, 6, 0.55);
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow: hidden;
}


.word-back {
  transform: rotateY(180deg);
}

.word-front-content {
  display: flex;
  flex-direction: column;
  gap: 0.35em;
  text-align: center;
  font-size: 13px; /* initial fallback; overridden by JS binary search */
  flex-shrink: 0; /* keep true content height so the font-fit measures honestly */
}

.word-headline {
  font-size: 1.55em;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--color-text-primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding-bottom: 0.15em;
  border-bottom: 1px solid rgba(197, 90, 90, 0.45);
}

.word-audio-btn {
  border: 1px solid rgba(150, 120, 80, 0.35);
  background: rgba(255, 255, 255, 0.6);
  border-radius: 50%;
  width: 1.35em;
  height: 1.35em;
  min-width: 18px;
  min-height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--color-text-secondary);
  font-size: 0.65em;
  padding: 0;
  flex-shrink: 0;
}

.word-audio-btn:hover {
  color: var(--color-accent);
  border-color: var(--color-accent);
}

.word-audio-btn i {
  line-height: 1;
}

/* Invisible twin of the audio button on the word's other side, so the word
   itself stays horizontally centered on the card */
.word-audio-spacer {
  visibility: hidden;
  pointer-events: none;
}

.word-phonetic {
  font-size: 0.8em;
  color: var(--color-text-secondary);
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 0.6em;
}

.word-pos {
  font-style: italic;
  color: var(--color-text-tertiary);
}

.word-definition {
  font-size: 0.95em;
  line-height: 1.35;
  color: var(--color-text-primary);
}

.word-example {
  font-size: 0.82em;
  font-style: italic;
  line-height: 1.3;
  color: var(--color-text-secondary);
}

.word-example::before {
  content: '“';
}

.word-example::after {
  content: '”';
}

.word-stale-note {
  position: absolute;
  top: 4px;
  left: 8px;
  font-size: 8px;
  color: var(--color-text-tertiary);
}

.word-info-icon {
  position: absolute;
  bottom: 4px;
  left: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-tertiary);
  cursor: help;
  user-select: none;
}

.word-info-icon i {
  font-size: 10px;
  line-height: 1;
}

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

.word-info-tooltip {
  position: absolute;
  bottom: 100%;
  left: 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: 150px;
  text-align: left;
  line-height: 1.4;
}

.word-info-tooltip a {
  color: #9cd2ff;
}

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

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

.word-copy-btn {
  position: absolute;
  bottom: 0; /* measured to vertically center the glyph with the info icon */
  right: 4px;
  background: none;
  border: none;
  padding: 2px;
  color: var(--color-text-tertiary);
  cursor: pointer;
  line-height: 1;
}

.word-copy-btn i {
  font-size: 10px;
  line-height: 1;
}

.word-copy-btn:hover {
  color: var(--color-text-secondary);
}

/* ─── Quiz (back of the card) ─── */

.word-quiz-slot {
  display: flex;
  flex-direction: column;
  gap: 0.6em;
  text-align: center;
  font-size: 12px; /* overridden by JS binary search */
  width: 100%;
  flex-shrink: 0; /* keep true content height so the font-fit measures honestly */
  transition: font-size 0.35s ease; /* post-answer correction glides (fits run suppressed) */
}

.word-quiz-prompt {
  font-size: 0.95em;
  line-height: 1.3;
  color: var(--color-text-primary);
}

.word-quiz-choices {
  display: flex;
  flex-direction: column;
  gap: 0.5em;
  /* On answer the block scales down as one crisp miniature (no text
     re-wrapping) while its layout height animates in sync to free the
     space below — both set from JS, both over the same 1s. */
  transform-origin: top center;
  transition: transform 1s ease, height 1s ease;
}

.word-quiz-choice {
  font-family: inherit;
  font-size: 0.85em;
  line-height: 1.25;
  text-align: left;
  padding: 0.45em 0.6em;
  border: 1px solid rgba(150, 120, 80, 0.35);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.6);
  color: var(--color-text-primary);
  cursor: pointer;
}

/* Post-answer block (verdict + example): hidden until answered, then its
   height grows from zero — with a margin that cancels the flex gap — so the
   instant of the click causes zero layout shift and everything animates
   together over the same 1s. */
.word-quiz-post {
  display: none;
  overflow: hidden;
  margin-top: -0.6em;
  transition: max-height 1s ease, margin-top 1s ease;
}

.word-quiz-slot.answered .word-quiz-post {
  display: block;
}

.word-quiz-slot .word-example {
  margin-top: 0.4em;
  animation: wordExampleIn 1s ease both; /* fades in alongside the shrink */
}

@keyframes wordExampleIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

/* Momentarily kill transitions while the font-fit re-measures */
.word-no-trans,
.word-no-trans * {
  transition: none !important;
}

.word-quiz-choice:hover:not(:disabled) {
  border-color: var(--color-accent);
}

.word-quiz-choice:disabled {
  pointer-events: none; /* clicks fall through to the card → flips back */
  opacity: 0.75;
}

.word-quiz-choice.correct {
  border-color: var(--color-success);
  background: rgba(180, 235, 190, 0.5);
  opacity: 1;
}

.word-quiz-choice.incorrect {
  border-color: var(--color-danger);
  background: rgba(250, 200, 200, 0.5);
}

.word-quiz-result {
  font-size: 0.85em;
  font-weight: 700;
}

.word-quiz-slot.answered .word-quiz-result {
  animation: wordExampleIn 1s ease both; /* verdict fades in with everything else */
}

.word-quiz-result.good {
  color: var(--color-success);
}

.word-quiz-result.bad {
  color: var(--color-danger);
}

.word-quiz-reveal {
  align-self: center;
}

.word-quiz-answer {
  font-size: 0.9em;
  line-height: 1.35;
  color: var(--color-text-primary);
}

/* ─── First-run setup / settings panel ─── */

.word-settings {
  position: absolute;
  top: 2px;
  left: 12px;
  right: 14px;
  bottom: 18px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 5px;
  padding: 6px 10px 8px;
  overflow-y: auto;
  background: #fdfaf0;
  border: 1px solid rgba(120, 90, 55, 0.35);
  border-radius: 8px;
  box-shadow: inset 0 0 22px rgba(95, 68, 36, 0.14), 0 2px 3px rgba(25, 14, 6, 0.35), 0 8px 18px rgba(25, 14, 6, 0.55);
}

.word-settings-desc {
  font-size: 10px;
  text-align: center;
  color: var(--color-text-secondary);
  line-height: 1.25;
}

.word-settings-levels {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.word-level-btn {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0;
  padding: 3px 9px;
  border: 1px solid var(--color-window-border);
  border-radius: var(--radius-button, 8px);
  background: rgba(255, 255, 255, 0.7);
  cursor: pointer;
  text-align: left;
}

.word-level-btn:hover {
  border-color: var(--color-accent);
}

.word-level-btn.selected {
  border-color: var(--color-accent);
  background: rgba(255, 255, 255, 0.95);
}

.word-level-name {
  font-size: 11px;
  font-weight: 600;
  line-height: 1.25;
  color: var(--color-text-primary);
}

.word-level-desc {
  font-size: 9px;
  line-height: 1.2;
  color: var(--color-text-tertiary);
}

.word-settings-cancel {
  align-self: center;
}

.word-loading,
.word-error {
  position: absolute;
  top: 2px;
  left: 12px;
  right: 14px;
  bottom: 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--color-text-tertiary);
  font-size: 13px;
  gap: 8px;
  background: #fdfaf0;
  border: 1px solid rgba(120, 90, 55, 0.35);
  border-radius: 8px;
  box-shadow: inset 0 0 22px rgba(95, 68, 36, 0.14), 0 2px 3px rgba(25, 14, 6, 0.35), 0 8px 18px rgba(25, 14, 6, 0.55);
}

/* ═══════════════════════════════════════════════════════════════════════
   LIFETIME WIDGET
   ═══════════════════════════════════════════════════════════════════════ */

.lifetime-widget {
  --lt-scale: 1; /* set from JS; text grows sublinearly with widget size */
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px 14px 10px;
}

.lifetime-header {
  text-align: center;
  flex-shrink: 0;
}

.lifetime-count {
  font-size: calc(26px * var(--lt-scale));
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.5px;
  font-variant-numeric: tabular-nums;
  color: #1d6a94;
}

.lifetime-caption {
  font-size: calc(10px * var(--lt-scale));
  color: #5292b4;
}

.lifetime-grid-wrap {
  flex: 1;
  min-height: 0;
  position: relative;
}

.lifetime-canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.lifetime-hover-dot {
  display: none;
  position: absolute;
  pointer-events: none;
  z-index: 5;
  border-radius: 50%;
  border: 2px solid transparent; /* color set per dot type from JS */
  background: transparent;
  /* white halo inside and out so the ring reads on water and mist alike */
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.85), inset 0 0 0 1px rgba(255, 255, 255, 0.85);
}

.lifetime-tooltip {
  display: none;
  position: absolute;
  pointer-events: none;
  z-index: 10;
  padding: 5px 8px;
  border-radius: 6px;
  background: rgba(29, 29, 31, 0.92);
  color: rgba(255, 255, 255, 0.92);
  font-size: 10px;
  line-height: 1.4;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.lifetime-tooltip-title {
  font-weight: 600;
  color: #fff;
}

.lifetime-tooltip-note {
  color: #f5c76b;
}

.lifetime-tooltip--poem {
  white-space: normal;
  width: 178px;
  font-style: italic;
  line-height: 1.5;
}

.lifetime-footer {
  flex-shrink: 0;
  display: flex;
  justify-content: space-between;
  font-size: calc(9px * var(--lt-scale));
  font-variant-numeric: tabular-nums;
  color: #85b9d3;
}

/* Water glow spans the whole window, shining through the transparent
   titlebar; children lift above it so text and controls stay crisp */
#window-lifetime::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(circle at 94% 36%,
    rgba(102, 187, 235, 0.32) 0%,
    rgba(102, 187, 235, 0.12) 45%,
    rgba(102, 187, 235, 0) 72%);
}

#window-lifetime .window-titlebar,
#window-lifetime .window-content {
  position: relative;
  z-index: 1;
}

/* The lifted content would otherwise cover the resize handle's corner */
#window-lifetime .window-resize-handle {
  z-index: 2;
}

/* ─── 80+ tribute: today's dot blooms into a glow with a dedication ─── */

.lifetime-tribute {
  position: absolute;
  inset: 0;
  z-index: 3;
  overflow: hidden;
  cursor: pointer;
  transition: opacity 2.4s ease;
}

.lifetime-tribute--fading {
  opacity: 0;
}

.lifetime-tribute-glow {
  position: absolute;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  transform: translate(-50%, -50%) scale(1);
  opacity: 0.3;
  transition: transform 2.8s cubic-bezier(0.22, 0.8, 0.3, 1), opacity 2.8s ease;
  background: radial-gradient(circle,
    rgba(255, 244, 224, 0.9) 0%,
    rgba(255, 199, 152, 0.82) 38%,
    rgba(255, 137, 112, 0.78) 72%,
    rgba(255, 107, 107, 0.72) 100%);
}

.lifetime-tribute-text {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 26px;
  text-align: center;
  font-style: italic;
  font-weight: 600;
  line-height: 1.55;
  color: #fff;
  text-shadow: 0 1px 12px rgba(170, 60, 40, 0.5);
  opacity: 0;
  transition: opacity 1.1s ease 1.5s;
}

.lifetime-tribute--lit .lifetime-tribute-glow {
  opacity: 1;
}

.lifetime-tribute--lit .lifetime-tribute-text {
  opacity: 1;
}

/* ─── First-run setup / settings panel ─── */

.lifetime-settings {
  --lt-scale: 1; /* set from JS; text and art grow sublinearly with widget size */
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: calc(5px * var(--lt-scale));
  padding: 6px 16px 8px;
  overflow-y: auto;
}

.lifetime-setup-art {
  display: block;
  margin-bottom: calc(1px * var(--lt-scale));
}

.lifetime-setup-headline {
  font-size: calc(16px * var(--lt-scale));
  font-weight: 700;
  letter-spacing: -0.2px;
  text-align: center;
  color: #1d6a94;
}

.lifetime-setup-subline {
  font-size: calc(10.5px * var(--lt-scale));
  text-align: center;
  line-height: 1.35;
  margin-bottom: calc(4px * var(--lt-scale));
  color: #5292b4;
}

.lifetime-dob-input {
  width: calc(150px * var(--lt-scale));
  padding: calc(6px * var(--lt-scale)) 8px;
  border: 1px solid #85b9d3;
  border-radius: var(--radius-input);
  background: rgba(255, 255, 255, 0.9);
  font-family: var(--font-body);
  font-size: calc(12.5px * var(--lt-scale));
  text-align: center;
  color: #1d6a94;
}

.lifetime-dob-input:focus {
  outline: none;
  border-color: #2b7ca8;
}

.lifetime-dob-error {
  font-size: calc(10px * var(--lt-scale));
  color: var(--color-danger);
  text-align: center;
}

.lifetime-start-btn {
  width: calc(150px * var(--lt-scale));
  margin-top: calc(4px * var(--lt-scale));
  padding: calc(7px * var(--lt-scale)) 8px;
  border: none;
  border-radius: 9px;
  background: #2b7ca8;
  color: #fff;
  font-family: var(--font-body);
  font-size: calc(12.5px * var(--lt-scale));
  font-weight: 600;
  cursor: pointer;
}

.lifetime-start-btn:hover {
  background: #246a90;
}

.lifetime-cancel-link {
  border: none;
  background: none;
  padding: 2px 6px;
  font-family: var(--font-body);
  font-size: calc(12.5px * var(--lt-scale));
  color: #85b9d3;
  cursor: pointer;
}

.lifetime-cancel-link:hover {
  color: #5292b4;
  text-decoration: underline;
}

.lifetime-privacy {
  font-size: calc(9px * var(--lt-scale));
  text-align: center;
  color: #85b9d3;
}

/* ═══════════════════════════════════════════════════════════════════════
   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);
}

/* ═══════════════════════════════════════════════════════════════════════
   YOUTUBE WIDGET
   ═══════════════════════════════════════════════════════════════════════ */
#window-youtube {
  background: #111 !important;
  border-color: #333;
}

#window-youtube.focused {
  border-color: #444;
}

#window-youtube .window-titlebar {
  background: #111;
}

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

#window-youtube .window-menu-btn {
  color: rgba(255, 255, 255, 0.6);
  background: transparent;
}

#window-youtube .window-menu-btn i {
  color: rgba(255, 255, 255, 0.6);
}

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

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

.youtube-new-btn {
  width: 24px;
  height: 24px;
  background: transparent;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  opacity: 0.5;
}

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

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

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

.youtube-history-btn {
  width: 24px;
  height: 24px;
  background: transparent;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  opacity: 0.5;
}

.window.focused .youtube-history-btn {
  opacity: 1;
}

.youtube-history-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  opacity: 1;
}

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

.youtube-player {
  width: 100%;
  height: 100%;
  display: flex;
}

.youtube-player iframe {
  width: 100%;
  height: 100%;
  border: none;
  border-radius: 0 0 12px 12px;
}

.youtube-empty {
  height: 100%;
  display: flex;
  flex-direction: column;
  padding: 10px;
  gap: 8px;
}

.youtube-drop-zone {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 2px dashed rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  cursor: default;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.youtube-drop-zone.drag-over {
  border-color: #ff0000;
  background: rgba(255, 0, 0, 0.08);
}

.youtube-empty-icon {
  font-size: 22px;
  color: rgba(255, 255, 255, 0.4);
}

.youtube-drop-hint {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.5);
  text-align: center;
  transition: color 0.15s ease;
}

.youtube-drop-hint.youtube-error {
  color: #ff4444;
}

.youtube-input-row {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.youtube-input {
  flex: 1;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  padding: 5px 8px;
  font-size: 11px;
  font-family: inherit;
  outline: none;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  transition: border-color 0.15s ease;
}

.youtube-input:focus {
  border-color: #ff0000;
}

.youtube-input::placeholder {
  color: rgba(255, 255, 255, 0.4);
}

.youtube-play-btn {
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 8px;
  background: #ff0000;
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  flex-shrink: 0;
  transition: opacity 0.15s ease;
}

.youtube-play-btn:hover {
  opacity: 0.85;
}

.youtube-history {
  height: 100%;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1px;
  background: #111;
}

.youtube-history-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  cursor: pointer;
  transition: background 0.15s ease;
  flex-shrink: 0;
}

.youtube-history-item:hover {
  background: rgba(255, 255, 255, 0.08);
}

.youtube-history-thumb {
  width: 56px;
  height: 32px;
  object-fit: cover;
  border-radius: 4px;
  flex-shrink: 0;
  background: #222;
}

.youtube-history-title {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.85);
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  line-height: 1.3;
  flex: 1;
}

.youtube-history-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;
}

.youtube-history-delete i {
  line-height: 1;
}

.youtube-history-item:hover .youtube-history-delete {
  opacity: 1;
  pointer-events: auto;
}

.youtube-history-empty {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.4);
}

/* ═══════════════════════════════════════════════════════════════════════
   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);
}

/* ═══════════════════════════════════════════════════════════════════════
   CONFIRM DIALOG
   ═══════════════════════════════════════════════════════════════════════ */

.cd-confirm-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  border-radius: inherit;
}

.cd-confirm-box {
  background: rgba(255, 255, 255, 0.97);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 10px;
  padding: 18px 22px;
  text-align: center;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.cd-confirm-msg {
  color: #333;
  font-size: 13px;
  margin-bottom: 14px;
}

.cd-confirm-btns {
  display: flex;
  gap: 8px;
  justify-content: center;
}

.cd-confirm-btns button {
  padding: 5px 18px;
  border: none;
  border-radius: 6px;
  font-size: 12px;
  cursor: pointer;
  font-weight: 500;
}

.cd-confirm-cancel {
  background: #e8e8e8;
  color: #555;
}

.cd-confirm-cancel:hover {
  background: #ddd;
}

.cd-confirm-ok {
  background: #e55;
  color: #fff;
}

.cd-confirm-ok:hover {
  background: #f66;
}

#window-pixelart .cd-confirm-box {
  background: #333;
  border-color: #555;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

#window-pixelart .cd-confirm-msg {
  color: #ddd;
}

#window-pixelart .cd-confirm-cancel {
  background: #555;
  color: #ddd;
}

#window-pixelart .cd-confirm-cancel:hover {
  background: #666;
}

/* ═══════════════════════════════════════════════════════════════════════
   SHARE BY LINK
   Sender panel + received view, mounted as an overlay inside a widget's
   .window-content (see public/js/share.js: mountOverlay/unmountOverlay).
   Namespaced "cds-" (Cute Desk Share). See docs/SHARE-BY-LINK.md.
   ═══════════════════════════════════════════════════════════════════════ */

.window-content.cds-covered > :not(.cds-overlay) {
  visibility: hidden;
}

/* Contain the overlay's z-index so it can't paint over the window's own
   resize handle (a later sibling of .window-content with z-index auto).
   Quotes/Word already isolate their content via their own z-index rules;
   Sticky and Meeting Planner don't, and lost the resize corner without this. */
.window-content.cds-covered {
  isolation: isolate;
}

/* Received view = three stacked regions. The overlay itself has no padding:
   the header and footer carry their own, and the body is the widget's own
   content area (full width, no padding from us) — just shorter, because
   the header and footer took some height. Each widget renders into it with
   its own CSS untouched. The sender panel is a plain padded form instead. */
.cds-overlay {
  position: absolute;
  inset: 0;
  z-index: 10;
  display: flex;
  flex-direction: column;
  font-size: 12px;
  color: var(--color-text-primary);
}

.cds-panel {
  gap: 6px;
  padding: 10px 14px;
  overflow-y: auto;
}

.cds-received {
  overflow: hidden;
}

.cds-heading,
.cds-received-title {
  font-weight: 600;
  font-size: 13px;
}

/* Title line; widgets may add a short right-aligned note (Meeting Planner's
   date). Wraps under the title when both don't fit on one line. */
.cds-received-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 2px 10px;
  padding: 10px 14px 6px;
  flex-shrink: 0;
}

.cds-received-meta {
  font-size: 11px;
  font-weight: 600;
  color: var(--color-text-secondary);
  white-space: nowrap;
}

/* Two rows on one grid — [link][Copy] over [From][Email it] — so the two
   inputs and the two buttons share heights and the buttons share a column. */
.cds-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px;
  align-items: stretch;
}

.cds-form > * {
  height: 32px;
  box-sizing: border-box;
}

.cds-form .widget-btn {
  white-space: nowrap;
  padding-top: 0;
  padding-bottom: 0;
}

.cds-link,
.cds-from {
  min-width: 0;
  font-size: 11px;
  padding: 6px 8px;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: var(--radius-button);
  background: rgba(255, 255, 255, 0.7);
  color: var(--color-text-primary);
}

.cds-copy {
  white-space: nowrap;
}

.cds-copy.is-copied {
  background: var(--color-success);
}

.cds-email {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.cds-note {
  font-size: 11px;
  color: var(--color-text-tertiary);
  margin-top: 4px;
}

.cds-empty {
  color: var(--color-text-secondary);
}

/* Plays the role of .window-content for the widget's received markup:
   positioned, clipping, full width. */
.cds-received-body {
  flex: 1;
  min-height: 0;
  position: relative;
  overflow: hidden;
}

/* Same box as .sticky-textarea (font, line-height, padding), read-only. */
.cds-sticky-note {
  position: absolute;
  inset: 0;
  overflow: auto;
  padding: 0 16px 16px;
  font-family: 'Consolas', 'Menlo', 'Monaco', 'Courier New', monospace;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
}

/* Footer band: full-bleed divider, then its own padding. */
.cds-install {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 4px;
  font-size: 11px;
  color: var(--color-text-secondary);
  padding: 5px 14px 10px;
  flex-shrink: 0;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
}

/* Received Quotes reuses .quotes-container itself (same font size, style,
   layout, auto-fit sizing and the top-right author circle bleeding off the
   window edge) — see renderReceived() in quotes.js. The only difference:
   the real card starts 36px above the content area with 40px of top
   padding, to bleed behind the window's titlebar. Here it would bleed
   behind the header text instead, so it starts at the body's top edge. */
.cds-received-body .quotes-container {
  top: 0;
  padding-top: 4px;
}

/* The word card keeps its own insets; only the 18px it normally leaves
   for the window's resize handle isn't needed above the footer. Not
   interactive here (no flip). */
.cds-received-body .word-card {
  bottom: 6px;
  cursor: default;
}

.cds-word-example {
  margin-top: 8px;
  font-style: italic;
  color: var(--color-text-secondary);
}

/* Received Meeting Planner: same header-stays / hours-scroll layout as the
   real widget (.mp-main is a flex column with 2% left padding, so .mp-grid's
   flex:1 + overflow can work). Without this the 24-row grid just stacks at
   full height and the whole body scrolls, header included. */
.cds-mp-body {
  display: flex;
  flex-direction: column;
}

.cds-mp-grid {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  padding-left: 2%;
}

/* Read-only grid: the city dropdown arrow is a click-to-edit affordance
   that does nothing here. */
.cds-mp-grid .mp-hcell-arrow {
  display: none;
}

/* The page-menu variant of this button is full-width; here it should hug
   its label. */
.cds-install .ext-download-btn--sm {
  width: fit-content;
}

/* Word of the Day's window is dark walnut: the overlay's default dark text
   (heading, install line, From label, privacy note) is unreadable on it.
   Same cream the widget uses for its own titlebar. */
#window-word .cds-overlay {
  color: rgba(248, 238, 220, 0.92);
}

#window-word .cds-install,
#window-word .cds-received-meta,
#window-word .cds-note,
#window-word .cds-empty {
  color: rgba(248, 238, 220, 0.7);
}

#window-word .cds-install {
  border-top-color: rgba(248, 238, 220, 0.2);
}

#window-word .cds-overlay .widget-btn.secondary {
  background: rgba(248, 238, 220, 0.14);
  color: rgba(248, 238, 220, 0.92);
}

/* ═══════════════════════════════════════════════════════════════════════
   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 12px;
}

.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: 0 20px 14px;
}

/* Standard pill "rim" (matches .ext-download-btn and the marketing pages):
   1px translucent border + inset top highlight, brighter on hover. */
.about-close-btn {
  background: var(--color-accent);
  color: white;
  border: 1px solid rgba(255,255,255,0.14);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.18);
  padding: 10px 28px;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: opacity 0.15s, box-shadow 0.15s, transform 0.15s;
}

.about-close-btn:hover {
  opacity: 0.9;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.22);
  transform: translateY(-1px);
}

.about-tip {
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

/* About modal: tip button matches the website's dark-brown .tip-btn
   (pages.css) rather than the small pink win-overlay variant. */
.about-tip .win-tip-btn {
  margin-top: 0;
  margin-bottom: 0;
  padding: 10px 28px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.14);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.18);
  background: rgb(80, 35, 35);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  transition: background 0.15s, box-shadow 0.15s, transform 0.15s;
}
.about-tip .win-tip-btn:hover {
  background: rgb(110, 50, 50);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.22);
  transform: translateY(-1px);
  text-decoration: none;
}

.about-tip-text {
  font-size: 13px;
  color: var(--color-text-secondary);
  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;
}

/* ═══════════════════════════════════════════════════════════════════════
   COLOR PICKER MODAL
   ═══════════════════════════════════════════════════════════════════════ */

.cp-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;
}

.cp-modal {
  background: rgba(255,255,255,0.97);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 14px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.2);
  width: 320px;
  overflow: hidden;
  user-select: none;
}

/* Presets row */
.cp-presets {
  display: flex;
  gap: 8px;
  padding: 12px 14px;
  justify-content: center;
}

.cp-preset-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid rgba(0,0,0,0.1);
  cursor: pointer;
  transition: transform 0.1s, border-color 0.1s;
  padding: 0;
  appearance: none;
  -webkit-appearance: none;
  outline: none;
}
.cp-preset-btn:hover { transform: scale(1.15); }
.cp-preset-btn.selected { border-color: rgba(0,0,0,0.4); }

/* Reset icon — no circle, just the bare icon */
.cp-preset-reset-btn {
  background: transparent !important;
  border-color: transparent !important;
  border-radius: 0 !important;
  color: var(--color-text-secondary);
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: auto !important;
  height: auto !important;
  transform: none !important;
}
.cp-preset-reset-btn:hover {
  background: transparent !important;
  border-color: transparent !important;
  transform: none !important;
  color: var(--color-text-primary);
}

/* Hover hint below preset row */
.cp-presets-hint {
  font-size: 10px;
  color: var(--color-text-secondary);
  text-align: center;
  padding: 0 14px 8px;
  opacity: 0;
  transition: opacity 0.2s;
  pointer-events: none;
  margin-top: -4px;
}
.cp-presets:hover:not(:has(.cp-preset-reset-btn:hover)) + .cp-presets-hint {
  opacity: 1;
}

/* Save-to-slot + badge */
.cp-preset-save {
  position: absolute;
  top: -5px;
  right: -5px;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: rgba(0,0,0,0.65);
  color: #fff;
  font-size: 10px;
  line-height: 13px;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s;
  font-style: normal;
  font-weight: 700;
  user-select: none;
}
.cp-preset-btn {
  position: relative;
}
.cp-preset-btn:hover .cp-preset-save {
  opacity: 1;
  pointer-events: auto;
}
.cp-preset-btn.cp-preset-saved {
  border-color: rgba(0,0,0,0.55);
  transform: scale(1.2);
}

/* Flat / Gradient mode toggle */
.cp-mode-toggle {
  display: flex;
  margin: 4px 14px 10px;
  border-radius: 6px;
  background: rgba(0,0,0,0.06);
  padding: 2px;
  gap: 2px;
}

.cp-mode-btn {
  flex: 1;
  padding: 5px 0;
  font-size: 12px;
  font-family: inherit;
  border: none;
  border-radius: 4px;
  background: transparent;
  color: var(--color-text-secondary);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.cp-mode-btn.active {
  background: #fff;
  color: var(--color-text-primary);
  box-shadow: 0 1px 3px rgba(0,0,0,0.12);
}
.cp-mode-btn:not(.active):hover {
  color: var(--color-text-primary);
}

/* 2D canvas */
.cp-canvas-wrap {
  position: relative;
  margin: 12px 14px 0;
  border-radius: 8px;
  overflow: hidden;
  cursor: crosshair;
  line-height: 0;
}

.cp-canvas {
  width: 100%;
  height: 180px;
  display: block;
  border-radius: 8px;
}

.cp-cursor {
  position: absolute;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2.5px solid #fff;
  box-shadow: 0 0 0 1.5px rgba(0,0,0,0.4), 0 2px 6px rgba(0,0,0,0.3);
  pointer-events: none;
  transform: translate(-50%, -50%);
  top: 0; left: 0;
}

/* Hue slider */
.cp-hue-wrap {
  padding: 10px 14px 0;
}

.cp-hue-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 14px;
  border-radius: 7px;
  background: linear-gradient(to right,
    hsl(0,100%,50%), hsl(30,100%,50%), hsl(60,100%,50%),
    hsl(90,100%,50%), hsl(120,100%,50%), hsl(150,100%,50%),
    hsl(180,100%,50%), hsl(210,100%,50%), hsl(240,100%,50%),
    hsl(270,100%,50%), hsl(300,100%,50%), hsl(330,100%,50%), hsl(360,100%,50%));
  outline: none;
  cursor: pointer;
}
.cp-hue-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid rgba(0,0,0,0.25);
  box-shadow: 0 1px 4px rgba(0,0,0,0.25);
  cursor: pointer;
}
.cp-hue-slider::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid rgba(0,0,0,0.25);
  box-shadow: 0 1px 4px rgba(0,0,0,0.25);
  cursor: pointer;
}

/* Hex + RGB inputs row */
.cp-inputs-row {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  padding: 10px 14px 0;
}

.cp-hex-wrap {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.cp-rgb-wrap {
  display: flex;
  align-items: flex-start;
  gap: 4px;
  flex: 1;
}

.cp-field {
  display: flex;
  flex-direction: column;
  gap: 3px;
  align-items: center;
}

.cp-input-label {
  font-size: 10px;
  font-weight: 600;
  color: var(--color-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  line-height: 1;
}

.cp-hex-input {
  width: 74px;
  font-size: 12px;
  font-family: var(--font-mono, monospace);
  padding: 5px 7px;
  border: 1.5px solid rgba(0,0,0,0.15);
  border-radius: 6px;
  outline: none;
  background: rgba(0,0,0,0.03);
  color: var(--color-text-primary);
  text-transform: uppercase;
}
.cp-hex-input:focus { border-color: rgba(0,0,0,0.3); }

.cp-rgb-input {
  width: 42px;
  font-size: 12px;
  padding: 5px 4px;
  border: 1.5px solid rgba(0,0,0,0.15);
  border-radius: 6px;
  outline: none;
  text-align: center;
  background: rgba(0,0,0,0.03);
  color: var(--color-text-primary);
  -moz-appearance: textfield;
}
.cp-rgb-input::-webkit-inner-spin-button,
.cp-rgb-input::-webkit-outer-spin-button { -webkit-appearance: none; }
.cp-rgb-input:focus { border-color: rgba(0,0,0,0.3); }

.cp-eyedropper-btn {
  background: none;
  border: 1.5px solid rgba(0,0,0,0.15);
  border-radius: 6px;
  width: 30px;
  height: 28px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-secondary);
  font-size: 14px;
  transition: background 0.15s, border-color 0.15s;
  flex-shrink: 0;
  align-self: flex-end;
}
.cp-eyedropper-btn:hover {
  background: rgba(0,0,0,0.05);
  border-color: rgba(0,0,0,0.25);
}

/* Footer: preview + apply */
.cp-footer {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  margin-top: 10px;
  border-top: 1px solid rgba(0,0,0,0.07);
}

.cp-preview {
  width: 36px;
  align-self: stretch;
  border-radius: 6px;
  border: none;
  flex-shrink: 0;
  background: #ff8c69;
}

.cp-apply-btn {
  flex: 1;
  padding: 8px 24px;
  background: var(--color-accent);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.14);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.18);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: opacity 0.15s, box-shadow 0.15s, transform 0.15s;
}
.cp-apply-btn:hover {
  opacity: 0.9;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.22);
  transform: translateY(-1px);
}

/* ═══════════════════════════════════════════════════════════════════════
   CONTACT MODAL
   ═══════════════════════════════════════════════════════════════════════ */
.contact-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;
}

.contact-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: 400px;
  max-width: calc(100vw - 32px);
  overflow: hidden;
}

.contact-modal-content {
  padding: 22px 20px 8px;
}

.contact-modal-title {
  font-size: 17px;
  font-weight: 600;
  color: var(--color-text-primary);
  margin-bottom: 4px;
  text-align: center;
}

.contact-modal-subtitle {
  font-size: 12px;
  color: var(--color-text-secondary);
  text-align: center;
  margin-bottom: 14px;
  line-height: 1.4;
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.contact-form-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.contact-form-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text-primary);
}

.contact-form-input,
.contact-form-textarea {
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 13px;
  font-family: inherit;
  color: var(--color-text-primary);
  outline: none;
  width: 100%;
  box-sizing: border-box;
  transition: border-color 0.15s;
}

.contact-form-input:focus,
.contact-form-textarea:focus {
  border-color: var(--color-accent);
}

.contact-form-textarea {
  resize: vertical;
  min-height: 72px;
}

.contact-char-count {
  font-size: 11px;
  color: var(--color-text-tertiary);
  text-align: right;
  margin-top: 2px;
}

.contact-form-checkbox {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 12px;
  color: var(--color-text-secondary);
  cursor: pointer;
  line-height: 1.4;
}

.contact-form-checkbox input[type="checkbox"] {
  margin-top: 1px;
  flex-shrink: 0;
  accent-color: var(--color-accent);
}

.contact-form-honeypot {
  display: none;
}

.contact-turnstile-wrap {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}

/* Explicit order so the widget always renders above its error message,
   regardless of when the Turnstile script finishes loading. */
#contact-turnstile {
  order: 0;
}

.contact-turnstile-error {
  order: 1;
  margin-top: 4px;
  font-size: 12px;
  color: #e53e3e;
}

.contact-form-error {
  font-size: 12px;
  color: #e53e3e;
}

.contact-submit-btn {
  opacity: 1;
  transition: opacity 0.15s;
}

.contact-submit-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.contact-legal {
  font-size: 11px;
  color: var(--color-text-tertiary);
  text-align: center;
  margin: 4px 0 0;
}

.contact-legal-link {
  color: var(--color-text-tertiary);
  text-decoration: underline;
}

.contact-success {
  text-align: center;
  padding: 20px 0 8px;
}

.contact-success-icon {
  font-size: 32px;
  margin-bottom: 8px;
}

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

.contact-success-message {
  font-size: 13px;
  color: var(--color-text-secondary);
  line-height: 1.5;
}

.contact-modal-footer {
  padding: 4px 20px 16px;
  text-align: center;
}

/* ═══════════════════════════════════════════════════════════════════════
   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;
}

/* Pill buttons with the standard rim (matches the other app modals) */
.consent-btn {
  padding: 10px 24px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid rgba(255,255,255,0.14);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.18);
  font-family: inherit;
  transition: opacity 0.15s ease, background 0.15s, box-shadow 0.15s, transform 0.15s;
}

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

.consent-btn.primary:hover {
  opacity: 0.9;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.22);
  transform: translateY(-1px);
}

.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);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.22);
  transform: translateY(-1px);
}

/* ═══════════════════════════════════════════════════════════════════════
   WHAT'S NEW MODAL
   ═══════════════════════════════════════════════════════════════════════ */
.whatsnew-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;
}

.whatsnew-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: 420px;
  max-width: 90%;
  max-height: 85vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.whatsnew-header {
  padding: 20px 24px 8px;
  text-align: center;
}

.whatsnew-header-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--color-text-primary);
}

.whatsnew-slide {
  padding: 12px 24px 0;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.whatsnew-slide--enter {
  opacity: 0;
  animation: onboardingFadeIn 0.3s ease forwards;
}

.whatsnew-slide-image-wrap {
  width: 80%;
  min-height: 60px;
  border-radius: 10px;
  overflow: hidden;
  background: transparent;
  flex-shrink: 0;
}

.whatsnew-slide-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.whatsnew-slide-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--color-text-primary);
  margin-top: 14px;
}

.whatsnew-slide-desc {
  font-size: 13px;
  color: var(--color-text-secondary);
  line-height: 1.5;
  margin-top: 6px;
  padding: 0 8px;
}

.whatsnew-footer {
  padding: 16px 24px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.whatsnew-footer--enter {
  opacity: 0;
  animation: onboardingFadeIn 0.7s ease 0.6s forwards;
}

.whatsnew-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.whatsnew-dots {
  flex: 1;
  display: flex;
  gap: 8px;
  justify-content: center;
}

.whatsnew-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-text-tertiary);
  opacity: 0.3;
  transition: opacity 0.3s, background 0.3s;
}

.whatsnew-dot--active {
  opacity: 1;
  background: var(--color-accent);
}

.whatsnew-back-btn,
.whatsnew-next-btn {
  background: rgba(0, 0, 0, 0.06);
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  color: var(--color-text-tertiary);
  font-size: 18px;
  transition: background 0.15s ease, opacity 0.15s ease;
}

.whatsnew-back-btn:hover:not(:disabled),
.whatsnew-next-btn:hover:not(:disabled) {
  background: rgba(0, 0, 0, 0.1);
  color: var(--color-text-secondary);
}

.whatsnew-back-btn:disabled,
.whatsnew-next-btn:disabled {
  opacity: 0.3;
  cursor: default;
}

.whatsnew-gotit-btn {
  background: var(--color-accent);
  color: white;
  border: 1px solid rgba(255,255,255,0.14);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.18);
  padding: 10px 32px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: opacity 0.15s, box-shadow 0.15s, transform 0.15s;
}

.whatsnew-gotit-btn:hover {
  opacity: 0.85;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.22);
  transform: translateY(-1px);
}

@media (max-height: 500px) {
  .whatsnew-slide-image { max-height: 180px; }
  .whatsnew-header { padding: 14px 24px 6px; }
  .whatsnew-footer { padding: 10px 24px 14px; }
}

/* ═══════════════════════════════════════════════════════════════════════
   CHROME EXTENSION PROMO MODAL
   ═══════════════════════════════════════════════════════════════════════ */

.chrome-promo-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;
}

.chrome-promo-modal {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 16px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
  width: 360px;
  padding: 32px 28px 24px;
  text-align: center;
}

.chrome-promo-icon {
  margin-bottom: 16px;
}

.chrome-promo-icon img {
  width: 64px;
  height: 64px;
  border-radius: 14px;
}

.chrome-promo-title {
  font-size: 18px;
  font-weight: 600;
  line-height: 1.3;
  margin-bottom: 10px;
}

.chrome-promo-desc {
  font-size: 14px;
  color: var(--color-text-secondary);
  line-height: 1.5;
  margin-bottom: 24px;
}

.chrome-promo-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

/* Promo CTA is the standard .ext-download-btn (black pill + browser logo);
   this only stretches it to the modal width. */
.chrome-promo-actions .chrome-promo-cta {
  width: 100%;
  box-sizing: border-box;
}

.chrome-promo-dismiss {
  background: none;
  border: none;
  font-size: 13px;
  color: var(--color-text-tertiary);
  cursor: pointer;
  font-family: inherit;
  padding: 4px 8px;
}

.chrome-promo-dismiss:hover {
  color: var(--color-text-secondary);
  text-decoration: underline;
}

/* ═══════════════════════════════════════════════════════════════════════
   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: 999px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid rgba(255,255,255,0.14);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.18);
  font-family: inherit;
  transition: opacity 0.15s ease, box-shadow 0.15s, transform 0.15s;
  align-self: center;
}

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

.tip-modal-btn.primary:hover {
  opacity: 0.9;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.22);
  transform: translateY(-1px);
}

.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;
}

/* ============================================================
   Extension Download Button — STANDARD reusable CTA
   The standard black pill used app-wide and on marketing pages
   to point users to the Chrome / Safari extension.

   Markup:
     <a class="ext-download-btn" href="<store-url>" target="_blank" rel="noopener">
       <img class="ext-download-btn-logo" src="images/extensions/Chrome-Logo.webp"
            alt="" width="20" height="20" draggable="false">
       Get the Chrome Extension
     </a>

   Use images/extensions/Chrome-Logo.webp or images/extensions/Safari-Logo.webp for the logo.
   ============================================================ */
.ext-download-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 8px 18px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.14);
  background: linear-gradient(145deg, #2a2a2e 0%, #0a0a0c 100%);
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  text-decoration: none;
  width: fit-content;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.18);
  transition: background 0.15s, box-shadow 0.15s, transform 0.15s;
}

.ext-download-btn-logo {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  display: block;
}

.ext-download-btn i {
  font-size: 13px;
  flex-shrink: 0;
}

.ext-download-btn:hover {
  background: linear-gradient(145deg, #343438 0%, #131316 100%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.22);
  transform: translateY(-1px);
  text-decoration: none;
}

/* Page menu: "Get Chrome/Safari Extension" row renders the standard black
   pill (compact size) instead of an icon + text row. Anchor keeps its
   GA4 click handler; only the presentation changes. */
.page-menu-item--ext {
  justify-content: center;
  padding: 10px 14px;
}
.page-menu-item--ext:hover {
  background: none;
}
.ext-download-btn--sm {
  width: 100%;
  gap: 7px;
  padding: 6px 12px;
  font-size: 12px;
  border-radius: 999px;
}
.ext-download-btn--sm .ext-download-btn-logo {
  width: 16px;
  height: 16px;
}

/* Onboarding modal usage: centered + fades in with the bullets */
.onboarding-chrome-ext-cta {
  margin: 14px auto 0;
  opacity: 0;
  animation: onboardingFadeIn 0.7s ease forwards;
}

.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: 1px solid rgba(255,255,255,0.14);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.18);
  padding: 10px 24px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: opacity 0.15s, box-shadow 0.15s, transform 0.15s;
}

.onboarding-close-btn:hover {
  opacity: 0.9;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.22);
  transform: translateY(-1px);
}

/* -----------------------------------------------------------------------
   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 0.8s ease, padding 0.8s ease;
}

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

.onboarding-splash-title {
  font-weight: 600;
  color: rgb(80, 35, 35);
  transition: font-size 0.8s ease, margin-top 0.8s 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 0.8s ease, margin-top 0.8s ease, max-height 0.8s ease, opacity 0.5s 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 0.9s ease forwards;
}

.onboarding-modal--phase1 .onboarding-splash-title {
  font-size: 32px;
  margin-top: 24px;
  opacity: 0;
  animation: onboardingFadeIn 0.7s ease 0.7s 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 0.8s ease, margin-top 0.8s ease, max-height 0.8s ease, opacity 0.5s ease 0.8s;
}

/* 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 0.7s 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 0.7s ease forwards;
}

.onboarding-continue-btn {
  background: var(--color-accent);
  color: white;
  border: 1px solid rgba(255,255,255,0.14);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.18);
  padding: 12px 40px;
  border-radius: 999px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: opacity 0.15s ease, box-shadow 0.15s, transform 0.15s;
}

.onboarding-continue-btn:hover {
  opacity: 0.85;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.22);
  transform: translateY(-1px);
}

@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 0.8s ease, margin-top 0.8s ease, opacity 0.5s ease;
}

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

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

/* Footer enter (fade in) */
.onboarding-modal-footer--enter {
  opacity: 0;
  animation: onboardingFadeIn 0.7s ease 0.6s 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-card-fallback {
  display: none;
  width: 100%;
  height: 100%;
  background: #fff;
  border-radius: 6px;
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
  padding: 4px 5px 6px;
  box-sizing: border-box;
  font-family: Georgia, 'Times New Roman', serif;
  font-weight: bold;
  pointer-events: none;
}

.sol-card-fallback.red { color: #c0392b; }
.sol-card-fallback.black { color: #1a1a1a; }

.sol-card-fallback .sol-fb-rank {
  font-size: 14px;
  line-height: 1;
}

.sol-card-fallback .sol-fb-suit {
  font-size: 20px;
  line-height: 1;
  align-self: center;
}

.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: 22px;
  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: 6px 16px;
  border-radius: 50px;
  font-size: 16px;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s;
  white-space: nowrap;
  line-height: 1.2;
}

.sol-ctrl-btn i {
  font-size: 14px;
  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: 12px;
}

.sol-win-box {
  background: #cc0000;
  border-radius: 14px;
  padding: 10px 16px;
  text-align: center;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  max-width: 170px;
}

/* Card fan animation */
.sol-win-cards {
  position: relative;
  height: 34px;
  width: 140px;
  margin: 0 auto 12px;
  overflow: visible;
}

.sol-win-card {
  position: absolute;
  top: 0;
  left: 50%;
  margin-left: -8px;
  width: 16px;
  height: 24px;
  border-radius: 2px;
  overflow: hidden;
  box-shadow: 1px 1px 4px rgba(0, 0, 0, 0.35);
  transform-origin: 50% 500%;
  opacity: 0;
  animation: sol-card-fan 0.45s cubic-bezier(0.34, 1.56, 0.64, 1) calc(var(--i) * 35ms) forwards;
}

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

@keyframes sol-card-fan {
  from { opacity: 0; transform: rotate(0deg); }
  to   { opacity: 1; transform: rotate(calc(var(--i) * 6deg - 36deg)); }
}

.sol-win-message {
  font-size: 15px;
  font-weight: 700;
  color: white;
  margin-bottom: 4px;
  position: relative;
  z-index: 2;
}

.sol-win-btn {
  background: #277714;
  color: white;
  border: none;
  padding: 7px 20px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: opacity 0.15s;
}

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

/* ── Shared tip button (used across all win overlays) ── */
.win-tip-btn {
  display: block;
  width: fit-content;
  margin-left: auto;
  margin-right: auto;
  background: #fff0f0;
  color: #b03030;
  border: 1.5px solid #f5b7b1;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  text-decoration: none;
  transition: background 0.15s;
  margin-top: 6px;
  margin-bottom: 6px;
}

.win-tip-btn:hover {
  background: #fde0e0;
}

/* 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;
}

.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;
}

/* ═══════════════════════════════════════════════════════════════════════
   HAPPY PRIDE WIDGET
   ═══════════════════════════════════════════════════════════════════════ */

.hp-container {
  width: 100%;
  height: 100%;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #87CEEB;
}

/* Hide cursor everywhere while a game is actively running */
body.hp-playing,
body.hp-playing *,
body.brk-playing,
body.brk-playing * {
  cursor: none !important;
}

.hp-canvas {
  display: block;
}

#window-happypride .window-titlebar {
  background: linear-gradient(90deg, #ff6ec7, #ff9f45, #ffe135, #5dfc8a, #00b4d8, #9b5de5);
  border-bottom: none;
}

#window-happypride .window-title {
  color: #fff;
  text-shadow: 0 1px 3px rgba(0,0,0,0.25);
}

#window-happypride .window-menu-btn,
#window-happypride .window-menu-btn i {
  color: rgba(255,255,255,0.9);
}

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

.hp-offseason {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  font-size: 13px;
  color: #555;
  text-align: center;
  padding: 16px;
  line-height: 1.5;
}

/* ═══════════════════════════════════════════════════════════════════════
   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;
}

.news-item--tip .news-index {
  color: #b03030;
}

.news-item--tip .news-blurb {
  display: block;
  -webkit-line-clamp: unset;
  -webkit-box-orient: unset;
  overflow: visible;
}

.news-tip-footer-label {
  font-size: 10px;
  color: #aaa;
  font-style: italic;
  margin: 0 0 6px;
  text-align: center;
}

@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;
}

.news-tip-footer {
  padding: 20px 0 24px;
  text-align: center;
  margin-top: 4px;
}

/* ═══ MERGE WIDGET ═══ */

#content-merge {
  position: relative;
}

#window-merge {
  background: #e8d0a8 !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

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

#window-merge .window-titlebar {
  color: #5c4a18;
}

.merge-scale-wrapper {
  position: absolute;
  top: 0;
  left: 0;
  transform-origin: top left;
  overflow: visible;
}

.merge-container {
  --merge-card-bg: #e8d0a8;
  --merge-board-bg: #a08058;
  --merge-chute-w: 44px;
  --merge-junction-r: 12px;
  --merge-gap: 5px;
  --merge-pad: 5px;
  --merge-pad-top: var(--merge-pad);
  --merge-cell-w: calc((100% - 2 * var(--merge-pad) - 3 * var(--merge-gap)) / 4);
  --merge-cell-h: calc((100% - var(--merge-pad-top) - var(--merge-pad) - 3 * var(--merge-gap)) / 4);
  --merge-pill-bg: #4a3520;
  --merge-btn-bg: #e87020;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  padding: 3px 8px 8px;
  box-sizing: border-box;
  position: relative;
}

/* ── Chute: vertical lane from window top edge to board ── */
.merge-chute {
  position: absolute;
  top: -40px;
  left: 50%;
  transform: translateX(-50%);
  width: var(--merge-chute-w);
  background: var(--merge-board-bg);
  z-index: 0;
  pointer-events: none;
  box-shadow: inset 3px 0 6px -3px rgba(0, 0, 0, 0.15), inset -3px 0 6px -3px rgba(0, 0, 0, 0.15);
}


/* ── Header: score pills left-aligned ── */
.merge-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1px;
  flex-shrink: 0;
  position: relative;
  z-index: 1;
}

.merge-score-pill {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: var(--merge-pill-bg);
  border-radius: 5px;
  padding: 2px 6px 2px;
  min-width: 36px;
}

.merge-score-label {
  font-size: 6px;
  font-weight: 700;
  letter-spacing: 0.6px;
  color: rgba(255, 255, 255, 0.5);
}

.merge-score-value {
  font-size: 11px;
  font-weight: 700;
  font-family: 'Fredoka', sans-serif;
  color: #ffffff;
  line-height: 1.15;
}

/* ── Midzone: UNDO | preview | NEW ── */
.merge-midzone {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  margin-bottom: 0;
  min-height: 28px;
  position: relative;
  z-index: 2;
}

.merge-midzone .merge-btn {
  flex-shrink: 0;
}

.merge-midzone .merge-undo-btn { margin-right: auto; }
.merge-midzone .merge-new-btn  { margin-left: auto; }

.merge-btn {
  font-family: inherit;
  font-size: 9px;
  font-weight: 600;
  padding: 2px 8px;
  border: none;
  border-radius: 5px;
  background: #e87020;
  color: #ffffff;
  cursor: pointer;
  transition: background 0.15s, opacity 0.15s;
  letter-spacing: 0.3px;
}

.merge-btn:hover {
  background: #d06018;
}

.merge-btn:active {
  opacity: 0.7;
}

/* ── Board wrapper with concave chute junction ── */
.merge-board {
  flex: 1;
  min-height: 0;
  position: relative;
  background: var(--merge-board-bg);
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  z-index: 1;
  overflow: hidden;
}

.merge-board::before,
.merge-board::after {
  content: '';
  position: absolute;
  top: 0;
  height: 6px;
  width: calc(50% - var(--merge-chute-w) / 2);
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.12), transparent);
  z-index: 3;
  pointer-events: none;
}

.merge-board::before {
  left: 0;
}

.merge-board::after {
  right: 0;
}

/* ── Game grid ── */
.merge-grid {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: repeat(4, 1fr);
  gap: var(--merge-gap);
  position: relative;
  padding: var(--merge-pad);
  padding-top: var(--merge-pad-top);
  touch-action: none;
  overflow: hidden;
  border-radius: 8px;
  background: var(--merge-board-bg);
  box-shadow: inset 3px 0 6px -3px rgba(0, 0, 0, 0.15);
}

.merge-cell {
  border-radius: 5px;
  background: rgba(0, 0, 0, 0.08);
  box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.12), inset 0 0 0 0.5px rgba(0, 0, 0, 0.05);
}

/* ── Tiles: 3D keycap style ── */
.merge-tile {
  position: absolute;
  border-radius: 5px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  z-index: 1;
  background: var(--ledge-color);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.22), 0 1px 2px rgba(0, 0, 0, 0.12);
  top: calc(var(--merge-pad-top) + var(--merge-r) * (var(--merge-cell-h) + var(--merge-gap)));
  left: calc(var(--merge-pad) + var(--merge-c) * (var(--merge-cell-w) + var(--merge-gap)));
  width: var(--merge-cell-w);
  height: var(--merge-cell-h);
  transition: top 80ms cubic-bezier(0.25, 0.46, 0.45, 0.94),
              left 80ms cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.merge-tile-face {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--face-color);
  border-radius: 4px 4px 3px 3px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55);
  font-family: 'Fredoka', sans-serif;
  font-weight: 700;
  line-height: 1;
  user-select: none;
}

.merge-tile-ledge {
  height: 6px;
  background: var(--ledge-color);
  flex-shrink: 0;
  box-shadow:
    0 3px 5px rgba(0, 0, 0, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.merge-font-lg .merge-tile-face { font-size: 17px; }
.merge-font-md .merge-tile-face { font-size: 12px; }
.merge-font-sm .merge-tile-face { font-size: 9px; }

/* Merge bounce */
@keyframes merge-bounce {
  0% { transform: scale(1); }
  40% { transform: scale(1.15); }
  70% { transform: scale(0.95); }
  100% { transform: scale(1); }
}

.merge-tile-merge {
  animation: merge-bounce 200ms cubic-bezier(0.34, 1.56, 0.64, 1);
  z-index: 2;
}

.merge-tile-merge .merge-tile-ledge {
  animation: merge-ledge-compress 200ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes merge-ledge-compress {
  0% { height: 6px; }
  40% { height: 2px; }
  70% { height: 7px; }
  100% { height: 6px; }
}

/* Spawn pop-in */
@keyframes merge-spawn {
  0% { transform: scale(0); opacity: 0; }
  60% { transform: scale(1.1); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}

.merge-tile-spawn {
  animation: merge-spawn 180ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Win wiggle */
@keyframes merge-wiggle {
  0% { transform: rotate(0); }
  15% { transform: rotate(-8deg); }
  30% { transform: rotate(8deg); }
  45% { transform: rotate(-6deg); }
  60% { transform: rotate(6deg); }
  75% { transform: rotate(-3deg); }
  100% { transform: rotate(0); }
}

.merge-tile-wiggle {
  animation: merge-wiggle 500ms ease-in-out;
  z-index: 3;
}

/* Grid shake (game over) */
@keyframes merge-shake {
  0% { transform: translateX(0); }
  20% { transform: translateX(-6px); }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(4px); }
  100% { transform: translateX(0); }
}

.merge-grid-shake {
  animation: merge-shake 350ms ease-in-out;
}

/* Grid fade for new game */
.merge-grid-fadeout {
  opacity: 0;
  transition: opacity 150ms ease-out;
}

.merge-grid-fadein {
  animation: merge-fadein 150ms ease-in;
}

@keyframes merge-fadein {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Merge particles */
.merge-particle {
  position: absolute;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  z-index: 5;
  pointer-events: none;
  top: calc(var(--merge-pad-top) + var(--merge-r) * (var(--merge-cell-h) + var(--merge-gap)) + var(--merge-cell-h) / 2 - 1.5px);
  left: calc(var(--merge-pad) + var(--merge-c) * (var(--merge-cell-w) + var(--merge-gap)) + var(--merge-cell-w) / 2 - 1.5px);
  animation: merge-particle 300ms ease-out forwards;
}

@keyframes merge-particle {
  0% { transform: translate(0, 0) scale(1); opacity: 1; }
  100% { transform: translate(var(--px), var(--py)) scale(0); opacity: 0; }
}

/* Score pop */
@keyframes merge-score-pop {
  0% { transform: scale(1); }
  50% { transform: scale(1.2); }
  100% { transform: scale(1); }
}

.merge-score-pop {
  animation: merge-score-pop 150ms ease-out;
}

/* Undo feedback */
@keyframes merge-undo-flash {
  0% { filter: brightness(1); }
  50% { filter: brightness(1.2); }
  100% { filter: brightness(1); }
}

.merge-tile-undo {
  animation: merge-undo-flash 200ms ease-out;
}

/* Overlays */
.merge-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(197, 180, 100, 0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  border-radius: 12px;
  animation: merge-overlay-in 250ms ease-out;
  pointer-events: all;
}

@keyframes merge-overlay-in {
  from { opacity: 0; transform: scale(0.9); }
  to { opacity: 1; transform: scale(1); }
}

.merge-overlay-box {
  background: #faf0c8;
  border-radius: 10px;
  padding: 14px 20px;
  text-align: center;
  box-shadow: 0 6px 24px rgba(80, 60, 10, 0.2);
}

.merge-overlay-msg {
  font-size: 15px;
  font-weight: 700;
  font-family: 'Fredoka', sans-serif;
  color: #5c4033;
  margin-bottom: 4px;
}

.merge-overlay-score {
  font-size: 11px;
  color: #8a7a50;
  margin-bottom: 10px;
}

.merge-overlay .merge-btn {
  display: block;
  width: 100%;
  padding: 5px 12px;
  font-size: 10px;
  margin-top: 6px;
}

.merge-keep-btn {
  background: #f4a0d4 !important;
  color: #fff !important;
}

.merge-keep-btn:hover {
  background: #e890c4 !important;
}

/* Edge spawn animations */
.merge-tile-edge-left {
  animation: merge-edge-from-left 150ms cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
.merge-tile-edge-right {
  animation: merge-edge-from-right 150ms cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
.merge-tile-edge-top {
  animation: merge-edge-from-top 150ms cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
.merge-tile-edge-bottom {
  animation: merge-edge-from-bottom 150ms cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

@keyframes merge-edge-from-left {
  0% { transform: translateX(calc(-100% - 10px)); }
  100% { transform: translateX(0); }
}
@keyframes merge-edge-from-right {
  0% { transform: translateX(calc(100% + 10px)); }
  100% { transform: translateX(0); }
}
@keyframes merge-edge-from-top {
  0% { transform: translateY(calc(-100% - 10px)); }
  100% { transform: translateY(0); }
}
@keyframes merge-edge-from-bottom {
  0% { transform: translateY(calc(100% + 10px)); }
  100% { transform: translateY(0); }
}

/* ── Preview tile in chute ── */
.merge-preview {
  position: absolute;
  left: 50%;
  top: 28%;
  transform: translate(-50%, -50%);
  display: flex;
  justify-content: center;
  align-items: center;
  pointer-events: none;
}

.merge-preview-tile.merge-tile {
  position: relative;
  top: auto;
  left: auto;
  width: 26px;
  height: 18px;
  transition: none;
  animation: merge-preview-drop 300ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

.merge-preview-tile .merge-tile-face {
  font-size: 9px;
  border-radius: 3px 3px 2px 2px;
}

.merge-preview-tile .merge-tile-ledge {
  height: 3px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.12);
}

@keyframes merge-preview-drop {
  0% { opacity: 0; transform: translateY(-40px) scale(0.8); }
  40% { opacity: 1; }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

/* ── Arrow hint overlay ── */
.merge-arrow-hint {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  opacity: 0.85;
  transition: opacity 1s ease-out;
  pointer-events: none;
}

.merge-arrow-hint-out {
  opacity: 0;
}

.merge-arrow-keys {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.merge-arrow-row {
  display: flex;
  gap: 4px;
}

.merge-arrow-key {
  width: 26px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.85);
  border-radius: 4px;
  font-size: 11px;
  color: #5c4033;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

/* ═══════════════════════════════════════════════════════════════════════
   PIXEL ART WIDGET
   ═══════════════════════════════════════════════════════════════════════ */

/* Download tip modal */
.pa-dl-modal {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  border-radius: 12px;
}

.pa-dl-box {
  background: #2b2b2b;
  border-radius: 12px;
  padding: 14px 16px;
  text-align: center;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.25);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.pa-dl-icon {
  font-size: 22px;
  color: rgba(255, 255, 255, 0.7);
}

.pa-dl-btn {
  background: #333;
  color: white;
  border: none;
  padding: 8px 20px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: opacity 0.15s;
  display: flex;
  align-items: center;
  gap: 6px;
}

.pa-dl-btn:hover {
  opacity: 0.8;
}

#window-pixelart .window-titlebar {
  background: #2b2b2b;
  border-bottom: 1px solid #3a3a3a;
}

#window-pixelart .window-title {
  color: #ddd;
}

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

#window-pixelart .window-menu-btn i {
  color: rgba(255, 255, 255, 0.7);
}

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

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

#window-pixelart .window-content {
  overflow: hidden;
}

.pa-container {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #2b2b2b;
  user-select: none;
}

.pa-main {
  display: flex;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.pa-sidebar {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 3px 2px;
  gap: 1px;
  background: #232323;
  flex-shrink: 0;
}

.pa-sidebar-left {
  border-right: 1px solid #3a3a3a;
}

.pa-sidebar-right {
  border-left: 1px solid #3a3a3a;
}

.pa-tool-sep {
  width: 18px;
  height: 1px;
  background: #3a3a3a;
  margin: 2px 0;
}

.pa-tool-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border: none;
  border-radius: 3px;
  background: transparent;
  color: #999;
  font-size: 11px;
  cursor: pointer;
  position: relative;
  outline: none;
  padding: 0;
  transition: background 0.15s, color 0.15s;
}

.pa-tool-btn:hover {
  background: #3a3a3a;
  color: #ddd;
}

.pa-tool-btn.active {
  background: #555;
  color: #fff;
}

.pa-tool-btn i {
  font-size: 11px;
  line-height: 1;
}

.pa-mirror-badge {
  position: absolute;
  bottom: 0;
  right: 0;
  font-size: 6px;
  font-weight: 700;
  line-height: 1;
  color: inherit;
  pointer-events: none;
}

.pa-canvas-area {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 4px;
  min-height: 0;
  min-width: 0;
}

.pa-canvas {
  display: block;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  cursor: default;
  border: 1px solid #3a3a3a;
  background: #fff;
}

.pa-bottom-bar {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 3px 4px;
  border-top: 1px solid #3a3a3a;
  background: #232323;
  flex-shrink: 0;
}

.pa-active-color {
  width: 18px;
  height: 18px;
  border-radius: 2px;
  border: 1px solid #555;
  flex-shrink: 0;
}

.pa-palette-wrap {
  display: flex;
  align-items: stretch;
  gap: 2px;
  flex: 0 1 auto;
  min-width: 0;
  margin: -3px 0;
}

.pa-palette {
  display: grid;
  grid-template-columns: repeat(8, 20px);
  grid-auto-rows: 14px;
  gap: 0;
  height: 28px;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: none;
}

.pa-palette::-webkit-scrollbar {
  display: none;
}

.pa-palette-arrows {
  display: flex;
  flex-direction: column;
  gap: 1px;
  flex-shrink: 0;
}

.pa-palette-arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 13px;
  border: none;
  border-radius: 2px;
  background: #3a3a3a;
  color: #999;
  font-size: 8px;
  cursor: pointer;
  padding: 0;
}

.pa-palette-arrow:hover {
  background: #4a4a4a;
  color: #ddd;
}

.pa-palette-arrow i {
  font-size: 8px;
  line-height: 1;
}

.pa-color-swatch {
  width: 20px;
  height: 14px;
  border: none;
  border-radius: 0;
  cursor: pointer;
  padding: 0;
  transition: opacity 0.1s;
}

.pa-color-swatch:hover {
  opacity: 0.8;
}

.pa-color-swatch.active {
  outline: 1.5px solid #fff;
  outline-offset: -1.5px;
  z-index: 1;
  position: relative;
}

.pa-picker-wrap {
  position: relative;
  flex-shrink: 0;
}

.pa-picker-btn {
  width: 18px;
  height: 18px;
  border: 1px solid #555;
  border-radius: 2px;
  padding: 0;
  cursor: pointer;
  background: linear-gradient(135deg, #f00, #ff0, #0f0, #0ff, #00f, #f0f, #f00);
}

.pa-picker-popup {
  display: none;
  position: absolute;
  bottom: calc(100% + 6px);
  right: 0;
  background: #333;
  border: 1px solid #555;
  border-radius: 6px;
  padding: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  z-index: 20;
  gap: 8px;
  flex-direction: column;
  align-items: stretch;
  min-width: 120px;
}

.pa-picker-popup.open {
  display: flex;
}

.pa-palette-select {
  background: #3a3a3a;
  color: #ccc;
  border: 1px solid #555;
  border-radius: 4px;
  font-size: 11px;
  padding: 4px 6px;
  cursor: pointer;
  outline: none;
  width: 100%;
}

.pa-palette-select option {
  background: #333;
  color: #ccc;
}

.pa-color-custom {
  width: 100%;
  height: 28px;
  border: 1px solid #555;
  border-radius: 4px;
  padding: 0;
  cursor: pointer;
  background: transparent;
}

.pa-color-custom::-webkit-color-swatch-wrapper {
  padding: 2px;
}

.pa-color-custom::-webkit-color-swatch {
  border: none;
  border-radius: 2px;
}

.pa-color-custom::-moz-color-swatch {
  border: none;
  border-radius: 2px;
}

.pa-preview {
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  border: 1px solid #3a3a3a;
  border-radius: 2px;
  flex-shrink: 0;
  width: 28px;
  height: 28px;
}

.pa-stamp-popup {
  display: none;
  position: fixed;
  background: #333;
  border: 1px solid #555;
  border-radius: 6px;
  padding: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  z-index: 100000;
  width: 200px;
  max-height: 260px;
  overflow-y: auto;
}

.pa-stamp-popup.open {
  display: block;
}

.pa-stamp-label {
  font-size: 10px;
  color: #999;
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.pa-stamp-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
}

.pa-stamp-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  aspect-ratio: 1;
  border: 1px solid #555;
  border-radius: 4px;
  background: #2b2b2b;
  cursor: pointer;
  padding: 4px;
  transition: background 0.15s, border-color 0.15s;
}

.pa-stamp-btn:hover {
  background: #444;
  border-color: #777;
}

.pa-stamp-btn img {
  width: 100%;
  height: 100%;
  filter: invert(0.8);
}

.pa-resize-spacer {
  width: 14px;
  flex-shrink: 0;
}


.window-menu-label {
  padding: 4px 12px 2px;
  font-size: 10px;
  font-weight: 600;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.window-menu-divider {
  height: 1px;
  background: rgba(0, 0, 0, 0.08);
  margin: 4px 0;
}

/* ═══════════════════════════════════════════════════════════════════════
   SUDOKU WIDGET — ZEN GARDEN THEME
   ═══════════════════════════════════════════════════════════════════════ */

#window-sudoku {
  background: transparent !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  border-color: rgba(107, 90, 62, 0.35);
}

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

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

#window-sudoku .window-title {
  color: rgba(20, 40, 10, 0.88);
  text-shadow: 0 1px 2px rgba(255, 255, 255, 0.3);
}

#window-sudoku .window-menu-btn {
  color: rgba(20, 40, 10, 0.80);
  background: rgba(0, 0, 0, 0.10);
}

#window-sudoku .window-menu-btn:hover {
  background: rgba(0, 0, 0, 0.20);
}

#window-sudoku .window-resize-handle i {
  color: rgba(20, 40, 10, 0.45);
}

.sdk-container {
  --sdk-board-bg:   #2d6614;
  --sdk-box-gap-bg: #4a8a24;
  --sdk-cell-bg:    #f4faf0;
  --sdk-ink:        #1a3d0a;
  --sdk-user:       #1e6e0e;
  --sdk-notes:      #2a5010;
  --sdk-sel:        rgba(80, 185, 40, 0.18);
  --sdk-peer:       rgba(210, 240, 190, 0.55);
  --sdk-match:      rgba(50, 155, 30, 0.30);
  --sdk-btn-bg:     #3a7a1a;
  --sdk-btn-text:   #ffffff;
  --sdk-btn-hover:  #2a5c10;

  width: 100%;
  height: calc(100% + 36px);
  margin-top: -36px;
  position: relative;
  overflow: hidden;
  border-radius: 12px;
  background-color: #c8e8a8;
  background-size: cover;
  background-position: center;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
}

.sdk-scale-wrapper {
  position: absolute;
  top: 0;
  left: 0;
  width: 297px;
  height: 280px;
  transform-origin: top left;
  display: flex;
  flex-direction: column;
  padding: 0 2px 6px;
  box-sizing: border-box;
}

/* ── Notes toggle (absolute, top-right, aligned with board top) ── */

.sdk-notes-toggle {
  position: absolute;
  top: 0;
  right: 0;
  width: 30px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 5px;
  background: rgba(30, 90, 12, 0.55);
  color: var(--sdk-btn-text);
  font-size: 11px;
  cursor: pointer;
  transition: background 0.12s, opacity 0.12s;
  z-index: 2;
}

.sdk-notes-toggle:hover {
  background: rgba(30, 90, 12, 0.78);
}

.sdk-notes-toggle.active {
  background: var(--sdk-btn-bg);
  color: var(--sdk-btn-text);
}

.sdk-notes-toggle i {
  font-size: 10px;
  line-height: 1;
}

/* ── Board ── */

.sdk-board {
  flex: none;
  width: 233px;
  height: 233px;
  align-self: center;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  gap: 3px;
  background: var(--sdk-board-bg);
  border: 3px solid var(--sdk-board-bg);
  border-radius: 5px;
  margin-bottom: 4px;
  box-shadow:
    0 4px 14px rgba(15, 50, 5, 0.45),
    inset 0 1px 0 rgba(180, 240, 130, 0.15);
}

.sdk-box {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  gap: 1px;
  background: var(--sdk-box-gap-bg);
}

.sdk-cell {
  background: var(--sdk-cell-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
  transition: background 0.1s;
  min-width: 0;
  min-height: 0;
}

.sdk-cell:hover {
  background: #e6f5e0;
}

.sdk-cell.sdk-given {
  background: #dff0d8;
  cursor: default;
}

.sdk-cell.sdk-selected {
  background: var(--sdk-sel) !important;
}

.sdk-cell.sdk-hl-peer {
  background: var(--sdk-peer);
}

.sdk-cell.sdk-hl-match {
  background: var(--sdk-match);
}

.sdk-cell.sdk-check-error .sdk-digit {
  color: #b84040 !important;
}

/* ── Digits ── */

.sdk-digit {
  font-size: 15px;
  font-weight: 700;
  line-height: 1;
  pointer-events: none;
  position: relative;
  z-index: 1;
}

.sdk-digit.sdk-ink {
  color: var(--sdk-ink);
  font-weight: 800;
}

.sdk-digit.sdk-user-digit {
  color: var(--sdk-user);
  font-weight: 700;
}

/* ── Notes micro-grid ── */

.sdk-notes-grid {
  position: absolute;
  inset: 1px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  pointer-events: none;
}

.sdk-note {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 7px;
  font-weight: 600;
  color: var(--sdk-notes);
  line-height: 1;
}

/* ── Input strip ── */

.sdk-input-strip {
  display: flex;
  gap: 3px;
  height: 32px;
  flex-shrink: 0;
  margin-top: auto;
}

.sdk-digit-btn,
.sdk-action-btn {
  flex: 1;
  min-width: 0;
  height: 100%;
  border: none;
  border-radius: 5px;
  font-family: inherit;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.12s, opacity 0.12s;
}

.sdk-digit-btn {
  font-size: 15px;
  background: var(--sdk-btn-bg);
  color: var(--sdk-btn-text);
  box-shadow: 0 2px 5px rgba(10, 40, 5, 0.30), inset 0 1px 0 rgba(180, 255, 140, 0.18);
}

.sdk-digit-btn:hover {
  background: var(--sdk-btn-hover);
}

.sdk-digit-btn:active {
  opacity: 0.75;
  transform: translateY(1px);
}

.sdk-action-btn {
  font-size: 11px;
  background: rgba(30, 90, 12, 0.55);
  color: var(--sdk-btn-text);
  flex: 0 0 30px;
}

.sdk-action-btn:hover {
  background: rgba(30, 90, 12, 0.78);
}

.sdk-action-btn:disabled {
  opacity: 0.3;
  cursor: default;
}

.sdk-action-btn:disabled:hover {
  background: rgba(30, 90, 12, 0.55);
}

.sdk-action-btn i {
  font-size: 11px;
  line-height: 1;
}

/* ── Hint flash animation ── */

@keyframes sdk-hint-flash {
  0%   { background: rgba(80, 200, 40, 0.75); }
  60%  { background: rgba(80, 200, 40, 0.40); }
  100% { background: var(--sdk-match); }
}

.sdk-hint-flash {
  animation: sdk-hint-flash 500ms ease-out forwards;
}

/* ── Win overlay ── */

.sdk-win-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(30, 90, 15, 0.84);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  border-radius: 12px;
  animation: sdk-win-in 300ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes sdk-win-in {
  from { opacity: 0; transform: scale(0.85); }
  to   { opacity: 1; transform: scale(1); }
}

.sdk-win-box {
  background: #f0faeb;
  border-radius: 12px;
  padding: 18px 28px;
  text-align: center;
  box-shadow: 0 8px 28px rgba(10, 50, 5, 0.30);
}

.sdk-win-icon {
  font-size: 32px;
  margin-bottom: 6px;
}

.sdk-win-msg {
  font-size: 18px;
  font-weight: 700;
  color: #2d6614;
  margin-bottom: 6px;
}

.sdk-win-btn {
  background: var(--sdk-btn-bg);
  color: var(--sdk-btn-text);
  border: none;
  padding: 8px 22px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: opacity 0.15s;
}

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

/* ═══════════════════════════════════════════════════════════════════════════════
   BREATH WIDGET
   ═══════════════════════════════════════════════════════════════════════════════ */

/* ── Window theming ──────────────────────────────────────────────────────────── */
#window-breath .window-content { overflow: hidden; }
#content-breath { position: relative; }

#window-breath.breath-dark { background: rgba(17, 24, 39, 0.96) !important; }
#window-breath.breath-dark .window-titlebar { border-bottom-color: rgba(255,255,255,0.07) !important; }
#window-breath.breath-dark .window-title { color: rgba(255,255,255,0.82) !important; }
#window-breath.breath-dark .window-menu-btn { color: rgba(255,255,255,0.70) !important; background: rgba(255,255,255,0.08) !important; }
#window-breath.breath-dark .window-menu-btn:hover { color: rgba(255,255,255,0.95) !important; background: rgba(255,255,255,0.15) !important; }
#window-breath.breath-dark .window-resize-handle { color: rgba(255,255,255,0.18) !important; }

/* ── Shared layout ───────────────────────────────────────────────────────────── */
.brth-idle,
.brth-active {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  min-height: 0;
  padding: 0 12px 4px;
  box-sizing: border-box;
}

/* ── Idle: technique cycler ──────────────────────────────────────────────────── */
.brth-cycler {
  display: flex;
  align-items: center;
  width: 100%;
  gap: 6px;
  height: 48px;
  flex-shrink: 0;
  background: rgba(0,0,0,0.04);
  border-radius: 12px;
  padding: 0 4px;
  box-sizing: border-box;
}
#window-breath.breath-dark .brth-cycler { background: rgba(255,255,255,0.06); }

.brth-name-wrap {
  flex: 1;
  text-align: center;
  min-width: 0;
}
.brth-tech-name {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: #222;
  line-height: 1.2;
}
.brth-tech-hint {
  font-size: 10px;
  color: #888;
  margin-top: 3px;
  line-height: 1.3;
}
#window-breath.breath-dark .brth-tech-name { color: rgba(255,255,255,0.88); }
#window-breath.breath-dark .brth-tech-hint { color: rgba(255,255,255,0.40); }

.brth-cycle-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 20px;
  color: #aaa;
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: 8px;
  transition: color 0.15s, background 0.15s;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.brth-cycle-btn:hover { color: #555; background: rgba(0,0,0,0.06); }
#window-breath.breath-dark .brth-cycle-btn { color: rgba(255,255,255,0.35); }
#window-breath.breath-dark .brth-cycle-btn:hover { color: rgba(255,255,255,0.80); background: rgba(255,255,255,0.08); }

/* ── Idle: duration row ──────────────────────────────────────────────────────── */
.brth-dur-row {
  display: flex;
  gap: 6px;
  margin-top: 6px;
  flex-shrink: 0;
  width: 100%;
}
.brth-dur-btn {
  flex: 1;
  height: 28px;
  border: 1.5px solid rgba(0,0,0,0.10);
  border-radius: 8px;
  background: transparent;
  font-size: 11px;
  font-weight: 600;
  color: #666;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
  font-family: inherit;
}
.brth-dur-btn:hover { background: rgba(0,0,0,0.05); color: #333; }
.brth-dur-btn.active {
  border-color: #4facfe;
  background: rgba(79,172,254,0.10);
  color: #2d8fe0;
}
#window-breath.breath-dark .brth-dur-btn { border-color: rgba(255,255,255,0.12); color: rgba(255,255,255,0.50); }
#window-breath.breath-dark .brth-dur-btn:hover { background: rgba(255,255,255,0.07); color: rgba(255,255,255,0.80); }
#window-breath.breath-dark .brth-dur-btn.active { border-color: #4facfe; background: rgba(79,172,254,0.15); color: #7dd3fc; }

/* ── Idle: stats grid ────────────────────────────────────────────────────────── */
.brth-stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px;
  width: 100%;
  margin-top: 6px;
  flex: 1;
  min-height: 0;
}
.brth-stat-cell {
  background: rgba(0,0,0,0.03);
  border-radius: 10px;
  padding: 5px 4px 4px;
  text-align: center;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}
#window-breath.breath-dark .brth-stat-cell { background: rgba(255,255,255,0.05); }
.brth-stat-val {
  font-size: 18px;
  font-weight: 700;
  line-height: 1.1;
  color: #222;
}
.brth-stat-lbl {
  font-size: 8.5px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #999;
  margin-top: 2px;
  line-height: 1.2;
}
#window-breath.breath-dark .brth-stat-val { color: rgba(255,255,255,0.88); }
#window-breath.breath-dark .brth-stat-lbl { color: rgba(255,255,255,0.35); }

/* ── Idle: begin button ──────────────────────────────────────────────────────── */
.brth-begin-btn {
  width: 100%;
  height: 36px;
  margin-top: 6px;
  border: none;
  border-radius: 10px;
  background: linear-gradient(135deg, #4facfe, #00d2ff);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.03em;
  cursor: pointer;
  transition: opacity 0.15s, transform 0.12s;
  font-family: inherit;
  flex-shrink: 0;
}
.brth-begin-btn:hover { opacity: 0.88; transform: translateY(-1px); }
.brth-begin-btn:active { transform: translateY(0); opacity: 1; }

/* ── Idle: legal note ────────────────────────────────────────────────────────── */
.brth-legal {
  font-size: 8px;
  text-align: center;
  color: #bbb;
  margin: 4px 0 0;
  line-height: 1.3;
  letter-spacing: 0.01em;
  flex-shrink: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
#window-breath.breath-dark .brth-legal { color: rgba(255,255,255,0.20); }

/* ── Active: info bar ────────────────────────────────────────────────────────── */
.brth-info-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  margin-bottom: 4px;
  flex-shrink: 0;
}
.brth-cycle-lbl {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #aaa;
}
.brth-time-lbl {
  font-size: 13px;
  font-weight: 600;
  color: #aaa;
  font-variant-numeric: tabular-nums;
}
#window-breath.breath-dark .brth-cycle-lbl,
#window-breath.breath-dark .brth-time-lbl { color: rgba(255,255,255,0.35); }

/* ── Active: canvas waveform ─────────────────────────────────────────────────── */
.brth-canvas {
  flex: 1;
  min-height: 0;
  width: 100%;
  display: block;
  border-radius: 8px;
}

/* ── Active: end button ──────────────────────────────────────────────────────── */
.brth-end-btn {
  width: 100%;
  height: 38px;
  margin-top: 8px;
  border: none;
  border-radius: 10px;
  background: rgba(0,0,0,0.07);
  color: #666;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.03em;
  cursor: pointer;
  transition: background 0.15s, transform 0.12s;
  font-family: inherit;
  flex-shrink: 0;
}
.brth-end-btn:hover { background: rgba(0,0,0,0.11); transform: translateY(-1px); }
.brth-end-btn:active { transform: translateY(0); }
#window-breath.breath-dark .brth-end-btn { background: rgba(255,255,255,0.10); color: rgba(255,255,255,0.55); }
#window-breath.breath-dark .brth-end-btn:hover { background: rgba(255,255,255,0.16); }

/* ── Active: completion overlay ──────────────────────────────────────────────── */
.brth-complete {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: inherit;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.45s ease;
}
#window-breath.breath-dark .brth-complete { background: rgba(17,24,39,0.93); }
.brth-complete.show { opacity: 1; pointer-events: auto; }
.brth-complete-icon { font-size: 40px; line-height: 1; }
.brth-complete-title {
  font-size: 17px;
  font-weight: 700;
  color: #222;
}
.brth-complete-sub {
  font-size: 12px;
  color: #888;
}
#window-breath.breath-dark .brth-complete-title { color: rgba(255,255,255,0.90); }
#window-breath.breath-dark .brth-complete-sub   { color: rgba(255,255,255,0.45); }

/* ── Active view: position completion overlay relative to .brth-active ───────── */
.brth-active {
  position: relative;
  transform: translateZ(0);
  will-change: opacity;
}

.brth-idle {
  transition: opacity 0.2s ease;
  transform: translateZ(0);
  will-change: opacity;
}

.brth-active {
  transition: opacity 0.2s ease;
}

.brth-fade-out {
  opacity: 0 !important;
  pointer-events: none;
}

/* ── Menu: danger button ─────────────────────────────────────────────────────── */
.window-menu-item.danger { color: #e05252; }
.window-menu-item.danger:hover { background: rgba(224, 82, 82, 0.08); }

/* ── Breath: streak tip overlay ──────────────────────────────────────────────── */
.brth-tip-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-radius: inherit;
  z-index: 2;
  transition: opacity 0.30s ease;
}
#window-breath.breath-dark .brth-tip-overlay { background: rgba(17,24,39,0.96); }

.brth-tip-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 0 22px;
  text-align: center;
}
.brth-tip-msg {
  font-size: 15px;
  font-weight: 500;
  color: #333;
  line-height: 1.5;
  max-width: 220px;
}
#window-breath.breath-dark .brth-tip-msg { color: rgba(255,255,255,0.82); }

.brth-tip-later {
  font-size: 11px;
  color: #aaa;
  cursor: pointer;
  text-decoration: none;
  margin-top: 2px;
}
.brth-tip-later:hover { color: #666; }
#window-breath.breath-dark .brth-tip-later       { color: rgba(255,255,255,0.30); }
#window-breath.breath-dark .brth-tip-later:hover { color: rgba(255,255,255,0.60); }

/* win-tip-btn dark-mode override inside the breath tip overlay */
#window-breath.breath-dark .brth-tip-overlay .win-tip-btn {
  background: rgba(255,255,255,0.10);
  color: rgba(255,255,255,0.80);
  border-color: rgba(255,255,255,0.20);
}
#window-breath.breath-dark .brth-tip-overlay .win-tip-btn:hover {
  background: rgba(255,255,255,0.18);
}

/* ============================================================
   Voice Recorder Widget
   ============================================================ */
#window-voice {
  overflow: visible;
}
#window-voice .window-titlebar {
  background: transparent;
}
#window-voice .window-content {
  overflow: visible;
  position: relative;
}

.voice-container {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  padding: 0 12px 8px;
  box-sizing: border-box;
  gap: 0;
  overflow: visible;
}

.voice-record-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 20px 0 12px;
}

.voice-record-btn {
  width: 62px;
  height: 62px;
  border-radius: 50%;
  border: none;
  background: #6366f1;
  color: #fff;
  font-size: 22px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s, box-shadow 0.3s, background 0.2s;
  position: relative;
  flex-shrink: 0;
  line-height: 1;
  box-shadow:
    0 0 12px 4px rgba(99, 102, 241, 0.35),
    0 0 32px 8px rgba(99, 102, 241, 0.18),
    0 2px 6px rgba(0, 0, 0, 0.12);
}
.voice-record-btn::before {
  content: '';
  position: absolute;
  inset: -10px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.28) 0%, rgba(99, 102, 241, 0) 70%);
  filter: blur(8px);
  pointer-events: none;
  transition: opacity 0.3s;
}
.voice-record-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  position: relative;
  z-index: 1;
}
.voice-record-btn:hover {
  transform: scale(1.07);
  background: #4f46e5;
  box-shadow:
    0 0 18px 6px rgba(99, 102, 241, 0.45),
    0 0 48px 14px rgba(99, 102, 241, 0.22),
    0 2px 8px rgba(0, 0, 0, 0.14);
}
.voice-record-btn:hover::before {
  opacity: 1.4;
}
.voice-record-btn.recording {
  background: #4f46e5;
  animation: voice-pulse 1.4s ease-in-out infinite;
}
.voice-record-btn.recording::before {
  background: radial-gradient(circle, rgba(239, 68, 68, 0.3) 0%, rgba(239, 68, 68, 0) 70%);
}
@keyframes voice-pulse {
  0%, 100% {
    box-shadow:
      0 0 12px 4px rgba(239, 68, 68, 0.4),
      0 0 32px 8px rgba(239, 68, 68, 0.15),
      0 2px 6px rgba(0,0,0,0.12);
  }
  50% {
    box-shadow:
      0 0 22px 10px rgba(239, 68, 68, 0.5),
      0 0 55px 20px rgba(239, 68, 68, 0.18),
      0 2px 6px rgba(0,0,0,0.12);
  }
}

.voice-timer {
  font-size: 15px;
  font-weight: 600;
  color: #6366f1;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.06em;
  min-height: 20px;
}

.voice-waveform {
  width: 200px;
  height: 28px;
  display: block;
}

.voice-list-section {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  border-top: 1px solid rgba(99, 102, 241, 0.15);
  padding-top: 6px;
}

.voice-list {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.voice-empty {
  color: #a5b4fc;
  font-size: 12px;
  text-align: center;
  padding: 14px 0;
}

.voice-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 7px;
  border-radius: 8px;
  background: rgba(99, 102, 241, 0.06);
  transition: background 0.15s;
}
.voice-item:hover {
  background: rgba(99, 102, 241, 0.12);
}

.voice-item-info {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}

.voice-item-name {
  font-size: 12px;
  font-weight: 500;
  color: #312e81;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  outline: none;
  cursor: text;
  border-radius: 3px;
  padding: 1px 3px;
  margin: -1px -3px;
}
.voice-item-name:focus {
  background: rgba(255,255,255,0.85);
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
}

.voice-item-dur {
  font-size: 9px;
  color: #a5b4fc;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.voice-item-controls {
  display: flex;
  gap: 1px;
  flex-shrink: 0;
}

.voice-item-controls button {
  width: 26px;
  height: 26px;
  border: none;
  background: transparent;
  color: #818cf8;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  transition: background 0.15s, color 0.15s;
}
.voice-item-controls button:hover {
  background: rgba(99, 102, 241, 0.12);
  color: #4f46e5;
}
.voice-delete-btn:hover {
  color: #ef4444 !important;
  background: rgba(239, 68, 68, 0.08) !important;
}

.voice-tip-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 7px;
  border-radius: 8px;
  background: rgba(99, 102, 241, 0.06);
  margin-top: 1px;
}
.voice-tip-label {
  font-size: 10px;
  color: #a5b4fc;
  font-weight: 500;
}
.voice-tip-btn {
  font-size: 10px;
  color: #6366f1;
  font-weight: 600;
  text-decoration: none;
  padding: 2px 7px;
  border-radius: 5px;
  background: rgba(99, 102, 241, 0.1);
  transition: background 0.15s, color 0.15s;
}
.voice-tip-btn:hover {
  background: rgba(99, 102, 241, 0.2);
  color: #4f46e5;
}
.voice-tip-dismiss {
  border: none;
  background: transparent;
  color: #c7d2fe;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  padding: 0 0 0 4px;
  flex-shrink: 0;
  transition: color 0.15s;
}
.voice-tip-dismiss:hover {
  color: #6366f1;
}

/* ============================================================
   Mirror Widget
   ============================================================ */

#window-mirror {
  background: #2d2d2d !important;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

#window-mirror .window-titlebar {
  background: transparent;
}

#window-mirror .window-title {
  color: rgba(255, 255, 255, 0.75);
  opacity: 1;
}

#window-mirror.focused .window-title {
  color: rgba(255, 255, 255, 0.95);
}

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

#window-mirror .window-menu-btn:hover {
  background: rgba(255, 255, 255, 0.18);
  color: rgba(255, 255, 255, 0.9);
}

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

#window-mirror .window-content {
  padding: 0 36px 36px;
  overflow: hidden;
  box-sizing: border-box;
}

.mirror-frame {
  width: 100%;
  height: 100%;
  overflow: hidden;
  border-radius: 2px;
  position: relative;
}

.mirror-frame::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 10;
  box-sizing: border-box;
  border-top: 3px solid #000;
  border-left: 3px solid #3a3a3a;
  border-bottom: 3px solid #e0e0e0;
  border-right: 3px solid #b0b0b0;
}

.mirror-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scaleX(-1);
  display: block;
}

.mirror-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: #1a1a1a;
}

.mirror-placeholder-icon {
  font-size: 24px;
  color: rgba(255, 255, 255, 0.25);
}

.mirror-placeholder-text {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.35);
  text-align: center;
  padding: 0 12px;
  line-height: 1.4;
}

/* ═══════════════════════════════════════════════════════════════════
   TANGLES WIDGET — Warm Wool theme
   ═══════════════════════════════════════════════════════════════════ */

#window-tangles {
  background: transparent !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  border-color: rgba(120, 90, 60, 0.3);
}

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

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

#window-tangles .window-title {
  color: rgba(61, 42, 26, 0.88);
  text-shadow: 0 1px 2px rgba(255, 255, 255, 0.4);
}

#window-tangles .window-menu-btn {
  color: rgba(61, 42, 26, 0.75);
  background: rgba(0, 0, 0, 0.08);
}

#window-tangles .window-menu-btn:hover {
  background: rgba(0, 0, 0, 0.16);
}

#window-tangles .window-resize-handle i {
  color: rgba(61, 42, 26, 0.4);
}

/* ── Container (extends behind titlebar) ── */

.tang-container {
  width: 100%;
  height: calc(100% + 36px);
  margin-top: -36px;
  position: relative;
  overflow: hidden;
  border-radius: 12px;
  background-color: #f0e8d8;
  background-image: url('/images/tangles/tangles-background.webp');
  background-size: cover;
  background-position: center bottom;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
}

.tang-container.tang-loading,
.tang-container.tang-error {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  color: rgba(61, 42, 26, 0.35);
}

/* ── Scale wrapper ── */


.tang-scale-wrapper {
  position: absolute;
  top: 0;
  left: 0;
  width: 264px;
  height: 290px;
  transform-origin: top left;
  display: flex;
  flex-direction: column;
  z-index: 1;
  box-sizing: border-box;
}

/* ── Header ── */

.tang-header {
  flex: none;
  padding: 6px 8px 4px;
  text-align: center;
}

.tang-pattern-label {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(61, 42, 26, 0.55);
  line-height: 1;
  margin-bottom: 3px;
}

.tang-pattern-name {
  font-size: 13px;
  font-weight: 700;
  color: #3d2a1a;
  line-height: 1.2;
  margin-bottom: 2px;
}

.tang-counter {
  font-size: 9px;
  color: rgba(61, 42, 26, 0.6);
  line-height: 1;
}

/* Dark-background puzzles (e.g. "Things that Glow"): light text + soft
   shadow so the header stays readable over the photo */
.tang-container.tang-dark .tang-pattern-label {
  color: rgba(255, 246, 230, 0.7);
}

.tang-container.tang-dark .tang-pattern-name {
  color: #fdf6e8;
}

.tang-container.tang-dark .tang-counter {
  color: rgba(255, 246, 230, 0.75);
}

.tang-container.tang-dark .tang-header {
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.6);
}

#window-tangles.tang-dark-window .window-title,
#window-tangles.tang-dark-window .window-menu-btn {
  color: rgba(250, 240, 225, 0.92);
}

/* ── Grid ── */

.tang-grid {
  flex: none;
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  grid-template-rows: repeat(6, 1fr);
  gap: 2px;
  margin: 4px 4px;
  width: 256px;
  height: 192px;
}

/* ── Cells ── */

.tang-cell {
  background: #e4d8c4;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.08s, transform 0.08s;
  position: relative;
}

.tang-letter {
  font-size: 13px;
  font-weight: 700;
  color: #3d2a1a;
  pointer-events: none;
  line-height: 1;
  text-transform: uppercase;
}

/* Hover */
.tang-cell:hover {
  background: #d8c8ae;
}

/* Active drag selection */
.tang-cell.tang-selecting {
  background: #c06040;
  transform: scale(1.08);
  z-index: 2;
}

.tang-cell.tang-selecting .tang-letter {
  color: #fff;
}

/* Found theme word (terracotta, locked in) */
.tang-cell.tang-found-word {
  background: #c06040;
}

.tang-cell.tang-found-word .tang-letter {
  color: #fff;
}

/* Found thread (deep teal) */
.tang-cell.tang-found-thread {
  background: #2a7a6e;
}

.tang-cell.tang-found-thread .tang-letter {
  color: #fff;
}

/* Invalid path flash */
.tang-cell.tang-invalid {
  background: #c04040;
  animation: tang-shake 0.3s ease;
}

.tang-cell.tang-invalid .tang-letter {
  color: #fff;
}

/* Hint pulse (highlights first cell of next unfound word) */
.tang-cell.tang-hint-pulse {
  animation: tang-pulse 0.6s ease 3;
}

@keyframes tang-shake {
  0%, 100% { transform: translateX(0); }
  25%       { transform: translateX(-3px); }
  75%       { transform: translateX(3px); }
}

@keyframes tang-pulse {
  0%, 100% { background: #e4d8c4; }
  50%       { background: #f0b060; box-shadow: 0 0 6px rgba(240, 176, 96, 0.7); }
}

/* ── Footer ── */

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

.tang-hint-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 5px 10px;
  border: none;
  border-radius: 20px;
  background: #8a6a50;
  color: #fff;
  font-size: 10px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.12s, opacity 0.12s;
  white-space: nowrap;
}

.tang-hint-btn i {
  font-size: 10px;
}

.tang-hint-btn:hover:not(:disabled) {
  background: #6e5040;
}

.tang-hint-btn:disabled {
  opacity: 0.4;
  cursor: default;
}

/* Progress badges */
.tang-found-badges {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: center;
}

.tang-badge {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #d8c8ae;
  border: 2px solid rgba(61, 42, 26, 0.2);
  transition: background 0.2s;
}

.tang-badge.tang-badge-filled {
  background: #c06040;
  border-color: #c06040;
}

/* ── Win overlay ── */

.tang-win-overlay {
  position: absolute;
  inset: 0;
  background: rgba(240, 232, 216, 0.92);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  border-radius: 12px;
  z-index: 20;
  animation: tang-fade-in 0.3s ease;
}

@keyframes tang-fade-in {
  from { opacity: 0; transform: scale(0.96); }
  to   { opacity: 1; transform: scale(1); }
}

.tang-win-box {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 16px;
}

.tang-win-icon {
  font-size: 36px;
  line-height: 1;
}

.tang-win-msg {
  font-size: 15px;
  font-weight: 700;
  color: #3d2a1a;
}

.tang-win-stats {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin: 4px 0 2px;
}

.tang-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  min-width: 36px;
}

.tang-stat-n {
  font-size: 20px;
  font-weight: 700;
  color: #3d2a1a;
  line-height: 1;
}

.tang-stat-label {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #8a7060;
}

.tang-win-hints {
  font-size: 10px;
  color: #a09080;
  margin-top: -2px;
}

.tang-tip-btn {
  display: inline-flex;
  align-items: center;
  padding: 7px 16px;
  border-radius: 20px;
  background: #8a6a50;
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.12s;
}

.tang-tip-btn:hover {
  background: #6e5040;
}

.tang-win-later {
  background: none;
  border: none;
  padding: 2px 0;
  font-size: 11px;
  color: #aaa;
  cursor: pointer;
  text-decoration: none;
  margin-top: 2px;
}
.tang-win-later:hover {
  color: #666;
}

/* ═══════════════════════════════════════════════════════════════════════
   SHEETS WIDGET
   ═══════════════════════════════════════════════════════════════════════ */

.sh {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  position: relative;
  font-size: var(--sh-font);
  color: var(--color-text-primary);
}

.sh-size-s { --sh-cell-w: 48px; --sh-cell-h: 18px; --sh-font: 10px; --sh-gut: 24px; }
.sh-size-m { --sh-cell-w: 60px; --sh-cell-h: 22px; --sh-font: 12px; --sh-gut: 28px; }
.sh-size-l { --sh-cell-w: 76px; --sh-cell-h: 28px; --sh-font: 15px; --sh-gut: 34px; }

.sh-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  flex-shrink: 0;
}

.sh-addr {
  min-width: 3em;
  font-weight: 600;
  font-size: 11px;
  color: var(--color-text-secondary);
  flex-shrink: 0;
}

.sh-fx-wrap {
  position: relative;
  flex: 1;
  min-width: 0;
}

.sh-fx {
  width: 100%;
  font-family: 'Consolas', 'Menlo', 'Monaco', 'Courier New', monospace;
  padding: 4px 46px 4px 8px;
  font-size: 12px;
  height: 24px;
  box-sizing: border-box;
}

.sh-fx-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 4px;
  padding: 0;
  cursor: pointer;
  background: none;
  font-size: 11px;
  transition: background 0.15s ease;
}
.sh-fx-btn:hover { background: rgba(0, 0, 0, 0.08); }
.sh-fx-btn[hidden] { display: none; }
.sh-fx-cancel { right: 25px; color: var(--color-danger); }
.sh-fx-commit { right: 4px; color: var(--color-success); }

.sh-fnlist {
  display: flex;
  flex-direction: column;
  max-height: 130px;
  overflow-y: auto;
  border-bottom: 1px solid var(--color-window-border);
  flex-shrink: 0;
}
.sh-fnlist[hidden] { display: none; }

.sh-fn-item {
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 4px 8px;
  cursor: pointer;
  font-size: 11px;
}
.sh-fn-item:hover,
.sh-fn-item.sh-fn-on { background: rgba(0, 122, 255, 0.10); }

.sh-fn-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.sh-fn-name {
  font-family: 'Consolas', 'Menlo', 'Monaco', 'Courier New', monospace;
  font-weight: 600;
  color: var(--color-text-primary);
  flex-shrink: 0;
}

.sh-fn-desc {
  color: var(--color-text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sh-fn-example {
  font-family: 'Consolas', 'Menlo', 'Monaco', 'Courier New', monospace;
  font-size: 10px;
  color: var(--color-accent);
  opacity: 0.8;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sh-scroll {
  flex: 1;
  min-height: 0;
  overflow: auto;
  position: relative;
}

.sh-grid {
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
  user-select: none;
  -webkit-user-select: none;
  width: calc(var(--sh-gut) + var(--sh-cell-w) * 26);
}

.sh-grid th,
.sh-grid td {
  width: var(--sh-cell-w);
  height: var(--sh-cell-h);
  box-sizing: border-box;
  padding: 0 4px;
  overflow: hidden;
  white-space: nowrap;
  border-right: 1px solid var(--color-window-border);
  border-bottom: 1px solid var(--color-window-border);
}

.sh-grid th {
  background: var(--color-window-bg);
  font-weight: 500;
  text-align: center;
  color: var(--color-text-secondary);
}

.sh-grid thead th {
  position: sticky;
  top: 0;
  z-index: 2;
}

.sh-grid tbody th {
  position: sticky;
  left: 0;
  z-index: 1;
  width: var(--sh-gut);
}

.sh-grid .sh-corner {
  left: 0;
  top: 0;
  z-index: 3;
  width: var(--sh-gut);
}

.sh-grid th.sh-hon {
  color: var(--color-accent);
  background: rgba(0, 122, 255, 0.10);
}

.sh-n { text-align: right; }
.sh-b { text-align: center; }
.sh-e { text-align: center; color: var(--color-danger); }

/* Per-cell text styles (Ctrl/Cmd+B / +I); the in-place editor mirrors them via inline style. */
.sh-grid td.sh-bold { font-weight: 700; }
.sh-grid td.sh-ital { font-style: italic; }

.sh-sel {
  background: rgba(0, 122, 255, 0.10);
}

.sh-act {
  box-shadow: inset 0 0 0 2px var(--color-accent);
}

.sh-editor {
  position: absolute;
  z-index: 1;
  box-sizing: border-box;
  padding: 0 4px;
  font: inherit;
  border: 2px solid var(--color-accent);
  outline: none;
  background: var(--color-window-bg);
  color: inherit;
}

.sh-focus {
  position: absolute;
  left: 0;
  top: 0;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
  resize: none;
  border: 0;
  padding: 0;
}

.sh-status {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 8px;
  font-size: 11px;
  color: var(--color-text-secondary);
  white-space: nowrap;
  overflow: hidden;
  flex-shrink: 0;
}

.sh-msg {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Sheet/document navigation arrows in the title bar — same look as .window-menu-btn */
.sheets-nav-btn,
.notes-nav-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);
  text-decoration: none;
  box-sizing: border-box;
  flex-shrink: 0;
}
.sheets-nav-btn i,
.notes-nav-btn i {
  line-height: 1;
  transform: scaleX(0.8);
}
.sheets-nav-btn img,
.notes-nav-btn img {
  width: 12px;
  height: 12px;
  display: block;
  pointer-events: none;
  opacity: 0.6;
}
.window.focused .sheets-nav-btn,
.window.focused .notes-nav-btn {
  opacity: 1;
}
.window.focused .sheets-nav-btn:disabled,
.window.focused .notes-nav-btn:disabled {
  opacity: 0.2;
}
.sheets-nav-btn:hover:not(:disabled),
.notes-nav-btn:hover:not(:disabled) {
  background: rgba(0, 0, 0, 0.1);
  opacity: 1;
}
.sheets-nav-btn[hidden],
.notes-nav-btn[hidden] {
  display: none;
}
.sheets-nav-btn:disabled,
.notes-nav-btn:disabled {
  opacity: 0.2;
  cursor: default;
}
