/*
  Dashboard layout — plain static CSS (not processed by Tailwind/Turbopack).
  Loaded via <link href="/dashboard-layout.css"> so Safari can fetch it
  independently of the compiled globals chunk.
*/

:root {
  color-scheme: light;
  --cs-bg: #f5f5f7;
  --cs-surface: #ffffff;
  --cs-surface-elevated: #fbfbfc;
  --cs-surface-muted: #f5f5f7;
  --cs-border: #e5e5ea;
  --cs-border-subtle: #f0f0f2;
  --cs-border-hover: #d2d2d7;
  --cs-text: #1d1d1f;
  --cs-text-secondary: #4a545b;
  --cs-text-muted: #9b9b9b;
  --cs-text-tertiary: #6e6e73;
  --cs-brand: #009fe3;
  --cs-brand-dark: #005c8a;
  --cs-brand-ink: #00569a;
  --cs-danger: #d93900;
  --cs-warning: #c47f00;
  --cs-escalation: #b00040;
  --cs-critical: #cc3366;
  --cs-active-bg: rgba(0, 159, 227, 0.1);
  --cs-segmented-hover: rgba(255, 255, 255, 0.7);
  --cs-shadow: rgba(0, 0, 0, 0.04);
  --cs-shadow-subtle: rgba(0, 0, 0, 0.03);
  --cs-shadow-thumb: rgba(0, 0, 0, 0.12);
  --cs-focus-ring: rgba(0, 159, 227, 0.45);
  --cs-on-brand: #ffffff;
  --surface: var(--cs-surface);
  --text-primary: var(--cs-text);
  --text-secondary: var(--cs-text-secondary);
  --border: var(--cs-border);
  --brand: var(--cs-brand);
}

html.dark {
  color-scheme: dark;
  --cs-bg: #000000;
  --cs-surface: #1c1c1e;
  --cs-surface-elevated: #2c2c2e;
  --cs-surface-muted: #2c2c2e;
  --cs-border: #3a3a3c;
  --cs-border-subtle: #3a3a3c;
  --cs-border-hover: #48484a;
  --cs-text: #f5f5f7;
  --cs-text-secondary: #a1a1a6;
  --cs-text-muted: #8e8e93;
  --cs-text-tertiary: #8e8e93;
  --cs-brand: #33b4eb;
  --cs-brand-dark: #009fe3;
  --cs-brand-ink: #7ec8e8;
  --cs-danger: #ff453a;
  --cs-warning: #ffd60a;
  --cs-escalation: #ff375f;
  --cs-critical: #ff375f;
  --cs-active-bg: rgba(51, 180, 235, 0.15);
  --cs-segmented-hover: rgba(255, 255, 255, 0.08);
  --cs-shadow: rgba(0, 0, 0, 0.35);
  --cs-shadow-subtle: rgba(0, 0, 0, 0.25);
  --cs-shadow-thumb: rgba(0, 0, 0, 0.4);
  --cs-focus-ring: rgba(51, 180, 235, 0.45);
  --cs-on-brand: #ffffff;
  --surface: var(--cs-surface);
  --text-primary: var(--cs-text);
  --text-secondary: var(--cs-text-secondary);
  --border: var(--cs-border);
  --brand: var(--cs-brand);
}

body {
  background: var(--cs-bg) !important;
  color: var(--cs-text) !important;
}

.dashboard-home {
  box-sizing: border-box;
  width: 100%;
  max-width: 1240px;
  margin-inline: auto;
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
}

.dashboard-header {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 1rem;
}

.dashboard-header__copy {
  min-width: 0;
}

.dashboard-header__title {
  margin: 0;
  font-size: 1.875rem;
  font-weight: 600;
  letter-spacing: -0.025em;
  color: var(--cs-text);
  line-height: 1.2;
}

.dashboard-header__date {
  margin: 0.35rem 0 0;
  font-size: 0.9375rem;
  color: var(--cs-text-secondary);
}

.dashboard-header__action {
  flex-shrink: 0;
}

.dashboard-section-title {
  margin: 0;
  font-size: 1.0625rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--cs-text);
}

.dashboard-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 1rem;
}

.dashboard-metric-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-sizing: border-box;
  height: 108px;
  min-height: 108px;
  max-height: 120px;
  padding: 1rem 1.25rem;
  border-radius: 16px;
  background: var(--cs-surface);
  box-shadow: 0 1px 2px var(--cs-shadow);
  border: 1px solid var(--cs-border);
  text-decoration: none;
  color: inherit;
}

.dashboard-metric-card:hover {
  border-color: var(--cs-brand);
}

.dashboard-metric-card__label {
  margin: 0;
  font-size: 0.8125rem;
  line-height: 1.3;
  color: var(--cs-text-secondary);
}

.dashboard-metric-card__value {
  margin: 0;
  font-size: 2rem;
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  color: var(--cs-text);
}

.dashboard-metric-card__value--danger {
  color: var(--cs-danger);
}

.dashboard-metric-card__value--warning {
  color: var(--cs-warning);
}

.dashboard-relevant-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
}

.dashboard-relevant-link {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--cs-brand-dark);
  text-decoration: none;
}

.dashboard-relevant-link:hover {
  color: var(--cs-brand);
}

.dashboard-relevant-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 1rem;
}

.dashboard-task-row {
  box-sizing: border-box;
  display: flex;
  align-items: center;
  gap: 0.625rem;
  min-height: 68px;
  height: auto;
  padding: 0.75rem 1rem;
  padding-left: 1.05rem;
  border-radius: 16px;
  background: var(--cs-surface);
  border: 1px solid var(--cs-border);
  box-shadow: 0 1px 2px var(--cs-shadow-subtle);
  text-decoration: none;
  color: inherit;
  position: relative;
  min-width: 0;
  transition: border-color 140ms ease, background-color 140ms ease, box-shadow 140ms ease;
}

.dashboard-task-row__hit {
  position: absolute;
  inset: 0;
  z-index: 0;
  border-radius: inherit;
}

.dashboard-task-row__hit:focus-visible {
  outline: 2px solid var(--cs-brand);
  outline-offset: 2px;
}

.dashboard-task-row__main {
  display: flex;
  min-width: 0;
  flex: 1;
  align-items: center;
  gap: 0.875rem;
  text-decoration: none;
  color: inherit;
}

.dashboard-task-row:hover {
  border-color: var(--cs-border-hover);
  background: var(--cs-surface-elevated);
}

.dashboard-task-row--overdue:not(.dashboard-task-row--escalated):hover {
  box-shadow: inset 3px 0 0 var(--cs-danger);
}

.dashboard-task-row--today:not(.dashboard-task-row--overdue):not(.dashboard-task-row--escalated):hover {
  box-shadow: inset 3px 0 0 #7aa7c2;
}

.dashboard-task-row--escalated:hover {
  box-shadow: inset 3px 0 0 #9a3d5c;
}

.dashboard-task-row__body {
  min-width: 0;
  flex: 1;
}

.dashboard-task-row__title-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
}

.dashboard-task-row__title {
  margin: 0;
  font-size: 0.9375rem;
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1.3;
  color: var(--cs-text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
  max-width: 100%;
}

.dashboard-task-row__recurring {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  margin: 0;
  padding: 0.125rem 0.5rem;
  border-radius: 999px;
  border: 1px solid var(--cs-border);
  background: var(--cs-surface-muted);
  font-size: 0.6875rem;
  font-weight: 500;
  line-height: 1.3;
  color: var(--cs-text-secondary);
}

.dashboard-task-row__follow-up {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  margin: 0;
  padding: 0.125rem 0.5rem;
  border-radius: 999px;
  border: 1px solid var(--cs-border);
  background: var(--cs-surface-muted);
  font-size: 0.6875rem;
  font-weight: 500;
  line-height: 1.3;
  color: var(--cs-text-secondary);
}

.dashboard-task-row__meta {
  margin: 0.25rem 0 0;
  font-size: 0.8125rem;
  line-height: 1.35;
  color: var(--cs-text-secondary);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  min-width: 0;
}

.dashboard-task-row__meta-sep {
  margin: 0 0.35rem;
  color: var(--cs-text-muted);
}

.dashboard-task-row__meta--overdue {
  color: var(--cs-danger);
  font-weight: 500;
}

.dashboard-task-row__status {
  display: flex;
  flex-shrink: 0;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: flex-end;
  align-self: center;
  gap: 8px;
  height: 28px;
  position: relative;
  z-index: 1;
  pointer-events: auto;
  text-decoration: none;
  color: inherit;
}

.dashboard-task-row__status-badge {
  box-sizing: border-box;
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  height: 28px;
  min-width: 28px;
  padding: 0;
  border-radius: 999px;
  line-height: 1;
}

.dashboard-task-row__status-badge--icon {
  width: 28px;
}

.dashboard-task-row__status-badge--critical {
  color: var(--cs-critical);
  background: rgba(204, 51, 102, 0.12);
}

.dashboard-task-row__status-badge--high {
  color: var(--cs-warning);
  background: rgba(196, 127, 0, 0.1);
}

.dashboard-task-row__status-badge--escalation {
  gap: 4px;
  width: auto;
  padding: 0 8px 0 6px;
  color: var(--cs-warning);
  background: rgba(196, 127, 0, 0.14);
}

.dashboard-task-row__status-level {
  font-size: 0.75rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.dashboard-task-row__status-badge svg {
  display: block;
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.dashboard-task-row__badge {
  display: inline-flex;
  align-items: center;
  padding: 0.125rem 0.5rem;
  border-radius: 999px;
  font-size: 0.6875rem;
  font-weight: 500;
  line-height: 1.3;
}

.dashboard-task-row__badge--status {
  background: var(--cs-surface-muted);
  color: var(--cs-text-secondary);
  border: 1px solid var(--cs-border);
}

.dashboard-task-row__badge--high {
  background: #fff8e8;
  color: #a56a00;
  border: 1px solid #f0d9a0;
}

.dashboard-task-row__badge--critical {
  background: #fff1f0;
  color: #b42318;
  border: 1px solid #f0c2bc;
}

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

@media (min-width: 1024px) {
  .dashboard-header {
    flex-direction: row;
    justify-content: space-between;
    align-items: flex-start;
    gap: 2rem;
  }

  .dashboard-header__title {
    font-size: 2.125rem;
  }

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

/* ── Shared app chrome (non-home screens) — matches approved dashboard ── */

.app-page {
  box-sizing: border-box;
  width: 100%;
  max-width: 1240px;
  margin-inline: auto;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.app-page-header {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.35rem;
}

.app-page-title {
  margin: 0;
  font-size: 1.875rem;
  font-weight: 600;
  letter-spacing: -0.025em;
  color: var(--cs-text);
  line-height: 1.2;
}

.app-page-subtitle {
  margin: 0;
  font-size: 0.9375rem;
  color: var(--cs-text-secondary);
}

.app-filter-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.app-filter-tab {
  display: inline-flex;
  align-items: center;
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
  border: 1px solid var(--cs-border);
  background: var(--cs-surface);
  color: var(--cs-text-secondary);
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
  transition: border-color 140ms ease, background-color 140ms ease, color 140ms ease;
}

.app-filter-tab:hover {
  border-color: var(--cs-border-hover);
  color: var(--cs-text);
}

.app-filter-tab--active {
  background: var(--cs-brand);
  border-color: var(--cs-brand);
  color: var(--cs-surface);
}

.app-filter-tab--active:hover {
  background: var(--cs-brand-dark);
  border-color: var(--cs-brand-dark);
  color: var(--cs-surface);
}

.app-task-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.app-surface {
  box-sizing: border-box;
  border-radius: 16px;
  background: var(--cs-surface);
  border: 1px solid var(--cs-border);
  box-shadow: 0 1px 2px var(--cs-shadow-subtle);
}

.app-surface--pad {
  padding: 1.25rem 1.5rem;
}

.app-empty {
  padding: 2.5rem 1.5rem;
  text-align: center;
  color: var(--cs-text-secondary);
  font-size: 0.9375rem;
}

.app-detail {
  display: grid;
  gap: 1.25rem;
}

.app-detail__main,
.app-detail__side {
  box-sizing: border-box;
  border-radius: 16px;
  background: var(--cs-surface);
  border: 1px solid var(--cs-border);
  box-shadow: 0 1px 2px var(--cs-shadow-subtle);
  padding: 1.5rem;
}

.app-detail__title {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--cs-text);
  line-height: 1.25;
}

.app-detail__label {
  margin: 0 0 0.35rem;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--cs-text-muted);
}

.app-detail__value {
  margin: 0;
  font-size: 0.9375rem;
  color: var(--cs-text);
}

.app-detail__section {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--cs-border);
}

.app-detail__section:first-child {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

.app-field {
  display: block;
  font-size: 0.875rem;
}

.app-field + .app-field {
  margin-top: 0.85rem;
}

.app-field__label {
  display: block;
  margin-bottom: 0.35rem;
  color: var(--cs-text-secondary);
}

.app-field__control {
  box-sizing: border-box;
  width: 100%;
  border-radius: 12px;
  border: 1px solid var(--cs-border);
  background: var(--cs-surface);
  padding: 0.55rem 0.75rem;
  font-size: 0.875rem;
  color: var(--cs-text);
}

.app-field__control:focus {
  outline: 2px solid rgba(0, 159, 227, 0.35);
  outline-offset: 1px;
  border-color: var(--cs-brand);
}

.app-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  border: 1px solid transparent;
  padding: 0.55rem 1rem;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: background-color 140ms ease, border-color 140ms ease, color 140ms ease;
}

.app-btn--primary {
  background: var(--cs-brand); color: var(--cs-on-brand);
}

.app-btn--primary:hover {
  background: var(--cs-brand-dark);
}

.app-btn--secondary {
  background: var(--cs-surface);
  border-color: var(--cs-border);
  color: var(--cs-text-secondary);
}

.app-btn--secondary:hover {
  border-color: var(--cs-border-hover);
  color: var(--cs-text);
}

.app-btn--ghost {
  background: transparent;
  color: var(--cs-text-secondary);
}

.app-btn--ghost:hover {
  color: var(--cs-text);
}

.app-btn--danger {
  background: transparent;
  color: var(--cs-danger);
}

.org-danger {
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--cs-border);
}

.org-danger__title {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--cs-danger);
  margin: 0 0 0.35rem;
}

.org-danger__hint {
  font-size: 0.8125rem;
  color: var(--cs-text-secondary);
  margin: 0 0 0.75rem;
  max-width: 36rem;
}

.app-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.app-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: rgba(29, 29, 31, 0.4);
  padding: 1rem;
}

.app-modal {
  position: relative;
  z-index: 10;
  box-sizing: border-box;
  width: 100%;
  max-width: 28rem;
  max-height: 90vh;
  overflow-y: auto;
  border-radius: 16px;
  background: var(--cs-surface);
  border: 1px solid var(--cs-border);
  box-shadow: 0 12px 40px var(--cs-shadow-thumb);
  padding: 1.25rem 1.35rem;
}

.app-modal__title {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--cs-text);
}

.app-more-toggle {
  margin-top: 0.25rem;
  border: 0;
  background: transparent;
  padding: 0;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--cs-brand-dark);
  cursor: pointer;
}

.app-more-toggle:hover {
  color: var(--cs-brand);
}

.app-table-wrap {
  overflow: hidden;
  border-radius: 16px;
  background: var(--cs-surface);
  border: 1px solid var(--cs-border);
  box-shadow: 0 1px 2px var(--cs-shadow-subtle);
}

.app-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.875rem;
}

.app-table th {
  padding: 0.85rem 1rem;
  font-weight: 500;
  color: var(--cs-text-secondary);
  background: var(--cs-surface-elevated);
  border-bottom: 1px solid var(--cs-border);
}

.app-table td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--cs-border-subtle);
  color: var(--cs-text);
  vertical-align: middle;
}

.app-table tr:last-child td {
  border-bottom: 0;
}

.app-login {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: var(--cs-bg);
}

.app-login__card {
  box-sizing: border-box;
  width: 100%;
  max-width: 26rem;
  border-radius: 16px;
  background: var(--cs-surface);
  border: 1px solid var(--cs-border);
  box-shadow: 0 1px 2px var(--cs-shadow);
  padding: 2rem 1.75rem;
}

.app-login__brand {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--cs-brand-dark);
}

.app-login__product {
  margin: 0.25rem 0 0;
  font-size: 1rem;
  color: var(--cs-text-secondary);
}

.app-login__welcome {
  margin: 1.5rem 0 0;
  font-size: 0.875rem;
  color: var(--cs-text-muted);
}

.app-shell {
  min-height: 100vh;
}

.app-shell__aside {
  box-sizing: border-box;
  background: var(--cs-surface);
  border-bottom: 1px solid var(--cs-border);
  padding: 1.25rem 1rem;
}

.app-shell__brand {
  margin: 0 0 1.5rem;
}

.app-shell__brand-name {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--cs-brand-dark);
}

.app-shell__brand-sub {
  margin: 0.15rem 0 0;
  font-size: 0.75rem;
  color: var(--cs-text-muted);
}

.app-shell__nav {
  display: flex;
  gap: 0.25rem;
  overflow-x: auto;
}

.app-shell__group {
  display: contents;
}

.app-shell__rule {
  display: none;
  flex-shrink: 0;
  width: auto;
  height: 0;
  margin: 0.85rem 0.75rem 0.15rem;
  border: 0;
  border-top: 1px solid var(--cs-border);
}

.app-shell__section {
  display: none;
  margin: 0 0.75rem 0.2rem;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--cs-text-muted);
  pointer-events: none;
}

.app-shell__link {
  white-space: nowrap;
  border-radius: 12px;
  padding: 0.55rem 0.75rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--cs-text-secondary);
  text-decoration: none;
}

.app-shell__link:hover {
  background: var(--cs-surface-muted);
  color: var(--cs-text);
}

.app-shell__link--active {
  background: var(--cs-active-bg);
  color: var(--cs-brand-dark);
}

.app-shell__link--pinned-view {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

.app-shell__footer {
  display: none;
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid var(--cs-border);
}

.app-shell__user {
  margin: 0;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--cs-text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-shell__main {
  padding: 1.25rem 1rem 2rem;
}

.dashboard-task-row__assignee {
  font-weight: 600;
  color: var(--cs-text);
}

@media (min-width: 640px) {
  .app-shell__main {
    padding: 1.5rem 1.5rem 2.5rem;
  }

  .app-modal-backdrop {
    align-items: center;
  }
}

@media (min-width: 1024px) {
  .app-shell {
    display: grid;
    grid-template-columns: 240px minmax(0, 1fr);
  }

  .app-shell__aside {
    border-bottom: 0;
    border-right: 1px solid var(--cs-border);
    padding: 1.5rem 1rem;
    overflow-x: hidden;
  }

  .app-shell__nav {
    flex-direction: column;
    overflow: visible;
    gap: 0;
  }

  .app-shell__group {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
  }

  .app-shell__rule {
    display: block;
  }

  .app-shell__section {
    display: block;
  }

  .app-shell__group:first-child .app-shell__section {
    margin-top: 0;
  }

  .app-shell__link {
    white-space: normal;
  }

  .app-shell__link--pinned-view {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .app-shell__footer {
    display: block;
  }

  .app-shell__main {
    padding: 1.75rem 2rem 3rem;
  }

  .app-page-title {
    font-size: 2.125rem;
  }

  .app-detail {
    grid-template-columns: minmax(0, 1fr) 300px;
    align-items: start;
  }
}

/* Task chat / files (additive; does not change Home dashboard rules) */
.app-unread-badge {
  display: inline-flex;
  min-width: 1.25rem;
  height: 1.25rem;
  align-items: center;
  justify-content: center;
  padding: 0 0.35rem;
  border-radius: 999px;
  background: var(--cs-brand);
  color: var(--cs-on-brand);
  font-size: 0.7rem;
  font-weight: 700;
  line-height: 1;
}

.task-chat-indicator {
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  gap: 0.2rem;
  max-height: 1.5rem;
  padding: 0.15rem 0.35rem;
  border-radius: 999px;
  border: 1px solid var(--cs-border);
  background: var(--cs-surface-muted);
  color: var(--cs-text-tertiary);
  text-decoration: none;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
}

.task-chat-indicator:hover {
  border-color: var(--cs-border-hover);
  color: var(--cs-text);
}

.task-chat-indicator__icon {
  display: block;
  width: 0.875rem;
  height: 0.875rem;
  flex-shrink: 0;
}

.task-chat-indicator__total {
  color: inherit;
}

.task-chat-indicator__unread {
  display: inline-flex;
  min-width: 1.1rem;
  height: 1.1rem;
  align-items: center;
  justify-content: center;
  margin-left: 0.1rem;
  padding: 0 0.28rem;
  border-radius: 999px;
  background: var(--cs-brand);
  color: var(--cs-on-brand);
  font-size: 0.65rem;
  font-weight: 700;
}

.task-chat-indicator--unread {
  border-color: rgba(0, 159, 227, 0.35);
  background: rgba(0, 159, 227, 0.08);
  color: var(--cs-brand-dark);
}

.task-chat-indicator--inline {
  position: relative;
  z-index: 1;
  max-height: none;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font-size: inherit;
  font-weight: 500;
  gap: 0.25rem;
}

.task-chat-indicator--inline:hover,
.task-chat-indicator--inline:focus-visible {
  background: transparent;
  color: var(--cs-brand-dark);
  outline: 2px solid var(--cs-brand);
  outline-offset: 2px;
  border-radius: 6px;
}

.task-chat-indicator--inline.task-chat-indicator--unread {
  border: 0;
  background: transparent;
  color: var(--cs-brand-dark);
  font-weight: 600;
}

.task-chat-indicator--inline .task-chat-indicator__unread {
  display: none;
}

.app-filter-tab .app-unread-badge {
  margin-left: 0.35rem;
}

.app-detail__section--flush {
  padding-left: 0;
  padding-right: 0;
}

.app-chat {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  min-height: 360px;
}

.app-chat__thread {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-height: min(55vh, 520px);
  overflow-y: auto;
  padding: 0.25rem 0.15rem;
}

.app-chat__system {
  align-self: center;
  max-width: 92%;
  text-align: center;
  padding: 0.45rem 0.85rem;
  border-radius: 999px;
  background: var(--cs-surface-muted);
  color: var(--cs-text-tertiary);
  font-size: 0.8125rem;
}

.app-chat__system time {
  display: block;
  margin-top: 0.15rem;
  font-size: 0.7rem;
  color: #8e8e93;
}

.app-chat__bubble {
  display: flex;
  gap: 0.65rem;
  align-items: flex-start;
  max-width: 92%;
}

.app-chat__bubble--mine {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.app-chat__bubble-body {
  background: var(--cs-surface);
  border: 1px solid var(--cs-border);
  border-radius: 14px;
  padding: 0.55rem 0.75rem;
  box-shadow: 0 1px 2px var(--cs-shadow);
}

.app-chat__bubble--mine .app-chat__bubble-body {
  background: rgba(0, 159, 227, 0.08);
  border-color: rgba(0, 159, 227, 0.2);
}

.app-chat__bubble-meta {
  display: flex;
  gap: 0.5rem;
  align-items: baseline;
  margin-bottom: 0.2rem;
}

.app-chat__sender {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--cs-text);
}

.app-chat__bubble-meta time {
  font-size: 0.7rem;
  color: #8e8e93;
}

.app-chat__text {
  font-size: 0.9375rem;
  color: var(--cs-text);
  white-space: pre-wrap;
  word-break: break-word;
}

.app-chat__composer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.65rem;
  align-items: end;
}

.app-chat__input {
  min-height: 2.75rem;
  resize: vertical;
}

.app-chat__mentions {
  list-style: none;
  margin: 0;
  padding: 0.35rem;
  border: 1px solid var(--cs-border);
  border-radius: 12px;
  background: var(--cs-surface);
}

.app-chat__mention {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.5rem;
  border: 0;
  border-radius: 8px;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.app-chat__mention:hover {
  background: var(--cs-surface-muted);
}

.app-files__drop {
  border: 1px dashed var(--cs-border-hover);
  border-radius: 14px;
  background: var(--cs-surface-elevated);
  padding: 1rem 1.1rem;
}

.app-files__drop--active {
  border-color: var(--cs-brand);
  background: rgba(0, 159, 227, 0.06);
}

.app-files__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.app-files__item {
  border: 1px solid var(--cs-border);
  border-radius: 12px;
  background: var(--cs-surface);
}

.app-files__open {
  display: flex;
  width: 100%;
  gap: 0.75rem;
  align-items: center;
  padding: 0.65rem 0.75rem;
  border: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.app-files__thumb,
.app-files__type {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  object-fit: cover;
  flex-shrink: 0;
}

.app-files__type {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--cs-bg);
  color: var(--cs-brand-dark);
  font-size: 0.7rem;
  font-weight: 700;
}

.app-files__meta {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 0.15rem;
}

.app-files__name {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--cs-text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-files__sub {
  font-size: 0.75rem;
  color: var(--cs-text-tertiary);
}

.task-detail-images {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 1rem;
}

.task-detail-images__management {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-top: 1rem;
}

.task-detail-images__management > .app-btn {
  min-height: 44px;
  min-width: 44px;
}

.task-detail-images__item {
  display: flex;
  min-width: 0;
  max-width: 100%;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.4rem;
}

.task-detail-images__remove {
  min-height: 44px;
  min-width: 44px;
  max-width: 100%;
}

.task-detail-images__btn {
  min-height: 44px;
  min-width: 44px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  border-radius: 12px;
  overflow: hidden;
  max-width: min(280px, 100%);
}

.task-detail-images__img {
  display: block;
  width: auto;
  height: auto;
  max-width: min(280px, 100%);
  max-height: 220px;
  object-fit: contain;
  object-position: center;
}

.task-detail-images__loading,
.task-detail-images__fallback {
  display: grid;
  place-items: center;
  width: 160px;
  height: 120px;
  max-width: min(280px, 100%);
  max-height: 220px;
  border-radius: 12px;
  background: color-mix(in srgb, var(--brand, var(--cs-brand)) 12%, transparent);
  color: var(--brand-dark, var(--cs-brand-dark));
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.5rem;
  text-align: center;
  overflow: hidden;
}

.app-lightbox {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  grid-template-rows: auto 1fr;
  align-items: stretch;
  justify-items: center;
  box-sizing: border-box;
  background: rgba(0, 0, 0, 0.92);
  padding:
    max(0.75rem, env(safe-area-inset-top))
    max(0.75rem, env(safe-area-inset-right))
    max(0.75rem, env(safe-area-inset-bottom))
    max(0.75rem, env(safe-area-inset-left));
}

.app-lightbox__img {
  display: block;
  width: auto;
  height: auto;
  max-width: min(100%, calc(100vw - 1.5rem));
  max-height: min(100%, calc(100dvh - 5rem));
  object-fit: contain;
  object-position: center;
  border-radius: 8px;
  background: transparent;
  margin: auto;
}

.app-lightbox__close {
  position: absolute;
  top: max(0.75rem, env(safe-area-inset-top));
  right: max(0.75rem, env(safe-area-inset-right));
  z-index: 2;
}


/* chat media v2 */
.app-chat__thread--drag {
  outline: 2px dashed var(--brand, var(--cs-brand));
  outline-offset: -4px;
}
.app-chat__images {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 6px 0;
}
.app-chat__image-btn {
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  border-radius: 14px;
  overflow: hidden;
  max-width: min(260px, 70vw);
}
.app-chat__image {
  display: block;
  width: 100%;
  max-height: 280px;
  object-fit: cover;
  border-radius: 14px;
}
.app-chat__image-loading,
.app-chat__image-fallback {
  display: block;
  width: 160px;
  height: 120px;
  border-radius: 14px;
  background: color-mix(in srgb, var(--brand, var(--cs-brand)) 12%, transparent);
}
.app-chat__image-fallback {
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 600;
  color: var(--brand-dark, var(--cs-brand-dark));
}
.app-chat__file-card {
  display: flex;
  gap: 10px;
  align-items: center;
  width: 100%;
  max-width: 280px;
  margin: 6px 0;
  padding: 10px 12px;
  border: 1px solid color-mix(in srgb, var(--border, #d0d7de) 80%, transparent);
  border-radius: 12px;
  background: var(--surface, #fff);
  text-align: left;
  cursor: pointer;
}
.app-chat__file-type {
  flex: 0 0 auto;
  font-size: 11px;
  font-weight: 700;
  color: var(--brand-dark, var(--cs-brand-dark));
  background: color-mix(in srgb, var(--brand, var(--cs-brand)) 14%, transparent);
  border-radius: 8px;
  padding: 6px 8px;
}
.app-chat__file-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.app-chat__file-name {
  font-size: 13px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.app-chat__file-sub {
  font-size: 11px;
  color: var(--text-secondary, #667085);
}
.app-chat__pending {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  list-style: none;
  margin: 0;
  padding: 8px 0 0;
}
.app-chat__pending-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 10px;
  background: color-mix(in srgb, var(--brand, var(--cs-brand)) 8%, transparent);
  max-width: 220px;
}
.app-chat__pending-thumb {
  width: 36px;
  height: 36px;
  object-fit: cover;
  border-radius: 8px;
}
.app-chat__pending-doc {
  font-size: 10px;
  font-weight: 700;
  color: var(--brand-dark, var(--cs-brand-dark));
}
.app-chat__pending-name {
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.app-chat__pending-remove {
  border: 0;
  background: transparent;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
}
.app-chat__composer {
  display: flex;
  align-items: flex-end;
  gap: 8px;
}
.app-chat__attach {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.app-chat__attach-btn {
  width: 36px;
  height: 36px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--brand, var(--cs-brand)) 35%, transparent);
  background: color-mix(in srgb, var(--brand, var(--cs-brand)) 10%, transparent);
  color: var(--brand-dark, var(--cs-brand-dark));
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}
.app-chat__attach-photo {
  border: 0;
  background: transparent;
  color: var(--brand-dark, var(--cs-brand-dark));
  font-size: 11px;
  cursor: pointer;
  padding: 0 2px;
}
.app-chat__input {
  flex: 1;
}


/* escalation v1 */
.escalation-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.01em;
  color: #8a0030;
  background: color-mix(in srgb, var(--cs-escalation) 12%, white);
  border: 1px solid color-mix(in srgb, var(--cs-escalation) 28%, transparent);
  white-space: nowrap;
}
.escalation-badge__level {
  min-width: 1.1rem;
  height: 1.1rem;
  padding: 0 4px;
  border-radius: 999px;
  display: inline-grid;
  place-items: center;
  background: var(--cs-escalation);
  color: var(--cs-on-brand);
  font-size: 10px;
  font-weight: 700;
}
.escalation-overdue {
  color: var(--cs-escalation);
  font-weight: 600;
}
.app-escalation__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.app-escalation__facts {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}
.app-escalation__facts dt {
  font-size: 11px;
  color: var(--text-secondary, #667085);
}
.app-escalation__facts dd {
  font-size: 13px;
  font-weight: 600;
}
.app-escalation__events {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
  display: grid;
  gap: 8px;
}
.app-escalation__events li {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 10px;
  border-radius: 10px;
  background: color-mix(in srgb, var(--cs-escalation) 6%, white);
  font-size: 13px;
}
.app-escalation__event-meta {
  font-size: 11px;
  color: var(--text-secondary, #667085);
  font-weight: 500;
}
.app-escalation__mode {
  display: grid;
  gap: 4px;
}
.app-escalation__preview-list {
  margin: 8px 0 0;
  padding-left: 1.25rem;
  display: grid;
  gap: 6px;
  font-size: 13px;
  color: var(--text, #101828);
}
.app-escalation__preview-list li.is-applied {
  color: var(--text-secondary, #667085);
}
.app-escalation__preview-applied {
  display: block;
  font-size: 11px;
  color: var(--text-secondary, #667085);
}
.admin-escalation__use-default {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
}
.admin-escalation__levels {
  display: grid;
  gap: 14px;
}
.admin-escalation__card {
  border: 1px solid var(--border, #e4e7ec);
  border-radius: 14px;
  padding: 14px 16px;
  background: color-mix(in srgb, var(--brand, var(--cs-brand)) 4%, white);
}
.admin-escalation__card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.admin-escalation__card-head h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
}
.admin-escalation__card-actions {
  display: flex;
  gap: 4px;
}
.admin-escalation__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  font-size: 13px;
  font-weight: 600;
}
.admin-escalation__delay {
  display: flex;
  gap: 8px;
  min-width: 0;
}
.admin-escalation__delay .app-field__control {
  width: auto;
  min-width: 5rem;
}
.admin-escalation__fieldset {
  border: 0;
  margin: 10px 0 0;
  padding: 0;
  display: grid;
  gap: 6px;
}
.admin-escalation__fieldset legend {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-secondary, #667085);
  margin-bottom: 4px;
}
.admin-escalation__check {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 500;
}
.app-notification-bell {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.app-notifications__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
}
.app-notifications__item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--cs-border);
  border-radius: 12px;
  background: var(--cs-surface);
  color: var(--cs-text);
}
.app-notifications__item.is-unread {
  border-color: color-mix(in srgb, var(--cs-brand) 35%, var(--cs-border));
  background: color-mix(in srgb, var(--cs-brand) 6%, var(--cs-surface));
}
.app-notifications__link {
  display: grid;
  gap: 4px;
  text-align: left;
  flex: 1;
  min-width: 0;
  color: inherit;
  text-decoration: none;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}
.app-notifications__title {
  font-size: 14px;
  font-weight: 700;
}
.app-notifications__body {
  font-size: 13px;
  color: var(--cs-text-secondary);
}
.app-notifications__meta {
  font-size: 11px;
  color: var(--cs-text-secondary);
}
.app-child-section {
  display: grid;
  gap: 10px;
}
.app-child-section__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}
.app-child-progress {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary, #667085);
}
.app-progress-bar {
  height: 6px;
  border-radius: 999px;
  background: #eef2f6;
  overflow: hidden;
}
.app-progress-bar > span {
  display: block;
  height: 100%;
  background: var(--brand, var(--cs-brand));
}
.app-child-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}
.app-child-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid var(--border, #e4e7ec);
  border-radius: 12px;
  background: white;
}
.app-child-row.is-done .app-child-row__title,
.app-child-row.is-done .app-child-row__input {
  text-decoration: line-through;
  color: var(--text-secondary, #667085);
}
.app-child-check {
  margin-top: 4px;
}
.app-child-row__body {
  flex: 1;
  min-width: 0;
  display: grid;
  gap: 6px;
}
.app-child-row__title {
  border: 0;
  background: none;
  padding: 0;
  text-align: left;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  color: inherit;
}
.app-child-row__input {
  flex: 1;
}
.app-child-row__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.app-child-row__actions {
  display: flex;
  gap: 2px;
}
.app-field__control--compact {
  min-width: 0;
  width: auto;
  font-size: 12px;
  padding: 4px 8px;
}
.app-child-add {
  display: flex;
  gap: 8px;
}
.app-subtask-pill {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--brand-dark, #0077a8);
  background: color-mix(in srgb, var(--brand, var(--cs-brand)) 12%, white);
  border-radius: 999px;
  padding: 2px 8px;
}

/* Task search / filters / views */
.tasks-browser__layout {
  display: grid;
  grid-template-columns: minmax(180px, 220px) minmax(0, 1fr);
  gap: 0.875rem;
  align-items: start;
}
.tasks-browser__main {
  min-width: 0;
}
.tasks-browser__stack {
  display: flex;
  flex-direction: column;
  gap: 0.875rem;
}
.tasks-browser__sidebar {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  position: sticky;
  top: 0.5rem;
}
.tasks-browser__card--toolbar {
  padding: 0.85rem 1.1rem;
}
.tasks-browser__content {
  padding: 0.75rem 1.1rem 1rem;
}
.tasks-browser__content .app-empty {
  margin: 0;
}
.tasks-browser__content .app-task-list {
  margin: 0;
}
.tasks-browser__follow-up-group {
  margin: 0 0 0.85rem;
}
.tasks-browser__follow-up-group:last-child {
  margin-bottom: 0;
}
.tasks-browser__follow-up-group-title {
  margin: 0 0 0.45rem;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--cs-text-tertiary);
}
.tasks-browser__more {
  margin-top: 0.75rem;
}
.tasks-browser__sidebar-label {
  margin: 0.75rem 0 0.25rem;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--cs-text-tertiary);
}
.tasks-browser__sidebar-label:first-child {
  margin-top: 0;
}
.tasks-browser__view-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.tasks-browser__view-btn {
  appearance: none;
  border: 0;
  background: transparent;
  text-align: left;
  padding: 0.45rem 0.6rem;
  border-radius: 8px;
  font-size: 0.875rem;
  color: var(--cs-text);
  cursor: pointer;
}
.tasks-browser__view-btn:hover {
  background: #ececef;
}
.tasks-browser__view-btn.is-active {
  background: color-mix(in srgb, var(--cs-brand) 14%, white);
  color: var(--cs-brand-dark);
  font-weight: 600;
}
.tasks-browser__saved-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 2px;
  align-items: center;
}
.tasks-browser__saved-row .tasks-browser__view-btn {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}
.tasks-browser__saved-actions {
  display: flex;
  gap: 0;
}
.tasks-browser__saved-actions button {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--cs-text-tertiary);
  cursor: pointer;
  padding: 0.25rem 0.35rem;
  font-size: 0.8rem;
}
.tasks-browser__saved-actions button.is-pinned {
  color: var(--cs-brand-dark);
}
.tasks-browser__empty-hint {
  margin: 0;
  font-size: 0.8125rem;
  color: var(--cs-text-tertiary);
  padding: 0.35rem 0.6rem;
}
.tasks-browser__save-form {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-top: 0.75rem;
}
.tasks-browser__save-form input,
.tasks-browser__search,
.tasks-browser__filters select,
.tasks-browser__sort select,
.tasks-browser__builtin-select select {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid var(--cs-border-hover);
  border-radius: 8px;
  padding: 0.5rem 0.65rem;
  font-size: 0.875rem;
  background: var(--cs-surface);
  color: var(--cs-text);
}
.tasks-browser__builtin-select {
  display: block;
  margin: 0 0 0.35rem;
}
.tasks-browser__toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}
.tasks-browser__search {
  flex: 1 1 220px;
  min-width: 160px;
}
.tasks-browser__sort {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.8125rem;
  color: var(--cs-text-secondary);
}
.tasks-browser__sort select {
  width: auto;
  min-width: 140px;
}
.tasks-browser__filters {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 0.75rem;
  padding: 0;
  margin: 0;
  background: transparent;
  border: 0;
  border-radius: 0;
}
.tasks-browser__filters label {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--cs-text-secondary);
}
.tasks-browser__priority-set {
  border: 0;
  margin: 0;
  padding: 0;
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 0.85rem;
}
.tasks-browser__priority-set legend {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--cs-text-secondary);
  margin-bottom: 0.25rem;
}
.tasks-browser__check {
  display: inline-flex !important;
  flex-direction: row !important;
  align-items: center;
  gap: 0.4rem !important;
  font-weight: 500 !important;
  font-size: 0.8125rem !important;
}
.tasks-browser__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.65rem;
}
.tasks-browser__chip {
  font-size: 0.75rem;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  background: #ececef;
  color: var(--cs-text);
}
.tasks-browser__due-range {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.65rem;
  align-items: end;
}
.tasks-browser__range-error {
  grid-column: 1 / -1;
  margin: 0;
  font-size: 0.8125rem;
  font-weight: 500;
  color: #c2410c;
}
.app-btn.is-active {
  border-color: var(--cs-brand);
  color: var(--cs-brand-dark);
}
@media (max-width: 860px) {
  .tasks-browser__layout {
    grid-template-columns: 1fr;
  }
  .tasks-browser__sidebar {
    position: static;
  }
  .tasks-browser__view-list {
    flex-direction: row;
    flex-wrap: wrap;
  }
}

/* Projects & Areas */
.app-page-header--row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.projects-toolbar {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}
.projects-toolbar .app-field__control {
  min-width: 12rem;
  flex: 1;
}
.projects-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.projects-list > li {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--cs-surface);
  border: 1px solid var(--cs-border);
  border-radius: 12px;
  padding: 0.35rem 0.5rem 0.35rem 0;
}
.projects-list__item {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.65rem 1rem;
  text-decoration: none;
  color: inherit;
  min-width: 0;
}
.projects-list__name {
  margin: 0;
  font-weight: 600;
  color: var(--cs-text);
}
.projects-list__meta {
  margin: 0.15rem 0 0;
  font-size: 0.8125rem;
  color: var(--cs-text-secondary);
}
.projects-status {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
  background: #ececef;
  white-space: nowrap;
}
.projects-status--active { background: #e8f6ee; color: #1f8a4c; }
.projects-status--completed { background: #e8f1f8; color: var(--cs-brand-dark); }
.projects-status--archived { background: var(--cs-border-subtle); color: #6b6b70; }
.projects-dates {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}
.project-detail__nav {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0.5rem;
}
.project-detail__desc {
  margin: 0 0 1rem;
  color: var(--cs-text-secondary);
  white-space: pre-wrap;
}
.project-detail__stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
  margin: 1rem 0;
}
.project-detail__stat-value {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--cs-text);
}
.project-detail__stat-label {
  margin: 0.15rem 0 0;
  font-size: 0.75rem;
  color: var(--cs-text-secondary);
}
.project-detail__progress {
  margin: 0.5rem 0 0.35rem;
  font-size: 0.875rem;
  font-weight: 500;
}
.project-detail__bar {
  height: 8px;
  border-radius: 999px;
  background: var(--cs-border);
  overflow: hidden;
}
.project-detail__bar > span {
  display: block;
  height: 100%;
  background: var(--cs-brand);
  border-radius: 999px;
}
.project-members {
  list-style: none;
  margin: 0;
  padding: 0;
}
.project-members li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.35rem 0;
  border-bottom: 1px solid var(--cs-border-subtle);
  font-size: 0.875rem;
}
@media (max-width: 640px) {
  .project-detail__stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .projects-dates {
    grid-template-columns: 1fr;
  }
}

.dashboard-home {
  min-width: 0;
  overflow-x: hidden;
}

.dashboard-empty {
  margin-top: 0.75rem;
  padding: 1.25rem 1rem;
  border-radius: 16px;
  border: 1px solid var(--cs-border);
  background: var(--cs-surface);
  color: var(--cs-text-secondary);
  font-size: 0.9375rem;
}

.dashboard-empty p {
  margin: 0;
}

.dashboard-empty__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.dashboard-empty-note {
  margin: 0.75rem 0 0;
  font-size: 0.8125rem;
  color: var(--cs-text-tertiary);
}

.dashboard-task-row {
  position: relative;
}

.dashboard-task-row > :not(.dashboard-task-row__hit):not(.dashboard-task-row__quick):not(.dashboard-task-row__status) {
  pointer-events: none;
}

.dashboard-task-row .task-chat-indicator,
.dashboard-task-row .task-attachment-indicator,
.dashboard-task-row__status,
.dashboard-task-row__quick,
.dashboard-task-row__quick * {
  pointer-events: auto;
}

.dashboard-task-row--overdue:not(.dashboard-task-row--escalated) {
  box-shadow: inset 3px 0 0 var(--cs-danger);
}

.dashboard-task-row--today:not(.dashboard-task-row--overdue):not(.dashboard-task-row--escalated) {
  box-shadow: inset 3px 0 0 #7aa7c2;
}

.dashboard-task-row--escalated {
  box-shadow: inset 3px 0 0 #9a3d5c;
}

.dashboard-task-row--unclaimed {
  background: var(--cs-surface-elevated);
}

.dashboard-task-row__meta--today {
  color: var(--cs-brand-dark);
  font-weight: 500;
}

.dashboard-task-row__meta--unclaimed,
.dashboard-task-row__meta--claimed {
  font-weight: 500;
}

.dashboard-task-row__quick {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  gap: 0.35rem;
  position: relative;
  z-index: 1;
}

.dashboard-task-row__quick-btn {
  border: 1px solid var(--cs-border);
  background: var(--cs-surface-muted);
  color: var(--cs-text);
  border-radius: 999px;
  padding: 0.2rem 0.55rem;
  font-size: 0.6875rem;
  font-weight: 600;
  line-height: 1.3;
  cursor: pointer;
}

.dashboard-task-row__quick-btn:hover,
.dashboard-task-row__quick-btn:focus-visible {
  border-color: var(--cs-border-hover);
  background: var(--cs-surface);
  outline: 2px solid var(--cs-brand);
  outline-offset: 1px;
}

.dashboard-task-row__quick-btn--icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  padding: 0;
  color: var(--cs-escalation);
}

.dashboard-task-row__quick-btn--icon svg {
  display: block;
}

.dashboard-task-row__secondary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.5rem;
  min-width: 0;
}

.dashboard-task-row__secondary .dashboard-task-row__meta {
  margin-top: 0.25rem;
}

.dashboard-task-row__tags {
  display: inline-flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.35rem;
  min-width: 0;
  max-width: 100%;
  margin: 0;
  padding: 0;
  list-style: none;
  overflow: hidden;
}

.dashboard-task-row--compact .dashboard-task-row__secondary .dashboard-task-row__status {
  flex-shrink: 0;
  height: 24px;
  gap: 6px;
}

.dashboard-task-row--compact .dashboard-task-row__secondary .dashboard-task-row__status-badge {
  height: 24px;
  min-width: 24px;
}

.dashboard-task-row--compact .dashboard-task-row__secondary .dashboard-task-row__status-badge--icon {
  width: 24px;
}

.dashboard-task-row--compact .dashboard-task-row__secondary .dashboard-task-row__status-badge svg {
  width: 14px;
  height: 14px;
}

.dashboard-task-row__menu-wrap {
  position: relative;
}

.dashboard-task-row__menu {
  min-width: 12rem;
  max-width: min(16rem, calc(100vw - 16px));
  max-height: min(24rem, calc(100vh - 16px));
  overflow-x: hidden;
  overflow-y: auto;
  padding: 0.35rem;
  border-radius: 12px;
  border: 1px solid var(--cs-border);
  background: var(--cs-surface);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

.dashboard-task-row__menu--portal {
  position: fixed;
  z-index: 70;
}

.dashboard-task-row__menu button,
.dashboard-task-row__menu-link {
  display: block;
  width: 100%;
  box-sizing: border-box;
  text-align: left;
  border: 0;
  background: transparent;
  color: var(--cs-text);
  padding: 0.4rem 0.55rem;
  border-radius: 8px;
  font-size: 0.8125rem;
  text-decoration: none;
  cursor: pointer;
}

.dashboard-task-row__menu button:hover,
.dashboard-task-row__menu-link:hover,
.dashboard-task-row__menu button:focus-visible,
.dashboard-task-row__menu-link:focus-visible {
  background: var(--cs-surface-muted);
}

.dashboard-task-row__menu-label {
  margin: 0.35rem 0.55rem 0.15rem;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--cs-text-tertiary);
}

.dashboard-task-row__menu-danger {
  color: var(--cs-escalation);
}

@media (hover: hover) and (pointer: fine) {
  .dashboard-task-row__quick {
    opacity: 0;
  }
  .dashboard-task-row:hover .dashboard-task-row__quick,
  .dashboard-task-row:focus-within .dashboard-task-row__quick {
    opacity: 1;
  }
}

.due-shortcuts {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.5rem;
}

.due-shortcuts__btn {
  border: 1px solid var(--cs-border);
  background: var(--cs-surface-muted);
  color: var(--cs-text);
  border-radius: 999px;
  padding: 0.25rem 0.65rem;
  font-size: 0.75rem;
  font-weight: 500;
  cursor: pointer;
}

.due-shortcuts__btn:hover,
.due-shortcuts__btn:focus-visible {
  border-color: var(--cs-brand);
  color: var(--cs-brand-dark);
  outline: 2px solid var(--cs-brand);
  outline-offset: 1px;
}

@media (max-width: 640px) {
  .dashboard-header__action {
    width: 100%;
  }
  .dashboard-task-row {
    flex-wrap: wrap;
  }
  .dashboard-task-row__status {
    width: 100%;
    justify-content: flex-start;
    padding-left: 2.5rem;
    flex-wrap: nowrap;
  }
  .dashboard-task-row--compact {
    flex-wrap: nowrap;
    align-items: center;
  }
  .dashboard-task-row--compact .dashboard-task-row__status {
    width: auto;
    padding-left: 0;
    justify-content: flex-end;
  }
  .dashboard-task-row--compact .dashboard-task-row__secondary {
    flex-wrap: wrap;
    align-items: center;
  }
  .dashboard-task-row--compact .dashboard-task-row__meta {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
  }
  .dashboard-task-row__tags {
    flex-wrap: wrap;
    overflow: visible;
    max-width: none;
  }
  .dashboard-task-row__tags li,
  .dashboard-task-row__tags li > span {
    flex-shrink: 0;
    max-width: none;
  }
  .dashboard-task-row__tags .truncate {
    overflow: visible;
    text-overflow: clip;
    white-space: nowrap;
  }
  .dashboard-task-row [data-testid="task-card-tags"] {
    overflow: visible;
    max-width: none;
  }
  .dashboard-task-row [data-testid="task-card-tags"] li,
  .dashboard-task-row [data-testid="task-card-tags"] li > span {
    flex-shrink: 0;
    max-width: none;
  }
  .dashboard-task-row [data-testid="task-card-tags"] .truncate {
    overflow: visible;
    text-overflow: clip;
    white-space: nowrap;
  }
  .dashboard-task-row__quick {
    display: none;
  }
  .dashboard-task-row__title {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    white-space: normal;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1 1 auto;
    min-width: 0;
  }
  .dashboard-task-row__title-line {
    flex: 1 1 auto;
    min-width: 0;
  }
}

/* —— Settings page redesign —— */

.settings-page {
  max-width: 720px;
}

.settings-stack {
  display: flex;
  flex-direction: column;
  gap: 0.875rem;
}

.settings-card {
  box-sizing: border-box;
  border-radius: 16px;
  background: var(--cs-surface);
  border: 1px solid var(--cs-border);
  box-shadow: 0 1px 2px var(--cs-shadow-subtle);
  padding: 1.1rem 1.25rem;
}

.tasks-browser__sidebar.settings-card {
  padding: 1rem 1.1rem;
}

.settings-card.tasks-browser__card--toolbar {
  padding: 0.85rem 1.1rem;
}

.settings-card.tasks-browser__content {
  padding: 0.75rem 1.1rem 1rem;
}

.settings-card.tasks-browser__filters {
  padding: 0.85rem 1.1rem;
}

.settings-card--action {
  padding: 0.9rem 1.25rem;
}

.settings-card__head {
  margin-bottom: 0.85rem;
}

.settings-card__title {
  margin: 0;
  font-size: 0.9375rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--cs-text);
  line-height: 1.3;
}

.settings-card__label {
  margin: 0 0 0.2rem;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--cs-text-muted);
}

.settings-card__help {
  margin: 0.3rem 0 0;
  font-size: 0.8125rem;
  line-height: 1.45;
  color: var(--cs-text-secondary);
}

.settings-muted {
  margin: 0;
  font-size: 0.8125rem;
  color: var(--cs-text-muted);
}

.settings-error {
  margin: 0.5rem 0 0;
  font-size: 0.8125rem;
  color: var(--cs-danger);
}

.settings-success {
  margin: 0.5rem 0 0;
  font-size: 0.8125rem;
  color: var(--cs-brand-dark);
}

.settings-account {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem 1.5rem;
}

.settings-account__identity {
  min-width: 0;
  flex: 1 1 14rem;
}

.settings-account__name {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  color: var(--cs-text);
  line-height: 1.3;
}

.settings-account__email {
  margin: 0.2rem 0 0;
  font-size: 0.8125rem;
  color: var(--cs-text-secondary);
  word-break: break-word;
}

.settings-account__org {
  flex: 0 1 auto;
  min-width: 8rem;
  text-align: left;
}

.settings-account__org-name {
  margin: 0;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--cs-text);
}

.settings-tags__toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 0.75rem;
  margin-bottom: 0.65rem;
}

.settings-tags__toolbar .settings-card__help {
  margin: 0;
  flex: 1 1 12rem;
}

.settings-tags__create {
  flex-shrink: 0;
  padding: 0.4rem 0.85rem;
  font-size: 0.8125rem;
}

.settings-tags__empty {
  padding: 1.25rem 0.5rem;
  text-align: center;
  color: var(--cs-text-secondary);
  font-size: 0.875rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}

.settings-tags__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.settings-tags__row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem 0.75rem;
  padding: 0.4rem 0.55rem;
  border-radius: 10px;
  border: 1px solid var(--cs-border);
  background: var(--cs-surface-elevated);
}

.settings-tags__actions {
  display: flex;
  align-items: center;
  gap: 0.15rem;
  margin-left: auto;
}

.settings-tags__action {
  padding: 0.3rem 0.55rem;
  font-size: 0.75rem;
  font-weight: 500;
}

.settings-readonly-row {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 0.5rem;
}

.settings-readonly-input {
  box-sizing: border-box;
  flex: 1 1 14rem;
  min-width: 0;
  border-radius: 12px;
  border: 1px solid var(--cs-border);
  background: var(--cs-surface-muted);
  padding: 0.55rem 0.75rem;
  font-size: 0.8125rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  color: var(--cs-text);
  cursor: text;
}

.settings-readonly-input:focus {
  outline: 2px solid rgba(0, 159, 227, 0.35);
  outline-offset: 1px;
  border-color: var(--cs-brand);
  background: var(--cs-surface);
}

.settings-readonly-row__action {
  flex-shrink: 0;
  padding: 0.5rem 0.9rem;
}

.settings-notifications__intro {
  margin: 0 0 0.85rem;
}

.settings-notifications__hint {
  margin-top: 0.5rem;
}

.settings-toggle-list {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.settings-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  min-height: 2.5rem;
  padding: 0.2rem 0;
  border-bottom: 1px solid var(--cs-border-subtle);
}

.settings-toggle-row:last-child {
  border-bottom: 0;
}

.settings-toggle-row__label {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--cs-text);
}

.settings-switch {
  position: relative;
  box-sizing: border-box;
  width: 2.75rem;
  height: 1.55rem;
  padding: 0;
  border: 1px solid var(--cs-border-hover);
  border-radius: 999px;
  background: var(--cs-border);
  cursor: pointer;
  flex-shrink: 0;
  transition: background-color 140ms ease, border-color 140ms ease;
}

.settings-switch__thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 1.2rem;
  height: 1.2rem;
  border-radius: 999px;
  background: var(--cs-surface);
  box-shadow: 0 1px 2px var(--cs-shadow-thumb);
  transition: transform 140ms ease;
}

.settings-switch--on {
  background: var(--cs-brand);
  border-color: var(--cs-brand);
}

.settings-switch--on .settings-switch__thumb {
  transform: translateX(1.15rem);
}

.settings-switch:hover:not(:disabled) {
  border-color: var(--cs-brand);
}

.settings-switch:focus-visible {
  outline: 2px solid var(--cs-focus-ring);
  outline-offset: 2px;
}

.settings-switch:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.settings-subsection {
  margin-top: 1rem;
  padding: 0.85rem 0.9rem;
  border-radius: 12px;
  border: 1px solid var(--cs-border);
  background: var(--cs-surface-muted);
}

.settings-subsection__head {
  margin-bottom: 0.65rem;
}

.settings-subsection__title {
  margin: 0;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--cs-text);
}

.settings-subsection__head .settings-card__help {
  margin-top: 0.25rem;
}

.settings-subsection__head .settings-muted {
  margin-top: 0.35rem;
}

.settings-whatsapp-row {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.settings-whatsapp-row__input {
  background: var(--cs-surface);
}

.settings-whatsapp-row__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.settings-segmented {
  display: inline-flex;
  flex-wrap: wrap;
  padding: 0.2rem;
  border-radius: 12px;
  border: 1px solid var(--cs-border);
  background: var(--cs-surface-muted);
  gap: 0.15rem;
}

.settings-segmented__btn {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--cs-text-secondary);
  font-size: 0.8125rem;
  font-weight: 600;
  padding: 0.45rem 0.95rem;
  border-radius: 10px;
  cursor: pointer;
  transition: background-color 140ms ease, color 140ms ease;
}

.settings-segmented__btn:hover:not(:disabled) {
  color: var(--cs-text);
  background: var(--cs-segmented-hover);
}

.settings-segmented__btn--active {
  background: var(--cs-surface);
  color: var(--cs-brand-dark);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}

.settings-segmented__btn:focus-visible {
  outline: 2px solid var(--cs-focus-ring);
  outline-offset: 1px;
}

.settings-segmented__btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.settings-signout {
  display: flex;
  align-items: center;
  justify-content: flex-start;
}

.settings-signout__btn {
  min-width: 8rem;
}

@media (max-width: 640px) {
  .settings-card {
    padding: 1rem 1rem;
  }

  .settings-account__org {
    width: 100%;
  }

  .settings-readonly-row__action {
    width: 100%;
  }

  .settings-tags__row {
    align-items: flex-start;
  }

  .settings-tags__actions {
    width: 100%;
    justify-content: flex-end;
  }
}

/* Shared task create/edit dialog (Package 1) */
.app-modal.task-form-dialog {
  max-width: 36rem;
}

.task-form-section {
  margin-top: 0.85rem;
  padding: 0.85rem 1rem;
  border-radius: 12px;
  border: 1px solid var(--cs-border);
  background: var(--cs-surface-elevated);
}

.task-form-section__title {
  margin: 0 0 0.75rem;
  font-size: 0.9375rem;
}

/* Task detail redesign — layout only; surfaces come from .settings-card / .app-btn */
.task-detail-page {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.task-detail-header {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.task-detail-actions,
.task-action-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.task-detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
}

.task-detail-card {
  min-width: 0;
}

@media (min-width: 1024px) {
  .task-detail-grid {
    grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.65fr);
    align-items: start;
  }
}

.task-detail-header__metadata {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.task-detail-overflow {
  position: relative;
}

.task-detail-overflow__menu {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  z-index: 40;
  min-width: 14rem;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 8px;
  border-radius: 12px;
  border: 1px solid var(--cs-border);
  background: var(--cs-surface);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

.task-detail-overflow__menu .app-btn {
  width: 100%;
  justify-content: flex-start;
}

.task-action-group > .app-btn,
.task-action-group > * > .app-btn {
  min-height: 40px;
  border-radius: 12px;
  font-weight: 600;
}

.task-action-group .app-btn svg {
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
}

@media (max-width: 639px) {
  .task-action-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
  .task-action-group > .app-btn--primary {
    grid-column: 1 / -1;
  }
  .task-action-group > .task-detail-overflow {
    grid-column: 1 / -1;
  }
}


.settings-ai-model-selector {
  width: 100%;
}

.settings-ai-model-selector .settings-segmented__btn {
  flex: 1 1 0;
  min-width: 8.5rem;
}

.settings-ai-current-model {
  margin: 0.55rem 0 0;
}

.settings-ai-current-model strong {
  color: var(--cs-text);
}

.settings-ai-price-list {
  display: grid;
  gap: 0.5rem;
  margin: 0 0 0.8rem;
}

.settings-ai-price-row {
  display: grid;
  grid-template-columns: minmax(10rem, 1.4fr) minmax(9rem, 1fr) minmax(9rem, 1fr);
  gap: 0.65rem;
  align-items: center;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--cs-border);
  border-radius: 10px;
  background: var(--cs-surface);
  color: var(--cs-text-secondary);
  font-size: 0.8125rem;
}

.settings-ai-price-row__model {
  color: var(--cs-text);
  font-weight: 600;
  overflow-wrap: anywhere;
}

.settings-ai-price-row b {
  color: var(--cs-text);
  font-weight: 600;
}

.settings-ai-pricing-form {
  display: grid;
  grid-template-columns: minmax(12rem, 1.3fr) minmax(9rem, 1fr) minmax(9rem, 1fr);
  gap: 0.65rem;
  align-items: end;
  padding-top: 0.25rem;
}

.settings-ai-pricing-form .app-field {
  min-width: 0;
}

.settings-ai-pricing-form__action {
  grid-column: 1 / -1;
  display: flex;
  justify-content: flex-end;
}

.settings-ai-pricing-form__action .app-btn {
  min-width: 11rem;
}

.settings-subsection[data-testid="settings-ai-pricing-section"] > .settings-subsection__head:not(:first-child) {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--cs-border);
}

@media (max-width: 760px) {
  .settings-ai-model-selector {
    display: grid;
    grid-template-columns: 1fr;
  }

  .settings-ai-model-selector .settings-segmented__btn {
    width: 100%;
    min-width: 0;
  }

  .settings-ai-price-row,
  .settings-ai-pricing-form {
    grid-template-columns: 1fr;
  }

  .settings-ai-price-row {
    gap: 0.3rem;
  }

  .settings-ai-pricing-form__action {
    grid-column: 1;
    justify-content: stretch;
  }

  .settings-ai-pricing-form__action .app-btn {
    width: 100%;
  }
}


.settings-cost-grid {
  display: grid;
  grid-template-columns: minmax(14rem, 1.4fr) minmax(7rem, 0.6fr) minmax(8rem, 0.7fr);
  gap: 0.65rem;
  align-items: end;
}

.settings-cost-grid--rates {
  grid-template-columns: repeat(4, minmax(9rem, 1fr));
  margin-top: 0.75rem;
}

.settings-cost-fallback-toggle {
  margin-top: 0.75rem;
}

.settings-cost-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 0.75rem;
}

.settings-ai-model-select {
  display: block;
  max-width: 24rem;
  margin-bottom: 0.85rem;
}

.settings-ai-price-row {
  grid-template-columns: minmax(10rem, 1.3fr) repeat(3, minmax(8rem, 1fr));
}

.settings-ai-price-row--active {
  border-color: var(--cs-brand);
  background: var(--cs-active-bg);
}

.settings-ai-pricing-source {
  margin: 0.65rem 0 0;
}

@media (max-width: 900px) {
  .settings-cost-grid,
  .settings-cost-grid--rates {
    grid-template-columns: 1fr 1fr;
  }

  .settings-ai-price-row {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 640px) {
  .settings-cost-grid,
  .settings-cost-grid--rates,
  .settings-ai-price-row {
    grid-template-columns: 1fr;
  }

  .settings-cost-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .settings-cost-actions .app-btn,
  .settings-ai-model-select {
    width: 100%;
    max-width: none;
  }
}
