/* /ui/modules/task-composer/taskComposer.css */
.mg-composer{
  margin: 0;
  padding: 0;
}
.mg-composer__card{
  background: rgba(255,255,255,0.92);
  border: 1px solid rgba(0,0,0,0.06);
  border-radius: 18px;
    box-shadow: none;
  padding: 10px;
  backdrop-filter: blur(10px);
}
/* ===== Landing "breathing" hero (subtle, premium iOS) ===== */
@keyframes mgComposerBreathe {
  0%   { box-shadow: 0 10px 28px rgba(0,0,0,0.06), 0 0 0 0 rgba(0,122,255,0.00); border-color: rgba(0,0,0,0.06); }
  50%  { box-shadow: 0 14px 34px rgba(0,0,0,0.08), 0 0 0 6px rgba(0,122,255,0.06); border-color: rgba(0,122,255,0.16); }
  100% { box-shadow: 0 10px 28px rgba(0,0,0,0.06), 0 0 0 0 rgba(0,122,255,0.00); border-color: rgba(0,0,0,0.06); }
}

@keyframes mgPlaceholderBreathe {
  0%   { opacity: 0.55; }
  50%  { opacity: 0.78; }
  100% { opacity: 0.55; }
}

/* Hero state only when composer is collapsed/empty */
.mg-composer__card--hero{
  animation: mgComposerBreathe 2.8s ease-in-out infinite;
}

/* Placeholder subtle pulse (only in hero state) */
.mg-composer__card--hero .mg-composer__input::placeholder{
  animation: mgPlaceholderBreathe 2.8s ease-in-out infinite;
}

/* ===== HERO ENTRY (make composer clearly the starting point) ===== */
.mg-composer__card--hero{
  border-color: rgba(0,122,255,0.22);
  box-shadow:
    0 10px 30px rgba(0,0,0,0.06),
    0 0 0 1px rgba(0,122,255,0.10) inset;
  position: relative;
}

.mg-composer__card--hero::after{
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: 18px;
  pointer-events: none;
  box-shadow: 0 0 0 6px rgba(0,122,255,0.06);
  opacity: 0.85;
}

/* iOS-like focus ring when user clicks into the input */
.mg-composer__inputwrap:focus-within{
  background: rgba(255,255,255,0.96);
  border-color: rgba(0,122,255,0.35);
  box-shadow: 0 0 0 4px rgba(0,122,255,0.12);
}

.mg-composer__row{
  display:flex;
  gap:10px;
  align-items:center;
}

.mg-composer__inputwrap{
  flex: 1;
  display:flex;
  align-items:center;
  gap:10px;
  padding: 7px 12px;
  border-radius: 14px;
  border: 1px solid rgba(0,0,0,0.08);
  background: rgba(0,0,0,0.02);
}

.mg-composer__input{
  flex:1;
  border:0;
  outline:none;
  background: transparent;
  font-size: 15px;
}

.mg-composer__mic{
  width: 30px;
  height: 30px;
  border-radius: 10px;
  border: 0;
  cursor:pointer;
  background: rgba(0,0,0,0.06);
}
/* Language label: thin, faded text (no button look) */
.mg-composer__lang{
  height: 34px;            /* để canh thẳng hàng với mic/AI */
  padding: 0 6px;
  border: 0;
  background: transparent; /* ✅ không nền */
  cursor: pointer;

  color: rgba(0,0,0,0.28);
  font-weight: 400;

  font-size: 11px;         /* nhỏ */

  letter-spacing: .4px;
  line-height: 34px;       /* canh giữa theo chiều dọc */
}

.mg-composer__lang:hover{
  color: rgba(0,0,0,0.55);
  text-decoration: underline;
  text-underline-offset: 3px;
}


.mg-composer__add{
  border:0;
  cursor:pointer;
  border-radius: 14px;
  padding: 7px 14px;
  font-weight: 800;
  background: rgba(0,122,255,0.14);
}
.mg-composer__tokens{
  margin-top: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
/* ===== Details smooth reveal (mount animation) ===== */
@keyframes mgComposerDetailsEnter {
  from {
    max-height: 0;
    opacity: 0;
    transform: translateY(-4px);
  }
  to {
    max-height: 600px; /* đủ lớn để chứa badges + chips */
    opacity: 1;
    transform: translateY(0);
  }
}

.mg-composer__details{
  overflow: hidden;
}

.mg-composer__details.is-entering{
  animation: mgComposerDetailsEnter 320ms cubic-bezier(.2,.8,.2,1) both;
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce){
  .mg-composer__card--hero,
  .mg-composer__card--hero .mg-composer__input::placeholder,
  .mg-composer__details.is-entering{
    animation: none !important;
  }
}

.mg-token{
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  border: 1px solid rgba(0,0,0,0.08);
  background: rgba(0,0,0,0.035);
  opacity: 0.85;
}

/* subtle semantic tint (iOS-like) */
.mg-token--tag{ background: rgba(0,122,255,0.10); border-color: rgba(0,122,255,0.18); }
.mg-token--duration{ background: rgba(52,199,89,0.10); border-color: rgba(52,199,89,0.18); }
.mg-token--deadline{ background: rgba(255,149,0,0.10); border-color: rgba(255,149,0,0.18); }
.mg-token--repeat{ background: rgba(175,82,222,0.10); border-color: rgba(175,82,222,0.18); }
.mg-token--priority{ background: rgba(255,59,48,0.10); border-color: rgba(255,59,48,0.18); }
.mg-token--time{ background: rgba(0,0,0,0.04); border-color: rgba(0,0,0,0.10); }

.mg-composer__badges{
  margin-top: 10px;
  display:flex;
  flex-wrap: wrap;
  gap: 8px;

  position: relative;          /* để neo actions */
  padding-right: 120px;        /* chừa chỗ cho Edit/Clear bên phải */
}

.mg-composer__badgeActions{
  position: absolute;
  top: 0;
  right: 0;
  display: flex;
  gap: 8px;
  align-items: center;
}

.mg-composer__actionBtn{
  border: 0;
  background: transparent;
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  padding: 6px 10px;
  border-radius: 10px;
  color: rgba(0,0,0,0.60);
}

.mg-composer__actionBtn:hover{
  background: rgba(0,0,0,0.05);
}


.mg-composer__badges--empty{
  font-size: 12px;
  opacity: 0.55;
  padding: 6px 2px;
}

.mg-badge{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(0,0,0,0.08);
  background: rgba(0,0,0,0.03);
  cursor:pointer;
  user-select:none;
}

.mg-badge__k{
  font-size: 12px;
  opacity: 0.65;
  font-weight: 700;
}

.mg-badge__v{
  font-size: 12px;
  font-weight: 800;
}

.mg-badge__x{
  font-weight: 900;
  opacity: 0.6;
}

.mg-composer__chat{
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(0,0,0,0.06);
}

.mg-chat__q{
  display:flex;
  gap: 10px;
  align-items: baseline;
}

.mg-chat__label{
  font-size: 12px;
  font-weight: 900;
  opacity: 0.55;
}

.mg-chat__text{
  font-size: 13px;
  font-weight: 900;
}
/* validation (red assistant question) */
.mg-chat__q--error .mg-chat__text{
  color: rgba(255, 59, 48, 0.95); /* iOS red-ish */
}

.mg-chat__hint--error{
  color: rgba(255, 59, 48, 0.6);
}

/* make assistant text a bit lighter overall (optional but matches premium) */
.mg-chat__text{
  font-weight: 700;  /* bớt dày */
}

.mg-chat__hint{
  margin-top: 4px;
  font-size: 12px;
  opacity: 0.6;
}

.mg-suggest__row{
  margin-top: 10px;
  display:flex;
  flex-wrap: wrap;
  gap: 8px;
}

.mg-chip{
  border: 1px solid rgba(0,0,0,0.08);
  background: rgba(0,0,0,0.02);
  border-radius: 999px;
  padding: 8px 10px;
  cursor:pointer;
  font-weight: 800;
  font-size: 12px;
}

.mg-chip--on{
  background: rgba(0,122,255,0.16);
  border-color: rgba(0,122,255,0.22);
}

.hidden{ display:none !important; }

.mg-helper{
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  font-size: 13px;
  color: rgba(0,0,0,0.55);
}

.mg-helper__icon{
  opacity: 0.7;
}
.mg-dots{
  display: inline-block;
  width: 1.2em; /* giữ layout không bị giật */
  text-align: left;
}

.mg-dots::after{
  content: '';
  animation: none;
}

.mg-dots.on::after{
  animation: mgTypingDots 1.4s infinite steps(4);
}


@keyframes mgTypingDots{
  0%   { content: ''; }
  25%  { content: '.'; }
  50%  { content: '..'; }
  75%  { content: '...'; }
  100% { content: ''; }
}

/* composer becomes a "header" card (square bottom corners) */
#mg-task-composer-root .mg-composer__card{
  border-bottom-left-radius: 0 !important;
  border-bottom-right-radius: 0 !important;
    box-shadow: none !important;

}

/* ===== HOME GROUP (composer + columns) ===== */

/* 3) bề rộng composer full như timeline (ăn theo same gutter) */
#mg-home-group{
  padding: 0;        /* quan trọng: không cộng thêm gutter */
  margin-top: 0;     /* gap timeline->composer đang do timeline-container quyết định */
}


/* composer không tự padding nữa vì group đã padding */
#mg-home-group .mg-composer{
  padding: 0;
  margin: 0;
}

/* composer card: đáy vuông để dính */
#mg-home-group #mg-task-composer-root .mg-composer__card{
  border-bottom-left-radius: 0 !important;
  border-bottom-right-radius: 0 !important;
  box-shadow: 0 6px 16px rgba(0,0,0,0.04);
    margin-bottom: var(--mg-col-gap);
}

/* HOME: columns directly under composer, only iOS divider + 7px between columns */
#mg-home-group #columns-wrapper{
  margin-top: 0 !important;                 /* không tạo gap giữa composer và columns */
  padding-top: 0 !important;
  border-top: 1px solid var(--ios-sep) !important; /* divider iOS */
  gap: 7px !important;                      /* khoảng cách giữa 2 cột */
}

#mg-task-composer-root{
  margin-bottom: 0 !important;
}

/* ✅ Square only the 2 inner top corners under the composer */
#mg-home-group #left-column{
  border-top-left-radius: 0 !important;   /* góc trên-trái của cột giữa */
}

#mg-home-group #right-column{
  border-top-right-radius: 0 !important;  /* góc trên-phải của cột phải */
}

/* Column wrappers (left/right) */
#mg-home-group #columns-wrapper > *:first-child{
  margin-top: 0 !important; /* spacing is handled by columns-wrapper padding-top */
}
#mg-home-group #columns-wrapper > *:last-child{
  margin-top: 0 !important;
}

/* The actual big cards inside each column wrapper */
/* Square top outer corners for the two column cards (match screenshot) */
#mg-home-group #left-column.column-left{
  border-top-left-radius: 0 !important;
}

#mg-home-group #right-column.column-right{
  border-top-right-radius: 0 !important;
}

:root{
  --ios-sep: rgba(60,60,67,0.12);  /* iOS separator tone */
}

.mg-badge__edit{
  border: 0;
  outline: none;
  padding: 6px 10px;
  border-radius: 10px;
  background: rgba(0,0,0,0.04);
  font-weight: 700;
  min-width: 90px;
}

.mg-badge-pop{
  margin-top: 10px;
  padding: 12px;
  border-radius: 14px;
  border: 1px solid rgba(0,0,0,0.08);
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(10px);
  box-shadow: 0 10px 30px rgba(0,0,0,0.08);
}

.mg-badge-pop__title{
  font-weight: 800;
  margin-bottom: 10px;
}

.mg-badge-pop__grid{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
}

.mg-badge-pop__row{
  display:flex;
  gap:8px;
  margin-top: 10px;
}

.mg-badge-pop__btn{
  border: 1px solid rgba(0,0,0,0.10);
  background: rgba(0,0,0,0.03);
  border-radius: 12px;
  padding: 8px 10px;
  font-weight: 800;
  cursor: pointer;
}

.mg-badge-pop__dt{
  width: 100%;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(0,0,0,0.10);
  background: rgba(0,0,0,0.03);
  font-weight: 700;
}

/* Floating overlay anchored popover */
.mg-badge-pop-overlay{
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: transparent;
}

.mg-badge-pop{
  position: fixed;
  width: 280px;
  padding: 12px;
  border-radius: 14px;
  border: 1px solid rgba(0,0,0,0.10);
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(12px);
  box-shadow: 0 18px 50px rgba(0,0,0,0.12);
}

.mg-badge-pop__title{
  font-weight: 800;
  margin-bottom: 10px;
}

.mg-badge-pop__grid{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
}

.mg-badge-pop__row{
  display:flex;
  gap:8px;
  margin-top: 10px;
}

.mg-badge-pop__btn{
  border: 1px solid rgba(0,0,0,0.12);
  background: rgba(0,0,0,0.04);
  border-radius: 12px;
  padding: 8px 10px;
  font-weight: 800;
  cursor: pointer;
}

.mg-badge-pop__dt{
  width: 100%;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(0,0,0,0.12);
  background: rgba(0,0,0,0.04);
  font-weight: 700;
}

/* ===== Badge popover (anchored) ===== */
.mg-badge__x{
  border: 0;
  background: transparent;
  cursor: pointer;
  font-weight: 900;
  opacity: 0.6;
  padding: 0 2px;
  line-height: 1;
}
.mg-badge__x:hover{ opacity: 0.9; }

.mg-popover{
  position: fixed;
  inset: 0;
  z-index: 9999;
}
.mg-popover.hidden{ display:none !important; }

.mg-popover__backdrop{
  position: absolute;
  inset: 0;
  background: transparent; /* iOS-style: no dim, just click-outside */
}

.mg-popover__panel{
  position: fixed;
  background: rgba(255,255,255,0.98);
  border: 1px solid rgba(0,0,0,0.08);
  border-radius: 14px;
  box-shadow: 0 18px 60px rgba(0,0,0,0.18);
  padding: 10px;
  backdrop-filter: blur(10px);
}

.mg-popover__head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  margin-bottom: 8px;
}
.mg-popover__title{
  font-weight: 900;
  font-size: 13px;
}
.mg-popover__close{
  border:0;
  background: rgba(0,122,255,0.12);
  border-radius: 10px;
  padding: 6px 10px;
  cursor:pointer;
  font-weight: 800;
}

.mg-popover__grid{
  display:flex;
  flex-wrap: wrap;
  gap: 8px;
}
.mg-popover__row{
  display:flex;
  gap: 8px;
  align-items:center;
}
.mg-popover__input{
  flex:1;
  border: 1px solid rgba(0,0,0,0.10);
  border-radius: 12px;
  padding: 8px 10px;
  font-weight: 700;
}
.mg-popover__btn{
  border: 1px solid rgba(0,0,0,0.10);
  background: rgba(0,0,0,0.02);
  border-radius: 12px;
  padding: 8px 10px;
  cursor:pointer;
  font-weight: 800;
}
.mg-popover__hint{
  margin-top: 8px;
  font-size: 12px;
  opacity: 0.6;
}
/* ---------- Badge Popover (premium iOS separator style, lightweight) ---------- */
.mg-badge-popover.hidden{ display:none; }

.mg-badge-popover{
  position: fixed;
  inset: 0;
  z-index: 99999;
}

.mg-badge-popover__backdrop{
  position: absolute;
  inset: 0;
  background: transparent;
}

/* panel is positioned by JS (fixed via left/top) */
.mg-badge-popover__panel{
  position: fixed;
  padding: 12px;
  border-radius: 14px;
  border: 1px solid rgba(60,60,67,0.18);   /* iOS separator-ish */
  background: rgba(255,255,255,0.98);
  box-shadow: 0 12px 36px rgba(0,0,0,0.14);
}

.mg-bp__title{
  font-weight: 900;
  font-size: 13px;
  margin-bottom: 10px;
}

.mg-bp__grid{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
}

.mg-bp__row{
  display:flex;
  gap:8px;
  margin-top: 10px;
}

.mg-bp__btn{
  border: 1px solid rgba(60,60,67,0.18);
  background: rgba(0,0,0,0.03);
  border-radius: 12px;
  padding: 8px 10px;
  font-weight: 800;
  cursor: pointer;
}

.mg-bp__dt{
  width: 100%;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(60,60,67,0.18);
  background: rgba(0,0,0,0.03);
  font-weight: 700;
}

/* ---------- Search popover (overlay, no layout shift) ---------- */
.mg-searchpop{
  position: fixed;
  z-index: 10050;
  pointer-events: auto;
}
/* ✅ AI popover must stay below edit modals (modal is z-index ~9999) */
.mg-aipop{
  z-index: 9500; /* < 9999 so modal is always on top */
}

.mg-searchpop--hidden{
  display: none;
}

.mg-searchpop__panel{
  border-radius: 18px;
  background: rgba(255,255,255,0.92);
  border: 1px solid rgba(60,60,67,0.18);
  box-shadow: 0 18px 60px rgba(0,0,0,0.20);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  overflow: hidden;
}

.mg-searchpop__item{
  padding: 10px 12px 12px;
  border-bottom: 1px solid rgba(60,60,67,0.12);
}

.mg-searchpop__item:last-child{
  border-bottom: 0;
}

.mg-searchpop__meta{
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.22px;
  opacity: 0.55;
  margin-bottom: 4px;
}

.mg-searchpop__title{
  font-size: 14px;
  font-weight: 900;
  line-height: 1.25;
  word-break: break-word;
}
.mg-searchpop__info{
  margin-top: 2px;

  font-size: 11px;
  font-weight: 400;
  line-height: 1.2;

  color: rgba(0,0,0,0.45);   /* xám iOS-style */
  letter-spacing: 0.15px;

  word-break: break-word;
}

/* Done styling (match main list feeling) */
.mg-searchpop__item.is-completed .mg-searchpop__title{
  text-decoration: line-through;
  opacity: 0.55;
}

.mg-searchpop__item.is-completed .mg-searchpop__btn[data-sact="done"]{
  opacity: 0.85;
}

.mg-searchpop__actions{
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.mg-searchpop__btn{
  border: 1px solid rgba(60,60,67,0.18);
  background: rgba(0,0,0,0.04);
  border-radius: 12px;
  padding: 7px 10px;
  font-weight: 900;
  font-size: 12px;
  cursor: pointer;
}

.mg-searchpop__btn:hover{
  background: rgba(0,0,0,0.07);
}

/* ===== Search popover: scroll instead of pushing down ===== */
.mg-searchpop{
  /* Popover is fixed by JS; keep it overlay only */
  overflow: hidden;
}

.mg-searchpop__panel{
  /* The JS sets max-height on .mg-searchpop, so panel must scroll inside */
  max-height: 100%;
  overflow: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}
/* -------- Language popover compact -------- */
.mg-langpop .mg-searchpop__panel{
  /* giữ style premium, nhưng cho scroll mượt */
  overflow-y: auto;
  overflow-x: hidden;
}

.mg-langpop .mg-searchpop__item{
  padding: 6px 10px;          /* ✅ nhỏ hơn nhiều */
  display: flex;              /* ✅ gom 1 hàng */
  align-items: center;
  gap: 8px;
}

.mg-langpop .mg-searchpop__title{
  font-size: 12px;            /* ✅ nhỏ */
  font-weight: 600;           /* ✅ bớt dày */
  line-height: 1.2;
  flex: 1;                    /* ✅ chiếm chỗ */
}

.mg-langpop .mg-searchpop__meta{
  font-size: 10px;            /* ✅ nhỏ */
  font-weight: 600;
  margin: 0;                  /* ✅ bỏ margin-bottom làm cao */
  opacity: 0.55;
}

/* Optional: keep it premium (scrollbar subtle) */
.mg-searchpop__panel::-webkit-scrollbar{
  width: 10px;
}
.mg-searchpop__panel::-webkit-scrollbar-thumb{
  background: rgba(0,0,0,0.12);
  border-radius: 999px;
  border: 3px solid transparent;
  background-clip: content-box;
}

/* AI button (FIX: visible on light background) */
.mg-composer__ai{
  margin-left: 8px;
  height: 34px;
  padding: 0 10px;
  border-radius: 10px;
  border: 1px solid rgba(0,0,0,0.12);
  background: rgba(0,0,0,0.04);
  color: rgba(0,0,0,0.68);
  font-weight: 700;
  cursor: pointer;
}

.mg-composer__ai:hover{
  background: rgba(0,0,0,0.06);
  color: rgba(0,0,0,0.78);
}

.mg-composer__ai.is-on{
  background: rgba(0,122,255,0.16);
  color: rgba(0,122,255,0.95);
  border-color: rgba(0,122,255,0.30);
}


/* ===== Smooth expand animation (runs only during opening window) ===== */
@keyframes mgDetailsIn {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.mg-composer__card--opening .mg-composer__badges,
.mg-composer__card--opening .mg-composer__tokens{
  animation: mgDetailsIn 260ms cubic-bezier(.2,.8,.2,1) both;
}
/* iOS-like focus ring */
.mg-composer__inputwrap:focus-within{
  border-color: rgba(0,122,255,0.35);
  box-shadow: 0 0 0 4px rgba(0,122,255,0.12);
  background: rgba(255,255,255,0.96);
  transition: box-shadow 160ms ease, border-color 160ms ease, background 160ms ease;
}

/* Smooth expand for details (must keep DOM mounted) */
.mg-composer__details{
  margin-top: 10px;
  overflow: hidden;

  max-height: 0;
  opacity: 0;
  transform: translateY(-4px);

  transition:
    max-height 420ms cubic-bezier(0.2, 0.8, 0.2, 1),
    opacity 220ms ease,
    transform 420ms cubic-bezier(0.2, 0.8, 0.2, 1);
  will-change: max-height, opacity, transform;
}

.mg-composer__details.is-open{
  max-height: 700px; /* đủ chứa tokens + badges + suggest */
  opacity: 1;
  transform: translateY(0);
}
/* ===== Composer hero attractor (empty landing) ===== */
.mg-composer__card--hero{
  border-color: rgba(0,122,255,0.22);
  box-shadow:
    0 10px 24px rgba(0,0,0,0.06),
    0 0 0 1px rgba(0,122,255,0.10);
  animation: mgHeroBreath 2.8s ease-in-out infinite;
}

@keyframes mgHeroBreath{
  0%,100%{
    box-shadow:
      0 10px 24px rgba(0,0,0,0.06),
      0 0 0 1px rgba(0,122,255,0.08);
  }
  50%{
    box-shadow:
      0 12px 28px rgba(0,0,0,0.07),
      0 0 0 1px rgba(0,122,255,0.14);
  }
}

@media (prefers-reduced-motion: reduce){
  .mg-composer__card--hero{ animation: none; }
}

/* ===== Smooth open/close for details ===== */
.mg-composer__details{
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  transform: translateY(-2px);
  transition:
    max-height 420ms cubic-bezier(.2,.8,.2,1),
    opacity 220ms ease,
    transform 420ms cubic-bezier(.2,.8,.2,1);
  will-change: max-height, opacity, transform;
}

.mg-composer__details.is-open{
  max-height: 520px; /* đủ cho tokens + suggestions; tăng nếu bạn có nhiều thứ */
  opacity: 1;
  transform: translateY(0);
}

/* ---------- Smooth expand/collapse for details ---------- */
.mg-composer__details{
  overflow: hidden;

  /* closed state */
  max-height: 0;
  opacity: 0;
  transform: translateY(-6px);

  transition:
    max-height 420ms cubic-bezier(.22,.61,.36,1),
    opacity 220ms ease,
    transform 320ms cubic-bezier(.22,.61,.36,1);

  will-change: max-height, opacity, transform;
}

.mg-composer__details.is-open{
  /* open state: set big enough to fit badges + chat */
  max-height: 420px;
  opacity: 1;
  transform: translateY(0);
}

/* optional: when just opened, a tiny “settle” feel */
.mg-composer__details.is-open.is-entering{
  transform: translateY(-2px);
}

@media (prefers-reduced-motion: reduce){
  .mg-composer__details{
    transition: none !important;
  }
}

/* subtle overdue tint in search results */
.mg-searchpop__item.is-overdue {
  background: rgba(255, 59, 48, 0.06);   /* iOS red, very light */
  border: 1px solid rgba(255, 59, 48, 0.14);
}

.mg-searchpop__item.is-overdue .mg-searchpop__meta {
  color: rgba(255, 59, 48, 0.75);
}

.mg-searchpop__item.is-overdue .mg-searchpop__title {
  color: rgba(0, 0, 0, 0.92); /* giữ readable */
}

/* nếu bạn có hover style chung, thêm nhẹ để vẫn premium */
.mg-searchpop__item.is-overdue:hover {
  background: rgba(255, 59, 48, 0.09);
}

/* Khi đang mở modal, cho popover AI xuống dưới + không bắt chuột */
#mgComposerAIPopover.is-behind-modal {
  z-index: 1 !important;
  pointer-events: none !important;
  opacity: 0.98; /* tùy thích, có thể bỏ */
}
