:root{
  --cmp-bg:#f6f8fc;
  --cmp-surface:rgba(255,255,255,.96);
  --cmp-surface-soft:rgba(255,255,255,.88);
  --cmp-line:rgba(15,23,42,.08);
  --cmp-line-strong:rgba(15,23,42,.14);
  --cmp-text:#0f172a;
  --cmp-soft:#475569;
  --cmp-muted:#64748b;
  --cmp-primary:#0f4c81;
  --cmp-primary-2:#2563eb;
  --cmp-accent:#eaf1ff;
  --cmp-gold:#d4af37;
  --cmp-shadow-lg:0 24px 60px rgba(2,6,23,.08);
  --cmp-shadow-md:0 16px 36px rgba(2,6,23,.06);
  --cmp-shadow-sm:0 8px 20px rgba(2,6,23,.05);
}

#ciae-msg-app.cmp-shell{
  width:100%;
  color:var(--cmp-text);
  font-family:Inter,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,sans-serif;
}

.cmp-header{
  display:flex;
  align-items:flex-end;
  justify-content:space-between;
  gap:18px;
  padding:24px;
  border:1px solid rgba(255,255,255,.75);
  border-radius:28px;
  background:linear-gradient(180deg, rgba(255,255,255,.92), rgba(255,255,255,.82));
  box-shadow:var(--cmp-shadow-md);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  margin-bottom:18px;
}

.cmp-header-copy h3{
  margin:0 0 8px;
  font-size:32px;
  line-height:1.05;
  font-weight:800;
  letter-spacing:-.03em;
}

.cmp-header-copy p{
  margin:0;
  max-width:720px;
  color:var(--cmp-soft);
  font-size:15px;
  line-height:1.65;
}

.cmp-chip{
  display:inline-flex;
  align-items:center;
  gap:8px;
  margin-bottom:12px;
  padding:8px 12px;
  border-radius:999px;
  background:#f1f5f9;
  border:1px solid rgba(15,23,42,.06);
  color:var(--cmp-primary);
  font-size:12px;
  font-weight:700;
  letter-spacing:.02em;
  text-transform:uppercase;
}

.cmp-action-btn,
.cmp-btn,
.cmp-mobile-back{
  appearance:none;
  border:none;
  cursor:pointer;
  transition:transform .18s ease, box-shadow .18s ease, background .18s ease, opacity .18s ease;
}

.cmp-action-btn,
.cmp-btn{
  background:linear-gradient(135deg, var(--cmp-primary), var(--cmp-primary-2));
  color:#fff;
  padding:12px 16px;
  border-radius:14px;
  font-size:14px;
  font-weight:700;
  box-shadow:0 14px 30px rgba(37,99,235,.18);
}

.cmp-action-btn:hover,
.cmp-btn:hover,
.cmp-mobile-back:hover{
  transform:translateY(-1px);
}

.cmp-action-btn:disabled,
.cmp-btn:disabled{
  opacity:.65;
  cursor:not-allowed;
  transform:none;
}

.cmp-toolbar{
  display:grid;
  grid-template-columns:minmax(220px,1.2fr) auto auto;
  gap:14px;
  align-items:center;
  padding:16px 18px;
  margin-bottom:18px;
  border-radius:24px;
  background:rgba(255,255,255,.88);
  border:1px solid rgba(255,255,255,.7);
  box-shadow:var(--cmp-shadow-sm);
}

.cmp-search{
  position:relative;
  display:flex;
  align-items:center;
  width:100%;
}

.cmp-search .dashicons{
  position:absolute;
  left:14px;
  color:var(--cmp-muted);
  font-size:18px;
  width:18px;
  height:18px;
}

.cmp-search input{
  width:100%;
  min-height:48px;
  padding:0 16px 0 42px;
  border-radius:16px;
  border:1px solid var(--cmp-line);
  background:#fff;
  outline:none;
  font-size:14px;
  color:var(--cmp-text);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.65);
}

.cmp-search input:focus{
  border-color:rgba(37,99,235,.35);
  box-shadow:0 0 0 4px rgba(37,99,235,.08);
}

.cmp-filters{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
}

.cmp-filter{
  appearance:none;
  border:1px solid transparent;
  background:#eef2f7;
  color:var(--cmp-soft);
  padding:11px 14px;
  border-radius:14px;
  font-size:13px;
  font-weight:700;
  cursor:pointer;
}

.cmp-filter.is-active{
  background:var(--cmp-accent);
  color:var(--cmp-primary);
  border-color:rgba(37,99,235,.18);
  box-shadow:0 8px 18px rgba(37,99,235,.09);
}

.cmp-stats{
  display:flex;
  gap:10px;
  justify-content:flex-end;
  flex-wrap:wrap;
}

.cmp-stat{
  display:inline-flex;
  align-items:center;
  gap:7px;
  padding:10px 12px;
  background:#fff;
  border:1px solid var(--cmp-line);
  border-radius:14px;
  color:var(--cmp-soft);
  font-size:13px;
  white-space:nowrap;
}

.cmp-stat strong{color:var(--cmp-text)}
.cmp-stat-unread strong{color:var(--cmp-primary)}

.cmp-container{
  display:grid;
  grid-template-columns:360px minmax(0,1fr);
  gap:20px;
  align-items:start;
}

.cmp-list-wrap,
.cmp-content-wrap{
  min-width:0;
  background:linear-gradient(180deg, rgba(255,255,255,.94), rgba(255,255,255,.86));
  border:1px solid rgba(255,255,255,.76);
  border-radius:28px;
  box-shadow:var(--cmp-shadow-lg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.cmp-list-wrap{
  position:sticky;
  top:18px;
  padding:14px;
}

.cmp-mobile-list-title{
  display:none;
}

.cmp-list{
  display:flex;
  flex-direction:column;
  gap:10px;
  max-height:72vh;
  overflow:auto;
  padding-right:4px;
  scroll-behavior:smooth;
}

.cmp-list::-webkit-scrollbar{width:10px}
.cmp-list::-webkit-scrollbar-thumb{background:rgba(100,116,139,.18);border-radius:999px;border:2px solid transparent;background-clip:padding-box}

.cmp-item{
  position:relative;
  display:block;
  width:100%;
  padding:16px 18px;
  border-radius:18px;
  background:linear-gradient(180deg, rgba(248,250,252,.92), rgba(255,255,255,.98));
  border:1px solid rgba(15,23,42,.05);
  box-shadow:0 6px 18px rgba(15,23,42,.04);
  cursor:pointer;
  transition:transform .18s ease, box-shadow .18s ease, border-color .18s ease, background .18s ease;
  outline:none;
}

.cmp-item:hover,
.cmp-item:focus-visible{
  transform:translateY(-1px);
  box-shadow:0 12px 26px rgba(15,23,42,.08);
  border-color:rgba(37,99,235,.14);
}

.cmp-item.is-active{
  background:linear-gradient(180deg, #ffffff, #f3f7ff);
  border-color:rgba(15,76,129,.26);
  box-shadow:0 14px 28px rgba(15,76,129,.1);
}

.cmp-item::after{
  content:'›';
  position:absolute;
  right:16px;
  top:50%;
  transform:translateY(-50%);
  font-size:22px;
  line-height:1;
  color:#94a3b8;
  font-weight:700;
}

.cmp-item .badge{
  position:absolute;
  left:10px;
  top:16px;
  width:8px;
  height:8px;
  border-radius:50%;
  background:transparent;
}

.cmp-item.unread .badge{
  background:#ef4444;
  box-shadow:0 0 0 4px rgba(239,68,68,.1);
}

.cmp-item-inner{
  min-width:0;
  padding-right:24px;
}

.cmp-item-title{
  display:block;
  margin:0 0 6px;
  font-size:18px;
  font-weight:800;
  line-height:1.25;
  color:var(--cmp-text);
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

.cmp-item-excerpt{
  display:-webkit-box;
  -webkit-line-clamp:2;
  -webkit-box-orient:vertical;
  overflow:hidden;
  margin:0 0 10px;
  color:var(--cmp-muted);
  font-size:13px;
  line-height:1.55;
}

.cmp-item-meta{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  color:var(--cmp-muted);
  font-size:12px;
}

.cmp-state{
  display:inline-flex;
  align-items:center;
  gap:6px;
  padding:6px 10px;
  border-radius:999px;
  background:#f8fafc;
  border:1px solid rgba(15,23,42,.06);
  font-weight:700;
}

.cmp-item.unread .cmp-state{
  color:#b91c1c;
  background:#fff5f5;
  border-color:rgba(239,68,68,.12);
}

.cmp-empty{
  padding:18px;
  border-radius:18px;
  background:#fff;
  border:1px dashed rgba(15,23,42,.12);
  color:var(--cmp-muted);
  text-align:center;
  margin-top:12px;
}

.cmp-btn{
  width:100%;
  margin-top:12px;
}

.cmp-content-wrap{
  padding:18px;
  min-height:640px;
}

.cmp-content{
  background:linear-gradient(180deg, rgba(255,255,255,.98), rgba(250,252,255,.98));
  border:1px solid rgba(15,23,42,.06);
  border-radius:24px;
  min-height:600px;
  padding:28px;
}

.cmp-content-empty{
  min-height:520px;
  display:flex;
  align-items:center;
  justify-content:center;
  flex-direction:column;
  gap:10px;
  text-align:center;
  color:var(--cmp-muted);
}

.cmp-content-empty-icon{
  font-size:52px;
  line-height:1;
}

.cmp-content-empty h4{
  margin:0;
  color:var(--cmp-text);
  font-size:28px;
  font-weight:800;
}

.cmp-content-empty p{
  margin:0;
  max-width:520px;
  font-size:15px;
  line-height:1.7;
}

.cmp-mobile-back{
  display:none;
}

.cmp-message-head{
  padding-bottom:18px;
  border-bottom:1px solid rgba(15,23,42,.08);
  margin-bottom:22px;
}

.cmp-message-head h2{
  margin:0 0 14px;
  font-size:28px;
  line-height:1.1;
  letter-spacing:-.03em;
  font-weight:800;
  color:#0b1733;
}

.cmp-message-meta{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
}

.cmp-message-meta span{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding:10px 14px;
  border-radius:999px;
  background:#f8fafc;
  border:1px solid rgba(15,23,42,.08);
  color:var(--cmp-muted);
  font-size:13px;
  line-height:1;
}

.cmp-message-body{
  color:#42546e;
  font-size:17px;
  line-height:1.9;
}

.cmp-message-body > :first-child{margin-top:0}
.cmp-message-body img{max-width:100%;height:auto;border-radius:16px}
.cmp-message-body a{color:var(--cmp-primary-2);word-break:break-word}
.cmp-message-body ul,
.cmp-message-body ol{padding-left:1.3em}
