/* ============================================================
 * Work is 1 — App + Component styles
 * ============================================================ */

/* ----- App shell ----- */
.app {
  display: grid;
  grid-template-columns: 240px 1fr;
  height: 100vh;
  background: var(--surface-background);
  color: var(--fg-primary);
}

/* Mobile sidebar scrim + hamburger */
.sidebar-scrim {
  display: none;
  position: fixed;
  inset: 0;
  background: var(--surface-overlay);
  z-index: 90;
  animation: fadeIn 160ms ease-out;
}
.hamburger {
  display: none;
  width: 34px; height: 34px;
  border-radius: var(--radius-md);
  align-items: center; justify-content: center;
  color: var(--fg-secondary);
  flex-shrink: 0;
}
.hamburger:hover { background: var(--chrome-hover); color: var(--fg-primary); }

/* FAB (mobile new-task button) */
.fab {
  display: none;
  position: fixed;
  bottom: 20px; right: 20px;
  width: 56px; height: 56px;
  border-radius: 999px;
  background: var(--brand-primary);
  color: var(--fg-on-primary);
  align-items: center; justify-content: center;
  box-shadow: 0 8px 24px rgba(79, 70, 229, 0.4), 0 2px 6px rgba(0,0,0,0.1);
  z-index: 50;
  transition: transform var(--motion-fast), box-shadow var(--motion-fast);
}
.fab:hover { transform: translateY(-2px); box-shadow: 0 12px 32px rgba(79, 70, 229, 0.5), 0 2px 6px rgba(0,0,0,0.1); }
.fab:active { transform: translateY(0); }

/* ============================================================
 * Sidebar
 * ============================================================ */
.sidebar {
  background: var(--chrome-bg);
  border-right: 1px solid var(--chrome-border);
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.sidebar__logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 16px 12px;
  font-weight: var(--weight-bold);
  font-size: 16px;
  letter-spacing: var(--tracking-tight);
}
.sidebar__logo-mark {
  width: 24px;
  height: 24px;
  border-radius: 7px;
  background: var(--brand-primary);
  display: grid;
  place-items: center;
  color: var(--fg-on-primary);
  font-weight: var(--weight-bold);
  font-size: 13px;
  letter-spacing: -0.02em;
  box-shadow: 0 2px 6px rgba(79, 70, 229, 0.25);
}

/* Workspace selector */
.ws-switcher {
  margin: 4px 12px 12px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 10px 12px;
  background: var(--surface-elevated);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: left;
  width: calc(100% - 24px);
  transition: background var(--motion-fast), border-color var(--motion-fast);
  position: relative;
}
.ws-switcher:hover { background: var(--chrome-hover); }
.ws-switcher__dot {
  width: 22px; height: 22px;
  border-radius: 7px;
  display: grid; place-items: center;
  color: white;
  font-weight: var(--weight-bold);
  font-size: 11px;
  flex-shrink: 0;
}
.ws-switcher__body { flex: 1; min-width: 0; }
.ws-switcher__name {
  font-size: 13px;
  font-weight: var(--weight-semibold);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ws-switcher__role {
  font-size: 11px; color: var(--fg-tertiary);
  margin-top: 1px;
}
.ws-switcher__chev { color: var(--fg-tertiary); flex-shrink: 0; }

.ws-popover {
  position: absolute;
  top: calc(100% + 6px);
  left: 0; right: 0;
  background: var(--surface-elevated);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-3);
  padding: 6px;
  z-index: 50;
  cursor: default;
}
.ws-popover__item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius-md);
  cursor: pointer;
  font-size: 13px;
}
.ws-popover__item:hover { background: var(--chrome-hover); }
.ws-popover__item--active { background: var(--chrome-active-bg); color: var(--chrome-active-fg); }
.ws-popover__divider { height: 1px; background: var(--border-subtle); margin: 6px 0; }
.ws-popover__new {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 10px;
  border-radius: var(--radius-md);
  font-size: 13px;
  color: var(--fg-secondary);
  cursor: pointer;
}
.ws-popover__new:hover { background: var(--chrome-hover); }

/* Sidebar nav */
.nav { padding: 4px 8px; overflow-y: auto; flex: 1; min-height: 0; }
.nav__section { margin-top: 12px; }
.nav__heading {
  display: flex; align-items: center; justify-content: space-between;
  padding: 6px 10px 4px;
  font-size: 11px;
  font-weight: var(--weight-semibold);
  color: var(--fg-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.nav__heading-add {
  color: var(--fg-tertiary);
  width: 20px; height: 20px;
  display: grid; place-items: center;
  border-radius: 4px;
}
.nav__heading-add:hover { background: var(--chrome-hover); color: var(--fg-primary); }
.nav__item {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 10px;
  border-radius: var(--radius-md);
  font-size: 13px;
  color: var(--fg-secondary);
  cursor: pointer;
  position: relative;
  width: 100%;
  text-align: left;
}
.nav__item:hover { background: var(--chrome-hover); color: var(--fg-primary); }
.nav__item--active {
  background: var(--chrome-active-bg);
  color: var(--chrome-active-fg);
  font-weight: var(--weight-medium);
}
.nav__item-icon { width: 16px; height: 16px; flex-shrink: 0; }
.nav__item-dot {
  width: 8px; height: 8px; border-radius: 999px;
  flex-shrink: 0;
}
.nav__item-count {
  margin-left: auto;
  font-size: 11px;
  color: var(--fg-tertiary);
  font-variant-numeric: tabular-nums;
}
.nav__project-tree { padding-left: 14px; }

/* Sidebar account footer */
.sidebar__account {
  border-top: 1px solid var(--chrome-border);
  padding: 10px;
  display: flex; align-items: center; gap: 10px;
}
.sidebar__account-body { flex: 1; min-width: 0; }
.sidebar__account-name { font-size: 13px; font-weight: var(--weight-semibold); }
.sidebar__account-email { font-size: 11px; color: var(--fg-tertiary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar__account-btn {
  width: 28px; height: 28px;
  border-radius: var(--radius-md);
  display: grid; place-items: center;
  color: var(--fg-tertiary);
}
.sidebar__account-btn:hover { background: var(--chrome-hover); color: var(--fg-primary); }

/* ============================================================
 * Topbar
 * ============================================================ */
.main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: var(--surface-background);
}
.topbar {
  height: 56px;
  border-bottom: 1px solid var(--chrome-border);
  display: flex; align-items: center;
  padding: 0 20px;
  gap: 16px;
  background: var(--surface-background);
  flex-shrink: 0;
}
.breadcrumb {
  display: flex; align-items: center; gap: 6px;
  font-size: 13px;
  color: var(--fg-secondary);
  min-width: 0;
}
.breadcrumb__item { white-space: nowrap; }
.breadcrumb__item--current { color: var(--fg-primary); font-weight: var(--weight-semibold); }
.breadcrumb__sep { color: var(--fg-tertiary); }
.breadcrumb__dot { width: 10px; height: 10px; border-radius: 3px; flex-shrink: 0; }

.search {
  flex: 1; max-width: 380px;
  margin-left: auto;
  position: relative;
}
.search input {
  width: 100%;
  height: 34px;
  padding: 0 12px 0 34px;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  background: var(--surface-background);
  font-size: 13px;
  color: var(--fg-primary);
}
.search input:focus { outline: none; border-color: var(--border-focus); box-shadow: 0 0 0 3px var(--alpha-primary-16); }
.search input::placeholder { color: var(--fg-tertiary); }
.search__icon {
  position: absolute; left: 10px; top: 50%; transform: translateY(-50%);
  color: var(--fg-tertiary);
  pointer-events: none;
}
.search__kbd {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  font-size: 10px; color: var(--fg-tertiary);
  border: 1px solid var(--border-default);
  padding: 1px 5px; border-radius: 4px;
  font-family: var(--font-mono);
  pointer-events: none;
}
.topbar__actions { display: flex; align-items: center; gap: 8px; }

/* ============================================================
 * Buttons
 * ============================================================ */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 6px;
  height: 34px;
  padding: 0 14px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: var(--weight-semibold);
  white-space: nowrap;
  transition: background var(--motion-fast), color var(--motion-fast), box-shadow var(--motion-fast), border-color var(--motion-fast);
  border: 1px solid transparent;
}
.btn--sm { height: 28px; padding: 0 10px; font-size: 12px; gap: 4px; border-radius: var(--radius-sm); }
.btn--lg { height: 42px; padding: 0 18px; font-size: 14px; }
.btn--primary { background: var(--brand-primary); color: var(--fg-on-primary); }
.btn--primary:hover { background: var(--brand-primary-hover); }
.btn--primary:active { background: var(--brand-primary-press); }
.btn--secondary {
  background: var(--surface-elevated);
  color: var(--fg-primary);
  border-color: var(--border-default);
}
.btn--secondary:hover { background: var(--chrome-hover); border-color: var(--border-strong); }
.btn--ghost { color: var(--fg-secondary); }
.btn--ghost:hover { background: var(--chrome-hover); color: var(--fg-primary); }
.btn--danger { background: var(--status-danger); color: white; }
.btn--danger:hover { background: var(--red-600); }
.btn--icon { width: 34px; padding: 0; }
.btn--icon.btn--sm { width: 28px; }
.btn:disabled { opacity: 0.5; pointer-events: none; }

/* Icon-only header buttons */
.icon-btn {
  width: 34px; height: 34px;
  border-radius: var(--radius-md);
  display: grid; place-items: center;
  color: var(--fg-secondary);
  position: relative;
  transition: background var(--motion-fast), color var(--motion-fast);
}
.icon-btn:hover { background: var(--chrome-hover); color: var(--fg-primary); }
.icon-btn__badge {
  position: absolute; top: 4px; right: 4px;
  background: var(--status-danger); color: white;
  font-size: 9px; font-weight: var(--weight-bold);
  height: 14px; min-width: 14px; padding: 0 3px;
  border-radius: 999px;
  display: grid; place-items: center;
  border: 2px solid var(--surface-background);
}

/* ============================================================
 * Avatar
 * ============================================================ */
.avatar {
  display: inline-grid; place-items: center;
  border-radius: 999px;
  background: var(--cool-neutral-90);
  color: var(--fg-primary);
  font-weight: var(--weight-semibold);
  font-size: 11px;
  flex-shrink: 0;
  position: relative;
  user-select: none;
}
.avatar--xs { width: 18px; height: 18px; font-size: 9px; }
.avatar--sm { width: 24px; height: 24px; font-size: 10px; }
.avatar--md { width: 32px; height: 32px; font-size: 12px; }
.avatar--lg { width: 40px; height: 40px; font-size: 14px; }
.avatar--xl { width: 56px; height: 56px; font-size: 18px; }
.avatar__status {
  position: absolute; bottom: 0; right: 0;
  width: 8px; height: 8px;
  border-radius: 999px;
  background: var(--status-success);
  border: 2px solid var(--surface-background);
}
.avatar-stack { display: inline-flex; }
.avatar-stack > .avatar {
  border: 2px solid var(--surface-background);
  margin-left: -6px;
}
.avatar-stack > .avatar:first-child { margin-left: 0; }
.avatar-stack > .avatar-overflow {
  background: var(--cool-neutral-94);
  color: var(--fg-secondary);
}
[data-theme="dark"] .avatar { background: var(--cool-neutral-40); color: var(--fg-primary); }
[data-theme="dark"] .avatar-stack > .avatar { border-color: var(--surface-background); }
[data-theme="dark"] .avatar-stack > .avatar-overflow { background: var(--cool-neutral-30); color: var(--fg-secondary); }

/* ============================================================
 * Badge / Pill
 * ============================================================ */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: var(--weight-semibold);
  border-radius: var(--radius-pill);
  white-space: nowrap;
  line-height: 1.4;
}
.badge svg { width: 11px; height: 11px; flex-shrink: 0; }
.badge__dot { width: 6px; height: 6px; border-radius: 999px; background: currentColor; flex-shrink: 0; }

.badge--pending   { background: var(--status-pending-soft);   color: var(--status-pending); }
.badge--progress  { background: var(--status-progress-soft);  color: var(--status-progress); }
.badge--review    { background: var(--status-review-soft);    color: var(--status-review); }
.badge--completed { background: var(--status-completed-soft); color: var(--status-completed); }
.badge--rejected  { background: var(--status-rejected-soft);  color: var(--status-rejected); }
.badge--canceled  { background: var(--status-canceled-soft);  color: var(--status-canceled); text-decoration: line-through; }

.badge--urgent { background: var(--priority-urgent-soft); color: var(--priority-urgent); }
.badge--high   { background: var(--priority-high-soft);   color: var(--priority-high); }
.badge--normal { background: var(--priority-normal-soft); color: var(--priority-normal); }

.badge--role-owner   { background: rgba(79, 70, 229, 0.10); color: var(--brand-primary); }
.badge--role-admin   { background: rgba(139, 92, 246, 0.12); color: #8B5CF6; }
.badge--role-member  { background: var(--cool-neutral-96); color: var(--fg-secondary); }
.badge--role-viewer  { background: transparent; color: var(--fg-tertiary); border: 1px solid var(--border-default); }
[data-theme="dark"] .badge--role-member { background: var(--alpha-neutral-08); color: var(--fg-secondary); }

/* Soft due-date chip */
.due-chip {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11px;
  color: var(--fg-tertiary);
  font-variant-numeric: tabular-nums;
}
.due-chip svg { width: 11px; height: 11px; }
.due-chip--overdue { color: var(--status-danger); font-weight: var(--weight-semibold); }
.due-chip--today { color: var(--status-warn); font-weight: var(--weight-semibold); }

/* ============================================================
 * Cards
 * ============================================================ */
.card {
  background: var(--surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-1);
}
.card__pad { padding: 20px; }

/* ============================================================
 * Task card (kanban)
 * ============================================================ */
.task-card {
  background: var(--surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 12px 14px 10px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: box-shadow var(--motion-fast), transform var(--motion-fast), border-color var(--motion-fast);
  box-shadow: var(--shadow-1);
}
.task-card::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--priority-normal);
}
.task-card--urgent::before { background: var(--priority-urgent); }
.task-card--high::before   { background: var(--priority-high); }
.task-card--normal::before { background: var(--priority-normal); }
.task-card:hover {
  border-color: var(--border-default);
  box-shadow: var(--shadow-2);
  transform: translateY(-1px);
}
.task-card__menu {
  position: absolute;
  top: 8px; right: 8px;
  width: 22px; height: 22px;
  display: grid; place-items: center;
  color: var(--fg-tertiary);
  border-radius: 4px;
  opacity: 0;
  transition: opacity var(--motion-fast), background var(--motion-fast);
}
.task-card:hover .task-card__menu { opacity: 1; }
.task-card__menu:hover { background: var(--chrome-hover); color: var(--fg-primary); }
.task-card__meta {
  display: flex; align-items: center; gap: 8px;
  font-size: 11px; color: var(--fg-tertiary);
  margin-bottom: 8px;
}
.task-card__id { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.02em; }
.task-card__title {
  font-size: 13px;
  font-weight: var(--weight-semibold);
  color: var(--fg-primary);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 10px;
  padding-right: 18px;
}
.task-card__footer {
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px;
}
.task-card__footer-right {
  display: flex; align-items: center; gap: 10px;
  color: var(--fg-tertiary);
  font-size: 11px;
}
.task-card__icon-stat {
  display: inline-flex; align-items: center; gap: 3px;
}
.task-card__icon-stat svg { width: 11px; height: 11px; }
.task-card__labels {
  display: flex; gap: 4px; flex-wrap: wrap;
  margin-bottom: 6px;
}
.task-card__label {
  font-size: 10px;
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--cool-neutral-96);
  color: var(--fg-secondary);
  font-weight: var(--weight-medium);
}
[data-theme="dark"] .task-card__label { background: var(--alpha-neutral-08); }

/* Dragging state */
.task-card--dragging {
  transform: rotate(2deg) translateY(-2px);
  box-shadow: var(--shadow-3);
  border-color: var(--brand-primary);
}

/* ============================================================
 * Board
 * ============================================================ */
.board {
  display: flex;
  gap: 16px;
  padding: 16px 20px 24px;
  overflow-x: auto;
  flex: 1;
  min-height: 0;
  align-items: flex-start;
}
.column {
  width: 280px;
  flex-shrink: 0;
  background: var(--chrome-bg);
  border-radius: var(--radius-lg);
  padding: 10px;
  display: flex; flex-direction: column;
  max-height: 100%;
  border: 1px solid var(--border-subtle);
}
.column__head {
  display: flex; align-items: center; gap: 8px;
  padding: 4px 4px 10px;
  font-size: 12px;
  font-weight: var(--weight-semibold);
}
.column__head-dot { width: 8px; height: 8px; border-radius: 999px; flex-shrink: 0; }
.column__head-count {
  font-size: 11px;
  color: var(--fg-tertiary);
  background: var(--surface-elevated);
  padding: 1px 7px;
  border-radius: 999px;
  border: 1px solid var(--border-subtle);
}
.column__head-add {
  margin-left: auto;
  width: 22px; height: 22px;
  display: grid; place-items: center;
  color: var(--fg-tertiary);
  border-radius: 4px;
}
.column__head-add:hover { background: var(--chrome-hover); color: var(--fg-primary); }
.column__body {
  display: flex; flex-direction: column; gap: 8px;
  overflow-y: auto;
  flex: 1;
  min-height: 60px;
  padding: 2px;
}
.column__add-task {
  padding: 8px 10px;
  border-radius: var(--radius-md);
  color: var(--fg-tertiary);
  font-size: 12px;
  text-align: left;
  display: flex; align-items: center; gap: 6px;
  width: 100%;
}
.column__add-task:hover { background: var(--chrome-hover); color: var(--fg-primary); }

/* Page header (toolbar above board/list) */
.page-head {
  padding: 16px 20px 4px;
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.page-head__title { display: flex; align-items: center; gap: 12px; }
.page-head__title h1 {
  font-size: 22px;
  font-weight: var(--weight-bold);
  letter-spacing: var(--tracking-tight);
}
.page-head__sub {
  font-size: 12px;
  color: var(--fg-tertiary);
  margin-top: 2px;
}
.page-head__actions { display: flex; align-items: center; gap: 8px; }

/* View switcher tabs */
.view-tabs {
  display: inline-flex;
  background: var(--chrome-bg);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 3px;
  gap: 2px;
}
.view-tabs__btn {
  padding: 4px 10px;
  font-size: 12px;
  font-weight: var(--weight-medium);
  color: var(--fg-secondary);
  border-radius: 5px;
  display: inline-flex; align-items: center; gap: 4px;
}
.view-tabs__btn--active {
  background: var(--surface-elevated);
  color: var(--fg-primary);
  box-shadow: var(--shadow-1);
}

/* Filter bar */
.filter-bar {
  padding: 8px 20px 12px;
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  border-bottom: 1px solid var(--chrome-border);
}
.filter-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px;
  border: 1px dashed var(--border-default);
  border-radius: var(--radius-pill);
  font-size: 12px;
  color: var(--fg-secondary);
  background: transparent;
}
.filter-chip:hover { background: var(--chrome-hover); }
.filter-chip--active {
  border-style: solid;
  background: var(--brand-primary-soft);
  color: var(--brand-primary);
  border-color: transparent;
}
[data-theme="dark"] .filter-chip--active { color: var(--chrome-active-fg); }

/* ============================================================
 * Dashboard
 * ============================================================ */
.dash {
  padding: 20px;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
}
.dash__kpis {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}
.kpi {
  background: var(--kpi-card-bg);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  box-shadow: var(--shadow-1);
  position: relative;
  overflow: hidden;
}
.kpi__label {
  font-size: 12px;
  color: var(--fg-secondary);
  display: flex; align-items: center; gap: 6px;
}
.kpi__label-icon {
  width: 22px; height: 22px;
  border-radius: 7px;
  display: grid; place-items: center;
  flex-shrink: 0;
}
.kpi__value {
  font-size: 28px;
  font-weight: var(--weight-bold);
  letter-spacing: var(--tracking-tight);
  margin-top: 6px;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}
.kpi__delta {
  font-size: 11px;
  color: var(--fg-tertiary);
  margin-top: 2px;
}
.kpi__delta--up { color: var(--status-success); }
.kpi__delta--down { color: var(--status-danger); }

.dash__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}
.widget {
  background: var(--surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-1);
  overflow: hidden;
}
.widget__head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px 8px;
}
.widget__title {
  font-size: 14px;
  font-weight: var(--weight-semibold);
  display: flex; align-items: center; gap: 8px;
}
.widget__title-count {
  font-size: 11px;
  color: var(--fg-tertiary);
  background: var(--cool-neutral-96);
  padding: 1px 7px;
  border-radius: 999px;
  font-weight: var(--weight-medium);
}
[data-theme="dark"] .widget__title-count { background: var(--alpha-neutral-08); }
.widget__more {
  font-size: 12px;
  color: var(--fg-link);
}
.widget__body { padding: 4px 8px 12px; }
.widget__row {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 8px;
  border-radius: var(--radius-md);
  cursor: pointer;
}
.widget__row:hover { background: var(--chrome-hover); }
.widget__row-pri {
  width: 3px; align-self: stretch;
  border-radius: 2px;
  flex-shrink: 0;
}
.widget__row-pri--urgent { background: var(--priority-urgent); }
.widget__row-pri--high   { background: var(--priority-high); }
.widget__row-pri--normal { background: var(--priority-normal); }
.widget__row-title {
  flex: 1; min-width: 0;
  font-size: 13px;
  font-weight: var(--weight-medium);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.widget__row-sub {
  font-size: 11px; color: var(--fg-tertiary);
  display: flex; gap: 6px; align-items: center;
  margin-top: 1px;
}
.widget__row-meta { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

/* Activity */
.activity-item {
  display: flex; gap: 10px;
  padding: 8px 8px;
  border-radius: var(--radius-md);
  font-size: 12px;
  align-items: flex-start;
}
.activity-item:hover { background: var(--chrome-hover); }
.activity-item__body { flex: 1; min-width: 0; line-height: 1.5; }
.activity-item__time { font-size: 11px; color: var(--fg-tertiary); margin-top: 2px; }
.activity-item strong { font-weight: var(--weight-semibold); }

/* Project progress (stacked bars) */
.progress-block {
  background: var(--surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-1);
  padding: 14px 16px 16px;
}
.progress-row {
  display: grid;
  grid-template-columns: 1fr 220px 60px;
  gap: 16px;
  align-items: center;
  padding: 8px 0;
}
.progress-row__name { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: var(--weight-medium); }
.progress-row__name-dot { width: 8px; height: 8px; border-radius: 3px; }
.progress-row__bar {
  height: 8px;
  border-radius: 999px;
  background: var(--cool-neutral-96);
  display: flex;
  overflow: hidden;
}
[data-theme="dark"] .progress-row__bar { background: var(--alpha-neutral-08); }
.progress-row__bar > span { display: block; height: 100%; }
.progress-row__pct {
  font-size: 12px; color: var(--fg-tertiary);
  font-variant-numeric: tabular-nums;
  text-align: right;
}

/* ============================================================
 * Drawer (task detail)
 * ============================================================ */
.drawer-overlay {
  position: fixed; inset: 0;
  background: var(--surface-overlay);
  z-index: 100;
  animation: fadeIn 160ms ease-out;
}
.drawer {
  position: fixed;
  top: 0; right: 0; bottom: 0;
  width: min(960px, 95vw);
  background: var(--surface-background);
  z-index: 101;
  display: grid;
  grid-template-columns: 1fr 320px;
  animation: slideInRight 240ms cubic-bezier(0.2, 0.8, 0.2, 1);
  box-shadow: var(--shadow-4);
  border-left: 1px solid var(--border-subtle);
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideInRight { from { transform: translateX(20px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

.drawer__main {
  overflow-y: auto;
  padding: 16px 28px 80px;
  min-width: 0;
}
.drawer__head {
  display: flex; align-items: center; gap: 8px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 18px;
}
.drawer__head-dot { width: 10px; height: 10px; border-radius: 3px; }
.drawer__head-text { font-size: 12px; color: var(--fg-secondary); }
.drawer__head-id { font-family: var(--font-mono); font-size: 11px; color: var(--fg-tertiary); }
.drawer__head-spacer { flex: 1; }
.drawer__close { width: 30px; height: 30px; border-radius: var(--radius-md); display: grid; place-items: center; color: var(--fg-secondary); }
.drawer__close:hover { background: var(--chrome-hover); color: var(--fg-primary); }

.drawer__title-row {
  display: flex; align-items: flex-start; gap: 10px;
  margin-bottom: 14px;
}
.drawer__title-row h1 {
  font-size: 22px;
  font-weight: var(--weight-bold);
  letter-spacing: var(--tracking-tight);
  flex: 1;
}
.drawer__title-edit {
  width: 28px; height: 28px;
  border-radius: var(--radius-sm);
  display: grid; place-items: center;
  color: var(--fg-tertiary);
  opacity: 0;
  transition: opacity var(--motion-fast);
}
.drawer__title-row:hover .drawer__title-edit { opacity: 1; }
.drawer__title-edit:hover { background: var(--chrome-hover); color: var(--fg-primary); }

.drawer__chips { display: flex; gap: 6px; margin-bottom: 20px; flex-wrap: wrap; }

.drawer__section-title {
  font-size: 11px;
  font-weight: var(--weight-semibold);
  color: var(--fg-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin: 24px 0 10px;
}
.drawer__body {
  font-size: 14px;
  line-height: 1.65;
  color: var(--fg-primary);
}
.drawer__body p { margin: 0 0 12px; }
.drawer__body ul { margin: 0 0 12px; padding-left: 20px; }
.drawer__body li { margin-bottom: 4px; }
.drawer__body code {
  background: var(--cool-neutral-96);
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 13px;
}
[data-theme="dark"] .drawer__body code { background: var(--alpha-neutral-08); }

/* Drop zone */
.dropzone {
  border: 1.5px dashed var(--border-default);
  border-radius: var(--radius-lg);
  padding: 18px;
  text-align: center;
  font-size: 13px;
  color: var(--fg-secondary);
  background: var(--chrome-bg);
  transition: background var(--motion-fast), border-color var(--motion-fast), color var(--motion-fast);
}
.dropzone:hover, .dropzone--active {
  border-color: var(--brand-primary);
  background: var(--brand-primary-soft);
  color: var(--brand-primary);
  border-style: solid;
}
.dropzone__icon { margin-bottom: 6px; }
.dropzone strong { font-weight: var(--weight-semibold); color: var(--fg-primary); }
.dropzone--active strong { color: var(--brand-primary); }
.dropzone__hint { font-size: 11px; color: var(--fg-tertiary); margin-top: 4px; }

/* Attachments grid */
.attach-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-top: 12px;
}
.attach-thumb {
  aspect-ratio: 1;
  border-radius: var(--radius-md);
  background: var(--cool-neutral-96);
  position: relative;
  overflow: hidden;
  border: 1px solid var(--border-subtle);
  cursor: pointer;
}
.attach-thumb:hover { border-color: var(--border-default); }
[data-theme="dark"] .attach-thumb { background: var(--alpha-neutral-08); }
.attach-thumb__placeholder {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  color: var(--fg-tertiary);
}
.attach-thumb__label {
  position: absolute; left: 6px; bottom: 6px;
  background: var(--alpha-black-72);
  color: white;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 10px;
  font-family: var(--font-mono);
}
.attach-file {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  margin-bottom: 6px;
}
.attach-file__icon {
  width: 32px; height: 32px;
  border-radius: var(--radius-sm);
  background: var(--brand-primary-soft);
  color: var(--brand-primary);
  display: grid; place-items: center;
  flex-shrink: 0;
}
.attach-file__body { flex: 1; min-width: 0; }
.attach-file__name { font-size: 13px; font-weight: var(--weight-medium); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.attach-file__meta { font-size: 11px; color: var(--fg-tertiary); }
.attach-file__action { color: var(--fg-tertiary); width: 28px; height: 28px; display: grid; place-items: center; border-radius: var(--radius-sm); }
.attach-file__action:hover { background: var(--chrome-hover); color: var(--fg-primary); }

.url-card {
  display: flex; align-items: center; gap: 12px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 10px;
}
.url-card__og {
  width: 56px; height: 56px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--brand-primary), #818CF8);
  flex-shrink: 0;
}
.url-card__body { flex: 1; min-width: 0; }
.url-card__title { font-size: 13px; font-weight: var(--weight-semibold); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.url-card__desc { font-size: 12px; color: var(--fg-tertiary); margin-top: 2px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.url-card__url { font-size: 11px; color: var(--fg-tertiary); margin-top: 4px; }

/* Comments */
.comment {
  display: flex; gap: 10px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border-subtle);
}
.comment:last-child { border-bottom: 0; }
.comment__body { flex: 1; min-width: 0; }
.comment__head {
  display: flex; align-items: center; gap: 8px;
  font-size: 12px;
  margin-bottom: 4px;
}
.comment__author { font-weight: var(--weight-semibold); }
.comment__time { color: var(--fg-tertiary); }
.comment__text { font-size: 13px; line-height: 1.6; color: var(--fg-primary); }
.comment__text .mention {
  color: var(--brand-primary);
  background: var(--brand-primary-soft);
  padding: 0 4px;
  border-radius: 4px;
  font-weight: var(--weight-medium);
}

/* Composer */
.composer {
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  background: var(--surface-elevated);
  margin-top: 12px;
  position: relative;
}
.composer:focus-within { border-color: var(--border-focus); box-shadow: 0 0 0 3px var(--alpha-primary-16); }
.composer__toolbar {
  display: flex; align-items: center; gap: 2px;
  padding: 6px 8px;
  border-bottom: 1px solid var(--border-subtle);
}
.composer__tool {
  width: 26px; height: 26px;
  border-radius: 4px;
  display: grid; place-items: center;
  color: var(--fg-tertiary);
}
.composer__tool:hover { background: var(--chrome-hover); color: var(--fg-primary); }
.composer__tool-divider { width: 1px; height: 16px; background: var(--border-subtle); margin: 0 4px; }
.composer__field {
  width: 100%;
  min-height: 70px;
  padding: 10px 12px;
  border: 0;
  outline: 0;
  resize: none;
  background: transparent;
  font-size: 13px;
  line-height: 1.5;
  color: var(--fg-primary);
}
.composer__footer {
  display: flex; align-items: center; justify-content: space-between;
  padding: 6px 10px 8px;
}
.composer__hint { font-size: 11px; color: var(--fg-tertiary); }

.mention-pop {
  position: absolute;
  bottom: calc(100% + 6px);
  left: 12px;
  width: 280px;
  background: var(--surface-elevated);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-3);
  padding: 4px;
  z-index: 10;
}
.mention-pop__item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
}
.mention-pop__item:hover, .mention-pop__item--active { background: var(--brand-primary-soft); }
.mention-pop__name { font-size: 13px; font-weight: var(--weight-medium); }
.mention-pop__email { font-size: 11px; color: var(--fg-tertiary); }

/* History */
.history {
  border-left: 2px solid var(--border-subtle);
  margin-left: 10px;
  padding-left: 18px;
}
.history__item {
  position: relative;
  padding: 6px 0;
  font-size: 12px;
  color: var(--fg-secondary);
}
.history__item::before {
  content: "";
  position: absolute;
  left: -25px; top: 12px;
  width: 10px; height: 10px;
  border-radius: 999px;
  background: var(--surface-background);
  border: 2px solid var(--border-default);
}
.history__time { color: var(--fg-tertiary); margin-left: 6px; }
.history__toggle {
  font-size: 12px; color: var(--fg-link);
  margin-top: 8px;
}

/* Drawer sidebar */
.drawer__side {
  border-left: 1px solid var(--border-subtle);
  background: var(--chrome-bg);
  padding: 16px 20px 24px;
  overflow-y: auto;
}
.drawer-side-toggle { display: none; }
.drawer__cta { width: 100%; margin-bottom: 16px; }
.drawer__cta + .drawer__cta { margin-top: -8px; }

.prop {
  display: grid;
  grid-template-columns: 80px 1fr;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  font-size: 12px;
  border-bottom: 1px solid var(--border-subtle);
}
.prop:last-child { border-bottom: 0; }
.prop__label { color: var(--fg-tertiary); }
.prop__value {
  font-size: 12px;
  color: var(--fg-primary);
  display: flex; align-items: center; gap: 6px;
  cursor: pointer;
  padding: 4px 6px;
  margin: -4px -6px;
  border-radius: 4px;
}
.prop__value:hover { background: var(--chrome-hover); }

.dropdown {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 12px;
}
.dropdown:hover { background: var(--chrome-hover); }
.dropdown svg { width: 12px; height: 12px; color: var(--fg-tertiary); }

/* Permission hint */
.perm-hint {
  display: flex; align-items: center; gap: 6px;
  padding: 8px 10px;
  background: var(--brand-primary-soft);
  border-radius: var(--radius-sm);
  font-size: 11px;
  color: var(--brand-primary);
  margin-bottom: 12px;
  line-height: 1.4;
}
[data-theme="dark"] .perm-hint { color: var(--chrome-active-fg); }

/* ============================================================
 * Settings — notification matrix
 * ============================================================ */
.settings {
  padding: 24px 28px;
  max-width: 1080px;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
}
.settings__head h1 { font-size: 22px; font-weight: var(--weight-bold); letter-spacing: var(--tracking-tight); }
.settings__head p { font-size: 13px; color: var(--fg-secondary); margin-top: 4px; }

.settings__panel {
  background: var(--surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-top: 20px;
  box-shadow: var(--shadow-1);
}
.settings__panel h2 { font-size: 16px; font-weight: var(--weight-semibold); margin-bottom: 4px; }
.settings__panel-sub { font-size: 12px; color: var(--fg-tertiary); margin-bottom: 16px; }

.field {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 16px;
  align-items: center;
  padding: 10px 0;
}
.field__label { font-size: 13px; font-weight: var(--weight-medium); color: var(--fg-secondary); }
.field__control { display: flex; gap: 8px; align-items: center; }

.input {
  flex: 1;
  height: 34px;
  padding: 0 12px;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  background: var(--surface-background);
  font-size: 13px;
  color: var(--fg-primary);
}
.input:focus { outline: none; border-color: var(--border-focus); box-shadow: 0 0 0 3px var(--alpha-primary-16); }
.input::placeholder { color: var(--fg-tertiary); }

/* Matrix table */
.matrix {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13px;
  margin-top: 8px;
}
.matrix th, .matrix td {
  padding: 12px 10px;
  text-align: left;
  border-bottom: 1px solid var(--border-subtle);
}
.matrix th {
  font-size: 11px;
  font-weight: var(--weight-semibold);
  color: var(--fg-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 1px solid var(--border-default);
}
.matrix th:not(:first-child), .matrix td:not(:first-child) { text-align: center; }
.matrix tr:last-child td { border-bottom: 0; }
.matrix__event-name { font-weight: var(--weight-medium); }
.matrix__event-desc { font-size: 11px; color: var(--fg-tertiary); margin-top: 1px; }

/* Checkbox */
.check {
  width: 18px; height: 18px;
  border: 1.5px solid var(--border-strong);
  border-radius: 5px;
  display: inline-grid; place-items: center;
  cursor: pointer;
  background: var(--surface-background);
  transition: background var(--motion-fast), border-color var(--motion-fast);
}
.check:hover { border-color: var(--brand-primary); }
.check--checked {
  background: var(--brand-primary);
  border-color: var(--brand-primary);
  color: white;
}
.check--checked svg { display: block; }
.check svg { display: none; width: 12px; height: 12px; }
.check--disabled {
  background: var(--cool-neutral-94);
  border-color: var(--border-default);
  color: var(--fg-tertiary);
  cursor: not-allowed;
}
.check--disabled.check--checked { background: var(--cool-neutral-80); border-color: var(--cool-neutral-80); color: white; }
[data-theme="dark"] .check--disabled { background: var(--alpha-neutral-08); }
[data-theme="dark"] .check--disabled.check--checked { background: var(--cool-neutral-50); border-color: var(--cool-neutral-50); }

/* Preview cards */
.preview-card {
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px;
  background: var(--chrome-bg);
  font-size: 12px;
}
.preview-card__type {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 10px; font-weight: var(--weight-semibold);
  color: var(--fg-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 6px;
}
.preview-card--slack { border-left: 3px solid #4A154B; }
.preview-card--email { border-left: 3px solid var(--brand-primary); }
.preview-card__subject { font-weight: var(--weight-semibold); margin-bottom: 4px; }
.preview-card__body { color: var(--fg-secondary); line-height: 1.5; }
.preview-card__body strong { color: var(--fg-primary); font-weight: var(--weight-semibold); }

/* ============================================================
 * Notification bell dropdown
 * ============================================================ */
.notif-pop {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  width: 380px;
  max-height: 480px;
  background: var(--surface-elevated);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-3);
  z-index: 60;
  display: flex; flex-direction: column;
}
.notif-pop__head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-subtle);
}
.notif-pop__head h3 { font-size: 14px; font-weight: var(--weight-semibold); }
.notif-pop__body { overflow-y: auto; padding: 4px; flex: 1; }
.notif-pop__group {
  font-size: 11px; color: var(--fg-tertiary); font-weight: var(--weight-semibold);
  text-transform: uppercase; letter-spacing: 0.04em;
  padding: 8px 12px 4px;
}
.notif-item {
  display: flex; gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  cursor: pointer;
  align-items: flex-start;
  position: relative;
}
.notif-item:hover { background: var(--chrome-hover); }
.notif-item--unread::after {
  content: "";
  position: absolute;
  left: 4px; top: 50%; transform: translateY(-50%);
  width: 6px; height: 6px;
  border-radius: 999px;
  background: var(--brand-primary);
}
.notif-item__icon {
  width: 28px; height: 28px;
  border-radius: 8px;
  display: grid; place-items: center;
  flex-shrink: 0;
}
.notif-item__body { flex: 1; min-width: 0; }
.notif-item__text { font-size: 12px; line-height: 1.5; }
.notif-item__text strong { font-weight: var(--weight-semibold); }
.notif-item__time { font-size: 11px; color: var(--fg-tertiary); margin-top: 2px; }
.notif-pop__foot {
  border-top: 1px solid var(--border-subtle);
  padding: 8px 12px;
  text-align: center;
  font-size: 12px;
  color: var(--fg-link);
  cursor: pointer;
}
.notif-pop__foot:hover { background: var(--chrome-hover); }

/* ============================================================
 * Tooltip
 * ============================================================ */
.tip { position: relative; }
.tip__bubble {
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%; transform: translateX(-50%);
  background: var(--cool-neutral-10);
  color: white;
  font-size: 11px;
  padding: 4px 8px;
  border-radius: 6px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--motion-fast);
  z-index: 200;
}
[data-theme="dark"] .tip__bubble { background: var(--cool-neutral-90); color: var(--cool-neutral-10); }
.tip:hover .tip__bubble { opacity: 1; }

/* ============================================================
 * Misc
 * ============================================================ */
.empty {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 40px 20px;
  text-align: center;
  color: var(--fg-tertiary);
  font-size: 13px;
}
.empty__illu {
  width: 80px; height: 80px;
  margin-bottom: 12px;
}
.empty__title { font-size: 14px; font-weight: var(--weight-semibold); color: var(--fg-secondary); margin-bottom: 4px; }
.empty__hint { margin-bottom: 12px; }


/* ============================================================
 * Responsive
 * Breakpoints:
 *  - tablet:  <= 1024
 *  - mobile:  <= 768
 *  - small:   <= 480
 * ============================================================ */

@media (max-width: 1280px) {
  .dash__kpis { grid-template-columns: repeat(2, 1fr); }
  .drawer { grid-template-columns: 1fr 280px; }
}

@media (max-width: 1024px) {
  .app { grid-template-columns: 220px 1fr; }
  .search { max-width: 240px; }
  .drawer { width: 100vw; grid-template-columns: 1fr; }
  .drawer__side {
    border-left: 0;
    border-top: 1px solid var(--border-subtle);
    order: -1;
    padding: 14px 20px;
  }
  .dash__grid { grid-template-columns: 1fr; }
  .progress-row { grid-template-columns: 1fr 140px 50px; gap: 12px; }
}

@media (max-width: 768px) {
  .app { grid-template-columns: 1fr; }

  /* Sidebar slides over */
  .sidebar {
    position: fixed;
    top: 0; bottom: 0; left: 0;
    width: 280px;
    z-index: 100;
    transform: translateX(-100%);
    transition: transform 240ms cubic-bezier(0.2, 0.8, 0.2, 1);
    box-shadow: var(--shadow-3);
  }
  .app--sidebar-open .sidebar { transform: translateX(0); }
  .app--sidebar-open .sidebar-scrim { display: block; }
  .hamburger { display: inline-flex; }
  .fab { display: inline-flex; }

  /* Topbar */
  .topbar { padding: 0 12px; gap: 8px; }
  .breadcrumb { font-size: 12px; gap: 4px; }
  .breadcrumb__item:not(.breadcrumb__item--current) { display: none; }
  .breadcrumb__sep { display: none; }
  .search { display: none; }
  .topbar__actions .btn--primary { display: none; } /* FAB replaces it */
  .topbar__actions { gap: 4px; margin-left: auto; }

  /* Dashboard */
  .dash { padding: 16px; }
  .dash__kpis { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .kpi { padding: 12px 12px; }
  .kpi__value { font-size: 22px; }
  .progress-block { padding: 12px; }
  .progress-row { grid-template-columns: 1fr 100px 40px; gap: 10px; font-size: 12px; }
  .progress-row__name { font-size: 12px; }

  /* Welcome header */
  .dash > div:first-child { flex-direction: column; align-items: flex-start; gap: 12px; }
  .dash > div:first-child h1 { font-size: 18px; }

  /* Page head */
  .page-head { padding: 12px 16px 4px; flex-direction: column; align-items: stretch; gap: 8px; }
  .page-head__title h1 { font-size: 18px; }
  .page-head__actions { width: 100%; justify-content: space-between; flex-wrap: wrap; gap: 6px; }
  .page-head__actions .btn--primary { display: none; }

  /* Filter bar — horizontal scroll */
  .filter-bar { padding: 8px 16px 12px; flex-wrap: nowrap; overflow-x: auto; gap: 6px; }
  .filter-bar > * { flex-shrink: 0; }
  .filter-bar label { margin-left: auto; }
  .filter-bar > .filter-chip:last-of-type { display: none; }

  /* Board — horizontal swipe */
  .board {
    padding: 12px 16px 24px;
    gap: 12px;
    scroll-snap-type: x mandatory;
    overflow-x: auto;
    overscroll-behavior-x: contain;
  }
  .column {
    width: calc(100vw - 56px);
    max-width: 320px;
    scroll-snap-align: center;
    flex-shrink: 0;
  }

  /* Drawer — fullscreen */
  .drawer {
    inset: 0;
    width: 100vw;
    height: 100vh;
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
    animation: slideUp 240ms cubic-bezier(0.2, 0.8, 0.2, 1);
  }
  .drawer__side {
    order: 0;
    border-top: 0;
    border-bottom: 1px solid var(--border-subtle);
    padding: 0;
    background: var(--surface-background);
    max-height: 56px;
    overflow: hidden;
    transition: max-height 240ms ease-out;
  }
  .drawer__side[data-open="true"] { max-height: 60vh; overflow-y: auto; padding: 14px 20px; }
  .drawer__side[data-open="false"] .drawer-side-toggle::after { content: " ▾"; color: var(--fg-tertiary); }
  .drawer__side[data-open="true"]  .drawer-side-toggle::after { content: " ▴"; color: var(--fg-tertiary); }
  .drawer-side-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 16px 20px;
    width: 100%;
    font-size: 13px;
    font-weight: var(--weight-semibold);
    color: var(--fg-secondary);
    text-align: left;
    background: var(--chrome-bg);
    border-bottom: 1px solid var(--border-subtle);
    cursor: pointer;
  }
  .drawer__main { padding: 16px 20px 80px; }
  .drawer__title-row h1 { font-size: 18px; }
  .attach-grid { grid-template-columns: repeat(3, 1fr); }

  /* New task modal — fullscreen sheet */
  div[role="dialog"][aria-label="신규 테스크"] {
    top: 0 !important; left: 0 !important;
    transform: none !important;
    width: 100vw !important;
    height: 100vh;
    border-radius: 0 !important;
    padding: 16px !important;
    overflow-y: auto;
  }
  div[role="dialog"][aria-label="신규 테스크"] > div:nth-child(2) {
    grid-template-columns: 1fr;
  }

  /* Settings / list pages */
  .settings { padding: 16px; max-width: 100%; }
  .settings__head h1 { font-size: 20px; }
  .settings__panel { padding: 16px; }
  .field { grid-template-columns: 1fr; gap: 6px; padding: 8px 0; }
  .field__label { font-size: 12px; }

  /* Notification matrix → cards */
  .settings__panel > div[style*="grid-template-columns"] { display: block !important; }
  .matrix thead { display: none; }
  .matrix, .matrix tbody, .matrix tr, .matrix td { display: block; width: 100%; }
  .matrix tr {
    background: var(--surface-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    margin-bottom: 8px;
    padding: 12px 14px;
  }
  .matrix tr:hover, .matrix tr[style*="brand-primary-soft"] { background: var(--brand-primary-soft) !important; }
  .matrix td {
    padding: 4px 0 !important;
    border: 0 !important;
    text-align: left !important;
  }
  .matrix td:first-child { padding-bottom: 8px !important; border-bottom: 1px solid var(--border-subtle) !important; margin-bottom: 8px; }
  .matrix td:not(:first-child) {
    display: inline-flex !important;
    align-items: center;
    gap: 8px;
    width: auto !important;
    margin-right: 16px;
  }
  .matrix td:not(:first-child)::before {
    content: attr(data-label);
    font-size: 11px;
    color: var(--fg-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
  }

  /* All-tasks/members list rows → cards */
  .settings div[style*="grid-template-columns: 60px 1fr"] {
    grid-template-columns: 1fr !important;
    gap: 6px !important;
  }
  .settings div[style*="grid-template-columns: 60px 1fr"] > *:nth-child(n+3) {
    display: inline-flex !important;
    margin-right: 8px;
  }

  /* Notifications page — looser */
  .settings div[style*="grid-template-columns: 1fr 200px"] {
    grid-template-columns: 1fr !important;
    gap: 6px !important;
  }

  /* Tweaks panel — keep but smaller */
}

@media (max-width: 480px) {
  .dash__kpis { grid-template-columns: 1fr 1fr; }
  .attach-grid { grid-template-columns: repeat(2, 1fr); }
  .topbar { height: 52px; }
  .sidebar__logo { padding: 12px 14px 8px; font-size: 15px; }
  .drawer__title-row h1 { font-size: 17px; }
  .progress-row { grid-template-columns: 1fr 80px 36px; }
  .progress-row__name { font-size: 11px; }
}

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