:root {
  color-scheme: light;
  --bg: #f6f7fa;
  --surface: #ffffff;
  --surface-soft: #fafbfc;
  --surface-subtle: #f1f3f7;
  --ink: #172033;
  --ink-strong: #101828;
  --muted: #667085;
  --muted-light: #6b7485;
  --line: #e7eaf0;
  --line-strong: #d8dde7;
  --primary: #5b5bd6;
  --primary-dark: #4848bd;
  --primary-soft: #efefff;
  --violet: #7659df;
  --green: #1d9a6c;
  --green-soft: #eaf8f2;
  --amber: #cf7a16;
  --amber-soft: #fff5e6;
  --red: #d34b55;
  --red-soft: #fff0f1;
  --blue: #3977d5;
  --blue-soft: #edf4ff;
  --shadow-xs: 0 1px 2px rgba(16, 24, 40, .04);
  --shadow-sm: 0 2px 8px rgba(16, 24, 40, .06), 0 1px 2px rgba(16, 24, 40, .04);
  --shadow-md: 0 12px 32px rgba(16, 24, 40, .12), 0 2px 8px rgba(16, 24, 40, .06);
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;
  --sidebar-width: 210px;
  --agent-width: 344px;
  font-family: Pretendard, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans KR", "Apple SD Gothic Neo", sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.5;
  overflow: hidden;
}

button, input, select, textarea { font: inherit; }
button, select { cursor: pointer; }
button { color: inherit; }
button:disabled { cursor: not-allowed; }
a { color: inherit; text-decoration: none; }
svg { display: block; }

:focus-visible {
  outline: 3px solid rgba(91, 91, 214, .24);
  outline-offset: 2px;
}

.svg-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.sr-only { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0, 0, 0, 0) !important; white-space: nowrap !important; border: 0 !important; }
.hidden { display: none !important; }

.skip-link {
  position: fixed;
  z-index: 1000;
  top: 10px;
  left: 10px;
  padding: 9px 14px;
  border-radius: var(--radius-sm);
  background: var(--ink-strong);
  color: white;
  transform: translateY(-160%);
  transition: transform .2s ease;
}
.skip-link:focus { transform: translateY(0); }

.app-shell {
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr) var(--agent-width);
  width: 100vw;
  height: 100vh;
  height: 100dvh;
}

/* Sidebar */
.sidebar {
  position: relative;
  z-index: 30;
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: #fbfbfd;
  border-right: 1px solid var(--line);
}

.brand {
  display: flex;
  align-items: center;
  height: 70px;
  padding: 0 20px;
  gap: 11px;
}

.brand-mark {
  position: relative;
  display: inline-flex;
  align-items: flex-end;
  justify-content: center;
  width: 29px;
  height: 29px;
  flex: 0 0 29px;
  padding: 6px;
  gap: 2px;
  overflow: hidden;
  border-radius: 9px;
  background: linear-gradient(145deg, #6669e8, #514dbf);
  box-shadow: 0 4px 10px rgba(81, 77, 191, .25);
}
.brand-mark::before { content: ""; position: absolute; inset: -15px 5px 7px -10px; background: rgba(255,255,255,.13); transform: rotate(35deg); }
.brand-mark span { position: relative; width: 3px; border-radius: 2px; background: white; }
.brand-mark span:nth-child(1) { height: 7px; opacity: .75; }
.brand-mark span:nth-child(2) { height: 13px; }
.brand-mark span:nth-child(3) { height: 10px; opacity: .86; }
.brand-name { color: var(--ink-strong); font-size: 17px; font-weight: 750; letter-spacing: -.04em; }

.primary-nav { display: flex; flex-direction: column; padding: 13px 11px; }
.nav-label { margin: 10px 10px 8px; color: var(--muted-light); font-size: 10px; font-weight: 750; letter-spacing: .09em; }
.nav-label-spaced { margin-top: 23px; }
.nav-item {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 42px;
  padding: 0 11px;
  gap: 11px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: #5d6576;
  text-align: left;
  font-weight: 570;
  transition: color .15s ease, background .15s ease;
}
.nav-item:hover { background: #f2f2f7; color: var(--ink); }
.nav-item.active { background: var(--primary-soft); color: var(--primary-dark); font-weight: 680; }
.nav-item svg { width: 19px; height: 19px; flex: 0 0 19px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.nav-count { min-width: 21px; margin-left: auto; padding: 1px 6px; border-radius: 10px; background: #e9e9f7; color: #68677c; text-align: center; font-size: 11px; }
.nav-item.active .nav-count { background: white; color: var(--primary); }

.sidebar-foot { margin-top: auto; padding: 12px; border-top: 1px solid var(--line); }
.workspace-switcher, .profile-row { display: flex; align-items: center; min-width: 0; }
.workspace-switcher { padding: 7px 7px 13px; gap: 9px; border-bottom: 1px solid var(--line); }
.workspace-switcher > svg { width: 15px; height: 15px; margin-left: auto; fill: none; stroke: var(--muted); stroke-width: 1.8; }
.workspace-avatar, .avatar { display: inline-grid; place-items: center; flex: 0 0 auto; border-radius: 9px; font-weight: 750; }
.workspace-avatar { width: 31px; height: 31px; background: #25283a; color: white; }
.workspace-copy, .profile-copy { display: flex; flex-direction: column; min-width: 0; line-height: 1.35; }
.workspace-copy strong, .profile-copy strong { overflow: hidden; color: var(--ink); font-size: 12px; font-weight: 680; text-overflow: ellipsis; white-space: nowrap; }
.workspace-copy small, .profile-copy small { color: var(--muted-light); font-size: 10px; }
.profile-row { padding: 13px 6px 2px; gap: 9px; }
.avatar-user { width: 31px; height: 31px; border-radius: 50%; background: linear-gradient(145deg, #c9dcff, #a8c3ef); color: #2d5087; }
.profile-row .quiet { margin-left: auto; }
.sidebar-scrim, .agent-scrim { display: none; }

/* Shared controls */
.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
  transition: border-color .15s ease, background .15s ease, color .15s ease, transform .15s ease;
}
.icon-btn:hover { border-color: var(--line-strong); background: #f9fafb; }
.icon-btn:active { transform: translateY(1px); }
.icon-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.icon-btn.quiet { width: 32px; height: 32px; border-color: transparent; background: transparent; color: var(--muted); }
.icon-btn.quiet:hover { background: var(--surface-subtle); color: var(--ink); }

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 15px;
  gap: 7px;
  border: 1px solid transparent;
  border-radius: 9px;
  font-weight: 680;
  box-shadow: none;
  transition: background .15s ease, border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}
.button svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.button.primary { background: var(--primary); color: white; box-shadow: 0 2px 5px rgba(91, 91, 214, .2); }
.button.primary:hover { background: var(--primary-dark); box-shadow: 0 4px 10px rgba(91, 91, 214, .22); }
.button.primary:disabled { background: #ababd5; box-shadow: none; }
.button.secondary { border-color: var(--line-strong); background: var(--surface); color: #3d4658; }
.button.secondary:hover { background: var(--surface-subtle); }
.button.danger { background: var(--red); color: white; }
.button.danger:hover { background: #b93944; }
.button.danger-ghost { background: transparent; color: var(--red); }
.button.danger-ghost:hover { background: var(--red-soft); }
.button.compact { min-height: 34px; padding-inline: 11px; font-size: 12px; }
.text-button { display: inline-flex; align-items: center; padding: 5px; gap: 5px; border: 0; background: transparent; color: var(--primary); font-size: 12px; font-weight: 650; }
.text-button:hover { color: var(--primary-dark); }
.text-button svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* Main content */
.main-area { display: flex; min-width: 0; flex-direction: column; background: var(--bg); }
.topbar {
  position: relative;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 70px;
  flex: 0 0 70px;
  padding: 0 27px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, .9);
  backdrop-filter: blur(10px);
}
.topbar-leading, .topbar-actions { display: flex; align-items: center; gap: 9px; }
.mobile-menu { display: none; }
.page-context { display: flex; align-items: center; gap: 8px; color: var(--muted-light); font-size: 12px; }
.page-context b { color: #d0d5dd; font-weight: 400; }
.page-context strong { color: #41495a; font-weight: 650; }
.notification-button { position: relative; border-color: transparent; background: transparent; color: var(--muted); }
.notification-button > span { position: absolute; top: 7px; right: 7px; width: 6px; height: 6px; border: 1.5px solid white; border-radius: 50%; background: var(--red); }
.agent-mobile-button { display: none; align-items: center; height: 36px; padding: 0 11px; gap: 6px; border: 1px solid var(--line); border-radius: 9px; background: white; color: var(--primary); font-weight: 650; }
.agent-mobile-button svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }

.content-scroll { min-height: 0; flex: 1; overflow: auto; scrollbar-gutter: stable; }
.content-wrap { width: 100%; max-width: 1180px; margin: 0 auto; padding: 30px 28px 44px; }
.hero-row { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: 24px; gap: 20px; }
.eyebrow { margin: 0 0 5px; color: var(--primary); font-size: 11px; font-weight: 720; letter-spacing: .01em; }
h1 { margin: 0; color: var(--ink-strong); font-size: clamp(23px, 2.1vw, 29px); line-height: 1.25; letter-spacing: -.045em; }
.hero-subtitle { margin: 7px 0 0; color: var(--muted); font-size: 12px; }
.week-control { display: inline-flex; align-items: center; padding: 3px; gap: 2px; border: 1px solid var(--line); border-radius: 11px; background: white; box-shadow: var(--shadow-xs); }
.week-control .icon-btn { width: 30px; height: 30px; border: 0; }
.week-control .icon-btn svg { width: 16px; height: 16px; }
.week-label { display: inline-flex; align-items: center; min-width: 138px; height: 30px; padding: 0 8px; gap: 7px; border: 0; background: transparent; color: #3f4859; font-size: 11px; font-weight: 650; white-space: nowrap; }
.week-label svg { width: 15px; height: 15px; fill: none; stroke: var(--muted); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.overview-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 11px; }
.metric-card { position: relative; min-width: 0; min-height: 114px; padding: 16px; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: white; box-shadow: var(--shadow-xs); }
.metric-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.metric-label { overflow: hidden; color: var(--muted); font-size: 11px; font-weight: 620; text-overflow: ellipsis; white-space: nowrap; }
.metric-icon { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; }
.metric-icon svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.metric-icon.purple { background: var(--primary-soft); color: var(--primary); }
.metric-icon.green { background: var(--green-soft); color: var(--green); }
.metric-icon.blue { background: var(--blue-soft); color: var(--blue); }
.metric-icon.amber { background: var(--amber-soft); color: var(--amber); }
.metric-body { display: flex; align-items: baseline; margin-top: 9px; gap: 7px; }
.metric-value { color: var(--ink-strong); font-size: 24px; font-weight: 750; line-height: 1; letter-spacing: -.04em; }
.metric-note { overflow: hidden; color: var(--muted-light); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.metric-trend { color: var(--green); font-weight: 650; }
.metric-progress { height: 4px; margin-top: 12px; overflow: hidden; border-radius: 4px; background: #f0f1f4; }
.metric-progress span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--primary), #7e79ec); transition: width .4s ease; }

.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.section-heading h2 { margin: 1px 0 0; color: var(--ink-strong); font-size: 16px; line-height: 1.3; letter-spacing: -.025em; }
.section-kicker { margin: 0; color: var(--muted-light); font-size: 9px; font-weight: 760; letter-spacing: .12em; }
.team-panel { margin-top: 14px; padding: 17px 17px 15px; border: 1px solid var(--line); border-radius: var(--radius); background: white; box-shadow: var(--shadow-xs); }
.team-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 14px; gap: 10px; }
.team-member { min-width: 0; padding: 10px 11px; border: 1px solid #edf0f4; border-radius: 9px; background: var(--surface-soft); }
.team-member-top { display: flex; align-items: center; gap: 8px; }
.team-avatar { display: inline-grid; place-items: center; width: 28px; height: 28px; flex: 0 0 auto; border-radius: 50%; color: #344054; font-size: 10px; font-weight: 750; object-fit: cover; }
.team-avatar.color-0 { background: #dbe7ff; color: #375789; }
.team-avatar.color-1 { background: #f8dfeb; color: #94506f; }
.team-avatar.color-2 { background: #d9f0e8; color: #397762; }
.team-avatar.color-3 { background: #fce8cb; color: #936425; }
.team-copy { min-width: 0; flex: 1; }
.team-copy strong { display: block; overflow: hidden; color: #303849; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.team-copy small { display: block; color: var(--muted-light); font-size: 9px; }
.team-rate { color: var(--ink); font-size: 11px; font-weight: 720; }
.progress-track { height: 5px; margin-top: 9px; overflow: hidden; border-radius: 5px; background: #e9ecf1; }
.progress-track span { display: block; height: 100%; border-radius: inherit; background: var(--primary); }
.team-member:nth-child(2) .progress-track span { background: #3d91bf; }
.team-member:nth-child(3) .progress-track span { background: #39a27a; }
.team-member:nth-child(4) .progress-track span { background: #c78332; }

.board-section { margin-top: 28px; scroll-margin-top: 20px; }
.board-heading { margin-bottom: 13px; }
.result-count { color: var(--muted-light); font-size: 11px; }
.board-toolbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 13px; gap: 10px; }
.search-field { position: relative; display: flex; align-items: center; width: min(310px, 42%); }
.search-field > svg { position: absolute; left: 11px; width: 16px; height: 16px; pointer-events: none; fill: none; stroke: var(--muted-light); stroke-width: 2; stroke-linecap: round; }
.search-field input { width: 100%; height: 37px; padding: 0 48px 0 34px; border: 1px solid var(--line-strong); border-radius: 9px; background: white; color: var(--ink); outline: none; }
.search-field input::placeholder { color: #737d8d; }
.search-field input:focus { border-color: #9d9de4; box-shadow: 0 0 0 3px rgba(91, 91, 214, .1); }
.search-field kbd { position: absolute; right: 9px; padding: 1px 5px; border: 1px solid var(--line); border-radius: 5px; background: #f8f9fb; color: var(--muted-light); font-family: inherit; font-size: 9px; }
.filter-group { display: flex; align-items: center; justify-content: flex-end; min-width: 0; gap: 7px; }
.select-field { position: relative; display: flex; align-items: center; }
.select-field > svg { position: absolute; left: 10px; z-index: 1; width: 15px; height: 15px; pointer-events: none; fill: none; stroke: var(--muted); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.select-field select { max-width: 145px; height: 37px; padding: 0 28px 0 31px; border: 1px solid var(--line-strong); border-radius: 9px; background-color: white; color: #525b6c; outline: none; }
.select-field select:focus { border-color: #9d9de4; box-shadow: 0 0 0 3px rgba(91, 91, 214, .1); }
.clear-filter { white-space: nowrap; }
.board-alert { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; padding: 11px 13px; gap: 12px; border: 1px solid #f1c8cb; border-radius: var(--radius-sm); background: var(--red-soft); color: #81383e; }
.board-alert > div { display: flex; flex-direction: column; }
.board-alert strong { font-size: 12px; }
.board-alert span { font-size: 10px; opacity: .8; }

.kanban { display: grid; grid-template-columns: repeat(4, minmax(190px, 1fr)); align-items: start; gap: 10px; overflow-x: auto; padding: 1px 1px 10px; scrollbar-width: thin; }
.kanban-column { min-width: 190px; padding: 10px; border: 1px solid var(--line); border-radius: 11px; background: #f2f4f7; transition: border-color .16s ease, background .16s ease; }
.kanban-column.drag-over { border-color: #a8a8e9; background: #eeeefd; box-shadow: inset 0 0 0 1px rgba(91, 91, 214, .08); }
.kanban-column > header { display: flex; align-items: center; min-height: 28px; padding: 0 2px 7px; gap: 7px; }
.kanban-column h3 { margin: 0; color: #465063; font-size: 11px; font-weight: 700; }
.status-dot { width: 7px; height: 7px; flex: 0 0 auto; border-radius: 50%; }
.status-dot.todo { background: #8993a5; }
.status-dot.progress { background: #4c83db; box-shadow: 0 0 0 3px rgba(76,131,219,.11); }
.status-dot.review { background: #d69134; box-shadow: 0 0 0 3px rgba(214,145,52,.11); }
.status-dot.done { background: #36a178; box-shadow: 0 0 0 3px rgba(54,161,120,.11); }
.column-count { min-width: 20px; padding: 1px 6px; border-radius: 8px; background: #e4e7ec; color: #717b8d; text-align: center; font-size: 9px; font-weight: 650; }
.column-add { width: 25px !important; height: 25px !important; margin-left: auto; }
.column-add svg { width: 14px !important; height: 14px !important; }
.task-list { display: flex; flex-direction: column; min-height: 86px; gap: 8px; }
.task-card { position: relative; padding: 12px; border: 1px solid #e2e5ea; border-radius: 9px; background: white; box-shadow: var(--shadow-xs); cursor: grab; transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease; }
.task-card:hover { border-color: #d2d6df; box-shadow: var(--shadow-sm); transform: translateY(-1px); }
.task-card:active { cursor: grabbing; }
.task-card.dragging { opacity: .5; transform: rotate(1deg); }
.task-card.done-card .task-title { color: #667085; text-decoration: line-through; text-decoration-color: #abb2bf; }
.task-card-top { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.priority-badge { display: inline-flex; align-items: center; min-height: 19px; padding: 1px 6px; border-radius: 5px; font-size: 8px; font-weight: 750; letter-spacing: .02em; }
.priority-badge.HIGH, .priority-badge.URGENT { background: var(--red-soft); color: #bd4851; }
.priority-badge.MEDIUM { background: var(--amber-soft); color: #aa6b1c; }
.priority-badge.LOW { background: #edf0f5; color: #6c7689; }
.card-menu { width: 25px !important; height: 25px !important; margin: -4px -5px -4px 0; }
.task-title-button { display: block; width: 100%; margin: 8px 0 0; padding: 0; border: 0; background: transparent; text-align: left; }
.task-title { display: -webkit-box; margin: 0; overflow: hidden; color: #252e3f; font-size: 12px; font-weight: 680; line-height: 1.45; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.task-description { display: -webkit-box; margin: 5px 0 0; overflow: hidden; color: #667085; font-size: 10px; line-height: 1.45; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.task-tags { display: flex; flex-wrap: wrap; margin-top: 8px; gap: 4px; }
.task-tag { max-width: 92px; overflow: hidden; padding: 2px 6px; border-radius: 5px; background: #f2f2fa; color: #696a91; font-size: 8px; text-overflow: ellipsis; white-space: nowrap; }
.task-progress { margin-top: 10px; }
.task-progress-label { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; color: var(--muted-light); font-size: 8px; }
.task-progress .progress-track { height: 3px; margin: 0; }
.task-progress .progress-track span { background: var(--blue); }
.task-card-foot { display: flex; align-items: center; margin-top: 11px; padding-top: 9px; gap: 6px; border-top: 1px solid #eff1f4; }
.task-assignee { display: inline-grid; place-items: center; width: 23px; height: 23px; border-radius: 50%; background: #dae6fa; color: #49688e; font-size: 8px; font-weight: 750; }
.task-due { display: flex; align-items: center; margin-left: auto; gap: 4px; color: #697386; font-size: 9px; }
.task-due svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.task-due.overdue { color: var(--red); font-weight: 650; }
.task-due.today { color: var(--amber); font-weight: 650; }
.card-move-actions { display: flex; margin: 8px -5px -5px; gap: 3px; opacity: 0; transition: opacity .15s ease; }
.task-card:hover .card-move-actions, .task-card:focus-within .card-move-actions { opacity: 1; }
.move-button { flex: 1; padding: 3px 4px; border: 0; border-radius: 5px; background: #f4f5f8; color: var(--muted); font-size: 8px; }
.move-button:hover { background: var(--primary-soft); color: var(--primary); }
.empty-column { display: grid; place-items: center; min-height: 80px; padding: 12px; border: 1px dashed #d9dde5; border-radius: 8px; color: #6f798a; text-align: center; font-size: 9px; }
.empty-column svg { width: 19px; height: 19px; margin-bottom: 4px; fill: none; stroke: #b4bbc6; stroke-width: 1.5; stroke-linecap: round; }

/* Agent */
.agent-panel {
  position: relative;
  z-index: 40;
  display: flex;
  min-width: 0;
  flex-direction: column;
  border-left: 1px solid var(--line);
  background: white;
  box-shadow: -5px 0 20px rgba(16, 24, 40, .025);
}
.agent-header { display: flex; align-items: center; justify-content: space-between; height: 70px; flex: 0 0 70px; padding: 0 15px; border-bottom: 1px solid var(--line); }
.agent-identity { display: flex; align-items: center; min-width: 0; gap: 10px; }
.agent-logo { display: inline-grid; place-items: center; width: 33px; height: 33px; flex: 0 0 auto; border-radius: 10px; background: linear-gradient(145deg, #5c5bd5, #7b5acb); color: white; box-shadow: 0 4px 10px rgba(91,91,214,.21); }
.agent-logo svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }
.agent-identity > span:last-child { display: flex; min-width: 0; flex-direction: column; }
.agent-identity strong { color: #252d3e; font-size: 12px; font-weight: 720; }
.agent-identity small { display: flex; align-items: center; gap: 5px; color: var(--muted-light); font-size: 10px; }
.agent-identity small i { width: 6px; height: 6px; border-radius: 50%; background: #b0b6c1; }
.agent-identity small.online { color: #42846c; }
.agent-identity small.online i { background: #36aa7e; box-shadow: 0 0 0 3px rgba(54,170,126,.11); }
.agent-identity small.offline { color: var(--red); }
.agent-identity small.offline i { background: var(--red); }
.agent-header-actions { display: flex; gap: 1px; }
.agent-close { display: none !important; }
.thread-bar { position: relative; padding: 10px 12px 8px; border-bottom: 1px solid #f0f1f4; }
.thread-picker { display: flex; align-items: center; justify-content: space-between; width: 100%; min-height: 42px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface-soft); text-align: left; }
.thread-picker:hover { border-color: var(--line-strong); background: #f7f8fa; }
.thread-picker:disabled { background: var(--surface-soft); color: var(--muted-light); opacity: .75; }
.thread-picker > span { display: flex; min-width: 0; flex-direction: column; }
.thread-picker small { color: var(--muted-light); font-size: 8px; }
.thread-picker strong { overflow: hidden; color: #3a4353; font-size: 10px; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.thread-picker svg { width: 15px; height: 15px; flex: 0 0 auto; fill: none; stroke: var(--muted); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.thread-popover { position: absolute; z-index: 50; top: calc(100% - 4px); right: 12px; left: 12px; overflow: hidden; border: 1px solid var(--line); border-radius: 10px; background: white; box-shadow: var(--shadow-md); }
.thread-popover-head { display: flex; justify-content: space-between; padding: 10px 11px 7px; color: #4f586a; font-size: 9px; }
.thread-popover-head span { color: var(--muted-light); }
.thread-list { max-height: 210px; overflow-y: auto; padding: 0 5px 5px; }
.thread-item { display: flex; align-items: center; width: 100%; padding: 8px; gap: 8px; border: 0; border-radius: 7px; background: transparent; text-align: left; }
.thread-item:hover, .thread-item[aria-selected="true"] { background: var(--primary-soft); }
.thread-item-icon { display: inline-grid; place-items: center; width: 24px; height: 24px; flex: 0 0 auto; border-radius: 7px; background: #f0f1f5; color: var(--muted); }
.thread-item-icon svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.thread-item > span:last-child { min-width: 0; }
.thread-item strong, .thread-item small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.thread-item strong { color: #414a5b; font-size: 9.5px; }
.thread-item small { color: var(--muted-light); font-size: 8px; }
.thread-empty { padding: 16px 8px; color: var(--muted-light); text-align: center; font-size: 9px; }
.agent-banner { display: flex; align-items: center; justify-content: space-between; padding: 7px 12px; background: var(--red-soft); color: #984048; font-size: 9px; }
.agent-banner button { border: 0; background: transparent; color: #984048; font-weight: 700; text-decoration: underline; }
.messages { min-height: 0; flex: 1; overflow-y: auto; padding: 18px 14px 10px; scroll-behavior: smooth; }
.agent-welcome { padding: 10px 3px 0; text-align: center; }
.welcome-icon { display: inline-grid; place-items: center; width: 43px; height: 43px; border-radius: 14px; background: var(--primary-soft); color: var(--primary); }
.welcome-icon svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.35; stroke-linecap: round; stroke-linejoin: round; }
.agent-welcome h2 { margin: 11px 0 5px; color: #263044; font-size: 14px; letter-spacing: -.02em; }
.agent-welcome p { margin: 0 auto; max-width: 240px; color: var(--muted); font-size: 10px; line-height: 1.55; }
.message-row { display: flex; margin-bottom: 14px; gap: 7px; }
.message-row.user { justify-content: flex-end; }
.message-avatar { display: inline-grid; place-items: center; width: 24px; height: 24px; flex: 0 0 auto; margin-top: 2px; border-radius: 7px; background: var(--primary-soft); color: var(--primary); }
.message-avatar svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.message-content { max-width: 86%; }
.message-bubble { padding: 9px 10px; border-radius: 4px 11px 11px 11px; background: #f2f3f7; color: #354052; font-size: 11px; line-height: 1.62; overflow-wrap: anywhere; white-space: pre-wrap; }
.message-row.user .message-bubble { border-radius: 11px 4px 11px 11px; background: var(--primary); color: white; }
.message-time { display: block; margin-top: 3px; color: var(--muted-light); font-size: 7.5px; }
.message-row.user .message-time { text-align: right; }
.message-bubble code { padding: 1px 3px; border-radius: 3px; background: rgba(16,24,40,.07); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .9em; }
.message-bubble pre { max-width: 100%; overflow-x: auto; padding: 8px; border-radius: 6px; background: #252938; color: #f3f4f8; white-space: pre; }
.message-thinking { display: flex; align-items: center; min-height: 34px; gap: 4px; }
.message-thinking span, .message-loading > span { width: 5px; height: 5px; border-radius: 50%; background: #8b8bd8; animation: bounce 1.2s infinite ease-in-out; }
.message-thinking span:nth-child(2), .message-loading > span:nth-child(2) { animation-delay: .15s; }
.message-thinking span:nth-child(3), .message-loading > span:nth-child(3) { animation-delay: .3s; }
.message-error { padding: 8px; border-radius: 7px; background: var(--red-soft); color: #984048; font-size: 9px; }
.message-error button { margin-left: 4px; padding: 0; border: 0; background: transparent; color: inherit; font-weight: 700; text-decoration: underline; }
.message-loading { display: flex; align-items: center; justify-content: center; height: 100%; gap: 5px; color: var(--muted-light); }
.message-loading p { margin-left: 5px; font-size: 9px; }
.suggestion-wrap { padding: 7px 12px 5px; }
.suggestion-wrap > p { margin: 0 0 5px; color: var(--muted-light); font-size: 8px; font-weight: 650; }
.suggestions { display: flex; flex-wrap: wrap; gap: 5px; }
.suggestions button { padding: 5px 7px; border: 1px solid var(--line); border-radius: 7px; background: white; color: #616a7b; font-size: 8px; }
.suggestions button:hover { border-color: #c9c9ed; background: var(--primary-soft); color: var(--primary); }
.suggestions button:disabled { border-color: var(--line); background: var(--surface-soft); color: var(--muted-light); opacity: .7; }
.agent-composer { margin: 4px 12px 0; padding: 9px 9px 7px; border: 1px solid var(--line-strong); border-radius: 11px; background: white; box-shadow: 0 2px 7px rgba(16,24,40,.04); transition: border-color .15s ease, box-shadow .15s ease; }
.agent-composer:focus-within { border-color: #a6a6e2; box-shadow: 0 0 0 3px rgba(91,91,214,.08); }
.agent-composer textarea { display: block; width: 100%; max-height: 120px; padding: 0; resize: none; border: 0; background: transparent; color: var(--ink); font-size: 11px; line-height: 1.5; outline: none; }
.agent-composer textarea::placeholder { color: #737d8d; }
.composer-actions { display: flex; align-items: center; min-height: 27px; margin-top: 5px; }
.composer-actions > span { color: #737d8d; font-size: 8.5px; }
.send-button, .interrupt-button { display: inline-grid; place-items: center; width: 27px; height: 27px; margin-left: auto; padding: 0; border: 0; border-radius: 8px; }
.send-button { background: var(--primary); color: white; }
.send-button:hover { background: var(--primary-dark); }
.send-button:disabled { background: #d6d8df; }
.send-button svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.interrupt-button { border: 1px solid #efc7ca; background: var(--red-soft); }
.interrupt-button span { width: 7px; height: 7px; border-radius: 1px; background: var(--red); }
.agent-disclaimer { margin: 6px 12px 9px; color: #737d8d; text-align: center; font-size: 8px; }

/* Dialogs and notices */
dialog { color: var(--ink); }
dialog::backdrop { background: rgba(22, 29, 45, .42); backdrop-filter: blur(2px); }
.task-dialog { width: min(590px, calc(100vw - 28px)); max-height: calc(100vh - 28px); max-height: calc(100dvh - 28px); padding: 0; overflow: hidden; border: 0; border-radius: var(--radius-lg); background: white; box-shadow: 0 24px 60px rgba(16,24,40,.23); }
.task-dialog form { display: flex; max-height: calc(100vh - 28px); max-height: calc(100dvh - 28px); flex-direction: column; }
.dialog-header { display: flex; align-items: flex-start; justify-content: space-between; padding: 20px 22px 15px; border-bottom: 1px solid var(--line); }
.dialog-header h2 { margin: 2px 0 0; color: var(--ink-strong); font-size: 19px; letter-spacing: -.03em; }
.dialog-body { display: grid; overflow-y: auto; padding: 18px 22px 20px; gap: 14px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; }
.form-field { display: flex; min-width: 0; flex-direction: column; gap: 6px; }
.form-field > span { color: #465063; font-size: 11px; font-weight: 650; }
.form-field > span b { color: var(--red); }
.form-field input, .form-field select, .form-field textarea { width: 100%; min-height: 40px; padding: 8px 10px; border: 1px solid var(--line-strong); border-radius: 8px; background: white; color: var(--ink); outline: none; }
.form-field textarea { resize: vertical; line-height: 1.5; }
.form-field input::placeholder, .form-field textarea::placeholder { color: #737d8d; }
.form-field input:focus, .form-field select:focus, .form-field textarea:focus { border-color: #9292dc; box-shadow: 0 0 0 3px rgba(91,91,214,.1); }
.form-field input[aria-invalid="true"] { border-color: var(--red); box-shadow: 0 0 0 3px rgba(211,75,85,.08); }
.field-error { min-height: 0; color: var(--red); font-size: 9px; }
.dialog-error { padding: 9px 10px; border-radius: 7px; background: var(--red-soft); color: #984048; font-size: 10px; }
.dialog-footer { display: flex; align-items: center; padding: 13px 22px; gap: 8px; border-top: 1px solid var(--line); background: var(--surface-soft); }
.dialog-spacer { flex: 1; }
.confirm-dialog { width: min(380px, calc(100vw - 28px)); padding: 25px; border: 0; border-radius: var(--radius-lg); background: white; text-align: center; box-shadow: 0 24px 60px rgba(16,24,40,.23); }
.confirm-icon { display: inline-grid; place-items: center; width: 43px; height: 43px; border-radius: 12px; background: var(--red-soft); color: var(--red); }
.confirm-icon svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.confirm-dialog h2 { margin: 13px 0 5px; color: var(--ink-strong); font-size: 18px; }
.confirm-dialog p { margin: 0; color: var(--muted); font-size: 11px; }
.confirm-actions { display: grid; grid-template-columns: 1fr 1fr; margin-top: 20px; gap: 8px; }
.auth-dialog { width: min(400px, calc(100vw - 28px)); padding: 0; border: 0; border-radius: 18px; background: white; box-shadow: 0 24px 70px rgba(16,24,40,.27); }
.auth-dialog::backdrop { background: rgba(18, 24, 38, .62); backdrop-filter: blur(5px); }
.auth-dialog form { padding: 30px; }
.auth-brand { margin-bottom: 18px; }
.auth-brand .brand-mark { width: 38px; height: 38px; padding: 8px; border-radius: 11px; }
.auth-dialog h2 { margin: 3px 0 6px; color: var(--ink-strong); font-size: 22px; letter-spacing: -.035em; }
.auth-description { margin: 0 0 21px; color: var(--muted); font-size: 11px; }
.auth-dialog .form-field { margin-top: 13px; }
.auth-submit { width: 100%; margin-top: 18px; }
.auth-note { margin: 10px 0 0; color: var(--muted-light); text-align: center; font-size: 9px; }
.toast-region { position: fixed; z-index: 200; right: calc(var(--agent-width) + 18px); bottom: 20px; display: flex; width: min(340px, calc(100vw - 32px)); flex-direction: column; gap: 7px; pointer-events: none; }
.toast { display: flex; align-items: center; padding: 11px 13px; gap: 9px; border: 1px solid var(--line); border-radius: 10px; background: #252c3a; color: white; box-shadow: var(--shadow-md); animation: toast-in .22s ease-out; font-size: 11px; }
.toast.success::before, .toast.error::before { display: inline-grid; place-items: center; width: 17px; height: 17px; flex: 0 0 auto; border-radius: 50%; color: white; font-size: 10px; font-weight: 800; }
.toast.success::before { content: "✓"; background: var(--green); }
.toast.error::before { content: "!"; background: var(--red); }
.toast.removing { animation: toast-out .18s ease-in forwards; }

/* Skeletons */
.skeleton-card span, .team-skeleton::before, .team-skeleton::after, .task-skeleton::before, .task-skeleton::after { display: block; border-radius: 6px; background: linear-gradient(90deg, #eff1f4 25%, #f8f9fa 45%, #eff1f4 65%); background-size: 400% 100%; animation: shimmer 1.45s infinite; }
.skeleton-card span:nth-child(1) { width: 45%; height: 9px; }
.skeleton-card span:nth-child(2) { width: 30%; height: 22px; margin-top: 15px; }
.skeleton-card span:nth-child(3) { width: 78%; height: 5px; margin-top: 15px; }
.team-skeleton { height: 55px; padding: 10px; border-radius: 9px; background: #f8f9fb; }
.team-skeleton::before { content: ""; width: 42%; height: 8px; }
.team-skeleton::after { content: ""; width: 90%; height: 5px; margin-top: 13px; }
.task-skeleton { height: 115px; padding: 13px; border-radius: 9px; background: white; }
.task-skeleton::before { content: ""; width: 42%; height: 9px; }
.task-skeleton::after { content: ""; width: 86%; height: 28px; margin-top: 14px; }

@keyframes shimmer { from { background-position: 100% 0; } to { background-position: 0 0; } }
@keyframes bounce { 0%, 60%, 100% { transform: translateY(0); opacity: .5; } 30% { transform: translateY(-4px); opacity: 1; } }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(6px); } }

/* Responsive */
@media (max-width: 1280px) and (min-width: 1025px) {
  :root { --sidebar-width: 74px; }
  .brand { justify-content: center; padding-inline: 0; }
  .brand-name, .nav-label, .nav-item span, .workspace-copy, .profile-copy, .workspace-switcher > svg, .profile-row .quiet { display: none; }
  .primary-nav { padding-inline: 10px; }
  .nav-item { justify-content: center; padding-inline: 0; }
  .nav-item svg { width: 20px; height: 20px; }
  .sidebar-foot { padding: 10px; }
  .workspace-switcher, .profile-row { justify-content: center; padding: 8px 0; border: 0; }
}

@media (max-width: 1024px) {
  :root { --sidebar-width: 0px; }
  .app-shell { grid-template-columns: minmax(0, 1fr) var(--agent-width); }
  .sidebar { position: fixed; top: 0; bottom: 0; left: 0; width: 230px; transform: translateX(-105%); box-shadow: var(--shadow-md); transition: transform .22s ease; }
  body.sidebar-open .sidebar { transform: translateX(0); }
  .sidebar-scrim { position: fixed; z-index: 29; inset: 0; display: block; background: rgba(16,24,40,.35); opacity: 0; pointer-events: none; transition: opacity .2s ease; }
  body.sidebar-open .sidebar-scrim { opacity: 1; pointer-events: auto; }
  .mobile-menu { display: inline-grid; }
  .toast-region { right: calc(var(--agent-width) + 16px); }
}

@media (max-width: 820px) {
  :root { --agent-width: 0px; }
  .app-shell { grid-template-columns: minmax(0, 1fr); }
  .agent-panel { position: fixed; z-index: 80; top: 0; right: 0; bottom: 0; width: min(370px, 92vw); transform: translateX(105%); box-shadow: var(--shadow-md); transition: transform .23s ease; }
  body.agent-open .agent-panel { transform: translateX(0); }
  .agent-scrim { position: fixed; z-index: 79; inset: 0; display: block; background: rgba(16,24,40,.38); opacity: 0; pointer-events: none; transition: opacity .2s ease; }
  body.agent-open .agent-scrim { opacity: 1; pointer-events: auto; }
  .agent-close { display: inline-grid !important; }
  .agent-mobile-button { display: inline-flex; }
  .toast-region { right: 16px; }
  .kanban { grid-template-columns: repeat(2, minmax(220px, 1fr)); }
}

@media (max-width: 640px) {
  body { overflow: hidden; }
  .topbar { height: 60px; flex-basis: 60px; padding-inline: 14px; }
  .page-context { display: none; }
  .notification-button { display: none; }
  .button.primary span { display: none; }
  .topbar .button.primary { width: 36px; min-height: 36px; padding: 0; }
  .agent-mobile-button span { display: none; }
  .agent-mobile-button { width: 36px; justify-content: center; padding: 0; }
  .content-wrap { padding: 22px 14px 35px; }
  .hero-row { align-items: flex-start; flex-direction: column; margin-bottom: 18px; }
  .week-control { align-self: stretch; justify-content: space-between; }
  .week-label { justify-content: center; }
  .overview-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .metric-card { min-height: 105px; padding: 14px; }
  .team-list { grid-template-columns: 1fr !important; }
  .team-list .team-member:nth-child(n+4) { display: none; }
  .board-toolbar { align-items: stretch; flex-direction: column; }
  .search-field { width: 100%; }
  .filter-group { justify-content: flex-start; overflow-x: auto; padding-bottom: 2px; }
  .select-field { flex: 0 0 auto; }
  .select-field select { max-width: 150px; }
  .kanban { grid-template-columns: minmax(260px, 1fr); overflow-x: visible; }
  .kanban-column { min-width: 0; }
  .card-move-actions { opacity: 1; }
  .task-dialog { width: 100vw; max-height: 100dvh; margin: auto 0 0; border-radius: 18px 18px 0 0; }
  .task-dialog form { max-height: 94dvh; }
  .dialog-header { padding: 17px 17px 13px; }
  .dialog-body { padding: 15px 17px; }
  .dialog-footer { padding: 12px 17px; }
  .form-grid { grid-template-columns: 1fr; }
  .auth-dialog form { padding: 24px 20px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

@media (forced-colors: active) {
  .status-dot, .agent-identity small i { border: 1px solid CanvasText; }
  .brand-mark { border: 1px solid CanvasText; }
}
