/* ================================================================
   ARANG — Service-specific CSS
   ICDS tokens + ARANG extensions (ar- prefix)
   ================================================================ */

/* ---- ICDS Tokens (inline, tokens.css 참조) ---- */
:root {
  /* Brand Primary (Indigo) */
  --ic-brand-50:  #eef2ff;
  --ic-brand-100: #e0e7ff;
  --ic-brand-200: #c7d2fe;
  --ic-brand-300: #a5b4fc;
  --ic-brand-400: #818cf8;
  --ic-brand-500: #6366f1;
  --ic-brand-600: #4f46e5;
  --ic-brand-700: #4338ca;
  --ic-brand-800: #3730a3;
  --ic-brand-900: #312e81;

  /* Neutral (Slate) */
  --ic-neutral-50:  #f8fafc;
  --ic-neutral-100: #f1f5f9;
  --ic-neutral-200: #e2e8f0;
  --ic-neutral-300: #cbd5e1;
  --ic-neutral-400: #94a3b8;
  --ic-neutral-500: #64748b;
  --ic-neutral-600: #475569;
  --ic-neutral-700: #334155;
  --ic-neutral-800: #1e293b;
  --ic-neutral-900: #0f172a;

  /* Status */
  --ic-success-50:  #f0fdf4;
  --ic-success-500: #22c55e;
  --ic-success-700: #15803d;
  --ic-warning-50:  #fffbeb;
  --ic-warning-500: #f59e0b;
  --ic-warning-700: #b45309;
  --ic-danger-50:  #fef2f2;
  --ic-danger-500: #ef4444;
  --ic-danger-700: #b91c1c;
  --ic-info-50:  #eff6ff;
  --ic-info-500: #3b82f6;
  --ic-info-700: #1d4ed8;

  /* Surface */
  --ic-surface-bg:       #ffffff;
  --ic-surface-raised:   #ffffff;
  --ic-surface-sunken:   #f8fafc;
  --ic-surface-border:   #e2e8f0;
  --ic-surface-border-subtle: #f1f5f9;

  /* Text */
  --ic-text-primary:   #0f172a;
  --ic-text-secondary: #475569;
  --ic-text-tertiary:  #94a3b8;
  --ic-text-inverse:   #ffffff;
  --ic-text-brand:     #4f46e5;

  /* Typography */
  --ic-font-sans: 'IBM Plex Sans KR', 'Apple SD Gothic Neo', 'Malgun Gothic', ui-sans-serif, system-ui, sans-serif;
  --ic-font-display: 'Sora', 'IBM Plex Sans KR', ui-sans-serif, system-ui, sans-serif;
  --ic-font-mono: 'JetBrains Mono', ui-monospace, monospace;
  --ic-text-xs:   0.75rem;
  --ic-text-sm:   0.8125rem;
  --ic-text-base: 0.875rem;
  --ic-text-lg:   1.125rem;
  --ic-text-xl:   1.25rem;
  --ic-text-2xl:  1.5rem;

  /* Spacing */
  --ic-space-1: 0.25rem;
  --ic-space-2: 0.5rem;
  --ic-space-3: 0.75rem;
  --ic-space-4: 1rem;
  --ic-space-5: 1.25rem;
  --ic-space-6: 1.5rem;
  --ic-space-8: 2rem;

  /* Radius */
  --ic-radius-md:   0.375rem;
  --ic-radius-lg:   0.5rem;
  --ic-radius-xl:   0.75rem;
  --ic-radius-2xl:  1rem;
  --ic-radius-full: 9999px;

  /* Shadow */
  --ic-shadow-sm:  0 1px 3px 0 rgba(0,0,0,0.1), 0 1px 2px -1px rgba(0,0,0,0.1);
  --ic-shadow-md:  0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -2px rgba(0,0,0,0.1);
  --ic-shadow-lg:  0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -4px rgba(0,0,0,0.1);

  /* Transition */
  --ic-duration-normal: 150ms;
  --ic-duration-slow:   200ms;
  --ic-easing-default:  cubic-bezier(0.4, 0, 0.2, 1);

  /* Layout */
  --ic-sidebar-width:     260px;
  --ic-sidebar-collapsed: 64px;
  --ic-topbar-height:     56px;

  /* Focus */
  --ic-focus-ring: 0 0 0 2px var(--ic-surface-bg), 0 0 0 4px var(--ic-brand-500);

  /* ---- ARANG Extension Tokens ---- */
  --ar-agent-50:  #ecfeff;
  --ar-agent-100: #cffafe;
  --ar-agent-200: #a5f3fc;
  --ar-agent-400: #22d3ee;
  --ar-agent-500: #06b6d4;
  --ar-agent-600: #0891b2;
  --ar-agent-700: #0e7490;

  --ar-collab-50:  #f5f3ff;
  --ar-collab-500: #8b5cf6;
  --ar-auto-50:  #ecfdf5;
  --ar-auto-500: #10b981;

  /* Thread (Indigo) — 스레드 대표 색상 */
  --ar-thread-50:  #eef2ff;
  --ar-thread-100: #e0e7ff;
  --ar-thread-200: #c7d2fe;
  --ar-thread-400: #818cf8;
  --ar-thread-500: #6366f1;
  --ar-thread-600: #4f46e5;
  --ar-thread-700: #4338ca;
  /* 시맨틱 별칭 — CSS 전역에서 사용 */
  --ar-thread-color:       var(--ar-thread-500);  /* 보더, 배경 틴트, 마커 — WCAG AA 4.5:1 */
  --ar-thread-color-light: var(--ar-thread-400);  /* 보조 보더, 아이콘 */
  --ar-thread-color-dark:  var(--ar-thread-600);  /* 텍스트, 뱃지 — WCAG AA 6.0:1 */

  /* ---- Agent Activity Colors (WCAG AA ≥4.5:1 on white bg) ---- */
  --ar-activity-thinking:  #4338ca; /* indigo-700  4.8:1 */
  --ar-activity-reading:   #1d4ed8; /* blue-700    5.0:1 */
  --ar-activity-editing:   #c2410c; /* orange-700  5.4:1 */
  --ar-activity-running:   #15803d; /* green-700   5.8:1 */
  --ar-activity-searching: #0e7490; /* cyan-700    5.6:1 */
  --ar-activity-reviewing: #92400e; /* amber-800   6.3:1 */
  --ar-activity-waiting:   #475569; /* slate-600   5.9:1 */
  --ar-activity-writing:   #6d28d9; /* violet-700  5.1:1 */
}

html,
body {
  height: 100%;
}

/* ================================================================
   Avatar with Status Indicator
   ================================================================ */
.ar-avatar-wrap {
  position: relative;
  display: inline-flex;
}
.ar-avatar-status {
  position: absolute;
  right: -2px;
  bottom: -1px;
}

/* ================================================================
   Agent Status Badges
   ================================================================ */
.ar-status-dot {
  width: 8px;
  height: 8px;
  border-radius: var(--ic-radius-full);
  display: inline-block;
  flex-shrink: 0;
}
.ar-status-dot--online {
  background: var(--ic-success-500);
  box-shadow: 0 0 6px rgba(34, 197, 94, 0.5);
  animation: ar-pulse 2s ease-in-out infinite;
}
.ar-status-dot--offline {
  background: var(--ic-neutral-400);
}
.ar-status-dot--busy {
  background: var(--ic-warning-500);
  box-shadow: 0 0 4px rgba(245, 158, 11, 0.4);
  animation: ar-pulse 2s ease-in-out infinite;
}
.ar-status-dot--sleeping {
  background: #0ea5e9;
  box-shadow: 0 0 4px rgba(14, 165, 233, 0.35);
}
.ar-status-dot--error {
  background: var(--ic-danger-500);
  box-shadow: 0 0 6px rgba(239, 68, 68, 0.5);
}

/* 에이전트 업그레이드 필요 배지 */
.ar-upgrade-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  margin-top: 0.375rem;
  padding: 0.25rem 0.625rem;
  border-radius: 0.375rem;
  background: #fef3c7;
  border: 1px solid #f59e0b;
  font-size: 0.75rem;
  line-height: 1.25rem;
  color: #92400e;
}
.ar-upgrade-badge__icon { font-size: 0.875rem; }
.ar-upgrade-badge__label { font-weight: 600; }
.ar-upgrade-badge__detail { color: #b45309; }
.ar-upgrade-badge--inline {
  display: inline-flex;
  margin-top: 0;
  padding: 0.125rem 0.5rem;
  font-size: 0.6875rem;
  vertical-align: middle;
}

@keyframes ar-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.45; }
}
/* 비활성 카드에서 pulse 없이 정적 표시 */
.ar-status-dot--static { animation: none !important; }

/* ================================================================
   Agent Card
   ================================================================ */
.ar-agent-card {
  background: var(--ic-surface-raised);
  border: 1px solid var(--ic-surface-border);
  border-radius: var(--ic-radius-xl);
  padding: var(--ic-space-5);
  transition: border-color var(--ic-duration-normal) var(--ic-easing-default),
              box-shadow var(--ic-duration-normal) var(--ic-easing-default);
}
.ar-agent-card:hover {
  border-color: var(--ar-agent-400);
  box-shadow: var(--ic-shadow-md);
}
.ar-agent-card__avatar {
  width: 40px;
  height: 40px;
  border-radius: var(--ic-radius-lg);
  background: var(--ar-agent-100);
  color: var(--ar-agent-700);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: var(--ic-text-sm);
  flex-shrink: 0;
  overflow: hidden;
  position: relative;
  line-height: 1;
}

.ar-agent-card__avatar img,
.ar-dm-avatar img,
.ar-dm-avatar-xs img,
.ar-msg-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* ================================================================
   Task Card — Keyframe Animations
   ================================================================ */
@keyframes card-enter {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes status-flash {
  0%   { background-color: rgba(99, 102, 241, 0.15); }
  100% { background-color: transparent; }
}
@keyframes pulse-bar {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.5; }
}
@keyframes blocked-pulse {
  0%, 100% { border-left-color: #ef4444; }
  50%       { border-left-color: rgba(239, 68, 68, 0.4); }
}

/* ================================================================
   Task Card (Kanban)
   ================================================================ */
.ar-task-card {
  background: var(--ic-surface-raised);
  border: 1px solid var(--ic-surface-border);
  border-radius: var(--ic-radius-lg);
  padding: var(--ic-space-3) var(--ic-space-4);
  border-left: 4px solid var(--ic-neutral-300);
  cursor: grab;
  animation: card-enter 0.25s ease-out both;
  transition: box-shadow var(--ic-duration-normal) var(--ic-easing-default),
              transform var(--ic-duration-normal) var(--ic-easing-default),
              opacity 0.2s ease, filter 0.2s ease;
}
.ar-task-card:hover {
  box-shadow: var(--ic-shadow-md);
}
.ar-task-card.dragging {
  box-shadow: var(--ic-shadow-lg);
  transform: rotate(2deg);
  opacity: 0.9;
}
.ar-task-card--critical { border-left-color: #ef4444; }
.ar-task-card--high     { border-left-color: #f97316; }
.ar-task-card--medium   { border-left-color: #6366f1; }
.ar-task-card--low      { border-left-color: #94a3b8; }
.ar-task-card--none     { border-left-color: transparent; }

/* in_progress: card-enter 후 pulse 루프 */
.ar-task-card--in-progress-pulse {
  animation: card-enter 0.25s ease-out both,
             pulse-bar 1.8s 0.3s ease-in-out infinite;
}

/* blocked: card-enter 후 빨간 보더 pulse */
.ar-task-card--blocked {
  background: rgba(239, 68, 68, 0.04);
  animation: card-enter 0.25s ease-out both,
             blocked-pulse 2s 0.3s ease-in-out infinite;
}

/* done: 완료 처리됨 표시 (애니메이션 그대로, opacity만 낮춤) */
.ar-task-card--done-style {
  opacity: 0.6;
  filter: grayscale(25%);
  transition: opacity 0.3s ease, filter 0.3s ease;
}

/* 상태 변경 flash (ActionCable 업데이트 후 JS로 잠깐 추가) */
.ar-task-card--status-flash {
  animation: card-enter 0.25s ease-out both, status-flash 0.8s 0.1s ease-out both;
}

/* Blocked badge */
.ar-task-blocked-badge {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  font-size: 0.62rem;
  font-weight: 600;
  color: #ef4444;
  background: #fee2e2;
  border-radius: 4px;
  padding: 2px 5px;
  white-space: nowrap;
  flex-shrink: 0;
}

/* Kanban column progress bar */
.ar-kanban-progress {
  height: 3px;
  background: rgba(0, 0, 0, 0.06);
  border-radius: 99px;
  overflow: hidden;
  margin-bottom: 0.75rem;
}
.ar-kanban-progress__fill {
  height: 100%;
  border-radius: 99px;
  transition: width 0.5s ease;
}

/* Task card assignee avatar */
.ar-task-avatar {
  width: 20px;
  height: 20px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 8px;
  font-weight: 700;
  flex-shrink: 0;
}

/* Kanban Column */
.ar-kanban-column {
  min-height: 200px;
  background: var(--ic-surface-sunken);
  border-radius: var(--ic-radius-xl);
  padding: var(--ic-space-3);
}
.ar-kanban-column.drag-over {
  background: var(--ic-brand-50);
  border: 2px dashed var(--ic-brand-200);
}

/* ================================================================
   Chat Bubbles
   ================================================================ */
.ar-message-row {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.4rem 0.1rem;
}
.ar-message-text {
  font-size: 0.94rem;
  line-height: 1.65;
  color: var(--ic-neutral-800);
  letter-spacing: -0.006em;
  word-break: break-word;
}
.ar-message-text strong {
  font-weight: 700;
  color: var(--ic-neutral-900);
}
.ar-message-text em {
  font-style: italic;
  color: var(--ic-neutral-700);
}
.ar-message-text del {
  text-decoration: line-through;
  color: var(--ic-neutral-400);
}
.ar-message-text p {
  margin: 0;
}
.ar-message-text p + p {
  margin-top: 0.45rem;
}
.ar-chat-system {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-align: center;
  font-size: 0.72rem;
  color: var(--ic-text-tertiary);
  letter-spacing: 0.01em;
}
.ar-chat-system::before,
.ar-chat-system::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--ic-neutral-200);
}
.ar-chat-system > span,
.ar-chat-system:not(:has(span)) {
  flex-shrink: 0;
  padding: 0.2rem 0.65rem;
  background: var(--ic-neutral-100);
  border-radius: var(--ic-radius-full);
  white-space: nowrap;
  max-width: 80%;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ar-chat-bubble {
  max-width: 75%;
  padding: var(--ic-space-3) var(--ic-space-4);
  border-radius: var(--ic-radius-xl);
  font-size: var(--ic-text-base);
  line-height: 1.5;
  word-break: break-word;
}
.ar-chat-bubble--human {
  background: var(--ic-brand-50);
  margin-left: auto;
  border-bottom-right-radius: var(--ic-radius-md);
}
.ar-chat-bubble--other {
  background: var(--ic-surface-sunken);
  border-bottom-left-radius: var(--ic-radius-md);
}
.ar-chat-bubble--agent {
  background: var(--ar-agent-50);
  border-left: 3px solid var(--ar-agent-500);
  border-bottom-left-radius: var(--ic-radius-md);
}
.ar-chat-bubble--system {
  background: var(--ic-neutral-100);
  max-width: 100%;
  text-align: center;
  font-size: var(--ic-text-xs);
  color: var(--ic-text-tertiary);
  border-radius: var(--ic-radius-full);
  padding: var(--ic-space-1) var(--ic-space-4);
}

/* ================================================================
   Stat Widget
   ================================================================ */
.ar-stat-widget {
  background: var(--ic-surface-raised);
  border: 1px solid var(--ic-surface-border);
  border-radius: var(--ic-radius-xl);
  padding: var(--ic-space-5);
}
.ar-stat-widget__value {
  font-size: var(--ic-text-2xl);
  font-weight: 700;
  color: var(--ic-text-primary);
}
.ar-stat-widget__label {
  font-size: var(--ic-text-sm);
  color: var(--ic-text-secondary);
  margin-bottom: var(--ic-space-1);
}
.ar-stat-widget__change {
  font-size: var(--ic-text-xs);
  font-weight: 500;
}
.ar-stat-widget__change--up { color: var(--ic-success-500); }
.ar-stat-widget__change--down { color: var(--ic-danger-500); }
/* ================================================================
   Progress Bar
   ================================================================ */
.ar-progress {
  height: 6px;
  background: var(--ic-surface-sunken);
  border-radius: var(--ic-radius-full);
  overflow: hidden;
}
.ar-progress__bar {
  height: 100%;
  background: var(--ic-brand-500);
  border-radius: var(--ic-radius-full);
  transition: width var(--ic-duration-slow) var(--ic-easing-default);
}
.ar-progress__bar--success { background: var(--ic-success-500); }
.ar-progress__bar--danger  { background: var(--ic-danger-500); }

/* ================================================================
   Timeline (Activity Log)
   ================================================================ */
.ar-timeline {
  position: relative;
  padding-left: var(--ic-space-8);
}
.ar-timeline::before {
  content: '';
  position: absolute;
  left: 15px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--ic-surface-border);
}
.ar-timeline__item {
  position: relative;
  padding-bottom: var(--ic-space-5);
}
.ar-timeline__dot {
  position: absolute;
  left: calc(-1 * var(--ic-space-8) + 8px);
  top: 4px;
  width: 16px;
  height: 16px;
  border-radius: var(--ic-radius-full);
  background: var(--ic-surface-raised);
  border: 2px solid var(--ic-brand-500);
  z-index: 1;
}
.ar-timeline__dot--agent { border-color: var(--ar-agent-500); }
.ar-timeline__dot--system { border-color: var(--ic-neutral-400); }

/* ---- Pagy Pagination ---- */
.pagy {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
}
.pagy a, .pagy span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2rem;
  height: 2rem;
  padding: 0 0.5rem;
  border-radius: 0.5rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--ic-text-secondary);
  text-decoration: none;
  transition: background 80ms ease, color 80ms ease;
}
.pagy a:hover {
  background: var(--ic-surface-sunken);
  color: var(--ic-text-primary);
}
.pagy span[aria-current="page"] {
  background: var(--ic-brand-600);
  color: #fff;
  font-weight: 600;
}
.pagy a[aria-disabled="true"],
.pagy a.disabled {
  opacity: 0.35;
  pointer-events: none;
}

/* ================================================================
   Sidebar Navigation
   ================================================================ */
.ar-sidebar {
  width: var(--ic-sidebar-width);
  height: 100vh;
  position: fixed;
  top: 0;
  left: 0;
  background: var(--ic-surface-raised);
  border-right: 1px solid var(--ic-surface-border);
  display: flex;
  flex-direction: column;
  z-index: 30;
  transition: width var(--ic-duration-slow) var(--ic-easing-default),
              transform var(--ic-duration-slow) var(--ic-easing-default);
}
.ar-sidebar__logo {
  padding: var(--ic-space-5);
  border-bottom: 1px solid var(--ic-surface-border-subtle);
  display: flex;
  align-items: center;
  gap: var(--ic-space-3);
}
.ar-sidebar__brand {
  display: flex;
  align-items: center;
  text-decoration: none;
  color: inherit;
}
.ar-sidebar__nav {
  flex: 1;
  padding: var(--ic-space-3);
  overflow-y: auto;
}
.ar-workspace-switcher {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
  padding: 0.8rem 0.9rem;
  border: 1px solid var(--ic-surface-border);
  border-radius: 1rem;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.96) 0%, rgba(248,250,252,0.96) 100%);
  box-shadow: 0 8px 24px -20px rgba(15, 23, 42, 0.45);
  transition: border-color var(--ic-duration-normal), box-shadow var(--ic-duration-normal), transform var(--ic-duration-normal);
  text-decoration: none;
  color: inherit;
  margin-bottom: var(--ic-space-4);
}
.ar-workspace-switcher:hover {
  border-color: var(--ic-brand-200);
  box-shadow: 0 16px 32px -24px rgba(79, 70, 229, 0.5);
  transform: translateY(-1px);
}
.ar-workspace-switcher__avatar,
.ar-workspace-switcher__item-avatar {
  width: 2.2rem;
  height: 2.2rem;
  border-radius: 0.8rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.78rem;
  font-weight: 700;
  flex-shrink: 0;
  color: var(--ic-text-inverse);
  background:
    linear-gradient(135deg, var(--ic-brand-500) 0%, var(--ar-agent-500) 100%);
}
.ar-workspace-switcher__label {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ic-text-tertiary);
}
.ar-workspace-switcher__name {
  margin-top: 0.1rem;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--ic-text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ar-workspace-switcher__meta {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-shrink: 0;
}
.ar-workspace-switcher__badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0.15rem 0.45rem;
  background: var(--ic-neutral-100);
  color: var(--ic-text-secondary);
  font-size: 0.62rem;
  font-weight: 700;
}
.ar-workspace-switcher__badge--default {
  background: var(--ic-brand-50);
  color: var(--ic-brand-700);
}
.ar-workspace-switcher__chevron {
  color: var(--ic-text-tertiary);
}
.ar-workspace-switcher__item {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.8rem 0.9rem;
  border: 1px solid transparent;
  border-radius: 1rem;
  text-decoration: none;
  color: inherit;
  transition: background var(--ic-duration-normal), border-color var(--ic-duration-normal), box-shadow var(--ic-duration-normal);
}
.ar-workspace-switcher__item:hover {
  border-color: var(--ic-brand-200);
  background: var(--ic-surface-sunken);
}
.ar-workspace-switcher__item.is-current {
  border-color: var(--ic-brand-300);
  background: linear-gradient(90deg, rgba(79,70,229,0.08) 0%, rgba(34,211,238,0.03) 100%);
  box-shadow: inset 0 0 0 1px rgba(99, 102, 241, 0.08);
}
.ar-workspace-switcher__item-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ic-text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ar-workspace-switcher__item-subtitle {
  margin-top: 0.1rem;
  font-size: 0.7rem;
  color: var(--ic-text-tertiary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ar-workspace-switcher__current {
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--ic-brand-600);
}
.ar-sidebar__section-label {
  margin: 0.2rem 0 0.45rem;
  padding: 0 0.25rem;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ic-text-tertiary);
}
.ar-sidebar__section-label--spaced {
  margin-top: 1rem;
}
.ar-sidebar__nav-item {
  display: flex;
  align-items: center;
  gap: var(--ic-space-3);
  padding: var(--ic-space-2) var(--ic-space-3);
  border-radius: var(--ic-radius-lg);
  color: var(--ic-text-secondary);
  font-size: var(--ic-text-sm);
  font-weight: 500;
  text-decoration: none;
  transition: background var(--ic-duration-normal), color var(--ic-duration-normal);
}
.ar-sidebar__nav-item:hover {
  background: var(--ic-surface-sunken);
  color: var(--ic-text-primary);
}
.ar-sidebar__nav-item.active {
  background: var(--ic-brand-50);
  color: var(--ic-brand-600);
}
.ar-sidebar__warn-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ic-danger-500);
  box-shadow: 0 0 5px rgba(239, 68, 68, 0.5);
  margin-left: auto;
  flex-shrink: 0;
}
.ar-sidebar__footer {
  padding: var(--ic-space-3);
  border-top: 1px solid var(--ic-surface-border-subtle);
}

/* Main content offset */
.ar-main {
  margin-left: var(--ic-sidebar-width);
  min-height: 100vh;
  background: var(--ic-surface-sunken);
}

.ar-main--chat {
  display: flex;
  flex-direction: column;
  height: 100dvh;
  min-height: 100dvh;
  overflow: hidden;
}

.ar-main--chat > div {
  flex: 1;
  min-height: 0;
}

/* ================================================================
   Responsive
   ================================================================ */
@media (max-width: 1024px) {
  /* 사이드바: 기본 숨김, 토글 시 슬라이드인 */
  .ar-sidebar {
    transform: translateX(-100%);
    z-index: 35;
  }
  .ar-sidebar.is-open {
    transform: translateX(0);
  }
  /* 햄버거 버튼(fixed top-3 left-3) 공간 확보 */
  .ar-content-wrap {
    padding-top: 3.5rem;
  }
  /* 채팅 헤더가 햄버거와 겹치지 않도록 */
  .ar-chat-header {
    padding-left: 3.5rem;
  }
}

@media (max-width: 768px) {
  /* 채널 레이아웃: 태스크 패널이 채팅을 밀지 않고 위에 오버레이 */
  .ar-channel-layout {
    position: relative;
  }
  .ar-task-panel.is-open {
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    z-index: 10;
    width: min(300px, 88vw);
    min-width: min(300px, 88vw);
    box-shadow: -4px 0 24px rgba(0, 0, 0, 0.14);
  }
  /* 태블릿 이하: 에이전트 활동 텍스트를 점 표시로 축약 */
  .ar-chat-header__agents .ar-agent-activity {
    display: none;
  }
  .ar-chat-header__subtitle {
    display: none;
  }
}

@media (max-width: 640px) {
  /* 콘텐츠 패딩 축소 */
  .ar-content-wrap {
    padding-left: 1rem;
    padding-right: 1rem;
    padding-bottom: 1.5rem;
  }
  /* 채팅 헤더 내 액션 버튼 텍스트 숨김 — 아이콘만 */
  .ar-chat-header .ar-button--compact span:not(.ar-badge-count) {
    display: none;
  }
  .ar-chat-header .ar-button--compact {
    padding-left: 0.5rem;
    padding-right: 0.5rem;
  }
  /* 모달: 하단 시트 스타일 */
  .ar-modal-center {
    align-items: flex-end;
    padding: 0;
  }
  .ar-modal-panel,
  .ar-modal-panel--xs,
  .ar-modal-panel--sm,
  .ar-modal-panel--sm-r,
  .ar-modal-panel--md,
  .ar-modal-panel--md2,
  .ar-modal-panel--lg,
  .ar-modal-panel--xl {
    width: 100vw;
    max-width: 100vw;
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
    border-top-left-radius: 16px;
    border-top-right-radius: 16px;
    max-height: 92dvh;
    overflow-y: auto;
  }
  /* 인증 페이지: 하단 시트 스타일 */
  .ar-auth {
    align-items: flex-end;
  }
  .ar-auth__card {
    padding: var(--ic-space-6);
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
    width: 100%;
    max-width: 100%;
  }
  /* 스탯 위젯 레이블 글자 크기 */
  .ar-stat-widget__label {
    font-size: 0.7rem;
  }
  /* 테이블 overflow 방지 */
  .ar-data-table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
}

/* ================================================================
   Flash Messages
   ================================================================ */
.ar-flash {
  padding: var(--ic-space-3) var(--ic-space-4);
  border-radius: var(--ic-radius-lg);
  font-size: var(--ic-text-sm);
  margin-bottom: var(--ic-space-4);
  display: flex;
  align-items: center;
  gap: var(--ic-space-2);
}
.ar-flash--notice {
  background: var(--ic-success-50);
  color: var(--ic-success-700);
  border: 1px solid #bbf7d0;
}
.ar-flash--alert {
  background: var(--ic-danger-50);
  color: var(--ic-danger-700);
  border: 1px solid #fecaca;
}
.ar-flash--warning {
  background: var(--ic-warning-50);
  color: var(--ic-warning-700);
  border: 1px solid #fde68a;
}

/* ================================================================
   Auth Pages
   ================================================================ */
.ar-auth {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--ic-brand-50) 0%, var(--ic-surface-bg) 50%, var(--ar-agent-50) 100%);
}
.ar-login {
  min-height: 100svh;
  display: grid;
  /* 초광폭 대응: 각 컬럼 상한 설정 → 최대 합계 ~1560px, 이후 배경만 늘어남 */
  grid-template-columns:
    minmax(0, clamp(400px, 56vw, 900px))
    minmax(420px, clamp(420px, 44vw, 660px));
  align-items: stretch;
  justify-content: center;
  background:
    radial-gradient(circle at 16% 18%, rgba(20, 184, 166, 0.12), transparent 31%),
    linear-gradient(135deg, #f8fafc 0%, #eef2ff 48%, #ecfeff 100%);
  color: #0f172a;
}
.ar-login,
.ar-login * {
  box-sizing: border-box;
}
.ar-login__showcase {
  position: relative;
  display: flex;
  min-width: 0;
  min-height: 100svh;
  flex-direction: column;
  justify-content: flex-start;
  padding: clamp(2rem, 5vw, 4.5rem);
  overflow: hidden;
}
.ar-login__showcase::before {
  content: "";
  position: absolute;
  inset: 6% 8% auto auto;
  width: min(42%, 380px);  /* 초광폭에서 데코 사각형 상한 */
  aspect-ratio: 1;
  background:
    linear-gradient(135deg, rgba(79, 70, 229, 0.08), rgba(14, 165, 233, 0.06)),
    radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.6), transparent 58%);
  border-radius: 32px;
  transform: rotate(8deg);
  opacity: 0.35;
}
.ar-login-brand,
.ar-login-copy,
.ar-login-preview {
  position: relative;
  z-index: 1;
}
.ar-login-brand {
  display: inline-flex;
  align-items: center;
  width: fit-content;
}
.ar-login-brand__link {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}
.ar-login-brand__logo {
  display: block;
  width: clamp(140px, 12vw, 180px);
  height: auto;
}
.ar-login-brand__mark {
  display: inline-flex;
  width: 42px;
  height: 42px;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  color: #ffffff;
  font-weight: 900;
  background: linear-gradient(135deg, #4f46e5, #06b6d4);
  box-shadow: 0 16px 38px rgba(37, 99, 235, 0.22);
}
.ar-login-brand__name {
  font-size: 1.05rem;
  font-weight: 900;
  letter-spacing: 0;
}
.ar-login-copy {
  max-width: 640px;
  margin-top: clamp(3rem, 9vh, 6.5rem);
}
.ar-login-copy__eyebrow {
  margin: 0 0 0.875rem;
  color: #2563eb;
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}
.ar-login-copy h1 {
  max-width: 11em;
  margin: 0;
  color: #0f172a;
  font-size: clamp(2.4rem, 5vw, 4.85rem);
  line-height: 0.98;
  letter-spacing: 0;
  word-break: keep-all;
  overflow-wrap: break-word;
}
.ar-login-copy p:not(.ar-login-copy__eyebrow) {
  max-width: 34rem;
  margin: 1.25rem 0 0;
  color: #475569;
  font-size: clamp(1rem, 1.45vw, 1.18rem);
  line-height: 1.7;
}
.ar-login-preview {
  width: min(100%, 620px);
  margin-top: clamp(2rem, 5vh, 3rem);
  border: 1px solid rgba(148, 163, 184, 0.34);
  border-radius: 26px;
  background: rgba(255, 255, 255, 0.76);
  box-shadow: 0 24px 80px rgba(15, 23, 42, 0.14);
  backdrop-filter: blur(18px);
  overflow: hidden;
}
/* 실제 스크린샷 변형 */
.ar-login-preview--screenshot {
  background: transparent;
  border: none;
  box-shadow: 0 24px 80px rgba(15, 23, 42, 0.18);
  border-radius: 14px;
}
.ar-login-preview__img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, 0.2);
}
.ar-login-preview__topbar {
  display: flex;
  gap: 7px;
  padding: 16px 18px;
  border-bottom: 1px solid rgba(226, 232, 240, 0.82);
}
.ar-login-preview__topbar span {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: #cbd5e1;
}
.ar-login-preview__topbar span:nth-child(1) {
  background: #fb7185;
}
.ar-login-preview__topbar span:nth-child(2) {
  background: #facc15;
}
.ar-login-preview__topbar span:nth-child(3) {
  background: #22c55e;
}
.ar-login-preview__grid {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  min-height: 260px;
}
.ar-login-preview__rail {
  display: flex;
  flex-direction: column;
  gap: 14px;
  align-items: center;
  padding: 24px 0;
  border-right: 1px solid rgba(226, 232, 240, 0.82);
  background: rgba(248, 250, 252, 0.8);
}
.ar-login-preview__rail span {
  width: 34px;
  height: 34px;
  border-radius: 12px;
  background: #e2e8f0;
}
.ar-login-preview__rail .is-active {
  background: linear-gradient(135deg, #4f46e5, #06b6d4);
}
.ar-login-preview__main {
  display: grid;
  gap: 16px;
  align-content: center;
  padding: 24px;
}
.ar-login-preview__row,
.ar-login-preview__agent,
.ar-login-preview__task {
  border: 1px solid rgba(226, 232, 240, 0.92);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.88);
}
.ar-login-preview__row {
  display: flex;
  gap: 14px;
  align-items: center;
  padding: 16px;
}
.ar-login-preview__avatar {
  display: inline-flex;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  color: #ffffff;
  font-weight: 900;
  background: linear-gradient(135deg, #0ea5e9, #10b981);
}
.ar-login-preview__row strong,
.ar-login-preview__task strong {
  display: block;
  color: #0f172a;
  font-weight: 900;
}
.ar-login-preview__row p,
.ar-login-preview__agent p {
  margin: 4px 0 0;
  color: #64748b;
  font-size: 0.88rem;
  line-height: 1.45;
}
.ar-login-preview__task {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 18px;
}
.ar-login-preview__task span {
  color: #475569;
  font-size: 0.82rem;
  font-weight: 800;
}
.ar-login-preview__task strong {
  font-size: 1.7rem;
}
.ar-login-preview__agent {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 15px 18px;
}
.ar-login-preview__agent span {
  width: 11px;
  height: 11px;
  flex: 0 0 auto;
  border-radius: 999px;
  background: #22c55e;
  box-shadow: 0 0 0 6px rgba(34, 197, 94, 0.14);
}
.ar-login__panel {
  display: flex;
  min-width: 0;
  min-height: 100svh;
  align-items: center;
  justify-content: center;
  padding: clamp(1.5rem, 4vw, 4rem);
  background: rgba(255, 255, 255, 0.6);
  border-left: 1px solid rgba(203, 213, 225, 0.55);
  backdrop-filter: blur(18px);
}
.ar-login-card {
  width: min(100%, 430px);
}
.ar-login-card__header {
  margin-bottom: 2rem;
}
.ar-login-card h2 {
  margin: 0;
  color: #0f172a;
  font-size: clamp(2rem, 4vw, 2.75rem);
  line-height: 1.05;
  letter-spacing: 0;
}
.ar-login-card__header p,
.ar-login-card__footer {
  color: #64748b;
}
.ar-login-card__header p {
  margin: 0.75rem 0 0;
  font-size: 0.98rem;
}
.ar-login-card__alert {
  margin-bottom: 1rem;
}
.ar-login-form {
  display: grid;
  gap: 1rem;
}
.ar-login-field {
  display: grid;
  gap: 0.5rem;
}
.ar-login-field label {
  color: #334155;
  font-size: 0.86rem;
  font-weight: 850;
}
/* ar-login-field__labelrow, ar-login-forgot: 제거됨 — footer 패턴으로 통합 */
.ar-login-card__footer--secondary {
  margin-top: 0.5rem;
}
.ar-login-field__hint {
  margin: 0;
  font-size: 0.79rem;
  color: #94a3b8;
  line-height: 1.4;
}
.ar-login-field__control {
  position: relative;
}
.ar-login-field__icon {
  position: absolute;
  top: 50%;
  left: 1rem;
  display: inline-flex;
  width: 20px;
  height: 20px;
  align-items: center;
  justify-content: center;
  color: #94a3b8;
  pointer-events: none;
  transform: translateY(-50%);
  transition: color 0.16s ease;
}
.ar-login-field__icon svg {
  display: block;
  width: 18px;
  height: 18px;
}
.ar-login-field__control:focus-within .ar-login-field__icon {
  color: #4f46e5;
}
.ar-login-input {
  width: 100%;
  height: 52px;
  padding: 0 1rem;
  border: 1px solid #cbd5e1;
  border-radius: 14px;
  color: #0f172a;
  background: rgba(255, 255, 255, 0.88);
  font-size: 1rem;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}
.ar-login-field__control .ar-login-input {
  padding-left: 3rem;
}
.ar-login-input::placeholder {
  color: #94a3b8;
}
.ar-login-input:focus {
  outline: none;
  border-color: #4f46e5;
  background: #ffffff;
  box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.13);
}
.ar-login-submit {
  display: inline-flex;
  width: 100%;
  height: 54px;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  margin-top: 0.25rem;
  border: 0;
  border-radius: 15px;
  color: #ffffff;
  background: linear-gradient(135deg, #4f46e5, #0891b2);
  box-shadow: 0 16px 32px rgba(37, 99, 235, 0.22);
  font-weight: 900;
  cursor: pointer;
  transition: transform 0.16s ease, box-shadow 0.16s ease, filter 0.16s ease;
}
.ar-login-submit svg {
  width: 18px;
  height: 18px;
}
.ar-login-submit:hover {
  filter: brightness(1.04);
  box-shadow: 0 20px 42px rgba(37, 99, 235, 0.28);
  transform: translateY(-1px);
}
.ar-login-submit:focus-visible {
  outline: 3px solid rgba(79, 70, 229, 0.28);
  outline-offset: 3px;
}
.ar-login-card__footer {
  margin: 1.5rem 0 0;
  font-size: 0.92rem;
  text-align: center;
}
.ar-login-card__footer a {
  color: #1d4ed8;
  font-weight: 900;
  text-decoration: none;
}
.ar-login-card__footer a:hover {
  text-decoration: underline;
}
/* button_to 기반 footer 링크 (예: 2FA verify → 로그인으로 돌아가기) */
.ar-login-card__footer-form {
  display: flex;
  justify-content: center;
}
.ar-login-card__footer-form button {
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  color: #1d4ed8;
  font-weight: 900;
  font-size: inherit;
  cursor: pointer;
  text-decoration: none;
}
.ar-login-card__footer-form button:hover {
  text-decoration: underline;
}
.ar-signup .ar-login-copy h1 {
  max-width: 12em;
}
.ar-signup-card {
  width: min(100%, 460px);
}
.ar-signup-form {
  gap: 0.9rem;
}
.ar-signup-errors {
  display: grid;
  gap: 0.35rem;
  margin: 0;
  padding-left: 1.1rem;
  color: inherit;
  font-size: 0.88rem;
  line-height: 1.45;
}
@media (max-width: 1080px) {
  .ar-login {
    grid-template-columns: 1fr;
  }
  .ar-login__showcase,
  .ar-login__panel {
    min-height: auto;
  }
  .ar-login__showcase {
    padding: 2rem clamp(1.25rem, 4vw, 2.5rem) 1rem;
  }
  .ar-login__panel {
    padding: 1.5rem clamp(1.25rem, 4vw, 2.5rem) 2.5rem;
    border-left: 0;
    background: transparent;
    backdrop-filter: none;
  }
  .ar-login-copy {
    margin-top: 3rem;
  }
  .ar-login-copy h1 {
    max-width: 13em;
  }
  .ar-login-preview {
    width: min(100%, 540px);
    margin-top: 2rem;
  }
  .ar-login-card {
    width: min(100%, 540px);
  }
  .ar-signup-card {
    width: min(100%, 540px);
  }
}
@media (max-width: 640px) {
  .ar-login {
    width: 100%;
    min-height: 100svh;
    background: linear-gradient(180deg, #f8fafc 0%, #eef2ff 100%);
    overflow-x: hidden;
  }
  .ar-login__showcase {
    width: 100vw;
    max-width: 100vw;
    padding: 1.25rem 1rem 0.25rem;
  }
  .ar-login-brand__mark {
    width: 36px;
    height: 36px;
    border-radius: 12px;
  }
  .ar-login-brand__logo {
    width: 136px;
  }
  .ar-login-copy {
    width: calc(100vw - 2rem);
    max-width: 100%;
    margin-top: 1.55rem;
  }
  .ar-login-copy h1 {
    width: calc(100vw - 2rem);
    max-width: 22rem;
    font-size: clamp(1.9rem, 9vw, 2.3rem);
    line-height: 1.08;
    overflow-wrap: anywhere;
    word-break: break-word;
  }
  .ar-login-copy p:not(.ar-login-copy__eyebrow) {
    margin-top: 0.75rem;
    font-size: 0.95rem;
    line-height: 1.55;
  }
  .ar-login-preview {
    display: none;
  }
  .ar-login__panel {
    width: 100vw;
    max-width: 100vw;
    padding: 0.9rem 1rem 1.5rem;
  }
  .ar-login-card {
    width: 100%;
    max-width: calc(100vw - 2rem);
    padding: 1.25rem;
    border: 1px solid rgba(203, 213, 225, 0.72);
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.78);
    box-shadow: 0 18px 60px rgba(15, 23, 42, 0.1);
  }
  .ar-login-card__header {
    margin-bottom: 1.35rem;
  }
  .ar-login-input,
  .ar-login-submit {
    height: 50px;
  }
  .ar-signup-card {
    padding: 1.2rem;
  }
  .ar-signup-form {
    gap: 0.85rem;
  }
  .ar-signup .ar-login-card__footer {
    margin-top: 1.15rem;
  }
}
.ar-auth__card {
  width: 100%;
  max-width: 420px;
  background: var(--ic-surface-raised);
  border: 1px solid var(--ic-surface-border);
  border-radius: var(--ic-radius-2xl);
  box-shadow: var(--ic-shadow-lg);
  padding: var(--ic-space-8);
}
.ar-auth__logo {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--ic-brand-600);
  letter-spacing: -0.02em;
}

/* ================================================================
   Workspace Card
   ================================================================ */
.ar-workspace-card {
  background: var(--ic-surface-raised);
  border: 1px solid var(--ic-surface-border);
  border-radius: var(--ic-radius-xl);
  padding: var(--ic-space-5);
  transition: border-color var(--ic-duration-normal), box-shadow var(--ic-duration-normal);
  cursor: pointer;
  text-decoration: none;
  display: block;
  color: inherit;
}
.ar-workspace-card:hover {
  border-color: var(--ic-brand-300);
  box-shadow: var(--ic-shadow-md);
}
.ar-workspace-card--sortable {
  cursor: grab;
}
.ar-workspace-card--dragging {
  opacity: 0.82;
  border-color: var(--ic-brand-300);
  box-shadow: var(--ic-shadow-lg);
}
.ar-channel--dragging {
  opacity: 0.5;
  background: var(--ic-brand-50, #eef2ff);
}

/* Screen reader only (Tailwind sr-only equivalent) */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Channel sort option grid (2x2) */
.ar-sort-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.ar-sort-grid__card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 14px;
  border: 1.5px solid #e2e8f0;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.15s ease;
  background: #fff;
}
.ar-sort-grid__card:hover {
  border-color: #cbd5e1;
  background: #f8fafc;
}
.ar-sort-grid__card--active {
  border-color: var(--ic-brand-500, #6366f1);
  background: var(--ic-brand-50, #eef2ff);
}
.ar-sort-grid__card--active:hover {
  background: var(--ic-brand-50, #eef2ff);
}
.ar-sort-grid__label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: #334155;
}
.ar-sort-grid__card--active .ar-sort-grid__label {
  color: var(--ic-brand-700, #4338ca);
}
.ar-sort-grid__desc {
  font-size: 0.6875rem;
  color: #94a3b8;
  line-height: 1.4;
}
.ar-sort-grid__card--active .ar-sort-grid__desc {
  color: var(--ic-brand-500, #6366f1);
}
.ar-sort-grid--3col {
  grid-template-columns: repeat(3, 1fr);
}
.ar-sort-grid__example {
  font-size: 0.875rem;
  font-weight: 600;
  color: #1e293b;
  margin: 2px 0;
}
.ar-sort-grid__card--active .ar-sort-grid__example {
  color: var(--ic-brand-700, #4338ca);
}
.ar-workspace-card__handle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 999px;
  background: var(--ic-surface-sunken);
  color: var(--ic-text-tertiary);
  flex-shrink: 0;
}

/* ================================================================
   Production UI Refresh
   ================================================================ */
:root {
  --ic-brand-50: #eff6ff;
  --ic-brand-100: #dbeafe;
  --ic-brand-200: #bfdbfe;
  --ic-brand-300: #93c5fd;
  --ic-brand-400: #60a5fa;
  --ic-brand-500: #3b82f6;
  --ic-brand-600: #2563eb;
  --ic-brand-700: #1d4ed8;
  --ic-brand-800: #1e40af;
  --ic-brand-900: #1e3a8a;
  --ic-surface-sunken: #eef3fb;
  --ic-surface-border: rgba(148, 163, 184, 0.24);
  --ic-surface-border-subtle: rgba(226, 232, 240, 0.75);

}

html.ic-app,
body.ar-app-shell--chat {
  height: 100%;
}

.ar-app-shell {
  position: relative;
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(59, 130, 246, 0.18), transparent 28%),
    radial-gradient(circle at top right, rgba(14, 116, 144, 0.16), transparent 24%),
    linear-gradient(180deg, #f5f8ff 0%, #eef3fb 48%, #ebf1fb 100%);
  color: var(--ic-text-primary);
}

.ar-app-shell--chat {
  height: 100dvh;
  overflow: hidden;
}

.ar-app-shell--chat > [data-controller="sidebar"] {
  height: 100%;
  overflow: hidden;
}

.ar-app-shell--chat .ar-main--chat,
.ar-app-shell--chat .ar-main--chat > div,
.ar-app-shell--chat .ar-chat-shell {
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

.ar-app-shell::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.55) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.55) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.22), transparent 55%);
  opacity: 0.34;
}

h1, h2, h3, .ar-page-title, .ar-auth__logo {
  font-family: var(--ic-font-display);
  letter-spacing: -0.03em;
}

a, button, input, textarea, select {
  transition:
    background-color var(--ic-duration-normal) var(--ic-easing-default),
    border-color var(--ic-duration-normal) var(--ic-easing-default),
    color var(--ic-duration-normal) var(--ic-easing-default),
    box-shadow var(--ic-duration-normal) var(--ic-easing-default),
    transform var(--ic-duration-normal) var(--ic-easing-default);
}

.ar-content-wrap {
  position: relative;
}

.ar-page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.ar-page-kicker,
.ar-sidebar__eyebrow {
  margin: 0 0 0.35rem;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.ar-page-kicker {
  color: var(--ic-brand-600);
}

.ar-page-title {
  margin: 0;
  font-size: clamp(1.7rem, 2vw, 2.35rem);
  font-weight: 800;
}

.ar-page-subtitle {
  margin-top: 0.5rem;
  max-width: 760px;
  font-size: 0.95rem;
  line-height: 1.7;
  color: var(--ic-text-secondary);
}

.ar-page-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.ar-page-action-button {
  min-height: 40px;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.25rem;
  border-radius: 0.5rem;
  box-sizing: border-box;
  white-space: nowrap;
  flex-shrink: 0;
}

.ar-agent-picker-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.5rem;
  grid-auto-rows: minmax(80px, auto);
  align-items: stretch;
  align-content: start;
}

@media (min-width: 768px) {
  .ar-agent-picker-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.ar-agent-picker-card {
  height: 100%;
  min-height: 80px;
}

.ar-member-picker-grid {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  align-items: stretch;
}

.ar-member-picker-card {
  height: 100%;
  min-height: 64px;
  background:
    radial-gradient(circle at top right, rgba(99, 102, 241, 0.05), transparent 38%),
    linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
}

.ar-member-picker-filter {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  border: 1px solid #e2e8f0;
  border-radius: 999px;
  padding: 0.45rem 0.85rem;
  background: #fff;
  color: #475569;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.ar-member-picker-filter:hover {
  border-color: #cbd5e1;
  background: #f8fafc;
}

.ar-member-picker-filter--active {
  border-color: color-mix(in srgb, var(--ic-brand-600) 28%, transparent);
  background: color-mix(in srgb, var(--ic-brand-600) 10%, white);
  color: var(--ic-brand-700, var(--ic-brand-600));
}

.ar-member-picker-avatar {
  width: 2.6rem;
  height: 2.6rem;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.25);
  font-size: 0.875rem;
  font-weight: 700;
}

.ar-member-picker-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: inherit;
}

.ar-member-picker-avatar--team {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.18), rgba(14, 165, 233, 0.14));
  color: #1d4ed8;
}

.ar-member-picker-avatar--user {
  background: linear-gradient(135deg, rgba(249, 115, 22, 0.15), rgba(234, 179, 8, 0.12));
  color: #c2410c;
}

.ar-member-picker-avatar--agent {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.18), rgba(20, 184, 166, 0.14));
  color: #0f766e;
}

.ar-button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border-radius: 999px;
  border: 1px solid transparent;
  font-weight: 600;
  text-decoration: none;
  box-shadow: 0 10px 30px -18px rgba(15, 23, 42, 0.45);
}

.ar-button:hover {
  transform: translateY(-1px);
}

.ar-button--primary {
  color: #fff;
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 55%, #0f766e 100%);
}

.ar-button--primary:hover {
  box-shadow: 0 18px 34px -20px rgba(29, 78, 216, 0.72);
}

.ar-button--secondary {
  color: var(--ic-text-primary);
  background: rgba(255, 255, 255, 0.82);
  border-color: rgba(148, 163, 184, 0.28);
  backdrop-filter: blur(12px);
}

.ar-button--secondary:hover {
  background: rgba(255, 255, 255, 0.94);
}

.ar-button--danger {
  color: #fff;
  background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
}

.ar-button--danger:hover {
  box-shadow: 0 18px 34px -20px rgba(185, 28, 28, 0.65);
}

.ar-button--warning {
  color: #fff;
  background: linear-gradient(135deg, #f59e0b 0%, #ea580c 100%);
}

.ar-button--warning:hover {
  box-shadow: 0 18px 34px -20px rgba(234, 88, 12, 0.65);
}

.ar-button--compact {
  padding: 0.5rem 0.8rem;
  font-size: 0.76rem;
}

.ar-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.38rem 0.7rem;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 700;
}

.ar-chip--neutral {
  color: var(--ic-neutral-700);
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(148, 163, 184, 0.22);
  backdrop-filter: blur(10px);
}

.ar-chip--brand {
  color: #fff;
  background: var(--ic-brand-600);
  border: 1px solid var(--ic-brand-600);
}

/* Agent status dropdown */
.ar-agent-dropdown {
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 1rem;
  box-shadow:
    0 8px 24px -8px rgba(15, 23, 42, 0.22),
    0 2px 6px -2px rgba(15, 23, 42, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(16px);
  overflow: hidden;
}

.ar-agent-dropdown__header {
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.12);
  background: linear-gradient(180deg, rgba(255,255,255,0.6), rgba(255,255,255,0.0));
}

.ar-panel {
  background: rgba(255, 255, 255, 0.84);
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 1.4rem;
  box-shadow:
    0 22px 40px -28px rgba(15, 23, 42, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(16px);
}

.ar-panel__header {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.58), rgba(255, 255, 255, 0.18));
}

.ar-kpi-grid {
  display: grid;
  gap: 1rem;
}

.ar-kpi-grid--3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.ar-kpi-grid--2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.ar-kpi-grid--4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.ar-kpi-grid--5 {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.ar-stat-widget {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 1.4rem;
  padding: 1.25rem;
  background:
    radial-gradient(circle at top right, rgba(59, 130, 246, 0.12), transparent 38%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(255, 255, 255, 0.84));
  box-shadow: 0 22px 40px -30px rgba(15, 23, 42, 0.38);
}

.ar-stat-widget::after {
  content: "";
  position: absolute;
  inset: 0 auto auto 0;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, rgba(37, 99, 235, 0.9), rgba(14, 116, 144, 0.55));
}

.ar-stat-widget__label {
  margin-bottom: 0.5rem;
  color: var(--ic-text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.68rem;
  font-weight: 700;
}

.ar-stat-widget__value {
  font-family: var(--ic-font-display);
  font-size: clamp(1.65rem, 2vw, 2.3rem);
  line-height: 1;
}

.ar-sidebar {
  background:
    radial-gradient(circle at top left, rgba(37, 99, 235, 0.22), transparent 28%),
    linear-gradient(180deg, #0a1220 0%, #0c1626 40%, #101c2f 100%);
  border-right: 1px solid rgba(148, 163, 184, 0.12);
  box-shadow: 24px 0 48px -32px rgba(2, 6, 23, 0.72);
}

.ar-sidebar__logo {
  border-bottom-color: rgba(148, 163, 184, 0.12);
}

.ar-sidebar__eyebrow {
  color: rgba(148, 163, 184, 0.65);
}

.ar-auth__logo {
  color: #f8fbff;
}

.ar-sidebar__logo {
  padding: 0.85rem 0.9rem;
}

.ar-sidebar__brand {
  width: 100%;
  min-width: 0;
}

.ar-sidebar__brand-logo {
  display: block;
  width: 9.35rem;
  max-width: 100%;
  max-height: 2.25rem;
  height: auto;
  object-fit: contain;
  object-position: left center;
  opacity: 0.96;
}

.ar-sidebar__brand-mark {
  width: 2.35rem;
  height: 2.35rem;
  border-radius: 0.5rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: linear-gradient(135deg, #38bdf8 0%, #2563eb 52%, #22c55e 100%);
  color: #ffffff;
  font-family: var(--ic-font-display);
  font-size: 1.45rem;
  font-weight: 800;
  line-height: 1;
  box-shadow: 0 14px 30px -18px rgba(56, 189, 248, 0.88);
}

.ar-sidebar__brand-copy {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.05;
}

.ar-sidebar__brand-name {
  color: #f8fbff;
  font-family: var(--ic-font-display);
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: 0;
}

.ar-sidebar__nav {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  gap: 0.45rem;
  padding: 0.75rem 0.75rem;
  overflow: hidden;
}

.ar-sidebar__nav-fixed,
.ar-sidebar__nav-lower {
  flex-shrink: 0;
  min-width: 0;
  overflow: hidden;
}

.ar-sidebar__service-block {
  padding-bottom: 0.15rem;
  min-width: 0;
  overflow: hidden;
}

.ar-sidebar__channel-area {
  flex: 0 1 auto;
  min-height: 7.5rem;
  max-height: min(30rem, 52vh);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.ar-sidebar__dm-area {
  border-top: 1px solid rgba(148, 163, 184, 0.1);
  margin-top: 0.2rem;
  padding-top: 0.42rem;
  flex-shrink: 0;
  min-width: 0;
}

.ar-sidebar__dm-list {
  min-height: 0;
  min-width: 0;
}

.ar-sidebar__group {
  padding: 0.65rem;
  border: 1px solid rgba(148, 163, 184, 0.12);
  border-radius: 0.5rem;
  background: rgba(15, 23, 42, 0.36);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.ar-sidebar__group--services {
  margin-bottom: 0.1rem;
}

.ar-sidebar__section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.7rem;
  min-height: 1.6rem;
  margin-bottom: 0.25rem;
}

.ar-sidebar__section-header .ar-sidebar__section-label {
  margin: 0;
}

.ar-sidebar__section-header--sub {
  margin: 0.35rem 0 0.35rem;
}

.ar-sidebar__section-kicker {
  margin: 0 0 0.15rem;
  color: rgba(148, 163, 184, 0.64);
  font-size: 0.58rem;
  font-weight: 800;
  letter-spacing: 0.14em;
}

.ar-sidebar__section-title {
  margin: 0;
  color: rgba(248, 250, 252, 0.96);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0;
}

.ar-sidebar__section-label {
  color: rgba(148, 163, 184, 0.76);
  margin-bottom: 0.3rem;
}

.ar-sidebar__section-label--spaced {
  margin-top: 0.65rem;
}

.ar-sidebar-workspace {
  display: flex;
  align-items: center;
  gap: 0.38rem;
  padding: 0.36rem 0.4rem;
  margin-top: 0.25rem;
  border: 1px solid rgba(96, 165, 250, 0.18);
  border-radius: 0.58rem;
  background:
    linear-gradient(135deg, rgba(37, 99, 235, 0.18), rgba(34, 197, 94, 0.07)),
    rgba(15, 23, 42, 0.44);
  color: inherit;
  text-decoration: none;
}

.ar-sidebar-workspace:hover {
  border-color: rgba(125, 211, 252, 0.38);
  background:
    linear-gradient(135deg, rgba(37, 99, 235, 0.3), rgba(34, 197, 94, 0.12)),
    rgba(15, 23, 42, 0.66);
}

.ar-sidebar-workspace__main {
  min-width: 0;
  flex: 1;
  display: flex;
  align-items: center;
  gap: 0.42rem;
  color: inherit;
  text-decoration: none;
}

.ar-sidebar-workspace__avatar {
  width: 1.55rem;
  height: 1.55rem;
  border-radius: 0.46rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: rgba(248, 250, 252, 0.1);
  color: #ffffff;
  font-size: 0.78rem;
  font-weight: 800;
}

.ar-sidebar-workspace__copy {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.12rem;
}

.ar-sidebar-workspace__copy span {
  display: none;
}

.ar-sidebar-workspace__copy strong {
  color: #ffffff;
  font-size: 0.8rem;
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ar-sidebar-workspace__switch {
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 0.48rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: rgba(226, 232, 240, 0.8);
  background: rgba(15, 23, 42, 0.38);
}

.ar-sidebar__section-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin: 0.35rem 0.15rem 0.3rem;
}

.ar-sidebar__section-title-row-label {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  min-width: 0;
  flex: 1;
  color: rgba(248, 250, 252, 0.9);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0;
}

.ar-sidebar__section-title-row-label svg {
  color: rgba(125, 211, 252, 0.82);
  flex-shrink: 0;
}

.ar-sidebar__section-title-row--dm .ar-sidebar__section-title-row-label {
  color: rgba(203, 213, 225, 0.72);
}

.ar-sidebar__section-title-row--dm .ar-sidebar__section-title-row-label svg {
  color: rgba(148, 163, 184, 0.72);
}

.ar-sidebar__section-count {
  min-width: 1.35rem;
  height: 1.05rem;
  padding: 0 0.35rem;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(148, 163, 184, 0.14);
  color: rgba(226, 232, 240, 0.78);
  font-size: 0.62rem;
  font-weight: 800;
}

.ar-sidebar__nav-item {
  color: rgba(226, 232, 240, 0.82);
  border: 1px solid transparent;
  padding: 0.45rem 0.6rem;
  border-radius: 0.55rem;
  min-width: 0;
}

.ar-sidebar__nav-item:hover {
  background: rgba(148, 163, 184, 0.08);
  color: #ffffff;
}

.ar-sidebar__nav-item.active {
  color: #ffffff;
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.42), rgba(14, 116, 144, 0.28));
  border-color: rgba(96, 165, 250, 0.26);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

/* ── Service Nav compact/expand ── */
.ar-service-nav {
  display: flex;
  flex-direction: column;
  gap: 0;
  min-width: 0;
  overflow-x: hidden;
}

.ar-service-nav--compact {
  flex-direction: row;
  gap: 0.25rem;
  padding: 0.05rem 0 0.15rem;
  overflow: hidden;
}

.ar-service-nav--compact .ar-service-nav__item {
  position: relative;
  justify-content: center;
  padding: 0.38rem;
  flex: 1;
  gap: 0;
  border-radius: var(--ic-radius-lg);
  min-width: 0;
}

.ar-service-nav--compact .ar-service-nav__label {
  display: none;
}

.ar-service-nav--compact .ar-sidebar__warn-dot {
  position: absolute;
  top: 2px;
  right: 2px;
}

.ar-service-nav--expanded .ar-service-nav__label {
  display: inline;
}

.ar-service-nav--expanded {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.32rem;
  max-height: none;
  overflow: hidden;
}

.ar-service-nav--expanded .ar-service-nav__item {
  justify-content: flex-start;
  gap: 0.42rem;
  min-height: 2.35rem;
  padding: 0.42rem 0.48rem;
  border-radius: 0.65rem;
}

.ar-service-nav__label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* FOUC 방지: JS 로드 전에 localStorage 상태를 <html> 클래스로 즉시 적용 */
html.ar-service-expanded .ar-service-nav.ar-service-nav--compact {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.32rem;
  padding: 0;
  max-height: none;
  overflow: hidden;
}
html.ar-service-expanded .ar-service-nav--compact .ar-service-nav__item {
  justify-content: flex-start;
  padding: 0.42rem 0.48rem;
  flex: initial;
  gap: 0.42rem;
  border-radius: 0.65rem;
  min-width: 0;
}
html.ar-service-expanded .ar-service-nav--compact .ar-service-nav__label {
  display: inline;
}
html.ar-service-expanded .ar-service-nav--compact .ar-sidebar__warn-dot {
  position: static;
}
html.ar-dm-collapsed [data-dm-toggle-target="list"] {
  display: none;
}

.ar-service-nav__toggle {
  width: 1.75rem;
  height: 1.75rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 1px solid rgba(148, 163, 184, 0.12);
  background: rgba(15, 23, 42, 0.38);
  color: rgba(226, 232, 240, 0.75);
  cursor: pointer;
  border-radius: 0.5rem;
  transition: color 0.2s, background 0.2s;
  line-height: 1;
}

.ar-service-nav__toggle:hover {
  color: #fff;
  background: rgba(148, 163, 184, 0.2);
}

.ar-dm-toggle__btn {
  width: 100%;
  cursor: pointer;
  border: none;
  background: transparent;
  text-align: left;
  padding: 0;
  color: rgba(248, 250, 252, 0.9);
  font-family: inherit;
  justify-content: flex-start;
}

.ar-dm-toggle__collapsed-badge {
  margin-left: auto;
  font-size: 0.65rem;
  min-width: 1.2rem;
  height: 1.2rem;
  padding: 0 0.3rem;
  background: rgba(96, 165, 250, 0.7);
  color: #fff;
}

.ar-sidebar__footer {
  border-top-color: rgba(148, 163, 184, 0.12);
  color: rgba(226, 232, 240, 0.88);
}

.ar-sidebar__footer a:hover {
  background: rgba(148, 163, 184, 0.1);
  color: #ffffff;
}

.ar-sidebar__channel-create {
  width: 1.65rem;
  height: 1.65rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(148, 163, 184, 0.12);
  border-radius: 0.5rem;
  background: rgba(15, 23, 42, 0.28);
  color: rgba(226, 232, 240, 0.72);
  flex-shrink: 0;
}

.ar-sidebar__channel-create:hover {
  background: rgba(148, 163, 184, 0.08);
  color: #fff;
}

.ar-sidebar__channel-list {
  margin-top: 0.12rem;
  padding-left: 0.5rem;
  border-left: 1px solid rgba(148, 163, 184, 0.12);
  display: flex;
  flex-direction: column;
  gap: 0.05rem;
}

.ar-sidebar__channel-list--primary {
  flex: 0 1 auto;
  min-height: 0;
  max-height: clamp(8rem, 42vh, 25rem);
  overflow-y: auto;
  padding-right: 0.18rem;
  scrollbar-width: thin;
}

.ar-sidebar__channel-list--dm {
  margin: 0.1rem 0 0;
  padding-left: 0;
  border-left: 0;
}

.ar-sidebar__channel-list--dm .ar-sidebar__channel-link {
  color: rgba(203, 213, 225, 0.7);
}

.ar-sidebar__channel-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 2rem;
  padding: 0.31rem 0.55rem;
  border-radius: 0.55rem;
  color: rgba(226, 232, 240, 0.72);
  font-size: 0.8rem;
  text-decoration: none;
}

.ar-sidebar__channel-link:hover {
  color: #fff;
  background: rgba(148, 163, 184, 0.08);
}

.ar-sidebar__channel-link.active {
  color: #fff;
  background: rgba(37, 99, 235, 0.26);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.ar-sidebar__channel-hash {
  color: rgba(148, 163, 184, 0.72);
}

.ar-sidebar__channel-link--unread {
  font-weight: 700;
  color: rgba(248, 250, 252, 0.95);
}

.ar-sidebar__unread-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.2rem;
  height: 1.2rem;
  padding: 0 0.3rem;
  border-radius: 999px;
  font-size: 0.62rem;
  font-weight: 700;
  background: rgba(96, 165, 250, 0.35);
  color: rgba(248, 250, 252, 0.95);
  margin-left: auto;
  flex-shrink: 0;
}

.ar-sidebar__unread-badge--mention {
  background: var(--ic-danger-500);
  color: #fff;
  box-shadow: 0 0 6px rgba(239, 68, 68, 0.45);
}

.ar-sidebar__channel-empty {
  padding: 0.42rem 0.7rem;
  font-size: 0.75rem;
  color: rgba(148, 163, 184, 0.78);
}

.ar-sidebar-tools {
  margin: 0.35rem 0 0;
  border-top: 1px solid rgba(148, 163, 184, 0.08);
  padding-top: 0.25rem;
  min-width: 0;
}

.ar-sidebar-tools__summary {
  min-height: 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.34rem 0.15rem;
  border-radius: 0.55rem;
  color: rgba(226, 232, 240, 0.78);
  font-size: 0.78rem;
  font-weight: 800;
  cursor: pointer;
  list-style: none;
}

.ar-sidebar-tools__summary::-webkit-details-marker {
  display: none;
}

.ar-sidebar-tools__summary:hover {
  color: #ffffff;
  background: rgba(148, 163, 184, 0.08);
}

.ar-sidebar-tools__label {
  min-width: 0;
  flex: 1;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.ar-sidebar-tools__label svg {
  color: rgba(125, 211, 252, 0.76);
  flex-shrink: 0;
}

.ar-sidebar-tools__chevron {
  flex-shrink: 0;
  transition: transform 0.16s ease;
}

.ar-sidebar-tools[open] .ar-sidebar-tools__chevron {
  transform: rotate(180deg);
}

.ar-sidebar-tools__list {
  display: flex;
  flex-direction: column;
  gap: 0.05rem;
  padding: 0.18rem 0 0;
}

.ar-sidebar-account {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.65rem;
  border: 1px solid rgba(148, 163, 184, 0.12);
  border-radius: 0.5rem;
  background: rgba(15, 23, 42, 0.44);
}

.ar-sidebar-account__avatar {
  width: 2rem;
  height: 2rem;
  border-radius: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: #ffffff;
  font-size: 0.74rem;
  font-weight: 800;
}

.ar-sidebar-account__copy {
  min-width: 0;
  flex: 1;
}

.ar-sidebar-account__copy p {
  margin: 0;
  color: rgba(248, 250, 252, 0.94);
  font-size: 0.82rem;
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ar-sidebar-account__copy span {
  display: block;
  margin-top: 0.1rem;
  color: rgba(148, 163, 184, 0.78);
  font-size: 0.68rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ar-sidebar-account__action {
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 0.5rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: rgba(226, 232, 240, 0.76);
  flex-shrink: 0;
  transition: background 0.2s, color 0.2s;
}

.ar-sidebar-account__action:hover {
  background: rgba(148, 163, 184, 0.1);
  color: #ffffff;
}

/* 에이전트 카드 DM 오버레이 버튼 */
.ar-agent-card-wrapper {
  position: relative;
  height: 100%;
}

.ar-agent-card__dm-overlay {
  position: absolute;
  bottom: 18px;
  right: 18px;
  width: 28px;
  height: 28px;
  border-radius: 0.5rem;
  border: 1px solid rgba(203, 213, 225, 0.7);
  background: rgba(255, 255, 255, 0.92);
  color: var(--ic-brand-600);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s;
  padding: 0;
  z-index: 1;
}

.ar-agent-card-wrapper:hover .ar-agent-card__dm-overlay {
  opacity: 1;
}

.ar-agent-card__dm-overlay:hover {
  background: #fff;
  box-shadow: 0 1px 4px rgba(0,0,0,0.1);
}

/* ── DM 아바타 ── */
.ar-dm-avatar {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--ic-brand-600);
  color: #fff;
  font-size: 0.875rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
}

.ar-dm-avatar-xs {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background: rgba(37, 99, 235, 0.55);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
}

.ar-main {
  margin-left: var(--ic-sidebar-width);
  min-height: 100vh;
  background: transparent;
}

.ar-workspace-card,
.ar-agent-card {
  position: relative;
  border-radius: 1.4rem;
  border-color: rgba(148, 163, 184, 0.18);
  background:
    radial-gradient(circle at top right, rgba(59, 130, 246, 0.08), transparent 34%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(255, 255, 255, 0.82));
  box-shadow: 0 24px 42px -32px rgba(15, 23, 42, 0.42);
}

.ar-workspace-card:hover,
.ar-agent-card:hover {
  transform: translateY(-2px);
  border-color: rgba(37, 99, 235, 0.28);
  box-shadow: 0 30px 50px -30px rgba(37, 99, 235, 0.34);
}

.ar-team-grid {
  align-items: stretch;
}

.ar-team-card {
  display: flex;
  flex-direction: column;
  padding: 0.875rem;
  min-height: 152px;
  height: 100%;
  cursor: default;
}

.ar-team-card__body {
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
  flex: 1;
  min-height: 0;
}

.ar-team-card__avatars {
  margin-top: auto;
}

.ar-team-card--new {
  justify-content: center;
  border-style: dashed;
  color: var(--ic-text-tertiary);
  cursor: pointer;
}

.ar-team-card__edit {
  transition:
    opacity var(--ic-duration-normal) var(--ic-easing-default),
    transform var(--ic-duration-normal) var(--ic-easing-default),
    background-color var(--ic-duration-normal) var(--ic-easing-default),
    border-color var(--ic-duration-normal) var(--ic-easing-default),
    color var(--ic-duration-normal) var(--ic-easing-default),
    box-shadow var(--ic-duration-normal) var(--ic-easing-default);
}

@media (hover: hover) {
  .ar-team-card__edit {
    opacity: 0;
    pointer-events: none;
    transform: translateY(-2px);
  }

.ar-team-card:hover .ar-team-card__edit,
.ar-team-card:focus-within .ar-team-card__edit {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
  }
}

.ar-channel-members-modal {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.ar-modal-panel.ar-channel-members-modal-panel {
  width: min(92vw, 440px);
}

.ar-channel-members-shell--editing .ar-modal-panel.ar-channel-members-modal-panel {
  width: min(92vw, 820px);
}

.ar-channel-members-delete {
  display: none;
}

.ar-channel-members-shell--editing .ar-channel-members-delete {
  display: flex;
}

.ar-channel-members-modal__body {
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.ar-channel-members-shell .ar-channel-members-layout {
  display: grid;
  gap: 1rem;
  grid-template-columns: minmax(0, 1fr);
  align-items: stretch;
}

.ar-channel-members-pane-surface {
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 0.75rem;
  padding: 1rem;
}

.ar-channel-members-shell .ar-channel-members-picker-pane {
  opacity: 0;
  max-height: 0;
  min-height: 0;
  max-width: 0;
  overflow: hidden;
  pointer-events: none;
  border-width: 0 !important;
  padding: 0 !important;
}

.ar-channel-members-shell--editing .ar-channel-members-picker-pane {
  opacity: 1;
  max-height: 960px;
  max-width: 100%;
  pointer-events: auto;
  border-width: 1px !important;
  padding: 1rem !important;
}

.ar-channel-members-section {
  min-height: 0;
  height: min(420px, calc(100dvh - 260px));
}

.ar-channel-members-section__scroll,
.ar-channel-members-picker,
.ar-channel-members-picker__scroll {
  min-height: 0;
}

.ar-channel-members-section__scroll,
.ar-channel-members-picker__scroll {
  flex: 1;
  overflow-y: auto;
  padding-right: 0.25rem;
}

@media (min-width: 1024px) {
  .ar-channel-members-shell .ar-channel-members-layout {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  .ar-channel-members-shell--editing .ar-channel-members-layout {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  .ar-channel-members-shell--editing .ar-channel-members-picker-pane {
    max-width: 100%;
  }

  .ar-channel-members-section {
    height: min(520px, calc(100dvh - 260px));
  }
}

.ar-kanban-column {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.74), rgba(255, 255, 255, 0.54));
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 1.4rem;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

.ar-task-card {
  border-radius: 1rem;
  background: rgba(255, 255, 255, 0.96);
}

.ar-filter-input {
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.04);
}

.ar-view-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.28rem;
  border-radius: 999px;
  border: 1px solid var(--ic-surface-border);
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 10px 24px -22px rgba(15, 23, 42, 0.35);
}

.ar-view-toggle__item {
  padding: 0.5rem 0.9rem;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--ic-text-secondary);
  transition: background var(--ic-duration-normal) var(--ic-easing-default),
              color var(--ic-duration-normal) var(--ic-easing-default);
}

.ar-view-toggle__item.is-active {
  background: linear-gradient(180deg, rgba(79, 70, 229, 0.12), rgba(79, 70, 229, 0.08));
  color: var(--ic-brand-700);
}

/* ================================================================
   Swimlane View
   ================================================================ */
.ar-swimlane {
  display: grid;
  grid-template-columns: 180px repeat(4, 1fr);
  gap: 0;
  border: 1px solid var(--ic-surface-border);
  border-radius: var(--ic-radius-xl);
  overflow: hidden;
  background: var(--ic-surface-raised);
}

.ar-swimlane__header {
  display: contents;
}

.ar-swimlane__label-cell {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.75rem 1rem;
  background: var(--ic-surface-sunken);
  border-right: 1px solid var(--ic-surface-border);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--ic-text-secondary);
  min-height: 52px;
}

.ar-swimlane__col-header {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.75rem 0.875rem;
  background: var(--ic-surface-sunken);
  border-right: 1px solid var(--ic-surface-border);
  border-bottom: 1px solid var(--ic-surface-border);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--ic-text-secondary);
}
.ar-swimlane__col-header:last-child { border-right: none; }

.ar-swimlane__col-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.ar-swimlane__col-dot--todo        { background: #94a3b8; }
.ar-swimlane__col-dot--in_progress { background: #6366f1; animation: pulse-bar 1.8s ease-in-out infinite; }
.ar-swimlane__col-dot--in_review   { background: #f59e0b; }
.ar-swimlane__col-dot--done        { background: #10b981; }

.ar-swimlane__row {
  display: contents;
}
.ar-swimlane__row > * {
  border-bottom: 1px solid var(--ic-surface-border);
}
.ar-swimlane__row:last-child > * {
  border-bottom: none;
}

/* 과부하 행: 레이블 셀 좌측 빨간 강조 */
.ar-swimlane__row--overloaded .ar-swimlane__label-cell {
  border-left: 3px solid #ef4444;
  background: rgba(239, 68, 68, 0.03);
}

.ar-swimlane__assignee-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.ar-swimlane__assignee-name {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--ic-text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ar-swimlane__assignee-meta {
  display: flex;
  align-items: center;
  gap: 4px;
}
.ar-swimlane__done-count {
  font-size: 0.68rem;
  color: #10b981;
  font-weight: 600;
}
.ar-swimlane__unassigned-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--ic-neutral-100);
  color: var(--ic-text-tertiary);
  flex-shrink: 0;
}

.ar-swimlane__cell {
  padding: 0.6rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  background: var(--ic-surface-raised);
  border-right: 1px solid var(--ic-surface-border);
  min-height: 80px;
  vertical-align: top;
}
.ar-swimlane__cell:last-child { border-right: none; }
.ar-swimlane__cell--in_progress { background: rgba(99, 102, 241, 0.02); }
.ar-swimlane__cell--empty { background: transparent; }

.ar-swimlane__task-chip {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.6rem;
  border-radius: 0.5rem;
  background: var(--ic-surface-sunken);
  border: 1px solid var(--ic-surface-border);
  font-size: 0.75rem;
  color: var(--ic-text-primary);
  text-decoration: none;
  transition: box-shadow 0.15s, background 0.15s;
  animation: card-enter 0.2s ease-out both;
}
.ar-swimlane__task-chip:hover {
  box-shadow: var(--ic-shadow-sm);
  background: var(--ic-surface-raised);
}
.ar-swimlane__task-chip--blocked {
  border-color: rgba(239, 68, 68, 0.3);
  background: rgba(239, 68, 68, 0.04);
}

.ar-swimlane__task-priority {
  width: 4px;
  height: 14px;
  border-radius: 2px;
  flex-shrink: 0;
}
.ar-swimlane__task-priority--critical { background: #ef4444; }
.ar-swimlane__task-priority--high     { background: #f97316; }
.ar-swimlane__task-priority--medium   { background: #6366f1; }
.ar-swimlane__task-priority--low      { background: #94a3b8; }
.ar-swimlane__task-priority--none     { background: transparent; }

.ar-swimlane__task-title {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ar-swimlane__blocked-icon {
  color: #ef4444;
  flex-shrink: 0;
}

.ar-swimlane__empty {
  grid-column: 1 / -1;
  padding: 3rem;
  text-align: center;
}


.ar-task-groups {
  display: grid;
  gap: 1.1rem;
}

.ar-task-group {
  border: 1px solid rgba(226, 232, 240, 0.9);
  border-radius: 1rem;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 16px 40px -34px rgba(15, 23, 42, 0.28);
}

.ar-task-group__header {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.1rem 0.85rem;
  border-bottom: 1px solid rgba(226, 232, 240, 0.72);
}

.ar-task-group__eyebrow {
  margin: 0;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ic-brand-600);
}

.ar-task-group__title {
  margin: 0.2rem 0 0;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--ic-neutral-900);
}

.ar-task-group__summary {
  margin: 0.22rem 0 0;
  font-size: 0.82rem;
  color: var(--ic-text-secondary);
}

.ar-task-group__list {
  display: grid;
  gap: 0.85rem;
  padding: 1rem 1.1rem 1.1rem;
}

.ar-task-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.ar-task-channel-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  background: rgba(226, 232, 240, 0.62);
  color: var(--ic-text-secondary);
  font-size: 0.72rem;
  font-weight: 600;
}

.ar-badge-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.25rem;
  height: 1.25rem;
  padding: 0 0.3rem;
  border-radius: 999px;
  background: var(--ic-brand-600);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 1;
}
.ar-badge-count--thread {
  background: var(--ar-thread-color, #6366f1);
}

.ar-channel-filter-banner {
  background: rgba(79, 70, 229, 0.07);
  border: 1px solid rgba(79, 70, 229, 0.2);
  color: var(--ic-brand-700);
}

.ar-chat-shell {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  height: 100%;
  min-height: 0;
  position: relative;
  background:
    radial-gradient(circle at top right, rgba(59, 130, 246, 0.08), transparent 28%),
    linear-gradient(180deg, #f9fbff 0%, #f5f8fe 100%);
}

.ar-chat-header {
  grid-row: 1;
  position: relative;
  z-index: 1;
  background: #ffffff;
  border-bottom: 1px solid var(--ic-neutral-200);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}

.ar-chat-snooze-banner {
  grid-row: 2;
  position: relative;
  z-index: 1;
}

.ar-chat-header__subtitle {
  display: inline-block;
  margin-top: 0.3rem;
  color: var(--ic-text-secondary);
}

.ar-chat-stream-wrapper {
  grid-row: 3;
  position: relative;
  min-height: 0;
  overflow: hidden;
}

.ar-chat-stream {
  position: relative;
  height: 100%;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  scroll-padding-top: calc(var(--ar-chat-header-height, 0px) + 1rem);
  scroll-padding-bottom: calc(var(--ar-chat-composer-height, 0px) + 1rem);
  padding: 0.5rem 0 max(2.5rem, env(safe-area-inset-bottom));
  background: transparent;
}

.ar-channel-task-panel {
  margin: 0 1.25rem;
  padding: 0.95rem 1rem 1rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.18);
  background:
    linear-gradient(180deg, rgba(248, 250, 252, 0.98), rgba(255, 255, 255, 0.94));
}

.ar-channel-task-panel__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.ar-channel-task-panel__eyebrow {
  margin: 0;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ic-text-tertiary);
}

.ar-channel-task-panel__title {
  margin: 0.16rem 0 0;
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--ic-neutral-900);
}

.ar-channel-task-panel__subtitle {
  margin: 0.18rem 0 0;
  font-size: 0.76rem;
  color: var(--ic-text-tertiary);
}

.ar-channel-task-panel__action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2rem;
  padding: 0 0.8rem;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  background: rgba(255, 255, 255, 0.84);
  color: var(--ic-text-secondary);
  font-size: 0.78rem;
  font-weight: 600;
  text-decoration: none;
}

.ar-channel-task-panel__action--primary {
  background: rgba(79, 70, 229, 0.1);
  color: var(--ic-brand-700, #4338ca);
  border-color: rgba(79, 70, 229, 0.16);
}

.ar-channel-task-panel__list {
  display: grid;
  gap: 0.7rem;
  margin-top: 0.9rem;
}

.ar-channel-task-panel__row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.9rem;
  padding: 0.85rem 0.95rem;
  border-radius: 1rem;
  border: 1px solid rgba(148, 163, 184, 0.16);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 12px 28px -28px rgba(15, 23, 42, 0.38);
  text-decoration: none;
}

.ar-channel-task-panel__row-top {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
  margin-bottom: 0.35rem;
}

.ar-channel-task-panel__status,
.ar-channel-task-panel__priority {
  display: inline-flex;
  align-items: center;
  padding: 0.18rem 0.5rem;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 700;
}

.ar-channel-task-panel__status--todo { background: rgba(148, 163, 184, 0.14); color: var(--ic-text-secondary); }
.ar-channel-task-panel__status--in_progress { background: rgba(59, 130, 246, 0.12); color: #1d4ed8; }
.ar-channel-task-panel__status--in_review { background: rgba(147, 51, 234, 0.12); color: #7e22ce; }
.ar-channel-task-panel__status--done { background: rgba(34, 197, 94, 0.12); color: #15803d; }

.ar-channel-task-panel__priority {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(148, 163, 184, 0.18);
  color: var(--ic-text-tertiary);
  text-transform: uppercase;
}

.ar-channel-task-panel__task-title {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--ic-neutral-900);
}

.ar-channel-task-panel__task-desc {
  margin: 0.22rem 0 0;
  font-size: 0.76rem;
  line-height: 1.45;
  color: var(--ic-text-secondary);
}

.ar-channel-task-panel__meta {
  display: grid;
  justify-items: end;
  gap: 0.3rem;
  min-width: 6rem;
  flex-shrink: 0;
  font-size: 0.72rem;
  color: var(--ic-text-tertiary);
}

.ar-channel-task-panel__empty {
  margin-top: 0.9rem;
  padding: 1rem 0.1rem 0.15rem;
}

.ar-channel-task-panel__empty-title {
  margin: 0;
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--ic-neutral-800);
}

.ar-channel-task-panel__empty-body {
  margin: 0.24rem 0 0;
  font-size: 0.76rem;
  color: var(--ic-text-tertiary);
}

.ar-channel-task-panel__done {
  margin-top: 0.9rem;
}

.ar-channel-task-panel__done-title {
  margin: 0 0 0.45rem;
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--ic-text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.ar-channel-task-panel__done-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.ar-channel-task-panel__done-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  background: rgba(241, 245, 249, 0.92);
  border: 1px solid rgba(148, 163, 184, 0.16);
  font-size: 0.72rem;
  color: var(--ic-text-secondary);
  text-decoration: none;
}

.ar-message-row {
  position: relative;
  padding: 0.25rem 1.25rem;
  border-radius: 0;
  background: transparent;
  border: none;
  transition: background 80ms ease;
}
/* Non-continuation messages get a bit of breathing room above */
.ar-message-row:not(.ar-message-row--continuation) + .ar-message-row:not(.ar-message-row--continuation) {
  margin-top: 1rem;
}
.ar-message-row--continuation + .ar-message-row:not(.ar-message-row--continuation) {
  margin-top: 1rem;
}
.ar-message-row:hover {
  background: rgba(0, 0, 0, 0.03);
}

.ar-message-row--focused {
  background: rgba(99, 102, 241, 0.08);
  box-shadow: inset 3px 0 0 rgba(99, 102, 241, 0.55);
}

.ar-message-row.is-highlight {
  animation: ar-message-highlight 2s ease-out forwards;
}
@keyframes ar-message-highlight {
  0%   { background: color-mix(in srgb, var(--ic-brand-500, #6366f1) 18%, transparent); }
  100% { background: transparent; }
}

.ar-message-meta {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
  margin-bottom: 0.2rem;
}
.ar-message-meta__sender {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--ic-neutral-900);
  letter-spacing: -0.012em;
}
.ar-message-meta__time {
  font-size: 0.72rem;
  color: var(--ic-text-tertiary);
}

.ar-message-row--agent {
  border-left: 2px solid var(--ar-agent-400, #22d3ee);
  padding-left: calc(1.25rem - 2px);
}

.ar-message-row--agent:hover {
  background: rgba(34, 211, 238, 0.05);
}

/* Continuation row (same sender, within 5 min) */
.ar-message-row--continuation {
  padding-top: 0.1rem;
  padding-bottom: 0.1rem;
}

.ar-message-row__cont-time {
  width: 36px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

.ar-message-row__cont-ts {
  font-size: 0.65rem;
  color: var(--ic-text-tertiary);
  opacity: 0;
  transition: opacity 80ms ease;
  white-space: nowrap;
}

.ar-message-row--continuation:hover .ar-message-row__cont-ts {
  opacity: 1;
}

/* Message delivery states */
.ar-message-row--sending {
  opacity: 1;
}
.ar-message-row--failed {
  opacity: 0.85;
  border-left: 3px solid var(--ic-danger-500, #ef4444);
  padding-left: calc(1.25rem - 3px);
}

.ar-message-status {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.7rem;
}
.ar-message-status--sending {
  color: var(--ic-text-tertiary, #94a3b8);
  line-height: 1;
}
.ar-sending-spinner {
  animation: ar-spin 0.8s linear infinite;
  transform-origin: center;
}
@keyframes ar-spin {
  to { transform: rotate(360deg); }
}
.ar-message-status--failed {
  color: var(--ic-danger-600, #dc2626);
}
.ar-message-retry {
  background: none;
  border: none;
  color: var(--ic-brand-600, #4f46e5);
  font-size: 0.7rem;
  cursor: pointer;
  text-decoration: underline;
  padding: 0;
}
.ar-message-retry:hover {
  color: var(--ic-brand-700, #4338ca);
}

/* Delivery failure notice */
.ar-delivery-failure {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.75rem;
  margin: 0.25rem 0;
  font-size: 0.78rem;
  color: var(--ic-warning-700);
  background: var(--ic-warning-50);
  border: 1px solid rgba(245, 158, 11, 0.2);
  border-radius: var(--ic-radius-md, 6px);
  animation: ar-fade-in 0.3s ease;
}
.ar-delivery-failure__icon {
  flex-shrink: 0;
  font-size: 0.9rem;
}
@keyframes ar-fade-in {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* History loader */
.ar-history-loader {
  text-align: center;
  padding: 0.75rem 0;
  font-size: 0.75rem;
  color: var(--ic-text-tertiary, #94a3b8);
}

.ar-unread-divider {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 1rem 0 0.85rem;
  color: var(--ic-brand-700, #4338ca);
}

.ar-unread-divider__line {
  flex: 1 1 auto;
  height: 1px;
  background: rgba(79, 70, 229, 0.2);
}

.ar-unread-divider__label {
  flex: 0 0 auto;
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  background: rgba(79, 70, 229, 0.08);
  color: var(--ic-brand-700, #4338ca);
}

/* "N new messages" floating badge */
.ar-new-messages-badge {
  position: absolute;
  bottom: calc(var(--ar-chat-composer-height, 80px) + var(--ar-mobile-keyboard-offset, 0px) + 0.5rem);
  left: 50%;
  transform: translateX(-50%);
  z-index: 5;
  padding: 0.35rem 1rem;
  border-radius: 999px;
  background: var(--ic-brand-600, #4f46e5);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.35);
  opacity: 0.35;
  transition: opacity 0.2s, transform 0.2s;
}
.ar-new-messages-badge:hover {
  opacity: 1;
  transform: translateX(-50%) scale(1.04);
}
.ar-new-messages-badge.hidden {
  display: none;
}

.ar-chat-composer {
  grid-row: 4;
  position: relative;
  z-index: 1;
  background: #ffffff;
  border-top: 1px solid var(--ic-neutral-200);
  box-shadow: 0 -1px 4px rgba(0, 0, 0, 0.04);
}

.ar-chat-composer__form {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  width: 100%;
}

.ar-chat-composer__row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: stretch;
  gap: 0.75rem;
  width: 100%;
}

.ar-chat-composer__field {
  min-width: 0;
  position: relative;
}

.ar-chat-input {
  width: 100%;
  background: #f8fafc;
  border-radius: 0.75rem;
  border: 1px solid var(--ic-neutral-200);
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.05);
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}

.ar-chat-input:focus {
  background: #ffffff;
  border-color: var(--ic-brand-400);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1), inset 0 1px 3px rgba(0, 0, 0, 0.03);
}

.ar-chat-composer__hint {
  color: var(--ic-text-tertiary);
  font-size: 0.72rem;
  margin: 0;
  flex: 1;
}

/* ================================================================
   Image Attachment Preview
   ================================================================ */
.ar-attachment-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 8px 0 4px;
}

.ar-attachment-preview:empty {
  display: none;
}

.ar-attachment-item {
  position: relative;
  width: 72px;
  height: 72px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--ic-surface-border, #e2e8f0);
  background: var(--ic-surface-sunken, #f8fafc);
  flex-shrink: 0;
}

.ar-attachment-item--file {
  width: min(100%, 360px);
  max-width: 360px;
  height: auto;
  min-height: 68px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px 10px 10px;
  border-radius: 14px;
  background:
    radial-gradient(circle at top right, rgba(99, 102, 241, 0.06), transparent 42%),
    linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
}

.ar-attachment-item__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.ar-attachment-item__remove {
  position: absolute;
  top: 3px;
  right: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.65);
  color: #fff;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  line-height: 1;
  padding: 0;
  transition: background 0.15s;
}

.ar-attachment-item__remove:hover {
  background: rgba(239, 68, 68, 0.85);
}

.ar-attachment-item__remove--file {
  position: static;
  margin-left: auto;
  flex-shrink: 0;
}

.ar-attachment-item__file-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.18), rgba(14, 165, 233, 0.14));
  color: #1d4ed8;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.02em;
  flex-shrink: 0;
}

.ar-attachment-item__file-meta {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.ar-attachment-item__file-name {
  margin: 0;
  min-width: 0;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--ic-text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ar-attachment-item__file-subtitle {
  margin: 0;
  font-size: 0.75rem;
  color: var(--ic-text-tertiary);
}

.ar-message-file-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.ar-message-file {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: min(100%, 360px);
  max-width: 360px;
  padding: 0.75rem 0.9rem;
  border: 1px solid var(--ic-surface-border, #e2e8f0);
  border-radius: 0.9rem;
  background:
    radial-gradient(circle at top right, rgba(99, 102, 241, 0.04), transparent 38%),
    linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s ease, background-color 0.15s ease, transform 0.15s ease;
}

.ar-message-file:hover {
  border-color: rgba(99, 102, 241, 0.28);
  transform: translateY(-1px);
}

.ar-message-file__badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  height: 28px;
  padding: 0 0.5rem;
  border-radius: 999px;
  background: rgba(59, 130, 246, 0.12);
  color: #1d4ed8;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  flex-shrink: 0;
}

.ar-message-file__name {
  flex: 1;
  min-width: 0;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--ic-text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ar-message-file__meta {
  font-size: 0.75rem;
  color: var(--ic-text-tertiary);
  flex-shrink: 0;
}

/* Drop overlay */
.ar-drop-overlay {
  position: absolute;
  inset: 0;
  background: color-mix(in srgb, var(--ic-brand-600) 8%, transparent);
  border: 2px dashed var(--ic-brand-500);
  border-radius: 12px;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s;
}

.ar-drop-overlay.is-active {
  opacity: 1;
}

.ar-drop-overlay__label {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--ic-brand-600);
  background: white;
  padding: 8px 16px;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

/* ── Message images (inline display) ──────────────────────────── */
.ar-message-images {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.ar-message-image-link {
  display: block;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--ic-surface-border, #e2e8f0);
  transition: opacity 0.15s;
}

.ar-message-image-link:hover {
  opacity: 0.85;
}

.ar-message-img {
  display: block;
  max-width: 160px;
  max-height: 160px;
  object-fit: contain;
  border-radius: 8px;
  cursor: zoom-in;
  transition: opacity 0.15s;
}
.ar-message-img:hover { opacity: 0.85; }

/* ── Lightbox ─────────────────────────────────────────────────────────── */
.ar-lightbox {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease;
}
.ar-lightbox--open {
  opacity: 1;
  pointer-events: auto;
}
.ar-lightbox__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
}
.ar-lightbox__stage {
  position: relative;
  z-index: 1;
  max-width: 90vw;
  max-height: 90vh;
  display: flex;
  align-items: center;
  justify-content: center;
}
.ar-lightbox__img {
  max-width: 90vw;
  max-height: 90vh;
  object-fit: contain;
  border-radius: 6px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.5);
  user-select: none;
}
.ar-lightbox__close {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 2;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255,255,255,0.12);
  border: none;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}
.ar-lightbox__close:hover { background: rgba(255,255,255,0.25); }
.ar-lightbox__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255,255,255,0.12);
  border: none;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}
.ar-lightbox__nav:hover { background: rgba(255,255,255,0.25); }
.ar-lightbox__nav--prev { left: 16px; }
.ar-lightbox__nav--next { right: 16px; }
.ar-lightbox__counter {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  color: rgba(255,255,255,0.7);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.ar-chat-send {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 3.25rem;
  min-height: 36px;
  align-self: stretch;
  border-radius: 0.75rem;
  flex-shrink: 0;
}

.ar-chat-composer__toolbar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.ar-chat-attach {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 0.5rem;
  color: var(--ic-text-tertiary);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: color 0.15s, background 0.15s;
  flex-shrink: 0;
}

.ar-chat-attach:hover {
  color: var(--ic-text-primary);
  background: var(--ic-surface-hover, rgba(0, 0, 0, 0.05));
}

.ar-chat-attach:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.ar-markdown {
  display: grid;
  gap: 0.7rem;
}

/* Heading hierarchy */
.ar-markdown__heading {
  margin: 0;
  font-weight: 700;
  color: var(--ic-neutral-900);
  line-height: 1.35;
}
.ar-markdown__heading--1 {
  font-size: 1.35rem;
  padding-bottom: 0.3rem;
  border-bottom: 1px solid rgba(99, 102, 241, 0.18);
  color: var(--ic-brand-700, #3730a3);
}
.ar-markdown__heading--2 {
  font-size: 1.15rem;
  padding-bottom: 0.2rem;
  border-bottom: 1px solid rgba(99, 102, 241, 0.12);
  color: var(--ic-brand-700, #3730a3);
}
.ar-markdown__heading--3 {
  font-size: 1.02rem;
}
.ar-markdown__heading--4,
.ar-markdown__heading--5,
.ar-markdown__heading--6 {
  font-size: 0.94rem;
  font-weight: 600;
  color: var(--ic-neutral-700);
}

.ar-markdown__paragraph {
  margin: 0;
  color: var(--ic-neutral-800);
}

/* Lists */
.ar-markdown__list {
  margin: 0;
  padding-left: 1.5rem;
  list-style: disc;
}
.ar-markdown__list li {
  padding: 0.08rem 0;
}
.ar-markdown__list li::marker {
  color: var(--ic-neutral-400);
}
.ar-markdown__list--ordered {
  list-style: decimal;
}
.ar-markdown__list--ordered li::marker {
  font-weight: 600;
  color: var(--ic-neutral-500);
}

/* Blockquote */
.ar-markdown__quote {
  margin: 0;
  padding: 0.5rem 0.9rem;
  border-left: 4px solid var(--ic-brand-500, #6366f1);
  background: var(--ic-neutral-50, rgba(15, 23, 42, 0.03));
  border-radius: 0 0.35rem 0.35rem 0;
  color: var(--ic-text-secondary);
  font-style: italic;
}

/* Inline code */
.ar-markdown__inline-code,
.ar-markdown__code code {
  font-family: var(--ic-font-mono);
}

.ar-markdown__inline-code {
  padding: 0.12rem 0.42rem;
  border-radius: 0.35rem;
  background: var(--ic-neutral-100, rgba(15, 23, 42, 0.06));
  border: 1px solid var(--ic-neutral-200, rgba(15, 23, 42, 0.08));
  font-size: 0.86em;
  color: var(--ic-neutral-800);
}

/* Code block */
.ar-markdown__code {
  margin: 0;
  padding: 0.9rem 1rem;
  border-radius: 0.55rem;
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: rgba(15, 23, 42, 0.94);
  color: rgba(248, 250, 252, 0.96);
  font-size: 0.86rem;
  line-height: 1.55;
  overflow-x: auto;
}

/* Horizontal rule */
.ar-markdown__hr {
  border: none;
  border-top: 1px solid var(--ic-neutral-200, rgba(15, 23, 42, 0.08));
  margin: 0.25rem 0;
}

.ar-markdown__table-wrap {
  overflow-x: auto;
  border-radius: 0.9rem;
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 252, 0.94));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

.ar-markdown__table {
  width: 100%;
  min-width: 24rem;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.ar-markdown__table-cell {
  padding: 0.72rem 0.9rem;
  border-top: 1px solid rgba(226, 232, 240, 0.9);
  vertical-align: top;
  text-align: left;
}

.ar-markdown__table-cell--head {
  border-top: none;
  font-weight: 700;
  color: var(--ic-neutral-900);
  background: linear-gradient(180deg, rgba(239, 246, 255, 0.98), rgba(241, 245, 249, 0.92));
}

.ar-markdown__table tbody tr:nth-child(even) .ar-markdown__table-cell {
  background: rgba(248, 250, 252, 0.78);
}

/* Inline text formatting — explicit so .ar-markdown is self-contained */
.ar-markdown strong {
  font-weight: 700;
  color: var(--ic-neutral-900);
}
.ar-markdown em {
  font-style: italic;
  color: var(--ic-neutral-700);
}
.ar-markdown del {
  text-decoration: line-through;
  color: var(--ic-neutral-400);
}

/* Links */
.ar-markdown__link {
  color: var(--ic-brand-600);
  text-decoration: underline;
  text-underline-offset: 0.14em;
}
.ar-markdown__link:hover {
  color: var(--ic-brand-700, #4338ca);
}

.ar-mention {
  display: inline-flex;
  align-items: center;
  padding: 0.02rem 0.38rem;
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.12);
  color: #1d4ed8;
  font-weight: 700;
}

/* ================================================================
   @Mention Autocomplete Dropdown
   ================================================================ */
.ar-mention-dropdown {
  position: absolute;
  bottom: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 50;
  background: #ffffff;
  border: 1px solid var(--ic-neutral-200);
  border-radius: 0.75rem;
  box-shadow:
    0 8px 24px -8px rgba(15, 23, 42, 0.18),
    0 2px 6px -2px rgba(15, 23, 42, 0.08);
  overflow: hidden;
  max-height: 240px;
  overflow-y: auto;
}

.ar-mention-dropdown[hidden] {
  display: none;
}

.ar-mention-dropdown__item {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.5rem 0.75rem;
  cursor: pointer;
  transition: background 0.1s;
}

.ar-mention-dropdown__item:hover,
.ar-mention-dropdown__item--active {
  background: var(--ic-neutral-100);
}

.ar-mention-dropdown__avatar {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: #ffffff;
  flex-shrink: 0;
  user-select: none;
}

.ar-mention-dropdown__avatar--user  { background: var(--ic-brand-600); }
.ar-mention-dropdown__avatar--agent { background: var(--ic-success-500); }

.ar-mention-dropdown__name {
  flex: 1;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--ic-text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ar-mention-dropdown__role {
  font-size: 0.72rem;
  color: var(--ic-text-tertiary);
  background: var(--ic-neutral-100);
  border-radius: 999px;
  padding: 0.1rem 0.5rem;
  flex-shrink: 0;
}

.ar-mention-dropdown__empty {
  padding: 0.75rem;
  text-align: center;
  color: var(--ic-text-tertiary);
  font-size: 0.8rem;
}

#turbo-progress-bar {
  height: 3px;
  border-radius: 999px;
  background: linear-gradient(90deg, #38bdf8 0%, #2563eb 55%, #0f766e 100%);
  box-shadow: 0 0 24px rgba(37, 99, 235, 0.45);
}

@media (max-width: 1280px) {
  .ar-kpi-grid--5 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 1024px) {
  .ar-channel-task-panel {
    margin: 0 1rem;
  }

  .ar-channel-task-panel__header,
  .ar-channel-task-panel__row {
    flex-direction: column;
  }

  .ar-channel-task-panel__meta {
    justify-items: start;
  }

  .ar-page-header {
    flex-direction: column;
  }

  .ar-kpi-grid--2,
  .ar-kpi-grid--3,
  .ar-kpi-grid--4,
  .ar-kpi-grid--5 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 1024px) {
  /* Override late-declared .ar-main so sidebar margin is removed on mobile */
  .ar-main {
    margin-left: 0 !important;
    padding-top: 3.5rem; /* hamburger button clearance */
  }
  .ar-main--chat {
    padding-top: 0 !important; /* chat uses its own header layout */
  }

  /* Shift chat header right on mobile so hamburger doesn't overlap */
  .ar-chat-header {
    padding-left: 3.5rem !important;
  }

  /* Task panel → overlay mode on tablet/mobile */
  .ar-task-panel {
    position: absolute;
    top: 0;
    right: 0;
    height: 100%;
    z-index: 20;
    box-shadow: -4px 0 16px rgba(0, 0, 0, 0.1);
  }
  .ar-task-panel.is-open {
    width: min(280px, 85vw);
    min-width: min(280px, 85vw);
  }

  .ar-channel-layout {
    position: relative;
  }
}

@media (max-width: 640px) {
  .ar-kpi-grid--2,
  .ar-kpi-grid--3,
  .ar-kpi-grid--4,
  .ar-kpi-grid--5 {
    grid-template-columns: 1fr;
  }

  /* Page header: stack + reduce size */
  .ar-page-header {
    flex-direction: column;
    gap: 0.75rem;
  }

  .ar-page-actions {
    width: 100%;
    flex-wrap: wrap;
  }

  .ar-page-title {
    font-size: 1.4rem;
  }

  .ar-page-subtitle {
    font-size: 0.82rem;
  }

  /* Content area padding */
  .ar-content-wrap {
    padding: 1rem;
  }

  /* Chat */
  .ar-chat-header,
  .ar-chat-composer,
  .ar-chat-stream {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
  }

  /* Chat header compact on mobile */
  .ar-chat-header {
    padding-top: 0.5rem !important;
    padding-bottom: 0.5rem !important;
    align-items: center !important;
  }

  .ar-chat-header__subtitle {
    display: none !important;
  }

  /* 모바일에서 에이전트 행 숨김 — 헤더 높이 절약 */
  .ar-chat-header__agents {
    display: none !important;
  }

  .ar-chat-header__actions {
    align-self: center;
  }

  .ar-chat-composer {
    padding: 0.5rem 0.75rem !important;
  }

  .ar-chat-composer__form {
    gap: 0.5rem;
  }

  .ar-chat-composer__row {
    grid-template-columns: 1fr auto;
  }

  .ar-chat-input {
    height: 36px;
    min-height: 36px !important;
    max-height: 100px;
    padding: 0.5rem 0.75rem !important;
    font-size: 0.875rem;
  }

  /* Task panel full-width overlay on phones */
  .ar-task-panel.is-open {
    width: 100%;
    min-width: 100%;
  }

  /* Auth card */
  .ar-auth__card {
    padding: 1.5rem;
    border-radius: var(--ic-radius-lg);
    margin: 1rem;
  }

  /* Stat widgets smaller text */
  .ar-stat-widget__value {
    font-size: 1.5rem;
  }

  /* Agent detail stat grid */
  .ar-stat-widget {
    padding: 0.75rem;
  }

  /* Panels */
  .ar-panel {
    border-radius: var(--ic-radius-md);
  }

  /* Filter input full width */
  .ar-filter-input {
    width: 100% !important;
  }
}

/* ================================================================
   Utility Classes  [U1: 인라인 스타일 → CSS 클래스 전환]
   ================================================================ */

/* Text color */
.ar-text-tertiary  { color: var(--ic-text-tertiary); }
.ar-text-secondary { color: var(--ic-text-secondary); }
.ar-text-primary   { color: var(--ic-text-primary); }
.ar-text-brand     { color: var(--ic-brand-600); }
.ar-text-agent     { color: var(--ar-agent-600); }
.ar-text-info      { color: var(--ic-info-500); }

/* Background */
.ar-bg-brand   { background: var(--ic-brand-600); }
.ar-bg-sunken  { background: var(--ic-surface-sunken); }
.ar-bg-border  { background: var(--ic-surface-border); }

/* Font */
.ar-font-mono  { font-family: var(--ic-font-mono); }
.ar-font-sans  { font-family: var(--ic-font-sans); }

/* Modal scaffold — 뷰에서 style="" 대체 */
.ar-modal-root {
  position: fixed;
  inset: 0;
  z-index: 220;
}
.ar-modal-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: rgba(15, 23, 42, 0.10);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
.ar-modal-center {
  position: relative;
  z-index: 2;
  min-height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.ar-modal-panel {
  background: #fff;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  box-shadow: 0 25px 50px -12px rgba(2, 6, 23, 0.35);
  box-sizing: border-box;
  max-height: min(92dvh, calc(100dvh - 32px));
  overflow-y: auto;
}
.ar-modal-panel--xs  { width: min(92vw, 520px); border-radius: 16px; }
.ar-modal-panel--sm  { width: min(92vw, 620px); }
.ar-modal-panel--sm-r { width: min(92vw, 620px); border-radius: 16px; }
.ar-modal-panel--md  { width: min(92vw, 760px); }
.ar-modal-panel--md2 { width: min(92vw, 820px); }
.ar-modal-panel--lg  { width: min(92vw, 900px); }
.ar-modal-panel--xl    { width: min(92vw, 960px); }
.ar-modal-panel--board { width: min(96vw, 1100px); max-height: calc(100dvh - 32px); display: flex; flex-direction: column; }

.ar-shortcuts {
  padding: 20px;
}

.ar-shortcuts__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.ar-shortcuts__eyebrow {
  margin: 0 0 4px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--ic-text-tertiary);
}

.ar-shortcuts__title {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
  color: var(--ic-text-primary);
}

.ar-shortcuts__close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--ic-surface-border);
  border-radius: 999px;
  background: #fff;
  color: var(--ic-text-secondary);
  cursor: pointer;
  flex-shrink: 0;
}

.ar-shortcuts__close:hover {
  background: var(--ic-surface-muted);
}

.ar-shortcuts__body {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.ar-shortcuts__description {
  margin: 0;
  font-size: 13px;
  line-height: 1.6;
  color: var(--ic-text-secondary);
}

.ar-shortcuts__group {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--ic-surface-border);
  border-radius: 14px;
  overflow: hidden;
  background: linear-gradient(180deg, rgba(248, 250, 252, 0.9) 0%, #ffffff 100%);
}

.ar-shortcuts__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
}

.ar-shortcuts__row + .ar-shortcuts__row {
  border-top: 1px solid var(--ic-surface-border);
}

.ar-shortcuts__label {
  font-size: 14px;
  font-weight: 500;
  color: var(--ic-text-primary);
}

.ar-shortcuts__keys {
  font-family: var(--ic-font-mono);
  font-size: 12px;
  font-weight: 700;
  color: var(--ic-brand-700);
  background: rgba(79, 70, 229, 0.08);
  border: 1px solid rgba(79, 70, 229, 0.16);
  border-radius: 999px;
  padding: 6px 10px;
  white-space: nowrap;
}

/* Avatar size variants */
.ar-avatar--16 { width: 16px; height: 16px; font-size: 6px; }
.ar-avatar--20 { width: 20px; height: 20px; font-size: 8px; }
.ar-avatar--28 { width: 28px; height: 28px; font-size: 10px; }
.ar-avatar--34 { width: 34px; height: 34px; font-size: 11px; }
.ar-avatar--36 { width: 36px; height: 36px; font-size: 12px; }
.ar-avatar--38 { width: 38px; height: 38px; font-size: 11px; }
.ar-avatar--48 { width: 48px; height: 48px; font-size: 18px; }

/* User avatar in message rows (rounded square) */
.ar-msg-avatar {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--ic-brand-600);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
  user-select: none;
  overflow: hidden;
}

/* Badge variants */
.ar-badge-border { background: var(--ic-surface-border); color: var(--ic-text-tertiary); }
.ar-badge-agent  { background: var(--ar-agent-50); color: var(--ar-agent-700); }

/* Profile Card Popover */
.ar-profile-card {
  position: absolute;
  width: 260px;
  background: #ffffff;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  mix-blend-mode: normal;
  isolation: isolate;
  border: 1px solid #e2e8f0;
  border-radius: var(--ic-radius-xl, 12px);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.18);
  overflow: hidden;
  z-index: 200;
  animation: ar-profile-card-in 0.15s ease-out;
}
@keyframes ar-profile-card-in {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}
.ar-profile-card__body {
  padding: 14px 16px 16px;
}
.ar-profile-card__header {
  display: flex;
  align-items: center;
  gap: 12px;
}
.ar-profile-card__avatar {
  width: 44px;
  height: 44px;
  border-radius: var(--ic-radius-lg);
  overflow: hidden;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--ic-brand-600), #7c3aed);
  color: #fff;
  font-size: 16px;
  font-weight: 700;
}
.ar-profile-card__avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.ar-profile-card__identity {
  min-width: 0;
  flex: 1;
}
.ar-profile-card__name-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 2px;
  flex-wrap: wrap;
}
.ar-profile-card__name {
  font-size: 14px;
  font-weight: 700;
  color: var(--ic-text-primary);
}
.ar-profile-card__sub {
  font-size: 11px;
  color: var(--ic-text-tertiary);
  margin-left: 4px;
}
.ar-profile-card__meta {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.ar-profile-card__meta-row {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--ic-text-secondary);
}
.ar-profile-card__meta-row svg {
  flex-shrink: 0;
  color: var(--ic-text-tertiary);
}
.ar-profile-card__meta-row--desc {
  font-size: 11px;
  line-height: 1.5;
  display: block;
  margin-top: 4px;
}
.ar-profile-card__desc {
  margin-top: 8px;
  font-size: 11px;
  color: var(--ic-text-secondary);
  line-height: 1.5;
}

.ar-profile-card__actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.ar-profile-card__dm-form { margin: 0; }
.ar-profile-card__dm-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 600;
  color: #fff;
  background: var(--ic-brand-600);
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: opacity 0.15s;
}
.ar-profile-card__dm-btn:hover { opacity: 0.85; }

.ar-profile-card__detail-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 600;
  color: var(--ic-text-secondary);
  background: #fff;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  text-decoration: none;
  transition: background-color 0.15s, border-color 0.15s, color 0.15s;
}

.ar-profile-card__detail-btn:hover {
  background: #f8fafc;
  border-color: #94a3b8;
  color: var(--ic-text-primary);
}

/* ================================================================
   Channel Layout — Chat + Task Panel Split
   ================================================================ */

/* Wrapper: flex row, fills full height */
.ar-channel-layout {
  display: flex;
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

.ar-channel-frame {
  display: flex;
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

/* Chat column (flex-1) */
.ar-channel-layout .ar-chat-shell {
  flex: 1;
  min-width: 0;
}

/* ── Task Panel ──────────────────────────────────────────────── */
.ar-task-panel {
  width: 0;
  min-width: 0;
  overflow: hidden;
  flex-shrink: 0;
  background: #ffffff;
  border-left: 1px solid var(--ic-neutral-200);
  display: flex;
  flex-direction: column;
  position: relative;
  transition: width 220ms cubic-bezier(0.4, 0, 0.2, 1),
              min-width 220ms cubic-bezier(0.4, 0, 0.2, 1);
}
.ar-task-panel.is-resizing {
  transition: none;
  user-select: none;
}

.ar-task-panel.is-open {
  width: 680px;
  min-width: 680px;
}

/* 리사이즈 핸들 */
.ar-task-panel__resize-handle {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  cursor: ew-resize;
  z-index: 10;
  background: transparent;
  transition: background 150ms;
}
.ar-task-panel__resize-handle::after {
  content: '';
  position: absolute;
  left: 1px;
  top: 50%;
  transform: translateY(-50%);
  width: 2px;
  height: 32px;
  border-radius: 2px;
  background: var(--ic-neutral-300);
  opacity: 0;
  transition: opacity 150ms;
}
.ar-task-panel__resize-handle:hover::after,
.ar-task-panel.is-resizing .ar-task-panel__resize-handle::after {
  opacity: 1;
}
.ar-task-panel__resize-handle:hover,
.ar-task-panel.is-resizing .ar-task-panel__resize-handle {
  background: rgba(99, 102, 241, 0.08);
}

/* 패널 상단 (헤더 + quick-add) */
.ar-task-panel__top {
  flex-shrink: 0;
  border-bottom: 1px solid var(--ic-neutral-200);
}

.ar-task-panel__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 1.36rem 1rem 0.9rem;
  border-bottom: none;
  flex-shrink: 0;
}

.ar-task-panel__title {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--ic-neutral-800);
  margin: 0;
  white-space: nowrap;
}

.ar-task-panel__close {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--ic-text-tertiary);
  display: flex;
  align-items: center;
  padding: 0.2rem;
  border-radius: 0.25rem;
  flex-shrink: 0;
  transition: color 100ms, background 100ms;
}
.ar-task-panel__close:hover {
  color: var(--ic-neutral-700);
  background: var(--ic-neutral-100);
}

.ar-task-panel__body {
  flex: 1;
  overflow-y: auto;
  padding: 0.75rem 0;
}

.ar-task-panel__section {
  padding: 0 0 0.75rem;
}

.ar-task-panel__section-label {
  padding: 0 1rem 0.4rem;
  font-size: 0.67rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ic-text-tertiary);
  margin: 0;
}

.ar-task-panel__list {
  display: flex;
  flex-direction: column;
}

.ar-task-panel__item {
  display: block;
  padding: 0.5rem 1rem;
  text-decoration: none;
  color: inherit;
  transition: background 80ms ease;
}
.ar-task-panel__item:hover {
  background: rgba(0, 0, 0, 0.03);
}
.ar-task-panel__item--done {
  opacity: 0.55;
}
.ar-task-panel__item--critical { border-left: 2px solid var(--ic-danger-500); }
.ar-task-panel__item--high     { border-left: 2px solid var(--ic-warning-500, #f59e0b); }
.ar-task-panel__item--medium   { border-left: 2px solid transparent; }
.ar-task-panel__item--low      { border-left: 2px solid transparent; }
.ar-task-panel__item--none     { border-left: 2px solid transparent; }

.ar-task-panel__item-header {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
}

.ar-task-panel__item-title {
  font-size: 0.82rem;
  line-height: 1.45;
  color: var(--ic-neutral-800);
  word-break: break-word;
}
.ar-task-panel__item--done .ar-task-panel__item-title {
  text-decoration: line-through;
}
.ar-task-panel__item-num {
  font-size: 0.68rem;
  font-family: ui-monospace, monospace;
  color: var(--ic-text-tertiary);
  margin-right: 0.15rem;
}
/* Chat message #t link */
.ar-task-mention {
  display: inline-flex;
  align-items: center;
  gap: 0.15rem;
  padding: 0.05rem 0.35rem;
  border-radius: 0.3rem;
  font-size: 0.8rem;
  font-weight: 500;
  font-family: ui-monospace, monospace;
  background: color-mix(in srgb, var(--ic-brand-600) 10%, transparent);
  color: var(--ic-brand-700);
  text-decoration: none;
  cursor: pointer;
}
.ar-task-mention:hover {
  background: color-mix(in srgb, var(--ic-brand-600) 18%, transparent);
}

.ar-task-panel__item-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.2rem;
  padding-left: 1.25rem;
}

.ar-task-panel__item-status {
  font-size: 0.68rem;
  color: var(--ic-text-tertiary);
}

.ar-task-panel__status-badge {
  font-size: 0.6rem;
  font-weight: 600;
  padding: 0.1rem 0.35rem;
  border-radius: 9999px;
  flex-shrink: 0;
  margin-left: auto;
}
.ar-task-panel__status-badge--todo        { background: #f1f5f9; color: #64748b; }
.ar-task-panel__status-badge--in_progress { background: #e0e7ff; color: #4338ca; }
.ar-task-panel__status-badge--in_review   { background: #fef3c7; color: #92400e; }

.ar-task-panel__done-divider {
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--ic-text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.5rem 0.75rem 0.2rem;
  border-top: 1px solid var(--ic-neutral-100);
  margin-top: 0.25rem;
}

/* 상태별 그룹 헤더 */
.ar-task-panel__group { margin-bottom: 0.5rem; }
.ar-task-panel__group-header {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.2rem 0.5rem;
  margin-bottom: 0.15rem;
}
.ar-task-panel__group-label {
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--ic-text-secondary);
}
.ar-task-panel__group-count {
  font-size: 0.62rem;
  color: var(--ic-text-tertiary);
  margin-left: 0.15rem;
}

/* 완료 태스크 접힘 그룹 */
.ar-task-panel__done-group {
  border-top: 1px solid var(--ic-neutral-100);
  margin-top: 0.25rem;
}
.ar-task-panel__done-summary {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.4rem 0.75rem;
  cursor: pointer;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--ic-text-tertiary);
  user-select: none;
  list-style: none;
}
.ar-task-panel__done-summary::-webkit-details-marker { display: none; }
.ar-task-panel__done-summary:hover { color: var(--ic-neutral-700); }
.ar-task-panel__done-count {
  margin-left: auto;
  font-weight: 500;
  font-size: 0.7rem;
  color: var(--ic-text-tertiary);
}
details[open] .ar-task-panel__done-chevron {
  transform: rotate(90deg);
}
.ar-task-panel__done-chevron {
  transition: transform 0.15s ease;
  flex-shrink: 0;
}

/* 현황판 모달 열기 버튼 */
.ar-task-panel__board-btn-row {
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--ic-neutral-100);
}
.ar-task-panel__board-btn {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.65rem;
  border-radius: 0.5rem;
  border: 1px solid var(--ic-neutral-200);
  background: var(--ic-surface-raised);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--ic-text-secondary);
  text-decoration: none;
  transition: background 0.12s, border-color 0.12s;
  width: 100%;
}
.ar-task-panel__board-btn:hover {
  background: var(--ic-neutral-50);
  border-color: var(--ic-brand-300);
  color: var(--ic-brand-600);
}

@media (max-width: 900px) {
  .ar-task-panel.is-open {
    width: 100vw;
    min-width: 0;
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    z-index: 40;
  }
}

/* ── 패널 뷰 래퍼 ───────────────────────────────── */
.ar-task-panel__view {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}
.ar-task-panel__view .ar-task-panel__body {
  flex: 1;
  min-height: 0;
}
.ar-task-panel__view--board {
  overflow-x: auto;
  overflow-y: auto;
  padding: 0.75rem;
  background: var(--ic-neutral-100);
  display: flex;
  flex-direction: column;
}
/* 높이 전달 체인: turbo-frame → div → kanban-wrap */
.ar-task-panel__view--board > turbo-frame {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.ar-task-panel__view--board > turbo-frame > div {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.ar-task-panel__view--board .ar-board-kanban-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.ar-task-panel__view--board .ar-board-kanban {
  flex: 1;
  min-height: 0;
  grid-template-columns: repeat(4, minmax(195px, 1fr));
  align-items: stretch;
}
.ar-task-panel__view--board .ar-board-kanban__col {
  background: #fff;
}

/* ── 현황판 로딩 스피너 ─────────────────────────── */
@keyframes ar-spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}
.ar-spin {
  animation: ar-spin 0.8s linear infinite;
}
.ar-task-panel__board-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 120px;
  color: var(--ic-text-tertiary);
}

/* ── 현황판 수직 스택 (패널용) ───────────────────── */
.ar-bss {
  padding: 0.5rem 0;
  flex: 1;
  position: relative;
}
.ar-bss__section {
  border-bottom: 1px solid var(--ic-neutral-100);
  padding-bottom: 0.25rem;
  margin-bottom: 0.25rem;
}
.ar-bss__section:last-of-type {
  border-bottom: none;
}
.ar-bss__header,
.ar-bss__done-header {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.75rem 0.35rem;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--ic-text-secondary);
  list-style: none;
  user-select: none;
}
/* details-marker 숨김 (활성 섹션 <summary> 용) */
.ar-bss__header::-webkit-details-marker { display: none; }
.ar-bss__section[open] .ar-bss__chevron {
  transform: rotate(180deg);
}
.ar-bss__chevron {
  transition: transform 150ms;
  color: var(--ic-text-tertiary);
  cursor: pointer;
  flex-shrink: 0;
}
.ar-bss__dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}
.ar-bss__label {
  flex: 1;
}
.ar-bss__count {
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--ic-text-tertiary);
  background: var(--ic-neutral-100);
  border-radius: 999px;
  padding: 0 0.4rem;
  line-height: 1.6;
}
.ar-bss__list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.5rem;
  padding: 0 0.75rem 0.75rem;
}
/* 패널 내 tpk 카드 높이 확장 */
.ar-bss__list .ar-tpk-card {
  padding: 0.65rem 0.6rem;
  min-height: 68px;
}
/* 패널 카드 제목: flex → block, 2줄 말줄임 */
.ar-bss__list .ar-tpk-card__title {
  display: block;
}
.ar-bss__list .ar-tpk-card__title-text {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  white-space: normal;
  word-break: break-word;
}
/* 빈 섹션 메시지 */
.ar-bss__empty {
  font-size: 0.72rem;
  color: var(--ic-text-tertiary);
  padding: 0.5rem 0.75rem 0.75rem;
  text-align: center;
}
.ar-bss__row {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 0.45rem 0.5rem;
  text-decoration: none;
  border-left: 2px solid transparent;
  border-radius: 0.5rem;
  background: var(--ic-surface-raised);
  border: 1px solid var(--ic-neutral-150, #e8ecf0);
  transition: background 0.1s, border-color 0.1s;
  min-width: 0;
}
.ar-bss__row:hover {
  background: var(--ic-neutral-50);
  border-color: var(--ic-neutral-300);
}
.ar-bss__row--active {
  border-left-color: var(--ic-brand-500);
  border-color: var(--ic-brand-200, #c7d2fe);
  background: var(--ic-brand-50, #eef2ff);
}
.ar-bss__row--blocked {
  opacity: 0.65;
}
.ar-bss__row--done {
  opacity: 0.6;
}
.ar-bss__row-main {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  min-width: 0;
}
.ar-bss__num {
  font-size: 0.68rem;
  color: var(--ic-text-tertiary);
  flex-shrink: 0;
}
.ar-bss__title {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--ic-text-primary);
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ar-bss__row--done .ar-bss__title {
  text-decoration: line-through;
  color: var(--ic-text-tertiary);
}
.ar-bss__blocked-icon {
  color: var(--ic-warning-500, #f59e0b);
  flex-shrink: 0;
}
.ar-bss__meta {
  display: flex;
  align-items: center;
  gap: 0.3rem;
}
.ar-bss__avatar {
  width: 14px;
  height: 14px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 7px;
  font-weight: 800;
  color: #fff;
  flex-shrink: 0;
}
.ar-bss__assignee {
  font-size: 0.7rem;
  color: var(--ic-text-secondary);
}
.ar-bss__activity {
  font-size: 0.68rem;
  color: var(--ic-brand-600);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 120px;
}

/* ── 채널 현황판 모달 (wide) ── */
.ar-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100vw;
  height: 100vh;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(15, 23, 42, 0.68);
}
.ar-modal--wide > div {
  max-width: 1100px;
}
.ar-modal > div {
  background: #fff;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  box-shadow: 0 20px 60px rgba(0,0,0,0.18);
  width: 100%;
  max-height: 92vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.ar-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.875rem 1.25rem;
  border-bottom: 1px solid #e2e8f0;
  flex-shrink: 0;
}
.ar-modal__title {
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--ic-text-primary);
  margin: 0;
}
.ar-modal__actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}
.ar-modal__close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border: none;
  background: transparent;
  border-radius: 0.375rem;
  color: var(--ic-text-secondary);
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.1s;
}
.ar-modal__close:hover {
  background: var(--ic-neutral-100);
  color: var(--ic-text-primary);
}
.ar-modal__body--board {
  padding: 1.25rem 1.5rem;
  overflow: auto;
  flex: 1;
}
.ar-modal__title-group {
  flex: 1;
  min-width: 0;
}
.ar-modal__subtitle {
  margin: 0;
  font-size: 0.75rem;
  color: var(--ic-text-tertiary);
}

/* 현황판 탭 */
.ar-board-tabs {
  display: flex;
  gap: 0.25rem;
  border-radius: 0.5rem;
  background: var(--ic-neutral-100);
  padding: 0.2rem;
}
.ar-board-tab {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.3rem 0.7rem;
  border-radius: 0.35rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--ic-text-secondary);
  text-decoration: none;
  transition: background 0.12s, color 0.12s;
}
.ar-board-tab:hover { background: rgba(255,255,255,0.7); color: var(--ic-neutral-800); }
.ar-board-tab.is-active { background: #fff; color: var(--ic-brand-600); box-shadow: 0 1px 3px rgba(0,0,0,0.08); }

/* 현황판 칸반 레이아웃 */
.ar-board-kanban {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  min-height: 300px;
}
.ar-board-kanban__col {
  background: var(--ic-surface-sunken);
  border-radius: 0.75rem;
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.ar-board-kanban__col-header {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0 0.25rem 0.4rem;
  border-bottom: 1px solid var(--ic-neutral-200);
  flex-shrink: 0;
}
.ar-board-kanban__col-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.ar-board-kanban__col-dot--pulse {
  animation: ar-pulse-dot 2s ease-in-out infinite;
}
.ar-board-kanban__col-label {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--ic-neutral-700);
}
/* 진행 중 컬럼 강조 */
.ar-board-kanban__col--in_progress {
  background: rgba(99, 102, 241, 0.06);
  border: 1.5px solid rgba(99, 102, 241, 0.2);
}
.ar-board-kanban__col--in_progress .ar-board-kanban__col-header {
  border-bottom-color: rgba(99, 102, 241, 0.2);
}
.ar-board-kanban__col--in_progress .ar-board-kanban__col-label {
  color: var(--ic-brand-600);
}
.ar-board-kanban__col--in_progress .ar-tpk-card {
  background: rgba(238, 242, 255, 0.6);
  border-left-width: 4px;
  box-shadow: 0 1px 4px rgba(99, 102, 241, 0.1);
}
@keyframes ar-card-active-glow {
  0%, 100% { box-shadow: 0 1px 8px rgba(99, 102, 241, 0.12); }
  50% { box-shadow: 0 4px 20px rgba(99, 102, 241, 0.42), 0 0 0 1px rgba(99, 102, 241, 0.12); }
}
/* 검토 중 컬럼 강조 */
.ar-board-kanban__col--in_review {
  background: rgba(245, 158, 11, 0.04);
  border: 1.5px solid rgba(245, 158, 11, 0.18);
}
.ar-board-kanban__col--in_review .ar-board-kanban__col-label { color: #b45309; }
.ar-board-kanban__col--in_review .ar-board-kanban__col-count {
  background: rgba(245, 158, 11, 0.15);
  color: #92400e;
}
.ar-board-kanban__col--in_review .ar-tpk-card {
  background: rgba(255, 251, 235, 0.7);
  border-left-width: 4px;
  border-left-color: #f59e0b;
}
@keyframes ar-card-review-glow {
  0%, 100% { box-shadow: 0 1px 8px rgba(245, 158, 11, 0.10); }
  50% { box-shadow: 0 4px 18px rgba(245, 158, 11, 0.38), 0 0 0 1px rgba(245, 158, 11, 0.10); }
}
.ar-board-kanban__col--in_progress .ar-board-kanban__col-count {
  background: rgba(99, 102, 241, 0.15);
  color: var(--ic-brand-700, #4338ca);
}
@keyframes ar-pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.55; transform: scale(1.25); }
}
.ar-board-kanban__col-count {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--ic-text-tertiary);
  background: var(--ic-neutral-200);
  padding: 0.05rem 0.4rem;
  border-radius: 999px;
}
.ar-board-kanban__col-assignees {
  display: flex;
  align-items: center;
  gap: -0.3rem;
  margin-left: auto;
}
.ar-board-kanban__col-assignees .ar-tpk-card__avatar--sm {
  width: 18px;
  height: 18px;
  font-size: 9px;
  margin-left: -4px;
  border: 1.5px solid #fff;
  flex-shrink: 0;
}
.ar-board-kanban__col-more {
  font-size: 0.65rem;
  color: var(--ic-text-tertiary);
  margin-left: 2px;
}
.ar-board-kanban__list {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  flex: 1;
}
.ar-tpk-card--done {
  opacity: 0.55;
  filter: grayscale(25%);
}

/* 완료 더 보기 */
.ar-board-done-more {
  border-top: 1px solid var(--ic-neutral-200);
  margin-top: 0.25rem;
}
.ar-board-done-more__toggle,
.ar-board-done-more__btn {
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--ic-text-tertiary);
  padding: 0.35rem 0.5rem;
  list-style: none;
  user-select: none;
}
.ar-board-done-more__toggle:hover,
.ar-board-done-more__btn:hover { color: var(--ic-neutral-700); }
.ar-board-done-more__toggle::-webkit-details-marker,
.ar-board-done-more__btn::-webkit-details-marker { display: none; }
.ar-board-done-more__chevron {
  flex-shrink: 0;
  transition: transform 0.2s ease;
}
.ar-board-done-more[open] .ar-board-done-more__chevron { transform: rotate(180deg); }
.ar-board-done-more__list {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  padding-top: 0.25rem;
}

.ar-task-panel__item-assignee {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.68rem;
  color: var(--ic-text-secondary);
}

/* Status dots in task panel */
.ar-task-panel__status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 0.25rem;
  background: var(--ic-neutral-300);
}
.ar-task-panel__status-dot--todo        { background: var(--ic-neutral-400); }
.ar-task-panel__status-dot--in_progress { background: var(--ic-info-500); }
.ar-task-panel__status-dot--in_review   { background: #a855f7; }
.ar-task-panel__status-dot--done        { background: var(--ic-success-500); }

/* Agent dot */
.ar-task-panel__agent-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--ar-agent-500);
  flex-shrink: 0;
}

/* Empty state */
.ar-task-panel__empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 2rem 1rem;
  color: var(--ic-text-tertiary);
  font-size: 0.8rem;
  text-align: center;
  gap: 0.4rem;
}

/* Footer */
.ar-task-panel__footer {
  padding: 0.65rem 1rem;
  border-top: 1px solid var(--ic-neutral-200);
  flex-shrink: 0;
}

.ar-task-panel__footer-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.74rem;
  color: var(--ic-brand-600);
  text-decoration: none;
  font-weight: 500;
}
.ar-task-panel__footer-link:hover {
  text-decoration: underline;
}

/* 통합 패널 보드 바디 (스크롤 영역) */
.ar-task-panel__board-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}

/* Quick-add form */
.ar-task-panel__quick-add {
  padding: 0 1rem 1rem;
  border-bottom: 1px solid var(--ic-neutral-200);
  flex-shrink: 0;
}

.ar-task-panel__quick-row {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.ar-task-panel__quick-input {
  flex: 1;
  min-width: 0;
  padding: 0.4rem 0.6rem;
  font-size: 0.78rem;
  border: 1px solid var(--ic-neutral-200);
  border-radius: 0.4rem;
  background: #ffffff;
  outline: none;
  transition: border-color 100ms ease;
}
.ar-task-panel__quick-input:focus {
  border-color: var(--ic-brand-500);
  box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.12);
}
.ar-task-panel__quick-input::placeholder {
  color: var(--ic-text-tertiary);
}

.ar-task-panel__quick-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 0.35rem;
  background: var(--ic-brand-600);
  color: #ffffff;
  cursor: pointer;
  flex-shrink: 0;
  transition: opacity 100ms ease;
}
.ar-task-panel__quick-btn:hover {
  opacity: 0.85;
}

/* Status button (clickable dot) */
.ar-task-panel__status-btn {
  background: none;
  border: none;
  padding: 0.15rem;
  cursor: pointer;
  border-radius: 50%;
  display: flex;
  align-items: center;
  flex-shrink: 0;
  transition: transform 100ms ease;
}
.ar-task-panel__status-btn:hover {
  transform: scale(1.4);
}
.ar-task-panel__status-btn:hover .ar-task-panel__status-dot {
  box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.08);
}

/* ── 패널 내 스윔레인 ────────────────────────────── */
.ar-panel-swimlane {
  padding: 0.5rem 0;
}
.ar-panel-swimlane__row {
  border-bottom: 1px solid var(--ic-neutral-100);
  padding: 0.5rem 0.75rem;
}
.ar-panel-swimlane__row:last-child { border-bottom: none; }
.ar-panel-swimlane__row--overload {
  background: rgba(239, 68, 68, 0.03);
  border-left: 2px solid #ef4444;
  padding-left: calc(0.75rem - 2px);
}
.ar-panel-swimlane__assignee {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--ic-neutral-700);
  margin-bottom: 0.4rem;
}
.ar-panel-swimlane__assignee-avatar {
  width: 20px;
  height: 20px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 8px;
  font-weight: 800;
  color: #fff;
  flex-shrink: 0;
}
.ar-panel-swimlane__cols {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.25rem;
}
.ar-panel-swimlane__col-header {
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ic-text-tertiary);
  padding-bottom: 0.2rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ar-panel-swimlane__chip {
  display: block;
  padding: 0.2rem 0.3rem;
  border-radius: 0.25rem;
  font-size: 0.65rem;
  line-height: 1.3;
  color: var(--ic-neutral-700);
  background: var(--ic-neutral-100);
  text-decoration: none;
  border-left: 2px solid var(--ic-neutral-300);
  margin-bottom: 0.15rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: background 80ms;
}
.ar-panel-swimlane__chip:hover { background: var(--ic-neutral-200); }
.ar-panel-swimlane__chip--in_progress { border-left-color: var(--ic-brand-500); }
.ar-panel-swimlane__chip--in_review   { border-left-color: #f59e0b; }
.ar-panel-swimlane__chip--done        { border-left-color: #10b981; opacity: 0.6; }
.ar-panel-swimlane__chip--todo        { border-left-color: var(--ic-neutral-400); }
.ar-panel-swimlane__empty-col {
  font-size: 0.62rem;
  color: var(--ic-neutral-300);
  text-align: center;
  padding: 0.25rem 0;
}


/* ── 태스크 폼 의존성 섹션 ────────────────────────── */
.ar-dep-list {
  max-height: 10rem;
  overflow-y: auto;
  border: 1px solid var(--ic-neutral-200);
  border-radius: 0.5rem;
  divide-color: var(--ic-neutral-100);
}
.ar-dep-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.75rem;
  border-bottom: 1px solid var(--ic-neutral-100);
  cursor: pointer;
  transition: background 80ms;
}
.ar-dep-item:last-child { border-bottom: none; }
.ar-dep-item:hover { background: var(--ic-neutral-50); }
.ar-dep-item input[type="checkbox"] {
  width: 13px;
  height: 13px;
  flex-shrink: 0;
  accent-color: var(--ic-brand-600);
}
.ar-dep-item__num {
  font-size: 0.67rem;
  font-family: ui-monospace, monospace;
  color: var(--ic-text-tertiary);
  flex-shrink: 0;
}
.ar-dep-item__title {
  flex: 1;
  font-size: 0.8rem;
  color: var(--ic-neutral-800);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ar-dep-item__badge {
  font-size: 0.63rem;
  padding: 0.1rem 0.4rem;
  border-radius: 9999px;
  flex-shrink: 0;
}

/* ── Pagy pagination ─────────────────────────────── */
.pagy.nav {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0;
  margin: 0;
}
.pagy.nav a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2rem;
  height: 2rem;
  padding: 0 0.5rem;
  border-radius: 0.4rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--ic-text-secondary);
  text-decoration: none;
  border: 1px solid transparent;
  transition: background 100ms ease, color 100ms ease, border-color 100ms ease;
  cursor: pointer;
}
.pagy.nav a:hover:not([aria-disabled="true"]) {
  background: var(--ic-brand-50);
  color: var(--ic-brand-700);
  border-color: var(--ic-brand-200);
}
.pagy.nav a.current {
  background: var(--ic-brand-600);
  color: #fff;
  border-color: var(--ic-brand-600);
  cursor: default;
  font-weight: 600;
}
.pagy.nav a[aria-disabled="true"]:not(.current) {
  color: var(--ic-text-tertiary);
  cursor: default;
}
.pagy.nav a.gap {
  color: var(--ic-text-tertiary);
  cursor: default;
  letter-spacing: 0.05em;
}

/* ── Task reference badges in chat ── */
.ar-task-ref {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  padding: 0.1rem 0.4rem;
  border-radius: 0.3rem;
  background: rgba(79, 70, 229, 0.08);
  color: var(--ic-brand-700);
  font-size: 0.85em;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background 80ms ease;
}
.ar-task-ref:hover {
  background: rgba(79, 70, 229, 0.16);
  text-decoration: none;
}
.ar-task-ref__icon {
  flex-shrink: 0;
  vertical-align: middle;
}
.ar-task-ref--unresolved {
  background: rgba(148, 163, 184, 0.12);
  color: var(--ic-text-tertiary);
  cursor: default;
}


.ar-profile-card__status-dot {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  margin-left: 2px;
}
.ar-profile-card__task-link {
  color: #6366f1;
  font-weight: 600;
  text-decoration: none;
}
.ar-profile-card__task-link:hover {
  text-decoration: underline;
}

/* ── 패널 칸반 (ar-tpk) ──────────────────────────── */
.ar-tpk-group {
  padding: 0 0.75rem;
  margin-bottom: 0.75rem;
}
.ar-tpk-group__header {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.35rem;
}
.ar-tpk-status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}
.ar-tpk-status-dot--todo        { background: #94a3b8; }
.ar-tpk-status-dot--in_progress { background: #6366f1; }
.ar-tpk-status-dot--in_review   { background: #f59e0b; }
.ar-tpk-status-dot--done        { background: #10b981; }
.ar-tpk-group__label {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--ic-text-secondary);
  flex: 1;
}
.ar-tpk-group__count {
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--ic-text-tertiary);
  background: var(--ic-neutral-100);
  border-radius: 9999px;
  padding: 0 0.4rem;
}
.ar-tpk-group__list { display: flex; flex-direction: column; gap: 0.25rem; }

.ar-tpk-card {
  display: block;
  padding: 0.35rem 0.5rem;
  border-radius: 0.375rem;
  background: white;
  border: 1px solid var(--ic-neutral-150, #e8ecf0);
  border-left: 3px solid var(--ic-neutral-300);
  text-decoration: none;
  transition: background 80ms, box-shadow 80ms;
  animation: card-enter 0.2s ease-out;
}
.ar-tpk-card:hover { background: var(--ic-neutral-50); box-shadow: 0 1px 3px rgba(0,0,0,0.06); }
.ar-tpk-card--critical { border-left-color: #ef4444; }
.ar-tpk-card--high     { border-left-color: #f97316; }
.ar-tpk-card--medium   { border-left-color: #6366f1; }
.ar-tpk-card--low      { border-left-color: #94a3b8; }
.ar-tpk-card--done     { opacity: 0.6; filter: grayscale(20%); }
/* 진행 중 카드: 부드러운 indigo glow pulse */
@keyframes ar-card-active-glow {
  0%, 100% {
    box-shadow: -4px 0 0 0 #6366f1, 0 1px 8px rgba(99,102,241,0.12);
    background: rgba(224,231,255,0.25);
  }
  50% {
    box-shadow: -4px 0 0 0 #818cf8, 0 4px 20px rgba(99,102,241,0.42), 0 0 0 1px rgba(99,102,241,0.12);
    background: rgba(224,231,255,0.50);
  }
}
.ar-tpk-card--in_progress {
  border-left-color: #6366f1;
  border-left-width: 4px;
  position: relative;
  overflow: hidden;
  animation: card-enter 0.2s ease-out, ar-card-active-glow 2s ease-in-out infinite;
}
@keyframes ar-card-shimmer {
  0%   { transform: translateX(-100%); }
  100% { transform: translateX(500%); }
}
.ar-tpk-card--in_progress::after {
  content: '';
  position: absolute;
  top: 0; bottom: 0; left: 0;
  width: 25%;
  background: linear-gradient(90deg, transparent, rgba(99,102,241,0.09), transparent);
  animation: ar-card-shimmer 4.5s ease-in-out infinite;
  pointer-events: none;
}
/* 검토 중 카드: 부드러운 amber glow pulse */
@keyframes ar-card-review-glow {
  0%, 100% {
    box-shadow: -4px 0 0 0 #f59e0b, 0 1px 8px rgba(245,158,11,0.10);
    background: rgba(254,243,199,0.25);
  }
  50% {
    box-shadow: -4px 0 0 0 #fbbf24, 0 4px 18px rgba(245,158,11,0.38), 0 0 0 1px rgba(245,158,11,0.10);
    background: rgba(254,243,199,0.48);
  }
}
.ar-tpk-card--in_review {
  border-left-color: #f59e0b;
  border-left-width: 4px;
  position: relative;
  overflow: hidden;
  animation: card-enter 0.2s ease-out, ar-card-review-glow 2.5s ease-in-out infinite;
}
.ar-tpk-card--in_review::after {
  content: '';
  position: absolute;
  top: 0; bottom: 0; left: 0;
  width: 25%;
  background: linear-gradient(90deg, transparent, rgba(245,158,11,0.09), transparent);
  animation: ar-card-shimmer 5s ease-in-out infinite;
  pointer-events: none;
}
/* 완료 더 보기 토글 */
.ar-board-done-more { margin-top: 0.25rem; }
.ar-board-done-more__btn {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.68rem;
  color: var(--ic-text-tertiary);
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  list-style: none;
  border-radius: 4px;
  user-select: none;
}
.ar-board-done-more__btn:hover { color: var(--ic-text-secondary); background: var(--ic-neutral-50); }
.ar-board-done-more__btn::-webkit-details-marker { display: none; }
.ar-board-done-more__chevron { transition: transform 0.15s ease; flex-shrink: 0; }
.ar-board-done-more[open] .ar-board-done-more__chevron { transform: rotate(180deg); }

.ar-tpk-card__title {
  font-size: 0.74rem;
  font-weight: 500;
  color: var(--ic-neutral-800);
  display: flex;
  align-items: center;
  gap: 0.25rem;
  line-height: 1.35;
}
.ar-tpk-card__num {
  font-size: 0.62rem;
  font-family: ui-monospace, monospace;
  color: var(--ic-text-tertiary);
  flex-shrink: 0;
}
.ar-tpk-card__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 0.25rem;
  gap: 0.25rem;
}
.ar-tpk-card__meta {
  display: flex;
  align-items: center;
  gap: 0.3rem;
}
.ar-tpk-card__dep-badge {
  font-size: 0.6rem;
  color: var(--ic-brand-500);
  background: rgba(99, 102, 241, 0.08);
  padding: 0.1rem 0.3rem;
  border-radius: 4px;
  white-space: nowrap;
  flex-shrink: 0;
}
.ar-tpk-card__dep-badge--blocked {
  color: #ef4444;
  background: rgba(239, 68, 68, 0.08);
}
.ar-tpk-card__dep-badge--dep {
  color: #10b981;
  background: rgba(16, 185, 129, 0.08);
}
/* 칸반 SVG 화살표 오버레이 */
.ar-board-arrows-svg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  overflow: visible;
  z-index: 5;
}
/* 태스크 관계 (선행/후행) */
.ar-tpk-card__rels {
  display: flex;
  flex-wrap: wrap;
  gap: 0.2rem;
  margin-top: 0.2rem;
}
.ar-tpk-card__rel {
  font-size: 0.58rem;
  font-weight: 600;
  padding: 0.05rem 0.3rem;
  border-radius: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
.ar-tpk-card__rel--blocking {
  color: #ef4444;
  background: rgba(239, 68, 68, 0.08);
}
.ar-tpk-card__rel--dependent {
  color: #10b981;
  background: rgba(16, 185, 129, 0.08);
}
.ar-tpk-card__avatar {
  width: 14px;
  height: 14px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 7px;
  font-weight: 800;
  color: #fff;
  flex-shrink: 0;
}
.ar-tpk-card__agent {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 5px;
  padding-top: 4px;
  border-top: 1px solid rgba(148, 163, 184, 0.12);
}
.ar-tpk-card__activity {
  font-size: 0.58rem;
  color: var(--ic-text-tertiary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 72px;
  margin-left: auto;
  flex-shrink: 1;
}
.ar-tpk-card__assignee {
  font-size: 0.62rem;
  color: var(--ic-text-tertiary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ar-tpk-card__agent-bullet {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #6366f1;
  flex-shrink: 0;
  display: inline-block;
}
/* col-dot 기본 */
.ar-board-kanban__col-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}
/* ── 에이전트×상태 스윔레인 칸반 (ar-swim-kanban) ── */
.ar-swim-kanban {
  display: grid;
  grid-template-columns: 140px repeat(4, 1fr);
  gap: 0;
  min-width: 0;
  border: 1px solid var(--ic-neutral-200);
  border-radius: 0.75rem;
  overflow: hidden;
}
.ar-swim-kanban__header-row {
  display: contents;
}
.ar-swim-kanban__assignee-cell--header {
  background: var(--ic-surface-sunken);
  border-bottom: 2px solid var(--ic-neutral-200);
  border-right: 1px solid var(--ic-neutral-200);
}
.ar-swim-kanban__col-header {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.6rem 0.75rem;
  background: var(--ic-surface-sunken);
  border-bottom: 2px solid var(--ic-neutral-200);
  border-right: 1px solid var(--ic-neutral-200);
  font-size: 0.78rem;
  font-weight: 700;
}
.ar-swim-kanban__col-header:last-child { border-right: none; }
.ar-swim-kanban__col-header--in_progress {
  background: rgba(99,102,241,0.07);
  border-bottom-color: rgba(99,102,241,0.3);
}
.ar-swim-kanban__col-header--in_progress .ar-swim-kanban__col-label {
  color: var(--ic-brand-600);
}
.ar-swim-kanban__col-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.ar-swim-kanban__col-label {
  color: var(--ic-neutral-700);
}
.ar-swim-kanban__col-count {
  margin-left: auto;
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--ic-text-tertiary);
  background: var(--ic-neutral-200);
  padding: 0.05rem 0.4rem;
  border-radius: 999px;
}
.ar-swim-kanban__col-header--in_progress .ar-swim-kanban__col-count {
  background: rgba(99,102,241,0.15);
  color: var(--ic-brand-700, #4338ca);
}
.ar-swim-kanban__row {
  display: contents;
}
.ar-swim-kanban__assignee-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 0.3rem;
  padding: 0.65rem 0.5rem 0.65rem;
  background: var(--ic-surface-sunken);
  border-right: 1px solid var(--ic-neutral-200);
  border-bottom: 1px solid var(--ic-neutral-100);
}
.ar-swim-kanban__avatar {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 800;
  color: #fff;
  flex-shrink: 0;
}
.ar-swim-kanban__name {
  font-size: 0.67rem;
  font-weight: 600;
  color: var(--ic-text-secondary);
  text-align: center;
  word-break: break-all;
  line-height: 1.2;
}
.ar-swim-kanban__cell {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  padding: 0.5rem 0.5rem;
  border-right: 1px solid var(--ic-neutral-100);
  border-bottom: 1px solid var(--ic-neutral-100);
  min-height: 60px;
  background: #fff;
}
.ar-swim-kanban__cell:last-child { border-right: none; }
.ar-swim-kanban__cell--in_progress {
  background: rgba(238,242,255,0.4);
}
.ar-swim-kanban__empty-cell {
  flex: 1;
}

/* ── 패널 그래프 (ar-tpg) ──────────────────────────── */
.ar-tpg-wrapper {
  display: flex;
  flex-direction: column;
  height: 100%;
}
.ar-tpg-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  padding: 0.5rem 0.75rem 0.25rem;
  flex-shrink: 0;
}
.ar-tpg-container {
  flex: 1;
  overflow: auto;
  padding: 0.5rem;
}

/* ── Channel Settings Tabs ─────────────────────────────────────────────── */
.ar-settings-tabs {
  display: flex;
  background: #f1f5f9;
  border-radius: 8px;
  padding: 3px;
  gap: 2px;
}
.ar-settings-tab {
  flex: 1;
  padding: 6px 10px;
  font-size: 0.8125rem;
  font-weight: 500;
  color: #64748b;
  border-radius: 6px;
  cursor: pointer;
  background: transparent;
  border: none;
  transition: color 0.15s, background 0.15s, box-shadow 0.15s;
  white-space: nowrap;
  text-align: center;
}
.ar-settings-tab:hover {
  color: #475569;
  background: rgba(255,255,255,0.6);
}
.ar-settings-tab.is-active {
  background: #fff;
  color: #0f172a;
  box-shadow: 0 1px 3px rgba(0,0,0,0.10), 0 1px 2px rgba(0,0,0,0.06);
}
.ar-settings-tab--danger { color: #f87171; }
.ar-settings-tab--danger:hover {
  color: #dc2626;
  background: rgba(255,255,255,0.6);
}
.ar-settings-tab--danger.is-active {
  background: #fff;
  color: #dc2626;
  box-shadow: 0 1px 3px rgba(0,0,0,0.10), 0 1px 2px rgba(0,0,0,0.06);
}

/* ── Settings Sections (잠자기 + 위험 구역 분리) ── */
.ar-settings-section {
  padding: 16px 20px;
}
.ar-settings-section + .ar-settings-section {
  border-top: 1px solid var(--ic-surface-border, #e2e8f0);
}
.ar-settings-section__title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ic-text-tertiary, #94a3b8);
  margin-bottom: 10px;
}

/* ── Snooze Toggle Row ── */
.ar-snooze-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.ar-snooze-row__info {
  flex: 1;
  min-width: 0;
}
.ar-snooze-row__label {
  font-size: 14px;
  font-weight: 500;
  color: var(--ic-text-primary, #0f172a);
  margin-bottom: 2px;
}
.ar-snooze-row__desc {
  font-size: 12px;
  color: var(--ic-text-secondary, #64748b);
}
/* 토글 스위치 버튼 */
.ar-snooze-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.ar-snooze-btn--active {
  background: color-mix(in srgb, #f59e0b 12%, #fff);
  border-color: #f59e0b;
  color: #92400e;
}
.ar-snooze-btn--active:hover {
  background: color-mix(in srgb, #f59e0b 20%, #fff);
}
.ar-snooze-btn--inactive {
  background: var(--ic-surface-default, #fff);
  border-color: var(--ic-surface-border, #e2e8f0);
  color: var(--ic-text-secondary, #64748b);
}
.ar-snooze-btn--inactive:hover {
  border-color: #94a3b8;
  color: var(--ic-text-primary, #0f172a);
}

/* ── Channel Type Selector ─────────────────────────────────────────────── */
.ar-channel-type {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.ar-channel-type__option { cursor: pointer; }
.ar-channel-type__radio {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  border: 0;
}
.ar-channel-type__card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 8px;
  border: 2px solid #e2e8f0;
  transition: border-color 0.15s, background 0.15s;
  user-select: none;
}
.ar-channel-type__option:has(.ar-channel-type__radio:checked) .ar-channel-type__card {
  border-color: #6366f1;
  background: #eef2ff;
}
.ar-channel-type__card:hover { border-color: #cbd5e1; }
.ar-channel-type__icon { color: #94a3b8; flex-shrink: 0; }
.ar-channel-type__option:has(.ar-channel-type__radio:checked) .ar-channel-type__icon { color: #6366f1; }
.ar-channel-type__label { font-size: 0.875rem; font-weight: 500; color: #334155; }
.ar-channel-type__desc { font-size: 0.75rem; color: #94a3b8; margin-top: 2px; }
.ar-channel-type__option:has(.ar-channel-type__radio:checked) .ar-channel-type__label { color: #4338ca; }

/* ── Bookmark Panel ──────────────────────────────────────────────────────────── */
.ar-bookmark-panel {
  width: 0;
  min-width: 0;
  overflow-x: hidden;
  flex-shrink: 0;
  background: #ffffff;
  border-left: 1px solid var(--ic-neutral-200);
  display: flex;
  flex-direction: column;
  position: relative;
  transition: width 220ms cubic-bezier(0.4, 0, 0.2, 1),
              min-width 220ms cubic-bezier(0.4, 0, 0.2, 1);
}
.ar-bookmark-panel.is-resizing {
  transition: none;
  user-select: none;
}
.ar-bookmark-panel.is-open {
  width: 360px;
  min-width: 360px;
}

.ar-bookmark-panel__resize-handle {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  cursor: ew-resize;
  z-index: 10;
  background: transparent;
  transition: background 150ms;
}
.ar-bookmark-panel__resize-handle::after {
  content: '';
  position: absolute;
  left: 1px;
  top: 50%;
  transform: translateY(-50%);
  width: 2px;
  height: 32px;
  border-radius: 2px;
  background: var(--ic-neutral-300);
  opacity: 0;
  transition: opacity 150ms;
}
.ar-bookmark-panel__resize-handle:hover::after,
.ar-bookmark-panel.is-resizing .ar-bookmark-panel__resize-handle::after {
  opacity: 1;
}
.ar-bookmark-panel__resize-handle:hover,
.ar-bookmark-panel.is-resizing .ar-bookmark-panel__resize-handle {
  background: rgba(99, 102, 241, 0.08);
}

.ar-bookmark-panel__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--ic-neutral-200);
  flex-shrink: 0;
}
.ar-bookmark-panel__title {
  font-size: 0.875rem;
  font-weight: 600;
  color: #1e293b;
  display: flex;
  align-items: center;
  gap: 0.375rem;
}
.ar-bookmark-panel__close {
  padding: 0.25rem;
  border-radius: 0.25rem;
  color: #64748b;
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
}
.ar-bookmark-panel__close:hover { color: #1e293b; background: #f1f5f9; }

.ar-bookmark-panel__search {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--ic-neutral-200);
  flex-shrink: 0;
}
.ar-bookmark-panel__search-input {
  flex: 1;
  font-size: 0.8125rem;
  border: 1px solid #e2e8f0;
  border-radius: 0.375rem;
  padding: 0.375rem 0.5rem;
  outline: none;
  color: #1e293b;
}
.ar-bookmark-panel__search-input:focus { border-color: #6366f1; }
.ar-bookmark-panel__filter-btn {
  padding: 0.375rem;
  border-radius: 0.375rem;
  border: 1px solid #e2e8f0;
  background: #fff;
  color: #64748b;
  cursor: pointer;
  display: flex;
  align-items: center;
}
.ar-bookmark-panel__filter-btn:hover { background: #f1f5f9; }

.ar-bookmark-panel__filter {
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--ic-neutral-200);
  display: none;
  flex-direction: column;
  gap: 0.375rem;
  background: #f8fafc;
  flex-shrink: 0;
}
.ar-bookmark-panel__filter.is-open {
  display: flex;
}
.ar-bookmark-filter__group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.ar-bookmark-filter__label {
  font-size: 0.75rem;
  color: #64748b;
  width: 3.5rem;
  flex-shrink: 0;
}
.ar-bookmark-filter__select {
  flex: 1;
  font-size: 0.75rem;
  border: 1px solid #e2e8f0;
  border-radius: 0.25rem;
  padding: 0.25rem 0.375rem;
  color: #1e293b;
  background: #fff;
}

.ar-bookmark-panel__list {
  flex: 1;
  overflow-y: auto;
  padding: 0.5rem 0;
}

.ar-bookmark-panel__empty {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 180px;
  margin: 0.5rem 0.75rem 0.75rem;
  padding: 0.875rem;
  border: 1px dashed rgba(148, 163, 184, 0.32);
  border-radius: 0.875rem;
  background: linear-gradient(180deg, rgba(248, 250, 252, 0.96) 0%, rgba(241, 245, 249, 0.85) 100%);
}

.ar-bookmark-panel__empty .text-center {
  width: 100%;
}

.ar-bookmark-panel__empty svg {
  color: #94a3b8;
}

.ar-bookmark-panel__load-more {
  padding: 0.625rem;
  text-align: center;
  font-size: 0.8125rem;
  color: #6366f1;
  border: none;
  background: none;
  cursor: pointer;
  width: 100%;
  border-top: 1px solid var(--ic-neutral-200);
  flex-shrink: 0;
}
.ar-bookmark-panel__load-more:hover { background: #f1f5f9; }

/* 북마크 항목 */
.ar-bookmark-item {
  padding: 0.625rem 0.75rem;
  margin: 0.375rem 0.625rem;
  border: 1px solid #e2e8f0;
  border-radius: 0.5rem;
  background: #fff;
}
.ar-bookmark-item:hover { background: #f8fafc; border-color: #cbd5e1; }
.ar-bookmark-item.is-new {
  background: rgba(99, 102, 241, 0.08);
}
.ar-bookmark-item__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}
.ar-bookmark-item__meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.375rem;
  font-size: 0.6875rem;
  color: #94a3b8;
}
.ar-bookmark-item__channel { color: #6366f1; font-weight: 500; }
.ar-bookmark-item__sender { color: #1e293b; font-weight: 500; }
.ar-bookmark-item__preview {
  font-size: 0.8125rem;
  color: #374151;
  line-height: 1.5;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  margin: 0.45rem 0 0;
  white-space: pre-wrap;
  word-break: break-word;
}
.ar-bookmark-item__expand-btn {
  font-size: 0.75rem;
  color: #6366f1;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.25rem 0;
  margin-top: 0.25rem;
  text-align: left;
}
.ar-bookmark-item__expand-btn:hover { color: #4f46e5; text-decoration: underline; }

/* 펼침 상태: preview는 숨기고 full content를 inline 표시 */
.ar-bookmark-item.is-expanded {
  background: #fafafa;
  border-left: 2px solid #6366f1;
}
.ar-bookmark-item.is-expanded .ar-bookmark-item__preview { display: none; }
.ar-bookmark-item__full {
  display: none;
  font-size: 0.8125rem;
  color: #374151;
  line-height: 1.6;
  margin-top: 0.45rem;
  word-break: break-word;
  padding-right: 0.25rem;
}
.ar-bookmark-item.is-expanded .ar-bookmark-item__full { display: block; }
.ar-bookmark-item__actions {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  opacity: 1;
  flex-shrink: 0;
}
.ar-bookmark-item__actions--inline {
  justify-content: flex-end;
  margin-left: auto;
}
.ar-bookmark-item__btn {
  padding: 0.25rem;
  border-radius: 0.25rem;
  border: none;
  background: none;
  color: #94a3b8;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}
.ar-bookmark-item__btn:hover { color: #374151; background: #e2e8f0; }
.ar-bookmark-item__btn--delete:hover { color: #dc2626; }
.ar-bookmark-item__btn--delete {
  color: #dc2626;
}

/* 메시지 북마크 버튼 (채팅) */
.ar-msg__bookmark-btn {
  position: relative;
  padding: 0.25rem;
  border-radius: 0.25rem;
  border: none;
  background: #fff;
  color: #cbd5e1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  transition: opacity 0.15s, color 0.15s, background 0.15s, transform 0.15s, box-shadow 0.15s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}
.ar-msg__bookmark-btn.is-bookmarked,
.ar-msg__bookmark-btn.is-feedback-visible { opacity: 1; }
.ar-msg__bookmark-btn.is-bookmarked {
  color: #4f46e5;
  background: #eef2ff;
  box-shadow: 0 0 0 1px rgba(99, 102, 241, 0.18), 0 6px 18px rgba(99, 102, 241, 0.16);
}
.ar-msg__bookmark-btn:hover { color: #6366f1; background: #eef2ff; }
.ar-msg__bookmark-btn.is-feedback-add {
  animation: ar-bookmark-pop 0.28s ease-out;
}
.ar-msg__bookmark-btn.is-feedback-remove {
  animation: ar-bookmark-fade 0.24s ease-out;
}

@keyframes ar-bookmark-pop {
  0% { transform: scale(0.92); box-shadow: 0 0 0 0 rgba(99, 102, 241, 0.22); }
  65% { transform: scale(1.12); box-shadow: 0 0 0 6px rgba(99, 102, 241, 0.14); }
  100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(99, 102, 241, 0); }
}

@keyframes ar-bookmark-fade {
  0% { transform: scale(1.04); box-shadow: 0 0 0 4px rgba(148, 163, 184, 0.16); }
  100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(148, 163, 184, 0); }
}

/* ── 스레드 패널 ─────────────────────────────────────────────────────────────── */
.ar-thread-panel {
  width: 0;
  min-width: 0;
  overflow: hidden;
  flex-shrink: 0;
  background: #ffffff;
  border-left: 1px solid var(--ic-neutral-200);
  display: flex;
  flex-direction: column;
  position: relative;
  transition: width 220ms cubic-bezier(0.4, 0, 0.2, 1),
              min-width 220ms cubic-bezier(0.4, 0, 0.2, 1);
}
.ar-thread-panel.is-resizing { transition: none; user-select: none; }
.ar-thread-panel.is-open { width: 360px; min-width: 360px; }

.ar-thread-panel__resize-handle {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  cursor: ew-resize;
  z-index: 10;
  background: transparent;
  transition: background 150ms;
}
.ar-thread-panel__resize-handle::after {
  content: '';
  position: absolute;
  left: 1px;
  top: 50%;
  transform: translateY(-50%);
  width: 2px;
  height: 32px;
  border-radius: 2px;
  background: var(--ic-neutral-300);
  opacity: 0;
  transition: opacity 150ms;
}
.ar-thread-panel__resize-handle:hover::after,
.ar-thread-panel.is-resizing .ar-thread-panel__resize-handle::after { opacity: 1; }
.ar-thread-panel__resize-handle:hover,
.ar-thread-panel.is-resizing .ar-thread-panel__resize-handle {
  background: rgba(99, 102, 241, 0.08);
}

.ar-thread-panel__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--ic-neutral-200);
  flex-shrink: 0;
}
.ar-thread-panel__title {
  font-size: 0.875rem;
  font-weight: 600;
  color: #1e293b;
  display: flex;
  align-items: center;
  gap: 0.375rem;
}
.ar-thread-panel__close {
  padding: 0.25rem;
  border-radius: 0.25rem;
  color: #64748b;
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
}
.ar-thread-panel__close:hover { color: #1e293b; background: #f1f5f9; }

/* turbo-frame 높이 전달 체인 */
turbo-frame#thread_panel_list {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.ar-thread-panel__list {
  flex: 1;
  overflow-y: auto;
  min-height: 0;
  padding: 0.5rem 0;
}
.ar-thread-panel__sentinel {
  height: 1px;
}
.ar-thread-panel__empty {
  padding: 2.5rem 1rem;
  text-align: center;
}
.ar-thread-panel__load-more {
  padding: 0.625rem;
  text-align: center;
  font-size: 0.8125rem;
  color: var(--ar-thread-color);
  border: none;
  background: none;
  cursor: pointer;
  width: 100%;
  border-top: 1px solid var(--ic-neutral-200);
  flex-shrink: 0;
}
.ar-thread-panel__load-more:hover { background: #f1f5f9; }

/* 스레드 패널 — 항목 */
.ar-thread-item {
  padding: 0.625rem 0.75rem;
  margin: 0.375rem 0.625rem;
  border: 1px solid #e2e8f0;
  border-radius: 0.5rem;
  background: #fff;
  cursor: pointer;
  transition: background 100ms, border-color 100ms;
}
.ar-thread-item:hover { background: #f8fafc; border-color: #c7d2fe; }
.ar-thread-item.has-unread { border-left: 3px solid var(--ar-thread-color); }

.ar-thread-item__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.3rem;
}
.ar-thread-item__meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.375rem;
  font-size: 0.6875rem;
  color: #94a3b8;
}
.ar-thread-item__sender {
  font-size: 0.75rem;
  font-weight: 600;
  color: #1e293b;
}
.ar-thread-item__date {
  font-size: 0.6875rem;
  color: #94a3b8;
  flex-shrink: 0;
}
.ar-thread-item__preview {
  font-size: 0.8125rem;
  color: #374151;
  line-height: 1.5;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  margin-bottom: 0.5rem;
  word-break: break-word;
}
.ar-thread-item__footer {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.ar-thread-item__reply-count {
  font-size: 0.75rem;
  color: var(--ar-thread-color);
  font-weight: 500;
}
.ar-thread-item__last-reply {
  font-size: 0.6875rem;
  color: #94a3b8;
  margin-left: auto;
}
.ar-thread-item__unread-badge {
  font-size: 0.625rem;
  font-weight: 700;
  background: var(--ar-thread-color);
  color: #fff;
  border-radius: 10px;
  padding: 1px 6px;
  line-height: 1.6;
  flex-shrink: 0;
}

/* 와치(Watch) 버튼 — 호버 시 표시, 와치 중이면 항상 표시 */
.ar-thread-item__watch-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.2rem;
  border-radius: 0.25rem;
  border: none;
  background: none;
  color: #cbd5e1;
  cursor: pointer;
  opacity: 0;
  transition: opacity 100ms, color 100ms, background 100ms;
  flex-shrink: 0;
}
.ar-thread-item:hover .ar-thread-item__watch-btn { opacity: 1; }
.ar-thread-item__watch-btn:hover { color: var(--ar-thread-color); background: #eef2ff; }
.ar-thread-item__watch-btn.is-watched {
  opacity: 1;
  color: #f59e0b;
}
.ar-thread-item__watch-btn.is-watched:hover { color: #d97706; background: #fef3c7; }

/* 와치 상태 아이템 강조 */
.ar-thread-item.is-watched {
  border-left: 3px solid #f59e0b;
  background: #fffbeb;
}
.ar-thread-item.is-watched:hover { background: #fef9e7; border-color: #f59e0b; }
.ar-thread-item.is-watched.has-unread { border-left-color: var(--ar-thread-color); }


/* 빈 상태 — 미읽 스레드 없음 */
.ar-thread-panel__all-read {
  padding: 2.5rem 1rem;
  text-align: center;
  color: #94a3b8;
  font-size: 0.8125rem;
}

/* ── Channel Variables ─────────────────────────────────────────────────────── */
.ar-cv-key { width: 12rem; flex-shrink: 0; }
.ar-cv-input-key { width: 12rem; }

/* ── Debug Capture (Extension) ─────────────────────────────────────────────── */
.ar-debug-capture {
  border: 1px solid rgba(148, 163, 184, 0.3);
  border-radius: 10px;
  background: #f8fafc;
  overflow: hidden;
}

.ar-debug-capture__summary summary {
  cursor: pointer;
  list-style: none;
  padding: 12px 16px;
}

.ar-debug-capture__summary summary::-webkit-details-marker {
  display: none;
}

.ar-debug-capture__header {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.ar-debug-capture__title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  color: #0f172a;
}

.ar-debug-capture__title svg {
  flex-shrink: 0;
  color: #4f46e5;
}

.ar-debug-capture__meta {
  font-size: 12px;
  color: #64748b;
  padding-left: 24px;
}

.ar-debug-capture__details {
  padding: 0 16px 16px;
  border-top: 1px solid rgba(148, 163, 184, 0.2);
}

.ar-debug-capture__details .ar-markdown {
  margin-top: 12px;
}

.ar-debug-capture__summary[open] .ar-debug-capture__title svg {
  transform: rotate(180deg);
}

/* ── Message Completed (Collapsed Preview) ─────────────────────────────────── */
.ar-message-row--completed:not(.ar-message-row--expanded) .ar-message-preview {
  text-decoration: line-through;
  color: inherit;
}

.ar-message-row--completed:not(.ar-message-row--expanded) .ar-message-images {
  position: relative;
}

.ar-message-row--completed:not(.ar-message-row--expanded) .ar-message-images::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 1.5px;
  background: currentColor;
  opacity: 0.4;
  pointer-events: none;
}

.ar-message-row--completed.ar-message-row--expanded .ar-message-preview {
  text-decoration: none;
}

.ar-message-row--completed.ar-message-row--expanded .ar-message-images::after {
  display: none;
}

.ar-badge-completed {
  display: inline-flex;
  align-items: center;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 0.65rem;
  font-weight: 500;
  color: #16a34a;
  background: rgba(22, 163, 74, 0.08);
  white-space: nowrap;
}

.ar-message-preview {
  max-height: 8em;
  overflow: hidden;
  position: relative;
  -webkit-mask-image: linear-gradient(to bottom, black 50%, transparent 100%);
  mask-image: linear-gradient(to bottom, black 50%, transparent 100%);
}
.ar-message-preview--expanded {
  max-height: none;
  -webkit-mask-image: none;
  mask-image: none;
}

.ar-message-preview__toggle {
  display: inline-block;
  margin-top: 4px;
  padding: 0;
  border: none;
  background: none;
  font-size: 0.75rem;
  color: var(--ic-brand-500, #6366f1);
  cursor: pointer;
}
.ar-message-preview__toggle:hover {
  text-decoration: underline;
}

/* ── Toggle Switch ─────────────────────────────────────────────────────────── */
.ar-toggle {
  position: relative;
  display: inline-flex;
  flex-shrink: 0;
  cursor: pointer;
}
.ar-toggle__track {
  display: block;
  width: 40px;
  height: 22px;
  border-radius: 11px;
  background: #cbd5e1;
  transition: background 0.15s ease;
}
.ar-toggle__track::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: white;
  box-shadow: 0 1px 2px rgba(0,0,0,0.15);
  transition: transform 0.15s ease;
}
.ar-toggle .peer:checked ~ .ar-toggle__track {
  background: var(--ic-brand-600, #6366f1);
}
.ar-toggle .peer:checked ~ .ar-toggle__track::after {
  transform: translateX(18px);
}
.ar-toggle .peer:focus-visible ~ .ar-toggle__track {
  outline: 2px solid var(--ic-brand-500, #6366f1);
  outline-offset: 2px;
}

/* ================================================================
   Dashboard Alert Bar
   ================================================================ */
.ar-alert-bar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  background: var(--ic-surface-raised);
  border: 1px solid var(--ic-surface-border);
  border-radius: 0.5rem;
}
.ar-alert-bar__item {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.25rem 0.625rem;
  border-radius: 9999px;
  font-size: 0.8125rem;
  font-weight: 500;
  line-height: 1.4;
}
.ar-alert-bar__item--danger {
  background: var(--ic-danger-50);
  color: var(--ic-danger-700);
}
.ar-alert-bar__item--warning {
  background: var(--ic-warning-50);
  color: var(--ic-warning-700);
}
.ar-alert-bar__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}
.ar-alert-bar__dot--danger { background: var(--ic-danger-500); }
.ar-alert-bar__dot--warning { background: var(--ic-warning-500); }

/* ================================================================
   Dashboard Stat Widget Extensions
   ================================================================ */
.ar-stat-widget__total {
  font-size: 0.875rem;
  font-weight: 400;
  color: var(--ic-text-tertiary);
}
.ar-stat-widget__unit {
  font-size: 0.875rem;
  font-weight: 400;
  color: var(--ic-text-secondary);
  margin-left: 0.125rem;
}
.ar-stat-widget__dots {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
}
.ar-stat-widget__dots-more {
  font-size: 0.625rem;
  font-weight: 600;
  color: var(--ic-text-secondary);
  line-height: 1;
}
.ar-status-dot--quota_exceeded {
  background: var(--ic-warning-500);
  box-shadow: 0 0 4px rgba(245, 158, 11, 0.4);
}

/* ================================================================
   Dashboard Action Panel
   ================================================================ */
.ar-panel--actions {
  border: 1px solid var(--ic-surface-border);
}
.ar-action-list {
  max-height: 320px;
  overflow-y: auto;
}
.ar-action-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.25rem;
  height: 1.25rem;
  padding: 0 0.375rem;
  border-radius: 9999px;
  background: var(--ic-danger-500);
  color: white;
  font-size: 0.6875rem;
  font-weight: 600;
  line-height: 1;
}
.ar-action-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.ar-action-item__icon {
  flex-shrink: 0;
}
.ar-action-item__badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 50%;
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1;
}
.ar-action-item__badge--danger {
  background: var(--ic-danger-50);
  color: var(--ic-danger-700);
}
.ar-action-item__badge--warning {
  background: var(--ic-warning-50);
  color: var(--ic-warning-700);
}
.ar-action-item__badge--info {
  background: var(--ic-info-50);
  color: var(--ic-info-700);
}
.ar-action-item__content {
  flex: 1;
  min-width: 0;
}
.ar-action-item__action {
  flex-shrink: 0;
}

/* Action panel button */
.ar-btn-outline {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.625rem;
  font-size: 0.75rem;
  font-weight: 500;
  border: 1px solid var(--ic-surface-border);
  border-radius: 0.375rem;
  background: transparent;
  color: var(--ic-text-secondary);
  text-decoration: none;
  transition: all 0.15s ease;
}
.ar-btn-outline:hover {
  background: var(--ic-surface-sunken);
  color: var(--ic-text-primary);
}

/* ================================================================
   Dashboard 2-column row
   ================================================================ */
.ar-dashboard-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  align-items: start;
}
.ar-dashboard-row .ar-action-list {
  max-height: 320px;
  overflow-y: auto;
}
@media (max-width: 1024px) {
  .ar-dashboard-row {
    grid-template-columns: 1fr;
  }
}

/* ================================================================
   Dashboard — Onboarding Empty State
   ================================================================ */
.ar-dashboard-onboarding {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 60vh;
  padding: 2rem 1rem;
}
.ar-dashboard-onboarding__card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 1rem;
  padding: 3rem 3.5rem;
  max-width: 480px;
  width: 100%;
  text-align: center;
  box-shadow: 0 4px 24px rgba(15, 15, 16, 0.06);
}
.ar-dashboard-onboarding__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 72px;
  height: 72px;
  border-radius: 1rem;
  background: linear-gradient(135deg, rgba(79, 70, 229, 0.1), rgba(8, 145, 178, 0.1));
  margin-bottom: 1.75rem;
}
.ar-dashboard-onboarding__title {
  font-size: 1.375rem;
  font-weight: 700;
  color: #0f0f10;
  margin-bottom: 0.75rem;
  line-height: 1.3;
}
.ar-dashboard-onboarding__desc {
  color: #5c5c6e;
  font-size: 0.9375rem;
  line-height: 1.7;
  margin-bottom: 2rem;
}
.ar-dashboard-onboarding__hint {
  color: #9ca3af;
  font-size: 0.8125rem;
  margin-top: 0.25rem;
  margin-bottom: 0.875rem;
}
.ar-dashboard-onboarding__secondary-link {
  color: #6366f1;
  font-size: 0.875rem;
  text-decoration: none;
}
.ar-dashboard-onboarding__secondary-link:hover {
  text-decoration: underline;
}
.ar-dashboard-onboarding__primary {
  width: 100%;
  justify-content: center;
  margin-bottom: 0.875rem;
}
@media (max-width: 600px) {
  .ar-dashboard-onboarding__card {
    padding: 2rem 1.5rem;
  }
}

/* ================================================================
   Phase 3 — Dashboard Real-time Update Flash
   ================================================================ */
@keyframes ar-dashboard-update {
  0%   { background-color: var(--ic-brand-50, #eff6ff); }
  100% { background-color: transparent; }
}
.ar-dashboard-updated {
  animation: ar-dashboard-update 0.8s ease-out;
}

/* ================================================================
   Phase 2 — Task Pipeline
   ================================================================ */
.ar-pipeline {
  padding: 0.25rem 0;
}
.ar-pipeline--bottleneck {
  border-left: 3px solid var(--ic-warning-500);
  padding-left: 0.75rem;
}
.ar-pipeline__warning {
  color: var(--ic-warning-700);
}
.ar-pipeline-bar {
  display: flex;
  height: 1.25rem;
  border-radius: 0.375rem;
  overflow: hidden;
  background: var(--ic-neutral-100);
}
.ar-pipeline-bar__segment {
  min-width: 2px;
}
.ar-pipeline-bar__segment--todo { background: var(--ic-neutral-300); }
.ar-pipeline-bar__segment--in_progress { background: var(--ic-brand-500); }
.ar-pipeline-bar__segment--in_review { background: var(--ic-warning-400); }
.ar-pipeline-bar__segment--done { background: var(--ic-success-500); }

.ar-pipeline-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}
.ar-pipeline-legend__item {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.75rem;
  color: var(--ic-text-secondary);
}
.ar-pipeline-legend__dot {
  width: 8px;
  height: 8px;
  border-radius: var(--ic-radius-full);
  flex-shrink: 0;
}
.ar-pipeline-legend__dot--todo { background: var(--ic-neutral-300); }
.ar-pipeline-legend__dot--in_progress { background: var(--ic-brand-500); }
.ar-pipeline-legend__dot--in_review { background: var(--ic-warning-400); }
.ar-pipeline-legend__dot--done { background: var(--ic-success-500); }

/* ================================================================
   Phase 2 — Agent Stats Table
   ================================================================ */
.ar-agent-stats-scroll {
  max-height: 320px;
  overflow-y: auto;
}
.ar-agent-stats-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8125rem;
}
.ar-agent-stats-table thead th {
  position: sticky;
  top: 0;
  background: var(--ic-surface-raised);
  padding: 0.5rem 1.25rem;
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ic-text-tertiary);
  border-bottom: 1px solid var(--ic-surface-border);
  white-space: nowrap;
}
.ar-agent-stats-table tbody td {
  padding: 0.5rem 1.25rem;
  border-bottom: 1px solid var(--ic-surface-border);
  white-space: nowrap;
}
.ar-agent-stats-table tbody tr:last-child td {
  border-bottom: none;
}
.ar-agent-stats-table__row--dim {
  opacity: 0.6;
}

/* ── 검색 패널 ── */
.ar-search-panel {
  width: 0;
  min-width: 0;
  overflow: hidden;
  flex-shrink: 0;
  background: #ffffff;
  border-left: 1px solid var(--ic-neutral-200);
  display: flex;
  flex-direction: column;
  position: relative;
  transition: width 220ms cubic-bezier(0.4, 0, 0.2, 1),
              min-width 220ms cubic-bezier(0.4, 0, 0.2, 1);
}
.ar-search-panel.is-resizing {
  transition: none;
  user-select: none;
}
.ar-search-panel.is-open {
  width: 400px;
  min-width: 400px;
}

.ar-search-panel__resize-handle {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  cursor: ew-resize;
  z-index: 10;
  background: transparent;
  transition: background 150ms;
}
.ar-search-panel__resize-handle::after {
  content: '';
  position: absolute;
  left: 1px;
  top: 50%;
  transform: translateY(-50%);
  width: 2px;
  height: 32px;
  border-radius: 2px;
  background: var(--ic-neutral-300);
  opacity: 0;
  transition: opacity 150ms;
}
.ar-search-panel__resize-handle:hover::after,
.ar-search-panel.is-resizing .ar-search-panel__resize-handle::after {
  opacity: 1;
}
.ar-search-panel__resize-handle:hover,
.ar-search-panel.is-resizing .ar-search-panel__resize-handle {
  background: rgba(99, 102, 241, 0.08);
}

.ar-search-panel__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--ic-neutral-200);
  flex-shrink: 0;
}
.ar-search-panel__title {
  font-size: 0.875rem;
  font-weight: 600;
  color: #1e293b;
  display: flex;
  align-items: center;
  gap: 0.375rem;
}
.ar-search-panel__close {
  padding: 0.25rem;
  border-radius: 0.25rem;
  color: #64748b;
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
}
.ar-search-panel__close:hover { color: #1e293b; background: #f1f5f9; }

.ar-search-panel__search {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--ic-neutral-200);
  flex-shrink: 0;
}
.ar-search-panel__search-input {
  flex: 1;
  font-size: 0.8125rem;
  border: 1px solid #e2e8f0;
  border-radius: 0.375rem;
  padding: 0.375rem 0.5rem;
  outline: none;
  color: #1e293b;
}
.ar-search-panel__search-input:focus { border-color: #6366f1; }
.ar-search-panel__filter-btn {
  padding: 0.375rem;
  border-radius: 0.375rem;
  border: 1px solid #e2e8f0;
  background: #fff;
  color: #64748b;
  cursor: pointer;
  display: flex;
  align-items: center;
}
.ar-search-panel__filter-btn:hover { background: #f1f5f9; }

.ar-search-panel__filter {
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--ic-neutral-200);
  display: none;
  flex-direction: column;
  gap: 0.375rem;
  background: #f8fafc;
  flex-shrink: 0;
}
.ar-search-panel__filter.is-open {
  display: flex;
}
.ar-search-filter__group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.ar-search-filter__label {
  font-size: 0.75rem;
  color: #64748b;
  width: 3.5rem;
  flex-shrink: 0;
}
.ar-search-filter__select {
  flex: 1;
  font-size: 0.75rem;
  border: 1px solid #e2e8f0;
  border-radius: 0.25rem;
  padding: 0.25rem 0.375rem;
  color: #1e293b;
  background: #fff;
}

.ar-search-panel__list {
  flex: 1;
  overflow-y: auto;
  padding: 0.5rem 0;
}
turbo-frame#search_panel_list {
  flex: 1;
  overflow-y: auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.ar-search-panel__results {
  flex: 1;
}
.ar-search-panel__sentinel {
  height: 1px;
}

.ar-search-panel__count {
  padding: 0.25rem 0.875rem 0.125rem;
}

.ar-search-panel__empty {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 180px;
  margin: 0.5rem 0.75rem 0.75rem;
  padding: 0.875rem;
  border: 1px dashed rgba(148, 163, 184, 0.32);
  border-radius: 0.875rem;
  background: linear-gradient(180deg, rgba(248, 250, 252, 0.96) 0%, rgba(241, 245, 249, 0.85) 100%);
}
.ar-search-panel__empty .text-center {
  width: 100%;
}
.ar-search-panel__empty svg {
  color: #94a3b8;
}

/* 검색 결과 항목 */
.ar-search-result-item {
  padding: 0.625rem 0.75rem;
  margin: 0.375rem 0.625rem;
  border: 1px solid #e2e8f0;
  border-radius: 0.5rem;
  background: #fff;
}
.ar-search-result-item:hover { background: #f8fafc; border-color: #cbd5e1; }
.ar-search-result-item__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}
.ar-search-result-item__meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.375rem;
  font-size: 0.6875rem;
  color: #94a3b8;
}
.ar-search-result-item__sender { color: #1e293b; font-weight: 500; }
.ar-search-result-item__preview {
  font-size: 0.8125rem;
  color: #374151;
  line-height: 1.5;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  margin: 0.45rem 0 0;
  white-space: pre-wrap;
  word-break: break-word;
}
.ar-search-result-item__actions {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  flex-shrink: 0;
}
.ar-search-result-item__btn {
  padding: 0.25rem;
  border-radius: 0.25rem;
  border: none;
  background: none;
  color: #94a3b8;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}
.ar-search-result-item__btn:hover { color: #374151; background: #e2e8f0; }
.ar-search-result-item__expand-btn {
  font-size: 0.75rem;
  color: #6366f1;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.25rem 0;
  margin-top: 0.25rem;
  text-align: left;
}
.ar-search-result-item__expand-btn:hover { color: #4f46e5; text-decoration: underline; }

/* 펼침 상태 */
.ar-search-result-item.is-expanded {
  background: #fafafa;
  border-left: 2px solid #6366f1;
}
.ar-search-result-item.is-expanded .ar-search-result-item__preview { display: none; }
.ar-search-result-item__full {
  display: none;
  font-size: 0.8125rem;
  color: #374151;
  line-height: 1.6;
  margin-top: 0.45rem;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 480px;
  overflow-y: auto;
  padding-right: 0.25rem;
}
.ar-search-result-item.is-expanded .ar-search-result-item__full { display: block; }

/* 검색어 하이라이트 */
.ar-search-highlight {
  background: rgba(250, 204, 21, 0.4);
  color: inherit;
  border-radius: 2px;
  padding: 0 1px;
}

/* ── Thread bar ── */
.ar-thread-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 32px;
  width: 100%;
  padding: 0 10px 0 9px;
  margin-top: 6px;
  border-width: 0 0 0 2px;
  border-style: solid;
  border-color: var(--ar-thread-color-light, #818cf8);
  border-radius: 0 8px 8px 0;
  background: color-mix(in srgb, var(--ar-thread-color, #6366f1) 5%, var(--ic-surface-default, #fff));
  color: inherit;
  cursor: pointer;
  font: inherit;
  text-align: left;
  transition: background 0.15s, border-color 0.15s;
}
.ar-thread-bar:hover {
  background: color-mix(in srgb, var(--ar-thread-color, #6366f1) 10%, var(--ic-surface-default, #fff));
  border-color: var(--ar-thread-color, #6366f1);
}
.ar-thread-bar:focus-visible {
  outline: 2px solid var(--ar-thread-color, #6366f1);
  outline-offset: 2px;
}
.ar-thread-bar__participants {
  display: flex;
  align-items: center;
}
.ar-thread-bar__participants > * {
  margin-left: -4px;
  border: 1.5px solid var(--ic-surface-default, #fff);
  border-radius: 4px;
}
.ar-thread-bar__participants > *:first-child { margin-left: 0; }
.ar-thread-bar__user-avatar {
  width: 16px;
  height: 16px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 8px;
  font-weight: 600;
  color: #fff;
  background: var(--ar-thread-color-dark, #4f46e5);
  flex-shrink: 0;
  overflow: hidden;
}
.ar-thread-bar__user-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 4px;
}
.ar-thread-bar__participants .ar-agent-card__avatar,
.ar-thread-bar__participants .ar-avatar--16 {
  width: 16px;
  height: 16px;
  border-radius: 4px;
  font-size: 8px;
}
.ar-thread-bar__label {
  font-size: 12px;
  font-weight: 500;
  color: var(--ar-thread-color-dark, #4f46e5);
  white-space: nowrap;
}
.ar-thread-bar:hover .ar-thread-bar__label {
  color: var(--ar-thread-color-dark, #4f46e5);
}
.ar-thread-bar__unread {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  background: var(--ar-thread-color-dark, #4f46e5);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
  border-radius: 8px;
  flex-shrink: 0;
}
.ar-thread-bar.has-unread {
  border-color: var(--ar-thread-color, #6366f1);
  background: color-mix(in srgb, var(--ar-thread-color, #6366f1) 12%, var(--ic-surface-default, #fff));
}
.ar-thread-bar.has-unread .ar-thread-bar__label {
  font-weight: 700;
  color: var(--ar-thread-color-dark, #4f46e5);
}
.ar-thread-bar.has-unread:hover {
  background: color-mix(in srgb, var(--ar-thread-color, #6366f1) 18%, var(--ic-surface-default, #fff));
}
.ar-thread-bar__unread-badge {
  display: inline-flex;
  align-items: center;
  padding: 1px 8px;
  border-radius: 10px;
  background: var(--ar-thread-color-dark, #4f46e5);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.4;
  white-space: nowrap;
  flex-shrink: 0;
}
.ar-thread-bar__chevron {
  color: var(--ar-thread-color-light, #818cf8);
  transition: transform 0.2s, color 0.15s;
  flex-shrink: 0;
}
.ar-thread-bar:hover .ar-thread-bar__chevron {
  color: var(--ar-thread-color, #6366f1);
}
.ar-thread-bar.is-expanded .ar-thread-bar__chevron {
  transform: rotate(180deg);
}

/* 스레드 바 우측 액션 그룹 (와치 버튼 + 화살표) */
.ar-thread-bar__actions {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
  flex-shrink: 0;
}

/* 스레드 바 와치 버튼 */
.ar-thread-bar__watch-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 4px;
  border: none;
  background: none;
  color: var(--ar-thread-color-light, #818cf8);
  cursor: pointer;
  opacity: 0;
  transition: opacity 100ms, color 100ms, background 100ms;
  flex-shrink: 0;
}
.ar-thread-bar:hover .ar-thread-bar__watch-btn { opacity: 1; }
.ar-thread-bar__watch-btn:hover {
  color: var(--ar-thread-color, #6366f1);
  background: color-mix(in srgb, var(--ar-thread-color, #6366f1) 12%, transparent);
}
.ar-thread-bar__watch-btn.is-watched {
  opacity: 1;
  color: #f59e0b;
}
.ar-thread-bar__watch-btn.is-watched:hover {
  color: #d97706;
  background: #fef3c7;
}

/* 스레드 바 와치 중 강조 */
.ar-thread-bar.is-watched {
  border-left-color: #f59e0b;
  background: color-mix(in srgb, #f59e0b 6%, var(--ic-surface-default, #fff));
}
.ar-thread-bar.is-watched:hover {
  background: color-mix(in srgb, #f59e0b 10%, var(--ic-surface-default, #fff));
  border-left-color: #f59e0b;
}
.ar-thread-bar.is-watched.has-unread {
  border-left-color: var(--ar-thread-color, #6366f1);
  background: color-mix(in srgb, var(--ar-thread-color, #6366f1) 12%, var(--ic-surface-default, #fff));
}
.ar-thread-bar.is-highlight {
  animation: ar-thread-highlight 2s ease-out forwards;
}
@keyframes ar-thread-highlight {
  0%   { background: color-mix(in srgb, var(--ar-thread-color, #6366f1) 25%, var(--ic-surface-default, #fff)); }
  100% { background: color-mix(in srgb, var(--ar-thread-color, #6366f1) 5%, var(--ic-surface-default, #fff)); }
}

/* ── Scrollbar Thread Marker Track (task #532, #533) ── */
.ar-scroll-marker-track {
  position: absolute;
  top: 0;
  right: 0;
  width: 14px;
  height: 100%;
  pointer-events: none;
  z-index: 10;
}
.ar-scroll-marker {
  position: absolute;
  right: 2px;
  width: 8px;
  height: 14px;
  border-radius: 3px;
  background: var(--ar-thread-color, #6366f1);
  opacity: 0.8;
  cursor: pointer;
  pointer-events: auto;
  transform: translateY(-50%);
  transition: width 0.15s ease, right 0.15s ease, opacity 0.15s ease;
}
.ar-scroll-marker:hover {
  width: 10px;
  right: 0px;
  opacity: 1;
}
/* hover 툴팁 */
.ar-scroll-marker[data-label] {
  position: absolute;
}
.ar-scroll-marker[data-label]::before {
  content: attr(data-label);
  position: absolute;
  right: calc(100% + 8px);
  top: 50%;
  transform: translateY(-50%);
  white-space: nowrap;
  padding: 3px 8px;
  border-radius: 5px;
  background: rgba(15, 23, 42, 0.82);
  color: #fff;
  font-size: 11px;
  font-weight: 500;
  line-height: 1.4;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.12s ease;
}
.ar-scroll-marker[data-label]:hover::before {
  opacity: 1;
}
.ar-scroll-marker[data-urgent] {
  background: var(--ar-thread-color-dark, #4f46e5);
  opacity: 0.85;
}
.ar-scroll-marker[data-urgent]:hover {
  opacity: 1;
}
/* 모바일: 터치 디바이스에서 마커 트랙 숨김 */
@media (max-width: 480px) {
  .ar-scroll-marker-track {
    display: none;
  }
}

/* ── Thread inline replies ── */
.ar-thread-inline {
  display: flex;
  flex-direction: column;
  margin-top: 6px;
  border: 1px solid var(--ic-surface-border, #e2e8f0);
  border-left: 2px solid var(--ar-thread-color, #6366f1);
  border-radius: 0 8px 8px 0;
  background: var(--ic-surface-default, #fff);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}
.ar-thread-inline__replies {
  padding: 6px 10px;
}
.ar-thread-inline__replies .ar-message-row {
  padding: 6px 0;
}
.ar-thread-inline__replies .ar-message-row--agent {
  border-left: none;
  padding-left: 0;
}
.ar-thread-inline__footer {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: 7px 12px;
  border-top: 1px solid var(--ic-surface-border, #e2e8f0);
  background: var(--ic-surface-default, #fff);
}
.ar-thread-reply-action {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 0;
  font-size: 12px;
  font-weight: 600;
  color: var(--ic-text-secondary);
  cursor: pointer;
  border: none;
  background: none;
}
.ar-thread-reply-action:hover {
  color: var(--ar-thread-color-dark, #4f46e5);
}
.ar-thread-collapse-action {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
  padding: 4px 0;
  font-size: 12px;
  font-weight: 600;
  color: var(--ic-text-secondary);
  cursor: pointer;
  border: none;
  background: none;
}
.ar-thread-collapse-action:hover {
  color: var(--ic-text-primary);
}


/* ── Composer reply bar ── */
.ar-reply-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 0 12px;
  background: color-mix(in srgb, var(--ar-thread-color, #6366f1) 8%, transparent);
  border-radius: 8px 8px 0 0;
  margin-bottom: 0;
  color: var(--ic-text-secondary);
  font-size: 12px;
}
.ar-reply-bar__text {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ar-reply-bar__text strong {
  font-weight: 700;
  color: var(--ic-text-primary);
}
.ar-reply-bar__cancel {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 6px;
  border: none;
  background: none;
  font-size: 12px;
  color: var(--ic-text-tertiary);
  cursor: pointer;
  border-radius: 4px;
  flex-shrink: 0;
}
.ar-reply-bar__cancel:hover {
  background: rgba(0,0,0,0.06);
  color: var(--ic-text-secondary);
}

/* ── Message action buttons (bookmark + reply) ── */
.ar-msg__actions {
  position: absolute;
  top: 4px;
  right: 8px;
  display: flex;
  gap: 2px;
  opacity: 0;
  transition: opacity 0.15s;
}
.ar-message-row:hover .ar-msg__actions,
.ar-msg__actions:has(.is-bookmarked),
.ar-msg__actions:has(.is-feedback-visible) { opacity: 1; }
.ar-msg__reply-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 6px;
  background: var(--ic-surface-default, #fff);
  color: var(--ic-text-tertiary);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  box-shadow: 0 1px 2px rgba(0,0,0,0.06);
}
.ar-msg__reply-btn:hover {
  background: var(--ic-surface-sunken);
  color: var(--ic-brand-600);
}

/* ================================================================
   Phase 3 — Toast Notifications (ar-toast)
   ================================================================ */

/* Toast stack — fixed to bottom-right */
/* 머신 연결 끊김 경고 — 채팅 뷰 포함 전 페이지 고정 오버레이 */
.ar-machine-status-banners {
  position: fixed;
  top: 1rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 8500;
  width: calc(100vw - 2rem);
  max-width: 640px;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  pointer-events: none;
}
.ar-machine-status-banners .ar-flash {
  pointer-events: auto;
}

.ar-toast-stack {
  position: fixed;
  bottom: 1.25rem;
  right: 1.25rem;
  z-index: 9000;
  display: flex;
  flex-direction: column-reverse;
  gap: 0.5rem;
  pointer-events: none;
  max-width: 360px;
  width: calc(100vw - 2.5rem);
}

/* Individual toast */
.ar-toast {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  padding: 0.7rem 0.9rem;
  background: var(--ic-neutral-900, #0f172a);
  color: #fff;
  border-radius: 10px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.22), 0 1px 4px rgba(0, 0, 0, 0.12);
  pointer-events: all;
  cursor: pointer;
  animation: ar-toast-in 0.22s cubic-bezier(0.34, 1.56, 0.64, 1) both;
  transition: opacity 0.18s, transform 0.18s;
  min-width: 0;
}
.ar-toast.is-hiding {
  animation: ar-toast-out 0.18s ease-in forwards;
}
.ar-toast:hover {
  background: var(--ic-neutral-800, #1e293b);
}

@keyframes ar-toast-in {
  from { opacity: 0; transform: translateY(12px) scale(0.96); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes ar-toast-out {
  from { opacity: 1; transform: translateY(0); }
  to   { opacity: 0; transform: translateY(8px); }
}

/* Toast avatar */
.ar-toast__avatar {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  flex-shrink: 0;
  overflow: hidden;
  background: var(--ic-brand-600, #4f46e5);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
}
.ar-toast__avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Toast body */
.ar-toast__body {
  min-width: 0;
  flex: 1;
}
.ar-toast__header {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.15rem;
}
.ar-toast__sender {
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ar-toast__channel {
  font-size: 11px;
  color: var(--ic-neutral-400, #94a3b8);
  white-space: nowrap;
}
.ar-toast__preview {
  font-size: 12px;
  color: var(--ic-neutral-300, #cbd5e1);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 260px;
}

/* Toast close button */
.ar-toast__close {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border: none;
  background: none;
  color: var(--ic-neutral-400, #94a3b8);
  border-radius: 4px;
  cursor: pointer;
  padding: 0;
  transition: color 0.12s;
  margin-top: -2px;
}
.ar-toast__close:hover {
  color: #fff;
}

/* ================================================================
   Phase 3 — Bottom Sheet (ar-bottom-sheet)
   Mobile only: max-width 768px
   ================================================================ */

/* backdrop은 파일 하단 .ar-bottom-sheet-backdrop 통합 정의 참조 */
@keyframes ar-backdrop-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.ar-bottom-sheet {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 8100;
  background: var(--ic-surface-bg, #fff);
  border-radius: 16px 16px 0 0;
  box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.14);
  max-height: 85dvh;
  overflow: hidden;
  flex-direction: column;
}
.ar-bottom-sheet.is-open {
  display: flex;
  animation: ar-sheet-up 0.28s cubic-bezier(0.32, 0.72, 0, 1) both;
}
.ar-bottom-sheet.is-closing {
  animation: ar-sheet-down 0.22s ease-in forwards;
}
@keyframes ar-sheet-up {
  from { transform: translateY(100%); }
  to   { transform: translateY(0); }
}
@keyframes ar-sheet-down {
  from { transform: translateY(0); }
  to   { transform: translateY(100%); }
}

/* Drag handle */
.ar-bottom-sheet__handle {
  width: 36px;
  height: 4px;
  background: var(--ic-neutral-300, #cbd5e1);
  border-radius: 2px;
  margin: 10px auto 0;
  flex-shrink: 0;
}

/* Sheet header */
.ar-bottom-sheet__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem 0.5rem;
  border-bottom: 1px solid var(--ic-surface-border, #e2e8f0);
  flex-shrink: 0;
}
.ar-bottom-sheet__title {
  font-size: 14px;
  font-weight: 600;
  color: var(--ic-text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ar-bottom-sheet__close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: none;
  background: none;
  color: var(--ic-text-tertiary);
  border-radius: 6px;
  cursor: pointer;
  padding: 0;
  transition: background 0.12s, color 0.12s;
  flex-shrink: 0;
}
.ar-bottom-sheet__close:hover {
  background: var(--ic-surface-sunken);
  color: var(--ic-text-primary);
}

/* Sheet scrollable content */
.ar-bottom-sheet__body {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 0.5rem 0;
}

/* Sheet footer (composer) */
.ar-bottom-sheet__footer {
  flex-shrink: 0;
  border-top: 1px solid var(--ic-surface-border, #e2e8f0);
  background: var(--ic-surface-bg, #fff);
  padding-bottom: env(safe-area-inset-bottom, 0);
}

/* Phase 3 bottom sheet 컴포넌트는 모바일 전용 */
@media (min-width: 768px) {
  .ar-bottom-sheet {
    display: none !important;
  }
}

/* ================================================================
   Phase 3.2 — Notification Bell + Dropdown (ar-notif)
   Placed in sidebar footer alongside settings/logout buttons
   ================================================================ */

/* Bell button wrapper (relative so dropdown positions off it) */
.ar-notif {
  position: relative;
}

/* Bell trigger button */
.ar-notif__btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: none;
  background: none;
  color: var(--ic-text-tertiary);
  border-radius: 6px;
  cursor: pointer;
  padding: 0;
  transition: background 0.12s, color 0.12s;
  position: relative;
}
.ar-notif__btn:hover {
  background: var(--ic-surface-sunken, #f8fafc);
  color: var(--ic-text-primary);
}
.ar-notif__btn.has-unread {
  color: var(--ic-brand-600, #4f46e5);
}

/* Unread badge on bell */
.ar-notif__badge {
  position: absolute;
  top: -2px;
  right: -3px;
  min-width: 14px;
  height: 14px;
  padding: 0 3px;
  background: var(--ic-danger-500, #ef4444);
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  line-height: 14px;
  border-radius: 7px;
  text-align: center;
  pointer-events: none;
}

/* Dropdown panel */
.ar-notif__dropdown {
  display: none;
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  width: 320px;
  max-height: 400px;
  background: var(--ic-surface-bg, #fff);
  border: 1px solid var(--ic-surface-border, #e2e8f0);
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.14), 0 2px 8px rgba(0, 0, 0, 0.08);
  overflow: hidden;
  flex-direction: column;
  z-index: 500;
}
.ar-notif__dropdown.is-open {
  display: flex;
  animation: ar-notif-in 0.16s ease both;
}
@keyframes ar-notif-in {
  from { opacity: 0; transform: translateX(-50%) translateY(6px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* Dropdown header */
.ar-notif__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.65rem 0.9rem 0.5rem;
  border-bottom: 1px solid var(--ic-surface-border, #e2e8f0);
  flex-shrink: 0;
}
.ar-notif__title {
  font-size: 13px;
  font-weight: 700;
  color: var(--ic-text-primary);
}
.ar-notif__mark-all {
  font-size: 11px;
  color: var(--ic-brand-600, #4f46e5);
  background: none;
  border: none;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
  transition: background 0.12s;
}
.ar-notif__mark-all:hover {
  background: var(--ic-brand-50, #eef2ff);
}

/* Notification list */
.ar-notif__list {
  flex: 1;
  overflow-y: auto;
  padding: 0.25rem 0;
}

/* Empty state */
.ar-notif__empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 2rem 1rem;
  color: var(--ic-text-tertiary);
  font-size: 13px;
  text-align: center;
}
.ar-notif__empty svg {
  opacity: 0.35;
}

/* Individual notification item */
.ar-notif__item {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  padding: 0.55rem 0.9rem;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.1s;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
}
.ar-notif__item:hover {
  background: var(--ic-surface-sunken, #f8fafc);
}
.ar-notif__item.is-unread {
  background: var(--ic-brand-50, #eef2ff);
}
.ar-notif__item.is-unread:hover {
  background: #e6eeff;
}

/* Unread dot */
.ar-notif__unread-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--ic-brand-500, #6366f1);
  flex-shrink: 0;
  margin-top: 5px;
}
.ar-notif__item:not(.is-unread) .ar-notif__unread-dot {
  visibility: hidden;
}

/* Item avatar */
.ar-notif__item-avatar {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  flex-shrink: 0;
  overflow: hidden;
  background: var(--ic-brand-600, #4f46e5);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
}
.ar-notif__item-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Item text */
.ar-notif__item-body {
  flex: 1;
  min-width: 0;
}
.ar-notif__item-meta {
  display: flex;
  align-items: baseline;
  gap: 0.3rem;
  margin-bottom: 0.1rem;
}
.ar-notif__item-sender {
  font-size: 12px;
  font-weight: 700;
  color: var(--ic-text-primary);
  white-space: nowrap;
}
.ar-notif__item-channel {
  font-size: 11px;
  color: var(--ic-text-tertiary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ar-notif__item-preview {
  font-size: 12px;
  color: var(--ic-text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ar-notif__item-time {
  font-size: 10px;
  color: var(--ic-text-tertiary);
  flex-shrink: 0;
  white-space: nowrap;
  margin-top: 1px;
}

/* ================================================================
   ARANG Landing Page Styles
   ar-landing-* prefix
   ================================================================ */

.ar-landing-nav,
.ar-landing-nav *,
.ar-landing-hero,
.ar-landing-hero *,
.ar-landing-section,
.ar-landing-section *,
.ar-landing-footer,
.ar-landing-footer * {
  box-sizing: border-box;
}

/* ---- 공통 버튼 ---- */
.ar-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  padding: 0.5rem 1.125rem;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.15s ease;
  border: none;
  white-space: nowrap;
}
.ar-btn--primary {
  background: linear-gradient(135deg, #4f46e5, #0891b2);
  color: #fff;
  box-shadow: 0 16px 36px rgba(37, 99, 235, 0.18);
}
.ar-btn--primary:hover { filter: brightness(1.04); }
.ar-btn--ghost {
  background: transparent;
  color: var(--ic-brand-600);
  border: 1.5px solid var(--ic-brand-300);
}
.ar-btn--ghost:hover { background: var(--ic-brand-50); }
.ar-btn--lg { padding: 0.75rem 1.5rem; font-size: 1rem; border-radius: 0.625rem; }
.ar-btn--white { background: #fff; color: var(--ic-brand-700); }
.ar-btn--white:hover { background: var(--ic-brand-50); }
.ar-btn--white-ghost {
  background: transparent;
  color: #fff;
  border: 1.5px solid rgba(255,255,255,0.5);
}
.ar-btn--white-ghost:hover { background: rgba(255,255,255,0.12); }

/* ---- 네비게이션 ---- */
.ar-landing-nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--ic-neutral-200);
}
.ar-landing-nav__inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
  height: 64px;
  display: flex;
  align-items: center;
  gap: 2rem;
}
.ar-landing-nav__logo {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  flex-shrink: 0;
}
.ar-landing-nav__logo-img {
  display: block;
  width: 150px;
  height: auto;
}
.ar-landing-nav__logo-text {
  font-family: 'Sora', sans-serif;
  font-weight: 800;
  font-size: 1.25rem;
  color: var(--ic-neutral-900);
  letter-spacing: -0.02em;
}
.ar-landing-nav__logo-dot { color: var(--ic-brand-600); }
.ar-landing-nav__menu {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  flex: 1;
}
.ar-landing-nav__link {
  padding: 0.375rem 0.75rem;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--ic-neutral-600);
  text-decoration: none;
  border-radius: 0.375rem;
  transition: color 0.15s, background 0.15s;
}
.ar-landing-nav__link:hover { color: var(--ic-neutral-900); background: var(--ic-neutral-100); }
.ar-landing-nav__link--active {
  color: var(--ic-neutral-900);
  font-weight: 700;
}
.ar-landing-nav__actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}
.ar-landing-nav__cta {
  display: inline-flex;
  align-items: center;
  padding: 0.4375rem 1rem;
  background: var(--ic-brand-600);
  color: #fff;
  font-size: 0.875rem;
  font-weight: 600;
  border-radius: 0.5rem;
  text-decoration: none;
  transition: background 0.15s;
}
.ar-landing-nav__cta:hover { background: var(--ic-brand-700); }

/* ---- 공통 섹션 래퍼 ---- */
.ar-landing-section {
  max-width: 1200px;
  margin: 0 auto;
  padding: 5rem 1.5rem;
}
.ar-landing-section__header {
  text-align: center;
  margin-bottom: 3.5rem;
}
.ar-landing-section__title {
  font-family: 'Sora', sans-serif;
  font-size: 2.25rem;
  font-weight: 700;
  color: var(--ic-neutral-900);
  letter-spacing: -0.02em;
  margin-bottom: 0.75rem;
  word-break: keep-all;
  overflow-wrap: break-word;
}
.ar-landing-section__subtitle {
  font-size: 1.0625rem;
  color: var(--ic-neutral-500);
  max-width: 560px;
  margin: 0 auto;
  word-break: keep-all;
  overflow-wrap: break-word;
}

/* ---- Hero ---- */
.ar-landing-hero {
  background:
    radial-gradient(circle at 13% 22%, rgba(20, 184, 166, 0.12), transparent 30%),
    linear-gradient(135deg, #f8fafc 0%, #eef2ff 52%, #ecfeff 100%);
  padding: 1rem 0 0;
  overflow: hidden;
}
.ar-landing-hero__inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 3rem 1.5rem 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: end;
}
.ar-landing-hero__content { padding-bottom: 5rem; }
/* 섹션 타이틀 인라인 모노크롬 브랜드마크 */
.ar-landing-section__brand-mark {
  display: inline-block;
  vertical-align: -0.15em;
  height: 1em;
  width: auto;
  margin: 0 0.12em;
}
.ar-landing-hero__badge {
  display: inline-block;
  padding: 0.3125rem 0.875rem;
  background: rgba(239, 246, 255, 0.86);
  color: #2563eb;
  font-size: 0.8125rem;
  font-weight: 800;
  border-radius: 99px;
  margin-bottom: 1.25rem;
  border: 1px solid rgba(37, 99, 235, 0.18);
}
.ar-landing-hero__headline {
  font-family: 'Sora', sans-serif;
  font-size: 3.25rem;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.03em;
  color: var(--ic-neutral-900);
  margin-bottom: 1.25rem;
  word-break: keep-all;
  overflow-wrap: break-word;
}
.ar-landing-hero__headline-accent {
  color: #0891b2;
}
.ar-landing-hero__subtext {
  font-size: 1.0625rem;
  color: var(--ic-neutral-500);
  line-height: 1.7;
  margin-bottom: 1.25rem;
  word-break: keep-all;
  overflow-wrap: break-word;
}
.ar-landing-provider-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  max-width: 34rem;
  margin-bottom: 2rem;
}
.ar-landing-provider-strip span {
  display: inline-flex;
  align-items: center;
  min-height: 2rem;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(148, 163, 184, 0.28);
  color: var(--ic-neutral-700);
  font-size: 0.8125rem;
  font-weight: 700;
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.05);
}
.ar-landing-hero__cta-group {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.ar-landing-hero__visual { align-self: end; }
/* 히어로 실제 스크린샷 */
.ar-landing-hero__screenshot {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 1rem 1rem 0 0;
  box-shadow: 0 -4px 40px rgba(99,102,241,0.15), 0 0 0 1px rgba(148,163,184,0.2);
}
/* 기능 섹션 스크린샷 */
.ar-landing-feature-screenshot {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 0.75rem;
  border: 1px solid rgba(148, 163, 184, 0.2);
  box-shadow: 0 8px 32px rgba(15, 23, 42, 0.1);
}
.ar-landing-hero__mockup {
  background: #fff;
  border-radius: 1rem 1rem 0 0;
  box-shadow: 0 -4px 40px rgba(99,102,241,0.12), 0 0 0 1px var(--ic-neutral-200);
  overflow: hidden;
  transform: translateY(1px);
}

/* ---- 채널 목업 ---- */
.ar-landing-mockup__header {
  background: var(--ic-neutral-800);
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.ar-landing-mockup__channel {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8125rem;
  color: var(--ic-neutral-400);
  font-weight: 500;
}
.ar-landing-mockup__body { padding: 1rem; display: flex; flex-direction: column; gap: 0.875rem; }
.ar-landing-msg { display: flex; align-items: flex-start; gap: 0.625rem; }
.ar-landing-msg__avatar {
  width: 32px;
  height: 32px;
  border-radius: 0.375rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8125rem;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
  background: var(--ic-neutral-400);
}
.ar-landing-msg__avatar--user { background: var(--ic-neutral-600); }
.ar-landing-msg__bubble { flex: 1; }
.ar-landing-msg__name {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--ic-neutral-800);
  display: flex;
  align-items: center;
  gap: 0.375rem;
  margin-bottom: 0.25rem;
}
.ar-landing-msg__name--agent { color: var(--ic-brand-700); }
.ar-landing-msg__badge {
  font-size: 0.625rem;
  font-weight: 700;
  padding: 0.0625rem 0.375rem;
  background: var(--ic-brand-100);
  color: var(--ic-brand-600);
  border-radius: 99px;
  letter-spacing: 0.04em;
}
.ar-landing-msg__bubble p {
  font-size: 0.875rem;
  color: var(--ic-neutral-700);
  line-height: 1.5;
}

/* ---- 핵심 가치 ---- */
.ar-landing-values { background: #fff; }
.ar-landing-values__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}
.ar-landing-value-card {
  padding: 2rem;
  background: var(--ic-neutral-50);
  border: 1px solid var(--ic-neutral-200);
  border-radius: 1rem;
  transition: box-shadow 0.2s, border-color 0.2s;
}
.ar-landing-value-card:hover {
  box-shadow: 0 4px 24px rgba(99,102,241,0.1);
  border-color: var(--ic-brand-200);
}
.ar-landing-value-card__icon { font-size: 2rem; margin-bottom: 1rem; }
.ar-landing-value-card__title {
  font-family: 'Sora', sans-serif;
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--ic-neutral-900);
  margin-bottom: 0.5rem;
}
.ar-landing-value-card__desc { font-size: 0.9375rem; color: var(--ic-neutral-500); line-height: 1.6; }

/* ---- How it works ---- */
.ar-landing-hiw { background: var(--ic-neutral-50); }
.ar-landing-hiw__steps { display: flex; flex-direction: column; gap: 2rem; max-width: 720px; margin: 0 auto; }
.ar-landing-step {
  display: flex;
  gap: 1.5rem;
  align-items: flex-start;
}
.ar-landing-step__number {
  font-family: 'Sora', sans-serif;
  font-size: 2rem;
  font-weight: 800;
  color: var(--ic-brand-300);
  line-height: 1;
  flex-shrink: 0;
  width: 56px;
  text-align: right;
  padding-top: 0.25rem;
}
.ar-landing-step__content { flex: 1; }
.ar-landing-step__title {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--ic-neutral-900);
  margin-bottom: 0.375rem;
}
.ar-landing-step__desc { font-size: 0.9375rem; color: var(--ic-neutral-500); line-height: 1.65; }

/* ---- 지원 프로바이더 ---- */
.ar-landing-providers { background: #fff; }
.ar-landing-providers__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}
.ar-landing-provider-card {
  padding: 1.25rem;
  background: var(--ic-neutral-50);
  border: 1px solid var(--ic-neutral-200);
  border-radius: 0.875rem;
}
.ar-landing-provider-card__label {
  display: inline-flex;
  margin-bottom: 0.625rem;
  color: var(--ic-neutral-900);
  font-size: 0.9375rem;
  font-weight: 800;
}
.ar-landing-provider-card p {
  margin: 0;
  color: var(--ic-neutral-500);
  font-size: 0.875rem;
  line-height: 1.6;
}
.ar-landing-providers__note {
  max-width: 760px;
  margin: 1.25rem auto 0;
  color: var(--ic-neutral-500);
  font-size: 0.875rem;
  line-height: 1.65;
  text-align: center;
}

/* ---- 주요 기능 (좌우 교차) ---- */
.ar-landing-features { background: #fff; }
.ar-landing-feature-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
  padding: 3.5rem 0;
  border-bottom: 1px solid var(--ic-neutral-100);
}
.ar-landing-feature-row:last-child { border-bottom: none; }
.ar-landing-feature-row--reverse .ar-landing-feature-row__text { order: 2; }
.ar-landing-feature-row--reverse .ar-landing-feature-row__visual { order: 1; }
.ar-landing-feature-row__badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  background: var(--ic-brand-50);
  color: var(--ic-brand-700);
  font-size: 0.75rem;
  font-weight: 700;
  border-radius: 99px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.875rem;
}
.ar-landing-feature-row__title {
  font-family: 'Sora', sans-serif;
  font-size: 1.625rem;
  font-weight: 700;
  color: var(--ic-neutral-900);
  letter-spacing: -0.02em;
  margin-bottom: 0.75rem;
}
.ar-landing-feature-row__desc { font-size: 0.9375rem; color: var(--ic-neutral-500); line-height: 1.7; }
.ar-landing-feature-list {
  margin: 1rem 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.5rem;
}
.ar-landing-feature-list li {
  position: relative;
  padding-left: 1.1rem;
  font-size: 0.875rem;
  color: var(--ic-neutral-600);
  line-height: 1.55;
}
.ar-landing-feature-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.62em;
  width: 0.35rem;
  height: 0.35rem;
  border-radius: 999px;
  background: var(--ic-brand-500);
}
.ar-landing-code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.875em;
  padding: 0.125rem 0.375rem;
  background: var(--ic-neutral-100);
  border-radius: 0.25rem;
  color: var(--ic-brand-700);
}
.ar-landing-placeholder-img {
  height: 240px;
  background: var(--ic-neutral-100);
  border-radius: 0.875rem;
  border: 1px solid var(--ic-neutral-200);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ic-neutral-400);
  font-size: 0.875rem;
  font-weight: 500;
}
.ar-landing-placeholder-img--dark {
  background: var(--ic-neutral-900);
  border-color: var(--ic-neutral-800);
  font-size: 1rem;
}

/* ---- 사용 사례 ---- */
.ar-landing-usecases { background: var(--ic-neutral-50); }
.ar-landing-usecases__grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; }
.ar-landing-usecase-card {
  padding: 2rem;
  background: #fff;
  border: 1px solid var(--ic-neutral-200);
  border-radius: 1rem;
}
.ar-landing-usecase-card__icon { font-size: 2rem; margin-bottom: 1rem; }
.ar-landing-usecase-card__label {
  display: inline-flex;
  margin-bottom: 0.875rem;
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
  background: var(--ic-neutral-100);
  color: var(--ic-neutral-600);
  font-size: 0.75rem;
  font-weight: 700;
}
.ar-landing-usecase-card__title {
  font-size: 1.0625rem;
  font-weight: 700;
  color: var(--ic-neutral-900);
  margin-bottom: 0.5rem;
}
.ar-landing-usecase-card__desc { font-size: 0.9rem; color: var(--ic-neutral-500); line-height: 1.6; }

/* ---- 요금제 ---- */
.ar-landing-pricing { background: #fff; }
.ar-landing-pricing__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.5rem;
  max-width: 860px;
  margin: 0 auto;
}
.ar-landing-pricing-card {
  padding: 2rem;
  background: #fff;
  border: 1px solid var(--ic-neutral-200);
  border-radius: 1rem;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.06);
}
.ar-landing-pricing-card--featured {
  border-color: var(--ic-brand-200);
  background: linear-gradient(135deg, var(--ic-brand-50), #fff);
}
.ar-landing-pricing-card__eyebrow {
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--ic-brand-700);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.75rem;
}
.ar-landing-pricing-card__title {
  font-family: 'Sora', sans-serif;
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--ic-neutral-900);
  margin-bottom: 0.5rem;
}
.ar-landing-pricing-card__price {
  font-size: 2rem;
  font-weight: 800;
  color: var(--ic-neutral-900);
  margin-bottom: 0.75rem;
}
.ar-landing-pricing-card__desc {
  font-size: 0.9rem;
  color: var(--ic-neutral-500);
  line-height: 1.6;
  margin-bottom: 1.25rem;
}
.ar-landing-pricing-card__list {
  display: grid;
  gap: 0.625rem;
  margin: 0 0 1.5rem;
  padding: 0;
  list-style: none;
}
.ar-landing-pricing-card__list li {
  font-size: 0.875rem;
  color: var(--ic-neutral-600);
  line-height: 1.5;
}
.ar-landing-pricing-card__list li::before {
  content: "✓";
  margin-right: 0.45rem;
  color: var(--ic-brand-600);
  font-weight: 800;
}
.ar-landing-pricing-card__cta {
  width: 100%;
}
.ar-landing-pricing__badge {
  text-align: center;
  padding: 3rem;
  background: linear-gradient(135deg, var(--ic-brand-50), #ede9fe);
  border-radius: 1.25rem;
  border: 1px solid var(--ic-brand-200);
}
.ar-landing-pricing__coming-soon {
  display: inline-block;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--ic-brand-700);
  margin-bottom: 0.75rem;
}
.ar-landing-pricing__coming-desc {
  font-size: 0.9375rem;
  color: var(--ic-neutral-500);
  margin-bottom: 1.5rem;
}

/* ---- 마지막 CTA ---- */
.ar-landing-cta-section {
  background: linear-gradient(135deg, var(--ic-brand-600), var(--ic-brand-800));
  padding: 6rem 1.5rem;
  text-align: center;
}
.ar-landing-cta-section__inner { max-width: 640px; margin: 0 auto; }
.ar-landing-cta-section__title {
  font-family: 'Sora', sans-serif;
  font-size: 2.5rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.03em;
  margin-bottom: 0.875rem;
  word-break: keep-all;
  overflow-wrap: break-word;
}
.ar-landing-cta-section__sub {
  font-size: 1.0625rem;
  color: rgba(255,255,255,0.75);
  line-height: 1.65;
  margin-bottom: 2rem;
}
.ar-landing-cta-section__actions { display: flex; align-items: center; justify-content: center; gap: 0.75rem; flex-wrap: wrap; }

/* ---- 푸터 ---- */
.ar-landing-footer {
  background: #f8fafc;
  color: var(--ic-neutral-500);
  border-top: 1px solid var(--ic-neutral-200);
}
.ar-landing-footer__inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 4rem 1.5rem 3rem;
  display: grid;
  grid-template-columns: 1.5fr repeat(3, 1fr);
  gap: 3rem;
}
.ar-landing-footer__logo {
  display: block;
  width: 150px;
  height: auto;
}
.ar-landing-footer__tagline { font-size: 0.875rem; margin-top: 0.75rem; color: var(--ic-neutral-500); }
.ar-landing-footer__group { display: flex; flex-direction: column; gap: 0.625rem; }
.ar-landing-footer__group-title {
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--ic-neutral-700);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.25rem;
}
.ar-landing-footer__link { font-size: 0.875rem; color: var(--ic-neutral-500); text-decoration: none; cursor: pointer; }
.ar-landing-footer__link:hover { color: var(--ic-neutral-800); }
.ar-landing-footer__link--muted { cursor: default; }
.ar-landing-footer__bottom {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.5rem;
  border-top: 1px solid var(--ic-neutral-200);
  font-size: 0.8125rem;
}
/* ---- 반응형 ---- */
@media (max-width: 1024px) {
  .ar-landing-hero__inner { grid-template-columns: 1fr; gap: 2rem; }
  .ar-landing-hero__content { padding-bottom: 2rem; }
  .ar-landing-hero__visual { display: none; }
  .ar-landing-feature-row { grid-template-columns: 1fr; gap: 2rem; }
  .ar-landing-feature-row--reverse .ar-landing-feature-row__text { order: 0; }
  .ar-landing-feature-row--reverse .ar-landing-feature-row__visual { order: 0; }
  .ar-landing-footer__inner { grid-template-columns: 1fr 1fr; gap: 2rem; }
}
@media (max-width: 768px) {
  .ar-landing-nav__inner { padding: 0 1rem; gap: 1rem; }
  .ar-landing-nav__logo-img { width: 128px; }
  .ar-landing-nav__actions .ar-landing-nav__link { font-size: 0.8125rem; padding: 0.35rem 0.6rem; }
  .ar-landing-hero,
  .ar-landing-section { overflow-x: hidden; }
  .ar-landing-section {
    width: 100%;
    max-width: 100vw;
    margin-left: 0;
    margin-right: 0;
  }
  .ar-landing-section__header,
  .ar-landing-values__grid,
  .ar-landing-providers__grid,
  .ar-landing-usecases__grid,
  .ar-landing-pricing__grid {
    margin-left: 0;
    margin-right: 0;
  }
  .ar-landing-section__header { max-width: 21rem; }
  .ar-landing-values__grid,
  .ar-landing-providers__grid,
  .ar-landing-usecases__grid,
  .ar-landing-pricing__grid { max-width: 20rem; }
  .ar-landing-hero__headline { font-size: 2.5rem; }
  .ar-landing-hero__subtext,
  .ar-landing-section__subtitle {
    width: 100%;
    overflow-wrap: break-word;
    word-break: keep-all;
    line-break: auto;
  }
  .ar-landing-hero__subtext { max-width: 21rem; }
  .ar-landing-section__subtitle { max-width: 19rem; }
  .ar-landing-hero__subtext br { display: none; }
  .ar-landing-section__title { font-size: 1.75rem; }
  .ar-landing-values__grid,
  .ar-landing-providers__grid,
  .ar-landing-usecases__grid,
  .ar-landing-pricing__grid {
    grid-template-columns: minmax(0, 1fr);
    width: 100%;
    min-width: 0;
  }
  .ar-landing-value-card,
  .ar-landing-provider-card,
  .ar-landing-usecase-card,
  .ar-landing-pricing-card { min-width: 0; }
  .ar-landing-value-card__desc,
  .ar-landing-provider-card p,
  .ar-landing-usecase-card__desc,
  .ar-landing-step__desc {
    overflow-wrap: break-word;
    word-break: keep-all;
    line-break: auto;
  }
  .ar-landing-nav__menu { display: none; }
  .ar-landing-footer__inner { grid-template-columns: 1fr; gap: 1.5rem; }
}

/* ================================================================
   File Viewer — Monaco Editor Modal
   ar-file-chip, ar-file-viewer-modal-* prefix
   ================================================================ */

/* ---- 파일 경로 칩 (채널 메시지 내 클릭 가능한 파일 링크) ---- */
.ar-file-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.05rem 0.45rem 0.05rem 0.3rem;
  background: #f6f8fa;
  color: #0550ae;
  border: 1px solid #d0d7de;
  border-radius: 0.25rem;
  font-family: ui-monospace, 'SFMono-Regular', Menlo, monospace;
  font-size: 0.80em;
  font-weight: 400;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.12s, border-color 0.12s, color 0.12s;
  vertical-align: middle;
}
.ar-file-chip::before {
  content: "📄";
  font-size: 0.80em;
  flex-shrink: 0;
  opacity: 0.65;
}
.ar-file-chip:hover {
  background: #eaf1fb;
  border-color: #0969da;
  color: #0550ae;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.ar-file-chip:active {
  background: #dbeafe;
  border-color: #0550ae;
}
.ar-file-chip:focus-visible {
  outline: 2px solid #0969da;
  outline-offset: 1px;
}

/* ---- 모달 레이아웃 ---- */
.ar-file-viewer-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9000;
  align-items: center;
  justify-content: center;
}
.ar-file-viewer-modal.is-open { display: flex; }
.ar-file-viewer-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
}
.ar-file-viewer-modal__panel {
  position: relative;
  z-index: 1;
  width: min(900px, 92vw);
  height: min(680px, 90vh);
  background: #1e1e1e; /* VS Code Dark */
  border-radius: 0.875rem;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 24px 64px rgba(0,0,0,0.5), 0 0 0 1px rgba(255,255,255,0.08);
}

/* ---- 헤더 ---- */
.ar-file-viewer-modal__header {
  height: 44px;
  background: #252526;
  border-bottom: 1px solid #3c3c3c;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 0.875rem;
  flex-shrink: 0;
}
.ar-file-viewer-modal__header-left {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
}
.ar-file-viewer-modal__file-icon { color: #858585; flex-shrink: 0; }
.ar-file-viewer-modal__title {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #cccccc;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ar-file-viewer-modal__header-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
}
.ar-file-viewer-modal__path {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.6875rem;
  color: #858585;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 280px;
}
.ar-file-viewer-modal__close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: none;
  background: transparent;
  color: #858585;
  border-radius: 0.25rem;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.ar-file-viewer-modal__close:hover { background: #3c3c3c; color: #cccccc; }

/* ---- 에디터 영역 ---- */
.ar-file-viewer-modal__body {
  flex: 1;
  min-height: 0;
  position: relative;
}
.ar-file-viewer-modal__editor {
  position: absolute;
  inset: 0;
}

/* ---- 로딩 상태 ---- */
.ar-file-viewer-modal__loading {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.875rem;
  color: #858585;
  font-size: 0.875rem;
}
.ar-file-viewer-modal__loading-spinner {
  width: 24px;
  height: 24px;
  border: 2px solid #3c3c3c;
  border-top-color: var(--ic-brand-500);
  border-radius: 50%;
  animation: ar-spin 0.7s linear infinite;
}

/* ---- 에러 상태 ---- */
.ar-file-viewer-modal__error {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  color: #f48771;
  font-size: 0.875rem;
  padding: 1.5rem;
  text-align: center;
  line-height: 1.5;
}
.ar-file-viewer-modal__error::before {
  content: "⚠";
  font-size: 1.75rem;
  line-height: 1;
  margin-bottom: 0.25rem;
}

/* ---- hidden 상태 (로딩 / 에러 / 에디터 전환) ---- */
.ar-file-viewer-modal__loading.hidden,
.ar-file-viewer-modal__error.hidden,
.ar-file-viewer-modal__editor.hidden {
  display: none !important;
}

/* ---- Monaco 줄 하이라이트 (파일 경로:줄번호 클릭 시) ---- */
.ar-monaco-highlight-line {
  background: rgba(255, 215, 0, 0.12);
  border-left: 2px solid rgba(255, 215, 0, 0.6);
}

/* ---- body scroll lock ---- */
body.ar-modal-open { overflow: hidden; }

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

/* ---- 반응형 ---- */
@media (max-width: 640px) {
  .ar-file-viewer-modal__panel {
    width: 100vw;
    height: 100dvh;
    border-radius: 0;
  }
  .ar-file-viewer-modal__path { display: none; }
}

/* ════════════════════════════════════════════════════════════════════
   채널 대화/토픽 탭 (#t97)
   ════════════════════════════════════════════════════════════════════ */

/* ── 헤더 탭 스트립 ──────────────────────────────────────────────── */
/* 탭 + 관리 버튼을 묶는 외부 컨테이너 (관리 버튼을 우측 고정) */
.ar-channel-tabs-outer {
  display: flex;
  align-items: stretch;
  margin-top: 0.3rem;
  /* 탭 card 방식: 아래 border를 기준선으로, active 탭이 배경과 연결 */
  border-bottom: 1px solid var(--ic-neutral-200, #e2e8f0);
  background: #f8fafc;
  margin-left: -0.25rem;
  margin-right: -0.25rem;
}

.ar-channel-tabs {
  display: flex;
  flex: 1;
  min-width: 0;
  gap: 0;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  padding: 0.3rem 0.25rem 0;
}

.ar-channel-tab {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.45rem 0.85rem 0.4rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--ic-text-secondary);
  background: transparent;
  border: 1px solid transparent;
  border-bottom: none;
  border-radius: 6px 6px 0 0;
  margin-bottom: -1px;
  cursor: pointer;
  transition: color 0.12s, background 0.12s, border-color 0.12s, box-shadow 0.12s;
  line-height: 1.4;
  white-space: nowrap;
}
/* 토픽 탭 제목 truncation */
.ar-channel-tab__topic-title {
  display: block;
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* + 버튼 탭 (36-40px 정사각 아이콘 버튼, 탭 끝 고정) */
.ar-channel-tab--add {
  padding: 0.35rem 0.5rem;
  min-width: 36px;
  justify-content: center;
  color: var(--ic-neutral-500);
  border: 1px solid transparent;
  border-bottom: none;
  margin-left: 2px;
}
.ar-channel-tab--add:hover {
  color: var(--ic-brand-600);
  background: color-mix(in srgb, var(--ic-brand-500) 10%, transparent);
  border-color: color-mix(in srgb, var(--ic-brand-400) 30%, transparent);
}

/* ⚙ 토픽 관리 버튼 (ar-channel-tabs-outer의 직속 자식 — 우측 고정) */
.ar-channel-tab--manage {
  padding: 0.35rem 0.5rem;
  min-width: 32px;
  flex-shrink: 0;
  justify-content: center;
  color: var(--ic-neutral-400);
  border: 1px solid transparent;
  border-bottom: none;
  border-left-color: var(--ic-neutral-200, #e2e8f0);
  opacity: 0.7;
  transition: color 0.12s, background 0.12s, border-color 0.12s, opacity 0.12s;
}
.ar-channel-tab--manage:hover {
  color: var(--ic-neutral-600);
  background: var(--ic-neutral-100, #f1f5f9);
  border-color: var(--ic-neutral-200, #e2e8f0);
  opacity: 1;
}

/* 토픽 탭 래퍼 (⋯ 버튼 포지셔닝 앵커 + 퇴장 애니메이션 단위) */
.ar-channel-tab-wrap--topic {
  position: relative;
  display: inline-flex;
  align-items: stretch;
  transition: opacity 0.14s ease, max-width 0.16s ease;
  max-width: 240px;
}
.ar-channel-tab-wrap--topic.is-exiting {
  opacity: 0;
  max-width: 0;
  overflow: hidden;
  pointer-events: none;
}
/* 토픽 탭 버튼: 오른쪽에 ⋯ 버튼 공간 확보 */
.ar-channel-tab-wrap--topic .ar-channel-tab--topic {
  padding-right: 1.6rem;
  transition: color 0.12s, background 0.12s, border-color 0.12s, box-shadow 0.12s;
  max-width: 200px;
}

/* ⋯ 메뉴 버튼: 탭 오른쪽 끝에 겹쳐서 위치 */
.ar-channel-tab__menu-btn {
  position: absolute;
  right: 3px;
  top: 50%;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  padding: 0;
  border: none;
  border-radius: 3px;
  background: transparent;
  cursor: pointer;
  color: var(--ic-text-secondary);
  font-size: 0.85rem;
  letter-spacing: 0;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: background 0.1s, color 0.1s;
  z-index: 1;
}
.ar-channel-tab-wrap--topic:hover .ar-channel-tab__menu-btn,
.ar-channel-tab-wrap--topic:has(.ar-channel-tab--topic:focus-visible) .ar-channel-tab__menu-btn,
.ar-channel-tab-wrap--topic:has(.ar-channel-tab__menu-btn:focus-visible) .ar-channel-tab__menu-btn {
  opacity: 1;
}
/* 탭 클릭 직후 hover 잔류로 인한 ⋯ 노출 방지 (400ms) */
.ar-channel-tab-wrap--topic.is-just-selected .ar-channel-tab__menu-btn {
  opacity: 0 !important;
}
.ar-channel-tab__menu-btn:hover {
  background: color-mix(in srgb, var(--ic-neutral-500) 18%, transparent);
  color: var(--ic-neutral-800);
}

/* ── 토픽 탭 드롭다운 메뉴 ────────────────────────────────────────────── */
.ar-tab-menu {
  position: fixed;
  z-index: 300;
  background: #fff;
  border: 1px solid var(--ic-neutral-200, #e2e8f0);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.12), 0 2px 6px rgba(0,0,0,0.07);
  padding: 0.3rem 0;
  min-width: 140px;
  font-size: 0.82rem;
}
.ar-tab-menu__item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 0.45rem 0.9rem;
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--ic-neutral-800);
  font-size: 0.82rem;
  line-height: 1.4;
  white-space: nowrap;
}
.ar-tab-menu__item:hover {
  background: var(--ic-neutral-50, #f8fafc);
}
.ar-tab-menu__item--danger { color: #dc2626; }
.ar-tab-menu__item--danger:hover { background: #fef2f2; }
.ar-tab-menu__divider {
  height: 1px;
  background: var(--ic-neutral-150, #e8edf2);
  margin: 0.3rem 0;
}

/* ── 인라인 이름 변경 input ─────────────────────────────────────────── */
.ar-channel-tab__rename-input {
  /* 탭 버튼과 동일한 외형 유지, 편집 중임을 border로 표시 */
  width: 120px;
  max-width: 160px;
  min-width: 60px;
  font-size: 0.78rem;   /* .ar-channel-tab과 동일 — input은 inherit 미적용 */
  font-weight: 600;
  font-family: inherit;
  line-height: 1.4;
  color: var(--ic-brand-700, #4338ca);
  border: 1px solid var(--ic-brand-400, #818cf8) !important;
  border-bottom: none !important;
  border-radius: 6px 6px 0 0;
  background: #fff;
  padding: 0 0.5rem;
  outline: none;
  box-shadow: 0 -2px 6px rgba(0,0,0,0.05), 0 0 0 2px color-mix(in srgb, var(--ic-brand-500) 18%, transparent);
}
.ar-channel-tab__rename-input:focus {
  outline: none;
}

/* ── 토픽 탭 미읽 카운트 뱃지 ──────────────────────────────────────── */
.ar-channel-tab__unread-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 8px;
  background: var(--ic-brand-500, #6366f1);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  line-height: 1;
  margin-left: 4px;
  flex-shrink: 0;
}

/* ── 토픽 탭 드래그 앤 드롭 ─────────────────────────────────────────── */
.ar-channel-tab-wrap--topic[draggable="true"] {
  cursor: grab;
}
.ar-channel-tab-wrap--topic.is-dragging {
  opacity: 0.4;
  cursor: grabbing;
}
.ar-channel-tab-wrap--topic.is-drop-before {
  box-shadow: -2px 0 0 0 var(--ic-brand-500, #6366f1);
}
.ar-channel-tab-wrap--topic.is-drop-after {
  box-shadow: 2px 0 0 0 var(--ic-brand-500, #6366f1);
}

/* ── 토픽 삭제 확인 모달 본문 ────────────────────────────────────────── */
.ar-topic-delete-body {
  margin: 0;
  font-size: 0.87rem;
  line-height: 1.6;
  color: var(--ic-text-primary);
}
.ar-topic-delete-name {
  font-weight: 700;
}
.ar-topic-delete-warn {
  font-size: 0.8rem;
  color: var(--ic-text-secondary);
}

/* closed 토픽 탭 퇴장 애니메이션 (하위 호환 — wrapper로 이전됨) */
.ar-channel-tab--topic {
  transition: color 0.12s, background 0.12s, border-color 0.12s, box-shadow 0.12s;
  max-width: 200px;
}

.ar-channel-tabs::-webkit-scrollbar { display: none; }

.ar-channel-tab:hover {
  color: var(--ic-neutral-800);
  background: color-mix(in srgb, var(--ic-neutral-400) 8%, transparent);
}
.ar-channel-tab.is-active {
  color: var(--ic-brand-600);
  background: #fff;
  border-color: var(--ic-neutral-200, #e2e8f0);
  /* border-bottom은 none이므로 background가 탭바 border와 이어짐 */
  box-shadow: 0 -2px 6px rgba(0, 0, 0, 0.05), inset 0 1px 0 rgba(79, 70, 229, 0.12);
}

.ar-mobile-channel-actions {
  display: none;
}

/* ── 토픽 뷰 컨테이너 ────────────────────────────────────────────── */
.ar-topics-view {
  grid-row: 3;
  min-height: 0;
  overflow-y: auto;
  background: var(--ic-surface-primary, #fff);
  flex-direction: column;
  /* display는 .hidden 제거 시에만 flex 적용 — Tailwind hidden 우선순위 충돌 방지 */
}
.ar-topics-view:not(.hidden) {
  display: flex;
}

.ar-topics-view__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1.25rem 0.6rem;
  border-bottom: 1px solid var(--ic-neutral-150, #e8edf2);
  flex-shrink: 0;
  position: sticky;
  top: 0;
  background: #fff;
  z-index: 1;
}

.ar-topics-view__title {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--ic-text-tertiary);
}

/* ── 토픽 생성 인라인 폼 ─────────────────────────────────────────── */
.ar-topic-create-form {
  padding: 0.6rem 1.25rem 0.7rem;
  border-bottom: 1px solid var(--ic-neutral-150, #e8edf2);
  background: var(--ic-neutral-50, #f8fafc);
  flex-shrink: 0;
}

.ar-topic-create-form__row {
  display: flex;
  gap: 0.45rem;
  align-items: center;
}

.ar-topic-create-form__input {
  flex: 1;
  min-width: 0;
  padding: 0.4rem 0.65rem;
  font-size: 0.85rem;
  border: 1px solid var(--ic-neutral-300);
  border-radius: 0.4rem;
  outline: none;
  background: #fff;
  transition: border-color 0.1s, box-shadow 0.1s;
}
.ar-topic-create-form__input:focus {
  border-color: var(--ic-brand-400);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--ic-brand-500) 14%, transparent);
}

/* ── 토픽 목록 ────────────────────────────────────────────────────── */
.ar-topics-list {
  flex: 1;
  padding: 0.75rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

/* ── 토픽 카드 ─────────────────────────────────────────────────────── */
.ar-topic-card {
  padding: 0.7rem 0.9rem;
  border: 1px solid var(--ic-neutral-200);
  border-radius: 0.6rem;
  background: #fff;
  cursor: pointer;
  transition: border-color 0.12s, box-shadow 0.12s, background 0.12s;
}
.ar-topic-card:hover {
  border-color: var(--ic-brand-300);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  background: color-mix(in srgb, var(--ic-brand-50, #eff6ff) 60%, #fff);
}

.ar-topic-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.15rem;
}

.ar-topic-card__title {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--ic-neutral-900);
  min-width: 0;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ar-topic-card__desc {
  font-size: 0.78rem;
  color: var(--ic-text-secondary);
  margin: 0.15rem 0 0.3rem;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.ar-topic-card__meta {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.72rem;
  color: var(--ic-text-tertiary);
  flex-wrap: wrap;
  margin-top: 0.3rem;
}

.ar-topic-card__dot {
  opacity: 0.4;
}

/* ── 토픽 상태 배지 ──────────────────────────────────────────────── */
.ar-topic-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.1rem 0.45rem;
  border-radius: 0.8rem;
  font-size: 0.66rem;
  font-weight: 700;
  flex-shrink: 0;
  letter-spacing: 0.02em;
}
.ar-topic-badge--active {
  background: color-mix(in srgb, var(--ic-success-500, #22c55e) 12%, transparent);
  color: var(--ic-success-700, #15803d);
}
.ar-topic-badge--closed {
  background: var(--ic-neutral-100);
  color: var(--ic-text-tertiary);
}

/* ── 닫힌 토픽 접힘 섹션 ─────────────────────────────────────────── */
.ar-topics-closed-section {
  margin-top: 0.25rem;
}

.ar-topics-closed-summary {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.45rem 0.6rem;
  font-size: 0.77rem;
  font-weight: 600;
  color: var(--ic-text-secondary);
  cursor: pointer;
  border-radius: 0.4rem;
  list-style: none;
  user-select: none;
}
.ar-topics-closed-summary::-webkit-details-marker { display: none; }
.ar-topics-closed-summary:hover {
  background: var(--ic-neutral-100);
}

.ar-topics-closed-chevron {
  flex-shrink: 0;
  transition: transform 0.15s ease;
}
details[open] > .ar-topics-closed-summary .ar-topics-closed-chevron {
  transform: rotate(180deg);
}

.ar-topics-closed-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: 9px;
  font-size: 0.68rem;
  font-weight: 700;
  background: var(--ic-neutral-200);
  color: var(--ic-text-tertiary);
}

/* ── 빈 상태 ─────────────────────────────────────────────────────── */
.ar-topics-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 1.5rem;
  gap: 0.4rem;
  text-align: center;
}
.ar-topics-empty svg {
  opacity: 0.3;
  margin-bottom: 0.4rem;
  color: var(--ic-neutral-500);
}
.ar-topics-empty__title {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--ic-neutral-600);
  margin: 0;
}
.ar-topics-empty__sub {
  font-size: 0.78rem;
  color: var(--ic-text-tertiary);
  margin: 0;
}

/* ── 로딩 상태 ──────────────────────────────────────────────────── */
.ar-topics-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2.5rem;
  font-size: 0.8rem;
  color: var(--ic-text-tertiary);
}

/* ── 모바일 채널 액션 ⋯ 메뉴 (≤640px 전용) ──────────────────────── */
/* 데스크톱에서는 숨김, 모바일에서만 표시 */
.ar-mobile-channel-actions {
  display: none;
  position: relative;
  z-index: 10;
}
.ar-mobile-channel-actions__summary {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--ic-neutral-200, #e2e8f0);
  border-radius: 8px;
  background: transparent;
  color: var(--ic-text-secondary);
  cursor: pointer;
  list-style: none;
  -webkit-tap-highlight-color: transparent;
}
.ar-mobile-channel-actions__summary::-webkit-details-marker { display: none; }
.ar-mobile-channel-actions[open] .ar-mobile-channel-actions__summary {
  background: var(--ic-neutral-100, #f1f5f9);
  color: var(--ic-text-primary);
}
/* 바텀시트 스타일 드롭다운 */
.ar-mobile-channel-actions__sheet {
  position: fixed;
  left: 0.75rem;
  right: 0.75rem;
  bottom: calc(0.75rem + env(safe-area-inset-bottom));
  background: #fff;
  border: 1px solid var(--ic-neutral-200, #e2e8f0);
  border-radius: 16px;
  padding: 0.4rem;
  box-shadow: 0 16px 42px rgba(15, 23, 42, 0.22), 0 2px 8px rgba(15, 23, 42, 0.08);
  display: flex;
  flex-direction: column;
  gap: 2px;
  z-index: 300;
  animation: ar-mobile-sheet-in 180ms cubic-bezier(0.32, 0.72, 0, 1) both;
}
@keyframes ar-mobile-sheet-in {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}
.ar-mobile-channel-actions__item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.7rem 0.9rem;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: var(--ic-text-primary, #1e293b);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
  min-height: 44px;
}
.ar-mobile-channel-actions__item:hover,
.ar-mobile-channel-actions__item:active {
  background: var(--ic-neutral-100, #f1f5f9);
}
.ar-mobile-channel-actions__item svg {
  flex-shrink: 0;
  color: var(--ic-text-secondary);
}
.ar-mobile-channel-actions__count {
  margin-left: auto;
  background: var(--ar-thread-color, #6366f1);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 600;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ── 반응형 ──────────────────────────────────────────────────────── */
@media (max-width: 640px) {
  /* 데스크톱 전용 버튼 — 모바일에서 숨김 */
  .ar-channel-action--desktop {
    display: none !important;
  }
  /* 모바일 ⋯ 메뉴 버튼 표시 */
  .ar-mobile-channel-actions {
    display: flex;
  }

  .ar-chat-header__top-row {
    align-items: center !important;
    gap: 0.5rem;
  }

  .ar-chat-header__top-row > h2 {
    flex: 1 1 auto;
    min-width: 0;
    min-height: 2rem;
    align-items: center;
    padding-right: 0.25rem;
  }

  .ar-chat-header__actions {
    flex: 0 0 auto;
    align-self: center;
    overflow: visible;
  }

  .ar-chat-header__actions .ar-channel-action--desktop {
    display: none !important;
  }

  .ar-mobile-channel-actions {
    display: block;
    position: relative;
  }

  .ar-mobile-channel-actions__summary {
    width: 44px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--ic-neutral-200, #e2e8f0);
    border-radius: 999px;
    background: #fff;
    color: var(--ic-text-secondary);
    cursor: pointer;
    list-style: none;
    box-shadow: 0 1px 4px rgba(15, 23, 42, 0.06);
  }

  .ar-mobile-channel-actions__summary::-webkit-details-marker {
    display: none;
  }

  .ar-mobile-channel-actions[open] .ar-mobile-channel-actions__summary {
    color: var(--ic-brand-600);
    border-color: color-mix(in srgb, var(--ic-brand-500) 28%, var(--ic-neutral-200));
    background: color-mix(in srgb, var(--ic-brand-500) 8%, #fff);
  }

  .ar-mobile-channel-actions__sheet {
    position: fixed;
    left: 50%;
    bottom: calc(0.75rem + env(safe-area-inset-bottom));
    z-index: 320;
    width: min(26rem, calc(100vw - 1.5rem));
    transform: translateX(-50%);
    display: grid;
    gap: 0.35rem;
    padding: 0.55rem;
    border: 1px solid var(--ic-neutral-200, #e2e8f0);
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 18px 48px rgba(15, 23, 42, 0.26), 0 2px 8px rgba(15, 23, 42, 0.08);
  }

  .ar-mobile-channel-actions__item {
    min-height: 46px;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    padding: 0.7rem 0.85rem;
    border: 0;
    border-radius: 12px;
    background: transparent;
    color: var(--ic-text-primary);
    font-size: 0.92rem;
    font-weight: 650;
    text-align: left;
    text-decoration: none;
    cursor: pointer;
  }

  .ar-mobile-channel-actions__item:hover,
  .ar-mobile-channel-actions__item:focus-visible {
    background: var(--ic-neutral-50, #f8fafc);
    outline: none;
  }

  .ar-mobile-channel-actions__item svg {
    flex-shrink: 0;
    color: var(--ic-text-secondary);
  }

  .ar-mobile-channel-actions__count {
    margin-left: auto;
    min-width: 22px;
    height: 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 0.4rem;
    border-radius: 999px;
    background: var(--ic-brand-500, #6366f1);
    color: #fff;
    font-size: 0.72rem;
    font-weight: 750;
  }

  .ar-channel-tabs-outer {
    border-bottom: none;
    background: transparent;
    margin-top: 0.2rem;
    margin-left: -0.35rem;
    margin-right: -0.35rem;
    align-items: center;
    gap: 0.35rem;
  }

  .ar-channel-tabs {
    gap: 0.25rem;
    padding: 0.35rem 0.4rem;
    border: 1px solid var(--ic-neutral-200, #e2e8f0);
    border-radius: 999px;
    background: #f8fafc;
  }

  .ar-channel-tabs-outer > .ar-channel-tab--manage {
    border: 1px solid var(--ic-neutral-200, #e2e8f0);
    border-radius: 999px;
    min-height: 38px;
    margin-bottom: 0;
    padding: 0 0.55rem;
  }

  .ar-channel-tab {
    min-height: 38px;
    padding: 0 0.8rem;
    font-size: 0.75rem;
    gap: 0.2rem;
    border: 1px solid transparent;
    border-radius: 999px;
    margin-bottom: 0;
    line-height: 1;
  }

  .ar-channel-tab.is-active {
    border-color: var(--ic-neutral-200, #e2e8f0);
    box-shadow: 0 1px 4px rgba(15, 23, 42, 0.08), inset 0 1px 0 rgba(79, 70, 229, 0.12);
  }

  .ar-channel-tab svg { display: none; }

  .ar-channel-tab--add svg,
  .ar-channel-tab--manage svg {
    display: block;
  }

  .ar-channel-tab-wrap--topic {
    flex: 0 0 auto;
    max-width: 190px;
  }

  .ar-channel-tab-wrap--topic .ar-channel-tab--topic {
    max-width: 170px;
    padding-right: 2.1rem;
  }

  .ar-channel-tab__topic-title {
    max-width: 106px;
  }

  /* 모바일: hover가 없으므로 ⋯ 버튼을 탭마다 항상 표시 */
  .ar-channel-tab__menu-btn {
    width: 30px;
    height: 30px;
    right: 3px;
    border-radius: 999px;
    font-size: 1rem;
    opacity: 1;
  }

  .ar-channel-tab-wrap--topic[draggable="true"],
  .ar-channel-tab-wrap--topic.is-touch-reorder {
    cursor: default;
  }

  .ar-tab-menu {
    left: 50% !important;
    top: auto !important;
    bottom: calc(0.75rem + env(safe-area-inset-bottom));
    transform: translateX(-50%);
    width: min(26rem, calc(100vw - 1.5rem));
    border-radius: 16px;
    padding: 0.45rem;
    box-shadow: 0 16px 42px rgba(15, 23, 42, 0.24), 0 2px 8px rgba(15, 23, 42, 0.08);
  }

  .ar-tab-menu__item {
    min-height: 44px;
    padding: 0.7rem 0.9rem;
    border-radius: 10px;
    font-size: 0.9rem;
  }

  .ar-tab-menu__divider {
    margin: 0.35rem 0;
  }

  .ar-chat-composer {
    padding: 0.5rem 0.75rem calc(0.5rem + env(safe-area-inset-bottom)) !important;
  }

  .ar-chat-shell.is-mobile-keyboard-raised .ar-chat-composer {
    transform: translateY(calc(-1 * var(--ar-mobile-keyboard-offset, 0px)));
    transition: transform 0.14s ease-out;
    z-index: 20;
    will-change: transform;
  }

  .ar-chat-shell.is-mobile-keyboard-raised .ar-chat-stream {
    padding-bottom: calc(var(--ar-mobile-keyboard-offset, 0px) + 0.75rem);
  }

  .ar-chat-composer__form {
    gap: 0.4rem;
  }

  .ar-chat-composer__row {
    align-items: end;
    gap: 0.5rem;
  }

  .ar-chat-input {
    height: auto;
    min-height: 42px !important;
    max-height: 124px;
    border-radius: 16px !important;
    line-height: 1.35;
  }

  .ar-chat-send {
    width: 42px;
    height: 42px;
    min-height: 42px;
    align-self: end;
    border-radius: 999px;
  }

  .ar-chat-composer__toolbar {
    min-height: 34px;
    gap: 0.4rem;
  }

  .ar-chat-attach {
    width: 34px;
    height: 34px;
    border: 1px solid var(--ic-neutral-200, #e2e8f0);
    border-radius: 999px;
    background: #f8fafc;
  }

  .ar-chat-composer__hint {
    display: none;
  }

  .ar-attachment-preview {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 0.3rem;
    scrollbar-width: none;
  }

  .ar-attachment-preview::-webkit-scrollbar {
    display: none;
  }

  .ar-topics-view__header {
    padding: 0.6rem 1rem 0.5rem;
  }
  .ar-topics-list {
    padding: 0.5rem 0.75rem;
    gap: 0.35rem;
  }
  .ar-topic-create-form {
    padding: 0.55rem 1rem 0.6rem;
  }
  .ar-topic-card {
    padding: 0.6rem 0.75rem;
  }
}

/* ════════════════════════════════════════════════════════════════════
   토픽 디테일 뷰 (#t98)
   ════════════════════════════════════════════════════════════════════ */

/* ── 디테일 오버레이 (ar-topics-view 내부 전체 덮음) ─────────────── */
.ar-topic-detail {
  position: absolute;
  inset: 0;
  background: #fff;
  display: flex;
  flex-direction: column;
  z-index: 2;
}
.ar-topic-detail.hidden { display: none; }

/* ── 헤더 ────────────────────────────────────────────────────────── */
.ar-topic-detail__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.55rem 1rem 0.55rem 0.75rem;
  border-bottom: 1px solid var(--ic-neutral-200);
  flex-shrink: 0;
  background: #fff;
  min-height: 0;
}

/* 뒤로가기 버튼 + 브레드크럼 */
.ar-topic-detail__back {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: none;
  border: none;
  padding: 0.25rem 0.4rem;
  border-radius: 0.35rem;
  cursor: pointer;
  color: var(--ic-text-secondary);
  font-size: 0.78rem;
  font-weight: 500;
  transition: background 0.1s, color 0.1s;
  min-width: 0;
  flex: 1;
  text-align: left;
}
.ar-topic-detail__back:hover {
  background: var(--ic-neutral-100);
  color: var(--ic-neutral-800);
}
.ar-topic-detail__back > svg { flex-shrink: 0; }

.ar-topic-detail__breadcrumb {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  min-width: 0;
}
.ar-topic-detail__channel {
  color: var(--ic-text-tertiary);
  white-space: nowrap;
  flex-shrink: 0;
}
.ar-topic-detail__name {
  color: var(--ic-neutral-900);
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 우측: 상태 배지 + 액션 버튼 */
.ar-topic-detail__header-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}
.ar-topic-detail__actions {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

/* ── 메시지 스트림 ────────────────────────────────────────────────── */
.ar-topic-detail__messages {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 0.75rem 1.25rem;
}

/* ── 작성 창 ─────────────────────────────────────────────────────── */
.ar-topic-detail__composer {
  flex-shrink: 0;
  padding: 0.6rem 1rem;
  border-top: 1px solid var(--ic-neutral-200);
  background: #fff;
}
.ar-topic-detail__composer-row {
  display: flex;
  align-items: flex-end;
  gap: 0.5rem;
}
.ar-topic-detail__input {
  flex: 1;
  min-width: 0;
  resize: none;
  padding: 0.45rem 0.65rem;
  font-size: 0.875rem;
  font-family: inherit;
  line-height: 1.5;
  border: 1px solid var(--ic-neutral-300);
  border-radius: 0.5rem;
  outline: none;
  background: #fff;
  max-height: 120px;
  overflow-y: auto;
  transition: border-color 0.1s, box-shadow 0.1s;
}
.ar-topic-detail__input:focus {
  border-color: var(--ic-brand-400);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--ic-brand-500) 14%, transparent);
}

/* ── 닫힌 토픽 CTA ─────────────────────────────────────────────── */
.ar-topic-detail__closed-cta {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  padding: 0.75rem 1rem;
  border-top: 1px solid var(--ic-neutral-200);
  background: var(--ic-neutral-50, #f8fafc);
  font-size: 0.8rem;
  color: var(--ic-text-secondary);
}
.ar-topic-detail__closed-cta.hidden { display: none; }
.ar-topic-detail__closed-cta > svg { flex-shrink: 0; opacity: 0.6; }

/* ── 반응형 ──────────────────────────────────────────────────────── */
@media (max-width: 640px) {
  .ar-topic-detail__header {
    padding: 0.5rem 0.75rem;
  }
  .ar-topic-detail__messages {
    padding: 0.6rem 0.75rem;
  }
  .ar-topic-detail__channel { display: none; }
  .ar-topic-detail__back > svg:first-child { display: none; }
}

/* ── 토픽 생성 모달
   ════════════════════════════════════════════════════════════════════ */

.ar-topic-modal {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
}
.ar-topic-modal.hidden { display: none; }

.ar-topic-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.35);
  backdrop-filter: blur(2px);
}

.ar-topic-modal__panel {
  position: relative;
  z-index: 1;
  width: min(100% - 2rem, 440px);
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.18), 0 4px 12px rgba(0, 0, 0, 0.08);
  overflow: hidden;
}

.ar-topic-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.1rem 1.25rem 0.9rem;
  border-bottom: 1px solid var(--ic-neutral-150, #e8edf2);
}

.ar-topic-modal__title {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  color: var(--ic-neutral-900);
}

.ar-topic-modal__close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--ic-neutral-500);
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
}
.ar-topic-modal__close:hover {
  background: var(--ic-neutral-100);
  color: var(--ic-neutral-800);
}

.ar-topic-modal__form {
  display: grid;
  gap: 0.75rem;
  padding: 1.1rem 1.25rem 1.25rem;
}


.ar-topic-modal__footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  padding-top: 0.25rem;
}

/* ── 토픽 관리 모달 ─────────────────────────────────────────────────── */
.ar-topic-modal__panel--manage {
  width: min(100% - 2rem, 520px);
}

.ar-manage-modal__tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--ic-neutral-200, #e2e8f0);
  padding: 0 1.25rem;
  background: #fff;
}
.ar-manage-modal__tab {
  padding: 0.6rem 1rem 0.55rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--ic-text-secondary);
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  cursor: pointer;
  transition: color 0.12s, border-color 0.12s;
}
.ar-manage-modal__tab:hover {
  color: var(--ic-neutral-700);
}
.ar-manage-modal__tab.is-active {
  color: var(--ic-brand-600);
  border-bottom-color: var(--ic-brand-500);
}

.ar-manage-modal__filter {
  padding: 0.55rem 1.25rem 0.4rem;
  border-bottom: 1px solid var(--ic-neutral-100, #f1f5f9);
}
.ar-manage-modal__filter-input {
  width: 100%;
  padding: 0.38rem 0.7rem;
  font-size: 0.8rem;
  border: 1px solid var(--ic-neutral-200, #e2e8f0);
  border-radius: 6px;
  background: var(--ic-neutral-50, #f8fafc);
  color: var(--ic-neutral-800);
  outline: none;
  transition: border-color 0.12s, box-shadow 0.12s, background 0.12s;
}
.ar-manage-modal__filter-input:focus {
  border-color: var(--ic-brand-400);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--ic-brand-500) 15%, transparent);
  background: #fff;
}
.ar-manage-modal__filter-input::placeholder {
  color: var(--ic-neutral-400);
}

.ar-manage-modal__body {
  max-height: 360px;
  overflow-y: auto;
  padding: 0.35rem 0;
}
.ar-manage-modal__empty {
  padding: 2.5rem 1.25rem;
  text-align: center;
  font-size: 0.82rem;
  color: var(--ic-text-secondary);
}
.ar-manage-modal__list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.ar-manage-modal__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.6rem 1.25rem;
  border-bottom: 1px solid var(--ic-neutral-100, #f1f5f9);
}
.ar-manage-modal__row:last-child {
  border-bottom: none;
}
.ar-manage-modal__topic-title {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--ic-neutral-800);
  min-width: 0;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ar-manage-modal__actions {
  display: flex;
  gap: 0.35rem;
  flex-shrink: 0;
}
.ar-manage-modal__btn {
  padding: 0.28rem 0.6rem;
  font-size: 0.74rem;
  font-weight: 600;
  border: 1px solid var(--ic-neutral-200, #e2e8f0);
  border-radius: 5px;
  background: #fff;
  color: var(--ic-neutral-700);
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
}
.ar-manage-modal__btn:hover {
  background: var(--ic-neutral-50, #f8fafc);
  border-color: var(--ic-neutral-300, #cbd5e1);
}
.ar-manage-modal__btn--danger {
  color: #dc2626;
  border-color: #fecaca;
}
.ar-manage-modal__btn--danger:hover {
  background: #fef2f2;
  border-color: #fca5a5;
}

/* ── 토스트 알림 ────────────────────────────────────────────────────── */
.ar-toast {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%) translateY(0.4rem);
  background: var(--ic-neutral-800, #1e293b);
  color: #fff;
  font-size: 0.82rem;
  padding: 0.5rem 1.1rem;
  border-radius: 6px;
  opacity: 0;
  pointer-events: none;
  white-space: nowrap;
  box-shadow: 0 4px 14px rgba(0,0,0,0.22);
  z-index: 400;
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.ar-toast--visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* 경고 토스트 (비활성화 사유 등) */
.ar-toast--warn {
  background: var(--ic-neutral-700, #334155);
}

/* aria-disabled 버튼/링크 공통 스타일 */
.ar-button--aria-disabled {
  opacity: 0.55;
  cursor: not-allowed;
  pointer-events: auto; /* click 이벤트는 살려둠 — Stimulus에서 토스트 처리 */
}

/* ================================================================
   Mobile bottom sheet — 스레드 인라인 / 스레드 패널
   ================================================================ */

/* 바텀시트 배경 오버레이 — 단일 통합 정의 (Phase 3 중복 제거)
   is-visible: thread bottom sheet JS 사용
   is-open:    Phase 3 ar-bottom-sheet 컴포넌트 하위 호환 */
.ar-bottom-sheet-backdrop {
  display: block;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.42);
  z-index: 200;
  opacity: 0;
  transition: opacity 240ms ease;
  pointer-events: none;
}
.ar-bottom-sheet-backdrop.is-visible,
.ar-bottom-sheet-backdrop.is-open {
  opacity: 1;
  pointer-events: auto;
}

/* 배경 스크롤 잠금 */
.ar-body-scroll-locked {
  overflow: hidden;
  touch-action: none;
}

@media (max-width: 768px) {
  /* ── 스레드 인라인 → 바텀시트 ── */
  .ar-thread-inline.is-mobile-sheet {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 201;
    max-height: 72vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: 16px 16px 0 0;
    border: none;
    border-left: none;
    margin-top: 0;
    box-shadow: 0 -4px 28px rgba(15, 23, 42, 0.18);
    transform: translateY(100%);
    transition: transform 280ms cubic-bezier(0.32, 0.72, 0, 1);
  }
  .ar-thread-inline.is-mobile-sheet.is-open {
    transform: translateY(0);
  }
  /* 드래그 핸들 */
  .ar-thread-inline.is-mobile-sheet::before {
    content: '';
    display: block;
    width: 40px;
    height: 4px;
    background: #cbd5e1;
    border-radius: 2px;
    margin: 10px auto 2px;
    flex-shrink: 0;
  }

  /* ── 스레드 패널 → 모바일 풀스크린 오버레이 ── */
  .ar-thread-panel {
    position: fixed;
    inset: 0;
    z-index: 201;
    border-left: none;
    transition: transform 280ms cubic-bezier(0.32, 0.72, 0, 1),
                opacity 200ms ease;
    transform: translateX(100%);
    opacity: 0;
  }
  .ar-thread-panel.is-open {
    width: 100% !important;
    min-width: 100% !important;
    transform: translateX(0);
    opacity: 1;
  }
  .ar-thread-panel__resize-handle {
    display: none;
  }
}

/* ================================================================
   DOCS — Tailwind-docs-inspired documentation layout
   ================================================================ */

/* ── Header ── */
.ar-docs-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(12px) saturate(180%);
  border-bottom: 1px solid var(--ic-neutral-200);
  font-family: "IBM Plex Sans KR", ui-sans-serif, system-ui, sans-serif;
}
.ar-docs-header__inner {
  max-width: 92rem;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0 1.5rem;
  height: 4rem;
}
.ar-docs-header__left {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  flex-shrink: 0;
}
.ar-docs-header__logo { display: flex; align-items: center; flex-shrink: 0; }
.ar-docs-header__logo-img { height: 1.625rem; width: auto; }
.ar-docs-header__version {
  display: inline-flex;
  align-items: center;
  height: 1.375rem;
  padding: 0 0.5rem;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--ic-brand-600);
  background: var(--ic-brand-50);
  border: 1px solid rgba(99,102,241,0.15);
  border-radius: 999px;
}
.ar-docs-header__nav {
  display: flex;
  align-items: center;
  gap: 0.125rem;
  margin-left: 1rem;
}
.ar-docs-header__link {
  padding: 0.375rem 0.625rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--ic-neutral-500);
  border-radius: 0.375rem;
  transition: color 150ms, background 150ms;
  text-decoration: none;
}
.ar-docs-header__link:hover {
  color: var(--ic-neutral-900);
}
.ar-docs-header__link--active {
  color: var(--ic-neutral-900);
  font-weight: 600;
}
.ar-docs-header__link--login {
  color: var(--ic-neutral-600);
}
.ar-docs-header__actions {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  margin-left: auto;
}
/* Search button */
.ar-docs-header__search-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.375rem 0.75rem;
  min-width: 12rem;
  font-size: 0.8125rem;
  color: var(--ic-neutral-400);
  background: var(--ic-neutral-50);
  border: 1px solid var(--ic-neutral-200);
  border-radius: 0.5rem;
  cursor: pointer;
  transition: border-color 150ms;
  font-family: inherit;
}
.ar-docs-header__search-btn:hover {
  border-color: var(--ic-neutral-300);
}
.ar-docs-header__search-btn svg { flex-shrink: 0; }
.ar-docs-header__search-btn span {
  flex: 1;
  text-align: left;
  font-size: 0.8125rem;
  color: var(--ic-neutral-400);
}
.ar-docs-header__search-btn kbd {
  font-family: inherit;
  font-size: 0.6875rem;
  font-weight: 500;
  color: var(--ic-neutral-400);
  background: #fff;
  border: 1px solid var(--ic-neutral-200);
  border-radius: 0.25rem;
  padding: 0.0625rem 0.375rem;
  line-height: 1.4;
}
.ar-docs-header__cta {
  padding: 0.375rem 0.875rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #fff;
  background: var(--ic-brand-600);
  border-radius: 0.5rem;
  text-decoration: none;
  transition: background 150ms;
}
.ar-docs-header__cta:hover { background: var(--ic-brand-700); }
.ar-docs-header__menu-btn {
  display: none;
  padding: 0.375rem;
  color: var(--ic-neutral-600);
  background: none;
  border: none;
  cursor: pointer;
  border-radius: 0.375rem;
  margin-left: auto;
}
.ar-docs-header__menu-btn:hover { background: var(--ic-neutral-100); }

/* ── Layout ── */
.ar-docs-layout {
  max-width: 92rem;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 17rem minmax(0, 1fr);
  min-height: calc(100vh - 4rem);
  font-family: "IBM Plex Sans KR", ui-sans-serif, system-ui, sans-serif;
}

/* ── Sidebar ── */
.ar-docs-sidebar {
  position: sticky;
  top: 4rem;
  height: calc(100vh - 4rem);
  overflow-y: auto;
  padding: 1.75rem 0 2.25rem 1.5rem;
  border-right: 1px solid var(--ic-neutral-200);
  scrollbar-width: thin;
  scrollbar-color: var(--ic-neutral-200) transparent;
}
.ar-docs-sidebar__nav { padding-right: 0.75rem; }
.ar-docs-sidebar__group { margin-bottom: 1.25rem; }
.ar-docs-sidebar__group-title {
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--ic-neutral-900);
  padding: 0.25rem 0.5rem;
  margin-bottom: 0.25rem;
}
.ar-docs-sidebar__list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.ar-docs-sidebar__link {
  display: block;
  padding: 0.3125rem 0.5rem;
  font-size: 0.8125rem;
  color: var(--ic-neutral-500);
  text-decoration: none;
  border-radius: 0.375rem;
  border-left: 2px solid transparent;
  transition: color 120ms, background 120ms, border-color 120ms;
  word-break: keep-all;
}
.ar-docs-sidebar__link[aria-disabled="true"] {
  color: var(--ic-neutral-350, #b0b8c4);
  cursor: default;
}
.ar-docs-sidebar__link:hover {
  color: var(--ic-neutral-900);
}
.ar-docs-sidebar__link[aria-disabled="true"]:hover {
  color: var(--ic-neutral-350, #b0b8c4);
}
.ar-docs-sidebar__link--active {
  color: var(--ic-brand-600);
  font-weight: 600;
  border-left-color: var(--ic-brand-500);
}

/* Mobile sidebar overlay */
.ar-docs-sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 199;
  background: rgba(0,0,0,0.25);
  backdrop-filter: blur(2px);
}
.ar-docs-sidebar-overlay--visible { display: block; }

/* ── Content ── */
.ar-docs-content {
  min-width: 0;
  padding: 3rem 3rem 5rem;
  max-width: 54rem;
}

/* ── Right TOC ── */
.ar-docs-toc {
  display: none; /* shown on xl+ */
}
.ar-docs-toc__inner {
  position: sticky;
  top: 5.75rem;
  padding: 2rem 1.5rem 1.5rem 0;
}
.ar-docs-toc__title {
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ic-neutral-400);
  margin-bottom: 0.625rem;
}
.ar-docs-toc__list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.ar-docs-toc__link {
  display: block;
  padding: 0.25rem 0;
  font-size: 0.8125rem;
  color: var(--ic-neutral-500);
  text-decoration: none;
  border-left: 2px solid var(--ic-neutral-200);
  padding-left: 0.75rem;
  transition: color 120ms, border-color 120ms;
}
.ar-docs-toc__link:hover {
  color: var(--ic-brand-600);
  border-left-color: var(--ic-brand-400);
}

/* ── Article ── */
.ar-docs-article { }
.ar-docs-article__header { margin-bottom: 2.5rem; }
.ar-docs-article__breadcrumb {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--ic-brand-600);
  margin-bottom: 0.375rem;
  letter-spacing: 0.01em;
}
.ar-docs-article__title {
  font-size: 2.25rem;
  font-weight: 800;
  line-height: 1.15;
  color: var(--ic-neutral-900);
  margin: 0 0 1rem;
  letter-spacing: -0.03em;
}
.ar-docs-article__lead {
  font-size: 1.0625rem;
  line-height: 1.75;
  color: var(--ic-neutral-600);
  margin: 0;
}

/* Article prose */
.ar-docs-article h2 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--ic-neutral-900);
  margin: 2.5rem 0 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--ic-neutral-200);
  letter-spacing: -0.015em;
}
.ar-docs-article section:first-of-type h2 {
  margin-top: 0;
}
.ar-docs-article h3 {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--ic-neutral-800);
  margin: 1.75rem 0 0.75rem;
}
.ar-docs-article p {
  font-size: 0.9375rem;
  line-height: 1.75;
  color: var(--ic-neutral-700);
  margin: 0 0 1rem;
}
.ar-docs-article ul, .ar-docs-article ol {
  font-size: 0.9375rem;
  line-height: 1.75;
  color: var(--ic-neutral-700);
  margin: 0 0 1rem;
  padding-left: 1.5rem;
}
.ar-docs-article li { margin-bottom: 0.375rem; }
.ar-docs-article li > p { margin-bottom: 0.25rem; }
.ar-docs-article code {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.8125rem;
  background: var(--ic-neutral-100);
  padding: 0.125rem 0.375rem;
  border-radius: 0.25rem;
  color: var(--ic-brand-700);
}
.ar-docs-article a {
  color: var(--ic-brand-600);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.ar-docs-article a:hover { color: var(--ic-brand-700); }
.ar-docs-article strong { color: var(--ic-neutral-900); font-weight: 600; }

/* Method cards */
.ar-docs-method-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
  margin: 1.25rem 0 2rem;
}
.ar-docs-method-card {
  display: flex;
  flex-direction: column;
  min-height: 8.25rem;
  gap: 0.45rem;
  padding: 1rem;
  color: var(--ic-neutral-700);
  text-decoration: none;
  border: 1px solid var(--ic-neutral-200);
  border-radius: 0.75rem;
  background: #fff;
  transition: border-color 140ms, box-shadow 140ms, color 140ms;
}
.ar-docs-method-card:hover,
.ar-docs-method-card--active {
  color: var(--ic-neutral-900);
  border-color: var(--ic-brand-300);
  box-shadow: 0 1px 4px rgba(15,23,42,0.08);
}
.ar-docs-method-card__label {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--ic-brand-600);
}
.ar-docs-method-card__title {
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--ic-neutral-900);
}
.ar-docs-method-card__description {
  font-size: 0.8125rem;
  line-height: 1.6;
  color: var(--ic-neutral-500);
}

/* Procedure steps */
.ar-docs-procedure {
  display: flex;
  flex-direction: column;
  margin-top: 2.25rem;
}
.ar-docs-procedure-step {
  display: grid;
  grid-template-columns: 3.5rem minmax(0, 1fr);
  gap: 1.5rem;
  padding: 2rem 0;
  border-top: 1px solid var(--ic-neutral-200);
}
.ar-docs-procedure-step:first-child {
  padding-top: 0;
  border-top: 0;
}
.ar-docs-procedure-step__marker {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1;
  color: var(--ic-brand-600);
}
.ar-docs-procedure-step__label {
  margin: 0 0 0.35rem;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--ic-neutral-400);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.ar-docs-procedure-step h2 {
  margin: 0 0 0.75rem;
  padding: 0;
  border: 0;
}
.ar-docs-procedure-step h3 { margin-top: 1.25rem; }
.ar-docs-procedure-step ol,
.ar-docs-procedure-step ul {
  padding-left: 1.25rem;
}

/* ── Callout ── */
.ar-docs-callout {
  border-radius: 0.5rem;
  padding: 1rem 1.25rem;
  margin: 1.25rem 0;
  font-size: 0.875rem;
  line-height: 1.7;
}
.ar-docs-callout p { margin: 0; font-size: inherit; }
.ar-docs-callout--info {
  background: #eff6ff;
  border-left: 3px solid #3b82f6;
  color: #1e3a5f;
}
.ar-docs-callout--tip {
  background: #f0fdf4;
  border-left: 3px solid #22c55e;
  color: #14532d;
}
.ar-docs-callout--warning {
  background: #fffbeb;
  border-left: 3px solid #f59e0b;
  color: #78350f;
}

/* ── Code Block ── */
.ar-docs-codeblock {
  margin: 1.25rem 0 1.5rem;
  border-radius: 0.75rem;
  overflow: hidden;
  border: none;
  box-shadow: 0 2px 6px rgba(15,23,42,0.08);
}
.ar-docs-codeblock__header {
  background: #1e293b;
  padding: 0.5rem 1rem;
  display: flex;
  align-items: center;
}
.ar-docs-codeblock__lang {
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #94a3b8;
}
.ar-docs-codeblock__code {
  background: #0f172a;
  color: #e2e8f0;
  padding: 1rem 1.25rem;
  margin: 0;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.8125rem;
  line-height: 1.7;
  overflow-x: auto;
}
.ar-docs-codeblock__code code {
  background: none;
  padding: 0;
  border-radius: 0;
  color: inherit;
  font-size: inherit;
}

/* ── Table ── */
.ar-docs-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0 1.25rem;
  font-size: 0.875rem;
  overflow-wrap: anywhere;
}
.ar-docs-table th {
  text-align: left;
  padding: 0.625rem 0.75rem;
  font-weight: 600;
  color: var(--ic-neutral-700);
  background: var(--ic-neutral-50);
  border-bottom: 2px solid var(--ic-neutral-200);
}
.ar-docs-table td {
  padding: 0.625rem 0.75rem;
  border-bottom: 1px solid var(--ic-neutral-100);
  color: var(--ic-neutral-700);
}
.ar-docs-table th:first-child,
.ar-docs-table td:first-child {
  white-space: nowrap;
}
.ar-docs-table tr:hover td { background: var(--ic-neutral-50); }

/* ── Steps ── */
.ar-docs-steps {
  margin: 1.5rem 0;
  display: flex;
  flex-direction: column;
  gap: 0;
}
.ar-docs-step {
  display: flex;
  gap: 1.25rem;
  align-items: flex-start;
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--ic-neutral-100);
}
.ar-docs-step:last-child { border-bottom: none; }
.ar-docs-step__number {
  flex-shrink: 0;
  width: 2.5rem;
  font-size: 1.75rem;
  font-weight: 800;
  line-height: 1;
  color: var(--ic-brand-500);
  letter-spacing: -0.02em;
  padding-top: 0.125rem;
  font-variant-numeric: tabular-nums;
}
.ar-docs-step__content h3 {
  font-size: 1rem;
  font-weight: 700;
  margin: 0 0 0.375rem;
  color: var(--ic-neutral-900);
}
.ar-docs-step__content p {
  font-size: 0.875rem;
  line-height: 1.7;
  margin: 0;
  color: var(--ic-neutral-600);
}

/* ── Pagination ── */
.ar-docs-pagination {
  display: flex;
  justify-content: space-between;
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--ic-neutral-200);
  gap: 1rem;
}
.ar-docs-pagination__prev,
.ar-docs-pagination__next {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
  padding: 0.75rem 1rem;
  border: 1px solid var(--ic-neutral-200);
  border-radius: 0.5rem;
  text-decoration: none;
  transition: border-color 150ms, background 150ms;
}
.ar-docs-pagination__prev:hover,
.ar-docs-pagination__next:hover {
  border-color: var(--ic-brand-300);
  background: var(--ic-brand-50);
}
.ar-docs-pagination__next { text-align: right; margin-left: auto; }
.ar-docs-pagination__label {
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ic-neutral-400);
}
.ar-docs-pagination__title {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--ic-brand-600);
}

/* ── Footer ── */
.ar-docs-footer {
  background: #0f172a;
  color: #94a3b8;
  font-family: "IBM Plex Sans KR", ui-sans-serif, system-ui, sans-serif;
  font-size: 0.8125rem;
  line-height: 1.6;
  margin-top: auto;
}
.ar-docs-footer__inner {
  max-width: 90rem;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2rem;
  padding: 3rem 1.5rem 2rem;
}
.ar-docs-footer__col h6 {
  font-size: 0.8125rem;
  font-weight: 700;
  color: #f1f5f9;
  margin: 0 0 0.75rem;
  letter-spacing: 0.01em;
}
.ar-docs-footer__col ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
.ar-docs-footer__col li { margin-bottom: 0.375rem; }
.ar-docs-footer__col a {
  color: #94a3b8;
  text-decoration: none;
  transition: color 150ms;
}
.ar-docs-footer__col a:hover { color: #e2e8f0; }
.ar-docs-footer__bottom {
  max-width: 90rem;
  margin: 0 auto;
  padding: 1.25rem 1.5rem;
  border-top: 1px solid rgba(148,163,184,0.15);
}
.ar-docs-footer__bottom p {
  margin: 0;
  font-size: 0.75rem;
  color: #64748b;
}

/* ── Responsive ── */
@media (min-width: 80rem) {
  .ar-docs-layout {
    grid-template-columns: 17rem minmax(0, 54rem) 15rem;
  }
  .ar-docs-toc { display: block; }
}

@media (max-width: 64rem) {
  .ar-docs-header__search-btn { display: none; }
}

@media (max-width: 48rem) {
  .ar-docs-header__nav { display: none; }
  .ar-docs-header__actions { display: none; }
  .ar-docs-header__menu-btn { display: flex; }

  .ar-docs-layout {
    grid-template-columns: 1fr;
  }
  .ar-docs-sidebar {
    display: none;
    position: fixed;
    top: 4rem;
    left: 0;
    bottom: 0;
    width: 18rem;
    z-index: 200;
    background: #fff;
    padding: 1rem;
    box-shadow: 4px 0 16px rgba(0,0,0,0.08);
  }
  .ar-docs-sidebar--open { display: block; }
  .ar-docs-content {
    padding: 1.5rem 1rem 3rem;
  }
  .ar-docs-article__title { font-size: 1.625rem; }
  .ar-docs-article__lead { font-size: 0.9375rem; }
  .ar-docs-method-grid { grid-template-columns: 1fr; }
  .ar-docs-method-card { min-height: auto; }
  .ar-docs-procedure-step {
    grid-template-columns: 1fr;
    gap: 0.65rem;
    padding: 1.5rem 0;
  }

  .ar-docs-footer__inner {
    grid-template-columns: repeat(2, 1fr);
    padding: 2rem 1rem 1.5rem;
  }
}
