/* 260525 21:41 Stable */
@import url("https://fonts.googleapis.com/css2?family=Noto+Serif+KR:wght@700&family=JetBrains+Mono:wght@500&display=swap");
:root {
  --glass-bg: rgba(0, 0, 0, 0.45);
  --glass-border: rgba(255, 255, 255, 0.15);
  --accent-color: #38bdf8;
  --warning-color: #fbbf24;
  --memo-color: #fcd34d;
  --quote-shadow: 0 4px 15px rgba(0, 0, 0, 1), 0 2px 4px rgba(0, 0, 0, 0.8);
  --btn-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  --quote-size-large: 3rem;
  --quote-size-medium: 2.4rem;
  --quote-size-small: 1.8rem;
  --quote-font-size: var(--quote-size-medium);
  --quote-author-size-large: 1.4rem;
  --quote-author-size-medium: 1.1rem;
  --quote-author-size-small: 0.8rem;
  --quote-author-font-size: var(--quote-author-size-medium);
  --widget-scale-large: 1.15;
  --widget-scale-medium: 1;
  --widget-scale-small: 0.85;
  --widget-scale: var(--widget-scale-medium);
}
html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
  overflow: auto !important;
}
body {
  padding: 120px 20px 150px;
  min-height: 100vh;
  background-color: #020617;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-attachment: fixed;
  color: #f1f5f9;
  font-family:
    "Pretendard Variable",
    Pretendard,
    -apple-system,
    BlinkMacSystemFont,
    system-ui,
    Roboto,
    "Helvetica Neue",
    "Segoe UI",
    "Apple SD Gothic Neo",
    "Noto Sans KR",
    "Malgun Gothic",
    "Apple Color Emoji",
    "Segoe UI Emoji",
    "Segoe UI Symbol",
    sans-serif;
  display: flex;
  flex-direction: column;
  align-items: center;
  box-sizing: border-box;
  transition: background-image 0.8s ease-in-out;
}
body::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: 0 0;
  z-index: -1;
}
.widget-btn {
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(10px);
  border: 1px solid var(--glass-border);
  border-radius: 14px;
  color: #fff;
  width: 45px;
  height: 45px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0.7;
  transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: var(--btn-shadow);
  transform: scale(1);
}
.widget-btn:hover {
  opacity: 1;
  border-color: var(--accent-color);
  color: var(--accent-color);
  transform: scale(1.1);
}
.fab-container {
  position: relative;
  display: flex;
  align-items: center;
}
.fab-menu {
  display: flex;
  gap: 10px;
  position: absolute;
  opacity: 0;
  visibility: hidden;
  transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;
  z-index: 200;
  transform: scale(0.9) translateX(-10px);
}
.fab-menu.active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: scale(1) translateX(0);
}
.right-menu {
  left: 55px;
  top: 0;
  flex-direction: row;
}
#top-left-widgets {
  position: fixed;
  top: 30px;
  left: 30px;
  z-index: 500;
  transition: 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  transform: scale(var(--widget-scale));
  transform-origin: top left;
}
#top-right-widgets {
  position: fixed;
  top: 30px;
  right: 30px;
  z-index: 2000;
  display: flex;
  flex-direction: row;
  gap: 20px;
  align-items: flex-start;
  transition: 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  transform: scale(var(--widget-scale));
  transform-origin: top right;
}
#stock-container {
  position: fixed;
  top: 30px;
  left: 85px;
  z-index: 500;
  display: flex;
  flex-direction: row;
  gap: 10px;
  transform: scale(var(--widget-scale));
  transform-origin: top left;
  transition: left 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}
#stock-container.file-hidden {
  left: 30px;
}
.stock-item {
  cursor: pointer;
  min-width: 100px;
}
.stock-up {
  color: #ef4444 !important;
}
.stock-down {
  color: #3b82f6 !important;
}
.stock-detail {
  min-width: 300px;
  padding: 20px;
}
.stock-detail-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
}
.stock-detail-title {
  font-size: 1.1rem;
  font-weight: 700;
}
.stock-refresh-btn {
  cursor: pointer;
  opacity: 0.6;
  transition: 0.2s;
}
.stock-refresh-btn:hover {
  opacity: 1;
  transform: rotate(180deg);
}
.stock-chart {
  width: 100%;
  margin-bottom: 15px;
  border-radius: 8px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.05);
}
.stock-chart img {
  width: 100%;
  display: block;
}
.stock-info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.stock-info-grid .info-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.stock-info-grid .info-item .label {
  font-size: 0.75rem;
  color: #94a3b8;
}
.stock-info-grid .info-item .value {
  font-size: 0.9rem;
  font-weight: 600;
}
.stock-code {
  font-size: 0.7rem;
  opacity: 0.5;
  margin-left: 5px;
}
.weather-item {
  position: relative;
  text-align: center;
  min-width: 120px;
  cursor: pointer;
  transition: 0.3s;
  background: transparent;
  padding: 10px;
  border-radius: 14px;
  border: 1px solid transparent;
}
.weather-item:hover {
  background: rgba(0, 0, 0, 0.4);
  border-color: var(--accent-color);
}
.weather-loc {
  font-size: 0.8rem;
  opacity: 0.9;
  margin-bottom: 4px;
  text-shadow: 1px 2px 4px rgba(0, 0, 0, 0.8);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 150px;
}
.weather-main {
  font-family: "JetBrains Mono", monospace;
  font-size: 1.5rem;
  color: var(--accent-color);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 700;
  line-height: 1;
  text-shadow: 1px 2px 5px rgba(0, 0, 0, 0.9);
}
.weather-hl {
  font-size: 0.8rem;
  opacity: 0.9;
  margin-top: 6px;
  text-shadow: 1px 2px 4px rgba(0, 0, 0, 0.8);
}
.forecast-window {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(-10px);
  position: absolute;
  top: 100%;
  right: 0;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: 18px;
  padding: 15px;
  width: 250px;
  z-index: 2400;
  margin-top: 10px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.forecast-window.active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0);
}
.forecast-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
.forecast-item:last-child {
  border-bottom: none;
}
.forecast-day {
  font-size: 0.85rem;
  width: 40px;
}
.forecast-icon {
  font-size: 1rem;
  color: var(--accent-color);
  width: 30px;
  text-align: center;
}
.forecast-temp {
  font-family: "JetBrains Mono";
  font-size: 0.85rem;
  width: 90px;
  text-align: right;
}
.city-search-container {
  position: relative;
  margin-bottom: 20px;
}
.city-result-item {
  padding: 10px;
  cursor: pointer;
  font-size: 0.85rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  color: #fff;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.city-result-item:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--accent-color);
}
.location-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 15px;
  min-height: 40px;
  position: relative; 
}
.weather-custom-select {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  padding: 10px 15px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  font-size: 0.85rem;
  transition: all 0.2s;
  color: #fff;
}
.weather-custom-select.disabled {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
  background: rgba(255, 255, 255, 0.02) !important;
}
.setting-row .weather-custom-select {
  padding: 6px 8px;
  border-radius: 8px;
  background: #0f172a;
  justify-content: center;
  gap: 4px;
}
.setting-row .weather-custom-select span {
  flex: none;
}
.weather-custom-select:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--accent-color);
}
.location-list {
  max-height: 200px;
  overflow-y: auto;
  z-index: 1001;
}
.location-tag {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #0f172a;
  padding: 0 12px;
  border-radius: 8px;
  font-size: 0.85rem;
  border: 1px solid #334155;
  height: 38px;
  flex-shrink: 0;
  box-sizing: border-box;
}
.location-tag i {
  cursor: pointer;
  color: #ef4444;
}
#quote-section {
  text-align: center;
  margin-bottom: 50px;
  max-width: 1200px;
  width: calc(100% - 60px);
  display: flex;
  justify-content: center;
  transform-origin: center;
  transform: scale(var(--widget-scale));
  animation: widgetFadeIn 0.6s ease-out;
}
.quote-container {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 15px;
  max-width: 100%;
  transition: all 0.4s ease;
  padding: 15px 40px;
  border-radius: 20px;
  cursor: pointer;
}
.quote-switching {
  opacity: 0;
  transform: translateY(10px);
}
#quote-text {
  font-family: "Noto Serif KR", serif;
  font-size: var(--quote-font-size);
  font-weight: 700;
  line-height: 1.4;
  color: #fff;
  text-shadow: var(--quote-shadow);
  word-break: keep-all;
  text-align: center;
}
#quote-author-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  opacity: 0.8;
  align-self: flex-end;
}
#quote-author {
  color: #fff;
  letter-spacing: 2px;
  font-weight: 600;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.9);
}
#shortcut-container {
  display: grid;
  gap: 15px;
  width: calc(100% - 100px);
  max-width: 915px;
  margin: 0 auto;
  transform: scale(var(--widget-scale));
  transform-origin: center top;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  z-index: 10;
  padding: 0 50px;
}
@media (max-width: 1100px) {
  #shortcut-container {
    width: calc(100% - 300px);
    padding: 0 150px;
  }
}
@media (max-width: 800px) {
  #shortcut-container {
    width: calc(100% - 60px);
    padding: 0 30px;
  }
}
.grid-layout,
.shortcut-list-view {
  grid-template-columns: repeat(auto-fit, 140px);
  justify-content: center;
  display: grid;
  max-width: 930px;
  margin: 0 auto;
}
.shortcut-list-view .shortcut-item {
  flex-direction: row !important;
  padding: 8px 12px !important;
  border-radius: 12px !important;
  gap: 12px !important;
  text-align: left !important;
  width: 140px !important;
  min-width: 140px !important;
  height: 40px !important;
  justify-content: flex-start !important;
  background: rgba(0, 0, 0, 0.45) !important;
}
.shortcut-list-view .shortcut-item .shortcut-icon-wrapper,
.shortcut-list-view .shortcut-item img,
.shortcut-list-view .shortcut-item .shortcut-default-icon {
  width: 16px !important;
  height: 16px !important;
  margin-bottom: 0 !important;
  font-size: 0.75rem !important;
  border-radius: 4px !important;
}
.shortcut-list-view .shortcut-item span {
  font-size: 0.75rem !important;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.shortcut-item {
  background: rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(15px);
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  padding: 16px 10px;
  font-size: 0.9rem;
  text-align: center;
  text-decoration: none;
  color: #fff;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  cursor: pointer;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  box-sizing: border-box;
  height: 84px;
}
.shortcut-item:hover {
  border-color: var(--accent-color) !important;
  background: rgba(255, 255, 255, 0.15) !important;
  box-shadow: 0 0 12px var(--accent-color);
  transform: translateY(-2px);
}
.shortcut-item:active {
  transform: scale(0.95);
}
.shortcut-item span {
  width: 100%;
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 0 5px;
  box-sizing: border-box;
  margin-top: auto;
  margin-bottom: auto;
}
.shortcut-icon-wrapper {
  width: 24px;
  height: 24px;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}
.shortcut-item img {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  pointer-events: none;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
.shortcut-default-icon {
  width: 24px;
  height: 24px;
  color: var(--accent-color);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  background: transparent;
  transition: all 0.3s ease;
}
.shortcut-item:hover .shortcut-default-icon {
  transform: translateY(-2px);
}
#shortcut-container.sorting-active .shortcut-item {
  /* Clear default transitions to let Sortable.js handle transform animations via inline styles */
  transition: none; 
  box-shadow: none !important;
}
#shortcut-container.sorting-active .shortcut-item:hover {
  border-color: var(--glass-border) !important;
  box-shadow: none !important;
  transform: none !important;
}
.sortable-chosen {
  border-color: var(--accent-color) !important;
  background: rgba(255, 255, 255, 0.1) !important;
  box-shadow: none !important; 
  transform: none !important; 
  transition: none !important; /* Chosen item follows mouse instantly without lag */
  opacity: 1 !important;
  z-index: 100;
}
.shortcut-ghost {
  opacity: 0.2 !important;
  border-color: var(--glass-border) !important;
  box-shadow: none !important;
}
#clock-container,
.calendar-widget {
  cursor: pointer;
  border: 1px solid var(--glass-border);
}
#clock-container:hover,
#calendar-container:hover {
  border-color: var(--accent-color);
}
.bottom-widgets {
  position: fixed;
  bottom: 30px;
  left: 0;
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  padding: 0 30px;
  box-sizing: border-box;
  pointer-events: none;
  z-index: 1000;
}
.left-area {
  align-items: flex-start;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none; 
  position: relative;
  z-index: 100;
  transition: 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  transform: scale(var(--widget-scale)) translateZ(0);
  transform-origin: bottom left;
  width: max-content;
}
.left-area > * {
  pointer-events: auto; 
}
.right-area {
  align-items: flex-end;
  display: flex;
  flex-direction: column-reverse;
  pointer-events: none; 
  position: relative;
  z-index: 100;
  transition: 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  transform: scale(var(--widget-scale)) translateZ(0);
  transform-origin: bottom right;
  width: max-content;
}
.right-area > * {
  pointer-events: auto; 
}
.setting-label-text {
  font-size: 0.75rem;
  color: #94a3b8;
  line-height: 1.2;
  display: inline-block;
  margin-top: 1px;
  white-space: nowrap;
}
.compact-checkbox-label {
  display: flex;
  align-items: center;
  gap: 2px;
  font-weight: normal;
  cursor: pointer;
  color: #94a3b8;
}
#clock-container {
  margin-bottom: 0;
}
#calendar-container,
#noti-folder {
  margin-bottom: 15px;
}
.widget-sidebar {
  position: fixed;
  right: -60px;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(15px);
  border: 1px solid var(--glass-border);
  border-right: none;
  border-radius: 20px 0 0 20px;
  padding: 15px 10px;
  display: flex;
  flex-direction: column;
  gap: 15px;
  z-index: 2500;
  transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
.sidebar-trigger {
  position: fixed;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 80px;
  z-index: 2499;
  cursor: pointer;
}
.sidebar-hint {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  color: #fff;
  opacity: 0.3;
  font-size: 1.4rem;
  font-weight: 700;
  font-family: "JetBrains Mono", monospace;
  pointer-events: none;
  animation: hintArrow 2.5s infinite;
  transition: 0.3s;
  text-shadow: 0 0 8px rgba(0, 0, 0, 0.8);
}
.sidebar-trigger:hover .sidebar-hint {
  opacity: 0 !important;
}
body:has(.widget-sidebar:hover) .sidebar-hint {
  opacity: 0 !important;
}
@keyframes hintArrow {
  0%,
  100% {
    transform: translateY(-50%) translateX(0);
    opacity: 0.3;
  }
  50% {
    transform: translateY(-50%) translateX(-12px);
    opacity: 0.8;
  }
}
.sidebar-trigger:hover + .widget-sidebar,
.widget-sidebar:hover {
  right: 0;
}
.sidebar-icon {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #fff;
  opacity: 0.4;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  font-size: 1.2rem;
  transform: scale(1);
  border-radius: 12px;
  border: 1px solid transparent;
}
.sidebar-icon:hover {
  opacity: 0.8;
  color: #fff;
  transform: scale(1.15);
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.3);
}
.sidebar-icon.active {
  opacity: 1;
  color: var(--accent-color);
}
.sidebar-icon.active:hover {
  color: var(--accent-color);
  border-color: var(--accent-color);
  box-shadow: 0 0 12px rgba(var(--accent-color-rgb, 56, 189, 248), 0.3);
}
#calendar-container,
#clock-container,
#noti-folder,
#top-right-widgets,
#memo-folder,
#quote-section,
#search-section,
#shortcut-container {
  transition:
    visibility 0.5s cubic-bezier(0.4, 0, 0.2, 1),
    height 0.5s cubic-bezier(0.4, 0, 0.2, 1),
    transform 0.5s cubic-bezier(0.4, 0, 0.2, 1),
    opacity 0.5s cubic-bezier(0.4, 0, 0.2, 1),
    margin 0.5s cubic-bezier(0.4, 0, 0.2, 1),
    max-height 0.5s cubic-bezier(0.4, 0, 0.2, 1),
    padding 0.5s cubic-bezier(0.4, 0, 0.2, 1),
    filter 0.5s cubic-bezier(0.4, 0, 0.2, 1),
    border-color 0.3s cubic-bezier(0.4, 0, 0.2, 1),
    background 0.3s cubic-bezier(0.4, 0, 0.2, 1),
    box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  transform-origin: center;
  max-height: 1000px; 
}
@keyframes widgetFadeIn {
  from {
    opacity: 0;
    transform: translateY(-20px) scale(1);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(var(--widget-scale));
  }
}
#top-right-widgets {
  transform-origin: right top;
}
#calendar-container,
#clock-container,
#noti-folder {
  transform-origin: right bottom;
}
#memo-folder {
  transform-origin: left bottom;
}
.widget-hidden {
  opacity: 0 !important;
  visibility: hidden !important;
  transform: scale(0.9) translateY(20px) !important;
  pointer-events: none !important;
  max-height: 0 !important;
  min-height: 0 !important;
  margin-top: 0 !important;
  margin-bottom: 0 !important;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
  overflow: hidden !important;
  border-width: 0 !important;
  backface-visibility: hidden;
}
#top-right-widgets.widget-hidden {
  transform: scale(0.9) translateY(-20px) !important;
}
#calendar-container.widget-hidden,
#clock-container.widget-hidden,
#noti-folder.widget-hidden {
  transform: scale(0.8) translateY(60px) !important;
  filter: blur(15px);
  opacity: 0 !important;
}
#memo-folder.widget-hidden {
  transform: scale(0.9) translateX(-20px) !important;
}
#quote-section.widget-hidden,
#search-section.widget-hidden,
#shortcut-container.widget-hidden {
  transform: scale(0.9) translateY(20px) !important;
}
.smart-folder {
  display: none;
  position: relative;
}
.smart-folder.has-items {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.folder-icon {
  display: none !important;
  position: relative;
}
.folder-content {
  width: 170px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.item-card {
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  border-radius: 14px;
  padding: 12px 15px;
  width: 100%;
  box-sizing: border-box;
  position: relative;
  animation: slideIn 0.3s ease;
  box-shadow: var(--btn-shadow);
  cursor: pointer;
  transition: 0.2s;
  display: flex;
  flex-direction: column;
  transform: translateZ(0);
}
.item-card:hover {
  border-color: var(--accent-color);
}
.item-card .title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent-color);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding-right: 15px;
}
.noti-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 4px;
  font-size: 0.65rem !important;
  font-weight: 300 !important;
  font-family: "JetBrains Mono";
}
.noti-info .remaining {
  font-weight: 300 !important;
}
#clock-container {
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(10px);
  border: 1px solid var(--glass-border);
  padding: 12px 20px;
  border-radius: 18px;
  text-align: center;
  box-shadow: var(--btn-shadow);
  display: flex;
  flex-direction: column;
  width: 210px;
  align-self: flex-end;
  overflow: hidden;
  box-sizing: border-box;
}
#clock-time {
  font-family: "JetBrains Mono", monospace;
  font-size: 1.6rem;
  color: var(--accent-color);
  line-height: 1;
  transition: opacity 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  white-space: nowrap;
  overflow: hidden;
  height: 1.2em;
}
#clock-time.animating {
  animation: clockFade 0.6s ease-in-out;
}
@keyframes clockFade {
  0% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0;
    transform: scale(0.95);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}
.clock-digit-group {
  height: 1.2em;
  line-height: 1.2em;
  overflow: hidden;
  position: relative;
  display: flex;
  flex-direction: column;
  align-self: center; 
}
.clock-digit-strip {
  display: flex;
  flex-direction: column;
  transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  text-align: center;
}
.clock-digit {
  height: 1.2em;
  display: flex;
  align-items: center;
  justify-content: center;
}
.clock-separator {
  opacity: 0.7;
  margin: 0 1px;
  align-self: center; 
}
.clock-ampm {
  font-size: 0.65rem;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 4px;
  display: inline-block;
  vertical-align: middle;
  letter-spacing: 0.5px;
}
.clock-ampm.am {
  background: rgba(255, 255, 255, 0.8);
  color: #000;
  border: 1px solid rgba(0, 0, 0, 0.1);
}
.clock-ampm.pm {
  background: rgba(0, 0, 0, 0.4);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.1);
}
#clock-ampm-container {
  display: flex;
  align-items: center;
  height: 100%;
  margin-left: 6px;
  line-height: 1;
  text-transform: uppercase;
}
.clock-switching {
  opacity: 0;
  transform: scale(0.85);
}
.calendar-widget {
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(10px);
  border: 1px solid var(--glass-border);
  padding: 15px;
  border-radius: 18px;
  box-shadow: var(--btn-shadow);
  width: 200px;
  color: #fff;
  font-size: 0.8rem;
  overflow: hidden;
  position: relative;
  min-height: auto;
  display: flex;
  flex-direction: column;
}
.calendar-header {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 12px;
  font-weight: 700;
  color: #fff;
  font-family: "JetBrains Mono";
  position: relative;
  z-index: 10;
  height: 24px;
}
.calendar-header-center {
  display: flex;
  align-items: center;
  position: relative; 
}
#cal-month-year {
  font-size: 0.9rem;
  white-space: nowrap;
}
.today-icon {
  position: absolute;
  left: calc(100% + 8px); 
  font-size: 0.75rem;
  opacity: 0.5;
  cursor: pointer;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  color: #fff;
}
.today-icon:hover {
  opacity: 1;
  color: var(--accent-color);
  transform: scale(1.2) rotate(-360deg); 
  filter: drop-shadow(0 0 5px var(--accent-color));
}
.cal-nav {
  position: absolute;
  cursor: pointer;
  padding: 5px;
  opacity: 0.5;
  transition: 0.2s;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.1rem; 
}
.cal-nav:hover {
  opacity: 1;
  color: var(--accent-color);
  transform: translateY(-50%) scale(1.2);
}
.fa-caret-left {
  left: 0;
}
.fa-caret-right {
  right: 0;
}
#cal-month-year {
  cursor: pointer;
  transition: 0.2s;
}
#cal-month-year:hover {
  color: var(--accent-color);
  transform: scale(1.05);
}
.calendar-body-container {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.calendar-days-header {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
  text-align: center;
  font-weight: 700;
  margin-bottom: 5px;
  opacity: 0.7;
}
.calendar-grid-wrapper {
  position: relative;
  flex: 1;
  overflow: hidden;
}
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
  text-align: center;
  transition: opacity 0.3s;
}
.calendar-grid.slide-left {
  animation: slideLeft 0.4s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}
.calendar-grid.slide-right {
  animation: slideRight 0.4s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}
.calendar-grid.pop-in {
  animation: popIn 0.4s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}
@keyframes slideLeft {
  0% { transform: translateX(30px); opacity: 0; }
  100% { transform: translateX(0); opacity: 1; }
}
@keyframes slideRight {
  0% { transform: translateX(-30px); opacity: 0; }
  100% { transform: translateX(0); opacity: 1; }
}
@keyframes popIn {
  0% { transform: scale(0.95); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}
.calendar-day {
  padding: 4px 0;
  border-radius: 8px;
  transition: background 0.2s;
  cursor: pointer;
}
.calendar-day:hover {
  background: var(--accent-color);
  color: var(--accent-contrast) !important;
}
.calendar-day.today {
  background: var(--accent-color);
  color: var(--accent-contrast) !important;
  font-weight: 700;
  border-radius: 8px;
}
.calendar-day.other-month {
  opacity: 0.3;
}
.month-selector {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(15px);
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 10px;
  box-sizing: border-box;
  z-index: 20;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  transform: scale(0.9);
}
.month-selector.active {
  opacity: 1;
  visibility: visible;
  transform: scale(1);
}
.month-selector-year-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 5px 10px;
  color: #fff;
  font-weight: 700;
  font-family: "JetBrains Mono";
}
.month-selector-year-header i {
  cursor: pointer;
  opacity: 0.5;
  transition: 0.2s;
  padding: 5px;
}
.month-selector-year-header i:hover:not(.cursor-not-allowed) {
  opacity: 1;
  color: var(--accent-color);
}
.month-selector-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(4, 1fr);
  gap: 5px;
  flex: 1;
}
.month-item {
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  transition: 0.2s;
  font-size: 0.75rem;
}
.month-item:hover {
  background: var(--accent-color);
  color: var(--accent-contrast) !important;
}
.month-item.current {
  color: var(--accent-color);
  border: 1px solid var(--accent-color);
}
.month-item.current:hover {
  color: var(--accent-contrast) !important;
}
.sun {
  color: #ff5f5f !important;
}
.sat {
  color: #60a5fa !important;
}
.calendar-day:hover.sun,
.calendar-day:hover.sat,
.month-item:hover.sun,
.month-item:hover.sat {
  color: var(--accent-contrast) !important;
}
.setting-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 15px;
  width: 100%;
}
.setting-column {
  display: flex;
  flex-direction: column;
  gap: 5px;
  flex: 1;
  min-width: 0;
}
.setting-group-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 15px;
  font-size: 0.85rem;
  color: #94a3b8;
  margin-top: 5px;
  margin-bottom: 10px;
  font-weight: 600;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding-bottom: 5px;
}
.setting-group-title > span:first-child {
  flex-shrink: 0;
}
.setting-column .setting-group-title:first-child {
  margin-top: 0;
}
.setting-inline-field {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #0f172a;
  padding: 6px 12px;
  border-radius: 10px;
  border: 1px solid #334155;
  height: 38px;
  box-sizing: border-box;
}
.field-quote-size {
  flex: 1;
}
.field-weather-toggle {
  flex: 1;
  justify-content: center;
}
.setting-inline-field .setting-label {
  font-size: 0.75rem;
  color: #94a3b8;
  white-space: nowrap;
}
.compact-select {
  background: transparent;
  color: #fff;
  border: none;
  font-size: 0.85rem;
  cursor: pointer;
  outline: none;
  padding: 0;
  flex: 1;
  text-align: center;
  text-align-last: center;
  -webkit-appearance: none;
}
.compact-checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 0.85rem;
  color: #fff;
  white-space: nowrap;
  text-align: right;
  word-break: keep-all;
  min-width: 0;
}
@keyframes slideDown {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}
.icon-picker-open {
  animation: slideDown 0.3s ease-out forwards;
}
.compact-checkbox-label input[type="checkbox"] {
  width: 16px !important;
  height: 16px !important;
  margin: 0 !important;
  padding: 0 !important;
  cursor: pointer;
  appearance: checkbox;
  -webkit-appearance: checkbox;
  flex-shrink: 0;
}
.compact-checkbox-label span {
  line-height: 1.2;
  display: inline-block;
  margin-top: 1px;
}
.cursor-not-allowed {
  cursor: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'%3E%3C/circle%3E%3Cline x1='4.93' y1='4.93' x2='19.07' y2='19.07'%3E%3C/line%3E%3C/svg%3E") 12 12, not-allowed !important;
}

.cal-nav.cursor-not-allowed:hover {
  background: transparent !important;
  color: inherit !important;
  opacity: 0.1 !important;
  transform: translateY(-50%) !important;
}

.month-item.cursor-not-allowed:hover,
.calendar-day.cursor-not-allowed:hover {
  background: transparent !important;
  color: inherit !important;
  opacity: 0.15 !important;
  transform: none !important;
}

.modal {
  visibility: hidden;
  opacity: 0;
  position: fixed;
  z-index: 3000;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(10px);
  pointer-events: none;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.modal.show {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
}
#alertModal,
#deleteConfirmModal,
#resetConfirmModal,
#aiTagModal {
  z-index: 10000 !important;
}
.modal-content {
  background: #1e293b;
  padding: 25px;
  border-radius: 30px;
  width: 400px;
  max-width: 95vw;
  max-height: 90vh;
  overflow-y: auto;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -40%) scale(0.9);
  border: 1px solid var(--glass-border);
  box-sizing: border-box;
  pointer-events: auto;
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.modal.show .modal-content {
  transform: translate(-50%, -50%) scale(1);
  opacity: 1;
}
#settingModal .modal-content {
  width: 585px;
  height: auto;
  min-height: 500px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
}
@media (max-height: 700px) {
  .modal-content {
    padding: 20px 25px;
  }
  .modal-content h3 {
    margin-bottom: 15px;
  }
  #settingModal .modal-content {
    min-height: auto;
  }
}
#settingModal .modal-content i:hover {
  color: #fff !important;
}
.setting-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: 30px;
  row-gap: 15px;
  margin-bottom: 5px;
  min-height: 0;
}
.modal-content.delete-modal {
  width: 320px;
  padding: 30px;
  text-align: center;
}
.delete-icon {
  font-size: 3rem;
  color: #ef4444;
  margin-bottom: 20px;
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0% {
    transform: scale(1);
    opacity: 0.8;
  }
  50% {
    transform: scale(1.1);
    opacity: 1;
  }
  100% {
    transform: scale(1);
    opacity: 0.8;
  }
}
#search-section {
  width: calc(100% - 60px);
  max-width: 600px;
  margin: 0 auto 60px auto;
  position: relative;
  z-index: 5;
  transform-origin: center top;
  transform: scale(var(--widget-scale));
  animation: widgetFadeIn 0.6s ease-out;
}
.search-box {
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(15px);
  border: 1px solid var(--glass-border);
  border-radius: 30px;
  padding: 5px 20px;
  display: flex;
  align-items: center;
  gap: 15px;
  transition: 0.3s;
  box-shadow: var(--btn-shadow);
}
.search-box:focus-within {
  border-color: var(--accent-color);
  background: rgba(0, 0, 0, 0.6);
  transform: scale(1.02);
}
.search-box i {
  color: #94a3b8;
  font-size: 1.1rem;
}
#searchInput {
  flex: 1;
  background: transparent;
  border: none;
  color: #fff;
  padding: 12px 0;
  font-size: 1.1rem;
  outline: none;
}
#searchInput::placeholder {
  color: rgba(255, 255, 255, 0.4);
}
.search-engine-icon {
  width: auto;
  padding: 0 5px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  flex-shrink: 0;
  cursor: pointer;
  position: relative;
  z-index: 10;
  gap: 2px;
}
#search-engine-current {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.2);
  transition: 0.3s;
}
.search-engine-icon:hover #search-engine-current {
  background: rgba(255, 255, 255, 0.2);
  transform: scale(1.1);
  border-color: var(--accent-color);
}
#search-engine-current img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
#search-engine-current i {
  font-size: 0.8rem;
  color: #94a3b8;
}
.search-engine-menu {
  position: absolute;
  top: calc(100% + 15px);
  right: -20px;
  transform: scale(0.9);
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(15px);
  border: 1px solid var(--glass-border);
  border-radius: 15px;
  padding: 8px;
  display: flex;
  flex-direction: row;
  gap: 8px;
  opacity: 0;
  visibility: hidden;
  transform-origin: right top;
  transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 2000;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
}
.search-engine-menu.active {
  opacity: 1;
  visibility: visible;
  transform: scale(1);
}
.engine-option {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  overflow: hidden;
  cursor: pointer;
  transition: 0.2s;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.05);
  flex-shrink: 0;
}
.engine-option:hover {
  transform: scale(1.1);
  border-color: var(--accent-color);
  background: rgba(255, 255, 255, 0.1);
}
.engine-option img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.modal-content h3 {
  text-align: center;
  margin-top: 0;
  margin-bottom: 25px;
  font-size: 1.2rem;
  color: var(--accent-color);
}
.modal-content input,
.modal-content textarea,
.modal-content select,
.time-select {
  width: 100%;
  padding: 12px;
  margin-bottom: 15px;
  border-radius: 10px;
  border: 1px solid #334155;
  background: #0f172a;
  color: #fff;
  box-sizing: border-box;
  font-family: inherit;
  outline: none;
  transition: all 0.2s;
}
.modal-content input:focus,
.modal-content textarea:focus,
.modal-content select:focus,
.time-select:focus {
  border-color: var(--accent-color);
  box-shadow: 0 0 0 2px rgba(var(--accent-color-rgb, 56, 189, 248), 0.2);
}
.modal-content select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2394a3b8'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 16px;
  padding-right: 40px;
}
.toggle-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 20px;
}
.toggle-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.9rem;
  color: #f1f5f9;
}
.toggle-item input {
  width: auto;
  margin-bottom: 0;
  cursor: pointer;
}
.time-picker-row {
  display: flex;
  gap: 10px;
  margin-bottom: 15px;
}
.custom-time-picker {
  position: relative;
  flex: 1;
}
.time-select {
  margin-bottom: 0;
  cursor: pointer;
  text-align: center;
  font-family: "JetBrains Mono";
  font-size: 0.85rem;
  padding: 12px;
  background: #0f172a;
  border: 1px solid #334155;
  border-radius: 10px;
  color: #fff;
  transition: 0.2s;
}
.time-select:hover {
  border-color: var(--accent-color);
  background: rgba(255, 255, 255, 0.05);
}
.time-popup {
  position: absolute;
  bottom: 100%;
  left: 0;
  width: 100%;
  background: #0f172a;
  border: 1px solid #334155;
  border-radius: 12px;
  margin-bottom: 5px;
  display: none;
  z-index: 1000;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
  overflow: hidden;
}
.time-popup.show {
  display: block;
}
.time-list {
  max-height: 160px;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 5px 0;
  scroll-behavior: smooth;
}
.time-item {
  padding: 10px;
  text-align: center;
  color: #94a3b8;
  cursor: pointer;
  border-radius: 6px;
  font-family: "JetBrains Mono";
  transition: 0.2s;
  font-size: 0.85rem;
}
.time-item:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
}
.time-item.selected {
  background: var(--accent-color);
  color: var(--accent-contrast);
  font-weight: bold;
  transform: scale(1.1);
}
@keyframes iconSubtleFadeIn {
  from {
    opacity: 0;
    transform: translateY(4px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}
.year-slide-left {
  animation: slideLeft 0.3s ease-out;
}
.year-slide-right {
  animation: slideRight 0.3s ease-out;
}
.repeat-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 15px;
  font-size: 0.9rem;
  white-space: nowrap;
}
.day-selector {
  display: flex;
  justify-content: space-between;
  margin-bottom: 20px;
}
.day-check input {
  display: none;
}
.day-check span {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #0f172a;
  border-radius: 8px;
  font-size: 0.75rem;
  border: 1px solid #334155;
  cursor: pointer;
}
.day-check input:checked + span {
  background: var(--accent-color);
  color: var(--accent-contrast);
  font-weight: 700;
}
.btn-save {
  padding: 10px 25px;
  border: none;
  border-radius: 10px;
  background: var(--accent-color);
  color: var(--accent-contrast);
  font-weight: 700;
  cursor: pointer;
  transition: 0.2s;
  font-size: 0.9rem;
}
.btn-save:hover {
  opacity: 0.9;
}
.btn-save.loading {
  opacity: 0.7;
  pointer-events: none;
}
.btn-save.loading i {
  animation: fa-spin 1s infinite linear;
}
.setting-footer {
  display: flex;
  justify-content: flex-end;
  padding-top: 15px;
  border-top: 1px solid var(--glass-border);
  background: inherit;
  flex-shrink: 0;
}
.theme-colors {
  display: grid;
  grid-template-columns: repeat(4, 35px);
  gap: 15px;
  justify-content: center;
  margin-bottom: 10px;
}
.color-swatch {
  width: 35px;
  height: 35px;
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid transparent;
  transition: 0.2s;
  box-shadow: var(--btn-shadow);
}
.color-swatch:hover {
  transform: scale(1.15);
}
.color-swatch.active {
  border: 2px solid #fff;
  transform: scale(1.15);
  box-shadow: 0 0 15px var(--accent-color);
  position: relative;
}
.color-swatch.active::after {
  content: '\f00c';
  font-family: 'Font Awesome 5 Free';
  font-weight: 900;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: #fff;
  font-size: 0.8rem;
  text-shadow: 0 0 3px rgba(0,0,0,0.5);
}
.color-swatch.active[style*="background: #fff"]::after,
.color-swatch.active[style*="background:#fff"]::after,
.color-swatch.active[style*="background: rgb(255, 255, 255)"]::after {
  color: #000;
  text-shadow: none;
}
.color-swatch.active[style*="background: #fff"],
.color-swatch.active[style*="background:#fff"],
.color-swatch.active[style*="background: rgb(255, 255, 255)"] {
  border-color: #cbd5e1;
}
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.ai-check-tooltip {
  position: absolute;
  bottom: calc(100% + 10px);
  right: 0;
  transform: translateY(10px);
  background: var(--tip-bg, #1e293b);
  color: #fff;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 0.75rem;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: 0.2s;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  z-index: 1200;
  border: 1px solid rgba(255, 255, 255, 0.1);
}
.ai-check-tooltip.show {
  opacity: 1;
  transform: translateY(0);
}
.ai-check-tooltip::after {
  content: '';
  position: absolute;
  top: 100%;
  right: 11px;
  border-width: 5px;
  border-style: solid;
  border-color: var(--tip-bg, #1e293b) transparent transparent transparent;
}
.ai-search-icon {
  transition: color 0.3s ease;
}
.ai-search-icon.error {
  color: #ef4444 !important;
}
.engine-popup {
  position: absolute;
  background: #1e293b;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  z-index: 1000;
  display: none;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
  padding: 8px;
  box-sizing: border-box;
  width: 100%;
  max-height: 280px;
  overflow-y: auto;
}
.engine-popup.show {
  display: flex !important;
  flex-direction: column;
  animation: fadeIn 0.2s ease;
}
#search-engine-popup,
#ai-provider-popup,
#ai-model-select-popup,
#ai-custom-add-container {
  bottom: 45px;
  left: 0;
}
#ai-provider-popup,
#ai-model-select-popup,
#ai-custom-add-container {
  min-width: 280px;
  width: max-content;
  max-width: 450px;
  max-height: 280px;
}
#lang-popup {
  width: 100% !important;
  max-height: 220px;
  min-width: 0 !important;
  left: 0 !important;
  box-sizing: border-box !important;
  top: auto !important;
  bottom: 100% !important;
  margin-top: 0 !important;
  margin-bottom: 5px !important;
  overflow-y: auto;
}
#protocol-popup {
  width: 100% !important;
  max-height: 280px;
  min-width: 0 !important;
  left: 0 !important;
  box-sizing: border-box !important;
}
#lang-popup *,
#protocol-popup * {
  box-sizing: border-box;
}
#search-engine-popup {
  width: 100%;
}
.weather-popup,
.city-results {
  position: absolute;
  top: 100% !important;
  bottom: auto !important;
  left: 0 !important;
  width: 100%;
  background: #1e293b;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  margin-top: 5px;
  max-height: 250px;
  z-index: 1000;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
  box-sizing: border-box;
  padding: 6px;
  animation: slideDown 0.2s ease-out;
}
@keyframes slideDown {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}
#quote-size-popup,
#widget-size-popup {
  min-width: unset !important;
  width: 100%;
  left: 0 !important;
  transform: none !important;
}
#quote-size-popup .ai-model-item,
#widget-size-popup .ai-model-item,
#quote-size-popup .ai-model-item span,
#widget-size-popup .ai-model-item span {
  justify-content: center !important;
  text-align: center !important;
  flex: 1;
}
#search-engine-popup,
#ai-model-select-popup,
#citySearchResults,
.weather-popup {
  overflow-y: auto;
}
.popup-list-area {
  overflow-y: auto;
  flex: 1;
}
.engine-popup::-webkit-scrollbar-thumb:hover,
.ai-model-popup::-webkit-scrollbar-thumb:hover,
.popup-list-area::-webkit-scrollbar-thumb:hover,
.city-results::-webkit-scrollbar-thumb:hover,
.weather-popup::-webkit-scrollbar-thumb:hover,
.location-list::-webkit-scrollbar-thumb:hover,
.ai-chat-messages::-webkit-scrollbar-thumb:hover,
.ai-history-list::-webkit-scrollbar-thumb:hover,
.engine-name {
  flex: 1;
  font-size: 0.9rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}
.engine-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 8px 12px;
  cursor: pointer;
  transition: 0.2s;
}
.engine-item:hover {
  border-color: var(--accent-color) !important;
}
.engine-item:hover .engine-name {
  color: #fff !important;
}
.engine-item:hover .engine-active-icon {
  color: var(--accent-color) !important;
}
.engine-item.active {
  background: rgba(var(--accent-color-rgb, 56, 189, 248), 0.1);
  border-color: var(--accent-color) !important;
  color: var(--accent-color) !important;
}
.engine-item.active .engine-active-icon {
  color: var(--accent-color);
}
.engine-item.active .engine-name {
  color: var(--accent-color) !important;
}
.engine-favicon {
  width: 20px;
  height: 20px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.1);
  overflow: hidden;
  flex-shrink: 0;
}
.engine-favicon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.engine-name {
  flex: 1;
  font-size: 0.85rem;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}
.engine-status {
  width: 32px;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-shrink: 0;
}
.engine-actions {
  width: 40px;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  flex-shrink: 0;
}
.engine-info-tag {
  font-size: 0.65rem;
  padding: 2px 5px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.1);
  color: #94a3b8;
  white-space: nowrap;
}
.engine-active-icon {
  color: var(--accent-color);
  font-size: 0.85rem;
}
.engine-actions {
  width: 25px;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-shrink: 0;
  margin-left: 5px;
}
.engine-btn-del,
#settingModal .modal-content i.engine-btn-del {
  color: #ef4444 !important;
  opacity: 0.6;
  transition: all 0.2s;
  cursor: pointer;
}
.engine-btn-del:hover,
#settingModal .modal-content i.engine-btn-del:hover {
  opacity: 1 !important;
  transform: scale(1.1);
  color: #ef4444 !important;
}
.engine-add-container {
  display: flex;
  gap: 10px;
  align-items: center;
  width: 98%;
  margin-left: 1%;
}
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(5px);
  z-index: 2100;
  transition: opacity 0.5s ease;
}
.modal-overlay.widget-hidden {
  opacity: 0;
  pointer-events: none;
}
#ai-chatbot-container {
  width: 80vw;
  max-width: 1400px;
  height: 80vh;
  max-height: 1000px;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: 24px;
  margin: 0 auto;
  display: flex;
  overflow: visible; /* 1.1: Allow children (tag popup) to overflow container */
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 2200;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  visibility: visible;
  pointer-events: auto;
}
#ai-chatbot-container.widget-hidden {
  opacity: 0 !important;
  transform: translate(-50%, -40%) scale(0.8) !important;
  filter: blur(20px) brightness(0);
  visibility: hidden;
  pointer-events: none;
}
.ai-history-panel {
  width: 220px;
  border-right: 1px solid var(--glass-border);
  display: flex;
  flex-direction: column;
  background: rgba(0, 0, 0, 0.2);
  transition: width 0.3s ease;
  position: relative; /* Established stacking context */
  z-index: 100; /* Ensure it stays above main panel and messages */
  overflow: visible !important;
}
.ai-history-panel.collapsed {
  width: 100px;
  overflow: visible;
}
.ai-header-left {
  display: flex;
  align-items: center;
  position: relative;
  flex: 1;
  min-width: 0;
  height: 100%;
}
.history-title {
  position: absolute;
  left: 40px; 
  top: 50%;
  transform: translateY(-50%);
  cursor: pointer;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: calc(100% - 35px); /* Increased width to show 1-2 more characters */
  font-size: 0.85rem;
  opacity: 0.8;
  z-index: 1;
}
.history-title:hover {
  opacity: 1;
  color: var(--accent-color);
}
.ai-history-panel.collapsed .history-title {
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
}
.ai-history-panel.collapsed .ai-header-left {
  /* No gap change needed as title is absolute */
}
.ai-history-header {
  padding: 0 5px 0 25px;
  font-size: 0.9rem;
  font-weight: 700;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--glass-border);
  white-space: nowrap;
  height: 60px;
  box-sizing: border-box;
}
.ai-history-panel.collapsed .ai-history-header {
  padding: 0 5px 0 25px;
  position: relative;
}
.ai-history-panel.collapsed .ai-history-header #ai-history-toggle {
  right: 5px;
  opacity: 0.4;
}
.ai-history-panel.collapsed .ai-history-header #ai-history-toggle:hover {
  opacity: 1;
}
#ai-history-toggle {
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 0.9rem;
  opacity: 0.6;
  transition: 0.2s;
}
#ai-history-toggle:hover {
  opacity: 1;
  color: var(--accent-color);
}
.ai-model-popup {
  position: absolute;
  top: 100%;
  left: 0;
  margin-top: 5px;
  background: #1e293b;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 8px;
  z-index: 1000;
  min-width: 140px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
  display: none;
  max-height: 250px;
  overflow-y: auto;
}
.ai-model-popup.show {
  display: block;
  animation: fadeIn 0.2s ease;
}
#ai-btn-new-chat {
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.1);
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  font-size: 0.85rem;
  border: 1px solid var(--glass-border);
  cursor: pointer;
  transition: 0.2s;
}
#ai-btn-new-chat:hover {
  background: var(--accent-color);
  color: var(--accent-contrast);
  border-color: var(--accent-color);
}
.ai-history-header i {
  cursor: pointer;
  opacity: 0.6;
  transition: 0.2s;
}
.ai-history-header i:hover {
  opacity: 1;
  color: var(--accent-color);
}
.ai-model-item {
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 0.85rem;
  cursor: pointer;
  transition: 0.2s;
  color: #fff;
  white-space: nowrap;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  border: 1px solid transparent;
}
.ai-model-item span {
  flex: 1;
  text-align: left;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ai-model-item:hover {
  border-color: var(--accent-color) !important;
}
.ai-model-item.active {
  background: rgba(var(--accent-color-rgb, 56, 189, 248), 0.1);
  border: 1px solid var(--accent-color);
  color: var(--accent-color);
}
.ai-model-tip {
  font-size: 0.75rem;
  color: #94a3b8;
  padding: 10px;
  text-align: center;
  line-height: 1.4;
}
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-5px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.ai-history-list {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 10px;
}
.ai-history-footer {
  padding: 0 10px;
  height: 50px;
  border-top: 1px solid var(--glass-border);
  position: relative;
  background: rgba(0, 0, 0, 0.1);
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-sizing: border-box;
  overflow: visible !important;
}

.ai-history-search-container {
  display: flex;
  align-items: center;
  flex: 1;
  min-width: 0;
  position: relative;
}

.ai-history-search-icon {
  font-size: 0.9rem;
  opacity: 0.5;
  cursor: pointer;
  transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  z-index: 15;
}

.ai-history-search-icon:hover {
  opacity: 1;
}

.ai-history-panel.collapsed .ai-history-search-icon:hover {
  color: var(--accent-color);
}

#ai-history-search {
  flex: 1;
  background: transparent;
  border: none;
  color: #fff;
  font-size: 0.85rem;
  outline: none !important;
  padding: 0 5px;
  transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.3s ease;
  opacity: 1;
  width: 100%;
}
#ai-history-search:focus {
  outline: none !important;
}

/* Base collapsed state: hidden and transparent to fade out smoothly when panel collapses */
.ai-history-panel.collapsed #ai-history-search {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  width: 0;
  padding: 0;
  margin: 0;
  transition: none;
}

/* Floating Search for Collapsed Mode (Active States) */
.ai-history-panel.collapsed #ai-history-search.show,
.ai-history-panel.collapsed #ai-history-search.hide {
  position: absolute;
  left: 0;
  bottom: 100%;
  margin-bottom: 10px;
  width: 180px;
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(15px);
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  padding: 8px 15px;
  height: 36px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
  color: #fff !important;
  z-index: 100;
}
.ai-history-panel.collapsed #ai-history-search.show::placeholder,
.ai-history-panel.collapsed #ai-history-search.hide::placeholder {
  color: rgba(255, 255, 255, 0.3) !important;
}

.ai-history-panel.collapsed #ai-history-search.show {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  animation: floatingSearchShow 0.2s ease forwards;
}

.ai-history-panel.collapsed #ai-history-search.hide {
  pointer-events: none;
  animation: floatingSearchHide 0.2s ease forwards;
}

@keyframes floatingSearchShow {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes floatingSearchHide {
  from { opacity: 1; transform: translateY(0); }
  to { opacity: 0; transform: translateY(10px); }
}

.ai-history-tag-filter-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  flex-shrink: 0;
  position: relative;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.ai-history-panel.collapsed .ai-history-tag-filter-wrapper {
  /* No special transform needed here, just relative to footer center */
}

#ai-history-tag-btn {
  font-size: 0.9rem;
  opacity: 0.5;
  cursor: pointer;
  transition: 0.3s;
}

#ai-history-tag-btn:hover,
#ai-history-tag-btn.active {
  opacity: 1;
  color: var(--accent-color);
}

.ai-history-tag-popup {
  position: absolute;
  bottom: 100%;
  right: 0;
  margin-bottom: 15px;
  background: #1e293b;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 8px;
  z-index: 1000;
  min-width: 160px;
  max-width: 180px; /* Reduced from 200px to prevent overflowing the left edge of expanded panel */
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
  display: none;
  flex-direction: column;
  gap: 2px;
}

.ai-history-tag-popup.show {
  display: flex;
  animation: fadeIn 0.2s ease;
}

.ai-history-tag-popup.hide {
  display: flex !important;
  animation: popoverFadeOutDown 0.2s ease-in forwards;
}

@keyframes popoverFadeOutDown {
  from { opacity: 1; transform: translateY(0); }
  to { opacity: 0; transform: translateY(10px); }
}

.tag-filter-item {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 12px !important;
  padding: 8px 12px !important;
  border-radius: 8px;
  font-size: 0.85rem;
  color: #f1f5f9;
  cursor: pointer;
  transition: 0.2s;
  width: 100% !important;
  box-sizing: border-box !important;
  user-select: none;
  border: none !important;
}

.tag-filter-item:hover {
  background: rgba(255, 255, 255, 0.05);
}

.tag-filter-item.active {
  background: rgba(var(--accent-color-rgb, 56, 189, 248), 0.15) !important;
}

.tag-filter-item.all-tags {
  border-radius: 8px;
  font-weight: 600;
}

.ai-history-panel.collapsed .ai-history-tag-popup {
  left: 0 !important;
  right: auto !important;
}

.tag-filter-text {
  flex: 1 !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  text-align: left !important;
  line-height: 1.2 !important;
  display: block !important;
  margin: 0 !important;
  padding: 0 !important;
}
.ai-tag-chip {
  display: flex;
  align-items: center;
  gap: 4px;
  background: rgba(56, 189, 248, 0.05); /* Slightly lighter base */
  border: 1px solid var(--accent-color);
  color: var(--accent-color);
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 0.4s cubic-bezier(0.4, 0, 0.2, 1), color 0.3s ease, border-color 0.3s ease;
  position: relative;
  max-width: 150px; 
  overflow: hidden;
  opacity: 1 !important; /* Ensure the whole chip is instantly visible */
}

/* Base style when NOT active */
.ai-tag-chip:not(.active) {
  /* When re-rendered as non-active, it just shows the base background. 
     Transition will only fire if the element persists. 
     We rely on the base state here to avoid eyes hurting on first render. */
  background-color: rgba(56, 189, 248, 0.05);
}

.ai-tag-chip span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  pointer-events: none; /* Let the chip handle click */
  z-index: 1;
}

.ai-tag-chip.active {
  background-color: var(--accent-color);
  color: var(--accent-contrast, #fff);
}

/* Special animation for the "filling" effect ONLY when toggled */
.ai-tag-chip.filling {
  animation: tagFillBg 0.4s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}
.ai-tag-chip.emptying {
  animation: tagEmptyBg 0.4s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes tagFillBg {
  from { background-color: rgba(56, 189, 248, 0.05); color: var(--accent-color); }
  to { background-color: var(--accent-color); color: var(--accent-contrast, #fff); }
}
@keyframes tagEmptyBg {
  from { background-color: var(--accent-color); color: var(--accent-contrast, #fff); }
  to { background-color: rgba(56, 189, 248, 0.05); color: var(--accent-color); }
}
.ai-tag-chip .delete-tag {
  display: inline-block;
  font-size: 0.7rem;
  color: inherit;
  opacity: 0.5;
  flex-shrink: 0;
  padding: 2px;
  border-radius: 50%;
  transition: 0.2s;
}
.ai-tag-chip:hover .delete-tag {
  opacity: 1;
  background: rgba(0,0,0,0.1);
}

#ai-btn-new-chat {
  background: rgba(255, 255, 255, 0.1);
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  font-size: 0.85rem;
  border: 1px solid var(--glass-border);
  cursor: pointer;
  transition: 0.2s;
}
#ai-btn-new-chat:hover {
  background: var(--accent-color);
  color: var(--accent-contrast);
  border-color: var(--accent-color);
}
.ai-history-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  margin-bottom: 8px;
  border-radius: 8px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 0.85rem;
  color: #fff;
  position: relative;
  transform-origin: center;
  overflow: hidden;
  background: transparent;
}
.ai-history-item.other-model {
  color: #94a3b8 !important;
}
.ai-history-item.other-model:hover {
  /* color remains gray as set above */
}
.ai-history-item.chat-adding {
  transition: none !important;
  z-index: 10;
}
.ai-history-item.chat-new-item {
  max-height: 0;
  opacity: 0;
  margin-bottom: 0;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
  border-width: 0 !important;
  overflow: hidden;
  transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1),
              opacity 0.3s ease 0.1s,
              margin-bottom 0.4s cubic-bezier(0.4, 0, 0.2, 1),
              padding 0.4s cubic-bezier(0.4, 0, 0.2, 1),
              border-width 0.4s step-start;
}
.ai-history-item.chat-new-item.visible {
  max-height: 50px;
  opacity: 1;
  margin-bottom: 8px;
  padding-top: 8px !important;
  padding-bottom: 8px !important;
  border-width: 1px !important;
}
.ai-history-item.chat-exit {
  max-height: 0 !important;
  opacity: 0 !important;
  margin-bottom: 0 !important;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
  border-width: 0 !important;
  pointer-events: none;
  transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1),
              opacity 0.3s ease,
              margin-bottom 0.4s cubic-bezier(0.4, 0, 0.2, 1),
              padding 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
.ai-history-item.chat-moving {
  transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.5s ease;
}
.ai-history-item.chat-deleting {
  animation: chatPopOut 0.4s cubic-bezier(0.4, 0, 0.2, 1) forwards;
  pointer-events: none;
}
@keyframes chatPopOut {
  0% {
    opacity: 1;
    transform: scale(1);
    max-height: 50px;
  }
  20% {
    transform: scale(1.05);
  }
  100% {
    opacity: 0;
    transform: scale(0.5);
    max-height: 0;
    margin-bottom: 0;
    padding-top: 0;
    padding-bottom: 0;
  }
}
.ai-history-item:hover {
  border-color: var(--accent-color) !important;
  background: rgba(255, 255, 255, 0.08);
}
.ai-history-item.active {
  background: rgba(56, 189, 248, 0.1);
  border: 1px solid var(--accent-color);
  color: var(--accent-color);
}
.ai-history-item.active.other-model {
  color: #94a3b8 !important;
}
.ai-history-item span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}
.ai-history-panel.collapsed .ai-history-item {
  justify-content: flex-start;
  padding: 8px 12px;
}
.ai-history-panel.collapsed .ai-history-item span {
  display: block !important;
  font-size: 0.85rem !important;
  opacity: 0.9;
  text-align: left;
  width: 100%;
}
.ai-history-item i {
  opacity: 0;
  color: #ef4444;
  transition: opacity 0.2s, transform 0.2s;
  margin-left: 8px;
  pointer-events: none;
}
.ai-history-panel.collapsed .ai-history-item i {
  display: none;
}
.ai-history-item.active i {
  opacity: 0.8;
  pointer-events: auto;
}
.ai-history-item i:hover {
  opacity: 1 !important;
  transform: scale(1.1);
}
.ai-history-item i.fa-trash-alt:hover {
  color: #ef4444 !important;
}
.ai-history-item i.fa-lock:hover,
.ai-history-item i.fa-unlock:hover {
  color: #60a5fa !important;
}
.ai-history-item i.fa-lock,
.ai-history-item i.fa-unlock {
  color: #3b82f6;
}
.ai-main-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: transparent;
  min-width: 0;
}
.ai-chat-header {
  padding: 0 25px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--glass-border);
  height: 60px;
  box-sizing: border-box;
  gap: 12px; /* Reduced from 15px to match .ai-actions gap */
}
.ai-status {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1; /* Grows to take all available space */
  min-width: 0;
}
.ai-header-tags-wrapper {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 1 auto; /* Dynamic width based on content */
  min-width: 0;
  max-width: 50%; /* Max width 50% as requested */
  position: relative;
  justify-content: flex-end; /* Push content to the right within the wrapper */
}
.ai-chat-tags-container {
  display: flex;
  align-items: center;
  gap: 2px;
  overflow-x: auto;
  padding: 5px 0;
  scroll-behavior: smooth;
  min-width: 0;
  /* justify-content: flex-end here can hide content if overflowing in some browsers, 
     but wrapper's justify-content handles alignment when not overflowing. */
}
.tag-scroll-btn {
  cursor: pointer;
  color: var(--accent-color);
  opacity: 0.5;
  transition: 0.2s;
  font-size: 0.9rem;
  padding: 5px;
  display: none;
}
.tag-scroll-btn.disabled {
  opacity: 0.1 !important;
  pointer-events: none;
}
.tag-scroll-btn:hover {
  opacity: 1;
  transform: scale(1.2);
}
#ai-header-tag-add-btn {
  cursor: pointer;
  transition: all 0.2s;
  font-size: 1.2rem;
  color: var(--accent-color);
  opacity: 0.8;
  flex-shrink: 0;
  padding: 5px;
  margin-left: 2px;
}
#ai-header-tag-add-btn:hover:not(:disabled) {
  transform: scale(1.1);
  opacity: 1;
  filter: brightness(1.2);
}
.ai-title-input {
  background: transparent;
  border: none;
  color: #fff;
  font-size: 1rem;
  font-weight: 600;
  padding: 5px 0;
  width: 100%;
  outline: none;
  transition: none;
  border-radius: 0;
  white-space: nowrap;
  overflow-x: auto;
  text-overflow: ellipsis;
}
.ai-title-input:hover,
.ai-title-input:focus {
  text-overflow: clip;
  background: transparent;
  padding-left: 0;
}
.ai-title-input::placeholder {
  color: rgba(255, 255, 255, 0.3);
}
.ai-actions {
  cursor: default;
  opacity: 1;
  transition: 0.2s;
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  gap: 12px; /* Uniform 12px spacing for all header icons */
  position: relative;
  flex-shrink: 0;
}
.ai-actions i {
  cursor: pointer;
  transition: all 0.2s;
  font-size: 1.2rem;
  color: var(--accent-color);
  opacity: 0.8;
}
.ai-actions i:hover {
  transform: scale(1.1);
  opacity: 1;
  filter: brightness(1.2);
}
.header-attachment-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}
.attachment-popover {
  position: absolute;
  top: calc(100% + 15px);
  right: 0;
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(15px);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  padding: 8px;
  min-width: 200px;
  max-width: min(450px, calc(100vw - 40px));
  display: none;
  z-index: 1000;
  box-shadow: 0 10px 30px rgba(0,0,0,0.6);
  animation: popoverFadeIn 0.2s ease-out;
}
@keyframes popoverFadeIn {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}
.attachment-popover.show {
  display: block;
}
.popover-file-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 0.85rem;
  color: #f1f5f9;
  transition: 0.2s;
  cursor: pointer;
  position: relative;
}
.popover-file-item:hover {
  background: rgba(255, 255, 255, 0.08);
}
.popover-file-item .file-info {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
}
.popover-file-item .popover-delete-btn {
  margin-left: 10px;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  transition: all 0.2s;
  color: #ef4444;
}
.popover-file-item:hover .popover-delete-btn {
  opacity: 0.6;
}
.popover-file-item .popover-delete-btn:hover {
  opacity: 1;
  transform: scale(1.1);
  color: #ef4444 !important;
}
.popover-file-item .popover-delete-btn i {
  font-size: 0.9rem !important;
  color: #ef4444 !important;
}
.validation-tip {
  position: fixed;
  background: var(--tip-bg, #ef4444);
  color: #fff;
  padding: 8px 15px;
  border-radius: 10px;
  font-size: 0.75rem;
  font-weight: 600;
  z-index: 2147483647;
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, 5px);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
  white-space: nowrap;
  --tip-bg: #ef4444; 
}
.validation-tip.success {
  --tip-bg: #22c55e; 
}
.ai-delete-confirm,
.ai-file-delete-confirm,
.ai-lock-confirm {
  --tip-bg: #1e293b;
  background: var(--tip-bg);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 12px 18px;
  display: flex;
  flex-direction: column;
  align-items: center; gap: 10px;
  pointer-events: auto !important;
  border-radius: 12px;
}
.ai-delete-confirm .btn-del-confirm,
.ai-file-delete-confirm .btn-del-confirm,
.ai-lock-confirm .btn-lock-confirm {
  background: #ef4444;
  color: #fff;
  border: none;
  padding: 6px 15px;
  border-radius: 8px;
  font-size: 0.8rem;
  cursor: pointer;
  transition: 0.2s;
  width: 100%;
  font-weight: 600;
  text-align: center;
}
.ai-lock-confirm .btn-lock-confirm {
  background: #3b82f6;
}
.ai-delete-confirm .btn-del-confirm:hover,
.ai-file-delete-confirm .btn-del-confirm:hover {
  background: #dc2626;
  transform: scale(1.05);
}
.ai-lock-confirm .btn-lock-confirm:hover {
  background: #2563eb;
  transform: scale(1.05);
}
.validation-tip.show {
  opacity: 1;
  transform: translate(-50%, -100%);
}
.validation-tip::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: var(--tip-bg);
}
.validation-tip.pos-right {
  transform: translateY(-50%);
}
.validation-tip.pos-right.show {
  opacity: 1;
  transform: translate(0, -50%);
}
.validation-tip.pos-right::after {
  top: 50%;
  right: 100%;
  left: auto;
  transform: translateY(-50%);
  border: 6px solid transparent;
  border-right-color: var(--tip-bg);
}
.validation-tip.pos-left {
  transform: translateY(-50%);
}
.validation-tip.pos-left.show {
  opacity: 1;
  transform: translate(-100%, -50%);
}
.validation-tip.pos-left::after {
  top: 50%;
  left: 100%;
  right: auto;
  transform: translateY(-50%);
  border: 6px solid transparent;
  border-left-color: var(--tip-bg);
}
.validation-tip.pos-bottom {
  transform: translate(-50%, -10px);
}
.validation-tip.pos-bottom.show {
  opacity: 1;
  transform: translate(-50%, 0);
}
.validation-tip.pos-bottom::after {
  bottom: 100%;
  top: auto;
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-bottom-color: var(--tip-bg);
}
.popover-file-item i.file-main-icon {
  width: 24px;
  height: 24px;
  font-size: 1.05rem;
  color: var(--accent-color);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.popover-file-item span {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: left;
}
.popover-file-item img {
  width: 24px;
  height: 24px;
  border-radius: 4px;
  object-fit: cover;
  flex-shrink: 0;
}
.ai-chat-messages {
  flex: 1;
  overflow-y: auto;
  overflow-x: visible;
  padding: 25px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.ai-chat-messages.content-loading {
  animation: chatContentFadeIn 0.3s ease-out forwards;
}
@keyframes chatContentFadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.ai-message {
  max-width: 85%;
  padding: 12px 16px;
  border-radius: 18px;
  font-size: 0.95rem;
  line-height: 1.5;
  position: relative;
  word-break: break-word;
  overflow: visible;
}
.ai-message.new-message {
  animation: messageSlideIn 0.3s ease-out forwards;
}
@keyframes messageSlideIn {
  from {
    opacity: 0;
    transform: translateY(15px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.ai-message.user {
  align-self: flex-end;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--accent-color);
  color: var(--accent-color);
  border-bottom-right-radius: 4px;
}
.ai-message.bot {
  align-self: flex-start;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--glass-border);
  border-bottom-left-radius: 4px;
}
.ai-message-attachment-badge {
  position: absolute;
  top: -8px;
  right: -8px;
  width: 22px;
  height: 22px;
  background: var(--accent-color);
  color: var(--accent-contrast, #fff);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  cursor: pointer;
  z-index: 20;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
  border: 1.5px solid rgba(255,255,255,0.1);
}
.ai-message-attachment-badge:hover {
  transform: scale(1.1);
  box-shadow: 0 4px 10px rgba(0,0,0,0.4);
}
.attachment-tooltip {
  position: absolute;
  top: -10px;
  right: 0;
  transform: translateY(-100%);
  background: #1e293b;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 12px;
  padding: 8px;
  display: none;
  flex-direction: column;
  gap: 2px;
  min-width: 180px;
  max-width: min(400px, calc(100vw - 80px));
  z-index: 9999;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.5), 0 8px 10px -6px rgba(0, 0, 0, 0.5);
  animation: tooltip-fade-in 0.2s ease-out;
}
.attachment-tooltip.show {
  display: flex;
}
.attachment-tooltip.pos-bottom {
  top: auto;
  bottom: -10px;
  transform: translateY(100%);
  animation: tooltip-fade-in-bottom 0.2s ease-out;
}
@keyframes tooltip-fade-in {
  from { opacity: 0; transform: translateY(-90%) scale(0.95); }
  to { opacity: 1; transform: translateY(-100%) scale(1); }
}
@keyframes tooltip-fade-in-bottom {
  from { opacity: 0; transform: translateY(90%) scale(0.95); }
  to { opacity: 1; transform: translateY(100%) scale(1); }
}
.tooltip-file-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  border-radius: 10px;
  font-size: 0.85rem;
  color: #f1f5f9;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}
.tooltip-file-item:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--accent-color);
}
.tooltip-file-item.deleted {
  text-decoration: line-through;
  text-decoration-color: #ff4d4d;
  text-decoration-thickness: 2px;
  opacity: 0.7;
  cursor: default;
}
.tooltip-file-item.deleted i,
.tooltip-file-item.deleted span {
  color: #94a3b8 !important;
}
.tooltip-file-item i {
  color: var(--accent-color);
  font-size: 1.05rem;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.tooltip-file-item span {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: left;
}
.typing-indicator {
  display: flex;
  gap: 5px;
  padding: 5px 0;
  align-items: center;
  height: 12px;
}
.typing-indicator span {
  width: 8px;
  height: 8px;
  background: #94a3b8;
  border-radius: 50%;
  display: inline-block;
  animation: typing-bounce 1.4s infinite ease-in-out both;
}
.typing-indicator span:nth-child(1) {
  animation-delay: -0.32s;
}
.typing-indicator span:nth-child(2) {
  animation-delay: -0.16s;
}
@keyframes typing-bounce {
  0%,
  80%,
  100% {
    transform: scale(0);
    opacity: 0.3;
  }
  40% {
    transform: scale(1);
    opacity: 1;
  }
}
.ai-chat-input-area {
  padding: 15px 25px;
  background: rgba(0, 0, 0, 0.2);
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: stretch;
  border-top: 1px solid var(--glass-border);
  flex-shrink: 0;
  position: relative;
  cursor: text;
}
.ai-input-wrapper {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  gap: 13px; /* 1.2: Increased by 5px from 8px */
  position: relative;
  z-index: 1;
}
.ai-drag-overlay {
  position: absolute;
  top: 8px;
  left: 8px;
  right: 8px;
  bottom: 8px;
  background: rgba(15, 23, 42, 0.9);
  border: 2px dashed var(--accent-color);
  border-radius: 16px;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 20;
  pointer-events: none;
}
.ai-drag-overlay span {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--accent-color);
  opacity: 0.4;
  pointer-events: none;
}
.ai-chat-input-area.drag-over .ai-drag-overlay {
  display: flex;
}
#ai-user-input {
  flex: 1;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  color: #fff;
  padding: 12px 15px;
  font-family: inherit;
  font-size: 0.95rem;
  resize: none;
  height: 60px;
  min-height: 60px;
  outline: none;
  transition: border-color 0.2s;
  box-sizing: border-box;
  cursor: text !important;
  position: relative;
  z-index: 5;
}
#ai-user-input:focus {
  border-color: var(--accent-color);
}
#ai-user-input.locked-placeholder::placeholder {
  color: #ef4444 !important;
  opacity: 0.8;
}
.ai-chat-input-area.locked {
  pointer-events: none;
  opacity: 0.7;
}
.ai-chat-input-area.locked .ai-input-actions {
  pointer-events: auto;
}
.ai-chat-input-area.locked #ai-user-input {
  cursor: not-allowed;
}
.ai-input-actions {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: stretch; /* 1.1: Buttons take full width */
  gap: 8px;
  flex-shrink: 0;
  height: 60px; /* 1.1: Matches #ai-user-input height */
}
.ai-tags-area {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  overflow-x: auto;
}
.ai-chat-tags-container {
  display: flex;
  align-items: center;
  gap: 2px;
}
.ai-action-buttons {
  display: flex;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
}
#ai-send-btn,
#ai-attach-btn {
  background: transparent;
  border: 1px solid var(--accent-color);
  color: var(--accent-color);
  width: 36px;
  height: 26px; /* 1.1: (60px - 8px gap) / 2 = 26px */
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}
#ai-send-btn:hover:not(:disabled),
#ai-attach-btn:hover:not(:disabled) {
  background: rgba(56, 189, 248, 0.1);
  transform: scale(1.05);
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.2);
}
#ai-send-btn:disabled,
#ai-attach-btn:disabled {
  opacity: 0.3 !important;
  border-color: #94a3b8 !important;
  color: #94a3b8 !important;
  cursor: not-allowed !important;
  transform: none !important;
  box-shadow: none !important;
}
#ai-send-btn:hover:not(:disabled),
#ai-attach-btn:hover:not(:disabled) {
  background: rgba(56, 189, 248, 0.1);
  transform: scale(1.05);
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.2);
}
#ai-send-btn:disabled,
#ai-attach-btn:disabled {
  opacity: 0.3 !important;
  border-color: #94a3b8 !important;
  color: #94a3b8 !important;
  cursor: not-allowed !important;
  transform: none !important;
  box-shadow: none !important;
}
.ai-file-previews {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  padding: 0 0 8px 0;
}
.ai-file-previews:empty {
  display: none;
}
.ai-file-preview-item {
  position: relative;
  width: 40px;
  height: 40px;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid var(--glass-border);
  background: rgba(255, 255, 255, 0.05);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: 0.2s;
  flex-shrink: 0;
}
.ai-file-preview-item:hover {
  border-color: var(--accent-color);
}
.ai-file-preview-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.ai-file-preview-item .remove-btn {
  position: absolute;
  top: -1px;
  right: -1px;
  width: 14px;
  height: 14px;
  background: #ef4444;
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 8px;
  cursor: pointer;
  z-index: 2;
  box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}
.ai-file-preview-item .file-icon {
  font-size: 1rem;
  opacity: 0.7;
}
.ai-icon-btn i {
  pointer-events: none; 
}
.ai-icon-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: var(--glass-border);
}
.ai-tooltip {
  position: fixed;
  background: rgba(15, 23, 42, 0.95);
  color: #fff;
  padding: 8px 15px;
  border-radius: 10px;
  font-size: 0.8rem;
  z-index: 10000;
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, 10px);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1px solid var(--glass-border);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
  white-space: nowrap;
}
.ai-tooltip.show {
  opacity: 1;
  transform: translate(-50%, -100%);
}
.validation-tip {
  position: fixed;
  background: var(--tip-bg, #ef4444);
  color: #fff;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 0.75rem;
  font-weight: 600;
  z-index: 100000;
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, 5px);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
  white-space: nowrap;
  --tip-bg: #ef4444; 
}
.validation-tip.success {
  --tip-bg: #22c55e; 
}
.ai-delete-confirm,
.ai-file-delete-confirm,
.ai-lock-confirm {
  --tip-bg: #334155;
  background: var(--tip-bg);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 10px 15px;
  display: flex;
  align-items: center;
  gap: 10px;
  pointer-events: auto !important;
}
.validation-tip.show {
  opacity: 1;
  transform: translate(-50%, -100%);
}
.validation-tip::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: var(--tip-bg);
}
.validation-tip.pos-right {
  transform: translateY(-50%);
}
.validation-tip.pos-right.show {
  transform: translate(0, -50%);
}
.validation-tip.pos-right::after {
  top: 50%;
  left: auto;
  right: 100%;
  transform: translateY(-50%);
  border-top-color: transparent;
  border-right-color: var(--tip-bg);
}
.validation-tip.pos-left {
  transform: translateY(-50%);
}
.validation-tip.pos-left.show {
  transform: translate(-100%, -50%);
  margin-left: -15px;
}
.validation-tip.pos-left::after {
  top: 50%;
  left: 100%;
  right: auto;
  transform: translateY(-50%);
  border-top-color: transparent;
  border-left-color: var(--tip-bg);
}
.ai-refresh-icon {
  color: #94a3b8;
  transition: all 0.3s ease;
}
.ai-refresh-icon.spin {
  pointer-events: none; 
}
#ai-check-btn:hover .ai-refresh-icon {
  transform: rotate(180deg) scale(1.2);
  filter: brightness(1.2);
}
.ai-icon-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  cursor: pointer;
}
.ai-search-icon {
  font-size: 1.1rem;
  color: #94a3b8;
  opacity: 0.5;
  transition: all 0.3s ease;
  z-index: 2;
}
.ai-search-icon.can-chat {
  color: var(--accent-color);
  opacity: 1;
}
.ai-search-icon.active {
  filter: drop-shadow(0 0 5px var(--accent-color));
}
.ai-orbit {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 100%;
  height: 100%;
  transform: translate(-50%, -50%);
  pointer-events: none;
  display: none;
}
.ai-search-icon.can-chat + .ai-orbit {
  display: block;
}
.ai-orbit-dot {
  position: absolute;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--accent-color);
  box-shadow: 0 0 10px var(--accent-color);
  top: 50%;
  left: 50%;
  margin-top: -2px;
  margin-left: -2px;
}
.dot-1 {
  animation: orbit-center-1 3s linear infinite;
}
.dot-2 {
  animation: orbit-center-2 4.5s linear infinite reverse;
}
.dot-3 {
  animation: orbit-center-3 6s linear infinite;
}
@keyframes orbit-center-1 {
  0% {
    transform: rotate(0deg) translateX(16px) rotate(0deg) scale(1);
    z-index: 3;
  }
  50% {
    transform: rotate(180deg) translateX(16px) rotate(-180deg) scale(0.5);
    opacity: 0.3;
    z-index: 1;
  }
  100% {
    transform: rotate(360deg) translateX(16px) rotate(-360deg) scale(1);
    z-index: 3;
  }
}
@keyframes orbit-center-2 {
  0% {
    transform: rotate(120deg) translateY(14px) rotate(-120deg) scale(0.4);
    opacity: 0.4;
    z-index: 1;
  }
  50% {
    transform: rotate(300deg) translateY(14px) rotate(-300deg) scale(1.1);
    opacity: 1;
    z-index: 3;
  }
  100% {
    transform: rotate(480deg) translateY(14px) rotate(-480deg) scale(0.4);
    opacity: 0.4;
    z-index: 1;
  }
}
@keyframes orbit-center-3 {
  0% {
    transform: rotate(-60deg) translateX(-18px) rotate(60deg) scale(1);
    z-index: 3;
  }
  50% {
    transform: rotate(120deg) translateX(-18px) rotate(-120deg) scale(0.4);
    opacity: 0.2;
    z-index: 1;
  }
  100% {
    transform: rotate(300deg) translateX(-18px) rotate(-300deg) scale(1);
    z-index: 3;
  }
}
.ai-search-icon:hover {
  opacity: 0.8;
  transform: scale(1.1);
}
.intro-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(15px);
  z-index: 9000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
.intro-overlay.show {
  opacity: 1;
  visibility: visible;
}
.intro-card {
  background: rgba(15, 23, 42, 0.8);
  backdrop-filter: blur(25px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 32px;
  width: 500px;
  max-width: 90vw;
  padding: 40px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  text-align: center;
  transform: scale(0.9) translateY(20px);
  opacity: 0;
  transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.intro-overlay.show .intro-card {
  transform: scale(1) translateY(0);
  opacity: 1;
}
body.tutorial-closing .driver-overlay {
  opacity: 0 !important;
  transition: opacity 0.3s ease !important;
}
body.tutorial-closing .driver-popover {
  opacity: 0 !important;
  transform: scale(0.9) !important;
  transition: opacity 0.3s ease, transform 0.3s ease !important;
}
body.tutorial-closing .driver-active-element {
  filter: brightness(1) !important;
  transition: filter 0.3s ease !important;
}

/* Driver.js Active Element Contrast */
.driver-active-element {
  outline: none !important;
  box-shadow: none !important;
  filter: brightness(1.3) contrast(1.1) !important;
  transition: all 0.3s ease !important;
  z-index: 100001 !important;
}

/* Driver.js Custom Dark Theme */
.driver-popover.driverjs-theme {
  background: rgba(15, 23, 42, 0.9) !important;
  backdrop-filter: blur(15px) !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  border-radius: 20px !important;
  padding: 20px !important;
  color: #fff !important;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6) !important;
}

.driver-popover.driverjs-theme .driver-popover-title {
  color: #fff !important;
  font-size: 1.1rem !important;
  font-weight: 700 !important;
  margin-bottom: 10px !important;
}

.driver-popover.driverjs-theme .driver-popover-description {
  color: rgba(255, 255, 255, 0.8) !important;
  font-size: 0.95rem !important;
  line-height: 1.6 !important;
}

.driver-popover.driverjs-theme .driver-popover-close-btn {
  color: rgba(255, 255, 255, 0.5) !important;
}

.driver-popover.driverjs-theme .driver-popover-close-btn:hover {
  color: #fff !important;
}

.driver-popover.driverjs-theme .driver-popover-arrow-side-left::after { border-left-color: rgba(15, 23, 42, 0.9) !important; }
.driver-popover.driverjs-theme .driver-popover-arrow-side-right::after { border-right-color: rgba(15, 23, 42, 0.9) !important; }
.driver-popover.driverjs-theme .driver-popover-arrow-side-top::after { border-top-color: rgba(15, 23, 42, 0.9) !important; }
.driver-popover.driverjs-theme .driver-popover-arrow-side-bottom::after { border-bottom-color: rgba(15, 23, 42, 0.9) !important; }

.driver-popover.driverjs-theme .driver-popover-footer {
  margin-top: 15px !important;
  gap: 10px !important;
}

.driver-popover.driverjs-theme .driver-popover-btn {
  background: rgba(255, 255, 255, 0.05) !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  color: #94a3b8 !important;
  border-radius: 10px !important;
  padding: 8px 15px !important;
  font-weight: 600 !important;
  text-shadow: none !important;
  transition: all 0.2s !important;
}

.driver-popover.driverjs-theme .driver-popover-btn:hover {
  background: rgba(255, 255, 255, 0.1) !important;
  color: #fff !important;
}

.driver-popover.driverjs-theme .driver-popover-next-btn {
  background: var(--accent-color) !important;
  border-color: var(--accent-color) !important;
  color: var(--accent-contrast, #fff) !important;
}

.driver-popover.driverjs-theme .driver-popover-next-btn:hover {
  filter: brightness(1.1) !important;
  background: var(--accent-color) !important;
}

.driver-popover.driverjs-theme .driver-popover-progress-text {
  color: rgba(255, 255, 255, 0.4) !important;
  font-size: 0.8rem !important;
}

.intro-header {
  margin-bottom: 30px;
}
.intro-logo {
  width: 80px;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 25px;
}
.intro-card h1 {
  font-size: 1.8rem;
  font-weight: 800;
  margin-bottom: 8px;
  color: #fff;
  letter-spacing: -0.02em;
}
.intro-subtitle {
  color: var(--accent-color);
  font-size: 0.95rem;
  font-weight: 600;
  opacity: 0.9;
}
.intro-body {
  margin-bottom: 35px;
  color: rgba(255, 255, 255, 0.7);
  line-height: 1.6;
  font-size: 1rem;
}
.intro-info-box {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 16px;
  padding: 15px;
  margin-top: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.info-item {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-size: 0.85rem;
}
.info-item a {
  color: #94a3b8;
  text-decoration: none;
  transition: color 0.2s;
}
.info-item a:hover {
  color: #fff;
}
.intro-footer {
  display: flex;
  gap: 15px;
}
.intro-btn {
  flex: 1;
  padding: 14px;
  border-radius: 16px;
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
}
.intro-btn.skip {
  background: rgba(255, 255, 255, 0.05);
  color: #94a3b8;
}
.intro-btn.skip:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}
.intro-btn.start {
  background: var(--accent-color);
  color: var(--accent-contrast);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}
.intro-btn.start:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
  filter: brightness(1.1);
}
@keyframes modalPopUp {
  from { opacity: 0; transform: scale(0.8); }
  to { opacity: 1; transform: scale(1); }
}

/* Alarm Desc Resizing */
#notiDesc {
  height: 85px;
  resize: none;
  overflow-y: auto;
}

/* Custom Prompt Modal for Links */
#customPromptModal .modal-content {
    width: 350px;
    padding: 25px;
}
#customPromptModal input {
    margin-bottom: 15px;
}

/* --- Final Consolidated & Corrected Styles --- */

/* Memo Modal Dimensions & Resizing */

/* Shortcut Modal - Separate Elements */

#siteIcon {
  height: 42px;
  flex: 1;
  margin-bottom: 0 !important;
  background: #0f172a;
  border: 1px solid #334155;
  border-radius: 10px;
  padding: 0 15px;
  color: #fff;
  outline: none;
  transition: all 0.2s;
}
#siteIcon:focus {
  border-color: var(--accent-color);
  box-shadow: 0 0 0 2px rgba(var(--accent-color-rgb, 56, 189, 248), 0.2);
}

/* Icon Picker - Fixed Height Search & Distinct Area */

/* Memo Toolbar & Dropdowns */

.table-picker-info { text-align: center; font-size: 0.75rem; color: #94a3b8; padding: 5px 0; font-family: monospace; }
.table-picker-grid { display: grid; gap: 4px; padding: 8px; width: min-content; }
.table-picker-cell { width: 18px; height: 18px; border: 1px solid rgba(255, 255, 255, 0.1); border-radius: 3px; cursor: pointer; }
.table-picker-cell.active { background: var(--accent-color); border-color: var(--accent-color); }

.color-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; padding: 8px; }
.color-swatch-btn { width: 24px; height: 24px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, 0.2); cursor: pointer; transition: 0.2s; }
.color-swatch-btn:hover { transform: scale(1.2); border-color: #fff; }

/* Markdown Preview Elements */
.modal-header-actions { position: absolute; top: 31px; right: 30px; display: flex; align-items: center; gap: 12px; }
.header-action-btn { background: transparent; border: none; color: var(--accent-color); cursor: pointer; font-size: 1.1rem; transition: 0.2s; }
.header-action-btn:disabled { opacity: 0.3; cursor: not-allowed; }
/* Table Editor Modal Content & Grid */
/* Table Management Buttons */
.table-mgmt-row-minus, .table-mgmt-row-plus,
.table-mgmt-col-minus, .table-mgmt-col-plus {    opacity: 0;
    transition: all 0.3s;
    display: flex;
    z-index: 10;
    position: absolute;
    background: #1e293b;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    padding: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.6);
}
.table-editor-grid:hover .table-mgmt-row-minus,
.table-editor-grid:hover .table-mgmt-row-plus,
.table-editor-grid:hover .table-mgmt-col-minus,
.table-mgmt-row-minus:hover, .table-mgmt-row-plus:hover,
.table-mgmt-col-minus:hover, .table-mgmt-col-plus:hover {
    opacity: 1 !important;
    background: #2d3748;
    border-color: var(--accent-color);
}
.table-mgmt-btn {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(30, 41, 59, 0.8);
    color: #94a3b8;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    font-size: 0.85rem;
}
.table-mgmt-btn:hover {
    background: var(--accent-color);
    color: #fff;
    transform: scale(1.1);
}
.table-mgmt-btn.delete:hover {
    background: #ef4444;
}

.ai-chat-messages::-webkit-scrollbar,
.ai-history-list::-webkit-scrollbar,
.ai-tags-area::-webkit-scrollbar,
.ai-chat-tags-container::-webkit-scrollbar,
#ai-user-input::-webkit-scrollbar,
.weather-popup::-webkit-scrollbar,
.city-results::-webkit-scrollbar,
.popup-list-area::-webkit-scrollbar,
#search-engine-popup::-webkit-scrollbar,
#ai-model-select-popup::-webkit-scrollbar,
#citySearchResults::-webkit-scrollbar,

/* Memo Header Preview Sizes in Dropdown */



/* === FINAL CONSOLIDATED DYNAMIC STYLES === */

/* Global Scrollbar Hiding */
* {
    scrollbar-width: none !important;
    -ms-overflow-style: none !important;
}
*::-webkit-scrollbar {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
}

/* Memo Modal */
#memoModal .modal-content {
  width: fit-content;
  min-width: 500px;
  max-width: 95vw;
  border-radius: 20px;
  background: #1e293b;
  overflow: hidden;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

#memoTitle {
  display: block;
  width: 100%;
  box-sizing: border-box;
  margin-bottom: 10px;
  background: #0f172a;
  border: 1px solid #334155;
  border-radius: 10px;
  padding: 12px 15px;
  color: #fff;
  font-family: inherit;
  font-size: 1.1rem;
  font-weight: 600;
  outline: none;
  transition: all 0.2s;
}
#memoTitle:focus {
  border-color: var(--accent-color);
  box-shadow: 0 0 0 2px rgba(var(--accent-color-rgb, 56, 189, 248), 0.2);
}

#memoContent, #memoPreview {
  width: 100%;
  min-width: 450px;
  height: 350px;
  min-height: 100px;
  padding: 15px;
  box-sizing: border-box;
  border-radius: 10px;
  margin-bottom: 15px;
  resize: both;
  word-wrap: break-word;
  overflow-wrap: break-word;
  word-break: break-word;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

#memoContent {
  display: block;
  background: #0f172a;
  border: 1px solid #334155;
  color: #fff;
  font-size: 1rem;
  line-height: 1.6;
  scrollbar-width: none;
  overflow-x: hidden;
  white-space: pre-wrap;
}
#memoContent:focus {
  border-color: var(--accent-color);
  box-shadow: 0 0 0 2px rgba(var(--accent-color-rgb, 56, 189, 248), 0.2);
}
#memoContent.preview-active {
  background: #1e293b !important;
  color: #64748b !important;
  cursor: default;
  pointer-events: none;
}

#memoPreview {
  display: none;
  background: rgba(15, 23, 42, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #fff;
  overflow: auto;
  line-height: 1.6;
  font-family: inherit;
  font-size: 1rem;
}

/* Shortcut Modal Elements */
#iconPreview, .icon-upload-btn {
  width: 42px;
  height: 42px;
  background: #0f172a;
  border: 1px solid #334155;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  cursor: pointer;
  transition: all 0.2s;
  color: #94a3b8;
  font-size: 1.1rem;
  padding: 0;
  overflow: hidden;
}
#iconPreview:hover, .icon-upload-btn:hover {
  border-color: var(--accent-color);
  color: #fff;
}
#iconPreview:focus, .icon-upload-btn:focus {
  outline: none;
  border-color: var(--accent-color);
  box-shadow: 0 0 0 2px rgba(var(--accent-color-rgb, 56, 189, 248), 0.2);
}

#siteIcon {
  height: 42px;
  flex: 1;
  margin-bottom: 0 !important;
  background: #0f172a;
  border: 1px solid #334155;
  border-radius: 10px;
  padding: 0 15px;
  color: #fff;
  outline: none;
  transition: all 0.2s;
}
#siteIcon:focus {
  border-color: var(--accent-color);
  box-shadow: 0 0 0 2px rgba(var(--accent-color-rgb, 56, 189, 248), 0.2);
}

/* Icon Picker */
#iconPickerArea {
  display: flex;
  flex-direction: column;
  background: transparent;
  border-radius: 12px;
  padding: 2px;
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;
}
#iconPickerArea.show {
  max-height: 400px;
  opacity: 1;
  margin-top: 15px;
  margin-bottom: 15px;
  pointer-events: auto;
}

.icon-search-container {
  display: flex;
  align-items: center;
  background: #0f172a;
  border: 1px solid #334155;
  border-radius: 10px;
  padding: 0 12px;
  transition: all 0.2s;
  margin-bottom: 12px;
  height: 42px;
  flex-shrink: 0;
  box-sizing: border-box;
}
.icon-search-container:focus-within {
  border-color: var(--accent-color);
  box-shadow: 0 0 0 2px rgba(var(--accent-color-rgb, 56, 189, 248), 0.2);
}
.icon-search-container i { color: #64748b; font-size: 0.9rem; }

#iconSearchInput {
  margin-left: 10px !important;
  margin-bottom: 0 !important;
  background: transparent !important;
  border: none !important;
  outline: none !important;
  color: #fff !important;
  width: 100% !important;
  padding: 0 !important;
  height: 100% !important;
  box-shadow: none !important;
  font-size: 0.9rem;
}

#iconGrid {
  display: grid !important;
  grid-template-columns: repeat(6, 1fr) !important;
  gap: 10px;
  height: 250px;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 12px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 12px;
  width: 100%;
  box-sizing: border-box;
  justify-items: center;
}
.icon-item {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
  cursor: pointer;
  border: 1px solid transparent;
  transition: 0.2s;
}
.icon-item:hover { background: rgba(255, 255, 255, 0.1); border-color: var(--accent-color); transform: translateY(-2px); }

/* Memo Toolbar & Dropdowns */
.memo-toolbar {
  display: flex;
  align-items: center;
  gap: 3px;
  margin-bottom: 10px;
  background: rgba(255, 255, 255, 0.05);
  padding: 5px 8px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  width: 100%;
  box-sizing: border-box;
  position: relative;
}
.memo-toolbar.disabled .memo-toolbar-group,
.memo-toolbar.disabled .memo-toolbar-separator,
.memo-toolbar.disabled > button:not(#memoToggleView) {
  pointer-events: none;
  opacity: 0.5;
}.memo-toolbar-group {
  position: relative;
  display: flex;
  align-items: center;
}
.memo-toolbar-separator {
  width: 1px;
  height: 20px;
  background: rgba(255, 255, 255, 0.1);
  margin: 0 5px;
}
.memo-toolbar-btn {  background: transparent;
  border: none;
  color: #94a3b8;
  padding: 6px 8px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
}
.memo-toolbar-btn:hover { background: rgba(255, 255, 255, 0.1); color: #fff; }
.memo-toolbar-btn.active, .memo-toolbar-btn.dropdown-active { color: var(--accent-color); background: rgba(var(--accent-color-rgb, 56, 189, 248), 0.1); }
.memo-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(15px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 6px;
  min-width: 180px;
  z-index: 1000;
  display: none;
  flex-direction: column;
}
.memo-dropdown.show { display: flex; animation: modalPopUp 0.2s ease-out; }
.memo-dropdown-item {
  padding: 8px 12px;
  border-radius: 8px;
  color: #94a3b8;
  cursor: pointer;
  font-size: 0.85rem;
  transition: 0.2s;
  display: flex;
  align-items: center;
  gap: 10px;
}
.memo-dropdown-item:hover { background: rgba(255, 255, 255, 0.08); color: #fff; }

/* Table Editor - Perfect Alignment & Centering */
.table-editor-modal-content {
    padding: 25px !important;
    width: fit-content !important;
    max-width: 95vw;
    border-radius: 20px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.table-editor-modal-content .modal-header {
    padding: 0 0 15px 0;
}
.table-editor-container {
    padding: 0;
    overflow: auto;
    max-height: 65vh;
    display: flex;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 12px;
    box-sizing: border-box;
    min-height: 120px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}.table-editor-grid {
  display: grid;
  gap: 6px 15px;
  padding: 25px; /* Equal padding on all sides */
  width: fit-content;
  margin: auto; /* Robustly centers horizontally and vertically even with overflow */
}
.table-editor-input {
  width: 130px;
  height: 30px;
  padding: 1px 12px;
  background: #0f172a;
  border: 1px solid #334155; 
  color: #fff;
  font-size: 0.85rem;
  outline: none;
  box-sizing: border-box;
  border-radius: 6px;
  vertical-align: middle;
  margin: 0;
  transition: all 0.2s ease-out;
}
.table-editor-input.header-input { background: rgba(var(--accent-color-rgb, 56, 189, 248), 0.15); font-weight: 600; }.table-editor-input:focus { border-color: var(--accent-color); box-shadow: 0 0 0 2px rgba(var(--accent-color-rgb, 56, 189, 248), 0.2); }

.table-editor-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 15px 0 0 0; /* Space above but not inside the frame */
}

/* Context Menu Enhancements */
.context-menu {
  display: none;
  position: absolute;
  z-index: 5000;
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(15px);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  padding: 0 1px; /* Added 1px horizontal padding */
  width: fit-content;
  min-width: auto; /* Allow complete dynamic shrinking */
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
  overflow: hidden;
  white-space: nowrap;
}.context-menu > div:not(.cm-group):not(#ctx-ai-group), 
.context-menu .cm-action,
#ctx-ai-group > div {
  padding: 10px 15px;
  margin-left: -1px;
  margin-right: -1px;
  width: calc(100% + 2px);
  box-sizing: border-box;
  font-size: 0.85rem;
  cursor: pointer;
  color: #fff;
  transition: 0.2s;
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 500;
}
#ctx-ai-group {
  width: 100%;
  display: flex;
  flex-direction: column;
  padding: 0;
}
.context-menu .cm-group {
  display: flex;
  align-items: stretch;
  padding: 0;
  width: 100%;
}
.context-menu > div:not(.cm-group):not(#ctx-ai-group):hover:not(.disabled), 
.context-menu .cm-action:hover:not(.disabled),
#ctx-ai-group > div:hover:not(.disabled) { 
  background: rgba(var(--accent-color-rgb, 56, 189, 248), 0.15) !important; 
}

.cm-icon {
  width: 16px;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 0.9rem;
}
/* Ensure icon inherits hover color from parent if needed, but the parent color override already handles text/icon color */.context-menu .cm-group {
  display: flex;
  align-items: stretch;
  padding: 0;
}
.context-menu .cm-action {
  flex: 1 1 auto; /* Allow items to scale naturally based on translated text length */
  justify-content: flex-start; /* Left align to keep icons in a vertical line */
  padding: 10px 15px; /* balanced for side-by-side */
  margin-left: -1px;
  margin-right: -1px;
  width: calc(100% + 2px);
  white-space: nowrap; /* Ensure text dictates width */
}
.context-menu .disabled {  opacity: 0.3 !important;
  cursor: not-allowed !important;
}

/* Context Menu Item Colors */.cm-add { color: #22c55e !important; }
.cm-edit { color: #f59e0b !important; }
.cm-hide { color: #3b82f6 !important; }
.cm-del { color: #ef4444 !important; }

/* AI Context Menu Colors */
.cm-ai-export { color: #22c55e !important; }
.cm-ai-lock { color: #3b82f6 !important; }
.cm-ai-tag { color: #eab308 !important; }
.cm-ai-del { color: #ef4444 !important; }

.cm-table-icon {
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  position: relative;
}
/* Addition Icons: Green Bars */
.cm-table-icon.row-bar.add::before {
  content: "";
  width: 15px;
  height: 4px;
  background: #22c55e;
  border-radius: 2px;
}
.cm-table-icon.col-bar.add::before {
  content: "";
  width: 4px;
  height: 15px;
  background: #22c55e;
  border-radius: 2px;
}
/* Deletion Icons: Red Circle with Slash (Ban) + Internal Green Bar */
.cm-table-icon.delete-ban {
  width: 20px;
  height: 20px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}
/* The Green Bar (at the bottom) */
.cm-table-icon.delete-ban.row-bar::before {
  content: "";
  position: absolute;
  width: 15px;
  height: 4px;
  background: #22c55e;
  border-radius: 2px;
  z-index: 1;
}
.cm-table-icon.delete-ban.col-bar::before {
  content: "";
  position: absolute;
  width: 4px;
  height: 15px;
  background: #22c55e;
  border-radius: 2px;
  z-index: 1;
}
/* The Red Ban Sign (on top) */
.cm-table-icon.delete-ban::after {
  content: "";
  position: absolute;
  width: 18px;
  height: 18px;
  border: 2px solid #ef4444;
  border-radius: 50%;
  box-sizing: border-box;
  background: linear-gradient(45deg, transparent 40%, #ef4444 40%, #ef4444 60%, transparent 60%);
  z-index: 2;
}

/* Hover state: Use theme accent color for addition icons and deletion internal bars */
.context-menu > div:not(.disabled):hover .cm-table-icon.add::before,
.context-menu .cm-action:not(.disabled):hover .cm-table-icon.add::before { background: var(--accent-color) !important; }

.context-menu > div:not(.disabled):hover .cm-table-icon.delete-ban::before,
.context-menu .cm-action:not(.disabled):hover .cm-table-icon.delete-ban::before { background: var(--accent-color) !important; }

/* Keep deletion ban sign red even on hover */
.context-menu > div:not(.disabled):hover .cm-table-icon.delete-ban::after,
.context-menu .cm-action:not(.disabled):hover .cm-table-icon.delete-ban::after { 
  border-color: #ef4444 !important; 
  background: linear-gradient(45deg, transparent 40%, #ef4444 40%, #ef4444 60%, transparent 60%) !important; 
}/* Day Selector (Alarm Repeat) */
#day-selector-wrap {
  display: flex;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 12px;
  border: 1px solid transparent;
  flex-direction: column;
  gap: 15px;
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  padding: 0 15px;
  transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  margin-top: 0;
  pointer-events: none;
}
#day-selector-wrap.show {
  max-height: 1000px;
  opacity: 1;
  padding: 15px;
  margin-top: 15px;
  border-color: rgba(255, 255, 255, 0.05);
  pointer-events: auto;
}
/* Header Previews */
.memo-dropdown-item.header-1 { font-size: 1.4rem; font-weight: 800; color: #fff; }
.memo-dropdown-item.header-2 { font-size: 1.25rem; font-weight: 700; color: #f1f5f9; }
.memo-dropdown-item.header-3 { font-size: 1.15rem; font-weight: 700; color: #e2e8f0; }
.memo-dropdown-item.header-4 { font-size: 1.05rem; font-weight: 600; color: #cbd5e1; }
.memo-dropdown-item.header-5 { font-size: 0.95rem; font-weight: 600; color: #94a3b8; }
.memo-dropdown-item.header-6 { font-size: 0.85rem; font-weight: 600; color: #64748b; }

@keyframes fadeIn { from { opacity: 0; transform: translateY(-5px); } to { opacity: 1; transform: translateY(0); } }
